HP C Programmer's Guide (92434-90009)

92 Chapter4
Optimizing HP C Programs
Level 2 Optimization Modules
pseudo-code as follows:
R1=0;
Initialize array index.
R2 = 4.0;
Load constant value.
R3 = Y[0];
Load first Y value.
R4 = X[0];
Load first X value.
R5=R4/R3;
Perform division on first element:n = X[0] / Y[0].
do {
Begin loop.
R6 = R1;
Save current array index.
R1++;
Increment array index.
R7 = X[R1];
Load current X value.
R8 = Y[R1];
Load current Y value.
R9=R5+R2;
Perform addition on prior row:X[i] = n + 4.0.
R10=R7/R8;
Perform division on current row:m = X[i+1] / Y[i+1].
X[R6] = R9;
Save result of operations on prior row.
R6 = R1;
Save current array index.
R1++;
Increment array index.
R4 = X[R1];
Load next X value.
R3 = Y[R1];
Load next Y value.
R11 = R10 + R2;
Perform addition on current row:X[i+1] = m + 4
R5=R4/R3;
Perform division on next row:n = X[i+2] / Y[i+2]