0022-RISC-V-Clarify-the-supported-versions-for-the-unrati.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. From 91df5cd432661a07b23f9a35d6c0741f0a2f7c96 Mon Sep 17 00:00:00 2001
  2. From: Nelson Chu <nelson.chu@sifive.com>
  3. Date: Thu, 9 Jul 2020 10:56:09 +0800
  4. Subject: [PATCH 22/48] RISC-V: Clarify the supported versions for the
  5. unratified extensions.
  6. Remove the V-ext v0.7 in the riscv_ext_version_table, and regard V-ext
  7. as a non-ISA spec extension temporarily. Since we only support the v1.0
  8. for now, and not yet upstreamed. Also, we define other unratified
  9. extensions to the non-ISA spec extension, too.
  10. ---
  11. gas/config/tc-riscv.c | 3 ++-
  12. gas/testsuite/gas/riscv/attribute-15-unratified.d | 6 ++++++
  13. opcodes/riscv-opc.c | 7 +++++++
  14. 3 files changed, 15 insertions(+), 1 deletion(-)
  15. create mode 100644 gas/testsuite/gas/riscv/attribute-15-unratified.d
  16. diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
  17. index 67353ab725..2dc55ca5aa 100644
  18. --- a/gas/config/tc-riscv.c
  19. +++ b/gas/config/tc-riscv.c
  20. @@ -298,7 +298,8 @@ riscv_get_default_ext_version (const char *name,
  21. && ext->name
  22. && strcmp (ext->name, name) == 0)
  23. {
  24. - if (ext->isa_spec_class == default_isa_spec)
  25. + if (ext->isa_spec_class == ISA_SPEC_CLASS_NONE
  26. + || ext->isa_spec_class == default_isa_spec)
  27. {
  28. *major_version = ext->major_version;
  29. *minor_version = ext->minor_version;
  30. diff --git a/gas/testsuite/gas/riscv/attribute-15-unratified.d b/gas/testsuite/gas/riscv/attribute-15-unratified.d
  31. new file mode 100644
  32. index 0000000000..09d64edbe6
  33. --- /dev/null
  34. +++ b/gas/testsuite/gas/riscv/attribute-15-unratified.d
  35. @@ -0,0 +1,6 @@
  36. +#as: -march-attr -march=rv32ifv_zvamo_zvediv_zvlsseg_zvqmac
  37. +#readelf: -A
  38. +#source: empty.s
  39. +Attribute Section: riscv
  40. +File Attributes
  41. + Tag_RISCV_arch: ".*_v1p0_zvamo1p0_zvediv1p0_zvlsseg1p0_zvqmac1p0"
  42. diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c
  43. index bc8c5b5d32..c7ecb7c965 100644
  44. --- a/opcodes/riscv-opc.c
  45. +++ b/opcodes/riscv-opc.c
  46. @@ -2205,12 +2205,19 @@ const struct riscv_ext_version riscv_ext_version_table[] =
  47. {"c", ISA_SPEC_CLASS_20190608, 2, 0},
  48. {"c", ISA_SPEC_CLASS_2P2, 2, 0},
  49. +{"v", ISA_SPEC_CLASS_NONE, 1, 0},
  50. +
  51. {"zicsr", ISA_SPEC_CLASS_20191213, 2, 0},
  52. {"zicsr", ISA_SPEC_CLASS_20190608, 2, 0},
  53. {"zifencei", ISA_SPEC_CLASS_20191213, 2, 0},
  54. {"zifencei", ISA_SPEC_CLASS_20190608, 2, 0},
  55. +{"zvamo", ISA_SPEC_CLASS_NONE, 1, 0},
  56. +{"zvediv", ISA_SPEC_CLASS_NONE, 1, 0},
  57. +{"zvlsseg", ISA_SPEC_CLASS_NONE, 1, 0},
  58. +{"zvqmac", ISA_SPEC_CLASS_NONE, 1, 0},
  59. +
  60. /* Terminate the list. */
  61. {NULL, 0, 0, 0}
  62. };
  63. --
  64. 2.33.0