The MIPS32® DSP ASE
91
Programming the MIPS32® 74K™ Core Family, Revision 02.14
7.4.2 Arithmetic - 64-bit
addsc
/
addwc
generate and use a carry bit, for efficient 64-bit add.
7.4.3 Arithmetic - saturating and/or SIMD Types
•
32-bit signed saturating arithmetic:
addq_s.w
,
subq_s.w
and
absq_s.w
.
•
Paired-half and quad-byte SIMD arithmetic: perform the same operation simultaneously on both 16-bit halves or
all four 8-bit bytes of a 32-bit register. The “
q
” in the instruction mnemonic for the PH operations here is cos-
metic: Q15 and signed 16-bit integer add/subtract operations are bit-identical - Q15 only behaves very differently
when converted or multiplied.
The paired half operations are:
addq.ph
/
addq_s.ph
,
subq.ph
/
subq_s.ph
and
absq_s.ph
.
The quad-byte operations (all unsigned) are:
addu.qb
/
addu_s.qb
,
subu.qb
/
subu_s.qb
.
•
Sum of quad-byte vector:
raddu.w.qb
does an unsigned sum of the four bytes found in a register, zero extends
the result and delivers it as a 32-bit value.
7.4.4 Bit-shifts - saturating and/or SIMD types
All shifts can either have a shift amount encoded in the instruction, or - indicated by a trailing “
v
” in the instruction
name - provided as a register operand. PH and 32-bit shifts have optional forms which saturate the result.
•
32-bit signed shifts: include a saturating version of shift left,
shll_s.w
; and an auto-rounded shift right (just
the “arithmetic”, sign-propagating form):
shra_r.w
. Recall from above that rounding can be imagined as pre-
adding a half to the least significant surviving bit.
•
Paired-half and quad-byte SIMD shifts:
shll.ph
/
shllv.ph
/
shll_s.ph
/
shllv_s
are as above. For PH
only there’s a shift-right-arithmetic instruction (“arithmetic” means it propagates the sign bit downward)
shra.ph
, which has a variant which rounds the result
shra_r.ph
.
The quad-byte shifts are unsigned and don’t round or saturate:
shll.qb
/
shllv.qb
,
shrl.qb
/
shrlv.qb
.
7.4.5 Comparison and “conditional-move” operations on SIMD types
The “
cmp
” operations simultaneously compare and set flags for two or four values packed in a vector (with equality,
less-than and less-than-or-equal tests). For PH that’s
cmp.eq.ph
,
cmp.lt.ph
and
cmp.le.ph
. The result is left
in the two LS bits of
DSPControl[ccond]
.
For quad-byte values
cmpu.eq.qb
,
cmpu.lt.qb
and
cmpu.le.qb
simultaneously compare and set flags for
four bytes in
DSPControl[ccond]
- the flag relating to the bytes found in the low-order bits of the source register is in
the lowest-numbered bit (and so on). There’s an alternative set of instructions
cmpgu.eq.qb
,
cmpgu.lt.qb
and
cmpgu.le.qb
which leave the 4-bit result in a specified general-purpose register.
pick.ph
uses the two LS bits of
DSPControl[ccond]
(usually the outcome of a paired-half compare instruction, see
above) to determine whether corresponding halves of the result should come from the first or second source register.
Among other things, this can implement a paired-half conditional move. You can reverse the order of your conditional
inputs to do a move dependent on the complementary condition, too.
pick.qb
does the same for QB types, this time using four bits of
DSPControl[ccond]
.
Содержание MIPS32 74K Series
Страница 1: ...Document Number MD00541 Revision 02 14 March 30 2011 Programming the MIPS32 74K Core Family...
Страница 10: ...Programming the MIPS32 74K Core Family Revision 02 14 10...
Страница 20: ...1 4 A brief guide to the 74K core implementation Programming the MIPS32 74K Core Family Revision 02 14 20...
Страница 28: ...2 2 PRId register identifying your CPU type Programming the MIPS32 74K Core Family Revision 02 14 28...
Страница 54: ...3 8 The TLB and translation Programming the MIPS32 74K Core Family Revision 02 14 54...
Страница 83: ......
Страница 86: ...6 5 FPU pipeline and instruction timing Programming the MIPS32 74K Core Family Revision 02 14 86...
Страница 101: ...The MIPS32 DSP ASE 101 Programming the MIPS32 74K Core Family Revision 02 14...
Страница 134: ...8 4 Performance counters Programming the MIPS32 74K Core Family Revision 02 14 134...
Страница 154: ...C 3 FPU changes in Release 2 of the MIPS32 Architecture Programming the MIPS32 74K Core Family Revision 02 14 154...