Commit d0f10a6e authored by Agniva De Sarker's avatar Agniva De Sarker Committed by Agniva De Sarker

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: default avatarRichard Musiol <neelance@gmail.com>
Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
parent 03ef105d
...@@ -45,9 +45,8 @@ TEXT cmpbody<>(SB), NOSPLIT, $0-0 ...@@ -45,9 +45,8 @@ TEXT cmpbody<>(SB), NOSPLIT, $0-0
I32WrapI64 I32WrapI64
Call memcmp<>(SB) Call memcmp<>(SB)
I64ExtendI32S I64ExtendI32S
Set R5 Tee R5
Get R5
I64Eqz I64Eqz
If If
// check length // check length
......
...@@ -17,10 +17,9 @@ loop: ...@@ -17,10 +17,9 @@ loop:
Get R2 Get R2
I32Const $1 I32Const $1
I32Sub I32Sub
Set R2 Tee R2
// n == 0 // n == 0
Get R2
I32Eqz I32Eqz
If If
Return Return
...@@ -54,10 +53,9 @@ loop: ...@@ -54,10 +53,9 @@ loop:
Get R1 Get R1
I32Const $1 I32Const $1
I32Sub I32Sub
Set R1 Tee R1
// n == 0 // n == 0
Get R1
I32Eqz I32Eqz
If If
Return Return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment