Option to pass alignment hints to the load and store macros#67
Option to pass alignment hints to the load and store macros#67Heath123 wants to merge 5 commits intoturbolent:mainfrom
Conversation
|
Oops, looks like I made a mistake that got caught by the test cases again |
turbolent
left a comment
There was a problem hiding this comment.
Nice, thank you for adding support for this!
Maybe the default header file can include alignment aware variants of the load/store functions (e.g. i32_store -> i32_store_a/i32_store_aligned) and wasmCWriteLoadExpr/wasmCWriteStoreExpr could generate calls to those functions if the flag is set?
Co-authored-by: Bastian Müller <bastian@turbolent.com>
|
Sorry, I missed your questions:
No, you don't need validate it. w2c2 does not do any validation and assumes the input module is valid, as other tools are already available to validate modules. That keeps w2c2 simple.
The way it is implemented at the moment seems fine to me 👍 |
Closes #65
This won't work with the original
w2c2_base.h, but a custom one should be able to make use of it.Questions:
result->align = 1 << align;in the instruction reader like I have here, leave it as-is in the instruction struct and do that as the C source file is written, or write it to the file as-is and have the macros do it?