diff options
| author | Alberto Donizetti <alb.donizetti@gmail.com> | 2018-04-09 14:24:35 +0200 |
|---|---|---|
| committer | Alberto Donizetti <alb.donizetti@gmail.com> | 2018-04-10 07:58:35 +0000 |
| commit | d5ff631e6b86787857913049fc5312969211a1c7 (patch) | |
| tree | 5719f75d97218572eaf4f382e2d6457a96f5c0d8 /test/codegen | |
| parent | 49ed4cbe853e910b6f8d83012bc8b9afedb4b6b6 (diff) | |
| download | go-d5ff631e6b86787857913049fc5312969211a1c7.tar.xz | |
test/codegen: port last remaining misc bit/arithmetic tests
And delete them from asm_test.
Change-Id: I9a75efe9858ef9d7ac86065f860c2ae3f25b0941
Reviewed-on: https://go-review.googlesource.com/105597
Reviewed-by: Daniel Martà <mvdan@mvdan.cc>
Diffstat (limited to 'test/codegen')
| -rw-r--r-- | test/codegen/arithmetic.go | 5 | ||||
| -rw-r--r-- | test/codegen/bitfield.go | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/test/codegen/arithmetic.go b/test/codegen/arithmetic.go index 0cd4d2ee23..d38f80c1e9 100644 --- a/test/codegen/arithmetic.go +++ b/test/codegen/arithmetic.go @@ -30,6 +30,11 @@ func Pow2Muls(n1, n2 int) (int, int) { return a, b } +func Mul_96(n int) int { + // amd64:`SHLQ\t[$]5`,`LEAQ\t\(.*\)\(.*\*2\),` + return n * 96 +} + // Multiplications merging tests func MergeMuls1(n int) int { diff --git a/test/codegen/bitfield.go b/test/codegen/bitfield.go index 937f735cea..08788f1447 100644 --- a/test/codegen/bitfield.go +++ b/test/codegen/bitfield.go @@ -222,3 +222,11 @@ func ubfx11(x uint64) uint64 { // arm64:"UBFX\t[$]1, R[0-9]+, [$]19",-"LSL",-"LSR" return ((x & 0xfffff) << 3) >> 4 } + +// Check that we don't emit comparisons for constant shifts. +//go:nosplit +func shift_no_cmp(x int) int { + // arm64:`LSL\t[$]17`,-`CMP` + // mips64:`SLLV\t[$]17`,-`SGT` + return x << 17 +} |
