Skip to content

Commit

Permalink
runtime: use regabi for riscv64 cputicks
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mengzhuo committed Sep 5, 2024
1 parent db07c86 commit 2707d42
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/runtime/asm_riscv64.s
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,11 @@ TEXT setg_gcc<>(SB),NOSPLIT,$0-0
RET

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

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

0 comments on commit 2707d42

Please sign in to comment.