mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-03 17:39:56 +01:00
+ added the memory.copy and memory.fill WebAssembly instructions
This commit is contained in:
parent
cc5ee6b868
commit
026d23632a
@ -86,7 +86,7 @@ interface
|
|||||||
id : tasm;
|
id : tasm;
|
||||||
idtxt : string[12];
|
idtxt : string[12];
|
||||||
asmbin : string[16];
|
asmbin : string[16];
|
||||||
asmcmd : string[100];
|
asmcmd : string[113];
|
||||||
supported_targets : set of tsystem;
|
supported_targets : set of tsystem;
|
||||||
flags : set of tasmflags;
|
flags : set of tasmflags;
|
||||||
labelprefix : string[3];
|
labelprefix : string[3];
|
||||||
|
|||||||
@ -542,6 +542,10 @@ uses
|
|||||||
a_memory_size,
|
a_memory_size,
|
||||||
a_memory_grow:
|
a_memory_grow:
|
||||||
result:=2;
|
result:=2;
|
||||||
|
a_memory_copy:
|
||||||
|
result:=4;
|
||||||
|
a_memory_fill:
|
||||||
|
result:=3;
|
||||||
a_i32_const:
|
a_i32_const:
|
||||||
begin
|
begin
|
||||||
if ops<>1 then
|
if ops<>1 then
|
||||||
@ -873,6 +877,19 @@ uses
|
|||||||
WriteByte($40);
|
WriteByte($40);
|
||||||
WriteByte($00);
|
WriteByte($00);
|
||||||
end;
|
end;
|
||||||
|
a_memory_copy:
|
||||||
|
begin
|
||||||
|
WriteByte($FC);
|
||||||
|
WriteUleb(10);
|
||||||
|
WriteByte($00);
|
||||||
|
WriteByte($00);
|
||||||
|
end;
|
||||||
|
a_memory_fill:
|
||||||
|
begin
|
||||||
|
WriteByte($FC);
|
||||||
|
WriteUleb(11);
|
||||||
|
WriteByte($00);
|
||||||
|
end;
|
||||||
a_i32_eqz:
|
a_i32_eqz:
|
||||||
WriteByte($45);
|
WriteByte($45);
|
||||||
a_i32_eq:
|
a_i32_eq:
|
||||||
|
|||||||
@ -247,7 +247,7 @@ implementation
|
|||||||
id : as_wasm32_llvm_mc;
|
id : as_wasm32_llvm_mc;
|
||||||
idtxt : 'LLVM-MC';
|
idtxt : 'LLVM-MC';
|
||||||
asmbin : 'llvm-mc';
|
asmbin : 'llvm-mc';
|
||||||
asmcmd : '--assemble --arch=wasm32 -mattr=+sign-ext,+exception-handling --filetype=obj -o $OBJ $EXTRAOPT $ASM';
|
asmcmd : '--assemble --arch=wasm32 -mattr=+sign-ext,+exception-handling,+bulk-memory --filetype=obj -o $OBJ $EXTRAOPT $ASM';
|
||||||
supported_targets : [system_wasm32_embedded,system_wasm32_wasi];
|
supported_targets : [system_wasm32_embedded,system_wasm32_wasi];
|
||||||
flags : [af_smartlink_sections];
|
flags : [af_smartlink_sections];
|
||||||
labelprefix : '.L';
|
labelprefix : '.L';
|
||||||
|
|||||||
@ -84,6 +84,8 @@ uses
|
|||||||
a_i32_store8, a_i32_store16, a_i64_store8, a_i64_store16, a_i64_store32,
|
a_i32_store8, a_i32_store16, a_i64_store8, a_i64_store16, a_i64_store32,
|
||||||
// additional memory
|
// additional memory
|
||||||
a_memory_grow, a_memory_size,
|
a_memory_grow, a_memory_size,
|
||||||
|
// bulk memory operations
|
||||||
|
a_memory_copy, a_memory_fill,
|
||||||
// exceptions
|
// exceptions
|
||||||
a_try,a_catch,a_catch_all,a_delegate,a_throw,a_rethrow,a_end_try
|
a_try,a_catch,a_catch_all,a_delegate,a_throw,a_rethrow,a_end_try
|
||||||
);
|
);
|
||||||
|
|||||||
@ -83,6 +83,8 @@ interface
|
|||||||
'i32.store8', 'i32.store16', 'i64.store8', 'i64.store16', 'i64.store32',
|
'i32.store8', 'i32.store16', 'i64.store8', 'i64.store16', 'i64.store32',
|
||||||
// additional memory
|
// additional memory
|
||||||
'memory.grow 0', 'memory.size 0',
|
'memory.grow 0', 'memory.size 0',
|
||||||
|
// bulk memory operations
|
||||||
|
'memory.copy 0,0', 'memory.fill 0',
|
||||||
// exceptions
|
// exceptions
|
||||||
'try','catch','catch_all','delegate','throw','rethrow','end_try'
|
'try','catch','catch_all','delegate','throw','rethrow','end_try'
|
||||||
);
|
);
|
||||||
|
|||||||
@ -67,6 +67,8 @@
|
|||||||
'i32.store8', 'i32.store16', 'i64.store8', 'i64.store16', 'i64.store32',
|
'i32.store8', 'i32.store16', 'i64.store8', 'i64.store16', 'i64.store32',
|
||||||
// additional memory
|
// additional memory
|
||||||
'grow_memory', 'current_memory',
|
'grow_memory', 'current_memory',
|
||||||
|
// bulk memory operations
|
||||||
|
'memory.copy', 'memory.fill',
|
||||||
// exceptions
|
// exceptions
|
||||||
'try','catch','catch_all','delegate','throw','rethrow','end'
|
'try','catch','catch_all','delegate','throw','rethrow','end'
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user