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
vil::Register::ret() returns a register with index 13, which maps to RAX in x86. There is actually no ret instruction in VIL; instead, the code generated for a return statement places the value of the expression in vil::Register::ret() and then jumps to the function's return label (so that every function has a single place of return).
The reason VIL has no ret instruction is that the x86 code generator needs to generate some code after the last instruction of the function but before the return to clean up the stack frame, but that would be awkward if ret were a regular instruction. Probably the solution is to move the stack clean-up logic in an abstracted form into VIL, and add a ret instruction to VIL that takes a register argument and let the x86 generator handle moving that register into RAX.
The text was updated successfully, but these errors were encountered:
vil::Register::ret()
returns a register with index 13, which maps toRAX
in x86. There is actually noret
instruction in VIL; instead, the code generated for areturn
statement places the value of the expression invil::Register::ret()
and then jumps to the function's return label (so that every function has a single place of return).The reason VIL has no
ret
instruction is that the x86 code generator needs to generate some code after the last instruction of the function but before the return to clean up the stack frame, but that would be awkward ifret
were a regular instruction. Probably the solution is to move the stack clean-up logic in an abstracted form into VIL, and add aret
instruction to VIL that takes a register argument and let the x86 generator handle moving that register intoRAX
.The text was updated successfully, but these errors were encountered: