1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216 |
- From c7e8eb17c274e33dd718871f15ee05f1f77341c2 Mon Sep 17 00:00:00 2001
- From: Nelson Chu <nelson.chu@sifive.com>
- Date: Fri, 20 Nov 2020 14:45:32 +0800
- Subject: [PATCH 04/48] RISC-V: Minor cleanup and testcases improvement for
- arch string parser.
- Re-indent the related codes, unify and improve the related error messages
- and comments. Besies, also re-write the testcases to cover more cases.
- bfd/
- * elfxx-riscv.c: Re-indent codes, unify and improve the error
- messages and comments.
- (riscv_parse_prefixed_ext): Stop parsing the prefixed class
- extensions if the class is RV_ISA_CLASS_UNKNOWN, I get internal
- errors before adding this check for march-fail-porder* testcases.
- (riscv_parse_subset): Move the rv32 with q checking in front.
- * elfxx-riscv.h: Likewise.
- gas/
- (These are new testcases that cover more cases)
- * testsuite/gas/riscv/march-fail-base-01.d: The first extension must
- be e, i or g.
- * testsuite/gas/riscv/march-fail-base-01.l: Likewise.
- * testsuite/gas/riscv/march-fail-base-02.d: rv64e is an invalid base ISA.
- * testsuite/gas/riscv/march-fail-base-02.l: Likewise.
- * testsuite/gas/riscv/march-fail-order-std.d: Check orders of standard
- extensions.
- * testsuite/gas/riscv/march-fail-order-std.l: Likewise.
- * testsuite/gas/riscv/march-fail-order-x.d: Check orders of prefixed
- x extensions.
- * testsuite/gas/riscv/march-fail-order-x.l: Likewise.
- * testsuite/gas/riscv/march-fail-porder-x-std.d: Check orders when
- standard and prefixed extensions are set at the same time.
- * testsuite/gas/riscv/march-fail-porder-x-z.d: Likewise.
- * testsuite/gas/riscv/march-fail-porder-z-std.d: Likewise.
- * testsuite/gas/riscv/march-fail-porder.l: Likewise.
- * testsuite/gas/riscv/march-fail-single-char-s.d: Only standard
- extensions can use single char.
- * testsuite/gas/riscv/march-fail-single-char-x.d: Likewise.
- * testsuite/gas/riscv/march-fail-single-char-z.d: Likewise.
- * testsuite/gas/riscv/march-fail-single-char.l: Likewise.
- * testsuite/gas/riscv/march-fail-unknown-s.d: All extensions
- should be known, except the non-standard x extensions.
- * testsuite/gas/riscv/march-fail-unknown-std.d: Likewise.
- * testsuite/gas/riscv/march-fail-unknown-std.l: Likewise.
- * testsuite/gas/riscv/march-fail-unknown-z.d: Likewise.
- * testsuite/gas/riscv/march-fail-unknown.l: Likewise.
- * testsuite/gas/riscv/march-fail-uppercase-base.d: Do not
- allow any uppercase in the arch string.
- * testsuite/gas/riscv/march-fail-uppercase-std.d: Likewise.
- * testsuite/gas/riscv/march-fail-uppercase-z.d: Likewise.
- * testsuite/gas/riscv/march-fail-uppercase.l: Likewise.
- * testsuite/gas/riscv/march-fail-version-x.d: Failed to set versions.
- * testsuite/gas/riscv/march-fail-version-z.d: Likewise.
- * testsuite/gas/riscv/march-fail-version.l: Likewise.
- * testsuite/gas/riscv/march-fail-rv32ef.l: Updated.
- * testsuite/gas/riscv/march-fail-rv32id.d: Need f-ext.
- * testsuite/gas/riscv/march-fail-rv32iq.d: Should be rv64.
- * testsuite/gas/riscv/march-fail-rv32iq.l: Likewise.
- * testsuite/gas/riscv/march-fail-rv64iq.d: Need d-ext and f-ext.
- * testsuite/gas/riscv/march-fail-rv64iq.l: Likewise.
- (The following testcases are removed and covered by new testcases)
- * testsuite/gas/riscv/march-fail-rv32i.d: march-fail-uppercase-base.
- * testsuite/gas/riscv/march-fail-rv32i.l: Likewise.
- * testsuite/gas/riscv/march-fail-rv32iam.d: march-fail-order-std.
- * testsuite/gas/riscv/march-fail-rv32iam.l: Likewise.
- * testsuite/gas/riscv/march-fail-rv32ic.d: march-fail-uppercase-std.
- * testsuite/gas/riscv/march-fail-rv32ic.l: Likewise.
- * testsuite/gas/riscv/march-fail-rv32icx2p.d: march-fail-version-x.
- * testsuite/gas/riscv/march-fail-rv32icx2p.l: Likewise.
- * testsuite/gas/riscv/march-fail-rv32imc.d: march-fail-order-std.
- * testsuite/gas/riscv/march-fail-rv32imc.l: Likewise.
- * testsuite/gas/riscv/march-fail-rv64I.d: march-fail-uppercase-std.
- * testsuite/gas/riscv/march-fail-rv64I.l: Likewise.
- * testsuite/gas/riscv/march-fail-rv64e.d: march-fail-base-02.
- * testsuite/gas/riscv/march-fail-rv64e.l: Likewise.
- * testsuite/gas/riscv/march-fail-s-with-version.d: march-fail-unknown-s.
- * testsuite/gas/riscv/march-fail-s-with-version.l: Likewise.
- * testsuite/gas/riscv/march-fail-s.d: march-fail-unknown-s.
- * testsuite/gas/riscv/march-fail-s.l: Likewise.
- * testsuite/gas/riscv/march-fail-sx.d: march-fail-unknown-s.
- * testsuite/gas/riscv/march-fail-sx.l: Likewise.
- ---
- bfd/elfxx-riscv.c | 214 +++++++++---------
- bfd/elfxx-riscv.h | 27 ++-
- gas/testsuite/gas/riscv/march-fail-base-01.d | 3 +
- gas/testsuite/gas/riscv/march-fail-base-01.l | 2 +
- gas/testsuite/gas/riscv/march-fail-base-02.d | 3 +
- gas/testsuite/gas/riscv/march-fail-base-02.l | 2 +
- ...-fail-rv32imc.d => march-fail-order-std.d} | 2 +-
- .../gas/riscv/march-fail-order-std.l | 2 +
- gas/testsuite/gas/riscv/march-fail-order-x.d | 3 +
- gas/testsuite/gas/riscv/march-fail-order-x.l | 2 +
- .../gas/riscv/march-fail-porder-x-std.d | 3 +
- .../gas/riscv/march-fail-porder-x-z.d | 3 +
- .../gas/riscv/march-fail-porder-z-std.d | 3 +
- gas/testsuite/gas/riscv/march-fail-porder.l | 2 +
- gas/testsuite/gas/riscv/march-fail-rv32ef.l | 4 +-
- gas/testsuite/gas/riscv/march-fail-rv32i.d | 3 -
- gas/testsuite/gas/riscv/march-fail-rv32i.l | 2 -
- gas/testsuite/gas/riscv/march-fail-rv32iam.d | 3 -
- gas/testsuite/gas/riscv/march-fail-rv32iam.l | 2 -
- gas/testsuite/gas/riscv/march-fail-rv32ic.d | 3 -
- gas/testsuite/gas/riscv/march-fail-rv32ic.l | 2 -
- .../gas/riscv/march-fail-rv32icx2p.d | 3 -
- .../gas/riscv/march-fail-rv32icx2p.l | 2 -
- gas/testsuite/gas/riscv/march-fail-rv32id.d | 3 +
- gas/testsuite/gas/riscv/march-fail-rv32id.l | 2 +
- gas/testsuite/gas/riscv/march-fail-rv32imc.l | 2 -
- gas/testsuite/gas/riscv/march-fail-rv32iq.d | 3 +
- gas/testsuite/gas/riscv/march-fail-rv32iq.l | 2 +
- gas/testsuite/gas/riscv/march-fail-rv64I.d | 3 -
- gas/testsuite/gas/riscv/march-fail-rv64I.l | 2 -
- gas/testsuite/gas/riscv/march-fail-rv64e.d | 3 -
- gas/testsuite/gas/riscv/march-fail-rv64e.l | 2 -
- gas/testsuite/gas/riscv/march-fail-rv64iq.d | 3 +
- gas/testsuite/gas/riscv/march-fail-rv64iq.l | 2 +
- .../gas/riscv/march-fail-s-with-version.d | 6 -
- .../gas/riscv/march-fail-s-with-version.l | 2 -
- gas/testsuite/gas/riscv/march-fail-s.d | 6 -
- gas/testsuite/gas/riscv/march-fail-s.l | 2 -
- .../gas/riscv/march-fail-single-char-s.d | 3 +
- .../gas/riscv/march-fail-single-char-x.d | 3 +
- .../gas/riscv/march-fail-single-char-z.d | 3 +
- .../gas/riscv/march-fail-single-char.l | 2 +
- gas/testsuite/gas/riscv/march-fail-sx.d | 6 -
- gas/testsuite/gas/riscv/march-fail-sx.l | 2 -
- .../gas/riscv/march-fail-unknown-s.d | 3 +
- .../gas/riscv/march-fail-unknown-std.d | 3 +
- .../gas/riscv/march-fail-unknown-std.l | 2 +
- .../gas/riscv/march-fail-unknown-z.d | 3 +
- gas/testsuite/gas/riscv/march-fail-unknown.l | 2 +
- .../gas/riscv/march-fail-uppercase-base.d | 3 +
- .../gas/riscv/march-fail-uppercase-std.d | 3 +
- .../gas/riscv/march-fail-uppercase-z.d | 3 +
- .../gas/riscv/march-fail-uppercase.l | 2 +
- .../gas/riscv/march-fail-version-x.d | 3 +
- .../gas/riscv/march-fail-version-z.d | 3 +
- gas/testsuite/gas/riscv/march-fail-version.l | 2 +
- 56 files changed, 206 insertions(+), 183 deletions(-)
- create mode 100644 gas/testsuite/gas/riscv/march-fail-base-01.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-base-01.l
- create mode 100644 gas/testsuite/gas/riscv/march-fail-base-02.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-base-02.l
- rename gas/testsuite/gas/riscv/{march-fail-rv32imc.d => march-fail-order-std.d} (50%)
- create mode 100644 gas/testsuite/gas/riscv/march-fail-order-std.l
- create mode 100644 gas/testsuite/gas/riscv/march-fail-order-x.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-order-x.l
- create mode 100644 gas/testsuite/gas/riscv/march-fail-porder-x-std.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-porder-x-z.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-porder-z-std.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-porder.l
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-rv32i.d
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-rv32i.l
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-rv32iam.d
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-rv32iam.l
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-rv32ic.d
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-rv32ic.l
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-rv32icx2p.d
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-rv32icx2p.l
- create mode 100644 gas/testsuite/gas/riscv/march-fail-rv32id.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-rv32id.l
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-rv32imc.l
- create mode 100644 gas/testsuite/gas/riscv/march-fail-rv32iq.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-rv32iq.l
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-rv64I.d
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-rv64I.l
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-rv64e.d
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-rv64e.l
- create mode 100644 gas/testsuite/gas/riscv/march-fail-rv64iq.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-rv64iq.l
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-s-with-version.d
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-s-with-version.l
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-s.d
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-s.l
- create mode 100644 gas/testsuite/gas/riscv/march-fail-single-char-s.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-single-char-x.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-single-char-z.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-single-char.l
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-sx.d
- delete mode 100644 gas/testsuite/gas/riscv/march-fail-sx.l
- create mode 100644 gas/testsuite/gas/riscv/march-fail-unknown-s.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-unknown-std.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-unknown-std.l
- create mode 100644 gas/testsuite/gas/riscv/march-fail-unknown-z.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-unknown.l
- create mode 100644 gas/testsuite/gas/riscv/march-fail-uppercase-base.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-uppercase-std.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-uppercase-z.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-uppercase.l
- create mode 100644 gas/testsuite/gas/riscv/march-fail-version-x.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-version-z.d
- create mode 100644 gas/testsuite/gas/riscv/march-fail-version.l
- diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
- index cfdd867e0d..dc196e0e12 100644
- --- a/bfd/elfxx-riscv.c
- +++ b/bfd/elfxx-riscv.c
- @@ -1010,13 +1010,13 @@ riscv_elf_add_sub_reloc (bfd *abfd,
- return bfd_reloc_ok;
- }
-
- -/* Parsing subset version.
- +/* Parsing extension version.
-
- Return Value:
- Points to the end of version
-
- Arguments:
- - `rps`: Hooks and status for parsing subset.
- + `rps`: Hooks and status for parsing extensions.
- `march`: Full arch string.
- `p`: Curent parsing position.
- `major_version`: Parsing result of major version, using
- @@ -1060,7 +1060,7 @@ riscv_parsing_subset_version (riscv_parse_subset_t *rps,
- else
- {
- rps->error_handler
- - (_("-march=%s: Expect number after `%dp'."),
- + (_("-march=%s: expect number after `%dp'"),
- march, version);
- return NULL;
- }
- @@ -1104,7 +1104,7 @@ riscv_supported_std_ext (void)
- Points to the end of extensions.
-
- Arguments:
- - `rps`: Hooks and status for parsing subset.
- + `rps`: Hooks and status for parsing extensions.
- `march`: Full arch string.
- `p`: Curent parsing position. */
-
- @@ -1117,21 +1117,17 @@ riscv_parse_std_ext (riscv_parse_subset_t *rps,
- const char *std_exts = all_std_exts;
- unsigned major_version = 0;
- unsigned minor_version = 0;
- - char std_ext = '\0';
- bfd_boolean use_default_version = FALSE;
- + char subset[2] = {0, 0};
-
- /* First letter must start with i, e or g. */
- switch (*p)
- {
- case 'i':
- - p = riscv_parsing_subset_version (rps,
- - march,
- - ++p,
- + p = riscv_parsing_subset_version (rps, march, ++p,
- &major_version,
- - &minor_version,
- - /* std_ext_p= */TRUE,
- + &minor_version, TRUE,
- &use_default_version);
- -
- /* Find the default version if needed. */
- if (use_default_version
- && rps->get_default_version != NULL)
- @@ -1139,18 +1135,15 @@ riscv_parse_std_ext (riscv_parse_subset_t *rps,
- &major_version,
- &minor_version);
- riscv_add_subset (rps->subset_list, "i",
- - major_version, minor_version);
- + major_version,
- + minor_version);
- break;
-
- case 'e':
- - p = riscv_parsing_subset_version (rps,
- - march,
- - ++p,
- + p = riscv_parsing_subset_version (rps, march, ++p,
- &major_version,
- - &minor_version,
- - /* std_ext_p= */TRUE,
- + &minor_version, TRUE,
- &use_default_version);
- -
- /* Find the default version if needed. */
- if (use_default_version
- && rps->get_default_version != NULL)
- @@ -1158,7 +1151,8 @@ riscv_parse_std_ext (riscv_parse_subset_t *rps,
- &major_version,
- &minor_version);
- riscv_add_subset (rps->subset_list, "e",
- - major_version, minor_version);
- + major_version,
- + minor_version);
-
- /* i-ext must be enabled. */
- if (rps->get_default_version != NULL)
- @@ -1166,7 +1160,8 @@ riscv_parse_std_ext (riscv_parse_subset_t *rps,
- &major_version,
- &minor_version);
- riscv_add_subset (rps->subset_list, "i",
- - major_version, minor_version);
- + major_version,
- + minor_version);
-
- if (*rps->xlen > 32)
- {
- @@ -1180,47 +1175,41 @@ riscv_parse_std_ext (riscv_parse_subset_t *rps,
- case 'g':
- /* The g-ext shouldn't has the version, so we just
- skip the setting if user set a version to it. */
- - p = riscv_parsing_subset_version (rps,
- - march,
- - ++p,
- + p = riscv_parsing_subset_version (rps, march, ++p,
- &major_version,
- - &minor_version,
- - TRUE,
- + &minor_version, TRUE,
- &use_default_version);
- -
- /* i-ext must be enabled. */
- if (rps->get_default_version != NULL)
- rps->get_default_version ("i",
- &major_version,
- &minor_version);
- riscv_add_subset (rps->subset_list, "i",
- - major_version, minor_version);
- + major_version,
- + minor_version);
-
- for ( ; *std_exts != 'q'; std_exts++)
- {
- - const char subset[] = {*std_exts, '\0'};
- -
- + subset[0] = *std_exts;
- if (rps->get_default_version != NULL)
- rps->get_default_version (subset,
- &major_version,
- &minor_version);
- riscv_add_subset (rps->subset_list, subset,
- - major_version, minor_version);
- + major_version,
- + minor_version);
- }
- break;
-
- default:
- rps->error_handler
- - (_("-march=%s: first ISA subset must be `e', `i' or `g'"), march);
- + (_("-march=%s: first ISA extension must be `e', `i' or `g'"),
- + march);
- return NULL;
- }
-
- - /* The riscv_parsing_subset_version may set `p` to NULL, so I think we should
- - skip parsing the string if `p` is NULL or value of `p` is `\0`. */
- while (p != NULL && *p != '\0')
- {
- - char subset[2] = {0, 0};
- -
- if (*p == 'x' || *p == 's' || *p == 'z')
- break;
-
- @@ -1230,35 +1219,31 @@ riscv_parse_std_ext (riscv_parse_subset_t *rps,
- continue;
- }
-
- - std_ext = *p;
- -
- /* Checking canonical order. */
- - while (*std_exts && std_ext != *std_exts) std_exts++;
- + char std_ext = *p;
- + while (*std_exts && std_ext != *std_exts)
- + std_exts++;
-
- if (std_ext != *std_exts)
- {
- if (strchr (all_std_exts, std_ext) == NULL)
- rps->error_handler
- - (_("-march=%s: unsupported ISA subset `%c'"), march, *p);
- + (_("-march=%s: unknown standard ISA extension `%c'"),
- + march, std_ext);
- else
- rps->error_handler
- - (_("-march=%s: ISA string is not in canonical order. `%c'"),
- - march, *p);
- + (_("-march=%s: standard ISA extension `%c' is not "
- + "in canonical order"), march, std_ext);
- return NULL;
- }
-
- std_exts++;
- -
- use_default_version = FALSE;
- subset[0] = std_ext;
- - p = riscv_parsing_subset_version (rps,
- - march,
- - ++p,
- + p = riscv_parsing_subset_version (rps, march, ++p,
- &major_version,
- - &minor_version,
- - TRUE,
- + &minor_version, TRUE,
- &use_default_version);
- -
- /* Find the default version if needed. */
- if (use_default_version
- && rps->get_default_version != NULL)
- @@ -1266,8 +1251,10 @@ riscv_parse_std_ext (riscv_parse_subset_t *rps,
- &major_version,
- &minor_version);
- riscv_add_subset (rps->subset_list, subset,
- - major_version, minor_version);
- + major_version,
- + minor_version);
- }
- +
- return p;
- }
-
- @@ -1294,23 +1281,26 @@ typedef struct riscv_parse_config
- /* Class of the extension. */
- riscv_isa_ext_class_t class;
-
- - /* Lower-case prefix string for error printing
- - and internal parser usage, e.g. "z", "x". */
- + /* Prefix string for error printing and internal parser usage. */
- const char *prefix;
-
- - /* Predicate which is used for checking whether
- - this is a "known" extension. For 'x',
- - it always returns true (since they are by
- + /* Predicate which is used for checking whether this is a "known"
- + extension. For 'x', it always returns true since they are by
- definition non-standard and cannot be known. */
- bfd_boolean (*ext_valid_p) (const char *);
- } riscv_parse_config_t;
-
- -/* Parse a generic prefixed extension.
- - `rps`: Hooks and status for parsing subset.
- - `march`: The full architecture string as passed in by "-march=...".
- - `p`: Point from which to start parsing the -march string.
- - `config`: What class of extensions to parse, predicate funcs,
- - and strings to use in error reporting. */
- +/* Parsing function for prefixed extensions.
- +
- + Return Value:
- + Points to the end of extension.
- +
- + Arguments:
- + `rps`: Hooks and status for parsing extensions.
- + `march`: Full architecture string.
- + `p`: Curent parsing position.
- + `config`: What class and predicate function to use for the
- + extension. */
-
- static const char *
- riscv_parse_prefixed_ext (riscv_parse_subset_t *rps,
- @@ -1335,7 +1325,8 @@ riscv_parse_prefixed_ext (riscv_parse_subset_t *rps,
- /* Assert that the current extension specifier matches our parsing
- class. */
- class = riscv_get_prefix_class (p);
- - if (class != config->class)
- + if (class != config->class
- + || class == RV_ISA_CLASS_UNKNOWN)
- break;
-
- char *subset = xstrdup (p);
- @@ -1347,12 +1338,13 @@ riscv_parse_prefixed_ext (riscv_parse_subset_t *rps,
-
- use_default_version = FALSE;
- end_of_version =
- - riscv_parsing_subset_version (rps, march, q, &major_version,
- + riscv_parsing_subset_version (rps, march, q,
- + &major_version,
- &minor_version, FALSE,
- &use_default_version);
- *q = '\0';
-
- - /* Check that the name is valid.
- + /* Check that the prefix extension is known.
- For 'x', anything goes but it cannot simply be 'x'.
- For 's', it must be known from a list and cannot simply be 's'.
- For 'z', it must be known from a list and cannot simply be 'z'. */
- @@ -1361,30 +1353,30 @@ riscv_parse_prefixed_ext (riscv_parse_subset_t *rps,
- if (!config->ext_valid_p (subset))
- {
- rps->error_handler
- - (_("-march=%s: Invalid or unknown %s ISA extension: '%s'"),
- + (_("-march=%s: unknown %s ISA extension `%s'"),
- march, config->prefix, subset);
- free (subset);
- return NULL;
- }
-
- - /* Check that the last item is not the same as this. */
- + /* Check that the extension isn't duplicate. */
- last_name = rps->subset_list->tail->name;
- if (!strcasecmp (last_name, subset))
- {
- rps->error_handler
- - (_("-march=%s: Duplicate %s ISA extension: \'%s\'"),
- + (_("-march=%s: duplicate %s ISA extension `%s'"),
- march, config->prefix, subset);
- free (subset);
- return NULL;
- }
-
- - /* Check that we are in alphabetical order within the subset. */
- + /* Check that the extension is in alphabetical order. */
- if (!strncasecmp (last_name, config->prefix, 1)
- && strcasecmp (last_name, subset) > 0)
- {
- rps->error_handler
- - (_("\
- --march=%s: %s ISA extension not in alphabetical order: \'%s\' must come before \'%s\'."),
- + (_("-march=%s: %s ISA extension `%s' is not in alphabetical "
- + "order. It must come before `%s'"),
- march, config->prefix, subset, last_name);
- free (subset);
- return NULL;
- @@ -1397,15 +1389,17 @@ riscv_parse_prefixed_ext (riscv_parse_subset_t *rps,
- &major_version,
- &minor_version);
- riscv_add_subset (rps->subset_list, subset,
- - major_version, minor_version);
- + major_version,
- + minor_version);
-
- free (subset);
- p += end_of_version - subset;
-
- if (*p != '\0' && *p != '_')
- {
- - rps->error_handler (_("-march=%s: %s must separate with _"),
- - march, config->prefix);
- + rps->error_handler
- + (_("-march=%s: %s ISA extension must separate with _"),
- + march, config->prefix);
- return NULL;
- }
- }
- @@ -1413,30 +1407,26 @@ riscv_parse_prefixed_ext (riscv_parse_subset_t *rps,
- return p;
- }
-
- -/* List of Z-class extensions that binutils should know about.
- - Whether or not a particular entry is in this list will
- - dictate if gas/ld will accept its presence in the -march
- - string.
- +/* Lists of prefixed class extensions that binutils should know about.
- + Whether or not a particular entry is in these lists will dictate if
- + gas/ld will accept its presence in the architecture string.
-
- - Example: To add an extension called "Zbb" (bitmanip base extension),
- - add "zbb" string to the list (all lowercase).
- -
- - Keep this list alphabetically ordered. */
- + Please add the extensions to the lists in lower case. However, keep
- + these subsets in alphabetical order in these tables is recommended,
- + although there is no impact on the current implementation. */
-
- static const char * const riscv_std_z_ext_strtab[] =
- - {
- - "zicsr", NULL
- - };
- -
- -/* Same as `riscv_std_z_ext_strtab', but for S-class extensions. */
- +{
- + "zicsr", NULL
- +};
-
- static const char * const riscv_std_s_ext_strtab[] =
- - {
- - NULL
- - };
- +{
- + NULL
- +};
-
- -/* For the extension EXT, search through the list of known extensions
- - KNOWN_EXTS for a match, and return TRUE if found. */
- +/* For the extension `ext`, search through the list of known extensions
- + `known_exts` for a match, and return TRUE if found. */
-
- static bfd_boolean
- riscv_multi_letter_ext_valid_p (const char *ext,
- @@ -1473,7 +1463,7 @@ riscv_ext_z_valid_p (const char *arg)
- }
-
- /* Predicator function for 's' prefixed extensions.
- - Must be either literal 's', or a known s-prefixed extension. */
- + Only known s-extensions are permitted. */
-
- static bfd_boolean
- riscv_ext_s_valid_p (const char *arg)
- @@ -1481,14 +1471,15 @@ riscv_ext_s_valid_p (const char *arg)
- return riscv_multi_letter_ext_valid_p (arg, riscv_std_s_ext_strtab);
- }
-
- -/* Parsing order that is specified by the ISA manual. */
- +/* Parsing order of the prefixed extensions that is specified by
- + the ISA spec. */
-
- static const riscv_parse_config_t parse_config[] =
- {
- - {RV_ISA_CLASS_S, "s", riscv_ext_s_valid_p},
- - {RV_ISA_CLASS_Z, "z", riscv_ext_z_valid_p},
- - {RV_ISA_CLASS_X, "x", riscv_ext_x_valid_p},
- - {RV_ISA_CLASS_UNKNOWN, NULL, NULL}
- + {RV_ISA_CLASS_S, "s", riscv_ext_s_valid_p},
- + {RV_ISA_CLASS_Z, "z", riscv_ext_z_valid_p},
- + {RV_ISA_CLASS_X, "x", riscv_ext_x_valid_p},
- + {RV_ISA_CLASS_UNKNOWN, NULL, NULL}
- };
-
- /* Function for parsing arch string.
- @@ -1497,8 +1488,8 @@ static const riscv_parse_config_t parse_config[] =
- Return TRUE on success.
-
- Arguments:
- - `rps`: Hooks and status for parsing subset.
- - `arch`: Arch string. */
- + `rps`: Hooks and status for parsing extensions.
- + `arch`: Full arch string. */
-
- bfd_boolean
- riscv_parse_subset (riscv_parse_subset_t *rps,
- @@ -1538,12 +1529,13 @@ riscv_parse_subset (riscv_parse_subset_t *rps,
- return FALSE;
-
- /* Parse the different classes of extensions in the specified order. */
- - for (i = 0; i < ARRAY_SIZE (parse_config); ++i) {
- - p = riscv_parse_prefixed_ext (rps, arch, p, &parse_config[i]);
- + for (i = 0; i < ARRAY_SIZE (parse_config); ++i)
- + {
- + p = riscv_parse_prefixed_ext (rps, arch, p, &parse_config[i]);
-
- - if (p == NULL)
- - return FALSE;
- - }
- + if (p == NULL)
- + return FALSE;
- + }
-
- if (*p != '\0')
- {
- @@ -1552,6 +1544,7 @@ riscv_parse_subset (riscv_parse_subset_t *rps,
- return FALSE;
- }
-
- + /* Check the conflicts. */
- if (riscv_lookup_subset (rps->subset_list, "e")
- && riscv_lookup_subset (rps->subset_list, "f"))
- {
- @@ -1561,6 +1554,14 @@ riscv_parse_subset (riscv_parse_subset_t *rps,
- return FALSE;
- }
-
- + if (riscv_lookup_subset (rps->subset_list, "q") && *rps->xlen < 64)
- + {
- + rps->error_handler
- + (_("-march=%s: rv32 does not support the `q' extension"),
- + arch);
- + return FALSE;
- + }
- +
- if (riscv_lookup_subset (rps->subset_list, "d")
- && !riscv_lookup_subset (rps->subset_list, "f"))
- {
- @@ -1579,13 +1580,6 @@ riscv_parse_subset (riscv_parse_subset_t *rps,
- return FALSE;
- }
-
- - if (riscv_lookup_subset (rps->subset_list, "q") && *rps->xlen < 64)
- - {
- - rps->error_handler
- - (_("-march=%s: rv32 does not support the `q' extension"),
- - arch);
- - return FALSE;
- - }
- return TRUE;
- }
-
- diff --git a/bfd/elfxx-riscv.h b/bfd/elfxx-riscv.h
- index c91b169e99..b5b17d1687 100644
- --- a/bfd/elfxx-riscv.h
- +++ b/bfd/elfxx-riscv.h
- @@ -46,7 +46,8 @@ struct riscv_subset_t
-
- typedef struct riscv_subset_t riscv_subset_t;
-
- -typedef struct {
- +typedef struct
- +{
- riscv_subset_t *head;
- riscv_subset_t *tail;
- } riscv_subset_list_t;
- @@ -68,14 +69,15 @@ riscv_lookup_subset_version (const riscv_subset_list_t *,
- const char *,
- int, int);
-
- -typedef struct {
- +typedef struct
- +{
- riscv_subset_list_t *subset_list;
- void (*error_handler) (const char *,
- ...) ATTRIBUTE_PRINTF_1;
- unsigned *xlen;
- void (*get_default_version) (const char *,
- - unsigned int *,
- - unsigned int *);
- + unsigned int *,
- + unsigned int *);
- } riscv_parse_subset_t;
-
- extern bfd_boolean
- @@ -95,18 +97,15 @@ extern size_t
- riscv_estimate_digit (unsigned);
-
- /* ISA extension name class. E.g. "zbb" corresponds to RV_ISA_CLASS_Z,
- - "xargs" corresponds to RV_ISA_CLASS_X, etc. Order is important
- - here. */
- + "xargs" corresponds to RV_ISA_CLASS_X, etc. */
-
- typedef enum riscv_isa_ext_class
- - {
- - RV_ISA_CLASS_S,
- - RV_ISA_CLASS_Z,
- - RV_ISA_CLASS_X,
- - RV_ISA_CLASS_UNKNOWN
- - } riscv_isa_ext_class_t;
- -
- -/* Classify the argument 'ext' into one of riscv_isa_ext_class_t. */
- +{
- + RV_ISA_CLASS_S,
- + RV_ISA_CLASS_Z,
- + RV_ISA_CLASS_X,
- + RV_ISA_CLASS_UNKNOWN
- +} riscv_isa_ext_class_t;
-
- riscv_isa_ext_class_t
- riscv_get_prefix_class (const char *);
- diff --git a/gas/testsuite/gas/riscv/march-fail-base-01.d b/gas/testsuite/gas/riscv/march-fail-base-01.d
- new file mode 100644
- index 0000000000..68cd453111
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-base-01.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32m
- +#source: empty.s
- +#error_output: march-fail-base-01.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-base-01.l b/gas/testsuite/gas/riscv/march-fail-base-01.l
- new file mode 100644
- index 0000000000..9fa071f5b0
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-base-01.l
- @@ -0,0 +1,2 @@
- +.*Assembler messages:
- +.*Fatal error: .*first ISA extension must be `e', `i' or `g'
- diff --git a/gas/testsuite/gas/riscv/march-fail-base-02.d b/gas/testsuite/gas/riscv/march-fail-base-02.d
- new file mode 100644
- index 0000000000..cfe085ab21
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-base-02.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv64e
- +#source: empty.s
- +#error_output: march-fail-base-02.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-base-02.l b/gas/testsuite/gas/riscv/march-fail-base-02.l
- new file mode 100644
- index 0000000000..6fc4dfa7ba
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-base-02.l
- @@ -0,0 +1,2 @@
- +.*Assembler messages:
- +.*Fatal error: .*rv64e is not a valid base ISA
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32imc.d b/gas/testsuite/gas/riscv/march-fail-order-std.d
- similarity index 50%
- rename from gas/testsuite/gas/riscv/march-fail-rv32imc.d
- rename to gas/testsuite/gas/riscv/march-fail-order-std.d
- index 1cb4d9ef0b..b9c7e09de1 100644
- --- a/gas/testsuite/gas/riscv/march-fail-rv32imc.d
- +++ b/gas/testsuite/gas/riscv/march-fail-order-std.d
- @@ -1,3 +1,3 @@
- #as: -march=rv32iamfd
- #source: empty.s
- -#error_output: march-fail-rv32imc.l
- +#error_output: march-fail-order-std.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-order-std.l b/gas/testsuite/gas/riscv/march-fail-order-std.l
- new file mode 100644
- index 0000000000..666a8c0d2c
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-order-std.l
- @@ -0,0 +1,2 @@
- +.*Assembler messages:
- +.*Fatal error: .*standard ISA extension `m' is not in canonical order
- diff --git a/gas/testsuite/gas/riscv/march-fail-order-x.d b/gas/testsuite/gas/riscv/march-fail-order-x.d
- new file mode 100644
- index 0000000000..72a821ef8e
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-order-x.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32i_xbargle2p0_xargle2p0
- +#source: empty.s
- +#error_output: march-fail-order-x.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-order-x.l b/gas/testsuite/gas/riscv/march-fail-order-x.l
- new file mode 100644
- index 0000000000..f7b383d855
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-order-x.l
- @@ -0,0 +1,2 @@
- +.*Assembler messages:
- +.*Fatal error: .*x ISA extension `xargle' is not in alphabetical order. It must come before `xbargle'
- diff --git a/gas/testsuite/gas/riscv/march-fail-porder-x-std.d b/gas/testsuite/gas/riscv/march-fail-porder-x-std.d
- new file mode 100644
- index 0000000000..2bef073464
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-porder-x-std.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32i_xargle2p0_mafd
- +#source: empty.s
- +#error_output: march-fail-porder.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-porder-x-z.d b/gas/testsuite/gas/riscv/march-fail-porder-x-z.d
- new file mode 100644
- index 0000000000..094180ddd0
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-porder-x-z.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32i_xargle2p0_zicsr2p0
- +#source: empty.s
- +#error_output: march-fail-porder.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-porder-z-std.d b/gas/testsuite/gas/riscv/march-fail-porder-z-std.d
- new file mode 100644
- index 0000000000..1fa1a159f3
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-porder-z-std.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32i_zicsr2p0_mafd
- +#source: empty.s
- +#error_output: march-fail-porder.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-porder.l b/gas/testsuite/gas/riscv/march-fail-porder.l
- new file mode 100644
- index 0000000000..a06d586580
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-porder.l
- @@ -0,0 +1,2 @@
- +.*Assembler messages:
- +.*Fatal error: .*unexpected ISA string at end:.*
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32ef.l b/gas/testsuite/gas/riscv/march-fail-rv32ef.l
- index 15e56c8bdc..d2d915d872 100644
- --- a/gas/testsuite/gas/riscv/march-fail-rv32ef.l
- +++ b/gas/testsuite/gas/riscv/march-fail-rv32ef.l
- @@ -1,2 +1,2 @@
- -Assembler messages:
- -Fatal error: -march=rv32ef: rv32e does not support the `f' extension
- +.*Assembler messages:
- +.*Fatal error: .*rv32e does not support the `f' extension
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32i.d b/gas/testsuite/gas/riscv/march-fail-rv32i.d
- deleted file mode 100644
- index 1e6e9e0868..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-rv32i.d
- +++ /dev/null
- @@ -1,3 +0,0 @@
- -#as: -march=rv32I
- -#source: empty.s
- -#error_output: march-fail-rv32i.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32i.l b/gas/testsuite/gas/riscv/march-fail-rv32i.l
- deleted file mode 100644
- index 1977aede3b..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-rv32i.l
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -Assembler messages:
- -Fatal error: -march=rv32I: first ISA subset must be `e', `i' or `g'
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32iam.d b/gas/testsuite/gas/riscv/march-fail-rv32iam.d
- deleted file mode 100644
- index 054cf4d28b..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-rv32iam.d
- +++ /dev/null
- @@ -1,3 +0,0 @@
- -#as: -march=rv32iam
- -#source: empty.s
- -#error_output: march-fail-rv32iam.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32iam.l b/gas/testsuite/gas/riscv/march-fail-rv32iam.l
- deleted file mode 100644
- index c7786f82ea..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-rv32iam.l
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -Assembler messages:
- -Fatal error: -march=rv32iam: ISA string is not in canonical order. `m'
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32ic.d b/gas/testsuite/gas/riscv/march-fail-rv32ic.d
- deleted file mode 100644
- index b419a654bd..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-rv32ic.d
- +++ /dev/null
- @@ -1,3 +0,0 @@
- -#as: -march=rv32iC
- -#source: empty.s
- -#error_output: march-fail-rv32ic.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32ic.l b/gas/testsuite/gas/riscv/march-fail-rv32ic.l
- deleted file mode 100644
- index d24ea2fd03..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-rv32ic.l
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -Assembler messages:
- -Fatal error: -march=rv32iC: unsupported ISA subset `C'
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32icx2p.d b/gas/testsuite/gas/riscv/march-fail-rv32icx2p.d
- deleted file mode 100644
- index 51980906cd..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-rv32icx2p.d
- +++ /dev/null
- @@ -1,3 +0,0 @@
- -#as: -march=rv32icx2p
- -#source: empty.s
- -#error_output: march-fail-rv32icx2p.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32icx2p.l b/gas/testsuite/gas/riscv/march-fail-rv32icx2p.l
- deleted file mode 100644
- index 25627d4054..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-rv32icx2p.l
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -Assembler messages:
- -Fatal error: -march=rv32icx2p: Expect number after `2p'.
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32id.d b/gas/testsuite/gas/riscv/march-fail-rv32id.d
- new file mode 100644
- index 0000000000..de741cbc81
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-rv32id.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32id
- +#source: empty.s
- +#error_output: march-fail-rv32id.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32id.l b/gas/testsuite/gas/riscv/march-fail-rv32id.l
- new file mode 100644
- index 0000000000..29b2717ef7
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-rv32id.l
- @@ -0,0 +1,2 @@
- +.*Assembler messages:
- +.*Fatal error: .*`d' extension requires `f' extension
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32imc.l b/gas/testsuite/gas/riscv/march-fail-rv32imc.l
- deleted file mode 100644
- index d922e9d348..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-rv32imc.l
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -Assembler messages:
- -Fatal error: -march=rv32iamfd: ISA string is not in canonical order. `m'
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32iq.d b/gas/testsuite/gas/riscv/march-fail-rv32iq.d
- new file mode 100644
- index 0000000000..c289c695ca
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-rv32iq.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32iq
- +#source: empty.s
- +#error_output: march-fail-rv32iq.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv32iq.l b/gas/testsuite/gas/riscv/march-fail-rv32iq.l
- new file mode 100644
- index 0000000000..361c381b86
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-rv32iq.l
- @@ -0,0 +1,2 @@
- +.*Assembler messages:
- +.*Fatal error: .*rv32 does not support the `q' extension
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv64I.d b/gas/testsuite/gas/riscv/march-fail-rv64I.d
- deleted file mode 100644
- index e00a6f86eb..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-rv64I.d
- +++ /dev/null
- @@ -1,3 +0,0 @@
- -#as: -march=rv64I
- -#source: empty.s
- -#error_output: march-fail-rv64I.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv64I.l b/gas/testsuite/gas/riscv/march-fail-rv64I.l
- deleted file mode 100644
- index 5b46e77d4b..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-rv64I.l
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -Assembler messages:
- -Fatal error: -march=rv64I: first ISA subset must be `e', `i' or `g'
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv64e.d b/gas/testsuite/gas/riscv/march-fail-rv64e.d
- deleted file mode 100644
- index 38d73db474..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-rv64e.d
- +++ /dev/null
- @@ -1,3 +0,0 @@
- -#as: -march=rv64e
- -#source: empty.s
- -#error_output: march-fail-rv64e.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv64e.l b/gas/testsuite/gas/riscv/march-fail-rv64e.l
- deleted file mode 100644
- index 85f755462f..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-rv64e.l
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -Assembler messages:
- -Fatal error: -march=rv64e: rv64e is not a valid base ISA
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv64iq.d b/gas/testsuite/gas/riscv/march-fail-rv64iq.d
- new file mode 100644
- index 0000000000..c97a812cb3
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-rv64iq.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv64iq
- +#source: empty.s
- +#error_output: march-fail-rv64iq.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-rv64iq.l b/gas/testsuite/gas/riscv/march-fail-rv64iq.l
- new file mode 100644
- index 0000000000..76a41043e3
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-rv64iq.l
- @@ -0,0 +1,2 @@
- +.*Assembler messages:
- +.*Fatal error: .*`q' extension requires `d' extension
- diff --git a/gas/testsuite/gas/riscv/march-fail-s-with-version.d b/gas/testsuite/gas/riscv/march-fail-s-with-version.d
- deleted file mode 100644
- index 9881c2a0e0..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-s-with-version.d
- +++ /dev/null
- @@ -1,6 +0,0 @@
- -#as: -march=rv32isfoo3p4
- -#objdump: -dr
- -#source: empty.s
- -#error_output: march-fail-s-with-version.l
- -
- -.*: file format elf32-littleriscv
- diff --git a/gas/testsuite/gas/riscv/march-fail-s-with-version.l b/gas/testsuite/gas/riscv/march-fail-s-with-version.l
- deleted file mode 100644
- index 6b1f957276..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-s-with-version.l
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -Assembler messages:
- -.*: Invalid or unknown s ISA extension: 'sfoo'
- diff --git a/gas/testsuite/gas/riscv/march-fail-s.d b/gas/testsuite/gas/riscv/march-fail-s.d
- deleted file mode 100644
- index ebc8377aaf..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-s.d
- +++ /dev/null
- @@ -1,6 +0,0 @@
- -#as: -march=rv32isfoo
- -#objdump: -dr
- -#source: empty.s
- -#error_output: march-fail-s.l
- -
- -.*: file format elf32-littleriscv
- diff --git a/gas/testsuite/gas/riscv/march-fail-s.l b/gas/testsuite/gas/riscv/march-fail-s.l
- deleted file mode 100644
- index 6b1f957276..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-s.l
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -Assembler messages:
- -.*: Invalid or unknown s ISA extension: 'sfoo'
- diff --git a/gas/testsuite/gas/riscv/march-fail-single-char-s.d b/gas/testsuite/gas/riscv/march-fail-single-char-s.d
- new file mode 100644
- index 0000000000..b3aace9122
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-single-char-s.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32is
- +#source: empty.s
- +#error_output: march-fail-single-char.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-single-char-x.d b/gas/testsuite/gas/riscv/march-fail-single-char-x.d
- new file mode 100644
- index 0000000000..585608cb82
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-single-char-x.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32ix
- +#source: empty.s
- +#error_output: march-fail-single-char.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-single-char-z.d b/gas/testsuite/gas/riscv/march-fail-single-char-z.d
- new file mode 100644
- index 0000000000..daf96d2124
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-single-char-z.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32iz
- +#source: empty.s
- +#error_output: march-fail-single-char.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-single-char.l b/gas/testsuite/gas/riscv/march-fail-single-char.l
- new file mode 100644
- index 0000000000..aa87a8db1a
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-single-char.l
- @@ -0,0 +1,2 @@
- +.*Assembler messages:
- +.*Fatal error: .*unknown (s|z|x) ISA extension `(s|z|x)'
- diff --git a/gas/testsuite/gas/riscv/march-fail-sx.d b/gas/testsuite/gas/riscv/march-fail-sx.d
- deleted file mode 100644
- index 144a85c2fb..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-sx.d
- +++ /dev/null
- @@ -1,6 +0,0 @@
- -#as: -march=rv32i_sxbar
- -#objdump: -dr
- -#source: empty.s
- -#error_output: march-fail-sx.l
- -
- -.*: file format elf32-littleriscv
- diff --git a/gas/testsuite/gas/riscv/march-fail-sx.l b/gas/testsuite/gas/riscv/march-fail-sx.l
- deleted file mode 100644
- index b8ead71a3b..0000000000
- --- a/gas/testsuite/gas/riscv/march-fail-sx.l
- +++ /dev/null
- @@ -1,2 +0,0 @@
- -Assembler messages:
- -.*: Invalid or unknown s ISA extension: 'sxbar'
- diff --git a/gas/testsuite/gas/riscv/march-fail-unknown-s.d b/gas/testsuite/gas/riscv/march-fail-unknown-s.d
- new file mode 100644
- index 0000000000..93be528db8
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-unknown-s.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32isfoo2p0
- +#source: empty.s
- +#error_output: march-fail-unknown.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-unknown-std.d b/gas/testsuite/gas/riscv/march-fail-unknown-std.d
- new file mode 100644
- index 0000000000..709c8f0971
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-unknown-std.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32iy
- +#source: empty.s
- +#error_output: march-fail-unknown-std.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-unknown-std.l b/gas/testsuite/gas/riscv/march-fail-unknown-std.l
- new file mode 100644
- index 0000000000..cb856377b3
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-unknown-std.l
- @@ -0,0 +1,2 @@
- +.*Assembler messages:
- +.*Fatal error: .*unknown standard ISA extension `[^eimafdqiglcbjtpvn]'
- diff --git a/gas/testsuite/gas/riscv/march-fail-unknown-z.d b/gas/testsuite/gas/riscv/march-fail-unknown-z.d
- new file mode 100644
- index 0000000000..6ea7c48c39
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-unknown-z.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32izfoo2p0
- +#source: empty.s
- +#error_output: march-fail-unknown.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-unknown.l b/gas/testsuite/gas/riscv/march-fail-unknown.l
- new file mode 100644
- index 0000000000..ac22fe60eb
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-unknown.l
- @@ -0,0 +1,2 @@
- +.*Assembler messages:
- +.*Fatal error: .*unknown (s|z) ISA extension `(s|z)foo'
- diff --git a/gas/testsuite/gas/riscv/march-fail-uppercase-base.d b/gas/testsuite/gas/riscv/march-fail-uppercase-base.d
- new file mode 100644
- index 0000000000..74b55ea165
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-uppercase-base.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32I
- +#source: empty.s
- +#error_output: march-fail-base-01.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-uppercase-std.d b/gas/testsuite/gas/riscv/march-fail-uppercase-std.d
- new file mode 100644
- index 0000000000..8bad1f9c3a
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-uppercase-std.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32iC
- +#source: empty.s
- +#error_output: march-fail-uppercase.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-uppercase-z.d b/gas/testsuite/gas/riscv/march-fail-uppercase-z.d
- new file mode 100644
- index 0000000000..951cc59a94
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-uppercase-z.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32ic_ziCSR
- +#source: empty.s
- +#error_output: march-fail-uppercase.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-uppercase.l b/gas/testsuite/gas/riscv/march-fail-uppercase.l
- new file mode 100644
- index 0000000000..2053135922
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-uppercase.l
- @@ -0,0 +1,2 @@
- +.*Assembler messages:
- +.*Fatal error: .*unknown (standard|z) ISA extension.*
- diff --git a/gas/testsuite/gas/riscv/march-fail-version-x.d b/gas/testsuite/gas/riscv/march-fail-version-x.d
- new file mode 100644
- index 0000000000..8e140e3d5f
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-version-x.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32i2p_zicsr2p0_xargle2p
- +#source: empty.s
- +#error_output: march-fail-version.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-version-z.d b/gas/testsuite/gas/riscv/march-fail-version-z.d
- new file mode 100644
- index 0000000000..73ca5794bf
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-version-z.d
- @@ -0,0 +1,3 @@
- +#as: -march=rv32i2p_zicsr2p
- +#source: empty.s
- +#error_output: march-fail-version.l
- diff --git a/gas/testsuite/gas/riscv/march-fail-version.l b/gas/testsuite/gas/riscv/march-fail-version.l
- new file mode 100644
- index 0000000000..b5d0b91350
- --- /dev/null
- +++ b/gas/testsuite/gas/riscv/march-fail-version.l
- @@ -0,0 +1,2 @@
- +.*Assembler messages:
- +.*Fatal error: .*expect number after `2p'
- --
- 2.33.0
|