feat(asm): take the loong64 register-pair spellings the toolchain parses

Assisted-by: GLM 5.3 Flash
This commit is contained in:
petrbalvin authored and Petr Balvín committed 2026-10-07 21:42:14 +02:00
1 parent 1031cd9ae7
commit a3eaa82f87
5 files changed
+237 -18

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
// Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
// SPDX-License-Identifier: BSD-3-Clause
// Differential kernel for the loong64 register-pair spellings: a top-level
// colon between two registers splits the operand in two with the halves
// swapped, so R4:R5 encodes exactly as R5, R4. The integer multiply and
// divide families, the FP pair and the vector pair, each the way
// GOARCH=loong64 go tool asm takes them.
#include "textflag.h"
TEXT ·pairs(SB), NOSPLIT, $0-0
MULV R4 : R5, R6
MULV R4 : R5
MULV R6, R4 : R5
DIVV R4 : R5, R6
DIVVU R4 : R5, R6
MULHV R4 : R5, R6
MULHVU R4 : R5, R6
ADDV R4 : R5, R6
ADDW R4 : R5, R6
AND R4 : R5, R6
OR R4 : R5, R6
XOR R4 : R5, R6
MOVV R4 : R5
MULD F4 : F5, F6
VADDW V1 : V2, V3
RET