
Contents
x
6.9 Loop Unrolling 6-94. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.9.1 Unrolled If-Then-Else C Code 6-94. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.9.2 Translating C Code to Linear Assembly 6-95. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.9.3 Drawing a Dependency Graph 6-96. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.9.4 Determining the Minimum Iteration Interval 6-97. . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.9.5 Linear Assembly Resource Allocation 6-97. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.9.6 Final Assembly 6-99. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.9.7 Comparing Performance 6-100. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.10 Live-Too-Long Issues 6-101. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.10.1 C Code With Live-Too-Long Problem 6-101. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.10.2 Translating C Code to Linear Assembly 6-102. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.10.3 Drawing a Dependency Graph 6-102. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.10.4 Determining the Minimum Iteration Interval 6-104. . . . . . . . . . . . . . . . . . . . . . . . . . .
6.10.5 Linear Assembly Resource Allocation 6-106. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.10.6 Final Assembly With Move Instructions 6-108. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.11 Redundant Load Elimination 6-110. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.11.1 FIR Filter C Code 6-110. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.11.2 Translating C Code to Linear Assembly 6-112. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.11.3 Drawing a Dependency Graph 6-113. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.11.4 Determining the Minimum Iteration Interval 6-114. . . . . . . . . . . . . . . . . . . . . . . . . . .
6.11.5 Linear Assembly Resource Allocation 6-114. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.11.6 Final Assembly 6-115. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.12 Memory Banks 6-118. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.12.1 FIR Filter Inner Loop 6-120. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.12.2 Unrolled FIR Filter C Code 6-122. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.12.3 Translating C Code to Linear Assembly 6-123. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.12.4 Drawing a Dependency Graph 6-124. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.12.5 Linear Assembly for Unrolled FIR Inner Loop With .mptr Directive 6-125. . . . . . . .
6.12.6 Linear Assembly Resource Allocation 6-127. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.12.7 Determining the Minimum Iteration Interval 6-128. . . . . . . . . . . . . . . . . . . . . . . . . . .
6.12.8 Final Assembly 6-128. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.12.9 Comparing Performance 6-128. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.13 Software Pipelining the Outer Loop 6-131. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.13.1 Unrolled FIR Filter C Code 6-131. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.13.2 Making the Outer Loop Parallel With the Inner Loop Epilog and Prolog 6-132. . .
6.13.3 Final Assembly 6-132. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.13.4 Comparing Performance 6-135. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.14 Outer Loop Conditionally Executed With Inner Loop 6-136. . . . . . . . . . . . . . . . . . . . . . . . . . .
6.14.1 Unrolled FIR Filter C Code 6-136. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.14.2 Translating C Code to Linear Assembly (Inner Loop) 6-137. . . . . . . . . . . . . . . . . . .
6.14.3 Translating C Code to Linear Assembly (Outer Loop) 6-138. . . . . . . . . . . . . . . . . . .
6.14.4 Unrolled FIR Filter C Code 6-138. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.14.5 Translating C Code to Linear Assembly (Inner Loop) 6-140. . . . . . . . . . . . . . . . . . .
6.14.6 Translating C Code to Linear Assembly (Inner Loop and Outer Loop) 6-142. . . .
6.14.7 Determining the Minimum Iteration Interval 6-146. . . . . . . . . . . . . . . . . . . . . . . . . . .
6.14.8 Final Assembly 6-146. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.14.9 Comparing Performance 6-149. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .