Skip to content

Commit

Permalink
left shift returns carry
Browse files Browse the repository at this point in the history
  • Loading branch information
kilic committed Feb 8, 2020
1 parent 4c0066a commit 62dafed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion codegen/gocode/arith_decl_code.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func is_even(a fieldElement) bool
func eq%[1]d(a, b fieldElement) bool
//go:noescape
func mul_two_%[1]d(a fieldElement)
func mul_two_%[1]d(a fieldElement) uint64
//go:noescape
func div_two_%[1]d(a fieldElement)
Expand Down
6 changes: 4 additions & 2 deletions codegen/x86/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ func generateMul2(size int, single bool) {
if !single {
funcName = fmt.Sprintf("%s_%d", funcName, size)
}
TEXT(funcName, NOSPLIT, fmt.Sprintf("func(a *[%d]uint64)", size))
TEXT(funcName, NOSPLIT, fmt.Sprintf("func(a *[%d]uint64) uint64", size))
tape := newTape(nil)
A := tape.newReprAtParam(size, "a", tape.di(), 0)
tape.ax().xorself()
for i := 0; i < size; i++ {
RCLQ(Imm(1), A.next().s)
}
RET()
RCLQ(Imm(1), RAX)
Store(RAX, ReturnIndex(0))
tape.ret()
}

func generateEq(size int, single bool) {
Expand Down

0 comments on commit 62dafed

Please sign in to comment.