From 4ce1c8e9e1aab695bb0da506f2de336a5caa81f6 Mon Sep 17 00:00:00 2001 From: Xiaolin Zhao Date: Tue, 20 May 2025 10:28:17 +0800 Subject: cmd/compile: add rules about ORN and ANDN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reduce the number of go toolchain instructions on loong64 as follows. file before after Δ % addr2line 279880 279776 -104 -0.0372% asm 556638 556410 -228 -0.0410% buildid 272272 272072 -200 -0.0735% cgo 481522 481318 -204 -0.0424% compile 2457788 2457580 -208 -0.0085% covdata 323384 323280 -104 -0.0322% cover 518450 518234 -216 -0.0417% dist 340790 340686 -104 -0.0305% distpack 282456 282252 -204 -0.0722% doc 789932 789688 -244 -0.0309% fix 324332 324228 -104 -0.0321% link 704622 704390 -232 -0.0329% nm 277132 277028 -104 -0.0375% objdump 507862 507758 -104 -0.0205% pack 221774 221674 -100 -0.0451% pprof 1469816 1469552 -264 -0.0180% test2json 254836 254732 -104 -0.0408% trace 1100002 1099738 -264 -0.0240% vet 781078 780874 -204 -0.0261% go 1529116 1528848 -268 -0.0175% gofmt 318556 318448 -108 -0.0339% total 13792238 13788566 -3672 -0.0266% Change-Id: I23fb3ebd41309252c7075e57ea7094e79f8c4fef Reviewed-on: https://go-review.googlesource.com/c/go/+/674335 Reviewed-by: abner chenc Reviewed-by: Michael Knyszek LUCI-TryBot-Result: Go LUCI Auto-Submit: abner chenc Reviewed-by: David Chase Reviewed-by: Meidan Li --- test/codegen/bits.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/codegen/bits.go') diff --git a/test/codegen/bits.go b/test/codegen/bits.go index 95e0ed85e4..7974f471fc 100644 --- a/test/codegen/bits.go +++ b/test/codegen/bits.go @@ -332,6 +332,7 @@ func op_eon(x, y, z uint32, a []uint32, n, m uint64) uint64 { func op_orn(x, y uint32) uint32 { // arm64:`ORN\t`,-`ORR` + // loong64:"ORN"\t,-"OR\t" return x | ^y } @@ -344,6 +345,11 @@ func op_nor(x int64, a []int64) { a[2] = ^(0x12 | 0x34) } +func op_andn(x, y uint32) uint32 { + // loong64:"ANDN\t",-"AND\t" + return x &^ y +} + // check bitsets func bitSetPowerOf2Test(x int) bool { // amd64:"BTL\t[$]3" -- cgit v1.3