1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-30 15:00:21 +02:00

Add CSE auxiliary definitions for cons, set-car! etc

* module/language/cps/cse.scm (eliminate-common-subexpressions-in-fun):
Add cons, set-car!, etc.
This commit is contained in:
Andy Wingo 2023-06-22 09:16:26 +02:00
parent e7e625b773
commit 2534326e5e

View file

@ -1,6 +1,6 @@
;;; Continuation-passing style (CPS) intermediate language (IL) ;;; 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 ;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public ;;;; 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)) ((word-set!/immediate p s x) (x <- word-ref/immediate p s))
((pointer-set!/immediate p s x) (x <- pointer-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)) ((u <- scm->f64 #f s) (s <- f64->scm #f u))
((s <- f64->scm #f u) (u <- scm->f64 #f s)) ((s <- f64->scm #f u) (u <- scm->f64 #f s))
((u <- scm->u64 #f s) (s <- u64->scm #f u)) ((u <- scm->u64 #f s) (s <- u64->scm #f u))