To my understanding R64
has something to do with WASM. But when using cranelift as a codegen backend to my own language compiler, can I use R64
as a way to distinguish integers from pointers so that I don't have to track that outside of cranelift?
My plan is to inline the data payload of a sum type (tag+data) if it fits in a single cranelift value, or pass it as a stack slot address if it doesn't. Marking whether it's meant to be used as a stack slot or as an inlined value by simply checking whether the type of the value is R64
would simplify my code a bit.
From what I can tell I64
and R64
are in most cases treated indistinguishably?
The difference is that r64 types end up in the stack map if any is generated. Note that we are currently moving wasmtime from letting cranelift generate stack maps using r64 to having the wasm->clif ir step generate them. This will remove the r64 type.
Also a lot of operations you may need don't work on r64 like iadd.
https://github.com/bytecodealliance/wasmtime/pull/8728 has some more details and motivation about moving this stuff into clif producers
Last updated: Nov 26 2024 at 01:30 UTC