1
0
mirror of https://github.com/golang/go synced 2024-11-23 13:40:04 -07:00

cmd/compile: improve GOAMD64=v1 violation test

Add more opcodes that are only available in >v1 modes.

This test will now correctly detect the regression in -race mode
for #53743.

Change-Id: Icfbb1384e4333d7b4ff167c9ebcb6f4c7aeb6134
Reviewed-on: https://go-review.googlesource.com/c/go/+/416477
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
This commit is contained in:
Keith Randall 2022-07-08 09:41:14 -07:00 committed by Keith Randall
parent 176b63e711
commit bb1749ba3b

View File

@ -242,12 +242,31 @@ var featureToOpcodes = map[string][]string{
// go tool objdump doesn't include a [QL] on popcnt instructions, until CL 351889
// native objdump doesn't include [QL] on linux.
"popcnt": {"popcntq", "popcntl", "popcnt"},
"bmi1": {"andnq", "andnl", "andn", "blsiq", "blsil", "blsi", "blsmskq", "blsmskl", "blsmsk", "blsrq", "blsrl", "blsr", "tzcntq", "tzcntl", "tzcnt"},
"bmi2": {"sarxq", "sarxl", "sarx", "shlxq", "shlxl", "shlx", "shrxq", "shrxl", "shrx"},
"sse41": {"roundsd"},
"fma": {"vfmadd231sd"},
"movbe": {"movbeqq", "movbeq", "movbell", "movbel", "movbe"},
"lzcnt": {"lzcntq", "lzcntl", "lzcnt"},
"bmi1": {
"andnq", "andnl", "andn",
"blsiq", "blsil", "blsi",
"blsmskq", "blsmskl", "blsmsk",
"blsrq", "blsrl", "blsr",
"tzcntq", "tzcntl", "tzcnt",
},
"bmi2": {
"sarxq", "sarxl", "sarx",
"shlxq", "shlxl", "shlx",
"shrxq", "shrxl", "shrx",
},
"sse41": {
"roundsd",
"pinsrq", "pinsrl", "pinsrd", "pinsrb", "pinsr",
"pextrq", "pextrl", "pextrd", "pextrb", "pextr",
"pminsb", "pminsd", "pminuw", "pminud", // Note: ub and sw are ok.
"pmaxsb", "pmaxsd", "pmaxuw", "pmaxud",
"pmovzxbw", "pmovzxbd", "pmovzxbq", "pmovzxwd", "pmovzxwq", "pmovzxdq",
"pmovsxbw", "pmovsxbd", "pmovsxbq", "pmovsxwd", "pmovsxwq", "pmovsxdq",
"pblendvb",
},
"fma": {"vfmadd231sd"},
"movbe": {"movbeqq", "movbeq", "movbell", "movbel", "movbe"},
"lzcnt": {"lzcntq", "lzcntl", "lzcnt"},
}
// Test to use POPCNT instruction, if available