Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
Added a few more _MM methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Apr 3, 2020
1 parent 917484c commit c17c40a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SIMDPirates"
uuid = "21efa798-c60a-11e8-04d3-e1a92915a26a"
authors = ["Chris Elrod <[email protected]>"]
version = "0.7.7"
version = "0.7.8"

[deps]
VectorizationBase = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
Expand Down
10 changes: 10 additions & 0 deletions src/integer_arithmetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,13 @@ end
@inline vadd(v::AbstractSIMDVector{W,I}, m::Mask{W}) where {W,I<:IntegerTypes} = vadd(m, v)
@inline vadd(m::Mask{W}, v::AbstractStructVec{W,I}) where {W,I<:IntegerTypes} = vadd(m, extract_data(v))

@inline Base.:(<<)(i::_MM{W}, j::SVec{W,T}) where {W,T<:Integer} = svrange(_MM{W}(i.i %T)) << j
@inline Base.:(>>)(i::_MM{W}, j::SVec{W,T}) where {W,T<:Integer} = svrange(_MM{W}(i.i %T)) >> j
@inline Base.:(>>>)(i::_MM{W}, j::SVec{W,T}) where {W,T<:Integer} = svrange(_MM{W}(i.i %T)) >>> j
@inline Base.:(<<)(i::SVec{W,T}, j::_MM{W}) where {W,T<:Integer} = i << svrange(_MM{W}(j.i %T))
@inline Base.:(>>)(i::SVec{W,T}, j::_MM{W}) where {W,T<:Integer} = i >> svrange(_MM{W}(j.i %T))
@inline Base.:(>>>)(i::SVec{W,T}, j::_MM{W}) where {W,T<:Integer} = i >>> svrange(_MM{W}(j.i %T))
@inline Base.:(<<)(i::_MM{W}, j::_MM{W}) where {W} = svrange(i) << svrange(j)
@inline Base.:(>>)(i::_MM{W}, j::_MM{W}) where {W} = svrange(i) >> svrange(j)
@inline Base.:(>>>)(i::_MM{W}, j::_MM{W}) where {W} = svrange(i) >>> svrange(j)

2 changes: 2 additions & 0 deletions src/memory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,8 @@ for store ∈ [:vstore!, :vnoaliasstore!]
@eval @inline $store(ptr::VectorizationBase.AbstractPointer{T}, m::Mask{W}, i::Tuple) where {W,T} = $store(ptr, vifelse(m, vone(Vec{W,T}), vzero(Vec{W,T})), i)
@eval @inline $store(ptr::VectorizationBase.AbstractPointer{T}, m::Mask{W}, i::Tuple, mask::Mask{W}) where {W,T} = $store(ptr, vifelse(m, vone(Vec{W,T}), vzero(Vec{W,T})), i, mask)
end
@inline vstore!(ptr::Ptr{T}, v::_MM{W}, i) where {W, T <: Integer} = vstore!(ptr, vrange(_MM{W}(v.i % T)), i)
@inline vstore!(ptr::Ptr{T}, v::_MM{W}, i, m::Mask) where {W, T <: Integer} = vstore!(ptr, vrange(_MM{W}(v.i % T)), i, m)

using VectorizationBase: AbstractColumnMajorStridedPointer, PackedStridedPointer, tdot
@inline VectorizationBase.gep(ptr::AbstractColumnMajorStridedPointer, i::NTuple{W,Core.VecElement{I}}) where {W,I<:Integer} = gep(ptr.ptr, i)
Expand Down

2 comments on commit c17c40a

@chriselrod
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/12120

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.8 -m "<description of version>" c17c40a254744ff239257a2ff9447175fdf4c879
git push origin v0.7.8

Please sign in to comment.