diff options
| author | Martin Möhrmann <moehrmann@google.com> | 2018-01-27 11:55:34 +0100 |
|---|---|---|
| committer | Martin Möhrmann <moehrmann@google.com> | 2018-10-15 19:04:09 +0000 |
| commit | a1ca4893ff755d6b0b3bf4b026196d55251ea846 (patch) | |
| tree | 72a39af659aa88e0a62a5da6ef6d45a659fcfc51 /src/runtime/string.go | |
| parent | 9f66b41beea82cc613cad9138c10a50f2b3ea137 (diff) | |
| download | go-a1ca4893ff755d6b0b3bf4b026196d55251ea846.tar.xz | |
cmd/compile: add intrinsics for runtime/internal/math on 386 and amd64
Add generic, 386 and amd64 specific ops and SSA rules for multiplication
with overflow and branching based on overflow flags. Use these to intrinsify
runtime/internal/math.MulUinptr.
On amd64
mul, overflow := math.MulUintptr(a, b)
if overflow {
is lowered to two instructions:
MULQ SI
JO 0x10ee35c
No codegen tests as codegen can not currently test unexported internal runtime
functions.
amd64:
name old time/op new time/op delta
MulUintptr/small 1.16ns ± 5% 0.88ns ± 6% -24.36% (p=0.000 n=19+20)
MulUintptr/large 10.7ns ± 1% 1.1ns ± 1% -89.28% (p=0.000 n=17+19)
Change-Id: If60739a86f820e5044d677276c21df90d3c7a86a
Reviewed-on: https://go-review.googlesource.com/c/141820
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/string.go')
0 files changed, 0 insertions, 0 deletions
