-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
load8 vs load_word? #159
Comments
Aaww, do you remember when we defined bedrock2/bedrock2/src/bedrock2/Syntax.v Line 11 in b28c1dc
how smart we felt that this automatically allows 8-byte load/store only on 64bit architectures? 😉 Is this not sufficient any more? As in, why couldn't you use If needed, you could probably change
but before doing that, I'd like to properly understand why it's needed. |
In the idiomatic C translation of these constructs, storing using "store8" and then loading using "loadword" is a strict aliasing violation. And the code that would be calling bedrock2-printed-as-C sure uses |
Another thought: we could just play safe and stupid with strict aliasing and load larger words in 8-bit chunks in the C back-end... or perhaps have two back-ends, "sane C" and "standard C". |
Could you write bitwidth-specific bedrock2-to-C pretty-printers that never output |
Yes, we could. Using the wrong one could lead to really awkward bugs. |
If we can have multiplication in the AST and still get compiler proofs for rv32im (if the code does not use it), can we have load8 in the AST and still get compiler proof for 32-bit architectures (if the code does not use load8). This would make it easier for the C back-end to satisfy strict aliasing rule (mit-plv/fiat-crypto#821 (comment)).
The text was updated successfully, but these errors were encountered: