14.06.2015 Views

Power ISA™ Version 2.03 - Power.org

Power ISA™ Version 2.03 - Power.org

Power ISA™ Version 2.03 - Power.org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Version</strong> <strong>2.03</strong><br />

Vector Shift Right<br />

VX-form<br />

Vector Shift Right by Octet<br />

VX-form<br />

vsr<br />

VRT,VRA,VRB<br />

vsro<br />

VRT,VRA,VRB<br />

4 VRT VRA VRB 708<br />

0 6 11 16 21 31<br />

4 VRT VRA VRB 1100<br />

0 6 11 16 21 31<br />

sh (VRB) 125:127<br />

t 1<br />

do i=0 to 127 by 8<br />

t t & ((VRB) i+5:i+7 =sh)<br />

if t=1 then VRT (VRA) >> ui sh<br />

else VRT undefined<br />

The contents of VRA are shifted right by the number of<br />

bits specified in (VRB) 125:127 .<br />

- Bits shifted out of bit 127 are lost.<br />

- Zeros are supplied to the vacated bits on the<br />

left.<br />

The result is place into VRT, except if, for any byte element<br />

in register VRB, the low-order 3 bits are not equal<br />

to the shift amount, then VRT is undefined.<br />

Special Registers Altered:<br />

None<br />

shb (VRB) 121:124<br />

VRT (VRA) >> ui ( shb || 0b000 )<br />

The contents of VRA are shifted right by the number of<br />

bytes specified in (VRB) 121:124 .<br />

- Bytes shifted out of byte 15 are lost.<br />

- Zeros are supplied to the vacated bytes on the<br />

left.<br />

The result is placed into VRT.<br />

Special Registers Altered:<br />

None<br />

Programming Note<br />

A double-register shift by a dynamically specified<br />

number of bits (0-127) can be performed in six<br />

instructions. The following example shifts Vw || Vx<br />

left by the number of bits specified in Vy and places<br />

the high-order 128 bits of the result into Vz.<br />

vslo Vt1,Vw,Vy #shift high-order reg left<br />

vsl Vt1,Vt1,Vy<br />

vsububm Vt3,V0,Vy #adjust shift count ((V0)=0)<br />

vsro Vt2,Vx,Vt3 #shift low-order reg right<br />

vsr Vt2,Vt2,Vt3<br />

vor Vz,Vt1,Vt2 #merge to get final result<br />

154<br />

<strong>Power</strong> ISA -- Book I

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!