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
According to godbolt.org these functions optimize to a simple *(T *)ptr
in many cases while ensuring that memory alignment requirements and
endianess does not effect the behavior.
The unroll pragma is needed for GCC to properly optimize the code.
The approach of using bit shifts is also used in multiple other parts
of binaryen (eg. WasmBinaryReader::getInt16) but usage of the helper
function doesn't seem to be that easy there.
Ref #2983
0 commit comments