1 ; The non-strictfp version of test/CodeGen/PowerPC/respect-rounding-mode.ll
2 ; Without strictfp, CSE should be free to eliminate the repeated multiply
3 ; and conversion instructions.
4 ; RUN: llc -verify-machineinstrs --mtriple powerpc64le-unknown-linux-gnu \
5 ; RUN: -mcpu=pwr8 -ppc-asm-full-reg-names < %s | grep 'xvrdpic' | count 2
6 ; RUN: llc -verify-machineinstrs --mtriple powerpc-unknown-linux-gnu \
7 ; RUN: -mcpu=pwr9 -ppc-asm-full-reg-names < %s | grep 'xvrdpic' | count 2
8 ; RUN: llc -verify-machineinstrs --mtriple powerpc64le-unknown-linux-gnu \
9 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names < %s | grep 'xvrdpic' | count 2
11 ; RUN: llc -verify-machineinstrs --mtriple powerpc64le-unknown-linux-gnu \
12 ; RUN: -mcpu=pwr8 -ppc-asm-full-reg-names < %s | grep 'xvmuldp' | count 2
13 ; RUN: llc -verify-machineinstrs --mtriple powerpc-unknown-linux-gnu \
14 ; RUN: -mcpu=pwr9 -ppc-asm-full-reg-names < %s | grep 'xvmuldp' | count 2
15 ; RUN: llc -verify-machineinstrs --mtriple powerpc64le-unknown-linux-gnu \
16 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names < %s | grep 'xvmuldp' | count 2
17 @IndirectCallPtr = dso_local local_unnamed_addr global ptr null, align 8
19 define dso_local signext i32 @func1() local_unnamed_addr #0 {
21 tail call void @directCall() #0
22 %0 = tail call <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double> <double -9.990000e+01, double 9.990000e+01>, metadata !"round.dynamic", metadata !"fpexcept.ignore") #0
23 %vecext = extractelement <2 x double> %0, i32 0
24 %sub = tail call double @llvm.experimental.constrained.fsub.f64(double %vecext, double -9.900000e+01, metadata !"round.dynamic", metadata !"fpexcept.ignore") #0
25 %conv = tail call i32 @llvm.experimental.constrained.fptosi.i32.f64(double %sub, metadata !"fpexcept.ignore") #0
26 tail call void @directCall() #0
27 %1 = tail call <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double> <double -9.990000e+01, double 9.990000e+01>, metadata !"round.dynamic", metadata !"fpexcept.ignore") #0
28 %vecext3 = extractelement <2 x double> %1, i32 1
29 %cmp = tail call i1 @llvm.experimental.constrained.fcmp.f64(double %vecext3, double 9.900000e+01, metadata !"une", metadata !"fpexcept.ignore") #0
30 br i1 %cmp, label %if.then, label %if.end
32 if.then: ; preds = %entry
33 tail call void @exit(i32 signext 2) #0
36 if.end: ; preds = %entry
40 declare void @directCall(...) local_unnamed_addr
42 declare double @llvm.experimental.constrained.fsub.f64(double, double, metadata, metadata)
44 declare i32 @llvm.experimental.constrained.fptosi.i32.f64(double, metadata)
46 declare i1 @llvm.experimental.constrained.fcmp.f64(double, double, metadata, metadata)
48 declare void @exit(i32 signext) local_unnamed_addr
50 define dso_local signext i32 @func2() local_unnamed_addr #0 {
52 %call = tail call <2 x double> @getvector1() #0
53 %call1 = tail call <2 x double> @getvector2() #0
54 tail call void @directCall() #0
55 %mul = tail call <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double> %call, <2 x double> %call1, metadata !"round.dynamic", metadata !"fpexcept.ignore") #0
56 %vecext = extractelement <2 x double> %mul, i32 0
57 %cmp = tail call i1 @llvm.experimental.constrained.fcmp.f64(double %vecext, double 4.000000e+00, metadata !"oeq", metadata !"fpexcept.ignore") #0
58 br i1 %cmp, label %cleanup, label %if.end
60 if.end: ; preds = %entry
61 tail call void @directCall() #0
62 %mul10 = tail call <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double> %call, <2 x double> %call1, metadata !"round.dynamic", metadata !"fpexcept.ignore") #0
63 %0 = tail call i32 @llvm.ppc.vsx.xvcmpeqdp.p(i32 2, <2 x double> %mul, <2 x double> %mul10) #0
66 cleanup: ; preds = %entry, %if.end
67 %retval.0 = phi i32 [ %0, %if.end ], [ 11, %entry ]
71 declare <2 x double> @getvector1(...) local_unnamed_addr
73 declare <2 x double> @getvector2(...) local_unnamed_addr
75 declare <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double>, <2 x double>, metadata, metadata)
77 declare i32 @llvm.ppc.vsx.xvcmpeqdp.p(i32, <2 x double>, <2 x double>)
79 define dso_local signext i32 @func3() local_unnamed_addr #0 {
81 %0 = load ptr, ptr @IndirectCallPtr, align 8
82 tail call void %0() #0
83 %1 = tail call <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double> <double -9.990000e+01, double 9.990000e+01>, metadata !"round.dynamic", metadata !"fpexcept.ignore") #0
84 %vecext = extractelement <2 x double> %1, i32 0
85 %sub = tail call double @llvm.experimental.constrained.fsub.f64(double %vecext, double -9.900000e+01, metadata !"round.dynamic", metadata !"fpexcept.ignore") #0
86 %conv = tail call i32 @llvm.experimental.constrained.fptosi.i32.f64(double %sub, metadata !"fpexcept.ignore") #0
87 %2 = load ptr, ptr @IndirectCallPtr, align 8
88 tail call void %2() #0
89 %3 = tail call <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double> <double -9.990000e+01, double 9.990000e+01>, metadata !"round.dynamic", metadata !"fpexcept.ignore") #0
90 %vecext4 = extractelement <2 x double> %3, i32 1
91 %cmp = tail call i1 @llvm.experimental.constrained.fcmp.f64(double %vecext4, double 9.900000e+01, metadata !"une", metadata !"fpexcept.ignore") #0
92 br i1 %cmp, label %if.then, label %if.end
94 if.then: ; preds = %entry
95 tail call void @exit(i32 signext 2) #0
98 if.end: ; preds = %entry
102 define dso_local signext i32 @func4() local_unnamed_addr #0 {
104 %call = tail call <2 x double> @getvector1() #0
105 %call1 = tail call <2 x double> @getvector2() #0
106 %0 = load ptr, ptr @IndirectCallPtr, align 8
107 tail call void %0() #0
108 %mul = tail call <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double> %call, <2 x double> %call1, metadata !"round.dynamic", metadata !"fpexcept.ignore") #0
109 %vecext = extractelement <2 x double> %mul, i32 0
110 %cmp = tail call i1 @llvm.experimental.constrained.fcmp.f64(double %vecext, double 4.000000e+00, metadata !"oeq", metadata !"fpexcept.ignore") #0
111 br i1 %cmp, label %cleanup, label %if.end
113 if.end: ; preds = %entry
114 %1 = load ptr, ptr @IndirectCallPtr, align 8
115 tail call void %1() #0
116 %mul11 = tail call <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double> %call, <2 x double> %call1, metadata !"round.dynamic", metadata !"fpexcept.ignore") #0
117 %2 = tail call i32 @llvm.ppc.vsx.xvcmpeqdp.p(i32 2, <2 x double> %mul, <2 x double> %mul11) #0
120 cleanup: ; preds = %entry, %if.end
121 %retval.0 = phi i32 [ %2, %if.end ], [ 11, %entry ]
125 declare <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double>, metadata, metadata)
127 attributes #0 = { nounwind }