Skip to content

Commit 424a3cd

Browse files
authored
Upgrade float32 support to beta (#2541)
* squash * fix
1 parent ddabbe9 commit 424a3cd

File tree

19 files changed

+42
-42
lines changed

19 files changed

+42
-42
lines changed
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
alpha.mli
22
alpha.ml
3-
float32.mli
4-
float32.ml

ocaml/otherlibs/alpha/alpha.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
module Float32 = Float32
2-
module Float32_u = Float32_u

ocaml/otherlibs/alpha/alpha.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
module Float32 = Float32
2-
module Float32_u = Float32_u

ocaml/otherlibs/alpha/dune

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,9 @@
4141
(alpha.cmxs as alpha/alpha.cmxs)
4242
(alpha.cma as alpha/alpha.cma)
4343
(alpha.mli as alpha/alpha.mli)
44-
(float32.mli as alpha/float32.mli)
45-
(float32_u.mli as alpha/float32_u.mli)
4644
(.alpha.objs/byte/alpha.cmi as alpha/alpha.cmi)
4745
(.alpha.objs/byte/alpha.cmt as alpha/alpha.cmt)
4846
(.alpha.objs/byte/alpha.cmti as alpha/alpha.cmti)
49-
(.alpha.objs/native/alpha.cmx as alpha/alpha.cmx)
50-
(.alpha.objs/byte/float32.cmi as alpha/float32.cmi)
51-
(.alpha.objs/byte/float32.cmt as alpha/float32.cmt)
52-
(.alpha.objs/byte/float32.cmti as alpha/float32.cmti)
53-
(.alpha.objs/native/float32.cmx as alpha/float32.cmx)
54-
(.alpha.objs/byte/float32_u.cmi as alpha/float32_u.cmi)
55-
(.alpha.objs/byte/float32_u.cmt as alpha/float32_u.cmt)
56-
(.alpha.objs/byte/float32_u.cmti as alpha/float32_u.cmti)
57-
(.alpha.objs/native/float32_u.cmx as alpha/float32_u.cmx))
47+
(.alpha.objs/native/alpha.cmx as alpha/alpha.cmx))
5848
(section lib)
5949
(package ocaml))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
beta.mli
22
beta.ml
3+
float32.mli
4+
float32.ml

ocaml/otherlibs/beta/beta.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module Float32 = Float32
2+
module Float32_u = Float32_u

ocaml/otherlibs/beta/beta.mli

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module Float32 = Float32
2+
module Float32_u = Float32_u

ocaml/otherlibs/beta/dune

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,19 @@
4141
(beta.cmxs as beta/beta.cmxs)
4242
(beta.cma as beta/beta.cma)
4343
(beta.mli as beta/beta.mli)
44+
(float32.mli as beta/float32.mli)
45+
(float32_u.mli as beta/float32_u.mli)
4446
(.beta.objs/byte/beta.cmi as beta/beta.cmi)
4547
(.beta.objs/byte/beta.cmt as beta/beta.cmt)
4648
(.beta.objs/byte/beta.cmti as beta/beta.cmti)
47-
(.beta.objs/native/beta.cmx as beta/beta.cmx))
49+
(.beta.objs/native/beta.cmx as beta/beta.cmx)
50+
(.beta.objs/byte/float32.cmi as beta/float32.cmi)
51+
(.beta.objs/byte/float32.cmt as beta/float32.cmt)
52+
(.beta.objs/byte/float32.cmti as beta/float32.cmti)
53+
(.beta.objs/native/float32.cmx as beta/float32.cmx)
54+
(.beta.objs/byte/float32_u.cmi as beta/float32_u.cmi)
55+
(.beta.objs/byte/float32_u.cmt as beta/float32_u.cmt)
56+
(.beta.objs/byte/float32_u.cmti as beta/float32_u.cmti)
57+
(.beta.objs/native/float32_u.cmx as beta/float32_u.cmx))
4858
(section lib)
4959
(package ocaml))
File renamed without changes.
File renamed without changes.

ocaml/testsuite/tests/typing-layouts-float32/alloc.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(* TEST
22
flambda2;
33
{
4-
include alpha;
5-
flags = "-extension-universe alpha";
4+
include beta;
5+
flags = "-extension-universe beta";
66
native;
77
}
88
*)
@@ -15,7 +15,7 @@
1515
floats. *)
1616

1717
module Float32_u = struct
18-
include Alpha.Float32_u
18+
include Beta.Float32_u
1919

2020
let ( + ) = add
2121
let ( - ) = sub

ocaml/utils/language_extension.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module Exist_pair = struct
7979
| Pair (Layouts, m) -> m
8080
| Pair (SIMD, ()) -> Stable
8181
| Pair (Labeled_tuples, ()) -> Stable
82-
| Pair (Small_numbers, ()) -> Alpha
82+
| Pair (Small_numbers, ()) -> Beta
8383

8484
let is_erasable : t -> bool = function Pair (ext, _) -> is_erasable ext
8585

tests/small_numbers/dune

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
(executables
1313
(names float32_builtin float32_lib float32_u_lib)
1414
(modules float32_builtin float32_lib float32_u_lib)
15-
(libraries alpha)
15+
(libraries beta)
1616
(foreign_archives stubs)
1717
(ocamlopt_flags
18-
(:standard -extension-universe alpha)))
18+
(:standard -extension-universe beta)))
1919

2020
(rule
2121
(enabled_if
@@ -64,12 +64,12 @@
6464
float32_builtin_internal
6565
float32_lib_internal
6666
float32_u_lib_internal)
67-
(libraries alpha)
67+
(libraries beta)
6868
(enabled_if
6969
(<> %{system} macosx))
7070
(foreign_archives stubs)
7171
(ocamlopt_flags
72-
(:standard -extension-universe alpha -internal-assembler)))
72+
(:standard -extension-universe beta -internal-assembler)))
7373

7474
(rule
7575
(enabled_if

tests/small_numbers/float32_lib.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
(* Tests for the float32 otherlib *)
33

4-
module F32 = Alpha.Float32
4+
module F32 = Beta.Float32
55

66
module CF32 = struct
77
type t = float32

tests/small_numbers/float32_u_lib.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
(* Tests for the float32 otherlib *)
33

4-
module F32 = Alpha.Float32_u
4+
module F32 = Beta.Float32_u
55

66
external box_int32 : int32# -> (int32[@local_opt]) = "%box_int32"
77
external unbox_int32 : (int32[@local_opt]) -> int32# = "%unbox_int32"

testsuite/tests/lib-extensions/alpha_exports.ml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,3 @@
99
*)
1010

1111
open Alpha
12-
13-
(* Test that [Float32] is exported. *)
14-
15-
let () =
16-
let one = Float32.of_float 1.0 in
17-
assert (Float32.to_float one = 1.0)
18-
;;
19-
20-
(* Test that [Float32_u] is exported. *)
21-
22-
let () =
23-
let one = Float32_u.of_int 1 in
24-
assert (Float32_u.to_int one = 1)
25-
;;

testsuite/tests/lib-extensions/beta_exports.ml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,17 @@
99
*)
1010

1111
open Beta
12+
13+
(* Test that [Float32] is exported. *)
14+
15+
let () =
16+
let one = Float32.of_float 1.0 in
17+
assert (Float32.to_float one = 1.0)
18+
;;
19+
20+
(* Test that [Float32_u] is exported. *)
21+
22+
let () =
23+
let one = Float32_u.of_int 1 in
24+
assert (Float32_u.to_int one = 1)
25+
;;

0 commit comments

Comments
 (0)