github.com/cloudflare/circl@v1.5.0/math/fp448/fp_amd64.go (about)

     1  //go:build amd64 && !purego
     2  // +build amd64,!purego
     3  
     4  package fp448
     5  
     6  import (
     7  	"golang.org/x/sys/cpu"
     8  )
     9  
    10  var hasBmi2Adx = cpu.X86.HasBMI2 && cpu.X86.HasADX
    11  
    12  var _ = hasBmi2Adx
    13  
    14  func cmov(x, y *Elt, n uint)  { cmovAmd64(x, y, n) }
    15  func cswap(x, y *Elt, n uint) { cswapAmd64(x, y, n) }
    16  func add(z, x, y *Elt)        { addAmd64(z, x, y) }
    17  func sub(z, x, y *Elt)        { subAmd64(z, x, y) }
    18  func addsub(x, y *Elt)        { addsubAmd64(x, y) }
    19  func mul(z, x, y *Elt)        { mulAmd64(z, x, y) }
    20  func sqr(z, x *Elt)           { sqrAmd64(z, x) }
    21  
    22  /* Functions defined in fp_amd64.s */
    23  
    24  //go:noescape
    25  func cmovAmd64(x, y *Elt, n uint)
    26  
    27  //go:noescape
    28  func cswapAmd64(x, y *Elt, n uint)
    29  
    30  //go:noescape
    31  func addAmd64(z, x, y *Elt)
    32  
    33  //go:noescape
    34  func subAmd64(z, x, y *Elt)
    35  
    36  //go:noescape
    37  func addsubAmd64(x, y *Elt)
    38  
    39  //go:noescape
    40  func mulAmd64(z, x, y *Elt)
    41  
    42  //go:noescape
    43  func sqrAmd64(z, x *Elt)