Skip to content

Commit 2707d42

Browse files
committed
runtime: use regabi for riscv64 cputicks
goos: linux goarch: riscv64 pkg: runtime cpu: Spacemit(R) X60 │ select.old.log │ select.new.log │ │ sec/op │ sec/op vs base │ SelectUncontended 490.5n ± 0% 486.8n ± 0% -0.77% (p=0.000 n=10) SelectSyncContended 2.754µ ± 0% 2.726µ ± 0% -1.02% (p=0.000 n=10) SelectAsyncContended 488.2n ± 0% 484.2n ± 0% -0.84% (p=0.000 n=10) SelectNonblock 112.2n ± 0% 111.5n ± 0% -0.58% (p=0.000 n=10) SelectProdCons 1.420µ ± 0% 1.417µ ± 0% ~ (p=0.069 n=10) GoroutineSelect 10.79m ± 3% 10.74m ± 3% ~ (p=0.529 n=10) geomean 3.228µ 3.208µ -0.63% Change-Id: Idb519ef8b2872284dca6dbf1cf94c3fff65bfd37 Reviewed-on: https://go-review.googlesource.com/c/go/+/610095 Reviewed-by: abner chenc <[email protected]> Reviewed-by: Joel Sing <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent db07c86 commit 2707d42

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/runtime/asm_riscv64.s

+2-3
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,11 @@ TEXT setg_gcc<>(SB),NOSPLIT,$0-0
8080
RET
8181

8282
// func cputicks() int64
83-
TEXT runtime·cputicks(SB),NOSPLIT,$0-8
83+
TEXT runtime·cputicks<ABIInternal>(SB),NOSPLIT,$0-0
8484
// RDTIME to emulate cpu ticks
8585
// RDCYCLE reads counter that is per HART(core) based
8686
// according to the riscv manual, see issue 46737
87-
RDTIME A0
88-
MOV A0, ret+0(FP)
87+
RDTIME X10
8988
RET
9089

9190
// systemstack_switch is a dummy routine that systemstack leaves at the bottom

0 commit comments

Comments
 (0)