@@ -5653,10 +5653,7 @@ instruct jmpDir_short(label labl) %{
56535653
56545654 ins_encode %{
56555655 Label &L = *($labl$$label);
5656- if(&L)
5657- __ b(L);
5658- else
5659- __ b(int(0));
5656+ __ b(L);
56605657 %}
56615658
56625659 ins_pipe( pipe_jump );
@@ -5714,16 +5711,10 @@ instruct jmpCon_flags_short(cmpOpEqNe cop, FlagsReg cr, label labl) %{
57145711 Label &L = *($labl$$label);
57155712 switch($cop$$cmpcode) {
57165713 case 0x01: //equal
5717- if (&L)
5718- __ bnez($cr$$Register, L);
5719- else
5720- __ bnez($cr$$Register, (int)0);
5714+ __ bnez($cr$$Register, L);
57215715 break;
57225716 case 0x02: //not equal
5723- if (&L)
5724- __ beqz($cr$$Register, L);
5725- else
5726- __ beqz($cr$$Register, (int)0);
5717+ __ beqz($cr$$Register, L);
57275718 break;
57285719 default:
57295720 Unimplemented();
@@ -6011,45 +6002,27 @@ instruct branchConF_reg_reg_short(cmpOp cmp, regF src1, regF src2, label labl) %
60116002 switch(flag) {
60126003 case 0x01: //equal
60136004 __ fcmp_ceq_s(FCC0, reg_op1, reg_op2);
6014- if (&L)
6015- __ bcnez(FCC0, L);
6016- else
6017- __ bcnez(FCC0, (int)0);
6005+ __ bcnez(FCC0, L);
60186006 break;
60196007 case 0x02: //not_equal
60206008 __ fcmp_ceq_s(FCC0, reg_op1, reg_op2);
6021- if (&L)
6022- __ bceqz(FCC0, L);
6023- else
6024- __ bceqz(FCC0, (int)0);
6009+ __ bceqz(FCC0, L);
60256010 break;
60266011 case 0x03: //greater
60276012 __ fcmp_cule_s(FCC0, reg_op1, reg_op2);
6028- if(&L)
6029- __ bceqz(FCC0, L);
6030- else
6031- __ bceqz(FCC0, (int)0);
6013+ __ bceqz(FCC0, L);
60326014 break;
60336015 case 0x04: //greater_equal
60346016 __ fcmp_cult_s(FCC0, reg_op1, reg_op2);
6035- if(&L)
6036- __ bceqz(FCC0, L);
6037- else
6038- __ bceqz(FCC0, (int)0);
6017+ __ bceqz(FCC0, L);
60396018 break;
60406019 case 0x05: //less
60416020 __ fcmp_cult_s(FCC0, reg_op1, reg_op2);
6042- if(&L)
6043- __ bcnez(FCC0, L);
6044- else
6045- __ bcnez(FCC0, (int)0);
6021+ __ bcnez(FCC0, L);
60466022 break;
60476023 case 0x06: //less_equal
60486024 __ fcmp_cule_s(FCC0, reg_op1, reg_op2);
6049- if(&L)
6050- __ bcnez(FCC0, L);
6051- else
6052- __ bcnez(FCC0, (int)0);
6025+ __ bcnez(FCC0, L);
60536026 break;
60546027 default:
60556028 Unimplemented();
@@ -6075,46 +6048,28 @@ instruct branchConD_reg_reg_short(cmpOp cmp, regD src1, regD src2, label labl) %
60756048 switch(flag) {
60766049 case 0x01: //equal
60776050 __ fcmp_ceq_d(FCC0, reg_op1, reg_op2);
6078- if (&L)
6079- __ bcnez(FCC0, L);
6080- else
6081- __ bcnez(FCC0, (int)0);
6051+ __ bcnez(FCC0, L);
60826052 break;
60836053 case 0x02: //not_equal
60846054 // c_ueq_d cannot distinguish NaN from equal. Double.isNaN(Double) is implemented by 'f != f', so the use of c_ueq_d causes bugs.
60856055 __ fcmp_ceq_d(FCC0, reg_op1, reg_op2);
6086- if (&L)
6087- __ bceqz(FCC0, L);
6088- else
6089- __ bceqz(FCC0, (int)0);
6056+ __ bceqz(FCC0, L);
60906057 break;
60916058 case 0x03: //greater
60926059 __ fcmp_cule_d(FCC0, reg_op1, reg_op2);
6093- if(&L)
6094- __ bceqz(FCC0, L);
6095- else
6096- __ bceqz(FCC0, (int)0);
6060+ __ bceqz(FCC0, L);
60976061 break;
60986062 case 0x04: //greater_equal
60996063 __ fcmp_cult_d(FCC0, reg_op1, reg_op2);
6100- if(&L)
6101- __ bceqz(FCC0, L);
6102- else
6103- __ bceqz(FCC0, (int)0);
6064+ __ bceqz(FCC0, L);
61046065 break;
61056066 case 0x05: //less
61066067 __ fcmp_cult_d(FCC0, reg_op1, reg_op2);
6107- if(&L)
6108- __ bcnez(FCC0, L);
6109- else
6110- __ bcnez(FCC0, (int)0);
6068+ __ bcnez(FCC0, L);
61116069 break;
61126070 case 0x06: //less_equal
61136071 __ fcmp_cule_d(FCC0, reg_op1, reg_op2);
6114- if(&L)
6115- __ bcnez(FCC0, L);
6116- else
6117- __ bcnez(FCC0, (int)0);
6072+ __ bcnez(FCC0, L);
61186073 break;
61196074 default:
61206075 Unimplemented();
@@ -16573,23 +16528,35 @@ instruct cmpV32(vecY dst, vecY src1, vecY src2, immI cond)
1657316528
1657416529// ---------------------------- LOAD_IOTA_INDICES -----------------------------
1657516530
16576- instruct loadcon16B (vecX dst, immI_0 src) %{
16577- predicate(Matcher::vector_length (n) == 16 && Matcher::vector_element_basic_type(n) == T_BYTE );
16531+ instruct loadconV16 (vecX dst, immI_0 src) %{
16532+ predicate(Matcher::vector_length_in_bytes (n) == 16);
1657816533 match(Set dst (VectorLoadConst src));
16579- format %{ "vld_con $dst, CONSTANT_MEMORY\t# @loadcon16B " %}
16534+ format %{ "vld_con $dst, CONSTANT_MEMORY\t# @loadconV16 " %}
1658016535 ins_encode %{
16581- __ li(AT, (long)StubRoutines::la::vector_iota_indices());
16536+ // The iota indices are ordered by type B/S/I/L/F/D, and the offset between two types is 32.
16537+ BasicType bt = Matcher::vector_element_basic_type(this);
16538+ int offset = exact_log2(type2aelembytes(bt)) << 5;
16539+ if (is_floating_point_type(bt)) {
16540+ offset += 64;
16541+ }
16542+ __ li(AT, (long)(StubRoutines::la::vector_iota_indices() + offset));
1658216543 __ vld($dst$$FloatRegister, AT, (int)0);
1658316544 %}
1658416545 ins_pipe( pipe_slow );
1658516546%}
1658616547
16587- instruct loadcon32B (vecY dst, immI_0 src) %{
16588- predicate(Matcher::vector_length (n) == 32 && Matcher::vector_element_basic_type(n) == T_BYTE );
16548+ instruct loadconV32 (vecY dst, immI_0 src) %{
16549+ predicate(Matcher::vector_length_in_bytes (n) == 32);
1658916550 match(Set dst (VectorLoadConst src));
16590- format %{ "xvld_con $dst, CONSTANT_MEMORY\t# @loadcon32B " %}
16551+ format %{ "xvld_con $dst, CONSTANT_MEMORY\t# @loadconV32 " %}
1659116552 ins_encode %{
16592- __ li(AT, (long)StubRoutines::la::vector_iota_indices());
16553+ // The iota indices are ordered by type B/S/I/L/F/D, and the offset between two types is 32.
16554+ BasicType bt = Matcher::vector_element_basic_type(this);
16555+ int offset = exact_log2(type2aelembytes(bt)) << 5;
16556+ if (is_floating_point_type(bt)) {
16557+ offset += 64;
16558+ }
16559+ __ li(AT, (long)(StubRoutines::la::vector_iota_indices() + offset));
1659316560 __ xvld($dst$$FloatRegister, AT, (int)0);
1659416561 %}
1659516562 ins_pipe( pipe_slow );
0 commit comments