diff options
| author | Wayne Zuo <wdvxdr@golangcn.org> | 2023-02-06 21:21:52 +0800 |
|---|---|---|
| committer | Wayne Zuo <wdvxdr@golangcn.org> | 2023-02-08 03:43:23 +0000 |
| commit | d7ac5d148039822159601ebbf3512431d81e204f (patch) | |
| tree | ee1a0104884bb4fd611642f06b20ad4b066cbe28 /test/codegen/mathbits.go | |
| parent | abd55d84832b1ca4129bfa0fbc13dba64d2164d2 (diff) | |
| download | go-d7ac5d148039822159601ebbf3512431d81e204f.tar.xz | |
cmd/compile: intrinsify math/bits/ReverseBytes{32|64} for 386
The BSWAPL instruction is supported in i486 and newer.
https://github.com/golang/go/wiki/MinimumRequirements#386 says we
support "All Pentium MMX or later". The Pentium is also referred to as
i586, so that we are safe with these instructions.
Change-Id: I6dea1f9d864a45bb07c8f8f35a81cfe16cca216c
Reviewed-on: https://go-review.googlesource.com/c/go/+/465515
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'test/codegen/mathbits.go')
| -rw-r--r-- | test/codegen/mathbits.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/codegen/mathbits.go b/test/codegen/mathbits.go index 0eed27a619..86a44d7c93 100644 --- a/test/codegen/mathbits.go +++ b/test/codegen/mathbits.go @@ -189,6 +189,7 @@ func OnesCount8(n uint8) int { func ReverseBytes(n uint) uint { // amd64:"BSWAPQ" + // 386:"BSWAPL" // s390x:"MOVDBR" // arm64:"REV" return bits.ReverseBytes(n) @@ -196,6 +197,7 @@ func ReverseBytes(n uint) uint { func ReverseBytes64(n uint64) uint64 { // amd64:"BSWAPQ" + // 386:"BSWAPL" // s390x:"MOVDBR" // arm64:"REV" // ppc64x/power10: "BRD" @@ -204,6 +206,7 @@ func ReverseBytes64(n uint64) uint64 { func ReverseBytes32(n uint32) uint32 { // amd64:"BSWAPL" + // 386:"BSWAPL" // s390x:"MOVWBR" // arm64:"REVW" // ppc64x/power10: "BRW" |
