[compiler-rt] [compiler-rt] Turn adcs with -1 into sbc with 0 (PR #204868)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 19 10:27:25 PDT 2026


https://github.com/AZero13 created https://github.com/llvm/llvm-project/pull/204868

adcs with -1 is not a valid immediate, but sbc with 0 is.

>From e80af70334cdb9a7f2b8b563d284fabba775b126 Mon Sep 17 00:00:00 2001
From: AZero13 <gfunni234 at gmail.com>
Date: Fri, 19 Jun 2026 13:27:03 -0400
Subject: [PATCH] [compiler-rt] Turn adcs with -1 into sbc with 0

adcs with -1 is not a valid immediate, but sbc with 0 is.
---
 compiler-rt/lib/builtins/arm/adddf3.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/compiler-rt/lib/builtins/arm/adddf3.S b/compiler-rt/lib/builtins/arm/adddf3.S
index 8c1a53a4d1bc1..34169490c21b3 100644
--- a/compiler-rt/lib/builtins/arm/adddf3.S
+++ b/compiler-rt/lib/builtins/arm/adddf3.S
@@ -769,7 +769,8 @@ LOCAL_LABEL(sub_bigshift):
   // yh was a negative number and we arithmetically shifted it right, the value
   // we add to xh is 0xFFFFFFFF rather than 0, as if we'd sign-extended that
   // negative number to 64 bits.
-  adcs    xh, xh, #-1
+  // Which is the same as sbc with 0
+  sbcs    xh, xh, #0
 
   // As in the small-shift case above, if this has left a positive value in
   // xh:xl, it means the exponent hasn't changed, so we can go to the easy



More information about the llvm-commits mailing list