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

reduce(min, Vec) doesn't respect IEEE 754 #129

Closed
Moelf opened this issue Oct 28, 2024 · 3 comments · Fixed by #130
Closed

reduce(min, Vec) doesn't respect IEEE 754 #129

Moelf opened this issue Oct 28, 2024 · 3 comments · Fixed by #130

Comments

@Moelf
Copy link

Moelf commented Oct 28, 2024

julia> a = SIMD.Vec((1.0, 2.0, NaN, 0.5))
<4 x Float64>[1.0, 2.0, NaN, 0.5]

julia> reduce(min, a)
0.5

julia> reduce(min, [1.0, 2.0, NaN, 0.5])
NaN
@KristofferC
Copy link
Collaborator

KristofferC commented Oct 29, 2024

Everything in this package pretty much directly calls into LLVM so this should be reported there imo.

@Moelf
Copy link
Author

Moelf commented Oct 29, 2024

depends on what we want though -- https://llvm.org/docs/LangRef.html#llvm-implementation they do have one minimum as oppose to minnum that has this semantics

@KristofferC
Copy link
Collaborator

I think https://llvm.org/docs/LangRef.html#llvm-vector-reduce-fmaximum-intrinsic is the relevant intrinsics which only seems available on julia nightly (LLVM 18).

#130

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