diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-16 20:29:40 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-16 20:29:40 +0800 |
| commit | 4d285efa781e2ceb4a65f7b4b06015a8ea86bb8c (patch) | |
| tree | 168ba972481b6734e255eabaa3800cdd01ef992e /backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc | |
| parent | e89ef1cdf4186e20469043167079dc95f14ce666 (diff) | |
| download | rcc-project-4d285efa781e2ceb4a65f7b4b06015a8ea86bb8c.tar.gz rcc-project-4d285efa781e2ceb4a65f7b4b06015a8ea86bb8c.tar.xz | |
[RISCV][GlobalISel] Generate copy sign selections
Diffstat (limited to 'backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc')
| -rw-r--r-- | backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc b/backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc index ff8c613..bcf12c0 100644 --- a/backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc +++ b/backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc @@ -280,6 +280,132 @@ selection_rules: root: true operands: [{ operand: 0 }, { operand: 1 }, { operand: 1 }] - + id: select_g_fcopysign_s32_fneg + priority: 200 + match: + opcode: G_FCOPYSIGN + result_type: { kind: scalar, bits: 32 } + operand_types: + - { index: 1, kind: scalar, bits: 32 } + - { index: 2, kind: scalar, bits: 32 } + operand_banks: + - { index: 0, bank: FPR } + - { index: 1, bank: FPR } + - { index: 2, bank: FPR } + def_use: + - operand: 2 + opcode: G_FNEG + captures: + - { id: sign, operand: 1 } + apply: + instructions: + - opcode: FSGNJN_S + root: true + operands: [{ operand: 0 }, { operand: 1 }, { captured_operand: sign }] + erase_operand_definitions: [2] + - + id: select_g_fcopysign_s64_fneg + priority: 200 + match: + opcode: G_FCOPYSIGN + 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: FPR } + - { index: 1, bank: FPR } + - { index: 2, bank: FPR } + def_use: + - operand: 2 + opcode: G_FNEG + captures: + - { id: sign, operand: 1 } + apply: + instructions: + - opcode: FSGNJN_D + root: true + operands: [{ operand: 0 }, { operand: 1 }, { captured_operand: sign }] + erase_operand_definitions: [2] + - + id: select_g_fcopysign_s32_s32 + priority: 100 + match: + opcode: G_FCOPYSIGN + result_type: { kind: scalar, bits: 32 } + operand_types: + - { index: 1, kind: scalar, bits: 32 } + - { index: 2, kind: scalar, bits: 32 } + operand_banks: + - { index: 0, bank: FPR } + - { index: 1, bank: FPR } + - { index: 2, bank: FPR } + apply: + instructions: + - opcode: FSGNJ_S + root: true + operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }] + - + id: select_g_fcopysign_s64_s64 + priority: 100 + match: + opcode: G_FCOPYSIGN + 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: FPR } + - { index: 1, bank: FPR } + - { index: 2, bank: FPR } + apply: + instructions: + - opcode: FSGNJ_D + root: true + operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }] + - + id: select_g_fcopysign_s32_s64 + priority: 100 + match: + opcode: G_FCOPYSIGN + result_type: { kind: scalar, bits: 32 } + operand_types: + - { index: 1, kind: scalar, bits: 32 } + - { index: 2, kind: scalar, bits: 64 } + operand_banks: + - { index: 0, bank: FPR } + - { index: 1, bank: FPR } + - { index: 2, bank: FPR } + apply: + instructions: + - opcode: FSGNJ_S + root: true + operands: + - { operand: 0 } + - { operand: 1 } + - { complex: fcopysign_to_s32, operand: 2 } + - + id: select_g_fcopysign_s64_s32 + priority: 100 + match: + opcode: G_FCOPYSIGN + result_type: { kind: scalar, bits: 64 } + operand_types: + - { index: 1, kind: scalar, bits: 64 } + - { index: 2, kind: scalar, bits: 32 } + operand_banks: + - { index: 0, bank: FPR } + - { index: 1, bank: FPR } + - { index: 2, bank: FPR } + apply: + instructions: + - opcode: FSGNJ_D + root: true + operands: + - { operand: 0 } + - { operand: 1 } + - { complex: fcopysign_to_s64, operand: 2 } + - id: select_g_fminnum_s32 priority: 100 match: |
