From 18770dac2e560c88daa3ca9944917be561c3548f Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sun, 30 Jan 2011 00:58:45 +0000 Subject: Use __builtin_constant_p() to select the best byteswapping method: constant or target optimized. Same macro can then be used for constant values and inits as well as non-constant. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29171 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/coldfire/system-target.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'firmware/target/coldfire') diff --git a/firmware/target/coldfire/system-target.h b/firmware/target/coldfire/system-target.h index 2de8fd06c2..d1a2a1f115 100644 --- a/firmware/target/coldfire/system-target.h +++ b/firmware/target/coldfire/system-target.h @@ -132,7 +132,7 @@ static inline void restore_irq(int oldlevel) asm volatile ("move.w %0, %%sr" : : "d"(oldlevel)); } -static inline uint16_t swap16(uint16_t value) +static inline uint16_t swap16_hw(uint16_t value) /* result[15..8] = value[ 7..0]; result[ 7..0] = value[15..8]; @@ -141,7 +141,7 @@ static inline uint16_t swap16(uint16_t value) return (value >> 8) | (value << 8); } -static inline uint32_t SWAW32(uint32_t value) +static inline uint32_t swaw32_hw(uint32_t value) /* result[31..16] = value[15.. 0]; result[15.. 0] = value[31..16]; @@ -151,7 +151,7 @@ static inline uint32_t SWAW32(uint32_t value) return value; } -static inline uint32_t swap32(uint32_t value) +static inline uint32_t swap32_hw(uint32_t value) /* result[31..24] = value[ 7.. 0]; result[23..16] = value[15.. 8]; @@ -174,7 +174,7 @@ static inline uint32_t swap32(uint32_t value) return value; } -static inline uint32_t swap_odd_even32(uint32_t value) +static inline uint32_t swap_odd_even32_hw(uint32_t value) { /* result[31..24],[15.. 8] = value[23..16],[ 7.. 0] -- cgit v1.2.3