+2020-12-01 Nelson Chu <nelson.chu@sifive.com>
+
+ * elfxx-riscv.c (riscv_parse_std_ext): Stop parsing standard
+ extensions when parsed h keyword.
+ (riscv_get_prefix_class): Support prefixed h class.
+ (riscv_std_h_ext_strtab): Likewise.
+ (riscv_ext_h_valid_p): Likewise.
+ (parse_config): Likewise.
+ (riscv_std_z_ext_strtab): Add zifencei.
+ * elfxx-riscv.h (riscv_isa_ext_class): Add RV_ISA_CLASS_H.
+
2020-12-01 Nelson Chu <nelson.chu@sifive.com>
* elfxx-riscv.c (riscv_parse_subset): ISA string cannot contain
while (p != NULL && *p != '\0')
{
- if (*p == 'x' || *p == 's' || *p == 'z')
+ if (*p == 'x' || *p == 's' || *p == 'h' || *p == 'z')
break;
if (*p == '_')
switch (*arch)
{
case 's': return RV_ISA_CLASS_S;
+ case 'h': return RV_ISA_CLASS_H;
case 'x': return RV_ISA_CLASS_X;
case 'z': return RV_ISA_CLASS_Z;
default: return RV_ISA_CLASS_UNKNOWN;
/* 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 'h', it must be known from a list and cannot simply be 'h'.
For 'z', it must be known from a list and cannot simply be 'z'. */
/* Check that the extension name is well-formed. */
static const char * const riscv_std_z_ext_strtab[] =
{
- "zicsr", NULL
+ "zicsr", "zifencei", NULL
};
static const char * const riscv_std_s_ext_strtab[] =
NULL
};
+static const char * const riscv_std_h_ext_strtab[] =
+{
+ NULL
+};
+
/* For the extension `ext`, search through the list of known extensions
`known_exts` for a match, and return TRUE if found. */
return riscv_multi_letter_ext_valid_p (arg, riscv_std_s_ext_strtab);
}
+/* Predicator function for 'h' prefixed extensions.
+ Only known h-extensions are permitted. */
+
+static bfd_boolean
+riscv_ext_h_valid_p (const char *arg)
+{
+ return riscv_multi_letter_ext_valid_p (arg, riscv_std_h_ext_strtab);
+}
+
/* 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_H, "h", riscv_ext_h_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}
+2020-12-01 Nelson Chu <nelson.chu@sifive.com>
+
+ * testsuite/gas/riscv/march-fail-order-z.d: New testcase, check
+ orders of prefixed z extensions.
+ * testsuite/gas/riscv/march-fail-order-z.l: Likewise.
+ * testsuite/gas/riscv/march-fail-single-char-h.d: New testcase.
+ * testsuite/gas/riscv/march-fail-single-char.l: Updated.
+ * testsuite/gas/riscv/march-fail-unknown-h.d: New testcase.
+ * testsuite/gas/riscv/march-fail-unknown.l: Updated.
+
2020-12-01 Nelson Chu <nelson.chu@sifive.com>
* testsuite/gas/riscv/march-fail-uppercase-base.d: Updated.
{"zicsr", ISA_SPEC_CLASS_20191213, 2, 0},
{"zicsr", ISA_SPEC_CLASS_20190608, 2, 0},
+{"zifencei", ISA_SPEC_CLASS_20191213, 2, 0},
+{"zifencei", ISA_SPEC_CLASS_20190608, 2, 0},
+
/* Terminate the list. */
{NULL, 0, 0, 0}
};