| 1 |
// asmcheck |
| 2 |
|
| 3 |
// Copyright 2020 The Go Authors. All rights reserved. |
| 4 |
// Use of this source code is governed by a BSD-style |
| 5 |
// license that can be found in the LICENSE file. |
| 6 |
|
| 7 |
// Don't allow 0 masks in shift lowering rules on ppc64x. |
| 8 |
// See issue 42610. |
| 9 |
|
| 10 |
package codegen |
| 11 |
|
| 12 |
func f32(a []int32, i uint32) { |
| 13 |
g := func(p int32) int32 { |
| 14 |
i = uint32(p) * (uint32(p) & (i & 1)) |
| 15 |
return 1 |
| 16 |
} |
| 17 |
// ppc64x: -"RLWNIM" |
| 18 |
a[0] = g(8) >> 1 |
| 19 |
} |
| 20 |
|
| 21 |
func f(a []int, i uint) { |
| 22 |
g := func(p int) int { |
| 23 |
i = uint(p) * (uint(p) & (i & 1)) |
| 24 |
return 1 |
| 25 |
} |
| 26 |
// ppc64x: -"RLDIC" |
| 27 |
a[0] = g(8) >> 1 |
| 28 |
} |