RFR: JDK-8276046: codestrings.validate_vm gtest fails on ppc64, s390 [v2]
Thomas Stuefe
stuefe at openjdk.java.net
Wed Oct 27 13:18:08 UTC 2021
On Wed, 27 Oct 2021 12:38:40 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
> I'm ok with it, but I'd prefer less `ifndef`s. ZERO, PPC and S390 could be covered by one Iine. Or even better something like `#if defined(X86) || defined(ARM)`.
ZERO cannot be following the same logic since it is orthogonal to the CPU architecture. E.g. zero on x86 builds with `-DAMD64 -DZERO`, and `AMD64` causes `X86` to be defined:
https://github.com/openjdk/jdk/blob/168081efc8af1f5d1d7524246eb4a0675bd49ae0/src/hotspot/share/utilities/macros.hpp#L447-L455
so you need to exclude ZERO independently from handling CPU architectures.
ARM is only 32bit arm:
https://github.com/openjdk/jdk/blob/168081efc8af1f5d1d7524246eb4a0675bd49ae0/src/hotspot/share/utilities/macros.hpp#L529-L531
So it would have to be at least `#if defined(X86) || defined(ARM) || defined(AARCH64)`. And downstream porters of different platforms (mips, riscv, sparc) would then have to opt in and extend that construct with their own macros. Which nobody would do probably since you would need to know it exists. So I prefer to keep the negative here. Also makes more sense to have explicit exclusions, since there are concrete reasons for exclusions vs having concrete reasons for doing this test.
So, are we good with:
#ifndef PRODUCT
#ifndef ZERO
// Neither ppc nor s390 compilers use code strings.
#if !defined(PPC) && !defined(S390)
?
-------------
PR: https://git.openjdk.java.net/jdk/pull/6133
More information about the hotspot-compiler-dev
mailing list