reg,build: remove "v" from virtual register ctors

Fixes #30
This commit is contained in:
Michael McLoughlin
2019-01-04 18:23:44 -08:00
parent 05cfa809f2
commit 672b77a441
26 changed files with 155 additions and 155 deletions

View File

@@ -13,8 +13,8 @@ Use `ReturnIndex` to reference unnamed return values. For example, the following
"Interval returns the (start, end) of an interval with the given start and size.",
"Demonstrates multiple unnamed return values.",
)
start := Load(Param("start"), GP64v())
size := Load(Param("size"), GP64v())
start := Load(Param("start"), GP64())
size := Load(Param("size"), GP64())
end := size
ADDQ(start, end)
Store(start, ReturnIndex(0))
@@ -33,9 +33,9 @@ Named return values are referenced much the same as arguments. For example, the
"Butterfly performs a 2-dimensional butterfly operation: computes (x0+x1, x0-x1).",
"Demonstrates multiple named return values.",
)
x0 := Load(Param("x0"), Xv())
x1 := Load(Param("x1"), Xv())
y0, y1 := Xv(), Xv()
x0 := Load(Param("x0"), XMM())
x1 := Load(Param("x1"), XMM())
y0, y1 := XMM(), XMM()
MOVSD(x0, y0)
ADDSD(x1, y0)
MOVSD(x0, y1)
@@ -58,7 +58,7 @@ The following code returns an array type.
"Septuple returns an array of seven of the given byte.",
"Demonstrates returning array values.",
)
b := Load(ParamIndex(0), GP8v())
b := Load(ParamIndex(0), GP8())
for i := 0; i < 7; i++ {
Store(b, ReturnIndex(0).Index(i))
}
@@ -74,8 +74,8 @@ Or a complex type:
"CriticalLine returns the complex value 0.5 + it on Riemann's critical line.",
"Demonstrates returning complex values.",
)
t := Load(Param("t"), Xv())
half := Xv()
t := Load(Param("t"), XMM())
half := XMM()
MOVSD(ConstData("half", F64(0.5)), half)
Store(half, ReturnIndex(0).Real())
Store(t, ReturnIndex(0).Imag())
@@ -91,10 +91,10 @@ You can even build a struct:
"NewStruct initializes a Struct value.",
"Demonstrates returning struct values.",
)
w := Load(Param("w"), GP16v())
x := Load(Param("p").Index(0), Xv())
y := Load(Param("p").Index(1), Xv())
q := Load(Param("q"), GP64v())
w := Load(Param("w"), GP16())
x := Load(Param("p").Index(0), XMM())
y := Load(Param("p").Index(1), XMM())
q := Load(Param("q"), GP64())
Store(w, ReturnIndex(0).Field("Word"))
Store(x, ReturnIndex(0).Field("Point").Index(0))
Store(y, ReturnIndex(0).Field("Point").Index(1))

View File

@@ -15,8 +15,8 @@ func main() {
"Interval returns the (start, end) of an interval with the given start and size.",
"Demonstrates multiple unnamed return values.",
)
start := Load(Param("start"), GP64v())
size := Load(Param("size"), GP64v())
start := Load(Param("start"), GP64())
size := Load(Param("size"), GP64())
end := size
ADDQ(start, end)
Store(start, ReturnIndex(0))
@@ -28,9 +28,9 @@ func main() {
"Butterfly performs a 2-dimensional butterfly operation: computes (x0+x1, x0-x1).",
"Demonstrates multiple named return values.",
)
x0 := Load(Param("x0"), Xv())
x1 := Load(Param("x1"), Xv())
y0, y1 := Xv(), Xv()
x0 := Load(Param("x0"), XMM())
x1 := Load(Param("x1"), XMM())
y0, y1 := XMM(), XMM()
MOVSD(x0, y0)
ADDSD(x1, y0)
MOVSD(x0, y1)
@@ -44,7 +44,7 @@ func main() {
"Septuple returns an array of seven of the given byte.",
"Demonstrates returning array values.",
)
b := Load(ParamIndex(0), GP8v())
b := Load(ParamIndex(0), GP8())
for i := 0; i < 7; i++ {
Store(b, ReturnIndex(0).Index(i))
}
@@ -55,8 +55,8 @@ func main() {
"CriticalLine returns the complex value 0.5 + it on Riemann's critical line.",
"Demonstrates returning complex values.",
)
t := Load(Param("t"), Xv())
half := Xv()
t := Load(Param("t"), XMM())
half := XMM()
MOVSD(ConstData("half", F64(0.5)), half)
Store(half, ReturnIndex(0).Real())
Store(t, ReturnIndex(0).Imag())
@@ -67,10 +67,10 @@ func main() {
"NewStruct initializes a Struct value.",
"Demonstrates returning struct values.",
)
w := Load(Param("w"), GP16v())
x := Load(Param("p").Index(0), Xv())
y := Load(Param("p").Index(1), Xv())
q := Load(Param("q"), GP64v())
w := Load(Param("w"), GP16())
x := Load(Param("p").Index(0), XMM())
y := Load(Param("p").Index(1), XMM())
q := Load(Param("q"), GP64())
Store(w, ReturnIndex(0).Field("Word"))
Store(x, ReturnIndex(0).Field("Point").Index(0))
Store(y, ReturnIndex(0).Field("Point").Index(1))