examples: forgot to regenerate
Sync READMEs with example code. Updates #31
This commit is contained in:
10
README.md
10
README.md
@@ -106,12 +106,12 @@ func main() {
|
|||||||
s := GP64()
|
s := GP64()
|
||||||
XORQ(s, s)
|
XORQ(s, s)
|
||||||
LABEL("loop")
|
LABEL("loop")
|
||||||
CMPQ(n, operand.Imm(0))
|
CMPQ(n, Imm(0))
|
||||||
JE(operand.LabelRef("done"))
|
JE(LabelRef("done"))
|
||||||
ADDQ(operand.Mem{Base: ptr}, s)
|
ADDQ(Mem{Base: ptr}, s)
|
||||||
ADDQ(operand.Imm(8), ptr)
|
ADDQ(Imm(8), ptr)
|
||||||
DECQ(n)
|
DECQ(n)
|
||||||
JMP(operand.LabelRef("loop"))
|
JMP(LabelRef("loop"))
|
||||||
LABEL("done")
|
LABEL("done")
|
||||||
Store(s, ReturnIndex(0))
|
Store(s, ReturnIndex(0))
|
||||||
RET()
|
RET()
|
||||||
|
|||||||
@@ -15,22 +15,22 @@ func main() {
|
|||||||
ptr := Load(Param("data").Base(), GP64())
|
ptr := Load(Param("data").Base(), GP64())
|
||||||
n := Load(Param("data").Len(), GP64())
|
n := Load(Param("data").Len(), GP64())
|
||||||
|
|
||||||
h := reg.RAX
|
h := RAX
|
||||||
MOVQ(operand.Imm(OffsetBasis), h)
|
MOVQ(Imm(OffsetBasis), h)
|
||||||
p := GP64()
|
p := GP64()
|
||||||
MOVQ(operand.Imm(Prime), p)
|
MOVQ(Imm(Prime), p)
|
||||||
|
|
||||||
LABEL("loop")
|
LABEL("loop")
|
||||||
CMPQ(n, operand.Imm(0))
|
CMPQ(n, Imm(0))
|
||||||
JE(operand.LabelRef("done"))
|
JE(LabelRef("done"))
|
||||||
b := GP64()
|
b := GP64()
|
||||||
MOVBQZX(operand.Mem{Base: ptr}, b)
|
MOVBQZX(Mem{Base: ptr}, b)
|
||||||
XORQ(b, h)
|
XORQ(b, h)
|
||||||
MULQ(p)
|
MULQ(p)
|
||||||
INCQ(ptr)
|
INCQ(ptr)
|
||||||
DECQ(n)
|
DECQ(n)
|
||||||
|
|
||||||
JMP(operand.LabelRef("loop"))
|
JMP(LabelRef("loop"))
|
||||||
LABEL("done")
|
LABEL("done")
|
||||||
Store(h, ReturnIndex(0))
|
Store(h, ReturnIndex(0))
|
||||||
RET()
|
RET()
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ func main() {
|
|||||||
s := GP64()
|
s := GP64()
|
||||||
XORQ(s, s)
|
XORQ(s, s)
|
||||||
LABEL("loop")
|
LABEL("loop")
|
||||||
CMPQ(n, operand.Imm(0))
|
CMPQ(n, Imm(0))
|
||||||
JE(operand.LabelRef("done"))
|
JE(LabelRef("done"))
|
||||||
ADDQ(operand.Mem{Base: ptr}, s)
|
ADDQ(Mem{Base: ptr}, s)
|
||||||
ADDQ(operand.Imm(8), ptr)
|
ADDQ(Imm(8), ptr)
|
||||||
DECQ(n)
|
DECQ(n)
|
||||||
JMP(operand.LabelRef("loop"))
|
JMP(LabelRef("loop"))
|
||||||
LABEL("done")
|
LABEL("done")
|
||||||
Store(s, ReturnIndex(0))
|
Store(s, ReturnIndex(0))
|
||||||
RET()
|
RET()
|
||||||
|
|||||||
Reference in New Issue
Block a user