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>
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)
// 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)
// 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