< prev index next >

src/os_cpu/solaris_x86/vm/bytes_solaris_x86.inline.hpp

Print this page
rev 13069 : imported patch Remove_GNU_SOURCE

*** 59,116 **** inline u8 Bytes::swap_u8_base(u4 x, u4 y) { return _raw_swap_u8(x, y); } #endif // !AMD64 - - #ifdef _GNU_SOURCE - - extern "C" { - #ifdef AMD64 - inline u2 _raw_swap_u2(u2 x) { - register unsigned short int __dest; - __asm__ ("rorw $8, %w0": "=r" (__dest): "0" (x): "cc"); - return __dest; - } - inline u4 _raw_swap_u4(u4 x) { - register unsigned int __dest; - __asm__ ("bswap %0" : "=r" (__dest) : "0" (x)); - return __dest; - } - inline u8 _raw_swap_u8(u8 x) { - register unsigned long __dest; - __asm__ ("bswap %q0" : "=r" (__dest) : "0" (x)); - return __dest; - } - #else - inline u2 _raw_swap_u2(u2 x) { - u2 ret; - __asm__ __volatile__ ( - "movw %0, %%ax;" - "xchg %%al, %%ah;" - "movw %%ax, %0" - :"=r" (ret) // output : register 0 => ret - :"0" (x) // input : x => register 0 - :"ax", "0" // clobbered registers - ); - return ret; - } - - inline u4 _raw_swap_u4(u4 x) { - u4 ret; - __asm__ __volatile__ ( - "bswap %0" - :"=r" (ret) // output : register 0 => ret - :"0" (x) // input : x => register 0 - :"0" // clobbered register - ); - return ret; - } - - inline u8 _raw_swap_u8(u4 x, u4 y) { - return (((u8)_raw_swap_u4(x))<<32) | _raw_swap_u4(y); - } - #endif // AMD64 - } - #endif //_GNU_SOURCE - #endif // OS_CPU_SOLARIS_X86_VM_BYTES_SOLARIS_X86_INLINE_HPP --- 59,64 ----
< prev index next >