summaryrefslogtreecommitdiff
path: root/src/prebuilt
Commit message (Collapse)AuthorAgeFilesLines
* wasm2c: harmonize bulk mem ops re: i32/i64 (#2506) + parametrize memchecks ↵HEADmainKeith Winstein2024-12-173-141/+246
| | | | | | | | | | | | | | | | | per-memory (#2507) The PR updates the bulk memory operations (memory.fill, memory.copy, table.fill, etc.) to support 64-bit addresses and counts. Previously these functions only took u32's, even with memory64 enabled. (#2506) This PR also allows "software-bounds-checked" memories and "guard-page-checked" memories to coexist in the same module. It creates two versions of every memory operation: an unrestricted version (that works with any memory) and a _default32 version (for memories with default page size and i32 indexing). (#2507) #2506 and #2507 have been squashed together to avoid a performance regression. This is a stepping stone to supporting custom-page-sizes (which will need to be software-bounds-checked) (#2508).
* binary/wat: Implement EHv4 (#2470)Soni L.2024-11-201-1308/+1281
| | | | This pull request implements EHv4. Binary is mostly untested until interp is working.
* Add support for the custom-page-sizes proposal (#2502)Keith Winstein2024-11-081-60/+62
| | | | This adds support in the binary/text parsers and writers, the validator and interpreter, and objdump (but not wasm2c).
* lexer-keywords.txt: Recognize exn and exnref (#2493)Soni L.2024-10-241-828/+844
| | | (`TokenType::Exn` already exists for some reason)
* wasm2c: Cleanup of handling of WASM_RT_USE_SEGUE macroShravan Narayan2024-10-141-47/+7
|
* wasm2c: Add segue option to make exclusive use of the segment registerShravan Narayan2024-09-181-1/+15
|
* wasm2c: Segue support for CPUs without wrgsbase instructionsShravan Narayan2024-09-061-6/+38
|
* wasm2c: Segue optimization for modules with a single unshared memory (#2395)Shravan Narayan2024-06-261-14/+107
|
* Update testsuite and corresponding update to comment parser (#2416)Sam Clegg2024-05-131-1061/+1044
| | | | | | | The main change here is because `comments.wast` was updated to include a "quoted" module at the top level. Previously quoted modules had only been used as part of invalid or malformed assertion expressions.
* Revert manual changes to src/prebuilt/lexer-keywords.cc. NFC (#2412)Sam Clegg2024-05-031-13/+13
| | | | | | This file is auto-generated but I had manually edited it #2091. Instead, disabled the clang fallthrough warnings when including this file.
* Add macOS arm64 support and CI testing (#2406)Soni L2024-03-261-0/+4
|
* wasm2c: Implement big-endian SIMD (#2340)Soni L2024-02-061-5/+439
|
* Remove unnecessary restriction (#2378)Soni L2024-01-311-24/+19
| | | | Thanks to MEM_ADDR we don't need to think about big-endian vs little-endian for any scalar(!) operations.
* wasm2c: atomic and shared mem operations using c11Shravan Narayan2024-01-301-214/+223
|
* wasm2c: Cleanup/separate code for heap and stack signal handlersShravan Narayan2023-12-141-1/+1
|
* wasm2c: Improve address abstraction for BE support (#2328)Soni L2023-11-143-114/+100
|
* wasm2c: implement the tail-call proposal (#2272)Keith Winstein2023-10-241-4/+48
|
* Implement custom section reading/writing (#2284)Diego Frias2023-09-151-1259/+1284
|
* [wasm2c] Use wasm_rt_memcpy everywhere in generated code (#2292)Sam Clegg2023-09-091-15/+15
|
* Share reading/validation code between elem exprs & other const exprs (#2288)Keith Winstein2023-09-061-5/+31
| | | | | | This continues the work from #1783 and reduces special handling of elem exprs, by treating them the same as other const expressions (init expressions).
* wasm2c: add link to clang bug on mips force read constraintShravan Narayan2023-07-301-0/+2
|
* wasm2c: ensure force read constraints compile for clang on mipsShravan Narayan2023-07-303-31/+47
|
* wasm2c: fix bug in windows atomic load macroShravan Narayan2023-06-191-4/+4
|
* wasm2c: partial support for atomic memory opsShravan Narayan2023-05-171-0/+438
|
* wasm2c: include simd128.h and wasm-rt-exceptions.h where necessary (#2236)Keith Winstein2023-05-123-257/+225
| | | Co-authored-by: Shravan Narayan <shravanrn@gmail.com>
* wasm2c: Enable exceptions and simd according to command line flagsShravan Narayan2023-05-021-0/+7
|
* alloca() lives in <stdlib.h> on OpenBSD too (fixes #2216) (#2217)Landry Breuil2023-04-261-1/+1
| | | per http://man.openbsd.org/alloca.3
* wasm2c: Use malloc.h instead of alloca.h for mingwShravan Narayan2023-04-241-1/+5
|
* wasm2c.includes.c: replace alloca.h with stdlib.h on FreeBSD (#2212)Petr Penzin2023-04-221-0/+4
|
* wasm2c: Separate the macros for allocation and bounds checks strategiesShravan Narayan2023-04-121-1/+1
|
* wasm2c: Checkin prebuilt source code in source folder, add lint checks to ↵Shravan Narayan2023-04-114-0/+1428
| | | | ensure these are up to date
* Use C++17's [[fallthrough]]. NFC (#2091)Sam Clegg2023-02-271-13/+13
|
* Implement Relaxed SIMD proposal (#1994)Marcus Better2022-11-301-1251/+1315
| | | | | | | | This adds support for the new opcodes from the Relaxed SIMD proposal (https://github.com/WebAssembly/relaxed-simd) behind the "--enable-relaxed-simd" flag. The exception is the f32x4.relaxed_dot_bf16x8_add_f32x4 instruction which is not yet implemented.
* wasm2c: simplify handling of templated code (#1940)Keith Winstein2022-07-112-356/+0
| | | Store templated wasm2c code as .h/.c; build templates on demand
* Format wasm2c templated code (#1942)Keith Winstein2022-07-082-92/+115
|
* wasm2c: Always use a module prefix and set one by default (#1897)Sam Clegg2022-04-141-14/+5
| | | | | | | | | | | | The module prefix is no longer optional and is now set by default to the name of the module as given in the name section, or taken from the name of the input file. A new `-n/--module-name` command line flag can also be used to override. The prefix used by the generated code is now fixed at wasm2c time which makes the output code easier to read and also avoid the symbol pasting in the C pre-processor which makes the source hard to understand. For example, it makes symbols hard to `grep` for.
* Fix spelling typo in wasm2c output. NFC (#1900)Sam Clegg2022-04-142-2/+2
|
* wasm2c: use signal handler to detect stack exhaustion (#1875)Keith Winstein2022-04-041-0/+6
| | | | | | On MacOS, merge OOB and exhaustion traps. (Linux distinguishes these as SEGV_ACCERR vs. SEGV_MAPERR in the si_code, but MacOS seems to deliver a SEGV_ACCERR for both.) Add wasm_rt_init() and wasm_rt_free() functions to wasm-rt.h that the embedder must call to set up and clean up the runtime state. (If the embedder doesn't call these, OOB and exhaustion will result in an uncaught segfault.)
* Add windows implementation of wasm2c runtime (#1843)Sam Clegg2022-03-091-26/+102
| | | | | | | All tests are now passing with cl.exe under x64. With x86 there are some test failure that I believe relate the use of the x87 registers to pass floating point numbers. I suggest we look into fixing those as a followup. Split out from #1833
* Fix compiler warnings in wasm2c output (#1844)Sam Clegg2022-03-022-23/+26
| | | | | Use stricter compiler settings and fix the resulting warnings. This is precursor to landing windows compiler support for wasm2c. See #1843.
* wasm2c: bounds-check active data loads (#1829)Keith Winstein2022-02-171-4/+12
| | | | | | | | | | | | | The bulk-memory proposal changed OOB access (when loading an active data segment) from a validation failure to an initialization-time trap, but wasm2c wasn't checking OOB access in LOAD_DATA(). When WASM_RT_MEMCHECK_SIGNAL_HANDLER is unset, this could produce memory corruption. When WASM_RT_MEMCHECK_SIGNAL_HANDLER is set, this led to failure in the new "data" tests that verify that modules with zero-length active data segments are uninstantiable if offset > mem.size. Add an unconditional bounds-check and restore the `test/wasm2c/spec/data.txt` test (one of the failing tests tracked at #1737).
* Finish instruction renaming (#1792)Heejin Ahn2021-12-201-1448/+1280
| | | | | | | | | | | | | This finishes #985. This - replaces the old names in the tests with the new names - drops support for the deprecated names - renames test files to match new instruction names I don't think dropping support for the old names will be a problem at this point. #985 says the old names are supported for convenience but we should remove those too at some point; that "some point" may have well arrived given that three years have passed. The lists of names updated are in #933, #1564, WebAssembly/spec#720.
* Add specification tests for exception handling proposal (#1764)Asumu Takikawa2021-12-061-2831/+1071
| | | | | | | | This PR imports the spec tests from the Wasm testsuite repo and adds infrastructure to run them correctly. * Adds test expectations for exception handling proposal spec tests. * Adds missing tag signature matching code for import tests. * Adds support for the `assert_exception` command used in new tests. * Fix filename normalization for the spec test runner.
* Support function references in parameters and results of functions and ↵Dmitry Bezhetskov2021-11-161-1264/+3068
| | | | blocks. (#1695)
* Add clang-format check to CI (#1683)Heejin Ahn2021-08-051-0/+2
| | | | | | | | | | This adds clang-format check to the CI. This only checks the diff so it doesn't affect the other parts of the codebase. Also generated files in src/prebuilt/ directories are excluded from the check. A new src/prebuilt/.clang-format is added to disable the check in the directory. scripts/clang-format-diff.sh is copied from the same file we are using in Binaryen.
* Begin support for typed function references proposal: added the flag and ↵Dmitry Bezhetskov2021-07-251-598/+600
| | | | supported call_ref (#1691)
* wasm2c: Support multi-value (#1686)Soni L2021-07-141-2/+2
|
* [EH] Remove `unwind` (#1682)Heejin Ahn2021-06-291-3/+2
| | | `unwind` was removed. See WebAssembly/exception-handling#156.
* wasm2c: Support saturating-float-to-int (#1680)Soni L2021-06-281-0/+22
|
* [EH] Replace event with tag (#1678)Heejin Ahn2021-06-221-1138/+1131
| | | | | | | | | | | We recently decided to change 'event' to 'tag', and 'event section' to 'tag section', out of the rationale that the section contains a generalized tag that references a type, which may be used for something other than exceptions, and the name 'event' can be confusing in the web context. See - https://github.com/WebAssembly/exception-handling/issues/159#issuecomment-857910130 - https://github.com/WebAssembly/exception-handling/pull/161