summaryrefslogtreecommitdiff
path: root/test/CodeGen/PowerPC/p9-xxinsertw-xxextractuw.ll
diff options
context:
space:
mode:
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>2016-09-14 14:19:09 +0000
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>2016-09-14 14:19:09 +0000
commit7328eb75584fc800cc0762611800837af2e145a3 (patch)
treebdb6111e9f2baf03506bf87f7b429f21f9d3f91b /test/CodeGen/PowerPC/p9-xxinsertw-xxextractuw.ll
parent707666e59d26c30c077961eb36d52d87ff5bc47e (diff)
Fix code-gen crash on Power9 for insert_vector_elt with variable index (PR30189)
This patch corresponds to review: https://reviews.llvm.org/D24021 In the initial implementation of this instruction, I forgot to account for variable indices. This patch fixes PR30189 and should probably be merged into 3.9.1 (I'll open a bug according to the new instructions). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281479 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PowerPC/p9-xxinsertw-xxextractuw.ll')
-rw-r--r--test/CodeGen/PowerPC/p9-xxinsertw-xxextractuw.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/p9-xxinsertw-xxextractuw.ll b/test/CodeGen/PowerPC/p9-xxinsertw-xxextractuw.ll
index ac187e08425..fa2844b8d55 100644
--- a/test/CodeGen/PowerPC/p9-xxinsertw-xxextractuw.ll
+++ b/test/CodeGen/PowerPC/p9-xxinsertw-xxextractuw.ll
@@ -968,3 +968,25 @@ entry:
%vecins = shufflevector <4 x float> %a, <4 x float> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 6>
ret <4 x float> %vecins
}
+define <4 x float> @insertVarF(<4 x float> %a, float %f, i32 %el) {
+entry:
+; CHECK-LABEL: insertVarF
+; CHECK: stxsspx 1,
+; CHECK: lxvd2x
+; CHECK-BE-LABEL: insertVarF
+; CHECK-BE: stxsspx 1,
+; CHECK-BE: lxvw4x
+ %vecins = insertelement <4 x float> %a, float %f, i32 %el
+ ret <4 x float> %vecins
+}
+define <4 x i32> @insertVarI(<4 x i32> %a, i32 %i, i32 %el) {
+entry:
+; CHECK-LABEL: insertVarI
+; CHECK: stwx
+; CHECK: lxvd2x
+; CHECK-BE-LABEL: insertVarI
+; CHECK-BE: stwx
+; CHECK-BE: lxvw4x
+ %vecins = insertelement <4 x i32> %a, i32 %i, i32 %el
+ ret <4 x i32> %vecins
+}