diff --git a/src/hotspot/cpu/ppc/matcher_ppc.hpp b/src/hotspot/cpu/ppc/matcher_ppc.hpp index aaac79325c421..441339b94c61b 100644 --- a/src/hotspot/cpu/ppc/matcher_ppc.hpp +++ b/src/hotspot/cpu/ppc/matcher_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,10 +37,12 @@ return false; } - // PPC implementation uses VSX load/store instructions (if - // SuperwordUseVSX) which support 4 byte but not arbitrary alignment + // The PPC implementation uses VSX lxvd2x/stxvd2x instructions (if + // SuperwordUseVSX). They do not have alignment requirements. + // Some VSX storage access instructions cannot encode arbitrary displacements + // (e.g. lxv). None of them is currently used. static constexpr bool misaligned_vectors_ok() { - return false; + return true; } // Whether code generation need accurate ConvI2L types. diff --git a/src/hotspot/cpu/ppc/vm_version_ppc.cpp b/src/hotspot/cpu/ppc/vm_version_ppc.cpp index 6aada789c1daf..8ec69bffe15ea 100644 --- a/src/hotspot/cpu/ppc/vm_version_ppc.cpp +++ b/src/hotspot/cpu/ppc/vm_version_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2024 SAP SE. All rights reserved. + * Copyright (c) 2012, 2025 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -131,6 +131,9 @@ void VM_Version::initialize() { } } MaxVectorSize = SuperwordUseVSX ? 16 : 8; + if (FLAG_IS_DEFAULT(AlignVector)) { + FLAG_SET_ERGO(AlignVector, false); + } if (PowerArchitecturePPC64 >= 9) { if (FLAG_IS_DEFAULT(UseCountTrailingZerosInstructionsPPC64)) { diff --git a/test/hotspot/jtreg/compiler/c2/TestCastX2NotProcessedIGVN.java b/test/hotspot/jtreg/compiler/c2/TestCastX2NotProcessedIGVN.java index ca5a754f296ec..dab2585c50014 100644 --- a/test/hotspot/jtreg/compiler/c2/TestCastX2NotProcessedIGVN.java +++ b/test/hotspot/jtreg/compiler/c2/TestCastX2NotProcessedIGVN.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2024, Red Hat, Inc. All rights reserved. - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,7 +77,7 @@ public static void test1Runner() { @Test @IR(counts = {IRNode.LOAD_VECTOR_I, "> 1"}, applyIfOr = {"UseCompactObjectHeaders", "false", "AlignVector", "false"}, - applyIfPlatformOr = {"x64", "true", "aarch64", "true"}) + applyIfPlatformOr = {"x64", "true", "aarch64", "true", "ppc", "true"}) public static int test2(int stop, int[] array) { int v = 0; stop = Math.min(stop, Integer.MAX_VALUE / 4);