[MLton-devel] cvs commit: datatype MLton.IntInf.rep
Stephen Weeks
sweeks@users.sourceforge.net
Wed, 02 Jul 2003 16:08:38 -0700
sweeks 03/07/02 16:08:38
Modified: basis-library/integer int-inf.sig int-inf.sml
basis-library/mlton int-inf.sig
doc changelog
lib/mlton-stubs int-inf.sig mlton.sml
Log:
Changed argument type of MLton.IntInf.Small from word to int.
Revision Changes Path
1.9 +2 -2 mlton/basis-library/integer/int-inf.sig
Index: int-inf.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/integer/int-inf.sig,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- int-inf.sig 26 Jun 2003 03:28:19 -0000 1.8
+++ int-inf.sig 2 Jul 2003 23:08:38 -0000 1.9
@@ -24,8 +24,8 @@
val gcd: int * int -> int
val isSmall: int -> bool
datatype rep =
- Small of Word.word
- | Big of Word.word Vector.vector
+ Big of Word.word Vector.vector
+ | Small of Int.int
val rep: int -> rep
val size: int -> Int.int
val toInt64: int -> Int64.int
1.14 +8 -8 mlton/basis-library/integer/int-inf.sml
Index: int-inf.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/integer/int-inf.sml,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- int-inf.sml 26 Jun 2003 03:28:19 -0000 1.13
+++ int-inf.sml 2 Jul 2003 23:08:38 -0000 1.14
@@ -18,8 +18,8 @@
structure Word = Word32
datatype rep =
- Small of Word.word
- | Big of Word.word Vector.vector
+ Big of Word.word Vector.vector
+ | Small of Int.int
structure Prim = Primitive.IntInf
type bigInt = Prim.int
@@ -151,10 +151,10 @@
end
fun rep x =
- if isSmall x then
- Small (stripTag x)
- else
- Big (Prim.toVector x)
+ if isSmall x
+ then Small (Word.toIntX (stripTag x))
+ else Big (Prim.toVector x)
+
(*
* Convert a bigInt to a smallInt, raising overflow if it
* is too big.
@@ -212,7 +212,7 @@
fun bigToInt64 (arg: bigInt): Int64.int =
case rep arg of
- Small w => Int64.fromInt (Word.toIntX w)
+ Small i => Int64.fromInt i
| Big v =>
if Vector.length v > 3
then raise Overflow
@@ -908,7 +908,7 @@
Big v =>
Int.+ (Int.* (bitsPerLimb, Int.- (Vector.length v, 2)),
Word.log2 (Vector.sub (v, Int.- (Vector.length v, 1))))
- | Small w => Word.log2 w
+ | Small i => Word.log2 (Word.fromInt i)
end
(*
1.4 +2 -2 mlton/basis-library/mlton/int-inf.sig
Index: int-inf.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/mlton/int-inf.sig,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- int-inf.sig 14 Jul 2002 17:01:37 -0000 1.3
+++ int-inf.sig 2 Jul 2003 23:08:38 -0000 1.4
@@ -8,8 +8,8 @@
val gcd: int * int -> int
val isSmall: int -> bool
datatype rep =
- Small of word
- | Big of word vector
+ Big of word vector
+ | Small of Int.int
val rep: int -> rep
val size: int -> Int.int
end
1.47 +6 -0 mlton/doc/changelog
Index: changelog
===================================================================
RCS file: /cvsroot/mlton/mlton/doc/changelog,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- changelog 26 Jun 2003 02:35:10 -0000 1.46
+++ changelog 2 Jul 2003 23:08:38 -0000 1.47
@@ -2,6 +2,12 @@
At this point, the only missing basis library function is "use".
+* 2004-07-02
+ - Fixed bug with negative IntInf constants that could cause compile
+ time error message:
+ "x86Translate.translateChunk ... strange Offset: base: ..."
+ - Changed argument type of MLton.IntInf.Small from word to int.
+
* 2003-06-25
- Added {Int{8,16},Word8}{,Array,ArraySlice,Vector,VectorSlice,Array2}
structures.
1.4 +2 -2 mlton/lib/mlton-stubs/int-inf.sig
Index: int-inf.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/lib/mlton-stubs/int-inf.sig,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- int-inf.sig 6 Aug 2002 03:19:19 -0000 1.3
+++ int-inf.sig 2 Jul 2003 23:08:38 -0000 1.4
@@ -8,8 +8,8 @@
val gcd: int * int -> int
val isSmall: int -> bool
datatype rep =
- Small of word
- | Big of word vector
+ Big of word vector
+ | Small of Int.int
val rep: int -> rep
val size: int -> Int.int
end
1.20 +2 -2 mlton/lib/mlton-stubs/mlton.sml
Index: mlton.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/lib/mlton-stubs/mlton.sml,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- mlton.sml 20 May 2003 17:06:01 -0000 1.19
+++ mlton.sml 2 Jul 2003 23:08:38 -0000 1.20
@@ -124,8 +124,8 @@
open IntInf
datatype rep =
- Small of Word.word
- | Big of Word.word Vector.vector
+ Big of Word.word Vector.vector
+ | Small of Int.int
val areSmall =
fn _ => raise Fail "MLton.IntInf.areSmall unimplemented"
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel