diff options
| author | Charlie Turner <charlie.turner@arm.com> | 2014-12-01 08:39:19 +0000 |
|---|---|---|
| committer | Charlie Turner <charlie.turner@arm.com> | 2014-12-01 08:39:19 +0000 |
| commit | 7de905cd172a908b96fa523575dbca4df52445ca (patch) | |
| tree | 838f42573770fecc23c66052e4a0cd8d0a19541d /llvm/lib | |
| parent | 4d88ae20026521a4a5ff1a8f74f482242c63f8c9 (diff) | |
| download | bcm5719-llvm-7de905cd172a908b96fa523575dbca4df52445ca.tar.gz bcm5719-llvm-7de905cd172a908b96fa523575dbca4df52445ca.zip | |
Add Thumb HVC and ERET virtualisation extension instructions.
Patch by Matthew Wahab.
Change-Id: I131f71c1150d5fa797066a18e09d526c19bf9016
llvm-svn: 222990
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMInstrThumb2.td | 21 | ||||
| -rw-r--r-- | llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp | 15 |
2 files changed, 36 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMInstrThumb2.td b/llvm/lib/Target/ARM/ARMInstrThumb2.td index 3670c82b121..5e41ea1c294 100644 --- a/llvm/lib/Target/ARM/ARMInstrThumb2.td +++ b/llvm/lib/Target/ARM/ARMInstrThumb2.td @@ -3824,6 +3824,27 @@ def t2SUBS_PC_LR : T2I <(outs), (ins imm0_255:$imm), NoItinerary, let Inst{7-0} = imm; } +// Hypervisor Call is a system instruction. +let isCall = 1 in { +def t2HVC : T2XI <(outs), (ins imm0_65535:$imm16), IIC_Br, "hvc.w\t$imm16", []>, + Requires<[IsThumb2, HasVirtualization]>, Sched<[WriteBr]> { + bits<16> imm16; + let Inst{31-20} = 0b111101111110; + let Inst{19-16} = imm16{15-12}; + let Inst{15-12} = 0b1000; + let Inst{11-0} = imm16{11-0}; +} +} + +// Alias for HVC without the ".w" optional width specifier +def : t2InstAlias<"hvc\t$imm16", (t2HVC imm0_65535:$imm16)>; + +// ERET - Return from exception in Hypervisor mode. +// B9.3.3, B9.3.20: ERET is an alias for "SUBS PC, LR, #0" in an implementation that +// includes virtualization extensions. +def t2ERET : InstAlias<"eret${p}", (t2SUBS_PC_LR 0, pred:$p)>, + Requires<[IsThumb2, HasVirtualization]>; + //===----------------------------------------------------------------------===// // Non-Instruction Patterns // diff --git a/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp b/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp index a51680c20da..03e4e0a5e17 100644 --- a/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp +++ b/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp @@ -292,6 +292,21 @@ void ARMInstPrinter::printInst(const MCInst *MI, raw_ostream &O, } break; } + // B9.3.3 ERET (Thumb) + // For a target that has Virtualization Extensions, ERET is the preferred + // disassembly of SUBS PC, LR, #0 + case ARM::t2SUBS_PC_LR: { + if (MI->getNumOperands() == 3 && + MI->getOperand(0).isImm() && + MI->getOperand(0).getImm() == 0 && + (getAvailableFeatures() & ARM::FeatureVirtualization)) { + O << "\teret"; + printPredicateOperand(MI, 1, O); + printAnnotation(O, Annot); + return; + } + break; + } } printInstruction(MI, O); |

