vnmakarov / mir

A lightweight JIT compiler based on MIR (Medium Internal Representation) and C11 JIT compiler and interpreter based on MIR
MIT License
2.24k stars 147 forks source link

bit conversion of floats to integers #293

Open Itay2805 opened 1 year ago

Itay2805 commented 1 year ago

It would be nice to have a way to easily and efficiently do a bit conversion of a float to int, right now code would require to essentially do

mov f(var), float_value
mov integer_value, i32(var)

which of course is not optimal as it requires a memory access

vnmakarov commented 1 year ago

Thank you for your proposal.

I have such plans as a lot of dynamic language implementations use tagged values and boxing/unboxing fp values requires the bitwise conversions. Simply I can not say when it will be done. I have long list todo for MIR project and unfortunately I can spend only small part of my work time on MIR project.