From 1cdd4b912b307d774f510b89932a5ff8893a5ae0 Mon Sep 17 00:00:00 2001 From: Michael McLoughlin Date: Sat, 5 Jan 2019 17:41:07 -0800 Subject: [PATCH] examples: remove non-dot imports Updates #31 --- examples/fnv1a/asm.go | 18 +++++++++--------- examples/sum/asm.go | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/fnv1a/asm.go b/examples/fnv1a/asm.go index 6e3afbfb..07c7dc1b 100644 --- a/examples/fnv1a/asm.go +++ b/examples/fnv1a/asm.go @@ -4,8 +4,8 @@ package main import ( . "github.com/mmcloughlin/avo/build" - "github.com/mmcloughlin/avo/operand" - "github.com/mmcloughlin/avo/reg" + . "github.com/mmcloughlin/avo/operand" + . "github.com/mmcloughlin/avo/reg" ) const ( @@ -19,22 +19,22 @@ func main() { ptr := Load(Param("data").Base(), GP64()) n := Load(Param("data").Len(), GP64()) - h := reg.RAX - MOVQ(operand.Imm(OffsetBasis), h) + h := RAX + MOVQ(Imm(OffsetBasis), h) p := GP64() - MOVQ(operand.Imm(Prime), p) + MOVQ(Imm(Prime), p) LABEL("loop") - CMPQ(n, operand.Imm(0)) - JE(operand.LabelRef("done")) + CMPQ(n, Imm(0)) + JE(LabelRef("done")) b := GP64() - MOVBQZX(operand.Mem{Base: ptr}, b) + MOVBQZX(Mem{Base: ptr}, b) XORQ(b, h) MULQ(p) INCQ(ptr) DECQ(n) - JMP(operand.LabelRef("loop")) + JMP(LabelRef("loop")) LABEL("done") Store(h, ReturnIndex(0)) RET() diff --git a/examples/sum/asm.go b/examples/sum/asm.go index 4c9aba70..3ec57fb4 100644 --- a/examples/sum/asm.go +++ b/examples/sum/asm.go @@ -4,7 +4,7 @@ package main import ( . "github.com/mmcloughlin/avo/build" - "github.com/mmcloughlin/avo/operand" + . "github.com/mmcloughlin/avo/operand" ) func main() { @@ -15,12 +15,12 @@ func main() { s := GP64() XORQ(s, s) LABEL("loop") - CMPQ(n, operand.Imm(0)) - JE(operand.LabelRef("done")) - ADDQ(operand.Mem{Base: ptr}, s) - ADDQ(operand.Imm(8), ptr) + CMPQ(n, Imm(0)) + JE(LabelRef("done")) + ADDQ(Mem{Base: ptr}, s) + ADDQ(Imm(8), ptr) DECQ(n) - JMP(operand.LabelRef("loop")) + JMP(LabelRef("loop")) LABEL("done") Store(s, ReturnIndex(0)) RET()