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