aboutsummaryrefslogtreecommitdiff
path: root/gcc/common
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-09-13 10:37:49 -0700
committerIan Lance Taylor <iant@golang.org>2021-09-13 10:37:49 -0700
commite252b51ccde010cbd2a146485d8045103cd99533 (patch)
treee060f101cdc32bf5e520de8e5275db9d4236b74c /gcc/common
parentf10c7c4596dda99d2ee872c995ae4aeda65adbdf (diff)
parent104c05c5284b7822d770ee51a7d91946c7e56d50 (diff)
downloadgcc-e252b51ccde010cbd2a146485d8045103cd99533.zip
gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.gz
gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.bz2
Merge from trunk revision 104c05c5284b7822d770ee51a7d91946c7e56d50.
Diffstat (limited to 'gcc/common')
-rw-r--r--gcc/common/common-target.def32
-rw-r--r--gcc/common/config/aarch64/aarch64-common.c2
-rw-r--r--gcc/common/config/arc/arc-common.c7
-rw-r--r--gcc/common/config/arm/arm-common.c47
-rw-r--r--gcc/common/config/bfin/bfin-common.c2
-rw-r--r--gcc/common/config/gcn/gcn-common.c2
-rw-r--r--gcc/common/config/i386/cpuinfo.h61
-rw-r--r--gcc/common/config/i386/i386-common.c74
-rw-r--r--gcc/common/config/i386/i386-cpuinfo.h10
-rw-r--r--gcc/common/config/i386/i386-isas.h6
-rw-r--r--gcc/common/config/riscv/riscv-common.c77
11 files changed, 248 insertions, 72 deletions
diff --git a/gcc/common/common-target.def b/gcc/common/common-target.def
index 1e10d4f..f54590a 100644
--- a/gcc/common/common-target.def
+++ b/gcc/common/common-target.def
@@ -64,23 +64,23 @@ DEFHOOK
DEFHOOK
(supports_split_stack,
- "Whether this target supports splitting the stack when the options\
- described in @var{opts} have been passed. This is called\
- after options have been parsed, so the target may reject splitting\
- the stack in some configurations. The default version of this hook\
- returns false. If @var{report} is true, this function may issue a warning\
- or error; if @var{report} is false, it must simply return a value",
+ "Whether this target supports splitting the stack when the options\n\
+described in @var{opts} have been passed. This is called\n\
+after options have been parsed, so the target may reject splitting\n\
+the stack in some configurations. The default version of this hook\n\
+returns false. If @var{report} is true, this function may issue a warning\n\
+or error; if @var{report} is false, it must simply return a value",
bool, (bool report, struct gcc_options *opts),
hook_bool_bool_gcc_optionsp_false)
DEFHOOK
(get_valid_option_values,
-"The hook is used for options that have a non-trivial list of\
- possible option values. OPTION_CODE is option code of opt_code\
- enum type. PREFIX is used for bash completion and allows an implementation\
- to return more specific completion based on the prefix. All string values\
- should be allocated from heap memory and consumers should release them. \
- The result will be pruned to cases with PREFIX if not NULL.",
+"The hook is used for options that have a non-trivial list of\n\
+possible option values. OPTION_CODE is option code of opt_code\n\
+enum type. PREFIX is used for bash completion and allows an implementation\n\
+to return more specific completion based on the prefix. All string values\n\
+should be allocated from heap memory and consumers should release them.\n\
+The result will be pruned to cases with PREFIX if not NULL.",
vec<const char *>, (int option_code, const char *prefix),
default_get_valid_option_values)
@@ -100,10 +100,10 @@ DEFHOOKPOD
DEFHOOKPOD
(always_strip_dotdot,
- "True if @file{..} components should always be removed from directory names\
- computed relative to GCC's internal directories, false (default) if such\
- components should be preserved and directory names containing them passed\
- to other tools such as the linker.",
+ "True if @file{..} components should always be removed from directory names\n\
+computed relative to GCC's internal directories, false (default) if such\n\
+components should be preserved and directory names containing them passed\n\
+to other tools such as the linker.",
bool, false)
HOOK_VECTOR_END (C90_EMPTY_HACK)
diff --git a/gcc/common/config/aarch64/aarch64-common.c b/gcc/common/config/aarch64/aarch64-common.c
index 6763191..6d200a1 100644
--- a/gcc/common/config/aarch64/aarch64-common.c
+++ b/gcc/common/config/aarch64/aarch64-common.c
@@ -219,7 +219,7 @@ aarch64_parse_extension (const char *str, uint64_t *isa_flags,
else
len = strlen (str);
- if (len >= 2 && strncmp (str, "no", 2) == 0)
+ if (len >= 2 && startswith (str, "no"))
{
adding_ext = 0;
len -= 2;
diff --git a/gcc/common/config/arc/arc-common.c b/gcc/common/config/arc/arc-common.c
index d5229ae..3b36d09 100644
--- a/gcc/common/config/arc/arc-common.c
+++ b/gcc/common/config/arc/arc-common.c
@@ -30,10 +30,8 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
static void
-arc_option_init_struct (struct gcc_options *opts)
+arc_option_init_struct (struct gcc_options *opts ATTRIBUTE_UNUSED)
{
- opts->x_flag_no_common = 255; /* Mark as not user-initialized. */
-
/* Which cpu we're compiling for (ARC600, ARC601, ARC700, ARCv2). */
arc_cpu = PROCESSOR_NONE;
}
@@ -62,7 +60,6 @@ static const struct default_options arc_option_optimization_table[] =
{ OPT_LEVELS_SIZE, OPT_fif_conversion, NULL, 0 },
{ OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
{ OPT_LEVELS_3_PLUS_SPEED_ONLY, OPT_msize_level_, NULL, 0 },
- { OPT_LEVELS_3_PLUS_SPEED_ONLY, OPT_malign_call, NULL, 1 },
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};
@@ -84,7 +81,7 @@ arc_handle_option (struct gcc_options *opts,
our caller, so comparing arc_cpu with PROCESSOR_NONE is pointless. */
if (mcpu_seen != PROCESSOR_NONE && mcpu_seen != value)
- warning_at (loc, 0, "multiple %<-mcpu=%> options specified.");
+ warning_at (loc, 0, "multiple %<-mcpu=%> options specified");
mcpu_seen = value;
break;
diff --git a/gcc/common/config/arm/arm-common.c b/gcc/common/config/arm/arm-common.c
index 9980af6..481aa9e 100644
--- a/gcc/common/config/arm/arm-common.c
+++ b/gcc/common/config/arm/arm-common.c
@@ -627,9 +627,15 @@ public:
The options array consists of couplets of information where the
first item in each couplet is the string describing which option
name was selected (arch, cpu, fpu) and the second is the value
- passed for that option. */
-const char *
-arm_canon_arch_option (int argc, const char **argv)
+ passed for that option.
+
+ arch_for_multilib is boolean variable taking value true or false.
+ arch_for_multilib is false when the canonical representation is for -march
+ option and it is true when canonical representation is for -mlibarch option.
+ On passing arch_for_multilib true the canonical string generated will be
+ without the compiler options which are not required for multilib linking. */
+static const char *
+arm_canon_arch_option_1 (int argc, const char **argv, bool arch_for_multilib)
{
const char *arch = NULL;
const char *cpu = NULL;
@@ -694,8 +700,8 @@ arm_canon_arch_option (int argc, const char **argv)
/* First build up a bitmap describing the target architecture. */
if (arch)
{
- selected_arch = arm_parse_arch_option_name (all_architectures,
- "-march", arch);
+ selected_arch = arm_parse_arch_option_name (all_architectures, "-march",
+ arch, !arch_for_multilib);
if (selected_arch == NULL)
return "";
@@ -703,6 +709,15 @@ arm_canon_arch_option (int argc, const char **argv)
arm_initialize_isa (target_isa, selected_arch->common.isa_bits);
arm_parse_option_features (target_isa, &selected_arch->common,
strchr (arch, '+'));
+ if (arch_for_multilib)
+ {
+ const enum isa_feature removable_bits[] = {ISA_IGNORE_FOR_MULTILIB,
+ isa_nobit};
+ sbitmap isa_bits = sbitmap_alloc (isa_num_bits);
+ arm_initialize_isa (isa_bits, removable_bits);
+ bitmap_and_compl (target_isa, target_isa, isa_bits);
+ }
+
if (fpu && strcmp (fpu, "auto") != 0)
{
/* We assume that architectures do not have any FPU bits
@@ -719,7 +734,8 @@ arm_canon_arch_option (int argc, const char **argv)
else if (cpu)
{
const cpu_option *selected_cpu
- = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu);
+ = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu,
+ !arch_for_multilib);
if (selected_cpu == NULL)
return "";
@@ -1069,3 +1085,22 @@ arm_asm_auto_mfpu (int argc, const char **argv)
#define TARGET_EXCEPT_UNWIND_INFO arm_except_unwind_info
struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
+
+/* Returns a canonical representation of the -march option from the current
+ -march string (if given) and other options on the command line that might
+ affect the architecture. */
+const char *
+arm_canon_arch_option (int argc, const char **argv)
+{
+ return arm_canon_arch_option_1 (argc, argv, false);
+}
+
+/* Returns a canonical representation of the -mlibarch option from the current
+ -march string (if given) and other options on the command line that might
+ affect the architecture after removing the compiler extension options which
+ are not required for multilib linking. */
+const char *
+arm_canon_arch_multilib_option (int argc, const char **argv)
+{
+ return arm_canon_arch_option_1 (argc, argv, true);
+}
diff --git a/gcc/common/config/bfin/bfin-common.c b/gcc/common/config/bfin/bfin-common.c
index 48a6fe8..a3ee4b5 100644
--- a/gcc/common/config/bfin/bfin-common.c
+++ b/gcc/common/config/bfin/bfin-common.c
@@ -313,7 +313,7 @@ bfin_handle_option (struct gcc_options *opts,
i = 0;
while ((p = bfin_cpus[i].name) != NULL)
{
- if (strncmp (arg, p, strlen (p)) == 0)
+ if (startswith (arg, p))
break;
i++;
}
diff --git a/gcc/common/config/gcn/gcn-common.c b/gcc/common/config/gcn/gcn-common.c
index 305c310..695eb46 100644
--- a/gcc/common/config/gcn/gcn-common.c
+++ b/gcc/common/config/gcn/gcn-common.c
@@ -27,7 +27,7 @@
/* Set default optimization options. */
static const struct default_options gcn_option_optimization_table[] =
{
- { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+ { OPT_LEVELS_3_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};
diff --git a/gcc/common/config/i386/cpuinfo.h b/gcc/common/config/i386/cpuinfo.h
index dbce022..bbf29bdb 100644
--- a/gcc/common/config/i386/cpuinfo.h
+++ b/gcc/common/config/i386/cpuinfo.h
@@ -46,6 +46,10 @@ struct __processor_model2
# define CHECK___builtin_cpu_is(cpu)
#endif
+#ifndef CHECK___builtin_cpu_supports
+# define CHECK___builtin_cpu_supports(isa)
+#endif
+
/* Return non-zero if the processor has feature F. */
static inline int
@@ -404,14 +408,20 @@ get_intel_cpu (struct __processor_model *cpu_model,
case 0xa5:
case 0xa6:
/* Comet Lake. */
- case 0xa7:
- /* Rocket Lake. */
cpu = "skylake";
CHECK___builtin_cpu_is ("corei7");
CHECK___builtin_cpu_is ("skylake");
cpu_model->__cpu_type = INTEL_COREI7;
cpu_model->__cpu_subtype = INTEL_COREI7_SKYLAKE;
break;
+ case 0xa7:
+ /* Rocket Lake. */
+ cpu = "rocketlake";
+ CHECK___builtin_cpu_is ("corei7");
+ CHECK___builtin_cpu_is ("rocketlake");
+ cpu_model->__cpu_type = INTEL_COREI7;
+ cpu_model->__cpu_subtype = INTEL_COREI7_ROCKETLAKE;
+ break;
case 0x55:
CHECK___builtin_cpu_is ("corei7");
cpu_model->__cpu_type = INTEL_COREI7;
@@ -476,6 +486,7 @@ get_intel_cpu (struct __processor_model *cpu_model,
cpu_model->__cpu_subtype = INTEL_COREI7_TIGERLAKE;
break;
case 0x97:
+ case 0x9a:
/* Alder Lake. */
cpu = "alderlake";
CHECK___builtin_cpu_is ("corei7");
@@ -724,6 +735,8 @@ get_available_features (struct __processor_model *cpu_model,
set_feature (FEATURE_AVX5124FMAPS);
if (edx & bit_AVX512VP2INTERSECT)
set_feature (FEATURE_AVX512VP2INTERSECT);
+ if (edx & bit_AVX512FP16)
+ set_feature (FEATURE_AVX512FP16);
}
__cpuid_count (7, 1, eax, ebx, ecx, edx);
@@ -924,6 +937,50 @@ cpu_indicator_init (struct __processor_model *cpu_model,
else
cpu_model->__cpu_vendor = VENDOR_OTHER;
+ if (has_cpu_feature (cpu_model, cpu_features2, FEATURE_LM)
+ && has_cpu_feature (cpu_model, cpu_features2, FEATURE_SSE2))
+ {
+ CHECK___builtin_cpu_supports ("x86-64");
+ set_cpu_feature (cpu_model, cpu_features2,
+ FEATURE_X86_64_BASELINE);
+ if (has_cpu_feature (cpu_model, cpu_features2, FEATURE_CMPXCHG16B)
+ && has_cpu_feature (cpu_model, cpu_features2, FEATURE_POPCNT)
+ && has_cpu_feature (cpu_model, cpu_features2, FEATURE_LAHF_LM)
+ && has_cpu_feature (cpu_model, cpu_features2, FEATURE_SSE4_2))
+ {
+ CHECK___builtin_cpu_supports ("x86-64-v2");
+ set_cpu_feature (cpu_model, cpu_features2,
+ FEATURE_X86_64_V2);
+ if (has_cpu_feature (cpu_model, cpu_features2, FEATURE_AVX2)
+ && has_cpu_feature (cpu_model, cpu_features2, FEATURE_BMI)
+ && has_cpu_feature (cpu_model, cpu_features2, FEATURE_BMI2)
+ && has_cpu_feature (cpu_model, cpu_features2, FEATURE_F16C)
+ && has_cpu_feature (cpu_model, cpu_features2, FEATURE_FMA)
+ && has_cpu_feature (cpu_model, cpu_features2,
+ FEATURE_LZCNT)
+ && has_cpu_feature (cpu_model, cpu_features2,
+ FEATURE_MOVBE))
+ {
+ CHECK___builtin_cpu_supports ("x86-64-v3");
+ set_cpu_feature (cpu_model, cpu_features2,
+ FEATURE_X86_64_V3);
+ if (has_cpu_feature (cpu_model, cpu_features2,
+ FEATURE_AVX512BW)
+ && has_cpu_feature (cpu_model, cpu_features2,
+ FEATURE_AVX512CD)
+ && has_cpu_feature (cpu_model, cpu_features2,
+ FEATURE_AVX512DQ)
+ && has_cpu_feature (cpu_model, cpu_features2,
+ FEATURE_AVX512VL))
+ {
+ CHECK___builtin_cpu_supports ("x86-64-v4");
+ set_cpu_feature (cpu_model, cpu_features2,
+ FEATURE_X86_64_V4);
+ }
+ }
+ }
+ }
+
gcc_assert (cpu_model->__cpu_vendor < VENDOR_MAX);
gcc_assert (cpu_model->__cpu_type < CPU_TYPE_MAX);
gcc_assert (cpu_model->__cpu_subtype < CPU_SUBTYPE_MAX);
diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c
index eea8af1..00c65ba 100644
--- a/gcc/common/config/i386/i386-common.c
+++ b/gcc/common/config/i386/i386-common.c
@@ -82,6 +82,8 @@ along with GCC; see the file COPYING3. If not see
#define OPTION_MASK_ISA2_AVX5124VNNIW_SET OPTION_MASK_ISA2_AVX5124VNNIW
#define OPTION_MASK_ISA_AVX512VBMI2_SET \
(OPTION_MASK_ISA_AVX512VBMI2 | OPTION_MASK_ISA_AVX512F_SET)
+#define OPTION_MASK_ISA_AVX512FP16_SET OPTION_MASK_ISA_AVX512BW_SET
+#define OPTION_MASK_ISA2_AVX512FP16_SET OPTION_MASK_ISA2_AVX512FP16
#define OPTION_MASK_ISA_AVX512VNNI_SET \
(OPTION_MASK_ISA_AVX512VNNI | OPTION_MASK_ISA_AVX512F_SET)
#define OPTION_MASK_ISA2_AVXVNNI_SET OPTION_MASK_ISA2_AVXVNNI
@@ -150,6 +152,7 @@ along with GCC; see the file COPYING3. If not see
#define OPTION_MASK_ISA_F16C_SET \
(OPTION_MASK_ISA_F16C | OPTION_MASK_ISA_AVX_SET)
#define OPTION_MASK_ISA2_MWAITX_SET OPTION_MASK_ISA2_MWAITX
+#define OPTION_MASK_ISA2_MWAIT_SET OPTION_MASK_ISA2_MWAIT
#define OPTION_MASK_ISA2_CLZERO_SET OPTION_MASK_ISA2_CLZERO
#define OPTION_MASK_ISA_PKU_SET OPTION_MASK_ISA_PKU
#define OPTION_MASK_ISA2_RDPID_SET OPTION_MASK_ISA2_RDPID
@@ -230,6 +233,8 @@ along with GCC; see the file COPYING3. If not see
#define OPTION_MASK_ISA2_AVX5124FMAPS_UNSET OPTION_MASK_ISA2_AVX5124FMAPS
#define OPTION_MASK_ISA2_AVX5124VNNIW_UNSET OPTION_MASK_ISA2_AVX5124VNNIW
#define OPTION_MASK_ISA_AVX512VBMI2_UNSET OPTION_MASK_ISA_AVX512VBMI2
+#define OPTION_MASK_ISA_AVX512FP16_UNSET OPTION_MASK_ISA_AVX512BW_UNSET
+#define OPTION_MASK_ISA2_AVX512FP16_UNSET OPTION_MASK_ISA2_AVX512FP16
#define OPTION_MASK_ISA_AVX512VNNI_UNSET OPTION_MASK_ISA_AVX512VNNI
#define OPTION_MASK_ISA2_AVXVNNI_UNSET OPTION_MASK_ISA2_AVXVNNI
#define OPTION_MASK_ISA_AVX512VPOPCNTDQ_UNSET OPTION_MASK_ISA_AVX512VPOPCNTDQ
@@ -245,6 +250,7 @@ along with GCC; see the file COPYING3. If not see
#define OPTION_MASK_ISA_XSAVES_UNSET OPTION_MASK_ISA_XSAVES
#define OPTION_MASK_ISA_CLWB_UNSET OPTION_MASK_ISA_CLWB
#define OPTION_MASK_ISA2_MWAITX_UNSET OPTION_MASK_ISA2_MWAITX
+#define OPTION_MASK_ISA2_MWAIT_UNSET OPTION_MASK_ISA2_MWAIT
#define OPTION_MASK_ISA2_CLZERO_UNSET OPTION_MASK_ISA2_CLZERO
#define OPTION_MASK_ISA_PKU_UNSET OPTION_MASK_ISA_PKU
#define OPTION_MASK_ISA2_RDPID_UNSET OPTION_MASK_ISA2_RDPID
@@ -311,7 +317,8 @@ along with GCC; see the file COPYING3. If not see
(OPTION_MASK_ISA2_AVX512BF16_UNSET \
| OPTION_MASK_ISA2_AVX5124FMAPS_UNSET \
| OPTION_MASK_ISA2_AVX5124VNNIW_UNSET \
- | OPTION_MASK_ISA2_AVX512VP2INTERSECT_UNSET)
+ | OPTION_MASK_ISA2_AVX512VP2INTERSECT_UNSET \
+ | OPTION_MASK_ISA2_AVX512FP16_UNSET)
#define OPTION_MASK_ISA2_GENERAL_REGS_ONLY_UNSET \
(OPTION_MASK_ISA2_AVX512F_UNSET)
#define OPTION_MASK_ISA2_AVX_UNSET OPTION_MASK_ISA2_AVX2_UNSET
@@ -324,7 +331,9 @@ along with GCC; see the file COPYING3. If not see
(OPTION_MASK_ISA2_SSE3_UNSET | OPTION_MASK_ISA2_KL_UNSET)
#define OPTION_MASK_ISA2_SSE_UNSET OPTION_MASK_ISA2_SSE2_UNSET
-#define OPTION_MASK_ISA2_AVX512BW_UNSET OPTION_MASK_ISA2_AVX512BF16_UNSET
+#define OPTION_MASK_ISA2_AVX512BW_UNSET \
+ (OPTION_MASK_ISA2_AVX512BF16_UNSET \
+ | OPTION_MASK_ISA2_AVX512FP16_UNSET)
/* Set 1 << value as value of -malign-FLAG option. */
@@ -352,16 +361,39 @@ ix86_handle_option (struct gcc_options *opts,
case OPT_mgeneral_regs_only:
if (value)
{
+ HOST_WIDE_INT general_regs_only_flags = 0;
+ HOST_WIDE_INT general_regs_only_flags2 = 0;
+
+ /* NB: Enable the GPR only instructions which are enabled
+ implicitly by SSE ISAs unless they have been disabled
+ explicitly. */
+ if (TARGET_SSE4_2_P (opts->x_ix86_isa_flags))
+ {
+ if (!TARGET_EXPLICIT_CRC32_P (opts))
+ general_regs_only_flags |= OPTION_MASK_ISA_CRC32;
+ if (!TARGET_EXPLICIT_POPCNT_P (opts))
+ general_regs_only_flags |= OPTION_MASK_ISA_POPCNT;
+ }
+ if (TARGET_SSE3_P (opts->x_ix86_isa_flags))
+ {
+ if (!TARGET_EXPLICIT_MWAIT_P (opts))
+ general_regs_only_flags2 |= OPTION_MASK_ISA2_MWAIT;
+ }
+
/* Disable MMX, SSE and x87 instructions if only
general registers are allowed. */
opts->x_ix86_isa_flags
&= ~OPTION_MASK_ISA_GENERAL_REGS_ONLY_UNSET;
opts->x_ix86_isa_flags2
&= ~OPTION_MASK_ISA2_GENERAL_REGS_ONLY_UNSET;
+ opts->x_ix86_isa_flags |= general_regs_only_flags;
+ opts->x_ix86_isa_flags2 |= general_regs_only_flags2;
opts->x_ix86_isa_flags_explicit
- |= OPTION_MASK_ISA_GENERAL_REGS_ONLY_UNSET;
+ |= (OPTION_MASK_ISA_GENERAL_REGS_ONLY_UNSET
+ | general_regs_only_flags);
opts->x_ix86_isa_flags2_explicit
- |= OPTION_MASK_ISA2_GENERAL_REGS_ONLY_UNSET;
+ |= (OPTION_MASK_ISA2_GENERAL_REGS_ONLY_UNSET
+ | general_regs_only_flags2);
opts->x_target_flags &= ~MASK_80387;
}
@@ -828,6 +860,21 @@ ix86_handle_option (struct gcc_options *opts,
}
return true;
+ case OPT_mavx512fp16:
+ if (value)
+ {
+ opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA2_AVX512FP16_SET;
+ opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA2_AVX512FP16_SET;
+ opts->x_ix86_isa_flags |= OPTION_MASK_ISA_AVX512FP16_SET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX512FP16_SET;
+ }
+ else
+ {
+ opts->x_ix86_isa_flags2 &= ~OPTION_MASK_ISA2_AVX512FP16_UNSET;
+ opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA2_AVX512FP16_UNSET;
+ }
+ return true;
+
case OPT_mavx512vnni:
if (value)
{
@@ -1546,6 +1593,19 @@ ix86_handle_option (struct gcc_options *opts,
}
return true;
+ case OPT_mmwait:
+ if (value)
+ {
+ opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA2_MWAIT_SET;
+ opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA2_MWAIT_SET;
+ }
+ else
+ {
+ opts->x_ix86_isa_flags2 &= ~OPTION_MASK_ISA2_MWAIT_UNSET;
+ opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA2_MWAIT_UNSET;
+ }
+ return true;
+
case OPT_mclzero:
if (value)
{
@@ -1749,6 +1809,7 @@ const char *const processor_names[] =
"cooperlake",
"sapphirerapids",
"alderlake",
+ "rocketlake",
"intel",
"geode",
"k6",
@@ -1845,6 +1906,9 @@ const pta processor_alias_table[] =
{"icelake-client", PROCESSOR_ICELAKE_CLIENT, CPU_HASWELL,
PTA_ICELAKE_CLIENT,
M_CPU_SUBTYPE (INTEL_COREI7_ICELAKE_CLIENT), P_PROC_AVX512F},
+ {"rocketlake", PROCESSOR_ROCKETLAKE, CPU_HASWELL,
+ PTA_ROCKETLAKE,
+ M_CPU_SUBTYPE (INTEL_COREI7_ROCKETLAKE), P_PROC_AVX512F},
{"icelake-server", PROCESSOR_ICELAKE_SERVER, CPU_HASWELL,
PTA_ICELAKE_SERVER,
M_CPU_SUBTYPE (INTEL_COREI7_ICELAKE_SERVER), P_PROC_AVX512F},
@@ -2051,7 +2115,7 @@ const pta processor_alias_table[] =
};
/* NB: processor_alias_table stops at the "generic" entry. */
-unsigned int const pta_size = ARRAY_SIZE (processor_alias_table) - 6;
+unsigned int const pta_size = ARRAY_SIZE (processor_alias_table) - 7;
unsigned int const num_arch_names = ARRAY_SIZE (processor_alias_table);
/* Provide valid option values for -march and -mtune options. */
diff --git a/gcc/common/config/i386/i386-cpuinfo.h b/gcc/common/config/i386/i386-cpuinfo.h
index 869115c..dc1a9fa 100644
--- a/gcc/common/config/i386/i386-cpuinfo.h
+++ b/gcc/common/config/i386/i386-cpuinfo.h
@@ -88,6 +88,7 @@ enum processor_subtypes
INTEL_COREI7_SAPPHIRERAPIDS,
INTEL_COREI7_ALDERLAKE,
AMDFAM19H_ZNVER3,
+ INTEL_COREI7_ROCKETLAKE,
CPU_SUBTYPE_MAX
};
@@ -101,6 +102,7 @@ enum feature_priority
P_MMX,
P_SSE,
P_SSE2,
+ P_X86_64_BASELINE,
P_SSE3,
P_SSSE3,
P_PROC_SSSE3,
@@ -110,6 +112,7 @@ enum feature_priority
P_SSE4_2,
P_PROC_SSE4_2,
P_POPCNT,
+ P_X86_64_V2,
P_AES,
P_PCLMUL,
P_AVX,
@@ -124,8 +127,10 @@ enum feature_priority
P_BMI2,
P_AVX2,
P_PROC_AVX2,
+ P_X86_64_V3,
P_AVX512F,
P_PROC_AVX512F,
+ P_X86_64_V4,
P_PROC_DYNAMIC
};
@@ -227,6 +232,11 @@ enum processor_features
FEATURE_AESKLE,
FEATURE_WIDEKL,
FEATURE_AVXVNNI,
+ FEATURE_AVX512FP16,
+ FEATURE_X86_64_BASELINE,
+ FEATURE_X86_64_V2,
+ FEATURE_X86_64_V3,
+ FEATURE_X86_64_V4,
CPU_FEATURE_MAX
};
diff --git a/gcc/common/config/i386/i386-isas.h b/gcc/common/config/i386/i386-isas.h
index 898c18f..7784010 100644
--- a/gcc/common/config/i386/i386-isas.h
+++ b/gcc/common/config/i386/i386-isas.h
@@ -169,4 +169,10 @@ ISA_NAMES_TABLE_START
ISA_NAMES_TABLE_ENTRY("aeskle", FEATURE_AESKLE, P_NONE, NULL)
ISA_NAMES_TABLE_ENTRY("widekl", FEATURE_WIDEKL, P_NONE, "-mwidekl")
ISA_NAMES_TABLE_ENTRY("avxvnni", FEATURE_AVXVNNI, P_NONE, "-mavxvnni")
+ ISA_NAMES_TABLE_ENTRY("avx512fp16", FEATURE_AVX512FP16, P_NONE, "-mavx512fp16")
+ ISA_NAMES_TABLE_ENTRY("x86-64", FEATURE_X86_64_BASELINE, P_X86_64_BASELINE,
+ NULL)
+ ISA_NAMES_TABLE_ENTRY("x86-64-v2", FEATURE_X86_64_V2, P_X86_64_V2, NULL)
+ ISA_NAMES_TABLE_ENTRY("x86-64-v3", FEATURE_X86_64_V3, P_X86_64_V3, NULL)
+ ISA_NAMES_TABLE_ENTRY("x86-64-v4", FEATURE_X86_64_V4, P_X86_64_V4, NULL)
ISA_NAMES_TABLE_END
diff --git a/gcc/common/config/riscv/riscv-common.c b/gcc/common/config/riscv/riscv-common.c
index 6bbe25d..10868fd4 100644
--- a/gcc/common/config/riscv/riscv-common.c
+++ b/gcc/common/config/riscv/riscv-common.c
@@ -32,6 +32,11 @@ along with GCC; see the file COPYING3. If not see
#include "config/riscv/riscv-protos.h"
#include "config/riscv/riscv-subset.h"
+#ifdef TARGET_BIG_ENDIAN_DEFAULT
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS (MASK_BIG_ENDIAN)
+#endif
+
/* Type for implied ISA info. */
struct riscv_implied_info_t
{
@@ -513,40 +518,39 @@ riscv_subset_list::parsing_subset_version (const char *ext,
unsigned version = 0;
unsigned major = 0;
unsigned minor = 0;
- char np;
*explicit_version_p = false;
- for (; *p; ++p)
- {
- if (*p == 'p')
- {
- np = *(p + 1);
-
- if (!ISDIGIT (np))
- {
- /* Might be beginning of `p` extension. */
- if (std_ext_p)
- {
- get_default_version (ext, major_version, minor_version);
- return p;
- }
- else
- {
- error_at (m_loc, "%<-march=%s%>: Expect number "
- "after %<%dp%>.", m_arch, version);
- return NULL;
- }
- }
-
- major = version;
- major_p = false;
- version = 0;
- }
- else if (ISDIGIT (*p))
- version = (version * 10) + (*p - '0');
- else
- break;
- }
+ /* If we got `p`, that means we are still parsing standard extension. */
+ gcc_assert (std_ext_p || *p != 'p');
+
+ if (*p != 'p') {
+ for (; *p; ++p)
+ {
+ if (*p == 'p')
+ {
+ if (!ISDIGIT (*(p+1)))
+ {
+ error_at (m_loc, "%<-march=%s%>: Expect number "
+ "after %<%dp%>.", m_arch, version);
+ return NULL;
+ }
+ if (!major_p)
+ {
+ error_at (m_loc, "%<-march=%s%>: For %<%s%dp%dp?%>, version "
+ "number with more than 2 level is not supported.",
+ m_arch, ext, major, version);
+ return NULL;
+ }
+ major = version;
+ major_p = false;
+ version = 0;
+ }
+ else if (ISDIGIT (*p))
+ version = (version * 10) + (*p - '0');
+ else
+ break;
+ }
+ }
if (major_p)
major = version;
@@ -638,7 +642,7 @@ riscv_subset_list::parse_std_ext (const char *p)
return NULL;
}
- while (*p)
+ while (p != NULL && *p)
{
char subset[2] = {0, 0};
@@ -766,6 +770,9 @@ riscv_subset_list::parse_multiletter_ext (const char *p,
/* std_ext_p= */ false, &explicit_version_p);
free (ext);
+ if (end_of_version == NULL)
+ return NULL;
+
*q = '\0';
if (strlen (subset) == 1)
@@ -799,12 +806,12 @@ riscv_subset_list::parse (const char *arch, location_t loc)
riscv_subset_list *subset_list = new riscv_subset_list (arch, loc);
riscv_subset_t *itr;
const char *p = arch;
- if (strncmp (p, "rv32", 4) == 0)
+ if (startswith (p, "rv32"))
{
subset_list->m_xlen = 32;
p += 4;
}
- else if (strncmp (p, "rv64", 4) == 0)
+ else if (startswith (p, "rv64"))
{
subset_list->m_xlen = 64;
p += 4;