Skip to content

kernel/mips(64): Fix cscal and zscal #5283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kernel/mips/cscal_msa.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r, FLOAT da_i,

if (1 == inc_x)
{
if ((0.0 == da_r) && (0.0 == da_i))
if ((0.0 == da_r) && (0.0 == da_i) && !dummy2)
{
v4f32 zero_v = {0.0, 0.0, 0.0, 0.0};

Expand Down Expand Up @@ -508,7 +508,7 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r, FLOAT da_i,
{
inc_x2 = 2 * inc_x;

if ((0.0 == da_r) && (0.0 == da_i))
if ((0.0 == da_r) && (0.0 == da_i) && !dummy2)
{
for (i = n; i--;)
{
Expand Down
2 changes: 1 addition & 1 deletion kernel/mips/zscal.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F
{
if ( da_r == 0.0 )
{
if ( da_i == 0.0 )
if ( da_i == 0.0 && !dummy2)
{
temp = 0.0;
x[ip+1] = 0.0 ;
Expand Down
4 changes: 2 additions & 2 deletions kernel/mips/zscal_msa.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r, FLOAT da_i,

if (1 == inc_x)
{
if ((0.0 == da_r) && (0.0 == da_i))
if ((0.0 == da_r) && (0.0 == da_i) && !dummy2)
{
v2f64 zero_v = {0.0, 0.0};

Expand Down Expand Up @@ -471,7 +471,7 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r, FLOAT da_i,
{
inc_x2 = 2 * inc_x;

if ((0.0 == da_r) && (0.0 == da_i))
if ((0.0 == da_r) && (0.0 == da_i) && !dummy2)
{
v2f64 zero_v = {0.0, 0.0};

Expand Down
6 changes: 6 additions & 0 deletions kernel/mips64/zscal.S
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#define TEMP $3

#define XX $5
#define DUMMY2 $6

#define ALPHA_R $f15
#define ALPHA_I $f16
Expand All @@ -74,6 +75,9 @@
blez N, .L999
dsll INCX, INCX, ZBASE_SHIFT

LDARG DUMMY2, 8(sp)
dsll DUMMY2, DUMMY2, ZBASE_SHIFT

CMPEQ $fcc0, ALPHA_R, a1
CMPEQ $fcc1, ALPHA_I, a1

Expand All @@ -83,6 +87,8 @@
bc1f $fcc1, .L50
NOP

beq DUMMY2, TEMP, .L50

bne INCX, TEMP, .L20
dsra I, N, 2

Expand Down
Loading