diff options
| author | Tom Coxon <tom.coxon@arm.com> | 2014-10-01 10:13:59 +0000 |
|---|---|---|
| committer | Tom Coxon <tom.coxon@arm.com> | 2014-10-01 10:13:59 +0000 |
| commit | e493f177eeee84a9c6000ca7c92499233490f1d1 (patch) | |
| tree | 613ad78107f7dd0817fb95636899b8e86ed2db30 /llvm/lib/Target/AArch64/Disassembler | |
| parent | 815f2869adfe7e9dfec14f4f30639a6c129ee5cf (diff) | |
| download | bcm5719-llvm-e493f177eeee84a9c6000ca7c92499233490f1d1.tar.gz bcm5719-llvm-e493f177eeee84a9c6000ca7c92499233490f1d1.zip | |
[AArch64] Allow access to all system registers with MRS/MSR instructions.
The A64 instruction set includes a generic register syntax for accessing
implementation-defined system registers. The syntax for these registers is:
S<op0>_<op1>_<CRn>_<CRm>_<op2>
The encoding space permitted for implementation-defined system registers
is:
op0 op1 CRn CRm op2
11 xxx 1x11 xxxx xxx
The full encoding space can now be accessed:
op0 op1 CRn CRm op2
xx xxx xxxx xxxx xxx
This is useful to anyone needing to write assembly code supporting new
system registers before the assembler has learned the official names for
them.
llvm-svn: 218753
Diffstat (limited to 'llvm/lib/Target/AArch64/Disassembler')
| -rw-r--r-- | llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp b/llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp index 87b2d5096dd..f522ca59a9a 100644 --- a/llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp +++ b/llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp @@ -626,35 +626,19 @@ static DecodeStatus DecodeMemExtend(llvm::MCInst &Inst, unsigned Imm, static DecodeStatus DecodeMRSSystemRegister(llvm::MCInst &Inst, unsigned Imm, uint64_t Address, const void *Decoder) { - const AArch64Disassembler *Dis = - static_cast<const AArch64Disassembler *>(Decoder); - const MCSubtargetInfo &STI = Dis->getSubtargetInfo(); - - Imm |= 0x8000; Inst.addOperand(MCOperand::CreateImm(Imm)); - bool ValidNamed; - (void)AArch64SysReg::MRSMapper(STI.getFeatureBits()) - .toString(Imm, ValidNamed); - - return ValidNamed ? Success : Fail; + // Every system register in the encoding space is valid with the syntax + // S<op0>_<op1>_<Cn>_<Cm>_<op2>, so decoding system registers always succeeds. + return Success; } static DecodeStatus DecodeMSRSystemRegister(llvm::MCInst &Inst, unsigned Imm, uint64_t Address, const void *Decoder) { - const AArch64Disassembler *Dis = - static_cast<const AArch64Disassembler *>(Decoder); - const MCSubtargetInfo &STI = Dis->getSubtargetInfo(); - - Imm |= 0x8000; Inst.addOperand(MCOperand::CreateImm(Imm)); - bool ValidNamed; - (void)AArch64SysReg::MSRMapper(STI.getFeatureBits()) - .toString(Imm, ValidNamed); - - return ValidNamed ? Success : Fail; + return Success; } static DecodeStatus DecodeFMOVLaneInstruction(llvm::MCInst &Inst, unsigned Insn, |

