Debian Codegraph @

examples/pragma/asm.go

raw symbols SCIP
1 //go:build ignore
2
3 package main
4
5 import (
6 . "github.com/mmcloughlin/avo/build"
7 . "github.com/mmcloughlin/avo/operand"
8 )
9
10 func main() {
11 TEXT("Add", NOSPLIT, "func(z, x, y *uint64)")
12 Pragma("noescape")
13 Doc("Add adds the values at x and y and writes the result to z.")
14 zptr := Mem{Base: Load(Param("z"), GP64())}
15 xptr := Mem{Base: Load(Param("x"), GP64())}
16 yptr := Mem{Base: Load(Param("y"), GP64())}
17 x, y := GP64(), GP64()
18 MOVQ(xptr, x)
19 MOVQ(yptr, y)
20 ADDQ(x, y)
21 MOVQ(y, zptr)
22 RET()
23 Generate()
24 }