use of com.android.dx.rop.code.RegisterSpecList in project buck by facebook.
the class Form31i method writeTo.
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
int value = ((CstLiteralBits) ((CstInsn) insn).getConstant()).getIntBits();
write(out, opcodeUnit(insn, regs.get(0).getReg()), value);
}
use of com.android.dx.rop.code.RegisterSpecList in project buck by facebook.
the class Form32x method compatibleRegs.
/** {@inheritDoc} */
@Override
public BitSet compatibleRegs(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
BitSet bits = new BitSet(2);
bits.set(0, unsignedFitsInShort(regs.get(0).getReg()));
bits.set(1, unsignedFitsInShort(regs.get(1).getReg()));
return bits;
}
use of com.android.dx.rop.code.RegisterSpecList in project buck by facebook.
the class Form21s method isCompatible.
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
if (!((insn instanceof CstInsn) && (regs.size() == 1) && unsignedFitsInByte(regs.get(0).getReg()))) {
return false;
}
CstInsn ci = (CstInsn) insn;
Constant cst = ci.getConstant();
if (!(cst instanceof CstLiteralBits)) {
return false;
}
CstLiteralBits cb = (CstLiteralBits) cst;
return cb.fitsInInt() && signedFitsInShort(cb.getIntBits());
}
use of com.android.dx.rop.code.RegisterSpecList in project buck by facebook.
the class Form21t method isCompatible.
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
if (!((insn instanceof TargetInsn) && (regs.size() == 1) && unsignedFitsInByte(regs.get(0).getReg()))) {
return false;
}
TargetInsn ti = (TargetInsn) insn;
return ti.hasTargetOffset() ? branchFits(ti) : true;
}
use of com.android.dx.rop.code.RegisterSpecList in project buck by facebook.
the class Form22b method compatibleRegs.
/** {@inheritDoc} */
@Override
public BitSet compatibleRegs(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
BitSet bits = new BitSet(2);
bits.set(0, unsignedFitsInByte(regs.get(0).getReg()));
bits.set(1, unsignedFitsInByte(regs.get(1).getReg()));
return bits;
}
Aggregations