You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Capturing an idea from @corsix to solve the register part of the default FFI calling convention being too heavyweight in some situations (#230):
Suppose we could declare that certain functions preserve the value of all CPU registers except for their arguments and return value. For example, an FFI function prototype could be declared as
__lowreg int foo(int x, int y, double z)
and the compiler would know that this function (likely written in assembler) will preserve the values of all registers except for rsi (x), rdi (y), xmm0 (z), and rax (return value.) This would make the function more efficient to call because the JIT would not need to bother saving and restoring the values of all the other registers that are caller-save in the standard platform calling convention.
The text was updated successfully, but these errors were encountered:
This is very similar to one of the features i added intrinsic system as well creating an intrinsic from a blob of memory you can instead specify an arbitrary address to call with the same system of listing input\output\modified registers.
@fsfod Generally I am wondering whether a custom calling convention can serve as an "80/20" solution for intrinsics. That is, to support most of the use cases for full-scale intrinsics but with a fraction of the implementation complexity. What do you think?
(I floated this idea on the LuaJIT repo some years back but didn't get a bite on discussion LuaJIT/LuaJIT#39 (comment).)
Capturing an idea from @corsix to solve the register part of the default FFI calling convention being too heavyweight in some situations (#230):
Suppose we could declare that certain functions preserve the value of all CPU registers except for their arguments and return value. For example, an FFI function prototype could be declared as
and the compiler would know that this function (likely written in assembler) will preserve the values of all registers except for
rsi
(x
),rdi
(y
),xmm0
(z
), andrax
(return value.) This would make the function more efficient to call because the JIT would not need to bother saving and restoring the values of all the other registers that are caller-save in the standard platform calling convention.The text was updated successfully, but these errors were encountered: