/** {@inheritDoc} */ public boolean hasConstantOperation(Rop opcode, RegisterSpec sourceA, RegisterSpec sourceB) { if (sourceA.getType() != Type.INT) { return false; } if (! (sourceB.getTypeBearer() instanceof CstInteger)) { return false; } CstInteger cst = (CstInteger) sourceB.getTypeBearer(); // TODO handle rsub switch (opcode.getOpcode()) { // These have 8 and 16 bit cst representations case RegOps.REM: case RegOps.ADD: case RegOps.MUL: case RegOps.DIV: case RegOps.AND: case RegOps.OR: case RegOps.XOR: return cst.fitsIn16Bits(); // These only have 8 bit cst reps case RegOps.SHL: case RegOps.SHR: case RegOps.USHR: return cst.fitsIn8Bits(); default: return false; } }
case RegOps.SHR: case RegOps.USHR: return cst.fitsIn8Bits();
case RegOps.SHR: case RegOps.USHR: return cst.fitsIn8Bits();
case RegOps.SHR: case RegOps.USHR: return cst.fitsIn8Bits();
case RegOps.SHR: case RegOps.USHR: return cst.fitsIn8Bits();
case RegOps.SHR: case RegOps.USHR: return cst.fitsIn8Bits();
case RegOps.SHR: case RegOps.USHR: return cst.fitsIn8Bits();
case RegOps.SHR: case RegOps.USHR: return cst.fitsIn8Bits();