Try _very_ hard to ensure that y is a compile time constant by forcing gcc to inline. For some reason if I have __attribute__((always_inline)) without the inline keyword, it does not inline correctly.

This commit is contained in:
Steve Checkoway
2005-12-29 10:00:43 +00:00
parent c580fc15ef
commit 811e488bb5
+2
View File
@@ -287,12 +287,14 @@ template<> inline word32 rotrMod<word32>(word32 x, unsigned int y)
# include <ppc_intrinsics.h>
#endif
template<> inline word32 rotlFixed<word32>(word32 x, const unsigned int y) __attribute__((always_inline));
template<> inline word32 rotlFixed<word32>(word32 x, const unsigned int y)
{
assert(y < 32);
return y ? __rlwinm(x,y,0,31) : x;
}
template<> inline word32 rotrFixed<word32>(word32 x, const unsigned int y) __attribute__((always_inline));
template<> inline word32 rotrFixed<word32>(word32 x, const unsigned int y)
{
assert(y < 32);