gitee.com/quant1x/num@v0.3.2/internal/functions/special_amd64.go (about)

     1  package functions
     2  
     3  import (
     4  	"gitee.com/quant1x/num/math32"
     5  	"math"
     6  )
     7  
     8  func Pow_AVX2_F64(x, y []float64) {
     9  	nSimd := len(x) & (-4)
    10  	Pow_4x_AVX2_F64(x[:nSimd], y[:nSimd])
    11  	for i := nSimd; i < len(x); i++ {
    12  		x[i] = math.Pow(x[i], y[i])
    13  	}
    14  }
    15  
    16  func Pow_AVX2_F32(x, y []float32) {
    17  	nSimd := len(x) & (-8)
    18  	Pow_8x_AVX2_F32(x[:nSimd], y[:nSimd])
    19  	for i := nSimd; i < len(x); i++ {
    20  		x[i] = math32.Pow(x[i], y[i])
    21  	}
    22  }
    23  
    24  func Exp_AVX2_F32(x []float32) {
    25  	nSimd := (len(x) / 8) * 8
    26  	Exp_Len8x_AVX2_F32(x[:nSimd])
    27  	for i := nSimd; i < len(x); i++ {
    28  		x[i] = math32.Exp(x[i])
    29  	}
    30  }
    31  
    32  func Log_AVX2_F32(x []float32) {
    33  	nSimd := (len(x) / 8) * 8
    34  	Log_Len8x_AVX2_F32(x[:nSimd])
    35  	for i := nSimd; i < len(x); i++ {
    36  		x[i] = math32.Log(x[i])
    37  	}
    38  }
    39  
    40  func Log2_AVX2_F32(x []float32) {
    41  	nSimd := (len(x) / 8) * 8
    42  	Log2_Len8x_AVX2_F32(x[:nSimd])
    43  	for i := nSimd; i < len(x); i++ {
    44  		x[i] = math32.Log2(x[i])
    45  	}
    46  }
    47  
    48  func Log10_AVX2_F32(x []float32) {
    49  	nSimd := (len(x) / 8) * 8
    50  	Log10_Len8x_AVX2_F32(x[:nSimd])
    51  	for i := nSimd; i < len(x); i++ {
    52  		x[i] = math32.Log10(x[i])
    53  	}
    54  }