chc4 / lineiform

A meta-JIT library for Rust interpreters
156 stars 4 forks source link

WIP: Temp refactor #10

Closed chc4 closed 2 years ago

chc4 commented 2 years ago

Refactors a bunch of code to handle instruction temporary values better - this allows us to do proper zero/sign extending for e.g. sub.

The main difference is that operations are over JitTmp values now, which are variable widths; previously we were passing and returning JitValues for them, which we always normalized to HOST_WIDTH width. This allows us to also give Cranelift better type information for all its SSA values, since we're using the actual variable-width int types. Additionally, it makes our math operations have correct condition flag settings: before we were assuming that all math ops were with usize operands, and the flag behavior for those operations, while now we have 8,16,32,64 bit assembly versions that we capture the flag effects of properly.

This is a pretty major refactor, and includes a bunch of other things I felt like changing while doing so. lol woops

chc4 commented 2 years ago

haha uh oh #19