Technical: Hardware: G4
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Vector Shift Right Logical and Left Logical

vec_srl(arg1, arg2)
vec_sll(arg1, arg2)

The result is obtained by shifting the entire 128 bits of arg1 right or left by the number of bits specified in the least significant three bits of arg2. Bits shifted out are replaced by zeroes for both signed and unsigned types.

CAUTION: The three bits used for the shift value must be replicated in each byte of arg2 or the results of the shift are unpredictable. This may be done using vec_splat / vec_vspltb:

arg2 = vec_vspltb( arg2, 15 );

Result

arg1

arg2

vec_srl
vec_sll
Maps To

vector unsigned char

vector unsigned char

vector unsigned char

vsr
vsl

vector unsigned char

vector unsigned char

vector unsigned short

vsr
vsl

vector unsigned char

vector unsigned char

vector unsigned long

vsr
vsl

vector signed char

vector signed char

vector unsigned char

vsr
vsl

vector signed char

vector signed char

vector unsigned short

vsr
vsl

vector signed char

vector signed char

vector unsigned long

vsr
vsl

vector bool char

vector bool char

vector unsigned char

vsr
vsl

vector bool char

vector bool char

vector unsigned short

vsr
vsl

vector bool char

vector bool char

vector unsigned long

vsr
vsl

vector unsigned short

vector unsigned short

vector unsigned char

vsr
vsl

vector unsigned short

vector unsigned short

vector unsigned short

vsr
vsl

vector unsigned short

vector unsigned short

vector unsigned long

vsr
vsl

vector signed short

vector signed short

vector unsigned char

vsr
vsl

vector signed short

vector signed short

vector unsigned short

vsr
vsl

vector signed short

vector signed short

vector unsigned long

vsr
vsl

vector bool short

vector bool short

vector unsigned char

vsr
vsl

vector bool short

vector bool short

vector unsigned short

vsr
vsl

vector bool short

vector bool short

vector unsigned long

vsr
vsl

vector pixel

vector pixel

vector unsigned char

vsr
vsl

vector pixel

vector pixel

vector unsigned short

vsr
vsl

vector pixel

vector pixel

vector unsigned long

vsr
vsl

vector unsigned long

vector unsigned long

vector unsigned char

vsr
vsl

vector unsigned long

vector unsigned long

vector unsigned short

vsr
vsl

vector unsigned long

vector unsigned long

vector unsigned long

vsr
vsl

vector signed long

vector signed long

vector unsigned char

vsr
vsl

vector signed long

vector signed long

vector unsigned short

vsr
vsl

vector signed long

vector signed long

vector unsigned long

vsr
vsl

vector bool long

vector bool long

vector unsigned char

vsr
vsl

vector bool long

vector bool long

vector unsigned short

vsr
vsl

vector bool long

vector bool long

vector unsigned long

vsr
vsl
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice