Examples
xvii
Contents
3–15
Float Dot Product Using Intrinsics
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–16
Float Dot Product With Peak Performance
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–17
Int Dot Product with Nonaligned Doubleword Reads
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–18
Using the Compiler to Generate a Dot Product With Word Accesses
. . . . . . . . . . . . . . . .
3–19
Using the _nassert() Intrinsic to Generate Word Accesses for Vector Sum
. . . . . . . . . . .
3–20
Using _nassert() Intrinsic to Generate Word Accesses for FIR Filter
. . . . . . . . . . . . . . . .
3–21
Compiler Output From Example 3–20
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–22
Compiler Output From Example 3–13
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–23
Compiler Output From Example 3–12
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–24
Automatic Use of Word Accesses Without the _nassert Intrinsic
. . . . . . . . . . . . . . . . . . . .
3–25
Trip Counters
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–26
Vector Sum With Three Memory Operations
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–27
Word-Aligned Vector Sum
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–28
Vector Sum Using const Keywords, MUST_ITERATE pragma,
Word Reads, and Loop Unrolling
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–29
FIR_Type2— Original Form
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–30
FIR_Type2—Inner Loop Completely Unrolled
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–31
Vector Sum
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–32
Use of If Statements in Float Collision Detection (Original Code)
. . . . . . . . . . . . . . . . . . .
3–33
Use of If Statements in Float Collision Detection (Modified Code)
. . . . . . . . . . . . . . . . . . .
4–1
Referencing Far Global Objects Defined in Other Files
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–1
Linear Assembly Block Copy
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–2
Block copy With .mdep
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–3
Linear Assembly Dot Product
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–4
Linear Assembly Dot Product With .mptr
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–5
Fixed-Point Dot Product C Code
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–6
Floating-Point Dot Product C Code
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–7
List of Assembly Instructions for Fixed-Point Dot Product
. . . . . . . . . . . . . . . . . . . . . . . . . .
6–8
List of Assembly Instructions for Floating-Point Dot Product
. . . . . . . . . . . . . . . . . . . . . . .
6–9
Nonparallel Assembly Code for Fixed-Point Dot Product
. . . . . . . . . . . . . . . . . . . . . . . . . .
6–10
Parallel Assembly Code for Fixed-Point Dot Product
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–11
Nonparallel Assembly Code for Floating-Point Dot Product
. . . . . . . . . . . . . . . . . . . . . . . .
6–12
Parallel Assembly Code for Floating-Point Dot Product
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–13
Fixed-Point Dot Product C Code (Unrolled)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–14
Floating-Point Dot Product C Code (Unrolled)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–15
Linear Assembly for Fixed-Point Dot Product Inner Loop with LDW
. . . . . . . . . . . . . . . . .
6–16
Linear Assembly for Floating-Point Dot Product Inner Loop with LDDW
. . . . . . . . . . . . .
6–17
Linear Assembly for Fixed-Point Dot Product Inner Loop With LDW
(With Allocated Resources)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–18
Linear Assembly for Floating-Point Dot Product Inner Loop With LDDW
(With Allocated Resources)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–19
Assembly Code for Fixed-Point Dot Product With LDW
(Before Software Pipelining)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–20
Assembly Code for Floating-Point Dot Product With LDDW
(Before Software Pipelining)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .