* [Bug rtl-optimization/113019] [NOT A BUG] Multi-architecture binaries for Linux
2023-12-14 11:47 [Bug rtl-optimization/113019] New: [NOT A BUG] Multi-architecture binaries for Linux aros at gmx dot com
@ 2023-12-14 12:23 ` ktkachov at gcc dot gnu.org
2023-12-14 12:39 ` arsen at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2023-12-14 12:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113019
ktkachov at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ktkachov at gcc dot gnu.org
--- Comment #1 from ktkachov at gcc dot gnu.org ---
GCC provides the Function Multiversioning feature that's supported on some
architectures:
https://gcc.gnu.org/onlinedocs/gcc/Function-Multiversioning.html
That seems to do what you want?
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/113019] [NOT A BUG] Multi-architecture binaries for Linux
2023-12-14 11:47 [Bug rtl-optimization/113019] New: [NOT A BUG] Multi-architecture binaries for Linux aros at gmx dot com
2023-12-14 12:23 ` [Bug rtl-optimization/113019] " ktkachov at gcc dot gnu.org
@ 2023-12-14 12:39 ` arsen at gcc dot gnu.org
2023-12-14 14:34 ` ultrafine at gmx dot com
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: arsen at gcc dot gnu.org @ 2023-12-14 12:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113019
Arsen Arsenović <arsen at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |arsen at gcc dot gnu.org
--- Comment #2 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
GNU targets, and many non-GNU targets, support ifuncs. you can use those to
resolve to an optimized implementation of a function.
if you mean to have gcc compile to a few -march/-mtune configurations and
generate these ifuncs 'implicitly', I suppose that could be done, and then
this'd be an RFE
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/113019] [NOT A BUG] Multi-architecture binaries for Linux
2023-12-14 11:47 [Bug rtl-optimization/113019] New: [NOT A BUG] Multi-architecture binaries for Linux aros at gmx dot com
2023-12-14 12:23 ` [Bug rtl-optimization/113019] " ktkachov at gcc dot gnu.org
2023-12-14 12:39 ` arsen at gcc dot gnu.org
@ 2023-12-14 14:34 ` ultrafine at gmx dot com
2023-12-14 14:34 ` ultrafine at gmx dot com
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: ultrafine at gmx dot com @ 2023-12-14 14:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113019
--- Comment #3 from ultrafine at gmx dot com ---
Yeah, I'm looking forward to being able to compile this way:
-march=x86-64 -mextra-arch=x86-64-v3
And do _nothing_ else and get a single binary. And then at runtime the
appropriate code for the detected uArch gets executed.
--- Comment #4 from ultrafine at gmx dot com ---
To make it simple Linux distros seemingly want to be able to compile a single
binary (application or shared library) which has two distinct code paths for
different flavours of the x86-64 arch to extract maximum performance from it
regardless of the CPU it's being executed on.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/113019] [NOT A BUG] Multi-architecture binaries for Linux
2023-12-14 11:47 [Bug rtl-optimization/113019] New: [NOT A BUG] Multi-architecture binaries for Linux aros at gmx dot com
` (2 preceding siblings ...)
2023-12-14 14:34 ` ultrafine at gmx dot com
@ 2023-12-14 14:34 ` ultrafine at gmx dot com
2023-12-14 14:53 ` aros at gmx dot com
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: ultrafine at gmx dot com @ 2023-12-14 14:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113019
--- Comment #3 from ultrafine at gmx dot com ---
Yeah, I'm looking forward to being able to compile this way:
-march=x86-64 -mextra-arch=x86-64-v3
And do _nothing_ else and get a single binary. And then at runtime the
appropriate code for the detected uArch gets executed.
--- Comment #4 from ultrafine at gmx dot com ---
To make it simple Linux distros seemingly want to be able to compile a single
binary (application or shared library) which has two distinct code paths for
different flavours of the x86-64 arch to extract maximum performance from it
regardless of the CPU it's being executed on.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/113019] [NOT A BUG] Multi-architecture binaries for Linux
2023-12-14 11:47 [Bug rtl-optimization/113019] New: [NOT A BUG] Multi-architecture binaries for Linux aros at gmx dot com
` (3 preceding siblings ...)
2023-12-14 14:34 ` ultrafine at gmx dot com
@ 2023-12-14 14:53 ` aros at gmx dot com
2023-12-14 16:44 ` [Bug target/113019] " pinskia at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: aros at gmx dot com @ 2023-12-14 14:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113019
--- Comment #5 from Artem S. Tashkinov <aros at gmx dot com> ---
(In reply to ktkachov from comment #1)
> GCC provides the Function Multiversioning feature that's supported on some
> architectures:
> https://gcc.gnu.org/onlinedocs/gcc/Function-Multiversioning.html
>
> That seems to do what you want?
This can only be achieved manually by rewriting everything, while I was
thinking about something compiler-side which you can enabled as a compile
option.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/113019] [NOT A BUG] Multi-architecture binaries for Linux
2023-12-14 11:47 [Bug rtl-optimization/113019] New: [NOT A BUG] Multi-architecture binaries for Linux aros at gmx dot com
` (4 preceding siblings ...)
2023-12-14 14:53 ` aros at gmx dot com
@ 2023-12-14 16:44 ` pinskia at gcc dot gnu.org
2023-12-14 16:48 ` pinskia at gcc dot gnu.org
2023-12-17 21:32 ` egallager at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-14 16:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113019
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|rtl-optimization |target
Severity|normal |enhancement
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/113019] [NOT A BUG] Multi-architecture binaries for Linux
2023-12-14 11:47 [Bug rtl-optimization/113019] New: [NOT A BUG] Multi-architecture binaries for Linux aros at gmx dot com
` (5 preceding siblings ...)
2023-12-14 16:44 ` [Bug target/113019] " pinskia at gcc dot gnu.org
@ 2023-12-14 16:48 ` pinskia at gcc dot gnu.org
2023-12-17 21:32 ` egallager at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-14 16:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113019
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|UNCONFIRMED |RESOLVED
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 78464.
*** This bug has been marked as a duplicate of bug 78464 ***
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/113019] [NOT A BUG] Multi-architecture binaries for Linux
2023-12-14 11:47 [Bug rtl-optimization/113019] New: [NOT A BUG] Multi-architecture binaries for Linux aros at gmx dot com
` (6 preceding siblings ...)
2023-12-14 16:48 ` pinskia at gcc dot gnu.org
@ 2023-12-17 21:32 ` egallager at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: egallager at gcc dot gnu.org @ 2023-12-17 21:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113019
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |egallager at gcc dot gnu.org
--- Comment #7 from Eric Gallager <egallager at gcc dot gnu.org> ---
Perhaps you're looking for something like cosmocc?
https://github.com/jart/cosmopolitan/blob/master/tool/cosmocc/bin/cosmocc
...or perhaps a port of driverdriver.c and lipo from the old Apple GCC to
Linux?
https://opensource.apple.com/source/gcc_42/gcc_42-5566/driverdriver.c.auto.html
^ permalink raw reply [flat|nested] 9+ messages in thread