1; RUN: llc -mtriple=s390x-linux-gnu -mcpu=z10 -mattr=soft-float -O0 < %s | FileCheck %s 2 3; Arithmetic functions 4 5define float @test_addsf3(float %a, float %b) { 6 ; CHECK-LABEL: test_addsf3: 7 ; CHECK: brasl %r14, __addsf3 8 %add = fadd float %a, %b 9 ret float %add 10} 11 12define double @test_adddf3(double %a, double %b) { 13 ; CHECK-LABEL: test_adddf3: 14 ; CHECK: brasl %r14, __adddf3 15 %add = fadd double %a, %b 16 ret double %add 17} 18 19define fp128 @test_addtf3(fp128 %a, fp128 %b) { 20 ; CHECK-LABEL: test_addtf3: 21 ; CHECK: brasl %r14, __addtf3 22 %add = fadd fp128 %a, %b 23 ret fp128 %add 24} 25 26define float @test_mulsf3(float %a, float %b) { 27 ; CHECK-LABEL: test_mulsf3: 28 ; CHECK: brasl %r14, __mulsf3 29 %mul = fmul float %a, %b 30 ret float %mul 31} 32 33define double @test_muldf3(double %a, double %b) { 34 ; CHECK-LABEL: test_muldf3: 35 ; CHECK: brasl %r14, __muldf3 36 %mul = fmul double %a, %b 37 ret double %mul 38} 39 40define fp128 @test_multf3(fp128 %a, fp128 %b) { 41 ; CHECK-LABEL: test_multf3: 42 ; CHECK: brasl %r14, __multf3 43 %mul = fmul fp128 %a, %b 44 ret fp128 %mul 45} 46 47define float @test_subsf3(float %a, float %b) { 48 ; CHECK-LABEL: test_subsf3: 49 ; CHECK: brasl %r14, __subsf3 50 %sub = fsub float %a, %b 51 ret float %sub 52} 53 54define double @test_subdf3(double %a, double %b) { 55 ; CHECK-LABEL: test_subdf3: 56 ; CHECK: brasl %r14, __subdf3 57 %sub = fsub double %a, %b 58 ret double %sub 59} 60 61define fp128 @test_subtf3(fp128 %a, fp128 %b) { 62 ; CHECK-LABEL: test_subtf3: 63 ; CHECK: brasl %r14, __subtf3 64 %sub = fsub fp128 %a, %b 65 ret fp128 %sub 66} 67 68define float @test_divsf3(float %a, float %b) { 69 ; CHECK-LABEL: test_divsf3: 70 ; CHECK: brasl %r14, __divsf3 71 %div = fdiv float %a, %b 72 ret float %div 73} 74 75define double @test_divdf3(double %a, double %b) { 76 ; CHECK-LABEL: test_divdf3: 77 ; CHECK: brasl %r14, __divdf3 78 %div = fdiv double %a, %b 79 ret double %div 80} 81 82define fp128 @test_divtf3(fp128 %a, fp128 %b) { 83 ; CHECK-LABEL: test_divtf3: 84 ; CHECK: brasl %r14, __divtf3 85 %div = fdiv fp128 %a, %b 86 ret fp128 %div 87} 88 89; Comparison functions 90define i1 @test_unordsf2(float %a, float %b) { 91 ; CHECK-LABEL: test_unordsf2: 92 ; CHECK: brasl %r14, __unordsf2 93 %cmp = fcmp uno float %a, %b 94 ret i1 %cmp 95} 96 97define i1 @test_unorddf2(double %a, double %b) { 98 ; CHECK-LABEL: test_unorddf2: 99 ; CHECK: brasl %r14, __unorddf2 100 %cmp = fcmp uno double %a, %b 101 ret i1 %cmp 102} 103 104define i1 @test_unordtf2(fp128 %a, fp128 %b) { 105 ; CHECK-LABEL: test_unordtf2: 106 ; CHECK: brasl %r14, __unordtf2 107 %cmp = fcmp uno fp128 %a, %b 108 ret i1 %cmp 109} 110 111define i1 @test_eqsf2(float %a, float %b) { 112 ; CHECK-LABEL: test_eqsf2: 113 ; CHECK: brasl %r14, __eqsf2 114 %cmp = fcmp oeq float %a, %b 115 ret i1 %cmp 116} 117 118define i1 @test_eqdf2(double %a, double %b) { 119 ; CHECK-LABEL: test_eqdf2: 120 ; CHECK: brasl %r14, __eqdf2 121 %cmp = fcmp oeq double %a, %b 122 ret i1 %cmp 123} 124 125define i1 @test_eqtf2(fp128 %a, fp128 %b) { 126 ; CHECK-LABEL: test_eqtf2: 127 ; CHECK: brasl %r14, __eqtf2 128 %cmp = fcmp oeq fp128 %a, %b 129 ret i1 %cmp 130} 131 132define i1 @test_nesf2(float %a, float %b) { 133 ; CHECK-LABEL: test_nesf2: 134 ; CHECK: brasl %r14, __nesf2 135 %cmp = fcmp une float %a, %b 136 ret i1 %cmp 137} 138 139define i1 @test_nedf2(double %a, double %b) { 140 ; CHECK-LABEL: test_nedf2: 141 ; CHECK: brasl %r14, __nedf2 142 %cmp = fcmp une double %a, %b 143 ret i1 %cmp 144} 145 146define i1 @test_netf2(fp128 %a, fp128 %b) { 147 ; CHECK-LABEL: test_netf2: 148 ; CHECK: brasl %r14, __netf2 149 %cmp = fcmp une fp128 %a, %b 150 ret i1 %cmp 151} 152 153define i1 @test_gesf2(float %a, float %b) { 154 ; CHECK-LABEL: test_gesf2: 155 ; CHECK: brasl %r14, __gesf2 156 %cmp = fcmp oge float %a, %b 157 ret i1 %cmp 158} 159 160define i1 @test_gedf2(double %a, double %b) { 161 ; CHECK-LABEL: test_gedf2: 162 ; CHECK: brasl %r14, __gedf2 163 %cmp = fcmp oge double %a, %b 164 ret i1 %cmp 165} 166 167define i1 @test_getf2(fp128 %a, fp128 %b) { 168 ; CHECK-LABEL: test_getf2: 169 ; CHECK: brasl %r14, __getf2 170 %cmp = fcmp oge fp128 %a, %b 171 ret i1 %cmp 172} 173 174define i1 @test_ltsf2(float %a, float %b) { 175 ; CHECK-LABEL: test_ltsf2: 176 ; CHECK: brasl %r14, __ltsf2 177 %cmp = fcmp olt float %a, %b 178 ret i1 %cmp 179} 180 181define i1 @test_ltdf2(double %a, double %b) { 182 ; CHECK-LABEL: test_ltdf2: 183 ; CHECK: brasl %r14, __ltdf2 184 %cmp = fcmp olt double %a, %b 185 ret i1 %cmp 186} 187 188define i1 @test_lttf2(fp128 %a, fp128 %b) { 189 ; CHECK-LABEL: test_lttf2: 190 ; CHECK: brasl %r14, __lttf2 191 %cmp = fcmp olt fp128 %a, %b 192 ret i1 %cmp 193} 194 195define i1 @test_lesf2(float %a, float %b) { 196 ; CHECK-LABEL: test_lesf2: 197 ; CHECK: brasl %r14, __lesf2 198 %cmp = fcmp ole float %a, %b 199 ret i1 %cmp 200} 201 202define i1 @test_ledf2(double %a, double %b) { 203 ; CHECK-LABEL: test_ledf2: 204 ; CHECK: brasl %r14, __ledf2 205 %cmp = fcmp ole double %a, %b 206 ret i1 %cmp 207} 208 209define i1 @test_letf2(fp128 %a, fp128 %b) { 210 ; CHECK-LABEL: test_letf2: 211 ; CHECK: brasl %r14, __letf2 212 %cmp = fcmp ole fp128 %a, %b 213 ret i1 %cmp 214} 215 216define i1 @test_gtsf2(float %a, float %b) { 217 ; CHECK-LABEL: test_gtsf2: 218 ; CHECK: brasl %r14, __gtsf2 219 %cmp = fcmp ogt float %a, %b 220 ret i1 %cmp 221} 222 223define i1 @test_gtdf2(double %a, double %b) { 224 ; CHECK-LABEL: test_gtdf2: 225 ; CHECK: brasl %r14, __gtdf2 226 %cmp = fcmp ogt double %a, %b 227 ret i1 %cmp 228} 229 230define i1 @test_gttf2(fp128 %a, fp128 %b) { 231 ; CHECK-LABEL: test_gttf2: 232 ; CHECK: brasl %r14, __gttf2 233 %cmp = fcmp ogt fp128 %a, %b 234 ret i1 %cmp 235} 236