aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/asm/internal
diff options
context:
space:
mode:
authorXiaolin Zhao <zhaoxiaolin@loongson.cn>2025-08-26 15:40:57 +0800
committerGopher Robot <gobot@golang.org>2025-09-04 12:24:25 -0700
commitddce0522bee36764c3b9529b8584c3d5b53c5dac (patch)
treee46b44486f399f7c069e12890a0c59f2063e86b7 /src/cmd/asm/internal
parent00b8474e47a1f0381170734604a7ce8123d7146d (diff)
downloadgo-ddce0522bee36764c3b9529b8584c3d5b53c5dac.tar.xz
cmd/internal/obj/loong64: add ADDU16I.D instruction support
Go asm syntax: ADDV16 $(1<<16), R4, R5 Equivalent platform assembler syntax: addu16i.d r5, r4, $1 Change-Id: Ica4a4e779d0a107cda3eade86027abd6458779a4 Reviewed-on: https://go-review.googlesource.com/c/go/+/699056 Reviewed-by: abner chenc <chenguoqi@loongson.cn> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd/asm/internal')
-rw-r--r--src/cmd/asm/internal/asm/testdata/loong64enc1.s7
-rw-r--r--src/cmd/asm/internal/asm/testdata/loong64error.s2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/loong64enc1.s b/src/cmd/asm/internal/asm/testdata/loong64enc1.s
index c5c6a4479a..fd86db7a4f 100644
--- a/src/cmd/asm/internal/asm/testdata/loong64enc1.s
+++ b/src/cmd/asm/internal/asm/testdata/loong64enc1.s
@@ -282,6 +282,13 @@ lable2:
MOVVP 4(R5), R4 // a4040026
MOVVP (R5), R4 // a4000026
+ // ADDU16I.D instruction
+ ADDV16 $(-32768<<16), R4, R5 // ADDV16 $-2147483648, R4, R5 // 85000012
+ ADDV16 $(0<<16), R4, R5 // ADDV16 $0, R4, R5 // 85000010
+ ADDV16 $(8<<16), R4, R5 // ADDV16 $524288, R4, R5 // 85200010
+ ADDV16 $(32767<<16), R4, R5 // ADDV16 $2147418112, R4, R5 // 85fcff11
+ ADDV16 $(16<<16), R4 // ADDV16 $1048576, R4 // 84400010
+
// Loong64 atomic memory access instructions
AMSWAPB R14, (R13), R12 // ac395c38
AMSWAPH R14, (R13), R12 // acb95c38
diff --git a/src/cmd/asm/internal/asm/testdata/loong64error.s b/src/cmd/asm/internal/asm/testdata/loong64error.s
index 9272ce51c3..2dcd34bf61 100644
--- a/src/cmd/asm/internal/asm/testdata/loong64error.s
+++ b/src/cmd/asm/internal/asm/testdata/loong64error.s
@@ -5,3 +5,5 @@
TEXT errors(SB),$0
VSHUF4IV $16, V1, V2 // ERROR "operand out of range 0 to 15"
XVSHUF4IV $16, X1, X2 // ERROR "operand out of range 0 to 15"
+ ADDV16 $1, R4, R5 // ERROR "the constant must be a multiple of 65536."
+ ADDV16 $65535, R4, R5 // ERROR "the constant must be a multiple of 65536."