Commit b003afe
cmd/compile: intrinsify RotateLeft32 on wasm
wasm has 32-bit versions of all integer operations. This change
lowers RotateLeft32 to i32.rotl on wasm and intrinsifies the math/bits
call. Benchmarking on amd64 under node.js this is ~25% faster.
node v10.15.3/amd64
name old time/op new time/op delta
RotateLeft 8.37ns ± 1% 8.28ns ± 0% -1.05% (p=0.029 n=4+4)
RotateLeft8 11.9ns ± 1% 11.8ns ± 0% ~ (p=0.167 n=5+5)
RotateLeft16 11.8ns ± 0% 11.8ns ± 0% ~ (all equal)
RotateLeft32 11.9ns ± 1% 8.7ns ± 0% -26.32% (p=0.008 n=5+5)
RotateLeft64 8.31ns ± 1% 8.43ns ± 2% ~ (p=0.063 n=5+5)
Updates #31265
Change-Id: I5b8e155978faeea536c4f6427ac9564d2f096a46
Reviewed-on: https://go-review.googlesource.com/c/go/+/182359
Run-TryBot: Brian Kessler <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Richard Musiol <[email protected]>1 parent 12dbd20 commit b003afe
File tree
7 files changed
+35
-29
lines changed- src/cmd/compile/internal
- gc
- ssa
- gen
- wasm
- test/codegen
7 files changed
+35
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3504 | 3504 | | |
3505 | 3505 | | |
3506 | 3506 | | |
3507 | | - | |
| 3507 | + | |
3508 | 3508 | | |
3509 | 3509 | | |
3510 | 3510 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
362 | 363 | | |
363 | 364 | | |
364 | 365 | | |
365 | | - | |
366 | | - | |
367 | 366 | | |
368 | 367 | | |
369 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
302 | 308 | | |
303 | 309 | | |
304 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| |||
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
| 236 | + | |
235 | 237 | | |
236 | 238 | | |
237 | 239 | | |
| |||
241 | 243 | | |
242 | 244 | | |
243 | 245 | | |
| 246 | + | |
244 | 247 | | |
245 | 248 | | |
246 | 249 | | |
| |||
251 | 254 | | |
252 | 255 | | |
253 | 256 | | |
| 257 | + | |
254 | 258 | | |
255 | 259 | | |
256 | 260 | | |
| |||
0 commit comments