ykjit / yk

yk packages
https://ykjit.github.io/yk/
Other
29 stars 7 forks source link

Fix sdiv implementation. #1241

Closed ptersilie closed 3 months ago

ptersilie commented 3 months ago

This fixes a bug with the sdiv implementation. The reason for the bug was that I misunderstood some details about idiv.

ltratt commented 3 months ago

Can we add tests to x86_64/mod.rs about the generated code? Those are more robust tests than the lang_tests for these sorts of thing (and the JIT IR parser & fm incombination make creating such tests pretty easy).

ptersilie commented 3 months ago

I can, but it will require me to add at least 8 unit tests to get the same coverage as the langtest has now.

ptersilie commented 3 months ago

I improved the langtest a bit and simplified the implementation for byte-sized values. I also added a unit test. Let me know if you want me to add unit tests for the other 7 cases.

ltratt commented 3 months ago

In general I would love it if we unit tested all the cases, because that will really help us going forwards, but I will leave that to your discretion until yklua is running. Please squash if you want.

ptersilie commented 3 months ago

Squashed (I kinda wanna push on with things and look into testing later).