[llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/rlwinm.ll
Jim Laskey
jlaskey at apple.com
Thu Aug 11 16:00:24 PDT 2005
Changes in directory llvm/test/Regression/CodeGen/PowerPC/rlwinm.ll
rlwinm.ll: 1.2 -> 1.3
---
Log message:
1. Changed the tests to guarantee that only rlwinm instructions are
generated.
Test Cases
==========
int %test6(int %a) {
entry:
%tmp.1 = and int %a, 65280 ; <int> [#uses=1]
%tmp.2 = shr int %tmp.1, ubyte 8 ; <uint> [#uses=1]
ret int %tmp.2
}
uint %test7(uint %a) {
entry:
%tmp.1 = and uint %a, 65280 ; <uint> [#uses=1]
%tmp.2 = shr uint %tmp.1, ubyte 8 ; <uint> [#uses=1]
ret uint %tmp.2
}
int %test8(int %a) {
entry:
%tmp.1 = and int %a, 16711680 ; <int> [#uses=1]
%tmp.2 = shl int %tmp.1, ubyte 8 ; <int> [#uses=1]
ret int %tmp.2
}
Old Result
==========
.text
.align 2
.globl _test6
_test6:
.LBB_test6_0: ; entry
rlwinm r2, r3, 0, 16, 23
srawi r3, r2, 8
blr
.text
.align 2
.globl _test7
_test7:
.LBB_test7_0: ; entry
rlwinm r2, r3, 0, 16, 23
srwi r3, r2, 8
blr
.text
.align 2
.globl _test8
_test8:
.LBB_test8_0: ; entry
rlwinm r2, r3, 0, 8, 15
slwi r3, r2, 8
blr
New Result
==========
.text
.align 2
.globl _test6
_test6:
.LBB_test6_0: ; entry
rlwinm r3, r3, 24, 24, 31
blr
.text
.align 2
.globl _test7
_test7:
.LBB_test7_0: ; entry
rlwinm r3, r3, 24, 24, 31
blr
.text
.align 2
.globl _test8
_test8:
.LBB_test8_0: ; entry
rlwinm r3, r3, 8, 0, 7
blr
---
Diffs of the changes: (+3 -0)
PPC32ISelPattern.cpp
1 files changed, 3 insertions(+), 0 deletions(-)
Index: test/Regression/CodeGen/PowerPC/rlwinm.ll
===================================================================
RCS file: /var/cvs/llvm/llvm/test/Regression/CodeGen/PowerPC/rlwinm.ll,v
retrieving revision 1.2
diff -u -d -b -w -r1.2 rlwinm.ll
--- test/Regression/CodeGen/PowerPC/rlwinm.ll 9 Aug 2005 20:24:16
-0000 1.2
+++ test/Regression/CodeGen/PowerPC/rlwinm.ll 11 Aug 2005 21:48:56
-0000
@@ -1,5 +1,8 @@
; All of these ands and shifts should be folded into rlwimi's
; RUN: llvm-as < rlwinm.ll | llc -march=ppc32 | not grep and &&
+; RUN: llvm-as < rlwinm.ll | llc -march=ppc32 | not grep srawi &&
+; RUN: llvm-as < rlwinm.ll | llc -march=ppc32 | not grep srwi &&
+; RUN: llvm-as < rlwinm.ll | llc -march=ppc32 | not grep slwi &&
; RUN: llvm-as < rlwinm.ll | llc -march=ppc32 | grep rlwinm | wc -l |
grep 8
More information about the llvm-commits
mailing list