aboutsummaryrefslogtreecommitdiff
path: root/llvm
diff options
context:
space:
mode:
authorBiplob Mishra <biplmish@in.ibm.com>2020-07-06 18:49:19 -0500
committerLei Huang <lei@ca.ibm.com>2020-07-06 20:29:33 -0500
commit0c6b6e28e70c06a3cb4704d2d8f90829a689e230 (patch)
tree50d4cdcd45e3f9c0037eb0c1f941e4ffcbcf20fc /llvm
parentc13e3e2c2e0c774917bcc7f4f50c29c8133d3a55 (diff)
downloadllvm-0c6b6e28e70c06a3cb4704d2d8f90829a689e230.zip
llvm-0c6b6e28e70c06a3cb4704d2d8f90829a689e230.tar.gz
llvm-0c6b6e28e70c06a3cb4704d2d8f90829a689e230.tar.bz2
[PowerPC] Implement Vector Splat Immediate Builtins in Clang
Implements builtins for the following prototypes: vector signed int vec_splati (const signed int); vector float vec_splati (const float); vector double vec_splatid (const float); vector signed int vec_splati_ins (vector signed int, const unsigned int, const signed int); vector unsigned int vec_splati_ins (vector unsigned int, const unsigned int, const unsigned int); vector float vec_splati_ins (vector float, const unsigned int, const float); Differential Revision: https://reviews.llvm.org/D82520
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/CodeGen/PowerPC/p10-splatImm.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/p10-splatImm.ll b/llvm/test/CodeGen/PowerPC/p10-splatImm.ll
index b468f6d..8bb83c2 100644
--- a/llvm/test/CodeGen/PowerPC/p10-splatImm.ll
+++ b/llvm/test/CodeGen/PowerPC/p10-splatImm.ll
@@ -286,3 +286,21 @@ define dso_local double @testDoubleZeroScalar() local_unnamed_addr {
entry:
ret double 0.000000e+00
}
+
+define dso_local <4 x i32> @vec_splati() local_unnamed_addr {
+; CHECK-LABEL: vec_splati:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: xxspltiw vs34, -17
+; CHECK-NEXT: blr
+entry:
+ ret <4 x i32> <i32 -17, i32 -17, i32 -17, i32 -17>
+}
+
+define dso_local <2 x double> @vec_splatid() local_unnamed_addr {
+; CHECK-LABEL: vec_splatid:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: xxspltidp vs34, 1065353216
+; CHECK-NEXT: blr
+entry:
+ ret <2 x double> <double 1.000000e+00, double 1.000000e+00>
+}