Skip to content

Commit bb1749b

Browse files
committed
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 <[email protected]> Run-TryBot: Keith Randall <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Keith Randall <[email protected]>
1 parent 176b63e commit bb1749b

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

src/cmd/compile/internal/amd64/versions_test.go

+25-6
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,31 @@ var featureToOpcodes = map[string][]string{
242242
// go tool objdump doesn't include a [QL] on popcnt instructions, until CL 351889
243243
// native objdump doesn't include [QL] on linux.
244244
"popcnt": {"popcntq", "popcntl", "popcnt"},
245-
"bmi1": {"andnq", "andnl", "andn", "blsiq", "blsil", "blsi", "blsmskq", "blsmskl", "blsmsk", "blsrq", "blsrl", "blsr", "tzcntq", "tzcntl", "tzcnt"},
246-
"bmi2": {"sarxq", "sarxl", "sarx", "shlxq", "shlxl", "shlx", "shrxq", "shrxl", "shrx"},
247-
"sse41": {"roundsd"},
248-
"fma": {"vfmadd231sd"},
249-
"movbe": {"movbeqq", "movbeq", "movbell", "movbel", "movbe"},
250-
"lzcnt": {"lzcntq", "lzcntl", "lzcnt"},
245+
"bmi1": {
246+
"andnq", "andnl", "andn",
247+
"blsiq", "blsil", "blsi",
248+
"blsmskq", "blsmskl", "blsmsk",
249+
"blsrq", "blsrl", "blsr",
250+
"tzcntq", "tzcntl", "tzcnt",
251+
},
252+
"bmi2": {
253+
"sarxq", "sarxl", "sarx",
254+
"shlxq", "shlxl", "shlx",
255+
"shrxq", "shrxl", "shrx",
256+
},
257+
"sse41": {
258+
"roundsd",
259+
"pinsrq", "pinsrl", "pinsrd", "pinsrb", "pinsr",
260+
"pextrq", "pextrl", "pextrd", "pextrb", "pextr",
261+
"pminsb", "pminsd", "pminuw", "pminud", // Note: ub and sw are ok.
262+
"pmaxsb", "pmaxsd", "pmaxuw", "pmaxud",
263+
"pmovzxbw", "pmovzxbd", "pmovzxbq", "pmovzxwd", "pmovzxwq", "pmovzxdq",
264+
"pmovsxbw", "pmovsxbd", "pmovsxbq", "pmovsxwd", "pmovsxwq", "pmovsxdq",
265+
"pblendvb",
266+
},
267+
"fma": {"vfmadd231sd"},
268+
"movbe": {"movbeqq", "movbeq", "movbell", "movbel", "movbe"},
269+
"lzcnt": {"lzcntq", "lzcntl", "lzcnt"},
251270
}
252271

253272
// Test to use POPCNT instruction, if available

0 commit comments

Comments
 (0)