From e89ef1cdf4186e20469043167079dc95f14ce666 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sun, 16 Aug 2026 20:23:21 +0800 Subject: [RISCV][GlobalISel] Generate high multiply selections --- backend/lib/Target/RISCV/RISCVGISelInteger.rccdesc | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'backend/lib/Target/RISCV/RISCVGISelInteger.rccdesc') diff --git a/backend/lib/Target/RISCV/RISCVGISelInteger.rccdesc b/backend/lib/Target/RISCV/RISCVGISelInteger.rccdesc index 0413007..e096993 100644 --- a/backend/lib/Target/RISCV/RISCVGISelInteger.rccdesc +++ b/backend/lib/Target/RISCV/RISCVGISelInteger.rccdesc @@ -217,6 +217,42 @@ selection_rules: - opcode: MUL root: true operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }] + - + id: select_g_smulh_register + priority: 100 + match: + opcode: G_SMULH + 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: + instructions: + - opcode: MULH + root: true + operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }] + - + id: select_g_umulh_register + priority: 100 + match: + opcode: G_UMULH + 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: + instructions: + - opcode: MULHU + root: true + operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }] - id: select_g_sdiv_register priority: 100 -- cgit v1.2.3