| 1 |
// asmcheck |
| 2 |
|
| 3 |
// Copyright 2025 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 |
package codegen |
| 8 |
|
| 9 |
type tile1 struct { |
| 10 |
a uint16 |
| 11 |
b uint16 |
| 12 |
c uint32 |
| 13 |
} |
| 14 |
|
| 15 |
func store_tile1(t *tile1) { |
| 16 |
// amd64:`MOVQ` |
| 17 |
t.a, t.b, t.c = 1, 1, 1 |
| 18 |
} |
| 19 |
|
| 20 |
type tile2 struct { |
| 21 |
a, b, c, d, e int8 |
| 22 |
} |
| 23 |
|
| 24 |
func store_tile2(t *tile2) { |
| 25 |
// amd64:`MOVW` |
| 26 |
t.a, t.b = 1, 1 |
| 27 |
// amd64:`MOVW` |
| 28 |
t.d, t.e = 1, 1 |
| 29 |
} |
| 30 |
|
| 31 |
type tile3 struct { |
| 32 |
a, b uint8 |
| 33 |
c uint16 |
| 34 |
} |
| 35 |
|
| 36 |
func store_shifted(t *tile3, x uint32) { |
| 37 |
// amd64:`MOVL` |
| 38 |
// ppc64:`MOVHBR` |
| 39 |
t.a = uint8(x) |
| 40 |
t.b = uint8(x >> 8) |
| 41 |
t.c = uint16(x >> 16) |
| 42 |
} |
| 43 |
|
| 44 |
func store_const(t *tile3) { |
| 45 |
// 0x00030201 |
| 46 |
// amd64:`MOVL\s\$197121` |
| 47 |
// 0x01020003 |
| 48 |
// ppc64:`MOVD\s\$16908291` |
| 49 |
t.a, t.b, t.c = 1, 2, 3 |
| 50 |
} |