var ctx … // TEXT starts building a new function called name, with attributes a, and sets its signature (see SignatureExpr). func TEXT(name string, a attr.Attribute, signature string) { … } // GLOBL declares a new static global data section with the given attributes. func GLOBL(name string, a attr.Attribute) operand.Mem { … } // DATA adds a data value to the active data section. func DATA(offset int, v operand.Constant) { … } var flags … // Generate builds and compiles the avo file built with the global context. This // should be the final line of any avo program. Configuration is determined from command-line flags. func Generate() { … } // Package sets the package the generated file will belong to. Required to be able to reference types in the package. func Package(path string) { … } // Constraints sets build constraints for the file. func Constraints(t buildtags.ConstraintsConvertable) { … } // Constraint appends a constraint to the file's build constraints. func Constraint(t buildtags.ConstraintConvertable) { … } // ConstraintExpr appends a constraint to the file's build constraints. The // constraint to add is parsed from the given expression. The expression should // look the same as the content following "// +build " in regular build // constraint comments. func ConstraintExpr(expr string) { … } // GP8L allocates and returns a general-purpose 8-bit register (low byte). func GP8L() reg.GPVirtual { … } // GP8H allocates and returns a general-purpose 8-bit register (high byte). func GP8H() reg.GPVirtual { … } // GP8 allocates and returns a general-purpose 8-bit register (low byte). func GP8() reg.GPVirtual { … } // GP16 allocates and returns a general-purpose 16-bit register. func GP16() reg.GPVirtual { … } // GP32 allocates and returns a general-purpose 32-bit register. func GP32() reg.GPVirtual { … } // GP64 allocates and returns a general-purpose 64-bit register. func GP64() reg.GPVirtual { … } // XMM allocates and returns a 128-bit vector register. func XMM() reg.VecVirtual { … } // YMM allocates and returns a 256-bit vector register. func YMM() reg.VecVirtual { … } // ZMM allocates and returns a 512-bit vector register. func ZMM() reg.VecVirtual { … } // K allocates and returns an opmask register. func K() reg.OpmaskVirtual { … } // Param returns a the named argument of the active function. func Param(name string) gotypes.Component { … } // ParamIndex returns the ith argument of the active function. func ParamIndex(i int) gotypes.Component { … } // Return returns a the named return value of the active function. func Return(name string) gotypes.Component { … } // ReturnIndex returns the ith argument of the active function. func ReturnIndex(i int) gotypes.Component { … } // Load the function argument src into register dst. Returns the destination // register. This is syntactic sugar: it will attempt to select the right MOV // instruction based on the types involved. func Load(src gotypes.Component, dst reg.Register) reg.Register { … } // Store register src into return value dst. This is syntactic sugar: it will // attempt to select the right MOV instruction based on the types involved. func Store(src reg.Register, dst gotypes.Component) { … } // Dereference loads a pointer and returns its element type. func Dereference(ptr gotypes.Component) gotypes.Component { … } // Function starts building a new function with the given name. func Function(name string) { … } // Doc sets documentation comment lines for the currently active function. func Doc(lines ...string) { … } // Pragma adds a compiler directive to the currently active function. func Pragma(directive string, args ...string) { … } // Attributes sets function attributes for the currently active function. func Attributes(a attr.Attribute) { … } // SignatureExpr parses the signature expression and sets it as the active function's signature. func SignatureExpr(expr string) { … } // Implement starts building a function of the given name, whose type is // specified by a stub in the containing package. func Implement(name string) { … } // AllocLocal allocates size bytes in the stack of the currently active function. // Returns a reference to the base pointer for the newly allocated region. func AllocLocal(size int) operand.Mem { … } // Label adds a label to the active function. func Label(name string) { … } // Comment adds comment lines to the active function. func Comment(lines ...string) { … } // Commentf adds a formtted comment line. func Commentf(format string, a ...interface{ … } // ConstData builds a static data section containing just the given constant. func ConstData(name string, v operand.Constant) operand.Mem { … } // Instruction adds an instruction to the active function. func Instruction(i *ir.Instruction) { … }