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

Vector Shift Right and Left

vec_sr(arg1, arg2)
vec_sl(arg1, arg2)

Each element of the result is obtained by shifting the corresponding element of arg1 right or left by the number of bits specified in the corresponding element of arg2. Byte, halfword, and word results use the least significant 3, 4, and 5 bits, respectively, of the corresponding element of arg2. Bits shifted out are replaced by zeroes for both signed and unsigned types.

Result

arg1

arg2

vec_sr
vec_sl
Maps To

vector unsigned char

vector unsigned char

vector unsigned char

vsrb
vslb

vector signed char

vector signed char

vector unsigned char

vsrb
vslb

vector unsigned short

vector unsigned short

vector unsigned short

vsrh
vslh

vector signed short

vector signed short

vector unsigned short

vsrh
vslh

vector unsigned long

vector unsigned long

vector unsigned long

vsrw
vslw

vector signed long

vector signed long

vector unsigned long

vsrw
vslw
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