Open stintel opened 9 months ago
Hi @stintel,
I thought I had replied here long ago but it seems that either my comment got lost or I never pushed the Comment
button :thinking:
What's interesting about your machine's case is that neither -march
nor its sort-of alias -mcpu
is set, so there is not terribly much that resolve-march-native could do, other than maybe just forwarding those two -mlittle-endian -mabi=lp64
… but that output would in some sense be a lie. From a user's point of view, what would you wish for from resolve-march-native in such a case?
It appears that -march=native doesn't produce useful info, but using -march=native -mcpu=native does:
➜ gcc -fverbose-asm -march=native -mcpu=native -Q --help=target
The following options are target specific:
-mabi= lp64
-march= armv8-a+crc+lse+rcpc+rdma+dotprod+aes+sha3+fp16fml+sb+ssbs+i8mm+bf16+flagm+pauth
-mbig-endian [disabled]
-mbionic [disabled]
-mbranch-protection=
-mcmodel= small
-mcpu=
-mfix-cortex-a53-835769 [enabled]
-mfix-cortex-a53-843419 [enabled]
-mgeneral-regs-only [disabled]
-mglibc [enabled]
-mharden-sls=
-mlittle-endian [enabled]
-mlow-precision-div [disabled]
-mlow-precision-recip-sqrt [disabled]
-mlow-precision-sqrt [disabled]
-mmusl [disabled]
-momit-leaf-frame-pointer [enabled]
-moutline-atomics [enabled]
-moverride=<string>
-mpc-relative-literal-loads [enabled]
-msign-return-address= none
-mstack-protector-guard-offset=
-mstack-protector-guard-reg=
-mstack-protector-guard= global
-mstrict-align [disabled]
-msve-vector-bits=<number> scalable
-mtls-dialect= desc
-mtls-size= 24
-mtrack-speculation [disabled]
-mtune=
-muclibc [disabled]
-mverbose-cost-dump [disabled]
Known AArch64 ABIs (for use with the -mabi= option):
ilp32 lp64
Supported AArch64 return address signing scope (for use with -msign-return-address= option):
all non-leaf none
The code model option names for -mcmodel:
large small tiny
Valid arguments to -mstack-protector-guard=:
global sysreg
The possible SVE vector lengths:
1024 128 2048 256 512 scalable
The possible TLS dialects:
desc trad
So maybe as a fallback option, when -march=native does not produce anything useful, retry with -mcpu=native added?
@stintel interesting! Did you try -mcpu=native
in isolation also, i.e. gcc -fverbose-asm -mcpu=native -Q --help=target
?
I did. Sorry, should have added that in my previous comment:
➜ gcc -fverbose-asm -mcpu=native -Q --help=target
The following options are target specific:
-mabi= lp64
-march=
-mbig-endian [disabled]
-mbionic [disabled]
-mbranch-protection=
-mcmodel= small
-mcpu=
-mfix-cortex-a53-835769 [enabled]
-mfix-cortex-a53-843419 [enabled]
-mgeneral-regs-only [disabled]
-mglibc [enabled]
-mharden-sls=
-mlittle-endian [enabled]
-mlow-precision-div [disabled]
-mlow-precision-recip-sqrt [disabled]
-mlow-precision-sqrt [disabled]
-mmusl [disabled]
-momit-leaf-frame-pointer [enabled]
-moutline-atomics [enabled]
-moverride=<string>
-mpc-relative-literal-loads [enabled]
-msign-return-address= none
-mstack-protector-guard-offset=
-mstack-protector-guard-reg=
-mstack-protector-guard= global
-mstrict-align [disabled]
-msve-vector-bits=<number> scalable
-mtls-dialect= desc
-mtls-size= 24
-mtrack-speculation [disabled]
-mtune=
-muclibc [disabled]
-mverbose-cost-dump [disabled]
Known AArch64 ABIs (for use with the -mabi= option):
ilp32 lp64
Supported AArch64 return address signing scope (for use with -msign-return-address= option):
all non-leaf none
The code model option names for -mcmodel:
large small tiny
Valid arguments to -mstack-protector-guard=:
global sysreg
The possible SVE vector lengths:
1024 128 2048 256 512 scalable
The possible TLS dialects:
desc trad
@stintel so it does need both combined, fancy. Thanks! Let me think more about a fix, I'm tending to try both combined first rather than last at the moment…
As requested downstream in https://bugs.gentoo.org/show_bug.cgi?id=924184:
I decided "-march=armv8-a" based on the output of the first gcc command, if that's not what you wanted, please let me know and I'll update the post.