Intel ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3 Manual page 1666

Hide thumbs Also See for ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3:
Table of Contents

Advertisement

SHRD—Double Precision Shift Right
Opcode
0F AC
0F AD
0F AC
0F AD
Description
Shifts the first operand (destination operand) to the right the number of bits specified
by the third operand (count operand). The second operand (source operand) provides
bits to shift in from the left (starting with the most significant bit of the destination
operand). The destination operand can be a register or a memory location; the source
operand is a register. The count operand is an unsigned integer that can be an
immediate byte or the contents of the CL register. Only bits 0 through 4 of the count
are used, which masks the count to a value between 0 and 31. If the count is greater
than the operand size, the result in the destination operand is undefined.
If the count is 1 or greater, the CF flag is filled with the last bit shifted out of the
destination operand. For a 1-bit shift, the OF flag is set if a sign change occurred;
otherwise, it is cleared. If the count operand is 0, the flags are not affected.
The SHRD instruction is useful for multiprecision shifts of 64 bits or more.
Operation
COUNT  COUNT MOD 32;
SIZE  OperandSize
IF COUNT = 0
THEN
no operation
ELSE
IF COUNT  SIZE
FI;
FI;
4:364
Instruction
SHRD r/m16,r16,imm8
SHRD r/m16,r16 ,CL
SHRD r/m32,r32,imm8
SHRD r/m32,r32 ,CL
THEN (* Bad parameters *)
DEST is undefined;
CF, OF, SF, ZF, AF, PF are undefined;
ELSE (* Perform the shift *)
CF  BIT[DEST, COUNT - 1]; (* last bit shifted out on exit *)
FOR i  0 TO SIZE - 1 - COUNT
DO
BIT[DEST, i]  BIT[DEST, i - COUNT];
OD;
FOR i  SIZE - COUNT TO SIZE - 1
DO
BIT[DEST,i]  BIT[inBits,i+COUNT - SIZE];
OD;
Description
Shift r/m16 to right imm8 places while shifting bits from r16 in
from the left
Shift r/m16 to right CL places while shifting bits from r16 in from
the left
Shift r/m32 to right imm8 places while shifting bits from r32 in
from the left
Shift r/m32 to right CL places while shifting bits from r32 in from
the left
Volume 4: Base IA-32 Instruction Reference

Advertisement

Table of Contents
loading

This manual is also suitable for:

Itanium architecture 2.3

Table of Contents