public RemOp( SPARCArithmetic opcode, Value result, Value x, Value y, LIRFrameState state, LIRGeneratorTool gen) { this.opcode = opcode; this.result = result; this.x = x; this.y = y; this.scratch1 = gen.newVariable(LIRKind.derive(x, y)); this.scratch2 = gen.newVariable(LIRKind.derive(x, y)); this.state = state; }
/** * If we are sub it sizes, we try to sign/zero extend the value to at least int as it is done in * the {@link com.oracle.graal.replacements.DefaultJavaLoweringProvider#implicitLoadConvert} and * {@link com.oracle.graal.replacements.DefaultJavaLoweringProvider#createUnsafeRead}. * * @see com.oracle.graal.replacements.DefaultJavaLoweringProvider#implicitLoadConvert * @see com.oracle.graal.replacements.DefaultJavaLoweringProvider#createUnsafeRead */ @Override public void generate(NodeLIRBuilderTool gen) { LIRKind kind = gen.getLIRGeneratorTool().target().getLIRKind(readKind); Value loaded = gen.getLIRGeneratorTool().emitLoad(kind, gen.operand(address), null); switch ((Kind) kind.getPlatformKind()) { case Byte: loaded = gen.getLIRGeneratorTool().emitSignExtend(loaded, 8, 32); break; case Short: loaded = gen.getLIRGeneratorTool().emitSignExtend(loaded, 16, 32); break; case Boolean: loaded = gen.getLIRGeneratorTool().emitZeroExtend(loaded, 8, 32); break; case Char: loaded = gen.getLIRGeneratorTool().emitZeroExtend(loaded, 16, 32); break; } gen.setResult(this, loaded); }