cpu.architecture: rep-length now works in deployed images

db4
Slava Pestov 2010-02-11 18:11:47 +13:00
parent 57ba1aff60
commit a3b74d88c9
2 changed files with 13 additions and 3 deletions

View File

@ -554,9 +554,6 @@ M: ulonglong-2-rep rep-component-type drop ulonglong ;
M: float-4-rep rep-component-type drop float ;
M: double-2-rep rep-component-type drop double ;
: rep-length ( rep -- n )
16 swap rep-component-type heap-size /i ; foldable
: (unsigned-interval) ( bytes -- from to ) [ 0 ] dip 8 * 2^ 1 - ; foldable
: unsigned-interval ( c-type -- from to ) heap-size (unsigned-interval) ; foldable
: (signed-interval) ( bytes -- from to ) 8 * 1 - 2^ [ neg ] [ 1 - ] bi ; foldable

View File

@ -169,6 +169,19 @@ M: uint-scalar-rep rep-size drop 4 ;
M: longlong-scalar-rep rep-size drop 8 ;
M: ulonglong-scalar-rep rep-size drop 8 ;
GENERIC: rep-length ( rep -- n ) foldable
M: char-16-rep rep-length drop 16 ;
M: uchar-16-rep rep-length drop 16 ;
M: short-8-rep rep-length drop 8 ;
M: ushort-8-rep rep-length drop 8 ;
M: int-4-rep rep-length drop 4 ;
M: uint-4-rep rep-length drop 4 ;
M: longlong-2-rep rep-length drop 2 ;
M: ulonglong-2-rep rep-length drop 2 ;
M: float-4-rep rep-length drop 4 ;
M: double-2-rep rep-length drop 2 ;
GENERIC: rep-component-type ( rep -- n )
! Methods defined in alien.c-types