[Git][cmucl/cmucl][issue-185-x86-shorter-insts] Simplify test using `sign-extend`.
![](https://secure.gravatar.com/avatar/5634a99cd64dd70d4a6692c3031a1284.jpg?s=120&d=mm&r=g)
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/db1e9b11dc19a5c3cedea51c... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/db1e9b11dc19a5c3cedea51c... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)