-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Don't use "generic" as the target cpu #20777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
To add some slightly more interesting numbers, these are for generic:
x86-64
|
Using "generic" disables a number of features that are present on all x86_64 cpus, the "x86-64" target cpu is the common denominator for that arch. Refs rust-lang#20777
Using "generic" disables a number of features that are present on all x86_64 cpus, the "x86-64" target cpu is the common denominator for that arch. Refs #20777
@dotdash Did your PR not resolve this? |
It probably did for x84_64, but I'm not sure about x86 (I guess "generic"
|
Using `generic` as the target cpu limits the generated code to the bare basics for the arch, while we can probably assume that we'll actually be running on somewhat modern hardware. This updates the default target CPUs for the x86 and x86_64 archs to match clang's behaviour. Refs #20777
The initial purpose is to workaround the LLVM bug https://llvm.org/bugs/show_bug.cgi?id=26554 for OpenBSD. By default, the `cpu' is defined to `generic`. But with a 64bit processor, the optimization for `generic` will use invalid asm code as NOP (the generated code for NOP isn't a NOP). According to rust-lang#20777, "x86-64" is the right thing to do for x86_64 builds. Closes: rust-lang#31363
The initial purpose is to workaround the LLVM bug https://llvm.org/bugs/show_bug.cgi?id=26554 for OpenBSD. By default, the `cpu` is defined to `generic`. But with a 64bit processor, the optimization for `generic` will use invalid asm code as NOP (the generated code for NOP isn't a NOP). According to #20777, "x86-64" is the right thing to do for x86_64 builds. Closes: #31363 r? @alexcrichton
Using "generic" disables a number of features that are present on all x86_64 cpus, the "x86-64" target cpu is the common denominator for that arch. Refs rust-lang#20777
…excrichton Use "x86-64" as the target CPU for NetBSD and Bitrig on amd64. Using "generic" disables a number of features that are present on all x86_64 cpus, the "x86-64" target cpu is the common denominator for that arch. Refs rust-lang#20777
By default, we use the "generic" target CPU, unfortunately on x86_64, this disables various features because "generic" is more like "generic x86". This disable things like some SSE usage and multibyte nops. On x86_64 we should use
x86-64
as the minimum target cpu, not sure about other archs.To present some arbitrary numbers:
cc @cmr
The text was updated successfully, but these errors were encountered: