Skip to content
Merged
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
14 changes: 13 additions & 1 deletion kernel/riscv64/zscal_rvv.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F
FLOAT_VX2_T vx2;

if(inc_x == 1) {
if (dummy2 == 0 && da_r==0. && da_i == 0.) {
BLASLONG i;
for (i=0; i < n*2; i++) x[i]=0.;
return(0);
} else {

for (size_t vl; n > 0; n -= vl, x += vl*2) {
vl = VSETVL(n);
Expand All @@ -80,16 +85,22 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F

vt = VFMULVF_FLOAT(vr, da_r, vl);
vt = VFNMSACVF_FLOAT(vt, da_i, vi, vl);

vi = VFMULVF_FLOAT(vi, da_r, vl);
vi = VFMACCVF_FLOAT(vi, da_i, vr, vl);

vx2 = VSET_VX2(vx2, 0, vt);
vx2 = VSET_VX2(vx2, 1, vi);
VSSEG_FLOAT(x, vx2, vl);
}
}

} else {

if (dummy2 == 0 && da_r==0. && da_i == 0.) {
BLASLONG i,ix=0,inc_x2=2*inc_x;
for (i=0; i < n; i++) {x[ix]=0.;x[ix+1]=0.;ix+=inc_x2;};
return(0);
} else {
for (size_t vl; n > 0; n -= vl, x += vl*inc_x*2) {
vl = VSETVL(n);

Expand All @@ -105,6 +116,7 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F
vx2 = VSET_VX2(vx2, 0, vt);
vx2 = VSET_VX2(vx2, 1, vi);
VSSSEG_FLOAT(x, stride_x, vx2, vl);
}
}
}

Expand Down
13 changes: 10 additions & 3 deletions kernel/riscv64/zscal_vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,15 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F
if((n <= 0) || (inc_x <= 0))
return(0);

unsigned int gvl = 0;
FLOAT_V_T vt, v0, v1;
{
if (dummy2 == 0 && da_r == 0. && da_i == 0.) {
int i,inc_x2,ix;
inc_x2 = 2*inc_x;
ix=0;
for (i=0;i<n;i++){x[ix]=0.;x[ix+1]=0.;ix+=inc_x2;}
} else {
unsigned int gvl = 0;
FLOAT_V_T vt, v0, v1;
{
gvl = VSETVL(n);
BLASLONG stride_x = inc_x * 2 * sizeof(FLOAT);
BLASLONG inc_xv = inc_x * 2 * gvl;
Expand Down Expand Up @@ -91,6 +97,7 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F
VSSEV_FLOAT(&x[ix], stride_x, vt, gvl);
VSSEV_FLOAT(&x[ix+1], stride_x, v1, gvl);
}
}
}
return(0);
}
Loading