Skip to content

Commit 395f8b3

Browse files
committed
fix(riscv64): keep signed strides in RVV ROTM
The general-stride ROTM path already computes kx/ky with the BLAS negative-increment starting offset. Converting negative increments to positive strides and moving dx/dy again double-adjusted the address and could access the wrong elements. Keep the signed byte strides for RVV strided loads and stores.
1 parent f82cf88 commit 395f8b3

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

kernel/riscv64/rotm_rvv.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,6 @@ int CNAME(BLASLONG n, FLOAT *dx, BLASLONG incx, FLOAT *dy, BLASLONG incy, FLOAT
229229
L80:
230230
dh12 = dparam[4];
231231
dh21 = dparam[3];
232-
if(incx < 0){
233-
incx = -incx;
234-
dx -= n*incx;
235-
}
236-
if(incy < 0){
237-
incy = -incy;
238-
dy -= n*incy;
239-
}
240232
stride_x = incx * sizeof(FLOAT);
241233
stride_y = incy * sizeof(FLOAT);
242234
for (size_t vl; n > 0; n -= vl, dx += vl*incx, dy += vl*incy) {
@@ -255,14 +247,6 @@ int CNAME(BLASLONG n, FLOAT *dx, BLASLONG incx, FLOAT *dy, BLASLONG incy, FLOAT
255247
L100:
256248
dh11 = dparam[2];
257249
dh22 = dparam[5];
258-
if(incx < 0){
259-
incx = -incx;
260-
dx -= n*incx;
261-
}
262-
if(incy < 0){
263-
incy = -incy;
264-
dy -= n*incy;
265-
}
266250
stride_x = incx * sizeof(FLOAT);
267251
stride_y = incy * sizeof(FLOAT);
268252
for (size_t vl; n > 0; n -= vl, dx += vl*incx, dy += vl*incy) {
@@ -283,14 +267,6 @@ int CNAME(BLASLONG n, FLOAT *dx, BLASLONG incx, FLOAT *dy, BLASLONG incy, FLOAT
283267
dh12 = dparam[4];
284268
dh21 = dparam[3];
285269
dh22 = dparam[5];
286-
if(incx < 0){
287-
incx = -incx;
288-
dx -= n*incx;
289-
}
290-
if(incy < 0){
291-
incy = -incy;
292-
dy -= n*incy;
293-
}
294270
stride_x = incx * sizeof(FLOAT);
295271
stride_y = incy * sizeof(FLOAT);
296272
for (size_t vl; n > 0; n -= vl, dx += vl*incx, dy += vl*incy) {

0 commit comments

Comments
 (0)