]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix implementation of cputicks for ppc64x
authorLynn Boger <laboger@linux.vnet.ibm.com>
Thu, 16 Aug 2018 14:49:35 +0000 (10:49 -0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 22 Aug 2018 19:47:31 +0000 (19:47 +0000)
The implementation of cputicks has been wrong for ppc64x. The
previous code sequence is for 32 bit, not 64 bit.

Change-Id: I308ae6cf9131f53a0100cd3f8ae4e16601f2d553
Reviewed-on: https://go-review.googlesource.com/129595
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/asm_ppc64x.s

index 0886de9f2ba7c7b008e3c769d61467029ac60367..57877c0194c7dc403b4bac71f2d886bfdbb65c88 100644 (file)
@@ -723,18 +723,11 @@ TEXT runtime·abort(SB),NOSPLIT|NOFRAME,$0-0
        MOVW    (R0), R0
        UNDEF
 
-#define        TBRL    268
-#define        TBRU    269             /* Time base Upper/Lower */
+#define        TBR     268
 
 // int64 runtime·cputicks(void)
 TEXT runtime·cputicks(SB),NOSPLIT,$0-8
-       MOVW    SPR(TBRU), R4
-       MOVW    SPR(TBRL), R3
-       MOVW    SPR(TBRU), R5
-       CMPW    R4, R5
-       BNE     -4(PC)
-       SLD     $32, R5
-       OR      R5, R3
+       MOVD    SPR(TBR), R3
        MOVD    R3, ret+0(FP)
        RET