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
(you might already know all this but I'll explain it just in case:
I did a fancy expandable box (click)
Currently loads and stores use memcpy, which on most platforms can be optimised into a normal memory access. However on platforms that don't support unaligned access like SuperH4 the compiler can't do this as it would cause the CPU to raise an exception if an unaligned access is performed. This means that there is a memcpy call for every memory access.
An option that would be faster in most situations would be to access the memory directly by type punning but use an exception handler to emulate unaligned access. This means you only pay a performance penalty when unaligned access actually happens, but that penalty will be much worse.
WebAssembly has a solution for this; alignment hints! This means you can tell the runtime when a memory is likely to be unaligned so it can emulate the access without causing a CPU exception, for example through a memcpy like w2c2 does now.
So, I'd like a way to have to have alignment hints passed through to the load and store functions so I can use them in a custom version of the header. I imagine this use case is too niche for it to be worth having a default implementation of this in w2c2_base.h but having it exposed would let me implement this myself.
I might do a PR for this like I did for #59 if you want it (should it be behind a flag to not bloat code size when it's not used?)
The text was updated successfully, but these errors were encountered:
(you might already know all this but I'll explain it just in case:
I did a fancy expandable box (click)
So, I'd like a way to have to have alignment hints passed through to the load and store functions so I can use them in a custom version of the header. I imagine this use case is too niche for it to be worth having a default implementation of this in w2c2_base.h but having it exposed would let me implement this myself.
I might do a PR for this like I did for #59 if you want it (should it be behind a flag to not bloat code size when it's not used?)
The text was updated successfully, but these errors were encountered: