# Changeset View

Changeset View

# Standalone View

Standalone View

# lib/Target/AArch64/AArch64InstrInfo.td

- This file is larger than 256 KB, so syntax highlighting is disabled by default.

Show First 20 Lines • Show All 1373 Lines • ▼ Show 20 Line(s) | |||||

1374 | def TLSDESC_CALLSEQ | 1374 | def TLSDESC_CALLSEQ | ||

1375 | : Pseudo<(outs), (ins i64imm:$sym), | 1375 | : Pseudo<(outs), (ins i64imm:$sym), | ||

1376 | [(AArch64tlsdesc_callseq tglobaltlsaddr:$sym)]>, | 1376 | [(AArch64tlsdesc_callseq tglobaltlsaddr:$sym)]>, | ||

1377 | Sched<[WriteI, WriteLD, WriteI, WriteBrReg]>; | 1377 | Sched<[WriteI, WriteLD, WriteI, WriteBrReg]>; | ||

1378 | def : Pat<(AArch64tlsdesc_callseq texternalsym:$sym), | 1378 | def : Pat<(AArch64tlsdesc_callseq texternalsym:$sym), | ||

1379 | (TLSDESC_CALLSEQ texternalsym:$sym)>; | 1379 | (TLSDESC_CALLSEQ texternalsym:$sym)>; | ||

1380 | 1380 | | |||

1381 | //===----------------------------------------------------------------------===// | 1381 | //===----------------------------------------------------------------------===// | ||

1382 | // Speculation barrier intrinsics | ||||

1383 | //===----------------------------------------------------------------------===// | ||||

1384 | multiclass NoSpeculateLoad<RegisterClass ValueClass, code TypeCheck> { | ||||

1385 | def _both_frag : PatFrag<(ops node:$ptr, node:$lower_bound, | ||||

1386 | node:$upper_bound, node:$failval, | ||||

1387 | node:$cmpptr), | ||||

1388 | (nospeculateload node:$ptr, node:$lower_bound, | ||||

1389 | node:$upper_bound, node:$failval, | ||||

1390 | node:$cmpptr), TypeCheck>; | ||||

1391 | def _nolower_frag : PatFrag<(ops node:$ptr, | ||||

1392 | node:$upper_bound, node:$failval, | ||||

1393 | node:$cmpptr), | ||||

1394 | (nospeculateload_nolower node:$ptr, | ||||

1395 | node:$upper_bound, node:$failval, | ||||

1396 | node:$cmpptr), TypeCheck>; | ||||

1397 | def _noupper_frag : PatFrag<(ops node:$ptr, node:$lower_bound, | ||||

1398 | node:$failval, node:$cmpptr), | ||||

1399 | (nospeculateload_noupper node:$ptr, node:$lower_bound, | ||||

1400 | node:$failval, | ||||

1401 | node:$cmpptr), TypeCheck>; | ||||

1402 | | ||||

1403 | let hasSideEffects = 1, isCodeGenOnly = 1, Defs = [NZCV], mayLoad = 1, | ||||

1404 | Constraints = "@earlyclobber $dst" in { | ||||

1405 | let Size = 24 in | ||||

1406 | def _both | ||||

1407 | : Pseudo<(outs ValueClass:$dst), | ||||

1408 | (ins GPR64sp:$ptr, GPR64:$lower_bound, | ||||

1409 | GPR64:$upper_bound, ValueClass:$failval, GPR64:$cmpptr), | ||||

1410 | [(set ValueClass:$dst, | ||||

1411 | (!cast<SDNode>(NAME # "_both_frag") GPR64sp:$ptr, | ||||

1412 | GPR64:$lower_bound, GPR64:$upper_bound, | ||||

1413 | ValueClass:$failval, GPR64:$cmpptr))]>, | ||||

1414 | Sched<[]>; | ||||

1415 | let Size = 20 in | ||||

1416 | def _nolower | ||||

1417 | : Pseudo<(outs ValueClass:$dst), | ||||

1418 | (ins GPR64sp:$ptr, GPR64:$upper_bound, | ||||

1419 | ValueClass:$failval, GPR64:$cmpptr), | ||||

1420 | [(set ValueClass:$dst, | ||||

1421 | (!cast<SDNode>(NAME # "_nolower_frag") GPR64sp:$ptr, | ||||

1422 | GPR64:$upper_bound, ValueClass:$failval, | ||||

1423 | GPR64:$cmpptr))]>, | ||||

1424 | Sched<[]>; | ||||

1425 | let Size = 20 in | ||||

1426 | def _noupper | ||||

1427 | : Pseudo<(outs ValueClass:$dst), | ||||

1428 | (ins GPR64sp:$ptr, GPR64:$lower_bound, | ||||

1429 | ValueClass:$failval, GPR64:$cmpptr), | ||||

1430 | [(set ValueClass:$dst, | ||||

1431 | (!cast<SDNode>(NAME # "_noupper_frag") GPR64sp:$ptr, | ||||

1432 | GPR64:$lower_bound, ValueClass:$failval, | ||||

1433 | GPR64:$cmpptr))]>, | ||||

1434 | Sched<[]>; | ||||

1435 | } | ||||

1436 | } | ||||

1437 | | ||||

1438 | defm NoSpeculateLoadX: NoSpeculateLoad<GPR64, | ||||

1439 | [{return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i64;}]>; | ||||

1440 | defm NoSpeculateLoadW: NoSpeculateLoad<GPR32, | ||||

1441 | [{return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i32;}]>; | ||||

1442 | defm NoSpeculateLoadH: NoSpeculateLoad<GPR32, | ||||

1443 | [{return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i16;}]>; | ||||

1444 | defm NoSpeculateLoadB: NoSpeculateLoad<GPR32, | ||||

1445 | [{return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i8;}]>; | ||||

1446 | | ||||

1447 | let hasSideEffects = 1, isCodeGenOnly = 1, Defs = [NZCV], | ||||

1448 | mayLoad = 1, Constraints = "@earlyclobber $dstlo,@earlyclobber $dsthi" in { | ||||

1449 | let Size = 28 in | ||||

1450 | def NoSpeculateLoadXPair_both | ||||

1451 | : Pseudo<(outs GPR64:$dstlo, GPR64:$dsthi), | ||||

1452 | (ins GPR64sp:$ptr, GPR64:$lower_bound, | ||||

1453 | GPR64:$upper_bound, GPR64:$failvallo, | ||||

1454 | GPR64:$failvalhi, GPR64:$cmpptr), | ||||

1455 | []>, | ||||

1456 | Sched<[]>; | ||||

1457 | let Size = 24 in | ||||

1458 | def NoSpeculateLoadXPair_nolower | ||||

1459 | : Pseudo<(outs GPR64:$dstlo, GPR64:$dsthi), | ||||

1460 | (ins GPR64sp:$ptr, | ||||

1461 | GPR64:$upper_bound, GPR64:$failvallo, | ||||

1462 | GPR64:$failvalhi, GPR64:$cmpptr), | ||||

1463 | []>, | ||||

1464 | Sched<[]>; | ||||

1465 | let Size = 24 in | ||||

1466 | def NoSpeculateLoadXPair_noupper | ||||

1467 | : Pseudo<(outs GPR64:$dstlo, GPR64:$dsthi), | ||||

1468 | (ins GPR64sp:$ptr, GPR64:$lower_bound, | ||||

1469 | GPR64:$failvallo, | ||||

1470 | GPR64:$failvalhi, GPR64:$cmpptr), | ||||

1471 | []>, | ||||

1472 | Sched<[]>; | ||||

1473 | } | ||||

1474 | | ||||

1475 | //===----------------------------------------------------------------------===// | ||||

1382 | // Conditional branch (immediate) instruction. | 1476 | // Conditional branch (immediate) instruction. | ||

1383 | //===----------------------------------------------------------------------===// | 1477 | //===----------------------------------------------------------------------===// | ||

1384 | def Bcc : BranchCond; | 1478 | def Bcc : BranchCond; | ||

1385 | 1479 | | |||

1386 | //===----------------------------------------------------------------------===// | 1480 | //===----------------------------------------------------------------------===// | ||

1387 | // Compare-and-branch instructions. | 1481 | // Compare-and-branch instructions. | ||

1388 | //===----------------------------------------------------------------------===// | 1482 | //===----------------------------------------------------------------------===// | ||

1389 | defm CBZ : CmpBranch<0, "cbz", AArch64cbz>; | 1483 | defm CBZ : CmpBranch<0, "cbz", AArch64cbz>; | ||

▲ Show 20 Lines • Show All 4889 Lines • Show Last 20 Lines |