7.4 DSP instructions
Programming the MIPS32® 74K™ Core Family, Revision 02.14
94
7.4.11 Accumulator access instructions
•
Historical instructions which now access new accumulators: the familiar
mfhi
/
mflo
/
mthi
/
mtlo
instructions
now take an optional extra accumulator-number parameter.
•
Shift and move to general register:
extr.w
/
extr_r.w
/
extr_rs.w
gets a 32-bit field from an accumulator
(starting at bit 0 up to 31) and puts the value in a general purpose register. At your option you can specify round-
ing and signed 32-bit saturation.
extrv.w
/
extrv_r.w
/
extrv_rs.w
do the same but specify the field’s starting bit number with a register.
•
Extract bitfield from accumulator:
extp
/
extpv
takes a bitfield (up to 32 bits) from an accumulator and moves
it to a GPR. The length of the field can be an immediate value or from a register. The position of the field is deter-
mined by
DSPControl[pos]
, which holds the bit number of the most significant bit.
extpdp
/
extpdpv
do the same, but also auto-decrement
DSPControl[pos]
to the bit-number just below the field
you extracted.
•
Accumulator rearrangement:
shilo
/
shilov
has a signed shift value between -32 and +31, where positive
numbers shift right, and negative ones shift left. The “v” version, as usual, takes the shift value from a register.
The right shift is a “logical” type so the result is zero extended.
•
Fill accumulator pushing low half to high:
mthlip
moves the low half of the accumulator to the high half, then
writes the GPR value in the low half. Generally used to bring 32 more bits from a bitstream into the accumulator
for parsing by the various
ext
... instructions.
7.4.12 Dot products and building blocks for complex multiplication
In 2-dimensional vector math (or in any doubled-up step of a multiply-accumulate sequence which has been opti-
mized for 2-way SIMD) you’re often interested in the dot product of two vectors:
v[0]*w[0] + v[1]*w[1]
In many cases you take the dot product of a series of vectors and add it up, too.
Some algorithms use complex numbers, represented by 2D vectors. Complex numbers use
i
to stand for “the square
root of -1”, and a vector
[a, b]
is interpreted as
a + ib
(mathematicians leave out the multiply sign and use single-
letter variables, habits which would not be appreciated in C programming!) Complex multiplication just follows the
rules of multiplying out sums, remembering that
i*i = -1
, so:
(a + ib)*(c + id) = (a*c - b*d) + i(a*d + b*c)
Or in vector format:
[a, b] * [c, d] = [a*c - b*d, a*d + b*c]
The first element of the result (the “real component”) is like a dot product but with a subtraction, and the second (the
“imaginary component”) is like a dot product but with the vectors crossed.
Summary of Contents for MIPS32 74K Series
Page 1: ...Document Number MD00541 Revision 02 14 March 30 2011 Programming the MIPS32 74K Core Family...
Page 10: ...Programming the MIPS32 74K Core Family Revision 02 14 10...
Page 54: ...3 8 The TLB and translation Programming the MIPS32 74K Core Family Revision 02 14 54...
Page 83: ......
Page 101: ...The MIPS32 DSP ASE 101 Programming the MIPS32 74K Core Family Revision 02 14...
Page 134: ...8 4 Performance counters Programming the MIPS32 74K Core Family Revision 02 14 134...