#7184 [C1] Fix assert(is_simm16(v)) failed: must be simm16 issue

Fri, 15 Jun 2018 16:26:12 +0800

author
zhaixiang
date
Fri, 15 Jun 2018 16:26:12 +0800
changeset 9149
f977b3d18c61
parent 9148
03e0bbd8e9dd
child 9150
f7b3bf895d68

#7184 [C1] Fix assert(is_simm16(v)) failed: must be simm16 issue
Summary: change beq and sort of branch instructions to beq_far
Reviewed-by: fujie

src/cpu/mips/vm/c1_LIRAssembler_mips.cpp file | annotate | diff | comparison | revisions
src/cpu/mips/vm/macroAssembler_mips.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp	Fri Jun 15 11:08:29 2018 +0800
     1.2 +++ b/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp	Fri Jun 15 16:26:12 2018 +0800
     1.3 @@ -1737,7 +1737,7 @@
     1.4  #endif
     1.5    if (op->cond() == lir_cond_always) {
     1.6      if(op->label()==NULL)           //by liaob1
     1.7 -      __ b(*op->label());
     1.8 +      __ b_far(*op->label());
     1.9      else
    1.10        __ b_far(*op->label());
    1.11      __ delayed()->nop();
    1.12 @@ -1752,13 +1752,13 @@
    1.13        Register reg_op2 = opr2->as_register();
    1.14        switch (condition) {
    1.15          case lir_cond_equal:
    1.16 -          __ beq(reg_op1, reg_op2, *op->label());
    1.17 +          __ beq_far(reg_op1, reg_op2, *op->label());
    1.18            break;
    1.19          case lir_cond_notEqual:
    1.20            if(op->label()==NULL)
    1.21 -            __ bne(reg_op1, reg_op2, *op->label());//liaobin1
    1.22 +            __ bne_far(reg_op1, reg_op2, *op->label());
    1.23            else
    1.24 -            __ bne_far(reg_op1, reg_op2, *op->label());//liaobin1
    1.25 +            __ bne_far(reg_op1, reg_op2, *op->label());
    1.26            break;
    1.27          case lir_cond_less:
    1.28            // AT = 1 TRUE
    1.29 @@ -1773,7 +1773,7 @@
    1.30          case lir_cond_belowEqual:
    1.31            // AT = 0 TRUE
    1.32            __ sltu(AT, reg_op2, reg_op1);
    1.33 -          __ beq(AT, R0, *op->label());
    1.34 +          __ beq_far(AT, R0, *op->label());
    1.35            break;
    1.36          case lir_cond_greaterEqual:
    1.37            // AT = 0 TRUE
    1.38 @@ -1862,7 +1862,7 @@
    1.39            // AT = 0 TRUE
    1.40            __ li(AT, temp_value);
    1.41            __ slt(AT, AT, reg_op1);
    1.42 -          __ beq(AT, R0, *op->label());
    1.43 +          __ beq_far(AT, R0, *op->label());
    1.44            break;
    1.45  
    1.46          case lir_cond_belowEqual:
    1.47 @@ -1876,7 +1876,7 @@
    1.48  #endif
    1.49              __ li(AT, temp_value);
    1.50              __ sltu(AT, AT, reg_op1);
    1.51 -            __ beq(AT, R0, *op->label());
    1.52 +            __ beq_far(AT, R0, *op->label());
    1.53  #ifdef OPT_RANGECHECK
    1.54            }
    1.55  #endif
    1.56 @@ -1893,7 +1893,7 @@
    1.57              __ li(AT, temp_value);
    1.58              __ slt(AT, reg_op1, AT);
    1.59            }
    1.60 -          __ beq(AT, R0, *op->label());
    1.61 +          __ beq_far(AT, R0, *op->label());
    1.62            break;
    1.63  
    1.64          case lir_cond_aboveEqual:
    1.65 @@ -1907,7 +1907,7 @@
    1.66              __ li(AT, temp_value);
    1.67              __ sltu(AT, reg_op1, AT);
    1.68            }
    1.69 -          __ beq(AT, R0, *op->label());
    1.70 +          __ beq_far(AT, R0, *op->label());
    1.71            break;
    1.72  
    1.73          case lir_cond_greater:
    1.74 @@ -1941,7 +1941,7 @@
    1.75  #ifdef OPT_RANGECHECK
    1.76            assert(!op->check(), "just check");
    1.77  #endif
    1.78 -          __ beq(reg_op1, AT, *op->label());
    1.79 +          __ beq_far(reg_op1, AT, *op->label());
    1.80            break;
    1.81          case lir_cond_notEqual:
    1.82  #ifdef OPT_RANGECHECK
    1.83 @@ -1963,7 +1963,7 @@
    1.84  #endif
    1.85            // AT = 0 TRUE
    1.86            __ slt(AT, AT, reg_op1);
    1.87 -          __ beq(AT, R0, *op->label());
    1.88 +          __ beq_far(AT, R0, *op->label());
    1.89            break;
    1.90          case lir_cond_belowEqual:
    1.91  #ifdef OPT_RANGECHECK
    1.92 @@ -1971,7 +1971,7 @@
    1.93  #endif
    1.94            // AT = 0 TRUE
    1.95            __ sltu(AT, AT, reg_op1);
    1.96 -          __ beq(AT, R0, *op->label());
    1.97 +          __ beq_far(AT, R0, *op->label());
    1.98            break;
    1.99          case lir_cond_greaterEqual:
   1.100  #ifdef OPT_RANGECHECK
   1.101 @@ -1979,7 +1979,7 @@
   1.102  #endif
   1.103            // AT = 0 TRUE
   1.104            __ slt(AT, reg_op1, AT);
   1.105 -          __ beq(AT, R0, *op->label());
   1.106 +          __ beq_far(AT, R0, *op->label());
   1.107            break;
   1.108          case lir_cond_aboveEqual:
   1.109            // AT = 0 TRUE
   1.110 @@ -2036,7 +2036,7 @@
   1.111  
   1.112            case lir_cond_equal:
   1.113              __ addi(AT, AT, -(int)temp_value);
   1.114 -            __ beq(AT, R0, *op->label());
   1.115 +            __ beq_far(AT, R0, *op->label());
   1.116              break;
   1.117            case lir_cond_notEqual:
   1.118              __ addi(AT, AT, -(int)temp_value);
   1.119 @@ -2051,23 +2051,23 @@
   1.120              // AT = 0 TRUE
   1.121              __ addi(AT, AT, -temp_value);
   1.122              __ slt(AT, R0, AT);
   1.123 -            __ beq(AT, R0, *op->label());
   1.124 +            __ beq_far(AT, R0, *op->label());
   1.125              break;
   1.126            case lir_cond_belowEqual:
   1.127              // AT = 0 TRUE
   1.128              __ addiu(AT, AT, -temp_value);
   1.129              __ sltu(AT, R0, AT);
   1.130 -            __ beq(AT, R0, *op->label());
   1.131 +            __ beq_far(AT, R0, *op->label());
   1.132              break;
   1.133            case lir_cond_greaterEqual:
   1.134              // AT = 0 TRUE
   1.135              __ slti(AT, AT, temp_value);
   1.136 -            __ beq(AT, R0, *op->label());
   1.137 +            __ beq_far(AT, R0, *op->label());
   1.138              break;
   1.139            case lir_cond_aboveEqual:
   1.140              // AT = 0 TRUE
   1.141              __ sltiu(AT, AT, temp_value);
   1.142 -            __ beq(AT, R0, *op->label());
   1.143 +            __ beq_far(AT, R0, *op->label());
   1.144              break;
   1.145            case lir_cond_greater:
   1.146              // AT = 1 TRUE
   1.147 @@ -2113,7 +2113,7 @@
   1.148  0x000000555e8532e4: bne a4, a6, 0x000000555e8532e4  <-- error
   1.149  0x000000555e8532e8: sll zero, zero, 0
   1.150  */
   1.151 -          __ beq(opr1_lo, opr2_lo, *op->label());
   1.152 +          __ beq_far(opr1_lo, opr2_lo, *op->label());
   1.153  #endif
   1.154            __ delayed()->nop();
   1.155            __ bind(L);
   1.156 @@ -2122,14 +2122,14 @@
   1.157  
   1.158          case lir_cond_notEqual:
   1.159            if (op->label()==NULL)
   1.160 -            __ bne(opr1_lo, opr2_lo, *op->label());//by liaobin2
   1.161 +            __ bne_far(opr1_lo, opr2_lo, *op->label());
   1.162            else
   1.163 -            __ bne_far(opr1_lo, opr2_lo, *op->label());//by liaobin2
   1.164 +            __ bne_far(opr1_lo, opr2_lo, *op->label());
   1.165              __ delayed()->nop();
   1.166            if (op->label()==NULL)
   1.167 -            NOT_LP64(__ bne(opr1_hi, opr2_hi, *op->label()));//by liaobin3
   1.168 +            NOT_LP64(__ bne(opr1_hi, opr2_hi, *op->label()));
   1.169            else
   1.170 -            NOT_LP64(__ bne_far(opr1_hi, opr2_hi, *op->label()));//by liaobin3
   1.171 +            NOT_LP64(__ bne_far(opr1_hi, opr2_hi, *op->label()));
   1.172              NOT_LP64(__ delayed()->nop());
   1.173            break;
   1.174  
   1.175 @@ -2175,9 +2175,9 @@
   1.176  
   1.177            // if hi less then jump
   1.178            if(op->label()==NULL)
   1.179 -            __ bne(opr2_hi, opr1_hi, *op->label());//by liaobin4
   1.180 +            __ bne(opr2_hi, opr1_hi, *op->label());
   1.181            else
   1.182 -            __ bne_far(opr2_hi, opr1_hi, *op->label());//by liaobin4
   1.183 +            __ bne_far(opr2_hi, opr1_hi, *op->label());
   1.184            __ delayed();
   1.185  
   1.186            // now just comp lo as unsigned
   1.187 @@ -2193,7 +2193,7 @@
   1.188          case lir_cond_belowEqual: {
   1.189  #ifdef _LP64
   1.190            __ sltu(AT, opr2_lo, opr1_lo);
   1.191 -          __ beq(AT, R0, *op->label());
   1.192 +          __ beq_far(AT, R0, *op->label());
   1.193            __ delayed()->nop();
   1.194  #else
   1.195            Label L;
   1.196 @@ -2205,9 +2205,9 @@
   1.197  
   1.198            // if hi less then jump
   1.199            if(op->label()==NULL)
   1.200 -            __ bne(opr2_hi, opr1_hi, *op->label());//by liaobin5
   1.201 +            __ bne(opr2_hi, opr1_hi, *op->label());
   1.202            else
   1.203 -            __ bne_far(opr2_hi, opr1_hi, *op->label());//by liaobin5
   1.204 +            __ bne_far(opr2_hi, opr1_hi, *op->label());
   1.205            __ delayed();
   1.206  
   1.207            // now just comp lo as unsigned
   1.208 @@ -2235,9 +2235,9 @@
   1.209  
   1.210            // if hi great then jump
   1.211            if(op->label()==NULL)
   1.212 -            __ bne(opr2_hi, opr1_hi, *op->label());//by liaobin6
   1.213 +            __ bne(opr2_hi, opr1_hi, *op->label());
   1.214            else
   1.215 -            __ bne_far(opr2_hi, opr1_hi, *op->label());//by liaobin6
   1.216 +            __ bne_far(opr2_hi, opr1_hi, *op->label());
   1.217            __ delayed();
   1.218  
   1.219            // now just comp lo as unsigned
   1.220 @@ -2265,9 +2265,9 @@
   1.221  
   1.222            // if hi great then jump
   1.223            if(op->label()==NULL)
   1.224 -            __ bne(opr2_hi, opr1_hi, *op->label());//by liaobin7
   1.225 +            __ bne(opr2_hi, opr1_hi, *op->label());
   1.226            else
   1.227 -            __ bne_far(opr2_hi, opr1_hi, *op->label());//by liaobin7
   1.228 +            __ bne_far(opr2_hi, opr1_hi, *op->label());
   1.229            __ delayed();
   1.230  
   1.231            // now just comp lo as unsigned
   1.232 @@ -2322,7 +2322,7 @@
   1.233          case lir_cond_equal:
   1.234  #ifdef _LP64
   1.235            __ li(T8, lv);
   1.236 -          __ beq(opr1_lo, T8, *op->label());
   1.237 +          __ beq_far(opr1_lo, T8, *op->label());
   1.238            __ delayed()->nop();
   1.239  #else
   1.240            if (is_zero) {
   1.241 @@ -2345,7 +2345,7 @@
   1.242          case lir_cond_notEqual:
   1.243  #ifdef _LP64
   1.244            __ li(T8, lv);
   1.245 -          __ bne(opr1_lo, T8, *op->label());
   1.246 +          __ bne_far(opr1_lo, T8, *op->label());
   1.247            __ delayed()->nop();
   1.248  #else
   1.249            if (is_zero) {
   1.250 @@ -2407,7 +2407,7 @@
   1.251  #ifdef _LP64
   1.252            __ li(T8, lv);
   1.253            __ slt(AT, T8, opr1_lo);
   1.254 -          __ beq(AT, R0, *op->label());
   1.255 +          __ beq_far(AT, R0, *op->label());
   1.256            __ delayed()->nop();
   1.257  #else
   1.258            if (is_zero) {
   1.259 @@ -2444,7 +2444,7 @@
   1.260  #ifdef _LP64
   1.261            __ li(T8, lv);
   1.262            __ sltu(AT, T8, opr1_lo);
   1.263 -          __ beq(AT, R0, *op->label());
   1.264 +          __ beq_far(AT, R0, *op->label());
   1.265            __ delayed()->nop();
   1.266  #else
   1.267            if (is_zero) {
   1.268 @@ -2479,7 +2479,7 @@
   1.269  #ifdef _LP64
   1.270            __ li(T8, lv);
   1.271            __ slt(AT, opr1_lo, T8);
   1.272 -          __ beq(AT, R0, *op->label());
   1.273 +          __ beq_far(AT, R0, *op->label());
   1.274            __ delayed()->nop();
   1.275  #else
   1.276            if (is_zero) {
   1.277 @@ -2517,7 +2517,7 @@
   1.278  #ifdef _LP64
   1.279            __ li(T8, lv);
   1.280            __ sltu(AT, opr1_lo, T8);
   1.281 -          __ beq(AT, R0, *op->label());
   1.282 +          __ beq_far(AT, R0, *op->label());
   1.283            __ delayed()->nop();
   1.284  #else
   1.285            if (is_zero) {
   1.286 @@ -3167,11 +3167,11 @@
   1.287      // not a safepoint as obj null check happens earlier
   1.288      if (UseCompressedClassPointers) {
   1.289        __ load_klass(Rtmp1, obj);
   1.290 -      __ bne(k_RInfo, Rtmp1, *failure_target);
   1.291 +      __ bne_far(k_RInfo, Rtmp1, *failure_target);
   1.292        __ delayed()->nop();
   1.293      } else {
   1.294        __ ld(AT, Address(obj, oopDesc::klass_offset_in_bytes()));
   1.295 -      __ bne(k_RInfo, AT, *failure_target);
   1.296 +      __ bne_far(k_RInfo, AT, *failure_target);
   1.297        __ delayed()->nop();
   1.298      }
   1.299      // successful cast, fall through to profile or jump
   1.300 @@ -3183,7 +3183,7 @@
   1.301        // See if we get an immediate positive hit
   1.302        __ ld(AT, Address(klass_RInfo, k->super_check_offset()));
   1.303        if ((juint)in_bytes(Klass::secondary_super_cache_offset()) != k->super_check_offset()) {
   1.304 -        __ bne(k_RInfo, AT, *failure_target);
   1.305 +        __ bne_far(k_RInfo, AT, *failure_target);
   1.306          __ delayed()->nop();
   1.307          // successful cast, fall through to profile or jump
   1.308        } else {
   1.309 @@ -3203,7 +3203,7 @@
   1.310          if (A1 != k_RInfo)     __ pop(A1);
   1.311          if (A0 != klass_RInfo) __ pop(A0);
   1.312          // result is a boolean
   1.313 -        __ beq(V0, R0, *failure_target);
   1.314 +        __ beq_far(V0, R0, *failure_target);
   1.315          __ delayed()->nop();
   1.316          // successful cast, fall through to profile or jump
   1.317        }
   1.318 @@ -3220,7 +3220,7 @@
   1.319        if (A1 != k_RInfo)     __ pop(A1);
   1.320        if (A0 != klass_RInfo) __ pop(A0);
   1.321        // result is a boolean
   1.322 -      __ beq(V0, R0, *failure_target);
   1.323 +      __ beq_far(V0, R0, *failure_target);
   1.324        __ delayed()->nop();
   1.325        // successful cast, fall through to profile or jump
   1.326      }
   1.327 @@ -3316,7 +3316,7 @@
   1.328      if (A1 != k_RInfo)     __ pop(A1);
   1.329      if (A0 != klass_RInfo) __ pop(A0);
   1.330      // result is a boolean
   1.331 -    __ beq(V0, R0, *failure_target);
   1.332 +    __ beq_far(V0, R0, *failure_target);
   1.333      __ delayed()->nop();
   1.334      // fall through to the success case
   1.335  
     2.1 --- a/src/cpu/mips/vm/macroAssembler_mips.cpp	Fri Jun 15 11:08:29 2018 +0800
     2.2 +++ b/src/cpu/mips/vm/macroAssembler_mips.cpp	Fri Jun 15 16:26:12 2018 +0800
     2.3 @@ -3784,7 +3784,7 @@
     2.4        beq(AT, R0, *L_slow_path);
     2.5        delayed()->nop();
     2.6      } else {
     2.7 -      bne(AT, R0, *L_failure);
     2.8 +      bne_far(AT, R0, *L_failure);
     2.9        delayed()->nop();
    2.10        b(*L_slow_path);
    2.11        delayed()->nop();
    2.12 @@ -3806,7 +3806,7 @@
    2.13        beq(super_klass, AT, *L_success);
    2.14        delayed()->nop();
    2.15      } else {
    2.16 -      bne(super_klass, AT, *L_failure);
    2.17 +      bne_far(super_klass, AT, *L_failure);
    2.18        delayed()->nop();
    2.19        b(*L_success);
    2.20        delayed()->nop();

mercurial