[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/shift-double.llx
Chris Lattner
lattner at cs.uiuc.edu
Tue Jan 18 22:30:48 PST 2005
Changes in directory llvm/test/Regression/CodeGen/X86:
shift-double.llx added (r1.1)
---
Log message:
Ensure that each these functions generates a sh[rl]d instruction.
---
Diffs of the changes: (+22 -0)
Index: llvm/test/Regression/CodeGen/X86/shift-double.llx
diff -c /dev/null llvm/test/Regression/CodeGen/X86/shift-double.llx:1.1
*** /dev/null Wed Jan 19 00:30:46 2005
--- llvm/test/Regression/CodeGen/X86/shift-double.llx Wed Jan 19 00:30:36 2005
***************
*** 0 ****
--- 1,22 ----
+ ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel -disable-pattern-isel=0 | grep sh[lr]d | wc -l | grep 4
+
+ long %test1(long %X, ubyte %C) {
+ %Y = shl long %X, ubyte %C
+ ret long %Y
+ }
+ long %test2(long %X, ubyte %C) {
+ %Y = shr long %X, ubyte %C
+ ret long %Y
+ }
+ ulong %test3(ulong %X, ubyte %C) {
+ %Y = shr ulong %X, ubyte %C
+ ret ulong %Y
+ }
+
+ uint %test4(uint %A, uint %B, ubyte %C) {
+ %X = shl uint %A, ubyte %C
+ %Cv = sub ubyte 32, %C
+ %Y = shr uint %B, ubyte %Cv
+ %Z = or uint %Y, %X
+ ret uint %Z
+ }
More information about the llvm-commits
mailing list