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

@@ -8,7 +8,7 @@ import (
)
func main() {
TEXT("EncodeInt", "func(lat, lng float64) uint64")
TEXT("EncodeInt", NOSPLIT, "func(lat, lng float64) uint64")
Doc("EncodeInt computes the 64-bit integer geohash of (lat, lng).")
lat := Load(Param("lat"), XMM())
lng := Load(Param("lng"), XMM())

View File

@@ -3,7 +3,7 @@
#include "textflag.h"
// func EncodeInt(lat float64, lng float64) uint64
TEXT ·EncodeInt(SB), $0-24
TEXT ·EncodeInt(SB), NOSPLIT, $0-24
MOVSD lat(FP), X0
MOVSD lng+8(FP), X1
MULSD reciprocal180<>(SB), X0