Implement the division and modulo instructions in WebAssembly
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Sep 2015 00:14:21 +0000 (00:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Sep 2015 00:14:21 +0000 (00:14 +0000)
commitfc2ad6fb4d6844c3d27a6bf2c6eda06b9dd2b4af
tree5a023e018b0b17afbbc05f1ccaf5c2d484600020
parent60903c12bc550fafd5c054a1c97ca4e50c923d1f
Implement the division and modulo instructions in WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=148791

Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2015-09-04
Reviewed by Geoffrey Garen.

This patch implements the unsigned division, signed modulo, and unsigned
modulo instructions for 32-bit integers in WebAssembly. It also
implements the context pool index instructions, which are needed for
testing. (pack-asmjs puts numbers that are used more than once in the
constant pool.)

* assembler/X86Assembler.h:
(JSC::X86Assembler::divl_r):
* tests/stress/wasm-arithmetic.js:
* tests/stress/wasm-arithmetic.wasm:
* wasm/WASMFunctionCompiler.h:
(JSC::operationMod):
(JSC::operationUnsignedDiv):
(JSC::operationUnsignedMod):
(JSC::WASMFunctionCompiler::buildBinaryI32):
(JSC::WASMFunctionCompiler::callOperation):
* wasm/WASMFunctionParser.cpp:
(JSC::WASMFunctionParser::parseExpressionI32):
(JSC::WASMFunctionParser::parseConstantPoolIndexExpressionI32):
* wasm/WASMFunctionParser.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/X86Assembler.h
Source/JavaScriptCore/tests/stress/wasm-arithmetic.js
Source/JavaScriptCore/tests/stress/wasm-arithmetic.wasm
Source/JavaScriptCore/wasm/WASMFunctionCompiler.h
Source/JavaScriptCore/wasm/WASMFunctionParser.cpp
Source/JavaScriptCore/wasm/WASMFunctionParser.h