aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-14 22:52:06 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-14 22:52:06 +0800
commit87c3f4ec276cd0b699b72603bb2745b6040ff7f9 (patch)
treefe845b65633d4b3ca7a1f7d06937745d9c386969 /backend/include/rcc/CodeGen
parentb85a348ab7bdd878fd975121fc2501625eceec95 (diff)
downloadrcc-project-87c3f4ec276cd0b699b72603bb2745b6040ff7f9.tar.gz
rcc-project-87c3f4ec276cd0b699b72603bb2745b6040ff7f9.tar.xz
[GlobalISel] Legalize G_ABDS and G_ABDU
Diffstat (limited to 'backend/include/rcc/CodeGen')
-rw-r--r--backend/include/rcc/CodeGen/GlobalISel/LegalizerHelper.h2
-rw-r--r--backend/include/rcc/CodeGen/GlobalISel/LegalizerInfo.h4
2 files changed, 6 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 &,