diff options
-rw-r--r-- | src/ChangeLog | 9 | ||||
-rw-r--r-- | src/algebra/Makefile.in | 3 | ||||
-rw-r--r-- | src/algebra/Makefile.pamphlet | 3 | ||||
-rw-r--r-- | src/algebra/data.spad.pamphlet | 24 | ||||
-rw-r--r-- | src/boot/ast.boot | 12 | ||||
-rw-r--r-- | src/interp/compiler.boot | 16 | ||||
-rw-r--r-- | src/interp/sys-constants.boot | 1 |
7 files changed, 59 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 790deb0c..ff7e5a96 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2009-03-26 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * boot/ast.boot (nativeType): Accept int16 and int32. + (getFFIDatatype): Accept ReadWrite modifier. + * algebra/data.spad.pamphlet (Int32): New. + (UInt64): Likewise. + * algebra/Makefile.pamphlet (axiom_algebra_layer_7): Include INT64 + and UINT64. + 2009-03-25 Gabriel Dos Reis <gdr@cs.tamu.edu> * clef/edible.c (main): Properly null-terminate varargs call. diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in index b42c5f9f..d50d9098 100644 --- a/src/algebra/Makefile.in +++ b/src/algebra/Makefile.in @@ -378,7 +378,8 @@ axiom_algebra_layer_6_objects = \ axiom_algebra_layer_7 = \ BTCAT BTCAT- LNAGG LNAGG- FMCAT IDPOAM \ IFAMON GRALG GRALG- FLAGG FLAGG- \ - INT8 INT16 INT32 UINT8 UINT16 UINT32 + INT8 INT16 INT32 INT64 UINT8 UINT16 \ + UINT32 UINT64 axiom_algebra_layer_7_nrlibs = \ $(addsuffix .NRLIB/code.$(FASLEXT),$(axiom_algebra_layer_7)) diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet index 85249ac1..42aa4dd1 100644 --- a/src/algebra/Makefile.pamphlet +++ b/src/algebra/Makefile.pamphlet @@ -410,7 +410,8 @@ axiom_algebra_layer_6_objects = \ axiom_algebra_layer_7 = \ BTCAT BTCAT- LNAGG LNAGG- FMCAT IDPOAM \ IFAMON GRALG GRALG- FLAGG FLAGG- \ - INT8 INT16 INT32 UINT8 UINT16 UINT32 + INT8 INT16 INT32 INT64 UINT8 UINT16 \ + UINT32 UINT64 axiom_algebra_layer_7_nrlibs = \ $(addsuffix .NRLIB/code.$(FASLEXT),$(axiom_algebra_layer_7)) diff --git a/src/algebra/data.spad.pamphlet b/src/algebra/data.spad.pamphlet index eb69372a..2760df04 100644 --- a/src/algebra/data.spad.pamphlet +++ b/src/algebra/data.spad.pamphlet @@ -140,6 +140,18 @@ Int32() == SystemInteger 32 @ +<<domain INT64 Int64>>= +)abbrev domain INT64 Int64 +++ Author: Gabriel Dos Reis +++ Date Created: March 25, 2009 +++ Date Last Modified: March 25, 2009 +++ Description: +++ This domain is a datatype for (signed) integer values +++ of precision 64 bits. +Int64() == SystemInteger 64 + +@ + <<domain SYSNNI SystemNonNegativeInteger>>= )abbrev domain SYSNNI SystemNonNegativeInteger @@ -208,6 +220,18 @@ UInt32() == SystemNonNegativeInteger 32 @ +<<domain UINT64 UInt64>>= +)abbrev domain UINT64 UInt64 +++ Author: Gabriel Dos Reis +++ Date Created: March 25, 2009 +++ Date Last Modified: March 25, 2009 +++ Description: +++ This domain is a datatype for (unsigned) integer values +++ of precision 64 bits. +UInt64() == SystemNonNegativeInteger 64 + +@ + \section{The ByteBuffer domain} diff --git a/src/boot/ast.boot b/src/boot/ast.boot index 819f79d4..9b9feac5 100644 --- a/src/boot/ast.boot +++ b/src/boot/ast.boot @@ -1256,7 +1256,7 @@ genTypeAlias(head,body) == -- part of the data being transmitted. $NativeSimpleDataTypes == - '(char byte int float double) + '(char byte int int16 int32 float double) $NativeSimpleReturnTypes == [:$NativeSimpleDataTypes,:'(void string)] @@ -1297,6 +1297,14 @@ nativeType t == %hasFeature KEYWORD::ECL => KEYWORD::UNSIGNED_-BYTE -- approximate by 'char' for GCL nativeType "char" + t = "int16" => + %hasFeature KEYWORD::SBCL => [bfColonColon("SB-ALIEN","UNSIGNED"),16] + %hasFeature KEYWORD::CLISP => bfColonColon("FFI","INT16") + unknownNativeTypeError t + t = "int32" => + %hasFeature KEYWORD::SBCL => [bfColonColon("SB-ALIEN","UNSIGNED"),32] + %hasFeature KEYWORD::CLISP => bfColonColon("FFI","INT32") + unknownNativeTypeError t unknownNativeTypeError t -- composite, reference type. first t = "buffer" => @@ -1339,7 +1347,7 @@ nativeArgumentType t == ++ True if objects of type native type `t' are sensible to GC. needsStableReference? t == - not atom t and first t in '(readonly writeonly readwrite) + t is [m,:.] and m in '(readonly writeonly readwrite) ++ coerce argument `a' to native type `t', in preparation for ++ a call to a native functions. diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index 399e6a5e..f567db1f 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -1271,25 +1271,31 @@ bootDenotation s == getBasicFFIType: %Mode -> %Symbol getBasicFFIType t == t = $Byte => bootDenotation "byte" + t = $Int16 => bootDenotation "int16" t = $Int32 => bootDenotation "int32" - t = $Int64 => bootDenotation "int64" +-- t = $Int64 => bootDenotation "int64" t = $SingleInteger => bootDenotation "int" t = $SingleFloat => bootDenotation "float" t = $DoubleFloat => bootDenotation "double" t = $String => bootDenotation "string" nil + +++ List of admissible type modifiers in an FFI import declaration. +$FFITypeModifier == '(ReadOnly WriteOnly ReadWrite) + ++ Return the Boot denotation of an FFI datatype. This is either ++ a basic VM type, or a simple array of sized integer or floating ++ point type. getFFIDatatype: %Mode -> %Form getFFIDatatype t == x := getBasicFFIType t => x - t is [m,["PrimitiveArray",t']] and m in '(ReadOnly WriteOnly) and - member(t',[$Byte,$Int32,$Int64,$SingleFloat,$DoubleFloat]) => + t is [m,["PrimitiveArray",t']] and m in $FFITypeModifier and + member(t',[$Byte,$Int16,$Int32,$SingleFloat,$DoubleFloat]) => m' := m = "ReadOnly" => bootDenotation "readonly" - bootDenotation "writeonly" + m = "WriteOnly" => bootDenotation "writeonly" + bootDenotation "readwrite" [m',[bootDenotation "buffer",getBasicFFIType t']] nil @@ -1342,7 +1348,7 @@ checkExternalEntity(id,type,lang,e) == ++ Remove possible modifiers in the FFI type expression `t'. removeModifiers t == for (ts := [x,:.]) in tails t repeat - x is [m,t'] and m in '(ReadOnly WriteOnly) => + x is [m,t'] and m in $FFITypeModifier => rplac(first ts,t') t diff --git a/src/interp/sys-constants.boot b/src/interp/sys-constants.boot index 1277504e..51bdfea0 100644 --- a/src/interp/sys-constants.boot +++ b/src/interp/sys-constants.boot @@ -364,6 +364,7 @@ $Boolean == '(Boolean) $Byte == '(Byte) +$Int16 == '(Int16) $Int32 == '(Int32) $Int64 == '(Int64) |