vrshift ( u n -- w )
Factor documentation > Factor handbook > The language > Numbers > Vector operations > Vector component- and bit-wise logic
Prev:vlshift ( u n -- w )
Next:vand ( u v -- w )


Vocabulary
math.vectors

Inputs and outputs
ua sequence of integers
na non-negative integer
wa sequence of integers


Word description
Shifts each element of u to the right by n bits.

Notes
Undefined behavior will result if n is negative.

Definition
IN: math.vectors

GENERIC# vrshift 1 ( u n -- w )


Methods
USING: kernel math.vectors sequences.cords ;

M: cord vrshift [ vrshift ] curry cord-map ; inline


USING: kernel math math.vectors sequences ;

M: object vrshift neg [ shift ] curry map ; inline


USING: generic kernel math.vectors math.vectors.simd
math.vectors.simd.intrinsics math.vectors.simd.private ;

M: simd-128 vrshift
over simd-rep
[ (simd-vrshift) ]
[ M\ simd-128 vrshift (call-next-method) ] vn->v-op ;
inline