diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-14 22:52:06 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-14 22:52:06 +0800 |
| commit | 87c3f4ec276cd0b699b72603bb2745b6040ff7f9 (patch) | |
| tree | fe845b65633d4b3ca7a1f7d06937745d9c386969 /backend/include | |
| parent | b85a348ab7bdd878fd975121fc2501625eceec95 (diff) | |
| download | rcc-project-87c3f4ec276cd0b699b72603bb2745b6040ff7f9.tar.gz rcc-project-87c3f4ec276cd0b699b72603bb2745b6040ff7f9.tar.xz | |
[GlobalISel] Legalize G_ABDS and G_ABDU
Diffstat (limited to 'backend/include')
| -rw-r--r-- | backend/include/rcc/CodeGen/GlobalISel/LegalizerHelper.h | 2 | ||||
| -rw-r--r-- | backend/include/rcc/CodeGen/GlobalISel/LegalizerInfo.h | 4 | ||||
| -rw-r--r-- | backend/include/rcc/Target/RISCV/RISCVSubtarget.h | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/backend/include/rcc/CodeGen/GlobalISel/LegalizerHelper.h b/backend/include/rcc/CodeGen/GlobalISel/LegalizerHelper.h index 07ee8bb..0fdc89f 100644 --- a/backend/include/rcc/CodeGen/GlobalISel/LegalizerHelper.h +++ b/backend/include/rcc/CodeGen/GlobalISel/LegalizerHelper.h @@ -29,6 +29,8 @@ public: [[nodiscard]] Expected<void> lower(MachineInstr &Instruction, const LegalizationDecision &Decision); [[nodiscard]] Expected<void> lowerAbsToAddXor(MachineInstr &Instruction); + [[nodiscard]] Expected<void> lowerAbsDiffToSelect(MachineInstr &Instruction); + [[nodiscard]] Expected<void> lowerAbsDiffToMinMax(MachineInstr &Instruction); [[nodiscard]] Expected<void> lowerVAArg(MachineInstr &Instruction); [[nodiscard]] Expected<void> widenScalar(MachineInstr &Instruction, std::size_t TypeIndex, LowLevelType WideType); diff --git a/backend/include/rcc/CodeGen/GlobalISel/LegalizerInfo.h b/backend/include/rcc/CodeGen/GlobalISel/LegalizerInfo.h index 2981f8e..5deefd4 100644 --- a/backend/include/rcc/CodeGen/GlobalISel/LegalizerInfo.h +++ b/backend/include/rcc/CodeGen/GlobalISel/LegalizerInfo.h @@ -184,6 +184,10 @@ public: [[nodiscard]] virtual GenericOpcode getExtOpcodeForWideningConstant(LowLevelType SmallType) const; + [[nodiscard]] virtual bool isSExtCheaperThanZExt(LowLevelType, LowLevelType) const { + return false; + } + // This hook performs read-only target checks before a lowering mutation is committed. [[nodiscard]] virtual Expected<void> validateLowering(const MachineInstr &, const MachineFunction &, diff --git a/backend/include/rcc/Target/RISCV/RISCVSubtarget.h b/backend/include/rcc/Target/RISCV/RISCVSubtarget.h index 9594a34..34ed4bd 100644 --- a/backend/include/rcc/Target/RISCV/RISCVSubtarget.h +++ b/backend/include/rcc/Target/RISCV/RISCVSubtarget.h @@ -27,6 +27,7 @@ enum class RISCVExtension : std::uint8_t { F, D, C, + Zbb, Zicsr, Zifencei, Zacas, |
