01:       SUBROUTINE SAXPY(N,SA,SX,INCX,SY,INCY)
02: *     .. Scalar Arguments ..
03:       REAL SA
04:       INTEGER INCX,INCY,N
05: *     ..
06: *     .. Array Arguments ..
07:       REAL SX(*),SY(*)
08: *     ..
09: *
10: *  Purpose
11: *  =======
12: *
13: *     SAXPY constant times a vector plus a vector.
14: *     uses unrolled loop for increments equal to one.
15: *
16: *  Further Details
17: *  ===============
18: *
19: *     jack dongarra, linpack, 3/11/78.
20: *     modified 12/3/93, array(1) declarations changed to array(*)
21: *
22: *  =====================================================================
23: *
24: *     .. Local Scalars ..
25:       INTEGER I,IX,IY,M,MP1
26: *     ..
27: *     .. Intrinsic Functions ..
28:       INTRINSIC MOD
29: *     ..
30:       IF (N.LE.0) RETURN
31:       IF (SA.EQ.0.0) RETURN
32:       IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20
33: *
34: *        code for unequal increments or equal increments
35: *          not equal to 1
36: *
37:       IX = 1
38:       IY = 1
39:       IF (INCX.LT.0) IX = (-N+1)*INCX + 1
40:       IF (INCY.LT.0) IY = (-N+1)*INCY + 1
41:       DO 10 I = 1,N
42:           SY(IY) = SY(IY) + SA*SX(IX)
43:           IX = IX + INCX
44:           IY = IY + INCY
45:    10 CONTINUE
46:       RETURN
47: *
48: *        code for both increments equal to 1
49: *
50: *
51: *        clean-up loop
52: *
53:    20 M = MOD(N,4)
54:       IF (M.EQ.0) GO TO 40
55:       DO 30 I = 1,M
56:           SY(I) = SY(I) + SA*SX(I)
57:    30 CONTINUE
58:       IF (N.LT.4) RETURN
59:    40 MP1 = M + 1
60:       DO 50 I = MP1,N,4
61:           SY(I) = SY(I) + SA*SX(I)
62:           SY(I+1) = SY(I+1) + SA*SX(I+1)
63:           SY(I+2) = SY(I+2) + SA*SX(I+2)
64:           SY(I+3) = SY(I+3) + SA*SX(I+3)
65:    50 CONTINUE
66:       RETURN
67:       END
68: