mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-24 23:19:03 +00:00
[mips][microMIPS] Implement LBU16, LHU16, LW16, SB16, SH16 and SW16 instructions
Differential Revision: http://reviews.llvm.org/D5122 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222653 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -634,6 +634,48 @@ MipsMCCodeEmitter::getMemEncoding(const MCInst &MI, unsigned OpNo,
|
||||
return (OffBits & 0xFFFF) | RegBits;
|
||||
}
|
||||
|
||||
unsigned MipsMCCodeEmitter::
|
||||
getMemEncodingMMImm4(const MCInst &MI, unsigned OpNo,
|
||||
SmallVectorImpl<MCFixup> &Fixups,
|
||||
const MCSubtargetInfo &STI) const {
|
||||
// Base register is encoded in bits 6-4, offset is encoded in bits 3-0.
|
||||
assert(MI.getOperand(OpNo).isReg());
|
||||
unsigned RegBits = getMachineOpValue(MI, MI.getOperand(OpNo),
|
||||
Fixups, STI) << 4;
|
||||
unsigned OffBits = getMachineOpValue(MI, MI.getOperand(OpNo+1),
|
||||
Fixups, STI);
|
||||
|
||||
return (OffBits & 0xF) | RegBits;
|
||||
}
|
||||
|
||||
unsigned MipsMCCodeEmitter::
|
||||
getMemEncodingMMImm4Lsl1(const MCInst &MI, unsigned OpNo,
|
||||
SmallVectorImpl<MCFixup> &Fixups,
|
||||
const MCSubtargetInfo &STI) const {
|
||||
// Base register is encoded in bits 6-4, offset is encoded in bits 3-0.
|
||||
assert(MI.getOperand(OpNo).isReg());
|
||||
unsigned RegBits = getMachineOpValue(MI, MI.getOperand(OpNo),
|
||||
Fixups, STI) << 4;
|
||||
unsigned OffBits = getMachineOpValue(MI, MI.getOperand(OpNo+1),
|
||||
Fixups, STI) >> 1;
|
||||
|
||||
return (OffBits & 0xF) | RegBits;
|
||||
}
|
||||
|
||||
unsigned MipsMCCodeEmitter::
|
||||
getMemEncodingMMImm4Lsl2(const MCInst &MI, unsigned OpNo,
|
||||
SmallVectorImpl<MCFixup> &Fixups,
|
||||
const MCSubtargetInfo &STI) const {
|
||||
// Base register is encoded in bits 6-4, offset is encoded in bits 3-0.
|
||||
assert(MI.getOperand(OpNo).isReg());
|
||||
unsigned RegBits = getMachineOpValue(MI, MI.getOperand(OpNo),
|
||||
Fixups, STI) << 4;
|
||||
unsigned OffBits = getMachineOpValue(MI, MI.getOperand(OpNo+1),
|
||||
Fixups, STI) >> 2;
|
||||
|
||||
return (OffBits & 0xF) | RegBits;
|
||||
}
|
||||
|
||||
unsigned MipsMCCodeEmitter::
|
||||
getMemEncodingMMImm12(const MCInst &MI, unsigned OpNo,
|
||||
SmallVectorImpl<MCFixup> &Fixups,
|
||||
|
||||
Reference in New Issue
Block a user