http://llvm.org/bugs/show_bug.cgi?id=8148
Summary: Inefficient code generated for rotate idiom
Product: libraries
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: Scalar Optimizations
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Reported by helmut on IRC.
clang compiles this code:
#define ROTL(v, s) (((v) << (s))|((v) >> (32-(s))))
uint32_t foo(uint32_t a) { return ROTL(a + 0xd76aa478, 7); }
into a shift/or sequence instead of the more efficient "rol" instruction on
x86. Removing the addition or turning ROTL into an inline function produces the
expected result.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs