You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(56) |
Sep
(40) |
Oct
(30) |
Nov
(144) |
Dec
(23) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(41) |
Feb
(29) |
Mar
(31) |
Apr
(39) |
May
(193) |
Jun
(45) |
Jul
(19) |
Aug
(3) |
Sep
(23) |
Oct
(83) |
Nov
(92) |
Dec
(123) |
| 2007 |
Jan
(90) |
Feb
(267) |
Mar
(120) |
Apr
(51) |
May
(40) |
Jun
(121) |
Jul
(109) |
Aug
(173) |
Sep
(77) |
Oct
(52) |
Nov
(121) |
Dec
(62) |
| 2008 |
Jan
(76) |
Feb
(53) |
Mar
(98) |
Apr
(87) |
May
(26) |
Jun
(27) |
Jul
(23) |
Aug
(136) |
Sep
(79) |
Oct
(68) |
Nov
(29) |
Dec
(14) |
| 2009 |
Jan
(7) |
Feb
(2) |
Mar
(11) |
Apr
(75) |
May
(1) |
Jun
(95) |
Jul
(19) |
Aug
(4) |
Sep
(8) |
Oct
(93) |
Nov
(43) |
Dec
(21) |
| 2010 |
Jan
(20) |
Feb
(23) |
Mar
(18) |
Apr
(6) |
May
(20) |
Jun
(23) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(2) |
Feb
(6) |
Mar
(15) |
Apr
(5) |
May
(9) |
Jun
(14) |
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
(2) |
Jun
(17) |
Jul
(37) |
Aug
|
Sep
(1) |
Oct
(6) |
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
(7) |
Jun
(11) |
Jul
(8) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(7) |
Aug
(2) |
Sep
|
Oct
(5) |
Nov
(2) |
Dec
(4) |
| 2015 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(9) |
Jul
(1) |
Aug
|
Sep
|
Oct
(4) |
Nov
(1) |
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
(1) |
Feb
(3) |
Mar
(3) |
Apr
(7) |
May
(2) |
Jun
(2) |
Jul
(5) |
Aug
(1) |
Sep
(2) |
Oct
(17) |
Nov
(4) |
Dec
(7) |
| 2018 |
Jan
(5) |
Feb
(14) |
Mar
(2) |
Apr
(5) |
May
(2) |
Jun
(5) |
Jul
|
Aug
(2) |
Sep
|
Oct
(3) |
Nov
(5) |
Dec
|
| 2019 |
Jan
(4) |
Feb
(2) |
Mar
(3) |
Apr
(1) |
May
(8) |
Jun
(14) |
Jul
(2) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
(15) |
Dec
(2) |
| 2020 |
Jan
(10) |
Feb
(3) |
Mar
(1) |
Apr
|
May
(9) |
Jun
(4) |
Jul
(16) |
Aug
(10) |
Sep
(4) |
Oct
(3) |
Nov
|
Dec
|
| 2021 |
Jan
(11) |
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(5) |
Sep
|
Oct
(6) |
Nov
(4) |
Dec
(4) |
| 2022 |
Jan
(4) |
Feb
(2) |
Mar
(2) |
Apr
|
May
(6) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(5) |
Jun
(1) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(13) |
Dec
|
| 2024 |
Jan
(1) |
Feb
|
Mar
(5) |
Apr
|
May
(10) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
(14) |
| 2025 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(3) |
Jul
|
Aug
|
Sep
(2) |
Oct
(3) |
Nov
|
Dec
|
|
From: Vesa K. <ve...@ml...> - 2006-10-20 09:48:09
|
Added documentation headers to signatures and reorganized specs.
Added missing extended MONO_VECTOR specs to extended STRING signature.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/array.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/array.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/array.sig 2006-10-20 16:11:14 UTC (rev 4737)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/array.sig 2006-10-20 16:48:08 UTC (rev 4738)
@@ -7,13 +7,19 @@
(**
* Extended {ARRAY} signature.
*)
-
signature ARRAY =
sig
include ARRAY
+
+ (** == Conversions == *)
+
+ val fromVector : 'a vector -> 'a array
+
val toList : 'a array -> 'a list
+ val toVector : 'a array -> 'a vector
+
+ (** == Isomorphisms == *)
+
val listIso : ('a array, 'a list) iso
- val toVector : 'a array -> 'a vector
- val fromVector : 'a vector -> 'a array
val vectorIso : ('a array, 'a vector) iso
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig 2006-10-20 16:11:14 UTC (rev 4737)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig 2006-10-20 16:48:08 UTC (rev 4738)
@@ -11,11 +11,11 @@
sig
include CHAR
- val intIso : (char, Int.int) iso
+ (** == Bounds == *)
+
+ val minOrd : Int.int
(**
- * The isomorphism between characters and character codes. It
- * always equals {(ord, chr)}. Note that the projection part of the
- * isomorphism, namely {chr}, is likely to be a partial function.
+ * The least character code. It always equals {0}.
*)
val boundsChar : char * char
@@ -24,14 +24,18 @@
* {(minChar, maxChar)}.
*)
- val minOrd : Int.int
- (**
- * The least character code. It always equals {0}.
- *)
-
val boundsOrd : Int.int * Int.int
(**
* Pair of the least and greatest character codes. It always equals
* {(minOrd, maxOrd)}.
*)
+
+ (** == Isomorphisms == *)
+
+ val intIso : (char, Int.int) iso
+ (**
+ * The isomorphism between characters and character codes. It
+ * always equals {(ord, chr)}. Note that the projection part of the
+ * isomorphism, namely {chr}, is likely to be a partial function.
+ *)
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig 2006-10-20 16:11:14 UTC (rev 4737)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig 2006-10-20 16:48:08 UTC (rev 4738)
@@ -7,15 +7,26 @@
(**
* Extended {INT_INF} signature.
*)
-
signature INT_INF =
sig
include INT_INF
+
+ (** == Bounds == *)
+
+ val bounds : (int * int) option
+
+ (** == Embeddings == *)
+
+ val stringEmb : (int, string) emb
+
+ (** == Isomorphisms == *)
+
val intIso : (int, Int.int) iso
val largeIso : (int, LargeInt.int) iso
- val stringEmb : (int, string) emb
- val isZero : int -> bool
+
+ (** == Predicates == *)
+
val isEven : int -> bool
val isOdd : int -> bool
- val bounds : (int * int) option
+ val isZero : int -> bool
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig 2006-10-20 16:11:14 UTC (rev 4737)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig 2006-10-20 16:48:08 UTC (rev 4738)
@@ -7,15 +7,26 @@
(**
* Extended {INTEGER} signature.
*)
-
signature INTEGER =
sig
include INTEGER
+
+ (** == Bounds == *)
+
+ val bounds : (int * int) option
+
+ (** == Embeddings == *)
+
+ val stringEmb : (int, string) emb
+
+ (** == Isomorphisms == *)
+
val intIso : (int, Int.int) iso
val largeIso : (int, LargeInt.int) iso
- val stringEmb : (int, string) emb
- val isZero : int -> bool
+
+ (** == Predicates == *)
+
val isEven : int -> bool
val isOdd : int -> bool
- val bounds : (int * int) option
+ val isZero : int -> bool
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig 2006-10-20 16:11:14 UTC (rev 4737)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig 2006-10-20 16:48:08 UTC (rev 4738)
@@ -7,16 +7,22 @@
(**
* Extended {MONO_ARRAY} signature.
*)
-
signature MONO_ARRAY =
sig
include MONO_ARRAY
+
+ (** == Conversions == *)
+
+ val fromPoly : elem Array.array -> array
+ val fromVector : vector -> array
+
val toList : array -> elem list
+ val toPoly : array -> elem Array.array
+ val toVector : array -> vector
+
+ (** == Isomorphisms == *)
+
val listIso : (array, elem list) iso
- val toVector : array -> vector
- val fromVector : vector -> array
+ val polyIso : (array, elem Array.array) iso
val vectorIso : (array, vector) iso
- val toPoly : array -> elem Array.array
- val fromPoly : elem Array.array -> array
- val polyIso : (array, elem Array.array) iso
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig 2006-10-20 16:11:14 UTC (rev 4737)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig 2006-10-20 16:48:08 UTC (rev 4738)
@@ -7,13 +7,19 @@
(**
* Extended {MONO_VECTOR} signature.
*)
-
signature MONO_VECTOR =
sig
include MONO_VECTOR
+
+ (** == Conversions == *)
+
+ val fromPoly : elem Vector.vector -> vector
+
val toList : vector -> elem list
+ val toPoly : vector -> elem Vector.vector
+
+ (** == Isomorphisms *)
+
val listIso : (vector, elem list) iso
- val toPoly : vector -> elem Vector.vector
- val fromPoly : elem Vector.vector -> vector
val polyIso : (vector, elem Vector.vector) iso
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig 2006-10-20 16:11:14 UTC (rev 4737)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig 2006-10-20 16:48:08 UTC (rev 4738)
@@ -7,14 +7,19 @@
(**
* Extended {REAL} signature.
*)
-
signature REAL =
sig
include REAL
+
+ (** == Embeddings == *)
+
val decimalEmb : (real, IEEEReal.decimal_approx) emb
+ val stringEmb : (real, string) emb
+
+ (** == Isomorphisms == *)
+
val intIso : (real, Int.int) iso
+ val largeIntIso : (real, LargeInt.int) iso
val largeIso : (real, LargeReal.real) iso
- val largeIntIso : (real, LargeInt.int) iso
val manExpIso : (real, {man : real, exp : int}) iso
- val stringEmb : (real, string) emb
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig 2006-10-20 16:11:14 UTC (rev 4737)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig 2006-10-20 16:48:08 UTC (rev 4738)
@@ -7,16 +7,23 @@
(**
* Extended {STRING} signature.
*)
-
signature STRING =
sig
include STRING
- val listIso : (string, char list) iso
+
+ (** == Embeddings == *)
+
val cStringEmb : (string, string) emb
val stringEmb : (string, string) emb
+ (** == Isomorphisms == *)
+
+ val listIso : (string, char list) iso
+
+ (** == {MONO_VECTOR} == *)
+
+ type elem = char
type vector = string
- type elem = char
val all : (elem -> bool) -> vector -> bool
val app : (elem -> unit) -> vector -> unit
@@ -29,10 +36,13 @@
val foldr : (elem * 'a -> 'a) -> 'a -> vector -> 'a
val foldri : (int * elem * 'a -> 'a) -> 'a -> vector -> 'a
val fromList : elem list -> vector
+ val fromPoly : elem Vector.vector -> vector
val length : vector -> int
val mapi : (int * elem -> elem) -> vector -> vector
val maxLen : int
+ val polyIso : (vector, elem Vector.vector) iso
val tabulate : int * (int -> elem) -> vector
val toList : vector -> elem list
+ val toPoly : vector -> elem Vector.vector
val update : vector * int * elem -> vector
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig 2006-10-20 16:11:14 UTC (rev 4737)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig 2006-10-20 16:48:08 UTC (rev 4738)
@@ -6,8 +6,10 @@
(**
* Extended {TEXT} signature.
+ *
+ * This signature is just a restament of the {TEXT} signature using the
+ * extended substructure signatures.
*)
-
signature TEXT =
sig
structure Char : CHAR
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sig 2006-10-20 16:11:14 UTC (rev 4737)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sig 2006-10-20 16:48:08 UTC (rev 4738)
@@ -7,10 +7,15 @@
(**
* Extended {VECTOR} signature.
*)
-
signature VECTOR =
sig
include VECTOR
+
+ (** == Conversions == *)
+
+ val toList : 'a vector -> 'a list
+
+ (** == Isomorphisms == *)
+
val listIso : ('a vector, 'a list) iso
- val toList : 'a vector -> 'a list
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig 2006-10-20 16:11:14 UTC (rev 4737)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig 2006-10-20 16:48:08 UTC (rev 4738)
@@ -7,24 +7,39 @@
(**
* Extended {WORD} signature.
*)
-
signature WORD =
sig
include WORD
+
+ (** == Bounds == *)
+
+ val maxWord : word
+ val minWord : word
+
+ val bounds : word * word
+
+ (** == Conversions == *)
+
+ val fromWord : Word.word -> word
val toWord : word -> Word.word
- val fromWord : Word.word -> word
+
+ (** == Embeddings == *)
+
+ val stringEmb : (word, string) emb
+
+ (** == Isomorphisms == *)
+
val intIso : (word, Int.int) iso
val intXIso : (word, Int.int) iso
- val largeIso : (word, LargeWord.word) iso
val largeIntIso : (word, LargeInt.int) iso
val largeIntXIso : (word, LargeInt.int) iso
+ val largeIso : (word, LargeWord.word) iso
val largeXIso : (word, LargeWord.word) iso
val wordIso : (word, Word.word) iso
- val stringEmb : (word, string) emb
- val isZero : word -> bool
+
+ (** == Predicates == *)
+
val isEven : word -> bool
val isOdd : word -> bool
- val minWord : word
- val maxWord : word
- val bounds : word * word
+ val isZero : word -> bool
end
|
|
From: Vesa K. <ve...@ml...> - 2006-10-20 09:11:20
|
Separated array.sig from array.sml and vector.sig from vector.sml.
Exposed real.sig, which was incorrectly hidden.
----------------------------------------------------------------------
A mltonlib/trunk/com/ssh/extended-basis/unstable/array.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb
A mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml
----------------------------------------------------------------------
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/array.sig (from rev 4733, mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml)
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml 2006-10-20 01:51:30 UTC (rev 4733)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/array.sig 2006-10-20 16:11:14 UTC (rev 4737)
@@ -0,0 +1,19 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {ARRAY} signature.
+ *)
+
+signature ARRAY =
+ sig
+ include ARRAY
+ val toList : 'a array -> 'a list
+ val listIso : ('a array, 'a list) iso
+ val toVector : 'a array -> 'a vector
+ val fromVector : 'a vector -> 'a array
+ val vectorIso : ('a array, 'a vector) iso
+ end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml 2006-10-20 15:31:21 UTC (rev 4736)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml 2006-10-20 16:11:14 UTC (rev 4737)
@@ -8,16 +8,6 @@
* Extended {Array :> ARRAY} structure.
*)
-signature ARRAY =
- sig
- include ARRAY
- val toList : 'a array -> 'a list
- val listIso : ('a array, 'a list) iso
- val toVector : 'a array -> 'a vector
- val fromVector : 'a vector -> 'a array
- val vectorIso : ('a array, 'a vector) iso
- end
-
structure Array : ARRAY =
struct
open Array
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb 2006-10-20 15:31:21 UTC (rev 4736)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb 2006-10-20 16:11:14 UTC (rev 4737)
@@ -28,8 +28,8 @@
(* Extended real modules *)
local
mk-real-ext.fun
+ in
real.sig
- in
reals-mlton.sml
end
@@ -41,23 +41,31 @@
words-mlton.sml
end
- (* Extended vector modules *)
+ (* Extended vector module *)
+ vector.sig
+ vector.sml
+
+ (* Extended array module (may depend on vector module) *)
+ array.sig
+ array.sml
+
+ (* Extended mono vector modules *)
local
mk-mono-vector-ext.fun
in
mono-vector.sig
mono-vectors-mlton.sml
- vector.sml
- (* Extended array modules (may depend on vector modules) *)
+ (* Extended mono array modules (may depend on mono vector modules) *)
local
mk-mono-array-ext.fun
in
mono-array.sig
- array.sml
mono-arrays-mlton.sml
- (* Extended text modules (may depend on vector and array modules) *)
+ (* Extended text modules (may depend on mono vector and mono
+ * array modules)
+ *)
local
mk-text-ext.fun
in
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sig (from rev 4733, mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml)
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml 2006-10-20 01:51:30 UTC (rev 4733)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sig 2006-10-20 16:11:14 UTC (rev 4737)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {VECTOR} signature.
+ *)
+
+signature VECTOR =
+ sig
+ include VECTOR
+ val listIso : ('a vector, 'a list) iso
+ val toList : 'a vector -> 'a list
+ end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml 2006-10-20 15:31:21 UTC (rev 4736)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml 2006-10-20 16:11:14 UTC (rev 4737)
@@ -8,13 +8,6 @@
* Extended {Vector :> VECTOR} structure.
*)
-signature VECTOR =
- sig
- include VECTOR
- val listIso : ('a vector, 'a list) iso
- val toList : 'a vector -> 'a list
- end
-
structure Vector : VECTOR =
struct
open Vector
|
|
From: Vesa K. <ve...@ml...> - 2006-10-20 08:31:35
|
Changed to use "header" style.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml 2006-10-20 15:27:21 UTC (rev 4735)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml 2006-10-20 15:31:21 UTC (rev 4736)
@@ -4,9 +4,7 @@
* See the file MLton-LICENSE for details.
*)
-(*
- * Extended {INTEGER} and {INT_INF} modules for MLton.
- *)
+(** == Extended {INTEGER} and {INT_INF} modules for MLton == *)
structure Int : INTEGER = MkIntegerExt (Int)
structure FixedInt : INTEGER = MkIntegerExt (FixedInt)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml 2006-10-20 15:27:21 UTC (rev 4735)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml 2006-10-20 15:31:21 UTC (rev 4736)
@@ -4,9 +4,7 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {MONO_ARRAY} modules for MLton.
- *)
+(** == Extended {MONO_ARRAY} modules for MLton == *)
structure BoolArray : MONO_ARRAY =
MkMonoArrayExt (structure MonoArray = BoolArray
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml 2006-10-20 15:27:21 UTC (rev 4735)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml 2006-10-20 15:31:21 UTC (rev 4736)
@@ -4,9 +4,7 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {MONO_VECTOR} modules for MLton.
- *)
+(** == Extended {MONO_VECTOR} modules for MLton == *)
structure BoolVector : MONO_VECTOR = MkMonoVectorExt (BoolVector)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml 2006-10-20 15:27:21 UTC (rev 4735)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml 2006-10-20 15:31:21 UTC (rev 4736)
@@ -4,9 +4,7 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {REAL} modules for MLton.
- *)
+(** == Extended {REAL} modules for MLton == *)
structure Real : REAL = MkRealExt (Real)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml 2006-10-20 15:27:21 UTC (rev 4735)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml 2006-10-20 15:31:21 UTC (rev 4736)
@@ -4,9 +4,7 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {TEXT} modules for MLton.
- *)
+(** == Extended {TEXT} modules for MLton == *)
structure Text : TEXT = MkTextExt (Text)
structure Char : CHAR = Text.Char
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml 2006-10-20 15:27:21 UTC (rev 4735)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml 2006-10-20 15:31:21 UTC (rev 4736)
@@ -4,9 +4,7 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {WORD} modules for MLton.
- *)
+(** == Extended {WORD} modules for MLton == *)
structure Word : WORD = MkWordExt (Word)
structure LargeWord : WORD = MkWordExt (LargeWord)
|
|
From: Vesa K. <ve...@ml...> - 2006-10-20 08:27:26
|
Documented.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig 2006-10-20 15:25:54 UTC (rev 4734)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig 2006-10-20 15:27:21 UTC (rev 4735)
@@ -7,12 +7,31 @@
(**
* Extended {CHAR} signature.
*)
-
signature CHAR =
sig
include CHAR
+
val intIso : (char, Int.int) iso
+ (**
+ * The isomorphism between characters and character codes. It
+ * always equals {(ord, chr)}. Note that the projection part of the
+ * isomorphism, namely {chr}, is likely to be a partial function.
+ *)
+
+ val boundsChar : char * char
+ (**
+ * Pair of the least and greatest characters. It always equals
+ * {(minChar, maxChar)}.
+ *)
+
val minOrd : Int.int
- val boundsChar : char * char
+ (**
+ * The least character code. It always equals {0}.
+ *)
+
val boundsOrd : Int.int * Int.int
+ (**
+ * Pair of the least and greatest character codes. It always equals
+ * {(minOrd, maxOrd)}.
+ *)
end
|
|
From: Vesa K. <ve...@ml...> - 2006-10-20 08:25:55
|
Elaborated. ---------------------------------------------------------------------- U mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt ---------------------------------------------------------------------- Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt =================================================================== --- mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt 2006-10-20 01:51:30 UTC (rev 4733) +++ mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt 2006-10-20 15:25:54 UTC (rev 4734) @@ -1,4 +1,53 @@ -This library implements a number of minor extensions to the signatures and -structures of the Standard ML Basis Library. The reason for extending the -Basis Library in this way is that the extensions are naturally associated -with specific basis library modules. +Extended Basis Library +---------------------- + + This library implements a number of minor extensions to the signatures + and structures of the Standard ML Basis Library [1]. These extensions + are done in a non-intrusive manner by simply rebinding the signatures + and structures of the basis library. The reason for extending the + basis library in this way is that the extensions are naturally + associated with specific basis library modules. Extensions include + things like isomorphisms and embeddings (pairs of the form (toX, + fromX)), bounds (pairs of the form (minX, maxX)), and simple utility + functions such as isZero, isEven and isOdd. + + The basis library, while certainly not perfect, is a valuable library + and it doesn't make sense to throw it away. There is a book describing + the basis library and people just learning SML are likely to spend time + learning the basis library. It makes sense to build on that knowledge. + + However, maintaining 100% basis library compatibility is unlikely to + lead to an "optimal" design. In particular, here is what the basis + library book [1] says (page 11, start of section 2, emphasis added): + + "We view the signature and structure names used below as being + *reserved*. For an implementation to be conforming, any module it + provides that is named in the SML Basis Library must *exactly* match + the description specified in the Library." + + So, the design of the basis library is supposed to be more or less cast + in stone - at least if you want to claim that you've implemented the + SML Basis Library. However, one can argue that the basis library + contains an organizational framework that goes beyond the exact + signatures and structures specified. For many simple extensions there + is a place in that organizational framework, and while it isn't + technically necessary to extended the basis library, it makes sense to + do so because it can reduce the learning curve and make the entirety + easier to use. + + On the other hand, it probably doesn't make sense to put everything + into such extended basis library. As a rule of thumb, things that + naturally belong (fuzzy, yes) to specific basis library modules and + what those things depend on should go into such an extended basis lib. + Everything else, even if looks like stuff that could be in a basis lib, + but there is no module in *the* basis lib for it, should go into other + libraries. + + +References +---------- + + [1] The Standard ML Basis Library. + Emden R. Gansner and John H. Reppy. + Cambridge University Press, 2004. + ISBN 0521794781. |
|
From: Matthew F. <fl...@ml...> - 2006-10-19 18:51:40
|
Move ".data" directive to data assembly
----------------------------------------------------------------------
U mlton/trunk/mlton/codegen/x86-codegen/x86-generate-transfers.fun
U mlton/trunk/mlton/codegen/x86-codegen/x86-translate.fun
----------------------------------------------------------------------
Modified: mlton/trunk/mlton/codegen/x86-codegen/x86-generate-transfers.fun
===================================================================
--- mlton/trunk/mlton/codegen/x86-codegen/x86-generate-transfers.fun 2006-10-20 01:42:40 UTC (rev 4732)
+++ mlton/trunk/mlton/codegen/x86-codegen/x86-generate-transfers.fun 2006-10-20 01:51:30 UTC (rev 4733)
@@ -1976,7 +1976,7 @@
val assembly =
if List.isEmpty data
then assembly
- else ((Assembly.pseudoop_data())::data)::assembly
+ else data::assembly
in
assembly
end
Modified: mlton/trunk/mlton/codegen/x86-codegen/x86-translate.fun
===================================================================
--- mlton/trunk/mlton/codegen/x86-codegen/x86-translate.fun 2006-10-20 01:42:40 UTC (rev 4732)
+++ mlton/trunk/mlton/codegen/x86-codegen/x86-translate.fun 2006-10-20 01:51:30 UTC (rev 4733)
@@ -806,6 +806,10 @@
val _ = Vector.foreach (blocks, fn Block.T {label, ...} =>
remLive label)
val data = List.concatRev (!data)
+ val data =
+ if List.isEmpty data
+ then []
+ else (Assembly.pseudoop_data())::data
in
x86.Chunk.T {data = data, blocks = x86Blocks}
end
|
|
From: Matthew F. <fl...@ml...> - 2006-10-19 18:42:44
|
MAIL Generate .symbol_stub sections on x86-darwin The MacOS X assembler guide describes how to generate symbol stubs for undefined functions that are called in the module. http://tuvix.apple.com/documentation/DeveloperTools/Reference/Assembler/Assembler.pdf This is untested, since I don't have access to an Intel Mac, but the produced assembly appears to match the spec. I believe that this should accomodate the _import syntax. I don't know if anything special needs to be done on x86-darwin to access a symbol defined in a dynamic library; i.e., the _symbol and _address syntax. I'd be interested to know how gcc compiles: extern int x; void setX(int y) { x = y; } int getX() { return x; } int* getXAddr() { return &x; } ---------------------------------------------------------------------- U mlton/trunk/mlton/codegen/x86-codegen/x86-allocate-registers.fun U mlton/trunk/mlton/codegen/x86-codegen/x86-generate-transfers.fun U mlton/trunk/mlton/codegen/x86-codegen/x86-translate.fun U mlton/trunk/mlton/codegen/x86-codegen/x86-validate.fun U mlton/trunk/mlton/codegen/x86-codegen/x86.fun U mlton/trunk/mlton/codegen/x86-codegen/x86.sig ---------------------------------------------------------------------- Modified: mlton/trunk/mlton/codegen/x86-codegen/x86-allocate-registers.fun =================================================================== --- mlton/trunk/mlton/codegen/x86-codegen/x86-allocate-registers.fun 2006-10-19 14:14:14 UTC (rev 4731) +++ mlton/trunk/mlton/codegen/x86-codegen/x86-allocate-registers.fun 2006-10-20 01:42:40 UTC (rev 4732) @@ -6792,9 +6792,48 @@ {assembly = AppendList.appends [assembly_pre, + AppendList.single (Assembly.instruction instruction), assembly_post], registerAllocation = registerAllocation} end + | HLT + (* Halt; p. 331 *) + => let + val {uses,defs,kills} + = Instruction.uses_defs_kills instruction + val {assembly = assembly_pre, + registerAllocation} + = RA.pre {uses = uses, + defs = defs, + kills = kills, + info = info, + registerAllocation = registerAllocation} + + val instruction + = Instruction.HLT + + val {uses = final_uses, + defs = final_defs, + ...} + = Instruction.uses_defs_kills instruction + + val {assembly = assembly_post, + registerAllocation} + = RA.post {uses = uses, + final_uses = final_uses, + defs = defs, + final_defs = final_defs, + kills = kills, + info = info, + registerAllocation = registerAllocation} + in + {assembly + = AppendList.appends + [assembly_pre, + AppendList.single (Assembly.instruction instruction), + assembly_post], + registerAllocation = registerAllocation} + end | BinAL {oper, src, dst, size} (* Integer binary arithmetic(w/o mult & div)/logic instructions. * Require src/dst operands as follows: Modified: mlton/trunk/mlton/codegen/x86-codegen/x86-generate-transfers.fun =================================================================== --- mlton/trunk/mlton/codegen/x86-codegen/x86-generate-transfers.fun 2006-10-19 14:14:14 UTC (rev 4731) +++ mlton/trunk/mlton/codegen/x86-codegen/x86-generate-transfers.fun 2006-10-20 01:42:40 UTC (rev 4732) @@ -424,6 +424,41 @@ else AppendList.single (Assembly.directive_unreserve {registers = [Register.esp]}) + val (mkCCallLabel, mkSymbolStubs) = + if !Control.targetOS = MLton.Platform.OS.Darwin + then + let + val set: (word * String.t * Label.t) HashSet.t = + HashSet.new {hash = #1} + fun mkCCallLabel name = + let + val hash = String.hash name + in + (#3 o HashSet.lookupOrInsert) + (set, hash, + fn (hash', name', _) => hash = hash' andalso name = name', + fn () => (hash, name, + Label.newString (concat ["L_", name, "_stub"]))) + end + fun mkSymbolStubs () = + HashSet.fold + (set, [], fn ((_, name, label), assembly) => + (Assembly.pseudoop_symbol_stub ()) :: + (Assembly.label label) :: + (Assembly.pseudoop_indirect_symbol (Label.fromString name)) :: + (Assembly.instruction_hlt ()) :: + (Assembly.instruction_hlt ()) :: + (Assembly.instruction_hlt ()) :: + (Assembly.instruction_hlt ()) :: + (Assembly.instruction_hlt ()) :: + assembly) + in + (mkCCallLabel, mkSymbolStubs) + end + else + (fn name => Label.fromString name, + fn () => []) + datatype z = datatype Entry.t datatype z = datatype Transfer.t fun generateAll (gef as GEF {effect,...}) @@ -434,12 +469,9 @@ | SOME (Block.T {entry, profileLabel, statements, transfer}) => let val _ = setLayoutInfo(label, NONE) - (* val isLoopHeader = fn _ => false *) - - fun near label = let val align = @@ -1293,11 +1325,12 @@ case convention of Cdecl => name | Stdcall => concat [name, "@", Int.toString size_args] + val target = mkCCallLabel name in AppendList.fromList [Assembly.directive_ccall (), Assembly.instruction_call - {target = Operand.label (Label.fromString name), + {target = Operand.label target, absolute = false}] end | Indirect => @@ -1931,10 +1964,21 @@ of [] => doit () | block => block::(doit ()))) val assembly = doit () + val symbol_stubs = mkSymbolStubs () val _ = destLayoutInfo () val _ = destProfileLabel () + + val assembly = [Assembly.pseudoop_text ()]::assembly + val assembly = + if List.isEmpty symbol_stubs + then assembly + else symbol_stubs :: assembly + val assembly = + if List.isEmpty data + then assembly + else ((Assembly.pseudoop_data())::data)::assembly in - data::assembly + assembly end val (generateTransfers, generateTransfers_msg) Modified: mlton/trunk/mlton/codegen/x86-codegen/x86-translate.fun =================================================================== --- mlton/trunk/mlton/codegen/x86-codegen/x86-translate.fun 2006-10-19 14:14:14 UTC (rev 4731) +++ mlton/trunk/mlton/codegen/x86-codegen/x86-translate.fun 2006-10-20 01:42:40 UTC (rev 4732) @@ -781,7 +781,6 @@ = let val data = ref [] val addData = fn l => List.push (data, l) - val _ = addData [x86.Assembly.pseudoop_data ()] val {get = live : Label.t -> x86.Operand.t list, set = setLive, rem = remLive, ...} @@ -806,7 +805,6 @@ transInfo = transInfo})) val _ = Vector.foreach (blocks, fn Block.T {label, ...} => remLive label) - val _ = addData [x86.Assembly.pseudoop_text ()] val data = List.concatRev (!data) in x86.Chunk.T {data = data, blocks = x86Blocks} Modified: mlton/trunk/mlton/codegen/x86-codegen/x86-validate.fun =================================================================== --- mlton/trunk/mlton/codegen/x86-codegen/x86-validate.fun 2006-10-19 14:14:14 UTC (rev 4731) +++ mlton/trunk/mlton/codegen/x86-codegen/x86-validate.fun 2006-10-20 01:42:40 UTC (rev 4732) @@ -103,6 +103,7 @@ fun validate {instruction: t} = case instruction of NOP => true + | HLT => true | BinAL {src, dst, size, ...} (* Integer binary arithmetic(w/o mult & div)/logic instructions. * Require src/dst operands as follows: Modified: mlton/trunk/mlton/codegen/x86-codegen/x86.fun =================================================================== --- mlton/trunk/mlton/codegen/x86-codegen/x86.fun 2006-10-19 14:14:14 UTC (rev 4731) +++ mlton/trunk/mlton/codegen/x86-codegen/x86.fun 2006-10-20 01:42:40 UTC (rev 4732) @@ -1717,6 +1717,8 @@ datatype t (* No operation *) = NOP + (* Halt *) + | HLT (* Integer binary arithmetic(w/o mult & div)/logic instructions. *) | BinAL of {oper: binal, @@ -1990,6 +1992,8 @@ in fn NOP => str "nop" + | HLT + => str "hlt" | BinAL {oper, src, dst, size} => bin (binal_layout oper, Size.layout size, @@ -2261,6 +2265,8 @@ val uses_defs_kills = fn NOP => {uses = [], defs = [], kills = []} + | HLT + => {uses = [], defs = [], kills = []} | BinAL {src, dst, ...} => {uses = [src, dst], defs = [dst], kills = []} | pMD {src, dst, ...} @@ -2596,6 +2602,8 @@ val srcs_dsts = fn NOP => {srcs = NONE, dsts = NONE} + | HLT + => {srcs = NONE, dsts = NONE} | BinAL {src, dst, ...} => {srcs = SOME [src, dst], dsts = SOME [dst]} | pMD {src, dst, ...} @@ -2785,6 +2793,8 @@ fun replace replacer = fn NOP => NOP + | HLT + => HLT | BinAL {oper, src, dst, size} => BinAL {oper = oper, src = replacer {use = true, def = false} src, @@ -2989,6 +2999,7 @@ => FBinASP {oper = oper} val nop = fn () => NOP + val hlt = fn () => HLT val binal = BinAL val pmd = pMD val md = MD @@ -3451,6 +3462,7 @@ datatype t = Data | Text + | SymbolStub | Balign of Immediate.t * Immediate.t option * Immediate.t option | P2align of Immediate.t * Immediate.t option * Immediate.t option | Space of Immediate.t * Immediate.t @@ -3459,6 +3471,7 @@ | Long of Immediate.t list | String of string list | Global of Label.t + | IndirectSymbol of Label.t | Local of Label.t | Comm of Label.t * Immediate.t * Immediate.t option @@ -3468,6 +3481,7 @@ in fn Data => str ".data" | Text => str ".text" + | SymbolStub => str ".symbol_stub" | Balign (i,fill,max) => seq [str ".balign ", Immediate.layout i, @@ -3519,6 +3533,9 @@ | Global l => seq [str ".globl ", Label.layout l] + | IndirectSymbol l + => seq [str ".indirect_symbol ", + Label.layout l] | Local l => seq [str ".local ", Label.layout l] @@ -3551,6 +3568,7 @@ in fn Data => Data | Text => Text + | SymbolStub => SymbolStub | Balign (i,fill,max) => Balign (replacerImmediate i, Option.map(fill, replacerImmediate), Option.map(max, replacerImmediate)) @@ -3563,6 +3581,7 @@ | Long ls => Long (List.map(ls, replacerImmediate)) | String ss => String ss | Global l => Global (replacerLabel l) + | IndirectSymbol l => IndirectSymbol (replacerLabel l) | Local l => Local (replacerLabel l) | Comm (l, i, a) => Comm (replacerLabel l, replacerImmediate i, @@ -3571,6 +3590,7 @@ val data = fn () => Data val text = fn () => Text + val symbol_stub = fn () => SymbolStub val balign = Balign val p2align = P2align val space = Space @@ -3579,6 +3599,7 @@ val long = Long val string = String val global = Global + val indirect_symbol = IndirectSymbol val locall = Local val comm = Comm end @@ -3648,6 +3669,7 @@ val pseudoop = PseudoOp val pseudoop_data = PseudoOp o PseudoOp.data val pseudoop_text = PseudoOp o PseudoOp.text + val pseudoop_symbol_stub = PseudoOp o PseudoOp.symbol_stub val pseudoop_balign = PseudoOp o PseudoOp.balign val pseudoop_p2align = PseudoOp o PseudoOp.p2align val pseudoop_space = PseudoOp o PseudoOp.space @@ -3656,11 +3678,13 @@ val pseudoop_long = PseudoOp o PseudoOp.long val pseudoop_string = PseudoOp o PseudoOp.string val pseudoop_global = PseudoOp o PseudoOp.global + val pseudoop_indirect_symbol = PseudoOp o PseudoOp.indirect_symbol val pseudoop_local = PseudoOp o PseudoOp.locall val pseudoop_comm = PseudoOp o PseudoOp.comm val label = Label val instruction = Instruction val instruction_nop = Instruction o Instruction.nop + val instruction_hlt = Instruction o Instruction.hlt val instruction_binal = Instruction o Instruction.binal val instruction_pmd = Instruction o Instruction.pmd val instruction_md = Instruction o Instruction.md Modified: mlton/trunk/mlton/codegen/x86-codegen/x86.sig =================================================================== --- mlton/trunk/mlton/codegen/x86-codegen/x86.sig 2006-10-19 14:14:14 UTC (rev 4731) +++ mlton/trunk/mlton/codegen/x86-codegen/x86.sig 2006-10-20 01:42:40 UTC (rev 4732) @@ -422,7 +422,10 @@ * dst operands are changed by the instruction. *) datatype t + (* No operation *) = NOP + (* Halt *) + | HLT (* Integer binary arithmetic(w/o mult & div)/logic instructions. *) | BinAL of {oper: binal, @@ -814,6 +817,7 @@ datatype t = Data | Text + | SymbolStub | Balign of Immediate.t * Immediate.t option * Immediate.t option | P2align of Immediate.t * Immediate.t option * Immediate.t option | Space of Immediate.t * Immediate.t @@ -822,6 +826,7 @@ | Long of Immediate.t list | String of string list | Global of Label.t + | IndirectSymbol of Label.t | Local of Label.t | Comm of Label.t * Immediate.t * Immediate.t option @@ -829,6 +834,7 @@ val data : unit -> t val text : unit -> t + val symbol_stub : unit -> t val balign : Immediate.t * Immediate.t option * Immediate.t option -> t val p2align : Immediate.t * Immediate.t option * Immediate.t option -> t val space : Immediate.t * Immediate.t -> t @@ -837,6 +843,7 @@ val long : Immediate.t list -> t val string : string list -> t val global : Label.t -> t + val indirect_symbol : Label.t -> t val locall : Label.t -> t val comm : Label.t * Immediate.t * Immediate.t option -> t end @@ -893,6 +900,7 @@ val pseudoop : PseudoOp.t -> t val pseudoop_data : unit -> t val pseudoop_text : unit -> t + val pseudoop_symbol_stub : unit -> t val pseudoop_balign : Immediate.t * Immediate.t option * Immediate.t option ->t val pseudoop_p2align : Immediate.t * Immediate.t option * Immediate.t option -> t val pseudoop_space : Immediate.t * Immediate.t -> t @@ -901,11 +909,13 @@ val pseudoop_long : Immediate.t list -> t val pseudoop_string : string list -> t val pseudoop_global : Label.t -> t + val pseudoop_indirect_symbol : Label.t -> t val pseudoop_local : Label.t -> t val pseudoop_comm : Label.t * Immediate.t * Immediate.t option -> t val label : Label.t -> t val instruction : Instruction.t -> t val instruction_nop : unit -> t + val instruction_hlt : unit -> t val instruction_binal : {oper: Instruction.binal, src: Operand.t, dst: Operand.t, |
|
From: Vesa K. <ve...@ml...> - 2006-10-19 07:14:18
|
Added toPoly, fromPoly, and polyIso specs/values to mono array and mono
vector modules. Note that the array conversions should probably always
make a copy for consistency across compilers, while the vector conversions
could be safely optimized to identity on compilers (like MLton) that make
it possible.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun 2006-10-19 13:52:06 UTC (rev 4730)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun 2006-10-19 14:14:14 UTC (rev 4731)
@@ -20,5 +20,8 @@
fun fromVector v =
tabulate (MonoVector.length v, fn i => MonoVector.sub (v, i))
val vectorIso = (toVector, fromVector)
+ fun toPoly a = Array.tabulate (length a, fn i => sub (a, i))
+ fun fromPoly a = tabulate (Array.length a, fn i => Array.sub (a, i))
+ val polyIso = (toPoly, fromPoly)
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun 2006-10-19 13:52:06 UTC (rev 4730)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun 2006-10-19 14:14:14 UTC (rev 4731)
@@ -13,4 +13,8 @@
open M
fun toList v = foldr op :: [] v
val listIso = (toList, fromList)
+ (* XXX It would be nice to avoid copying in toPoly and fromPoly *)
+ fun toPoly v = Vector.tabulate (length v, fn i => sub (v, i))
+ fun fromPoly v = tabulate (Vector.length v, fn i => Vector.sub (v, i))
+ val polyIso = (toPoly, fromPoly)
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig 2006-10-19 13:52:06 UTC (rev 4730)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig 2006-10-19 14:14:14 UTC (rev 4731)
@@ -16,4 +16,7 @@
val toVector : array -> vector
val fromVector : vector -> array
val vectorIso : (array, vector) iso
+ val toPoly : array -> elem Array.array
+ val fromPoly : elem Array.array -> array
+ val polyIso : (array, elem Array.array) iso
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig 2006-10-19 13:52:06 UTC (rev 4730)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig 2006-10-19 14:14:14 UTC (rev 4731)
@@ -11,6 +11,9 @@
signature MONO_VECTOR =
sig
include MONO_VECTOR
+ val toList : vector -> elem list
val listIso : (vector, elem list) iso
- val toList : vector -> elem list
+ val toPoly : vector -> elem Vector.vector
+ val fromPoly : elem Vector.vector -> vector
+ val polyIso : (vector, elem Vector.vector) iso
end
|
|
From: Vesa K. <ve...@ml...> - 2006-10-19 06:52:09
|
Added Iso/Emb -suffix to iso/emb values as suggested by Stephen Weeks.
Added toVector, fromVector, and vectorIso specs/values to array modules.
Note that ARRAY and MONO_ARRAY already specify a vector value.
Reorganized basis.mlb.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb
U mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml 2006-10-19 13:52:06 UTC (rev 4730)
@@ -11,13 +11,19 @@
signature ARRAY =
sig
include ARRAY
- val list : ('a array, 'a list) iso
val toList : 'a array -> 'a list
+ val listIso : ('a array, 'a list) iso
+ val toVector : 'a array -> 'a vector
+ val fromVector : 'a vector -> 'a array
+ val vectorIso : ('a array, 'a vector) iso
end
structure Array : ARRAY =
struct
open Array
fun toList v = foldr op :: [] v
- val list = (toList, fromList)
+ val listIso = (toList, fromList)
+ val toVector = vector
+ fun fromVector v = tabulate (Vector.length v, fn i => Vector.sub (v, i))
+ val vectorIso = (toVector, fromVector)
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb 2006-10-19 13:52:06 UTC (rev 4730)
@@ -10,38 +10,62 @@
"warnUnused true"
in
$(SML_LIB)/basis/basis.mlb
+
+ (* New {Iso :> ISO} and {Emb :> EMB} modules *)
iso.sml
emb.sml
+
+ (* Extended integer modules *)
local
mk-integer-ext.fun
- mk-mono-array-ext.fun
- mk-mono-vector-ext.fun
- mk-real-ext.fun
- mk-word-ext.fun
-
mk-int-inf-ext.fun
-
- mk-text-ext.fun
in
- char.sig
int-inf.sig
integer.sig
- mono-array.sig
- mono-vector.sig
+ ints-mlton.sml
+ end
+
+ (* Extended real modules *)
+ local
+ mk-real-ext.fun
real.sig
- string.sig
+ in
+ reals-mlton.sml
+ end
+
+ (* Extended word modules *)
+ local
+ mk-word-ext.fun
+ in
word.sig
+ words-mlton.sml
+ end
- text.sig
-
- array.sml
- ints-mlton.sml
- mono-arrays-mlton.sml
+ (* Extended vector modules *)
+ local
+ mk-mono-vector-ext.fun
+ in
+ mono-vector.sig
mono-vectors-mlton.sml
- reals-mlton.sml
vector.sml
- words-mlton.sml
- texts-mlton.sml
+ (* Extended array modules (may depend on vector modules) *)
+ local
+ mk-mono-array-ext.fun
+ in
+ mono-array.sig
+ array.sml
+ mono-arrays-mlton.sml
+
+ (* Extended text modules (may depend on vector and array modules) *)
+ local
+ mk-text-ext.fun
+ in
+ char.sig
+ string.sig
+ text.sig
+ texts-mlton.sml
+ end
+ end
end
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig 2006-10-19 13:52:06 UTC (rev 4730)
@@ -11,7 +11,7 @@
signature CHAR =
sig
include CHAR
- val int : (char, Int.int) iso
+ val intIso : (char, Int.int) iso
val minOrd : Int.int
val boundsChar : char * char
val boundsOrd : Int.int * Int.int
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig 2006-10-19 13:52:06 UTC (rev 4730)
@@ -11,9 +11,9 @@
signature INT_INF =
sig
include INT_INF
- val int : (int, Int.int) iso
- val large : (int, LargeInt.int) iso
- val string : (int, string) emb
+ val intIso : (int, Int.int) iso
+ val largeIso : (int, LargeInt.int) iso
+ val stringEmb : (int, string) emb
val isZero : int -> bool
val isEven : int -> bool
val isOdd : int -> bool
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig 2006-10-19 13:52:06 UTC (rev 4730)
@@ -11,9 +11,9 @@
signature INTEGER =
sig
include INTEGER
- val int : (int, Int.int) iso
- val large : (int, LargeInt.int) iso
- val string : (int, string) emb
+ val intIso : (int, Int.int) iso
+ val largeIso : (int, LargeInt.int) iso
+ val stringEmb : (int, string) emb
val isZero : int -> bool
val isEven : int -> bool
val isOdd : int -> bool
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun 2006-10-19 13:52:06 UTC (rev 4730)
@@ -11,9 +11,9 @@
functor MkIntegerExt (I : INTEGER) =
struct
open I
- val int = (toInt, fromInt)
- val large = (toLarge, fromLarge)
- val string = (toString, fromString)
+ val intIso = (toInt, fromInt)
+ val largeIso = (toLarge, fromLarge)
+ val stringEmb = (toString, fromString)
fun isZero i = fromInt 0 = i
fun isEven i = isZero (rem (i, fromInt 2))
val isOdd = not o isEven
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun 2006-10-19 13:52:06 UTC (rev 4730)
@@ -8,9 +8,17 @@
* Functor for extending {MONO_ARRAY} modules.
*)
-functor MkMonoArrayExt (M : MONO_ARRAY) =
+functor MkMonoArrayExt (structure MonoVector : MONO_VECTOR
+ structure MonoArray : MONO_ARRAY
+ where type elem = MonoVector.elem
+ where type vector = MonoVector.vector) =
struct
- open M
- fun toList v = foldr op :: [] v
- val list = (toList, fromList)
+ open MonoArray
+ fun toList a = foldr op :: [] a
+ val listIso = (toList, fromList)
+ val toVector = vector
+ fun fromVector v =
+ tabulate (MonoVector.length v, fn i => MonoVector.sub (v, i))
+ val vectorIso = (toVector, fromVector)
end
+
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun 2006-10-19 13:52:06 UTC (rev 4730)
@@ -12,5 +12,5 @@
struct
open M
fun toList v = foldr op :: [] v
- val list = (toList, fromList)
+ val listIso = (toList, fromList)
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun 2006-10-19 13:52:06 UTC (rev 4730)
@@ -11,10 +11,10 @@
functor MkRealExt (R : REAL) =
struct
open R
- val decimal = (toDecimal, fromDecimal)
- val int = (toInt IEEEReal.TO_NEAREST, fromInt)
- val large = (toLarge, fromLarge IEEEReal.TO_NEAREST)
- val largeInt = (toLargeInt IEEEReal.TO_NEAREST, fromLargeInt)
- val manExp = (toManExp, fromManExp)
- val string = (toString, fromString)
+ val decimalEmb = (toDecimal, fromDecimal)
+ val intIso = (toInt IEEEReal.TO_NEAREST, fromInt)
+ val largeIso = (toLarge, fromLarge IEEEReal.TO_NEAREST)
+ val largeIntIso = (toLargeInt IEEEReal.TO_NEAREST, fromLargeInt)
+ val manExpIso = (toManExp, fromManExp)
+ val stringEmb = (toString, fromString)
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun 2006-10-19 13:52:06 UTC (rev 4730)
@@ -15,20 +15,22 @@
structure Char =
struct
open Char
- val int = (ord, chr)
+ val intIso = (ord, chr)
val minOrd = 0
val boundsChar = (minChar, maxChar)
val boundsOrd = (minOrd, maxOrd)
end
- structure CharArray = MkMonoArrayExt (CharArray)
structure CharVector = MkMonoVectorExt (CharVector)
+ structure CharArray =
+ MkMonoArrayExt (structure MonoArray = CharArray
+ structure MonoVector = CharVector)
structure String =
struct
open CharVector String
- val list = (explode, implode)
- val cString = (toCString, fromCString)
- val string = (toString, fromString)
+ val listIso = (explode, implode)
+ val cStringEmb = (toCString, fromCString)
+ val stringEmb = (toString, fromString)
end
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun 2006-10-19 13:52:06 UTC (rev 4730)
@@ -13,14 +13,14 @@
open W
val toWord = Word.fromLarge o toLarge
val fromWord = fromLarge o Word.toLarge
- val int = (toInt, fromInt)
- val intX = (toIntX, fromInt)
- val large = (toLarge, fromLarge)
- val largeInt = (toLargeInt, fromLargeInt)
- val largeIntX = (toLargeIntX, fromLargeInt)
- val largeX = (toLargeX, fromLarge)
- val word = (toWord, fromWord)
- val string = (toString, fromString)
+ val intIso = (toInt, fromInt)
+ val intXIso = (toIntX, fromInt)
+ val largeIso = (toLarge, fromLarge)
+ val largeIntIso = (toLargeInt, fromLargeInt)
+ val largeIntXIso = (toLargeIntX, fromLargeInt)
+ val largeXIso = (toLargeX, fromLarge)
+ val wordIso = (toWord, fromWord)
+ val stringEmb = (toString, fromString)
fun isZero w = fromInt 0 = w
fun isEven w = isZero (andb (fromInt 1, w))
val isOdd = not o isEven
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig 2006-10-19 13:52:06 UTC (rev 4730)
@@ -11,6 +11,9 @@
signature MONO_ARRAY =
sig
include MONO_ARRAY
- val list : (array, elem list) iso
val toList : array -> elem list
+ val listIso : (array, elem list) iso
+ val toVector : array -> vector
+ val fromVector : vector -> array
+ val vectorIso : (array, vector) iso
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml 2006-10-19 13:52:06 UTC (rev 4730)
@@ -8,23 +8,57 @@
* Extended {MONO_ARRAY} modules for MLton.
*)
-structure BoolArray : MONO_ARRAY = MkMonoArrayExt (BoolArray)
+structure BoolArray : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = BoolArray
+ structure MonoVector = BoolVector)
-structure IntArray : MONO_ARRAY = MkMonoArrayExt (IntArray)
-structure LargeIntArray : MONO_ARRAY = MkMonoArrayExt (LargeIntArray)
-structure Int8Array : MONO_ARRAY = MkMonoArrayExt (Int8Array)
-structure Int16Array : MONO_ARRAY = MkMonoArrayExt (Int16Array)
-structure Int32Array : MONO_ARRAY = MkMonoArrayExt (Int32Array)
-structure Int64Array : MONO_ARRAY = MkMonoArrayExt (Int64Array)
+structure IntArray : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = IntArray
+ structure MonoVector = IntVector)
+structure LargeIntArray : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = LargeIntArray
+ structure MonoVector = LargeIntVector)
+structure Int8Array : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = Int8Array
+ structure MonoVector = Int8Vector)
+structure Int16Array : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = Int16Array
+ structure MonoVector = Int16Vector)
+structure Int32Array : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = Int32Array
+ structure MonoVector = Int32Vector)
+structure Int64Array : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = Int64Array
+ structure MonoVector = Int64Vector)
-structure RealArray : MONO_ARRAY = MkMonoArrayExt (RealArray)
-structure LargeRealArray : MONO_ARRAY = MkMonoArrayExt (LargeRealArray)
-structure Real32Array : MONO_ARRAY = MkMonoArrayExt (Real32Array)
-structure Real64Array : MONO_ARRAY = MkMonoArrayExt (Real64Array)
+structure RealArray : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = RealArray
+ structure MonoVector = RealVector)
+structure LargeRealArray : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = LargeRealArray
+ structure MonoVector = LargeRealVector)
+structure Real32Array : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = Real32Array
+ structure MonoVector = Real32Vector)
+structure Real64Array : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = Real64Array
+ structure MonoVector = Real64Vector)
-structure WordArray : MONO_ARRAY = MkMonoArrayExt (WordArray)
-structure LargeWordArray : MONO_ARRAY = MkMonoArrayExt (LargeWordArray)
-structure Word8Array : MONO_ARRAY = MkMonoArrayExt (Word8Array)
-structure Word16Array : MONO_ARRAY = MkMonoArrayExt (Word16Array)
-structure Word32Array : MONO_ARRAY = MkMonoArrayExt (Word32Array)
-structure Word64Array : MONO_ARRAY = MkMonoArrayExt (Word64Array)
+structure WordArray : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = WordArray
+ structure MonoVector = WordVector)
+structure LargeWordArray : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = LargeWordArray
+ structure MonoVector = LargeWordVector)
+structure Word8Array : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = Word8Array
+ structure MonoVector = Word8Vector)
+structure Word16Array : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = Word16Array
+ structure MonoVector = Word16Vector)
+structure Word32Array : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = Word32Array
+ structure MonoVector = Word32Vector)
+structure Word64Array : MONO_ARRAY =
+ MkMonoArrayExt (structure MonoArray = Word64Array
+ structure MonoVector = Word64Vector)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig 2006-10-19 13:52:06 UTC (rev 4730)
@@ -11,6 +11,6 @@
signature MONO_VECTOR =
sig
include MONO_VECTOR
- val list : (vector, elem list) iso
+ val listIso : (vector, elem list) iso
val toList : vector -> elem list
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig 2006-10-19 13:52:06 UTC (rev 4730)
@@ -11,10 +11,10 @@
signature REAL =
sig
include REAL
- val decimal : (real, IEEEReal.decimal_approx) emb
- val int : (real, Int.int) iso
- val large : (real, LargeReal.real) iso
- val largeInt : (real, LargeInt.int) iso
- val manExp : (real, {man : real, exp : int}) iso
- val string : (real, string) emb
+ val decimalEmb : (real, IEEEReal.decimal_approx) emb
+ val intIso : (real, Int.int) iso
+ val largeIso : (real, LargeReal.real) iso
+ val largeIntIso : (real, LargeInt.int) iso
+ val manExpIso : (real, {man : real, exp : int}) iso
+ val stringEmb : (real, string) emb
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig 2006-10-19 13:52:06 UTC (rev 4730)
@@ -11,9 +11,9 @@
signature STRING =
sig
include STRING
- val list : (string, char list) iso
- val cString : (string, string) emb
- val string : (string, string) emb
+ val listIso : (string, char list) iso
+ val cStringEmb : (string, string) emb
+ val stringEmb : (string, string) emb
type vector = string
type elem = char
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml 2006-10-19 13:52:06 UTC (rev 4730)
@@ -11,7 +11,7 @@
signature VECTOR =
sig
include VECTOR
- val list : ('a vector, 'a list) iso
+ val listIso : ('a vector, 'a list) iso
val toList : 'a vector -> 'a list
end
@@ -19,5 +19,5 @@
struct
open Vector
fun toList v = foldr op :: [] v
- val list = (toList, fromList)
+ val listIso = (toList, fromList)
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig 2006-10-19 09:31:43 UTC (rev 4729)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig 2006-10-19 13:52:06 UTC (rev 4730)
@@ -13,14 +13,14 @@
include WORD
val toWord : word -> Word.word
val fromWord : Word.word -> word
- val int : (word, Int.int) iso
- val intX : (word, Int.int) iso
- val large : (word, LargeWord.word) iso
- val largeInt : (word, LargeInt.int) iso
- val largeIntX : (word, LargeInt.int) iso
- val largeX : (word, LargeWord.word) iso
- val word : (word, Word.word) iso
- val string : (word, string) emb
+ val intIso : (word, Int.int) iso
+ val intXIso : (word, Int.int) iso
+ val largeIso : (word, LargeWord.word) iso
+ val largeIntIso : (word, LargeInt.int) iso
+ val largeIntXIso : (word, LargeInt.int) iso
+ val largeXIso : (word, LargeWord.word) iso
+ val wordIso : (word, Word.word) iso
+ val stringEmb : (word, string) emb
val isZero : word -> bool
val isEven : word -> bool
val isOdd : word -> bool
|
|
From: Vesa K. <ve...@ml...> - 2006-10-19 02:32:04
|
Renamed is0 to isZero as it is probably more customary.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig 2006-10-19 07:08:43 UTC (rev 4728)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig 2006-10-19 09:31:43 UTC (rev 4729)
@@ -14,7 +14,7 @@
val int : (int, Int.int) iso
val large : (int, LargeInt.int) iso
val string : (int, string) emb
- val is0 : int -> bool
+ val isZero : int -> bool
val isEven : int -> bool
val isOdd : int -> bool
val bounds : (int * int) option
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig 2006-10-19 07:08:43 UTC (rev 4728)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig 2006-10-19 09:31:43 UTC (rev 4729)
@@ -14,7 +14,7 @@
val int : (int, Int.int) iso
val large : (int, LargeInt.int) iso
val string : (int, string) emb
- val is0 : int -> bool
+ val isZero : int -> bool
val isEven : int -> bool
val isOdd : int -> bool
val bounds : (int * int) option
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun 2006-10-19 07:08:43 UTC (rev 4728)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun 2006-10-19 09:31:43 UTC (rev 4729)
@@ -14,8 +14,8 @@
val int = (toInt, fromInt)
val large = (toLarge, fromLarge)
val string = (toString, fromString)
- fun is0 i = fromInt 0 = i
- fun isEven i = is0 (rem (i, fromInt 2))
+ fun isZero i = fromInt 0 = i
+ fun isEven i = isZero (rem (i, fromInt 2))
val isOdd = not o isEven
val bounds = case (minInt, maxInt) of
(NONE, NONE) => NONE
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun 2006-10-19 07:08:43 UTC (rev 4728)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun 2006-10-19 09:31:43 UTC (rev 4729)
@@ -21,8 +21,8 @@
val largeX = (toLargeX, fromLarge)
val word = (toWord, fromWord)
val string = (toString, fromString)
- fun is0 w = fromInt 0 = w
- fun isEven w = is0 (andb (fromInt 1, w))
+ fun isZero w = fromInt 0 = w
+ fun isEven w = isZero (andb (fromInt 1, w))
val isOdd = not o isEven
val bounds as (minWord, maxWord) = (fromInt 0, fromInt~1)
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig 2006-10-19 07:08:43 UTC (rev 4728)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig 2006-10-19 09:31:43 UTC (rev 4729)
@@ -21,7 +21,7 @@
val largeX : (word, LargeWord.word) iso
val word : (word, Word.word) iso
val string : (word, string) emb
- val is0 : word -> bool
+ val isZero : word -> bool
val isEven : word -> bool
val isOdd : word -> bool
val minWord : word
|
|
From: Vesa K. <ve...@ml...> - 2006-10-19 00:08:45
|
Optimized implementation of isEven (after suggestion by Stephen Weeks).
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun 2006-10-18 22:00:11 UTC (rev 4727)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun 2006-10-19 07:08:43 UTC (rev 4728)
@@ -15,7 +15,7 @@
val large = (toLarge, fromLarge)
val string = (toString, fromString)
fun is0 i = fromInt 0 = i
- fun isEven i = is0 (i mod fromInt 2)
+ fun isEven i = is0 (rem (i, fromInt 2))
val isOdd = not o isEven
val bounds = case (minInt, maxInt) of
(NONE, NONE) => NONE
|
|
From: Matthew F. <fl...@ml...> - 2006-10-18 15:00:22
|
Tweaked compile time asserts
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/string.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h 2006-10-18 21:25:13 UTC (rev 4726)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h 2006-10-18 22:00:11 UTC (rev 4727)
@@ -24,11 +24,11 @@
} obj;
} *GC_intInf;
-COMPILE_TIME_ASSERT(GC_intInf__fields_packed,
- offsetof(struct GC_intInf, obj) == sizeof(GC_arrayCounter) + sizeof(GC_arrayLength) + sizeof(GC_header));
-COMPILE_TIME_ASSERT(GC_intInf__isneg_packed,
+COMPILE_TIME_ASSERT(GC_intInf__obj_packed,
+ offsetof(struct GC_intInf, obj) == offsetof(struct GC_intInf, counter) + sizeof(GC_arrayCounter) + sizeof(GC_arrayLength) + sizeof(GC_header));
+COMPILE_TIME_ASSERT(GC_intInf__obj_body_isneg_packed,
offsetof(struct GC_intInf, obj.body.isneg) == offsetof(struct GC_intInf, obj));
-COMPILE_TIME_ASSERT(GC_intInf__limbs_packed,
+COMPILE_TIME_ASSERT(GC_intInf_obj_body_limbs_packed,
offsetof(struct GC_intInf, obj.body.limbs) == offsetof(struct GC_intInf, obj) + sizeof(mp_limb_t));
#endif /* (defined (MLTON_GC_INTERNAL_TYPES)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/string.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/string.h 2006-10-18 21:25:13 UTC (rev 4726)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/string.h 2006-10-18 22:00:11 UTC (rev 4727)
@@ -23,9 +23,9 @@
} obj;
} *GC_string8;
-COMPILE_TIME_ASSERT(GC_string8__fields_packed,
- offsetof(struct GC_string8, obj) == sizeof(GC_arrayCounter) + sizeof(GC_arrayLength) + sizeof(GC_header));
-COMPILE_TIME_ASSERT(GC_string8__chars_packed,
+COMPILE_TIME_ASSERT(GC_string8__obj_packed,
+ offsetof(struct GC_string8, obj) == offsetof(struct GC_string8, counter) + sizeof(GC_arrayCounter) + sizeof(GC_arrayLength) + sizeof(GC_header));
+COMPILE_TIME_ASSERT(GC_string8__obj_body_chars_packed,
offsetof(struct GC_string8, obj.body.chars) == offsetof(struct GC_string8, obj));
#endif /* (defined (MLTON_GC_INTERNAL_TYPES)) */
|
|
From: Matthew F. <fl...@ml...> - 2006-10-18 14:25:16
|
Type name
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c 2006-10-18 21:17:36 UTC (rev 4725)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c 2006-10-18 21:25:13 UTC (rev 4726)
@@ -11,14 +11,14 @@
#define ROUNDING_CONTROL_MASK 0x0C00
#define ROUNDING_CONTROL_SHIFT 10
-static inline int fegetround (void) {
+static inline C_Int_t fegetround (void) {
unsigned short controlWord;
_FPU_GETCW (controlWord);
return (controlWord & ROUNDING_CONTROL_MASK) >> ROUNDING_CONTROL_SHIFT;
}
-static inline void fesetround (int mode) {
+static inline void fesetround (C_Int_t mode) {
unsigned short controlWord;
_FPU_GETCW (controlWord);
|
|
From: Matthew F. <fl...@ml...> - 2006-10-18 14:17:37
|
MAIL Statically-linked wrapper functions for Intel Mac
Added wrapper functions for "cosh", "pow", "sinh", and "tanh". This
should avoid problems with Mac OS dynamic linking.
----------------------------------------------------------------------
U mlton/trunk/basis-library/misc/primitive.sml
U mlton/trunk/runtime/basis/Real/Math.c
----------------------------------------------------------------------
Modified: mlton/trunk/basis-library/misc/primitive.sml
===================================================================
--- mlton/trunk/basis-library/misc/primitive.sml 2006-10-18 20:49:01 UTC (rev 4724)
+++ mlton/trunk/basis-library/misc/primitive.sml 2006-10-18 21:17:36 UTC (rev 4725)
@@ -1325,18 +1325,18 @@
val atan = _prim "Real64_Math_atan": real -> real;
val atan2 = _prim "Real64_Math_atan2": real * real -> real;
val cos = _prim "Real64_Math_cos": real -> real;
- val cosh = _import "cosh": real -> real;
+ val cosh = _import "Real64_Math_cosh": real -> real;
val e = #1 _symbol "Real64_Math_e": real GetSet.t; ()
val exp = _prim "Real64_Math_exp": real -> real;
val ln = _prim "Real64_Math_ln": real -> real;
val log10 = _prim "Real64_Math_log10": real -> real;
val pi = #1 _symbol "Real64_Math_pi": real GetSet.t; ()
- val pow = _import "pow": real * real -> real;
+ val pow = _import "Real64_Math_pow": real * real -> real;
val sin = _prim "Real64_Math_sin": real -> real;
- val sinh = _import "sinh": real -> real;
+ val sinh = _import "Real64_Math_sinh": real -> real;
val sqrt = _prim "Real64_Math_sqrt": real -> real;
val tan = _prim "Real64_Math_tan": real -> real;
- val tanh = _import "tanh": real -> real;
+ val tanh = _import "Real64_Math_tanh": real -> real;
end
val * = _prim "Real64_mul": real * real -> real;
Modified: mlton/trunk/runtime/basis/Real/Math.c
===================================================================
--- mlton/trunk/runtime/basis/Real/Math.c 2006-10-18 20:49:01 UTC (rev 4724)
+++ mlton/trunk/runtime/basis/Real/Math.c 2006-10-18 21:17:36 UTC (rev 4725)
@@ -21,6 +21,7 @@
return (Real32)(Real64_Math_##f ((Real64)x, (Real64)y)); \
}
binaryReal(atan2, atan2)
+binaryReal(pow, pow)
#undef binaryReal
#define unaryReal(f, g) \
@@ -35,12 +36,15 @@
unaryReal(asin, asin)
unaryReal(atan, atan)
unaryReal(cos, cos)
+unaryReal(cosh, cosh)
unaryReal(exp, exp)
unaryReal(ln, log)
unaryReal(log10, log10)
unaryReal(sin, sin)
+unaryReal(sinh, sinh)
unaryReal(sqrt, sqrt)
unaryReal(tan, tan)
+unaryReal(tanh, tanh)
#undef unaryReal
double ldexp (double x, int i);
|
|
From: Matthew F. <fl...@ml...> - 2006-10-18 13:49:13
|
Formatting
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math-fns.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math-fns.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math-fns.h 2006-10-18 14:23:59 UTC (rev 4723)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math-fns.h 2006-10-18 20:49:01 UTC (rev 4724)
@@ -90,7 +90,7 @@
#if (defined (__hppa__) || defined (__sparc__))
#define binaryRealRealRef(g, h) \
MLTON_CODEGEN_MATHFN(Real32_t h##f (Real32_t x, Real32_t *yp);) \
- MLTON_CODEGEN_STATIC_INLINE \
+ MLTON_CODEGEN_STATIC_INLINE \
Real32_t Real32_##g (Real32_t x, Ref(Real32_t) yp) { \
/* Real32_t r, res; */ \
/* r = Real32_fetch (yp); */ \
@@ -116,7 +116,7 @@
return h##f (x, (Real32_t*)yp); \
} \
MLTON_CODEGEN_MATHFN(Real64_t h (Real64_t x, Real64_t *yp);) \
- MLTON_CODEGEN_STATIC_INLINE \
+ MLTON_CODEGEN_STATIC_INLINE \
Real64_t Real64_##g (Real64_t x, Ref(Real64_t) yp) { \
return h (x, (Real64_t*)yp); \
}
|
|
From: Vesa K. <ve...@ml...> - 2006-10-18 07:24:21
|
Initial commit of the extended basis library.
----------------------------------------------------------------------
A mltonlib/trunk/com/
A mltonlib/trunk/com/ssh/
A mltonlib/trunk/com/ssh/extended-basis/
A mltonlib/trunk/com/ssh/extended-basis/unstable/
A mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb
A mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/mk-int-inf-ext.fun
A mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
A mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun
A mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun
A mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun
A mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun
A mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun
A mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt
A mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml
----------------------------------------------------------------------
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,23 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {Array :> ARRAY} structure.
+ *)
+
+signature ARRAY =
+ sig
+ include ARRAY
+ val list : ('a array, 'a list) iso
+ val toList : 'a array -> 'a list
+ end
+
+structure Array : ARRAY =
+ struct
+ open Array
+ fun toList v = foldr op :: [] v
+ val list = (toList, fromList)
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,47 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+ann
+ "forceUsed"
+ "sequenceNonUnit warn"
+ "warnUnused true"
+in
+ $(SML_LIB)/basis/basis.mlb
+ iso.sml
+ emb.sml
+ local
+ mk-integer-ext.fun
+ mk-mono-array-ext.fun
+ mk-mono-vector-ext.fun
+ mk-real-ext.fun
+ mk-word-ext.fun
+
+ mk-int-inf-ext.fun
+
+ mk-text-ext.fun
+ in
+ char.sig
+ int-inf.sig
+ integer.sig
+ mono-array.sig
+ mono-vector.sig
+ real.sig
+ string.sig
+ word.sig
+
+ text.sig
+
+ array.sml
+ ints-mlton.sml
+ mono-arrays-mlton.sml
+ mono-vectors-mlton.sml
+ reals-mlton.sml
+ vector.sml
+ words-mlton.sml
+
+ texts-mlton.sml
+ end
+end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,18 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {CHAR} signature.
+ *)
+
+signature CHAR =
+ sig
+ include CHAR
+ val int : (char, Int.int) iso
+ val minOrd : Int.int
+ val boundsChar : char * char
+ val boundsOrd : Int.int * Int.int
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,31 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Utility module for dealing with embeddings.
+ *)
+
+signature EMB =
+ sig
+ type ('a, 'b) emb = ('a -> 'b) * ('b -> 'a option)
+
+ val id : ('a, 'a) emb
+
+ val to : ('a, 'b) emb -> 'a -> 'b
+ val from : ('a, 'b) emb -> 'b -> 'a option
+ end
+
+structure Emb :> EMB =
+ struct
+ type ('a, 'b) emb = ('a -> 'b) * ('b -> 'a option)
+
+ val id = (fn a => a, SOME)
+
+ fun to (a2b, _) = a2b
+ fun from (_, b2a) = b2a
+ end
+
+type ('a, 'b) emb = ('a, 'b) Emb.emb
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,21 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {INT_INF} signature.
+ *)
+
+signature INT_INF =
+ sig
+ include INT_INF
+ val int : (int, Int.int) iso
+ val large : (int, LargeInt.int) iso
+ val string : (int, string) emb
+ val is0 : int -> bool
+ val isEven : int -> bool
+ val isOdd : int -> bool
+ val bounds : (int * int) option
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,21 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {INTEGER} signature.
+ *)
+
+signature INTEGER =
+ sig
+ include INTEGER
+ val int : (int, Int.int) iso
+ val large : (int, LargeInt.int) iso
+ val string : (int, string) emb
+ val is0 : int -> bool
+ val isEven : int -> bool
+ val isOdd : int -> bool
+ val bounds : (int * int) option
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,51 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(*
+ * Extended {INTEGER} and {INT_INF} modules for MLton.
+ *)
+
+structure Int : INTEGER = MkIntegerExt (Int)
+structure FixedInt : INTEGER = MkIntegerExt (FixedInt)
+structure LargeInt : INTEGER = MkIntegerExt (LargeInt)
+structure Position : INTEGER = MkIntegerExt (Position)
+
+structure Int1 : INTEGER = MkIntegerExt (Int1)
+structure Int2 : INTEGER = MkIntegerExt (Int2)
+structure Int3 : INTEGER = MkIntegerExt (Int3)
+structure Int4 : INTEGER = MkIntegerExt (Int4)
+structure Int5 : INTEGER = MkIntegerExt (Int5)
+structure Int6 : INTEGER = MkIntegerExt (Int6)
+structure Int7 : INTEGER = MkIntegerExt (Int7)
+structure Int8 : INTEGER = MkIntegerExt (Int8)
+structure Int9 : INTEGER = MkIntegerExt (Int9)
+structure Int10 : INTEGER = MkIntegerExt (Int10)
+structure Int11 : INTEGER = MkIntegerExt (Int11)
+structure Int12 : INTEGER = MkIntegerExt (Int12)
+structure Int13 : INTEGER = MkIntegerExt (Int13)
+structure Int14 : INTEGER = MkIntegerExt (Int14)
+structure Int15 : INTEGER = MkIntegerExt (Int15)
+structure Int16 : INTEGER = MkIntegerExt (Int16)
+structure Int17 : INTEGER = MkIntegerExt (Int17)
+structure Int18 : INTEGER = MkIntegerExt (Int18)
+structure Int19 : INTEGER = MkIntegerExt (Int19)
+structure Int20 : INTEGER = MkIntegerExt (Int20)
+structure Int21 : INTEGER = MkIntegerExt (Int21)
+structure Int22 : INTEGER = MkIntegerExt (Int22)
+structure Int23 : INTEGER = MkIntegerExt (Int23)
+structure Int24 : INTEGER = MkIntegerExt (Int24)
+structure Int25 : INTEGER = MkIntegerExt (Int25)
+structure Int26 : INTEGER = MkIntegerExt (Int26)
+structure Int27 : INTEGER = MkIntegerExt (Int27)
+structure Int28 : INTEGER = MkIntegerExt (Int28)
+structure Int29 : INTEGER = MkIntegerExt (Int29)
+structure Int30 : INTEGER = MkIntegerExt (Int30)
+structure Int31 : INTEGER = MkIntegerExt (Int31)
+structure Int32 : INTEGER = MkIntegerExt (Int32)
+
+structure Int64 : INTEGER = MkIntegerExt (Int64)
+
+structure IntInf : INT_INF = MkIntInfExt (IntInf)
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,31 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Utility module for dealing with isomorphisms.
+ *)
+
+signature ISO =
+ sig
+ type ('a, 'b) iso = ('a -> 'b) * ('b -> 'a)
+
+ val id : ('a, 'a) iso
+
+ val to : ('a, 'b) iso -> 'a -> 'b
+ val from : ('a, 'b) iso -> 'b -> 'a
+ end
+
+structure Iso :> ISO =
+ struct
+ type ('a, 'b) iso = ('a -> 'b) * ('b -> 'a)
+
+ val id = (fn a => a, fn a => a)
+
+ fun to (a2b, _) = a2b
+ fun from (_, b2a) = b2a
+ end
+
+type ('a, 'b) iso = ('a, 'b) Iso.iso
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-int-inf-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-int-inf-ext.fun 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-int-inf-ext.fun 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,18 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {INT_INF} modules.
+ *)
+
+functor MkIntInfExt (I : INT_INF) =
+ let
+ structure E = MkIntegerExt (I)
+ in
+ struct
+ open E I
+ end
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-int-inf-ext.fun
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,24 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {INTEGER} modules.
+ *)
+
+functor MkIntegerExt (I : INTEGER) =
+ struct
+ open I
+ val int = (toInt, fromInt)
+ val large = (toLarge, fromLarge)
+ val string = (toString, fromString)
+ fun is0 i = fromInt 0 = i
+ fun isEven i = is0 (i mod fromInt 2)
+ val isOdd = not o isEven
+ val bounds = case (minInt, maxInt) of
+ (NONE, NONE) => NONE
+ | (SOME min, SOME max) => SOME (min, max)
+ | _ => raise Fail "impossible"
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {MONO_ARRAY} modules.
+ *)
+
+functor MkMonoArrayExt (M : MONO_ARRAY) =
+ struct
+ open M
+ fun toList v = foldr op :: [] v
+ val list = (toList, fromList)
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {MONO_VECTOR} modules.
+ *)
+
+functor MkMonoVectorExt (M : MONO_VECTOR) =
+ struct
+ open M
+ fun toList v = foldr op :: [] v
+ val list = (toList, fromList)
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,20 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {REAL} modules.
+ *)
+
+functor MkRealExt (R : REAL) =
+ struct
+ open R
+ val decimal = (toDecimal, fromDecimal)
+ val int = (toInt IEEEReal.TO_NEAREST, fromInt)
+ val large = (toLarge, fromLarge IEEEReal.TO_NEAREST)
+ val largeInt = (toLargeInt IEEEReal.TO_NEAREST, fromLargeInt)
+ val manExp = (toManExp, fromManExp)
+ val string = (toString, fromString)
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,34 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {TEXT} modules.
+ *)
+
+functor MkTextExt (T : TEXT) =
+ struct
+ open T
+
+ structure Char =
+ struct
+ open Char
+ val int = (ord, chr)
+ val minOrd = 0
+ val boundsChar = (minChar, maxChar)
+ val boundsOrd = (minOrd, maxOrd)
+ end
+
+ structure CharArray = MkMonoArrayExt (CharArray)
+ structure CharVector = MkMonoVectorExt (CharVector)
+
+ structure String =
+ struct
+ open CharVector String
+ val list = (explode, implode)
+ val cString = (toCString, fromCString)
+ val string = (toString, fromString)
+ end
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,28 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {WORD} modules.
+ *)
+
+functor MkWordExt (W : WORD) =
+ struct
+ open W
+ val toWord = Word.fromLarge o toLarge
+ val fromWord = fromLarge o Word.toLarge
+ val int = (toInt, fromInt)
+ val intX = (toIntX, fromInt)
+ val large = (toLarge, fromLarge)
+ val largeInt = (toLargeInt, fromLargeInt)
+ val largeIntX = (toLargeIntX, fromLargeInt)
+ val largeX = (toLargeX, fromLarge)
+ val word = (toWord, fromWord)
+ val string = (toString, fromString)
+ fun is0 w = fromInt 0 = w
+ fun isEven w = is0 (andb (fromInt 1, w))
+ val isOdd = not o isEven
+ val bounds as (minWord, maxWord) = (fromInt 0, fromInt~1)
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {MONO_ARRAY} signature.
+ *)
+
+signature MONO_ARRAY =
+ sig
+ include MONO_ARRAY
+ val list : (array, elem list) iso
+ val toList : array -> elem list
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,30 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {MONO_ARRAY} modules for MLton.
+ *)
+
+structure BoolArray : MONO_ARRAY = MkMonoArrayExt (BoolArray)
+
+structure IntArray : MONO_ARRAY = MkMonoArrayExt (IntArray)
+structure LargeIntArray : MONO_ARRAY = MkMonoArrayExt (LargeIntArray)
+structure Int8Array : MONO_ARRAY = MkMonoArrayExt (Int8Array)
+structure Int16Array : MONO_ARRAY = MkMonoArrayExt (Int16Array)
+structure Int32Array : MONO_ARRAY = MkMonoArrayExt (Int32Array)
+structure Int64Array : MONO_ARRAY = MkMonoArrayExt (Int64Array)
+
+structure RealArray : MONO_ARRAY = MkMonoArrayExt (RealArray)
+structure LargeRealArray : MONO_ARRAY = MkMonoArrayExt (LargeRealArray)
+structure Real32Array : MONO_ARRAY = MkMonoArrayExt (Real32Array)
+structure Real64Array : MONO_ARRAY = MkMonoArrayExt (Real64Array)
+
+structure WordArray : MONO_ARRAY = MkMonoArrayExt (WordArray)
+structure LargeWordArray : MONO_ARRAY = MkMonoArrayExt (LargeWordArray)
+structure Word8Array : MONO_ARRAY = MkMonoArrayExt (Word8Array)
+structure Word16Array : MONO_ARRAY = MkMonoArrayExt (Word16Array)
+structure Word32Array : MONO_ARRAY = MkMonoArrayExt (Word32Array)
+structure Word64Array : MONO_ARRAY = MkMonoArrayExt (Word64Array)
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {MONO_VECTOR} signature.
+ *)
+
+signature MONO_VECTOR =
+ sig
+ include MONO_VECTOR
+ val list : (vector, elem list) iso
+ val toList : vector -> elem list
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,30 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {MONO_VECTOR} modules for MLton.
+ *)
+
+structure BoolVector : MONO_VECTOR = MkMonoVectorExt (BoolVector)
+
+structure IntVector : MONO_VECTOR = MkMonoVectorExt (IntVector)
+structure LargeIntVector : MONO_VECTOR = MkMonoVectorExt (LargeIntVector)
+structure Int8Vector : MONO_VECTOR = MkMonoVectorExt (Int8Vector)
+structure Int16Vector : MONO_VECTOR = MkMonoVectorExt (Int16Vector)
+structure Int32Vector : MONO_VECTOR = MkMonoVectorExt (Int32Vector)
+structure Int64Vector : MONO_VECTOR = MkMonoVectorExt (Int64Vector)
+
+structure RealVector : MONO_VECTOR = MkMonoVectorExt (RealVector)
+structure LargeRealVector : MONO_VECTOR = MkMonoVectorExt (LargeRealVector)
+structure Real32Vector : MONO_VECTOR = MkMonoVectorExt (Real32Vector)
+structure Real64Vector : MONO_VECTOR = MkMonoVectorExt (Real64Vector)
+
+structure WordVector : MONO_VECTOR = MkMonoVectorExt (WordVector)
+structure LargeWordVector : MONO_VECTOR = MkMonoVectorExt (LargeWordVector)
+structure Word8Vector : MONO_VECTOR = MkMonoVectorExt (Word8Vector)
+structure Word16Vector : MONO_VECTOR = MkMonoVectorExt (Word16Vector)
+structure Word32Vector : MONO_VECTOR = MkMonoVectorExt (Word32Vector)
+structure Word64Vector : MONO_VECTOR = MkMonoVectorExt (Word64Vector)
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,4 @@
+This library implements a number of minor extensions to the signatures and
+structures of the Standard ML Basis Library. The reason for extending the
+Basis Library in this way is that the extensions are naturally associated
+with specific basis library modules.
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,20 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {REAL} signature.
+ *)
+
+signature REAL =
+ sig
+ include REAL
+ val decimal : (real, IEEEReal.decimal_approx) emb
+ val int : (real, Int.int) iso
+ val large : (real, LargeReal.real) iso
+ val largeInt : (real, LargeInt.int) iso
+ val manExp : (real, {man : real, exp : int}) iso
+ val string : (real, string) emb
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {REAL} modules for MLton.
+ *)
+
+structure Real : REAL = MkRealExt (Real)
+
+structure LargeReal : REAL = MkRealExt (LargeReal)
+
+structure Real32 : REAL = MkRealExt (Real32)
+structure Real64 : REAL = MkRealExt (Real64)
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,38 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {STRING} signature.
+ *)
+
+signature STRING =
+ sig
+ include STRING
+ val list : (string, char list) iso
+ val cString : (string, string) emb
+ val string : (string, string) emb
+
+ type vector = string
+ type elem = char
+
+ val all : (elem -> bool) -> vector -> bool
+ val app : (elem -> unit) -> vector -> unit
+ val appi : (int * elem -> unit) -> vector -> unit
+ val exists : (elem -> bool) -> vector -> bool
+ val find : (elem -> bool) -> vector -> elem option
+ val findi : (int * elem -> bool) -> vector -> (int * elem) option
+ val foldl : (elem * 'a -> 'a) -> 'a -> vector -> 'a
+ val foldli : (int * elem * 'a -> 'a) -> 'a -> vector -> 'a
+ val foldr : (elem * 'a -> 'a) -> 'a -> vector -> 'a
+ val foldri : (int * elem * 'a -> 'a) -> 'a -> vector -> 'a
+ val fromList : elem list -> vector
+ val length : vector -> int
+ val mapi : (int * elem -> elem) -> vector -> vector
+ val maxLen : int
+ val tabulate : int * (int -> elem) -> vector
+ val toList : vector -> elem list
+ val update : vector * int * elem -> vector
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,38 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {TEXT} signature.
+ *)
+
+signature TEXT =
+ sig
+ structure Char : CHAR
+ structure CharArray : MONO_ARRAY
+ structure CharArraySlice : MONO_ARRAY_SLICE
+ structure CharVector : MONO_VECTOR
+ structure CharVectorSlice : MONO_VECTOR_SLICE
+ structure String : STRING
+ structure Substring : SUBSTRING
+ sharing type Char.char
+ = CharArray.elem
+ = CharArraySlice.elem
+ = CharVector.elem
+ = CharVectorSlice.elem
+ = String.char
+ = Substring.char
+ sharing type Char.string
+ = CharArray.vector
+ = CharArraySlice.vector
+ = CharVector.vector
+ = CharVectorSlice.vector
+ = String.string
+ = Substring.string
+ sharing type CharArray.array
+ = CharArraySlice.array
+ sharing type CharArraySlice.vector_slice
+ = CharVectorSlice.slice
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,15 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {TEXT} modules for MLton.
+ *)
+
+structure Text : TEXT = MkTextExt (Text)
+structure Char : CHAR = Text.Char
+structure CharArray : MONO_ARRAY = Text.CharArray
+structure CharVector : MONO_VECTOR = Text.CharVector
+structure String : STRING = Text.String
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,23 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {Vector :> VECTOR} structure.
+ *)
+
+signature VECTOR =
+ sig
+ include VECTOR
+ val list : ('a vector, 'a list) iso
+ val toList : 'a vector -> 'a list
+ end
+
+structure Vector : VECTOR =
+ struct
+ open Vector
+ fun toList v = foldr op :: [] v
+ val list = (toList, fromList)
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,30 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {WORD} signature.
+ *)
+
+signature WORD =
+ sig
+ include WORD
+ val toWord : word -> Word.word
+ val fromWord : Word.word -> word
+ val int : (word, Int.int) iso
+ val intX : (word, Int.int) iso
+ val large : (word, LargeWord.word) iso
+ val largeInt : (word, LargeInt.int) iso
+ val largeIntX : (word, LargeInt.int) iso
+ val largeX : (word, LargeWord.word) iso
+ val word : (word, Word.word) iso
+ val string : (word, string) emb
+ val is0 : word -> bool
+ val isEven : word -> bool
+ val isOdd : word -> bool
+ val minWord : word
+ val maxWord : word
+ val bounds : word * word
+ end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml 2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml 2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,48 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {WORD} modules for MLton.
+ *)
+
+structure Word : WORD = MkWordExt (Word)
+structure LargeWord : WORD = MkWordExt (LargeWord)
+structure SysWord : WORD = MkWordExt (SysWord)
+
+structure Word1 : WORD = MkWordExt (Word1)
+structure Word2 : WORD = MkWordExt (Word2)
+structure Word3 : WORD = MkWordExt (Word3)
+structure Word4 : WORD = MkWordExt (Word4)
+structure Word5 : WORD = MkWordExt (Word5)
+structure Word6 : WORD = MkWordExt (Word6)
+structure Word7 : WORD = MkWordExt (Word7)
+structure Word8 : WORD = MkWordExt (Word8)
+structure Word9 : WORD = MkWordExt (Word9)
+structure Word10 : WORD = MkWordExt (Word10)
+structure Word11 : WORD = MkWordExt (Word11)
+structure Word12 : WORD = MkWordExt (Word12)
+structure Word13 : WORD = MkWordExt (Word13)
+structure Word14 : WORD = MkWordExt (Word14)
+structure Word15 : WORD = MkWordExt (Word15)
+structure Word16 : WORD = MkWordExt (Word16)
+structure Word17 : WORD = MkWordExt (Word17)
+structure Word18 : WORD = MkWordExt (Word18)
+structure Word19 : WORD = MkWordExt (Word19)
+structure Word20 : WORD = MkWordExt (Word20)
+structure Word21 : WORD = MkWordExt (Word21)
+structure Word22 : WORD = MkWordExt (Word22)
+structure Word23 : WORD = MkWordExt (Word23)
+structure Word24 : WORD = MkWordExt (Word24)
+structure Word25 : WORD = MkWordExt (Word25)
+structure Word26 : WORD = MkWordExt (Word26)
+structure Word27 : WORD = MkWordExt (Word27)
+structure Word28 : WORD = MkWordExt (Word28)
+structure Word29 : WORD = MkWordExt (Word29)
+structure Word30 : WORD = MkWordExt (Word30)
+structure Word31 : WORD = MkWordExt (Word31)
+structure Word32 : WORD = MkWordExt (Word32)
+
+structure Word64 : WORD = MkWordExt (Word64)
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml
___________________________________________________________________
Name: svn:eol-style
+ native
|
|
From: Stephen W. <sw...@ml...> - 2006-10-10 10:57:14
|
Added dummy def to avoid empty file, which makes the MacOS linker
unhappy.
----------------------------------------------------------------------
U mlton/trunk/runtime/basis/Ptrace.c
----------------------------------------------------------------------
Modified: mlton/trunk/runtime/basis/Ptrace.c
===================================================================
--- mlton/trunk/runtime/basis/Ptrace.c 2006-10-06 18:12:52 UTC (rev 4721)
+++ mlton/trunk/runtime/basis/Ptrace.c 2006-10-10 17:57:11 UTC (rev 4722)
@@ -10,4 +10,9 @@
return ptrace (request, pid, (int) addr, (int) data);
}
+#else
+
+/* We need the following to make the MacOS linker happy. */
+int mlton_no_ptrace_dummy;
+
#endif
|
|
From: Stephen W. <sw...@ml...> - 2006-10-06 11:12:54
|
Standard layout. ---------------------------------------------------------------------- A mltonlib/branches/ A mltonlib/tags/ A mltonlib/trunk/ ---------------------------------------------------------------------- |
|
From: Stephen W. <sw...@ml...> - 2006-10-06 11:12:21
|
New project. ---------------------------------------------------------------------- A mltonlib/ ---------------------------------------------------------------------- |
|
From: Stephen W. <sw...@ml...> - 2006-10-06 09:56:28
|
Copied MLton-LICENSE to NEC-LICENSE and generalized the MLton-LICENSE
so that the disclaimer applies to all copyright holders.
----------------------------------------------------------------------
U mlton/trunk/doc/license/MLton-LICENSE
A mlton/trunk/doc/license/NEC-LICENSE
----------------------------------------------------------------------
Modified: mlton/trunk/doc/license/MLton-LICENSE
===================================================================
--- mlton/trunk/doc/license/MLton-LICENSE 2006-10-05 16:41:15 UTC (rev 4718)
+++ mlton/trunk/doc/license/MLton-LICENSE 2006-10-06 16:56:27 UTC (rev 4719)
@@ -4,7 +4,7 @@
MLton COPYRIGHT NOTICE, LICENSE AND DISCLAIMER.
-Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
Jagannathan, and Stephen Weeks.
Copyright (C) 1997-2000 by the NEC Research Institute
@@ -13,14 +13,14 @@
provided that the above copyright notice appear in all copies and that
both the copyright notice and this permission notice and warranty
disclaimer appear in supporting documentation, and that the name of
-NEC, or any NEC entity not be used in advertising or publicity
-pertaining to distribution of the software without specific, written
-prior permission.
+the above copyright holders, or their entities, not be used in
+advertising or publicity pertaining to distribution of the software
+without specific, written prior permission.
-NEC disclaims all warranties with regard to this software, including
-all implied warranties of merchantability and fitness. In no event
-shall NEC be liable for any special, indirect or consequential damages
-or any damages whatsoever resulting from loss of use, data or profits,
-whether in an action of contract, negligence or other tortious action,
-arising out of or in connection with the use or performance of this
-software.
+The above copyright holders disclaim all warranties with regard to
+this software, including all implied warranties of merchantability and
+fitness. In no event shall the above copyright holders be liable for
+any special, indirect or consequential damages or any damages
+whatsoever resulting from loss of use, data or profits, whether in an
+action of contract, negligence or other tortious action, arising out
+of or in connection with the use or performance of this software.
Copied: mlton/trunk/doc/license/NEC-LICENSE (from rev 4718, mlton/trunk/doc/license/MLton-LICENSE)
|
|
From: Matthew F. <fl...@ml...> - 2006-10-05 09:41:33
|
Moved the jumpToSML/returnToC code from x86-main.h to x86-codegen.fun.
This code essentially establishes the interface by which C jumps into
SML code (both initially and for exported SML functions) and by which
SML returns to C (for exported SML functions). The key property is
that all C activation frames must be accounted for on the C stack.
Each time C jumps to SML via jumpToSML, the current C stack pointer
is saved for C calls from SML. Additionally, we ensure that the saved
C stack pointer is 16-byte aligned.
Previously, this logic was handled in x86-main.h via inline assembly.
This had a number of disadvantages:
1. We couldn't be sure of what gcc was doing with %esp before the
inline assembly began. In fact, we couldn't be sure that %esp
necessarily pointed to the top of the C stack.
2. We needed extra logic from CPP and from MLton_main arguments to
determine whether or not %esp was reserved for sigstack handling and
whether or not extra "_" were required by assembly labels.
Moving the definition of this code to x86-codegen.fun solves these
problems:
1. Since we control the entire execution, we know that %esp is
16-aligned on entry (modulo the return address pushed by the call
instruction) and can maintain this property easily.
2. We can save temporaries in the C stack frame corresponding to the
call to MLton_jumpToC.
3. We know whether or not to reserve %esp and whether or not labels
need an extra "_".
The downside is that writing out the assembly via the datatype
interface is much more verbose.
----------------------------------------------------------------------
U mlton/trunk/include/x86-main.h
U mlton/trunk/mlton/codegen/x86-codegen/x86-codegen.fun
U mlton/trunk/mlton/codegen/x86-codegen/x86-mlton-basic.sig
----------------------------------------------------------------------
Modified: mlton/trunk/include/x86-main.h
===================================================================
--- mlton/trunk/include/x86-main.h 2006-10-05 01:37:54 UTC (rev 4717)
+++ mlton/trunk/include/x86-main.h 2006-10-05 16:41:15 UTC (rev 4718)
@@ -50,63 +50,12 @@
#define DEBUG_X86CODEGEN FALSE
#endif
-#if (defined (__CYGWIN__) || defined (__Darwin__) || defined (__MSVCRT__))
-#define ReturnToC "_Thread_returnToC"
-#elif (defined (__FreeBSD__) || defined (__linux__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__sun__))
-#define ReturnToC "Thread_returnToC"
-#else
-#error ReturnToC not defined
-#endif
-
static Word32 returnAddressToFrameIndex (Word32 w) {
return *((Word32*)(w - sizeof(Word32)));
}
-#define Main(al, mg, mfs, mmc, pk, ps, ml, reserveEsp) \
-void MLton_jumpToSML (pointer jump) { \
- Word c_stackPLast; \
- Word c_stackPLastTrue; \
- \
- if (DEBUG_X86CODEGEN) \
- fprintf (stderr, "MLton_jumpToSML(0x%08x) starting\n", (uint)jump); \
- c_stackPLast = c_stackP; \
- c_stackPLastTrue = c_stackPTrue; \
- if (reserveEsp) \
- __asm__ __volatile__ \
- ("pusha\n\t" \
- "movl %%esp,%0\n\t" \
- "andl $-16,%%esp\n\t" \
- "movl %%esp,%1\n\t" \
- "movl %2,%%ebp\n\t" \
- "movl %3,%%edi\n\t" \
- "jmp *%4\n" \
- ".global "ReturnToC"\n"ReturnToC":\n\t" \
- "movl %0,%%esp\n\t" \
- "popa\n" \
- : "=o" (c_stackPTrue), "=o" (c_stackP) \
- : "o" (gcState.stackTop), "o" (gcState.frontier), "r" (jump) \
- ); \
- else \
- __asm__ __volatile__ \
- ("pusha\n\t" \
- "movl %%esp,%0\n\t" \
- "andl $-16,%%esp\n\t" \
- "movl %%esp,%1\n\t" \
- "movl %2,%%ebp\n\t" \
- "movl %3,%%esp\n\t" \
- "jmp *%4\n" \
- ".global "ReturnToC"\n"ReturnToC":\n\t" \
- "movl %0,%%esp\n\t" \
- "popa\n" \
- : "=o" (c_stackPTrue), "=o" (c_stackP) \
- : "o" (gcState.stackTop), "o" (gcState.frontier), "r" (jump) \
- ); \
- c_stackP = c_stackPLast; \
- c_stackPTrue = c_stackPLastTrue; \
- if (DEBUG_X86CODEGEN) \
- fprintf (stderr, "MLton_jumpToSML(0x%08x) done\n", (uint)jump); \
- return; \
-} \
+#define Main(al, mg, mfs, mmc, pk, ps, ml) \
+void MLton_jumpToSML (pointer jump); \
void MLton_callFromC () { \
pointer jump; \
GC_state s; \
Modified: mlton/trunk/mlton/codegen/x86-codegen/x86-codegen.fun
===================================================================
--- mlton/trunk/mlton/codegen/x86-codegen/x86-codegen.fun 2006-10-05 01:37:54 UTC (rev 4717)
+++ mlton/trunk/mlton/codegen/x86-codegen/x86-codegen.fun 2006-10-05 16:41:15 UTC (rev 4718)
@@ -62,12 +62,6 @@
structure x86Validate
= x86Validate (structure x86 = x86)
- structure C =
- struct
- val truee = "TRUE"
- val falsee = "FALSE"
- end
-
open x86
fun output {program as Machine.Program.T {chunks, frameLayouts, handlesSignals,
main, ...},
@@ -137,7 +131,7 @@
then String.dropPrefix (mainLabel, 1)
else mainLabel
in
- [mainLabel, if reserveEsp then C.truee else C.falsee]
+ [mainLabel]
end
fun declareLocals () =
List.foreach
@@ -179,6 +173,174 @@
x86.Assembly.label x86MLton.fileNameLabel,
x86.Assembly.pseudoop_string [file]]
+ fun outputJumpToSML print =
+ let
+ val jumpToSML = x86.Label.fromString "MLton_jumpToSML"
+ val returnToC = x86.Label.fromString "Thread_returnToC"
+ val {frontierReg, stackTopReg} =
+ if reserveEsp
+ then {frontierReg = x86.Register.edi,
+ stackTopReg = x86.Register.ebp}
+ else {frontierReg = x86.Register.esp,
+ stackTopReg = x86.Register.ebp}
+ val asm =
+ [
+ x86.Assembly.pseudoop_text (),
+ x86.Assembly.pseudoop_p2align
+ (x86.Immediate.const_int 4, NONE, NONE),
+ x86.Assembly.pseudoop_global jumpToSML,
+ x86.Assembly.label jumpToSML,
+ x86.Assembly.instruction_binal
+ {oper = x86.Instruction.SUB,
+ src = x86.Operand.immediate_const_int 28,
+ dst = x86.Operand.register x86.Register.esp,
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.const_int 32),
+ base = SOME x86.Register.esp,
+ index= NONE, scale = NONE},
+ dst = x86.Operand.register x86.Register.eax,
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = x86.Operand.register x86.Register.ebp,
+ dst = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.const_int 24),
+ base = SOME x86.Register.esp,
+ index= NONE, scale = NONE},
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = x86.Operand.register x86.Register.ebx,
+ dst = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.const_int 20),
+ base = SOME x86.Register.esp,
+ index= NONE, scale = NONE},
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = x86.Operand.register x86.Register.edi,
+ dst = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.const_int 16),
+ base = SOME x86.Register.esp,
+ index= NONE, scale = NONE},
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = x86.Operand.register x86.Register.esi,
+ dst = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.const_int 12),
+ base = SOME x86.Register.esp,
+ index = NONE, scale = NONE},
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.label x86MLton.c_stackP),
+ base = NONE, index = NONE, scale = NONE},
+ dst = x86.Operand.register x86.Register.ebx,
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = x86.Operand.register x86.Register.ebx,
+ dst = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.const_int 8),
+ base = SOME x86.Register.esp,
+ index = NONE, scale = NONE},
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = x86.Operand.register x86.Register.esp,
+ dst = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.label x86MLton.c_stackP),
+ base = NONE, index = NONE, scale = NONE},
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = (x86.Operand.address o x86.Address.T)
+ {disp = (SOME o x86.Immediate.binexp)
+ {oper = x86.Immediate.Addition,
+ exp1 = x86.Immediate.label x86MLton.gcState_label,
+ exp2 = x86.Immediate.const_int
+ (Bytes.toInt
+ (Machine.Runtime.GCField.offset
+ Machine.Runtime.GCField.StackTop))},
+ base = NONE, index = NONE, scale = NONE},
+ dst = x86.Operand.register stackTopReg,
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = (x86.Operand.address o x86.Address.T)
+ {disp = (SOME o x86.Immediate.binexp)
+ {oper = x86.Immediate.Addition,
+ exp1 = x86.Immediate.label x86MLton.gcState_label,
+ exp2 = x86.Immediate.const_int
+ (Bytes.toInt
+ (Machine.Runtime.GCField.offset
+ Machine.Runtime.GCField.Frontier))},
+ base = NONE, index = NONE, scale = NONE},
+ dst = x86.Operand.register frontierReg,
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_jmp
+ {target = x86.Operand.register x86.Register.eax,
+ absolute = true},
+ x86.Assembly.pseudoop_p2align
+ (x86.Immediate.const_int 4, NONE, NONE),
+ x86.Assembly.pseudoop_global returnToC,
+ x86.Assembly.label returnToC,
+ x86.Assembly.instruction_mov
+ {src = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.label x86MLton.c_stackP),
+ base = NONE, index = NONE, scale = NONE},
+ dst = x86.Operand.register x86.Register.esp,
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.const_int 8),
+ base = SOME x86.Register.esp,
+ index = NONE, scale = NONE},
+ dst = x86.Operand.register x86.Register.ebx,
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = x86.Operand.register x86.Register.ebx,
+ dst = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.label x86MLton.c_stackP),
+ base = NONE, index = NONE, scale = NONE},
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.const_int 12),
+ base = SOME x86.Register.esp,
+ index = NONE, scale = NONE},
+ dst = x86.Operand.register x86.Register.esi,
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.const_int 16),
+ base = SOME x86.Register.esp,
+ index = NONE, scale = NONE},
+ dst = x86.Operand.register x86.Register.edi,
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.const_int 20),
+ base = SOME x86.Register.esp,
+ index = NONE, scale = NONE},
+ dst = x86.Operand.register x86.Register.ebx,
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_mov
+ {src = (x86.Operand.address o x86.Address.T)
+ {disp = SOME (x86.Immediate.const_int 24),
+ base = SOME x86.Register.esp,
+ index = NONE, scale = NONE},
+ dst = x86.Operand.register x86.Register.ebp,
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_binal
+ {oper = x86.Instruction.ADD,
+ src = x86.Operand.immediate_const_int 28,
+ dst = x86.Operand.register x86.Register.esp,
+ size = x86.Size.LONG},
+ x86.Assembly.instruction_ret {src = NONE}
+ ]
+ in
+ List.foreach
+ (asm,
+ fn asm => (Layout.print(Assembly.layout asm, print);
+ print "\n"))
+ end
+
val liveInfo = x86Liveness.LiveInfo.newLiveInfo ()
val jumpInfo = x86JumpInfo.newJumpInfo ()
@@ -194,6 +356,11 @@
val isMain
= Machine.ChunkLabel.equals(#chunkLabel main, chunkLabel)
+ val ()
+ = if isMain
+ then outputJumpToSML print
+ else ()
+
val {chunk}
= x86Translate.translateChunk
{chunk = chunk,
@@ -243,7 +410,7 @@
in
List.fold
(validated_assembly,
- 0,
+ if isMain then 30 else 0,
fn (block, n)
=> List.fold
(block,
Modified: mlton/trunk/mlton/codegen/x86-codegen/x86-mlton-basic.sig
===================================================================
--- mlton/trunk/mlton/codegen/x86-codegen/x86-mlton-basic.sig 2006-10-05 01:37:54 UTC (rev 4717)
+++ mlton/trunk/mlton/codegen/x86-codegen/x86-mlton-basic.sig 2006-10-05 16:41:15 UTC (rev 4718)
@@ -78,6 +78,7 @@
end
(* CStack locations *)
+ val c_stackP : x86.Label.t
val c_stackPContents : x86.MemLoc.t
val c_stackPContentsOperand : x86.Operand.t
val c_stackPDerefOperand : x86.Operand.t
|
|
From: Matthew F. <fl...@ml...> - 2006-10-04 18:37:54
|
Don't use a function local variable to hold the true value of %esp, as a function local variable is likely to be addressed via %esp.
----------------------------------------------------------------------
U mlton/trunk/include/x86-main.h
----------------------------------------------------------------------
Modified: mlton/trunk/include/x86-main.h
===================================================================
--- mlton/trunk/include/x86-main.h 2006-10-04 23:06:34 UTC (rev 4716)
+++ mlton/trunk/include/x86-main.h 2006-10-05 01:37:54 UTC (rev 4717)
@@ -16,6 +16,7 @@
Word32 checkTemp;
Word32 cReturnTemp[16];
Word32 c_stackP;
+Word32 c_stackPTrue;
Word32 divTemp;
Word32 eq1Temp;
Word32 eq2Temp;
@@ -64,11 +65,12 @@
#define Main(al, mg, mfs, mmc, pk, ps, ml, reserveEsp) \
void MLton_jumpToSML (pointer jump) { \
Word c_stackPLast; \
- Word c_stackPThis; \
+ Word c_stackPLastTrue; \
\
if (DEBUG_X86CODEGEN) \
fprintf (stderr, "MLton_jumpToSML(0x%08x) starting\n", (uint)jump); \
c_stackPLast = c_stackP; \
+ c_stackPLastTrue = c_stackPTrue; \
if (reserveEsp) \
__asm__ __volatile__ \
("pusha\n\t" \
@@ -81,7 +83,7 @@
".global "ReturnToC"\n"ReturnToC":\n\t" \
"movl %0,%%esp\n\t" \
"popa\n" \
- : "=o" (c_stackPThis), "=o" (c_stackP) \
+ : "=o" (c_stackPTrue), "=o" (c_stackP) \
: "o" (gcState.stackTop), "o" (gcState.frontier), "r" (jump) \
); \
else \
@@ -96,10 +98,11 @@
".global "ReturnToC"\n"ReturnToC":\n\t" \
"movl %0,%%esp\n\t" \
"popa\n" \
- : "=o" (c_stackPThis), "=o" (c_stackP) \
+ : "=o" (c_stackPTrue), "=o" (c_stackP) \
: "o" (gcState.stackTop), "o" (gcState.frontier), "r" (jump) \
); \
c_stackP = c_stackPLast; \
+ c_stackPTrue = c_stackPLastTrue; \
if (DEBUG_X86CODEGEN) \
fprintf (stderr, "MLton_jumpToSML(0x%08x) done\n", (uint)jump); \
return; \
|
|
From: Matthew F. <fl...@ml...> - 2006-10-04 16:06:35
|
Applied a varition of the patch from Eric McCorkle <er...@sh...>
for x86-darwin support that changes include/x86-main.h. This assumes
that gcc leaves %esp pointing to the top but of the stack, but not
necessarily 16-byte aligned. Not tested extensively yet.
----------------------------------------------------------------------
U mlton/trunk/include/x86-main.h
----------------------------------------------------------------------
Modified: mlton/trunk/include/x86-main.h
===================================================================
--- mlton/trunk/include/x86-main.h 2006-09-30 02:03:32 UTC (rev 4715)
+++ mlton/trunk/include/x86-main.h 2006-10-04 23:06:34 UTC (rev 4716)
@@ -63,24 +63,43 @@
#define Main(al, mg, mfs, mmc, pk, ps, ml, reserveEsp) \
void MLton_jumpToSML (pointer jump) { \
- Word lc_stackP; \
+ Word c_stackPLast; \
+ Word c_stackPThis; \
\
if (DEBUG_X86CODEGEN) \
fprintf (stderr, "MLton_jumpToSML(0x%08x) starting\n", (uint)jump); \
- lc_stackP = c_stackP; \
+ c_stackPLast = c_stackP; \
if (reserveEsp) \
__asm__ __volatile__ \
- ("pusha\nmovl %%esp,%0\nmovl %1,%%ebp\nmovl %2,%%edi\njmp *%3\n.global "ReturnToC"\n"ReturnToC":\nmovl %0,%%esp\npopa" \
- : "=o" (c_stackP) \
+ ("pusha\n\t" \
+ "movl %%esp,%0\n\t" \
+ "andl $-16,%%esp\n\t" \
+ "movl %%esp,%1\n\t" \
+ "movl %2,%%ebp\n\t" \
+ "movl %3,%%edi\n\t" \
+ "jmp *%4\n" \
+ ".global "ReturnToC"\n"ReturnToC":\n\t" \
+ "movl %0,%%esp\n\t" \
+ "popa\n" \
+ : "=o" (c_stackPThis), "=o" (c_stackP) \
: "o" (gcState.stackTop), "o" (gcState.frontier), "r" (jump) \
); \
else \
__asm__ __volatile__ \
- ("pusha\nmovl %%esp,%0\nmovl %1,%%ebp\nmovl %2,%%esp\njmp *%3\n.global "ReturnToC"\n"ReturnToC":\nmovl %0,%%esp\npopa" \
- : "=o" (c_stackP) \
+ ("pusha\n\t" \
+ "movl %%esp,%0\n\t" \
+ "andl $-16,%%esp\n\t" \
+ "movl %%esp,%1\n\t" \
+ "movl %2,%%ebp\n\t" \
+ "movl %3,%%esp\n\t" \
+ "jmp *%4\n" \
+ ".global "ReturnToC"\n"ReturnToC":\n\t" \
+ "movl %0,%%esp\n\t" \
+ "popa\n" \
+ : "=o" (c_stackPThis), "=o" (c_stackP) \
: "o" (gcState.stackTop), "o" (gcState.frontier), "r" (jump) \
); \
- c_stackP = lc_stackP; \
+ c_stackP = c_stackPLast; \
if (DEBUG_X86CODEGEN) \
fprintf (stderr, "MLton_jumpToSML(0x%08x) done\n", (uint)jump); \
return; \
|
|
From: Stephen W. <sw...@ml...> - 2006-09-29 19:03:33
|
Back to original license, as per discussion on the MLton list. ---------------------------------------------------------------------- U mlton/trunk/doc/license/MLton-LICENSE ---------------------------------------------------------------------- Modified: mlton/trunk/doc/license/MLton-LICENSE =================================================================== --- mlton/trunk/doc/license/MLton-LICENSE 2006-09-28 10:57:00 UTC (rev 4714) +++ mlton/trunk/doc/license/MLton-LICENSE 2006-09-30 02:03:32 UTC (rev 4715) @@ -2,8 +2,12 @@ the Standard ML programming language. Send comments and questions to ML...@ml.... -MLton LICENSE AND DISCLAIMER. +MLton COPYRIGHT NOTICE, LICENSE AND DISCLAIMER. +Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh + Jagannathan, and Stephen Weeks. +Copyright (C) 1997-2000 by the NEC Research Institute + Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that |
|
From: Stephen W. <sw...@ml...> - 2006-09-28 03:57:01
|
Simpler solution. Took out the copyright from MLton-LICENSE, since it already appears in individual files. ---------------------------------------------------------------------- U mlton/trunk/doc/license/MLton-LICENSE D mlton/trunk/doc/license/MLton-LICENSE-only ---------------------------------------------------------------------- Modified: mlton/trunk/doc/license/MLton-LICENSE =================================================================== --- mlton/trunk/doc/license/MLton-LICENSE 2006-09-28 10:47:38 UTC (rev 4713) +++ mlton/trunk/doc/license/MLton-LICENSE 2006-09-28 10:57:00 UTC (rev 4714) @@ -2,12 +2,8 @@ the Standard ML programming language. Send comments and questions to ML...@ml.... -MLton COPYRIGHT NOTICE, LICENSE AND DISCLAIMER. +MLton LICENSE AND DISCLAIMER. -Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh - Jagannathan, and Stephen Weeks. -Copyright (C) 1997-2000 by the NEC Research Institute - Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that Deleted: mlton/trunk/doc/license/MLton-LICENSE-only =================================================================== --- mlton/trunk/doc/license/MLton-LICENSE-only 2006-09-28 10:47:38 UTC (rev 4713) +++ mlton/trunk/doc/license/MLton-LICENSE-only 2006-09-28 10:57:00 UTC (rev 4714) @@ -1,16 +0,0 @@ -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both the copyright notice and this permission notice and warranty -disclaimer appear in supporting documentation, and that the name of -NEC, or any NEC entity not be used in advertising or publicity -pertaining to distribution of the software without specific, written -prior permission. - -NEC disclaims all warranties with regard to this software, including -all implied warranties of merchantability and fitness. In no event -shall NEC be liable for any special, indirect or consequential damages -or any damages whatsoever resulting from loss of use, data or profits, -whether in an action of contract, negligence or other tortious action, -arising out of or in connection with the use or performance of this -software. |