Commit Graph

280 Commits

Author SHA1 Message Date
nickysn
715de4547a * fixed WASI dll imports that are declared in a different unit
git-svn-id: trunk@49537 -
2021-06-23 20:36:52 +00:00
nickysn
b527ab694c + implemented twasmtypeconvnode.second_class_to_intf
git-svn-id: trunk@49451 -
2021-06-01 22:15:57 +00:00
nickysn
74bac86711 + support loading a function result (on the evaluation stack) to a register in
thlcgwasm.gen_load_cgpara_loc

git-svn-id: trunk@49449 -
2021-06-01 21:52:51 +00:00
nickysn
08f9a68798 - removed unused local variables from twasmaddnode.second_generic_compare
git-svn-id: trunk@49435 -
2021-06-01 19:11:21 +00:00
nickysn
8dd591e838 + implemented twasmaddnode.second_cmpsmallset for equaln and unequaln
git-svn-id: trunk@49434 -
2021-06-01 19:10:20 +00:00
nickysn
c42e297bc6 + implemented sqr(real) for the WebAssembly target
git-svn-id: trunk@49430 -
2021-06-01 16:41:39 +00:00
pierre
570af33fa9 Add a second handling of NIL entries in deflist
git-svn-id: trunk@49270 -
2021-04-26 21:12:02 +00:00
nickysn
bc42d64348 * workaround for the raise node generating invalid WebAssembly code for
obtaining the current address. Note that exception handling in WebAssembly
  doesn't work. This only fixes the raise node enough to generate valid (but not
  correct) WebAssembly code. This is a temporary fix to allow the SysUtils unit
  to be compiled. Eventually, exception handling for WebAssembly will need to be
  rewritten entirely, in order to make exceptions work properly.

git-svn-id: trunk@49259 -
2021-04-24 14:40:07 +00:00
nickysn
f81dd894aa * override the raise node for WebAssembly and copy the generic pass_1
implementation. No functional changes.

git-svn-id: trunk@49258 -
2021-04-24 14:31:56 +00:00
pierre
e6045673ee Handle NIL entries in deflist after commit 48986
git-svn-id: trunk@49230 -
2021-04-18 15:44:07 +00:00
nickysn
dbecb67d45 * fixed the value passing of record parameters with non-scalar value size on the
WebAssembly target

git-svn-id: trunk@49218 -
2021-04-17 14:25:54 +00:00
nickysn
947f9af0e5 + fixed code generation for high(dynarray) for the WebAssembly target
git-svn-id: trunk@49217 -
2021-04-17 13:58:55 +00:00
nickysn
4f828929a3 * fixed the support for infinity and nan float literal values in the webassembly
llvm-mc asm writer

git-svn-id: trunk@49213 -
2021-04-16 23:40:11 +00:00
nickysn
340a71d2bc * always keep the WebAssembly stack frame aligned on 16 bytes
git-svn-id: trunk@49179 -
2021-04-11 14:02:40 +00:00
nickysn
9fa61a6c9f - removed the discardresult proc directive
git-svn-id: trunk@49017 -
2021-03-20 01:22:43 +00:00
nickysn
ecad5e9a6c + WebAssembly implementation of g_rangecheck that uses if/endif instead of
jumps to labels (which causes internal compiler error, because they're not
  supported in WebAssembly)

git-svn-id: trunk@49000 -
2021-03-18 16:45:40 +00:00
nickysn
d090af4abe * skip nil values in current_module.deflist in TLLVMMachineCodePlaygroundAssembler.WriteImports
git-svn-id: trunk@48985 -
2021-03-15 18:12:36 +00:00
nickysn
76c61c3aac * call inherited inside twasminnode.checkgenjumps in order to initialize use_small
git-svn-id: trunk@48971 -
2021-03-14 16:56:16 +00:00
nickysn
f0aed5d355 * fixed another WebAssembly compilation error with -CR
git-svn-id: trunk@48966 -
2021-03-14 15:06:13 +00:00
nickysn
74854eee58 * fixed WebAssembly compilation error with -CR
git-svn-id: trunk@48964 -
2021-03-14 15:03:58 +00:00
nickysn
e2e0756eaf * fixed compilation with -Sew
git-svn-id: branches/wasm@48446 -
2021-01-28 16:25:03 +00:00
nickysn
0ceefa4d22 + enabled DWARF debug info writing on the WebAssembly target. Note that it
doesn't work yet (produces internal errors).

git-svn-id: branches/wasm@48445 -
2021-01-28 16:16:32 +00:00
nickysn
4ef1367019 + added wasm32 inline procedure for generating the 'unreachable' instruction
git-svn-id: branches/wasm@48442 -
2021-01-28 12:48:56 +00:00
nickysn
eb7db76a31 * fixed compiler internal error, when compiling a unit that has an external function in its interface section
git-svn-id: branches/wasm@48421 -
2021-01-25 20:53:01 +00:00
nickysn
f77ae51751 * the wasm target (now 'embedded') moved to the i_embed/t_embed units
git-svn-id: branches/wasm@48365 -
2021-01-24 01:45:35 +00:00
nickysn
807c743e35 * system identifier system_wasm32_wasm renamed system_wasm32_embedded
git-svn-id: branches/wasm@48362 -
2021-01-24 01:01:39 +00:00
nickysn
594be1be04 * properly handle reference with negative offsets
git-svn-id: branches/wasm@48340 -
2021-01-23 05:27:32 +00:00
nickysn
b35d3c5f3a * don't override inittempvariables for WebAssembly, because things like
ansistrings actually need to be initialized to zero on proc entry

git-svn-id: branches/wasm@48338 -
2021-01-23 04:42:52 +00:00
nickysn
f891c52dd1 - removed tarrayreftype, because it's not used on the wasm target
git-svn-id: branches/wasm@48336 -
2021-01-22 21:47:08 +00:00
nickysn
f294ea5028 - removed commented out code from aasmcpu.pas
git-svn-id: branches/wasm@48335 -
2021-01-22 18:23:15 +00:00
nickysn
1003d6499f * formatting
git-svn-id: branches/wasm@48333 -
2021-01-22 16:35:32 +00:00
nickysn
9e95895a9b * get rid of the internal error in thlcgwasm.a_cmp_ref_reg_stack by using swap_opcmp
git-svn-id: branches/wasm@48332 -
2021-01-22 16:31:31 +00:00
nickysn
5a84c4db61 - get rid of FRAME_POINTER_SYM and BASE_POINTER_SYM - they should not be used anymore
git-svn-id: branches/wasm@48331 -
2021-01-22 16:24:56 +00:00
nickysn
4d99fb3352 * allocate locals in a better way, so that we don't get 2 extra wasted locals per function
git-svn-id: branches/wasm@48330 -
2021-01-22 16:22:49 +00:00
nickysn
e0dffb1c2c * fixes to the type conversions in thlcgwasm.resize_stack_int_val
git-svn-id: branches/wasm@48329 -
2021-01-22 16:05:03 +00:00
nickysn
f03245e05c - get rid of maybe_adjust_cmp_stackval - it is unnecessary for WebAssembly,
because it has unsigned comparison instructions, unlike the JVM, and using it
  with the unsigned instructions even produced incorrect code

git-svn-id: branches/wasm@48328 -
2021-01-22 15:41:50 +00:00
nickysn
a9264cc608 - removed commented out method g_copyvalueparas
git-svn-id: branches/wasm@48327 -
2021-01-22 15:29:34 +00:00
nickysn
3a0d84fde2 - removed outdated comment from thlcgwasm.a_cmp_stack_stack
git-svn-id: branches/wasm@48326 -
2021-01-22 15:26:30 +00:00
nickysn
f3482acbf9 - removed commented out code from thlcgwasm.g_proc_entry
git-svn-id: branches/wasm@48325 -
2021-01-22 15:24:11 +00:00
nickysn
83f88e515b * renamed the a_get/set/tee_local/global asm ops a_local/global_set/get/tee
git-svn-id: branches/wasm@48324 -
2021-01-22 15:21:40 +00:00
nickysn
d8f55ebb48 * renamed the a_iXX_extendYYYY family of asm ops to their modern versions
git-svn-id: branches/wasm@48323 -
2021-01-22 15:08:43 +00:00
nickysn
116366a8e3 * updated the a_iXX_trunc_su_fYY asm ops to their modern format a_iXX_trunc_fYY_su
git-svn-id: branches/wasm@48322 -
2021-01-22 15:05:35 +00:00
nickysn
60242ca0fd * updated the a_fXX_convert_su_iYY asm ops to their modern format a_fXX_convert_iYY_su
git-svn-id: branches/wasm@48321 -
2021-01-22 15:03:04 +00:00
nickysn
9acfdc8cdd * the a_f64_reinterpret_f64 asm op renamed a_f64_reinterpret_i64
git-svn-id: branches/wasm@48320 -
2021-01-22 14:58:50 +00:00
nickysn
699626ee5c * a_grow_memory asm op renamed a_memory_grow
git-svn-id: branches/wasm@48319 -
2021-01-22 14:52:46 +00:00
nickysn
d0fe45a595 * a_current_memory asm op renamed a_memory_size
git-svn-id: branches/wasm@48318 -
2021-01-22 14:51:55 +00:00
nickysn
910bbc6b37 * override is_pushleftright for WebAssembly and make it return true
git-svn-id: branches/wasm@48312 -
2021-01-22 02:59:13 +00:00
nickysn
61ba4869ae * quick and dirty fix for the move parameter order passing in g_concatcopy
git-svn-id: branches/wasm@48295 -
2021-01-22 00:02:12 +00:00
nickysn
54299874d3 + implemented memory.grow and memory.size intrinsics and implemented SysOSAlloc
git-svn-id: branches/wasm@48290 -
2021-01-21 23:13:49 +00:00
nickysn
4d933d74b9 + call the inherited methods for generating the standard entry/exit code, so that units are initialized/finalized
git-svn-id: branches/wasm@48286 -
2021-01-21 22:15:50 +00:00