summaryrefslogtreecommitdiff
path: root/src/shared-constants.h
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup shared constants (#1784)Sam Clegg2018-11-291-0/+2
|
* Share trap mode between asm2wasm and s2wasm (#1168)jgravelle-google2017-10-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Extract Asm2WasmBuilder::TrapMode to shared FloatTrapMode * Extract makeTrappingI32Binary * Extract makeTrappingI64Binary * Extract asm2wasm test script into scripts/test/asm2wasm.py This matches s2wasm.py, and makes iterating on asm2wasm slightly faster. * Simplify callsites with an arg struct * Combine func adding across i32 and i64 * Support f32-to-int in asm2wasm * Add BinaryenTrapMode pass, run pass from s2wasm * BinaryenTrapMode pass takes trap context as a parameter * Pass fully supports non-trapping binary ops * Defer adding functions until after iteration (hackily) * Update asm2wasm to work with deferred function adding, rebuild tests * Extract makeTrappingFloatToInt32 * Extract makeTrappingFloatToInt64 * Add unary conversions to trap pass * Add functions in the pass itself * Set s2wasm trap mode with command-line arguments * Print BINARYEN_PASS_DEBUG state when testing * Get asm2wasm using the BinaryenTrapMode pass instead of handling it inline * Also handle f32 to int in asm2wasm * Make BinaryenTrapMode only need a FloatTrapMode from the caller * Just pass the current binary Expression directly * Combine makeTrappingI32Binary with makeTrappingI64Binary * Pass Unary expr to makeTrappingFloatToInt32 * Unify makeTrappingFloatToInt32 & 64 * Move makeTrapping* functions inside BinaryenTrapMode, make addedFunctions non-static * Remove FloatTrapContext * Minor cleanups * Extract some smaller subfunctions * Emit name switch/casing, rename is32Bit to isI64 for consistency * Rename BinaryenTrapMode to FloatTrap, make trap mode a nested enum * Add some comments explaining why FloatTrap is non-parallel * Rename addedFunctions to generatedFunctions for precision * Rename move and split float-clamp.h to passes/FloatTrap.(h|cpp) * Use builder instead of allocator * Instantiate trap handling passes via the pass manager * Move passes/FloatTrap.h to ast/trapping.h * Add helper function to add trap-handling passes * Add trap mode pass tests * Rename FloatTrap.cpp to TrapMode.cpp * Add s2wasm trap mode tests. Force float->int conversion to be signed * Add trapping_sint_div_s test to unit.asm.js * Fix flake8 issues with test scripts * Update pass description comment * Extract building functions methods * Make generate functions into top-level functions * Add GeneratedTrappingFunctions class to manage function/import additions * Move ensure/makeTrapping functions outside class scope * Use GeneratedTrappingFunctions to add immediately in asm2wasm mode * Remove trapping_sint_div_s test We only added it to test that trapping divisions would get constant-folded at the correct time. Now that we're not changing the timing of trapping modes, the test is unneeded (and problematic). * Review feedback, add validator/*.wasm to .gitignore * Add support for unsigned float-to-int conversion * Use opcode directly instead of bools * Update s2wasm clamp test for unsigned ftoi
* Make header guards consistent (#997)Sam Clegg2017-05-041-1/+0
|
* wasm-merge tool (#919)Alon Zakai2017-04-171-0/+8
| | | | wasm-merge tool: combines two wasm files into a larger one, handling collisions, and aware of the dynamic linking conventions. it does not do full static linking, but may eventually.
* global parsingAlon Zakai2016-09-191-0/+1
|
* support module operations in shell testsAlon Zakai2016-09-171-1/+0
|
* support assert_malformed in shell test runnerAlon Zakai2016-09-161-3/+0
|
* support function table initial and max sizes, and new printing formatAlon Zakai2016-08-121-0/+2
|
* support expressions in segment offsetsAlon Zakai2016-08-121-0/+1
|
* add shared-constants.h for wasm constantsAlon Zakai2016-06-261-0/+56
|
* Split construction, scanning, and building phases of S2WasmBuilder (#400)Derek Schuff2016-04-271-104/+0
| | | | | | | | | | | Instead of doing all of the S2Wasm work in the constructor, split construction, scanning (to determine implemented functions) and building of the wasm module. This allows the linker to get the symbol information (e.g. implemented functions) without having to build an entire module (which will be useful for archives) and to allow the linker to link a new object into the existing one by building the wasm module in place on the existing module.
* refactor shell interface into its own fileAlon Zakai2016-04-041-1/+8
|
* de-recurse operations on nested blocksAlon Zakai2016-03-101-0/+1
|
* refactoring in preparation for then-else parsingAlon Zakai2016-03-071-0/+2
|
* support asm.js ceilAlon Zakai2016-02-211-0/+1
|
* Support startJF Bastien2016-02-051-0/+1
| | | | | | | | | | | | | | As spec'd in: https://github.com/WebAssembly/design/pull/495 And discussed in: https://github.com/WebAssembly/spec/issues/231 This will make it simpler and more uniform to add a start entry point. s2wasm is the right place to add start because it'll eventually need to do other basic setup, e.g. put code in start to setup the stack, as dschuff is doing in: https://github.com/WebAssembly/binaryen/pull/179 Or rather, the linker is the right place and s2wasm happens to act as our linker right now.
* s2wasm const parsing fixesAlon Zakai2015-12-231-0/+2
|
* Fix / uniformize include guardsJF Bastien2015-12-221-3/+3
|
* Fix the license headersJF Bastien2015-12-211-1/+16
| | | | This applies Apache 2.0 properly (as far as our lawyers have told me). We can do this early since all of the code was written by Alon Zakai.
* use Math.imul in wasm2asmAlon Zakai2015-12-071-0/+1
|
* emit heap views in wasm2asmAlon Zakai2015-12-061-0/+2
|
* emit 'use asm' in wasm2asmAlon Zakai2015-12-061-0/+1
|
* more wasm2asm progressAlon Zakai2015-12-041-1/+12
|
* refactor wasm.js so that it will be able to support multiple wasm loading ↵Alon Zakai2015-11-281-0/+60
methods