-
-
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
[RFC/WIP] Intrinsics for NTuple{N, VecElement}
#18470
Conversation
@@ -936,6 +937,24 @@ STATIC_INLINE int jl_is_vecelement_type(jl_value_t* t) | |||
((jl_datatype_t*)(t))->name == jl_vecelement_typename); | |||
} | |||
|
|||
STATIC_INLINE int jl_is_vec_type(jl_value_t* t) | |||
{ | |||
if (!jl_is_tuple_type(t)) |
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.
4 space (also one case in the test)
So the big show-stopper for this are our runtime intrinsics. I am slightly tempted to punt this down the road till somebody actually needs it and for now implement |
jl_errorf("%s: type is not a bitstype", name); | ||
if (!(jl_is_bitstype(aty) || jl_is_vec_type(aty))) | ||
jl_errorf("%s: value is not a bitstype or vector type", name); | ||
if (!(jl_is_bitstype(ty) || jl_is_vec_type(aty))) |
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.
Did you mean ty
instead of aty
here?
* Use `jl_datatype_size` instead of `dt->size`. `jl_datatype_size` is always in bytes, whereas the underlying implementation of `dt->size` might change. * do not use .size directly (that is just asking for trouble) * Introduce `jl_datatype_nbits` that gives nbits Instead of calculating it per hand everywhere. This allows for interesting experiments (and eventually not restricting `bitstype` to multiplies of 8).
How's this going? |
Stalled because it needs a big refactor of |
Cool. You'll probably want to talk/collaborate with @vtjnash on any intrinsics work so you two aren't working across purposes. |
This doesn't look like it's going to be ready in time for 0.6. |
No this won't be ready in time and is somewhat dependent on the runtime-library julep. |
Seems like a feature that can be post-1.0. |
This fixes #18445 by handling
NTuple{N, VecElement}
in the lowering of our intrinsics. This should make it easier to implement the fundamentals ofSIMD.jl
withoutllvmcall
and maybe in the long-term enable us to have SIMD types in base julia.Todo:
jl_is_vec_type
check thatVecElement
contains ajl_is_bitstype
If needed I can separate out b2f6b1b and fb12337 into a separate PR.
cc @eschnett