]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use unsigned load for iscgo variable in ppc64x runtime asm
authorLynn Boger <laboger@linux.vnet.ibm.com>
Mon, 22 Oct 2018 20:02:43 +0000 (16:02 -0400)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Tue, 23 Oct 2018 20:25:29 +0000 (20:25 +0000)
This changes the runtime asm code that loads iscgo to use MOVBZ
instead of MOVB, avoiding an unnecessary sign extension. This is most
significant in runtime.save_g, reducing the size from 8 to 7
instructions.

Change-Id: Iaa2121464b5309e1f27fd91b19b5603c7aaf619d
Reviewed-on: https://go-review.googlesource.com/c/144217
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/runtime/asm_ppc64x.s
src/runtime/sys_linux_ppc64x.s
src/runtime/tls_ppc64x.s

index e77c7179354927903875f4646e6d45011c88e987..87076817f977f9661b8fb9687ea8804cf68b19f1 100644 (file)
@@ -648,7 +648,7 @@ TEXT ·cgocallback_gofunc(SB),NOSPLIT,$16-32
        NO_LOCAL_POINTERS
 
        // Load m and g from thread-local storage.
-       MOVB    runtime·iscgo(SB), R3
+       MOVBZ   runtime·iscgo(SB), R3
        CMP     R3, $0
        BEQ     nocgo
        BL      runtime·load_g(SB)
index 5b5df50d41ba7790ea047debc0cb343c3ed036f9..bf01099830799c0a8fe8989a51c95d1e3dfd9571 100644 (file)
@@ -301,7 +301,7 @@ TEXT runtime·_sigtramp(SB),NOSPLIT,$64
 
        // this might be called in external code context,
        // where g is not set.
-       MOVB    runtime·iscgo(SB), R6
+       MOVBZ   runtime·iscgo(SB), R6
        CMP     R6, $0
        BEQ     2(PC)
        BL      runtime·load_g(SB)
index 82714853ee7a84f2794dbe0cdf575dcfcf9f2f4e..c6974492828ea64f0f3f5bf3e28af07305cf5c45 100644 (file)
@@ -24,7 +24,7 @@
 // NOTE: setg_gcc<> assume this clobbers only R31.
 TEXT runtime·save_g(SB),NOSPLIT|NOFRAME,$0-0
 #ifndef GOOS_aix
-       MOVB    runtime·iscgo(SB), R31
+       MOVBZ   runtime·iscgo(SB), R31
        CMP     R31, $0
        BEQ     nocgo
 #endif