Encoding:

P32A

001000

rt

mask

01

011

001

111

111

6

5

7

2

3

3

3

3

Format:

WRDSP rt, mask

DSP

Write Fields to DSPControl Register from a GPR

Purpose:

Write Fields to DSPControl Register from a GPR

To copy selected fields from the specified GPR to the special-purpose DSPControl register.

Description:

DSPControl = select(mask, GPR[rt])

Selected fields in the special register DSPControl are overwritten with the corresponding bits from the source GPR rt.

Each of bits 0 through 5 of the mask operand corresponds to a specific field in the DSPControl register. A mask bit value of 1 indicates that the field will be overwritten using the bits from the same bit positions in register rt, and a mask bit value of 0 indicates that the corresponding field will be unchanged. Bits 6 through 9 of the mask operand are ignored.

The table below shows the correspondence between the bits in the mask operand and the fields in the DSPControl register; mask bit 0 is the least-significant bit in mask.

ccond

ouflag

0

EFI C

scount

pos

4

3

5

2

1

0

For example, to overwrite only the scount field in DSPControl, the value of the mask operand used will be 2 decimal

(0x02 hexadecimal). After execution of the instruction, the scount field in DSPControl will have the value of bits 7 through 12 of the specified source register rt and the remaining bits in DSPControl are unmodified.

The one-operand version of the instruction provides a convenient assembly idiom that allows the programmer to write

, it is equivalent to specifying a mask all the allowable fields in the DSPControl register from the source GPR, i.e. value of 31 decimal (0x1F hexadecimal).

Restrictions:

No data-dependent exceptions are possible.

The operands must be values in the specified format. If they are not, the results are UNPREDICTABLE and the values of the operand vectors become UNPREDICTABLE.

Operation:

ValidateAccessToDSPResources()
newbits31..0 = 032
overwrite31..0 = 0xFFFFFFFF
if ( mask0 = 1 ) then
   overwrite5..0 = 06
   newbits5..0 = GPR[rt]5..0
endif
if ( mask1 = 1 ) then
   overwrite12..7 = 06
   newbits12..7 = GPR[rt]12..7
endif
if ( mask2 = 1 ) then
   newbits13 = GPR[rt]13
endif
if ( mask3 = 1 ) then
   overwrite23..16 = 08
   newbits23..16 = GPR[rt]23..16
endif
if ( mask4 = 1 ) then
   overwrite31..24 = 08
   newbits31..24 = GPR[rt]31..24
endif
if ( mask5 = 1 ) then
   overwrite14 = 0
   newbits14 = GPR[rt]14
endif
DSPControl = DSPControl and overwrite31..0
DSPControl = DSPControl or new31..0

Exceptions:

Reserved Instruction, DSP Disabled