Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Commit e6139f6

Browse files
author
nemanjai
committed
[PowerPC] Implement vec_insert_exp builtins - llvm portion
This revision corresponds to review: https://reviews.llvm.org/D25957. Committing on behalf of Zaara Syeda. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285225 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent b48c442 commit e6139f6

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

include/llvm/IR/IntrinsicsPowerPC.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,12 @@ def int_ppc_vsx_xvcmpgtsp_p : GCCBuiltin<"__builtin_vsx_xvcmpgtsp_p">,
782782
def int_ppc_vsx_xxleqv :
783783
PowerPC_VSX_Intrinsic<"xxleqv", [llvm_v4i32_ty],
784784
[llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
785+
def int_ppc_vsx_xviexpdp :
786+
PowerPC_VSX_Intrinsic<"xviexpdp",[llvm_v2f64_ty],
787+
[llvm_v2i64_ty, llvm_v2i64_ty],[IntrNoMem]>;
788+
def int_ppc_vsx_xviexpsp :
789+
PowerPC_VSX_Intrinsic<"xviexpsp",[llvm_v4f32_ty],
790+
[llvm_v4i32_ty, llvm_v4i32_ty],[IntrNoMem]>;
785791
}
786792

787793
//===----------------------------------------------------------------------===//

lib/Target/PowerPC/PPCInstrVSX.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,9 +2191,9 @@ let AddedComplexity = 400, Predicates = [HasP9Vector] in {
21912191

21922192
// Vector Insert Exponent DP/SP
21932193
def XVIEXPDP : XX3_XT5_XA5_XB5<60, 248, "xviexpdp", vsrc, vsrc, vsrc,
2194-
IIC_VecFP, []>;
2194+
IIC_VecFP, [(set v2f64: $XT,(int_ppc_vsx_xviexpdp v2i64:$XA, v2i64:$XB))]>;
21952195
def XVIEXPSP : XX3_XT5_XA5_XB5<60, 216, "xviexpsp", vsrc, vsrc, vsrc,
2196-
IIC_VecFP, []>;
2196+
IIC_VecFP, [(set v4f32: $XT,(int_ppc_vsx_xviexpsp v4i32:$XA, v4i32:$XB))]>;
21972197

21982198
// Vector Extract Exponent/Significand DP/SP
21992199
def XVXEXPDP : XX2_XT6_XO5_XB6<60, 0, 475, "xvxexpdp", vsrc, []>;

test/CodeGen/PowerPC/vsx-p9.ll

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,28 @@ entry:
143143
ret void
144144
}
145145

146+
; Function Attrs: nounwind readnone
147+
define <4 x float> @testXVIEXPSP(<4 x i32> %a, <4 x i32> %b) {
148+
entry:
149+
%0 = tail call <4 x float> @llvm.ppc.vsx.xviexpsp(<4 x i32> %a, <4 x i32> %b)
150+
ret <4 x float> %0
151+
; CHECK-LABEL: testXVIEXPSP
152+
; CHECK: xviexpsp 34, 34, 35
153+
; CHECK: blr
154+
}
155+
; Function Attrs: nounwind readnone
156+
declare <4 x float> @llvm.ppc.vsx.xviexpsp(<4 x i32>, <4 x i32>)
157+
158+
; Function Attrs: nounwind readnone
159+
define <2 x double> @testXVIEXPDP(<2 x i64> %a, <2 x i64> %b) {
160+
entry:
161+
%0 = tail call <2 x double> @llvm.ppc.vsx.xviexpdp(<2 x i64> %a, <2 x i64> %b)
162+
ret <2 x double> %0
163+
; CHECK-LABEL: testXVIEXPDP
164+
; CHECK: xviexpdp 34, 34, 35
165+
; CHECK: blr
166+
}
167+
; Function Attrs: nounwind readnone
168+
declare <2 x double> @llvm.ppc.vsx.xviexpdp(<2 x i64>, <2 x i64>)
169+
146170
declare void @sink(...)

0 commit comments

Comments
 (0)