github.com/muyo/sno@v1.2.1/internal/encoding_amd64.go (about)

     1  package internal
     2  
     3  // Encode returns the sno32-encoded representation of src as an array of 16 bytes.
     4  //go:noescape
     5  func Encode(src *[10]byte) (dst [16]byte)
     6  
     7  // Decode returns the binary representation of a sno32-encoded src as an array of bytes.
     8  //
     9  // Src does not get validated and must have a length of 16 - otherwise Decode will panic.
    10  //go:noescape
    11  func Decode(src []byte) (dst [10]byte)
    12  
    13  // One-shot to determine whether we've got SSE2 at all - and the SSE4.2 and BMI2 sets
    14  // that we need for the vectorized codecs.
    15  //
    16  // The fallbacks currently rely on SSE2 - while it's available on just about
    17  // any modern amd64 platform, *just in case* it's not, the check will fail loudly
    18  // and immediately (panic) instead of faulting on the first encode/decode attempt.
    19  var hasVectorSupport = checkVectorSupport()