Commit Graph

83 Commits

Author SHA1 Message Date
nickysn
90251d7050 * allocate the base and frame pointer correctly as locals after the previous commit
git-svn-id: branches/wasm@47876 -
2020-12-28 18:44:26 +00:00
nickysn
c3ac9eb559 * only allocate a local for tt_regallocator temps in ttgwasm.gethltemp
git-svn-id: branches/wasm@47875 -
2020-12-28 18:43:50 +00:00
nickysn
f138d66a2a * switch NR_FRAME_POINTER_REG to NR_LOCAL_FRAME_POINTER_REG
git-svn-id: branches/wasm@47874 -
2020-12-28 18:38:43 +00:00
nickysn
170fab85ff + introduced RS_EVAL_STACK_BASE and RS_LOCAL_STACK_POINTER_REG
git-svn-id: branches/wasm@47873 -
2020-12-28 18:32:16 +00:00
nickysn
59c9bff744 * updated first_int/fpu/mm_imreg, so it doesn't clash with the non-imaginary registers
git-svn-id: branches/wasm@47828 -
2020-12-21 00:32:36 +00:00
nickysn
40eb696d8e + defined RS_LOCAL_FRAME_POINTER_REG
git-svn-id: branches/wasm@47827 -
2020-12-21 00:31:24 +00:00
nickysn
4bac65be86 * set the wasm tempgen direction in the parent constructor, together with the other targets
git-svn-id: branches/wasm@47801 -
2020-12-17 15:37:08 +00:00
nickysn
2f889f3244 - removed the ttgwasm.alloctemp override, because it does nothing
git-svn-id: branches/wasm@47793 -
2020-12-16 16:16:07 +00:00
nickysn
577e39e57f - removed commented out methods (copied from the jvm code generator) from ttgwasm
git-svn-id: branches/wasm@47792 -
2020-12-16 16:14:36 +00:00
nickysn
a104c3d7a0 - removed ttgwasm.deallocLocalVar, as it is no longer used
git-svn-id: branches/wasm@47791 -
2020-12-16 16:13:06 +00:00
nickysn
58d361049f * some optimizations in TWasmLocalVars.dealloc(index: integer)
git-svn-id: branches/wasm@47790 -
2020-12-16 16:09:10 +00:00
nickysn
949d5e61f8 * several public methods of ttgwasm made private
git-svn-id: branches/wasm@47787 -
2020-12-16 13:33:03 +00:00
nickysn
ae60449699 * funnel all the wasm local var allocation, done by the register allocator, through the temp generator
git-svn-id: branches/wasm@47786 -
2020-12-16 13:26:27 +00:00
nickysn
f572bcf8f3 + introduced the NR_LOCAL_FRAME_POINTER_REG constant (alias for NR_R3)
git-svn-id: branches/wasm@47780 -
2020-12-15 15:08:24 +00:00
nickysn
bfb13fb848 - get rid of treference.islocal. Instead, use checks whether treference.base
is equal to NR_LOCAL_STACK_POINTER_REG

git-svn-id: branches/wasm@47779 -
2020-12-14 23:27:27 +00:00
nickysn
fd690e8ba1 * use NR_LOCAL_STACK_POINTER_REG in ttgwasm.localVarToRef
git-svn-id: branches/wasm@47777 -
2020-12-14 23:07:17 +00:00
nickysn
ce8439fb36 + introduced NR_LOCAL_STACK_POINTER_REG
git-svn-id: branches/wasm@47776 -
2020-12-14 23:06:55 +00:00
nickysn
91e9558f5b * synchronized with trunk
git-svn-id: branches/wasm@47766 -
2020-12-12 23:20:33 +00:00
nickysn
2b8ab731c8 * also raise internal errors in trgcpu.do_all_register_allocation for unexpected subregister types
git-svn-id: branches/wasm@47718 -
2020-12-08 08:06:17 +00:00
nickysn
1a6f6f6054 * raise an internal error for unexpected subregister types in rgcpu.registertobasictype
git-svn-id: branches/wasm@47717 -
2020-12-08 07:26:08 +00:00
nickysn
12aa8f0f1f + added another wasm fake register to represent local variable on the linear stack
git-svn-id: branches/wasm@47270 -
2020-11-01 17:06:29 +00:00
nickysn
762fdf593e + added comment, documenting the purpose of the STACK_POINTER_SYM constant
git-svn-id: branches/wasm@47252 -
2020-10-29 16:14:03 +00:00
nickysn
2c56514135 - removed thlcgwasm.a_load_const_stack_intern - it comes from the JVM code
generator and serves no purpose in WebAssembly

git-svn-id: branches/wasm@47195 -
2020-10-25 13:17:54 +00:00
nickysn
c0bbe6d8c0 * 64-bit constants take a single stack slot in WebAssembly. Don't incstack a
second time for 64-bit consts in thlcgwasm.a_load_const_stack

git-svn-id: branches/wasm@47194 -
2020-10-25 12:37:51 +00:00
nickysn
da87a9e48d + write proctype of procedures in other units as well
git-svn-id: branches/wasm@47184 -
2020-10-24 20:23:51 +00:00
nickysn
99482051a8 * write the unsupported parameter type in thlcgwam.g_procdef, when compiler is compiled with EXTDEBUG
git-svn-id: branches/wasm@47183 -
2020-10-24 20:04:40 +00:00
nickysn
fbe9e975e5 + support dup in some more cases in thlcgwasm.prepare_stack_for_ref
git-svn-id: branches/wasm@47181 -
2020-10-24 18:52:31 +00:00
nickysn
d2a4e3b441 - removed debug writeln from thlcgwasm.prepare_stack_for_ref
git-svn-id: branches/wasm@47180 -
2020-10-24 18:48:07 +00:00
nickysn
3c3a8ce111 * fixed bug in thlcgwasm.a_cmp_const_ref_label
git-svn-id: branches/wasm@47179 -
2020-10-24 18:47:29 +00:00
nickysn
c46f308749 + support dup for symbols in prepare_stack_for_ref
git-svn-id: branches/wasm@47178 -
2020-10-24 18:41:01 +00:00
nickysn
64b2d8ef85 * wasm base and index reference access fixes
git-svn-id: branches/wasm@47177 -
2020-10-24 17:28:43 +00:00
nickysn
d15e9717e3 * treference parameter of prepare_stack_for_ref changed to var
git-svn-id: branches/wasm@47176 -
2020-10-24 17:12:48 +00:00
nickysn
0bb255709f * formatting
git-svn-id: branches/wasm@47175 -
2020-10-24 16:51:48 +00:00
nickysn
1d8c5edbcc + write references with registers for debugging purposes (to support asm output with -sr) in the LLVM-MC asm writer
git-svn-id: branches/wasm@47173 -
2020-10-24 15:41:41 +00:00
nickysn
9972d0e7d9 + internal error in thlcgwasm.prepare_stack_for_ref for symbol with registers
git-svn-id: branches/wasm@47170 -
2020-10-24 14:53:46 +00:00
nickysn
5128c07e68 * fixed writing to global variables
git-svn-id: branches/wasm@47169 -
2020-10-24 14:10:04 +00:00
nickysn
8211bcbd4c * fixed getting the address of a global variable
git-svn-id: branches/wasm@47168 -
2020-10-24 12:24:15 +00:00
nickysn
bbe5e3d0e7 - removed spurious load of global symbols in thlcgwasm.prepare_stack_for_ref
git-svn-id: branches/wasm@47167 -
2020-10-24 12:09:02 +00:00
nickysn
19519eb3d2 + support global references with offset in the LLVM-MC asm writer
git-svn-id: branches/wasm@47166 -
2020-10-24 12:03:55 +00:00
nickysn
8494283925 * fixed load/store LLVM-MC asm output for global variables
git-svn-id: branches/wasm@47165 -
2020-10-24 11:56:20 +00:00
nickysn
da5c9a978e + write procdef for imports
git-svn-id: branches/wasm@47001 -
2020-09-29 00:16:10 +00:00
nickysn
fe4f041436 * procdef directive code generation moved to a separate method
git-svn-id: branches/wasm@47000 -
2020-09-29 00:11:11 +00:00
nickysn
8fee0f6130 + partial implementation of imports
git-svn-id: branches/wasm@46999 -
2020-09-29 00:05:14 +00:00
nickysn
0a5655955c + declare the stack pointer global type
git-svn-id: branches/wasm@46997 -
2020-09-28 23:23:42 +00:00
nickysn
e5b0d9cf32 * __stack_top renamed __stack_pointer (which seems to follow the C ABI correctly)
git-svn-id: branches/wasm@46996 -
2020-09-28 23:20:33 +00:00
nickysn
5ee6e9d593 * declare end_function as an instruction, instead of a directive
git-svn-id: branches/wasm@46849 -
2020-09-11 16:25:44 +00:00
nickysn
5c27030faf * emit sec_fpc as sec_data, because custom section names aren't supported
git-svn-id: branches/wasm@46848 -
2020-09-11 16:19:32 +00:00
nickysn
e1b6f0bd85 + introduced end_block, end_if, end_loop
git-svn-id: branches/wasm@46842 -
2020-09-11 15:20:00 +00:00
nickysn
c69dce34c4 + add a .text section directive before each procedure
git-svn-id: branches/wasm@46840 -
2020-09-11 15:05:45 +00:00
nickysn
fc96ad5afd + write the end_function directive
git-svn-id: branches/wasm@46838 -
2020-09-11 14:47:27 +00:00