-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 support for intrinsics for NTuple{VecElement}
#55118
base: master
Are you sure you want to change the base?
Add support for intrinsics for NTuple{VecElement}
#55118
Conversation
7ee1df5
to
6aced19
Compare
As one of the people rather excited about this, I'm wondering whether I might hope to see this progress to a non-draft PR in the near future, or whether this has some blocker/major further work needed? 🙂 |
I'm unlikely to have time to do all the things that likely will be necessary to finish this off. there's no blockers, just a bunch more work. |
e05da0d
to
b5117ac
Compare
export vload, vstore!, natural_vecwidth | ||
|
||
# TODO: See C# and Co Vec type | ||
# TODO: Hardware portable vector types... |
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.
Would this include vscale
? 👀
Co-authored-by: Mosè Giordano <[email protected]>
4977f8c
to
71dd9ab
Compare
import Core.Intrinsics: add_float, sub_float, mul_float, div_float, muladd_float, neg_float | ||
|
||
## floating point promotions ## | ||
promote_rule(::Type{Vec{N, Float32}}, ::Type{Vec{N, Float16}}) where N = Vec{N, Float32} |
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.
It is not obvious to me that these should be defined. When you are doing low level SIMD stuff you probably don't want to accidentally promote things and in case where you really want to work with different types, an explicit convert might be better for clarity?
This is the start towards proper SIMD support in Base. Currently the main things missing are support for masked/predicated instructions, and an intrinsic to load an arbitrarily chosen sized
NTuple{n, VecElement}
from aMemory
. Many thanks to Alexandre Prieur for pair programming this with me, and @vtjnash, @gbaraldi and @vchuravy for answering the 50 million questions about C++/LLVM/debugging.