src/cpu/x86/vm/x86_32.ad
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/cpu/x86/vm/x86_32.ad Fri Jul 15 18:49:47 2011
--- new/src/cpu/x86/vm/x86_32.ad Fri Jul 15 18:49:47 2011
*** 1711,1728 ****
--- 1711,1728 ----
emit_rm(cbuf, 0x3, $tertiary, HIGH_FROM_LOW($dst$$reg));
if ((con >= -128) && (con <= 127)) emit_d8 (cbuf,con);
else emit_d32(cbuf,con);
%}
! enc_class Lbl (label labl) %{ // JMP, CALL
! enc_class Lbl (label labl) %{ // GOTO
Label *l = $labl$$label;
! emit_d32(cbuf, l ? (l->loc_pos() - (cbuf.insts_size()+4)) : 0);
%}
! enc_class LblShort (label labl) %{ // JMP, CALL
! enc_class LblShort (label labl) %{ // GOTO
Label *l = $labl$$label;
! int disp = l ? (l->loc_pos() - (cbuf.insts_size()+1)) : 0;
assert(-128 <= disp && disp <= 127, "Displacement too large for short jmp");
emit_d8(cbuf, disp);
%}
enc_class OpcSReg (eRegI dst) %{ // BSWAP
*** 1749,1765 ****
--- 1749,1765 ----
enc_class Jcc (cmpOp cop, label labl) %{ // JCC
Label *l = $labl$$label;
$$$emit8$primary;
emit_cc(cbuf, $secondary, $cop$$cmpcode);
! emit_d32(cbuf, l ? (l->loc_pos() - (cbuf.insts_size()+4)) : 0);
%}
enc_class JccShort (cmpOp cop, label labl) %{ // JCC
Label *l = $labl$$label;
emit_cc(cbuf, $primary, $cop$$cmpcode);
! int disp = l ? (l->loc_pos() - (cbuf.insts_size()+1)) : 0;
assert(-128 <= disp && disp <= 127, "Displacement too large for short jmp");
emit_d8(cbuf, disp);
%}
enc_class enc_cmov(cmpOp cop ) %{ // CMOV
*** 13170,13190 ****
--- 13170,13190 ----
emit_cc(cbuf, $secondary, Assembler::parity);
int parity_disp = -1;
bool ok = false;
if ($cop$$cmpcode == Assembler::notEqual) {
// the two jumps 6 bytes apart so the jump distances are too
! parity_disp = l ? (l->loc_pos() - (cbuf.insts_size() + 4)) : 0;
} else if ($cop$$cmpcode == Assembler::equal) {
parity_disp = 6;
ok = true;
} else {
ShouldNotReachHere();
}
emit_d32(cbuf, parity_disp);
$$$emit8$primary;
emit_cc(cbuf, $secondary, $cop$$cmpcode);
! int disp = l ? (l->loc_pos() - (cbuf.insts_size() + 4)) : 0;
emit_d32(cbuf, disp);
%}
ins_pipe(pipe_jcc);
ins_pc_relative(1);
%}
*** 13366,13384 ****
--- 13366,13384 ----
ins_encode %{
Label* l = $labl$$label;
emit_cc(cbuf, $primary, Assembler::parity);
int parity_disp = -1;
if ($cop$$cmpcode == Assembler::notEqual) {
! parity_disp = l ? (l->loc_pos() - (cbuf.insts_size() + 1)) : 0;
} else if ($cop$$cmpcode == Assembler::equal) {
parity_disp = 2;
} else {
ShouldNotReachHere();
}
emit_d8(cbuf, parity_disp);
emit_cc(cbuf, $primary, $cop$$cmpcode);
! int disp = l ? (l->loc_pos() - (cbuf.insts_size() + 1)) : 0;
emit_d8(cbuf, disp);
assert(-128 <= disp && disp <= 127, "Displacement too large for short jmp");
assert(-128 <= parity_disp && parity_disp <= 127, "Displacement too large for short jmp");
%}
ins_pipe(pipe_jcc);
src/cpu/x86/vm/x86_32.ad
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File