public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/95843] New: Duplicated ISA info in driver-i386.c and i386-builtins.c
@ 2020-06-23 14:52 hjl.tools at gmail dot com
2020-06-24 6:10 ` [Bug target/95843] " rguenth at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: hjl.tools at gmail dot com @ 2020-06-23 14:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95843
Bug ID: 95843
Summary: Duplicated ISA info in 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: hubicka at gcc dot gnu.org, ubizjak at gmail dot com
Target Milestone: ---
Target: i386,x86-64
i386-builtins.c has _isa_names_table to map command-line option to ISA
feature. driver-i386.c has many conditional statements to map ISA to
command-line option. _isa_names_table doesn't cover all ISA features
GCC supports. _isa_names_table should be enhanced to support both
i386-builtins.c and driver-i386.c.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/95843] Duplicated ISA info in driver-i386.c and i386-builtins.c
2020-06-23 14:52 [Bug target/95843] New: Duplicated ISA info in driver-i386.c and i386-builtins.c hjl.tools at gmail dot com
@ 2020-06-24 6:10 ` rguenth at gcc dot gnu.org
2020-06-24 14:58 ` cvs-commit at gcc dot gnu.org
2020-06-24 15:02 ` hjl.tools at gmail dot com
2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-06-24 6:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95843
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2020-06-24
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/95843] Duplicated ISA info in driver-i386.c and i386-builtins.c
2020-06-23 14:52 [Bug target/95843] New: Duplicated ISA info in driver-i386.c and i386-builtins.c hjl.tools at gmail dot com
2020-06-24 6:10 ` [Bug target/95843] " rguenth at gcc dot gnu.org
@ 2020-06-24 14:58 ` cvs-commit at gcc dot gnu.org
2020-06-24 15:02 ` hjl.tools at gmail dot com
2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-24 14:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95843
--- Comment #1 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:6c35d16a3925958b3a22426de0cb8e04f654b6dd
commit r11-1629-g6c35d16a3925958b3a22426de0cb8e04f654b6dd
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Jun 24 04:39:16 2020 -0700
x86: Share _isa_names_table and use cpuinfo.h
Both driver-i386.c and libgcc use CPUID to detect the processor name
as well as available ISAs. To detect the same processor or ISAs, the
same detection logic is duplicated in 2 places. Sometimes only one place
was up to date or got it right. Sometimes both places got it wrong.
1. Add common/config/i386/i386-isas.h to define _isa_names_table.
2. Use isa_names_table to auto-generate ISA command-line options.
3. Use isa_names_table to auto-generate __builtin_cpu_supports tests.
4. Use common/config/i386/cpuinfo.h to check available ISAs and detect
newer Intel processors in driver-i386.c and builtin_target.c.
5. Detection of AMD processors and older processors in driver-i386.c is
unchanged.
gcc/
PR target/95843
* common/config/i386/i386-isas.h: New file. Extracted from
gcc/config/i386/i386-builtins.c.
(_isa_names_table): Add option.
(ISA_NAMES_TABLE_START): New.
(ISA_NAMES_TABLE_END): Likewise.
(ISA_NAMES_TABLE_ENTRY): Likewise.
(isa_names_table): Defined with ISA_NAMES_TABLE_START,
ISA_NAMES_TABLE_END and ISA_NAMES_TABLE_ENTRY. Add more ISAs
from enum processor_features.
* config/i386/driver-i386.c: Include
"common/config/i386/cpuinfo.h" and
"common/config/i386/i386-isas.h".
(has_feature): New macro.
(host_detect_local_cpu): Call cpu_indicator_init to get CPU
features. Use has_feature to detect processor features. Call
Call get_intel_cpu to get the newer Intel CPU name. Use
isa_names_table to generate command-line options.
* config/i386/i386-builtins.c: Include
"common/config/i386/i386-isas.h".
(_arch_names_table): Removed.
(isa_names_table): Likewise.
gcc/testsuite/
PR target/95843
* gcc.target/i386/builtin_target.c: Include <stdlib.h>,
../../../common/config/i386/i386-cpuinfo.h and
../../../common/config/i386/cpuinfo.h.
(check_amd_cpu_model): Removed.
(check_intel_cpu_model): Likewise,
(CHECK___builtin_cpu_is): New.
(gcc_assert): New. Defined as assert.
(gcc_unreachable): New. Defined as abort.
(inline): New. Defined as empty.
(ISA_NAMES_TABLE_START): Likewise.
(ISA_NAMES_TABLE_END): Likewise.
(ISA_NAMES_TABLE_ENTRY): New.
(check_features): Include
"../../../common/config/i386/i386-isas.h".
(check_detailed): Call cpu_indicator_init. Always call
check_features. Call get_amd_cpu instead of check_amd_cpu_model.
Call get_intel_cpu instead of check_intel_cpu_model.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/95843] Duplicated ISA info in driver-i386.c and i386-builtins.c
2020-06-23 14:52 [Bug target/95843] New: Duplicated ISA info in driver-i386.c and i386-builtins.c hjl.tools at gmail dot com
2020-06-24 6:10 ` [Bug target/95843] " rguenth at gcc dot gnu.org
2020-06-24 14:58 ` cvs-commit at gcc dot gnu.org
@ 2020-06-24 15:02 ` hjl.tools at gmail dot com
2 siblings, 0 replies; 4+ messages in thread
From: hjl.tools at gmail dot com @ 2020-06-24 15:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95843
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
Target Milestone|--- |11.0
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed for GCC 11.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-06-24 15:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-23 14:52 [Bug target/95843] New: Duplicated ISA info in driver-i386.c and i386-builtins.c hjl.tools at gmail dot com
2020-06-24 6:10 ` [Bug target/95843] " rguenth at gcc dot gnu.org
2020-06-24 14:58 ` cvs-commit at gcc dot gnu.org
2020-06-24 15:02 ` 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).