Files
avo/tests/cast/asm.go
Michael McLoughlin 9c70781236 all: go 1.17 (#197)
Bump CI Go versions to 1.16 and 1.17.
Update build tags with `go:build` equivalents.
Upgrade asmfmt tool for new `go:build` support.

Updates #183
2021-10-29 01:18:34 -07:00

24 lines
489 B
Go

//go:build ignore
// +build ignore
package main
import . "github.com/mmcloughlin/avo/build"
func main() {
TEXT("Split", NOSPLIT, "func(x uint64) (q uint64, l uint32, w uint16, b uint8)")
Doc(
"Split returns the low 64, 32, 16 and 8 bits of x.",
"Tests the As() methods of virtual general-purpose registers.",
)
x := GP64()
Load(Param("x"), x)
Store(x, Return("q"))
Store(x.As32(), Return("l"))
Store(x.As16(), Return("w"))
Store(x.As8(), Return("b"))
RET()
Generate()
}