From 3a5533dc442ae8f5e90abf152f89cfd813f2b6b8 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 22 Jul 2018 11:34:29 -0500 Subject: [PATCH] layouts: Add 32bit? and 64bit? words. --- basis/compiler/tree/cleanup/cleanup-tests.factor | 2 +- basis/compiler/tree/propagation/propagation-tests.factor | 2 +- core/layouts/layouts.factor | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/basis/compiler/tree/cleanup/cleanup-tests.factor b/basis/compiler/tree/cleanup/cleanup-tests.factor index 53a4ce8fda..1e6f85f92e 100644 --- a/basis/compiler/tree/cleanup/cleanup-tests.factor +++ b/basis/compiler/tree/cleanup/cleanup-tests.factor @@ -225,7 +225,7 @@ M: float detect-float ; { shift fixnum-shift } inlined? ] unit-test -cell-bits 32 = [ +32bit? [ [ t ] [ [ { fixnum fixnum } declare 1 swap 31 bitand shift ] \ shift inlined? diff --git a/basis/compiler/tree/propagation/propagation-tests.factor b/basis/compiler/tree/propagation/propagation-tests.factor index a63364f10e..37460dffc0 100644 --- a/basis/compiler/tree/propagation/propagation-tests.factor +++ b/basis/compiler/tree/propagation/propagation-tests.factor @@ -492,7 +492,7 @@ IN: compiler.tree.propagation.tests [ { fixnum } declare 1 swap 7 bitand >bignum shift ] final-classes ] unit-test -cell-bits 32 = [ +32bit? [ [ V{ integer } ] [ [ { fixnum } declare 1 swap 31 bitand shift ] final-classes diff --git a/core/layouts/layouts.factor b/core/layouts/layouts.factor index 9f5b7b95ba..f72bb3bcd4 100644 --- a/core/layouts/layouts.factor +++ b/core/layouts/layouts.factor @@ -48,6 +48,10 @@ SYMBOL: header-bits : cell-bits ( -- n ) 8 cells ; inline +: 32bit? ( -- ? ) cell-bits 32 = ; inline + +: 64bit? ( -- ? ) cell-bits 64 = ; inline + : bootstrap-cell ( -- n ) \ cell get cell or ; inline : bootstrap-cells ( m -- n ) bootstrap-cell * ; inline