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 some shift operations to agree with Base (and prevent undefined behavior) #119

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

KristofferC
Copy link
Collaborator

…ehavior)

Due to an off by one, shifting with the exact amount as the number of bits caused garbage to get returned:

julia> f2(v) = v >> 64
f2 (generic function with 1 method)

julia> v = Vec(1,2,3,4)
<4 x Int64>[1, 2, 3, 4]

julia> @code_llvm f2(v)
;  @ REPL[25]:1 within `f2`
define void @julia_f2_542([1 x <4 x i64>]* noalias nocapture noundef nonnull sret([1 x <4 x i64>]) align 32 dereferenceable(32) %0, [1 x <4 x i64>]* nocapture noundef nonnull readonly align 16 dereferenceable(32) %1) #0 {
top:
  ret void
}

Ref https://discourse.julialang.org/t/simd-struggles-seeking-solutions-with-kangarootwelve-jl/105800/23?u=kristoffer.carlsson

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files Coverage Δ
src/simdvec.jl 79.12% <100.00%> (ø)

... and 1 file with indirect coverage changes

📢 Thoughts on this report? Let us know!

@KristofferC
Copy link
Collaborator Author

Error on nightly is unrelated.

@KristofferC KristofferC merged commit a07992d into master Nov 7, 2023
5 of 10 checks passed
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