aboutsummaryrefslogtreecommitdiff
path: root/src/simd
diff options
context:
space:
mode:
authorJunyang Shao <shaojunyang@google.com>2025-07-14 22:00:29 +0000
committerJunyang Shao <shaojunyang@google.com>2025-07-15 14:54:29 -0700
commitef5f6cc92109ee18d978f81650f93fd8a254b8d2 (patch)
treed3b5a011ea68128f65afc4fe9c390624a897f4af /src/simd
parent6d1068014168da26b2f5bcaab15a137aee4d7d05 (diff)
downloadgo-ef5f6cc92109ee18d978f81650f93fd8a254b8d2.tar.xz
[dev.simd] cmd/compile: adjust param order for AndNot
This CL adjusts the parameter order of AndNot, making it x &^ y instead of ^x & y. This CL also added a test. This CL is partially generated by CL 687977. Change-Id: I244e7b887991dc97e695131a5287af1b0e6fc3ce Reviewed-on: https://go-review.googlesource.com/c/go/+/687996 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/simd')
-rw-r--r--src/simd/ops_amd64.go64
-rw-r--r--src/simd/simd_test.go6
2 files changed, 38 insertions, 32 deletions
diff --git a/src/simd/ops_amd64.go b/src/simd/ops_amd64.go
index 7121a6d208..3b87836962 100644
--- a/src/simd/ops_amd64.go
+++ b/src/simd/ops_amd64.go
@@ -620,164 +620,164 @@ func (x Uint64x8) AndMasked(y Uint64x8, mask Mask64x8) Uint64x8
/* AndNot */
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX
func (x Int8x16) AndNot(y Int8x16) Int8x16
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX2
func (x Int8x32) AndNot(y Int8x32) Int8x32
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX
func (x Int16x8) AndNot(y Int16x8) Int16x8
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX2
func (x Int16x16) AndNot(y Int16x16) Int16x16
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX
func (x Int32x4) AndNot(y Int32x4) Int32x4
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX2
func (x Int32x8) AndNot(y Int32x8) Int32x8
-// AndNot performs a masked bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDND, CPU Feature: AVX512F
func (x Int32x16) AndNot(y Int32x16) Int32x16
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX
func (x Int64x2) AndNot(y Int64x2) Int64x2
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX2
func (x Int64x4) AndNot(y Int64x4) Int64x4
-// AndNot performs a masked bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDNQ, CPU Feature: AVX512F
func (x Int64x8) AndNot(y Int64x8) Int64x8
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX
func (x Uint8x16) AndNot(y Uint8x16) Uint8x16
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX2
func (x Uint8x32) AndNot(y Uint8x32) Uint8x32
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX
func (x Uint16x8) AndNot(y Uint16x8) Uint16x8
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX2
func (x Uint16x16) AndNot(y Uint16x16) Uint16x16
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX
func (x Uint32x4) AndNot(y Uint32x4) Uint32x4
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX2
func (x Uint32x8) AndNot(y Uint32x8) Uint32x8
-// AndNot performs a masked bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDND, CPU Feature: AVX512F
func (x Uint32x16) AndNot(y Uint32x16) Uint32x16
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX
func (x Uint64x2) AndNot(y Uint64x2) Uint64x2
-// AndNot performs a bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDN, CPU Feature: AVX2
func (x Uint64x4) AndNot(y Uint64x4) Uint64x4
-// AndNot performs a masked bitwise AND NOT operation between two vectors.
+// AndNot performs a bitwise x &^ y.
//
// Asm: VPANDNQ, CPU Feature: AVX512F
func (x Uint64x8) AndNot(y Uint64x8) Uint64x8
/* AndNotMasked */
-// AndNotMasked performs a masked bitwise AND NOT operation between two vectors.
+// AndNotMasked performs a bitwise x &^ y.
//
// Asm: VPANDND, CPU Feature: AVX512F
func (x Int32x4) AndNotMasked(y Int32x4, mask Mask32x4) Int32x4
-// AndNotMasked performs a masked bitwise AND NOT operation between two vectors.
+// AndNotMasked performs a bitwise x &^ y.
//
// Asm: VPANDND, CPU Feature: AVX512F
func (x Int32x8) AndNotMasked(y Int32x8, mask Mask32x8) Int32x8
-// AndNotMasked performs a masked bitwise AND NOT operation between two vectors.
+// AndNotMasked performs a bitwise x &^ y.
//
// Asm: VPANDND, CPU Feature: AVX512F
func (x Int32x16) AndNotMasked(y Int32x16, mask Mask32x16) Int32x16
-// AndNotMasked performs a masked bitwise AND NOT operation between two vectors.
+// AndNotMasked performs a bitwise x &^ y.
//
// Asm: VPANDNQ, CPU Feature: AVX512F
func (x Int64x2) AndNotMasked(y Int64x2, mask Mask64x2) Int64x2
-// AndNotMasked performs a masked bitwise AND NOT operation between two vectors.
+// AndNotMasked performs a bitwise x &^ y.
//
// Asm: VPANDNQ, CPU Feature: AVX512F
func (x Int64x4) AndNotMasked(y Int64x4, mask Mask64x4) Int64x4
-// AndNotMasked performs a masked bitwise AND NOT operation between two vectors.
+// AndNotMasked performs a bitwise x &^ y.
//
// Asm: VPANDNQ, CPU Feature: AVX512F
func (x Int64x8) AndNotMasked(y Int64x8, mask Mask64x8) Int64x8
-// AndNotMasked performs a masked bitwise AND NOT operation between two vectors.
+// AndNotMasked performs a bitwise x &^ y.
//
// Asm: VPANDND, CPU Feature: AVX512F
func (x Uint32x4) AndNotMasked(y Uint32x4, mask Mask32x4) Uint32x4
-// AndNotMasked performs a masked bitwise AND NOT operation between two vectors.
+// AndNotMasked performs a bitwise x &^ y.
//
// Asm: VPANDND, CPU Feature: AVX512F
func (x Uint32x8) AndNotMasked(y Uint32x8, mask Mask32x8) Uint32x8
-// AndNotMasked performs a masked bitwise AND NOT operation between two vectors.
+// AndNotMasked performs a bitwise x &^ y.
//
// Asm: VPANDND, CPU Feature: AVX512F
func (x Uint32x16) AndNotMasked(y Uint32x16, mask Mask32x16) Uint32x16
-// AndNotMasked performs a masked bitwise AND NOT operation between two vectors.
+// AndNotMasked performs a bitwise x &^ y.
//
// Asm: VPANDNQ, CPU Feature: AVX512F
func (x Uint64x2) AndNotMasked(y Uint64x2, mask Mask64x2) Uint64x2
-// AndNotMasked performs a masked bitwise AND NOT operation between two vectors.
+// AndNotMasked performs a bitwise x &^ y.
//
// Asm: VPANDNQ, CPU Feature: AVX512F
func (x Uint64x4) AndNotMasked(y Uint64x4, mask Mask64x4) Uint64x4
-// AndNotMasked performs a masked bitwise AND NOT operation between two vectors.
+// AndNotMasked performs a bitwise x &^ y.
//
// Asm: VPANDNQ, CPU Feature: AVX512F
func (x Uint64x8) AndNotMasked(y Uint64x8, mask Mask64x8) Uint64x8
diff --git a/src/simd/simd_test.go b/src/simd/simd_test.go
index d7010de10a..d19889cc76 100644
--- a/src/simd/simd_test.go
+++ b/src/simd/simd_test.go
@@ -196,6 +196,12 @@ func TestCompress(t *testing.T) {
[]int32{2, 4, 0, 0}, "Compress")
}
+func TestAndNot(t *testing.T) {
+ testInt32x4Binary(t, []int32{0b11, 0b00, 0b11, 0b00},
+ []int32{0b01, 0b01, 0b01, 0b01},
+ []int32{0b10, 0b00, 0b10, 0b00}, "AndNot")
+}
+
// checkInt8Slices ensures that b and a are equal, to the end of b.
// also serves to use the slices, to prevent accidental optimization.
func checkInt8Slices(t *testing.T, a, b []int8) {