build: add attributes argument to TEXT
Brings the TEXT() function signature closer to how the directive works in assembly. Also update almost all examples to use NOSPLIT. Closes #11
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
TEXT("Sum", "func(xs []uint64) uint64")
|
||||
TEXT("Sum", NOSPLIT, "func(xs []uint64) uint64")
|
||||
Doc("Sum returns the sum of the elements in xs.")
|
||||
ptr := Load(Param("xs").Base(), GP64())
|
||||
n := Load(Param("xs").Len(), GP64())
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
// Code generated by command: go run asm.go -out sum.s -stubs stub.go. DO NOT EDIT.
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
// func Sum(xs []uint64) uint64
|
||||
TEXT ·Sum(SB), $0-32
|
||||
TEXT ·Sum(SB), NOSPLIT, $0-32
|
||||
MOVQ xs_base(FP), AX
|
||||
MOVQ xs_len+8(FP), CX
|
||||
XORQ DX, DX
|
||||
|
||||
Reference in New Issue
Block a user