POWER: pass assembler CPU flags for more cores with clang on FreeBSD - #6018
Open
pkubaj wants to merge 1 commit into
Open
POWER: pass assembler CPU flags for more cores with clang on FreeBSD#6018pkubaj wants to merge 1 commit into
pkubaj wants to merge 1 commit into
Conversation
clang with -fno-integrated-as does not translate -mcpu into CPU selection flags for the external assembler the way GCC's ASM_CPU_SPEC does, so GNU as runs with bare defaults and rejects AltiVec/VSX mnemonics, both in the hand-written kernels and in clang's own vectorized output. This is already handled for POWER9/POWER10 via -Wa,-mpwr10; do the equivalent for the remaining 64-bit cores: POWER8: -Wa,-mpwr8 POWER6: -Wa,-mpwr6 -Wa,-maltivec PPC970: -Wa,-mpwr4 -Wa,-maltivec The POWER6/PPC970 spellings match what GCC passes to the assembler for -mcpu=power6 and -mcpu=970. Note a lone -Wa,-maltivec is not enough: an explicit -m option replaces the assembler's implicit 64-bit default, making it reject even lwa/mulld. Tested on FreeBSD/powerpc64 (big-endian) with clang 19.1.7: TARGET=PPC970 and TARGET=POWER8 both build and pass the BLAS test suite.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
clang with -fno-integrated-as does not translate -mcpu into CPU
selection flags for the external assembler the way GCC's ASM_CPU_SPEC
does, so GNU as runs with bare defaults and rejects AltiVec/VSX
mnemonics, both in the hand-written kernels and in clang's own
vectorized output. This is already handled for POWER9/POWER10 via
-Wa,-mpwr10; do the equivalent for the remaining 64-bit cores:
POWER8: -Wa,-mpwr8
POWER6: -Wa,-mpwr6 -Wa,-maltivec
PPC970: -Wa,-mpwr4 -Wa,-maltivec
The POWER6/PPC970 spellings match what GCC passes to the assembler
for -mcpu=power6 and -mcpu=970. Note a lone -Wa,-maltivec is not
enough: an explicit -m option replaces the assembler's implicit
64-bit default, making it reject even lwa/mulld.
Tested on FreeBSD/powerpc64 (big-endian) with clang 19.1.7:
TARGET=PPC970 and TARGET=POWER8 both build and pass the BLAS test
suite.