[Git][cmucl/cmucl][issue-185-x86-shorter-insts] Simplify test using `sign-extend`.

Raymond Toy (@rtoy) gitlab at common-lisp.net
Wed Apr 26 22:59:57 UTC 2023



Raymond Toy pushed to branch issue-185-x86-shorter-insts at cmucl / cmucl


Commits:
db1e9b11 by Carl S. Shapiro at 2023-04-26T22:59:49+00:00
Simplify test using `sign-extend`.
- - - - -


1 changed file:

- src/compiler/x86/insts.lisp


Changes:

=====================================
src/compiler/x86/insts.lisp
=====================================
@@ -1274,12 +1274,7 @@
 				 #b00000100
 				 #b00000101)))
 	     (emit-sized-immediate segment size src))
-	    ((and (not (eq size :byte))
-		  (or (<= -128 src 127)
-		      ;; Check that the top 25 bits are all ones so
-		      ;; that sign-extending an 8-bit value produces
-		      ;; the desired 32-bit value.
-		      (= (ldb (byte 25 7) src) #x1ffffff)))
+	    ((and (not (eq size :byte)) (<= -128 (sign-extend src 32) 127))
 	     (emit-byte segment #b10000011)
 	     (emit-ea segment dst opcode allow-constants)
 	     (emit-byte segment (ldb (byte 8 0) src)))



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/db1e9b11dc19a5c3cedea51c517ab51c1d5ad32e

-- 
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/db1e9b11dc19a5c3cedea51c517ab51c1d5ad32e
You're receiving this email because of your account on gitlab.common-lisp.net.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20230426/a192c09b/attachment.html>


More information about the cmucl-cvs mailing list