peterhuene commented on Issue #1177:
I believe this has been resolved since March of 2020, but this probably fell through the cracks during the cranelift repo migration; therefore I'm closing this issue now.
peterhuene closed Issue #1177:
We're having issues, only on Windows, with floating point variables becoming corrupt across calls into Cranelift from Wasmer.
The following function
callee_saved_gprs
in the codegen is supposed to return a list of the callee-saved registers:However, it, nor its callers, seem to concern themselves with saving the floating point callee-saved registers (with gprs in its name, that kind makes sense). Quoth https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2019#callercallee-saved-registers:
The registers RBX, RBP, RDI, RSI, RSP, R12, R13, R14, R15, and XMM6-15 are considered nonvolatile and must be saved and restored by a function that uses them.
callee_saved_gprs
only lists RBX, RBP, RDI, RSI, RSP, R12, R13, R14, R15, ignoring XMM6-15.I believe this may be the cause of our troubles, it definitely looks wrong. What do you think?
(If the reserved stack spaced for this would be prohibitive and code is generated assuming no callee saved registers, things could still work internally as they do now, but you'd still need to save XMM6-15 on entering Cranelift and restore them when exiting Cranelift).
peterhuene edited a comment on Issue #1177:
I believe this has been resolved since April of 2020 (Wasmtime 0.16.0), but this probably fell through the cracks during the cranelift repo migration; therefore I'm closing this issue now.
peterhuene edited a comment on Issue #1177:
I believe this has been resolved since April of 2020 (Wasmtime 0.16.0; Cranelift 0.69.0), but this probably fell through the cracks during the cranelift repo migration; therefore I'm closing this issue now.
Last updated: Dec 23 2024 at 13:07 UTC