-
Notifications
You must be signed in to change notification settings - Fork 42
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
zihintntl Intrinsic function proposal #47
Conversation
For further context, I understand this intends to match what Clang currently provides (which is gated on enabling experimental extension support right now - awaiting the intrinsics being standardised). |
For more context: this also match what @cmuellner proposed #30 (comment) before |
c.c. @aswaterman |
This is LGTM, and although this is not implemented on GCC, but I think this is implementable and we have enough time frame to implement that before next release (which expected released at 2024/04). |
LGTM. The only comment I'd make is that we might consider adding overloaded versions that omit the |
Both GCC's and Clang's C-language dialects support a limited form of C++ function overloading. We use this already in the vector intrinsics ("overloaded API"). Since these are the only compilers we require to prove concepts, this seems actionable here as well. |
The version that omit the [1] https://clang.llvm.org/docs/LanguageExtensions.html#non-temporal-load-store-builtins |
@BeMg OK. Can we document that API here so that GCC and LLVM will match? Or is the problem that we can't make it part of this API because it does not include the If the answer is that we can't include |
I'm not sure whether to add the cc @kito-cheng The overloaded version look like more consistent, so I add it into proposal. It could be implemented by some macros.
|
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, seems like the overloading trick is work both on GCC and clang/LLVM, and I will try to find some resource to implement GCC part.
I would like to get explicitly ack from @aswaterman and @asb before merge.
LGTM. |
OK with me, too. |
I will implement the overloaded version in LLVM. |
Thanks for everyone, I gonna merge this :) |
@@ -235,6 +235,51 @@ long __riscv_clmul (long a, long b); // clmul rd, rs1, rs2 | |||
vint8m1_t __riscv_vadd_vv_i8m1(vint8m1_t vs2, vint8m1_t vs1, size_t vl); // vadd.vv vd, vs2, vs1 | |||
``` | |||
|
|||
### NTLH Intrisics | |||
|
|||
The RISC-V zihintntl extension provides the RISC-V specific intrinsic functions for generating non-temporal memory accesses. These intrinsic functions provide the domain parameter to specify the behavior of memory accesses. |
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.
zihintntl -> Zihintntl
Here is the proposal riscv-non-isa/riscv-c-api-doc#47. The version that omit the domain argument imply domain=__RISCV_NTLH_ALL. ``` type __riscv_ntl_load (type *ptr); void __riscv_ntl_store (type *ptr, type val); ``` Reviewed By: kito-cheng, craig.topper Differential Revision: https://reviews.llvm.org/D156221
Here is the proposal riscv-non-isa/riscv-c-api-doc#47. The version that omit the domain argument imply domain=__RISCV_NTLH_ALL. ``` type __riscv_ntl_load (type *ptr); void __riscv_ntl_store (type *ptr, type val); ``` Reviewed By: kito-cheng, craig.topper Differential Revision: https://reviews.llvm.org/D156221
This is a proposal for zihintntl intrinsic function.