Refining C/C++ Code
3-37
Optimizing C/C++ Code
Example 3–22. Compiler Output From Example 3–13
L3: ; PIPED LOOP KERNEL
ADD .L2 B3,B5:B4,B5:B4
|| ADD .L1 A3,A5:A4,A5:A4
|| MV .S2 B1,B2
|| MPY .M2X B1,A8,B3
|| MPYHL .M1X B1,A8,A3
|| [ A1] B .S1 L3
|| [ B0] LDW .D2T2 *B8,B1
[ B0] SUB .S2 B0,1,B0
|| ADD .L1 A3,A7:A6,A7:A6
|| ADD .L2 B3,B7:B6,B7:B6
|| MPYH .M1X B2,A8,A3
|| MPYHL .M2X A8,B9,B3
|| [ A1] SUB .S1 A1,1,A1
|| [ B0] LDW .D1T1 *A0++,A8
|| [ B0] LDW .D2T2 *++B8,B9
Example 3–23. Compiler Output From Example 3–12
L4: ; PIPED LOOP KERNEL
[ A2] SUB .S1 A2,1,A2
|| ADD .L1 A5,A1:A0,A1:A0
|| MPY .M1X B5,A4,A5
|| [ B0] B .S2 L4
|| [ B0] SUB .L2 B0,1,B0
|| [ A2] LDH .D1T1 *A3++,A4
|| [ A2] LDH .D2T2 *B4++,B5
Note:
The _nassert() intrinsic may not solve all of your short to int or float-
to-double accesses, but it can be a useful tool in achieving better perfor-
mance without rewriting the C code.