Skip to content

Commit 30c3643

Browse files
committed
bindings/go/blst.go: re-generate.py.
1 parent bf19aba commit 30c3643

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

bindings/go/blst.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -1823,13 +1823,12 @@ func P1AffinesMult(pointsIf interface{}, scalarsIf interface{}, nbits int) *P1 {
18231823
for y > 0 {
18241824
y -= window
18251825
for i := 0; i < nx; i++ {
1826-
grid[total].x = i * dx
1827-
grid[total].dx = dx
1826+
grid[total].x = grid[i].x
1827+
grid[total].dx = grid[i].dx
18281828
grid[total].y = y
18291829
grid[total].dy = window
18301830
total++
18311831
}
1832-
grid[total-1].dx = npoints - grid[total-1].x
18331832
}
18341833

18351834
if numThreads > total {
@@ -1893,6 +1892,8 @@ func P1AffinesMult(pointsIf interface{}, scalarsIf interface{}, nbits int) *P1 {
18931892

18941893
if atomic.AddInt32(&rowSync[y/window], 1) == int32(nx) {
18951894
msgsCh <- y // "row" is done
1895+
} else {
1896+
runtime.Gosched() // be nice to the application
18961897
}
18971898
}
18981899

@@ -2323,13 +2324,12 @@ func P2AffinesMult(pointsIf interface{}, scalarsIf interface{}, nbits int) *P2 {
23232324
for y > 0 {
23242325
y -= window
23252326
for i := 0; i < nx; i++ {
2326-
grid[total].x = i * dx
2327-
grid[total].dx = dx
2327+
grid[total].x = grid[i].x
2328+
grid[total].dx = grid[i].dx
23282329
grid[total].y = y
23292330
grid[total].dy = window
23302331
total++
23312332
}
2332-
grid[total-1].dx = npoints - grid[total-1].x
23332333
}
23342334

23352335
if numThreads > total {
@@ -2393,6 +2393,8 @@ func P2AffinesMult(pointsIf interface{}, scalarsIf interface{}, nbits int) *P2 {
23932393

23942394
if atomic.AddInt32(&rowSync[y/window], 1) == int32(nx) {
23952395
msgsCh <- y // "row" is done
2396+
} else {
2397+
runtime.Gosched() // be nice to the application
23962398
}
23972399
}
23982400

0 commit comments

Comments
 (0)