diff --git a/basis/alien/c-types/c-types.factor b/basis/alien/c-types/c-types.factor index 4ff599e0d1..e2f15f5de8 100644 --- a/basis/alien/c-types/c-types.factor +++ b/basis/alien/c-types/c-types.factor @@ -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 diff --git a/basis/cpu/architecture/architecture.factor b/basis/cpu/architecture/architecture.factor index 734241a5d3..4d99b5a0ed 100644 --- a/basis/cpu/architecture/architecture.factor +++ b/basis/cpu/architecture/architecture.factor @@ -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