0037-RISC-V-Support-sub-extensions-of-B-for-march-parser.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. From 9a13033a9799982d53f47f853f8322ce6ed8246e Mon Sep 17 00:00:00 2001
  2. From: Kito Cheng <kito.cheng@sifive.com>
  3. Date: Tue, 3 Nov 2020 01:28:01 -0800
  4. Subject: [PATCH 37/48] RISC-V: Support sub-extensions of B for -march parser
  5. ---
  6. bfd/elfxx-riscv.c | 1 +
  7. gas/testsuite/gas/riscv/attribute-15-unratified.d | 4 ++--
  8. opcodes/riscv-opc.c | 13 +++++++++++++
  9. 3 files changed, 16 insertions(+), 2 deletions(-)
  10. diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
  11. index 67dbc2e682..75add5be1c 100644
  12. --- a/bfd/elfxx-riscv.c
  13. +++ b/bfd/elfxx-riscv.c
  14. @@ -1567,6 +1567,7 @@ riscv_parse_prefixed_ext (riscv_parse_subset_t *rps,
  15. static const char * const riscv_std_z_ext_strtab[] =
  16. {
  17. "zicsr", "zifencei", "zfh",
  18. + "zba", "zbb", "zbc", "zbe", "zbf", "zbm", "zbp", "zbr", "zbs", "zbt",
  19. "zvamo", "zvediv", "zvlsseg", "zvqmac",
  20. NULL
  21. };
  22. diff --git a/gas/testsuite/gas/riscv/attribute-15-unratified.d b/gas/testsuite/gas/riscv/attribute-15-unratified.d
  23. index 09d64edbe6..4645762bd6 100644
  24. --- a/gas/testsuite/gas/riscv/attribute-15-unratified.d
  25. +++ b/gas/testsuite/gas/riscv/attribute-15-unratified.d
  26. @@ -1,6 +1,6 @@
  27. -#as: -march-attr -march=rv32ifv_zvamo_zvediv_zvlsseg_zvqmac
  28. +#as: -march-attr -march=rv32ibv_zfh_zba_zbb_zbc_zbe_zbf_zbm_zbp_zbr_zbs_zbt_zvamo_zvediv_zvlsseg_zvqmac
  29. #readelf: -A
  30. #source: empty.s
  31. Attribute Section: riscv
  32. File Attributes
  33. - Tag_RISCV_arch: ".*_v1p0_zvamo1p0_zvediv1p0_zvlsseg1p0_zvqmac1p0"
  34. + Tag_RISCV_arch: ".*_b0p92_v1p0_zfh0p1_zba0p92_zbb0p92_zbc0p92_zbe0p92_zbf0p92_zbm0p92_zbp0p92_zbr0p92_zbs0p92_zbt0p92_zvamo1p0_zvediv1p0_zvlsseg1p0_zvqmac1p0"
  35. diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c
  36. index 1869f545cf..bf36ada39c 100644
  37. --- a/opcodes/riscv-opc.c
  38. +++ b/opcodes/riscv-opc.c
  39. @@ -2758,6 +2758,8 @@ const struct riscv_ext_version riscv_ext_version_table[] =
  40. {"c", ISA_SPEC_CLASS_20190608, 2, 0},
  41. {"c", ISA_SPEC_CLASS_2P2, 2, 0},
  42. +{"b", ISA_SPEC_CLASS_NONE, 0, 92},
  43. +
  44. {"v", ISA_SPEC_CLASS_NONE, 1, 0},
  45. {"zicsr", ISA_SPEC_CLASS_20191213, 2, 0},
  46. @@ -2768,6 +2770,17 @@ const struct riscv_ext_version riscv_ext_version_table[] =
  47. {"zfh", ISA_SPEC_CLASS_NONE, 0, 1},
  48. +{"zba", ISA_SPEC_CLASS_NONE, 0, 92},
  49. +{"zbb", ISA_SPEC_CLASS_NONE, 0, 92},
  50. +{"zbc", ISA_SPEC_CLASS_NONE, 0, 92},
  51. +{"zbe", ISA_SPEC_CLASS_NONE, 0, 92},
  52. +{"zbf", ISA_SPEC_CLASS_NONE, 0, 92},
  53. +{"zbm", ISA_SPEC_CLASS_NONE, 0, 92},
  54. +{"zbp", ISA_SPEC_CLASS_NONE, 0, 92},
  55. +{"zbr", ISA_SPEC_CLASS_NONE, 0, 92},
  56. +{"zbs", ISA_SPEC_CLASS_NONE, 0, 92},
  57. +{"zbt", ISA_SPEC_CLASS_NONE, 0, 92},
  58. +
  59. {"zvamo", ISA_SPEC_CLASS_NONE, 1, 0},
  60. {"zvediv", ISA_SPEC_CLASS_NONE, 1, 0},
  61. {"zvlsseg", ISA_SPEC_CLASS_NONE, 1, 0},
  62. --
  63. 2.33.0