diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-19 03:19:40 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-19 03:19:40 +0800 |
| commit | 69e1baa931dfa63838683378fa20ed9c46c68a70 (patch) | |
| tree | d8ae9222ed52c3036b30371241bd593e0324ce6c /backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc | |
| parent | c0f2700e0c7effc5da267bf501232ff4bfea63bc (diff) | |
| download | rcc-project-69e1baa931dfa63838683378fa20ed9c46c68a70.tar.gz rcc-project-69e1baa931dfa63838683378fa20ed9c46c68a70.tar.xz | |
[RISCV][GlobalISel] Match floating comparisons
Diffstat (limited to 'backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc')
| -rw-r--r-- | backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc b/backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc index 18046b5..a5d9107 100644 --- a/backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc +++ b/backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc @@ -1,5 +1,119 @@ selection_rules: - + id: select_g_fcmp_oeq_s32 + priority: 100 + match: + opcode: G_FCMP + result_type: { kind: scalar, bits: 64 } + floating_predicate: { index: 1, value: oeq } + operand_types: + - { index: 2, kind: scalar, bits: 32 } + - { index: 3, kind: scalar, bits: 32 } + operand_banks: + - { index: 0, bank: GPR } + - { index: 2, bank: FPR } + - { index: 3, bank: FPR } + apply: + instructions: + - opcode: FEQ_S + root: true + operands: [{ operand: 0 }, { operand: 2 }, { operand: 3 }] + - + id: select_g_fcmp_olt_s32 + priority: 100 + match: + opcode: G_FCMP + result_type: { kind: scalar, bits: 64 } + floating_predicate: { index: 1, value: olt } + operand_types: + - { index: 2, kind: scalar, bits: 32 } + - { index: 3, kind: scalar, bits: 32 } + operand_banks: + - { index: 0, bank: GPR } + - { index: 2, bank: FPR } + - { index: 3, bank: FPR } + apply: + instructions: + - opcode: FLT_S + root: true + operands: [{ operand: 0 }, { operand: 2 }, { operand: 3 }] + - + id: select_g_fcmp_ole_s32 + priority: 100 + match: + opcode: G_FCMP + result_type: { kind: scalar, bits: 64 } + floating_predicate: { index: 1, value: ole } + operand_types: + - { index: 2, kind: scalar, bits: 32 } + - { index: 3, kind: scalar, bits: 32 } + operand_banks: + - { index: 0, bank: GPR } + - { index: 2, bank: FPR } + - { index: 3, bank: FPR } + apply: + instructions: + - opcode: FLE_S + root: true + operands: [{ operand: 0 }, { operand: 2 }, { operand: 3 }] + - + id: select_g_fcmp_oeq_s64 + priority: 100 + match: + opcode: G_FCMP + result_type: { kind: scalar, bits: 64 } + floating_predicate: { index: 1, value: oeq } + operand_types: + - { index: 2, kind: scalar, bits: 64 } + - { index: 3, kind: scalar, bits: 64 } + operand_banks: + - { index: 0, bank: GPR } + - { index: 2, bank: FPR } + - { index: 3, bank: FPR } + apply: + instructions: + - opcode: FEQ_D + root: true + operands: [{ operand: 0 }, { operand: 2 }, { operand: 3 }] + - + id: select_g_fcmp_olt_s64 + priority: 100 + match: + opcode: G_FCMP + result_type: { kind: scalar, bits: 64 } + floating_predicate: { index: 1, value: olt } + operand_types: + - { index: 2, kind: scalar, bits: 64 } + - { index: 3, kind: scalar, bits: 64 } + operand_banks: + - { index: 0, bank: GPR } + - { index: 2, bank: FPR } + - { index: 3, bank: FPR } + apply: + instructions: + - opcode: FLT_D + root: true + operands: [{ operand: 0 }, { operand: 2 }, { operand: 3 }] + - + id: select_g_fcmp_ole_s64 + priority: 100 + match: + opcode: G_FCMP + result_type: { kind: scalar, bits: 64 } + floating_predicate: { index: 1, value: ole } + operand_types: + - { index: 2, kind: scalar, bits: 64 } + - { index: 3, kind: scalar, bits: 64 } + operand_banks: + - { index: 0, bank: GPR } + - { index: 2, bank: FPR } + - { index: 3, bank: FPR } + apply: + instructions: + - opcode: FLE_D + root: true + operands: [{ operand: 0 }, { operand: 2 }, { operand: 3 }] + - id: select_g_fadd_s32 priority: 100 match: |
