mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 11:45:32 +02:00
+ added AtomicStore() to the WebAssembly unit
This commit is contained in:
parent
f12752372f
commit
7cac9d2f02
@ -3031,7 +3031,7 @@ si_prc$(PPUEXT) : si_prc.pp $(SYSTEMUNIT)$(PPUEXT)
|
||||
$(COMPILER) $<
|
||||
si_dll$(PPUEXT) : si_dll.pp $(SYSTEMUNIT)$(PPUEXT)
|
||||
$(COMPILER) $<
|
||||
webassembly$(PPUEXT) : $(PROCINC)/webassembly.pp $(SYSTEMUNIT)$(PPUEXT) $(PROCINC)/cpuh.inc $(PROCINC)/cpuinnr.inc
|
||||
webassembly$(PPUEXT) : $(PROCINC)/webassembly.pp $(SYSTEMUNIT)$(PPUEXT) $(PROCINC)/cpuh.inc $(PROCINC)/cpuinnr.inc objpas$(PPUEXT)
|
||||
$(COMPILER) $<
|
||||
wasiapi$(PPUEXT) : wasiapi.pp wasiinc/wasitypes.inc wasiinc/wasiprocs.inc $(SYSTEMUNIT)$(PPUEXT)
|
||||
$(COMPILER) $< -Fiwasiinc
|
||||
|
@ -96,7 +96,7 @@ si_dll$(PPUEXT) : si_dll.pp $(SYSTEMUNIT)$(PPUEXT)
|
||||
# Other $(SYSTEMUNIT)-dependent RTL Units
|
||||
#
|
||||
|
||||
webassembly$(PPUEXT) : $(PROCINC)/webassembly.pp $(SYSTEMUNIT)$(PPUEXT) $(PROCINC)/cpuh.inc $(PROCINC)/cpuinnr.inc
|
||||
webassembly$(PPUEXT) : $(PROCINC)/webassembly.pp $(SYSTEMUNIT)$(PPUEXT) $(PROCINC)/cpuh.inc $(PROCINC)/cpuinnr.inc objpas$(PPUEXT)
|
||||
$(COMPILER) $<
|
||||
|
||||
wasiapi$(PPUEXT) : wasiapi.pp wasiinc/wasitypes.inc wasiinc/wasiprocs.inc $(SYSTEMUNIT)$(PPUEXT)
|
||||
|
@ -15,6 +15,8 @@
|
||||
|
||||
unit WebAssembly;
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
interface
|
||||
|
||||
procedure AtomicFence; inline;
|
||||
@ -28,6 +30,15 @@ function AtomicLoad(constref Mem: UInt32): UInt32; inline;
|
||||
function AtomicLoad(constref Mem: Int64): Int64; inline;
|
||||
function AtomicLoad(constref Mem: UInt64): UInt64; inline;
|
||||
|
||||
procedure AtomicStore(out Mem: Int8; Data: Int8); inline;
|
||||
procedure AtomicStore(out Mem: UInt8; Data: UInt8); inline;
|
||||
procedure AtomicStore(out Mem: Int16; Data: Int16); inline;
|
||||
procedure AtomicStore(out Mem: UInt16; Data: UInt16); inline;
|
||||
procedure AtomicStore(out Mem: Int32; Data: Int32); inline;
|
||||
procedure AtomicStore(out Mem: UInt32; Data: UInt32); inline;
|
||||
procedure AtomicStore(out Mem: Int64; Data: Int64); inline;
|
||||
procedure AtomicStore(out Mem: UInt64; Data: UInt64); inline;
|
||||
|
||||
function AtomicAdd(var Mem: Int8; Data: Int8): Int8; inline;
|
||||
function AtomicAdd(var Mem: UInt8; Data: UInt8): UInt8; inline;
|
||||
function AtomicAdd(var Mem: Int16; Data: Int16): Int16; inline;
|
||||
@ -140,6 +151,46 @@ begin
|
||||
AtomicLoad:=UInt64(fpc_wasm32_i64_atomic_load(@Mem));
|
||||
end;
|
||||
|
||||
procedure AtomicStore(out Mem: Int8; Data: Int8); inline;
|
||||
begin
|
||||
fpc_wasm32_i32_atomic_store8(@Mem,Byte(Data));
|
||||
end;
|
||||
|
||||
procedure AtomicStore(out Mem: UInt8; Data: UInt8); inline;
|
||||
begin
|
||||
fpc_wasm32_i32_atomic_store8(@Mem,Data);
|
||||
end;
|
||||
|
||||
procedure AtomicStore(out Mem: Int16; Data: Int16); inline;
|
||||
begin
|
||||
fpc_wasm32_i32_atomic_store16(@Mem,Word(Data));
|
||||
end;
|
||||
|
||||
procedure AtomicStore(out Mem: UInt16; Data: UInt16); inline;
|
||||
begin
|
||||
fpc_wasm32_i32_atomic_store16(@Mem,Data);
|
||||
end;
|
||||
|
||||
procedure AtomicStore(out Mem: Int32; Data: Int32); inline;
|
||||
begin
|
||||
fpc_wasm32_i32_atomic_store(@Mem,LongWord(Data));
|
||||
end;
|
||||
|
||||
procedure AtomicStore(out Mem: UInt32; Data: UInt32); inline;
|
||||
begin
|
||||
fpc_wasm32_i32_atomic_store(@Mem,Data);
|
||||
end;
|
||||
|
||||
procedure AtomicStore(out Mem: Int64; Data: Int64); inline;
|
||||
begin
|
||||
fpc_wasm32_i64_atomic_store(@Mem,QWord(Data));
|
||||
end;
|
||||
|
||||
procedure AtomicStore(out Mem: UInt64; Data: UInt64); inline;
|
||||
begin
|
||||
fpc_wasm32_i64_atomic_store(@Mem,Data);
|
||||
end;
|
||||
|
||||
function AtomicAdd(var Mem: Int8; Data: Int8): Int8; inline;
|
||||
begin
|
||||
AtomicAdd:=Int8(fpc_wasm32_i32_atomic_rmw8_add_u(@Mem,Byte(Data)));
|
||||
|
Loading…
Reference in New Issue
Block a user