Java Code Examples for com.android.dx.rop.cst.CstLiteralBits#fitsInInt()

The following examples show how to use com.android.dx.rop.cst.CstLiteralBits#fitsInInt() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Form22b.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@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());
}
 
Example 2
Source File: Form22s.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    if (!((insn instanceof CstInsn) &&
          (regs.size() == 2) &&
          unsignedFitsInNibble(regs.get(0).getReg()) &&
          unsignedFitsInNibble(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() && signedFitsInShort(cb.getIntBits());
}
 
Example 3
Source File: Form21s.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@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());
}
 
Example 4
Source File: Form11n.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    if (!((insn instanceof CstInsn) &&
          (regs.size() == 1) &&
          unsignedFitsInNibble(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() && signedFitsInNibble(cb.getIntBits());
}
 
Example 5
Source File: Form22b.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@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());
}
 
Example 6
Source File: Form22s.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    if (!((insn instanceof CstInsn) &&
          (regs.size() == 2) &&
          unsignedFitsInNibble(regs.get(0).getReg()) &&
          unsignedFitsInNibble(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() && signedFitsInShort(cb.getIntBits());
}
 
Example 7
Source File: Form21s.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@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());
}
 
Example 8
Source File: Form11n.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    if (!((insn instanceof CstInsn) &&
          (regs.size() == 1) &&
          unsignedFitsInNibble(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() && signedFitsInNibble(cb.getIntBits());
}
 
Example 9
Source File: Form22b.java    From J2ME-Loader with Apache License 2.0 6 votes vote down vote up
/** {@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());
}
 
Example 10
Source File: Form22s.java    From J2ME-Loader with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    if (!((insn instanceof CstInsn) &&
          (regs.size() == 2) &&
          unsignedFitsInNibble(regs.get(0).getReg()) &&
          unsignedFitsInNibble(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() && signedFitsInShort(cb.getIntBits());
}
 
Example 11
Source File: Form21s.java    From J2ME-Loader with Apache License 2.0 6 votes vote down vote up
/** {@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());
}
 
Example 12
Source File: Form11n.java    From J2ME-Loader with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    if (!((insn instanceof CstInsn) &&
          (regs.size() == 1) &&
          unsignedFitsInNibble(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() && signedFitsInNibble(cb.getIntBits());
}
 
Example 13
Source File: Form22b.java    From buck with Apache License 2.0 6 votes vote down vote up
/** {@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());
}
 
Example 14
Source File: Form22s.java    From buck with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    if (!((insn instanceof CstInsn) &&
          (regs.size() == 2) &&
          unsignedFitsInNibble(regs.get(0).getReg()) &&
          unsignedFitsInNibble(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() && signedFitsInShort(cb.getIntBits());
}
 
Example 15
Source File: Form21s.java    From buck with Apache License 2.0 6 votes vote down vote up
/** {@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());
}
 
Example 16
Source File: Form11n.java    From buck with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    if (!((insn instanceof CstInsn) &&
          (regs.size() == 1) &&
          unsignedFitsInNibble(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() && signedFitsInNibble(cb.getIntBits());
}