Skip to content

Commit 877023e

Browse files
authored
Fix precision of zarch DSDOT
from patch provided by aarnez in #991
1 parent 265142e commit 877023e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

kernel/zarch/dsdot.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ double CNAME(BLASLONG n,FLOAT *x,BLASLONG inc_x,FLOAT *y,BLASLONG inc_y)
132132
while(i < n)
133133
{
134134

135-
dot += y[i] * x[i] ;
135+
dot += (double) y[i] * (double) x[i] ;
136136
i++ ;
137137

138138
}
@@ -146,7 +146,8 @@ double CNAME(BLASLONG n,FLOAT *x,BLASLONG inc_x,FLOAT *y,BLASLONG inc_y)
146146
while(i < n1)
147147
{
148148

149-
dot += y[iy] * x[ix] + y[iy+inc_y] * x[ix+inc_x];
149+
dot += (double) y[iy] * (double) x[ix];
150+
dot += (double) y[iy+inc_y] * (double) x[ix+inc_x];
150151
ix += inc_x*2 ;
151152
iy += inc_y*2 ;
152153
i+=2 ;
@@ -156,7 +157,7 @@ double CNAME(BLASLONG n,FLOAT *x,BLASLONG inc_x,FLOAT *y,BLASLONG inc_y)
156157
while(i < n)
157158
{
158159

159-
dot += y[iy] * x[ix] ;
160+
dot += (double) y[iy] * (double) x[ix] ;
160161
ix += inc_x ;
161162
iy += inc_y ;
162163
i++ ;

0 commit comments

Comments
 (0)