2015-02-27 17:40:34 +09:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
// NOTE: If you change this file you must run "go generate"
|
2016-03-01 23:21:55 +00:00
|
|
|
// to update builtin.go. This is not done automatically
|
2015-02-27 17:40:34 +09:00
|
|
|
// to avoid depending on having a working compiler binary.
|
|
|
|
|
|
|
|
|
|
// +build ignore
|
|
|
|
|
|
2015-12-01 11:52:32 -08:00
|
|
|
package runtime
|
2015-02-27 17:40:34 +09:00
|
|
|
|
|
|
|
|
// emitted by compiler, not referred to by go programs
|
|
|
|
|
|
2017-02-19 23:40:24 -05:00
|
|
|
import "unsafe"
|
|
|
|
|
|
2015-02-27 17:40:34 +09:00
|
|
|
func newobject(typ *byte) *any
|
|
|
|
|
func panicindex()
|
|
|
|
|
func panicslice()
|
|
|
|
|
func panicdivide()
|
2018-04-26 18:30:11 +02:00
|
|
|
func panicmakeslicelen()
|
2015-02-27 17:40:34 +09:00
|
|
|
func throwinit()
|
cmd/compile: make panicwrap argument-free
When code defines a method on T,
the compiler generates a corresponding wrapper method on *T.
The first thing the wrapper does is check whether
the pointer is nil and if so, call panicwrap.
This is done to provide a useful error message.
The existing implementation gets its information
from arguments set up by the compiler.
However, with some trouble, this information can
be extracted from the name of the wrapper method itself.
Removing the arguments to panicwrap simplifies and
shrinks the wrapper method.
It also means that the call to panicwrap does not
require any stack space.
This enables a further optimization on amd64/x86,
which is to skip the function prologue if nothing
else in the method requires stack space.
This is frequently the case in simple, hot methods,
such as Less and Swap in sort.Interface implementations.
Fixes #19040.
Benchmarks for package sort on amd64:
name old time/op new time/op delta
SearchWrappers-8 104ns ± 1% 104ns ± 1% ~ (p=0.286 n=27+27)
SortString1K-8 128µs ± 1% 128µs ± 1% -0.44% (p=0.004 n=30+30)
SortString1K_Slice-8 118µs ± 2% 117µs ± 1% ~ (p=0.106 n=30+30)
StableString1K-8 18.6µs ± 1% 18.6µs ± 1% ~ (p=0.446 n=28+26)
SortInt1K-8 65.9µs ± 1% 60.7µs ± 1% -7.96% (p=0.000 n=28+30)
StableInt1K-8 75.3µs ± 2% 72.8µs ± 1% -3.41% (p=0.000 n=30+30)
StableInt1K_Slice-8 57.7µs ± 1% 57.7µs ± 1% ~ (p=0.515 n=30+30)
SortInt64K-8 6.28ms ± 1% 6.01ms ± 1% -4.19% (p=0.000 n=28+28)
SortInt64K_Slice-8 5.04ms ± 1% 5.04ms ± 1% ~ (p=0.927 n=28+27)
StableInt64K-8 6.65ms ± 1% 6.38ms ± 1% -3.97% (p=0.000 n=26+30)
Sort1e2-8 37.9µs ± 1% 37.2µs ± 1% -1.89% (p=0.000 n=29+27)
Stable1e2-8 77.0µs ± 1% 74.7µs ± 1% -3.06% (p=0.000 n=27+30)
Sort1e4-8 8.21ms ± 2% 7.98ms ± 1% -2.77% (p=0.000 n=29+30)
Stable1e4-8 24.8ms ± 1% 24.3ms ± 1% -2.31% (p=0.000 n=28+30)
Sort1e6-8 1.27s ± 4% 1.22s ± 1% -3.42% (p=0.000 n=30+29)
Stable1e6-8 5.06s ± 1% 4.92s ± 1% -2.77% (p=0.000 n=25+29)
[Geo mean] 731µs 714µs -2.29%
Before/after assembly for sort.(*intPairs).Less follows.
It can be optimized further, but that's for a follow-up CL.
Before:
"".(*intPairs).Less t=1 size=214 args=0x20 locals=0x38
0x0000 00000 (<autogenerated>:1) TEXT "".(*intPairs).Less(SB), $56-32
0x0000 00000 (<autogenerated>:1) MOVQ (TLS), CX
0x0009 00009 (<autogenerated>:1) CMPQ SP, 16(CX)
0x000d 00013 (<autogenerated>:1) JLS 204
0x0013 00019 (<autogenerated>:1) SUBQ $56, SP
0x0017 00023 (<autogenerated>:1) MOVQ BP, 48(SP)
0x001c 00028 (<autogenerated>:1) LEAQ 48(SP), BP
0x0021 00033 (<autogenerated>:1) MOVQ 32(CX), BX
0x0025 00037 (<autogenerated>:1) TESTQ BX, BX
0x0028 00040 (<autogenerated>:1) JEQ 55
0x002a 00042 (<autogenerated>:1) LEAQ 64(SP), DI
0x002f 00047 (<autogenerated>:1) CMPQ (BX), DI
0x0032 00050 (<autogenerated>:1) JNE 55
0x0034 00052 (<autogenerated>:1) MOVQ SP, (BX)
0x0037 00055 (<autogenerated>:1) NOP
0x0037 00055 (<autogenerated>:1) FUNCDATA $0, gclocals·4032f753396f2012ad1784f398b170f4(SB)
0x0037 00055 (<autogenerated>:1) FUNCDATA $1, gclocals·69c1753bd5f81501d95132d08af04464(SB)
0x0037 00055 (<autogenerated>:1) MOVQ ""..this+64(FP), AX
0x003c 00060 (<autogenerated>:1) TESTQ AX, AX
0x003f 00063 (<autogenerated>:1) JEQ $0, 135
0x0041 00065 (<autogenerated>:1) MOVQ (AX), CX
0x0044 00068 (<autogenerated>:1) MOVQ 8(AX), AX
0x0048 00072 (<autogenerated>:1) MOVQ "".i+72(FP), DX
0x004d 00077 (<autogenerated>:1) CMPQ DX, AX
0x0050 00080 (<autogenerated>:1) JCC $0, 128
0x0052 00082 (<autogenerated>:1) SHLQ $4, DX
0x0056 00086 (<autogenerated>:1) MOVQ (CX)(DX*1), DX
0x005a 00090 (<autogenerated>:1) MOVQ "".j+80(FP), BX
0x005f 00095 (<autogenerated>:1) CMPQ BX, AX
0x0062 00098 (<autogenerated>:1) JCC $0, 128
0x0064 00100 (<autogenerated>:1) SHLQ $4, BX
0x0068 00104 (<autogenerated>:1) MOVQ (CX)(BX*1), AX
0x006c 00108 (<autogenerated>:1) CMPQ DX, AX
0x006f 00111 (<autogenerated>:1) SETLT AL
0x0072 00114 (<autogenerated>:1) MOVB AL, "".~r2+88(FP)
0x0076 00118 (<autogenerated>:1) MOVQ 48(SP), BP
0x007b 00123 (<autogenerated>:1) ADDQ $56, SP
0x007f 00127 (<autogenerated>:1) RET
0x0080 00128 (<autogenerated>:1) PCDATA $0, $1
0x0080 00128 (<autogenerated>:1) CALL runtime.panicindex(SB)
0x0085 00133 (<autogenerated>:1) UNDEF
0x0087 00135 (<autogenerated>:1) LEAQ go.string."sort_test"(SB), AX
0x008e 00142 (<autogenerated>:1) MOVQ AX, (SP)
0x0092 00146 (<autogenerated>:1) MOVQ $9, 8(SP)
0x009b 00155 (<autogenerated>:1) LEAQ go.string."intPairs"(SB), AX
0x00a2 00162 (<autogenerated>:1) MOVQ AX, 16(SP)
0x00a7 00167 (<autogenerated>:1) MOVQ $8, 24(SP)
0x00b0 00176 (<autogenerated>:1) LEAQ go.string."Less"(SB), AX
0x00b7 00183 (<autogenerated>:1) MOVQ AX, 32(SP)
0x00bc 00188 (<autogenerated>:1) MOVQ $4, 40(SP)
0x00c5 00197 (<autogenerated>:1) PCDATA $0, $1
0x00c5 00197 (<autogenerated>:1) CALL runtime.panicwrap(SB)
0x00ca 00202 (<autogenerated>:1) UNDEF
0x00cc 00204 (<autogenerated>:1) NOP
0x00cc 00204 (<autogenerated>:1) PCDATA $0, $-1
0x00cc 00204 (<autogenerated>:1) CALL runtime.morestack_noctxt(SB)
0x00d1 00209 (<autogenerated>:1) JMP 0
After:
"".(*intPairs).Swap t=1 size=147 args=0x18 locals=0x8
0x0000 00000 (<autogenerated>:1) TEXT "".(*intPairs).Swap(SB), $8-24
0x0000 00000 (<autogenerated>:1) MOVQ (TLS), CX
0x0009 00009 (<autogenerated>:1) SUBQ $8, SP
0x000d 00013 (<autogenerated>:1) MOVQ BP, (SP)
0x0011 00017 (<autogenerated>:1) LEAQ (SP), BP
0x0015 00021 (<autogenerated>:1) MOVQ 32(CX), BX
0x0019 00025 (<autogenerated>:1) TESTQ BX, BX
0x001c 00028 (<autogenerated>:1) JEQ 43
0x001e 00030 (<autogenerated>:1) LEAQ 16(SP), DI
0x0023 00035 (<autogenerated>:1) CMPQ (BX), DI
0x0026 00038 (<autogenerated>:1) JNE 43
0x0028 00040 (<autogenerated>:1) MOVQ SP, (BX)
0x002b 00043 (<autogenerated>:1) NOP
0x002b 00043 (<autogenerated>:1) FUNCDATA $0, gclocals·e6397a44f8e1b6e77d0f200b4fba5269(SB)
0x002b 00043 (<autogenerated>:1) FUNCDATA $1, gclocals·69c1753bd5f81501d95132d08af04464(SB)
0x002b 00043 (<autogenerated>:1) MOVQ ""..this+16(FP), AX
0x0030 00048 (<autogenerated>:1) TESTQ AX, AX
0x0033 00051 (<autogenerated>:1) JEQ $0, 140
0x0035 00053 (<autogenerated>:1) MOVQ (AX), CX
0x0038 00056 (<autogenerated>:1) MOVQ 8(AX), AX
0x003c 00060 (<autogenerated>:1) MOVQ "".i+24(FP), DX
0x0041 00065 (<autogenerated>:1) CMPQ DX, AX
0x0044 00068 (<autogenerated>:1) JCC $0, 133
0x0046 00070 (<autogenerated>:1) SHLQ $4, DX
0x004a 00074 (<autogenerated>:1) MOVQ 8(CX)(DX*1), BX
0x004f 00079 (<autogenerated>:1) MOVQ (CX)(DX*1), SI
0x0053 00083 (<autogenerated>:1) MOVQ "".j+32(FP), DI
0x0058 00088 (<autogenerated>:1) CMPQ DI, AX
0x005b 00091 (<autogenerated>:1) JCC $0, 133
0x005d 00093 (<autogenerated>:1) SHLQ $4, DI
0x0061 00097 (<autogenerated>:1) MOVQ 8(CX)(DI*1), AX
0x0066 00102 (<autogenerated>:1) MOVQ (CX)(DI*1), R8
0x006a 00106 (<autogenerated>:1) MOVQ R8, (CX)(DX*1)
0x006e 00110 (<autogenerated>:1) MOVQ AX, 8(CX)(DX*1)
0x0073 00115 (<autogenerated>:1) MOVQ SI, (CX)(DI*1)
0x0077 00119 (<autogenerated>:1) MOVQ BX, 8(CX)(DI*1)
0x007c 00124 (<autogenerated>:1) MOVQ (SP), BP
0x0080 00128 (<autogenerated>:1) ADDQ $8, SP
0x0084 00132 (<autogenerated>:1) RET
0x0085 00133 (<autogenerated>:1) PCDATA $0, $1
0x0085 00133 (<autogenerated>:1) CALL runtime.panicindex(SB)
0x008a 00138 (<autogenerated>:1) UNDEF
0x008c 00140 (<autogenerated>:1) PCDATA $0, $1
0x008c 00140 (<autogenerated>:1) CALL runtime.panicwrap(SB)
0x0091 00145 (<autogenerated>:1) UNDEF
Change-Id: I15bb8435f0690badb868799f313ed8817335efd3
Reviewed-on: https://go-review.googlesource.com/36809
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-10 21:49:07 -08:00
|
|
|
func panicwrap()
|
2015-02-27 17:40:34 +09:00
|
|
|
|
|
|
|
|
func gopanic(interface{})
|
2018-03-08 21:00:36 +00:00
|
|
|
func gorecover(*int32) interface{}
|
2016-11-10 16:03:47 -05:00
|
|
|
func goschedguarded()
|
2015-02-27 17:40:34 +09:00
|
|
|
|
|
|
|
|
func printbool(bool)
|
|
|
|
|
func printfloat(float64)
|
|
|
|
|
func printint(int64)
|
|
|
|
|
func printhex(uint64)
|
|
|
|
|
func printuint(uint64)
|
|
|
|
|
func printcomplex(complex128)
|
|
|
|
|
func printstring(string)
|
|
|
|
|
func printpointer(any)
|
|
|
|
|
func printiface(any)
|
|
|
|
|
func printeface(any)
|
|
|
|
|
func printslice(any)
|
|
|
|
|
func printnl()
|
|
|
|
|
func printsp()
|
|
|
|
|
func printlock()
|
|
|
|
|
func printunlock()
|
|
|
|
|
|
|
|
|
|
func concatstring2(*[32]byte, string, string) string
|
|
|
|
|
func concatstring3(*[32]byte, string, string, string) string
|
|
|
|
|
func concatstring4(*[32]byte, string, string, string, string) string
|
|
|
|
|
func concatstring5(*[32]byte, string, string, string, string, string) string
|
|
|
|
|
func concatstrings(*[32]byte, []string) string
|
|
|
|
|
|
|
|
|
|
func cmpstring(string, string) int
|
|
|
|
|
func intstring(*[4]byte, int64) string
|
|
|
|
|
func slicebytetostring(*[32]byte, []byte) string
|
|
|
|
|
func slicebytetostringtmp([]byte) string
|
|
|
|
|
func slicerunetostring(*[32]byte, []rune) string
|
|
|
|
|
func stringtoslicebyte(*[32]byte, string) []byte
|
|
|
|
|
func stringtoslicerune(*[32]rune, string) []rune
|
|
|
|
|
func slicecopy(to any, fr any, wid uintptr) int
|
|
|
|
|
func slicestringcopy(to any, fr any) int
|
|
|
|
|
|
2018-04-24 15:13:08 +02:00
|
|
|
func decoderune(string, int) (retv rune, retk int)
|
|
|
|
|
func countrunes(string) int
|
|
|
|
|
|
2018-10-29 13:54:24 -07:00
|
|
|
// Non-empty-interface to non-empty-interface conversion.
|
2015-02-27 17:40:34 +09:00
|
|
|
func convI2I(typ *byte, elem any) (ret any)
|
cmd/compile, runtime: specialize convT2x, don't alloc for zero vals
Prior to this CL, all runtime conversions
from a concrete value to an interface went
through one of two runtime calls: convT2E or convT2I.
However, in practice, basic types are very common.
Specializing convT2x for those basic types allows
for a more efficient implementation for those types.
For basic scalars and strings, allocation and copying
can use the same methods as normal code.
For pointer-free types, allocation can occur without
zeroing, and copying can take place without GC calls.
For slices, copying is cheaper and simpler.
This CL adds twelve runtime routines:
convT2E16, convT2I16
convT2E32, convT2I32
convT2E64, convT2I64
convT2Estring, convT2Istring
convT2Eslice, convT2Islice
convT2Enoptr, convT2Inoptr
While compiling make.bash, 93% of all convT2x calls
are now to one of these specialized convT2x call.
Within specialized convT2x routines, it is cheap to check
for a zero value, in a way that it is not in general.
When we detect a zero value there, we return a pointer
to zeroVal, rather than allocating.
name old time/op new time/op delta
ConvT2Ezero/zero/16-8 17.9ns ± 2% 3.0ns ± 3% -83.20% (p=0.000 n=56+56)
ConvT2Ezero/zero/32-8 17.8ns ± 2% 3.0ns ± 3% -83.15% (p=0.000 n=59+60)
ConvT2Ezero/zero/64-8 20.1ns ± 1% 3.0ns ± 2% -84.98% (p=0.000 n=57+57)
ConvT2Ezero/zero/str-8 32.6ns ± 1% 3.0ns ± 4% -90.70% (p=0.000 n=59+60)
ConvT2Ezero/zero/slice-8 36.7ns ± 2% 3.0ns ± 2% -91.78% (p=0.000 n=59+59)
ConvT2Ezero/zero/big-8 91.9ns ± 2% 85.9ns ± 2% -6.52% (p=0.000 n=57+57)
ConvT2Ezero/nonzero/16-8 17.7ns ± 2% 12.7ns ± 3% -28.38% (p=0.000 n=55+60)
ConvT2Ezero/nonzero/32-8 17.8ns ± 1% 12.7ns ± 1% -28.44% (p=0.000 n=54+57)
ConvT2Ezero/nonzero/64-8 20.0ns ± 1% 15.0ns ± 1% -24.90% (p=0.000 n=56+58)
ConvT2Ezero/nonzero/str-8 32.6ns ± 1% 25.7ns ± 1% -21.17% (p=0.000 n=58+55)
ConvT2Ezero/nonzero/slice-8 36.8ns ± 2% 30.4ns ± 1% -17.32% (p=0.000 n=60+52)
ConvT2Ezero/nonzero/big-8 92.1ns ± 2% 85.9ns ± 2% -6.70% (p=0.000 n=57+59)
Benchmarks on a real program (the compiler):
name old time/op new time/op delta
Template 227ms ± 5% 221ms ± 2% -2.48% (p=0.000 n=30+26)
Unicode 102ms ± 5% 100ms ± 3% -1.30% (p=0.009 n=30+26)
GoTypes 656ms ± 5% 659ms ± 4% ~ (p=0.208 n=30+30)
Compiler 2.82s ± 2% 2.82s ± 1% ~ (p=0.614 n=29+27)
Flate 128ms ± 2% 128ms ± 5% ~ (p=0.783 n=27+28)
GoParser 158ms ± 3% 158ms ± 3% ~ (p=0.261 n=28+30)
Reflect 408ms ± 7% 401ms ± 3% ~ (p=0.075 n=30+30)
Tar 123ms ± 6% 121ms ± 8% ~ (p=0.287 n=29+30)
XML 220ms ± 2% 220ms ± 4% ~ (p=0.805 n=29+29)
name old user-ns/op new user-ns/op delta
Template 281user-ms ± 4% 279user-ms ± 3% -0.87% (p=0.044 n=28+28)
Unicode 142user-ms ± 4% 141user-ms ± 3% -1.04% (p=0.015 n=30+27)
GoTypes 884user-ms ± 3% 886user-ms ± 2% ~ (p=0.532 n=30+30)
Compiler 3.94user-s ± 3% 3.92user-s ± 1% ~ (p=0.185 n=30+28)
Flate 165user-ms ± 2% 165user-ms ± 4% ~ (p=0.780 n=27+29)
GoParser 209user-ms ± 2% 208user-ms ± 3% ~ (p=0.453 n=28+30)
Reflect 533user-ms ± 6% 526user-ms ± 3% ~ (p=0.057 n=30+30)
Tar 156user-ms ± 6% 154user-ms ± 6% ~ (p=0.133 n=29+30)
XML 288user-ms ± 4% 288user-ms ± 4% ~ (p=0.633 n=30+30)
name old alloc/op new alloc/op delta
Template 41.0MB ± 0% 40.9MB ± 0% -0.11% (p=0.000 n=29+29)
Unicode 32.6MB ± 0% 32.6MB ± 0% ~ (p=0.572 n=29+30)
GoTypes 122MB ± 0% 122MB ± 0% -0.10% (p=0.000 n=30+30)
Compiler 482MB ± 0% 481MB ± 0% -0.07% (p=0.000 n=30+29)
Flate 26.6MB ± 0% 26.6MB ± 0% ~ (p=0.096 n=30+30)
GoParser 32.7MB ± 0% 32.6MB ± 0% -0.06% (p=0.011 n=28+28)
Reflect 84.2MB ± 0% 84.1MB ± 0% -0.17% (p=0.000 n=29+30)
Tar 27.7MB ± 0% 27.7MB ± 0% -0.05% (p=0.032 n=27+28)
XML 44.7MB ± 0% 44.7MB ± 0% ~ (p=0.131 n=28+30)
name old allocs/op new allocs/op delta
Template 373k ± 1% 370k ± 1% -0.76% (p=0.000 n=30+30)
Unicode 325k ± 1% 325k ± 1% ~ (p=0.383 n=29+30)
GoTypes 1.16M ± 0% 1.15M ± 0% -0.75% (p=0.000 n=29+30)
Compiler 4.15M ± 0% 4.13M ± 0% -0.59% (p=0.000 n=30+29)
Flate 238k ± 1% 237k ± 1% -0.62% (p=0.000 n=30+30)
GoParser 304k ± 1% 302k ± 1% -0.64% (p=0.000 n=30+28)
Reflect 1.00M ± 0% 0.99M ± 0% -1.10% (p=0.000 n=29+30)
Tar 245k ± 1% 244k ± 1% -0.59% (p=0.000 n=27+29)
XML 391k ± 1% 389k ± 1% -0.59% (p=0.000 n=29+30)
Change-Id: Id7f456d690567c2b0a96b0d6d64de8784b6e305f
Reviewed-on: https://go-review.googlesource.com/36476
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-02-03 22:40:56 -08:00
|
|
|
|
2018-10-29 13:54:24 -07:00
|
|
|
// Specialized type-to-interface conversion.
|
|
|
|
|
// These return only a data pointer.
|
|
|
|
|
func convT16(val any) unsafe.Pointer // val must be uint16-like (same size and alignment as a uint16)
|
|
|
|
|
func convT32(val any) unsafe.Pointer // val must be uint32-like (same size and alignment as a uint32)
|
|
|
|
|
func convT64(val any) unsafe.Pointer // val must be uint64-like (same size and alignment as a uint64 and contains no pointers)
|
|
|
|
|
func convTstring(val any) unsafe.Pointer // val must be a string
|
|
|
|
|
func convTslice(val any) unsafe.Pointer // val must be a slice
|
|
|
|
|
|
|
|
|
|
// Type to empty-interface conversion.
|
2016-09-17 15:04:36 -07:00
|
|
|
func convT2E(typ *byte, elem *any) (ret any)
|
cmd/compile, runtime: specialize convT2x, don't alloc for zero vals
Prior to this CL, all runtime conversions
from a concrete value to an interface went
through one of two runtime calls: convT2E or convT2I.
However, in practice, basic types are very common.
Specializing convT2x for those basic types allows
for a more efficient implementation for those types.
For basic scalars and strings, allocation and copying
can use the same methods as normal code.
For pointer-free types, allocation can occur without
zeroing, and copying can take place without GC calls.
For slices, copying is cheaper and simpler.
This CL adds twelve runtime routines:
convT2E16, convT2I16
convT2E32, convT2I32
convT2E64, convT2I64
convT2Estring, convT2Istring
convT2Eslice, convT2Islice
convT2Enoptr, convT2Inoptr
While compiling make.bash, 93% of all convT2x calls
are now to one of these specialized convT2x call.
Within specialized convT2x routines, it is cheap to check
for a zero value, in a way that it is not in general.
When we detect a zero value there, we return a pointer
to zeroVal, rather than allocating.
name old time/op new time/op delta
ConvT2Ezero/zero/16-8 17.9ns ± 2% 3.0ns ± 3% -83.20% (p=0.000 n=56+56)
ConvT2Ezero/zero/32-8 17.8ns ± 2% 3.0ns ± 3% -83.15% (p=0.000 n=59+60)
ConvT2Ezero/zero/64-8 20.1ns ± 1% 3.0ns ± 2% -84.98% (p=0.000 n=57+57)
ConvT2Ezero/zero/str-8 32.6ns ± 1% 3.0ns ± 4% -90.70% (p=0.000 n=59+60)
ConvT2Ezero/zero/slice-8 36.7ns ± 2% 3.0ns ± 2% -91.78% (p=0.000 n=59+59)
ConvT2Ezero/zero/big-8 91.9ns ± 2% 85.9ns ± 2% -6.52% (p=0.000 n=57+57)
ConvT2Ezero/nonzero/16-8 17.7ns ± 2% 12.7ns ± 3% -28.38% (p=0.000 n=55+60)
ConvT2Ezero/nonzero/32-8 17.8ns ± 1% 12.7ns ± 1% -28.44% (p=0.000 n=54+57)
ConvT2Ezero/nonzero/64-8 20.0ns ± 1% 15.0ns ± 1% -24.90% (p=0.000 n=56+58)
ConvT2Ezero/nonzero/str-8 32.6ns ± 1% 25.7ns ± 1% -21.17% (p=0.000 n=58+55)
ConvT2Ezero/nonzero/slice-8 36.8ns ± 2% 30.4ns ± 1% -17.32% (p=0.000 n=60+52)
ConvT2Ezero/nonzero/big-8 92.1ns ± 2% 85.9ns ± 2% -6.70% (p=0.000 n=57+59)
Benchmarks on a real program (the compiler):
name old time/op new time/op delta
Template 227ms ± 5% 221ms ± 2% -2.48% (p=0.000 n=30+26)
Unicode 102ms ± 5% 100ms ± 3% -1.30% (p=0.009 n=30+26)
GoTypes 656ms ± 5% 659ms ± 4% ~ (p=0.208 n=30+30)
Compiler 2.82s ± 2% 2.82s ± 1% ~ (p=0.614 n=29+27)
Flate 128ms ± 2% 128ms ± 5% ~ (p=0.783 n=27+28)
GoParser 158ms ± 3% 158ms ± 3% ~ (p=0.261 n=28+30)
Reflect 408ms ± 7% 401ms ± 3% ~ (p=0.075 n=30+30)
Tar 123ms ± 6% 121ms ± 8% ~ (p=0.287 n=29+30)
XML 220ms ± 2% 220ms ± 4% ~ (p=0.805 n=29+29)
name old user-ns/op new user-ns/op delta
Template 281user-ms ± 4% 279user-ms ± 3% -0.87% (p=0.044 n=28+28)
Unicode 142user-ms ± 4% 141user-ms ± 3% -1.04% (p=0.015 n=30+27)
GoTypes 884user-ms ± 3% 886user-ms ± 2% ~ (p=0.532 n=30+30)
Compiler 3.94user-s ± 3% 3.92user-s ± 1% ~ (p=0.185 n=30+28)
Flate 165user-ms ± 2% 165user-ms ± 4% ~ (p=0.780 n=27+29)
GoParser 209user-ms ± 2% 208user-ms ± 3% ~ (p=0.453 n=28+30)
Reflect 533user-ms ± 6% 526user-ms ± 3% ~ (p=0.057 n=30+30)
Tar 156user-ms ± 6% 154user-ms ± 6% ~ (p=0.133 n=29+30)
XML 288user-ms ± 4% 288user-ms ± 4% ~ (p=0.633 n=30+30)
name old alloc/op new alloc/op delta
Template 41.0MB ± 0% 40.9MB ± 0% -0.11% (p=0.000 n=29+29)
Unicode 32.6MB ± 0% 32.6MB ± 0% ~ (p=0.572 n=29+30)
GoTypes 122MB ± 0% 122MB ± 0% -0.10% (p=0.000 n=30+30)
Compiler 482MB ± 0% 481MB ± 0% -0.07% (p=0.000 n=30+29)
Flate 26.6MB ± 0% 26.6MB ± 0% ~ (p=0.096 n=30+30)
GoParser 32.7MB ± 0% 32.6MB ± 0% -0.06% (p=0.011 n=28+28)
Reflect 84.2MB ± 0% 84.1MB ± 0% -0.17% (p=0.000 n=29+30)
Tar 27.7MB ± 0% 27.7MB ± 0% -0.05% (p=0.032 n=27+28)
XML 44.7MB ± 0% 44.7MB ± 0% ~ (p=0.131 n=28+30)
name old allocs/op new allocs/op delta
Template 373k ± 1% 370k ± 1% -0.76% (p=0.000 n=30+30)
Unicode 325k ± 1% 325k ± 1% ~ (p=0.383 n=29+30)
GoTypes 1.16M ± 0% 1.15M ± 0% -0.75% (p=0.000 n=29+30)
Compiler 4.15M ± 0% 4.13M ± 0% -0.59% (p=0.000 n=30+29)
Flate 238k ± 1% 237k ± 1% -0.62% (p=0.000 n=30+30)
GoParser 304k ± 1% 302k ± 1% -0.64% (p=0.000 n=30+28)
Reflect 1.00M ± 0% 0.99M ± 0% -1.10% (p=0.000 n=29+30)
Tar 245k ± 1% 244k ± 1% -0.59% (p=0.000 n=27+29)
XML 391k ± 1% 389k ± 1% -0.59% (p=0.000 n=29+30)
Change-Id: Id7f456d690567c2b0a96b0d6d64de8784b6e305f
Reviewed-on: https://go-review.googlesource.com/36476
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-02-03 22:40:56 -08:00
|
|
|
func convT2Enoptr(typ *byte, elem *any) (ret any)
|
|
|
|
|
|
2018-10-29 13:54:24 -07:00
|
|
|
// Type to non-empty-interface conversion.
|
2016-09-17 15:04:36 -07:00
|
|
|
func convT2I(tab *byte, elem *any) (ret any)
|
cmd/compile, runtime: specialize convT2x, don't alloc for zero vals
Prior to this CL, all runtime conversions
from a concrete value to an interface went
through one of two runtime calls: convT2E or convT2I.
However, in practice, basic types are very common.
Specializing convT2x for those basic types allows
for a more efficient implementation for those types.
For basic scalars and strings, allocation and copying
can use the same methods as normal code.
For pointer-free types, allocation can occur without
zeroing, and copying can take place without GC calls.
For slices, copying is cheaper and simpler.
This CL adds twelve runtime routines:
convT2E16, convT2I16
convT2E32, convT2I32
convT2E64, convT2I64
convT2Estring, convT2Istring
convT2Eslice, convT2Islice
convT2Enoptr, convT2Inoptr
While compiling make.bash, 93% of all convT2x calls
are now to one of these specialized convT2x call.
Within specialized convT2x routines, it is cheap to check
for a zero value, in a way that it is not in general.
When we detect a zero value there, we return a pointer
to zeroVal, rather than allocating.
name old time/op new time/op delta
ConvT2Ezero/zero/16-8 17.9ns ± 2% 3.0ns ± 3% -83.20% (p=0.000 n=56+56)
ConvT2Ezero/zero/32-8 17.8ns ± 2% 3.0ns ± 3% -83.15% (p=0.000 n=59+60)
ConvT2Ezero/zero/64-8 20.1ns ± 1% 3.0ns ± 2% -84.98% (p=0.000 n=57+57)
ConvT2Ezero/zero/str-8 32.6ns ± 1% 3.0ns ± 4% -90.70% (p=0.000 n=59+60)
ConvT2Ezero/zero/slice-8 36.7ns ± 2% 3.0ns ± 2% -91.78% (p=0.000 n=59+59)
ConvT2Ezero/zero/big-8 91.9ns ± 2% 85.9ns ± 2% -6.52% (p=0.000 n=57+57)
ConvT2Ezero/nonzero/16-8 17.7ns ± 2% 12.7ns ± 3% -28.38% (p=0.000 n=55+60)
ConvT2Ezero/nonzero/32-8 17.8ns ± 1% 12.7ns ± 1% -28.44% (p=0.000 n=54+57)
ConvT2Ezero/nonzero/64-8 20.0ns ± 1% 15.0ns ± 1% -24.90% (p=0.000 n=56+58)
ConvT2Ezero/nonzero/str-8 32.6ns ± 1% 25.7ns ± 1% -21.17% (p=0.000 n=58+55)
ConvT2Ezero/nonzero/slice-8 36.8ns ± 2% 30.4ns ± 1% -17.32% (p=0.000 n=60+52)
ConvT2Ezero/nonzero/big-8 92.1ns ± 2% 85.9ns ± 2% -6.70% (p=0.000 n=57+59)
Benchmarks on a real program (the compiler):
name old time/op new time/op delta
Template 227ms ± 5% 221ms ± 2% -2.48% (p=0.000 n=30+26)
Unicode 102ms ± 5% 100ms ± 3% -1.30% (p=0.009 n=30+26)
GoTypes 656ms ± 5% 659ms ± 4% ~ (p=0.208 n=30+30)
Compiler 2.82s ± 2% 2.82s ± 1% ~ (p=0.614 n=29+27)
Flate 128ms ± 2% 128ms ± 5% ~ (p=0.783 n=27+28)
GoParser 158ms ± 3% 158ms ± 3% ~ (p=0.261 n=28+30)
Reflect 408ms ± 7% 401ms ± 3% ~ (p=0.075 n=30+30)
Tar 123ms ± 6% 121ms ± 8% ~ (p=0.287 n=29+30)
XML 220ms ± 2% 220ms ± 4% ~ (p=0.805 n=29+29)
name old user-ns/op new user-ns/op delta
Template 281user-ms ± 4% 279user-ms ± 3% -0.87% (p=0.044 n=28+28)
Unicode 142user-ms ± 4% 141user-ms ± 3% -1.04% (p=0.015 n=30+27)
GoTypes 884user-ms ± 3% 886user-ms ± 2% ~ (p=0.532 n=30+30)
Compiler 3.94user-s ± 3% 3.92user-s ± 1% ~ (p=0.185 n=30+28)
Flate 165user-ms ± 2% 165user-ms ± 4% ~ (p=0.780 n=27+29)
GoParser 209user-ms ± 2% 208user-ms ± 3% ~ (p=0.453 n=28+30)
Reflect 533user-ms ± 6% 526user-ms ± 3% ~ (p=0.057 n=30+30)
Tar 156user-ms ± 6% 154user-ms ± 6% ~ (p=0.133 n=29+30)
XML 288user-ms ± 4% 288user-ms ± 4% ~ (p=0.633 n=30+30)
name old alloc/op new alloc/op delta
Template 41.0MB ± 0% 40.9MB ± 0% -0.11% (p=0.000 n=29+29)
Unicode 32.6MB ± 0% 32.6MB ± 0% ~ (p=0.572 n=29+30)
GoTypes 122MB ± 0% 122MB ± 0% -0.10% (p=0.000 n=30+30)
Compiler 482MB ± 0% 481MB ± 0% -0.07% (p=0.000 n=30+29)
Flate 26.6MB ± 0% 26.6MB ± 0% ~ (p=0.096 n=30+30)
GoParser 32.7MB ± 0% 32.6MB ± 0% -0.06% (p=0.011 n=28+28)
Reflect 84.2MB ± 0% 84.1MB ± 0% -0.17% (p=0.000 n=29+30)
Tar 27.7MB ± 0% 27.7MB ± 0% -0.05% (p=0.032 n=27+28)
XML 44.7MB ± 0% 44.7MB ± 0% ~ (p=0.131 n=28+30)
name old allocs/op new allocs/op delta
Template 373k ± 1% 370k ± 1% -0.76% (p=0.000 n=30+30)
Unicode 325k ± 1% 325k ± 1% ~ (p=0.383 n=29+30)
GoTypes 1.16M ± 0% 1.15M ± 0% -0.75% (p=0.000 n=29+30)
Compiler 4.15M ± 0% 4.13M ± 0% -0.59% (p=0.000 n=30+29)
Flate 238k ± 1% 237k ± 1% -0.62% (p=0.000 n=30+30)
GoParser 304k ± 1% 302k ± 1% -0.64% (p=0.000 n=30+28)
Reflect 1.00M ± 0% 0.99M ± 0% -1.10% (p=0.000 n=29+30)
Tar 245k ± 1% 244k ± 1% -0.59% (p=0.000 n=27+29)
XML 391k ± 1% 389k ± 1% -0.59% (p=0.000 n=29+30)
Change-Id: Id7f456d690567c2b0a96b0d6d64de8784b6e305f
Reviewed-on: https://go-review.googlesource.com/36476
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-02-03 22:40:56 -08:00
|
|
|
func convT2Inoptr(tab *byte, elem *any) (ret any)
|
2015-02-27 17:40:34 +09:00
|
|
|
|
2017-08-19 22:33:51 +02:00
|
|
|
// interface type assertions x.(T)
|
2016-10-28 11:37:45 -07:00
|
|
|
func assertE2I(typ *byte, iface any) (ret any)
|
|
|
|
|
func assertE2I2(typ *byte, iface any) (ret any, b bool)
|
|
|
|
|
func assertI2I(typ *byte, iface any) (ret any)
|
|
|
|
|
func assertI2I2(typ *byte, iface any) (ret any, b bool)
|
2017-01-03 16:15:38 -08:00
|
|
|
func panicdottypeE(have, want, iface *byte)
|
|
|
|
|
func panicdottypeI(have, want, iface *byte)
|
2016-10-28 11:37:45 -07:00
|
|
|
func panicnildottype(want *byte)
|
2015-02-27 17:40:34 +09:00
|
|
|
|
2017-03-24 14:03:15 -07:00
|
|
|
// interface equality. Type/itab pointers are already known to be equal, so
|
|
|
|
|
// we only need to pass one.
|
|
|
|
|
func ifaceeq(tab *uintptr, x, y unsafe.Pointer) (ret bool)
|
|
|
|
|
func efaceeq(typ *uintptr, x, y unsafe.Pointer) (ret bool)
|
2015-02-27 17:40:34 +09:00
|
|
|
|
2017-09-02 18:46:59 +02:00
|
|
|
func fastrand() uint32
|
|
|
|
|
|
2015-02-27 17:40:34 +09:00
|
|
|
// *byte is really *runtime.Type
|
2017-08-14 10:16:21 +02:00
|
|
|
func makemap64(mapType *byte, hint int64, mapbuf *any) (hmap map[any]any)
|
|
|
|
|
func makemap(mapType *byte, hint int, mapbuf *any) (hmap map[any]any)
|
2017-09-02 18:46:59 +02:00
|
|
|
func makemap_small() (hmap map[any]any)
|
2015-02-27 17:40:34 +09:00
|
|
|
func mapaccess1(mapType *byte, hmap map[any]any, key *any) (val *any)
|
|
|
|
|
func mapaccess1_fast32(mapType *byte, hmap map[any]any, key any) (val *any)
|
|
|
|
|
func mapaccess1_fast64(mapType *byte, hmap map[any]any, key any) (val *any)
|
|
|
|
|
func mapaccess1_faststr(mapType *byte, hmap map[any]any, key any) (val *any)
|
2016-04-19 08:31:04 -07:00
|
|
|
func mapaccess1_fat(mapType *byte, hmap map[any]any, key *any, zero *byte) (val *any)
|
2015-02-27 17:40:34 +09:00
|
|
|
func mapaccess2(mapType *byte, hmap map[any]any, key *any) (val *any, pres bool)
|
|
|
|
|
func mapaccess2_fast32(mapType *byte, hmap map[any]any, key any) (val *any, pres bool)
|
|
|
|
|
func mapaccess2_fast64(mapType *byte, hmap map[any]any, key any) (val *any, pres bool)
|
|
|
|
|
func mapaccess2_faststr(mapType *byte, hmap map[any]any, key any) (val *any, pres bool)
|
2016-04-19 08:31:04 -07:00
|
|
|
func mapaccess2_fat(mapType *byte, hmap map[any]any, key *any, zero *byte) (val *any, pres bool)
|
2016-10-11 08:36:38 -07:00
|
|
|
func mapassign(mapType *byte, hmap map[any]any, key *any) (val *any)
|
2017-03-12 14:47:59 -07:00
|
|
|
func mapassign_fast32(mapType *byte, hmap map[any]any, key any) (val *any)
|
2017-11-21 07:14:11 -08:00
|
|
|
func mapassign_fast32ptr(mapType *byte, hmap map[any]any, key any) (val *any)
|
2017-03-12 14:47:59 -07:00
|
|
|
func mapassign_fast64(mapType *byte, hmap map[any]any, key any) (val *any)
|
2017-11-21 07:14:11 -08:00
|
|
|
func mapassign_fast64ptr(mapType *byte, hmap map[any]any, key any) (val *any)
|
2017-03-12 14:47:59 -07:00
|
|
|
func mapassign_faststr(mapType *byte, hmap map[any]any, key any) (val *any)
|
2016-02-23 07:46:01 +00:00
|
|
|
func mapiterinit(mapType *byte, hmap map[any]any, hiter *any)
|
2015-02-27 17:40:34 +09:00
|
|
|
func mapdelete(mapType *byte, hmap map[any]any, key *any)
|
2017-03-14 11:11:28 -07:00
|
|
|
func mapdelete_fast32(mapType *byte, hmap map[any]any, key any)
|
|
|
|
|
func mapdelete_fast64(mapType *byte, hmap map[any]any, key any)
|
|
|
|
|
func mapdelete_faststr(mapType *byte, hmap map[any]any, key any)
|
2016-02-23 07:46:01 +00:00
|
|
|
func mapiternext(hiter *any)
|
2018-04-27 21:58:59 +02:00
|
|
|
func mapclear(mapType *byte, hmap map[any]any)
|
2015-02-27 17:40:34 +09:00
|
|
|
|
|
|
|
|
// *byte is really *runtime.Type
|
2017-08-13 20:03:02 +02:00
|
|
|
func makechan64(chanType *byte, size int64) (hchan chan any)
|
|
|
|
|
func makechan(chanType *byte, size int) (hchan chan any)
|
2017-03-18 15:55:41 +00:00
|
|
|
func chanrecv1(hchan <-chan any, elem *any)
|
|
|
|
|
func chanrecv2(hchan <-chan any, elem *any) bool
|
|
|
|
|
func chansend1(hchan chan<- any, elem *any)
|
2015-02-27 17:40:34 +09:00
|
|
|
func closechan(hchan any)
|
|
|
|
|
|
2015-11-13 17:45:22 -08:00
|
|
|
var writeBarrier struct {
|
|
|
|
|
enabled bool
|
2017-02-21 15:57:06 -08:00
|
|
|
pad [3]byte
|
2015-11-13 17:45:22 -08:00
|
|
|
needed bool
|
|
|
|
|
cgo bool
|
2017-02-21 15:57:06 -08:00
|
|
|
alignme uint64
|
2015-11-13 17:45:22 -08:00
|
|
|
}
|
cmd/internal/gc: inline writeBarrierEnabled check before calling writebarrierptr
I believe the benchmarks that get slower are under register pressure,
and not making the call unconditionally makes the pressure worse,
and the register allocator doesn't do a great job. But part of the point
of this sequence is to get the write barriers out of the way so I can work
on the register allocator, so that's okay.
name old new delta
BenchmarkBinaryTree17 17.9s × (1.00,1.01) 18.0s × (0.99,1.01) ~
BenchmarkFannkuch11 4.43s × (1.00,1.00) 4.43s × (1.00,1.00) ~
BenchmarkFmtFprintfEmpty 110ns × (1.00,1.06) 114ns × (0.95,1.05) ~
BenchmarkFmtFprintfString 487ns × (0.99,1.00) 468ns × (0.99,1.01) -4.00%
BenchmarkFmtFprintfInt 450ns × (0.99,1.00) 433ns × (1.00,1.01) -3.88%
BenchmarkFmtFprintfIntInt 762ns × (1.00,1.00) 748ns × (0.99,1.01) -1.84%
BenchmarkFmtFprintfPrefixedInt 584ns × (0.99,1.01) 547ns × (0.99,1.01) -6.26%
BenchmarkFmtFprintfFloat 738ns × (1.00,1.00) 756ns × (1.00,1.01) +2.37%
BenchmarkFmtManyArgs 2.80µs × (1.00,1.01) 2.79µs × (1.00,1.01) ~
BenchmarkGobDecode 39.0ms × (0.99,1.00) 39.6ms × (0.99,1.00) +1.54%
BenchmarkGobEncode 37.8ms × (0.98,1.01) 37.6ms × (1.00,1.01) ~
BenchmarkGzip 661ms × (0.99,1.01) 663ms × (0.99,1.02) ~
BenchmarkGunzip 142ms × (1.00,1.00) 142ms × (1.00,1.00) ~
BenchmarkHTTPClientServer 132µs × (0.99,1.01) 132µs × (0.99,1.01) ~
BenchmarkJSONEncode 56.3ms × (0.99,1.01) 56.2ms × (0.99,1.01) ~
BenchmarkJSONDecode 138ms × (0.99,1.01) 138ms × (1.00,1.00) ~
BenchmarkMandelbrot200 6.01ms × (1.00,1.00) 6.03ms × (1.00,1.01) +0.23%
BenchmarkGoParse 10.2ms × (0.87,1.05) 9.8ms × (0.93,1.10) ~
BenchmarkRegexpMatchEasy0_32 208ns × (1.00,1.00) 207ns × (1.00,1.00) ~
BenchmarkRegexpMatchEasy0_1K 588ns × (1.00,1.00) 581ns × (1.00,1.01) -1.27%
BenchmarkRegexpMatchEasy1_32 182ns × (0.99,1.01) 185ns × (0.99,1.01) +1.65%
BenchmarkRegexpMatchEasy1_1K 986ns × (1.00,1.01) 975ns × (1.00,1.01) -1.17%
BenchmarkRegexpMatchMedium_32 323ns × (1.00,1.01) 328ns × (0.99,1.00) +1.55%
BenchmarkRegexpMatchMedium_1K 89.9µs × (1.00,1.00) 88.6µs × (1.00,1.01) -1.38%
BenchmarkRegexpMatchHard_32 4.72µs × (0.95,1.01) 4.69µs × (0.95,1.03) ~
BenchmarkRegexpMatchHard_1K 133µs × (1.00,1.01) 133µs × (1.00,1.01) ~
BenchmarkRevcomp 900ms × (1.00,1.05) 902ms × (0.99,1.05) ~
BenchmarkTemplate 168ms × (0.99,1.01) 174ms × (0.99,1.01) +3.30%
BenchmarkTimeParse 637ns × (1.00,1.00) 639ns × (1.00,1.00) +0.31%
BenchmarkTimeFormat 738ns × (1.00,1.00) 736ns × (1.00,1.01) ~
Change-Id: I03ce152852edec404538f6c20eb650fac82e2aa2
Reviewed-on: https://go-review.googlesource.com/9224
Reviewed-by: Austin Clements <austin@google.com>
2015-04-24 14:13:06 -04:00
|
|
|
|
|
|
|
|
// *byte is really *runtime.Type
|
2015-02-27 17:40:34 +09:00
|
|
|
func typedmemmove(typ *byte, dst *any, src *any)
|
2016-10-17 18:41:56 -04:00
|
|
|
func typedmemclr(typ *byte, dst *any)
|
2015-02-27 17:40:34 +09:00
|
|
|
func typedslicecopy(typ *byte, dst any, src any) int
|
|
|
|
|
|
2017-03-18 15:55:41 +00:00
|
|
|
func selectnbsend(hchan chan<- any, elem *any) bool
|
|
|
|
|
func selectnbrecv(elem *any, hchan <-chan any) bool
|
|
|
|
|
func selectnbrecv2(elem *any, received *bool, hchan <-chan any) bool
|
2015-02-27 17:40:34 +09:00
|
|
|
|
2017-03-07 14:26:27 -08:00
|
|
|
func selectsetpc(cas *byte)
|
2017-03-07 15:12:11 -08:00
|
|
|
func selectgo(cas0 *byte, order0 *byte, ncases int) (int, bool)
|
2015-02-27 17:40:34 +09:00
|
|
|
func block()
|
|
|
|
|
|
2018-10-14 22:28:58 +02:00
|
|
|
func makeslice(typ *byte, len int, cap int) unsafe.Pointer
|
|
|
|
|
func makeslice64(typ *byte, len int64, cap int64) unsafe.Pointer
|
2015-06-25 19:27:20 -04:00
|
|
|
func growslice(typ *byte, old []any, cap int) (ary []any)
|
2015-02-27 17:40:34 +09:00
|
|
|
func memmove(to *any, frm *any, length uintptr)
|
2017-02-19 23:40:24 -05:00
|
|
|
func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr)
|
|
|
|
|
func memclrHasPointers(ptr unsafe.Pointer, n uintptr)
|
2015-02-27 17:40:34 +09:00
|
|
|
|
|
|
|
|
func memequal(x, y *any, size uintptr) bool
|
|
|
|
|
func memequal8(x, y *any) bool
|
|
|
|
|
func memequal16(x, y *any) bool
|
|
|
|
|
func memequal32(x, y *any) bool
|
|
|
|
|
func memequal64(x, y *any) bool
|
|
|
|
|
func memequal128(x, y *any) bool
|
|
|
|
|
|
|
|
|
|
// only used on 32-bit
|
|
|
|
|
func int64div(int64, int64) int64
|
|
|
|
|
func uint64div(uint64, uint64) uint64
|
|
|
|
|
func int64mod(int64, int64) int64
|
|
|
|
|
func uint64mod(uint64, uint64) uint64
|
|
|
|
|
func float64toint64(float64) int64
|
|
|
|
|
func float64touint64(float64) uint64
|
2016-07-21 10:37:59 -07:00
|
|
|
func float64touint32(float64) uint32
|
2015-02-27 17:40:34 +09:00
|
|
|
func int64tofloat64(int64) float64
|
|
|
|
|
func uint64tofloat64(uint64) float64
|
2016-07-21 10:37:59 -07:00
|
|
|
func uint32tofloat64(uint32) float64
|
2015-02-27 17:40:34 +09:00
|
|
|
|
|
|
|
|
func complex128div(num complex128, den complex128) (quo complex128)
|
|
|
|
|
|
|
|
|
|
// race detection
|
|
|
|
|
func racefuncenter(uintptr)
|
2018-03-29 11:15:18 -04:00
|
|
|
func racefuncenterfp()
|
2015-02-27 17:40:34 +09:00
|
|
|
func racefuncexit()
|
|
|
|
|
func raceread(uintptr)
|
|
|
|
|
func racewrite(uintptr)
|
|
|
|
|
func racereadrange(addr, size uintptr)
|
|
|
|
|
func racewriterange(addr, size uintptr)
|
2015-10-21 07:04:10 -07:00
|
|
|
|
|
|
|
|
// memory sanitizer
|
|
|
|
|
func msanread(addr, size uintptr)
|
|
|
|
|
func msanwrite(addr, size uintptr)
|
2017-03-16 21:33:03 -07:00
|
|
|
|
|
|
|
|
// architecture variants
|
2018-11-06 17:00:04 +01:00
|
|
|
var x86HasPOPCNT bool
|
|
|
|
|
var x86HasSSE41 bool
|
|
|
|
|
var arm64HasATOMICS bool
|