Examples
xix
Contents
6–58
Linear Assembly for Full Live-Too-Long Code
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–59
Assembly Code for Live-Too-Long With Move Instructions
. . . . . . . . . . . . . . . . . . . . . . .
6–60
FIR Filter C Code
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–61
FIR Filter C Code With Redundant Load Elimination
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–62
Linear Assembly for FIR Inner Loop
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–63
Linear Assembly for Full FIR Code
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–64
Final Assembly Code for FIR Filter With Redundant Load Elimination
. . . . . . . . . . . . . .
6–65
Final Assembly Code for Inner Loop of FIR Filter
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–66
FIR Filter C Code (Unrolled)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–67
Linear Assembly for Unrolled FIR Inner Loop
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–68
Linear Assembly for Full Unrolled FIR Filter
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–69
Final Assembly Code for FIR Filter With Redundant Load Elimination
and No Memory Hits
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–70
Unrolled FIR Filter C Code
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–71
Final Assembly Code for FIR Filter With Redundant Load Elimination
and No Memory Hits With Outer Loop Software-Pipelined
. . . . . . . . . . . . . . . . . . . . . . . .
6–72
Unrolled FIR Filter C Code
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–73
Linear Assembly for Unrolled FIR Inner Loop
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–74
Linear Assembly for FIR Outer Loop
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–75
Unrolled FIR Filter C Code
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–76
Linear Assembly for FIR With Outer Loop
Conditionally Executed With Inner Loop
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–77
Linear Assembly for FIR With Outer Loop
Conditionally Executed With Inner Loop (With Functional Units)
. . . . . . . . . . . . . . . . . . .
6–78
Final Assembly Code for FIR Filter
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–1
Code With Multiple Assignment of A1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–2
Code Using Single Assignment
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–3
Dot Product With MUST_ITERATE Pragma Guaranteeing Minimum Trip Count
. . . . . . .
7–4
Dot Product With _nassert Guaranteeing Trip Count Range
. . . . . . . . . . . . . . . . . . . . . . . .
7–5
Dot Product With MUST_ITERATE Pragma Guaranteeing Trip Count Range
and Factor of 2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–6
Dot Product With MUST_ITERATE Pragma Guaranteeing Trip Count Range
and Factor of 4
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–7
Hand-Coded Assembly ISR
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–8
Hand-Coded Assembly ISR Allowing Nesting of Interrupts
. . . . . . . . . . . . . . . . . . . . . . . . .
8–1
Vector Sum
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8–2
Vector Multiply
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8–3
Dot Product
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8–4
Vector Complex Multiply
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8–5
Vectorization: Using LDDW and STDW in Vector Sum
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
8–6
Vector Addition (Complete)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8–7
Using LDDW and STDW in Vector Multiply
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8–8
Using _mpy2() and _pack2() to Perform the Vector Multiply
. . . . . . . . . . . . . . . . . . . . . . . .
8–9
Vectorized Form of the Dot Product Kernel
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8–10
Vectorized Form of the Dot Product Kernel
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .