// Code generated by 'tmplgen'; DO NOT EDIT. //go:build goexperiment.simd package archsimd import "unsafe" // LoadInt8x16 loads an Int8x16 from a slice of elements. // If s does not have at least 16 elements, it panics. func LoadInt8x16(s []int8) Int8x16 { return LoadInt8x16Array((*[16]int8)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 16 elements, it panics. func (x Int8x16) Store(s []int8) { x.StoreArray((*[16]int8)(s)) } // LoadInt16x8 loads an Int16x8 from a slice of elements. // If s does not have at least 8 elements, it panics. func LoadInt16x8(s []int16) Int16x8 { return LoadInt16x8Array((*[8]int16)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 8 elements, it panics. func (x Int16x8) Store(s []int16) { x.StoreArray((*[8]int16)(s)) } // LoadInt32x4 loads an Int32x4 from a slice of elements. // If s does not have at least 4 elements, it panics. func LoadInt32x4(s []int32) Int32x4 { return LoadInt32x4Array((*[4]int32)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 4 elements, it panics. func (x Int32x4) Store(s []int32) { x.StoreArray((*[4]int32)(s)) } // LoadInt64x2 loads an Int64x2 from a slice of elements. // If s does not have at least 2 elements, it panics. func LoadInt64x2(s []int64) Int64x2 { return LoadInt64x2Array((*[2]int64)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 2 elements, it panics. func (x Int64x2) Store(s []int64) { x.StoreArray((*[2]int64)(s)) } // LoadUint8x16 loads an Uint8x16 from a slice of elements. // If s does not have at least 16 elements, it panics. func LoadUint8x16(s []uint8) Uint8x16 { return LoadUint8x16Array((*[16]uint8)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 16 elements, it panics. func (x Uint8x16) Store(s []uint8) { x.StoreArray((*[16]uint8)(s)) } // LoadUint16x8 loads an Uint16x8 from a slice of elements. // If s does not have at least 8 elements, it panics. func LoadUint16x8(s []uint16) Uint16x8 { return LoadUint16x8Array((*[8]uint16)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 8 elements, it panics. func (x Uint16x8) Store(s []uint16) { x.StoreArray((*[8]uint16)(s)) } // LoadUint32x4 loads an Uint32x4 from a slice of elements. // If s does not have at least 4 elements, it panics. func LoadUint32x4(s []uint32) Uint32x4 { return LoadUint32x4Array((*[4]uint32)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 4 elements, it panics. func (x Uint32x4) Store(s []uint32) { x.StoreArray((*[4]uint32)(s)) } // LoadUint64x2 loads an Uint64x2 from a slice of elements. // If s does not have at least 2 elements, it panics. func LoadUint64x2(s []uint64) Uint64x2 { return LoadUint64x2Array((*[2]uint64)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 2 elements, it panics. func (x Uint64x2) Store(s []uint64) { x.StoreArray((*[2]uint64)(s)) } // LoadFloat32x4 loads a Float32x4 from a slice of elements. // If s does not have at least 4 elements, it panics. func LoadFloat32x4(s []float32) Float32x4 { return LoadFloat32x4Array((*[4]float32)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 4 elements, it panics. func (x Float32x4) Store(s []float32) { x.StoreArray((*[4]float32)(s)) } // LoadFloat64x2 loads a Float64x2 from a slice of elements. // If s does not have at least 2 elements, it panics. func LoadFloat64x2(s []float64) Float64x2 { return LoadFloat64x2Array((*[2]float64)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 2 elements, it panics. func (x Float64x2) Store(s []float64) { x.StoreArray((*[2]float64)(s)) } // LoadInt8x32 loads an Int8x32 from a slice of elements. // If s does not have at least 32 elements, it panics. func LoadInt8x32(s []int8) Int8x32 { return LoadInt8x32Array((*[32]int8)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 32 elements, it panics. func (x Int8x32) Store(s []int8) { x.StoreArray((*[32]int8)(s)) } // LoadInt16x16 loads an Int16x16 from a slice of elements. // If s does not have at least 16 elements, it panics. func LoadInt16x16(s []int16) Int16x16 { return LoadInt16x16Array((*[16]int16)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 16 elements, it panics. func (x Int16x16) Store(s []int16) { x.StoreArray((*[16]int16)(s)) } // LoadInt32x8 loads an Int32x8 from a slice of elements. // If s does not have at least 8 elements, it panics. func LoadInt32x8(s []int32) Int32x8 { return LoadInt32x8Array((*[8]int32)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 8 elements, it panics. func (x Int32x8) Store(s []int32) { x.StoreArray((*[8]int32)(s)) } // LoadInt64x4 loads an Int64x4 from a slice of elements. // If s does not have at least 4 elements, it panics. func LoadInt64x4(s []int64) Int64x4 { return LoadInt64x4Array((*[4]int64)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 4 elements, it panics. func (x Int64x4) Store(s []int64) { x.StoreArray((*[4]int64)(s)) } // LoadUint8x32 loads an Uint8x32 from a slice of elements. // If s does not have at least 32 elements, it panics. func LoadUint8x32(s []uint8) Uint8x32 { return LoadUint8x32Array((*[32]uint8)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 32 elements, it panics. func (x Uint8x32) Store(s []uint8) { x.StoreArray((*[32]uint8)(s)) } // LoadUint16x16 loads an Uint16x16 from a slice of elements. // If s does not have at least 16 elements, it panics. func LoadUint16x16(s []uint16) Uint16x16 { return LoadUint16x16Array((*[16]uint16)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 16 elements, it panics. func (x Uint16x16) Store(s []uint16) { x.StoreArray((*[16]uint16)(s)) } // LoadUint32x8 loads an Uint32x8 from a slice of elements. // If s does not have at least 8 elements, it panics. func LoadUint32x8(s []uint32) Uint32x8 { return LoadUint32x8Array((*[8]uint32)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 8 elements, it panics. func (x Uint32x8) Store(s []uint32) { x.StoreArray((*[8]uint32)(s)) } // LoadUint64x4 loads an Uint64x4 from a slice of elements. // If s does not have at least 4 elements, it panics. func LoadUint64x4(s []uint64) Uint64x4 { return LoadUint64x4Array((*[4]uint64)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 4 elements, it panics. func (x Uint64x4) Store(s []uint64) { x.StoreArray((*[4]uint64)(s)) } // LoadFloat32x8 loads a Float32x8 from a slice of elements. // If s does not have at least 8 elements, it panics. func LoadFloat32x8(s []float32) Float32x8 { return LoadFloat32x8Array((*[8]float32)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 8 elements, it panics. func (x Float32x8) Store(s []float32) { x.StoreArray((*[8]float32)(s)) } // LoadFloat64x4 loads a Float64x4 from a slice of elements. // If s does not have at least 4 elements, it panics. func LoadFloat64x4(s []float64) Float64x4 { return LoadFloat64x4Array((*[4]float64)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 4 elements, it panics. func (x Float64x4) Store(s []float64) { x.StoreArray((*[4]float64)(s)) } // LoadInt8x64 loads an Int8x64 from a slice of elements. // If s does not have at least 64 elements, it panics. func LoadInt8x64(s []int8) Int8x64 { return LoadInt8x64Array((*[64]int8)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 64 elements, it panics. func (x Int8x64) Store(s []int8) { x.StoreArray((*[64]int8)(s)) } // LoadInt16x32 loads an Int16x32 from a slice of elements. // If s does not have at least 32 elements, it panics. func LoadInt16x32(s []int16) Int16x32 { return LoadInt16x32Array((*[32]int16)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 32 elements, it panics. func (x Int16x32) Store(s []int16) { x.StoreArray((*[32]int16)(s)) } // LoadInt32x16 loads an Int32x16 from a slice of elements. // If s does not have at least 16 elements, it panics. func LoadInt32x16(s []int32) Int32x16 { return LoadInt32x16Array((*[16]int32)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 16 elements, it panics. func (x Int32x16) Store(s []int32) { x.StoreArray((*[16]int32)(s)) } // LoadInt64x8 loads an Int64x8 from a slice of elements. // If s does not have at least 8 elements, it panics. func LoadInt64x8(s []int64) Int64x8 { return LoadInt64x8Array((*[8]int64)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 8 elements, it panics. func (x Int64x8) Store(s []int64) { x.StoreArray((*[8]int64)(s)) } // LoadUint8x64 loads an Uint8x64 from a slice of elements. // If s does not have at least 64 elements, it panics. func LoadUint8x64(s []uint8) Uint8x64 { return LoadUint8x64Array((*[64]uint8)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 64 elements, it panics. func (x Uint8x64) Store(s []uint8) { x.StoreArray((*[64]uint8)(s)) } // LoadUint16x32 loads an Uint16x32 from a slice of elements. // If s does not have at least 32 elements, it panics. func LoadUint16x32(s []uint16) Uint16x32 { return LoadUint16x32Array((*[32]uint16)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 32 elements, it panics. func (x Uint16x32) Store(s []uint16) { x.StoreArray((*[32]uint16)(s)) } // LoadUint32x16 loads an Uint32x16 from a slice of elements. // If s does not have at least 16 elements, it panics. func LoadUint32x16(s []uint32) Uint32x16 { return LoadUint32x16Array((*[16]uint32)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 16 elements, it panics. func (x Uint32x16) Store(s []uint32) { x.StoreArray((*[16]uint32)(s)) } // LoadUint64x8 loads an Uint64x8 from a slice of elements. // If s does not have at least 8 elements, it panics. func LoadUint64x8(s []uint64) Uint64x8 { return LoadUint64x8Array((*[8]uint64)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 8 elements, it panics. func (x Uint64x8) Store(s []uint64) { x.StoreArray((*[8]uint64)(s)) } // LoadFloat32x16 loads a Float32x16 from a slice of elements. // If s does not have at least 16 elements, it panics. func LoadFloat32x16(s []float32) Float32x16 { return LoadFloat32x16Array((*[16]float32)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 16 elements, it panics. func (x Float32x16) Store(s []float32) { x.StoreArray((*[16]float32)(s)) } // LoadFloat64x8 loads a Float64x8 from a slice of elements. // If s does not have at least 8 elements, it panics. func LoadFloat64x8(s []float64) Float64x8 { return LoadFloat64x8Array((*[8]float64)(s)) } // Store stores the elements of x into a slice. // If s does not have at least 8 elements, it panics. func (x Float64x8) Store(s []float64) { x.StoreArray((*[8]float64)(s)) } // LoadInt8x64Part loads a Int8x64 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 64 elements, the remaining elements of the vector are filled with zeroes. // If s has 64 or more elements, the function is equivalent to LoadInt8x64. func LoadInt8x64Part(s []int8) (Int8x64, int) { l := len(s) if l >= 64 { return LoadInt8x64(s), 64 } if l == 0 { var x Int8x64 return x, 0 } mask := Mask8x64FromBits(0xffffffffffffffff >> (64 - l)) return LoadInt8x64Array(paInt8x64(s)).Masked(mask), l } // StorePart stores the 64 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 64 or more elements, the method is equivalent to x.Store. func (x Int8x64) StorePart(s []int8) int { l := len(s) if l >= 64 { x.Store(s) return 64 } if l == 0 { return 0 } mask := Mask8x64FromBits(0xffffffffffffffff >> (64 - l)) x.StoreArrayMasked(paInt8x64(s), mask) return l } // LoadInt16x32Part loads a Int16x32 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 32 elements, the remaining elements of the vector are filled with zeroes. // If s has 32 or more elements, the function is equivalent to LoadInt16x32. func LoadInt16x32Part(s []int16) (Int16x32, int) { l := len(s) if l >= 32 { return LoadInt16x32(s), 32 } if l == 0 { var x Int16x32 return x, 0 } mask := Mask16x32FromBits(0xffffffff >> (32 - l)) return LoadInt16x32Array(paInt16x32(s)).Masked(mask), l } // StorePart stores the 32 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 32 or more elements, the method is equivalent to x.Store. func (x Int16x32) StorePart(s []int16) int { l := len(s) if l >= 32 { x.Store(s) return 32 } if l == 0 { return 0 } mask := Mask16x32FromBits(0xffffffff >> (32 - l)) x.StoreArrayMasked(paInt16x32(s), mask) return l } // LoadInt32x16Part loads a Int32x16 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 16 elements, the remaining elements of the vector are filled with zeroes. // If s has 16 or more elements, the function is equivalent to LoadInt32x16. func LoadInt32x16Part(s []int32) (Int32x16, int) { l := len(s) if l >= 16 { return LoadInt32x16(s), 16 } if l == 0 { var x Int32x16 return x, 0 } mask := Mask32x16FromBits(0xffff >> (16 - l)) return LoadInt32x16Array(paInt32x16(s)).Masked(mask), l } // StorePart stores the 16 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 16 or more elements, the method is equivalent to x.Store. func (x Int32x16) StorePart(s []int32) int { l := len(s) if l >= 16 { x.Store(s) return 16 } if l == 0 { return 0 } mask := Mask32x16FromBits(0xffff >> (16 - l)) x.StoreArrayMasked(paInt32x16(s), mask) return l } // LoadInt64x8Part loads a Int64x8 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 8 elements, the remaining elements of the vector are filled with zeroes. // If s has 8 or more elements, the function is equivalent to LoadInt64x8. func LoadInt64x8Part(s []int64) (Int64x8, int) { l := len(s) if l >= 8 { return LoadInt64x8(s), 8 } if l == 0 { var x Int64x8 return x, 0 } mask := Mask64x8FromBits(0xff >> (8 - l)) return LoadInt64x8Array(paInt64x8(s)).Masked(mask), l } // StorePart stores the 8 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 8 or more elements, the method is equivalent to x.Store. func (x Int64x8) StorePart(s []int64) int { l := len(s) if l >= 8 { x.Store(s) return 8 } if l == 0 { return 0 } mask := Mask64x8FromBits(0xff >> (8 - l)) x.StoreArrayMasked(paInt64x8(s), mask) return l } // LoadUint8x64Part loads a Uint8x64 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 64 elements, the remaining elements of the vector are filled with zeroes. // If s has 64 or more elements, the function is equivalent to LoadUint8x64. func LoadUint8x64Part(s []uint8) (Uint8x64, int) { l := len(s) if l >= 64 { return LoadUint8x64(s), 64 } if l == 0 { var x Uint8x64 return x, 0 } mask := Mask8x64FromBits(0xffffffffffffffff >> (64 - l)) return LoadUint8x64Array(paUint8x64(s)).Masked(mask), l } // StorePart stores the 64 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 64 or more elements, the method is equivalent to x.Store. func (x Uint8x64) StorePart(s []uint8) int { l := len(s) if l >= 64 { x.Store(s) return 64 } if l == 0 { return 0 } mask := Mask8x64FromBits(0xffffffffffffffff >> (64 - l)) x.StoreArrayMasked(paUint8x64(s), mask) return l } // LoadUint16x32Part loads a Uint16x32 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 32 elements, the remaining elements of the vector are filled with zeroes. // If s has 32 or more elements, the function is equivalent to LoadUint16x32. func LoadUint16x32Part(s []uint16) (Uint16x32, int) { l := len(s) if l >= 32 { return LoadUint16x32(s), 32 } if l == 0 { var x Uint16x32 return x, 0 } mask := Mask16x32FromBits(0xffffffff >> (32 - l)) return LoadUint16x32Array(paUint16x32(s)).Masked(mask), l } // StorePart stores the 32 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 32 or more elements, the method is equivalent to x.Store. func (x Uint16x32) StorePart(s []uint16) int { l := len(s) if l >= 32 { x.Store(s) return 32 } if l == 0 { return 0 } mask := Mask16x32FromBits(0xffffffff >> (32 - l)) x.StoreArrayMasked(paUint16x32(s), mask) return l } // LoadUint32x16Part loads a Uint32x16 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 16 elements, the remaining elements of the vector are filled with zeroes. // If s has 16 or more elements, the function is equivalent to LoadUint32x16. func LoadUint32x16Part(s []uint32) (Uint32x16, int) { l := len(s) if l >= 16 { return LoadUint32x16(s), 16 } if l == 0 { var x Uint32x16 return x, 0 } mask := Mask32x16FromBits(0xffff >> (16 - l)) return LoadUint32x16Array(paUint32x16(s)).Masked(mask), l } // StorePart stores the 16 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 16 or more elements, the method is equivalent to x.Store. func (x Uint32x16) StorePart(s []uint32) int { l := len(s) if l >= 16 { x.Store(s) return 16 } if l == 0 { return 0 } mask := Mask32x16FromBits(0xffff >> (16 - l)) x.StoreArrayMasked(paUint32x16(s), mask) return l } // LoadUint64x8Part loads a Uint64x8 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 8 elements, the remaining elements of the vector are filled with zeroes. // If s has 8 or more elements, the function is equivalent to LoadUint64x8. func LoadUint64x8Part(s []uint64) (Uint64x8, int) { l := len(s) if l >= 8 { return LoadUint64x8(s), 8 } if l == 0 { var x Uint64x8 return x, 0 } mask := Mask64x8FromBits(0xff >> (8 - l)) return LoadUint64x8Array(paUint64x8(s)).Masked(mask), l } // StorePart stores the 8 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 8 or more elements, the method is equivalent to x.Store. func (x Uint64x8) StorePart(s []uint64) int { l := len(s) if l >= 8 { x.Store(s) return 8 } if l == 0 { return 0 } mask := Mask64x8FromBits(0xff >> (8 - l)) x.StoreArrayMasked(paUint64x8(s), mask) return l } // LoadFloat32x16Part loads a Float32x16 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 16 elements, the remaining elements of the vector are filled with zeroes. // If s has 16 or more elements, the function is equivalent to LoadFloat32x16. func LoadFloat32x16Part(s []float32) (Float32x16, int) { l := len(s) if l >= 16 { return LoadFloat32x16(s), 16 } if l == 0 { var x Float32x16 return x, 0 } mask := Mask32x16FromBits(0xffff >> (16 - l)) return LoadFloat32x16Array(paFloat32x16(s)).Masked(mask), l } // StorePart stores the 16 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 16 or more elements, the method is equivalent to x.Store. func (x Float32x16) StorePart(s []float32) int { l := len(s) if l >= 16 { x.Store(s) return 16 } if l == 0 { return 0 } mask := Mask32x16FromBits(0xffff >> (16 - l)) x.StoreArrayMasked(paFloat32x16(s), mask) return l } // LoadFloat64x8Part loads a Float64x8 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 8 elements, the remaining elements of the vector are filled with zeroes. // If s has 8 or more elements, the function is equivalent to LoadFloat64x8. func LoadFloat64x8Part(s []float64) (Float64x8, int) { l := len(s) if l >= 8 { return LoadFloat64x8(s), 8 } if l == 0 { var x Float64x8 return x, 0 } mask := Mask64x8FromBits(0xff >> (8 - l)) return LoadFloat64x8Array(paFloat64x8(s)).Masked(mask), l } // StorePart stores the 8 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 8 or more elements, the method is equivalent to x.Store. func (x Float64x8) StorePart(s []float64) int { l := len(s) if l >= 8 { x.Store(s) return 8 } if l == 0 { return 0 } mask := Mask64x8FromBits(0xff >> (8 - l)) x.StoreArrayMasked(paFloat64x8(s), mask) return l } // LoadInt32x4Part loads a Int32x4 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 4 elements, the remaining elements of the vector are filled with zeroes. // If s has 4 or more elements, the function is equivalent to LoadInt32x4. func LoadInt32x4Part(s []int32) (Int32x4, int) { l := len(s) if l >= 4 { return LoadInt32x4(s), 4 } if l == 0 { var x Int32x4 return x, 0 } mask := vecMask32[len(vecMask32)/2-l:] return LoadInt32x4Array(paInt32x4(s)).Masked(LoadInt32x4(mask).asMask()), l } // StorePart stores the 4 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 4 or more elements, the method is equivalent to x.Store. func (x Int32x4) StorePart(s []int32) int { l := len(s) if l >= 4 { x.Store(s) return 4 } if l == 0 { return 0 } mask := vecMask32[len(vecMask32)/2-l:] x.StoreArrayMasked(paInt32x4(s), LoadInt32x4(mask).asMask()) return l } // LoadInt64x2Part loads a Int64x2 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 2 elements, the remaining elements of the vector are filled with zeroes. // If s has 2 or more elements, the function is equivalent to LoadInt64x2. func LoadInt64x2Part(s []int64) (Int64x2, int) { l := len(s) if l >= 2 { return LoadInt64x2(s), 2 } if l == 0 { var x Int64x2 return x, 0 } mask := vecMask64[len(vecMask64)/2-l:] return LoadInt64x2Array(paInt64x2(s)).Masked(LoadInt64x2(mask).asMask()), l } // StorePart stores the 2 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 2 or more elements, the method is equivalent to x.Store. func (x Int64x2) StorePart(s []int64) int { l := len(s) if l >= 2 { x.Store(s) return 2 } if l == 0 { return 0 } mask := vecMask64[len(vecMask64)/2-l:] x.StoreArrayMasked(paInt64x2(s), LoadInt64x2(mask).asMask()) return l } // LoadUint32x4Part loads a Uint32x4 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 4 elements, the remaining elements of the vector are filled with zeroes. // If s has 4 or more elements, the function is equivalent to LoadUint32x4. func LoadUint32x4Part(s []uint32) (Uint32x4, int) { l := len(s) if l >= 4 { return LoadUint32x4(s), 4 } if l == 0 { var x Uint32x4 return x, 0 } mask := vecMask32[len(vecMask32)/2-l:] return LoadUint32x4Array(paUint32x4(s)).Masked(LoadInt32x4(mask).asMask()), l } // StorePart stores the 4 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 4 or more elements, the method is equivalent to x.Store. func (x Uint32x4) StorePart(s []uint32) int { l := len(s) if l >= 4 { x.Store(s) return 4 } if l == 0 { return 0 } mask := vecMask32[len(vecMask32)/2-l:] x.StoreArrayMasked(paUint32x4(s), LoadInt32x4(mask).asMask()) return l } // LoadUint64x2Part loads a Uint64x2 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 2 elements, the remaining elements of the vector are filled with zeroes. // If s has 2 or more elements, the function is equivalent to LoadUint64x2. func LoadUint64x2Part(s []uint64) (Uint64x2, int) { l := len(s) if l >= 2 { return LoadUint64x2(s), 2 } if l == 0 { var x Uint64x2 return x, 0 } mask := vecMask64[len(vecMask64)/2-l:] return LoadUint64x2Array(paUint64x2(s)).Masked(LoadInt64x2(mask).asMask()), l } // StorePart stores the 2 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 2 or more elements, the method is equivalent to x.Store. func (x Uint64x2) StorePart(s []uint64) int { l := len(s) if l >= 2 { x.Store(s) return 2 } if l == 0 { return 0 } mask := vecMask64[len(vecMask64)/2-l:] x.StoreArrayMasked(paUint64x2(s), LoadInt64x2(mask).asMask()) return l } // LoadFloat32x4Part loads a Float32x4 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 4 elements, the remaining elements of the vector are filled with zeroes. // If s has 4 or more elements, the function is equivalent to LoadFloat32x4. func LoadFloat32x4Part(s []float32) (Float32x4, int) { l := len(s) if l >= 4 { return LoadFloat32x4(s), 4 } if l == 0 { var x Float32x4 return x, 0 } mask := vecMask32[len(vecMask32)/2-l:] return LoadFloat32x4Array(paFloat32x4(s)).Masked(LoadInt32x4(mask).asMask()), l } // StorePart stores the 4 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 4 or more elements, the method is equivalent to x.Store. func (x Float32x4) StorePart(s []float32) int { l := len(s) if l >= 4 { x.Store(s) return 4 } if l == 0 { return 0 } mask := vecMask32[len(vecMask32)/2-l:] x.StoreArrayMasked(paFloat32x4(s), LoadInt32x4(mask).asMask()) return l } // LoadFloat64x2Part loads a Float64x2 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 2 elements, the remaining elements of the vector are filled with zeroes. // If s has 2 or more elements, the function is equivalent to LoadFloat64x2. func LoadFloat64x2Part(s []float64) (Float64x2, int) { l := len(s) if l >= 2 { return LoadFloat64x2(s), 2 } if l == 0 { var x Float64x2 return x, 0 } mask := vecMask64[len(vecMask64)/2-l:] return LoadFloat64x2Array(paFloat64x2(s)).Masked(LoadInt64x2(mask).asMask()), l } // StorePart stores the 2 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 2 or more elements, the method is equivalent to x.Store. func (x Float64x2) StorePart(s []float64) int { l := len(s) if l >= 2 { x.Store(s) return 2 } if l == 0 { return 0 } mask := vecMask64[len(vecMask64)/2-l:] x.StoreArrayMasked(paFloat64x2(s), LoadInt64x2(mask).asMask()) return l } // LoadInt32x8Part loads a Int32x8 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 8 elements, the remaining elements of the vector are filled with zeroes. // If s has 8 or more elements, the function is equivalent to LoadInt32x8. func LoadInt32x8Part(s []int32) (Int32x8, int) { l := len(s) if l >= 8 { return LoadInt32x8(s), 8 } if l == 0 { var x Int32x8 return x, 0 } mask := vecMask32[len(vecMask32)/2-l:] return LoadInt32x8Array(paInt32x8(s)).Masked(LoadInt32x8(mask).asMask()), l } // StorePart stores the 8 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 8 or more elements, the method is equivalent to x.Store. func (x Int32x8) StorePart(s []int32) int { l := len(s) if l >= 8 { x.Store(s) return 8 } if l == 0 { return 0 } mask := vecMask32[len(vecMask32)/2-l:] x.StoreArrayMasked(paInt32x8(s), LoadInt32x8(mask).asMask()) return l } // LoadInt64x4Part loads a Int64x4 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 4 elements, the remaining elements of the vector are filled with zeroes. // If s has 4 or more elements, the function is equivalent to LoadInt64x4. func LoadInt64x4Part(s []int64) (Int64x4, int) { l := len(s) if l >= 4 { return LoadInt64x4(s), 4 } if l == 0 { var x Int64x4 return x, 0 } mask := vecMask64[len(vecMask64)/2-l:] return LoadInt64x4Array(paInt64x4(s)).Masked(LoadInt64x4(mask).asMask()), l } // StorePart stores the 4 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 4 or more elements, the method is equivalent to x.Store. func (x Int64x4) StorePart(s []int64) int { l := len(s) if l >= 4 { x.Store(s) return 4 } if l == 0 { return 0 } mask := vecMask64[len(vecMask64)/2-l:] x.StoreArrayMasked(paInt64x4(s), LoadInt64x4(mask).asMask()) return l } // LoadUint32x8Part loads a Uint32x8 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 8 elements, the remaining elements of the vector are filled with zeroes. // If s has 8 or more elements, the function is equivalent to LoadUint32x8. func LoadUint32x8Part(s []uint32) (Uint32x8, int) { l := len(s) if l >= 8 { return LoadUint32x8(s), 8 } if l == 0 { var x Uint32x8 return x, 0 } mask := vecMask32[len(vecMask32)/2-l:] return LoadUint32x8Array(paUint32x8(s)).Masked(LoadInt32x8(mask).asMask()), l } // StorePart stores the 8 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 8 or more elements, the method is equivalent to x.Store. func (x Uint32x8) StorePart(s []uint32) int { l := len(s) if l >= 8 { x.Store(s) return 8 } if l == 0 { return 0 } mask := vecMask32[len(vecMask32)/2-l:] x.StoreArrayMasked(paUint32x8(s), LoadInt32x8(mask).asMask()) return l } // LoadUint64x4Part loads a Uint64x4 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 4 elements, the remaining elements of the vector are filled with zeroes. // If s has 4 or more elements, the function is equivalent to LoadUint64x4. func LoadUint64x4Part(s []uint64) (Uint64x4, int) { l := len(s) if l >= 4 { return LoadUint64x4(s), 4 } if l == 0 { var x Uint64x4 return x, 0 } mask := vecMask64[len(vecMask64)/2-l:] return LoadUint64x4Array(paUint64x4(s)).Masked(LoadInt64x4(mask).asMask()), l } // StorePart stores the 4 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 4 or more elements, the method is equivalent to x.Store. func (x Uint64x4) StorePart(s []uint64) int { l := len(s) if l >= 4 { x.Store(s) return 4 } if l == 0 { return 0 } mask := vecMask64[len(vecMask64)/2-l:] x.StoreArrayMasked(paUint64x4(s), LoadInt64x4(mask).asMask()) return l } // LoadFloat32x8Part loads a Float32x8 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 8 elements, the remaining elements of the vector are filled with zeroes. // If s has 8 or more elements, the function is equivalent to LoadFloat32x8. func LoadFloat32x8Part(s []float32) (Float32x8, int) { l := len(s) if l >= 8 { return LoadFloat32x8(s), 8 } if l == 0 { var x Float32x8 return x, 0 } mask := vecMask32[len(vecMask32)/2-l:] return LoadFloat32x8Array(paFloat32x8(s)).Masked(LoadInt32x8(mask).asMask()), l } // StorePart stores the 8 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 8 or more elements, the method is equivalent to x.Store. func (x Float32x8) StorePart(s []float32) int { l := len(s) if l >= 8 { x.Store(s) return 8 } if l == 0 { return 0 } mask := vecMask32[len(vecMask32)/2-l:] x.StoreArrayMasked(paFloat32x8(s), LoadInt32x8(mask).asMask()) return l } // LoadFloat64x4Part loads a Float64x4 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 4 elements, the remaining elements of the vector are filled with zeroes. // If s has 4 or more elements, the function is equivalent to LoadFloat64x4. func LoadFloat64x4Part(s []float64) (Float64x4, int) { l := len(s) if l >= 4 { return LoadFloat64x4(s), 4 } if l == 0 { var x Float64x4 return x, 0 } mask := vecMask64[len(vecMask64)/2-l:] return LoadFloat64x4Array(paFloat64x4(s)).Masked(LoadInt64x4(mask).asMask()), l } // StorePart stores the 4 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 4 or more elements, the method is equivalent to x.Store. func (x Float64x4) StorePart(s []float64) int { l := len(s) if l >= 4 { x.Store(s) return 4 } if l == 0 { return 0 } mask := vecMask64[len(vecMask64)/2-l:] x.StoreArrayMasked(paFloat64x4(s), LoadInt64x4(mask).asMask()) return l } // LoadUint8x32Part loads a Uint8x32 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 32 elements, the remaining elements of the vector are filled with zeroes. // If s has 32 or more elements, the function is equivalent to LoadUint8x32. func LoadUint8x32Part(s []uint8) (Uint8x32, int) { if len(s) == 0 { var zero Uint8x32 return zero, 0 } t := unsafe.Slice((*int8)(unsafe.Pointer(&s[0])), len(s)) v, l := LoadInt8x32Part(t) return v.AsUint8x32(), l } // StorePart stores the 32 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 32 or more elements, the method is equivalent to x.Store. func (x Uint8x32) StorePart(s []uint8) int { if len(s) == 0 { return 0 } t := unsafe.Slice((*int8)(unsafe.Pointer(&s[0])), len(s)) return x.AsInt8x32().StorePart(t) } // LoadUint16x16Part loads a Uint16x16 from the slice s, it returns the loaded vector and the // number of elements loaded. // If s has fewer than 16 elements, the remaining elements of the vector are filled with zeroes. // If s has 16 or more elements, the function is equivalent to LoadUint16x16. func LoadUint16x16Part(s []uint16) (Uint16x16, int) { if len(s) == 0 { var zero Uint16x16 return zero, 0 } t := unsafe.Slice((*int16)(unsafe.Pointer(&s[0])), len(s)) v, l := LoadInt16x16Part(t) return v.AsUint16x16(), l } // StorePart stores the 16 elements of x into the slice s. // It stores as many elements as will fit in s. // If s has 16 or more elements, the method is equivalent to x.Store. func (x Uint16x16) StorePart(s []uint16) int { if len(s) == 0 { return 0 } t := unsafe.Slice((*int16)(unsafe.Pointer(&s[0])), len(s)) return x.AsInt16x16().StorePart(t) }