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
Currently, a RuntimeValue is represented by a rust enum.
As a refresher: A rust enum requires space for the variant tag plus the size of a payload of the largest variant, which also requires to be properly aligned. Thus, a RuntimeValue takes 8 bytes for the payload (for 64-bit wide values) and 8 bytes for the alignment (on x86_64).
We can shelve 8 bytes by removing a tag. We can achieve it by using C-like unions for representing runtime values internally. It is possible because after validation it is statically guaranteed that each operation will be used with operands of appropriate types (i.e., f32.* operators will always be used with f32 operands).
Shrinking RuntimeValue may potentially improve cache efficiency for the operand stack and remove branching to check operand types.
The text was updated successfully, but these errors were encountered:
Depends on #98
Currently, a
RuntimeValue
is represented by a rust enum.As a refresher: A rust enum requires space for the variant tag plus the size of a payload of the largest variant, which also requires to be properly aligned. Thus, a
RuntimeValue
takes 8 bytes for the payload (for 64-bit wide values) and 8 bytes for the alignment (on x86_64).We can shelve 8 bytes by removing a tag. We can achieve it by using C-like unions for representing runtime values internally. It is possible because after validation it is statically guaranteed that each operation will be used with operands of appropriate types (i.e.,
f32.*
operators will always be used withf32
operands).Shrinking
RuntimeValue
may potentially improve cache efficiency for the operand stack and remove branching to check operand types.The text was updated successfully, but these errors were encountered: