public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/95259] New: Duplicated codes in libgcc, driver-i386.c and i386-builtins.c
@ 2020-05-21 12:55 hjl.tools at gmail dot com
2020-05-21 13:25 ` [Bug target/95259] " hjl.tools at gmail dot com
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2020-05-21 12:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95259
Bug ID: 95259
Summary: Duplicated codes in libgcc, driver-i386.c and
i386-builtins.c
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
CC: ubizjak at gmail dot com
Depends on: 95258, 91695, 95212, 95220
Target Milestone: ---
Target: i386, x86-64
There are duplicated codes in libgcc, driver-i386.c and i386-builtins.c.
It is very hard to keep them in sync and up to date. libgcc doesn't enable
any AVX512 ISAs if AVX512 isn't usable. But driver-i386.c only does it for
some AVX512 ISAs. libgcc only supports a subset of ISAs.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91695
[Bug 91695] [X86] get_available_features only sets FEATURE_GFNI and
FEATURE_VPCLMULQDQ when avx512_usable is true
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95212
[Bug 95212] enum processor_features is out of sync
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95220
[Bug 95220] Incorrect GFNI dectection
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95258
[Bug 95258] -march=native doesn't handle -mavx512vpopcntdq
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/95259] Duplicated codes in libgcc, driver-i386.c and i386-builtins.c
2020-05-21 12:55 [Bug target/95259] New: Duplicated codes in libgcc, driver-i386.c and i386-builtins.c hjl.tools at gmail dot com
@ 2020-05-21 13:25 ` hjl.tools at gmail dot com
2020-05-21 13:25 ` hjl.tools at gmail dot com
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2020-05-21 13:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95259
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |hjl.tools at gmail dot com
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 48576
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48576&action=edit
A patch
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/95259] Duplicated codes in libgcc, driver-i386.c and i386-builtins.c
2020-05-21 12:55 [Bug target/95259] New: Duplicated codes in libgcc, driver-i386.c and i386-builtins.c hjl.tools at gmail dot com
2020-05-21 13:25 ` [Bug target/95259] " hjl.tools at gmail dot com
@ 2020-05-21 13:25 ` hjl.tools at gmail dot com
2020-05-21 14:54 ` hjl.tools at gmail dot com
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2020-05-21 13:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95259
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Target Milestone|--- |11.0
Last reconfirmed| |2020-05-21
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/95259] Duplicated codes in libgcc, driver-i386.c and i386-builtins.c
2020-05-21 12:55 [Bug target/95259] New: Duplicated codes in libgcc, driver-i386.c and i386-builtins.c hjl.tools at gmail dot com
2020-05-21 13:25 ` [Bug target/95259] " hjl.tools at gmail dot com
2020-05-21 13:25 ` hjl.tools at gmail dot com
@ 2020-05-21 14:54 ` hjl.tools at gmail dot com
2020-05-24 11:36 ` hjl.tools at gmail dot com
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2020-05-21 14:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95259
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #48576|0 |1
is obsolete| |
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 48577
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48577&action=edit
An updated patch
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/95259] Duplicated codes in libgcc, driver-i386.c and i386-builtins.c
2020-05-21 12:55 [Bug target/95259] New: Duplicated codes in libgcc, driver-i386.c and i386-builtins.c hjl.tools at gmail dot com
` (2 preceding siblings ...)
2020-05-21 14:54 ` hjl.tools at gmail dot com
@ 2020-05-24 11:36 ` hjl.tools at gmail dot com
2020-05-28 20:41 ` hjl.tools at gmail dot com
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2020-05-24 11:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95259
Bug 95259 depends on bug 95258, which changed state.
Bug 95258 Summary: -march=native doesn't handle -mavx512vpopcntdq
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95258
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/95259] Duplicated codes in libgcc, driver-i386.c and i386-builtins.c
2020-05-21 12:55 [Bug target/95259] New: Duplicated codes in libgcc, driver-i386.c and i386-builtins.c hjl.tools at gmail dot com
` (3 preceding siblings ...)
2020-05-24 11:36 ` hjl.tools at gmail dot com
@ 2020-05-28 20:41 ` hjl.tools at gmail dot com
2020-06-24 12:50 ` cvs-commit at gcc dot gnu.org
2020-06-24 13:17 ` hjl.tools at gmail dot com
6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2020-05-28 20:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95259
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
URL| |https://gcc.gnu.org/piperma
| |il/gcc-patches/2020-May/546
| |522.html
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
The current patch is at
https://gcc.gnu.org/pipermail/gcc-patches/2020-May/546522.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/95259] Duplicated codes in libgcc, driver-i386.c and i386-builtins.c
2020-05-21 12:55 [Bug target/95259] New: Duplicated codes in libgcc, driver-i386.c and i386-builtins.c hjl.tools at gmail dot com
` (4 preceding siblings ...)
2020-05-28 20:41 ` hjl.tools at gmail dot com
@ 2020-06-24 12:50 ` cvs-commit at gcc dot gnu.org
2020-06-24 13:17 ` hjl.tools at gmail dot com
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-24 12:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95259
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:
https://gcc.gnu.org/g:1890f2f0e210ef515c39728c54151372d36dd187
commit r11-1627-g1890f2f0e210ef515c39728c54151372d36dd187
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Mon May 18 05:58:41 2020 -0700
x86: Move cpuinfo.h from libgcc to common/config/i386
Both x86 backend and libgcc define enum processor_features. libgcc sets
enum processor_feature and x86 backend checks enum processor_feature.
They are very easy out of sync and it has happened multiple times in the
past.
1. Move cpuinfo.h from libgcc to common/config/i386 so that we can share
the same enum processor_features in x86 backend and libgcc.
2. Change __cpu_features2 to an array to support more processor features.
3. Add more processor features to enum processor_features.
gcc/
PR target/95259
* common/config/i386/cpuinfo.h: New file.
(__processor_model): Moved from libgcc/config/i386/cpuinfo.h.
(__processor_model2): New.
(CHECK___builtin_cpu_is): New. Defined as empty if not defined.
(has_cpu_feature): New function.
(set_cpu_feature): Likewise.
(get_amd_cpu): Moved from libgcc/config/i386/cpuinfo.c. Use
CHECK___builtin_cpu_is. Return AMD CPU name.
(get_intel_cpu): Moved from libgcc/config/i386/cpuinfo.c. Use
Use CHECK___builtin_cpu_is. Return Intel CPU name.
(get_available_features): Moved from libgcc/config/i386/cpuinfo.c.
Also check FEATURE_3DNOW, FEATURE_3DNOWP, FEATURE_ADX,
FEATURE_ABM, FEATURE_CLDEMOTE, FEATURE_CLFLUSHOPT, FEATURE_CLWB,
FEATURE_CLZERO, FEATURE_CMPXCHG16B, FEATURE_CMPXCHG8B,
FEATURE_ENQCMD, FEATURE_F16C, FEATURE_FSGSBASE, FEATURE_FXSAVE,
FEATURE_HLE, FEATURE_IBT, FEATURE_LAHF_LM, FEATURE_LM,
FEATURE_LWP, FEATURE_LZCNT, FEATURE_MOVBE, FEATURE_MOVDIR64B,
FEATURE_MOVDIRI, FEATURE_MWAITX, FEATURE_OSXSAVE,
FEATURE_PCONFIG, FEATURE_PKU, FEATURE_PREFETCHWT1, FEATURE_PRFCHW,
FEATURE_PTWRITE, FEATURE_RDPID, FEATURE_RDRND, FEATURE_RDSEED,
FEATURE_RTM, FEATURE_SERIALIZE, FEATURE_SGX, FEATURE_SHA,
FEATURE_SHSTK, FEATURE_TBM, FEATURE_TSXLDTRK, FEATURE_VAES,
FEATURE_WAITPKG, FEATURE_WBNOINVD, FEATURE_XSAVE, FEATURE_XSAVEC,
FEATURE_XSAVEOPT and FEATURE_XSAVES
(cpu_indicator_init): Moved from libgcc/config/i386/cpuinfo.c.
Also update cpu_model2.
* common/config/i386/i386-cpuinfo.h (processor_vendor): Add
Add VENDOR_CENTAUR, VENDOR_CYRIX and VENDOR_NSC.
(processor_features): Moved from gcc/config/i386/i386-builtins.c.
Renamed F_XXX to FEATURE_XXX. Add FEATURE_3DNOW, FEATURE_3DNOWP,
FEATURE_ADX, FEATURE_ABM, FEATURE_CLDEMOTE, FEATURE_CLFLUSHOPT,
FEATURE_CLWB, FEATURE_CLZERO, FEATURE_CMPXCHG16B,
FEATURE_CMPXCHG8B, FEATURE_ENQCMD, FEATURE_F16C,
FEATURE_FSGSBASE, FEATURE_FXSAVE, FEATURE_HLE, FEATURE_IBT,
FEATURE_LAHF_LM, FEATURE_LM, FEATURE_LWP, FEATURE_LZCNT,
FEATURE_MOVBE, FEATURE_MOVDIR64B, FEATURE_MOVDIRI,
FEATURE_MWAITX, FEATURE_OSXSAVE, FEATURE_PCONFIG,
FEATURE_PKU, FEATURE_PREFETCHWT1, FEATURE_PRFCHW,
FEATURE_PTWRITE, FEATURE_RDPID, FEATURE_RDRND, FEATURE_RDSEED,
FEATURE_RTM, FEATURE_SERIALIZE, FEATURE_SGX, FEATURE_SHA,
FEATURE_SHSTK, FEATURE_TBM, FEATURE_TSXLDTRK, FEATURE_VAES,
FEATURE_WAITPKG, FEATURE_WBNOINVD, FEATURE_XSAVE, FEATURE_XSAVEC,
FEATURE_XSAVEOPT, FEATURE_XSAVES and CPU_FEATURE_MAX.
(SIZE_OF_CPU_FEATURES): New.
* config/i386/i386-builtins.c (processor_features): Removed.
(isa_names_table): Replace F_XXX with FEATURE_XXX.
(fold_builtin_cpu): Change __cpu_features2 to an array.
libgcc/
PR target/95259
* config/i386/cpuinfo.c: Don't include "cpuinfo.h". Include
"common/config/i386/i386-cpuinfo.h" and
"common/config/i386/cpuinfo.h".
(__cpu_features2): Changed to array.
(get_amd_cpu): Removed.
(get_intel_cpu): Likewise.
(get_available_features): Likewise.
(__cpu_indicator_init): Call cpu_indicator_init.
* config/i386/cpuinfo.h: Removed.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/95259] Duplicated codes in libgcc, driver-i386.c and i386-builtins.c
2020-05-21 12:55 [Bug target/95259] New: Duplicated codes in libgcc, driver-i386.c and i386-builtins.c hjl.tools at gmail dot com
` (5 preceding siblings ...)
2020-06-24 12:50 ` cvs-commit at gcc dot gnu.org
@ 2020-06-24 13:17 ` hjl.tools at gmail dot com
6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2020-06-24 13:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95259
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed for GCC 11.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-06-24 13:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21 12:55 [Bug target/95259] New: Duplicated codes in libgcc, driver-i386.c and i386-builtins.c hjl.tools at gmail dot com
2020-05-21 13:25 ` [Bug target/95259] " hjl.tools at gmail dot com
2020-05-21 13:25 ` hjl.tools at gmail dot com
2020-05-21 14:54 ` hjl.tools at gmail dot com
2020-05-24 11:36 ` hjl.tools at gmail dot com
2020-05-28 20:41 ` hjl.tools at gmail dot com
2020-06-24 12:50 ` cvs-commit at gcc dot gnu.org
2020-06-24 13:17 ` hjl.tools at gmail dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).