@@ -72,7 +72,7 @@ void C2_MacroAssembler::fast_lock_c2(Register oop, Register box, Register flag,
7272 st_d (tmp, box, BasicLock::displaced_header_offset_in_bytes ());
7373
7474 // If cmpxchg is succ, then flag = 1
75- cmpxchg (Address (oop, 0 ), tmp, box, flag, true , false );
75+ cmpxchg (Address (oop, 0 ), tmp, box, flag, true , true /* acquire */ );
7676 bnez (flag, cont);
7777
7878 // If the compare-and-exchange succeeded, then we found an unlocked
@@ -106,7 +106,7 @@ void C2_MacroAssembler::fast_lock_c2(Register oop, Register box, Register flag,
106106 // Try to CAS m->owner from null to current thread.
107107 move (AT, R0);
108108 addi_d (tmp, disp_hdr, in_bytes (ObjectMonitor::owner_offset ()) - markWord::monitor_value);
109- cmpxchg (Address (tmp, 0 ), AT, TREG, flag, true , false );
109+ cmpxchg (Address (tmp, 0 ), AT, TREG, flag, true , true /* acquire */ );
110110 if (LockingMode != LM_LIGHTWEIGHT) {
111111 // Store a non-null value into the box to avoid looking like a re-entrant
112112 // lock. The fast-path monitor unlock code checks for
@@ -166,7 +166,7 @@ void C2_MacroAssembler::fast_unlock_c2(Register oop, Register box, Register flag
166166 // Check if it is still a light weight lock, this is true if we
167167 // see the stack address of the basicLock in the markWord of the
168168 // object.
169- cmpxchg (Address (oop, 0 ), box, disp_hdr, flag, false , false );
169+ cmpxchg (Address (oop, 0 ), box, disp_hdr, flag, false , false /* acquire */ );
170170 b (cont);
171171 } else {
172172 assert (LockingMode == LM_LIGHTWEIGHT, " must be" );
@@ -1317,16 +1317,26 @@ void C2_MacroAssembler::reduce(Register dst, Register src, FloatRegister vsrc, F
13171317 } else if (vector_size == 16 ) {
13181318 vpermi_w (tmp1, vsrc, 0b00001110 );
13191319 reduce_ins_v (tmp1, vsrc, tmp1, type, opcode);
1320+ } else if (vector_size == 8 ) {
1321+ vshuf4i_w (tmp1, vsrc, 0b00000001 );
1322+ reduce_ins_v (tmp1, vsrc, tmp1, type, opcode);
1323+ } else if (vector_size == 4 ) {
1324+ vshuf4i_h (tmp1, vsrc, 0b00000001 );
1325+ reduce_ins_v (tmp1, vsrc, tmp1, type, opcode);
13201326 } else {
13211327 ShouldNotReachHere ();
13221328 }
13231329
13241330 if (type != T_LONG) {
1325- vshuf4i_w (tmp2, tmp1, 0b00000001 );
1326- reduce_ins_v (tmp1, tmp2, tmp1, type, opcode);
1327- if (type != T_INT) {
1328- vshuf4i_h (tmp2, tmp1, 0b00000001 );
1331+ if (vector_size > 8 ) {
1332+ vshuf4i_w (tmp2, tmp1, 0b00000001 );
13291333 reduce_ins_v (tmp1, tmp2, tmp1, type, opcode);
1334+ }
1335+ if (type != T_INT) {
1336+ if (vector_size > 4 ) {
1337+ vshuf4i_h (tmp2, tmp1, 0b00000001 );
1338+ reduce_ins_v (tmp1, tmp2, tmp1, type, opcode);
1339+ }
13301340 if (type != T_SHORT) {
13311341 vshuf4i_b (tmp2, tmp1, 0b00000001 );
13321342 reduce_ins_v (tmp1, tmp2, tmp1, type, opcode);
@@ -1414,6 +1424,11 @@ void C2_MacroAssembler::reduce(FloatRegister dst, FloatRegister src, FloatRegist
14141424 default :
14151425 ShouldNotReachHere ();
14161426 }
1427+ } else if (vector_size == 8 ) {
1428+ assert (type == T_FLOAT, " must be" );
1429+ vpermi_w (tmp, vsrc, 0b00000001 );
1430+ reduce_ins_f (dst, vsrc, src, type, opcode);
1431+ reduce_ins_f (dst, tmp, dst, type, opcode);
14171432 } else {
14181433 ShouldNotReachHere ();
14191434 }
@@ -1487,8 +1502,8 @@ void C2_MacroAssembler::vector_compare(FloatRegister dst, FloatRegister src1, Fl
14871502 case BoolTest::eq: xvfcmp_ceq_s (dst, src1, src2); break ;
14881503 case BoolTest::ge: xvfcmp_cle_s (dst, src2, src1); break ;
14891504 case BoolTest::gt: xvfcmp_clt_s (dst, src2, src1); break ;
1490- case BoolTest::le: xvfcmp_cule_s (dst, src1, src2); break ;
1491- case BoolTest::lt: xvfcmp_cult_s (dst, src1, src2); break ;
1505+ case BoolTest::le: xvfcmp_cle_s (dst, src1, src2); break ;
1506+ case BoolTest::lt: xvfcmp_clt_s (dst, src1, src2); break ;
14921507 default :
14931508 ShouldNotReachHere ();
14941509 }
@@ -1498,15 +1513,15 @@ void C2_MacroAssembler::vector_compare(FloatRegister dst, FloatRegister src1, Fl
14981513 case BoolTest::eq: xvfcmp_ceq_d (dst, src1, src2); break ;
14991514 case BoolTest::ge: xvfcmp_cle_d (dst, src2, src1); break ;
15001515 case BoolTest::gt: xvfcmp_clt_d (dst, src2, src1); break ;
1501- case BoolTest::le: xvfcmp_cule_d (dst, src1, src2); break ;
1502- case BoolTest::lt: xvfcmp_cult_d (dst, src1, src2); break ;
1516+ case BoolTest::le: xvfcmp_cle_d (dst, src1, src2); break ;
1517+ case BoolTest::lt: xvfcmp_clt_d (dst, src1, src2); break ;
15031518 default :
15041519 ShouldNotReachHere ();
15051520 }
15061521 } else {
15071522 ShouldNotReachHere ();
15081523 }
1509- } else if (vector_size == 16 ) {
1524+ } else if (vector_size == 16 || vector_size == 8 || vector_size == 4 ) {
15101525 if (bt == T_BYTE) {
15111526 switch (cond) {
15121527 case BoolTest::ne: vseq_b (dst, src1, src2); vxori_b (dst, dst, 0xff ); break ;
@@ -1573,8 +1588,8 @@ void C2_MacroAssembler::vector_compare(FloatRegister dst, FloatRegister src1, Fl
15731588 case BoolTest::eq: vfcmp_ceq_s (dst, src1, src2); break ;
15741589 case BoolTest::ge: vfcmp_cle_s (dst, src2, src1); break ;
15751590 case BoolTest::gt: vfcmp_clt_s (dst, src2, src1); break ;
1576- case BoolTest::le: vfcmp_cule_s (dst, src1, src2); break ;
1577- case BoolTest::lt: vfcmp_cult_s (dst, src1, src2); break ;
1591+ case BoolTest::le: vfcmp_cle_s (dst, src1, src2); break ;
1592+ case BoolTest::lt: vfcmp_clt_s (dst, src1, src2); break ;
15781593 default :
15791594 ShouldNotReachHere ();
15801595 }
@@ -1584,8 +1599,8 @@ void C2_MacroAssembler::vector_compare(FloatRegister dst, FloatRegister src1, Fl
15841599 case BoolTest::eq: vfcmp_ceq_d (dst, src1, src2); break ;
15851600 case BoolTest::ge: vfcmp_cle_d (dst, src2, src1); break ;
15861601 case BoolTest::gt: vfcmp_clt_d (dst, src2, src1); break ;
1587- case BoolTest::le: vfcmp_cule_d (dst, src1, src2); break ;
1588- case BoolTest::lt: vfcmp_cult_d (dst, src1, src2); break ;
1602+ case BoolTest::le: vfcmp_cle_d (dst, src1, src2); break ;
1603+ case BoolTest::lt: vfcmp_clt_d (dst, src1, src2); break ;
15891604 default :
15901605 ShouldNotReachHere ();
15911606 }
0 commit comments