Skip to content

Commit 5943fae

Browse files
committed
fix cloudflare problem in go 1.11
1 parent 704ebf0 commit 5943fae

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

crypto/bn256/cloudflare/gfp_amd64.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ TEXT ·gfpMul(SB),0,$160-24
110110
MOVQ b+16(FP), SI
111111

112112
// Jump to a slightly different implementation if MULX isn't supported.
113-
CMPB runtime·support_bmi2(SB), $0
113+
CMPB ·hasBMI2(SB), $0
114114
JE nobmi2Mul
115115

116116
mulBMI2(0(DI),8(DI),16(DI),24(DI), 0(SI))

crypto/bn256/cloudflare/gfp_decl.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ package bn256
55
// This file contains forward declarations for the architecture-specific
66
// assembly implementations of these functions, provided that they exist.
77

8+
import (
9+
"golang.org/x/sys/cpu"
10+
)
11+
12+
var hasBMI2 = cpu.X86.HasBMI2
13+
814
// go:noescape
915
func gfpNeg(c, a *gfP)
1016

0 commit comments

Comments
 (0)