doc: forgot to regenerate on last commit

This commit is contained in:
Michael McLoughlin
2019-01-06 20:16:26 -08:00
parent 304c7425d2
commit 4f73a6ea72
10 changed files with 36 additions and 30 deletions

View File

@@ -41,7 +41,7 @@ import (
)
func main() {
TEXT("Add", "func(x, y uint64) uint64")
TEXT("Add", NOSPLIT, "func(x, y uint64) uint64")
Doc("Add adds x and y.")
x := Load(Param("x"), GP64())
y := Load(Param("y"), GP64())
@@ -65,8 +65,10 @@ After running `go generate` the [`add.s`](examples/add/add.s) file will contain
```s
// Code generated by command: go run asm.go -out add.s -stubs stub.go. DO NOT EDIT.
#include "textflag.h"
// func Add(x uint64, y uint64) uint64
TEXT ·Add(SB), $0-24
TEXT ·Add(SB), NOSPLIT, $0-24
MOVQ x(FP), AX
MOVQ y+8(FP), CX
ADDQ AX, CX
@@ -99,7 +101,7 @@ Sum a slice of `uint64`s:
[embedmd]:# (examples/sum/asm.go /func main/ /^}/)
```go
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())
@@ -135,8 +137,10 @@ The result from this code generator is:
```s
// 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
@@ -160,7 +164,7 @@ Full example at [`examples/sum`](examples/sum).
[embedmd]:# (examples/args/asm.go go /.*TEXT.*StringLen/ /Load.*/)
```go
TEXT("StringLen", "func(s string) int")
TEXT("StringLen", NOSPLIT, "func(s string) int")
strlen := Load(Param("s").Len(), GP64())
```
@@ -168,7 +172,7 @@ Index an array:
[embedmd]:# (examples/args/asm.go go /.*TEXT.*ArrayThree/ /Load.*/)
```go
TEXT("ArrayThree", "func(a [7]uint64) uint64")
TEXT("ArrayThree", NOSPLIT, "func(a [7]uint64) uint64")
a3 := Load(Param("a").Index(3), GP64())
```
@@ -176,7 +180,7 @@ Access a struct field (provided you have loaded your package with the `Package`
[embedmd]:# (examples/args/asm.go go /.*TEXT.*FieldFloat64/ /Load.*/)
```go
TEXT("FieldFloat64", "func(s Struct) float64")
TEXT("FieldFloat64", NOSPLIT, "func(s Struct) float64")
f64 := Load(Param("s").Field("Float64"), XMM())
```
@@ -184,7 +188,7 @@ Component accesses can be arbitrarily nested:
[embedmd]:# (examples/args/asm.go go /.*TEXT.*FieldArrayTwoBTwo/ /Load.*/)
```go
TEXT("FieldArrayTwoBTwo", "func(s Struct) byte")
TEXT("FieldArrayTwoBTwo", NOSPLIT, "func(s Struct) byte")
b2 := Load(Param("s").Field("Array").Index(2).Field("B").Index(2), GP8())
```
@@ -197,7 +201,7 @@ Very similar techniques apply to writing return values. See [`examples/args`](ex
[embedmd]:# (examples/sha1/asm.go /func main/ /^}/)
```go
func main() {
TEXT("block", "func(h *[5]uint32, m []byte)")
TEXT("block", 0, "func(h *[5]uint32, m []byte)")
Doc("block SHA-1 hashes the 64-byte message m into the running state h.")
h := Mem{Base: Load(Param("h"), GP64())}
m := Mem{Base: Load(Param("m").Base(), GP64())}