diff src/cpu/x86/vm/x86_64.ad @ 3839:3d42f82cd811

7063628: Use cbcond on T4 Summary: Add new short branch instruction to Hotspot sparc assembler. Reviewed-by: never, twisti, jrose
author kvn
date Thu, 21 Jul 2011 11:25:07 -0700
parents de6a837d75cf
children c7b60b601eb4
line wrap: on
line diff
--- a/src/cpu/x86/vm/x86_64.ad	Thu Jul 21 08:38:25 2011 -0700
+++ b/src/cpu/x86/vm/x86_64.ad	Thu Jul 21 11:25:07 2011 -0700
@@ -2428,16 +2428,16 @@
 
   enc_class Lbl(label labl)
   %{
-    // JMP, CALL
+    // GOTO
     Label* l = $labl$$label;
-    emit_d32(cbuf, l ? (l->loc_pos() - (cbuf.insts_size() + 4)) : 0);
+    emit_d32(cbuf, (l->loc_pos() - (cbuf.insts_size() + 4)));
   %}
 
   enc_class LblShort(label labl)
   %{
-    // JMP, CALL
+    // GOTO
     Label* l = $labl$$label;
-    int disp = l ? (l->loc_pos() - (cbuf.insts_size() + 1)) : 0;
+    int disp = l->loc_pos() - (cbuf.insts_size() + 1);
     assert(-128 <= disp && disp <= 127, "Displacement too large for short jmp");
     emit_d8(cbuf, disp);
   %}
@@ -2466,7 +2466,7 @@
     Label* l = $labl$$label;
     $$$emit8$primary;
     emit_cc(cbuf, $secondary, $cop$$cmpcode);
-    emit_d32(cbuf, l ? (l->loc_pos() - (cbuf.insts_size() + 4)) : 0);
+    emit_d32(cbuf, (l->loc_pos() - (cbuf.insts_size() + 4)));
   %}
 
   enc_class JccShort (cmpOp cop, label labl)
@@ -2474,7 +2474,7 @@
   // JCC
     Label *l = $labl$$label;
     emit_cc(cbuf, $primary, $cop$$cmpcode);
-    int disp = l ? (l->loc_pos() - (cbuf.insts_size() + 1)) : 0;
+    int disp = l->loc_pos() - (cbuf.insts_size() + 1);
     assert(-128 <= disp && disp <= 127, "Displacement too large for short jmp");
     emit_d8(cbuf, disp);
   %}
@@ -12131,7 +12131,7 @@
     int parity_disp = -1;
     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;
+       parity_disp = l->loc_pos() - (cbuf.insts_size() + 4);
     } else if ($cop$$cmpcode == Assembler::equal) {
        parity_disp = 6;
     } else {
@@ -12140,7 +12140,7 @@
     emit_d32(cbuf, parity_disp);
     $$$emit8$primary;
     emit_cc(cbuf, $secondary, $cop$$cmpcode);
-    int disp = l ? (l->loc_pos() - (cbuf.insts_size() + 4)) : 0;
+    int disp = l->loc_pos() - (cbuf.insts_size() + 4);
     emit_d32(cbuf, disp);
   %}
   ins_pipe(pipe_jcc);
@@ -12335,7 +12335,7 @@
     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;
+      parity_disp = l->loc_pos() - (cbuf.insts_size() + 1);
     } else if ($cop$$cmpcode == Assembler::equal) {
       parity_disp = 2;
     } else {
@@ -12343,7 +12343,7 @@
     }
     emit_d8(cbuf, parity_disp);
     emit_cc(cbuf, $primary, $cop$$cmpcode);
-    int disp = l ? (l->loc_pos() - (cbuf.insts_size() + 1)) : 0;
+    int disp = l->loc_pos() - (cbuf.insts_size() + 1);
     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");