aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/CellSPU/trunc.ll
diff options
context:
space:
mode:
authorScott Michel <scottm@aero.org>2009-03-16 18:47:25 +0000
committerScott Michel <scottm@aero.org>2009-03-16 18:47:25 +0000
commit6e1d1470c2c637ecce5e5ac1da358ecabdc1f7e3 (patch)
tree4b563a9a331b14307a65d5c161c5fbf38703929a /test/CodeGen/CellSPU/trunc.ll
parent56cb12c9a72ce5c5dbee4c77c49f312b6a4c7fa0 (diff)
downloadexternal_llvm-6e1d1470c2c637ecce5e5ac1da358ecabdc1f7e3.zip
external_llvm-6e1d1470c2c637ecce5e5ac1da358ecabdc1f7e3.tar.gz
external_llvm-6e1d1470c2c637ecce5e5ac1da358ecabdc1f7e3.tar.bz2
CellSPU:
Incorporate Tilmann's 128-bit operation patch. Evidently, it gets the llvm-gcc bootstrap a bit further along. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/CellSPU/trunc.ll')
-rw-r--r--test/CodeGen/CellSPU/trunc.ll120
1 files changed, 69 insertions, 51 deletions
diff --git a/test/CodeGen/CellSPU/trunc.ll b/test/CodeGen/CellSPU/trunc.ll
index 1c6e1f6..db22564 100644
--- a/test/CodeGen/CellSPU/trunc.ll
+++ b/test/CodeGen/CellSPU/trunc.ll
@@ -1,76 +1,94 @@
; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep shufb %t1.s | count 10
+; RUN: grep shufb %t1.s | count 19
; RUN: grep {ilhu.*1799} %t1.s | count 1
-; RUN: grep {ilhu.*771} %t1.s | count 1
+; RUN: grep {ilhu.*771} %t1.s | count 2
; RUN: grep {ilhu.*1543} %t1.s | count 1
; RUN: grep {ilhu.*1029} %t1.s | count 1
-; RUN: grep {ilhu.*515} %t1.s | count 2
-; RUN: grep xsbh %t1.s | count 2
-; RUN: grep sfh %t1.s | count 1
+; RUN: grep {ilhu.*515} %t1.s | count 1
+; RUN: grep {ilhu.*3855} %t1.s | count 1
+; RUN: grep {ilhu.*3599} %t1.s | count 1
+; RUN: grep {ilhu.*3085} %t1.s | count 1
+; RUN: grep {iohl.*3855} %t1.s | count 1
+; RUN: grep {iohl.*3599} %t1.s | count 2
+; RUN: grep {iohl.*1543} %t1.s | count 2
+; RUN: grep {iohl.*771} %t1.s | count 2
+; RUN: grep {iohl.*515} %t1.s | count 1
+; RUN: grep {iohl.*1799} %t1.s | count 1
+; RUN: grep lqa %t1.s | count 1
+; RUN: grep cbd %t1.s | count 4
+; RUN: grep chd %t1.s | count 3
+; RUN: grep cwd %t1.s | count 1
+; RUN: grep cdd %t1.s | count 1
; ModuleID = 'trunc.bc'
target datalayout = "E-p:32:32:128-i1:8:128-i8:8:128-i16:16:128-i32:32:128-i64:32:128-f32:32:128-f64:64:128-v64:64:64-v128:128:128-a0:0:128-s0:128:128"
target triple = "spu"
-; codegen for i128 arguments is not implemented yet on CellSPU
-; once this changes uncomment the functions below
-; and update the expected results accordingly
+define <16 x i8> @trunc_i128_i8(i128 %u, <16 x i8> %v) {
+entry:
+ %0 = trunc i128 %u to i8
+ %tmp1 = insertelement <16 x i8> %v, i8 %0, i32 15
+ ret <16 x i8> %tmp1
+}
-;define i8 @trunc_i128_i8(i128 %u) nounwind readnone {
-;entry:
-; %0 = trunc i128 %u to i8
-; ret i8 %0
-;}
-;define i16 @trunc_i128_i16(i128 %u) nounwind readnone {
-;entry:
-; %0 = trunc i128 %u to i16
-; ret i16 %0
-;}
-;define i32 @trunc_i128_i32(i128 %u) nounwind readnone {
-;entry:
-; %0 = trunc i128 %u to i32
-; ret i32 %0
-;}
-;define i64 @trunc_i128_i64(i128 %u) nounwind readnone {
-;entry:
-; %0 = trunc i128 %u to i64
-; ret i64 %0
-;}
+define <8 x i16> @trunc_i128_i16(i128 %u, <8 x i16> %v) {
+entry:
+ %0 = trunc i128 %u to i16
+ %tmp1 = insertelement <8 x i16> %v, i16 %0, i32 8
+ ret <8 x i16> %tmp1
+}
-define <16 x i8> @trunc_i64_i8(i64 %u, <16 x i8> %v) nounwind readnone {
+define <4 x i32> @trunc_i128_i32(i128 %u, <4 x i32> %v) {
entry:
- %0 = trunc i64 %u to i8
- %tmp1 = insertelement <16 x i8> %v, i8 %0, i32 10
- ret <16 x i8> %tmp1
+ %0 = trunc i128 %u to i32
+ %tmp1 = insertelement <4 x i32> %v, i32 %0, i32 2
+ ret <4 x i32> %tmp1
}
-define <8 x i16> @trunc_i64_i16(i64 %u, <8 x i16> %v) nounwind readnone {
+
+define <2 x i64> @trunc_i128_i64(i128 %u, <2 x i64> %v) {
entry:
- %0 = trunc i64 %u to i16
- %tmp1 = insertelement <8 x i16> %v, i16 %0, i32 6
- ret <8 x i16> %tmp1
+ %0 = trunc i128 %u to i64
+ %tmp1 = insertelement <2 x i64> %v, i64 %0, i32 1
+ ret <2 x i64> %tmp1
}
-define i32 @trunc_i64_i32(i64 %u, i32 %v) nounwind readnone {
+
+define <16 x i8> @trunc_i64_i8(i64 %u, <16 x i8> %v) {
entry:
- %0 = trunc i64 %u to i32
- ret i32 %0
+ %0 = trunc i64 %u to i8
+ %tmp1 = insertelement <16 x i8> %v, i8 %0, i32 10
+ ret <16 x i8> %tmp1
}
-define i8 @trunc_i32_i8(i32 %u, i8 %v) nounwind readnone {
+define <8 x i16> @trunc_i64_i16(i64 %u, <8 x i16> %v) {
entry:
- %0 = trunc i32 %u to i8
- %1 = sub i8 %0, %v
- ret i8 %1
+ %0 = trunc i64 %u to i16
+ %tmp1 = insertelement <8 x i16> %v, i16 %0, i32 6
+ ret <8 x i16> %tmp1
}
-define <8 x i16> @trunc_i32_i16(i32 %u, <8 x i16> %v) nounwind readnone {
+
+define i32 @trunc_i64_i32(i64 %u) {
+entry:
+ %0 = trunc i64 %u to i32
+ ret i32 %0
+}
+
+define <16 x i8> @trunc_i32_i8(i32 %u, <16 x i8> %v) {
+entry:
+ %0 = trunc i32 %u to i8
+ %tmp1 = insertelement <16 x i8> %v, i8 %0, i32 7
+ ret <16 x i8> %tmp1
+}
+
+define <8 x i16> @trunc_i32_i16(i32 %u, <8 x i16> %v) {
entry:
- %0 = trunc i32 %u to i16
- %tmp1 = insertelement <8 x i16> %v, i16 %0, i32 3
- ret <8 x i16> %tmp1
+ %0 = trunc i32 %u to i16
+ %tmp1 = insertelement <8 x i16> %v, i16 %0, i32 3
+ ret <8 x i16> %tmp1
}
-define <16 x i8> @trunc_i16_i8(i16 %u, <16 x i8> %v) nounwind readnone {
+define <16 x i8> @trunc_i16_i8(i16 %u, <16 x i8> %v) {
entry:
- %0 = trunc i16 %u to i8
- %tmp1 = insertelement <16 x i8> %v, i8 %0, i32 5
- ret <16 x i8> %tmp1
+ %0 = trunc i16 %u to i8
+ %tmp1 = insertelement <16 x i8> %v, i8 %0, i32 5
+ ret <16 x i8> %tmp1
}