Skip to content

Commit

Permalink
Merge pull request #7600 from eclipse/revert-7572-32bit_reg
Browse files Browse the repository at this point in the history
Revert "Stop using the J9VM_JIT_32BIT_USES64BIT_REGISTERS from m4 asm"
  • Loading branch information
pshipton committed Oct 25, 2019
2 parents 5fed57a + 0c4e136 commit 077e525
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 22 deletions.
4 changes: 4 additions & 0 deletions runtime/codert_vm/CMakeLists.txt
Expand Up @@ -66,6 +66,10 @@ elseif(OMR_ARCH_S390)
endif()
# NOTE: no flags needed for 31 bit

if(J9VM_JIT_32BIT_USES64BIT_REGISTERS)
list(APPEND m4_defines J9VM_JIT_32BIT_USES64BIT_REGISTERS)
endif()

if(J9VM_JIT_FREE_SYSTEM_STACK_POINTER)
list(APPEND m4_defines J9VM_JIT_FREE_SYSTEM_STACK_POINTER)
endif()
Expand Down
6 changes: 6 additions & 0 deletions runtime/compiler/build/toolcfg/gnu/common.mk
Expand Up @@ -369,6 +369,12 @@ ifeq ($(HOST_ARCH),z)
M4_DEFINES+=$(HOST_DEFINES) $(TARGET_DEFINES)
M4_DEFINES+=J9VM_TIERED_CODE_CACHE

ifeq ($(HOST_BITS),32)
ifneq (,$(shell grep 'define J9VM_JIT_32BIT_USES64BIT_REGISTERS' $(J9SRC)/include/j9cfg.h))
M4_DEFINES+=J9VM_JIT_32BIT_USES64BIT_REGISTERS
endif
endif

ifeq ($(HOST_BITS),64)
ifneq (,$(shell grep 'define J9VM_INTERP_COMPRESSED_OBJECT_HEADER' $(J9SRC)/include/j9cfg.h))
M4_DEFINES+=J9VM_INTERP_COMPRESSED_OBJECT_HEADER
Expand Down
6 changes: 6 additions & 0 deletions runtime/compiler/build/toolcfg/zos-xlc/common.mk
Expand Up @@ -186,6 +186,12 @@ M4_DEFINES+=\
J9VM_TIERED_CODE_CACHE \
J9VM_JIT_FREE_SYSTEM_STACK_POINTER

ifeq ($(HOST_BITS),32)
ifneq (,$(shell grep 'define J9VM_JIT_32BIT_USES64BIT_REGISTERS' $(J9SRC)/include/j9cfg.h 2>/dev/null))
M4_DEFINES+=J9VM_JIT_32BIT_USES64BIT_REGISTERS
endif
endif

ifeq ($(HOST_BITS),64)
M4_DEFINES+=TR_64Bit

Expand Down
10 changes: 5 additions & 5 deletions runtime/compiler/z/runtime/Math.m4
Expand Up @@ -722,7 +722,7 @@ LABEL(LDIVExit)
END_FUNC(_longDivide,_LDIV,7)

SETVAL(rdsa,5)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
SETVAL(dsaSize,32*PTR_SIZE)
],[dnl
SETVAL(dsaSize,16*PTR_SIZE)
Expand All @@ -739,7 +739,7 @@ ZZ
ST_GPR r14,PTR_SIZE(,rdsa)
AHI_GPR rdsa,-dsaSize
STM_GPR r0,r15,0(rdsa)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
STMH_GPR r0,r15,64(rdsa)
])dnl

Expand Down Expand Up @@ -769,7 +769,7 @@ ifdef([TR_HOST_64BIT],[dnl

LR_GPR rdsa,r8 #restore dsa from r8
LM_GPR r0,r15,0(rdsa)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
LMH_GPR r0,r15,64(rdsa)
])dnl
AHI_GPR rdsa,dsaSize
Expand All @@ -789,7 +789,7 @@ ZZ
ST_GPR r14,PTR_SIZE(,rdsa)
AHI_GPR rdsa,-dsaSize
STM_GPR r0,r15,0(rdsa)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
STMH_GPR r0,r15,64(rdsa)
])dnl

Expand Down Expand Up @@ -821,7 +821,7 @@ ZZ load up the C Environment addr into r5 and Entry point in R6

LR_GPR rdsa,r8
LM_GPR r0,r15,0(rdsa)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
LMH_GPR r0,r15,64(rdsa)
])dnl
AHI_GPR rdsa,dsaSize
Expand Down
6 changes: 3 additions & 3 deletions runtime/compiler/z/runtime/PicBuilder.m4
Expand Up @@ -2765,7 +2765,7 @@ ifdef([J9ZOS390],[dnl
END_FUNC(_RITRIC,RITRIC,8)

SETVAL(rdsa,5)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
SETVAL(dsaSize,32*PTR_SIZE)
],[dnl
SETVAL(dsaSize,16*PTR_SIZE)
Expand All @@ -2791,7 +2791,7 @@ ZZ ===================================================================
ST_GPR r14,PTR_SIZE(,rdsa)
AHI_GPR rdsa,-dsaSize
STM_GPR r0,r15,0(rdsa)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
STMH_GPR r0,r15,64(rdsa)
])dnl
LR_GPR r8,rdsa # save dsa in r8
Expand Down Expand Up @@ -2839,7 +2839,7 @@ ZZ R2 contains return value
LR_GPR rdsa,r8 #restore dsa from r8
LM_GPR r0,r1,0(rdsa)
LM_GPR r3,r15,3*PTR_SIZE(rdsa)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
LMH_GPR r0,r15,64(rdsa)
])dnl
AHI_GPR rdsa,dsaSize
Expand Down
24 changes: 12 additions & 12 deletions runtime/compiler/z/runtime/ValueProf.m4
Expand Up @@ -4,7 +4,7 @@ define(`ZZ',`**')
define(`ZZ',`##')
')dnl

ZZ Copyright (c) 2000, 2019 IBM Corp. and others
ZZ Copyright (c) 2000, 2017 IBM Corp. and others
ZZ
ZZ This program and the accompanying materials are made
ZZ available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -70,7 +70,7 @@ SETVAL(PVFPSize,0)
SETVAL(PVFPSize,8*DblLen)
])dnl

ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
SETVAL(PVGPRSize,27*PTR_SIZE)
],[dnl
SETVAL(PVGPRSize,11*PTR_SIZE)
Expand Down Expand Up @@ -506,7 +506,7 @@ START_FUNC(_jitProfileValueWrap,_jitPVW)

AHI_GPR J9SP,-ProfileValueStackSize
STM_GPR r5,r15,0(J9SP)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
STMH_GPR r0,r15,44(J9SP)
])dnl
ifdef([J9_SOFT_FLOAT],[dnl
Expand Down Expand Up @@ -552,7 +552,7 @@ ZZ do nothing
LD f7,ProfileVFPSlot7(J9SP)
])dnl
LM_GPR r5,r15,0(J9SP)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
LMH_GPR r0,r15,44(J9SP)
])dnl
AHI_GPR J9SP,ProfileValueStackSize
Expand All @@ -564,7 +564,7 @@ ZZ ------------------------------------------
START_FUNC(_jitProfileAddressWrap,_jitPAW)
AHI_GPR J9SP,-ProfileValueStackSize
STM_GPR r5,r15,0(J9SP)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
STMH_GPR r0,r15,44(J9SP)
])dnl
ifdef([J9_SOFT_FLOAT],[dnl
Expand Down Expand Up @@ -611,7 +611,7 @@ ZZ do nothing
LD f7,ProfileVFPSlot7(J9SP)
])dnl
LM_GPR r5,r15,0(J9SP)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
LMH_GPR r0,r15,44(J9SP)
])dnl
AHI_GPR J9SP,ProfileValueStackSize
Expand All @@ -623,7 +623,7 @@ ZZ ------------------------------------------
START_FUNC(_jitProfileLongValueWrap,_jitPLW)
AHI_GPR J9SP,-ProfileValueStackSize
STM_GPR r5,r15,0(J9SP)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
STMH_GPR r0,r15,44(J9SP)
])dnl
ifdef([J9_SOFT_FLOAT],[dnl
Expand Down Expand Up @@ -669,7 +669,7 @@ ZZ do nothing
LD f7,ProfileVFPSlot7(J9SP)
])dnl
LM_GPR r5,r15,0(J9SP)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
LMH_GPR r0,r15,44(J9SP)
])dnl
AHI_GPR J9SP,ProfileValueStackSize
Expand All @@ -681,7 +681,7 @@ ZZ ------------------------------------------
START_FUNC(_jitProfileBigDecimalValueWrap,_jitPBDW)
AHI_GPR J9SP,-ProfileValueStackSize
STM_GPR r5,r15,0(J9SP)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
STMH_GPR r0,r15,44(J9SP)
])dnl
ifdef([J9_SOFT_FLOAT],[dnl
Expand Down Expand Up @@ -727,7 +727,7 @@ ZZ do nothing
LD f7,ProfileVFPSlot7(J9SP)
])dnl
LM_GPR r5,r15,0(J9SP)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
LMH_GPR r0,r15,44(J9SP)
])dnl
AHI_GPR J9SP,ProfileValueStackSize
Expand All @@ -739,7 +739,7 @@ ZZ ------------------------------------------
START_FUNC(_jitProfileStringValueWrap,_jitPSW)
AHI_GPR J9SP,-ProfileValueStackSize
STM_GPR r5,r15,0(J9SP)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
STMH_GPR r0,r15,44(J9SP)
])dnl
ifdef([J9_SOFT_FLOAT],[dnl
Expand Down Expand Up @@ -785,7 +785,7 @@ ZZ do nothing
LD f7,ProfileVFPSlot7(J9SP)
])dnl
LM_GPR r5,r15,0(J9SP)
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
LMH_GPR r0,r15,44(J9SP)
])dnl
AHI_GPR J9SP,ProfileValueStackSize
Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/z/runtime/s390_macros.inc
Expand Up @@ -473,7 +473,7 @@ ZZ ============================================================
define(SaveRegs,
[dnl
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
AHI_GPR r5,-(32*PTR_SIZE)
STM_GPR r0,r15,0(r5) # save all registers
STMH_GPR r0,r15,64(r5) # save all hi regs (16*4)
Expand All @@ -496,7 +496,7 @@ define(RestoreRegs,
[dnl
ST_GPR r5,(5*PTR_SIZE)(r5) # store the new J9SP
ifdef([ASM_J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
ifdef([J9VM_JIT_32BIT_USES64BIT_REGISTERS],[dnl
LMH_GPR r0,r15,64(r5) # restore all hi regs (16*4)
LM_GPR r0,r15,0(r5) # restore all registers
AHI_GPR r5,(32*PTR_SIZE)
Expand Down
4 changes: 4 additions & 0 deletions runtime/makelib/targets.mk.zos.inc.ftl
Expand Up @@ -92,6 +92,10 @@ ifdef j9vm_env_data64
UMA_M4_FLAGS += -DTR_64Bit -DTR_HOST_64BIT
endif

ifdef j9vm_jit_32bitUses64bitRegisters
UMA_M4_FLAGS += -DJ9VM_JIT_32BIT_USES64BIT_REGISTERS
endif

ifdef j9vm_jit_freeSystemStackPointer
UMA_M4_FLAGS += -DJ9VM_JIT_FREE_SYSTEM_STACK_POINTER
endif
Expand Down
4 changes: 4 additions & 0 deletions runtime/makelib/targets.mk.ztpf.inc.ftl
Expand Up @@ -177,6 +177,10 @@ UMA_EXE_POSTFIX_FLAGS += -Wl,--eh-frame-hdr
UMA_EXE_POSTFIX_FLAGS += -lgcc
UMA_EXE_POSTFIX_FLAGS += -lCTOE

ifdef j9vm_jit_32bitUses64bitRegisters
UMA_M4_FLAGS += -DJ9VM_JIT_32BIT_USES64BIT_REGISTERS
endif

ifdef UMA_TREAT_WARNINGS_AS_ERRORS
ifndef UMA_SUPPRESS_WARNINGS_AS_ERRORS
CFLAGS += -Wimplicit -Wreturn-type -Werror
Expand Down

0 comments on commit 077e525

Please sign in to comment.