summaryrefslogtreecommitdiff
path: root/module/system/base
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2017-11-11 21:10:28 +0100
committerAndy Wingo <wingo@pobox.com>2017-11-11 22:08:14 +0100
commitb331ea319355e3a5eb626abc736b6fa540a516ed (patch)
tree6f1c7a3b02edc1d7aaab7cf0839f9a361c978e0d /module/system/base
parenta268c02fa0c7e93c390cc7adf0bfbf422e92ea29 (diff)
downloadguile-b331ea319355e3a5eb626abc736b6fa540a516ed.tar.gz
Convert "ash" to "lsh"/"rsh" when lowering to CPS
* module/language/cps/effects-analysis.scm: Remove case for "ash". * module/language/cps/types.scm (ash): Remove. * module/language/tree-il/compile-cps.scm (convert, canonicalize): Convert "ash" to "lsh"/"rsh" early on. * module/system/base/target.scm (target-fixnum?): New procedure.
Diffstat (limited to 'module/system/base')
-rw-r--r--module/system/base/target.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/module/system/base/target.scm b/module/system/base/target.scm
index 7c6e0aca0..95ab8d8c9 100644
--- a/module/system/base/target.scm
+++ b/module/system/base/target.scm
@@ -33,7 +33,8 @@
target-max-vector-length
target-most-negative-fixnum
- target-most-positive-fixnum))
+ target-most-positive-fixnum
+ target-fixnum?))
@@ -179,3 +180,9 @@ target platform."
"Return the most positive integer representable as a fixnum on the
target platform."
(1- (ash 1 (- (* (target-word-size) 8) 3))))
+
+(define (target-fixnum? n)
+ (and (exact-integer? n)
+ (<= (target-most-negative-fixnum)
+ n
+ (target-most-positive-fixnum))))