mirror of
https://github.com/golang/go
synced 2024-11-17 02:54:45 -07:00
runtime: improve ppc64x memclr for tail bytes
This improves memclr for the last few bytes when compiling for power9 or earlier. Change-Id: I46940ebc7e98e27a2e48d4b319acb7d2106a6f29 Reviewed-on: https://go-review.googlesource.com/c/go/+/495035 Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Paul Murphy <murp@ibm.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
This commit is contained in:
parent
5534f04498
commit
470c6f6418
@ -111,11 +111,21 @@ nozerolarge:
|
||||
STXVL V0, R3, R7
|
||||
RET
|
||||
#else
|
||||
MOVD R5, CTR // set up to clear tail bytes
|
||||
zerotailloop:
|
||||
MOVB R0, 0(R3) // clear single bytes
|
||||
ADD $1, R3
|
||||
BDNZ zerotailloop // dec ctr, br zerotailloop if ctr not 0
|
||||
CMP R5, $4
|
||||
BLT next2
|
||||
MOVW R0, 0(R3)
|
||||
ADD $4, R3
|
||||
ADD $-4, R5
|
||||
next2:
|
||||
CMP R5, $2
|
||||
BLT next1
|
||||
MOVH R0, 0(R3)
|
||||
ADD $2, R3
|
||||
ADD $-2, R5
|
||||
next1:
|
||||
CMP R5, $0
|
||||
BC 12, 2, LR // beqlr
|
||||
MOVB R0, 0(R3)
|
||||
RET
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user