Fix 64-bit shift family Wasm opcodes
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2016 19:17:00 +0000 (19:17 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2016 19:17:00 +0000 (19:17 +0000)
commit363a4e894aa264f80ea8fc5a6d0c65456c7ff0fd
treeff4e00dbaa2a345d4dea52d33968b18b7fd1272b
parent6bf63dcb2ab86e6d85bae05a8373892a29af23dc
Fix 64-bit shift family Wasm opcodes
https://bugs.webkit.org/show_bug.cgi?id=165902

Reviewed by Geoffrey Garen.

JSTests:

Add tests for shift family of instructions. Since
we can't generate i64 values to pass to wasm we only compile
the code for those functions. Attempting to generate any i64
code using these instructions would have been enough to cause
the B3 Validation error anyway.

* wasm/assert.js:
* wasm/function-tests/rotl.js: Added.
* wasm/function-tests/rotr.js: Added.
* wasm/function-tests/shl.js: Added.
* wasm/function-tests/shr-s.js: Added.
* wasm/function-tests/shr-u.js: Added.
* wasm/wasm.json:

Source/JavaScriptCore:

The Int64 versions of the shift family B3 opcodes take an Int32
for the shift value. Wasm, however, takes an i64, so we need to
Trunc the shift value. Also, this fixes a bug where shr_u mapped
to signed shift and shr_s mapped to the unsigned shift.

* wasm/wasm.json:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@209866 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/wasm/assert.js
JSTests/wasm/function-tests/rotl.js [new file with mode: 0644]
JSTests/wasm/function-tests/rotr.js [new file with mode: 0644]
JSTests/wasm/function-tests/shl.js [new file with mode: 0644]
JSTests/wasm/function-tests/shr-s.js [new file with mode: 0644]
JSTests/wasm/function-tests/shr-u.js [new file with mode: 0644]
JSTests/wasm/wasm.json
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wasm/wasm.json