Skip to content

Commit 65c465a

Browse files
authored
Update (2023.09.20, 3rd)
32446: Fix the error of assert(v_align > 1) when MaxVectorSize is 4 or 8 30382: LA port of 8292591: Experimentally add back barrier-less Java thread transitions 32377: Optimize VectorMaskFirstTrue 32328: implement the intrinsic of ShiftRightImplWork 32365: Support comparison of DecodeN with zero 24480: [LA][C2] Eliminate unnecessary CastP2X 32304: Decompose the rem calculation in the DivMod nodes
1 parent ccd2390 commit 65c465a

File tree

7 files changed

+195
-126
lines changed

7 files changed

+195
-126
lines changed

src/hotspot/cpu/loongarch/assembler_loongarch.hpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,8 @@ class Assembler : public AbstractAssembler {
919919
vnor_v_op = 0b01110001001001111,
920920
vandn_v_op = 0b01110001001010000,
921921
vorn_v_op = 0b01110001001010001,
922+
vfrstp_b_op = 0b01110001001010110,
923+
vfrstp_h_op = 0b01110001001010111,
922924
vadd_q_op = 0b01110001001011010,
923925
vsub_q_op = 0b01110001001011011,
924926
vfadd_s_op = 0b01110001001100001,
@@ -956,6 +958,8 @@ class Assembler : public AbstractAssembler {
956958
vsubi_hu_op = 0b01110010100011001,
957959
vsubi_wu_op = 0b01110010100011010,
958960
vsubi_du_op = 0b01110010100011011,
961+
vfrstpi_b_op = 0b01110010100110100,
962+
vfrstpi_h_op = 0b01110010100110101,
959963
vrotri_w_op = 0b01110010101000001,
960964
vbitclri_w_op = 0b01110011000100001,
961965
vbitseti_w_op = 0b01110011000101001,
@@ -964,8 +968,6 @@ class Assembler : public AbstractAssembler {
964968
vsrli_w_op = 0b01110011001100001,
965969
vsrai_w_op = 0b01110011001101001,
966970
vsrlni_h_w_op = 0b01110011010000001,
967-
vfrstpi_b_op = 0b01110010100110100,
968-
vfrstpi_h_op = 0b01110010100110101,
969971
xvseq_b_op = 0b01110100000000000,
970972
xvseq_h_op = 0b01110100000000001,
971973
xvseq_w_op = 0b01110100000000010,
@@ -1084,6 +1086,8 @@ class Assembler : public AbstractAssembler {
10841086
xvnor_v_op = 0b01110101001001111,
10851087
xvandn_v_op = 0b01110101001010000,
10861088
xvorn_v_op = 0b01110101001010001,
1089+
xvfrstp_b_op = 0b01110101001010110,
1090+
xvfrstp_h_op = 0b01110101001010111,
10871091
xvadd_q_op = 0b01110101001011010,
10881092
xvsub_q_op = 0b01110101001011011,
10891093
xvfadd_s_op = 0b01110101001100001,
@@ -1122,6 +1126,8 @@ class Assembler : public AbstractAssembler {
11221126
xvsubi_hu_op = 0b01110110100011001,
11231127
xvsubi_wu_op = 0b01110110100011010,
11241128
xvsubi_du_op = 0b01110110100011011,
1129+
xvfrstpi_b_op = 0b01110110100110100,
1130+
xvfrstpi_h_op = 0b01110110100110101,
11251131
xvrotri_w_op = 0b01110110101000001,
11261132
xvbitclri_w_op = 0b01110111000100001,
11271133
xvbitseti_w_op = 0b01110111000101001,
@@ -2605,8 +2611,15 @@ class Assembler : public AbstractAssembler {
26052611
void xvbitrevi_w(FloatRegister xd, FloatRegister xj, int ui5) { ASSERT_LASX emit_int32(insn_I5RR(xvbitrevi_w_op, ui5, (int)xj->encoding(), (int)xd->encoding())); }
26062612
void xvbitrevi_d(FloatRegister xd, FloatRegister xj, int ui6) { ASSERT_LASX emit_int32(insn_I6RR(xvbitrevi_d_op, ui6, (int)xj->encoding(), (int)xd->encoding())); }
26072613

2614+
void vfrstp_b(FloatRegister vd, FloatRegister vj, FloatRegister vk) { ASSERT_LSX emit_int32(insn_RRR( vfrstp_b_op, (int)vk->encoding(), (int)vj->encoding(), (int)vd->encoding())); }
2615+
void vfrstp_h(FloatRegister vd, FloatRegister vj, FloatRegister vk) { ASSERT_LSX emit_int32(insn_RRR( vfrstp_h_op, (int)vk->encoding(), (int)vj->encoding(), (int)vd->encoding())); }
2616+
void xvfrstp_b(FloatRegister xd, FloatRegister xj, FloatRegister xk) { ASSERT_LASX emit_int32(insn_RRR(xvfrstp_b_op, (int)xk->encoding(), (int)xj->encoding(), (int)xd->encoding())); }
2617+
void xvfrstp_h(FloatRegister xd, FloatRegister xj, FloatRegister xk) { ASSERT_LASX emit_int32(insn_RRR(xvfrstp_h_op, (int)xk->encoding(), (int)xj->encoding(), (int)xd->encoding())); }
2618+
26082619
void vfrstpi_b(FloatRegister vd, FloatRegister vj, int ui5) { ASSERT_LSX emit_int32(insn_I5RR( vfrstpi_b_op, ui5, (int)vj->encoding(), (int)vd->encoding())); }
26092620
void vfrstpi_h(FloatRegister vd, FloatRegister vj, int ui5) { ASSERT_LSX emit_int32(insn_I5RR( vfrstpi_h_op, ui5, (int)vj->encoding(), (int)vd->encoding())); }
2621+
void xvfrstpi_b(FloatRegister xd, FloatRegister xj, int ui5) { ASSERT_LASX emit_int32(insn_I5RR(xvfrstpi_b_op, ui5, (int)xj->encoding(), (int)xd->encoding())); }
2622+
void xvfrstpi_h(FloatRegister xd, FloatRegister xj, int ui5) { ASSERT_LASX emit_int32(insn_I5RR(xvfrstpi_h_op, ui5, (int)xj->encoding(), (int)xd->encoding())); }
26102623

26112624
void vfadd_s(FloatRegister vd, FloatRegister vj, FloatRegister vk) { ASSERT_LSX emit_int32(insn_RRR( vfadd_s_op, (int)vk->encoding(), (int)vj->encoding(), (int)vd->encoding())); }
26122625
void vfadd_d(FloatRegister vd, FloatRegister vj, FloatRegister vk) { ASSERT_LSX emit_int32(insn_RRR( vfadd_d_op, (int)vk->encoding(), (int)vj->encoding(), (int)vd->encoding())); }

src/hotspot/cpu/loongarch/downcallLinker_loongarch_64.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "logging/logStream.hpp"
3232
#include "memory/resourceArea.hpp"
3333
#include "prims/downcallLinker.hpp"
34+
#include "runtime/globals.hpp"
3435
#include "runtime/stubCodeGenerator.hpp"
3536

3637
#define __ _masm->
@@ -274,16 +275,15 @@ void DowncallStubGenerator::generate() {
274275
Label L_after_reguard;
275276
if (_needs_transition) {
276277
__ li(tmp1, _thread_in_native_trans);
277-
if (os::is_MP()) {
278+
279+
// Force this write out before the read below
280+
if (os::is_MP() && !UseSystemMemoryBarrier) {
278281
__ addi_d(tmp2, TREG, in_bytes(JavaThread::thread_state_offset()));
279-
__ amswap_db_w(R0, tmp1, tmp2);
282+
__ amswap_db_w(R0, tmp1, tmp2); // AnyAny
280283
} else {
281284
__ st_w(tmp1, TREG, in_bytes(JavaThread::thread_state_offset()));
282285
}
283286

284-
// Force this write out before the read below
285-
//if (os::is_MP()) __ membar(__ AnyAny);
286-
287287
__ safepoint_poll(L_safepoint_poll_slow_path, TREG, true /* at_return */, true /* acquire */, false /* in_nmethod */);
288288

289289
__ ld_w(tmp1, TREG, in_bytes(JavaThread::suspend_flags_offset()));

0 commit comments

Comments
 (0)