mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
ARM: Define generic HINT instruction.
The NOP, WFE, WFI, SEV and YIELD instructions are all hints w/ a different immediate value in bits [7,0]. Define a generic HINT instruction and refactor NOP, WFI, WFI, SEV and YIELD to be assembly aliases of that. rdar://11600518 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158674 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -52,6 +52,27 @@ void ARMInstPrinter::printInst(const MCInst *MI, raw_ostream &O,
|
||||
StringRef Annot) {
|
||||
unsigned Opcode = MI->getOpcode();
|
||||
|
||||
// Check for HINT instructions w/ canonical names.
|
||||
if (Opcode == ARM::HINT || Opcode == ARM::t2HINT) {
|
||||
switch (MI->getOperand(0).getImm()) {
|
||||
case 0: O << "\tnop"; break;
|
||||
case 1: O << "\tyield"; break;
|
||||
case 2: O << "\twfe"; break;
|
||||
case 3: O << "\twfi"; break;
|
||||
case 4: O << "\tsev"; break;
|
||||
default:
|
||||
// Anything else should just print normally.
|
||||
printInstruction(MI, O);
|
||||
printAnnotation(O, Annot);
|
||||
return;
|
||||
}
|
||||
printPredicateOperand(MI, 1, O);
|
||||
if (Opcode == ARM::t2HINT)
|
||||
O << ".w";
|
||||
printAnnotation(O, Annot);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for MOVs and print canonical forms, instead.
|
||||
if (Opcode == ARM::MOVsr) {
|
||||
// FIXME: Thumb variants?
|
||||
|
||||
Reference in New Issue
Block a user