]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: use BMI1 instructions for GOAMD64=v3 and higher
authorMatthew Dempsky <mdempsky@google.com>
Sat, 3 Jul 2021 04:02:30 +0000 (21:02 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 22 Sep 2021 00:15:27 +0000 (00:15 +0000)
commit04572fa29ba689dcdd098cc6b7f84307bf1e171b
tree36b4e5aefcef9bfb5318507035f620ad0e549f09
parent30faf968b1f348e944db3bde24c13462125007b1
cmd/compile: use BMI1 instructions for GOAMD64=v3 and higher

BMI1 includes four instructions (ANDN, BLSI, BLSMSK, BLSR) that are
easy to peephole optimize, and which GCC always seems to favor using
when available and applicable.

Updates #45453.

Change-Id: I0274184057058f5c579e5bc3ea9c414396d3cf46
Reviewed-on: https://go-review.googlesource.com/c/go/+/351130
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/amd64/ssa.go
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
test/codegen/bmi.go [new file with mode: 0644]