1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00

Add type checkers for lsh/immediate and rsh/immediate

* module/language/cps/types.scm (lsh/immediate, rsh/immediate): New type
  checkers.
This commit is contained in:
Andy Wingo 2020-02-12 15:57:12 +01:00
parent a706b7e465
commit 7dc90a17e0

View file

@ -1,5 +1,5 @@
;;; Type analysis on CPS
;;; Copyright (C) 2014-2019 Free Software Foundation, Inc.
;;; Copyright (C) 2014-2020 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 License as
@ -1383,6 +1383,7 @@ minimum, and maximum."
(&min/0 count)
(&max/u64 count))))
(define-exact-integer! result min max)))
(define-simple-type-checker (lsh/immediate &exact-integer))
(define-type-inferrer/param (lsh/immediate count val result)
(restrict! val &exact-integer -inf.0 +inf.0)
(let-values (((min max) (compute-ash-range (&min val)
@ -1396,6 +1397,7 @@ minimum, and maximum."
(- (&min/0 count))
(- (&max/u64 count)))))
(define-exact-integer! result min max)))
(define-simple-type-checker (rsh/immediate &exact-integer))
(define-type-inferrer/param (rsh/immediate count val result)
(restrict! val &exact-integer -inf.0 +inf.0)
(let-values (((min max) (compute-ash-range (&min val)