diff options
author | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2016-10-04 06:59:23 +0000 |
---|---|---|
committer | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2016-10-04 06:59:23 +0000 |
commit | 11049f8f07330c30c689d54ed91d63909b360cf2 (patch) | |
tree | a70b349635cb8c9c5d445cc77595f2794e5e0dc4 /llvm/test/CodeGen/PowerPC | |
parent | 6b929d5ba91eec2acd6f47c6921ce0dff9a94cd6 (diff) | |
download | bcm5719-llvm-11049f8f07330c30c689d54ed91d63909b360cf2.tar.gz bcm5719-llvm-11049f8f07330c30c689d54ed91d63909b360cf2.zip |
[Power9] Part-word VSX integer scalar loads/stores and sign extend instructions
This patch corresponds to review:
https://reviews.llvm.org/D23155
This patch removes the VSHRC register class (based on D20310) and adds
exploitation of the Power9 sub-word integer loads into VSX registers as well
as vector sign extensions.
The new instructions are useful for a few purposes:
Int to Fp conversions of 1 or 2-byte values loaded from memory
Building vectors of 1 or 2-byte integers with values loaded from memory
Storing individual 1 or 2-byte elements from integer vectors
This patch implements all of those uses.
llvm-svn: 283190
Diffstat (limited to 'llvm/test/CodeGen/PowerPC')
-rw-r--r-- | llvm/test/CodeGen/PowerPC/inline-asm-scalar-to-vector-error.ll | 3 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/load-v4i8-improved.ll | 14 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/machine-combiner.ll | 4 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/p8-scalar_vector_conversions.ll | 7 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/power9-moves-and-splats.ll | 12 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/ppc64-i128-abi.ll | 9 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/select-i1-vs-i1.ll | 97 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/sjlj.ll | 8 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/vsx-args.ll | 21 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/vsx-infl-copy1.ll | 10 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/vsx-p8.ll | 6 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/vsx-partword-int-loads-and-stores.ll | 1132 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/vsx-spill-norwstore.ll | 4 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/vsx-vec-spill.ll | 34 | ||||
-rw-r--r-- | llvm/test/CodeGen/PowerPC/vsx.ll | 184 |
15 files changed, 1307 insertions, 238 deletions
diff --git a/llvm/test/CodeGen/PowerPC/inline-asm-scalar-to-vector-error.ll b/llvm/test/CodeGen/PowerPC/inline-asm-scalar-to-vector-error.ll index 3f1d9d32bec..cdcf9ba797d 100644 --- a/llvm/test/CodeGen/PowerPC/inline-asm-scalar-to-vector-error.ll +++ b/llvm/test/CodeGen/PowerPC/inline-asm-scalar-to-vector-error.ll @@ -7,8 +7,5 @@ define hidden void @f(i32 %x) { ; CHECK: scalar-to-vector conversion failed, possible invalid constraint for vector type tail call void asm sideeffect "nop", "{vsl1}"(i32 %x) nounwind - ; CHECK: scalar-to-vector conversion failed, possible invalid constraint for vector type - tail call void asm sideeffect "nop", "{vsh1}"(i32 %x) nounwind - ret void } diff --git a/llvm/test/CodeGen/PowerPC/load-v4i8-improved.ll b/llvm/test/CodeGen/PowerPC/load-v4i8-improved.ll index 45ed30d0c93..36f347222d5 100644 --- a/llvm/test/CodeGen/PowerPC/load-v4i8-improved.ll +++ b/llvm/test/CodeGen/PowerPC/load-v4i8-improved.ll @@ -1,8 +1,7 @@ ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck \ ; RUN: -implicit-check-not vmrg -implicit-check-not=vperm %s ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck \ -; RUN: -implicit-check-not vmrg -implicit-check-not=vperm %s \ -; RUN: --check-prefix=CHECK-BE +; RUN: -implicit-check-not vmrg -implicit-check-not=vperm %s define <16 x i8> @test(i32* %s, i32* %t) { entry: @@ -11,13 +10,6 @@ entry: %2 = shufflevector <4 x i8> %1, <4 x i8> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3> ret <16 x i8> %2 ; CHECK-LABEL: test -; CHECK: lwz [[GPR:[0-9]+]], 0(3) -; CHECK: mtvsrd [[VSR:[0-9]+]], [[GPR]] -; CHECK: xxswapd [[SWP:[0-9]+]], [[VSR]] -; CHECK: xxspltw 34, [[SWP]], 3 -; CHECK-BE-LABEL: test -; CHECK-BE: lwz [[GPR:[0-9]+]], 0(3) -; CHECK-BE: sldi [[SHL:[0-9]+]], [[GPR]], 32 -; CHECK-BE: mtvsrd [[VSR:[0-9]+]], [[SHL]] -; CHECK-BE: xxspltw 34, [[VSR]], 0 +; CHECK: lxsiwax 34, 0, 3 +; CHECK: xxspltw 34, 34, 1 } diff --git a/llvm/test/CodeGen/PowerPC/machine-combiner.ll b/llvm/test/CodeGen/PowerPC/machine-combiner.ll index 5e097b61b78..e026017710e 100644 --- a/llvm/test/CodeGen/PowerPC/machine-combiner.ll +++ b/llvm/test/CodeGen/PowerPC/machine-combiner.ll @@ -98,7 +98,6 @@ define <4 x float> @vector_reassociate_adds1(<4 x float> %x0, <4 x float> %x1, < ; CHECK-PWR: xvaddsp [[REG0:[0-9]+]], 34, 35 ; CHECK-PWR: xvaddsp [[REG1:[0-9]+]], 36, 37 ; CHECK-PWR: xvaddsp 34, [[REG0]], [[REG1]] -; CHECK-PWR: # kill ; CHECK-NEXT: blr %t0 = fadd <4 x float> %x0, %x1 @@ -116,7 +115,6 @@ define <4 x float> @vector_reassociate_adds2(<4 x float> %x0, <4 x float> %x1, < ; CHECK-PWR: xvaddsp [[REG0:[0-9]+]], 34, 35 ; CHECK-PWR: xvaddsp [[REG1:[0-9]+]], 36, 37 ; CHECK-PWR: xvaddsp 34, [[REG0]], [[REG1]] -; CHECK-PWR: # kill ; CHECK-NEXT: blr %t0 = fadd <4 x float> %x0, %x1 @@ -134,7 +132,6 @@ define <4 x float> @vector_reassociate_adds3(<4 x float> %x0, <4 x float> %x1, < ; CHECK-PWR: xvaddsp [[REG0:[0-9]+]], 34, 35 ; CHECK-PWR: xvaddsp [[REG1:[0-9]+]], 36, 37 ; CHECK-PWR: xvaddsp 34, [[REG0]], [[REG1]] -; CHECK-PWR: # kill ; CHECK-NEXT: blr %t0 = fadd <4 x float> %x0, %x1 @@ -152,7 +149,6 @@ define <4 x float> @vector_reassociate_adds4(<4 x float> %x0, <4 x float> %x1, < ; CHECK-PWR: xvaddsp [[REG0:[0-9]+]], 34, 35 ; CHECK-PWR: xvaddsp [[REG1:[0-9]+]], 36, 37 ; CHECK-PWR: xvaddsp 34, [[REG0]], [[REG1]] -; CHECK-PWR: # kill ; CHECK-NEXT: blr %t0 = fadd <4 x float> %x0, %x1 diff --git a/llvm/test/CodeGen/PowerPC/p8-scalar_vector_conversions.ll b/llvm/test/CodeGen/PowerPC/p8-scalar_vector_conversions.ll index b3451843133..979dd4b5d02 100644 --- a/llvm/test/CodeGen/PowerPC/p8-scalar_vector_conversions.ll +++ b/llvm/test/CodeGen/PowerPC/p8-scalar_vector_conversions.ll @@ -63,7 +63,7 @@ entry: ret <2 x i64> %splat.splat ; CHECK: mtvsrd {{[0-9]+}}, 3 ; CHECK-LE: mtvsrd [[REG1:[0-9]+]], 3 -; CHECK-LE: xxspltd [[REG1]], [[REG1]], 0 +; CHECK-LE: xxspltd 34, [[REG1]], 0 } ; Function Attrs: nounwind @@ -75,9 +75,10 @@ entry: %splat.splatinsert = insertelement <4 x float> undef, float %0, i32 0 %splat.splat = shufflevector <4 x float> %splat.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer ret <4 x float> %splat.splat -; CHECK: xscvdpspn {{[0-9]+}}, 1 +; CHECK: xscvdpspn [[REG1:[0-9]+]], 1 +; CHECK: xxspltw 34, [[REG1]] ; CHECK-LE: xscvdpspn [[REG1:[0-9]+]], 1 -; CHECK-LE: xxsldwi {{[0-9]+}}, [[REG1]], [[REG1]], 1 +; CHECK-LE: xxspltw 34, [[REG1]] } ; The optimization to remove stack operations from PPCDAGToDAGISel::Select diff --git a/llvm/test/CodeGen/PowerPC/power9-moves-and-splats.ll b/llvm/test/CodeGen/PowerPC/power9-moves-and-splats.ll index 89e09625a14..fa4f0320c92 100644 --- a/llvm/test/CodeGen/PowerPC/power9-moves-and-splats.ll +++ b/llvm/test/CodeGen/PowerPC/power9-moves-and-splats.ll @@ -7,10 +7,18 @@ define <2 x i64> @test1(i64 %a, i64 %b) { entry: +; The FIXME below is due to the lowering for BUILD_VECTOR needing a re-vamp +; which will happen in a subsequent patch. ; CHECK-LABEL: test1 -; CHECK: mtvsrdd 34, 4, 3 +; FIXME: mtvsrdd 34, 4, 3 +; CHECK: mtvsrd {{[0-9]+}}, 3 +; CHECK: mtvsrd {{[0-9]+}}, 4 +; CHECK: xxmrgld ; CHECK-BE-LABEL: test1 -; CHECK-BE: mtvsrdd 34, 3, 4 +; FIXME-BE: mtvsrdd 34, 3, 4 +; CHECK-BE: mtvsrd {{[0-9]+}}, 4 +; CHECK-BE: mtvsrd {{[0-9]+}}, 3 +; CHECK-BE: xxmrghd %vecins = insertelement <2 x i64> undef, i64 %a, i32 0 %vecins1 = insertelement <2 x i64> %vecins, i64 %b, i32 1 ret <2 x i64> %vecins1 diff --git a/llvm/test/CodeGen/PowerPC/ppc64-i128-abi.ll b/llvm/test/CodeGen/PowerPC/ppc64-i128-abi.ll index d81a1104c53..924e04a34a9 100644 --- a/llvm/test/CodeGen/PowerPC/ppc64-i128-abi.ll +++ b/llvm/test/CodeGen/PowerPC/ppc64-i128-abi.ll @@ -55,9 +55,12 @@ define <1 x i128> @v1i128_increment_by_one(<1 x i128> %a) nounwind { ; CHECK-LE: blr ; CHECK-P9-LABEL: @v1i128_increment_by_one -; CHECK-P9-DAG: li [[R1:r[0-9]+]], 1 -; CHECK-P9-DAG: li [[R2:r[0-9]+]], 0 -; CHECK-P9: mtvsrdd [[V1:v[0-9]+]], [[R2]], [[R1]] +; The below FIXME is due to the lowering for BUILD_VECTOR that will be fixed +; in a subsequent patch. +; FIXME: li [[R1:r[0-9]+]], 1 +; FIXME: li [[R2:r[0-9]+]], 0 +; FIXME: mtvsrdd [[V1:v[0-9]+]], [[R2]], [[R1]] +; CHECK-P9: lxvx [[V1:v[0-9]+]] ; CHECK-P9: vadduqm v2, v2, [[V1]] ; CHECK-P9: blr diff --git a/llvm/test/CodeGen/PowerPC/select-i1-vs-i1.ll b/llvm/test/CodeGen/PowerPC/select-i1-vs-i1.ll index 8bceb9f779a..a8f1ef1dd28 100644 --- a/llvm/test/CodeGen/PowerPC/select-i1-vs-i1.ll +++ b/llvm/test/CodeGen/PowerPC/select-i1-vs-i1.ll @@ -714,18 +714,12 @@ entry: %cond = select i1 %cmp3, <4 x float> %a1, <4 x float> %a2 ret <4 x float> %cond -; FIXME: This test (and the other v4f32 tests) should use the same bclr -; technique as the v2f64 tests below. - ; CHECK-LABEL: @testv4floatslt ; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4 ; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2 -; CHECK-DAG: xxlor [[REG2:[0-9]+]], 34, 34 -; CHECK-DAG: crandc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} -; CHECK: bc 12, [[REG1]], .LBB[[BB:[0-9_]+]] -; CHECK: xxlor [[REG2]], 35, 35 -; CHECK: .LBB[[BB]]: -; CHECK: xxlor 34, [[REG2]], [[REG2]] +; CHECK: crandc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} +; CHECK: bclr 12, [[REG1]], 0 +; CHECK: vor 2, 3, 3 ; CHECK: blr } @@ -740,12 +734,9 @@ entry: ; CHECK-LABEL: @testv4floatult ; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4 ; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2 -; CHECK-DAG: xxlor [[REG2:[0-9]+]], 34, 34 -; CHECK-DAG: crandc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} -; CHECK: bc 12, [[REG1]], .LBB[[BB:[0-9_]+]] -; CHECK: xxlor [[REG2]], 35, 35 -; CHECK: .LBB[[BB]]: -; CHECK: xxlor 34, [[REG2]], [[REG2]] +; CHECK: crandc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} +; CHECK: bclr 12, [[REG1]], 0 +; CHECK: vor 2, 3, 3 ; CHECK: blr } @@ -760,12 +751,9 @@ entry: ; CHECK-LABEL: @testv4floatsle ; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4 ; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2 -; CHECK-DAG: xxlor [[REG2:[0-9]+]], 34, 34 -; CHECK-DAG: crorc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} -; CHECK: bc 12, [[REG1]], .LBB[[BB:[0-9_]+]] -; CHECK: xxlor [[REG2]], 35, 35 -; CHECK: .LBB[[BB]]: -; CHECK: xxlor 34, [[REG2]], [[REG2]] +; CHECK: crorc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} +; CHECK: bclr 12, [[REG1]], 0 +; CHECK: vor 2, 3, 3 ; CHECK: blr } @@ -780,12 +768,9 @@ entry: ; CHECK-LABEL: @testv4floatule ; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4 ; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2 -; CHECK-DAG: xxlor [[REG2:[0-9]+]], 34, 34 -; CHECK-DAG: crorc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} -; CHECK: bc 12, [[REG1]], .LBB[[BB:[0-9_]+]] -; CHECK: xxlor [[REG2]], 35, 35 -; CHECK: .LBB[[BB]]: -; CHECK: xxlor 34, [[REG2]], [[REG2]] +; CHECK: crorc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} +; CHECK: bclr 12, [[REG1]], 0 +; CHECK: vor 2, 3, 3 ; CHECK: blr } @@ -800,12 +785,11 @@ entry: ; CHECK-LABEL: @testv4floateq ; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4 ; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2 -; CHECK-DAG: xxlor [[REG2:[0-9]+]], 35, 35 -; CHECK-DAG: crxor [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} -; CHECK: bc 12, [[REG1]], .LBB[[BB:[0-9_]+]] -; CHECK: xxlor [[REG2]], 34, 34 -; CHECK: .LBB[[BB]]: -; CHECK: xxlor 34, [[REG2]], [[REG2]] +; CHECK: crxor [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} +; CHECK: bc 12, [[REG1]], .LBB[[BB1:[0-9_]+]] +; CHECK: vor 3, 2, 2 +; CHECK: .LBB[[BB1]] +; CHECK: vor 2, 3, 3 ; CHECK: blr } @@ -820,12 +804,9 @@ entry: ; CHECK-LABEL: @testv4floatsge ; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4 ; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2 -; CHECK-DAG: xxlor [[REG2:[0-9]+]], 34, 34 -; CHECK-DAG: crorc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} -; CHECK: bc 12, [[REG1]], .LBB[[BB:[0-9_]+]] -; CHECK: xxlor [[REG2]], 35, 35 -; CHECK: .LBB[[BB]]: -; CHECK: xxlor 34, [[REG2]], [[REG2]] +; CHECK: crorc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} +; CHECK: bclr 12, [[REG1]], 0 +; CHECK: vor 2, 3, 3 ; CHECK: blr } @@ -840,12 +821,9 @@ entry: ; CHECK-LABEL: @testv4floatuge ; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4 ; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2 -; CHECK-DAG: xxlor [[REG2:[0-9]+]], 34, 34 -; CHECK-DAG: crorc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} -; CHECK: bc 12, [[REG1]], .LBB[[BB:[0-9_]+]] -; CHECK: xxlor [[REG2]], 35, 35 -; CHECK: .LBB[[BB]]: -; CHECK: xxlor 34, [[REG2]], [[REG2]] +; CHECK: crorc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} +; CHECK: bclr 12, [[REG1]], 0 +; CHECK: vor 2, 3, 3 ; CHECK: blr } @@ -860,12 +838,9 @@ entry: ; CHECK-LABEL: @testv4floatsgt ; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4 ; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2 -; CHECK-DAG: xxlor [[REG2:[0-9]+]], 34, 34 -; CHECK-DAG: crandc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} -; CHECK: bc 12, [[REG1]], .LBB[[BB:[0-9_]+]] -; CHECK: xxlor [[REG2]], 35, 35 -; CHECK: .LBB[[BB]]: -; CHECK: xxlor 34, [[REG2]], [[REG2]] +; CHECK: crandc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} +; CHECK: bclr 12, [[REG1]], 0 +; CHECK: vor 2, 3, 3 ; CHECK: blr } @@ -880,12 +855,9 @@ entry: ; CHECK-LABEL: @testv4floatugt ; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4 ; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2 -; CHECK-DAG: xxlor [[REG2:[0-9]+]], 34, 34 -; CHECK-DAG: crandc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} -; CHECK: bc 12, [[REG1]], .LBB[[BB:[0-9_]+]] -; CHECK: xxlor [[REG2]], 35, 35 -; CHECK: .LBB[[BB]]: -; CHECK: xxlor 34, [[REG2]], [[REG2]] +; CHECK: crandc [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} +; CHECK: bclr 12, [[REG1]], 0 +; CHECK: vor 2, 3, 3 ; CHECK: blr } @@ -900,12 +872,9 @@ entry: ; CHECK-LABEL: @testv4floatne ; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4 ; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2 -; CHECK-DAG: xxlor [[REG2:[0-9]+]], 34, 34 -; CHECK-DAG: crxor [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} -; CHECK: bc 12, [[REG1]], .LBB[[BB:[0-9_]+]] -; CHECK: xxlor [[REG2]], 35, 35 -; CHECK: .LBB[[BB]]: -; CHECK: xxlor 34, [[REG2]], [[REG2]] +; CHECK: crxor [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}} +; CHECK: bclr 12, [[REG1]], 0 +; CHECK: vor 2, 3, 3 ; CHECK: blr } @@ -1023,7 +992,7 @@ entry: ; CHECK: bc 12, [[REG1]], .LBB[[BB55:[0-9_]+]] ; CHECK: vor 3, 2, 2 ; CHECK: .LBB[[BB55]] -; CHECK: xxlor 34, 35, 35 +; CHECK: vor 2, 3, 3 ; CHECK: blr } diff --git a/llvm/test/CodeGen/PowerPC/sjlj.ll b/llvm/test/CodeGen/PowerPC/sjlj.ll index 8c6682ca706..7fe31384675 100644 --- a/llvm/test/CodeGen/PowerPC/sjlj.ll +++ b/llvm/test/CodeGen/PowerPC/sjlj.ll @@ -66,7 +66,7 @@ return: ; preds = %if.end, %if.then ; CHECK-NOT: mfspr ; CHECK-DAG: stfd -; CHECK-DAG: stvx +; CHECK-DAG: stxvd2x ; CHECK-DAG: addis [[REG:[0-9]+]], 2, env_sigill@toc@ha ; CHECK-DAG: std 31, env_sigill@toc@l([[REG]]) @@ -82,7 +82,7 @@ return: ; preds = %if.end, %if.then ; CHECK: .LBB1_4: ; CHECK: lfd -; CHECK: lvx +; CHECK: lxvd2x ; CHECK: ld ; CHECK: blr @@ -93,11 +93,11 @@ return: ; preds = %if.end, %if.then ; CHECK: li 3, 0 ; CHECK-NOAV: @main -; CHECK-NOAV-NOT: stvx +; CHECK-NOAV-NOT: stxvd2x ; CHECK-NOAV: bcl ; CHECK-NOAV: mflr ; CHECK-NOAV: bl foo -; CHECK-NOAV-NOT: lvx +; CHECK-NOAV-NOT: lxvd2x ; CHECK-NOAV: blr } diff --git a/llvm/test/CodeGen/PowerPC/vsx-args.ll b/llvm/test/CodeGen/PowerPC/vsx-args.ll index 650cd0e951d..252f9b360b9 100644 --- a/llvm/test/CodeGen/PowerPC/vsx-args.ll +++ b/llvm/test/CodeGen/PowerPC/vsx-args.ll @@ -1,5 +1,6 @@ ; RUN: llc -verify-machineinstrs < %s -mcpu=pwr7 -mattr=+vsx | FileCheck %s -; RUN: llc -verify-machineinstrs < %s -mcpu=pwr7 -mattr=+vsx -fast-isel -O0 | FileCheck %s +; RUN: llc -verify-machineinstrs < %s -mcpu=pwr7 -mattr=+vsx -fast-isel -O0 | \ +; RUN: FileCheck -check-prefix=CHECK-FISL %s target datalayout = "E-m:e-i64:64-n32:64" target triple = "powerpc64-unknown-linux-gnu" @@ -13,13 +14,23 @@ entry: ; CHECK-LABEL: @main ; CHECK-DAG: vor [[V:[0-9]+]], 2, 2 -; CHECK-DAG: xxlor 34, 35, 35 -; CHECK-DAG: xxlor 35, 36, 36 +; CHECK-DAG: vor 2, 3, 3 +; CHECK-DAG: vor 3, 4, 4 ; CHECK-DAG: vor 4, [[V]], [[V]] -; CHECK-DAG: bl sv -; CHECK-DAG: lxvd2x [[VC:[0-9]+]], +; CHECK: bl sv +; CHECK: lxvd2x [[VC:[0-9]+]], ; CHECK: xvadddp 34, 34, [[VC]] ; CHECK: blr + +; CHECK-FISL-LABEL: @main +; CHECK-FISL: stxvd2x 34 +; CHECK-FISL: vor 2, 3, 3 +; CHECK-FISL: vor 3, 4, 4 +; CHECK-FISL: lxvd2x 36 +; CHECK-FISL: bl sv +; CHECK-FISL: lxvd2x [[VC:[0-9]+]], +; CHECK-FISL: xvadddp 34, 34, [[VC]] +; CHECK-FISL: blr } attributes #0 = { noinline nounwind readnone } diff --git a/llvm/test/CodeGen/PowerPC/vsx-infl-copy1.ll b/llvm/test/CodeGen/PowerPC/vsx-infl-copy1.ll index 24ea6087adf..592f85e2bca 100644 --- a/llvm/test/CodeGen/PowerPC/vsx-infl-copy1.ll +++ b/llvm/test/CodeGen/PowerPC/vsx-infl-copy1.ll @@ -11,7 +11,15 @@ entry: br label %vector.body ; CHECK-LABEL: @_Z8example9Pj -; CHECK: xxlor +; CHECK: vor +; CHECK: vor +; CHECK: vor +; CHECK: vor +; CHECK: vor +; CHECK: vor +; CHECK: vor +; CHECK: vor +; CHECK: vor vector.body: ; preds = %vector.body, %entry %index = phi i64 [ 0, %entry ], [ %index.next, %vector.body ] diff --git a/llvm/test/CodeGen/PowerPC/vsx-p8.ll b/llvm/test/CodeGen/PowerPC/vsx-p8.ll index 7836803affa..f42eb6ab0d7 100644 --- a/llvm/test/CodeGen/PowerPC/vsx-p8.ll +++ b/llvm/test/CodeGen/PowerPC/vsx-p8.ll @@ -34,8 +34,7 @@ define <4 x float> @test32u(<4 x float>* %a) { ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test32u -; CHECK-FISL: lxvw4x 0, 0, 3 -; CHECK-FISL: xxlor 34, 0, 0 +; CHECK-FISL: lxvw4x 34, 0, 3 ; CHECK-FISL: blr } @@ -48,8 +47,7 @@ define void @test33u(<4 x float>* %a, <4 x float> %b) { ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test33u -; CHECK-FISL: vor 3, 2, 2 -; CHECK-FISL: stxvw4x 35, 0, 3 +; CHECK-FISL: stxvw4x 34, 0, 3 ; CHECK-FISL: blr } diff --git a/llvm/test/CodeGen/PowerPC/vsx-partword-int-loads-and-stores.ll b/llvm/test/CodeGen/PowerPC/vsx-partword-int-loads-and-stores.ll new file mode 100644 index 00000000000..01f87cead6a --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/vsx-partword-int-loads-and-stores.ll @@ -0,0 +1,1132 @@ +; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s +; RUN: llc -mcpu=pwr9 -mtriple=powerpc64-unknown-unknown < %s | FileCheck %s \ +; RUN: --check-prefix=CHECK-BE +; Function Attrs: norecurse nounwind readonly +define <16 x i8> @vecucuc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %splat.splatinsert = insertelement <16 x i8> undef, i8 %0, i32 0 + %splat.splat = shufflevector <16 x i8> %splat.splatinsert, <16 x i8> undef, <16 x i32> zeroinitializer + ret <16 x i8> %splat.splat +; CHECK-LABEL: vecucuc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vspltb 2, 2, 7 +; CHECK-BE-LABEL: vecucuc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: vspltb 2, 2, 7 +} + +; Function Attrs: norecurse nounwind readonly +define <8 x i16> @vecusuc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = zext i8 %0 to i16 + %splat.splatinsert = insertelement <8 x i16> undef, i16 %conv, i32 0 + %splat.splat = shufflevector <8 x i16> %splat.splatinsert, <8 x i16> undef, <8 x i32> zeroinitializer + ret <8 x i16> %splat.splat +; CHECK-LABEL: vecusuc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vsplth 2, 2, 3 +; CHECK-BE-LABEL: vecusuc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: vsplth 2, 2, 3 +} + +; Function Attrs: norecurse nounwind readonly +define <4 x i32> @vecuiuc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = zext i8 %0 to i32 + %splat.splatinsert = insertelement <4 x i32> undef, i32 %conv, i32 0 + %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer + ret <4 x i32> %splat.splat +; CHECK-LABEL: vecuiuc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: xxspltw 34, 34, 1 +; CHECK-BE-LABEL: vecuiuc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: xxspltw 34, 34, 1 +} + +; Function Attrs: norecurse nounwind readonly +define <2 x i64> @veculuc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = zext i8 %0 to i64 + %splat.splatinsert = insertelement <2 x i64> undef, i64 %conv, i32 0 + %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> undef, <2 x i32> zeroinitializer + ret <2 x i64> %splat.splat +; CHECK-LABEL: veculuc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: xxspltd 34, 34, 0 +; CHECK-BE-LABEL: veculuc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: xxspltd 34, 34, 0 +} + +; Function Attrs: norecurse nounwind readonly +define <16 x i8> @vecscuc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %splat.splatinsert = insertelement <16 x i8> undef, i8 %0, i32 0 + %splat.splat = shufflevector <16 x i8> %splat.splatinsert, <16 x i8> undef, <16 x i32> zeroinitializer + ret <16 x i8> %splat.splat +; CHECK-LABEL: vecscuc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vspltb 2, 2, 7 +; CHECK-BE-LABEL: vecscuc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: vspltb 2, 2, 7 +} + +; Function Attrs: norecurse nounwind readonly +define <8 x i16> @vecssuc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = zext i8 %0 to i16 + %splat.splatinsert = insertelement <8 x i16> undef, i16 %conv, i32 0 + %splat.splat = shufflevector <8 x i16> %splat.splatinsert, <8 x i16> undef, <8 x i32> zeroinitializer + ret <8 x i16> %splat.splat +; CHECK-LABEL: vecssuc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vsplth 2, 2, 3 +; CHECK-BE-LABEL: vecssuc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: vsplth 2, 2, 3 +} + +; Function Attrs: norecurse nounwind readonly +define <4 x i32> @vecsiuc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = zext i8 %0 to i32 + %splat.splatinsert = insertelement <4 x i32> undef, i32 %conv, i32 0 + %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer + ret <4 x i32> %splat.splat +; CHECK-LABEL: vecsiuc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: xxspltw 34, 34, 1 +; CHECK-BE-LABEL: vecsiuc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: xxspltw 34, 34, 1 +} + +; Function Attrs: norecurse nounwind readonly +define <2 x i64> @vecsluc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = zext i8 %0 to i64 + %splat.splatinsert = insertelement <2 x i64> undef, i64 %conv, i32 0 + %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> undef, <2 x i32> zeroinitializer + ret <2 x i64> %splat.splat +; CHECK-LABEL: vecsluc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: xxspltd 34, 34, 0 +; CHECK-BE-LABEL: vecsluc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: xxspltd 34, 34, 0 +} + +; Function Attrs: norecurse nounwind readonly +define <4 x float> @vecfuc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = uitofp i8 %0 to float + %splat.splatinsert = insertelement <4 x float> undef, float %conv, i32 0 + %splat.splat = shufflevector <4 x float> %splat.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer + ret <4 x float> %splat.splat +; CHECK-LABEL: vecfuc +; CHECK: lxsibzx [[LD:[0-9]+]], 0, 3 +; CHECK-NEXT: xscvuxdsp [[CONVD:[0-9]+]], [[LD]] +; CHECK-NEXT: xscvdpspn [[CONVS:[0-9]+]], [[CONVD]] +; CHECK-NEXT: xxspltw 34, [[CONVS]], 0 +; CHECK-BE-LABEL: vecfuc +; CHECK-BE: lxsibzx [[LD:[0-9]+]], 0, 3 +; CHECK-BE-NEXT: xscvuxdsp [[CONVD:[0-9]+]], [[LD]] +; CHECK-BE-NEXT: xscvdpspn [[CONVS:[0-9]+]], [[CONVD]] +; CHECK-BE-NEXT: xxspltw 34, [[CONVS]], 0 +} + +; Function Attrs: norecurse nounwind readonly +define <2 x double> @vecduc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = uitofp i8 %0 to double + %splat.splatinsert = insertelement <2 x double> undef, double %conv, i32 0 + %splat.splat = shufflevector <2 x double> %splat.splatinsert, <2 x double> undef, <2 x i32> zeroinitializer + ret <2 x double> %splat.splat +; CHECK-LABEL: vecduc +; CHECK: lxsibzx [[LD:[0-9]+]], 0, 3 +; CHECK-NEXT: xscvuxddp [[CONVD:[0-9]+]], [[LD]] +; CHECK-NEXT: xxspltd 34, [[CONVD]], 0 +; CHECK-BE-LABEL: vecduc +; CHECK-BE: lxsibzx [[LD:[0-9]+]], 0, 3 +; CHECK-BE-NEXT: xscvuxddp [[CONVD:[0-9]+]], [[LD]] +; CHECK-BE-NEXT: xxspltd 34, [[CONVD]], 0 +} + +; Function Attrs: norecurse nounwind readonly +define <16 x i8> @vecucsc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %splat.splatinsert = insertelement <16 x i8> undef, i8 %0, i32 0 + %splat.splat = shufflevector <16 x i8> %splat.splatinsert, <16 x i8> undef, <16 x i32> zeroinitializer + ret <16 x i8> %splat.splat +; CHECK-LABEL: vecucsc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vspltb 2, 2, 7 +; CHECK-BE-LABEL: vecucsc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: vspltb 2, 2, 7 +} + +; Function Attrs: norecurse nounwind readonly +define <4 x i32> @vecuisc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = sext i8 %0 to i32 + %splat.splatinsert = insertelement <4 x i32> undef, i32 %conv, i32 0 + %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer + ret <4 x i32> %splat.splat +; CHECK-LABEL: vecuisc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vextsb2w 2, 2 +; CHECK-NEXT: xxspltw 34, 34, 1 +; CHECK-BE-LABEL: vecuisc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: vextsb2w 2, 2 +; CHECK-BE-NEXT: xxspltw 34, 34, 1 +} + +; Function Attrs: norecurse nounwind readonly +define <2 x i64> @veculsc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = sext i8 %0 to i64 + %splat.splatinsert = insertelement <2 x i64> undef, i64 %conv, i32 0 + %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> undef, <2 x i32> zeroinitializer + ret <2 x i64> %splat.splat +; CHECK-LABEL: veculsc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vextsb2d 2, 2 +; CHECK-NEXT: xxspltd 34, 34, 0 +; CHECK-BE-LABEL: veculsc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: vextsb2d 2, 2 +; CHECK-BE-NEXT: xxspltd 34, 34, 0 +} + +; Function Attrs: norecurse nounwind readonly +define <16 x i8> @vecscsc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %splat.splatinsert = insertelement <16 x i8> undef, i8 %0, i32 0 + %splat.splat = shufflevector <16 x i8> %splat.splatinsert, <16 x i8> undef, <16 x i32> zeroinitializer + ret <16 x i8> %splat.splat +; CHECK-LABEL: vecscsc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vspltb 2, 2, 7 +; CHECK-BE-LABEL: vecscsc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: vspltb 2, 2, 7 +} + +; Function Attrs: norecurse nounwind readonly +define <4 x i32> @vecsisc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = sext i8 %0 to i32 + %splat.splatinsert = insertelement <4 x i32> undef, i32 %conv, i32 0 + %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer + ret <4 x i32> %splat.splat +; CHECK-LABEL: vecsisc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vextsb2w 2, 2 +; CHECK-NEXT: xxspltw 34, 34, 1 +; CHECK-BE-LABEL: vecsisc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: vextsb2w 2, 2 +; CHECK-BE-NEXT: xxspltw 34, 34, 1 +} + +; Function Attrs: norecurse nounwind readonly +define <2 x i64> @vecslsc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = sext i8 %0 to i64 + %splat.splatinsert = insertelement <2 x i64> undef, i64 %conv, i32 0 + %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> undef, <2 x i32> zeroinitializer + ret <2 x i64> %splat.splat +; CHECK-LABEL: vecslsc +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vextsb2d 2, 2 +; CHECK-NEXT: xxspltd 34, 34, 0 +; CHECK-BE-LABEL: vecslsc +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: vextsb2d 2, 2 +; CHECK-BE-NEXT: xxspltd 34, 34, 0 +} + +; Function Attrs: norecurse nounwind readonly +define <4 x float> @vecfsc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = sitofp i8 %0 to float + %splat.splatinsert = insertelement <4 x float> undef, float %conv, i32 0 + %splat.splat = shufflevector <4 x float> %splat.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer + ret <4 x float> %splat.splat +; CHECK-LABEL: vecfsc +; CHECK: lxsibzx +; CHECK-NEXT: vextsb2d +; CHECK-NEXT: xscvsxdsp [[CONVD:[0-9]+]], +; CHECK-NEXT: xscvdpspn [[CONVS:[0-9]+]], [[CONVD]] +; CHECK-NEXT: xxspltw 34, [[CONVS]], 0 +; CHECK-BE-LABEL: vecfsc +; CHECK-BE: lxsibzx [[LD:[0-9]+]], 0, 3 +; CHECK-BE-NEXT: vextsb2d +; CHECK-BE-NEXT: xscvsxdsp [[CONVD:[0-9]+]], +; CHECK-BE-NEXT: xscvdpspn [[CONVS:[0-9]+]], [[CONVD]] +; CHECK-BE-NEXT: xxspltw 34, [[CONVS]], 0 +} + +; Function Attrs: norecurse nounwind readonly +define <2 x double> @vecdsc(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = sitofp i8 %0 to double + %splat.splatinsert = insertelement <2 x double> undef, double %conv, i32 0 + %splat.splat = shufflevector <2 x double> %splat.splatinsert, <2 x double> undef, <2 x i32> zeroinitializer + ret <2 x double> %splat.splat +; CHECK-LABEL: vecdsc +; CHECK: lxsibzx +; CHECK-NEXT: vextsb2d +; CHECK-NEXT: xscvsxddp [[CONVD:[0-9]+]], +; CHECK-NEXT: xxspltd 34, [[CONVD]], 0 +; CHECK-BE-LABEL: vecdsc +; CHECK-BE: lxsibzx +; CHECK-BE-NEXT: vextsb2d +; CHECK-BE-NEXT: xscvsxddp [[CONVD:[0-9]+]], +; CHECK-BE-NEXT: xxspltd 34, [[CONVD]], 0 +} + +; Function Attrs: norecurse nounwind readonly +define <16 x i8> @vecucus(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = trunc i16 %0 to i8 + %splat.splatinsert = insertelement <16 x i8> undef, i8 %conv, i32 0 + %splat.splat = shufflevector <16 x i8> %splat.splatinsert, <16 x i8> undef, <16 x i32> zeroinitializer + ret <16 x i8> %splat.splat +; CHECK-LABEL: vecucus +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vspltb 2, 2, 7 +; CHECK-BE-LABEL: vecucus +; CHECK-BE: li [[OFFSET:[0-9]+]], 1 +; CHECK-BE-NEXT: lxsibzx 34, 3, [[OFFSET]] +; CHECK-BE-NEXT: vspltb 2, 2, 7 +} + +; Function Attrs: norecurse nounwind readonly +define <8 x i16> @vecusus(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %splat.splatinsert = insertelement <8 x i16> undef, i16 %0, i32 0 + %splat.splat = shufflevector <8 x i16> %splat.splatinsert, <8 x i16> undef, <8 x i32> zeroinitializer + ret <8 x i16> %splat.splat +; CHECK-LABEL: vecusus +; CHECK: lxsihzx 34, 0, 3 +; CHECK-NEXT: vsplth 2, 2, 3 +; CHECK-BE-LABEL: vecusus +; CHECK-BE: lxsihzx 34, 0, 3 +; CHECK-BE-NEXT: vsplth 2, 2, 3 +} + +; Function Attrs: norecurse nounwind readonly +define <4 x i32> @vecuius(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = zext i16 %0 to i32 + %splat.splatinsert = insertelement <4 x i32> undef, i32 %conv, i32 0 + %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer + ret <4 x i32> %splat.splat +; CHECK-LABEL: vecuius +; CHECK: lxsihzx 34, 0, 3 +; CHECK-NEXT: xxspltw 34, 34, 1 +; CHECK-BE-LABEL: vecuius +; CHECK-BE: lxsihzx 34, 0, 3 +; CHECK-BE-NEXT: xxspltw 34, 34, 1 +} + +; Function Attrs: norecurse nounwind readonly +define <2 x i64> @veculus(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = zext i16 %0 to i64 + %splat.splatinsert = insertelement <2 x i64> undef, i64 %conv, i32 0 + %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> undef, <2 x i32> zeroinitializer + ret <2 x i64> %splat.splat +; CHECK-LABEL: veculus +; CHECK: lxsihzx 34, 0, 3 +; CHECK-NEXT: xxspltd 34, 34, 0 +; CHECK-BE-LABEL: veculus +; CHECK-BE: lxsihzx 34, 0, 3 +; CHECK-BE-NEXT: xxspltd 34, 34, 0 +} + +; Function Attrs: norecurse nounwind readonly +define <16 x i8> @vecscus(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = trunc i16 %0 to i8 + %splat.splatinsert = insertelement <16 x i8> undef, i8 %conv, i32 0 + %splat.splat = shufflevector <16 x i8> %splat.splatinsert, <16 x i8> undef, <16 x i32> zeroinitializer + ret <16 x i8> %splat.splat +; CHECK-LABEL: vecscus +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vspltb 2, 2, 7 +; CHECK-BE-LABEL: vecscus +; CHECK-BE: li [[OFFSET:[0-9]+]], 1 +; CHECK-BE-NEXT: lxsibzx 34, 3, [[OFFSET]] +; CHECK-BE-NEXT: vspltb 2, 2, 7 +} + +; Function Attrs: norecurse nounwind readonly +define <8 x i16> @vecssus(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %splat.splatinsert = insertelement <8 x i16> undef, i16 %0, i32 0 + %splat.splat = shufflevector <8 x i16> %splat.splatinsert, <8 x i16> undef, <8 x i32> zeroinitializer + ret <8 x i16> %splat.splat +; CHECK-LABEL: vecssus +; CHECK: lxsihzx 34, 0, 3 +; CHECK-NEXT: vsplth 2, 2, 3 +; CHECK-BE-LABEL: vecssus +; CHECK-BE: lxsihzx 34, 0, 3 +; CHECK-BE-NEXT: vsplth 2, 2, 3 +} + +; Function Attrs: norecurse nounwind readonly +define <4 x i32> @vecsius(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = zext i16 %0 to i32 + %splat.splatinsert = insertelement <4 x i32> undef, i32 %conv, i32 0 + %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer + ret <4 x i32> %splat.splat +; CHECK-LABEL: vecsius +; CHECK: lxsihzx 34, 0, 3 +; CHECK-NEXT: xxspltw 34, 34, 1 +; CHECK-BE-LABEL: vecsius +; CHECK-BE: lxsihzx 34, 0, 3 +; CHECK-BE-NEXT: xxspltw 34, 34, 1 +} + +; Function Attrs: norecurse nounwind readonly +define <2 x i64> @vecslus(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = zext i16 %0 to i64 + %splat.splatinsert = insertelement <2 x i64> undef, i64 %conv, i32 0 + %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> undef, <2 x i32> zeroinitializer + ret <2 x i64> %splat.splat +; CHECK-LABEL: vecslus +; CHECK: lxsihzx 34, 0, 3 +; CHECK-NEXT: xxspltd 34, 34, 0 +; CHECK-BE-LABEL: vecslus +; CHECK-BE: lxsihzx 34, 0, 3 +; CHECK-BE-NEXT: xxspltd 34, 34, 0 +} + +; Function Attrs: norecurse nounwind readonly +define <4 x float> @vecfus(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = uitofp i16 %0 to float + %splat.splatinsert = insertelement <4 x float> undef, float %conv, i32 0 + %splat.splat = shufflevector <4 x float> %splat.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer + ret <4 x float> %splat.splat +; CHECK-LABEL: vecfus +; CHECK: lxsihzx [[LD:[0-9]+]], 0, 3 +; CHECK-NEXT: xscvuxdsp [[CONVD:[0-9]+]], [[LD]] +; CHECK-NEXT: xscvdpspn [[CONVS:[0-9]+]], [[CONVD]] +; CHECK-NEXT: xxspltw 34, [[CONVS]], 0 +; CHECK-BE-LABEL: vecfus +; CHECK-BE: lxsihzx [[LD:[0-9]+]], 0, 3 +; CHECK-BE-NEXT: xscvuxdsp [[CONVD:[0-9]+]], [[LD]] +; CHECK-BE-NEXT: xscvdpspn [[CONVS:[0-9]+]], [[CONVD]] +; CHECK-BE-NEXT: xxspltw 34, [[CONVS]], 0 +} + +; Function Attrs: norecurse nounwind readonly +define <2 x double> @vecdus(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = uitofp i16 %0 to double + %splat.splatinsert = insertelement <2 x double> undef, double %conv, i32 0 + %splat.splat = shufflevector <2 x double> %splat.splatinsert, <2 x double> undef, <2 x i32> zeroinitializer + ret <2 x double> %splat.splat +; CHECK-LABEL: vecdus +; CHECK: lxsihzx [[LD:[0-9]+]], 0, 3 +; CHECK-NEXT: xscvuxddp [[CONVD:[0-9]+]], [[LD]] +; CHECK-NEXT: xxspltd 34, [[CONVD]], 0 +; CHECK-BE-LABEL: vecdus +; CHECK-BE: lxsihzx [[LD:[0-9]+]], 0, 3 +; CHECK-BE-NEXT: xscvuxddp [[CONVD:[0-9]+]], [[LD]] +; CHECK-BE-NEXT: xxspltd 34, [[CONVD]], 0 +} + +; Function Attrs: norecurse nounwind readonly +define <16 x i8> @vecucss(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = trunc i16 %0 to i8 + %splat.splatinsert = insertelement <16 x i8> undef, i8 %conv, i32 0 + %splat.splat = shufflevector <16 x i8> %splat.splatinsert, <16 x i8> undef, <16 x i32> zeroinitializer + ret <16 x i8> %splat.splat +; CHECK-LABEL: vecucss +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vspltb 2, 2, 7 +; CHECK-BE-LABEL: vecucss +; CHECK-BE: li [[OFFSET:[0-9]+]], 1 +; CHECK-BE-NEXT: lxsibzx 34, 3, [[OFFSET]] +; CHECK-BE-NEXT: vspltb 2, 2, 7 +} + +; Function Attrs: norecurse nounwind readonly +define <4 x i32> @vecuiss(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = sext i16 %0 to i32 + %splat.splatinsert = insertelement <4 x i32> undef, i32 %conv, i32 0 + %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer + ret <4 x i32> %splat.splat +; CHECK-LABEL: vecuiss +; CHECK: lxsihzx 34, 0, 3 +; CHECK-NEXT: vextsh2w 2, 2 +; CHECK-NEXT: xxspltw 34, 34, 1 +; CHECK-BE-LABEL: vecuiss +; CHECK-BE: lxsihzx 34, 0, 3 +; CHECK-BE-NEXT: vextsh2w 2, 2 +; CHECK-BE-NEXT: xxspltw 34, 34, 1 +} + +; Function Attrs: norecurse nounwind readonly +define <2 x i64> @veculss(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = sext i16 %0 to i64 + %splat.splatinsert = insertelement <2 x i64> undef, i64 %conv, i32 0 + %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> undef, <2 x i32> zeroinitializer + ret <2 x i64> %splat.splat +; CHECK-LABEL: veculss +; CHECK: lxsihzx 34, 0, 3 +; CHECK-NEXT: vextsh2d 2, 2 +; CHECK-NEXT: xxspltd 34, 34, 0 +; CHECK-BE-LABEL: veculss +; CHECK-BE: lxsihzx 34, 0, 3 +; CHECK-BE-NEXT: vextsh2d 2, 2 +; CHECK-BE-NEXT: xxspltd 34, 34, 0 +} + +; Function Attrs: norecurse nounwind readonly +define <16 x i8> @vecscss(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = trunc i16 %0 to i8 + %splat.splatinsert = insertelement <16 x i8> undef, i8 %conv, i32 0 + %splat.splat = shufflevector <16 x i8> %splat.splatinsert, <16 x i8> undef, <16 x i32> zeroinitializer + ret <16 x i8> %splat.splat +; CHECK-LABEL: vecscss +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vspltb 2, 2, 7 +; CHECK-BE-LABEL: vecscss +; CHECK-BE: li [[OFFSET:[0-9]+]], 1 +; CHECK-BE-NEXT: lxsibzx 34, 3, [[OFFSET]] +; CHECK-BE-NEXT: vspltb 2, 2, 7 +} + +; Function Attrs: norecurse nounwind readonly +define <4 x i32> @vecsiss(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = sext i16 %0 to i32 + %splat.splatinsert = insertelement <4 x i32> undef, i32 %conv, i32 0 + %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer + ret <4 x i32> %splat.splat +; CHECK-LABEL: vecsiss +; CHECK: lxsihzx 34, 0, 3 +; CHECK-NEXT: vextsh2w 2, 2 +; CHECK-NEXT: xxspltw 34, 34, 1 +; CHECK-BE-LABEL: vecsiss +; CHECK-BE: lxsihzx 34, 0, 3 +; CHECK-BE-NEXT: vextsh2w 2, 2 +; CHECK-BE-NEXT: xxspltw 34, 34, 1 +} + +; Function Attrs: norecurse nounwind readonly +define <2 x i64> @vecslss(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = sext i16 %0 to i64 + %splat.splatinsert = insertelement <2 x i64> undef, i64 %conv, i32 0 + %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> undef, <2 x i32> zeroinitializer + ret <2 x i64> %splat.splat +; CHECK-LABEL: vecslss +; CHECK: lxsihzx 34, 0, 3 +; CHECK-NEXT: vextsh2d 2, 2 +; CHECK-NEXT: xxspltd 34, 34, 0 +; CHECK-BE-LABEL: vecslss +; CHECK-BE: lxsihzx 34, 0, 3 +; CHECK-BE-NEXT: vextsh2d 2, 2 +; CHECK-BE-NEXT: xxspltd 34, 34, 0 +} + +; Function Attrs: norecurse nounwind readonly +define <4 x float> @vecfss(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = sitofp i16 %0 to float + %splat.splatinsert = insertelement <4 x float> undef, float %conv, i32 0 + %splat.splat = shufflevector <4 x float> %splat.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer + ret <4 x float> %splat.splat +; CHECK-LABEL: vecfss +; CHECK: lxsihzx +; CHECK-NEXT: vextsh2d +; CHECK-NEXT: xscvsxdsp [[CONVD:[0-9]+]], +; CHECK-NEXT: xscvdpspn [[CONVS:[0-9]+]], [[CONVD]] +; CHECK-NEXT: xxspltw 34, [[CONVS]], 0 +; CHECK-BE-LABEL: vecfss +; CHECK-BE: lxsihzx [[LD:[0-9]+]], 0, 3 +; CHECK-BE-NEXT: vextsh2d +; CHECK-BE-NEXT: xscvsxdsp [[CONVD:[0-9]+]], +; CHECK-BE-NEXT: xscvdpspn [[CONVS:[0-9]+]], [[CONVD]] +; CHECK-BE-NEXT: xxspltw 34, [[CONVS]], 0 +} + +; Function Attrs: norecurse nounwind readonly +define <2 x double> @vecdss(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = sitofp i16 %0 to double + %splat.splatinsert = insertelement <2 x double> undef, double %conv, i32 0 + %splat.splat = shufflevector <2 x double> %splat.splatinsert, <2 x double> undef, <2 x i32> zeroinitializer + ret <2 x double> %splat.splat +; CHECK-LABEL: vecdss +; CHECK: lxsihzx +; CHECK-NEXT: vextsh2d +; CHECK-NEXT: xscvsxddp [[CONVD:[0-9]+]], +; CHECK-NEXT: xxspltd 34, [[CONVD]], 0 +; CHECK-BE-LABEL: vecdss +; CHECK-BE: lxsihzx +; CHECK-BE-NEXT: vextsh2d +; CHECK-BE-NEXT: xscvsxddp [[CONVD:[0-9]+]], +; CHECK-BE-NEXT: xxspltd 34, [[CONVD]], 0 +} + +; Function Attrs: norecurse nounwind +define void @storefsc(float %f, i8* nocapture %ptr) { +entry: + %conv = fptosi float %f to i8 + store i8 %conv, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storefsc +; CHECK: xscvdpsxws 0, 1 +; CHECK: stxsibx 0, 0, 4 +; CHECK-BE-LABEL: storefsc +; CHECK-BE: xscvdpsxws 0, 1 +; CHECK-BE: stxsibx 0, 0, 4 +} + +; Function Attrs: norecurse nounwind +define void @storedsc(double %d, i8* nocapture %ptr) { +entry: + %conv = fptosi double %d to i8 + store i8 %conv, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storedsc +; CHECK: xscvdpsxws 0, 1 +; CHECK: stxsibx 0, 0, 4 +; CHECK-BE-LABEL: storedsc +; CHECK-BE: xscvdpsxws 0, 1 +; CHECK-BE: stxsibx 0, 0, 4 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc0(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 0 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc0 +; CHECK: vsldoi 2, 2, 2, 8 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc0 +; CHECK-BE: vsldoi 2, 2, 2, 9 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc1(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 1 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc1 +; CHECK: vsldoi 2, 2, 2, 7 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc1 +; CHECK-BE: vsldoi 2, 2, 2, 10 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc2(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 2 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc2 +; CHECK: vsldoi 2, 2, 2, 6 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc2 +; CHECK-BE: vsldoi 2, 2, 2, 11 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc3(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 3 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc3 +; CHECK: vsldoi 2, 2, 2, 5 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc3 +; CHECK-BE: vsldoi 2, 2, 2, 12 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc4(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 4 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc4 +; CHECK: vsldoi 2, 2, 2, 4 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc4 +; CHECK-BE: vsldoi 2, 2, 2, 13 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc5(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 5 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc5 +; CHECK: vsldoi 2, 2, 2, 3 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc5 +; CHECK-BE: vsldoi 2, 2, 2, 14 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc6(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 6 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc6 +; CHECK: vsldoi 2, 2, 2, 2 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc6 +; CHECK-BE: vsldoi 2, 2, 2, 15 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc7(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 7 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc7 +; CHECK: vsldoi 2, 2, 2, 1 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc7 +; CHECK-BE: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc8(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 8 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc8 +; CHECK: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc8 +; CHECK-BE: vsldoi 2, 2, 2, 1 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc9(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 9 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc9 +; CHECK: vsldoi 2, 2, 2, 15 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc9 +; CHECK-BE: vsldoi 2, 2, 2, 2 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc10(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 10 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc10 +; CHECK: vsldoi 2, 2, 2, 14 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc10 +; CHECK-BE: vsldoi 2, 2, 2, 3 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc11(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 11 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc11 +; CHECK: vsldoi 2, 2, 2, 13 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc11 +; CHECK-BE: vsldoi 2, 2, 2, 4 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc12(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 12 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc12 +; CHECK: vsldoi 2, 2, 2, 12 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc12 +; CHECK-BE: vsldoi 2, 2, 2, 5 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc13(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 13 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc13 +; CHECK: vsldoi 2, 2, 2, 11 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc13 +; CHECK-BE: vsldoi 2, 2, 2, 6 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc14(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 14 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc14 +; CHECK: vsldoi 2, 2, 2, 10 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc14 +; CHECK-BE: vsldoi 2, 2, 2, 7 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevcsc15(<16 x i8> %v, i8* nocapture %ptr) { +entry: + %vecext = extractelement <16 x i8> %v, i32 15 + store i8 %vecext, i8* %ptr, align 1 + ret void +; CHECK-LABEL: storevcsc15 +; CHECK: vsldoi 2, 2, 2, 9 +; CHECK-NEXT: stxsibx 34, 0, 5 +; CHECK-BE-LABEL: storevcsc15 +; CHECK-BE: vsldoi 2, 2, 2, 8 +; CHECK-BE-NEXT: stxsibx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storefss(float %f, i16* nocapture %ptr) { +entry: + %conv = fptosi float %f to i16 + store i16 %conv, i16* %ptr, align 2 + ret void +; CHECK-LABEL: storefss +; CHECK: xscvdpsxws 0, 1 +; CHECK: stxsihx 0, 0, 4 +; CHECK-BE-LABEL: storefss +; CHECK-BE: xscvdpsxws 0, 1 +; CHECK-BE: stxsihx 0, 0, 4 +} + +; Function Attrs: norecurse nounwind +define void @storedss(double %d, i16* nocapture %ptr) { +entry: + %conv = fptosi double %d to i16 + store i16 %conv, i16* %ptr, align 2 + ret void +; CHECK-LABEL: storedss +; CHECK: xscvdpsxws 0, 1 +; CHECK: stxsihx 0, 0, 4 +; CHECK-BE-LABEL: storedss +; CHECK-BE: xscvdpsxws 0, 1 +; CHECK-BE: stxsihx 0, 0, 4 +} + +; Function Attrs: norecurse nounwind +define void @storevsss0(<8 x i16> %v, i16* nocapture %ptr) { +entry: + %vecext = extractelement <8 x i16> %v, i32 0 + store i16 %vecext, i16* %ptr, align 2 + ret void +; CHECK-LABEL: storevsss0 +; CHECK: vsldoi 2, 2, 2, 8 +; CHECK-NEXT: stxsihx 34, 0, 5 +; CHECK-BE-LABEL: storevsss0 +; CHECK-BE: vsldoi 2, 2, 2, 10 +; CHECK-BE-NEXT: stxsihx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevsss1(<8 x i16> %v, i16* nocapture %ptr) { +entry: + %vecext = extractelement <8 x i16> %v, i32 1 + store i16 %vecext, i16* %ptr, align 2 + ret void +; CHECK-LABEL: storevsss1 +; CHECK: vsldoi 2, 2, 2, 6 +; CHECK-NEXT: stxsihx 34, 0, 5 +; CHECK-BE-LABEL: storevsss1 +; CHECK-BE: vsldoi 2, 2, 2, 12 +; CHECK-BE-NEXT: stxsihx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevsss2(<8 x i16> %v, i16* nocapture %ptr) { +entry: + %vecext = extractelement <8 x i16> %v, i32 2 + store i16 %vecext, i16* %ptr, align 2 + ret void +; CHECK-LABEL: storevsss2 +; CHECK: vsldoi 2, 2, 2, 4 +; CHECK-NEXT: stxsihx 34, 0, 5 +; CHECK-BE-LABEL: storevsss2 +; CHECK-BE: vsldoi 2, 2, 2, 14 +; CHECK-BE-NEXT: stxsihx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevsss3(<8 x i16> %v, i16* nocapture %ptr) { +entry: + %vecext = extractelement <8 x i16> %v, i32 3 + store i16 %vecext, i16* %ptr, align 2 + ret void +; CHECK-LABEL: storevsss3 +; CHECK: vsldoi 2, 2, 2, 2 +; CHECK-NEXT: stxsihx 34, 0, 5 +; CHECK-BE-LABEL: storevsss3 +; CHECK-BE: stxsihx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevsss4(<8 x i16> %v, i16* nocapture %ptr) { +entry: + %vecext = extractelement <8 x i16> %v, i32 4 + store i16 %vecext, i16* %ptr, align 2 + ret void +; CHECK-LABEL: storevsss4 +; CHECK: stxsihx 34, 0, 5 +; CHECK-BE-LABEL: storevsss4 +; CHECK-BE: vsldoi 2, 2, 2, 2 +; CHECK-BE-NEXT: stxsihx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevsss5(<8 x i16> %v, i16* nocapture %ptr) { +entry: + %vecext = extractelement <8 x i16> %v, i32 5 + store i16 %vecext, i16* %ptr, align 2 + ret void +; CHECK-LABEL: storevsss5 +; CHECK: vsldoi 2, 2, 2, 14 +; CHECK-NEXT: stxsihx 34, 0, 5 +; CHECK-BE-LABEL: storevsss5 +; CHECK-BE: vsldoi 2, 2, 2, 4 +; CHECK-BE-NEXT: stxsihx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevsss6(<8 x i16> %v, i16* nocapture %ptr) { +entry: + %vecext = extractelement <8 x i16> %v, i32 6 + store i16 %vecext, i16* %ptr, align 2 + ret void +; CHECK-LABEL: storevsss6 +; CHECK: vsldoi 2, 2, 2, 12 +; CHECK-NEXT: stxsihx 34, 0, 5 +; CHECK-BE-LABEL: storevsss6 +; CHECK-BE: vsldoi 2, 2, 2, 6 +; CHECK-BE-NEXT: stxsihx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind +define void @storevsss7(<8 x i16> %v, i16* nocapture %ptr) { +entry: + %vecext = extractelement <8 x i16> %v, i32 7 + store i16 %vecext, i16* %ptr, align 2 + ret void +; CHECK-LABEL: storevsss7 +; CHECK: vsldoi 2, 2, 2, 10 +; CHECK-NEXT: stxsihx 34, 0, 5 +; CHECK-BE-LABEL: storevsss7 +; CHECK-BE: vsldoi 2, 2, 2, 8 +; CHECK-BE-NEXT: stxsihx 34, 0, 5 +} + +; Function Attrs: norecurse nounwind readonly +define float @convscf(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = sitofp i8 %0 to float + ret float %conv +; CHECK-LABEL: convscf +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vextsb2d 2, 2 +; CHECK-NEXT: xscvsxdsp 1, 34 +; CHECK-BE-LABEL: convscf +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: vextsb2d 2, 2 +; CHECK-BE-NEXT: xscvsxdsp 1, 34 +} + +; Function Attrs: norecurse nounwind readonly +define float @convucf(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = uitofp i8 %0 to float + ret float %conv +; CHECK-LABEL: convucf +; CHECK: lxsibzx 0, 0, 3 +; CHECK-NEXT: xscvuxdsp 1, 0 +; CHECK-BE-LABEL: convucf +; CHECK-BE: lxsibzx 0, 0, 3 +; CHECK-BE-NEXT: xscvuxdsp 1, 0 +} + +; Function Attrs: norecurse nounwind readonly +define double @convscd(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = sitofp i8 %0 to double +; CHECK-LABEL: convscd +; CHECK: lxsibzx 34, 0, 3 +; CHECK-NEXT: vextsb2d 2, 2 +; CHECK-NEXT: xscvsxddp 1, 34 +; CHECK-BE-LABEL: convscd +; CHECK-BE: lxsibzx 34, 0, 3 +; CHECK-BE-NEXT: vextsb2d 2, 2 +; CHECK-BE-NEXT: xscvsxddp 1, 34 + ret double %conv +} + +; Function Attrs: norecurse nounwind readonly +define double @convucd(i8* nocapture readonly %ptr) { +entry: + %0 = load i8, i8* %ptr, align 1 + %conv = uitofp i8 %0 to double + ret double %conv +; CHECK-LABEL: convucd +; CHECK: lxsibzx 0, 0, 3 +; CHECK-NEXT: xscvuxddp 1, 0 +; CHECK-BE-LABEL: convucd +; CHECK-BE: lxsibzx 0, 0, 3 +; CHECK-BE-NEXT: xscvuxddp 1, 0 +} + +; Function Attrs: norecurse nounwind readonly +define float @convssf(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = sitofp i16 %0 to float + ret float %conv +; CHECK-LABEL: convssf +; CHECK: lxsihzx 34, 0, 3 +; CHECK-NEXT: vextsh2d 2, 2 +; CHECK-NEXT: xscvsxdsp 1, 34 +; CHECK-BE-LABEL: convssf +; CHECK-BE: lxsihzx 34, 0, 3 +; CHECK-BE-NEXT: vextsh2d 2, 2 +; CHECK-BE-NEXT: xscvsxdsp 1, 34 +} + +; Function Attrs: norecurse nounwind readonly +define float @convusf(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = uitofp i16 %0 to float + ret float %conv +; CHECK-LABEL: convusf +; CHECK: lxsihzx 0, 0, 3 +; CHECK-NEXT: xscvuxdsp 1, 0 +; CHECK-BE-LABEL: convusf +; CHECK-BE: lxsihzx 0, 0, 3 +; CHECK-BE-NEXT: xscvuxdsp 1, 0 +} + +; Function Attrs: norecurse nounwind readonly +define double @convssd(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = sitofp i16 %0 to double + ret double %conv +; CHECK-LABEL: convssd +; CHECK: lxsihzx 34, 0, 3 +; CHECK-NEXT: vextsh2d 2, 2 +; CHECK-NEXT: xscvsxddp 1, 34 +; CHECK-BE-LABEL: convssd +; CHECK-BE: lxsihzx 34, 0, 3 +; CHECK-BE-NEXT: vextsh2d 2, 2 +; CHECK-BE-NEXT: xscvsxddp 1, 34 +} + +; Function Attrs: norecurse nounwind readonly +define double @convusd(i16* nocapture readonly %ptr) { +entry: + %0 = load i16, i16* %ptr, align 2 + %conv = uitofp i16 %0 to double + ret double %conv +; CHECK-LABEL: convusd +; CHECK: lxsihzx 0, 0, 3 +; CHECK-NEXT: xscvuxddp 1, 0 +; CHECK-BE-LABEL: convusd +; CHECK-BE: lxsihzx 0, 0, 3 +; CHECK-BE-NEXT: xscvuxddp 1, 0 +} diff --git a/llvm/test/CodeGen/PowerPC/vsx-spill-norwstore.ll b/llvm/test/CodeGen/PowerPC/vsx-spill-norwstore.ll index 77b6cb29b24..c194ad5d4bf 100644 --- a/llvm/test/CodeGen/PowerPC/vsx-spill-norwstore.ll +++ b/llvm/test/CodeGen/PowerPC/vsx-spill-norwstore.ll @@ -4,6 +4,7 @@ target triple = "powerpc64-unknown-linux-gnu" @.str1 = external unnamed_addr constant [5 x i8], align 1 @.str10 = external unnamed_addr constant [9 x i8], align 1 +@.v2f64 = external unnamed_addr constant <2 x double>, align 16 ; Function Attrs: nounwind define void @main() #0 { @@ -12,6 +13,7 @@ define void @main() #0 { ; CHECK: stxvd2x entry: + %val = load <2 x double>, <2 x double>* @.v2f64, align 16 %0 = tail call <8 x i16> @llvm.ppc.altivec.vupkhsb(<16 x i8> <i8 0, i8 -1, i8 -1, i8 0, i8 0, i8 0, i8 -1, i8 0, i8 -1, i8 0, i8 0, i8 -1, i8 -1, i8 -1, i8 0, i8 -1>) #0 %1 = tail call <8 x i16> @llvm.ppc.altivec.vupklsb(<16 x i8> <i8 0, i8 -1, i8 -1, i8 0, i8 0, i8 0, i8 -1, i8 0, i8 -1, i8 0, i8 0, i8 -1, i8 -1, i8 -1, i8 0, i8 -1>) #0 br i1 false, label %if.then.i68.i, label %check.exit69.i @@ -23,7 +25,7 @@ check.exit69.i: ; preds = %entry br i1 undef, label %if.then.i63.i, label %check.exit64.i if.then.i63.i: ; preds = %check.exit69.i - tail call void (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str1, i64 0, i64 0)) #0 + tail call void (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str1, i64 0, i64 0), <2 x double> %val) #0 br label %check.exit64.i check.exit64.i: ; preds = %if.then.i63.i, %check.exit69.i diff --git a/llvm/test/CodeGen/PowerPC/vsx-vec-spill.ll b/llvm/test/CodeGen/PowerPC/vsx-vec-spill.ll new file mode 100644 index 00000000000..8f65b731505 --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/vsx-vec-spill.ll @@ -0,0 +1,34 @@ +; RUN: llc < %s -march=ppc64 -mattr=+vsx -verify-machineinstrs | \ +; RUN: FileCheck %s --check-prefix=VSX +; RUN: llc < %s -march=ppc64 -mattr=-vsx -verify-machineinstrs | \ +; RUN: FileCheck %s --check-prefix=NOVSX + +define <2 x double> @interleaving_VSX_VMX( + <2 x double> %a, <2 x double> %b, <2 x double> %c, + <2 x double> %d, <2 x double> %e, <2 x double> %f) { +entry: + tail call void asm sideeffect "# clobbers", + "~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() nounwind + tail call void @goo(<2 x double> %a) nounwind + %add = fadd <2 x double> %a, %b + %sub = fsub <2 x double> %a, %b + %mul = fmul <2 x double> %add, %sub + %add1 = fadd <2 x double> %c, %d + %sub2 = fsub <2 x double> %c, %d + %mul3 = fmul <2 x double> %add1, %sub2 + %add4 = fadd <2 x double> %mul, %mul3 + %add5 = fadd <2 x double> %e, %f + %sub6 = fsub <2 x double> %e, %f + %mul7 = fmul <2 x double> %add5, %sub6 + %add8 = fadd <2 x double> %add4, %mul7 + ret <2 x double> %add8 +; VSX-LABEL: interleaving_VSX_VMX +; VSX-NOT: stvx +; VSX-NOT: lvx + +; NOVSX-LABEL: interleaving_VSX_VMX +; NOVSX-NOT: stxvd2x +; NOVSX-NOT: lxvd2x +} + +declare void @goo(<2 x double>) diff --git a/llvm/test/CodeGen/PowerPC/vsx.ll b/llvm/test/CodeGen/PowerPC/vsx.ll index 008f1f9a724..2be57d2ae18 100644 --- a/llvm/test/CodeGen/PowerPC/vsx.ll +++ b/llvm/test/CodeGen/PowerPC/vsx.ll @@ -70,10 +70,7 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test5 -; CHECK-FISL: vor -; CHECK-FISL: vor -; CHECK-FISL: xxlxor -; CHECK-FISL: vor 2 +; CHECK-FISL: xxlxor 34, 34, 35 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test5 @@ -91,10 +88,7 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test6 -; 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: xxlxor 34, 34, 35 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test6 @@ -112,10 +106,7 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test7 -; 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: xxlxor 34, 34, 35 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test7 @@ -133,10 +124,7 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test8 -; CHECK-FISL: vor -; CHECK-FISL: vor -; CHECK-FISL: xxlor -; CHECK-FISL: vor 2 +; CHECK-FISL: xxlor 34, 34, 35 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test8 @@ -154,10 +142,7 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test9 -; 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: xxlor 34, 34, 35 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test9 @@ -175,10 +160,7 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test10 -; 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: xxlor 34, 34, 35 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test10 @@ -196,10 +178,7 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test11 -; CHECK-FISL: vor -; CHECK-FISL: vor -; CHECK-FISL: xxland -; CHECK-FISL: vor 2 +; CHECK-FISL: xxland 34, 34, 35 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test11 @@ -217,10 +196,7 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test12 -; 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: xxland 34, 34, 35 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test12 @@ -238,10 +214,7 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test13 -; 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: xxland 34, 34, 35 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test13 @@ -260,11 +233,8 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test14 -; 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: xxlor 0, 34, 35 +; CHECK-FISL: xxlnor 34, 34, 35 ; CHECK-FISL: lis 0, -1 ; CHECK-FISL: ori 0, 0, 65520 ; CHECK-FISL: stxvd2x 0, 1, 0 @@ -286,17 +256,13 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test15 -; 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 2, 4, 4 +; CHECK-FISL: xxlor 0, 34, 35 +; CHECK-FISL: xxlor 36, 0, 0 +; CHECK-FISL: xxlnor 0, 34, 35 +; CHECK-FISL: xxlor 34, 0, 0 ; CHECK-FISL: lis 0, -1 ; CHECK-FISL: ori 0, 0, 65520 -; CHECK-FISL: stvx 0, 1, 0 +; CHECK-FISL: stxvd2x 36, 1, 0 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test15 @@ -315,17 +281,13 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test16 -; 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 2, 4, 4 +; CHECK-FISL: xxlor 0, 34, 35 +; CHECK-FISL: xxlor 36, 0, 0 +; CHECK-FISL: xxlnor 0, 34, 35 +; CHECK-FISL: xxlor 34, 0, 0 ; CHECK-FISL: lis 0, -1 ; CHECK-FISL: ori 0, 0, 65520 -; CHECK-FISL: stvx 0, 1, 0 +; CHECK-FISL: stxvd2x 36, 1, 0 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test16 @@ -344,11 +306,8 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test17 -; CHECK-FISL: vor 4, 3, 3 -; CHECK-FISL: vor 5, 2, 2 -; CHECK-FISL: xxlnor 36, 36, 36 -; CHECK-FISL: xxland 36, 37, 36 -; CHECK-FISL: vor 2, 4, 4 +; CHECK-FISL: xxlnor 35, 35, 35 +; CHECK-FISL: xxland 34, 34, 35 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test17 @@ -367,17 +326,13 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test18 -; CHECK-FISL: vor 4, 3, 3 -; CHECK-FISL: vor 5, 3, 3 -; CHECK-FISL: xxlnor 36, 36, 37 -; CHECK-FISL: vor 0, 4, 4 -; CHECK-FISL: vor 4, 2, 2 -; CHECK-FISL: vor 5, 3, 3 -; CHECK-FISL: xxlandc 36, 36, 37 -; CHECK-FISL: vor 2, 4, 4 +; CHECK-FISL: xxlnor 0, 35, 35 +; CHECK-FISL: xxlor 36, 0, 0 +; CHECK-FISL: xxlandc 0, 34, 35 +; CHECK-FISL: xxlor 34, 0, 0 ; CHECK-FISL: lis 0, -1 ; CHECK-FISL: ori 0, 0, 65520 -; CHECK-FISL: stvx 0, 1, 0 +; CHECK-FISL: stxvd2x 36, 1, 0 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test18 @@ -396,17 +351,13 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test19 -; CHECK-FISL: vor 4, 3, 3 -; CHECK-FISL: vor 5, 3, 3 -; CHECK-FISL: xxlnor 36, 36, 37 -; CHECK-FISL: vor 0, 4, 4 -; CHECK-FISL: vor 4, 2, 2 -; CHECK-FISL: vor 5, 3, 3 -; CHECK-FISL: xxlandc 36, 36, 37 -; CHECK-FISL: vor 2, 4, 4 +; CHECK-FISL: xxlnor 0, 35, 35 +; CHECK-FISL: xxlor 36, 0, 0 +; CHECK-FISL: xxlandc 0, 34, 35 +; CHECK-FISL: xxlor 34, 0, 0 ; CHECK-FISL: lis 0, -1 ; CHECK-FISL: ori 0, 0, 65520 -; CHECK-FISL: stvx 0, 1, 0 +; CHECK-FISL: stxvd2x 36, 1, 0 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test19 @@ -425,19 +376,9 @@ 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: 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: vcmpequw {{[0-9]+}}, 4, 5 +; CHECK-FISL: xxsel 34, 35, 34, {{[0-9]+}} ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test20 @@ -458,13 +399,8 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test21 -; 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: xvcmpeqsp 32, 33, 32 -; CHECK-FISL: xxsel 32, 38, 39, 32 -; CHECK-FISL: vor 2, 0, 0 +; CHECK-FISL: xvcmpeqsp [[V1:[0-9]+]], 36, 37 +; CHECK-FISL: xxsel 34, 35, 34, [[V1]] ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test21 @@ -491,14 +427,14 @@ entry: ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test22 -; CHECK-FISL-DAG: xvcmpeqsp {{[0-9]+}}, 33, 32 -; CHECK-FISL-DAG: xvcmpeqsp {{[0-9]+}}, 32, 32 -; CHECK-FISL-DAG: xvcmpeqsp {{[0-9]+}}, 33, 33 +; CHECK-FISL-DAG: xvcmpeqsp {{[0-9]+}}, 37, 37 +; CHECK-FISL-DAG: xvcmpeqsp {{[0-9]+}}, 36, 36 +; CHECK-FISL-DAG: xvcmpeqsp {{[0-9]+}}, 36, 37 ; CHECK-FISL-DAG: xxlnor ; CHECK-FISL-DAG: xxlnor ; CHECK-FISL-DAG: xxlor ; CHECK-FISL-DAG: xxlor -; CHECK-FISL: xxsel 0, 38, 39, {{[0-9]+}} +; CHECK-FISL: xxsel 34, 35, 34, {{[0-9]+}} ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test22 @@ -526,11 +462,7 @@ entry: ; CHECK-FISL-LABEL: @test23 ; CHECK-FISL: vcmpequh 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 2, 0, +; CHECK-FISL: xxsel 34, 35, 34, 36 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test23 @@ -552,11 +484,7 @@ entry: ; CHECK-FISL-LABEL: @test24 ; CHECK-FISL: vcmpequb 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 2, 0, 0 +; CHECK-FISL: xxsel 34, 35, 34, 36 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test24 @@ -682,8 +610,6 @@ define <2 x i64> @test30(<2 x i64>* %a) { ; CHECK-FISL-LABEL: @test30 ; CHECK-FISL: lxvd2x 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: @test30 @@ -715,8 +641,7 @@ define <4 x float> @test32(<4 x float>* %a) { ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test32 -; CHECK-FISL: lxvw4x 0, 0, 3 -; CHECK-FISL: xxlor 34, 0, 0 +; CHECK-FISL: lxvw4x 34, 0, 3 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test32 @@ -734,8 +659,7 @@ define void @test33(<4 x float>* %a, <4 x float> %b) { ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test33 -; CHECK-FISL: vor 3, 2, 2 -; CHECK-FISL: stxvw4x 35, 0, 3 +; CHECK-FISL: stxvw4x 34, 0, 3 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test33 @@ -770,8 +694,7 @@ define void @test33u(<4 x float>* %a, <4 x float> %b) { ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test33u -; CHECK-FISL: vor 3, 2, 2 -; CHECK-FISL: stxvw4x 35, 0, 3 +; CHECK-FISL: stxvw4x 34, 0, 3 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test33u @@ -789,8 +712,7 @@ define <4 x i32> @test34(<4 x i32>* %a) { ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test34 -; CHECK-FISL: lxvw4x 0, 0, 3 -; CHECK-FISL: xxlor 34, 0, 0 +; CHECK-FISL: lxvw4x 34, 0, 3 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test34 @@ -808,8 +730,7 @@ define void @test35(<4 x i32>* %a, <4 x i32> %b) { ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test35 -; CHECK-FISL: vor 3, 2, 2 -; CHECK-FISL: stxvw4x 35, 0, 3 +; CHECK-FISL: stxvw4x 34, 0, 3 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test35 @@ -1086,10 +1007,7 @@ define <2 x i1> @test65(<2 x i64> %a, <2 x i64> %b) { ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test65 -; CHECK-FISL: vor 4, 3, 3 -; CHECK-FISL: vor 5, 2, 2 -; CHECK-FISL: vcmpequw 4, 5, 4 -; CHECK-FISL: vor 2, 4, 4 +; CHECK-FISL: vcmpequw 2, 2, 3 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test65 @@ -1107,8 +1025,8 @@ define <2 x i1> @test66(<2 x i64> %a, <2 x i64> %b) { ; CHECK-REG: blr ; CHECK-FISL-LABEL: @test66 -; CHECK-FISL: vcmpequw {{[0-9]+}}, 5, 4 -; CHECK-FISL: xxlnor 34, {{[0-9]+}}, {{[0-9]+}} +; CHECK-FISL: vcmpequw 2, 2, 3 +; CHECK-FISL: xxlnor 34, 34, 34 ; CHECK-FISL: blr ; CHECK-LE-LABEL: @test66 |