0008-RISCV-Add-support-for-bcompress.patch 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. From 4046c346a88fd00f032e7ef6766a3fd0431e6c1a Mon Sep 17 00:00:00 2001
  2. From: LevyHsu <admin@levyhsu.com>
  3. Date: Tue, 8 Jun 2021 17:09:36 +0800
  4. Subject: [PATCH 08/28] [RISCV] Add support for bcompress
  5. Add coding for bcompress:
  6. #define MATCH_BCOMPRESS 0x8006033
  7. #define MASK_BCOMPRESS 0xfe00707f
  8. #define MATCH_BCOMPRESSW 0x4800603b
  9. #define MASK_BCOMPRESSW 0xfe00707f
  10. ---
  11. include/opcode/riscv-opc.h | 6 ++++++
  12. opcodes/riscv-opc.c | 2 ++
  13. 2 files changed, 8 insertions(+)
  14. diff --git a/include/opcode/riscv-opc.h b/include/opcode/riscv-opc.h
  15. index fc08a3be7e..8a25e90f65 100644
  16. --- a/include/opcode/riscv-opc.h
  17. +++ b/include/opcode/riscv-opc.h
  18. @@ -535,6 +535,8 @@
  19. #define MASK_UNSHFL 0xfe00707f
  20. #define MATCH_UNSHFLI 0x8005013
  21. #define MASK_UNSHFLI 0xfc00707f
  22. +#define MATCH_BCOMPRESS 0x8006033
  23. +#define MASK_BCOMPRESS 0xfe00707f
  24. #define MATCH_BDECOMPRESS 0x48006033
  25. #define MASK_BDECOMPRESS 0xfe00707f
  26. #define MATCH_SEXT_B 0x60401013
  27. @@ -663,6 +665,8 @@
  28. #define MASK_SHFLW 0xfe00707f
  29. #define MATCH_UNSHFLW 0x800503b
  30. #define MASK_UNSHFLW 0xfe00707f
  31. +#define MATCH_BCOMPRESSW 0x4800603b
  32. +#define MASK_BCOMPRESSW 0xfe00707f
  33. #define MATCH_BDECOMPRESSW 0x4800603b
  34. #define MASK_BDECOMPRESSW 0xfe00707f
  35. #define MATCH_BFPW 0x4800703b
  36. @@ -3264,6 +3268,7 @@ DECLARE_INSN(bset, MATCH_BSET, MASK_BSET)
  37. DECLARE_INSN(bclr, MATCH_BCLR, MASK_BCLR)
  38. DECLARE_INSN(binv, MATCH_BINV, MASK_BINV)
  39. DECLARE_INSN(bext, MATCH_BEXT, MASK_BEXT)
  40. +DECLARE_INSN(bcompress, MATCH_BCOMPRESS, MASK_BCOMPRESS)
  41. DECLARE_INSN(bdecompress, MATCH_BDECOMPRESS, MASK_BDECOMPRESS)
  42. DECLARE_INSN(bseti, MATCH_BSETI, MASK_BSETI)
  43. DECLARE_INSN(bclri, MATCH_BCLRI, MASK_BCLRI)
  44. @@ -3273,6 +3278,7 @@ DECLARE_INSN(bsetw, MATCH_BSETW, MASK_BSETW)
  45. DECLARE_INSN(bclrw, MATCH_BCLRW, MASK_BCLRW)
  46. DECLARE_INSN(binvw, MATCH_BINVW, MASK_BINVW)
  47. DECLARE_INSN(bextw, MATCH_BEXTW, MASK_BEXTW)
  48. +DECLARE_INSN(bcompressw, MATCH_BCOMPRESSW, MASK_BCOMPRESSW)
  49. DECLARE_INSN(bdecompressw, MATCH_BDECOMPRESSW, MASK_BDECOMPRESSW)
  50. DECLARE_INSN(bsetiw, MATCH_BSETIW, MASK_BSETIW)
  51. DECLARE_INSN(bclriw, MATCH_BCLRIW, MASK_BCLRIW)
  52. diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c
  53. index 5783c79df9..ab2f80d00f 100644
  54. --- a/opcodes/riscv-opc.c
  55. +++ b/opcodes/riscv-opc.c
  56. @@ -1497,6 +1497,7 @@ const struct riscv_opcode riscv_opcodes[] =
  57. {"bclr", 0, INSN_CLASS_ZBS, "d,s,t", MATCH_BCLR, MASK_BCLR, match_opcode, 0 },
  58. {"binv", 0, INSN_CLASS_ZBS, "d,s,t", MATCH_BINV, MASK_BINV, match_opcode, 0 },
  59. {"bext", 0, INSN_CLASS_ZBS_OR_ZBE, "d,s,t", MATCH_BEXT, MASK_BEXT, match_opcode, 0 },
  60. +{"bcompress",0, INSN_CLASS_ZBE, "d,s,t", MATCH_BCOMPRESS, MASK_BCOMPRESS, match_opcode, 0 },
  61. {"bdecompress",0, INSN_CLASS_ZBE, "d,s,t", MATCH_BDECOMPRESS, MASK_BDECOMPRESS, match_opcode, 0 },
  62. {"bseti", 0, INSN_CLASS_ZBS, "d,s,>", MATCH_BSETI, MASK_BSETI, match_opcode, 0 },
  63. {"bclri", 0, INSN_CLASS_ZBS, "d,s,>", MATCH_BCLRI, MASK_BCLRI, match_opcode, 0 },
  64. @@ -1506,6 +1507,7 @@ const struct riscv_opcode riscv_opcodes[] =
  65. {"bclrw", 64, INSN_CLASS_ZBS, "d,s,t", MATCH_BCLRW, MASK_BCLRW, match_opcode, 0 },
  66. {"binvw", 64, INSN_CLASS_ZBS, "d,s,t", MATCH_BINVW, MASK_BINVW, match_opcode, 0 },
  67. {"bextw", 64, INSN_CLASS_ZBS_OR_ZBE, "d,s,t", MATCH_BEXTW, MASK_BEXTW, match_opcode, 0 },
  68. +{"bcompressw",64, INSN_CLASS_ZBE, "d,s,<", MATCH_BCOMPRESSW, MASK_BCOMPRESSW, match_opcode, 0 },
  69. {"bdecompressw",64, INSN_CLASS_ZBE, "d,s,<", MATCH_BDECOMPRESSW, MASK_BDECOMPRESSW, match_opcode, 0 },
  70. {"bsetiw", 64, INSN_CLASS_ZBS, "d,s,<", MATCH_BSETIW, MASK_BSETIW, match_opcode, 0 },
  71. {"bclriw", 64, INSN_CLASS_ZBS, "d,s,<", MATCH_BCLRIW, MASK_BCLRIW, match_opcode, 0 },
  72. --
  73. 2.33.0