summaryrefslogtreecommitdiffstats
path: root/firmware/target/sh
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-01-30 00:58:45 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-01-30 00:58:45 +0000
commit18770dac2e560c88daa3ca9944917be561c3548f (patch)
tree5adf8aef7cb7999a6e07ddefcbb9e1d9bf18a15c /firmware/target/sh
parentc0c769c5a86c56c2ab2c9e88515a64da98575182 (diff)
downloadrockbox-18770dac2e560c88daa3ca9944917be561c3548f.tar.gz
rockbox-18770dac2e560c88daa3ca9944917be561c3548f.tar.bz2
rockbox-18770dac2e560c88daa3ca9944917be561c3548f.zip
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
Diffstat (limited to 'firmware/target/sh')
-rw-r--r--firmware/target/sh/system-target.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/target/sh/system-target.h b/firmware/target/sh/system-target.h
index a84ce07af9..1693a132a6 100644
--- a/firmware/target/sh/system-target.h
+++ b/firmware/target/sh/system-target.h
@@ -77,7 +77,7 @@ static inline void enable_irq(void)
#define restore_irq(i) \
((void)set_irq_level(i))
-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];
@@ -88,7 +88,7 @@ static inline uint16_t swap16(uint16_t value)
return result;
}
-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];
@@ -99,7 +99,7 @@ static inline uint32_t SWAW32(uint32_t value)
return result;
}
-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];
@@ -113,7 +113,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]