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,9 +254,15 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r, FLOAT da_i,
while(j < n1)
{
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] = temp0;
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+inc_x] = temp1;
@ -268,6 +274,9 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r, FLOAT da_i,
while(j < n)
{
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] = temp0;