forked from tinygo-org/tinybench
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompilerflags_test.go
More file actions
51 lines (44 loc) · 1.18 KB
/
Copy pathcompilerflags_test.go
File metadata and controls
51 lines (44 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package tinybench
const (
cpuTargetX86_64V3 = "x86-64-v3"
goAMD64LevelV3 = "v3"
)
var gccLinkFlags = map[string][]string{
"n-body": {"-lm"}, // Math library.
"n-body-nosqrt": {"-lm"}, // Math library.
"spectral-norm": {"-lm"}, // Math library.
}
var gccBaseFlags = []string{
// "-O2"=="-O=ReleaseSafe" Same reasoning as with Zig.
// It seems serious projects compile with memory limits and safety on.
"-O2",
"-o", "c.bin",
}
var zigBaseFlags = []string{
"build-exe",
"-femit-bin=zig.bin",
"-fno-incremental",
// Prominent Zig projects use ReleaseSafe instead of ReleaseFast.
// This would seem to be a more realistic measure of how zig would perform in real circumstances.
// Also puts the compiler to the test of how well it can eliminate bounds checks.
// https://github.com/tigerbeetle/tigerbeetle/blob/ae7f25dbd904f27498673bf2d60a51f21759cdb8/build.zig#L470
"-O", "ReleaseSafe",
}
var goBaseFlags = []string{
"build",
"-o=go.bin",
}
var tinygoBaseFlags = []string{
"build",
"-opt=2",
"-o=tinybin",
}
var rustBaseFlags = []string{
"-Copt-level=3",
"-Ctarget-cpu=x86-64-v3",
"-Clto=thin",
"-Ccodegen-units=1",
"-Cpanic=abort",
"-Cdebuginfo=0",
"-o", "rust.bin",
}