1
0
mirror of https://github.com/janet-lang/janet synced 2025-07-06 12:02:53 +00:00

24 Commits

Author SHA1 Message Date
Calvin Rose
3dd6e744de More work on e_mov - work on loading immediates. 2025-04-15 20:40:05 -05:00
Calvin Rose
862b4e9688 Add sysir test suite stub 2025-04-13 07:47:52 -05:00
Calvin Rose
c9305a0a42 Format. 2025-04-11 22:44:36 -05:00
Calvin Rose
11e6a5a315 More work on compile-opt. 2025-03-31 21:48:46 -05:00
Calvin Rose
871f8ebf4e More work on moving to machine code emission. 2025-03-30 13:38:33 -05:00
Calvin Rose
c677c72a73 Add tool that lets us more easily compare compilation paths.
Compare:
IR -> C -> x64
vs.
IR -> x64
2025-03-29 20:37:51 -05:00
Calvin Rose
af73e214b2 Begin work on emitting machine code directly.
Far from done, we are currently splicing raw bytes in NASM output.
2025-03-29 16:52:11 -05:00
Calvin Rose
4396f01297 More work on drawing example and frontend changes. 2024-12-01 08:43:54 -06:00
Calvin Rose
046d299d77 More work on x86 backend. 2024-11-26 11:18:46 -06:00
Calvin Rose
3510e235ee More work on compile-opt 2024-06-21 17:16:56 -05:00
Calvin Rose
b6fb7ae69c x64 allow dynamically switching between windows and sysv target. 2024-06-17 23:02:05 -05:00
Calvin Rose
e5765b26d4 Working examples on windows.
Add some support for windows x64 ABI.
2024-06-17 07:07:20 -07:00
Calvin Rose
cdb3baaca3 Work on windows. 2024-06-16 13:37:25 -07:00
Calvin Rose
c413bc2b4e Don't assign variables positions on the stack that clobber import info.
(return address, previous basepoint, etc.)
2024-06-16 10:06:22 -05:00
Calvin Rose
314e684097 More work on x64 backend. 2024-06-14 16:57:32 -05:00
Calvin Rose
232a8faa35 More work compile-opt. 2024-06-13 07:27:48 -05:00
Calvin Rose
c31d8b52ff Add typed constants and lots more. 2024-06-12 13:57:33 -05:00
Calvin Rose
f0395763b7 More work on x86 target.
Also remove all (limited) type inference from the sysir. Type
inference is better done in frontend, limited inference in backend
just covers compilers issues.

Simple hello world with nasm working.
2024-06-10 20:16:04 -05:00
Calvin Rose
5b3c5a5969 Lots of work on calling conventions and x86 backend.
We need the ability to represent multiple calling conventions in IR.
All backends need to support a :default CC, but can also support more
for interop with system libraries, code from other compilers, syscalls, etc.

Also allow void returns.
2024-06-10 08:47:27 -05:00
Calvin Rose
af10c1d4b5 More work on x64 backend, especially branching.
Needs changes to IR to allow encoding immediates in all
instructions where possible. This makes the IR denser, means
we don't need `constant` and `callk`, and allows certain optimizations
like comparing to zero, using `inc` and `dec`, etc which are
specializations of more general instructions with constants.
2024-06-08 13:20:34 -05:00
Calvin Rose
3995fa86e2 More work on function calls. 2024-06-07 20:20:16 -05:00
Calvin Rose
3e273ce03a More work on sysir. 2024-06-07 10:09:53 -05:00
Calvin Rose
25b7c74089 More work on register allocation and spilling.
Setup frontend.janet to show the basics of what is going on. Currently
emitting "fake" instructions just to hash out the idea.

One apparent issue is how we handle register spilling during variable
argument IR instructions (function calls). Arguments should come
_before_ the function call not after.
2024-06-05 17:50:11 -05:00
Calvin Rose
7ea118f248 Begin work on simple x64 backend.
Introduce register allocation, spilling, etc. First implementation
will likely emit textual assembly and use a very bad register allocation
algorithm.
2024-06-03 08:35:08 -05:00