More progress with
#AArch64 #dlang dmd code generator. The function prolog/epilog is working at a basic level now, and so is the address resolution for stack symbols and register allocation is also working:
uint add(uint x, uint y) { return x y; }
becomes:
0000: D1 00 43 FF sub sp,sp,
#0x10
0004: B9 00 0B E0 str w0,[sp,#8]
0008: 2A 01 03 E2 mov w2,w1
000c: B9 40 0B E3 ldr w3,[sp,#8]
0010: 0B 23 40 40 add w0,w2,w3,uxtw
0014: 91 00 43 FF add sp,sp,
#0x10
0018: D6 5F 03 C0 ret
0000: allocate space for locals
0004: save register parameter x as local
0008: save register parameter y as w2
000c: load local x into w3
0010: w0 = w2 w3
0014: deallocate space for locals
0018: return from function
I know this looks treeevial, but an awful lot has to work to get this far.
#compilers #programming #programminglanguages