github.com/parquet-go/parquet-go@v0.21.1-0.20240501160520-b3c3a0c3ed6f/column_buffer_amd64.go (about)

     1  //go:build !purego
     2  
     3  package parquet
     4  
     5  import (
     6  	"github.com/parquet-go/parquet-go/internal/bytealg"
     7  	"github.com/parquet-go/parquet-go/internal/unsafecast"
     8  	"github.com/parquet-go/parquet-go/sparse"
     9  	"golang.org/x/sys/cpu"
    10  )
    11  
    12  func broadcastValueInt32(dst []int32, src int8) {
    13  	bytealg.Broadcast(unsafecast.Int32ToBytes(dst), byte(src))
    14  }
    15  
    16  //go:noescape
    17  func broadcastRangeInt32AVX2(dst []int32, base int32)
    18  
    19  func broadcastRangeInt32(dst []int32, base int32) {
    20  	if len(dst) >= 8 && cpu.X86.HasAVX2 {
    21  		broadcastRangeInt32AVX2(dst, base)
    22  	} else {
    23  		for i := range dst {
    24  			dst[i] = base + int32(i)
    25  		}
    26  	}
    27  }
    28  
    29  //go:noescape
    30  func writePointersBE128(values [][16]byte, rows sparse.Array)