diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-21 17:22:14 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-21 17:22:14 +0000 |
commit | 8e9c9ec8e47866c116d29dd4e2ee0b40bbbe6b00 (patch) | |
tree | 477aaed9ef0fb4a9601cf50f8af1ee92c0fbd832 /pack.c | |
parent | 6503d883124d8193c3adf485ebe1977fb2503a29 (diff) |
* bignum.c (bary_pack): Specialized packers implemented.
(HOST_BIGENDIAN_P): New macro.
(ALIGNOF): New macro.
(CLEAR_LOWBITS): New macro.
(FILL_LOWBITS): New macro.
(swap_bdigit): New macro.
(bary_2comp): Returns an int.
* internal.h (swap16): Moved from pack.c
(swap32): Ditto.
(swap64): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r-- | pack.c | 37 |
1 files changed, 0 insertions, 37 deletions
@@ -100,43 +100,6 @@ TOKEN_PASTE(swap,x)(xtype z) \ return r; \ } -#ifndef swap32 -# if GCC_VERSION_SINCE(4,3,0) -# define swap32(x) __builtin_bswap32(x) -# endif -#endif - -#ifndef swap64 -# if GCC_VERSION_SINCE(4,3,0) -# define swap64(x) __builtin_bswap64(x) -# endif -#endif - -#ifndef swap16 -# define swap16(x) ((uint16_t)((((x)&0xFF)<<8) | (((x)>>8)&0xFF))) -#endif - -#ifndef swap32 -# define swap32(x) ((uint32_t)((((x)&0xFF)<<24) \ - |(((x)>>24)&0xFF) \ - |(((x)&0x0000FF00)<<8) \ - |(((x)&0x00FF0000)>>8) )) -#endif - -#ifndef swap64 -# ifdef HAVE_INT64_T -# define byte_in_64bit(n) ((uint64_t)0xff << (n)) -# define swap64(x) ((uint64_t)((((x)&byte_in_64bit(0))<<56) \ - |(((x)>>56)&0xFF) \ - |(((x)&byte_in_64bit(8))<<40) \ - |(((x)&byte_in_64bit(48))>>40) \ - |(((x)&byte_in_64bit(16))<<24) \ - |(((x)&byte_in_64bit(40))>>24) \ - |(((x)&byte_in_64bit(24))<<8) \ - |(((x)&byte_in_64bit(32))>>8))) -# endif -#endif - #if SIZEOF_SHORT == 2 # define swaps(x) swap16(x) #elif SIZEOF_SHORT == 4 |