diff options
author | Andy Wingo <wingo@pobox.com> | 2023-06-22 09:16:26 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2023-06-22 16:01:44 +0200 |
commit | 2534326e5e0a32d26041799b9f72070cb53ff8ac (patch) | |
tree | 0d2f5b3b1487e28b50eb5fca504d9c5592a71f78 | |
parent | e7e625b7731c29f1777dd670381ef374588c26d0 (diff) | |
download | guile-2534326e5e0a32d26041799b9f72070cb53ff8ac.tar.gz |
Add CSE auxiliary definitions for cons, set-car! etc
* module/language/cps/cse.scm (eliminate-common-subexpressions-in-fun):
Add cons, set-car!, etc.
-rw-r--r-- | module/language/cps/cse.scm | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/module/language/cps/cse.scm b/module/language/cps/cse.scm index 3c67a043a..d06f918f4 100644 --- a/module/language/cps/cse.scm +++ b/module/language/cps/cse.scm @@ -1,6 +1,6 @@ ;;; Continuation-passing style (CPS) intermediate language (IL) -;; Copyright (C) 2013-2021 Free Software Foundation, Inc. +;; Copyright (C) 2013-2021, 2023 Free Software Foundation, Inc. ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -518,6 +518,21 @@ for a label, it isn't known to be constant at that label." ((word-set!/immediate p s x) (x <- word-ref/immediate p s)) ((pointer-set!/immediate p s x) (x <- pointer-ref/immediate p s)) + ((p <- cons #f x y) (x <- car #f p) + (y <- cdr #f p)) + ((set-car! #f p x) (x <- car #f p)) + ((set-cdr! #f p y) (y <- cdr #f p)) + + ((b <- box #f x) (x <- box-ref #f b)) + ((box-set! #f b x) (x <- box-ref #f b)) + + ((v <- allocate-vector #f n) (n <- vector-length #f v)) + ((vector-set!/immediate p v x) (x <- vector-ref/immediate p v)) + ((vector-set! #f v i x) (x <- vector-ref #f v i)) + + ((s <- allocate-struct n v) (v <- struct-vtable #f s)) + ((struct-set! p s x) (x <- struct-ref p s)) + ((u <- scm->f64 #f s) (s <- f64->scm #f u)) ((s <- f64->scm #f u) (u <- scm->f64 #f s)) ((u <- scm->u64 #f s) (s <- u64->scm #f u)) |