diff options
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 // // ------------------------ // |
