mirror of
https://github.com/golang/go.git
synced 2026-02-03 09:25:06 +03:00
simd/archsimd: rename Mask.AsIntMxN to Mask.ToIntMxN
To be more consistent with vector.ToMask and mask.ToBits. Cherry-pick CL 729022 from the dev.simd branch, for Go 1.26. Change-Id: I4ea4dfd0059d256f39a93d1fe2ce1de158049800 Reviewed-on: https://go-review.googlesource.com/c/go/+/729223 Auto-Submit: David Chase <drchase@google.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
@@ -1742,73 +1742,73 @@ func simdIntrinsics(addF func(pkg, fn string, b intrinsicBuilder, archFamilies .
|
||||
addF(simdPackage, "Mask32x16.StoreMasked", simdMaskedStore(ssa.OpStoreMasked32), sys.AMD64)
|
||||
addF(simdPackage, "LoadMaskedMask64x8", simdMaskedLoad(ssa.OpLoadMasked64), sys.AMD64)
|
||||
addF(simdPackage, "Mask64x8.StoreMasked", simdMaskedStore(ssa.OpStoreMasked64), sys.AMD64)
|
||||
addF(simdPackage, "Mask8x16.AsInt8x16", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask8x16.ToInt8x16", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Int8x16.asMask", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask8x16.And", opLen2(ssa.OpAndInt32x4, types.TypeVec128), sys.AMD64)
|
||||
addF(simdPackage, "Mask8x16.Or", opLen2(ssa.OpOrInt32x4, types.TypeVec128), sys.AMD64)
|
||||
addF(simdPackage, "Mask8x16FromBits", simdCvtVToMask(8, 16), sys.AMD64)
|
||||
addF(simdPackage, "Mask8x16.ToBits", simdCvtMaskToV(8, 16), sys.AMD64)
|
||||
addF(simdPackage, "Mask8x32.AsInt8x32", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask8x32.ToInt8x32", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Int8x32.asMask", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask8x32.And", opLen2(ssa.OpAndInt32x8, types.TypeVec256), sys.AMD64)
|
||||
addF(simdPackage, "Mask8x32.Or", opLen2(ssa.OpOrInt32x8, types.TypeVec256), sys.AMD64)
|
||||
addF(simdPackage, "Mask8x32FromBits", simdCvtVToMask(8, 32), sys.AMD64)
|
||||
addF(simdPackage, "Mask8x32.ToBits", simdCvtMaskToV(8, 32), sys.AMD64)
|
||||
addF(simdPackage, "Mask8x64.AsInt8x64", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask8x64.ToInt8x64", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Int8x64.asMask", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask8x64.And", opLen2(ssa.OpAndInt32x16, types.TypeVec512), sys.AMD64)
|
||||
addF(simdPackage, "Mask8x64.Or", opLen2(ssa.OpOrInt32x16, types.TypeVec512), sys.AMD64)
|
||||
addF(simdPackage, "Mask8x64FromBits", simdCvtVToMask(8, 64), sys.AMD64)
|
||||
addF(simdPackage, "Mask8x64.ToBits", simdCvtMaskToV(8, 64), sys.AMD64)
|
||||
addF(simdPackage, "Mask16x8.AsInt16x8", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask16x8.ToInt16x8", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Int16x8.asMask", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask16x8.And", opLen2(ssa.OpAndInt32x4, types.TypeVec128), sys.AMD64)
|
||||
addF(simdPackage, "Mask16x8.Or", opLen2(ssa.OpOrInt32x4, types.TypeVec128), sys.AMD64)
|
||||
addF(simdPackage, "Mask16x8FromBits", simdCvtVToMask(16, 8), sys.AMD64)
|
||||
addF(simdPackage, "Mask16x8.ToBits", simdCvtMaskToV(16, 8), sys.AMD64)
|
||||
addF(simdPackage, "Mask16x16.AsInt16x16", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask16x16.ToInt16x16", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Int16x16.asMask", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask16x16.And", opLen2(ssa.OpAndInt32x8, types.TypeVec256), sys.AMD64)
|
||||
addF(simdPackage, "Mask16x16.Or", opLen2(ssa.OpOrInt32x8, types.TypeVec256), sys.AMD64)
|
||||
addF(simdPackage, "Mask16x16FromBits", simdCvtVToMask(16, 16), sys.AMD64)
|
||||
addF(simdPackage, "Mask16x16.ToBits", simdCvtMaskToV(16, 16), sys.AMD64)
|
||||
addF(simdPackage, "Mask16x32.AsInt16x32", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask16x32.ToInt16x32", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Int16x32.asMask", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask16x32.And", opLen2(ssa.OpAndInt32x16, types.TypeVec512), sys.AMD64)
|
||||
addF(simdPackage, "Mask16x32.Or", opLen2(ssa.OpOrInt32x16, types.TypeVec512), sys.AMD64)
|
||||
addF(simdPackage, "Mask16x32FromBits", simdCvtVToMask(16, 32), sys.AMD64)
|
||||
addF(simdPackage, "Mask16x32.ToBits", simdCvtMaskToV(16, 32), sys.AMD64)
|
||||
addF(simdPackage, "Mask32x4.AsInt32x4", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask32x4.ToInt32x4", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Int32x4.asMask", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask32x4.And", opLen2(ssa.OpAndInt32x4, types.TypeVec128), sys.AMD64)
|
||||
addF(simdPackage, "Mask32x4.Or", opLen2(ssa.OpOrInt32x4, types.TypeVec128), sys.AMD64)
|
||||
addF(simdPackage, "Mask32x4FromBits", simdCvtVToMask(32, 4), sys.AMD64)
|
||||
addF(simdPackage, "Mask32x4.ToBits", simdCvtMaskToV(32, 4), sys.AMD64)
|
||||
addF(simdPackage, "Mask32x8.AsInt32x8", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask32x8.ToInt32x8", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Int32x8.asMask", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask32x8.And", opLen2(ssa.OpAndInt32x8, types.TypeVec256), sys.AMD64)
|
||||
addF(simdPackage, "Mask32x8.Or", opLen2(ssa.OpOrInt32x8, types.TypeVec256), sys.AMD64)
|
||||
addF(simdPackage, "Mask32x8FromBits", simdCvtVToMask(32, 8), sys.AMD64)
|
||||
addF(simdPackage, "Mask32x8.ToBits", simdCvtMaskToV(32, 8), sys.AMD64)
|
||||
addF(simdPackage, "Mask32x16.AsInt32x16", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask32x16.ToInt32x16", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Int32x16.asMask", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask32x16.And", opLen2(ssa.OpAndInt32x16, types.TypeVec512), sys.AMD64)
|
||||
addF(simdPackage, "Mask32x16.Or", opLen2(ssa.OpOrInt32x16, types.TypeVec512), sys.AMD64)
|
||||
addF(simdPackage, "Mask32x16FromBits", simdCvtVToMask(32, 16), sys.AMD64)
|
||||
addF(simdPackage, "Mask32x16.ToBits", simdCvtMaskToV(32, 16), sys.AMD64)
|
||||
addF(simdPackage, "Mask64x2.AsInt64x2", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask64x2.ToInt64x2", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Int64x2.asMask", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask64x2.And", opLen2(ssa.OpAndInt32x4, types.TypeVec128), sys.AMD64)
|
||||
addF(simdPackage, "Mask64x2.Or", opLen2(ssa.OpOrInt32x4, types.TypeVec128), sys.AMD64)
|
||||
addF(simdPackage, "Mask64x2FromBits", simdCvtVToMask(64, 2), sys.AMD64)
|
||||
addF(simdPackage, "Mask64x2.ToBits", simdCvtMaskToV(64, 2), sys.AMD64)
|
||||
addF(simdPackage, "Mask64x4.AsInt64x4", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask64x4.ToInt64x4", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Int64x4.asMask", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask64x4.And", opLen2(ssa.OpAndInt32x8, types.TypeVec256), sys.AMD64)
|
||||
addF(simdPackage, "Mask64x4.Or", opLen2(ssa.OpOrInt32x8, types.TypeVec256), sys.AMD64)
|
||||
addF(simdPackage, "Mask64x4FromBits", simdCvtVToMask(64, 4), sys.AMD64)
|
||||
addF(simdPackage, "Mask64x4.ToBits", simdCvtMaskToV(64, 4), sys.AMD64)
|
||||
addF(simdPackage, "Mask64x8.AsInt64x8", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask64x8.ToInt64x8", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Int64x8.asMask", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "Mask64x8.And", opLen2(ssa.OpAndInt32x16, types.TypeVec512), sys.AMD64)
|
||||
addF(simdPackage, "Mask64x8.Or", opLen2(ssa.OpOrInt32x16, types.TypeVec512), sys.AMD64)
|
||||
|
||||
@@ -78,7 +78,7 @@ func simdIntrinsics(addF func(pkg, fn string, b intrinsicBuilder, archFamilies .
|
||||
addF(simdPackage, "{{.Name}}.StoreMasked", simdMaskedStore(ssa.OpStoreMasked{{.ElemBits}}), sys.AMD64)
|
||||
{{end}}
|
||||
|
||||
{{define "mask"}} addF(simdPackage, "{{.Name}}.As{{.VectorCounterpart}}", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
{{define "mask"}} addF(simdPackage, "{{.Name}}.To{{.VectorCounterpart}}", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "{{.VectorCounterpart}}.asMask", func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value { return args[0] }, sys.AMD64)
|
||||
addF(simdPackage, "{{.Name}}.And", opLen2(ssa.OpAnd{{.ReshapedVectorWithAndOr}}, types.TypeVec{{.Size}}), sys.AMD64)
|
||||
addF(simdPackage, "{{.Name}}.Or", opLen2(ssa.OpOr{{.ReshapedVectorWithAndOr}}, types.TypeVec{{.Size}}), sys.AMD64)
|
||||
|
||||
@@ -400,8 +400,8 @@ func (from {{.Tsrc.Name}}) As{{.Tdst.Name}}() (to {{.Tdst.Name}})
|
||||
{{end}}
|
||||
|
||||
{{define "mask"}}
|
||||
// As{{.VectorCounterpart}} converts from {{.Name}} to {{.VectorCounterpart}}
|
||||
func (from {{.Name}}) As{{.VectorCounterpart}}() (to {{.VectorCounterpart}})
|
||||
// To{{.VectorCounterpart}} converts from {{.Name}} to {{.VectorCounterpart}}
|
||||
func (from {{.Name}}) To{{.VectorCounterpart}}() (to {{.VectorCounterpart}})
|
||||
|
||||
// asMask converts from {{.VectorCounterpart}} to {{.Name}}
|
||||
func (from {{.VectorCounterpart}}) asMask() (to {{.Name}})
|
||||
|
||||
@@ -440,7 +440,7 @@ func test{{.VType}}Compare(t *testing.T, f func(_, _ archsimd.{{.VType}}) archsi
|
||||
a := archsimd.Load{{.VType}}Slice(x)
|
||||
b := archsimd.Load{{.VType}}Slice(y)
|
||||
g := make([]int{{.EWidth}}, n)
|
||||
f(a, b).AsInt{{.WxC}}().StoreSlice(g)
|
||||
f(a, b).ToInt{{.WxC}}().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() {t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); })
|
||||
})
|
||||
@@ -462,7 +462,7 @@ func test{{.VType}}CompareMasked(t *testing.T,
|
||||
b := archsimd.Load{{.VType}}Slice(y)
|
||||
k := archsimd.LoadInt{{.WxC}}Slice(toVect[int{{.EWidth}}](m)).ToMask()
|
||||
g := make([]int{{.EWidth}}, n)
|
||||
f(a, b, k).AsInt{{.WxC}}().StoreSlice(g)
|
||||
f(a, b, k).ToInt{{.WxC}}().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -591,24 +591,24 @@ func (x {{.VType}}) Less(y {{.VType}}) Mask{{.WxC}} {
|
||||
//
|
||||
// Emulated, CPU Feature {{.CPUfeature}}
|
||||
func (x {{.VType}}) GreaterEqual(y {{.VType}}) Mask{{.WxC}} {
|
||||
ones := x.Equal(x).AsInt{{.WxC}}()
|
||||
return y.Greater(x).AsInt{{.WxC}}().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt{{.WxC}}()
|
||||
return y.Greater(x).ToInt{{.WxC}}().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
//
|
||||
// Emulated, CPU Feature {{.CPUfeature}}
|
||||
func (x {{.VType}}) LessEqual(y {{.VType}}) Mask{{.WxC}} {
|
||||
ones := x.Equal(x).AsInt{{.WxC}}()
|
||||
return x.Greater(y).AsInt{{.WxC}}().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt{{.WxC}}()
|
||||
return x.Greater(y).ToInt{{.WxC}}().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
//
|
||||
// Emulated, CPU Feature {{.CPUfeature}}
|
||||
func (x {{.VType}}) NotEqual(y {{.VType}}) Mask{{.WxC}} {
|
||||
ones := x.Equal(x).AsInt{{.WxC}}()
|
||||
return x.Equal(y).AsInt{{.WxC}}().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt{{.WxC}}()
|
||||
return x.Equal(y).ToInt{{.WxC}}().Xor(ones).asMask()
|
||||
}
|
||||
`)
|
||||
|
||||
@@ -617,7 +617,7 @@ var bitWiseIntTemplate = shapedTemplateOf(intShapes, "bitwise int complement", `
|
||||
//
|
||||
// Emulated, CPU Feature {{.CPUfeature}}
|
||||
func (x {{.VType}}) Not() {{.VType}} {
|
||||
return x.Xor(x.Equal(x).As{{.VType}}())
|
||||
return x.Xor(x.Equal(x).ToInt{{.WxC}}())
|
||||
}
|
||||
`)
|
||||
|
||||
@@ -626,7 +626,7 @@ var bitWiseUintTemplate = shapedTemplateOf(uintShapes, "bitwise uint complement"
|
||||
//
|
||||
// Emulated, CPU Feature {{.CPUfeature}}
|
||||
func (x {{.VType}}) Not() {{.VType}} {
|
||||
return x.Xor(x.Equal(x).AsInt{{.WxC}}().As{{.VType}}())
|
||||
return x.Xor(x.Equal(x).ToInt{{.WxC}}().As{{.VType}}())
|
||||
}
|
||||
`)
|
||||
|
||||
@@ -651,7 +651,7 @@ func (x {{.VType}}) Greater(y {{.VType}}) Mask{{.WxC}} {
|
||||
{{- if eq .EWidth 8}}
|
||||
signs := BroadcastInt{{.WxC}}(-1 << ({{.EWidth}}-1))
|
||||
{{- else}}
|
||||
ones := x.Equal(x).AsInt{{.WxC}}()
|
||||
ones := x.Equal(x).ToInt{{.WxC}}()
|
||||
signs := ones.ShiftAllLeft({{.EWidth}}-1)
|
||||
{{- end }}
|
||||
return a.Xor(signs).Greater(b.Xor(signs))
|
||||
@@ -665,7 +665,7 @@ func (x {{.VType}}) Less(y {{.VType}}) Mask{{.WxC}} {
|
||||
{{- if eq .EWidth 8}}
|
||||
signs := BroadcastInt{{.WxC}}(-1 << ({{.EWidth}}-1))
|
||||
{{- else}}
|
||||
ones := x.Equal(x).AsInt{{.WxC}}()
|
||||
ones := x.Equal(x).ToInt{{.WxC}}()
|
||||
signs := ones.ShiftAllLeft({{.EWidth}}-1)
|
||||
{{- end }}
|
||||
return b.Xor(signs).Greater(a.Xor(signs))
|
||||
@@ -676,13 +676,13 @@ func (x {{.VType}}) Less(y {{.VType}}) Mask{{.WxC}} {
|
||||
// Emulated, CPU Feature {{.CPUfeatureAVX2if8}}
|
||||
func (x {{.VType}}) GreaterEqual(y {{.VType}}) Mask{{.WxC}} {
|
||||
a, b := x.AsInt{{.WxC}}(), y.AsInt{{.WxC}}()
|
||||
ones := x.Equal(x).AsInt{{.WxC}}()
|
||||
ones := x.Equal(x).ToInt{{.WxC}}()
|
||||
{{- if eq .EWidth 8}}
|
||||
signs := BroadcastInt{{.WxC}}(-1 << ({{.EWidth}}-1))
|
||||
{{- else}}
|
||||
signs := ones.ShiftAllLeft({{.EWidth}}-1)
|
||||
{{- end }}
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).AsInt{{.WxC}}().Xor(ones).asMask()
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).ToInt{{.WxC}}().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
@@ -690,13 +690,13 @@ func (x {{.VType}}) GreaterEqual(y {{.VType}}) Mask{{.WxC}} {
|
||||
// Emulated, CPU Feature {{.CPUfeatureAVX2if8}}
|
||||
func (x {{.VType}}) LessEqual(y {{.VType}}) Mask{{.WxC}} {
|
||||
a, b := x.AsInt{{.WxC}}(), y.AsInt{{.WxC}}()
|
||||
ones := x.Equal(x).AsInt{{.WxC}}()
|
||||
ones := x.Equal(x).ToInt{{.WxC}}()
|
||||
{{- if eq .EWidth 8}}
|
||||
signs := BroadcastInt{{.WxC}}(-1 << ({{.EWidth}}-1))
|
||||
{{- else}}
|
||||
signs := ones.ShiftAllLeft({{.EWidth}}-1)
|
||||
{{- end }}
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).AsInt{{.WxC}}().Xor(ones).asMask()
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).ToInt{{.WxC}}().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
@@ -704,8 +704,8 @@ func (x {{.VType}}) LessEqual(y {{.VType}}) Mask{{.WxC}} {
|
||||
// Emulated, CPU Feature {{.CPUfeature}}
|
||||
func (x {{.VType}}) NotEqual(y {{.VType}}) Mask{{.WxC}} {
|
||||
a, b := x.AsInt{{.WxC}}(), y.AsInt{{.WxC}}()
|
||||
ones := x.Equal(x).AsInt{{.WxC}}()
|
||||
return a.Equal(b).AsInt{{.WxC}}().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt{{.WxC}}()
|
||||
return a.Equal(b).ToInt{{.WxC}}().Xor(ones).asMask()
|
||||
}
|
||||
`)
|
||||
|
||||
@@ -721,7 +721,7 @@ func pa{{.VType}}(s []{{.Etype}}) *[{{.Count}}]{{.Etype}} {
|
||||
var avx2MaskedTemplate = shapedTemplateOf(avx2Shapes, "avx2 .Masked methods", `
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x {{.VType}}) Masked(mask Mask{{.WxC}}) {{.VType}} {
|
||||
im := mask.AsInt{{.WxC}}()
|
||||
im := mask.ToInt{{.WxC}}()
|
||||
{{- if eq .Base "Int" }}
|
||||
return im.And(x)
|
||||
{{- else}}
|
||||
@@ -732,9 +732,9 @@ func (x {{.VType}}) Masked(mask Mask{{.WxC}}) {{.VType}} {
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x {{.VType}}) Merge(y {{.VType}}, mask Mask{{.WxC}}) {{.VType}} {
|
||||
{{- if eq .BxC .WxC -}}
|
||||
im := mask.AsInt{{.BxC}}()
|
||||
im := mask.ToInt{{.BxC}}()
|
||||
{{- else}}
|
||||
im := mask.AsInt{{.WxC}}().AsInt{{.BxC}}()
|
||||
im := mask.ToInt{{.WxC}}().AsInt{{.BxC}}()
|
||||
{{- end -}}
|
||||
{{- if and (eq .Base "Int") (eq .BxC .WxC) }}
|
||||
return y.blend(x, im)
|
||||
@@ -750,7 +750,7 @@ func (x {{.VType}}) Merge(y {{.VType}}, mask Mask{{.WxC}}) {{.VType}} {
|
||||
var avx512MaskedTemplate = shapedTemplateOf(avx512Shapes, "avx512 .Masked methods", `
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x {{.VType}}) Masked(mask Mask{{.WxC}}) {{.VType}} {
|
||||
im := mask.AsInt{{.WxC}}()
|
||||
im := mask.ToInt{{.WxC}}()
|
||||
{{- if eq .Base "Int" }}
|
||||
return im.And(x)
|
||||
{{- else}}
|
||||
|
||||
@@ -15,24 +15,24 @@ func (x Int8x16) Less(y Int8x16) Mask8x16 {
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int8x16) GreaterEqual(y Int8x16) Mask8x16 {
|
||||
ones := x.Equal(x).AsInt8x16()
|
||||
return y.Greater(x).AsInt8x16().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt8x16()
|
||||
return y.Greater(x).ToInt8x16().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int8x16) LessEqual(y Int8x16) Mask8x16 {
|
||||
ones := x.Equal(x).AsInt8x16()
|
||||
return x.Greater(y).AsInt8x16().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt8x16()
|
||||
return x.Greater(y).ToInt8x16().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int8x16) NotEqual(y Int8x16) Mask8x16 {
|
||||
ones := x.Equal(x).AsInt8x16()
|
||||
return x.Equal(y).AsInt8x16().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt8x16()
|
||||
return x.Equal(y).ToInt8x16().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Less returns a mask whose elements indicate whether x < y
|
||||
@@ -46,24 +46,24 @@ func (x Int16x8) Less(y Int16x8) Mask16x8 {
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int16x8) GreaterEqual(y Int16x8) Mask16x8 {
|
||||
ones := x.Equal(x).AsInt16x8()
|
||||
return y.Greater(x).AsInt16x8().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt16x8()
|
||||
return y.Greater(x).ToInt16x8().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int16x8) LessEqual(y Int16x8) Mask16x8 {
|
||||
ones := x.Equal(x).AsInt16x8()
|
||||
return x.Greater(y).AsInt16x8().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt16x8()
|
||||
return x.Greater(y).ToInt16x8().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int16x8) NotEqual(y Int16x8) Mask16x8 {
|
||||
ones := x.Equal(x).AsInt16x8()
|
||||
return x.Equal(y).AsInt16x8().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt16x8()
|
||||
return x.Equal(y).ToInt16x8().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Less returns a mask whose elements indicate whether x < y
|
||||
@@ -77,24 +77,24 @@ func (x Int32x4) Less(y Int32x4) Mask32x4 {
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int32x4) GreaterEqual(y Int32x4) Mask32x4 {
|
||||
ones := x.Equal(x).AsInt32x4()
|
||||
return y.Greater(x).AsInt32x4().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt32x4()
|
||||
return y.Greater(x).ToInt32x4().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int32x4) LessEqual(y Int32x4) Mask32x4 {
|
||||
ones := x.Equal(x).AsInt32x4()
|
||||
return x.Greater(y).AsInt32x4().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt32x4()
|
||||
return x.Greater(y).ToInt32x4().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int32x4) NotEqual(y Int32x4) Mask32x4 {
|
||||
ones := x.Equal(x).AsInt32x4()
|
||||
return x.Equal(y).AsInt32x4().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt32x4()
|
||||
return x.Equal(y).ToInt32x4().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Less returns a mask whose elements indicate whether x < y
|
||||
@@ -108,24 +108,24 @@ func (x Int64x2) Less(y Int64x2) Mask64x2 {
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int64x2) GreaterEqual(y Int64x2) Mask64x2 {
|
||||
ones := x.Equal(x).AsInt64x2()
|
||||
return y.Greater(x).AsInt64x2().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt64x2()
|
||||
return y.Greater(x).ToInt64x2().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int64x2) LessEqual(y Int64x2) Mask64x2 {
|
||||
ones := x.Equal(x).AsInt64x2()
|
||||
return x.Greater(y).AsInt64x2().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt64x2()
|
||||
return x.Greater(y).ToInt64x2().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int64x2) NotEqual(y Int64x2) Mask64x2 {
|
||||
ones := x.Equal(x).AsInt64x2()
|
||||
return x.Equal(y).AsInt64x2().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt64x2()
|
||||
return x.Equal(y).ToInt64x2().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Less returns a mask whose elements indicate whether x < y
|
||||
@@ -139,24 +139,24 @@ func (x Int8x32) Less(y Int8x32) Mask8x32 {
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int8x32) GreaterEqual(y Int8x32) Mask8x32 {
|
||||
ones := x.Equal(x).AsInt8x32()
|
||||
return y.Greater(x).AsInt8x32().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt8x32()
|
||||
return y.Greater(x).ToInt8x32().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int8x32) LessEqual(y Int8x32) Mask8x32 {
|
||||
ones := x.Equal(x).AsInt8x32()
|
||||
return x.Greater(y).AsInt8x32().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt8x32()
|
||||
return x.Greater(y).ToInt8x32().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int8x32) NotEqual(y Int8x32) Mask8x32 {
|
||||
ones := x.Equal(x).AsInt8x32()
|
||||
return x.Equal(y).AsInt8x32().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt8x32()
|
||||
return x.Equal(y).ToInt8x32().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Less returns a mask whose elements indicate whether x < y
|
||||
@@ -170,24 +170,24 @@ func (x Int16x16) Less(y Int16x16) Mask16x16 {
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int16x16) GreaterEqual(y Int16x16) Mask16x16 {
|
||||
ones := x.Equal(x).AsInt16x16()
|
||||
return y.Greater(x).AsInt16x16().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt16x16()
|
||||
return y.Greater(x).ToInt16x16().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int16x16) LessEqual(y Int16x16) Mask16x16 {
|
||||
ones := x.Equal(x).AsInt16x16()
|
||||
return x.Greater(y).AsInt16x16().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt16x16()
|
||||
return x.Greater(y).ToInt16x16().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int16x16) NotEqual(y Int16x16) Mask16x16 {
|
||||
ones := x.Equal(x).AsInt16x16()
|
||||
return x.Equal(y).AsInt16x16().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt16x16()
|
||||
return x.Equal(y).ToInt16x16().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Less returns a mask whose elements indicate whether x < y
|
||||
@@ -201,24 +201,24 @@ func (x Int32x8) Less(y Int32x8) Mask32x8 {
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int32x8) GreaterEqual(y Int32x8) Mask32x8 {
|
||||
ones := x.Equal(x).AsInt32x8()
|
||||
return y.Greater(x).AsInt32x8().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt32x8()
|
||||
return y.Greater(x).ToInt32x8().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int32x8) LessEqual(y Int32x8) Mask32x8 {
|
||||
ones := x.Equal(x).AsInt32x8()
|
||||
return x.Greater(y).AsInt32x8().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt32x8()
|
||||
return x.Greater(y).ToInt32x8().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int32x8) NotEqual(y Int32x8) Mask32x8 {
|
||||
ones := x.Equal(x).AsInt32x8()
|
||||
return x.Equal(y).AsInt32x8().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt32x8()
|
||||
return x.Equal(y).ToInt32x8().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Less returns a mask whose elements indicate whether x < y
|
||||
@@ -232,24 +232,24 @@ func (x Int64x4) Less(y Int64x4) Mask64x4 {
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int64x4) GreaterEqual(y Int64x4) Mask64x4 {
|
||||
ones := x.Equal(x).AsInt64x4()
|
||||
return y.Greater(x).AsInt64x4().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt64x4()
|
||||
return y.Greater(x).ToInt64x4().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int64x4) LessEqual(y Int64x4) Mask64x4 {
|
||||
ones := x.Equal(x).AsInt64x4()
|
||||
return x.Greater(y).AsInt64x4().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt64x4()
|
||||
return x.Greater(y).ToInt64x4().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int64x4) NotEqual(y Int64x4) Mask64x4 {
|
||||
ones := x.Equal(x).AsInt64x4()
|
||||
return x.Equal(y).AsInt64x4().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt64x4()
|
||||
return x.Equal(y).ToInt64x4().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Greater returns a mask whose elements indicate whether x > y
|
||||
@@ -275,9 +275,9 @@ func (x Uint8x16) Less(y Uint8x16) Mask8x16 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint8x16) GreaterEqual(y Uint8x16) Mask8x16 {
|
||||
a, b := x.AsInt8x16(), y.AsInt8x16()
|
||||
ones := x.Equal(x).AsInt8x16()
|
||||
ones := x.Equal(x).ToInt8x16()
|
||||
signs := BroadcastInt8x16(-1 << (8 - 1))
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).AsInt8x16().Xor(ones).asMask()
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).ToInt8x16().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
@@ -285,9 +285,9 @@ func (x Uint8x16) GreaterEqual(y Uint8x16) Mask8x16 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint8x16) LessEqual(y Uint8x16) Mask8x16 {
|
||||
a, b := x.AsInt8x16(), y.AsInt8x16()
|
||||
ones := x.Equal(x).AsInt8x16()
|
||||
ones := x.Equal(x).ToInt8x16()
|
||||
signs := BroadcastInt8x16(-1 << (8 - 1))
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).AsInt8x16().Xor(ones).asMask()
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).ToInt8x16().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
@@ -295,8 +295,8 @@ func (x Uint8x16) LessEqual(y Uint8x16) Mask8x16 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint8x16) NotEqual(y Uint8x16) Mask8x16 {
|
||||
a, b := x.AsInt8x16(), y.AsInt8x16()
|
||||
ones := x.Equal(x).AsInt8x16()
|
||||
return a.Equal(b).AsInt8x16().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt8x16()
|
||||
return a.Equal(b).ToInt8x16().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Greater returns a mask whose elements indicate whether x > y
|
||||
@@ -304,7 +304,7 @@ func (x Uint8x16) NotEqual(y Uint8x16) Mask8x16 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint16x8) Greater(y Uint16x8) Mask16x8 {
|
||||
a, b := x.AsInt16x8(), y.AsInt16x8()
|
||||
ones := x.Equal(x).AsInt16x8()
|
||||
ones := x.Equal(x).ToInt16x8()
|
||||
signs := ones.ShiftAllLeft(16 - 1)
|
||||
return a.Xor(signs).Greater(b.Xor(signs))
|
||||
}
|
||||
@@ -314,7 +314,7 @@ func (x Uint16x8) Greater(y Uint16x8) Mask16x8 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint16x8) Less(y Uint16x8) Mask16x8 {
|
||||
a, b := x.AsInt16x8(), y.AsInt16x8()
|
||||
ones := x.Equal(x).AsInt16x8()
|
||||
ones := x.Equal(x).ToInt16x8()
|
||||
signs := ones.ShiftAllLeft(16 - 1)
|
||||
return b.Xor(signs).Greater(a.Xor(signs))
|
||||
}
|
||||
@@ -324,9 +324,9 @@ func (x Uint16x8) Less(y Uint16x8) Mask16x8 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint16x8) GreaterEqual(y Uint16x8) Mask16x8 {
|
||||
a, b := x.AsInt16x8(), y.AsInt16x8()
|
||||
ones := x.Equal(x).AsInt16x8()
|
||||
ones := x.Equal(x).ToInt16x8()
|
||||
signs := ones.ShiftAllLeft(16 - 1)
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).AsInt16x8().Xor(ones).asMask()
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).ToInt16x8().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
@@ -334,9 +334,9 @@ func (x Uint16x8) GreaterEqual(y Uint16x8) Mask16x8 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint16x8) LessEqual(y Uint16x8) Mask16x8 {
|
||||
a, b := x.AsInt16x8(), y.AsInt16x8()
|
||||
ones := x.Equal(x).AsInt16x8()
|
||||
ones := x.Equal(x).ToInt16x8()
|
||||
signs := ones.ShiftAllLeft(16 - 1)
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).AsInt16x8().Xor(ones).asMask()
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).ToInt16x8().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
@@ -344,8 +344,8 @@ func (x Uint16x8) LessEqual(y Uint16x8) Mask16x8 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint16x8) NotEqual(y Uint16x8) Mask16x8 {
|
||||
a, b := x.AsInt16x8(), y.AsInt16x8()
|
||||
ones := x.Equal(x).AsInt16x8()
|
||||
return a.Equal(b).AsInt16x8().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt16x8()
|
||||
return a.Equal(b).ToInt16x8().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Greater returns a mask whose elements indicate whether x > y
|
||||
@@ -353,7 +353,7 @@ func (x Uint16x8) NotEqual(y Uint16x8) Mask16x8 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint32x4) Greater(y Uint32x4) Mask32x4 {
|
||||
a, b := x.AsInt32x4(), y.AsInt32x4()
|
||||
ones := x.Equal(x).AsInt32x4()
|
||||
ones := x.Equal(x).ToInt32x4()
|
||||
signs := ones.ShiftAllLeft(32 - 1)
|
||||
return a.Xor(signs).Greater(b.Xor(signs))
|
||||
}
|
||||
@@ -363,7 +363,7 @@ func (x Uint32x4) Greater(y Uint32x4) Mask32x4 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint32x4) Less(y Uint32x4) Mask32x4 {
|
||||
a, b := x.AsInt32x4(), y.AsInt32x4()
|
||||
ones := x.Equal(x).AsInt32x4()
|
||||
ones := x.Equal(x).ToInt32x4()
|
||||
signs := ones.ShiftAllLeft(32 - 1)
|
||||
return b.Xor(signs).Greater(a.Xor(signs))
|
||||
}
|
||||
@@ -373,9 +373,9 @@ func (x Uint32x4) Less(y Uint32x4) Mask32x4 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint32x4) GreaterEqual(y Uint32x4) Mask32x4 {
|
||||
a, b := x.AsInt32x4(), y.AsInt32x4()
|
||||
ones := x.Equal(x).AsInt32x4()
|
||||
ones := x.Equal(x).ToInt32x4()
|
||||
signs := ones.ShiftAllLeft(32 - 1)
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).AsInt32x4().Xor(ones).asMask()
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).ToInt32x4().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
@@ -383,9 +383,9 @@ func (x Uint32x4) GreaterEqual(y Uint32x4) Mask32x4 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint32x4) LessEqual(y Uint32x4) Mask32x4 {
|
||||
a, b := x.AsInt32x4(), y.AsInt32x4()
|
||||
ones := x.Equal(x).AsInt32x4()
|
||||
ones := x.Equal(x).ToInt32x4()
|
||||
signs := ones.ShiftAllLeft(32 - 1)
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).AsInt32x4().Xor(ones).asMask()
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).ToInt32x4().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
@@ -393,8 +393,8 @@ func (x Uint32x4) LessEqual(y Uint32x4) Mask32x4 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint32x4) NotEqual(y Uint32x4) Mask32x4 {
|
||||
a, b := x.AsInt32x4(), y.AsInt32x4()
|
||||
ones := x.Equal(x).AsInt32x4()
|
||||
return a.Equal(b).AsInt32x4().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt32x4()
|
||||
return a.Equal(b).ToInt32x4().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Greater returns a mask whose elements indicate whether x > y
|
||||
@@ -402,7 +402,7 @@ func (x Uint32x4) NotEqual(y Uint32x4) Mask32x4 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint64x2) Greater(y Uint64x2) Mask64x2 {
|
||||
a, b := x.AsInt64x2(), y.AsInt64x2()
|
||||
ones := x.Equal(x).AsInt64x2()
|
||||
ones := x.Equal(x).ToInt64x2()
|
||||
signs := ones.ShiftAllLeft(64 - 1)
|
||||
return a.Xor(signs).Greater(b.Xor(signs))
|
||||
}
|
||||
@@ -412,7 +412,7 @@ func (x Uint64x2) Greater(y Uint64x2) Mask64x2 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint64x2) Less(y Uint64x2) Mask64x2 {
|
||||
a, b := x.AsInt64x2(), y.AsInt64x2()
|
||||
ones := x.Equal(x).AsInt64x2()
|
||||
ones := x.Equal(x).ToInt64x2()
|
||||
signs := ones.ShiftAllLeft(64 - 1)
|
||||
return b.Xor(signs).Greater(a.Xor(signs))
|
||||
}
|
||||
@@ -422,9 +422,9 @@ func (x Uint64x2) Less(y Uint64x2) Mask64x2 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint64x2) GreaterEqual(y Uint64x2) Mask64x2 {
|
||||
a, b := x.AsInt64x2(), y.AsInt64x2()
|
||||
ones := x.Equal(x).AsInt64x2()
|
||||
ones := x.Equal(x).ToInt64x2()
|
||||
signs := ones.ShiftAllLeft(64 - 1)
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).AsInt64x2().Xor(ones).asMask()
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).ToInt64x2().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
@@ -432,9 +432,9 @@ func (x Uint64x2) GreaterEqual(y Uint64x2) Mask64x2 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint64x2) LessEqual(y Uint64x2) Mask64x2 {
|
||||
a, b := x.AsInt64x2(), y.AsInt64x2()
|
||||
ones := x.Equal(x).AsInt64x2()
|
||||
ones := x.Equal(x).ToInt64x2()
|
||||
signs := ones.ShiftAllLeft(64 - 1)
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).AsInt64x2().Xor(ones).asMask()
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).ToInt64x2().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
@@ -442,8 +442,8 @@ func (x Uint64x2) LessEqual(y Uint64x2) Mask64x2 {
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint64x2) NotEqual(y Uint64x2) Mask64x2 {
|
||||
a, b := x.AsInt64x2(), y.AsInt64x2()
|
||||
ones := x.Equal(x).AsInt64x2()
|
||||
return a.Equal(b).AsInt64x2().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt64x2()
|
||||
return a.Equal(b).ToInt64x2().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Greater returns a mask whose elements indicate whether x > y
|
||||
@@ -469,9 +469,9 @@ func (x Uint8x32) Less(y Uint8x32) Mask8x32 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint8x32) GreaterEqual(y Uint8x32) Mask8x32 {
|
||||
a, b := x.AsInt8x32(), y.AsInt8x32()
|
||||
ones := x.Equal(x).AsInt8x32()
|
||||
ones := x.Equal(x).ToInt8x32()
|
||||
signs := BroadcastInt8x32(-1 << (8 - 1))
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).AsInt8x32().Xor(ones).asMask()
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).ToInt8x32().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
@@ -479,9 +479,9 @@ func (x Uint8x32) GreaterEqual(y Uint8x32) Mask8x32 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint8x32) LessEqual(y Uint8x32) Mask8x32 {
|
||||
a, b := x.AsInt8x32(), y.AsInt8x32()
|
||||
ones := x.Equal(x).AsInt8x32()
|
||||
ones := x.Equal(x).ToInt8x32()
|
||||
signs := BroadcastInt8x32(-1 << (8 - 1))
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).AsInt8x32().Xor(ones).asMask()
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).ToInt8x32().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
@@ -489,8 +489,8 @@ func (x Uint8x32) LessEqual(y Uint8x32) Mask8x32 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint8x32) NotEqual(y Uint8x32) Mask8x32 {
|
||||
a, b := x.AsInt8x32(), y.AsInt8x32()
|
||||
ones := x.Equal(x).AsInt8x32()
|
||||
return a.Equal(b).AsInt8x32().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt8x32()
|
||||
return a.Equal(b).ToInt8x32().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Greater returns a mask whose elements indicate whether x > y
|
||||
@@ -498,7 +498,7 @@ func (x Uint8x32) NotEqual(y Uint8x32) Mask8x32 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint16x16) Greater(y Uint16x16) Mask16x16 {
|
||||
a, b := x.AsInt16x16(), y.AsInt16x16()
|
||||
ones := x.Equal(x).AsInt16x16()
|
||||
ones := x.Equal(x).ToInt16x16()
|
||||
signs := ones.ShiftAllLeft(16 - 1)
|
||||
return a.Xor(signs).Greater(b.Xor(signs))
|
||||
}
|
||||
@@ -508,7 +508,7 @@ func (x Uint16x16) Greater(y Uint16x16) Mask16x16 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint16x16) Less(y Uint16x16) Mask16x16 {
|
||||
a, b := x.AsInt16x16(), y.AsInt16x16()
|
||||
ones := x.Equal(x).AsInt16x16()
|
||||
ones := x.Equal(x).ToInt16x16()
|
||||
signs := ones.ShiftAllLeft(16 - 1)
|
||||
return b.Xor(signs).Greater(a.Xor(signs))
|
||||
}
|
||||
@@ -518,9 +518,9 @@ func (x Uint16x16) Less(y Uint16x16) Mask16x16 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint16x16) GreaterEqual(y Uint16x16) Mask16x16 {
|
||||
a, b := x.AsInt16x16(), y.AsInt16x16()
|
||||
ones := x.Equal(x).AsInt16x16()
|
||||
ones := x.Equal(x).ToInt16x16()
|
||||
signs := ones.ShiftAllLeft(16 - 1)
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).AsInt16x16().Xor(ones).asMask()
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).ToInt16x16().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
@@ -528,9 +528,9 @@ func (x Uint16x16) GreaterEqual(y Uint16x16) Mask16x16 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint16x16) LessEqual(y Uint16x16) Mask16x16 {
|
||||
a, b := x.AsInt16x16(), y.AsInt16x16()
|
||||
ones := x.Equal(x).AsInt16x16()
|
||||
ones := x.Equal(x).ToInt16x16()
|
||||
signs := ones.ShiftAllLeft(16 - 1)
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).AsInt16x16().Xor(ones).asMask()
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).ToInt16x16().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
@@ -538,8 +538,8 @@ func (x Uint16x16) LessEqual(y Uint16x16) Mask16x16 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint16x16) NotEqual(y Uint16x16) Mask16x16 {
|
||||
a, b := x.AsInt16x16(), y.AsInt16x16()
|
||||
ones := x.Equal(x).AsInt16x16()
|
||||
return a.Equal(b).AsInt16x16().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt16x16()
|
||||
return a.Equal(b).ToInt16x16().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Greater returns a mask whose elements indicate whether x > y
|
||||
@@ -547,7 +547,7 @@ func (x Uint16x16) NotEqual(y Uint16x16) Mask16x16 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint32x8) Greater(y Uint32x8) Mask32x8 {
|
||||
a, b := x.AsInt32x8(), y.AsInt32x8()
|
||||
ones := x.Equal(x).AsInt32x8()
|
||||
ones := x.Equal(x).ToInt32x8()
|
||||
signs := ones.ShiftAllLeft(32 - 1)
|
||||
return a.Xor(signs).Greater(b.Xor(signs))
|
||||
}
|
||||
@@ -557,7 +557,7 @@ func (x Uint32x8) Greater(y Uint32x8) Mask32x8 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint32x8) Less(y Uint32x8) Mask32x8 {
|
||||
a, b := x.AsInt32x8(), y.AsInt32x8()
|
||||
ones := x.Equal(x).AsInt32x8()
|
||||
ones := x.Equal(x).ToInt32x8()
|
||||
signs := ones.ShiftAllLeft(32 - 1)
|
||||
return b.Xor(signs).Greater(a.Xor(signs))
|
||||
}
|
||||
@@ -567,9 +567,9 @@ func (x Uint32x8) Less(y Uint32x8) Mask32x8 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint32x8) GreaterEqual(y Uint32x8) Mask32x8 {
|
||||
a, b := x.AsInt32x8(), y.AsInt32x8()
|
||||
ones := x.Equal(x).AsInt32x8()
|
||||
ones := x.Equal(x).ToInt32x8()
|
||||
signs := ones.ShiftAllLeft(32 - 1)
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).AsInt32x8().Xor(ones).asMask()
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).ToInt32x8().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
@@ -577,9 +577,9 @@ func (x Uint32x8) GreaterEqual(y Uint32x8) Mask32x8 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint32x8) LessEqual(y Uint32x8) Mask32x8 {
|
||||
a, b := x.AsInt32x8(), y.AsInt32x8()
|
||||
ones := x.Equal(x).AsInt32x8()
|
||||
ones := x.Equal(x).ToInt32x8()
|
||||
signs := ones.ShiftAllLeft(32 - 1)
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).AsInt32x8().Xor(ones).asMask()
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).ToInt32x8().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
@@ -587,8 +587,8 @@ func (x Uint32x8) LessEqual(y Uint32x8) Mask32x8 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint32x8) NotEqual(y Uint32x8) Mask32x8 {
|
||||
a, b := x.AsInt32x8(), y.AsInt32x8()
|
||||
ones := x.Equal(x).AsInt32x8()
|
||||
return a.Equal(b).AsInt32x8().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt32x8()
|
||||
return a.Equal(b).ToInt32x8().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// Greater returns a mask whose elements indicate whether x > y
|
||||
@@ -596,7 +596,7 @@ func (x Uint32x8) NotEqual(y Uint32x8) Mask32x8 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint64x4) Greater(y Uint64x4) Mask64x4 {
|
||||
a, b := x.AsInt64x4(), y.AsInt64x4()
|
||||
ones := x.Equal(x).AsInt64x4()
|
||||
ones := x.Equal(x).ToInt64x4()
|
||||
signs := ones.ShiftAllLeft(64 - 1)
|
||||
return a.Xor(signs).Greater(b.Xor(signs))
|
||||
}
|
||||
@@ -606,7 +606,7 @@ func (x Uint64x4) Greater(y Uint64x4) Mask64x4 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint64x4) Less(y Uint64x4) Mask64x4 {
|
||||
a, b := x.AsInt64x4(), y.AsInt64x4()
|
||||
ones := x.Equal(x).AsInt64x4()
|
||||
ones := x.Equal(x).ToInt64x4()
|
||||
signs := ones.ShiftAllLeft(64 - 1)
|
||||
return b.Xor(signs).Greater(a.Xor(signs))
|
||||
}
|
||||
@@ -616,9 +616,9 @@ func (x Uint64x4) Less(y Uint64x4) Mask64x4 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint64x4) GreaterEqual(y Uint64x4) Mask64x4 {
|
||||
a, b := x.AsInt64x4(), y.AsInt64x4()
|
||||
ones := x.Equal(x).AsInt64x4()
|
||||
ones := x.Equal(x).ToInt64x4()
|
||||
signs := ones.ShiftAllLeft(64 - 1)
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).AsInt64x4().Xor(ones).asMask()
|
||||
return b.Xor(signs).Greater(a.Xor(signs)).ToInt64x4().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// LessEqual returns a mask whose elements indicate whether x <= y
|
||||
@@ -626,9 +626,9 @@ func (x Uint64x4) GreaterEqual(y Uint64x4) Mask64x4 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint64x4) LessEqual(y Uint64x4) Mask64x4 {
|
||||
a, b := x.AsInt64x4(), y.AsInt64x4()
|
||||
ones := x.Equal(x).AsInt64x4()
|
||||
ones := x.Equal(x).ToInt64x4()
|
||||
signs := ones.ShiftAllLeft(64 - 1)
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).AsInt64x4().Xor(ones).asMask()
|
||||
return a.Xor(signs).Greater(b.Xor(signs)).ToInt64x4().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
// NotEqual returns a mask whose elements indicate whether x != y
|
||||
@@ -636,6 +636,6 @@ func (x Uint64x4) LessEqual(y Uint64x4) Mask64x4 {
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint64x4) NotEqual(y Uint64x4) Mask64x4 {
|
||||
a, b := x.AsInt64x4(), y.AsInt64x4()
|
||||
ones := x.Equal(x).AsInt64x4()
|
||||
return a.Equal(b).AsInt64x4().Xor(ones).asMask()
|
||||
ones := x.Equal(x).ToInt64x4()
|
||||
return a.Equal(b).ToInt64x4().Xor(ones).asMask()
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ func testInt8x16Compare(t *testing.T, f func(_, _ archsimd.Int8x16) archsimd.Mas
|
||||
a := archsimd.LoadInt8x16Slice(x)
|
||||
b := archsimd.LoadInt8x16Slice(y)
|
||||
g := make([]int8, n)
|
||||
f(a, b).AsInt8x16().StoreSlice(g)
|
||||
f(a, b).ToInt8x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -37,7 +37,7 @@ func testInt16x8Compare(t *testing.T, f func(_, _ archsimd.Int16x8) archsimd.Mas
|
||||
a := archsimd.LoadInt16x8Slice(x)
|
||||
b := archsimd.LoadInt16x8Slice(y)
|
||||
g := make([]int16, n)
|
||||
f(a, b).AsInt16x8().StoreSlice(g)
|
||||
f(a, b).ToInt16x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -52,7 +52,7 @@ func testInt32x4Compare(t *testing.T, f func(_, _ archsimd.Int32x4) archsimd.Mas
|
||||
a := archsimd.LoadInt32x4Slice(x)
|
||||
b := archsimd.LoadInt32x4Slice(y)
|
||||
g := make([]int32, n)
|
||||
f(a, b).AsInt32x4().StoreSlice(g)
|
||||
f(a, b).ToInt32x4().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -67,7 +67,7 @@ func testInt64x2Compare(t *testing.T, f func(_, _ archsimd.Int64x2) archsimd.Mas
|
||||
a := archsimd.LoadInt64x2Slice(x)
|
||||
b := archsimd.LoadInt64x2Slice(y)
|
||||
g := make([]int64, n)
|
||||
f(a, b).AsInt64x2().StoreSlice(g)
|
||||
f(a, b).ToInt64x2().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -82,7 +82,7 @@ func testUint8x16Compare(t *testing.T, f func(_, _ archsimd.Uint8x16) archsimd.M
|
||||
a := archsimd.LoadUint8x16Slice(x)
|
||||
b := archsimd.LoadUint8x16Slice(y)
|
||||
g := make([]int8, n)
|
||||
f(a, b).AsInt8x16().StoreSlice(g)
|
||||
f(a, b).ToInt8x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -97,7 +97,7 @@ func testUint16x8Compare(t *testing.T, f func(_, _ archsimd.Uint16x8) archsimd.M
|
||||
a := archsimd.LoadUint16x8Slice(x)
|
||||
b := archsimd.LoadUint16x8Slice(y)
|
||||
g := make([]int16, n)
|
||||
f(a, b).AsInt16x8().StoreSlice(g)
|
||||
f(a, b).ToInt16x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -112,7 +112,7 @@ func testUint32x4Compare(t *testing.T, f func(_, _ archsimd.Uint32x4) archsimd.M
|
||||
a := archsimd.LoadUint32x4Slice(x)
|
||||
b := archsimd.LoadUint32x4Slice(y)
|
||||
g := make([]int32, n)
|
||||
f(a, b).AsInt32x4().StoreSlice(g)
|
||||
f(a, b).ToInt32x4().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -127,7 +127,7 @@ func testUint64x2Compare(t *testing.T, f func(_, _ archsimd.Uint64x2) archsimd.M
|
||||
a := archsimd.LoadUint64x2Slice(x)
|
||||
b := archsimd.LoadUint64x2Slice(y)
|
||||
g := make([]int64, n)
|
||||
f(a, b).AsInt64x2().StoreSlice(g)
|
||||
f(a, b).ToInt64x2().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -142,7 +142,7 @@ func testFloat32x4Compare(t *testing.T, f func(_, _ archsimd.Float32x4) archsimd
|
||||
a := archsimd.LoadFloat32x4Slice(x)
|
||||
b := archsimd.LoadFloat32x4Slice(y)
|
||||
g := make([]int32, n)
|
||||
f(a, b).AsInt32x4().StoreSlice(g)
|
||||
f(a, b).ToInt32x4().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -157,7 +157,7 @@ func testFloat64x2Compare(t *testing.T, f func(_, _ archsimd.Float64x2) archsimd
|
||||
a := archsimd.LoadFloat64x2Slice(x)
|
||||
b := archsimd.LoadFloat64x2Slice(y)
|
||||
g := make([]int64, n)
|
||||
f(a, b).AsInt64x2().StoreSlice(g)
|
||||
f(a, b).ToInt64x2().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -172,7 +172,7 @@ func testInt8x32Compare(t *testing.T, f func(_, _ archsimd.Int8x32) archsimd.Mas
|
||||
a := archsimd.LoadInt8x32Slice(x)
|
||||
b := archsimd.LoadInt8x32Slice(y)
|
||||
g := make([]int8, n)
|
||||
f(a, b).AsInt8x32().StoreSlice(g)
|
||||
f(a, b).ToInt8x32().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -187,7 +187,7 @@ func testInt16x16Compare(t *testing.T, f func(_, _ archsimd.Int16x16) archsimd.M
|
||||
a := archsimd.LoadInt16x16Slice(x)
|
||||
b := archsimd.LoadInt16x16Slice(y)
|
||||
g := make([]int16, n)
|
||||
f(a, b).AsInt16x16().StoreSlice(g)
|
||||
f(a, b).ToInt16x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -202,7 +202,7 @@ func testInt32x8Compare(t *testing.T, f func(_, _ archsimd.Int32x8) archsimd.Mas
|
||||
a := archsimd.LoadInt32x8Slice(x)
|
||||
b := archsimd.LoadInt32x8Slice(y)
|
||||
g := make([]int32, n)
|
||||
f(a, b).AsInt32x8().StoreSlice(g)
|
||||
f(a, b).ToInt32x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -217,7 +217,7 @@ func testInt64x4Compare(t *testing.T, f func(_, _ archsimd.Int64x4) archsimd.Mas
|
||||
a := archsimd.LoadInt64x4Slice(x)
|
||||
b := archsimd.LoadInt64x4Slice(y)
|
||||
g := make([]int64, n)
|
||||
f(a, b).AsInt64x4().StoreSlice(g)
|
||||
f(a, b).ToInt64x4().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -232,7 +232,7 @@ func testUint8x32Compare(t *testing.T, f func(_, _ archsimd.Uint8x32) archsimd.M
|
||||
a := archsimd.LoadUint8x32Slice(x)
|
||||
b := archsimd.LoadUint8x32Slice(y)
|
||||
g := make([]int8, n)
|
||||
f(a, b).AsInt8x32().StoreSlice(g)
|
||||
f(a, b).ToInt8x32().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -247,7 +247,7 @@ func testUint16x16Compare(t *testing.T, f func(_, _ archsimd.Uint16x16) archsimd
|
||||
a := archsimd.LoadUint16x16Slice(x)
|
||||
b := archsimd.LoadUint16x16Slice(y)
|
||||
g := make([]int16, n)
|
||||
f(a, b).AsInt16x16().StoreSlice(g)
|
||||
f(a, b).ToInt16x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -262,7 +262,7 @@ func testUint32x8Compare(t *testing.T, f func(_, _ archsimd.Uint32x8) archsimd.M
|
||||
a := archsimd.LoadUint32x8Slice(x)
|
||||
b := archsimd.LoadUint32x8Slice(y)
|
||||
g := make([]int32, n)
|
||||
f(a, b).AsInt32x8().StoreSlice(g)
|
||||
f(a, b).ToInt32x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -277,7 +277,7 @@ func testUint64x4Compare(t *testing.T, f func(_, _ archsimd.Uint64x4) archsimd.M
|
||||
a := archsimd.LoadUint64x4Slice(x)
|
||||
b := archsimd.LoadUint64x4Slice(y)
|
||||
g := make([]int64, n)
|
||||
f(a, b).AsInt64x4().StoreSlice(g)
|
||||
f(a, b).ToInt64x4().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -292,7 +292,7 @@ func testFloat32x8Compare(t *testing.T, f func(_, _ archsimd.Float32x8) archsimd
|
||||
a := archsimd.LoadFloat32x8Slice(x)
|
||||
b := archsimd.LoadFloat32x8Slice(y)
|
||||
g := make([]int32, n)
|
||||
f(a, b).AsInt32x8().StoreSlice(g)
|
||||
f(a, b).ToInt32x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -307,7 +307,7 @@ func testFloat64x4Compare(t *testing.T, f func(_, _ archsimd.Float64x4) archsimd
|
||||
a := archsimd.LoadFloat64x4Slice(x)
|
||||
b := archsimd.LoadFloat64x4Slice(y)
|
||||
g := make([]int64, n)
|
||||
f(a, b).AsInt64x4().StoreSlice(g)
|
||||
f(a, b).ToInt64x4().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -322,7 +322,7 @@ func testInt8x64Compare(t *testing.T, f func(_, _ archsimd.Int8x64) archsimd.Mas
|
||||
a := archsimd.LoadInt8x64Slice(x)
|
||||
b := archsimd.LoadInt8x64Slice(y)
|
||||
g := make([]int8, n)
|
||||
f(a, b).AsInt8x64().StoreSlice(g)
|
||||
f(a, b).ToInt8x64().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -337,7 +337,7 @@ func testInt16x32Compare(t *testing.T, f func(_, _ archsimd.Int16x32) archsimd.M
|
||||
a := archsimd.LoadInt16x32Slice(x)
|
||||
b := archsimd.LoadInt16x32Slice(y)
|
||||
g := make([]int16, n)
|
||||
f(a, b).AsInt16x32().StoreSlice(g)
|
||||
f(a, b).ToInt16x32().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -352,7 +352,7 @@ func testInt32x16Compare(t *testing.T, f func(_, _ archsimd.Int32x16) archsimd.M
|
||||
a := archsimd.LoadInt32x16Slice(x)
|
||||
b := archsimd.LoadInt32x16Slice(y)
|
||||
g := make([]int32, n)
|
||||
f(a, b).AsInt32x16().StoreSlice(g)
|
||||
f(a, b).ToInt32x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -367,7 +367,7 @@ func testInt64x8Compare(t *testing.T, f func(_, _ archsimd.Int64x8) archsimd.Mas
|
||||
a := archsimd.LoadInt64x8Slice(x)
|
||||
b := archsimd.LoadInt64x8Slice(y)
|
||||
g := make([]int64, n)
|
||||
f(a, b).AsInt64x8().StoreSlice(g)
|
||||
f(a, b).ToInt64x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -382,7 +382,7 @@ func testUint8x64Compare(t *testing.T, f func(_, _ archsimd.Uint8x64) archsimd.M
|
||||
a := archsimd.LoadUint8x64Slice(x)
|
||||
b := archsimd.LoadUint8x64Slice(y)
|
||||
g := make([]int8, n)
|
||||
f(a, b).AsInt8x64().StoreSlice(g)
|
||||
f(a, b).ToInt8x64().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -397,7 +397,7 @@ func testUint16x32Compare(t *testing.T, f func(_, _ archsimd.Uint16x32) archsimd
|
||||
a := archsimd.LoadUint16x32Slice(x)
|
||||
b := archsimd.LoadUint16x32Slice(y)
|
||||
g := make([]int16, n)
|
||||
f(a, b).AsInt16x32().StoreSlice(g)
|
||||
f(a, b).ToInt16x32().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -412,7 +412,7 @@ func testUint32x16Compare(t *testing.T, f func(_, _ archsimd.Uint32x16) archsimd
|
||||
a := archsimd.LoadUint32x16Slice(x)
|
||||
b := archsimd.LoadUint32x16Slice(y)
|
||||
g := make([]int32, n)
|
||||
f(a, b).AsInt32x16().StoreSlice(g)
|
||||
f(a, b).ToInt32x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -427,7 +427,7 @@ func testUint64x8Compare(t *testing.T, f func(_, _ archsimd.Uint64x8) archsimd.M
|
||||
a := archsimd.LoadUint64x8Slice(x)
|
||||
b := archsimd.LoadUint64x8Slice(y)
|
||||
g := make([]int64, n)
|
||||
f(a, b).AsInt64x8().StoreSlice(g)
|
||||
f(a, b).ToInt64x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -442,7 +442,7 @@ func testFloat32x16Compare(t *testing.T, f func(_, _ archsimd.Float32x16) archsi
|
||||
a := archsimd.LoadFloat32x16Slice(x)
|
||||
b := archsimd.LoadFloat32x16Slice(y)
|
||||
g := make([]int32, n)
|
||||
f(a, b).AsInt32x16().StoreSlice(g)
|
||||
f(a, b).ToInt32x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
@@ -457,7 +457,7 @@ func testFloat64x8Compare(t *testing.T, f func(_, _ archsimd.Float64x8) archsimd
|
||||
a := archsimd.LoadFloat64x8Slice(x)
|
||||
b := archsimd.LoadFloat64x8Slice(y)
|
||||
g := make([]int64, n)
|
||||
f(a, b).AsInt64x8().StoreSlice(g)
|
||||
f(a, b).ToInt64x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
|
||||
})
|
||||
|
||||
@@ -26,7 +26,7 @@ func testInt8x16CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadInt8x16Slice(y)
|
||||
k := archsimd.LoadInt8x16Slice(toVect[int8](m)).ToMask()
|
||||
g := make([]int8, n)
|
||||
f(a, b, k).AsInt8x16().StoreSlice(g)
|
||||
f(a, b, k).ToInt8x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -50,7 +50,7 @@ func testInt16x8CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadInt16x8Slice(y)
|
||||
k := archsimd.LoadInt16x8Slice(toVect[int16](m)).ToMask()
|
||||
g := make([]int16, n)
|
||||
f(a, b, k).AsInt16x8().StoreSlice(g)
|
||||
f(a, b, k).ToInt16x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -74,7 +74,7 @@ func testInt32x4CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadInt32x4Slice(y)
|
||||
k := archsimd.LoadInt32x4Slice(toVect[int32](m)).ToMask()
|
||||
g := make([]int32, n)
|
||||
f(a, b, k).AsInt32x4().StoreSlice(g)
|
||||
f(a, b, k).ToInt32x4().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -98,7 +98,7 @@ func testInt64x2CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadInt64x2Slice(y)
|
||||
k := archsimd.LoadInt64x2Slice(toVect[int64](m)).ToMask()
|
||||
g := make([]int64, n)
|
||||
f(a, b, k).AsInt64x2().StoreSlice(g)
|
||||
f(a, b, k).ToInt64x2().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -122,7 +122,7 @@ func testUint8x16CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadUint8x16Slice(y)
|
||||
k := archsimd.LoadInt8x16Slice(toVect[int8](m)).ToMask()
|
||||
g := make([]int8, n)
|
||||
f(a, b, k).AsInt8x16().StoreSlice(g)
|
||||
f(a, b, k).ToInt8x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -146,7 +146,7 @@ func testUint16x8CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadUint16x8Slice(y)
|
||||
k := archsimd.LoadInt16x8Slice(toVect[int16](m)).ToMask()
|
||||
g := make([]int16, n)
|
||||
f(a, b, k).AsInt16x8().StoreSlice(g)
|
||||
f(a, b, k).ToInt16x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -170,7 +170,7 @@ func testUint32x4CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadUint32x4Slice(y)
|
||||
k := archsimd.LoadInt32x4Slice(toVect[int32](m)).ToMask()
|
||||
g := make([]int32, n)
|
||||
f(a, b, k).AsInt32x4().StoreSlice(g)
|
||||
f(a, b, k).ToInt32x4().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -194,7 +194,7 @@ func testUint64x2CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadUint64x2Slice(y)
|
||||
k := archsimd.LoadInt64x2Slice(toVect[int64](m)).ToMask()
|
||||
g := make([]int64, n)
|
||||
f(a, b, k).AsInt64x2().StoreSlice(g)
|
||||
f(a, b, k).ToInt64x2().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -218,7 +218,7 @@ func testFloat32x4CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadFloat32x4Slice(y)
|
||||
k := archsimd.LoadInt32x4Slice(toVect[int32](m)).ToMask()
|
||||
g := make([]int32, n)
|
||||
f(a, b, k).AsInt32x4().StoreSlice(g)
|
||||
f(a, b, k).ToInt32x4().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -242,7 +242,7 @@ func testFloat64x2CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadFloat64x2Slice(y)
|
||||
k := archsimd.LoadInt64x2Slice(toVect[int64](m)).ToMask()
|
||||
g := make([]int64, n)
|
||||
f(a, b, k).AsInt64x2().StoreSlice(g)
|
||||
f(a, b, k).ToInt64x2().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -266,7 +266,7 @@ func testInt8x32CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadInt8x32Slice(y)
|
||||
k := archsimd.LoadInt8x32Slice(toVect[int8](m)).ToMask()
|
||||
g := make([]int8, n)
|
||||
f(a, b, k).AsInt8x32().StoreSlice(g)
|
||||
f(a, b, k).ToInt8x32().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -290,7 +290,7 @@ func testInt16x16CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadInt16x16Slice(y)
|
||||
k := archsimd.LoadInt16x16Slice(toVect[int16](m)).ToMask()
|
||||
g := make([]int16, n)
|
||||
f(a, b, k).AsInt16x16().StoreSlice(g)
|
||||
f(a, b, k).ToInt16x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -314,7 +314,7 @@ func testInt32x8CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadInt32x8Slice(y)
|
||||
k := archsimd.LoadInt32x8Slice(toVect[int32](m)).ToMask()
|
||||
g := make([]int32, n)
|
||||
f(a, b, k).AsInt32x8().StoreSlice(g)
|
||||
f(a, b, k).ToInt32x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -338,7 +338,7 @@ func testInt64x4CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadInt64x4Slice(y)
|
||||
k := archsimd.LoadInt64x4Slice(toVect[int64](m)).ToMask()
|
||||
g := make([]int64, n)
|
||||
f(a, b, k).AsInt64x4().StoreSlice(g)
|
||||
f(a, b, k).ToInt64x4().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -362,7 +362,7 @@ func testUint8x32CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadUint8x32Slice(y)
|
||||
k := archsimd.LoadInt8x32Slice(toVect[int8](m)).ToMask()
|
||||
g := make([]int8, n)
|
||||
f(a, b, k).AsInt8x32().StoreSlice(g)
|
||||
f(a, b, k).ToInt8x32().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -386,7 +386,7 @@ func testUint16x16CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadUint16x16Slice(y)
|
||||
k := archsimd.LoadInt16x16Slice(toVect[int16](m)).ToMask()
|
||||
g := make([]int16, n)
|
||||
f(a, b, k).AsInt16x16().StoreSlice(g)
|
||||
f(a, b, k).ToInt16x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -410,7 +410,7 @@ func testUint32x8CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadUint32x8Slice(y)
|
||||
k := archsimd.LoadInt32x8Slice(toVect[int32](m)).ToMask()
|
||||
g := make([]int32, n)
|
||||
f(a, b, k).AsInt32x8().StoreSlice(g)
|
||||
f(a, b, k).ToInt32x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -434,7 +434,7 @@ func testUint64x4CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadUint64x4Slice(y)
|
||||
k := archsimd.LoadInt64x4Slice(toVect[int64](m)).ToMask()
|
||||
g := make([]int64, n)
|
||||
f(a, b, k).AsInt64x4().StoreSlice(g)
|
||||
f(a, b, k).ToInt64x4().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -458,7 +458,7 @@ func testFloat32x8CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadFloat32x8Slice(y)
|
||||
k := archsimd.LoadInt32x8Slice(toVect[int32](m)).ToMask()
|
||||
g := make([]int32, n)
|
||||
f(a, b, k).AsInt32x8().StoreSlice(g)
|
||||
f(a, b, k).ToInt32x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -482,7 +482,7 @@ func testFloat64x4CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadFloat64x4Slice(y)
|
||||
k := archsimd.LoadInt64x4Slice(toVect[int64](m)).ToMask()
|
||||
g := make([]int64, n)
|
||||
f(a, b, k).AsInt64x4().StoreSlice(g)
|
||||
f(a, b, k).ToInt64x4().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -506,7 +506,7 @@ func testInt8x64CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadInt8x64Slice(y)
|
||||
k := archsimd.LoadInt8x64Slice(toVect[int8](m)).ToMask()
|
||||
g := make([]int8, n)
|
||||
f(a, b, k).AsInt8x64().StoreSlice(g)
|
||||
f(a, b, k).ToInt8x64().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -530,7 +530,7 @@ func testInt16x32CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadInt16x32Slice(y)
|
||||
k := archsimd.LoadInt16x32Slice(toVect[int16](m)).ToMask()
|
||||
g := make([]int16, n)
|
||||
f(a, b, k).AsInt16x32().StoreSlice(g)
|
||||
f(a, b, k).ToInt16x32().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -554,7 +554,7 @@ func testInt32x16CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadInt32x16Slice(y)
|
||||
k := archsimd.LoadInt32x16Slice(toVect[int32](m)).ToMask()
|
||||
g := make([]int32, n)
|
||||
f(a, b, k).AsInt32x16().StoreSlice(g)
|
||||
f(a, b, k).ToInt32x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -578,7 +578,7 @@ func testInt64x8CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadInt64x8Slice(y)
|
||||
k := archsimd.LoadInt64x8Slice(toVect[int64](m)).ToMask()
|
||||
g := make([]int64, n)
|
||||
f(a, b, k).AsInt64x8().StoreSlice(g)
|
||||
f(a, b, k).ToInt64x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -602,7 +602,7 @@ func testUint8x64CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadUint8x64Slice(y)
|
||||
k := archsimd.LoadInt8x64Slice(toVect[int8](m)).ToMask()
|
||||
g := make([]int8, n)
|
||||
f(a, b, k).AsInt8x64().StoreSlice(g)
|
||||
f(a, b, k).ToInt8x64().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -626,7 +626,7 @@ func testUint16x32CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadUint16x32Slice(y)
|
||||
k := archsimd.LoadInt16x32Slice(toVect[int16](m)).ToMask()
|
||||
g := make([]int16, n)
|
||||
f(a, b, k).AsInt16x32().StoreSlice(g)
|
||||
f(a, b, k).ToInt16x32().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -650,7 +650,7 @@ func testUint32x16CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadUint32x16Slice(y)
|
||||
k := archsimd.LoadInt32x16Slice(toVect[int32](m)).ToMask()
|
||||
g := make([]int32, n)
|
||||
f(a, b, k).AsInt32x16().StoreSlice(g)
|
||||
f(a, b, k).ToInt32x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -674,7 +674,7 @@ func testUint64x8CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadUint64x8Slice(y)
|
||||
k := archsimd.LoadInt64x8Slice(toVect[int64](m)).ToMask()
|
||||
g := make([]int64, n)
|
||||
f(a, b, k).AsInt64x8().StoreSlice(g)
|
||||
f(a, b, k).ToInt64x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -698,7 +698,7 @@ func testFloat32x16CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadFloat32x16Slice(y)
|
||||
k := archsimd.LoadInt32x16Slice(toVect[int32](m)).ToMask()
|
||||
g := make([]int32, n)
|
||||
f(a, b, k).AsInt32x16().StoreSlice(g)
|
||||
f(a, b, k).ToInt32x16().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
@@ -722,7 +722,7 @@ func testFloat64x8CompareMasked(t *testing.T,
|
||||
b := archsimd.LoadFloat64x8Slice(y)
|
||||
k := archsimd.LoadInt64x8Slice(toVect[int64](m)).ToMask()
|
||||
g := make([]int64, n)
|
||||
f(a, b, k).AsInt64x8().StoreSlice(g)
|
||||
f(a, b, k).ToInt64x8().StoreSlice(g)
|
||||
w := want(x, y)
|
||||
for i := range m {
|
||||
if !m[i] {
|
||||
|
||||
@@ -381,7 +381,7 @@ func TestMergeFloat(t *testing.T) {
|
||||
a := archsimd.LoadFloat64x4Slice([]float64{1, 2, 3, 4})
|
||||
b := archsimd.LoadFloat64x4Slice([]float64{4, 2, 3, 1})
|
||||
g := a.Greater(b)
|
||||
g.AsInt64x4().StoreSlice(k)
|
||||
g.ToInt64x4().StoreSlice(k)
|
||||
c := a.Merge(b, g)
|
||||
|
||||
c.StoreSlice(s)
|
||||
@@ -402,7 +402,7 @@ func TestMergeFloat512(t *testing.T) {
|
||||
a := archsimd.LoadFloat64x8Slice([]float64{1, 2, 3, 4, 5, 6, 7, 8})
|
||||
b := archsimd.LoadFloat64x8Slice([]float64{8, 7, 6, 5, 4, 2, 3, 1})
|
||||
g := a.Greater(b)
|
||||
g.AsInt64x8().StoreSlice(k)
|
||||
g.ToInt64x8().StoreSlice(k)
|
||||
c := a.Merge(b, g)
|
||||
d := a.Masked(g)
|
||||
|
||||
@@ -487,7 +487,7 @@ func TestMaskOpt512(t *testing.T) {
|
||||
g := a.Greater(b)
|
||||
e := c.Add(d).Masked(g)
|
||||
e.StoreSlice(s)
|
||||
g.AsInt64x8().StoreSlice(k)
|
||||
g.ToInt64x8().StoreSlice(k)
|
||||
checkSlices[int64](t, k, []int64{-1, 0, -1, 0, -1, 0, -1, 0})
|
||||
checkSlices[float64](t, s, []float64{3, 0, 9, 0, 15, 0, 21, 0})
|
||||
}
|
||||
|
||||
@@ -6,25 +6,25 @@ package archsimd
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Int8x16) Masked(mask Mask8x16) Int8x16 {
|
||||
im := mask.AsInt8x16()
|
||||
im := mask.ToInt8x16()
|
||||
return im.And(x)
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Int8x16) Merge(y Int8x16, mask Mask8x16) Int8x16 {
|
||||
im := mask.AsInt8x16()
|
||||
im := mask.ToInt8x16()
|
||||
return y.blend(x, im)
|
||||
}
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Int16x8) Masked(mask Mask16x8) Int16x8 {
|
||||
im := mask.AsInt16x8()
|
||||
im := mask.ToInt16x8()
|
||||
return im.And(x)
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Int16x8) Merge(y Int16x8, mask Mask16x8) Int16x8 {
|
||||
im := mask.AsInt16x8().AsInt8x16()
|
||||
im := mask.ToInt16x8().AsInt8x16()
|
||||
ix := x.AsInt8x16()
|
||||
iy := y.AsInt8x16()
|
||||
return iy.blend(ix, im).AsInt16x8()
|
||||
@@ -32,13 +32,13 @@ func (x Int16x8) Merge(y Int16x8, mask Mask16x8) Int16x8 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Int32x4) Masked(mask Mask32x4) Int32x4 {
|
||||
im := mask.AsInt32x4()
|
||||
im := mask.ToInt32x4()
|
||||
return im.And(x)
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Int32x4) Merge(y Int32x4, mask Mask32x4) Int32x4 {
|
||||
im := mask.AsInt32x4().AsInt8x16()
|
||||
im := mask.ToInt32x4().AsInt8x16()
|
||||
ix := x.AsInt8x16()
|
||||
iy := y.AsInt8x16()
|
||||
return iy.blend(ix, im).AsInt32x4()
|
||||
@@ -46,13 +46,13 @@ func (x Int32x4) Merge(y Int32x4, mask Mask32x4) Int32x4 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Int64x2) Masked(mask Mask64x2) Int64x2 {
|
||||
im := mask.AsInt64x2()
|
||||
im := mask.ToInt64x2()
|
||||
return im.And(x)
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Int64x2) Merge(y Int64x2, mask Mask64x2) Int64x2 {
|
||||
im := mask.AsInt64x2().AsInt8x16()
|
||||
im := mask.ToInt64x2().AsInt8x16()
|
||||
ix := x.AsInt8x16()
|
||||
iy := y.AsInt8x16()
|
||||
return iy.blend(ix, im).AsInt64x2()
|
||||
@@ -60,13 +60,13 @@ func (x Int64x2) Merge(y Int64x2, mask Mask64x2) Int64x2 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Uint8x16) Masked(mask Mask8x16) Uint8x16 {
|
||||
im := mask.AsInt8x16()
|
||||
im := mask.ToInt8x16()
|
||||
return x.AsInt8x16().And(im).AsUint8x16()
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Uint8x16) Merge(y Uint8x16, mask Mask8x16) Uint8x16 {
|
||||
im := mask.AsInt8x16()
|
||||
im := mask.ToInt8x16()
|
||||
ix := x.AsInt8x16()
|
||||
iy := y.AsInt8x16()
|
||||
return iy.blend(ix, im).AsUint8x16()
|
||||
@@ -74,13 +74,13 @@ func (x Uint8x16) Merge(y Uint8x16, mask Mask8x16) Uint8x16 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Uint16x8) Masked(mask Mask16x8) Uint16x8 {
|
||||
im := mask.AsInt16x8()
|
||||
im := mask.ToInt16x8()
|
||||
return x.AsInt16x8().And(im).AsUint16x8()
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Uint16x8) Merge(y Uint16x8, mask Mask16x8) Uint16x8 {
|
||||
im := mask.AsInt16x8().AsInt8x16()
|
||||
im := mask.ToInt16x8().AsInt8x16()
|
||||
ix := x.AsInt8x16()
|
||||
iy := y.AsInt8x16()
|
||||
return iy.blend(ix, im).AsUint16x8()
|
||||
@@ -88,13 +88,13 @@ func (x Uint16x8) Merge(y Uint16x8, mask Mask16x8) Uint16x8 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Uint32x4) Masked(mask Mask32x4) Uint32x4 {
|
||||
im := mask.AsInt32x4()
|
||||
im := mask.ToInt32x4()
|
||||
return x.AsInt32x4().And(im).AsUint32x4()
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Uint32x4) Merge(y Uint32x4, mask Mask32x4) Uint32x4 {
|
||||
im := mask.AsInt32x4().AsInt8x16()
|
||||
im := mask.ToInt32x4().AsInt8x16()
|
||||
ix := x.AsInt8x16()
|
||||
iy := y.AsInt8x16()
|
||||
return iy.blend(ix, im).AsUint32x4()
|
||||
@@ -102,13 +102,13 @@ func (x Uint32x4) Merge(y Uint32x4, mask Mask32x4) Uint32x4 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Uint64x2) Masked(mask Mask64x2) Uint64x2 {
|
||||
im := mask.AsInt64x2()
|
||||
im := mask.ToInt64x2()
|
||||
return x.AsInt64x2().And(im).AsUint64x2()
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Uint64x2) Merge(y Uint64x2, mask Mask64x2) Uint64x2 {
|
||||
im := mask.AsInt64x2().AsInt8x16()
|
||||
im := mask.ToInt64x2().AsInt8x16()
|
||||
ix := x.AsInt8x16()
|
||||
iy := y.AsInt8x16()
|
||||
return iy.blend(ix, im).AsUint64x2()
|
||||
@@ -116,13 +116,13 @@ func (x Uint64x2) Merge(y Uint64x2, mask Mask64x2) Uint64x2 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Float32x4) Masked(mask Mask32x4) Float32x4 {
|
||||
im := mask.AsInt32x4()
|
||||
im := mask.ToInt32x4()
|
||||
return x.AsInt32x4().And(im).AsFloat32x4()
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Float32x4) Merge(y Float32x4, mask Mask32x4) Float32x4 {
|
||||
im := mask.AsInt32x4().AsInt8x16()
|
||||
im := mask.ToInt32x4().AsInt8x16()
|
||||
ix := x.AsInt8x16()
|
||||
iy := y.AsInt8x16()
|
||||
return iy.blend(ix, im).AsFloat32x4()
|
||||
@@ -130,13 +130,13 @@ func (x Float32x4) Merge(y Float32x4, mask Mask32x4) Float32x4 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Float64x2) Masked(mask Mask64x2) Float64x2 {
|
||||
im := mask.AsInt64x2()
|
||||
im := mask.ToInt64x2()
|
||||
return x.AsInt64x2().And(im).AsFloat64x2()
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Float64x2) Merge(y Float64x2, mask Mask64x2) Float64x2 {
|
||||
im := mask.AsInt64x2().AsInt8x16()
|
||||
im := mask.ToInt64x2().AsInt8x16()
|
||||
ix := x.AsInt8x16()
|
||||
iy := y.AsInt8x16()
|
||||
return iy.blend(ix, im).AsFloat64x2()
|
||||
@@ -144,25 +144,25 @@ func (x Float64x2) Merge(y Float64x2, mask Mask64x2) Float64x2 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Int8x32) Masked(mask Mask8x32) Int8x32 {
|
||||
im := mask.AsInt8x32()
|
||||
im := mask.ToInt8x32()
|
||||
return im.And(x)
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Int8x32) Merge(y Int8x32, mask Mask8x32) Int8x32 {
|
||||
im := mask.AsInt8x32()
|
||||
im := mask.ToInt8x32()
|
||||
return y.blend(x, im)
|
||||
}
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Int16x16) Masked(mask Mask16x16) Int16x16 {
|
||||
im := mask.AsInt16x16()
|
||||
im := mask.ToInt16x16()
|
||||
return im.And(x)
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Int16x16) Merge(y Int16x16, mask Mask16x16) Int16x16 {
|
||||
im := mask.AsInt16x16().AsInt8x32()
|
||||
im := mask.ToInt16x16().AsInt8x32()
|
||||
ix := x.AsInt8x32()
|
||||
iy := y.AsInt8x32()
|
||||
return iy.blend(ix, im).AsInt16x16()
|
||||
@@ -170,13 +170,13 @@ func (x Int16x16) Merge(y Int16x16, mask Mask16x16) Int16x16 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Int32x8) Masked(mask Mask32x8) Int32x8 {
|
||||
im := mask.AsInt32x8()
|
||||
im := mask.ToInt32x8()
|
||||
return im.And(x)
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Int32x8) Merge(y Int32x8, mask Mask32x8) Int32x8 {
|
||||
im := mask.AsInt32x8().AsInt8x32()
|
||||
im := mask.ToInt32x8().AsInt8x32()
|
||||
ix := x.AsInt8x32()
|
||||
iy := y.AsInt8x32()
|
||||
return iy.blend(ix, im).AsInt32x8()
|
||||
@@ -184,13 +184,13 @@ func (x Int32x8) Merge(y Int32x8, mask Mask32x8) Int32x8 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Int64x4) Masked(mask Mask64x4) Int64x4 {
|
||||
im := mask.AsInt64x4()
|
||||
im := mask.ToInt64x4()
|
||||
return im.And(x)
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Int64x4) Merge(y Int64x4, mask Mask64x4) Int64x4 {
|
||||
im := mask.AsInt64x4().AsInt8x32()
|
||||
im := mask.ToInt64x4().AsInt8x32()
|
||||
ix := x.AsInt8x32()
|
||||
iy := y.AsInt8x32()
|
||||
return iy.blend(ix, im).AsInt64x4()
|
||||
@@ -198,13 +198,13 @@ func (x Int64x4) Merge(y Int64x4, mask Mask64x4) Int64x4 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Uint8x32) Masked(mask Mask8x32) Uint8x32 {
|
||||
im := mask.AsInt8x32()
|
||||
im := mask.ToInt8x32()
|
||||
return x.AsInt8x32().And(im).AsUint8x32()
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Uint8x32) Merge(y Uint8x32, mask Mask8x32) Uint8x32 {
|
||||
im := mask.AsInt8x32()
|
||||
im := mask.ToInt8x32()
|
||||
ix := x.AsInt8x32()
|
||||
iy := y.AsInt8x32()
|
||||
return iy.blend(ix, im).AsUint8x32()
|
||||
@@ -212,13 +212,13 @@ func (x Uint8x32) Merge(y Uint8x32, mask Mask8x32) Uint8x32 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Uint16x16) Masked(mask Mask16x16) Uint16x16 {
|
||||
im := mask.AsInt16x16()
|
||||
im := mask.ToInt16x16()
|
||||
return x.AsInt16x16().And(im).AsUint16x16()
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Uint16x16) Merge(y Uint16x16, mask Mask16x16) Uint16x16 {
|
||||
im := mask.AsInt16x16().AsInt8x32()
|
||||
im := mask.ToInt16x16().AsInt8x32()
|
||||
ix := x.AsInt8x32()
|
||||
iy := y.AsInt8x32()
|
||||
return iy.blend(ix, im).AsUint16x16()
|
||||
@@ -226,13 +226,13 @@ func (x Uint16x16) Merge(y Uint16x16, mask Mask16x16) Uint16x16 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Uint32x8) Masked(mask Mask32x8) Uint32x8 {
|
||||
im := mask.AsInt32x8()
|
||||
im := mask.ToInt32x8()
|
||||
return x.AsInt32x8().And(im).AsUint32x8()
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Uint32x8) Merge(y Uint32x8, mask Mask32x8) Uint32x8 {
|
||||
im := mask.AsInt32x8().AsInt8x32()
|
||||
im := mask.ToInt32x8().AsInt8x32()
|
||||
ix := x.AsInt8x32()
|
||||
iy := y.AsInt8x32()
|
||||
return iy.blend(ix, im).AsUint32x8()
|
||||
@@ -240,13 +240,13 @@ func (x Uint32x8) Merge(y Uint32x8, mask Mask32x8) Uint32x8 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Uint64x4) Masked(mask Mask64x4) Uint64x4 {
|
||||
im := mask.AsInt64x4()
|
||||
im := mask.ToInt64x4()
|
||||
return x.AsInt64x4().And(im).AsUint64x4()
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Uint64x4) Merge(y Uint64x4, mask Mask64x4) Uint64x4 {
|
||||
im := mask.AsInt64x4().AsInt8x32()
|
||||
im := mask.ToInt64x4().AsInt8x32()
|
||||
ix := x.AsInt8x32()
|
||||
iy := y.AsInt8x32()
|
||||
return iy.blend(ix, im).AsUint64x4()
|
||||
@@ -254,13 +254,13 @@ func (x Uint64x4) Merge(y Uint64x4, mask Mask64x4) Uint64x4 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Float32x8) Masked(mask Mask32x8) Float32x8 {
|
||||
im := mask.AsInt32x8()
|
||||
im := mask.ToInt32x8()
|
||||
return x.AsInt32x8().And(im).AsFloat32x8()
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Float32x8) Merge(y Float32x8, mask Mask32x8) Float32x8 {
|
||||
im := mask.AsInt32x8().AsInt8x32()
|
||||
im := mask.ToInt32x8().AsInt8x32()
|
||||
ix := x.AsInt8x32()
|
||||
iy := y.AsInt8x32()
|
||||
return iy.blend(ix, im).AsFloat32x8()
|
||||
@@ -268,13 +268,13 @@ func (x Float32x8) Merge(y Float32x8, mask Mask32x8) Float32x8 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Float64x4) Masked(mask Mask64x4) Float64x4 {
|
||||
im := mask.AsInt64x4()
|
||||
im := mask.ToInt64x4()
|
||||
return x.AsInt64x4().And(im).AsFloat64x4()
|
||||
}
|
||||
|
||||
// Merge returns x but with elements set to y where mask is false.
|
||||
func (x Float64x4) Merge(y Float64x4, mask Mask64x4) Float64x4 {
|
||||
im := mask.AsInt64x4().AsInt8x32()
|
||||
im := mask.ToInt64x4().AsInt8x32()
|
||||
ix := x.AsInt8x32()
|
||||
iy := y.AsInt8x32()
|
||||
return iy.blend(ix, im).AsFloat64x4()
|
||||
@@ -282,7 +282,7 @@ func (x Float64x4) Merge(y Float64x4, mask Mask64x4) Float64x4 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Int8x64) Masked(mask Mask8x64) Int8x64 {
|
||||
im := mask.AsInt8x64()
|
||||
im := mask.ToInt8x64()
|
||||
return im.And(x)
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ func (x Int8x64) Merge(y Int8x64, mask Mask8x64) Int8x64 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Int16x32) Masked(mask Mask16x32) Int16x32 {
|
||||
im := mask.AsInt16x32()
|
||||
im := mask.ToInt16x32()
|
||||
return im.And(x)
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ func (x Int16x32) Merge(y Int16x32, mask Mask16x32) Int16x32 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Int32x16) Masked(mask Mask32x16) Int32x16 {
|
||||
im := mask.AsInt32x16()
|
||||
im := mask.ToInt32x16()
|
||||
return im.And(x)
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ func (x Int32x16) Merge(y Int32x16, mask Mask32x16) Int32x16 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Int64x8) Masked(mask Mask64x8) Int64x8 {
|
||||
im := mask.AsInt64x8()
|
||||
im := mask.ToInt64x8()
|
||||
return im.And(x)
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ func (x Int64x8) Merge(y Int64x8, mask Mask64x8) Int64x8 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Uint8x64) Masked(mask Mask8x64) Uint8x64 {
|
||||
im := mask.AsInt8x64()
|
||||
im := mask.ToInt8x64()
|
||||
return x.AsInt8x64().And(im).AsUint8x64()
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ func (x Uint8x64) Merge(y Uint8x64, mask Mask8x64) Uint8x64 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Uint16x32) Masked(mask Mask16x32) Uint16x32 {
|
||||
im := mask.AsInt16x32()
|
||||
im := mask.ToInt16x32()
|
||||
return x.AsInt16x32().And(im).AsUint16x32()
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ func (x Uint16x32) Merge(y Uint16x32, mask Mask16x32) Uint16x32 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Uint32x16) Masked(mask Mask32x16) Uint32x16 {
|
||||
im := mask.AsInt32x16()
|
||||
im := mask.ToInt32x16()
|
||||
return x.AsInt32x16().And(im).AsUint32x16()
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ func (x Uint32x16) Merge(y Uint32x16, mask Mask32x16) Uint32x16 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Uint64x8) Masked(mask Mask64x8) Uint64x8 {
|
||||
im := mask.AsInt64x8()
|
||||
im := mask.ToInt64x8()
|
||||
return x.AsInt64x8().And(im).AsUint64x8()
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ func (x Uint64x8) Merge(y Uint64x8, mask Mask64x8) Uint64x8 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Float32x16) Masked(mask Mask32x16) Float32x16 {
|
||||
im := mask.AsInt32x16()
|
||||
im := mask.ToInt32x16()
|
||||
return x.AsInt32x16().And(im).AsFloat32x16()
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ func (x Float32x16) Merge(y Float32x16, mask Mask32x16) Float32x16 {
|
||||
|
||||
// Masked returns x but with elements zeroed where mask is false.
|
||||
func (x Float64x8) Masked(mask Mask64x8) Float64x8 {
|
||||
im := mask.AsInt64x8()
|
||||
im := mask.ToInt64x8()
|
||||
return x.AsInt64x8().And(im).AsFloat64x8()
|
||||
}
|
||||
|
||||
|
||||
@@ -8652,8 +8652,8 @@ func (from Uint64x8) AsUint16x32() (to Uint16x32)
|
||||
// Uint32x16 converts from Uint64x8 to Uint32x16
|
||||
func (from Uint64x8) AsUint32x16() (to Uint32x16)
|
||||
|
||||
// AsInt8x16 converts from Mask8x16 to Int8x16
|
||||
func (from Mask8x16) AsInt8x16() (to Int8x16)
|
||||
// ToInt8x16 converts from Mask8x16 to Int8x16
|
||||
func (from Mask8x16) ToInt8x16() (to Int8x16)
|
||||
|
||||
// asMask converts from Int8x16 to Mask8x16
|
||||
func (from Int8x16) asMask() (to Mask8x16)
|
||||
@@ -8662,8 +8662,8 @@ func (x Mask8x16) And(y Mask8x16) Mask8x16
|
||||
|
||||
func (x Mask8x16) Or(y Mask8x16) Mask8x16
|
||||
|
||||
// AsInt8x32 converts from Mask8x32 to Int8x32
|
||||
func (from Mask8x32) AsInt8x32() (to Int8x32)
|
||||
// ToInt8x32 converts from Mask8x32 to Int8x32
|
||||
func (from Mask8x32) ToInt8x32() (to Int8x32)
|
||||
|
||||
// asMask converts from Int8x32 to Mask8x32
|
||||
func (from Int8x32) asMask() (to Mask8x32)
|
||||
@@ -8672,8 +8672,8 @@ func (x Mask8x32) And(y Mask8x32) Mask8x32
|
||||
|
||||
func (x Mask8x32) Or(y Mask8x32) Mask8x32
|
||||
|
||||
// AsInt8x64 converts from Mask8x64 to Int8x64
|
||||
func (from Mask8x64) AsInt8x64() (to Int8x64)
|
||||
// ToInt8x64 converts from Mask8x64 to Int8x64
|
||||
func (from Mask8x64) ToInt8x64() (to Int8x64)
|
||||
|
||||
// asMask converts from Int8x64 to Mask8x64
|
||||
func (from Int8x64) asMask() (to Mask8x64)
|
||||
@@ -8682,8 +8682,8 @@ func (x Mask8x64) And(y Mask8x64) Mask8x64
|
||||
|
||||
func (x Mask8x64) Or(y Mask8x64) Mask8x64
|
||||
|
||||
// AsInt16x8 converts from Mask16x8 to Int16x8
|
||||
func (from Mask16x8) AsInt16x8() (to Int16x8)
|
||||
// ToInt16x8 converts from Mask16x8 to Int16x8
|
||||
func (from Mask16x8) ToInt16x8() (to Int16x8)
|
||||
|
||||
// asMask converts from Int16x8 to Mask16x8
|
||||
func (from Int16x8) asMask() (to Mask16x8)
|
||||
@@ -8692,8 +8692,8 @@ func (x Mask16x8) And(y Mask16x8) Mask16x8
|
||||
|
||||
func (x Mask16x8) Or(y Mask16x8) Mask16x8
|
||||
|
||||
// AsInt16x16 converts from Mask16x16 to Int16x16
|
||||
func (from Mask16x16) AsInt16x16() (to Int16x16)
|
||||
// ToInt16x16 converts from Mask16x16 to Int16x16
|
||||
func (from Mask16x16) ToInt16x16() (to Int16x16)
|
||||
|
||||
// asMask converts from Int16x16 to Mask16x16
|
||||
func (from Int16x16) asMask() (to Mask16x16)
|
||||
@@ -8702,8 +8702,8 @@ func (x Mask16x16) And(y Mask16x16) Mask16x16
|
||||
|
||||
func (x Mask16x16) Or(y Mask16x16) Mask16x16
|
||||
|
||||
// AsInt16x32 converts from Mask16x32 to Int16x32
|
||||
func (from Mask16x32) AsInt16x32() (to Int16x32)
|
||||
// ToInt16x32 converts from Mask16x32 to Int16x32
|
||||
func (from Mask16x32) ToInt16x32() (to Int16x32)
|
||||
|
||||
// asMask converts from Int16x32 to Mask16x32
|
||||
func (from Int16x32) asMask() (to Mask16x32)
|
||||
@@ -8712,8 +8712,8 @@ func (x Mask16x32) And(y Mask16x32) Mask16x32
|
||||
|
||||
func (x Mask16x32) Or(y Mask16x32) Mask16x32
|
||||
|
||||
// AsInt32x4 converts from Mask32x4 to Int32x4
|
||||
func (from Mask32x4) AsInt32x4() (to Int32x4)
|
||||
// ToInt32x4 converts from Mask32x4 to Int32x4
|
||||
func (from Mask32x4) ToInt32x4() (to Int32x4)
|
||||
|
||||
// asMask converts from Int32x4 to Mask32x4
|
||||
func (from Int32x4) asMask() (to Mask32x4)
|
||||
@@ -8722,8 +8722,8 @@ func (x Mask32x4) And(y Mask32x4) Mask32x4
|
||||
|
||||
func (x Mask32x4) Or(y Mask32x4) Mask32x4
|
||||
|
||||
// AsInt32x8 converts from Mask32x8 to Int32x8
|
||||
func (from Mask32x8) AsInt32x8() (to Int32x8)
|
||||
// ToInt32x8 converts from Mask32x8 to Int32x8
|
||||
func (from Mask32x8) ToInt32x8() (to Int32x8)
|
||||
|
||||
// asMask converts from Int32x8 to Mask32x8
|
||||
func (from Int32x8) asMask() (to Mask32x8)
|
||||
@@ -8732,8 +8732,8 @@ func (x Mask32x8) And(y Mask32x8) Mask32x8
|
||||
|
||||
func (x Mask32x8) Or(y Mask32x8) Mask32x8
|
||||
|
||||
// AsInt32x16 converts from Mask32x16 to Int32x16
|
||||
func (from Mask32x16) AsInt32x16() (to Int32x16)
|
||||
// ToInt32x16 converts from Mask32x16 to Int32x16
|
||||
func (from Mask32x16) ToInt32x16() (to Int32x16)
|
||||
|
||||
// asMask converts from Int32x16 to Mask32x16
|
||||
func (from Int32x16) asMask() (to Mask32x16)
|
||||
@@ -8742,8 +8742,8 @@ func (x Mask32x16) And(y Mask32x16) Mask32x16
|
||||
|
||||
func (x Mask32x16) Or(y Mask32x16) Mask32x16
|
||||
|
||||
// AsInt64x2 converts from Mask64x2 to Int64x2
|
||||
func (from Mask64x2) AsInt64x2() (to Int64x2)
|
||||
// ToInt64x2 converts from Mask64x2 to Int64x2
|
||||
func (from Mask64x2) ToInt64x2() (to Int64x2)
|
||||
|
||||
// asMask converts from Int64x2 to Mask64x2
|
||||
func (from Int64x2) asMask() (to Mask64x2)
|
||||
@@ -8752,8 +8752,8 @@ func (x Mask64x2) And(y Mask64x2) Mask64x2
|
||||
|
||||
func (x Mask64x2) Or(y Mask64x2) Mask64x2
|
||||
|
||||
// AsInt64x4 converts from Mask64x4 to Int64x4
|
||||
func (from Mask64x4) AsInt64x4() (to Int64x4)
|
||||
// ToInt64x4 converts from Mask64x4 to Int64x4
|
||||
func (from Mask64x4) ToInt64x4() (to Int64x4)
|
||||
|
||||
// asMask converts from Int64x4 to Mask64x4
|
||||
func (from Int64x4) asMask() (to Mask64x4)
|
||||
@@ -8762,8 +8762,8 @@ func (x Mask64x4) And(y Mask64x4) Mask64x4
|
||||
|
||||
func (x Mask64x4) Or(y Mask64x4) Mask64x4
|
||||
|
||||
// AsInt64x8 converts from Mask64x8 to Int64x8
|
||||
func (from Mask64x8) AsInt64x8() (to Int64x8)
|
||||
// ToInt64x8 converts from Mask64x8 to Int64x8
|
||||
func (from Mask64x8) ToInt64x8() (to Int64x8)
|
||||
|
||||
// asMask converts from Int64x8 to Mask64x8
|
||||
func (from Int64x8) asMask() (to Mask64x8)
|
||||
|
||||
@@ -338,168 +338,168 @@ func (from Int64x8) ToMask() (to Mask64x8) {
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int8x16) Not() Int8x16 {
|
||||
return x.Xor(x.Equal(x).AsInt8x16())
|
||||
return x.Xor(x.Equal(x).ToInt8x16())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int16x8) Not() Int16x8 {
|
||||
return x.Xor(x.Equal(x).AsInt16x8())
|
||||
return x.Xor(x.Equal(x).ToInt16x8())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int32x4) Not() Int32x4 {
|
||||
return x.Xor(x.Equal(x).AsInt32x4())
|
||||
return x.Xor(x.Equal(x).ToInt32x4())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Int64x2) Not() Int64x2 {
|
||||
return x.Xor(x.Equal(x).AsInt64x2())
|
||||
return x.Xor(x.Equal(x).ToInt64x2())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int8x32) Not() Int8x32 {
|
||||
return x.Xor(x.Equal(x).AsInt8x32())
|
||||
return x.Xor(x.Equal(x).ToInt8x32())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int16x16) Not() Int16x16 {
|
||||
return x.Xor(x.Equal(x).AsInt16x16())
|
||||
return x.Xor(x.Equal(x).ToInt16x16())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int32x8) Not() Int32x8 {
|
||||
return x.Xor(x.Equal(x).AsInt32x8())
|
||||
return x.Xor(x.Equal(x).ToInt32x8())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Int64x4) Not() Int64x4 {
|
||||
return x.Xor(x.Equal(x).AsInt64x4())
|
||||
return x.Xor(x.Equal(x).ToInt64x4())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX512
|
||||
func (x Int8x64) Not() Int8x64 {
|
||||
return x.Xor(x.Equal(x).AsInt8x64())
|
||||
return x.Xor(x.Equal(x).ToInt8x64())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX512
|
||||
func (x Int16x32) Not() Int16x32 {
|
||||
return x.Xor(x.Equal(x).AsInt16x32())
|
||||
return x.Xor(x.Equal(x).ToInt16x32())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX512
|
||||
func (x Int32x16) Not() Int32x16 {
|
||||
return x.Xor(x.Equal(x).AsInt32x16())
|
||||
return x.Xor(x.Equal(x).ToInt32x16())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX512
|
||||
func (x Int64x8) Not() Int64x8 {
|
||||
return x.Xor(x.Equal(x).AsInt64x8())
|
||||
return x.Xor(x.Equal(x).ToInt64x8())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint8x16) Not() Uint8x16 {
|
||||
return x.Xor(x.Equal(x).AsInt8x16().AsUint8x16())
|
||||
return x.Xor(x.Equal(x).ToInt8x16().AsUint8x16())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint16x8) Not() Uint16x8 {
|
||||
return x.Xor(x.Equal(x).AsInt16x8().AsUint16x8())
|
||||
return x.Xor(x.Equal(x).ToInt16x8().AsUint16x8())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint32x4) Not() Uint32x4 {
|
||||
return x.Xor(x.Equal(x).AsInt32x4().AsUint32x4())
|
||||
return x.Xor(x.Equal(x).ToInt32x4().AsUint32x4())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX
|
||||
func (x Uint64x2) Not() Uint64x2 {
|
||||
return x.Xor(x.Equal(x).AsInt64x2().AsUint64x2())
|
||||
return x.Xor(x.Equal(x).ToInt64x2().AsUint64x2())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint8x32) Not() Uint8x32 {
|
||||
return x.Xor(x.Equal(x).AsInt8x32().AsUint8x32())
|
||||
return x.Xor(x.Equal(x).ToInt8x32().AsUint8x32())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint16x16) Not() Uint16x16 {
|
||||
return x.Xor(x.Equal(x).AsInt16x16().AsUint16x16())
|
||||
return x.Xor(x.Equal(x).ToInt16x16().AsUint16x16())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint32x8) Not() Uint32x8 {
|
||||
return x.Xor(x.Equal(x).AsInt32x8().AsUint32x8())
|
||||
return x.Xor(x.Equal(x).ToInt32x8().AsUint32x8())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX2
|
||||
func (x Uint64x4) Not() Uint64x4 {
|
||||
return x.Xor(x.Equal(x).AsInt64x4().AsUint64x4())
|
||||
return x.Xor(x.Equal(x).ToInt64x4().AsUint64x4())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX512
|
||||
func (x Uint8x64) Not() Uint8x64 {
|
||||
return x.Xor(x.Equal(x).AsInt8x64().AsUint8x64())
|
||||
return x.Xor(x.Equal(x).ToInt8x64().AsUint8x64())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX512
|
||||
func (x Uint16x32) Not() Uint16x32 {
|
||||
return x.Xor(x.Equal(x).AsInt16x32().AsUint16x32())
|
||||
return x.Xor(x.Equal(x).ToInt16x32().AsUint16x32())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX512
|
||||
func (x Uint32x16) Not() Uint32x16 {
|
||||
return x.Xor(x.Equal(x).AsInt32x16().AsUint32x16())
|
||||
return x.Xor(x.Equal(x).ToInt32x16().AsUint32x16())
|
||||
}
|
||||
|
||||
// Not returns the bitwise complement of x
|
||||
//
|
||||
// Emulated, CPU Feature AVX512
|
||||
func (x Uint64x8) Not() Uint64x8 {
|
||||
return x.Xor(x.Equal(x).AsInt64x8().AsUint64x8())
|
||||
return x.Xor(x.Equal(x).ToInt64x8().AsUint64x8())
|
||||
}
|
||||
|
||||
// String returns a string representation of SIMD vector x
|
||||
|
||||
Reference in New Issue
Block a user