master: Remove clc instructions that do nothing

snuglas via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  ca8de03628b2eab4f1190f1b01e87575c0ce74c8 (commit)
      from  8b6a050b4664d2c6b8242ae185ac77a81e8b0c06 (commit)

- Log -----------------------------------------------------------------
commit ca8de03628b2eab4f1190f1b01e87575c0ce74c8
Author: Douglas Katzman <[email protected]>
Date:   Fri Aug 28 18:51:29 2026 -0400

    Remove clc instructions that do nothing
    
    Assembly routines for generic +,-,* are not tail-callable so they
    do not need to adhere to the Lisp function return convention.
---
 src/assembly/x86-64/arith.lisp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/assembly/x86-64/arith.lisp b/src/assembly/x86-64/arith.lisp
index f41bc8fa6..cbdeb4a38 100644
--- a/src/assembly/x86-64/arith.lisp
+++ b/src/assembly/x86-64/arith.lisp
@@ -60,7 +60,6 @@
                 (inst jmp :nz DO-STATIC-FUN)    ; no - do generic
 
                 ,@body
-                (inst clc) ; single-value return
                 (inst ret)
 
                 DO-STATIC-FUN
@@ -70,7 +69,7 @@
     (move res x)
     (inst add res y)
     (inst jmp :o BIGNUM)
-    (inst clc) (inst ret)
+    (inst ret)
     BIGNUM
     ;; Unbox the overflowed result, recovering the correct sign from
     ;; the carry flag, then re-box as a bignum.
@@ -83,7 +82,7 @@
     (move res x)
     (inst sub res y)
     (inst jmp :o BIGNUM)
-    (inst clc) (inst ret)
+    (inst ret)
     BIGNUM
     ;; Unbox the overflowed result, recovering the correct sign from
     ;; the carry flag, then re-box as a bignum.
@@ -99,7 +98,7 @@
     (inst imul y)                    ; result in edx:eax
     (inst jmp :o BIGNUM)
     (move res rax)
-    (inst clc) (inst ret)
+    (inst ret)
 
     BIGNUM
     (inst shrd rax rdx-tn n-fixnum-tag-bits) ; high bits from edx
@@ -113,7 +112,7 @@
     (emit-alloc-other nil thread-tn bignum-widetag (+ bignum-digits-offset 2) res)
     (storew rax res bignum-digits-offset other-pointer-lowtag)
     (storew rcx res (1+ bignum-digits-offset) other-pointer-lowtag)
-    (inst clc) (inst ret)
+    (inst ret)
 
     SINGLE-WORD-BIGNUM
     (return-single-word-bignum res res rax)))
@@ -138,7 +137,7 @@
                                     (+ (ash code-constants-offset word-shift)
                                        (- other-pointer-lowtag)))
                         rip-tn))
-  (inst clc) (inst ret)
+  (inst ret)
   GENERIC
   (tail-call-lisp-fun '%negate 1))
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.