< prev index next >

src/cpu/sparc/vm/sparc.ad

Print this page

        

@@ -1070,11 +1070,17 @@
       disp = (consts_size + insts_offset) + table_base_offset;
     }
 
     __ rdpc(r);
 
-    if (disp != 0) {
+    if (disp == 0) {
+      // Emitting an additional 'nop' instruction in order not to cause a code
+      // size adjustment in the code following the table setup (if the instruction
+      // immediately following after this section is a CTI).
+      __ nop();
+    }
+    else {
       assert(r != O7, "need temporary");
       __ sub(r, __ ensure_simm13_or_reg(disp, O7), r);
     }
   }
   else {

@@ -8622,11 +8628,11 @@
 instruct branch_short(label labl) %{
   match(Goto);
   predicate(UseCBCond);
   effect(USE labl);
 
-  size(4);
+  size(4); // Assuming no NOP inserted.
   ins_cost(BRANCH_COST);
   format %{ "BA     $labl\t! short branch" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");

@@ -8963,11 +8969,11 @@
 instruct cmpI_reg_branch_short(cmpOp cmp, iRegI op1, iRegI op2, label labl, flagsReg icc) %{
   match(If cmp (CmpI op1 op2));
   predicate(UseCBCond);
   effect(USE labl, KILL icc);
 
-  size(4);
+  size(4); // Assuming no NOP inserted.
   ins_cost(BRANCH_COST);
   format %{ "CWB$cmp  $op1,$op2,$labl\t! int" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");

@@ -8981,11 +8987,11 @@
 instruct cmpI_imm_branch_short(cmpOp cmp, iRegI op1, immI5 op2, label labl, flagsReg icc) %{
   match(If cmp (CmpI op1 op2));
   predicate(UseCBCond);
   effect(USE labl, KILL icc);
 
-  size(4);
+  size(4); // Assuming no NOP inserted.
   ins_cost(BRANCH_COST);
   format %{ "CWB$cmp  $op1,$op2,$labl\t! int" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");

@@ -8999,11 +9005,11 @@
 instruct cmpU_reg_branch_short(cmpOpU cmp, iRegI op1, iRegI op2, label labl, flagsRegU icc) %{
   match(If cmp (CmpU op1 op2));
   predicate(UseCBCond);
   effect(USE labl, KILL icc);
 
-  size(4);
+  size(4); // Assuming no NOP inserted.
   ins_cost(BRANCH_COST);
   format %{ "CWB$cmp $op1,$op2,$labl\t! unsigned" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");

@@ -9017,11 +9023,11 @@
 instruct cmpU_imm_branch_short(cmpOpU cmp, iRegI op1, immI5 op2, label labl, flagsRegU icc) %{
   match(If cmp (CmpU op1 op2));
   predicate(UseCBCond);
   effect(USE labl, KILL icc);
 
-  size(4);
+  size(4); // Assuming no NOP inserted.
   ins_cost(BRANCH_COST);
   format %{ "CWB$cmp $op1,$op2,$labl\t! unsigned" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");

@@ -9035,11 +9041,11 @@
 instruct cmpL_reg_branch_short(cmpOp cmp, iRegL op1, iRegL op2, label labl, flagsRegL xcc) %{
   match(If cmp (CmpL op1 op2));
   predicate(UseCBCond);
   effect(USE labl, KILL xcc);
 
-  size(4);
+  size(4); // Assuming no NOP inserted.
   ins_cost(BRANCH_COST);
   format %{ "CXB$cmp  $op1,$op2,$labl\t! long" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");

@@ -9053,11 +9059,11 @@
 instruct cmpL_imm_branch_short(cmpOp cmp, iRegL op1, immL5 op2, label labl, flagsRegL xcc) %{
   match(If cmp (CmpL op1 op2));
   predicate(UseCBCond);
   effect(USE labl, KILL xcc);
 
-  size(4);
+  size(4); // Assuming no NOP inserted.
   ins_cost(BRANCH_COST);
   format %{ "CXB$cmp  $op1,$op2,$labl\t! long" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");

@@ -9072,11 +9078,11 @@
 instruct cmpP_reg_branch_short(cmpOpP cmp, iRegP op1, iRegP op2, label labl, flagsRegP pcc) %{
   match(If cmp (CmpP op1 op2));
   predicate(UseCBCond);
   effect(USE labl, KILL pcc);
 
-  size(4);
+  size(4); // Assuming no NOP inserted.
   ins_cost(BRANCH_COST);
   format %{ "CXB$cmp $op1,$op2,$labl\t! ptr" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");

@@ -9090,11 +9096,11 @@
 instruct cmpP_null_branch_short(cmpOpP cmp, iRegP op1, immP0 null, label labl, flagsRegP pcc) %{
   match(If cmp (CmpP op1 null));
   predicate(UseCBCond);
   effect(USE labl, KILL pcc);
 
-  size(4);
+  size(4); // Assuming no NOP inserted.
   ins_cost(BRANCH_COST);
   format %{ "CXB$cmp $op1,0,$labl\t! ptr" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");

@@ -9108,11 +9114,11 @@
 instruct cmpN_reg_branch_short(cmpOp cmp, iRegN op1, iRegN op2, label labl, flagsReg icc) %{
   match(If cmp (CmpN op1 op2));
   predicate(UseCBCond);
   effect(USE labl, KILL icc);
 
-  size(4);
+  size(4); // Assuming no NOP inserted.
   ins_cost(BRANCH_COST);
   format %{ "CWB$cmp  $op1,$op2,$labl\t! compressed ptr" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");

@@ -9126,11 +9132,11 @@
 instruct cmpN_null_branch_short(cmpOp cmp, iRegN op1, immN0 null, label labl, flagsReg icc) %{
   match(If cmp (CmpN op1 null));
   predicate(UseCBCond);
   effect(USE labl, KILL icc);
 
-  size(4);
+  size(4); // Assuming no NOP inserted.
   ins_cost(BRANCH_COST);
   format %{ "CWB$cmp  $op1,0,$labl\t! compressed ptr" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");

@@ -9145,11 +9151,11 @@
 instruct cmpI_reg_branchLoopEnd_short(cmpOp cmp, iRegI op1, iRegI op2, label labl, flagsReg icc) %{
   match(CountedLoopEnd cmp (CmpI op1 op2));
   predicate(UseCBCond);
   effect(USE labl, KILL icc);
 
-  size(4);
+  size(4); // Assuming no NOP inserted.
   ins_cost(BRANCH_COST);
   format %{ "CWB$cmp  $op1,$op2,$labl\t! Loop end" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");

@@ -9163,11 +9169,11 @@
 instruct cmpI_imm_branchLoopEnd_short(cmpOp cmp, iRegI op1, immI5 op2, label labl, flagsReg icc) %{
   match(CountedLoopEnd cmp (CmpI op1 op2));
   predicate(UseCBCond);
   effect(USE labl, KILL icc);
 
-  size(4);
+  size(4); // Assuming no NOP inserted.
   ins_cost(BRANCH_COST);
   format %{ "CWB$cmp  $op1,$op2,$labl\t! Loop end" %}
   ins_encode %{
     Label* L = $labl$$label;
     assert(__ use_cbcond(*L), "back to back cbcond");
< prev index next >