]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Evaluating htons() at compile time is more efficient than doing ntohs()
authorMarko Zec <zec@FreeBSD.org>
Wed, 19 Jun 2019 08:39:19 +0000 (08:39 +0000)
committerAlexander Motin <mav@FreeBSD.org>
Thu, 7 Jan 2021 17:41:12 +0000 (12:41 -0500)
commit896ccd678d1837f7c39b4c0a617a081f2c168443
treede7d61c3153a0b89aea6fec45fd2f0e885fdf372
parentacaac0eefa1f2675dfc49faa077e3fb10949d540
Evaluating htons() at compile time is more efficient than doing ntohs()
at runtime.  This change removes a dependency on a barrel shifter pass
before branch resolution, while reducing the instruction stream size
by 9 bytes on amd64.

(cherry picked from commit 6aee0bfa85685017dbc5050ce36793f7dcd80f82)
sys/net/iflib.c