[llvm-commits] CVS: llvm/test/CodeGen/Generic/bit-intrinsics.ll
Reid Spencer
reid at x10sys.com
Mon Apr 16 14:53:17 PDT 2007
Changes in directory llvm/test/CodeGen/Generic:
bit-intrinsics.ll updated: 1.2 -> 1.3
---
Log message:
Also validate that the code generation of IntrinsicLowering for LLI works.
---
Diffs of the changes: (+25 -6)
bit-intrinsics.ll | 31 +++++++++++++++++++++++++------
1 files changed, 25 insertions(+), 6 deletions(-)
Index: llvm/test/CodeGen/Generic/bit-intrinsics.ll
diff -u llvm/test/CodeGen/Generic/bit-intrinsics.ll:1.2 llvm/test/CodeGen/Generic/bit-intrinsics.ll:1.3
--- llvm/test/CodeGen/Generic/bit-intrinsics.ll:1.2 Thu Apr 5 17:57:45 2007
+++ llvm/test/CodeGen/Generic/bit-intrinsics.ll Mon Apr 16 16:52:56 2007
@@ -1,15 +1,34 @@
; Make sure this testcase is supported by all code generators. Either the
; intrinsic is supported natively or IntrinsicLowering provides it.
-; RUN: llvm-as < %s | llc
+; RUN: llvm-as < %s > %t.bc
+; RUN: lli --force-interpreter=true %t.bc
+; RUN: llc %t.bc -o /dev/null -f
; XFAIL: *
+declare i32 @llvm.part.set.i32.i32.i32(i32 %x, i32 %rep, i32 %hi, i32 %lo)
+declare i16 @llvm.part.set.i16.i16.i16(i16 %x, i16 %rep, i32 %hi, i32 %lo)
+define i32 @test_part_set(i32 %A, i16 %B) {
+ %a = call i32 @llvm.part.set.i32.i32.i32(i32 %A, i32 27, i32 8, i32 0)
+ %b = call i16 @llvm.part.set.i16.i16.i16(i16 %B, i16 27, i32 8, i32 0)
+ %c = zext i16 %b to i32
+ %d = add i32 %a, %c
+ ret i32 %d
+}
-declare i32 @llvm.bit.part.select.i32.i32(i32 %x, i32 %hi, i32 %lo)
-declare i16 @llvm.bit.part.select.i16.i16(i16 %x, i32 %hi, i32 %lo)
-define i32 @bit_part_select(i32 %A, i16 %B) {
- %a = call i32 @llvm.bit.part.select.i32.i32(i32 %A, i32 8, i32 0)
- %b = call i16 @llvm.bit.part.select.i16.i16(i16 %B, i32 8, i32 0)
+declare i32 @llvm.part.select.i32.i32(i32 %x, i32 %hi, i32 %lo)
+declare i16 @llvm.part.select.i16.i16(i16 %x, i32 %hi, i32 %lo)
+define i32 @test_part_select(i32 %A, i16 %B) {
+ %a = call i32 @llvm.part.select.i32.i32(i32 %A, i32 8, i32 0)
+ %b = call i16 @llvm.part.select.i16.i16(i16 %B, i32 8, i32 0)
%c = zext i16 %b to i32
%d = add i32 %a, %c
ret i32 %d
}
+
+define i32 @main(i32 %argc, i8** %argv) {
+ %a = call i32 @test_part_set(i32 23, i16 57)
+ %b = call i32 @test_part_select(i32 23, i16 57)
+ %c = add i32 %a, %b
+ %d = urem i32 %c, 1
+ ret i32 %d
+}
More information about the llvm-commits
mailing list