go/test
Junxian Zhu f0d575c266 cmd/compile: optimize math.Float64(32)bits and math.Float64(32)frombits on mips64x
This CL use MFC1/MTC1 instructions to move data between GPR and FPR instead of stores and loads to move float/int values.

goos: linux
goarch: mips64le
pkg: math
                      │   oldmath    │              newmath               │
                      │    sec/op    │   sec/op     vs base               │
Acos-4                   258.2n ± 0%   258.2n ± 0%        ~ (p=0.859 n=8)
Acosh-4                  378.7n ± 0%   323.9n ± 0%  -14.47% (p=0.000 n=8)
Asin-4                   255.1n ± 2%   255.5n ± 0%   +0.16% (p=0.002 n=8)
Asinh-4                  407.1n ± 0%   348.7n ± 0%  -14.35% (p=0.000 n=8)
Atan-4                   189.5n ± 0%   189.9n ± 3%        ~ (p=0.205 n=8)
Atanh-4                  355.6n ± 0%   323.4n ± 2%   -9.03% (p=0.000 n=8)
Atan2-4                  284.1n ± 7%   280.1n ± 4%        ~ (p=0.313 n=8)
Cbrt-4                   314.3n ± 0%   236.4n ± 0%  -24.79% (p=0.000 n=8)
Ceil-4                   144.3n ± 3%   139.6n ± 0%        ~ (p=0.069 n=8)
Compare-4               21.100n ± 0%   7.035n ± 0%  -66.66% (p=0.000 n=8)
Compare32-4             20.100n ± 0%   6.030n ± 0%  -70.00% (p=0.000 n=8)
Copysign-4              34.970n ± 0%   6.221n ± 0%  -82.21% (p=0.000 n=8)
Cos-4                    183.4n ± 3%   184.1n ± 5%        ~ (p=0.159 n=8)
Cosh-4                   487.9n ± 2%   419.6n ± 0%  -14.00% (p=0.000 n=8)
Erf-4                    160.6n ± 0%   157.9n ± 0%   -1.68% (p=0.009 n=8)
Erfc-4                   183.7n ± 4%   169.8n ± 0%   -7.54% (p=0.000 n=8)
Erfinv-4                 191.5n ± 4%   183.6n ± 0%   -4.13% (p=0.023 n=8)
Erfcinv-4                192.0n ± 7%   184.3n ± 0%        ~ (p=0.425 n=8)
Exp-4                    398.2n ± 0%   340.1n ± 4%  -14.58% (p=0.000 n=8)
ExpGo-4                  383.3n ± 0%   327.3n ± 0%  -14.62% (p=0.000 n=8)
Expm1-4                  248.7n ± 5%   216.0n ± 0%  -13.11% (p=0.000 n=8)
Exp2-4                   372.8n ± 0%   316.9n ± 3%  -14.98% (p=0.000 n=8)
Exp2Go-4                 374.1n ± 0%   320.5n ± 0%  -14.33% (p=0.000 n=8)
Abs-4                    3.013n ± 0%   3.016n ± 0%   +0.10% (p=0.020 n=8)
Dim-4                    5.021n ± 0%   5.022n ± 0%        ~ (p=0.270 n=8)
Floor-4                  127.5n ± 4%   126.2n ± 3%        ~ (p=0.186 n=8)
Max-4                    72.32n ± 0%   61.33n ± 0%  -15.20% (p=0.000 n=8)
Min-4                    83.33n ± 1%   61.36n ± 0%  -26.37% (p=0.000 n=8)
Mod-4                    690.7n ± 0%   454.5n ± 0%  -34.20% (p=0.000 n=8)
Frexp-4                 116.30n ± 1%   71.80n ± 1%  -38.26% (p=0.000 n=8)
Gamma-4                  389.0n ± 0%   355.9n ± 1%   -8.48% (p=0.000 n=8)
Hypot-4                 102.40n ± 0%   83.90n ± 0%  -18.07% (p=0.000 n=8)
HypotGo-4               105.45n ± 4%   84.82n ± 2%  -19.56% (p=0.000 n=8)
Ilogb-4                  99.13n ± 4%   63.71n ± 2%  -35.73% (p=0.000 n=8)
J0-4                     859.7n ± 0%   854.8n ± 0%   -0.57% (p=0.000 n=8)
J1-4                     873.9n ± 0%   875.7n ± 0%   +0.21% (p=0.007 n=8)
Jn-4                     1.855µ ± 0%   1.867µ ± 0%   +0.65% (p=0.000 n=8)
Ldexp-4                 130.50n ± 2%   64.35n ± 0%  -50.69% (p=0.000 n=8)
Lgamma-4                 208.8n ± 0%   200.9n ± 0%   -3.78% (p=0.000 n=8)
Log-4                    294.1n ± 0%   255.2n ± 3%  -13.22% (p=0.000 n=8)
Logb-4                  105.45n ± 1%   66.81n ± 1%  -36.64% (p=0.000 n=8)
Log1p-4                  268.2n ± 0%   211.3n ± 0%  -21.21% (p=0.000 n=8)
Log10-4                  295.4n ± 0%   255.2n ± 2%  -13.59% (p=0.000 n=8)
Log2-4                   152.9n ± 1%   127.5n ± 0%  -16.61% (p=0.000 n=8)
Modf-4                  103.40n ± 0%   75.36n ± 0%  -27.12% (p=0.000 n=8)
Nextafter32-4           121.20n ± 1%   78.40n ± 0%  -35.31% (p=0.000 n=8)
Nextafter64-4           110.40n ± 1%   64.91n ± 0%  -41.20% (p=0.000 n=8)
PowInt-4                 509.8n ± 1%   369.3n ± 1%  -27.56% (p=0.000 n=8)
PowFrac-4               1189.0n ± 0%   947.8n ± 0%  -20.29% (p=0.000 n=8)
Pow10Pos-4               15.07n ± 0%   15.07n ± 0%        ~ (p=0.733 n=8)
Pow10Neg-4               20.10n ± 0%   20.10n ± 0%        ~ (p=0.576 n=8)
Round-4                  44.22n ± 0%   26.12n ± 0%  -40.92% (p=0.000 n=8)
RoundToEven-4            46.22n ± 0%   27.12n ± 0%  -41.31% (p=0.000 n=8)
Remainder-4              539.0n ± 1%   417.1n ± 1%  -22.62% (p=0.000 n=8)
Signbit-4               17.985n ± 0%   5.694n ± 0%  -68.34% (p=0.000 n=8)
Sin-4                    185.7n ± 5%   172.9n ± 0%   -6.89% (p=0.001 n=8)
Sincos-4                 176.6n ± 0%   200.9n ± 0%  +13.76% (p=0.000 n=8)
Sinh-4                   495.8n ± 0%   435.9n ± 0%  -12.09% (p=0.000 n=8)
SqrtIndirect-4           5.022n ± 0%   5.024n ± 0%        ~ (p=0.083 n=8)
SqrtLatency-4            8.038n ± 0%   8.044n ± 0%        ~ (p=0.524 n=8)
SqrtIndirectLatency-4    8.035n ± 0%   8.039n ± 0%   +0.06% (p=0.017 n=8)
SqrtGoLatency-4          340.1n ± 0%   278.3n ± 0%  -18.19% (p=0.000 n=8)
SqrtPrime-4              5.381µ ± 0%   5.386µ ± 0%        ~ (p=0.662 n=8)
Tan-4                    198.6n ± 1%   183.1n ± 0%   -7.85% (p=0.000 n=8)
Tanh-4                   491.3n ± 1%   440.8n ± 1%  -10.29% (p=0.000 n=8)
Trunc-4                  121.7n ± 0%   121.7n ± 0%        ~ (p=0.769 n=8)
Y0-4                     855.1n ± 0%   859.8n ± 0%   +0.54% (p=0.007 n=8)
Y1-4                     862.3n ± 0%   865.1n ± 0%   +0.32% (p=0.007 n=8)
Yn-4                     1.830µ ± 0%   1.837µ ± 0%   +0.36% (p=0.011 n=8)
Float64bits-4           13.060n ± 0%   3.016n ± 0%  -76.91% (p=0.000 n=8)
Float64frombits-4       13.060n ± 0%   3.018n ± 0%  -76.90% (p=0.000 n=8)
Float32bits-4           13.060n ± 0%   3.016n ± 0%  -76.91% (p=0.000 n=8)
Float32frombits-4       13.070n ± 0%   3.013n ± 0%  -76.94% (p=0.000 n=8)
FMA-4                    446.0n ± 0%   413.1n ± 1%   -7.38% (p=0.000 n=8)
geomean                  143.4n        108.3n       -24.49%

Change-Id: I2067f7a5ae1126ada7ab3fb2083710e8212535e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/493815
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2023-05-24 03:36:31 +00:00
..
abi
alias3.dir
asmhdr.dir
chan
closure3.dir cmd/compile: incorporate inlined function names into closure naming 2023-05-22 22:47:15 +00:00
closure5.dir
codegen cmd/compile: optimize math.Float64(32)bits and math.Float64(32)frombits on mips64x 2023-05-24 03:36:31 +00:00
ddd2.dir
dwarf
fixedbugs cmd/compile: enable more lenient type inference for untyped arguments 2023-05-18 00:35:53 +00:00
import2.dir
import4.dir go/types, types2: use "and not used" instead of "but not used" in error messages 2022-09-27 21:10:19 +00:00
interface go/types, types2: more systematic use of Checker.use und useLHS 2023-03-28 14:28:33 +00:00
intrinsic.dir runtime: replace all uses of CtzXX with TrailingZerosXX 2022-10-18 18:06:27 +00:00
ken
linkname.dir
method4.dir
retjmp.dir
runtime
stress
syntax go/parser: adjustments to error messages 2022-09-01 22:37:04 +00:00
typeparam cmd/compile: constant-fold loads from constant dictionaries and types 2023-05-19 18:10:11 +00:00
uintptrescapes.dir
64bit.go
235.go
alg.go
alias.go
alias1.go
alias2.go cmd/compile: use "cannot use %s as %s value in %s: %s" error message 2022-09-28 22:28:39 +00:00
alias3.go
align.go
append.go
append1.go cmd/compile: use "cannot use %s as %s value in %s: %s" error message 2022-09-28 22:28:39 +00:00
args.go
armimm.go
asmhdr.go
assign.go
assign1.go
atomicload.go
bigalg.go
bigmap.go
blank.go
blank1.go
bom.go
bombad.go
bounds.go
cannotassign.go
chancap.go
chanlinear.go
char_lit.go
char_lit1.go
checkbce.go cmd/compile: sparse conditional constant propagation 2023-05-24 02:54:03 +00:00
clear.go cmd/compile: add clear(x) builtin 2023-01-31 19:43:07 +00:00
clearfat.go
closedchan.go
closure.go
closure1.go
closure2.go cmd/compile: experimental loop iterator capture semantics change 2023-03-06 18:34:24 +00:00
closure3.go
closure4.go
closure5.go
closure6.go
closure7.go
cmp.go
cmp6.go
cmplx.go
cmplxdivide.c
cmplxdivide.go
cmplxdivide1.go
complit.go
complit1.go
compos.go
const.go
const1.go
const2.go
const3.go
const4.go
const5.go
const6.go
const7.go all: add wasip1 support 2023-04-11 20:56:32 +00:00
const8.go test: add more tests for const decls with ommitted RHS expressions 2022-06-28 18:11:31 +00:00
convert.go
convert1.go
convert2.go go/types, types2: implement slice-to-array conversions 2022-09-08 15:55:44 +00:00
convert3.go
convert4.go cmd/compile: implement slice-to-array conversions 2022-09-19 18:58:26 +00:00
convinline.go cmd/compile: handle integer conversions in static init inliner 2022-11-17 13:46:05 +00:00
convlit.go
convlit1.go
convT2X.go
copy.go
copy1.go
crlf.go
ddd.go
ddd1.go cmd/compile: use "cannot use %s as %s value in %s: %s" error message 2022-09-28 22:28:39 +00:00
ddd2.go
decl.go
declbad.go
defer.go
defererrcheck.go
deferfin.go
defernil.go
deferprint.go
deferprint.out
devirt.go
directive.go cmd/compile: restrict //go:notinheap to runtime/internal/sys 2022-09-02 06:22:23 +00:00
directive2.go cmd/compile: restrict //go:notinheap to runtime/internal/sys 2022-09-02 06:22:23 +00:00
divide.go
divmod.go
embedfunc.go
embedvers.go
empty.go
env.go test,internal/testdir: don't set GOOS/GOARCH 2023-05-12 12:34:59 +00:00
eof.go
eof1.go
escape.go cmd/compile: experimental loop iterator capture semantics change 2023-03-06 18:34:24 +00:00
escape2.go
escape2n.go
escape3.go
escape4.go test: enable inlining tests for functions with local type 2023-01-31 20:36:55 +00:00
escape5.go
escape_array.go
escape_calls.go
escape_closure.go
escape_field.go
escape_goto.go
escape_hash_maphash.go
escape_iface.go test: remove *_unified.go variants 2023-05-23 17:16:35 +00:00
escape_indir.go
escape_level.go
escape_map.go
escape_param.go
escape_reflect.go test: add escape test for reflect.Value operations 2023-05-12 23:13:19 +00:00
escape_runtime_atomic.go
escape_selfassign.go
escape_slice.go cmd/compile: implement slice-to-array conversions 2022-09-19 18:58:26 +00:00
escape_struct_param1.go
escape_struct_param2.go
escape_struct_return.go
escape_sync_atomic.go
escape_unsafe.go test: fix typo in escape_unsafe.go 2022-09-07 17:25:59 +00:00
fibo.go
finprofiled.go
float_lit.go
float_lit2.go
float_lit3.go
floatcmp.go
for.go
func.go
func1.go
func2.go
func3.go
func4.go
func5.go
func6.go
func7.go
func8.go
funcdup.go
funcdup2.go
fuse.go
gc.go
gc1.go
gc2.go
gcgort.go
gcstring.go
goprint.go
goprint.out
goto.go
heapsampling.go test/heapsampling.go: slow down allocation rate and reduce iterations 2022-05-27 21:36:06 +00:00
helloworld.go
helloworld.out
if.go
import.go
import1.go go/types, types2: use "and not used" instead of "but not used" in error messages 2022-09-27 21:10:19 +00:00
import2.go
import4.go
import5.go
import6.go
index.go
index0.go
index1.go
index2.go
indirect.go
indirect1.go
init.go
init1.go
initcomma.go
initexp.go cmd/compile: use "init... cycle" instead of "init... loop" in error messages 2022-09-23 20:27:09 +00:00
initialize.go cmd/compile: handle simple inlined calls in staticinit 2022-11-16 04:04:52 +00:00
initializerr.go
initloop.go
inline.go test: remove *_unified.go variants 2023-05-23 17:16:35 +00:00
inline_big.go cmd/compile: flag 'large' functions when -m=2+ in effect 2023-01-24 13:28:54 +00:00
inline_caller.go
inline_callers.go
inline_endian.go cmd/compile: make encoding/binary appends cheaper to inline 2022-09-15 21:05:02 +00:00
inline_literal.go
inline_math_bits_rotate.go
inline_sync.go reflect: do not escape Value.Type 2023-05-12 21:11:51 +00:00
inline_variadic.go
int_lit.go
intcvt.go
intrinsic.go
intrinsic_atomic.go misc, test: fix test error for loong64 2022-05-20 16:16:37 +00:00
iota.go
label.go
label1.go
linkmain.go
linkmain_run.go all: add wasip1 support 2023-04-11 20:56:32 +00:00
linkname.go
linkname3.go
linkobj.go all: add wasip1 support 2023-04-11 20:56:32 +00:00
linkx.go
linkx_run.go all: add wasip1 support 2023-04-11 20:56:32 +00:00
literal.go
literal2.go
live.go cmd/compile: sort liveness variable reports 2023-01-21 21:08:00 +00:00
live1.go
live2.go
live_regabi.go test: test that we schedule OpArgIntReg early 2023-01-21 21:08:30 +00:00
live_uintptrkeepalive.go all: add wasip1 support 2023-04-11 20:56:32 +00:00
loopbce.go cmd/compile: sparse conditional constant propagation 2023-05-24 02:54:03 +00:00
mainsig.go
makechan.go
makemap.go
makenew.go
makeslice.go
mallocfin.go
map.go
map1.go
mapclear.go
maplinear.go
maymorestack.go
mergemul.go
method.go
method1.go cmd/compile: use "method T.m already declared" for method redeclaration errors 2022-09-27 21:59:19 +00:00
method2.go
method3.go
method4.go
method5.go
method6.go
method7.go
named.go
named1.go
nil.go
nilcheck.go [dev.unified] test: tweak nilcheck test 2022-06-30 18:41:59 +00:00
nilptr.go
nilptr2.go
nilptr3.go cmd/compile: casts from slices to array pointers are known to be non-nil 2023-03-29 21:55:11 +00:00
nilptr4.go
nilptr5.go cmd/compile: handle partially overlapping assignments 2022-08-23 19:56:32 +00:00
nilptr5_aix.go
nilptr5_wasm.go
nilptr_aix.go
noinit.go cmd/compile: reenable inline static init 2023-04-14 17:57:36 +00:00
nosplit.go runtime, cmd: rationalize StackLimit and StackGuard 2023-04-21 19:28:56 +00:00
nowritebarrier.go
nul1.go
opt_branchlikely.go
parentype.go
peano.go
phiopt.go
print.go
print.out
printbig.go
printbig.out
prove.go cmd/compile: teach prove about bitwise OR operation 2023-04-10 17:13:41 +00:00
prove_constant_folding.go cmd/compile: fold constants found by prove 2022-05-04 20:30:17 +00:00
range.go
README.md internal/testdir: move to cmd/internal/testdir 2023-05-12 17:18:08 +00:00
recover.go
recover1.go
recover2.go
recover3.go
recover4.go
recover5.go
reflectmethod1.go
reflectmethod2.go
reflectmethod3.go
reflectmethod4.go
reflectmethod5.go
reflectmethod6.go
reflectmethod7.go
reflectmethod8.go
rename.go
rename1.go cmd/compile/internal/types2: only mark variables as used if they are 2023-04-19 14:07:00 +00:00
reorder.go
reorder2.go
retjmp.go
return.go
rotate.go
rotate0.go
rotate1.go
rotate2.go
rotate3.go
rune.go
runtime.go
shift1.go
shift2.go
shift3.go
sieve.go
sigchld.go all: add wasip1 support 2023-04-11 20:56:32 +00:00
sigchld.out
simassign.go
sizeof.go
slice3.go
slice3err.go
slicecap.go
sliceopt.go
solitaire.go
stack.go
stackobj.go
stackobj2.go
stackobj3.go
strcopy.go
strength.go
string_lit.go
stringrange.go
struct0.go
switch.go [dev.unified] test: add switch test case for tricky nil handling 2022-07-19 23:30:49 +00:00
switch2.go go/parser: adjustments to error messages 2022-09-01 22:37:04 +00:00
switch3.go
switch4.go
switch5.go
switch6.go cmd/compile: use "missing method m" instead of "missing m method" 2022-09-24 17:04:15 +00:00
switch7.go
tighten.go cmd/compile: enhance tighten pass for memory values 2023-05-16 01:01:38 +00:00
tinyfin.go
torture.go
turing.go
typecheck.go
typecheckloop.go cmd/compile: use "init... cycle" instead of "init... loop" in error messages 2022-09-23 20:27:09 +00:00
typeswitch.go
typeswitch1.go
typeswitch2.go
typeswitch2b.go go/types, types2: use "and not used" instead of "but not used" in error messages 2022-09-27 21:10:19 +00:00
typeswitch3.go
uintptrescapes.go
uintptrescapes2.go
uintptrescapes3.go
uintptrkeepalive.go
undef.go
unsafe_slice_data.go cmd/compile: add support for unsafe.{String,StringData,SliceData} 2022-08-31 17:15:15 +00:00
unsafe_string.go cmd/compile: add support for unsafe.{String,StringData,SliceData} 2022-08-31 17:15:15 +00:00
unsafe_string_data.go cmd/compile: add support for unsafe.{String,StringData,SliceData} 2022-08-31 17:15:15 +00:00
unsafebuiltins.go cmd/compile: add support for unsafe.{String,StringData,SliceData} 2022-08-31 17:15:15 +00:00
used.go
utf.go
varerr.go
varinit.go
winbatch.go
writebarrier.go
zerodivide.go
zerosize.go cmd/link: put zero-sized data symbols at same address as runtime.zerobase 2023-04-28 18:35:43 +00:00

The test directory contains tests of the Go tool chain and runtime. It includes black box tests, regression tests, and error output tests. They are run as part of all.bash.

To run just these tests, execute:

../bin/go test cmd/internal/testdir

To run just tests from specified files in this directory, execute:

../bin/go test cmd/internal/testdir -run='Test/(file1.go|file2.go|...)'

Standard library tests should be written as regular Go tests in the appropriate package.

The tool chain and runtime also have regular Go tests in their packages. The main reasons to add a new test to this directory are:

  • it is most naturally expressed using the test runner; or
  • it is also applicable to gccgo and other Go tool chains.