From 7401cce31392295f531e1d0fcc2f01d782353300 Mon Sep 17 00:00:00 2001 From: Guoqi Chen Date: Wed, 12 Mar 2025 10:18:00 +0800 Subject: [PATCH] cpu: replace specific instructions with WORD in the function get_cpucfg on loong64 The CPUCFG instruction on loong64 was introduced in Go1.24, which caused compilation errors when using this feature in Go1.23 and earlier versions. Change-Id: I68891bbfc527194ecdafebac3398e700bfb53c2f Reviewed-on: https://go-review.googlesource.com/c/sys/+/656915 Reviewed-by: Meidan Li LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase Reviewed-by: Junyang Shao --- cpu/cpu_loong64.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpu/cpu_loong64.s b/cpu/cpu_loong64.s index 30b4c0d1..71cbaf1c 100644 --- a/cpu/cpu_loong64.s +++ b/cpu/cpu_loong64.s @@ -7,6 +7,7 @@ // func get_cpucfg(reg uint32) uint32 TEXT ·get_cpucfg(SB), NOSPLIT|NOFRAME, $0 MOVW reg+0(FP), R5 - CPUCFG R5, R4 + // CPUCFG R5, R4 = 0x00006ca4 + WORD $0x00006ca4 MOVW R4, ret+8(FP) RET