+ support intrinsic for the memory.atomic.notify WebAssembly instruction

This commit is contained in:
Nikolay Nikolov 2022-05-21 18:03:14 +03:00
parent 86643710c4
commit f1cb5d8f71
2 changed files with 10 additions and 1 deletions

View File

@ -589,6 +589,11 @@ implementation
CheckParameters(3);
resultdef:=s32inttype;
end;
in_wasm32_memory_atomic_notify:
begin
CheckParameters(2);
resultdef:=u32inttype;
end;
else
Result:=inherited pass_typecheck_cpu;
end;
@ -658,7 +663,8 @@ implementation
in_wasm32_i64_atomic_rmw32_cmpxchg_u,
in_wasm32_i64_atomic_rmw_cmpxchg,
in_wasm32_memory_atomic_wait32,
in_wasm32_memory_atomic_wait64:
in_wasm32_memory_atomic_wait64,
in_wasm32_memory_atomic_notify:
expectloc:=LOC_REGISTER;
else
Result:=inherited first_cpu;
@ -785,6 +791,8 @@ implementation
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);
in_wasm32_memory_atomic_notify:
second_atomic_rmw_x_y(a_memory_atomic_notify);
else
inherited pass_generate_code_cpu;
end;

View File

@ -83,4 +83,5 @@ function fpc_wasm32_i64_atomic_rmw_cmpxchg_u(Dest: PLongWord; Expected, Replacem
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];
function fpc_wasm32_memory_atomic_notify(Address: Pointer; Count: LongWord): LongWord;[internproc:fpc_in_wasm32_memory_atomic_notify];