From: Lynn Boger Date: Thu, 16 Aug 2018 14:49:35 +0000 (-0400) Subject: runtime: fix implementation of cputicks for ppc64x X-Git-Tag: go1.12beta1~1325 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=cfbe3cfbeb6b2de561fc709b8644d4d7a4e182bb;p=gostls13.git runtime: fix implementation of cputicks for ppc64x 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 TryBot-Result: Gobot Gobot Reviewed-by: Carlos Eduardo Seo Reviewed-by: Brad Fitzpatrick --- diff --git a/src/runtime/asm_ppc64x.s b/src/runtime/asm_ppc64x.s index 0886de9f2b..57877c0194 100644 --- a/src/runtime/asm_ppc64x.s +++ b/src/runtime/asm_ppc64x.s @@ -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