Skip to content

Commit 7b93134

Browse files
gretay-jsxclerc
andauthored
Vectorizer: add tests (#3456)
* Add tests * Disable ocamlformat on unboxed tests * Increase -vectorize-max-block-size for tests * Fix asssertion failure when vectorizing unboxed int32 * Disable float32 on arm64 (not yet implemented) * improve gen_dune.ml for the vectorizer tests Co-authored-by: Xavier Clerc <xclerc@users.noreply.github.com>
1 parent 6379678 commit 7b93134

36 files changed

+2321
-36
lines changed

backend/vectorize_utils.ml

+5-3
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,13 @@ let vectorize_machtypes (pack : Reg.t list) : Cmm.machtype_component =
137137
Printreg.reglist pack;
138138
match hd.typ, List.length pack with
139139
| Addr, _ -> Misc.fatal_errorf "Unexpected machtype for %a" Printreg.reg hd
140-
| (Int | Float), 2 | Float32, 4 ->
141-
(* allows subregs, width should be correct by construction of [Group]. *)
140+
| Float, 2 | Float32, 4 -> Vec128
141+
| Int, _ ->
142+
(* [Int] may be used for int32, width should be correct by construction of
143+
[Group]. *)
142144
Vec128
143145
| Val, 2 -> Valx2
144-
| (Val | Int | Float | Float32), n ->
146+
| (Val | Float | Float32), n ->
145147
Misc.fatal_errorf "Unexpected pack size %d for %a" n Printreg.reglist pack
146148
| Vec128, _ | Valx2, _ ->
147149
Misc.fatal_errorf "Unexpected machtype for %a" Printreg.reg hd)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
test_int64_unboxed.ml
2+
test_float_unboxed.ml
3+
test_int32_unboxed.ml
4+
test_float32_unboxed.ml

0 commit comments

Comments
 (0)