Skip to content

Commit 0843d3e

Browse files
committed
BLAS: inline SCABS1/DCABS1 into CAXPY/ZAXPY as statement function CABS1
Replace external function references to SCABS1 and DCABS1 with a local statement function CABS1 in CAXPY and ZAXPY respectively, eliminating the dependency on those auxiliary routines.
1 parent c550a36 commit 0843d3e

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

BLAS/SRC/caxpy.f

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,16 @@ SUBROUTINE CAXPY(N,CA,CX,INCX,CY,INCY)
103103
*
104104
* .. Local Scalars ..
105105
INTEGER I,IX,IY
106+
COMPLEX CDUM
106107
* ..
107-
* .. External Functions ..
108-
REAL SCABS1
109-
EXTERNAL SCABS1
108+
* .. Statement Functions ..
109+
REAL CABS1
110+
* ..
111+
* .. Statement Function definitions ..
112+
CABS1(CDUM) = ABS(REAL(CDUM)) + ABS(AIMAG(CDUM))
110113
* ..
111114
IF (N.LE.0) RETURN
112-
IF (SCABS1(CA).EQ.0.0E+0) RETURN
115+
IF (CABS1(CA).EQ.0.0E+0) RETURN
113116
IF (INCX.EQ.1 .AND. INCY.EQ.1) THEN
114117
*
115118
* code for both increments equal to 1

BLAS/SRC/zaxpy.f

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,16 @@ SUBROUTINE ZAXPY(N,ZA,ZX,INCX,ZY,INCY)
103103
*
104104
* .. Local Scalars ..
105105
INTEGER I,IX,IY
106+
COMPLEX*16 ZDUM
106107
* ..
107-
* .. External Functions ..
108-
DOUBLE PRECISION DCABS1
109-
EXTERNAL DCABS1
108+
* .. Statement Functions ..
109+
DOUBLE PRECISION CABS1
110+
* ..
111+
* .. Statement Function definitions ..
112+
CABS1(ZDUM) = ABS(DBLE(ZDUM)) + ABS(DIMAG(ZDUM))
110113
* ..
111114
IF (N.LE.0) RETURN
112-
IF (DCABS1(ZA).EQ.0.0d0) RETURN
115+
IF (CABS1(ZA).EQ.0.0D+0) RETURN
113116
IF (INCX.EQ.1 .AND. INCY.EQ.1) THEN
114117
*
115118
* code for both increments equal to 1

0 commit comments

Comments
 (0)