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

@@ -9,15 +9,15 @@ Compare to the [`crypto/sha1`](https://github.com/golang/go/blob/204a8f55dc2e0ac
func main() {
TEXT("block", "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"), GP64v())}
m := Mem{Base: Load(Param("m").Base(), GP64v())}
h := Mem{Base: Load(Param("h"), GP64())}
m := Mem{Base: Load(Param("m").Base(), GP64())}
// Store message values on the stack.
w := AllocLocal(64)
W := func(r int) Mem { return w.Offset((r % 16) * 4) }
// Load initial hash.
h0, h1, h2, h3, h4 := GP32v(), GP32v(), GP32v(), GP32v(), GP32v()
h0, h1, h2, h3, h4 := GP32(), GP32(), GP32(), GP32(), GP32()
MOVL(h.Offset(0), h0)
MOVL(h.Offset(4), h1)
@@ -26,7 +26,7 @@ func main() {
MOVL(h.Offset(16), h4)
// Initialize registers.
a, b, c, d, e := GP32v(), GP32v(), GP32v(), GP32v(), GP32v()
a, b, c, d, e := GP32(), GP32(), GP32(), GP32(), GP32()
MOVL(h0, a)
MOVL(h1, b)
@@ -49,7 +49,7 @@ func main() {
q := quarter[r/20]
// Load message value.
u := GP32v()
u := GP32()
if r < 16 {
MOVL(m.Offset(4*r), u)
BSWAPL(u)
@@ -63,7 +63,7 @@ func main() {
MOVL(u, W(r))
// Compute the next state register.
t := GP32v()
t := GP32()
MOVL(a, t)
ROLL(U8(5), t)
ADDL(q.F(b, c, d), t)