-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add macros for unaligned access #40
Add macros for unaligned access #40
Conversation
e1abad3
to
7135bd4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RISC-V ISA spec (and profiles, etc.) appear to consistently use the word "misaligned". Is there a reason this proposal uses "unaligned"?
No real reason, just the terminology I'm more used to from past. I can certainly respin with new verbiage. |
f0cb8cc
to
2b48b0f
Compare
riscv-c-api.md
Outdated
A typical complier could (but not necessarily) map fast variant to -mno-strict-align | ||
and bad to -mstrict-align, if specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to drop that since clang has different behavior here, it just accept and ignore -mno-strict-align
and -mstrict-align
for RISC-V clang.
Or move it become a note to say GCC is using that way to decide which macro should be defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry not clear what you mean: clang ignores either of them ? and uses a different toggle to affect misaligned access codegen or doesn't support that at all (extremely unlikely)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry not clear what you mean: clang ignores either of them ? and uses a different toggle to affect misaligned access codegen or doesn't support that at all (extremely unlikely)
Yes, RISC-V clang accept that and then ignore that for now - clang did support misaligned code gen and some more are coming up[1], option handling in clang part can easily be implement/fix later.
Anyway just second thought about this: This should not major blocker issue here, just a minor implementation issue, and you already mention (but not necessarily)
.
cc @asb @luismarques |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as a RISC-V GCC maintainer, but I would like to wait LLVM folks ack here.
I think from #32, @aswaterman was concerned that I had a slight preference for zicclsm even if it's not very comprehensible just to avoid introducing too many ways of saying the same thing. But I don't feel strongly enough to block this. I think we should wait for @aswaterman's feedback though, as he participated in the other thread. |
riscv-non-isa#32 Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
2b48b0f
to
69d21f8
Compare
Fair enough. Updated pull request with bad -> avoid
I tend to disagree still, but we can agree to disagree :-)
Sure thing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and I am OK with those name
ping @aswaterman
I'm OK with this scheme. I guess I agree with @asb in principle, but, like him, I don't think it's actually a problem, so I don't want to hold this up. |
Thanks Andrew. Sounds like we have consensus on this then? LGTM. |
Thanks @vineetgarc , gonna merge this :) |
RISC-V C API introduce predefined macro to achieve hints about unaligned accesses [0]. This defines __riscv_misaligned_fast when using -mno-strict-align, otherwise, defines __riscv_misaligned_avoid. Note: This ignores __riscv_misaligned_slow which is also defined by spec. The spec has mentioned riscv-non-isa/riscv-c-api-doc#40 [0]: riscv-non-isa/riscv-c-api-doc#40
…5756) RISC-V C API introduced predefined macro to achieve hints about unaligned accesses ([pr]). This patch defines __riscv_misaligned_fast when using -mno-strict-align, otherwise, defines __riscv_misaligned_avoid. Note: This ignores __riscv_misaligned_slow which is also defined by spec. [pr]: riscv-non-isa/riscv-c-api-doc#40
…vm#65756) RISC-V C API introduced predefined macro to achieve hints about unaligned accesses ([pr]). This patch defines __riscv_misaligned_fast when using -mno-strict-align, otherwise, defines __riscv_misaligned_avoid. Note: This ignores __riscv_misaligned_slow which is also defined by spec. [pr]: riscv-non-isa/riscv-c-api-doc#40
No description provided.