Encoding:

POOL32A

000000

rt

mask

WRDSP

01011001

POOL32Axf

111100

6

5

7

8

6

SPECIAL3

011111

rs

mask

WRDSP

10011

EXTR.W

111000

6

5

10

5

6

Format:

WRDSP rst, mask

microMIPSDSP

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[rst])

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

rst. 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 rst, 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 rst and the remaining bits in DSPControl are unmodified.

The one-operand version of the instructi on provides a convenient assembly idiom that allows the programmer to write all the allowable fields in the DSPControl register from the source GPR, i.e., it is equivalent to specifying a

mask 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:

newbits31..0 = 032
overwrite31..0 = 0xFFFFFFFF
if ( mask0 = 1 ) then
   overwrite6..0 = 07
   newbits6..0 = GPR[rst]6..0
endif
if ( mask1 = 1 ) then
   overwrite12..7 = 06
   newbits12..7 = GPR[rst]12..7
endif
if ( mask2 = 1 ) then
   overwrite13 = 0
   newbits13 = GPR[rst]13
endif
if ( mask3 = 1 ) then
   overwrite23..16 = 08
   newbits23..16 = GPR[rst]23..16
endif
if ( mask4 = 1 ) then
   overwrite31..24 = 08
   newbits31..24 = GPR[rst]31..24
endif
if ( mask5 = 1 ) then
   overwrite14 = 0
   newbits14 = GPR[rst]14
endif
DSPControl = DSPControl and overwrite31..0
DSPControl = DSPControl or new31..0

Exceptions:

Reserved Instruction, DSP Disabled