use of com.taobao.android.dx.rop.cst.CstLiteralBits in project atlas by alibaba.
the class Form21s 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()), (short) value);
}
use of com.taobao.android.dx.rop.cst.CstLiteralBits in project atlas by alibaba.
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.taobao.android.dx.rop.cst.CstLiteralBits in project atlas by alibaba.
the class Form22b method isCompatible.
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
if (!((insn instanceof CstInsn) && (regs.size() == 2) && unsignedFitsInByte(regs.get(0).getReg()) && unsignedFitsInByte(regs.get(1).getReg()))) {
return false;
}
CstInsn ci = (CstInsn) insn;
Constant cst = ci.getConstant();
if (!(cst instanceof CstLiteralBits)) {
return false;
}
CstLiteralBits cb = (CstLiteralBits) cst;
return cb.fitsInInt() && signedFitsInByte(cb.getIntBits());
}
use of com.taobao.android.dx.rop.cst.CstLiteralBits in project atlas by alibaba.
the class Form51l method insnArgString.
/** {@inheritDoc} */
@Override
public String insnArgString(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
CstLiteralBits value = (CstLiteralBits) ((CstInsn) insn).getConstant();
return regs.get(0).regString() + ", " + literalBitsString(value);
}
Aggregations