@@ -1220,6 +1220,172 @@ define i64 @cmps(i64 %a, i64 %b, fp128 %x, fp128 %y) #0 {
1220
1220
ret i64 %res
1221
1221
}
1222
1222
1223
+ define i64 @cmp_ueq_q (i64 %a , i64 %b , fp128 %x , fp128 %y ) #0 {
1224
+ ; CHECK-LABEL: cmp_ueq_q:
1225
+ ; CHECK: # %bb.0:
1226
+ ; CHECK-NEXT: pushq %rbp
1227
+ ; CHECK-NEXT: pushq %r14
1228
+ ; CHECK-NEXT: pushq %rbx
1229
+ ; CHECK-NEXT: subq $32, %rsp
1230
+ ; CHECK-NEXT: movaps %xmm1, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
1231
+ ; CHECK-NEXT: movaps %xmm0, (%rsp) # 16-byte Spill
1232
+ ; CHECK-NEXT: movq %rsi, %r14
1233
+ ; CHECK-NEXT: movq %rdi, %rbx
1234
+ ; CHECK-NEXT: callq __eqtf2
1235
+ ; CHECK-NEXT: testl %eax, %eax
1236
+ ; CHECK-NEXT: sete %bpl
1237
+ ; CHECK-NEXT: movaps (%rsp), %xmm0 # 16-byte Reload
1238
+ ; CHECK-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload
1239
+ ; CHECK-NEXT: callq __unordtf2
1240
+ ; CHECK-NEXT: testl %eax, %eax
1241
+ ; CHECK-NEXT: setne %al
1242
+ ; CHECK-NEXT: orb %bpl, %al
1243
+ ; CHECK-NEXT: cmoveq %r14, %rbx
1244
+ ; CHECK-NEXT: movq %rbx, %rax
1245
+ ; CHECK-NEXT: addq $32, %rsp
1246
+ ; CHECK-NEXT: popq %rbx
1247
+ ; CHECK-NEXT: popq %r14
1248
+ ; CHECK-NEXT: popq %rbp
1249
+ ; CHECK-NEXT: retq
1250
+ ;
1251
+ ; X86-LABEL: cmp_ueq_q:
1252
+ ; X86: # %bb.0:
1253
+ ; X86-NEXT: pushl %ebp
1254
+ ; X86-NEXT: pushl %ebx
1255
+ ; X86-NEXT: pushl %edi
1256
+ ; X86-NEXT: pushl %esi
1257
+ ; X86-NEXT: subl $12, %esp
1258
+ ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
1259
+ ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
1260
+ ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
1261
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1262
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1263
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1264
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1265
+ ; X86-NEXT: pushl %ebx
1266
+ ; X86-NEXT: movl %ebx, %esi
1267
+ ; X86-NEXT: pushl %edi
1268
+ ; X86-NEXT: pushl %ebp
1269
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1270
+ ; X86-NEXT: calll __eqtf2
1271
+ ; X86-NEXT: addl $32, %esp
1272
+ ; X86-NEXT: testl %eax, %eax
1273
+ ; X86-NEXT: sete %bl
1274
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1275
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1276
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1277
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1278
+ ; X86-NEXT: pushl %esi
1279
+ ; X86-NEXT: pushl %edi
1280
+ ; X86-NEXT: pushl %ebp
1281
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1282
+ ; X86-NEXT: calll __unordtf2
1283
+ ; X86-NEXT: addl $32, %esp
1284
+ ; X86-NEXT: testl %eax, %eax
1285
+ ; X86-NEXT: setne %al
1286
+ ; X86-NEXT: orb %bl, %al
1287
+ ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
1288
+ ; X86-NEXT: leal {{[0-9]+}}(%esp), %ecx
1289
+ ; X86-NEXT: cmovnel %eax, %ecx
1290
+ ; X86-NEXT: movl (%ecx), %eax
1291
+ ; X86-NEXT: movl 4(%ecx), %edx
1292
+ ; X86-NEXT: addl $12, %esp
1293
+ ; X86-NEXT: popl %esi
1294
+ ; X86-NEXT: popl %edi
1295
+ ; X86-NEXT: popl %ebx
1296
+ ; X86-NEXT: popl %ebp
1297
+ ; X86-NEXT: retl
1298
+ %cond = call i1 @llvm.experimental.constrained.fcmp.f128 (
1299
+ fp128 %x , fp128 %y ,
1300
+ metadata !"ueq" ,
1301
+ metadata !"fpexcept.strict" ) #0
1302
+ %res = select i1 %cond , i64 %a , i64 %b
1303
+ ret i64 %res
1304
+ }
1305
+
1306
+ define i64 @cmp_one_q (i64 %a , i64 %b , fp128 %x , fp128 %y ) #0 {
1307
+ ; CHECK-LABEL: cmp_one_q:
1308
+ ; CHECK: # %bb.0:
1309
+ ; CHECK-NEXT: pushq %rbp
1310
+ ; CHECK-NEXT: pushq %r14
1311
+ ; CHECK-NEXT: pushq %rbx
1312
+ ; CHECK-NEXT: subq $32, %rsp
1313
+ ; CHECK-NEXT: movaps %xmm1, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
1314
+ ; CHECK-NEXT: movaps %xmm0, (%rsp) # 16-byte Spill
1315
+ ; CHECK-NEXT: movq %rsi, %r14
1316
+ ; CHECK-NEXT: movq %rdi, %rbx
1317
+ ; CHECK-NEXT: callq __gttf2
1318
+ ; CHECK-NEXT: testl %eax, %eax
1319
+ ; CHECK-NEXT: setg %bpl
1320
+ ; CHECK-NEXT: movaps (%rsp), %xmm0 # 16-byte Reload
1321
+ ; CHECK-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload
1322
+ ; CHECK-NEXT: callq __lttf2
1323
+ ; CHECK-NEXT: testl %eax, %eax
1324
+ ; CHECK-NEXT: sets %al
1325
+ ; CHECK-NEXT: orb %bpl, %al
1326
+ ; CHECK-NEXT: cmoveq %r14, %rbx
1327
+ ; CHECK-NEXT: movq %rbx, %rax
1328
+ ; CHECK-NEXT: addq $32, %rsp
1329
+ ; CHECK-NEXT: popq %rbx
1330
+ ; CHECK-NEXT: popq %r14
1331
+ ; CHECK-NEXT: popq %rbp
1332
+ ; CHECK-NEXT: retq
1333
+ ;
1334
+ ; X86-LABEL: cmp_one_q:
1335
+ ; X86: # %bb.0:
1336
+ ; X86-NEXT: pushl %ebp
1337
+ ; X86-NEXT: pushl %ebx
1338
+ ; X86-NEXT: pushl %edi
1339
+ ; X86-NEXT: pushl %esi
1340
+ ; X86-NEXT: subl $12, %esp
1341
+ ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
1342
+ ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
1343
+ ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
1344
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1345
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1346
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1347
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1348
+ ; X86-NEXT: pushl %ebx
1349
+ ; X86-NEXT: movl %ebx, %esi
1350
+ ; X86-NEXT: pushl %edi
1351
+ ; X86-NEXT: pushl %ebp
1352
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1353
+ ; X86-NEXT: calll __gttf2
1354
+ ; X86-NEXT: addl $32, %esp
1355
+ ; X86-NEXT: testl %eax, %eax
1356
+ ; X86-NEXT: setg %bl
1357
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1358
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1359
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1360
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1361
+ ; X86-NEXT: pushl %esi
1362
+ ; X86-NEXT: pushl %edi
1363
+ ; X86-NEXT: pushl %ebp
1364
+ ; X86-NEXT: pushl {{[0-9]+}}(%esp)
1365
+ ; X86-NEXT: calll __lttf2
1366
+ ; X86-NEXT: addl $32, %esp
1367
+ ; X86-NEXT: testl %eax, %eax
1368
+ ; X86-NEXT: sets %al
1369
+ ; X86-NEXT: orb %bl, %al
1370
+ ; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
1371
+ ; X86-NEXT: leal {{[0-9]+}}(%esp), %ecx
1372
+ ; X86-NEXT: cmovnel %eax, %ecx
1373
+ ; X86-NEXT: movl (%ecx), %eax
1374
+ ; X86-NEXT: movl 4(%ecx), %edx
1375
+ ; X86-NEXT: addl $12, %esp
1376
+ ; X86-NEXT: popl %esi
1377
+ ; X86-NEXT: popl %edi
1378
+ ; X86-NEXT: popl %ebx
1379
+ ; X86-NEXT: popl %ebp
1380
+ ; X86-NEXT: retl
1381
+ %cond = call i1 @llvm.experimental.constrained.fcmp.f128 (
1382
+ fp128 %x , fp128 %y ,
1383
+ metadata !"one" ,
1384
+ metadata !"fpexcept.strict" ) #0
1385
+ %res = select i1 %cond , i64 %a , i64 %b
1386
+ ret i64 %res
1387
+ }
1388
+
1223
1389
attributes #0 = { nounwind strictfp }
1224
1390
1225
1391
declare fp128 @llvm.experimental.constrained.fadd.f128 (fp128 , fp128 , metadata , metadata )
0 commit comments