layouts: Add 32bit? and 64bit? words.

handle-patch-and-put
Doug Coleman 2018-07-22 11:34:29 -05:00
parent 2b4d2a4a13
commit 3a5533dc44
3 changed files with 6 additions and 2 deletions

View File

@ -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?

View File

@ -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

View File

@ -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