mirror of
https://github.com/pound-emu/ballistic.git
synced 2026-01-31 01:15:21 +01:00
This does two things so I'll split them. (1) Add function intern_constant() which adds a constant to the constants array and returns the index. The assembly for this function is beautiful. Only one load and store on a successfull path. Dump of assembler code for function intern_constant: 0x0000000000010ee0 <+0>: ldr w8, [x4] 0x0000000000010ee4 <+4>: cbnz w8, 0x10f08 <intern_constant+40> 0x0000000000010ee8 <+8>: ldrh w8, [x2] 0x0000000000010eec <+12>: cmp x3, x8 0x0000000000010ef0 <+16>: b.ls 0x10f10 <intern_constant+48> // b.plast 0x0000000000010ef4 <+20>: str w0, [x1, x8, lsl #2] 0x0000000000010ef8 <+24>: add w9, w8, #0x1 0x0000000000010efc <+28>: orr w0, w8, #0x10000 0x0000000000010f00 <+32>: strh w9, [x2] 0x0000000000010f04 <+36>: ret 0x0000000000010f08 <+40>: mov w0, #0x10000 // #65536 0x0000000000010f0c <+44>: ret 0x0000000000010f10 <+48>: mov w8, #0xffffff9c // #-100 0x0000000000010f14 <+52>: mov w0, #0x10000 // #65536 0x0000000000010f18 <+56>: str w8, [x4] 0x0000000000010f1c <+60>: ret End of assembler dump. (2) I've decided that the entire translation code will fit in bal_engine.c so the bal_ir_immiter and bal_translator files are not needed anymore. I moved their preprocessor definitions into bal_engine.c Signed-off-by: Ronald Caesar <github43132@proton.me>