OpenSolaris

Printable Version Enter a New Search
Bug ID 6729208
Synopsis Optimize BSWAP_* and BE_* macros in sys/byteorder.h to use inline amd64 assembly
State 10-Fix Delivered (Fix available in build)
Category:Subcategory kernel:header
Keywords SFO
Responsible Engineer Daniel Anderson
Reported Against snv_94
Duplicate Of
Introduced In solaris_10
Commit to Fix snv_99
Fixed In snv_99
Release Fixed solaris_nevada(snv_99)
Related Bugs 4758470 , 5007142 , 6729215 , 6753574
Submit Date 24-July-2008
Last Update Date 24-September-2008
Description
Optimize the BSWAP_8, 16, 32, 64 and BE_8, 16, 32, and 64 #define macros in sys/byteorder.h to use inline amd64 assembly.

For SPARC and x86 32-bit, the current macros can still be used.

This is similar to CR 5007142, where ntohll() and htonll() (also in byteorder.h) are implemented with inline assembly.

The inline assembly differs between the Sun and GNU C compilers--see 5007142.

Another issue is signed/unsigned integer conversion.  These aren't problems with #define macros, but could generate problems when a function is called and a signed integer is passed to a function that returns a unsigned integer.

See also CR 4760705 to avoid namespace pollution with these (nonstandard) macros.
Work Around
N/A
Comments
N/A