Skip to content
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

Fix (x::Vec)^n for n>3 #120

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dubosipsl
Copy link

Fixes:

julia> SIMD.Vec(randn(Float64,4)...)^4
ERROR: MethodError: no method matching powi(::NTuple{4, VecElement{Float64}}, ::Int64)

Or is there a good reason to not define powi for Int64 exponents ?

@KristofferC
Copy link
Collaborator

Looking at https://llvm.org/docs/LangRef.html#llvm-powi-intrinsic it says:

Generally, the only supported type for the exponent is the one matching with the C type int.

but we could maybe do some conversion on the Julia side to bring it down to a 32 bit int before passing it to LLVM.

@dubosipsl
Copy link
Author

I have pushed another, pure Julia approach (no LLVM intrinsics). Is that better ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants