Skip to content

Commit 8e4e305

Browse files
committed
update to jdk-20+9
27312: LA port of 8291106: ZPlatformGranuleSizeShift is redundant 27311: LA port of 8291000: C2: Purge LoadPLocked and Store*Conditional nodes
1 parent 17cd2c4 commit 8e4e305

File tree

2 files changed

+1
-118
lines changed

2 files changed

+1
-118
lines changed

src/hotspot/cpu/loongarch/gc/z/zGlobals_loongarch.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2021, Loongson Technology. All rights reserved.
3+
* Copyright (c) 2021, 2022, Loongson Technology. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
2525
#ifndef CPU_LOONGARCH_GC_Z_ZGLOBALS_LOONGARCH_HPP
2626
#define CPU_LOONGARCH_GC_Z_ZGLOBALS_LOONGARCH_HPP
2727

28-
const size_t ZPlatformGranuleSizeShift = 21; // 2MB
2928
const size_t ZPlatformHeapViews = 3;
3029
const size_t ZPlatformCacheLineSize = 64;
3130

src/hotspot/cpu/loongarch/loongarch_64.ad

Lines changed: 0 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -5305,7 +5305,6 @@ instruct jmpLoopEnd_reg_zero_long(cmpOp cop, mRegI src1, immI_0 zero, label lab
53055305
%}
53065306

53075307

5308-
// This match pattern is created for StoreIConditional since I cannot match IfNode without a RegFlags!
53095308
instruct jmpCon_flags_long(cmpOpEqNe cop, FlagsReg cr, label labl) %{
53105309
match(If cop cr);
53115310
effect(USE labl);
@@ -5735,7 +5734,6 @@ instruct jmpLoopEnd_reg_zero_short(cmpOp cop, mRegI src1, immI_0 zero, label la
57355734
%}
57365735

57375736

5738-
// This match pattern is created for StoreIConditional since I cannot match IfNode without a RegFlags!
57395737
instruct jmpCon_flags_short(cmpOpEqNe cop, FlagsReg cr, label labl) %{
57405738
match(If cop cr);
57415739
effect(USE labl);
@@ -11363,120 +11361,6 @@ instruct partialSubtypeCheckVsZero_short( mRegP sub, mRegP super, mRegP tmp1, mR
1136311361
ins_short_branch(1);
1136411362
%}
1136511363

11366-
// Conditional-store of the updated heap-top.
11367-
// Used during allocation of the shared heap.
11368-
11369-
instruct storePConditional(memory heap_top_ptr, mRegP oldval, mRegP newval, FlagsReg cr) %{
11370-
match(Set cr (StorePConditional heap_top_ptr (Binary oldval newval)));
11371-
11372-
format %{ "move AT, $newval\n\t"
11373-
"sc_d $heap_top_ptr, AT\t# (ptr) @storePConditional \n\t"
11374-
"move $cr, AT\n" %}
11375-
ins_encode%{
11376-
Register oldval = $oldval$$Register;
11377-
Register newval = $newval$$Register;
11378-
Address addr(as_Register($heap_top_ptr$$base), $heap_top_ptr$$disp);
11379-
11380-
int index = $heap_top_ptr$$index;
11381-
int scale = $heap_top_ptr$$scale;
11382-
int disp = $heap_top_ptr$$disp;
11383-
11384-
guarantee(Assembler::is_simm(disp, 12), "");
11385-
11386-
if (index != -1) {
11387-
__ stop("in storePConditional: index != -1");
11388-
} else {
11389-
__ move(AT, newval);
11390-
__ sc_d(AT, addr);
11391-
__ move($cr$$Register, AT);
11392-
}
11393-
%}
11394-
ins_pipe(long_memory_op);
11395-
%}
11396-
11397-
// Conditional-store of an int value.
11398-
// AT flag is set on success, reset otherwise.
11399-
instruct storeIConditional(memory mem, mRegI oldval, mRegI newval, FlagsReg cr) %{
11400-
match(Set cr (StoreIConditional mem (Binary oldval newval)));
11401-
format %{ "CMPXCHG $newval, $mem, $oldval \t# @storeIConditional" %}
11402-
11403-
ins_encode %{
11404-
Register oldval = $oldval$$Register;
11405-
Register newval = $newval$$Register;
11406-
Register cr = $cr$$Register;
11407-
Address addr(as_Register($mem$$base), $mem$$disp);
11408-
11409-
int index = $mem$$index;
11410-
int scale = $mem$$scale;
11411-
int disp = $mem$$disp;
11412-
11413-
guarantee(Assembler::is_simm(disp, 12), "");
11414-
11415-
if (index != -1) {
11416-
__ stop("in storeIConditional: index != -1");
11417-
} else {
11418-
if (cr != addr.base() && cr != oldval && cr != newval) {
11419-
__ cmpxchg32(addr, oldval, newval, cr, true, false, true);
11420-
} else {
11421-
__ cmpxchg32(addr, oldval, newval, AT, true, false, true);
11422-
__ move(cr, AT);
11423-
}
11424-
}
11425-
%}
11426-
11427-
ins_pipe(long_memory_op);
11428-
%}
11429-
11430-
// Conditional-store of a long value.
11431-
// ZF flag is set on success, reset otherwise. Implemented with a CMPXCHG.
11432-
instruct storeLConditional(memory mem, mRegL oldval, mRegL newval, FlagsReg cr)
11433-
%{
11434-
match(Set cr (StoreLConditional mem (Binary oldval newval)));
11435-
11436-
format %{ "cmpxchg $mem, $newval\t# If $oldval == $mem then store $newval into $mem" %}
11437-
ins_encode%{
11438-
Register oldval = $oldval$$Register;
11439-
Register newval = $newval$$Register;
11440-
Register cr = $cr$$Register;
11441-
Address addr(as_Register($mem$$base), $mem$$disp);
11442-
11443-
int index = $mem$$index;
11444-
int scale = $mem$$scale;
11445-
int disp = $mem$$disp;
11446-
11447-
guarantee(Assembler::is_simm(disp, 12), "");
11448-
11449-
if (index != -1) {
11450-
__ stop("in storeIConditional: index != -1");
11451-
} else {
11452-
if (cr != addr.base() && cr != oldval && cr != newval) {
11453-
__ cmpxchg(addr, oldval, newval, cr, false, true);
11454-
} else {
11455-
__ cmpxchg(addr, oldval, newval, AT, false, true);
11456-
__ move(cr, AT);
11457-
}
11458-
}
11459-
%}
11460-
ins_pipe(long_memory_op);
11461-
%}
11462-
11463-
// Implement LoadPLocked. Must be ordered against changes of the memory location
11464-
// by storePConditional.
11465-
instruct loadPLocked(mRegP dst, memory mem) %{
11466-
match(Set dst (LoadPLocked mem));
11467-
ins_cost(MEMORY_REF_COST);
11468-
11469-
format %{ "ll_d $dst, $mem #@loadPLocked\n\t" %}
11470-
size(12);
11471-
ins_encode %{
11472-
relocInfo::relocType disp_reloc = $mem->disp_reloc();
11473-
assert(disp_reloc == relocInfo::none, "cannot have disp");
11474-
__ loadstore_enc($dst$$Register, $mem$$base, $mem$$index, $mem$$scale, $mem$$disp, C2_MacroAssembler::LOAD_LINKED_LONG);
11475-
%}
11476-
ins_pipe( ialu_loadI );
11477-
%}
11478-
11479-
1148011364
instruct compareAndSwapI(mRegI res, mRegP mem_ptr, mRegI oldval, mRegI newval) %{
1148111365
match(Set res (CompareAndSwapI mem_ptr (Binary oldval newval)));
1148211366
ins_cost(3 * MEMORY_REF_COST);

0 commit comments

Comments
 (0)