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:
Michael McLoughlin
2019-01-06 20:04:51 -08:00
parent 76db5bb03f
commit 304c7425d2
25 changed files with 105 additions and 72 deletions

View File

@@ -7,7 +7,7 @@ import (
)
func main() {
TEXT("Split", "func(x uint64) (q uint64, l uint32, w uint16, b uint8)")
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.",

View File

@@ -1,7 +1,9 @@
// Code generated by command: go run asm.go -out cast.s -stubs stub.go. DO NOT EDIT.
#include "textflag.h"
// func Split(x uint64) (q uint64, l uint32, w uint16, b uint8)
TEXT ·Split(SB), $0-23
TEXT ·Split(SB), NOSPLIT, $0-23
MOVQ x(FP), AX
MOVQ AX, q+8(FP)
MOVL AX, l+16(FP)