diff options
| author | Oliver Stannard <oliver.stannard@arm.com> | 2018-09-28 08:27:56 +0000 |
|---|---|---|
| committer | Oliver Stannard <oliver.stannard@arm.com> | 2018-09-28 08:27:56 +0000 |
| commit | 5f34e9e265f87af4b5f1b64e885d5eaf58a904a2 (patch) | |
| tree | 76eab67023aebeda9067d1f15d3a3d4e6df9a0cf /llvm/lib/Target/ARM/AsmParser | |
| parent | 280af1c7f0cce6fe15e7074c0724ded7cca23038 (diff) | |
| download | bcm5719-llvm-5f34e9e265f87af4b5f1b64e885d5eaf58a904a2.tar.gz bcm5719-llvm-5f34e9e265f87af4b5f1b64e885d5eaf58a904a2.zip | |
[ARM][v8.5A] Add speculation barriers SSBB and PSSBB
This adds two new barrier instructions which can be used to restrict
speculative execution of load instructions.
Patch by Pablo Barrio!
Differential revision: https://reviews.llvm.org/D52484
llvm-svn: 343300
Diffstat (limited to 'llvm/lib/Target/ARM/AsmParser')
| -rw-r--r-- | llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index c5b2d2d5968..f837db56264 100644 --- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -5721,7 +5721,8 @@ void ARMAsmParser::getMnemonicAcceptInfo(StringRef Mnemonic, StringRef FullInst, Mnemonic == "vudot" || Mnemonic == "vsdot" || Mnemonic == "vcmla" || Mnemonic == "vcadd" || Mnemonic == "vfmal" || Mnemonic == "vfmsl" || - Mnemonic == "sb") { + Mnemonic == "sb" || Mnemonic == "ssbb" || + Mnemonic == "pssbb") { // These mnemonics are never predicable CanAcceptPredicationCode = false; } else if (!isThumb()) { @@ -6824,6 +6825,26 @@ bool ARMAsmParser::validateInstruction(MCInst &Inst, "code specified"); break; } + case ARM::DSB: + case ARM::t2DSB: { + + if (Inst.getNumOperands() < 2) + break; + + unsigned Option = Inst.getOperand(0).getImm(); + unsigned Pred = Inst.getOperand(1).getImm(); + + // SSBB and PSSBB (DSB #0|#4) are not predicable (pred must be AL). + if (Option == 0 && Pred != ARMCC::AL) + return Error(Operands[1]->getStartLoc(), + "instruction 'ssbb' is not predicable, but condition code " + "specified"); + if (Option == 4 && Pred != ARMCC::AL) + return Error(Operands[1]->getStartLoc(), + "instruction 'pssbb' is not predicable, but condition code " + "specified"); + break; + } case ARM::VMOVRRS: { // Source registers must be sequential. const unsigned Sm = MRI->getEncodingValue(Inst.getOperand(2).getReg()); |

