scalar_amd64.go raw

   1  //go:build amd64
   2  
   3  package avx
   4  
   5  // AMD64-specific scalar operations with AVX2 assembly.
   6  
   7  // ScalarAddAVX2 adds two scalars using AVX2.
   8  // This loads both scalars into YMM registers and performs parallel addition.
   9  //
  10  //go:noescape
  11  func ScalarAddAVX2(r, a, b *Scalar)
  12  
  13  // ScalarSubAVX2 subtracts two scalars using AVX2.
  14  //
  15  //go:noescape
  16  func ScalarSubAVX2(r, a, b *Scalar)
  17  
  18  // ScalarMulAVX2 multiplies two scalars using AVX2.
  19  // Computes 512-bit product and reduces mod n.
  20  //
  21  //go:noescape
  22  func ScalarMulAVX2(r, a, b *Scalar)
  23  
  24  // hasAVX2 returns true if the CPU supports AVX2.
  25  //
  26  //go:noescape
  27  func hasAVX2() bool
  28