github.com/parquet-go/parquet-go@v0.21.1-0.20240501160520-b3c3a0c3ed6f/internal/bytealg/broadcast_amd64.go (about)

     1  //go:build !purego
     2  
     3  package bytealg
     4  
     5  //go:noescape
     6  func broadcastAVX2(dst []byte, src byte)
     7  
     8  // Broadcast writes the src value to all bytes of dst.
     9  func Broadcast(dst []byte, src byte) {
    10  	if len(dst) >= 8 && hasAVX2 {
    11  		broadcastAVX2(dst, src)
    12  	} else {
    13  		for i := range dst {
    14  			dst[i] = src
    15  		}
    16  	}
    17  }