1 ; RUN: llc < %s -march=sparc -mattr=hard-quad-float | FileCheck %s --check-prefix=HARD
2 ; RUN: llc < %s -march=sparc -mattr=-hard-quad-float | FileCheck %s --check-prefix=SOFT
10 ; HARD: faddq [[R0:.+]], [[R1:.+]], [[R2:.+]]
11 ; HARD: fsubq [[R2]], [[R3:.+]], [[R4:.+]]
12 ; HARD: fmulq [[R4]], [[R5:.+]], [[R6:.+]]
13 ; HARD: fdivq [[R6]], [[R2]]
17 ; SOFT-LABEL: f128_ops
29 define void @f128_ops(fp128* noalias sret %scalar.result, fp128* byval %a, fp128* byval %b, fp128* byval %c, fp128* byval %d) {
31 %0 = load fp128* %a, align 8
32 %1 = load fp128* %b, align 8
33 %2 = load fp128* %c, align 8
34 %3 = load fp128* %d, align 8
35 %4 = fadd fp128 %0, %1
36 %5 = fsub fp128 %4, %2
37 %6 = fmul fp128 %5, %3
38 %7 = fdiv fp128 %6, %4
39 store fp128 %7, fp128* %scalar.result, align 8
43 ; HARD-LABEL: f128_spill
44 ; HARD: std %f{{.+}}, [%[[S0:.+]]]
45 ; HARD: std %f{{.+}}, [%[[S1:.+]]]
46 ; HARD-DAG: ldd [%[[S0]]], %f{{.+}}
47 ; HARD-DAG: ldd [%[[S1]]], %f{{.+}}
50 ; SOFT-LABEL: f128_spill
51 ; SOFT: std %f{{.+}}, [%[[S0:.+]]]
52 ; SOFT: std %f{{.+}}, [%[[S1:.+]]]
53 ; SOFT-DAG: ldd [%[[S0]]], %f{{.+}}
54 ; SOFT-DAG: ldd [%[[S1]]], %f{{.+}}
57 define void @f128_spill(fp128* noalias sret %scalar.result, fp128* byval %a) {
59 %0 = load fp128* %a, align 8
60 call void asm sideeffect "", "~{f0},~{f1},~{f2},~{f3},~{f4},~{f5},~{f6},~{f7},~{f8},~{f9},~{f10},~{f11},~{f12},~{f13},~{f14},~{f15},~{f16},~{f17},~{f18},~{f19},~{f20},~{f21},~{f22},~{f23},~{f24},~{f25},~{f26},~{f27},~{f28},~{f29},~{f30},~{f31}"()
61 store fp128 %0, fp128* %scalar.result, align 8
65 ; HARD-LABEL: f128_compare
69 ; SOFT-LABEL: f128_compare
72 define i32 @f128_compare(fp128* byval %f0, fp128* byval %f1, i32 %a, i32 %b) {
74 %0 = load fp128* %f0, align 8
75 %1 = load fp128* %f1, align 8
76 %cond = fcmp ult fp128 %0, %1
77 %ret = select i1 %cond, i32 %a, i32 %b
81 ; HARD-LABEL: f128_compare2
85 ; SOFT-LABEL: f128_compare2
89 define i32 @f128_compare2() {
91 %0 = fcmp ogt fp128 undef, 0xL00000000000000000000000000000000
92 br i1 %0, label %"5", label %"7"
102 ; HARD-LABEL: f128_abs
105 ; SOFT-LABEL: f128_abs
108 define void @f128_abs(fp128* noalias sret %scalar.result, fp128* byval %a) {
110 %0 = load fp128* %a, align 8
111 %1 = tail call fp128 @llvm.fabs.f128(fp128 %0)
112 store fp128 %1, fp128* %scalar.result, align 8
116 declare fp128 @llvm.fabs.f128(fp128) nounwind readonly
118 ; HARD-LABEL: int_to_f128
121 ; SOFT-LABEL: int_to_f128
124 define void @int_to_f128(fp128* noalias sret %scalar.result, i32 %i) {
126 %0 = sitofp i32 %i to fp128
127 store fp128 %0, fp128* %scalar.result, align 8
131 ; HARD-LABEL: fp128_unaligned
137 ; SOFT-LABEL: fp128_unaligned
143 define void @fp128_unaligned(fp128* %a, fp128* %b, fp128* %c) {
145 %0 = load fp128* %a, align 1
146 %1 = load fp128* %b, align 1
147 %2 = fadd fp128 %0, %1
148 store fp128 %2, fp128* %c, align 1
152 ; HARD-LABEL: uint_to_f128
155 ; SOFT-LABEL: uint_to_f128
158 define void @uint_to_f128(fp128* noalias sret %scalar.result, i32 %i) {
160 %0 = uitofp i32 %i to fp128
161 store fp128 %0, fp128* %scalar.result, align 8
165 ; HARD-LABEL: f128_to_i32
169 ; SOFT-LABEL: f128_to_i32
174 define i32 @f128_to_i32(fp128* %a, fp128* %b) {
176 %0 = load fp128* %a, align 8
177 %1 = load fp128* %b, align 8
178 %2 = fptoui fp128 %0 to i32
179 %3 = fptosi fp128 %1 to i32