Conversation
|
It appears Int64.of_int32 sign extends, so this might not be want is needed for wasm32. Might it be better to spec the maximum index rather than memory size to support 4GB cleanly? Is seems really confusing to be using the wasm storage types in the spec for general computations. Can the spec just use arbitrate precision integer maths. |
|
Arg, good catch. I changed them to proper unsigned conversions now. This caused some tests to expose the problem that the initial memory size is not rounded up to a page size. I've now added a patch which fixes that too. The spec is using int64 as a "sufficiently large integer math" type, even when the index size is i32. In fact, the spec doesn't support wasm64 at all right now. |
ml-proto/spec/eval.ml
Outdated
There was a problem hiding this comment.
When I make that change, I get:
File "spec/eval.ml", line 117, characters 14-38:
Error: This expression has type I32.t -> I64.t
but an expression was expected of type int
which I don't understand.
There was a problem hiding this comment.
Oh yes, it's parsing the - as a binary operator. Need to put parens around the -1l.
|
LGTM modulo nits |
ml-proto/spec/eval.ml
Outdated
There was a problem hiding this comment.
I don't think this comment is necessary; we do this all over the place.
5f097c2 to
9509588
Compare
9509588 to
11a00bf
Compare
|
Looking at this again, since OCaml doesn't actually support unsigned integers, and since we do a proper check for unsigned overflow in the |
Rename some test functions, for consistency with other functions.
[Interpreter] infrastructure
This moves all EH proposals into exception-handling/ directory, to maintain the same level of directory structure with other proposals. Also this renames Exceptions-v3.md to Exceptions-v2.md; Exceptions-v2-Level-1.md was actually the same as that file with some added context, and we so far have had two different proposals, not three. Also this fixes some links.
Resolved minor issues of prose spec diffs
When testing whether a value is in the i32 unsigned range, use the
unsigned max value (aka minus_one), rather than max_int, which is the
signed max value.