freenode/#sicl - IRC Chatlog
Search
7:10:37
beach
The situation with ASTs is different, because one can not swap the inputs of an AST without changing the order of evaluation, but for instructions, the evaluation order is explicit in the control graph.
8:54:10
beach
Here is the current plan for the near future, and I would like opinions about it, especially if I have planned something stupid:
8:55:01
beach
I implement the Common Lisp code to add those HIR snippets for argument processing and I apply that code early on after AST-to-HIR.
8:56:02
beach
I already have most of the code to translate from HIR to MIR. There might be a few corner cases left,
8:57:03
beach
MIR has explicit address calculations, but target-specific stuff like registers have not yet been introduced.
8:59:28
beach
However, to avoid writing the register allocator, I give every lexical location and every raw datum its own place in the stack frame.
9:00:41
beach
A few registers are reserved as scratch registers to hold lexical locations and raw data temporarily in order to execute an instruction.
9:02:28
beach
So an instruction will be translated into several LIR instructions. Each input will be loaded into a register, and the instruction will compute its outputs in registers, and finally, the output registers are saved to the designated locations of the locations on the stack.
9:03:43
beach
What is left to decide is how to represent the dynamic environment, and things like how to handle unwinding.
9:05:29
beach
After that, I use the assembler I wrote in order to turn the linearized LIR code into a byte vector of native instructions.
9:49:09
beach
In fact, now that I know how easy it is to create a simple executable file, I should play around some more with the assembler. There are definitely instructions that I haven't defined and that will be needed early on.
14:07:07
beach
The assembler seems to work. I was able to write the same program as I did to test the ELF executable, except I wrote it using my assembler. And I had to add SYSCALL to the instruction database, which worked fine. I can execute the resulting program with the desired effect.
14:07:38
beach
But when I looked at the output of the assembler and compared it to the output of NASM, I was puzzled.
14:08:38
beach
In NASM I wrote "mov rax, 60" and "mov rdi, 44" and it seems to generate instructions that only assign to the 32-bit half of those registers.
14:11:44
beach
The code generated by my assembler uses the REX prefix and a full 64-bit constant. That's a bit wasteful, but it is no doubt because I haven't encoded all variations on the MOV instruction in my database.
15:39:03
beach
When I travel for work (like to ELS) I take a few days off to look at the (usually new) place.
16:16:40
ck_
my only hope is the realization that many concepts that sound very fancy judging from their name are actually quite basic; that's what I meant about the vocabulary feeling like a study of medicine
16:22:36
beach
I am sure you are right. As a researcher, I have learned to invent new terminology to avoid repeating myself, so I am partly responsible for adding to the problems. But there is nothing complicated about it.
16:39:24
ck_
Thank you very much. It's of course perfectly normal for a specialization to have its own set of terms, I didn't mean to criticize that.
16:41:28
ck_
you don't need the float printer for anything other than 32- and 64-bits at the moment, right?
17:31:31
beach
Time to go spend time with my (admittedly small) family. See you tomorrow or next week.
17:31:53
ck_
you always put that suffix, I wonder why you feel the need? Have a good weekend regardless! See you around.