]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use riscv64 RDTIME instruction
authorJoel Sing <joel@sing.id.au>
Mon, 4 May 2020 17:15:58 +0000 (03:15 +1000)
committerJoel Sing <joel@sing.id.au>
Sun, 16 Aug 2020 13:55:00 +0000 (13:55 +0000)
Use the actual RDTIME instruction, rather than a WORD.
Generated code is the same.

Change-Id: I6f6f5a1836eae2d05af34d4a22db2ede4fdcb458
Reviewed-on: https://go-review.googlesource.com/c/go/+/231997
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/asm_riscv64.s

index d7c45a183dca1cf8ae8dcce063aa8497657cbb65..8f6c8773eb089409259a4cc1c8726c5a908865fd 100644 (file)
@@ -79,7 +79,7 @@ TEXT setg_gcc<>(SB),NOSPLIT,$0-0
 
 // func cputicks() int64
 TEXT runtime·cputicks(SB),NOSPLIT,$0-8
-       WORD    $0xc0102573     // rdtime a0
+       RDTIME  A0
        MOV     A0, ret+0(FP)
        RET