v8/test/cctest/wasm
ahaas de369129d2 [wasm] Detect unrepresentability in the float32-to-int32 conversion correctly on arm.
In the current implementation of wasm an unrepresentable input of the
float32-to-int32 conversion is detected by first truncating the input, then
converting the truncated input to int32 and back to float32, and then checking
whether the result is the same as the truncated input.

This input check does not work on arm and arm64 for an input of (INT32_MAX + 1)
because on these platforms the float32-to-int32 conversion results in INT32_MAX
if the input is greater than INT32_MAX.  When INT32_MAX is converted back to
float32, then the result is (INT32_MAX + 1) again because INT32_MAX cannot be
represented precisely as float32, and rounding-to-nearest results in (INT32_MAX
+ 1). Since (INT32_MAX + 1) equals the truncated input value, the input appears
to be representable.

With the changes in this CL, the result of the float32-to-int32 conversion is
incremented by 1 if the original result was INT32_MAX. Thereby the detection of
unrepresenable inputs in wasm works. Note that since INT32_MAX cannot be
represented precisely in float32, it can also never be a valid result of the
float32-to-int32 conversion.

@v8-mips-ports, can you do a similar implementation for mips?

R=titzer@chromium.org, Rodolph.Perfetta@arm.com

Review-Url: https://codereview.chromium.org/2105313002
Cr-Commit-Position: refs/heads/master@{#37448}
2016-06-30 14:30:44 +00:00
..
OWNERS Adding a few more owners to the wasm directory. 2016-06-29 17:38:30 +00:00
test-run-wasm-64.cc Reland of "Implement WASM big-endian support". 2016-06-29 09:26:31 +00:00
test-run-wasm-asmjs.cc [wasm] Support for memory size relocation for asm-wasm. 2016-06-15 16:43:34 +00:00
test-run-wasm-interpreter.cc [wasm] Fix CFI failures due to Wasm threads. 2016-06-09 14:23:52 +00:00
test-run-wasm-js.cc [formatting] Remove all double blank lines in WASM code. 2016-05-11 12:36:04 +00:00
test-run-wasm-module.cc [wasm] Consolidate CompileAndRunWasmModule 2016-06-22 21:39:14 +00:00
test-run-wasm-relocation.cc [wasm] Relocatable Globals. 2016-06-14 21:41:30 +00:00
test-run-wasm.cc [wasm] Detect unrepresentability in the float32-to-int32 conversion correctly on arm. 2016-06-30 14:30:44 +00:00
test-signatures.h [wasm] Add utilities to print out WASM ast directly from the bytes. 2016-01-21 16:11:19 +00:00
test-wasm-function-name-table.cc [wasm] Refactor encoder.h to use a proper buffer and remove OldFunctions section. 2016-05-25 16:13:50 +00:00
test-wasm-stack.cc Use JS_ERROR_TYPE to check for error objects. 2016-06-27 09:34:44 +00:00
test-wasm-trap-position.cc Use JS_ERROR_TYPE to check for error objects. 2016-06-27 09:34:44 +00:00
wasm-run-utils.h [wasm] Cleanup AST decoder. Remove Tree and TreeResult. 2016-06-29 11:40:11 +00:00