RFR: 8344381: [s390x] Test failures with error: Register type is not known [v2]
Amit Kumar
amitkumar at openjdk.org
Tue Nov 19 05:24:26 UTC 2024
On Mon, 18 Nov 2024 13:32:59 GMT, Amit Kumar <amitkumar at openjdk.org> wrote:
>> Adds SaveLiveRegister portion for vector registers also.
>>
>> Depends on https://github.com/openjdk/jdk/pull/22190. Once that PR gets integrated, will rebase and mark it ready for review.
>
> Amit Kumar has updated the pull request incrementally with one additional commit since the last revision:
>
> suggestion from martin
I looked ppc-abi and your changes. I want to push some additional changes:
diff --git a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp
index 57d38170a4d..3fff500e47c 100644
--- a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp
+++ b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp
@@ -240,6 +240,7 @@ int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int of
int reg_save_index = 0;
RegMaskIterator live_regs_iterator(_reg_mask);
+ // Going to preserve the volatile registers which can be used by Register Allocator.
while(live_regs_iterator.has_next()) {
const OptoReg::Name opto_reg = live_regs_iterator.next();
@@ -251,8 +252,10 @@ int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int of
const VMReg vm_reg = OptoReg::as_VMReg(opto_reg);
if (vm_reg->is_Register()) {
Register std_reg = vm_reg->as_Register();
-
- if (std_reg->encoding() >= Z_R2->encoding() && std_reg->encoding() <= Z_R15->encoding()) {
+ // Z_R0 and Z_R1 will not be allocated by the register allocator, see s390.ad (Integer Register Classes)
+ // Z_R6 to Z_R15 are saved registers, except Z_R14 (see Z-Abi)
+ if (std_reg->encoding() == Z_R14->encoding()
+ || (std_reg->encoding() >= Z_R2->encoding() && std_reg->encoding() <= Z_R5->encoding())) {
reg_save_index++;
if (action == ACTION_SAVE) {
@@ -265,7 +268,8 @@ int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int of
}
} else if (vm_reg->is_FloatRegister()) {
FloatRegister fp_reg = vm_reg->as_FloatRegister();
- if (fp_reg->encoding() >= Z_F0->encoding() && fp_reg->encoding() <= Z_F15->encoding()
+ // Z_R1 will not be allocated by the register allocator, see s390.ad (Float Register Classes)
+ if (fp_reg->encoding() >= Z_F0->encoding() && fp_reg->encoding() <= Z_F7->encoding()
&& fp_reg->encoding() != Z_F1->encoding()) {
reg_save_index++;
@@ -279,7 +283,8 @@ int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int of
}
} else if (vm_reg->is_VectorRegister()) {
VectorRegister vs_reg = vm_reg->as_VectorRegister();
- if (vs_reg->encoding() >= Z_V2->encoding() && vs_reg->encoding() <= Z_V31->encoding()) {
+ // Z_V0 to Z_V15 will not be allocated by the register allocator, see s390.ad (reg class z_v_reg)
+ if (vs_reg->encoding() >= Z_V16->encoding() && vs_reg->encoding() <= Z_V31->encoding()) {
reg_save_index += 2;
if (action == ACTION_SAVE) {
__ z_vst(vs_reg, Address(Z_SP, offset - reg_save_index * BytesPerWord));
<img width="913" alt="z_abi" src="https://github.com/user-attachments/assets/4ac267ee-fb74-45fd-9aaa-07de81f99b18">
Does these seem any good ? I guess I have preserved many already-saved-registers. Maybe we can get rid of that ?
Tier1 test are clean. We are ready for review.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22197#issuecomment-2483653718
PR Comment: https://git.openjdk.org/jdk/pull/22197#issuecomment-2484732180
More information about the hotspot-dev
mailing list