Nikolay Nikolov
5e813e62f2
+ added function fpc_wasm_invoke_helper to the WebAssembly RTL
2025-01-25 08:21:56 +02:00
Michaël Van Canneyt
925091d0d1
* Fix compilation when using threading
2025-01-23 14:48:57 +01:00
Sven/Sarah Barth
f29fe358ad
- remove unnecessary defines
2025-01-08 23:06:29 +01:00
Sven/Sarah Barth
40725146cc
+ add intrinsic for 8-bit atomic cmpxchg for wasm32 (this way the fallback for cmxchg is no longer used for wasm32)
2025-01-08 23:06:29 +01:00
Michaël Van Canneyt
8488c87b20
* New fix for fpc_atomic_cmp_xchg_alu, as suggested by Sven
2025-01-08 14:56:16 +01:00
Sven/Sarah Barth
e94d02a067
* with all existing RTLs switched over to the atomic intrinsics, the define FPC_SYSTEM_INTERLOCKED_USE_INTRIN can be removed again
2024-12-12 22:05:20 +01:00
Sven/Sarah Barth
573b82c67f
* switch WebAssembly RTL to provide atomic intrinsic helpers instead of Interlocked* functions
2024-12-12 22:05:18 +01:00
Nikolay Nikolov
b340994e1b
* proper implementation for the function Sptr (which returns the stack pointer) for WebAssembly
2024-08-06 03:16:41 +03:00
Nikolay Nikolov
cdba427bcf
+ added WASI multithreading helper for setting the stack pointer for the linear stack
2024-05-13 14:00:36 +02:00
Michaël Van Canneyt
8c8f8088eb
* Seems not all was committed
2024-05-13 14:00:34 +02:00
Michaël Van Canneyt
27133cb66d
* Wasm Threads (WIP)
2024-05-13 13:58:36 +02:00
Michael VAN CANNEYT
ccfa38c68e
* Dotted RTL compiles
2023-07-27 19:04:03 +02:00
Jonas Maebe
0758aa1143
FPU exception mask: generlised system unit interface
2022-10-17 19:43:01 +00:00
Nikolay Nikolov
e3139fea21
+ setup a thread manager (functions are still not yet implemented), when the WASI RTL is compiled with multithreading support
2022-07-14 05:14:20 +03:00
Nikolay Nikolov
b900be6142
+ added WebAssembly intrinsics for reading __tls_size, __tls_align and __tls_base
2022-07-14 04:15:47 +03:00
Nikolay Nikolov
bc6ab39ea2
* WebAssembly exceptions fix: fixed raise without parameters in except..end
...
blocks in WebAssembly native and branchful exceptions mode. Fixes #39752
2022-06-21 05:43:35 +03:00
Nikolay Nikolov
48f115686d
+ print more exceptions debug info, when the WebAssembly RTL is compiled with -dEXCDEBUG
2022-06-21 04:47:04 +03:00
Nikolay Nikolov
1ce1a0fe1f
* added non-atomic implementations of the atomic operations in the WebAssembly unit, used when the RTL is compiled without -CTwasmthreads
2022-05-28 02:17:20 +03:00
Nikolay Nikolov
3cb4952745
* AtomicWait marked as inline
2022-05-25 20:18:07 +03:00
Nikolay Nikolov
a916aa36d8
+ added AtomicNotify() to the WebAssembly unit
2022-05-25 20:16:50 +03:00
Nikolay Nikolov
19cce3e42e
+ added AtomicWait() to the WebAssembly unit
2022-05-25 20:11:54 +03:00
Nikolay Nikolov
7cac9d2f02
+ added AtomicStore() to the WebAssembly unit
2022-05-25 19:39:17 +03:00
Nikolay Nikolov
16f5863847
+ added WebAssembly atomic store intrinsics
2022-05-25 19:22:45 +03:00
Nikolay Nikolov
219294c02b
+ added AtomicLoad() to the WebAssembly unit
2022-05-25 19:05:28 +03:00
Nikolay Nikolov
0103964250
+ implemented WebAssembly atomic load intrinsics
2022-05-25 18:55:41 +03:00
Nikolay Nikolov
9274f17c52
+ reserved inline numbers for the WebAssembly atomic loads and stores
2022-05-24 16:06:05 +03:00
Nikolay Nikolov
7fa8f514af
+ added AtomicCompareExchange() to the WebAssembly unit
2022-05-24 15:40:13 +03:00
Nikolay Nikolov
9ba01e7aee
+ added AtomicExchange() to the WebAssembly unit
2022-05-24 15:24:25 +03:00
Nikolay Nikolov
362cabe684
+ added AtomicAnd(), AtomicOr() and AtomicXor() to the WebAssembly unit
2022-05-24 15:21:59 +03:00
Nikolay Nikolov
99d66b4c93
+ added AtomicAdd() and AtomicSub() intrinsics to the WebAssembly unit
2022-05-24 15:16:40 +03:00
Nikolay Nikolov
585d0cf574
+ added unit WebAssembly for WebAssembly-specific stuff. Currently contains
...
the AtomicFence intrinsic, which emits the atomic.fence instruction.
2022-05-24 14:50:42 +03:00
Nikolay Nikolov
d9781bcebe
+ added except_branchful.inc as a system unit dependency include file to wasm32/makefile.cpu
2022-05-24 14:10:04 +03:00
Nikolay Nikolov
47c271dcd0
+ implemented InterlockedIncrement, InterlockedDecrement, InterlockedExchange,
...
InterlockedCompareExchange and InterlockedExchangeAdd for WebAssembly in a
thread safe way, using the thread and atomics extension, when the RTL is
compiled with -dFPC_WASM_THREADS
2022-05-22 06:34:10 +03:00
Nikolay Nikolov
f1cb5d8f71
+ support intrinsic for the memory.atomic.notify WebAssembly instruction
2022-05-21 18:03:14 +03:00
Nikolay Nikolov
86643710c4
+ support intrinsics for the WebAssembly memory.atomic.wait32 and memory.atomic.wait64 instructions
2022-05-21 17:53:38 +03:00
Nikolay Nikolov
e376851fd8
* fixes to the WebAssembly atomic function intrinsics
2022-05-21 16:29:28 +03:00
Nikolay Nikolov
e03b920520
+ added intrinsic support for the WebAssembly cmpxchg atomic operations as well
2022-05-21 02:52:31 +03:00
Nikolay Nikolov
d8f06aa4f1
+ added instrinsic support for the all the 2-parameter read-modify-write
...
WebAssembly atomic operations (add, sub, and, or, xor, xchg). Note that they
are not implemented in the internal assembler, yet.
2022-05-20 17:36:37 +03:00
Nikolay Nikolov
1d70437017
+ added intrinsic (for RTL internal use) that emits the WebAssembly atomic.fence instruction
2022-05-13 22:46:27 +03:00
Nikolay Nikolov
a62c7555d7
- removed the DebugWriteXXX functions from the WASI system unit, since console
...
output is now quite stable and can be used for debugging
2021-10-10 20:25:29 +03:00
Nikolay Nikolov
387c80cc57
+ default exception handling in WebAssembly native exceptions mode
2021-10-05 08:02:39 +03:00
Nikolay Nikolov
d9eb8d75b9
+ return a small, fake backtrace for WebAssembly, so that in case of a runtime
...
error, the message 'Runtime error XXX at $EEEEEEEE' appears.
2021-10-05 04:44:52 +03:00
Nikolay Nikolov
c0cec218d6
+ added unhandled exception handling code for the branchful exceptions mode
2021-10-05 04:06:56 +03:00
Nikolay Nikolov
7afb665c92
+ insert exception flag check and branch after each function call, when
...
compiling in WebAssembly branchful exceptions mode
2021-10-05 02:26:13 +03:00
Nikolay Nikolov
30b503abc4
* instead of using the 'throw' intrinsic, set a boolean flag, in the branchful
...
exceptions support code
2021-10-05 00:49:29 +03:00
Nikolay Nikolov
5124ab2521
* cloned the WebAssembly native exceptions code generation and rtl support into
...
the branchful exceptions (which will be modified later, but we're using this
as their starting point, because we can get a snapshot built, without compiler
internal errors)
2021-10-05 00:37:20 +03:00
Nikolay Nikolov
3258937d97
+ implemented move() for WebAssembly via the memory.copy instruction
2021-10-02 21:33:28 +03:00
Nikolay Nikolov
2e3e3edb5f
+ implemented FillChar for WebAssembly via the memory.fill instruction
2021-10-02 20:31:37 +03:00
Nikolay Nikolov
85207e94f8
+ added inline numbers for a memory.copy and a memory.fill intrinsic
2021-10-02 19:40:36 +03:00
Nikolay Nikolov
3836b0be04
* longjmp in fpc_reraise changed to a throw instruction intrinsic in wasm native exceptions mode
2021-09-28 04:02:52 +03:00