}
else
{
- error_at (m_loc, "%<-march=%s%>: ISA string must begin with rv32, rv64 "
- "or Profiles", m_arch);
+ error_at (m_loc, "%<-march=%s%>: ISA string must begin with rv32, rv64,"
+ " a supported RVA profile or refer to a supported CPU",
+ m_arch);
return NULL;
}
switch (decoded->opt_index)
{
case OPT_march_:
- riscv_parse_arch_string (decoded->arg, opts, loc);
+ if (riscv_find_cpu (decoded->arg) == NULL)
+ riscv_parse_arch_string (decoded->arg, opts, loc);
return true;
case OPT_mcpu_:
/* Expand arch string with implied extensions. */
const char *
-riscv_expand_arch (int argc ATTRIBUTE_UNUSED,
+riscv_expand_arch (int argc,
const char **argv)
{
gcc_assert (argc == 1);
location_t loc = UNKNOWN_LOCATION;
- riscv_parse_arch_string (argv[0], NULL, loc);
+ /* Try to interpret the arch as CPU first. */
+ const char *arch_str = riscv_expand_arch_from_cpu (argc, argv);
+ if (!strlen (arch_str))
+ riscv_parse_arch_string (argv[0], NULL, loc);
const std::string arch = riscv_arch_str (false);
- if (arch.length())
- return xasprintf ("-march=%s", arch.c_str());
+ if (arch.length ())
+ return xasprintf ("-march=%s", arch.c_str ());
else
return "";
}
-mfence-tso -mno-fence-tso
-mdiv -mno-div
-misa-spec=@var{ISA-spec-string}
--march=@var{ISA-string|Profiles|Profiles_ISA-string}
+-march=@var{ISA-string|Profiles|Profiles_ISA-string|CPU/processor string}
-mtune=@var{processor-string}
-mpreferred-stack-boundary=@var{num}
-msmall-data-limit=@var{N-bytes}
--- /dev/null
+/* Check whether the second -march overrides the first. */
+/* { dg-do compile { target rv64 } } */
+/* { dg-options "-O3 -march=rv64gc -march=sifive-p670" } */
+
+void
+foo (char *a, char *b, int n)
+{
+ for (int i = 0; i < n; i++)
+ a[i] = b[i] + 1;
+}
+
+/* { dg-final { scan-assembler "vset" } } */
+/* { dg-final { scan-assembler "zvl128b" } } */