diff options
-rw-r--r-- | module/language/tree-il/compile-cps.scm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/module/language/tree-il/compile-cps.scm b/module/language/tree-il/compile-cps.scm index e1cf8c297..ea5be8aa8 100644 --- a/module/language/tree-il/compile-cps.scm +++ b/module/language/tree-il/compile-cps.scm @@ -2385,9 +2385,13 @@ integer." ;; if type folding can't prove Y to be an exact integer, then DCE ;; would have to leave it in the program for its possible ;; effects. - (($ <primcall> src 'logand (x ($ <primcall> _ 'lognot (y)))) + (($ <primcall> src 'lognot (x)) + (make-primcall src 'logxor (list x (make-const src -1)))) + (($ <primcall> src 'logand + (x ($ <primcall> _ 'logxor (y ($ <const> _ -1))))) (make-primcall src 'logsub (list x y))) - (($ <primcall> src 'logand (($ <primcall> _ 'lognot (y)) x)) + (($ <primcall> src 'logand + (($ <primcall> _ 'logxor (y ($ <const> _ -1))) x)) (make-primcall src 'logsub (list x y))) (($ <primcall> src 'throw ()) |