summaryrefslogtreecommitdiff
path: root/src/literal.h
Commit message (Collapse)AuthorAgeFilesLines
...
* fix binaryen.js bindings handling of literals (#1896)Alon Zakai2019-02-061-12/+11
| | | The hardcoded 16 size was no longer valid. This was broken for a while, but happened to not overwrite important memory. Testing with the wasm backend did hit breakage.
* Rename `idx` to `index` in SIMD code for consistency (#1836)Thomas Lively2018-12-181-14/+14
|
* Fuzzing v128 and associated bug fixes (#1827)Thomas Lively2018-12-141-1/+1
| | | | * Fuzzing v128 and associated bug fixes
* SIMD (#1820)Thomas Lively2018-12-131-6/+214
| | | | | | | | | Implement and test the following functionality for SIMD. - Parsing and printing - Assembling and disassembling - Interpretation - C API - JS API
* Update wrap and demote literal op names (#1817)Thomas Lively2018-12-121-6/+5
| | | | | | * Update literal op names * Remove `demoteToF32` in favor of `demote`
* Implement nontrapping float-to-int instructions (#1780)Thomas Lively2018-12-041-4/+9
|
* Change the Literal class's operator== to be bitwise (#1661)Alon Zakai2018-09-011-1/+6
| | | | | The change means that nan values will be compared bitwise when writing A == B, and so the float rule of a nan is different from itself would not apply. I think this is a safer default. In particular this PR fixes a fuzz bug in the rse pass, which placed Literals in a hash table, and due to nan != nan, an infinite loop... Also, looks like we really want a bitwise comparison pretty much everywhere anyhow, as can be seen in the diff here. Really the single place we need a floaty comparison is in the intepreter where we implement f32.eq etc., and there the code was already using the proper code path anyhow.
* Refactor interpreter (#1508)Alon Zakai2018-04-131-6/+5
| | | | | | * Move more logic to the Literal class. We now leave all the work to there, except for handling traps. * Avoid switching on the type, then the opcode, then Literal method usually switches on the type again - instead, do one big switch for the opcodes (then the Literal method is unchanged) which is shorter and clearer, and avoids that first switching.
* Rename WasmType => Type (#1398)Alon Zakai2018-02-021-18/+18
| | | | * rename WasmType to Type. it's in the wasm:: namespace anyhow, and without Wasm- it fits in better alongside Index, Address, Expression, Module, etc.
* disambiguate hash usage (#1182)Alon Zakai2017-09-131-2/+2
|
* precompute-propagate pass (#1179)Alon Zakai2017-09-121-1/+5
| | | | | | | Implements #1172: this adds a variant of precompute, "precompute-propagate", which also does constant propagation. Precompute by itself just runs the interpreter on each expression and sees if it is in fact a constant; precompute-propagate also looks at the graph of connections between get and set locals, and propagates those constant values. This helps with cases as noticed in #1168 - while in most cases LLVM will do this already, it's important when inlining, e.g. inlining of the clamping math functions. This new pass is run when inlining, and otherwise only in -O3/-Oz, as it does increase compilation time noticeably if run on everything (and for almost no benefit if LLVM has run). Most of the code here is just refactoring out from the ssa pass the get/set graph computation, so it can now be used by both the ssa pass and precompute-propagate.
* Const hoisting (#1176)Alon Zakai2017-09-121-3/+23
| | | A pass that hoists repeating constants to a local, and replaces their uses with a get of that local. This can reduce binary size, but can also *increase* gzip size, so it's mostly for experimentation and not used by default.
* Wasm h to cpp (#926)jgravelle-google2017-03-101-0/+151
* Move WasmType function implementations to wasm.cpp * Move Literal methods to wasm.cpp * Reorder wasm.cpp shared constants back to top * Move expression functions to wasm.cpp * Finish moving things to wasm.cpp * Split out Literal into its own .h/.cpp. Also factor out common wasm-type module * Remove unneeded/transitive includes from wasm.h * Add comment to try/check methods * Rename tryX/checkX methods to getXOrNull * Add missing include that should fix appveyor build breakage * More appveyor