1 ; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu -O0 < %s | FileCheck %s
3 @ld = common global ppc_fp128 0xM00000000000000000000000000000000, align 16
4 @ld2 = common global ppc_fp128 0xM00000000000000000000000000000000, align 16
5 @d = common global double 0.000000e+00, align 8
6 @f = common global float 0.000000e+00, align 4
7 @i = common global i32 0, align 4
8 @ui = common global i32 0, align 4
9 @var = common global i8 0, align 1
11 define void @foo() #0 {
13 %c = alloca ppc_fp128, align 16
14 %0 = load ppc_fp128, ptr @ld, align 16
15 %1 = load ppc_fp128, ptr @ld2, align 16
16 %add = fadd ppc_fp128 %0, %1
17 store volatile ppc_fp128 %add, ptr %c, align 16
18 %2 = load ppc_fp128, ptr @ld, align 16
19 %3 = load ppc_fp128, ptr @ld2, align 16
20 %sub = fsub ppc_fp128 %2, %3
21 store volatile ppc_fp128 %sub, ptr %c, align 16
22 %4 = load ppc_fp128, ptr @ld, align 16
23 %5 = load ppc_fp128, ptr @ld2, align 16
24 %mul = fmul ppc_fp128 %4, %5
25 store volatile ppc_fp128 %mul, ptr %c, align 16
26 %6 = load ppc_fp128, ptr @ld, align 16
27 %7 = load ppc_fp128, ptr @ld2, align 16
28 %div = fdiv ppc_fp128 %6, %7
29 store volatile ppc_fp128 %div, ptr %c, align 16
32 ; CHECK-LABEL: __gcc_qadd
33 ; CHECK-LABEL: __gcc_qsub
34 ; CHECK-LABEL: __gcc_qmul
35 ; CHECK-LABEL: __gcc_qdiv
38 define void @foo1() #0 {
40 %0 = load double, ptr @d, align 8
41 %conv = fpext double %0 to ppc_fp128
42 store ppc_fp128 %conv, ptr @ld, align 16
45 ; CHECK-LABEL: __gcc_dtoq
48 define void @foo2() #0 {
50 %0 = load ppc_fp128, ptr @ld, align 16
51 %conv = fptrunc ppc_fp128 %0 to double
52 store double %conv, ptr @d, align 8
55 ; CHECK-LABEL: __gcc_qtod
58 define void @foo3() #0 {
60 %0 = load ppc_fp128, ptr @ld, align 16
61 %conv = fptrunc ppc_fp128 %0 to float
62 store float %conv, ptr @f, align 4
65 ; CHECK-LABEL: __gcc_qtos
68 define void @foo4() #0 {
70 %0 = load i32, ptr @i, align 4
71 %conv = sitofp i32 %0 to ppc_fp128
72 store ppc_fp128 %conv, ptr @ld, align 16
75 ; CHECK-LABEL: __gcc_itoq
78 define void @foo5() #0 {
80 %0 = load i32, ptr @ui, align 4
81 %conv = uitofp i32 %0 to ppc_fp128
82 store ppc_fp128 %conv, ptr @ld, align 16
85 ; CHECK-LABEL: __gcc_utoq
88 define void @foo6() #0 {
90 %0 = load ppc_fp128, ptr @ld, align 16
91 %1 = load ppc_fp128, ptr @ld2, align 16
92 %cmp = fcmp oeq ppc_fp128 %0, %1
93 %conv = zext i1 %cmp to i32
94 %conv1 = trunc i32 %conv to i8
95 store i8 %conv1, ptr @var, align 1
98 ; CHECK-LABEL: __gcc_qeq
101 define void @foo7() #0 {
103 %0 = load ppc_fp128, ptr @ld, align 16
104 %1 = load ppc_fp128, ptr @ld2, align 16
105 %cmp = fcmp une ppc_fp128 %0, %1
106 %conv = zext i1 %cmp to i32
107 %conv1 = trunc i32 %conv to i8
108 store i8 %conv1, ptr @var, align 1
111 ; CHECK-LABEL: __gcc_qne
114 define void @foo8() #0 {
116 %0 = load ppc_fp128, ptr @ld, align 16
117 %1 = load ppc_fp128, ptr @ld2, align 16
118 %cmp = fcmp ogt ppc_fp128 %0, %1
119 %conv = zext i1 %cmp to i32
120 %conv1 = trunc i32 %conv to i8
121 store i8 %conv1, ptr @var, align 1
124 ; CHECK-LABEL: __gcc_qgt
127 define void @foo9() #0 {
129 %0 = load ppc_fp128, ptr @ld, align 16
130 %1 = load ppc_fp128, ptr @ld2, align 16
131 %cmp = fcmp olt ppc_fp128 %0, %1
132 %conv = zext i1 %cmp to i32
133 %conv1 = trunc i32 %conv to i8
134 store i8 %conv1, ptr @var, align 1
137 ; CHECK-LABEL: __gcc_qlt
140 define void @foo10() #0 {
142 %0 = load ppc_fp128, ptr @ld, align 16
143 %1 = load ppc_fp128, ptr @ld2, align 16
144 %cmp = fcmp ole ppc_fp128 %0, %1
145 %conv = zext i1 %cmp to i32
146 %conv1 = trunc i32 %conv to i8
147 store i8 %conv1, ptr @var, align 1
150 ; CHECK-LABEL: __gcc_qle
153 define void @foo11() #0 {
155 %0 = load ppc_fp128, ptr @ld, align 16
156 %1 = load ppc_fp128, ptr @ld, align 16
157 %cmp = fcmp une ppc_fp128 %0, %1
158 %conv = zext i1 %cmp to i32
159 %conv1 = trunc i32 %conv to i8
160 store i8 %conv1, ptr @var, align 1
163 ; CHECK-LABEL: __gcc_qunord
166 define void @foo12() #0 {
168 %0 = load ppc_fp128, ptr @ld, align 16
169 %1 = load ppc_fp128, ptr @ld2, align 16
170 %cmp = fcmp oge ppc_fp128 %0, %1
171 %conv = zext i1 %cmp to i32
172 %conv1 = trunc i32 %conv to i8
173 store i8 %conv1, ptr @var, align 1
176 ; CHECK-LABEL: __gcc_qge
179 attributes #0 = { "use-soft-float"="true" }