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

D.4 Subtract Mnemonics<br />

D.4.1<br />

Subtract Immediate<br />

Although there is no “Subtract Immediate” instruction, its effect can be achieved by using an Add Immediate instruction<br />

with the immediate operand negated. Extended mnemonics are provided that include this negation, making the<br />

intent of the computation clearer.<br />

subi Rx,Ry,value (equivalent to: addi Rx,Ry,-value)<br />

subis Rx,Ry,value (equivalent to: addis Rx,Ry,-value)<br />

subic Rx,Ry,value (equivalent to: addic Rx,Ry,-value)<br />

subic. Rx,Ry,value (equivalent to: addic. Rx,Ry,-value)<br />

D.4.2<br />

Subtract<br />

The Subtract From instructions subtract the second operand (RA) from the third (RB). Extended mnemonics are provided<br />

that use the more “normal” order, in which the third operand is subtracted from the second. Both these mnemonics<br />

can be coded with a final “o” and/or “.” to cause the OE and/or Rc bit to be set in the underlying instruction.<br />

sub Rx,Ry,Rz (equivalent to: subf Rx,Rz,Ry)<br />

subc Rx,Ry,Rz (equivalent to: subfc Rx,Rz,Ry)<br />

D.5 Compare Mnemonics<br />

The L field in the fixed-point Compare instructions controls whether the operands are treated as 64-bit quantities or<br />

as 32-bit quantities. Extended mnemonics are provided that represent the L value in the mnemonic rather than<br />

requiring it to be coded as a numeric operand.<br />

The BF field can be omitted if the result of the comparison is to be placed into CR Field 0. Otherwise the target CR<br />

field must be specified as the first operand. One of the CR field symbols defined in Section D.1 can be used for this<br />

operand.<br />

D.5.1<br />

Doubleword Comparisons<br />

Table 14: Doubleword compare mnemonics<br />

Operation Extended Mnemonic Equivalent to<br />

Compare doubleword immediate cmpdi bf,ra,si cmpi bf,1,ra,si<br />

Compare doubleword cmpd bf,ra,rb cmp bf,1,ra,rb<br />

Compare logical doubleword immediate cmpldi bf,ra,ui cmpli bf,1,ra,ui<br />

Compare logical doubleword cmpld bf,ra,rb cmpl bf,1,ra,rb<br />

Examples<br />

1. Compare register Rx and immediate value 100 as unsigned 64-bit integers and place result into CR0.<br />

cmpldi Rx,100 (equivalent to: cmpli 0,1,Rx,100)<br />

2. Same as (1), but place result into CR4.<br />

cmpldi cr4,Rx,100 (equivalent to: cmpli 4,1,Rx,100)<br />

3. Compare registers Rx and Ry as signed 64-bit integers and place result into CR0.<br />

cmpd Rx,Ry (equivalent to: cmp 0,1,Rx,Ry)<br />

Appendix D. Assembler Extended Mnemonics<br />

317

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

Saved successfully!

Ooh no, something went wrong!