Skip to content

Commit af10c13

Browse files
committed
LoongArch64: Fix dsymv and ssymv LASX version
"fmov.d $f2, $f4" leaves all the bits higher than the 63-th bit unpredictable but it's obvious that the following code uses the value of those high bits. We actually want to replicate the lower 64 bits here, so we should use xvreplve0.d instead. LA464 (Loongson 3[A-Z]-5000) happens to replicate them for us due to some uarch internal details so the issue was not detected, but for LA664 (Loongson 3[A-Z]-6000) and future uarch we need to do things correctly or we end up getting a lot of test failures. Closes: https://bbs.aosc.io/t/topic/302 Signed-off-by: Xi Ruoyao <xry111@xry111.site>
1 parent 4e817f8 commit af10c13

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

kernel/loongarch64/dsymv_L_lasx.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
288288

289289
//Acc U2
290290
GACC xvf, d, U4, U2
291-
fmov.d $f2, $f4
291+
xvreplve0.d U2, U4
292292
.L03: /* &4 */
293293
sub.d T0, M, J
294294
addi.d T0, T0, -1

kernel/loongarch64/dsymv_U_lasx.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272272

273273
//Acc U2
274274
GACC xvf, d, U4, U2
275-
fmov.d $f2, $f4
275+
xvreplve0.d U2, U4
276276

277277
.L03: /* &4 */
278278
andi T0, J, 4

kernel/loongarch64/ssymv_L_lasx.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
279279

280280
//Acc U2
281281
GACC xvf, s, U4, U2
282-
fmov.d $f2, $f4
282+
xvreplve0.d U2, U4
283283

284284
.L03: /* &4 */
285285
sub.d T0, M, J

kernel/loongarch64/ssymv_U_lasx.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
263263

264264
//Acc U2
265265
GACC xvf, s, U4, U2
266-
fmov.d $f2, $f4
266+
xvreplve0.d U2, U4
267267

268268
.L03: /* &4 */
269269
andi T0, J, 4

0 commit comments

Comments
 (0)