mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 16:29:21 +02:00
+ support intrinsics for the WebAssembly memory.atomic.wait32 and memory.atomic.wait64 instructions
This commit is contained in:
parent
3cfdf000a2
commit
86643710c4
@ -74,5 +74,9 @@
|
||||
in_wasm32_i64_atomic_rmw8_cmpxchg_u = in_cpu_first+52,
|
||||
in_wasm32_i64_atomic_rmw16_cmpxchg_u = in_cpu_first+53,
|
||||
in_wasm32_i64_atomic_rmw32_cmpxchg_u = in_cpu_first+54,
|
||||
in_wasm32_i64_atomic_rmw_cmpxchg = in_cpu_first+55
|
||||
in_wasm32_i64_atomic_rmw_cmpxchg = in_cpu_first+55,
|
||||
|
||||
in_wasm32_memory_atomic_wait32 = in_cpu_first+56,
|
||||
in_wasm32_memory_atomic_wait64 = in_cpu_first+57,
|
||||
in_wasm32_memory_atomic_notify = in_cpu_first+58
|
||||
|
||||
|
@ -583,6 +583,12 @@ implementation
|
||||
CheckParameters(3);
|
||||
resultdef:=u64inttype;
|
||||
end;
|
||||
in_wasm32_memory_atomic_wait32,
|
||||
in_wasm32_memory_atomic_wait64:
|
||||
begin
|
||||
CheckParameters(3);
|
||||
resultdef:=s32inttype;
|
||||
end;
|
||||
else
|
||||
Result:=inherited pass_typecheck_cpu;
|
||||
end;
|
||||
@ -650,7 +656,9 @@ implementation
|
||||
in_wasm32_i64_atomic_rmw8_cmpxchg_u,
|
||||
in_wasm32_i64_atomic_rmw16_cmpxchg_u,
|
||||
in_wasm32_i64_atomic_rmw32_cmpxchg_u,
|
||||
in_wasm32_i64_atomic_rmw_cmpxchg:
|
||||
in_wasm32_i64_atomic_rmw_cmpxchg,
|
||||
in_wasm32_memory_atomic_wait32,
|
||||
in_wasm32_memory_atomic_wait64:
|
||||
expectloc:=LOC_REGISTER;
|
||||
else
|
||||
Result:=inherited first_cpu;
|
||||
@ -773,6 +781,10 @@ implementation
|
||||
second_atomic_rmw_x_y_z(a_i64_atomic_rmw32_cmpxchg_u);
|
||||
in_wasm32_i64_atomic_rmw_cmpxchg:
|
||||
second_atomic_rmw_x_y_z(a_i64_atomic_rmw_cmpxchg);
|
||||
in_wasm32_memory_atomic_wait32:
|
||||
second_atomic_rmw_x_y_z(a_memory_atomic_wait32);
|
||||
in_wasm32_memory_atomic_wait64:
|
||||
second_atomic_rmw_x_y_z(a_memory_atomic_wait64);
|
||||
else
|
||||
inherited pass_generate_code_cpu;
|
||||
end;
|
||||
|
@ -81,3 +81,6 @@ function fpc_wasm32_i64_atomic_rmw16_cmpxchg_u(Dest: PWord; Expected, Replacemen
|
||||
function fpc_wasm32_i64_atomic_rmw32_cmpxchg_u(Dest: PWord; Expected, Replacement: QWord): QWord;[internproc:fpc_in_wasm32_i64_atomic_rmw32_cmpxchg_u];
|
||||
function fpc_wasm32_i64_atomic_rmw_cmpxchg_u(Dest: PLongWord; Expected, Replacement: QWord): QWord;[internproc:fpc_in_wasm32_i64_atomic_rmw_cmpxchg];
|
||||
|
||||
function fpc_wasm32_memory_atomic_wait32(Dest: PLongWord; Expected: LongWord; Timeout: Int64): LongInt;[internproc:fpc_in_wasm32_memory_atomic_wait32];
|
||||
function fpc_wasm32_memory_atomic_wait64(Dest: PQWord; Expected: QWord; Timeout: Int64): LongInt;[internproc:fpc_in_wasm32_memory_atomic_wait64];
|
||||
|
||||
|
@ -76,3 +76,7 @@
|
||||
fpc_in_wasm32_i64_atomic_rmw32_cmpxchg_u = fpc_in_cpu_first+54;
|
||||
fpc_in_wasm32_i64_atomic_rmw_cmpxchg = fpc_in_cpu_first+55;
|
||||
|
||||
fpc_in_wasm32_memory_atomic_wait32 = fpc_in_cpu_first+56;
|
||||
fpc_in_wasm32_memory_atomic_wait64 = fpc_in_cpu_first+57;
|
||||
fpc_in_wasm32_memory_atomic_notify = fpc_in_cpu_first+58;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user