OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [pr40021.f] - Blame information for rev 711

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 695 jeremybenn
C Derived from lapack
2
        PROGRAM test
3
        DOUBLE PRECISION DA
4
        INTEGER I, N
5
        DOUBLE PRECISION DX(9),DY(9)
6
 
7
        EXTERNAL DAXPY
8
        N=5
9
        DA=1.0
10
        DATA DX/-2, -1, -3, -4, 1, 2, 10, 15, 14/
11
        DATA DY/0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/
12
        CALL DAXPY (N,DA,DX,DY)
13
        DO 10 I = 1, N
14
          if (DX(I).ne.DY(I)) call abort
15
10      CONTINUE
16
        STOP
17
        END
18
 
19
      SUBROUTINE DAXPY(N,DA,DX,DY)
20
      DOUBLE PRECISION DA
21
      INTEGER N
22
      DOUBLE PRECISION DX(*),DY(*)
23
      INTEGER I,IX,IY,M,MP1
24
      INTRINSIC MOD
25
      IF (N.LE.0) RETURN
26
   20 M = MOD(N,4)
27
      IF (M.EQ.0) GO TO 40
28
      DO 30 I = 1,M
29
          DY(I) = DY(I) + DA*DX(I)
30
   30 CONTINUE
31
      IF (N.LT.4) RETURN
32
   40 MP1 = M + 1
33
      DO 50 I = MP1,N,4
34
          DY(I) = DY(I) + DA*DX(I)
35
          DY(I+1) = DY(I+1) + DA*DX(I+1)
36
          DY(I+2) = DY(I+2) + DA*DX(I+2)
37
          DY(I+3) = DY(I+3) + DA*DX(I+3)
38
   50 CONTINUE
39
      RETURN
40
      END

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.