1
0
mirror of https://github.com/golang/go synced 2024-11-18 09:44:50 -07:00

runtime,internal/bytealg: optimize wasmZero, wasmMove, Compare

Coalesce set/get pairs into a tee.

Change-Id: I88ccdcb148465615437bebf24145e941a037e0a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/200357
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Richard Musiol <neelance@gmail.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Agniva De Sarker 2019-10-10 12:31:43 +05:30 committed by Agniva De Sarker
parent 03ef105dae
commit d0f10a6e68
2 changed files with 3 additions and 6 deletions

View File

@ -45,9 +45,8 @@ TEXT cmpbody<>(SB), NOSPLIT, $0-0
I32WrapI64
Call memcmp<>(SB)
I64ExtendI32S
Set R5
Tee R5
Get R5
I64Eqz
If
// check length

View File

@ -17,10 +17,9 @@ loop:
Get R2
I32Const $1
I32Sub
Set R2
Tee R2
// n == 0
Get R2
I32Eqz
If
Return
@ -54,10 +53,9 @@ loop:
Get R1
I32Const $1
I32Sub
Set R1
Tee R1
// n == 0
Get R1
I32Eqz
If
Return