StrongerXi / soc

Compiler for a subset of OCaml
1 stars 0 forks source link

X86 to string #24

Closed StrongerXi closed 3 years ago

StrongerXi commented 3 years ago

Implement translation from X86 program with physical register to final assembly code. Discovered some neglected requirements from X86 assembly, and fixed X86 accordingly.

Notably, setCC requires byte access to target register. Ideally we should wrap the general purpose registers in X86 with [B1, B2, B4, B8] to implement that, but since (1) currently there is no other use case, (2) it's hard to enforce access requirements of different instructions (I'm too lazy to look into this), we'll use the compare-set-jump approach to translate conditional set from Lir.