diff options
| author | Alberto Donizetti <alb.donizetti@gmail.com> | 2018-03-06 20:10:35 +0100 |
|---|---|---|
| committer | Alberto Donizetti <alb.donizetti@gmail.com> | 2018-03-06 20:34:33 +0000 |
| commit | 8516ecd05f856f895dceeb7c150c98d706a0b326 (patch) | |
| tree | 83a2ccd419753ae4a3b025d913754d4f728668e4 /test/codegen/mathbits.go | |
| parent | 05962561ae490ae006377a7b8d0fd1495ad6eb2e (diff) | |
| download | go-8516ecd05f856f895dceeb7c150c98d706a0b326.tar.xz | |
test/codegen: port math/bits.ReverseBytes tests to codegen
And remove them from ssa_test.
Change-Id: If767af662801219774d1bdb787c77edfa6067770
Reviewed-on: https://go-review.googlesource.com/98976
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Diffstat (limited to 'test/codegen/mathbits.go')
| -rw-r--r-- | test/codegen/mathbits.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/codegen/mathbits.go b/test/codegen/mathbits.go index a95c13caa9..2185b535b9 100644 --- a/test/codegen/mathbits.go +++ b/test/codegen/mathbits.go @@ -124,6 +124,36 @@ func OnesCount16(n uint16) int { return bits.OnesCount16(n) } +// ----------------------- // +// bits.ReverseBytes // +// ----------------------- // + +func ReverseBytes(n uint) uint { + //amd64:"BSWAPQ" + //s390x:"MOVDBR" + //arm64:"REV" + return bits.ReverseBytes(n) +} + +func ReverseBytes64(n uint64) uint64 { + //amd64:"BSWAPQ" + //s390x:"MOVDBR" + //arm64:"REV" + return bits.ReverseBytes64(n) +} + +func ReverseBytes32(n uint32) uint32 { + //amd64:"BSWAPL" + //s390x:"MOVWBR" + //arm64:"REVW" + return bits.ReverseBytes32(n) +} + +func ReverseBytes16(n uint16) uint16 { + //amd64:"ROLW" + return bits.ReverseBytes16(n) +} + // ------------------------ // // bits.TrailingZeros // // ------------------------ // |
