Skip to content

Commit

Permalink
Fix 64bit opt long return, char load and integer divide.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Rogers committed Sep 29, 2009
1 parent 302d6f3 commit 7664ca4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
8 changes: 4 additions & 4 deletions rvm/src-generated/opt-burs/ia32/IA32-Load-64.rules
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ NOFLAGS
#####
# SHORT_LOAD
#####
r: SHORT_LOAD(rlv, riv)
r: SHORT_LOAD(rlv, rlv)
20
EMIT_INSTRUCTION
EMIT(MIR_Unary.mutate(P(p), IA32_MOVSX__W, Load.getResult(P(p)), MO_L(P(p), W)));

sload16: SHORT_LOAD(rlv, riv)
sload16: SHORT_LOAD(rlv, rlv)
0
EMIT_INSTRUCTION
pushMO(MO_L(P(p), W));
Expand All @@ -92,12 +92,12 @@ pushMO(MO_AL(P(p), W_S, W));
#####
# USHORT_LOAD
#####
r: USHORT_LOAD(rlv, riv)
r: USHORT_LOAD(rlv, rlv)
15
EMIT_INSTRUCTION
EMIT(MIR_Unary.mutate(P(p), IA32_MOVZX__W, Load.getResult(P(p)), MO_L(P(p), W)));

uload16: USHORT_LOAD(rlv, riv)
uload16: USHORT_LOAD(rlv, rlv)
0
EMIT_INSTRUCTION
pushMO(MO_L(P(p), W));
Expand Down
16 changes: 10 additions & 6 deletions rvm/src-generated/opt-burs/ia32/IA32.rules
Original file line number Diff line number Diff line change
Expand Up @@ -346,19 +346,23 @@ EMIT(MIR_Return.mutate(P(p), IA32_RET, null, Return.getVal(P(p)), null));
stm: RETURN(r)
13
EMIT_INSTRUCTION
RegisterOperand ret = R(Return.getVal(P(p))); \\
RegisterOperand ret2 = null; \\
if (ret.getType().isLongType()) { \\
ret.setType(TypeReference.Int); \\
RegisterOperand ret = R(Return.getVal(P(p))); \\
RegisterOperand ret2 = null; \\
if (VM.BuildFor32Addr &&ret.getType().isLongType()) { \\
ret.setType(TypeReference.Int); \\
ret2 = new RegisterOperand(regpool.getSecondReg(ret.getRegister()), TypeReference.Int); \\
} \\
} \\
EMIT(MIR_Return.mutate(P(p), IA32_RET, null, ret, ret2));

stm: RETURN(LONG_CONSTANT)
11
EMIT_INSTRUCTION
LongConstantOperand val = LC(Return.getVal(P(p))); \\
EMIT(MIR_Return.mutate(P(p), IA32_RET, null, IC(val.upper32()), IC(val.lower32())));
if (VM.BuildFor32Addr) { \\
EMIT(MIR_Return.mutate(P(p), IA32_RET, null, IC(val.upper32()), IC(val.lower32()))); \\
} else { \\
EMIT(MIR_Return.mutate(P(p), IA32_RET, null, val, null)); \\
}

#####
# CALL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ boolean isQuad(Instruction inst) {
for (int i = 0; i < inst.getNumberOfOperands(); i++) {
Operand op = inst.getOperand(i);
if (VM.BuildFor64Addr) {
if (op == null) continue;
if (op.isLong() || op.isRef()) {
return true;
}
Expand Down

0 comments on commit 7664ca4

Please sign in to comment.