diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-16 01:24:48 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-16 01:24:48 +0800 |
| commit | 9388ff494a554e1f5d529be3636f9e1596fbf035 (patch) | |
| tree | 11091166469e71b10eb098171b0e7c1f97159f92 /backend/lib/Target | |
| parent | 5a91301bb6f7ba5b3bd8d383f21831962a68e670 (diff) | |
| download | rcc-project-9388ff494a554e1f5d529be3636f9e1596fbf035.tar.gz rcc-project-9388ff494a554e1f5d529be3636f9e1596fbf035.tar.xz | |
[RISCV][GlobalISel] Select word division pseudos
Diffstat (limited to 'backend/lib/Target')
| -rw-r--r-- | backend/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/backend/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp b/backend/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp index 854b6a5..1d7aec2 100644 --- a/backend/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp +++ b/backend/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp @@ -185,7 +185,10 @@ public: const TargetDescription &Target) const override { if (Instruction.opcode() == instructionOpcode(InstructionOpcode::G_SLLW) || Instruction.opcode() == instructionOpcode(InstructionOpcode::G_SRAW) || - Instruction.opcode() == instructionOpcode(InstructionOpcode::G_SRLW)) { + Instruction.opcode() == instructionOpcode(InstructionOpcode::G_SRLW) || + Instruction.opcode() == instructionOpcode(InstructionOpcode::G_DIVW) || + Instruction.opcode() == instructionOpcode(InstructionOpcode::G_DIVUW) || + Instruction.opcode() == instructionOpcode(InstructionOpcode::G_REMUW)) { const std::optional<LowLevelType> Type = resultType(Function, Instruction); const std::optional<LowLevelType> Left = operandType(Function, Instruction, 1); const std::optional<LowLevelType> Right = operandType(Function, Instruction, 2); @@ -349,6 +352,12 @@ public: return Instruction.setOpcode(instructionOpcode(InstructionOpcode::SRAW)); if (Instruction.opcode() == instructionOpcode(InstructionOpcode::G_SRLW)) return Instruction.setOpcode(instructionOpcode(InstructionOpcode::SRLW)); + if (Instruction.opcode() == instructionOpcode(InstructionOpcode::G_DIVW)) + return Instruction.setOpcode(instructionOpcode(InstructionOpcode::DIVW)); + if (Instruction.opcode() == instructionOpcode(InstructionOpcode::G_DIVUW)) + return Instruction.setOpcode(instructionOpcode(InstructionOpcode::DIVUW)); + if (Instruction.opcode() == instructionOpcode(InstructionOpcode::G_REMUW)) + return Instruction.setOpcode(instructionOpcode(InstructionOpcode::REMUW)); const GenericOpcode Generic = static_cast<GenericOpcode>(Instruction.opcode().value()); const std::optional<LowLevelType> Type = resultType(Function, Instruction); |
