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 />

5.9.2 Vector Integer Compare Instructions<br />

The Vector Integer Compare instructions compare two<br />

Vector Registers element by element, interpreting the<br />

elements as unsigned or signed-integers depending on<br />

the instruction, and set the corresponding element of<br />

the target Vector Register to all 1s if the relation being<br />

tested is true and to all 0s if the relation being tested is<br />

false.<br />

If Rc=1 CR Field 6 is set to reflect the result of the comparison,<br />

as follows.<br />

Bit Description<br />

0 The relation is true for all element pairs<br />

(i.e., VRT is set to all 1s)<br />

1 0<br />

2 The relation is false for all element pairs<br />

(i.e., VRT is set to all 0s)<br />

3 0<br />

Programming Note<br />

vcmpequb[.], vcmpequh[.] and vcmpequw[.] can<br />

be used for unsigned or signed-integers.<br />

Vector Compare Equal To Unsigned Byte<br />

VC-form<br />

vcmpequb VRT,VRA,VRB ( Rc=0)<br />

vcmpequb. VRT,VRA,VRB ( Rc=1)<br />

4 VRT VRA VRB Rc 6<br />

0 6 11 16 21 22 31<br />

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

VRT i:i+7 ((VRA) i:i+7 = int (VRB) i:i+7 ) ? 8 1 : 8 0<br />

if Rc=1 then do<br />

t (VRT= 128 1)<br />

f (VRT= 128 0)<br />

CR6 t || 0b0 || f || 0b0<br />

For each vector element i from 0 to 15, do the following.<br />

Unsigned-integer byte element i in VRA is compared<br />

to unsigned-integer byte element i in VRB.<br />

Byte element i in VRT is set to all 1s if<br />

unsigned-integer byte element i in VRA is equal to<br />

unsigned-integer byte element i in VRB, and is set<br />

to all 0s otherwise.<br />

Special Registers Altered:<br />

CR6<br />

(if Rc=1)<br />

Vector Compare Equal To Unsigned<br />

Halfword<br />

VC-form<br />

vcmpequh VRT,VRA,VRB ( Rc=0)<br />

vcmpequh. VRT,VRA,VRB ( Rc=1)<br />

4 VRT VRA VRB Rc 70<br />

0 6 11 16 21 22 31<br />

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

VRT i:i+15 ((VRA) i:i+15 = int (VRB) i:i+15 ) ? 16 1 : 16 0<br />

if Rc=1 then do<br />

t (VRT= 128 1)<br />

f (VRT= 128 0)<br />

CR6 t || 0b0 || f || 0b0<br />

For each vector element i from 0 to 7, do the following.<br />

Unsigned-integer halfword element i in VRA is<br />

compared to unsigned-integer halfword element<br />

element i in VRB. Halfword element i in VRT is set<br />

to all 1s if unsigned-integer halfword element i in<br />

VRA is equal to unsigned-integer halfword element<br />

i in VRB, and is set to all 0s otherwise.<br />

Special Registers Altered:<br />

CR6<br />

(if Rc=1)<br />

Chapter 5. Vector Processor [Category: Vector]<br />

175

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

Saved successfully!

Ooh no, something went wrong!