4
4
5
5
@inline Base. fld (x:: AbstractSIMD , y:: AbstractSIMD ) = div (promote (x,y)... , RoundDown)
6
6
7
- @inline function Base. div (x:: AbstractSIMD{W1 ,T} , y:: AbstractSIMD{W2 ,T} , :: RoundingMode{:Down} ) where {W1,W2 ,T<: Integer }
7
+ @inline function Base. div (x:: AbstractSIMD{W ,T} , y:: AbstractSIMD{W ,T} , :: RoundingMode{:Down} ) where {W ,T<: Integer }
8
8
d = div (x, y)
9
9
d - (signbit (x ⊻ y) & (d * y != x))
10
10
end
11
11
12
- @inline Base. mod (x:: AbstractSIMD{W1 ,T} , y:: AbstractSIMD{W2 ,T} ) where {W1,W2 ,T<: Integer } =
12
+ @inline Base. mod (x:: AbstractSIMD{W ,T} , y:: AbstractSIMD{W ,T} ) where {W ,T<: Integer } =
13
13
ifelse (y == - 1 , zero (x), x - fld (x, y) * y)
14
14
15
+ @inline Base. mod (x:: AbstractSIMD{W,T} , y:: AbstractSIMD{W,T} ) where {W,T<: Unsigned } =
16
+ rem (x, y)
17
+
15
18
@inline Base. mod (i:: AbstractSIMD{<:Any,<:Integer} , r:: AbstractUnitRange{<:Integer} ) =
16
19
mod (i- first (r), length (r)) + first (r)
17
20
@@ -25,5 +28,5 @@ for (X,L,H) in Iterators.product(fill([:Any, :Missing, :AbstractSIMD], 3)...)
25
28
end
26
29
end
27
30
28
- @inline Base. clamp (x:: AbstractSIMD{<:Any, <:Integer} , r:: AbstractUnitRange{<:Integer} ) =
31
+ @inline Base. clamp (x:: AbstractSIMD{<:Any,<:Integer} , r:: AbstractUnitRange{<:Integer} ) =
29
32
clamp (x, first (r), last (r))
0 commit comments