RISC-V: Allow ISA subsets to be disabled
Without this patch, passing "-march=rv64ic -march=rv64i" results in you getting a "RV64IC" toolchain, which isn't expected. gas/ChangeLog: 2017-03-30 Palmer Dabbelt <palmer@dabbelt.com> * config/tc-riscv.c (riscv_clear_subsets): New function. (riscv_add_subset): Call riscv_clear_subsets and riscv_set_rvc to clear RVC when it's been previously set.
This commit is contained in:
parent
858f82bf7e
commit
fecb9c4665
@ -1,3 +1,9 @@
|
|||||||
|
2017-03-30 Palmer Dabbelt <palmer@dabbelt.com>
|
||||||
|
|
||||||
|
* config/tc-riscv.c (riscv_clear_subsets): New function.
|
||||||
|
(riscv_add_subset): Call riscv_clear_subsets and riscv_set_rvc to
|
||||||
|
clear RVC when it's been previously set.
|
||||||
|
|
||||||
2017-03-31 Nick Clifton <nickc@redhat.com>
|
2017-03-31 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
PR gas/21333
|
PR gas/21333
|
||||||
|
@ -120,6 +120,18 @@ riscv_subset_supports (const char *feature)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
riscv_clear_subsets (void)
|
||||||
|
{
|
||||||
|
while (riscv_subsets != NULL)
|
||||||
|
{
|
||||||
|
struct riscv_subset *next = riscv_subsets->next;
|
||||||
|
free (riscv_subsets->name);
|
||||||
|
free (riscv_subsets);
|
||||||
|
riscv_subsets = next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
riscv_add_subset (const char *subset)
|
riscv_add_subset (const char *subset)
|
||||||
{
|
{
|
||||||
@ -139,6 +151,8 @@ riscv_set_arch (const char *s)
|
|||||||
const char *extension = NULL;
|
const char *extension = NULL;
|
||||||
const char *p = s;
|
const char *p = s;
|
||||||
|
|
||||||
|
riscv_clear_subsets();
|
||||||
|
|
||||||
if (strncmp (p, "rv32", 4) == 0)
|
if (strncmp (p, "rv32", 4) == 0)
|
||||||
{
|
{
|
||||||
xlen = 32;
|
xlen = 32;
|
||||||
@ -1808,6 +1822,7 @@ riscv_after_parse_args (void)
|
|||||||
riscv_set_arch (xlen == 64 ? "rv64g" : "rv32g");
|
riscv_set_arch (xlen == 64 ? "rv64g" : "rv32g");
|
||||||
|
|
||||||
/* Add the RVC extension, regardless of -march, to support .option rvc. */
|
/* Add the RVC extension, regardless of -march, to support .option rvc. */
|
||||||
|
riscv_set_rvc (FALSE);
|
||||||
if (riscv_subset_supports ("c"))
|
if (riscv_subset_supports ("c"))
|
||||||
riscv_set_rvc (TRUE);
|
riscv_set_rvc (TRUE);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user