1 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 | FileCheck %s
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 | FileCheck %s
3 @a = global float 3.000000e+00, align 4
4 @b = global float 4.000000e+00, align 4
5 @c = global double 3.000000e+00, align 8
6 @d = global double 4.000000e+00, align 8
8 ; Function Attrs: nounwind
9 define float @emit_xsaddsp() {
11 %0 = load float, float* @a, align 4
12 %1 = load float, float* @b, align 4
13 %add = fadd float %0, %1
15 ; CHECK-LABEL: @emit_xsaddsp
16 ; CHECK: xsaddsp {{[0-9]+}}
19 ; Function Attrs: nounwind
20 define float @emit_xssubsp() {
22 %0 = load float, float* @a, align 4
23 %1 = load float, float* @b, align 4
24 %sub = fsub float %0, %1
26 ; CHECK-LABEL: @emit_xssubsp
27 ; CHECK: xssubsp {{[0-9]+}}
30 ; Function Attrs: nounwind
31 define float @emit_xsdivsp() {
33 %0 = load float, float* @a, align 4
34 %1 = load float, float* @b, align 4
35 %div = fdiv float %0, %1
37 ; CHECK-LABEL: @emit_xsdivsp
38 ; CHECK: xsdivsp {{[0-9]+}}
41 ; Function Attrs: nounwind
42 define float @emit_xsmulsp() {
44 %0 = load float, float* @a, align 4
45 %1 = load float, float* @b, align 4
46 %mul = fmul float %0, %1
48 ; CHECK-LABEL: @emit_xsmulsp
49 ; CHECK: xsmulsp {{[0-9]+}}
52 ; Function Attrs: nounwind
53 define float @emit_xssqrtsp() {
55 %0 = load float, float* @b, align 4
56 %call = call float @sqrtf(float %0)
58 ; CHECK-LABEL: @emit_xssqrtsp
59 ; CHECK: xssqrtsp {{[0-9]+}}
62 ; Function Attrs: nounwind
63 declare float @sqrtf(float)
65 ; Function Attrs: nounwind
66 define double @emit_xsadddp() {
68 %0 = load double, double* @c, align 8
69 %1 = load double, double* @d, align 8
70 %add = fadd double %0, %1
72 ; CHECK-LABEL: @emit_xsadddp
73 ; CHECK: xsadddp {{[0-9]+}}
76 ; Function Attrs: nounwind
77 define double @emit_xssubdp() {
79 %0 = load double, double* @c, align 8
80 %1 = load double, double* @d, align 8
81 %sub = fsub double %0, %1
83 ; CHECK-LABEL: @emit_xssubdp
84 ; CHECK: xssubdp {{[0-9]+}}
87 ; Function Attrs: nounwind
88 define double @emit_xsdivdp() {
90 %0 = load double, double* @c, align 8
91 %1 = load double, double* @d, align 8
92 %div = fdiv double %0, %1
94 ; CHECK-LABEL: @emit_xsdivdp
95 ; CHECK: xsdivdp {{[0-9]+}}
98 ; Function Attrs: nounwind
99 define double @emit_xsmuldp() {
101 %0 = load double, double* @c, align 8
102 %1 = load double, double* @d, align 8
103 %mul = fmul double %0, %1
105 ; CHECK-LABEL: @emit_xsmuldp
106 ; CHECK: xsmuldp {{[0-9]+}}
109 ; Function Attrs: nounwind
110 define double @emit_xssqrtdp() {
112 %0 = load double, double* @d, align 8
113 %call = call double @sqrt(double %0)
115 ; CHECK-LABEL: @emit_xssqrtdp
116 ; CHECK: xssqrtdp {{[0-9]+}}
120 ; Function Attrs: nounwind
121 define <4 x float> @emit_xvrsqrtesp() {
123 ; CHECK-LABEL: @emit_xvrsqrtesp
124 %vf = alloca <4 x float>, align 16
125 %vfr = alloca <4 x float>, align 16
126 %0 = load <4 x float>, <4 x float>* %vf, align 16
127 %call = call <4 x float> @llvm.ppc.vsx.xvrsqrtesp(<4 x float> %0)
128 ; CHECK: xvrsqrtesp {{[0-9]+}}, {{[0-9]+}}
129 ret <4 x float> %call
132 ; Function Attrs: nounwind
133 define <2 x double> @emit_xvrsqrtedp() {
135 ; CHECK-LABEL: @emit_xvrsqrtedp
136 %vd = alloca <2 x double>, align 16
137 %vdr = alloca <2 x double>, align 16
138 %0 = load <2 x double>, <2 x double>* %vd, align 16
139 %call = call <2 x double> @llvm.ppc.vsx.xvrsqrtedp(<2 x double> %0)
140 ret <2 x double> %call
141 ; CHECK: xvrsqrtedp {{[0-9]+}}, {{[0-9]+}}
144 ; Function Attrs: nounwind
145 declare double @sqrt(double)
147 ; Function Attrs: nounwind readnone
148 declare <4 x float> @llvm.ppc.vsx.xvrsqrtesp(<4 x float>)
150 ; Function Attrs: nounwind readnone
151 declare <2 x double> @llvm.ppc.vsx.xvrsqrtedp(<2 x double>)