Skip to content

Commit

Permalink
RISC-V: Reorder the prefixed extensions which are out of order.
Browse files Browse the repository at this point in the history
This patch has been pending for almost a year...  However, I noticed that
llvm can already re-order the extensions, even if they are out of orders.
Not really sure if they can also re-order the single letter extensions,
but at least we can do this for the multi-letter extensions in binutils.

bfd/
    * elfxx-riscv.c (riscv_parse_prefixed_ext): Removed the code which are
    used to check the prefixed extension orders.
gas/
    * testsuite/gas/riscv/march-fail-order-x-z.d: Removed since we will help
    tp reorder the prefixed extensions for now.
    * testsuite/gas/riscv/march-fail-order-x-z.l: Likewise.
    * testsuite/gas/riscv/march-fail-order-x.d: Likewise.
    * testsuite/gas/riscv/march-fail-order-x.l: Likewise.
    * testsuite/gas/riscv/march-fail-order-z.d: Likewise.
    * testsuite/gas/riscv/march-fail-order-z.l: Likewise.
  • Loading branch information
Nelson Chu committed Jun 22, 2022
1 parent c625f4e commit afc41ff
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 38 deletions.
23 changes: 0 additions & 23 deletions bfd/elfxx-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,6 @@ riscv_parse_prefixed_ext (riscv_parse_subset_t *rps,
{
int major_version;
int minor_version;
const char *last_name;
enum riscv_prefix_ext_class class;

while (*p)
Expand Down Expand Up @@ -1806,28 +1805,6 @@ riscv_parse_prefixed_ext (riscv_parse_subset_t *rps,
return NULL;
}

/* Check that the extension isn't duplicate. */
last_name = rps->subset_list->tail->name;
if (!strcasecmp (last_name, subset))
{
rps->error_handler
(_("%s: duplicate prefixed ISA extension `%s'"),
arch, subset);
free (subset);
return NULL;
}

/* Check that the extension is in expected order. */
if (riscv_compare_subsets (last_name, subset) > 0)
{
rps->error_handler
(_("%s: prefixed ISA extension `%s' is not in expected "
"order. It must come before `%s'"),
arch, subset, last_name);
free (subset);
return NULL;
}

riscv_parse_add_subset (rps, subset,
major_version,
minor_version, false);
Expand Down
3 changes: 0 additions & 3 deletions gas/testsuite/gas/riscv/march-fail-order-x-z.d

This file was deleted.

2 changes: 0 additions & 2 deletions gas/testsuite/gas/riscv/march-fail-order-x-z.l

This file was deleted.

3 changes: 0 additions & 3 deletions gas/testsuite/gas/riscv/march-fail-order-x.d

This file was deleted.

2 changes: 0 additions & 2 deletions gas/testsuite/gas/riscv/march-fail-order-x.l

This file was deleted.

3 changes: 0 additions & 3 deletions gas/testsuite/gas/riscv/march-fail-order-z.d

This file was deleted.

2 changes: 0 additions & 2 deletions gas/testsuite/gas/riscv/march-fail-order-z.l

This file was deleted.

0 comments on commit afc41ff

Please sign in to comment.