.section ".text",#alloc,#execinstr .align 8 .skip 16 ! block 0 .global main .type main,2 main: save %sp,-144,%sp ! block 1 .L174: ! File c_diffusion.c: ! 1 /* Diffusion Program */ ! 2 /* ! 3 # the compile properties you will use to link in the LINPACK routines is ! 4 # cc -o c_diffusion c_diffusion.c -xlic_lib=sunperf ! 5 # ! 6 # or cc -o c_diffusion c_diffusion.c sgesl.o sgeco.o ! 7 # if you use other options, be sure that the -xlic_lib=sunperf is last ! 8 ! 9 */ ! 10 ! 11 /* Set up a linear system A X = b with a maximum dimension on A ! 12 given by the parameter ndim. The vector B is called the Right Hand ! 13 Side (RHS, for short), the vector X is called the solution. ! 14 ! 15 Using Fortran subroutines from the LINPACK library to perform ! 16 the Gaussian Elimination factorization (sgeco) and solve (sgesl) ! 17 ! 18 BE ADVISED - C starts at 0 in matrices ! 19 - C stores matrices by rows and Fortran stores by columns ! 20 ! 21 The matrix A is symmetric, so this won't matter now ! 22 but with a nonsymmetric A, you would pass A-transpose ! 23 to the Fortran subroutines sgeco and sgesl ! 24 ! 25 */ ! 26 ! 27 /* needed for inter-language communication Fortran <-> C */ ! 28 #include ! 29 #include ! 30 ! 31 /* if we are calling Fortran routines ------ ! 32 * need to append _ to name of routine ! 33 * sgeco_ and sgesl_ ! 34 * --------------------- interlanguage - end ----------*/ ! 35 ! 36 #define ndim 2048 ! 37 #define sideleft 10.0 ! 38 #define sideright 40.0 ! 39 #define sidetop 20.0 ! 40 #define sidebottom 20.0 ! 41 ! 43 /* the declaration of storage needed must be placed before the ! 44 specification of the main program */ ! 45 float A [ndim][ndim]; ! 46 ! 47 /* X stored the computed solution; this storage also holds B initially */ ! 48 float X [ndim]; ! 49 ! 50 /* work is the required floating point workspace */ ! 51 float work [ndim]; ! 52 ! 53 /* ipvt is the required floating point workspace */ ! 54 int ipvt[ndim]; ! 55 ! 56 int main(void) ! 57 { ! 58 int i, j, index; ! 59 float rcond; ! 60 ! 61 int row, col, K, M, N=ndim+1; mov 2049,%l0 st %l0,[%fp-40] ! 62 static int max = ndim; ! 63 int zero = 0; st %g0,[%fp-44] ! 65 /* Two dimensional heat diffusion problem. */ ! 66 ! 67 while (N > ndim) cmp %l0,2048 ble .L179 nop ! block 2 .L_y0: add %fp,-36,%l2 add %fp,-32,%l3 mov 2048,%l5 sethi %hi(.L181),%l4 or %l4,%lo(.L181),%l4 .L180: .L177: ! 68 { ! 69 printf("Be sure to enter values of K and M below so that K*M <= %i\n",ndim); mov %l4,%o0 call printf mov %l5,%o1 ! 70 printf("Enter number of rows K\n"); call printf add %l4,60,%o0 ! 71 printf("Suggested values are 10...20...40...\n:"); call printf add %l4,84,%o0 ! 72 scanf("%d",&K); add %l4,124,%o0 call scanf mov %l3,%o1 ! 73 printf("Enter number of columns M\n"); call printf add %l4,128,%o0 ! 74 printf("Suggested values are 10...20...40...\n:"); call printf add %l4,156,%o0 ! 75 scanf("%d",&M); add %l4,196,%o0 call scanf mov %l2,%o1 ! 76 N = K * M; ld [%fp-32],%l0 ld [%fp-36],%l1 smul %l0,%l1,%l0 cmp %l0,2048 bg .L177 st %l0,[%fp-40] ! block 3 .L188: .L179: ! 77 } ! 78 ! 79 /* Initialize matrix to 0 */ ! 80 for (i = 0; i < M; i++) mov %g0,%i4 ld [%fp-36],%l0 cmp %g0,%l0 bge .L191 nop ! block 4 .L192: .L189: ! 81 for (j = 0; j < K; j++) mov %g0,%i1 ld [%fp-32],%l0 cmp %g0,%l0 bge .L195 nop ! block 5 .L_y1: sethi %hi(A),%l3 or %l3,%lo(A),%l3 sethi %hi(.L_cseg0),%l4 or %l4,%lo(.L_cseg0),%l4 .L196: .L193: ! 82 A[i][j] = 0.0; ld [%l4+0],%f2 sll %i4,13,%l0 add %l0,%l3,%l2 sll %i1,2,%l1 st %f2,[%l2+%l1] add %i1,1,%i1 ld [%fp-32],%l0 cmp %i1,%l0 bl .L193 nop ! block 6 .L197: .L195: add %i4,1,%i4 ld [%fp-36],%l0 cmp %i4,%l0 bl .L189 nop ! block 7 .L198: .L191: ! 83 ! 84 /* Set up the N by N block-structured matrix matrix we store in a full ! 85 matrix for experimentation using the Linpack software SGECO, SGESL ! 86 instead of the more efficient storage as just the non-zero entries ! 87 (whise notation is slightly complicated) ! 88 */ ! 89 ! 90 /* for row = 1, we have a very special "boundary case" */ ! 91 ! 92 index = 0; mov %g0,%i5 ! 93 A[index][index] = 4.0; sethi %hi(.L_cseg1),%l0 ld [%l0+%lo(.L_cseg1)],%f2 sll %g0,13,%l0 sethi %hi(A),%l1 or %l1,%lo(A),%l1 add %l0,%l1,%l2 sll %g0,2,%l1 add %l2,%l1,%l1 st %f2,[%l1+0] ! 94 A[index][index+1] = -1.0; sethi %hi(.L_cseg2),%l0 ld [%l0+%lo(.L_cseg2)],%f2 st %f2,[%l1+4] ! 95 A[index][index+M] = -1.0; ld [%l0+%lo(.L_cseg2)],%f2 ld [%fp-36],%l0 add %g0,%l0,%l0 sll %l0,2,%l1 st %f2,[%l2+%l1] ! 96 ! 97 for (i = 2; i < M; i++) mov 2,%i4 ld [%fp-36],%l0 cmp %i4,%l0 bge .L201 nop ! block 8 .L_y2: sethi %hi(.L_cseg2),%l5 or %l5,%lo(.L_cseg2),%l5 sethi %hi(A),%l6 or %l6,%lo(A),%l6 sethi %hi(.L_cseg1),%l4 or %l4,%lo(.L_cseg1),%l4 .L202: .L199: ! 98 { ! 99 index++; add %i5,1,%i5 ! 100 A[index][index] = 4.0; ld [%l4+0],%f2 sll %i5,13,%l0 add %l0,%l6,%l2 sll %i5,2,%l1 add %l2,%l1,%l1 st %f2,[%l1+0] ! 101 A[index][index-1] = -1.0; ld [%l5+0],%f2 st %f2,[%l1-4] ! 102 A[index][index+1] = -1.0; ld [%l5+0],%f2 st %f2,[%l1+4] ! 103 A[index][index+M] = -1.0; ld [%l5+0],%f2 ld [%fp-36],%l1 add %i5,%l1,%l0 sll %l0,2,%l1 st %f2,[%l2+%l1] add %i4,1,%i4 ld [%fp-36],%l0 cmp %i4,%l0 bl .L199 nop ! block 9 .L203: .L201: ! 104 } ! 105 ! 106 index++; add %i5,1,%i5 ! 107 A[index][index] = 4.0; sethi %hi(.L_cseg1),%l0 ld [%l0+%lo(.L_cseg1)],%f2 sll %i5,13,%l0 sethi %hi(A),%l1 or %l1,%lo(A),%l1 add %l0,%l1,%l3 sll %i5,2,%l1 add %l3,%l1,%l1 st %f2,[%l1+0] ! 108 A[index][index-1] = -1.0; sethi %hi(.L_cseg2),%l0 ld [%l0+%lo(.L_cseg2)],%f2 st %f2,[%l1-4] ! 109 A[index][index+M] = -1.0; ld [%l0+%lo(.L_cseg2)],%f2 ld [%fp-36],%l1 add %i5,%l1,%l0 sll %l0,2,%l1 st %f2,[%l3+%l1] ! 110 ! 111 /* for row = 2 ... K-1, we have the standard pattern */ ! 112 ! 113 for (row = 2; row < K; row ++) mov 2,%i3 ld [%fp-32],%l0 cmp %i3,%l0 bge .L206 nop ! block 10 .L207: .L204: ! 114 { ! 115 ! 116 /* first grid point of each row is special */ ! 117 ! 118 index++; add %i5,1,%i5 ! 119 A[index][index] = 4.0; sethi %hi(.L_cseg1),%l0 ld [%l0+%lo(.L_cseg1)],%f2 sll %i5,13,%l0 sethi %hi(A),%l1 or %l1,%lo(A),%l1 add %l0,%l1,%l4 sll %i5,2,%l1 add %l4,%l1,%l1 st %f2,[%l1+0] ! 120 A[index][index+1] = -1.0; sethi %hi(.L_cseg2),%l2 ld [%l2+%lo(.L_cseg2)],%f2 st %f2,[%l1+4] ! 121 A[index][index-M] = -1.0; ld [%l2+%lo(.L_cseg2)],%f2 ld [%fp-36],%l1 sub %i5,%l1,%l0 sll %l0,2,%l1 st %f2,[%l4+%l1] ! 122 A[index][index+M] = -1.0; ld [%l2+%lo(.L_cseg2)],%f2 ld [%fp-36],%l1 add %i5,%l1,%l0 sll %l0,2,%l1 st %f2,[%l4+%l1] ! 123 ! 124 /* for col = 2 ... M-1, we have the standard pattern */ ! 125 ! 126 for (col = 2; col < M; col ++) mov 2,%i2 ld [%fp-36],%l0 cmp %i2,%l0 bge .L210 nop ! block 11 .L_y3: sethi %hi(.L_cseg2),%l5 or %l5,%lo(.L_cseg2),%l5 sethi %hi(A),%l6 or %l6,%lo(A),%l6 sethi %hi(.L_cseg1),%l4 or %l4,%lo(.L_cseg1),%l4 .L211: .L208: ! 127 { ! 128 index++; add %i5,1,%i5 ! 129 A[index][index] = 4.0; ld [%l4+0],%f2 sll %i5,13,%l0 add %l0,%l6,%l2 sll %i5,2,%l1 add %l2,%l1,%l1 st %f2,[%l1+0] ! 130 A[index][index-1] = -1.0; ld [%l5+0],%f2 st %f2,[%l1-4] ! 131 A[index][index+1] = -1.0; ld [%l5+0],%f2 st %f2,[%l1+4] ! 132 A[index][index-M] = -1.0; ld [%l5+0],%f2 ld [%fp-36],%l1 sub %i5,%l1,%l0 sll %l0,2,%l1 st %f2,[%l2+%l1] ! 133 A[index][index+M] = -1.0; ld [%l5+0],%f2 ld [%fp-36],%l1 add %i5,%l1,%l0 sll %l0,2,%l1 st %f2,[%l2+%l1] add %i2,1,%i2 ld [%fp-36],%l0 cmp %i2,%l0 bl .L208 nop ! block 12 .L212: .L210: ! 134 } ! 135 ! 136 /* Column M - Last grid point of each row is special */ ! 137 ! 138 index++; add %i5,1,%i5 ! 139 A[index][index] = 4.0; sethi %hi(.L_cseg1),%l0 ld [%l0+%lo(.L_cseg1)],%f2 sll %i5,13,%l0 sethi %hi(A),%l1 or %l1,%lo(A),%l1 add %l0,%l1,%l4 sll %i5,2,%l1 add %l4,%l1,%l1 st %f2,[%l1+0] ! 140 A[index][index-1] = -1.0; sethi %hi(.L_cseg2),%l2 ld [%l2+%lo(.L_cseg2)],%f2 st %f2,[%l1-4] ! 141 A[index][index+M] = -1.0; ld [%l2+%lo(.L_cseg2)],%f2 ld [%fp-36],%l1 add %i5,%l1,%l0 sll %l0,2,%l1 st %f2,[%l4+%l1] ! 142 A[index][index-M] = -1.0; ld [%l2+%lo(.L_cseg2)],%f2 ld [%fp-36],%l1 sub %i5,%l1,%l0 sll %l0,2,%l1 st %f2,[%l4+%l1] add %i3,1,%i3 ld [%fp-32],%l0 cmp %i3,%l0 bl .L204 nop ! block 13 .L213: .L206: ! 143 ! 144 } ! 145 ! 146 /* Last row is very special boundary case */ ! 147 ! 148 index++; add %i5,1,%i5 ! 149 A[index][index] = 4.0; sethi %hi(.L_cseg1),%l0 ld [%l0+%lo(.L_cseg1)],%f2 sll %i5,13,%l0 sethi %hi(A),%l1 or %l1,%lo(A),%l1 add %l0,%l1,%l3 sll %i5,2,%l1 add %l3,%l1,%l5 st %f2,[%l5+0] ! 150 A[index][index-M] = -1.0; sethi %hi(.L_cseg2),%l4 ld [%l4+%lo(.L_cseg2)],%f2 ld [%fp-36],%l1 sub %i5,%l1,%l0 sll %l0,2,%l1 st %f2,[%l3+%l1] ! 151 A[index][index+1] = -1.0; ld [%l4+%lo(.L_cseg2)],%f2 st %f2,[%l5+4] ! 152 ! 153 for (col = 2; col < M; col++) mov 2,%i2 ld [%fp-36],%l0 cmp %i2,%l0 bge .L216 nop ! block 14 .L_y4: sethi %hi(.L_cseg2),%l5 or %l5,%lo(.L_cseg2),%l5 sethi %hi(A),%l6 or %l6,%lo(A),%l6 sethi %hi(.L_cseg1),%l4 or %l4,%lo(.L_cseg1),%l4 .L217: .L214: ! 154 { ! 155 index++; add %i5,1,%i5 ! 156 A[index][index] = 4.0; ld [%l4+0],%f2 sll %i5,13,%l0 add %l0,%l6,%l2 sll %i5,2,%l1 add %l2,%l1,%l1 st %f2,[%l1+0] ! 157 A[index][index-1] = -1.0; ld [%l5+0],%f2 st %f2,[%l1-4] ! 158 A[index][index+1] = -1.0; ld [%l5+0],%f2 st %f2,[%l1+4] ! 159 A[index][index-M] = -1.0; ld [%l5+0],%f2 ld [%fp-36],%l1 sub %i5,%l1,%l0 sll %l0,2,%l1 st %f2,[%l2+%l1] add %i2,1,%i2 ld [%fp-36],%l0 cmp %i2,%l0 bl .L214 nop ! block 15 .L218: .L216: ! 160 } ! 161 ! 162 index++; add %i5,1,%i5 ! 163 A[index][index] = 4.0; sethi %hi(.L_cseg1),%l0 ld [%l0+%lo(.L_cseg1)],%f2 sll %i5,13,%l0 sethi %hi(A),%l1 or %l1,%lo(A),%l1 add %l0,%l1,%l3 sll %i5,2,%l1 add %l3,%l1,%l1 st %f2,[%l1+0] ! 164 A[index][index-1] = -1.0; sethi %hi(.L_cseg2),%l0 ld [%l0+%lo(.L_cseg2)],%f2 st %f2,[%l1-4] ! 165 A[index][index-M] = -1.0; ld [%l0+%lo(.L_cseg2)],%f2 ld [%fp-36],%l1 sub %i5,%l1,%l0 sll %l0,2,%l1 st %f2,[%l3+%l1] ! 168 /****************************************/ ! 169 /* Set up the RHS vector - mostly zeros */ ! 170 ! 171 for (i = 0; i < N; i++) mov %g0,%i4 ld [%fp-40],%l0 cmp %g0,%l0 bge .L221 nop ! block 16 .L_y5: sethi %hi(X),%l2 or %l2,%lo(X),%l2 sethi %hi(.L_cseg0),%l3 or %l3,%lo(.L_cseg0),%l3 .L222: .L219: ! 172 X[i] = 0.0; ld [%l3+0],%f2 sll %i4,2,%l0 st %f2,[%l0+%l2] add %i4,1,%i4 ld [%fp-40],%l0 cmp %i4,%l0 bl .L219 nop ! block 17 .L223: .L221: ! 174 /* row 1 */ ! 175 /* Boundary conditions 10 + 20 */ ! 176 X[0] = sideleft + sidebottom; sethi %hi(.L_cseg3),%l0 ldd [%l0+%lo(.L_cseg3)],%f4 sethi %hi(.L_cseg4),%l0 ldd [%l0+%lo(.L_cseg4)],%f2 faddd %f4,%f2,%f2 fdtos %f2,%f2 sethi %hi(X),%l0 st %f2,[%l0+%lo(X)] ! 177 /* Boundary condition on bottom row = 20 degrees */ ! 178 for (i = 1; i < M-1; i++) mov 1,%i4 ld [%fp-36],%l0 sub %l0,1,%l0 cmp %i4,%l0 bge .L226 nop ! block 18 .L_y6: sethi %hi(X),%l2 or %l2,%lo(X),%l2 sethi %hi(.L_cseg5),%l3 or %l3,%lo(.L_cseg5),%l3 .L227: .L224: ! 179 X[i] = sidebottom; ld [%l3+0],%f2 sll %i4,2,%l0 st %f2,[%l0+%l2] add %i4,1,%i4 ld [%fp-36],%l0 sub %l0,1,%l0 cmp %i4,%l0 bl .L224 nop ! block 19 .L228: .L226: ! 181 /* Boundary Conditions 20 + 40 degrees */ ! 182 index = M-1; ld [%fp-36],%l0 sub %l0,1,%i5 ! 183 X[index] = sideright + sidetop; sethi %hi(.L_cseg6),%l0 ldd [%l0+%lo(.L_cseg6)],%f4 sethi %hi(.L_cseg4),%l0 ldd [%l0+%lo(.L_cseg4)],%f2 faddd %f4,%f2,%f2 fdtos %f2,%f2 sll %i5,2,%l0 sethi %hi(X),%l1 or %l1,%lo(X),%l1 st %f2,[%l0+%l1] ! 185 /* row 2 ... row k-1 for "interior" grid points */ ! 186 /* only the first and last grid points have non-zero value */ ! 187 for (row = 2; row < K; row++) mov 2,%i3 ld [%fp-32],%l0 cmp %i3,%l0 bge .L231 nop ! block 20 .L_y7: sethi %hi(.L_cseg8),%l5 or %l5,%lo(.L_cseg8),%l5 sethi %hi(X),%l2 or %l2,%lo(X),%l2 sethi %hi(.L_cseg7),%l4 or %l4,%lo(.L_cseg7),%l4 .L232: .L229: ! 188 { ! 189 index++; add %i5,1,%i5 ! 190 X[index] = sideleft; /* Boundary condition on left side = 10 degrees */ ld [%l4+0],%f2 sll %i5,2,%l0 st %f2,[%l0+%l2] ! 191 index=index+M-1; ld [%fp-36],%l1 add %i5,%l1,%l0 sub %l0,1,%i5 ! 192 X[index] = sideright; ld [%l5+0],%f2 sll %i5,2,%l0 st %f2,[%l0+%l2] add %i3,1,%i3 ld [%fp-32],%l0 cmp %i3,%l0 bl .L229 nop ! block 21 .L233: .L231: ! 193 } ! 194 ! 195 /* row K - top row */ ! 196 ! 197 index++; add %i5,1,%i5 ! 198 X[index] = sideleft + sidetop; sethi %hi(.L_cseg3),%l0 ldd [%l0+%lo(.L_cseg3)],%f4 sethi %hi(.L_cseg4),%l0 ldd [%l0+%lo(.L_cseg4)],%f2 faddd %f4,%f2,%f2 fdtos %f2,%f2 sll %i5,2,%l0 sethi %hi(X),%l1 or %l1,%lo(X),%l1 st %f2,[%l0+%l1] ! 200 for (col = 2; col < M; col++) mov 2,%i2 ld [%fp-36],%l0 cmp %i2,%l0 bge .L236 nop ! block 22 .L_y8: sethi %hi(X),%l2 or %l2,%lo(X),%l2 sethi %hi(.L_cseg5),%l3 or %l3,%lo(.L_cseg5),%l3 .L237: .L234: ! 201 { ! 202 index++; add %i5,1,%i5 ! 203 X[index] = sidetop; /* Boundary condition on the top = 20 degrees */ ld [%l3+0],%f2 sll %i5,2,%l0 st %f2,[%l0+%l2] add %i2,1,%i2 ld [%fp-36],%l0 cmp %i2,%l0 bl .L234 nop ! block 23 .L238: .L236: ! 204 } ! 205 ! 206 /* Boundary conditions 40 + 20 */ ! 207 index++; add %i5,1,%i5 ! 208 X[index] = sidetop + sideright; sethi %hi(.L_cseg4),%l0 ldd [%l0+%lo(.L_cseg4)],%f4 sethi %hi(.L_cseg6),%l0 ldd [%l0+%lo(.L_cseg6)],%f2 faddd %f4,%f2,%f2 fdtos %f2,%f2 sll %i5,2,%l0 sethi %hi(X),%l1 or %l1,%lo(X),%l1 st %f2,[%l0+%l1] ! 210 /* The software os efficient in its use of memory - and will take as ! 211 input the vector of the Right Hand Hand, and overwrite with the ! 212 solution vector, X. ! 213 */ ! 214 /*********************************************/ ! 215 /* Compute the lu decomposition of the matrix A using sgeco from the ! 216 LINPACK collection of stable, efficient mathematical software ! 217 */ ! 218 ! 219 /* The matrix A is a nm1 by nm1 and its "declared dimension", which ! 220 allocates the actual storage in memory is given by ndim ! 221 */ ! 222 ! 223 sgeco_ (A, &max, &N, ipvt, &rcond, work); sethi %hi(A),%o0 or %o0,%lo(A),%o0 sethi %hi(.L176),%o1 or %o1,%lo(.L176),%o1 add %fp,-40,%o2 sethi %hi(ipvt),%o3 or %o3,%lo(ipvt),%o3 add %fp,-20,%o4 sethi %hi(work),%o5 or %o5,%lo(work),%o5 call sgeco_ nop ! 225 printf("Called sgeco - condition = %.4f\n",1.0/rcond); sethi %hi(.L240),%l0 or %l0,%lo(.L240),%l0 sethi %hi(.L_cseg9),%l1 ldd [%l1+%lo(.L_cseg9)],%f4 ld [%fp-20],%f2 fstod %f2,%f2 fdivd %f4,%f2,%f2 mov %l0,%o0 std %f2,[%sp+88] ld [%sp+88],%o1 call printf ld [%sp+92],%o2 ! 227 /* The test below might seem impossible to satisfy, but we'll see that ! 228 this is not so. This will be our jumping off point to discuss the ! 229 available percision due to the finite word size for any computer. ! 230 */ ! 231 ! 232 if (1.0 + rcond <= 1.0) ldd [%l1+%lo(.L_cseg9)],%f4 ld [%fp-20],%f2 fstod %f2,%f2 faddd %f4,%f2,%f2 fcmped %f2,%f4 nop fbug .L241 nop ! block 24 .L242: ! 233 printf("Numerically Singular Matrix\n"); call printf add %l0,36,%o0 ! block 25 .L241: ! 235 /* In a normal problem solving situation, you would "stop" when a ! 236 numerical singular matrix is detected. For CS575, we will proceed ! 237 to gain insight into the effects on accuracy. ! 238 */ ! 239 ! 240 /* A large condition number (effectively a small rcond = 1/cond) ! 241 indicates extreme sensitivity in the matrix A - user beware! ! 242 */ ! 243 ! 244 /******************************************/ ! 245 /* Using the LU factors of A (computed above by sgeco) and the RHS ! 246 (stored in X initially) - compute the solution for A X = RHS ! 247 */ ! 248 ! 249 sgesl_ (A, &max, &N, ipvt, X, &zero); sethi %hi(A),%o0 or %o0,%lo(A),%o0 sethi %hi(.L176),%o1 or %o1,%lo(.L176),%o1 add %fp,-40,%o2 sethi %hi(ipvt),%o3 or %o3,%lo(ipvt),%o3 sethi %hi(X),%o4 or %o4,%lo(X),%o4 call sgesl_ add %fp,-44,%o5 ! 251 printf("The solution is X =\n"); sethi %hi(.L245),%o0 or %o0,%lo(.L245),%o0 call printf nop ! 252 ! 253 for (row = K - 1; row >= 0; row --) ld [%fp-32],%l0 sub %l0,1,%i3 cmp %i3,0 bl .L248 nop ! block 26 .L249: .L246: ! 254 { ! 255 printf ("\nrow = %d\n",row); sethi %hi(.L250),%o0 or %o0,%lo(.L250),%o0 call printf mov %i3,%o1 ! 256 for (i = 0; i < M; i++) mov %g0,%i4 ld [%fp-36],%l0 cmp %g0,%l0 bge .L253 nop ! block 27 .L_y9: sethi %hi(X),%l2 or %l2,%lo(X),%l2 sethi %hi(.L255),%l3 or %l3,%lo(.L255),%l3 .L254: .L251: ! 257 printf("%8.5f ",X[row*M + i]); ld [%fp-36],%l1 smul %i3,%l1,%l0 add %l0,%i4,%l0 sll %l0,2,%l0 ld [%l0+%l2],%f2 fstod %f2,%f2 mov %l3,%o0 std %f2,[%sp+88] ld [%sp+88],%o1 call printf ld [%sp+92],%o2 add %i4,1,%i4 ld [%fp-36],%l0 cmp %i4,%l0 bl .L251 nop ! block 28 .L256: .L253: sub %i3,1,%i3 cmp %i3,0 bge .L246 nop ! block 29 .L257: .L248: ! 258 } ! 259 ! 260 printf("\nEnd \n"); sethi %hi(.L258),%o0 or %o0,%lo(.L258),%o0 call printf nop jmp %i7+8 restore ! block 30 .L173: jmp %i7+8 restore .size main,(.-main) .align 8 .section ".rodata1",#alloc .align 4 .L181: .ascii "Be sure to enter values of K and M below so that K*M <= %i\n\000" .type .L181,#object .size .L181,60 .align 4 .L182: .ascii "Enter number of rows K\n\000" .type .L182,#object .size .L182,24 .align 4 .L183: .ascii "Suggested values are 10...20...40...\n:\000" .skip 1 .type .L183,#object .size .L183,40 .align 4 .L184: .ascii "%d\000" .skip 1 .type .L184,#object .size .L184,4 .align 4 .L185: .ascii "Enter number of columns M\n\000" .skip 1 .type .L185,#object .size .L185,28 .align 4 .L186: .ascii "Suggested values are 10...20...40...\n:\000" .skip 1 .type .L186,#object .size .L186,40 .align 4 .L187: .ascii "%d\000" .skip 1 .type .L187,#object .size .L187,4 .common A,16777216,4 .common X,8192,4 .section ".data",#alloc,#write .align 4 .L176: .word 0x800 .type .L176,#object .size .L176,4 .common ipvt,8192,4 .common work,8192,4 .section ".rodata1",#alloc .align 4 .L240: .ascii "Called sgeco - condition = %.4f\n\000" .skip 3 .type .L240,#object .size .L240,36 .align 4 .L243: .ascii "Numerically Singular Matrix\n\000" .skip 3 .type .L243,#object .size .L243,32 .align 4 .L245: .ascii "The solution is X =\n\000" .skip 3 .type .L245,#object .size .L245,24 .align 4 .L250: .ascii "\nrow = %d\n\000" .skip 1 .type .L250,#object .size .L250,12 .align 4 .L255: .ascii "%8.5f \000" .skip 1 .type .L255,#object .size .L255,8 .align 4 .L258: .ascii "\nEnd \n\000" .type .L258,#object .size .L258,7 .section ".rodata",#alloc .align 4 .L_cseg0: .skip 4 .type .L_cseg0,#object .size .L_cseg0,4 .align 4 .L_cseg1: .word 0x40800000 .type .L_cseg1,#object .size .L_cseg1,4 .align 4 .L_cseg2: .word 0xbf800000 .type .L_cseg2,#object .size .L_cseg2,4 .align 8 .L_cseg3: .word 0x40240000,0x0 .type .L_cseg3,#object .size .L_cseg3,8 .align 8 .L_cseg4: .word 0x40340000,0x0 .type .L_cseg4,#object .size .L_cseg4,8 .align 4 .L_cseg5: .word 0x41a00000 .type .L_cseg5,#object .size .L_cseg5,4 .align 8 .L_cseg6: .word 0x40440000,0x0 .type .L_cseg6,#object .size .L_cseg6,8 .align 4 .L_cseg7: .word 0x41200000 .type .L_cseg7,#object .size .L_cseg7,4 .align 4 .L_cseg8: .word 0x42200000 .type .L_cseg8,#object .size .L_cseg8,4 .align 8 .L_cseg9: .word 0x3ff00000,0x0 .type .L_cseg9,#object .size .L_cseg9,8 .section ".bss",#alloc,#write Bbss.bss: .skip 0 .type Bbss.bss,#object .size Bbss.bss,0 .section ".data",#alloc,#write Ddata.data: .skip 0 .type Ddata.data,#object .size Ddata.data,0 .section ".rodata",#alloc Drodata.rodata: .skip 0 .type Drodata.rodata,#object .size Drodata.rodata,0 .file "c_diffusion.c" .xstabs ".stab.index","V=6.0 ; DBG_GEN=3.4.2 ; Xa ; R=Sun WorkShop 6 update 2 C 5.3 2001/05/15",60,0,0,1034800360 .xstabs ".stab.index","/home/ma/575.01/masc0670/diffusion; /opt/SUNWspro/bin/../WS6U2/bin/cc -S c_diffusion.c",52,0,0,0 .xstabs ".stab.index","main",42,0,0,0 .ident "@(#)stdio.h 1.78 99/12/08 SMI" .ident "@(#)stdio_iso.h 1.2 99/10/25 SMI" .ident "@(#)feature_tests.h 1.18 99/07/26 SMI" .ident "@(#)isa_defs.h 1.20 99/05/04 SMI" .ident "@(#)va_list.h 1.12 99/05/04 SMI" .ident "@(#)stdio_tag.h 1.3 98/04/20 SMI" .ident "@(#)stdio_impl.h 1.8 99/06/10 SMI" .ident "@(#)math.h 2.10 99/07/29 SMI" .ident "@(#)math_iso.h 1.1 99/07/30 SMI" .ident "@(#)floatingpoint.h 2.5 99/06/22 SMI" .ident "@(#)ieeefp.h 2.8 99/10/29" .ident "acomp: Sun WorkShop 6 update 2 C 5.3 2001/05/15" .global __fsr_init_value __fsr_init_value = 0x0