]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: don't use BTS when OR works, add direct memory BTS operations
authorKeith Randall <khr@golang.org>
Tue, 1 Aug 2023 21:32:56 +0000 (14:32 -0700)
committerKeith Randall <khr@google.com>
Fri, 4 Aug 2023 16:40:24 +0000 (16:40 +0000)
commit611706b17136beb602711f7bfebd15622f73f58f
tree47a67335a6e838036b57134620e775a6b3ac6ee8
parent51cb12e83b87a100d1df0d80f5176417e08872ea
cmd/compile: don't use BTS when OR works, add direct memory BTS operations

Stop using BTSconst and friends when ORLconst can be used instead.
OR can be issued by more function units than BTS can, so it could
lead to better IPC. OR might take a few more bytes to encode, but
not a lot more.

Still use BTSconst for cases where the constant otherwise wouldn't
fit and would require a separate movabs instruction to materialize
the constant. This happens when setting bits 31-63 of 64-bit targets.

Add BTS-to-memory operations so we don't need to load/bts/store.

Fixes #61694

Change-Id: I00379608df8fb0167cb01466e97d11dec7c1596c
Reviewed-on: https://go-review.googlesource.com/c/go/+/515755
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
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/bits.go
test/codegen/mathbits.go
test/codegen/memops.go