[llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/and_sext.ll and_sra.ll extsh.ll
Nate Begeman
natebegeman at mac.com
Fri Feb 17 13:22:20 PST 2006
Changes in directory llvm/test/Regression/CodeGen/PowerPC:
and_sext.ll added (r1.1)
and_sra.ll added (r1.1)
extsh.ll added (r1.1)
---
Log message:
New tests!
---
Diffs of the changes: (+34 -0)
and_sext.ll | 9 +++++++++
and_sra.ll | 18 ++++++++++++++++++
extsh.ll | 7 +++++++
3 files changed, 34 insertions(+)
Index: llvm/test/Regression/CodeGen/PowerPC/and_sext.ll
diff -c /dev/null llvm/test/Regression/CodeGen/PowerPC/and_sext.ll:1.1
*** /dev/null Fri Feb 17 15:22:18 2006
--- llvm/test/Regression/CodeGen/PowerPC/and_sext.ll Fri Feb 17 15:22:08 2006
***************
*** 0 ****
--- 1,9 ----
+ ; This test should not contain a sign extend
+ ; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsh
+
+ int %test(uint %mode.0.i.0) {
+ %tmp.79 = cast uint %mode.0.i.0 to short ; <sbyte> [#uses=1]
+ %tmp.80 = cast short %tmp.79 to int ; <int> [#uses=1]
+ %tmp.81 = and int %tmp.80, 24 ; <int> [#uses=1]
+ ret int %tmp.81
+ }
Index: llvm/test/Regression/CodeGen/PowerPC/and_sra.ll
diff -c /dev/null llvm/test/Regression/CodeGen/PowerPC/and_sra.ll:1.1
*** /dev/null Fri Feb 17 15:22:20 2006
--- llvm/test/Regression/CodeGen/PowerPC/and_sra.ll Fri Feb 17 15:22:08 2006
***************
*** 0 ****
--- 1,18 ----
+ ; Neither of these functions should contain algebraic right shifts
+ ; RUN: llvm-as < %s | llc -march=ppc32 | not grep srawi
+
+ int %test1(uint %mode.0.i.0) {
+ %tmp.79 = cast uint %mode.0.i.0 to int ; <sbyte> [#uses=1]
+ %tmp.80 = shr int %tmp.79, ubyte 15 ; <int> [#uses=1]
+ %tmp.81 = and int %tmp.80, 24 ; <int> [#uses=1]
+ ret int %tmp.81
+ }
+
+ int %test2(uint %mode.0.i.0) {
+ %tmp.79 = cast uint %mode.0.i.0 to int ; <sbyte> [#uses=1]
+ %tmp.80 = shr int %tmp.79, ubyte 15 ; <int> [#uses=1]
+ %tmp.81 = shr uint %mode.0.i.0, ubyte 16
+ %tmp.82 = cast uint %tmp.81 to int
+ %tmp.83 = and int %tmp.80, %tmp.82 ; <int> [#uses=1]
+ ret int %tmp.83
+ }
Index: llvm/test/Regression/CodeGen/PowerPC/extsh.ll
diff -c /dev/null llvm/test/Regression/CodeGen/PowerPC/extsh.ll:1.1
*** /dev/null Fri Feb 17 15:22:20 2006
--- llvm/test/Regression/CodeGen/PowerPC/extsh.ll Fri Feb 17 15:22:08 2006
***************
*** 0 ****
--- 1,7 ----
+ ; This should turn into a single extsh
+ ; RUN: llvm-as < %s | llc -march=ppc32 | grep extsh | wc -l | grep 1
+ int %test(int %X) {
+ %tmp.81 = shl int %X, ubyte 16 ; <int> [#uses=1]
+ %tmp.82 = shr int %tmp.81, ubyte 16 ; <int> [#uses=1]
+ ret int %tmp.82
+ }
More information about the llvm-commits
mailing list