mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
ARM Binary encoding information for BFC/BFI instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117072 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -88,6 +88,8 @@ public:
|
||||
return MI.getOperand(Op).getImm() - 1;
|
||||
}
|
||||
|
||||
unsigned getBitfieldInvertedMaskOpValue(const MCInst &MI, unsigned Op) const;
|
||||
|
||||
unsigned getNumFixupKinds() const {
|
||||
assert(0 && "ARMMCCodeEmitter::getNumFixupKinds() not yet implemented.");
|
||||
return 0;
|
||||
@@ -238,6 +240,18 @@ unsigned ARMMCCodeEmitter::getSORegOpValue(const MCInst &MI,
|
||||
return Binary | ARM_AM::getSORegOffset(MO2.getImm()) << 7;
|
||||
}
|
||||
|
||||
unsigned ARMMCCodeEmitter::getBitfieldInvertedMaskOpValue(const MCInst &MI,
|
||||
unsigned Op) const {
|
||||
// 10 bits. lower 5 bits are are the lsb of the mask, high five bits are the
|
||||
// msb of the mask.
|
||||
const MCOperand &MO = MI.getOperand(Op);
|
||||
uint32_t v = ~MO.getImm();
|
||||
uint32_t lsb = CountTrailingZeros_32(v);
|
||||
uint32_t msb = (32 - CountLeadingZeros_32 (v)) - 1;
|
||||
assert (v != 0 && lsb < 32 && msb < 32 && "Illegal bitfield mask!");
|
||||
return lsb | (msb << 5);
|
||||
}
|
||||
|
||||
void ARMMCCodeEmitter::
|
||||
EncodeInstruction(const MCInst &MI, raw_ostream &OS,
|
||||
SmallVectorImpl<MCFixup> &Fixups) const {
|
||||
|
Reference in New Issue
Block a user