X86_64: Fixed bug in zscal

Fixed handling of NAN and INF arguments when
inc is greater than 1.
This commit is contained in:
gxw 2024-01-31 11:20:25 +08:00
parent bb043a021f
commit 969601a1dc
1 changed files with 50 additions and 41 deletions

View File

@ -254,10 +254,16 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r, FLOAT da_i,
while(j < n1) while(j < n1)
{ {
temp0 = -da_i * x[i+1]; if (isnan(x[i]) || isinf(x[i]))
temp0 = NAN;
else
temp0 = -da_i * x[i+1];
x[i+1] = da_i * x[i]; x[i+1] = da_i * x[i];
x[i] = temp0; x[i] = temp0;
temp1 = -da_i * x[i+1+inc_x]; if (isnan(x[i+inc_x]) || isinf(x[i+inc_x]))
temp1 = NAN;
else
temp1 = -da_i * x[i+1+inc_x];
x[i+1+inc_x] = da_i * x[i+inc_x]; x[i+1+inc_x] = da_i * x[i+inc_x];
x[i+inc_x] = temp1; x[i+inc_x] = temp1;
i += 2*inc_x ; i += 2*inc_x ;
@ -268,7 +274,10 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r, FLOAT da_i,
while(j < n) while(j < n)
{ {
temp0 = -da_i * x[i+1]; if (isnan(x[i]) || isinf(x[i]))
temp0 = NAN;
else
temp0 = -da_i * x[i+1];
x[i+1] = da_i * x[i]; x[i+1] = da_i * x[i];
x[i] = temp0; x[i] = temp0;
i += inc_x ; i += inc_x ;