riscv_subset_t *current, *new;
if (riscv_lookup_subset (subset_list, subset, ¤t))
- {
- if (major != RISCV_UNKNOWN_VERSION
- && minor != RISCV_UNKNOWN_VERSION)
- {
- current->major_version = major;
- current->minor_version = minor;
- }
- return;
- }
+ return;
new = xmalloc (sizeof *new);
new->name = xstrdup (subset);
int minor_version = RISCV_UNKNOWN_VERSION;
bool removed = false;
- switch (*p++)
+ switch (*p)
{
case '+': removed = false; break;
case '-': removed = true; break;
- case '=':
+ default:
riscv_release_subset_list (rps->subset_list);
return riscv_parse_subset (rps, p);
- default:
- rps->error_handler
- (_("extensions must begin with +/-/= in .option arch `%s'"), str);
- return false;
}
+ ++p;
char *subset = xstrdup (p);
char *q = subset;
return false;
}
- if (removed)
+ if (strcmp (subset, "i") == 0
+ || strcmp (subset, "e") == 0
+ || strcmp (subset, "g") == 0)
{
- if (strcmp (subset, "i") == 0)
- {
- rps->error_handler
- (_("cannot remove extension `i' in .option arch `%s'"), str);
- free (subset);
- return false;
- }
- riscv_remove_subset (rps->subset_list, subset);
+ rps->error_handler
+ (_("cannot + or - base extension `%s' in .option "
+ "arch `%s'"), subset, str);
+ free (subset);
+ return false;
}
+
+ if (removed)
+ riscv_remove_subset (rps->subset_list, subset);
else
riscv_parse_add_subset (rps, subset, major_version, minor_version, true);
p += end_of_version - subset;
.*Assembler messages:
-.*Error: extensions must begin with \+/\-/\= in .option arch `m2p0'
-.*Error: cannot remove extension `i' in .option arch `\-i'
+.*Error: m2p0: ISA string must begin with rv32 or rv64
+.*Error: cannot \+ or \- base extension `i' in .option arch `\-i'
+.*Error: cannot \+ or \- base extension `e' in .option arch `\+e'
+.*Error: cannot \+ or \- base extension `g' in .option arch `\-g'
.*Error: unknown ISA extension `zsubset' in .option arch `\+zsubset2p0'
.*Error: unknown ISA extension `f2p0_d' in .option arch `\+f2p0_d2p0'
.*Error: unknown ISA extension `' in .option arch `\+'