mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-23 01:25:32 +00:00
[ARM] Honor FeatureD16 in the assembler and disassembler
Some ARM FPUs only have 16 double-precision registers, rather than the normal 32. LLVM represents this with the D16 target feature. This is currently used by CodeGen to avoid using high registers when they are not available, but the assembler and disassembler do not. I fix this in the assmebler and disassembler rather than the InstrInfo.td files, as the latter would require a large number of changes everywhere one of the floating-point instructions is referenced in the backend. This solution is similar to the one used for co-processor numbers and MSR masks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221341 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1017,7 +1017,11 @@ static const uint16_t DPRDecoderTable[] = {
|
||||
|
||||
static DecodeStatus DecodeDPRRegisterClass(MCInst &Inst, unsigned RegNo,
|
||||
uint64_t Address, const void *Decoder) {
|
||||
if (RegNo > 31)
|
||||
uint64_t featureBits = ((const MCDisassembler*)Decoder)->getSubtargetInfo()
|
||||
.getFeatureBits();
|
||||
bool hasD16 = featureBits & ARM::FeatureD16;
|
||||
|
||||
if (RegNo > 31 || (hasD16 && RegNo > 15))
|
||||
return MCDisassembler::Fail;
|
||||
|
||||
unsigned Register = DPRDecoderTable[RegNo];
|
||||
|
Reference in New Issue
Block a user