diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 18:34:38 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 18:34:38 +0000 |
| commit | 69156b4c20249e7800cc09e0eef0beb3d15ac1ad (patch) | |
| tree | 461d3cf041290f4a99740d540bf0973d6084f98e /test/CodeGen/PowerPC | |
| parent | ee8648bdac07986a0f1ec897b02ec82a2f144d46 (diff) | |
Notes
Diffstat (limited to 'test/CodeGen/PowerPC')
| -rw-r--r-- | test/CodeGen/PowerPC/fp2int2fp-ppcfp128.ll | 16 | ||||
| -rw-r--r-- | test/CodeGen/PowerPC/ppc64-patchpoint.ll | 15 | ||||
| -rw-r--r-- | test/CodeGen/PowerPC/pr24216.ll | 14 | ||||
| -rw-r--r-- | test/CodeGen/PowerPC/vec_shuffle_le.ll | 2 | ||||
| -rw-r--r-- | test/CodeGen/PowerPC/vsx.ll | 69 | ||||
| -rw-r--r-- | test/CodeGen/PowerPC/vsx_insert_extract_le.ll | 8 | ||||
| -rw-r--r-- | test/CodeGen/PowerPC/xvcmpeqdp-v2f64.ll | 38 |
7 files changed, 122 insertions, 40 deletions
diff --git a/test/CodeGen/PowerPC/fp2int2fp-ppcfp128.ll b/test/CodeGen/PowerPC/fp2int2fp-ppcfp128.ll new file mode 100644 index 000000000000..7742ffe33150 --- /dev/null +++ b/test/CodeGen/PowerPC/fp2int2fp-ppcfp128.ll @@ -0,0 +1,16 @@ +; RUN: llc -mcpu=a2 < %s | FileCheck %s +target datalayout = "E-m:e-i64:64-n32:64" +target triple = "powerpc64-bgq-linux" + +define linkonce_odr double @test1() { +entry: + %conv6.i.i = fptosi ppc_fp128 undef to i64 + %conv.i = sitofp i64 %conv6.i.i to double + ret double %conv.i + +; CHECK-LABEL: @test1 +; CHECK: bl __fixtfdi +; CHECK: fcfid +; CHECK: blr +} + diff --git a/test/CodeGen/PowerPC/ppc64-patchpoint.ll b/test/CodeGen/PowerPC/ppc64-patchpoint.ll index 53b737ae9a0b..d10ea98cd1a7 100644 --- a/test/CodeGen/PowerPC/ppc64-patchpoint.ll +++ b/test/CodeGen/PowerPC/ppc64-patchpoint.ll @@ -103,6 +103,21 @@ entry: ret void } +; Trivial symbolic patchpoint codegen. + +declare i64 @foo(i64 %p1, i64 %p2) +define i64 @trivial_symbolic_patchpoint_codegen(i64 %p1, i64 %p2) { +entry: +; CHECK-LABEL: trivial_symbolic_patchpoint_codegen: +; CHECK: bl foo +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NOT: nop +; CHECK: blr + %result = tail call i64 (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.i64(i64 9, i32 12, i8* bitcast (i64 (i64, i64)* @foo to i8*), i32 2, i64 %p1, i64 %p2) + ret i64 %result +} + declare void @llvm.experimental.stackmap(i64, i32, ...) declare void @llvm.experimental.patchpoint.void(i64, i32, i8*, i32, ...) declare i64 @llvm.experimental.patchpoint.i64(i64, i32, i8*, i32, ...) diff --git a/test/CodeGen/PowerPC/pr24216.ll b/test/CodeGen/PowerPC/pr24216.ll new file mode 100644 index 000000000000..4ab41985f5b1 --- /dev/null +++ b/test/CodeGen/PowerPC/pr24216.ll @@ -0,0 +1,14 @@ +; RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s + +; Test case adapted from PR24216. + +define void @foo(<16 x i8>* nocapture readonly %in, <16 x i8>* nocapture %out) { +entry: + %0 = load <16 x i8>, <16 x i8>* %in, align 16 + %1 = shufflevector <16 x i8> %0, <16 x i8> undef, <16 x i32> <i32 2, i32 3, i32 4, i32 5, i32 2, i32 3, i32 4, i32 5, i32 2, i32 3, i32 4, i32 5, i32 2, i32 3, i32 4, i32 5> + store <16 x i8> %1, <16 x i8>* %out, align 16 + ret void +} + +; CHECK: vperm +; CHECK-NOT: vspltw diff --git a/test/CodeGen/PowerPC/vec_shuffle_le.ll b/test/CodeGen/PowerPC/vec_shuffle_le.ll index 46d451ff1573..65c47ada8750 100644 --- a/test/CodeGen/PowerPC/vec_shuffle_le.ll +++ b/test/CodeGen/PowerPC/vec_shuffle_le.ll @@ -202,7 +202,7 @@ entry: ; CHECK: VSLDOI_xx: %tmp = load <16 x i8>, <16 x i8>* %A %tmp2 = shufflevector <16 x i8> %tmp, <16 x i8> %tmp, <16 x i32> <i32 12, i32 13, i32 14, i32 15, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11> -; CHECK: vsldoi +; CHECK: vsldoi {{[0-9]+}}, [[REG1:[0-9]+]], [[REG1]], 4 store <16 x i8> %tmp2, <16 x i8>* %A ret void } diff --git a/test/CodeGen/PowerPC/vsx.ll b/test/CodeGen/PowerPC/vsx.ll index f85acebeea67..dceb2516c696 100644 --- a/test/CodeGen/PowerPC/vsx.ll +++ b/test/CodeGen/PowerPC/vsx.ll @@ -70,10 +70,10 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test5 -; CHECK-FISL: vor 4, 2, 2 -; CHECK-FISL: vor 5, 3, 3 -; CHECK-FISL: xxlxor 36, 36, 37 -; CHECK-FISL: vor 2, 4, 4 +; CHECK-FISL: vor +; CHECK-FISL: vor +; CHECK-FISL: xxlxor +; CHECK-FISL: vor 2 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test5 @@ -133,10 +133,10 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test8 -; CHECK-FISL: vor 4, 2, 2 -; CHECK-FISL: vor 5, 3, 3 -; CHECK-FISL: xxlor 36, 36, 37 -; CHECK-FISL: vor 2, 4, 4 +; CHECK-FISL: vor +; CHECK-FISL: vor +; CHECK-FISL: xxlor +; CHECK-FISL: vor 2 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test8 @@ -196,10 +196,10 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test11 -; CHECK-FISL: vor 4, 2, 2 -; CHECK-FISL: vor 5, 3, 3 -; CHECK-FISL: xxland 36, 36, 37 -; CHECK-FISL: vor 2, 4, 4 +; CHECK-FISL: vor +; CHECK-FISL: vor +; CHECK-FISL: xxland +; CHECK-FISL: vor 2 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test11 @@ -260,17 +260,14 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test14 -; CHECK-FISL: vor 4, 2, 2 -; CHECK-FISL: vor 5, 3, 3 -; CHECK-FISL: xxlor 36, 36, 37 -; CHECK-FISL: vor 0, 4, 4 -; CHECK-FISL: vor 4, 2, 2 -; CHECK-FISL: vor 5, 3, 3 -; CHECK-FISL: xxlnor 36, 36, 37 +; CHECK-FISL: vor 4, 3, 3 +; CHECK-FISL: vor 5, 2, 2 +; CHECK-FISL: xxlor 0, 37, 36 +; CHECK-FISL: xxlnor 36, 37, 36 ; CHECK-FISL: vor 2, 4, 4 ; CHECK-FISL: lis 0, -1 ; CHECK-FISL: ori 0, 0, 65520 -; CHECK-FISL: stvx 0, 1, 0 +; CHECK-FISL: stxvd2x 0, 1, 0 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test14 @@ -347,15 +344,13 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test17 -; CHECK-FISL: vspltisb 4, -1 -; CHECK-FISL: vor 5, 3, 3 -; CHECK-FISL: vor 0, 4, 4 -; CHECK-FISL: xxlxor 37, 37, 32 -; CHECK-FISL: vor 3, 5, 5 +; CHECK-FISL: vor 4, 3, 3 ; CHECK-FISL: vor 5, 2, 2 -; CHECK-FISL: vor 0, 3, 3 -; CHECK-FISL: xxland 37, 37, 32 -; CHECK-FISL: vor 2, 5, 5 +; CHECK-FISL: vspltisb 2, -1 +; CHECK-FISL: vor 0, 2, 2 +; CHECK-FISL: xxlxor 36, 36, 32 +; CHECK-FISL: xxland 36, 37, 36 +; CHECK-FISL: vor 2, 4, 4 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test17 @@ -434,12 +429,18 @@ entry: ; CHECK-REG: xxsel 34, 35, 34, {{[0-9]+}} ; CHECK-REG: blr +; FIXME: The fast-isel code is pretty miserable for this one. + ; CHECK-FISL-LABEL: @test20 -; CHECK-FISL: vcmpequw 4, 4, 5 -; CHECK-FISL: vor 0, 3, 3 -; CHECK-FISL: vor 1, 2, 2 -; CHECK-FISL: vor 6, 4, 4 -; CHECK-FISL: xxsel 32, 32, 33, 38 +; CHECK-FISL: vor 0, 5, 5 +; CHECK-FISL: vor 1, 4, 4 +; CHECK-FISL: vor 6, 3, 3 +; CHECK-FISL: vor 7, 2, 2 +; CHECK-FISL: vor 2, 1, 1 +; CHECK-FISL: vor 3, 0, 0 +; CHECK-FISL: vcmpequw 2, 2, 3 +; CHECK-FISL: vor 0, 2, 2 +; CHECK-FISL: xxsel 32, 38, 39, 32 ; CHECK-FISL: vor 2, 0, 0 ; CHECK-FISL: blr @@ -794,8 +795,6 @@ define <4 x i32> @test34(<4 x i32>* %a) { ; CHECK-FISL-LABEL: @test34 ; CHECK-FISL: lxvw4x 0, 0, 3 ; CHECK-FISL: xxlor 34, 0, 0 -; CHECK-FISL: vor 3, 2, 2 -; CHECK-FISL: vor 2, 3, 3 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test34 diff --git a/test/CodeGen/PowerPC/vsx_insert_extract_le.ll b/test/CodeGen/PowerPC/vsx_insert_extract_le.ll index 84bbdd75b0f7..6c89b1092bdf 100644 --- a/test/CodeGen/PowerPC/vsx_insert_extract_le.ll +++ b/test/CodeGen/PowerPC/vsx_insert_extract_le.ll @@ -8,9 +8,9 @@ define <2 x double> @testi0(<2 x double>* %p1, double* %p2) { ; CHECK-LABEL: testi0 ; CHECK: lxvd2x 0, 0, 3 -; CHECK: lxsdx 34, 0, 4 +; CHECK: lxsdx 1, 0, 4 ; CHECK: xxswapd 0, 0 -; CHECK: xxspltd 1, 34, 0 +; CHECK: xxspltd 1, 1, 0 ; CHECK: xxpermdi 34, 0, 1, 1 } @@ -22,9 +22,9 @@ define <2 x double> @testi1(<2 x double>* %p1, double* %p2) { ; CHECK-LABEL: testi1 ; CHECK: lxvd2x 0, 0, 3 -; CHECK: lxsdx 34, 0, 4 +; CHECK: lxsdx 1, 0, 4 ; CHECK: xxswapd 0, 0 -; CHECK: xxspltd 1, 34, 0 +; CHECK: xxspltd 1, 1, 0 ; CHECK: xxmrgld 34, 1, 0 } diff --git a/test/CodeGen/PowerPC/xvcmpeqdp-v2f64.ll b/test/CodeGen/PowerPC/xvcmpeqdp-v2f64.ll new file mode 100644 index 000000000000..ef63233e746b --- /dev/null +++ b/test/CodeGen/PowerPC/xvcmpeqdp-v2f64.ll @@ -0,0 +1,38 @@ +; RUN: llc < %s | FileCheck %s +target datalayout = "e-m:e-i64:64-n32:64" +target triple = "powerpc64le-unknown-linux-gnu" + +; Function Attrs: nounwind +define void @__fmax_double3_3D_exec() #0 { +entry: + br i1 undef, label %if.then.i, label %fmax_double3.exit + +if.then.i: ; preds = %entry + %cmp24.i.i = fcmp ord <3 x double> undef, zeroinitializer + %sext25.i.i = sext <3 x i1> %cmp24.i.i to <3 x i64> + %neg.i.i = xor <3 x i64> %sext25.i.i, <i64 -1, i64 -1, i64 -1> + %or.i.i = or <3 x i64> undef, %neg.i.i + %neg.i.i.i = select <3 x i1> undef, <3 x i64> zeroinitializer, <3 x i64> %sext25.i.i + %and.i.i.i = and <3 x i64> undef, %neg.i.i.i + %and26.i.i.i = and <3 x i64> undef, %or.i.i + %or.i.i.i = or <3 x i64> %and.i.i.i, %and26.i.i.i + %astype32.i.i.i = bitcast <3 x i64> %or.i.i.i to <3 x double> + %extractVec33.i.i.i = shufflevector <3 x double> %astype32.i.i.i, <3 x double> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 undef> + store <4 x double> %extractVec33.i.i.i, <4 x double>* undef, align 32 + br label %fmax_double3.exit + +; CHECK-LABEL: @__fmax_double3_3D_exec +; CHECK: xvcmpeqdp + +fmax_double3.exit: ; preds = %if.then.i, %entry + br i1 undef, label %if.then, label %do.end + +if.then: ; preds = %fmax_double3.exit + unreachable + +do.end: ; preds = %fmax_double3.exit + ret void +} + +attributes #0 = { nounwind } + |
