aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/Target/RISCV/RISCVGISel.rccdesc
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-16 15:39:45 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-16 15:39:45 +0800
commit4f7b41c3c711d6c6fa4e422f3eec8961c91eea7a (patch)
treea825927a4a3ef91ec6e3489aa1f96e63788ff476 /backend/lib/Target/RISCV/RISCVGISel.rccdesc
parenta39d8f6f4ed2ad0f8435b73bd6b2a35769c6fead (diff)
downloadrcc-project-4f7b41c3c711d6c6fa4e422f3eec8961c91eea7a.tar.gz
rcc-project-4f7b41c3c711d6c6fa4e422f3eec8961c91eea7a.tar.xz
tablegen: Generate GlobalISel match tables
Diffstat (limited to 'backend/lib/Target/RISCV/RISCVGISel.rccdesc')
-rw-r--r--backend/lib/Target/RISCV/RISCVGISel.rccdesc157
1 files changed, 157 insertions, 0 deletions
diff --git a/backend/lib/Target/RISCV/RISCVGISel.rccdesc b/backend/lib/Target/RISCV/RISCVGISel.rccdesc
new file mode 100644
index 0000000..97ed3d6
--- /dev/null
+++ b/backend/lib/Target/RISCV/RISCVGISel.rccdesc
@@ -0,0 +1,157 @@
+selection_rules:
+ -
+ id: select_g_sllw
+ priority: 100
+ match:
+ opcode: G_SLLW
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: GPR }
+ - { index: 2, bank: GPR }
+ apply: { opcode: SLLW }
+ -
+ id: select_g_sraw
+ priority: 100
+ match:
+ opcode: G_SRAW
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: GPR }
+ - { index: 2, bank: GPR }
+ apply: { opcode: SRAW }
+ -
+ id: select_g_srlw
+ priority: 100
+ match:
+ opcode: G_SRLW
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: GPR }
+ - { index: 2, bank: GPR }
+ apply: { opcode: SRLW }
+ -
+ id: select_g_divw
+ priority: 100
+ match:
+ opcode: G_DIVW
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: GPR }
+ - { index: 2, bank: GPR }
+ apply: { opcode: DIVW }
+ -
+ id: select_g_divuw
+ priority: 100
+ match:
+ opcode: G_DIVUW
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: GPR }
+ - { index: 2, bank: GPR }
+ apply: { opcode: DIVUW }
+ -
+ id: select_g_remuw
+ priority: 100
+ match:
+ opcode: G_REMUW
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: GPR }
+ - { index: 2, bank: GPR }
+ apply: { opcode: REMUW }
+ -
+ id: select_g_fcvt_w_rv64_s32
+ priority: 100
+ match:
+ opcode: G_FCVT_W_RV64
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: FPR }
+ apply: { opcode: FCVT_W_S }
+ -
+ id: select_g_fcvt_w_rv64_s64
+ priority: 100
+ match:
+ opcode: G_FCVT_W_RV64
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: FPR }
+ apply: { opcode: FCVT_W_D }
+ -
+ id: select_g_fcvt_wu_rv64_s32
+ priority: 100
+ match:
+ opcode: G_FCVT_WU_RV64
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: FPR }
+ apply: { opcode: FCVT_WU_S }
+ -
+ id: select_g_fcvt_wu_rv64_s64
+ priority: 100
+ match:
+ opcode: G_FCVT_WU_RV64
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: FPR }
+ apply: { opcode: FCVT_WU_D }
+ -
+ id: select_g_fclass_s32
+ priority: 100
+ match:
+ opcode: G_FCLASS
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: FPR }
+ apply: { opcode: FCLASS_S }
+ -
+ id: select_g_fclass_s64
+ priority: 100
+ match:
+ opcode: G_FCLASS
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: FPR }
+ apply: { opcode: FCLASS_D }