-
Notifications
You must be signed in to change notification settings - Fork 35
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
Refactor package into one part dealing with LLVM and one part that builds a Vec on top of that #63
Merged
Commits on Feb 21, 2020
-
This PR pretty much rewrites the package from scratch (with the
exception of some of the indexing implemented by tkf) while keeping the API intact. The reason for this is that I felt that the code could gain a lot of clarity by clearly separating the parts that deals with LLVM/`llvmcall` and then build a `Vec` on top of that. The number of lines of code has also been reduced from ~1600 to 1000. The code is structured as follows: - `LLVM_Intrinsics.jl` is pretty much a direct mapping of Julia Vectors (`NTuple{N, VecElement{T}}`) to the operators and intrinsics defined in https://llvm.org/docs/LangRef.html. It contains almost no higher level logic. - `simdvec.jl` contains the `Vec` (wrapping the tuple of `VecElement`s) with definitions defined on it that maps to the intrinsics defined in `LLVM.jl`. In some cases this is pretty automatic but in some cases requires some logic (like in the bitshifts partly to avoid undefined behavior or in the different conversions). - `arrayops.jl` is the stuff that deals with Julia `Array` like `vload`, `vstore`, `vgather`. Things that have gotten added to the API: - The `count_ones, count_zeros, leading_ones, leading_zeros, trailing_ones, trailing_zeros` family of functions. - Type conversions and different types of reinterprets from scalar to vectors and back and between vectors of different size: ```jl julia> v = Vec((Int32(2), Int32(4))) <2 x Int32>[2, 4] julia> reinterpret(Int64, v) 17179869186 julia> reinterpret(Vec{4, Int16}, v) <4 x Int16>[2, 0, 4, 0] julia> reinterpret(Vec{2, Int32}, 4) <2 x Int32>[4, 0] julia> convert(Vec{2, Float32}, v) <2 x Float32>[2.0, 4.0] ``` - Uses the LLVM vector reduction intrinsics (https://llvm.org/docs/LangRef.html#experimental-vector-reduction-intrinsics) instead of a hand rolled reducer. Things that has been removed from the API: - Removed the `Val` arguments from many functions (`setindex`, `>>` etc). Julia's constant propagation + LLVM's optimization are enough for these not to be needed. Things are specialized on the constant just as well as if using `Val`. - Removed the `Val{}` arguments and just use `Val()` consistently everywhere. - Removed `exp10`. This used to just call `10^v` but the reason you would use `exp10` is that there is a more efficient implementation for it than the naive one. I feel that providing `exp10` gives the false impression that it provides a benefit over the naive version Co-Authored-By: Valentin Churavy <vchuravy@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 83a7471 - Browse repository at this point
Copy the full SHA 83a7471View commit details -
Configuration menu - View commit details
-
Copy full SHA for 68c0b2d - Browse repository at this point
Copy the full SHA 68c0b2dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e3321e5 - Browse repository at this point
Copy the full SHA e3321e5View commit details
Commits on Feb 22, 2020
-
Configuration menu - View commit details
-
Copy full SHA for bf71b69 - Browse repository at this point
Copy the full SHA bf71b69View commit details -
Configuration menu - View commit details
-
Copy full SHA for f237a54 - Browse repository at this point
Copy the full SHA f237a54View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9efd543 - Browse repository at this point
Copy the full SHA 9efd543View commit details -
Configuration menu - View commit details
-
Copy full SHA for 86805c2 - Browse repository at this point
Copy the full SHA 86805c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for bca864d - Browse repository at this point
Copy the full SHA bca864dView commit details -
Configuration menu - View commit details
-
Copy full SHA for bbd89f8 - Browse repository at this point
Copy the full SHA bbd89f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0706d0f - Browse repository at this point
Copy the full SHA 0706d0fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5167673 - Browse repository at this point
Copy the full SHA 5167673View commit details -
throw when trying to call mul with overflow on Int64 on i686 because
the error we get is "LLVM ERROR: Symbols not found: { __mulodi4 }" which seems like it would require compiler-rt support"
Configuration menu - View commit details
-
Copy full SHA for 5fb86c2 - Browse repository at this point
Copy the full SHA 5fb86c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 67372bf - Browse repository at this point
Copy the full SHA 67372bfView commit details
Commits on Feb 23, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 5de3b15 - Browse repository at this point
Copy the full SHA 5de3b15View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8204863 - Browse repository at this point
Copy the full SHA 8204863View commit details
Commits on Mar 4, 2020
-
add fast math options to intrinsics and hook into fastmath macro (#1)
Kristoffer Carlsson authoredMar 4, 2020 Configuration menu - View commit details
-
Copy full SHA for bdfd585 - Browse repository at this point
Copy the full SHA bdfd585View commit details
Commits on Mar 5, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 05949bc - Browse repository at this point
Copy the full SHA 05949bcView commit details
Commits on Mar 22, 2020
-
Kristoffer Carlsson authored
Mar 22, 2020 Configuration menu - View commit details
-
Copy full SHA for 37b2340 - Browse repository at this point
Copy the full SHA 37b2340View commit details
Commits on Mar 23, 2020
-
Configuration menu - View commit details
-
Copy full SHA for e8f5815 - Browse repository at this point
Copy the full SHA e8f5815View commit details
Commits on Mar 31, 2020
-
this release should be non-breaking
Kristoffer Carlsson authoredMar 31, 2020 Configuration menu - View commit details
-
Copy full SHA for 90d54fd - Browse repository at this point
Copy the full SHA 90d54fdView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.