1 ; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu -O0 < %s | FileCheck %s
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O0 < %s | FileCheck %s
3 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O0 < %s | FileCheck %s
5 ; Testing operations in soft-float mode
6 define double @foo() #0 {
8 %a = alloca double, align 8
9 %b = alloca double, align 8
10 %0 = load double, ptr %a, align 8
11 %1 = load double, ptr %b, align 8
12 %add = fadd double %0, %1
15 ; CHECK-LABEL: __adddf3
18 define double @foo1() #0 {
20 %a = alloca double, align 8
21 %b = alloca double, align 8
22 %0 = load double, ptr %a, align 8
23 %1 = load double, ptr %b, align 8
24 %mul = fmul double %0, %1
27 ; CHECK-LABEL: __muldf3
30 define double @foo2() #0 {
32 %a = alloca double, align 8
33 %b = alloca double, align 8
34 %0 = load double, ptr %a, align 8
35 %1 = load double, ptr %b, align 8
36 %sub = fsub double %0, %1
39 ; CHECK-LABEL: __subdf3
42 define double @foo3() #0 {
44 %a = alloca double, align 8
45 %b = alloca double, align 8
46 %0 = load double, ptr %a, align 8
47 %1 = load double, ptr %b, align 8
48 %div = fdiv double %0, %1
51 ; CHECK-LABEL: __divdf3
54 ; Function Attrs: noinline nounwind optnone uwtable
55 define dso_local zeroext i32 @func(double noundef %0, double noundef %1) #0 {
56 %3 = alloca double, align 8
57 %4 = alloca double, align 8
58 store double %0, ptr %3, align 8
59 store double %1, ptr %4, align 8
60 %5 = load double, ptr %3, align 8
61 %6 = load double, ptr %4, align 8
63 %8 = call double @llvm.fmuladd.f64(double %7, double 0x41F0000000000000, double %5)
64 %9 = fptoui double %8 to i32
67 ; CHECK-LABEL: __muldf3
68 ; CHECK-LABEL: __adddf3
71 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
72 declare double @llvm.fmuladd.f64(double, double, double) #1
74 attributes #0 = {"use-soft-float"="true" }
75 attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }