Skip to content
Snippets Groups Projects
Commit afe15e97 authored by liuhongt's avatar liuhongt
Browse files

Fix target_clone ("arch=graniterapids-d") and target_clone ("arch=arrowlake-s")

Both "graniterapid-d" and "graniterapids" are attached with
PROCESSOR_GRANITERAPID in processor_alias_table but mapped to
different __cpu_subtype in get_intel_cpu.

And get_builtin_code_for_version will try to match the first
PROCESSOR_GRANITERAPIDS in processor_alias_table which maps to
"granitepraids" here.

861      else if (new_target->arch_specified && new_target->arch > 0)
1862        for (i = 0; i < pta_size; i++)
1863          if (processor_alias_table[i].processor == new_target->arch)
1864            {
1865              const pta *arch_info = &processor_alias_table[i];
1866              switch (arch_info->priority)
1867                {
1868                default:
1869                  arg_str = arch_info->name;

This mismatch makes dispatch_function_versions check the preidcate
of__builtin_cpu_is ("graniterapids") for "graniterapids-d" and causes
the issue.
The patch explicitly adds PROCESSOR_ARROWLAKE_S and
PROCESSOR_GRANITERAPIDS_D to make a distinction.

For "alderlake","raptorlake", "meteorlake" they share same isa, cost,
tuning, and mapped to the same __cpu_type/__cpu_subtype in
get_intel_cpu, so no need to add PROCESSOR_RAPTORLAKE and others.

gcc/ChangeLog:

	* common/config/i386/i386-common.cc (processor_names): Add new
	member graniterapids-s and arrowlake-s.
	* config/i386/i386-options.cc (processor_alias_table): Update
	table with PROCESSOR_ARROWLAKE_S and
	PROCESSOR_GRANITERAPIDS_D.
	(m_GRANITERAPID_D): New macro.
	(m_ARROWLAKE_S): Ditto.
	(m_CORE_AVX512): Add m_GRANITERAPIDS_D.
	(processor_cost_table): Add icelake_cost for
	PROCESSOR_GRANITERAPIDS_D and alderlake_cost for
	PROCESSOR_ARROWLAKE_S.
	* config/i386/x86-tune.def: Hanlde m_ARROWLAKE_S same as
	m_ARROWLAKE.
	* config/i386/i386.h (enum processor_type): Add new member
	PROCESSOR_GRANITERAPIDS_D and PROCESSOR_ARROWLAKE_S.
	* config/i386/i386-c.cc (ix86_target_macros_internal): Handle
	PROCESSOR_GRANITERAPIDS_D and PROCESSOR_ARROWLAKE_S
parent 0c2633dd
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment