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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

3.3.13.1.1 64-bit Fixed-Point Rotate Instructions<br />

[Category: 64-Bit]<br />

Rotate Left Doubleword Immediate then<br />

Clear Left<br />

MD-form<br />

rldicl RA,RS,SH,MB (Rc=0)<br />

rldicl. RA,RS,SH,MB (Rc=1)<br />

30 RS RA sh mb 0 sh Rc<br />

0 6 11 16 21 27 30 31<br />

Rotate Left Doubleword Immediate then<br />

Clear Right<br />

MD-form<br />

rldicr RA,RS,SH,ME (Rc=0)<br />

rldicr. RA,RS,SH,ME (Rc=1)<br />

30 RS RA sh me 1 sh Rc<br />

0 6 11 16 21 27 30 31<br />

n sh 5 || sh 0:4<br />

r ROTL 64 ((RS), n)<br />

b mb 5 || mb 0:4<br />

m MASK(b, 63)<br />

RA r & m<br />

The contents of register RS are rotated 64 left SH bits.<br />

A mask is generated having 1-bits from bit MB through<br />

bit 63 and 0-bits elsewhere. The rotated data are<br />

ANDed with the generated mask and the result is<br />

placed into register RA.<br />

Special Registers Altered:<br />

CR0<br />

(if Rc=1)<br />

Extended Mnemonics:<br />

Examples of extended mnemonics for Rotate Left Doubleword<br />

Immediate then Clear Left:<br />

Extended:<br />

Equivalent to:<br />

extrdi Rx,Ry,n,b rldicl Rx,Ry,b+n,64-n<br />

srdi Rx,Ry,n rldicl Rx,Ry,64-n,n<br />

clrldi Rx,Ry,n rldicl Rx,Ry,0,n<br />

Programming Note<br />

rldicl can be used to extract an n-bit field that starts<br />

at bit position b in register RS, right-justified into<br />

register RA (clearing the remaining 64-n bits of<br />

RA), by setting SH=b+n and MB=64-n. It can be<br />

used to rotate the contents of a register left (right)<br />

by n bits, by setting SH=n (64-n) and MB=0. It can<br />

be used to shift the contents of a register right by n<br />

bits, by setting SH=64-n and MB=n. It can be used<br />

to clear the high-order n bits of a register, by setting<br />

SH=0 and MB=n.<br />

Extended mnemonics are provided for all of these<br />

uses; see Appendix D, “Assembler Extended Mnemonics”<br />

on page 313.<br />

n sh 5 || sh 0:4<br />

r ROTL 64 ((RS), n)<br />

e me 5 || me 0:4<br />

m MASK(0, e)<br />

RA r & m<br />

The contents of register RS are rotated 64 left SH bits.<br />

A mask is generated having 1-bits from bit 0 through bit<br />

ME and 0-bits elsewhere. The rotated data are ANDed<br />

with the generated mask and the result is placed into<br />

register RA.<br />

Special Registers Altered:<br />

CR0<br />

(if Rc=1)<br />

Extended Mnemonics:<br />

Examples of extended mnemonics for Rotate Left Doubleword<br />

Immediate then Clear Right:<br />

Extended:<br />

Equivalent to:<br />

extldi Rx,Ry,n,b rldicr Rx,Ry,b,n-1<br />

sldi Rx,Ry,n rldicr Rx,Ry,n,63-n<br />

clrrdi Rx,Ry,n rldicr Rx,Ry,0,63-n<br />

Programming Note<br />

rldicr can be used to extract an n-bit field that<br />

starts at bit position b in register RS, left-justified<br />

into register RA (clearing the remaining 64-n bits of<br />

RA), by setting SH=b and ME=n-1. It can be used<br />

to rotate the contents of a register left (right) by n<br />

bits, by setting SH=n (64-n) and ME=63. It can be<br />

used to shift the contents of a register left by n bits,<br />

by setting SH=n and ME=63-n. It can be used to<br />

clear the low-order n bits of a register, by setting<br />

SH=0 and ME=63-n.<br />

Extended mnemonics are provided for all of these<br />

uses (some devolve to rldicl); see Appendix D,<br />

“Assembler Extended Mnemonics” on page 313.<br />

Chapter 3. Fixed-Point Processor<br />

77

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

Saved successfully!

Ooh no, something went wrong!