From 5ebe2d05d52be797498314c20c93c9ef3fca568d Mon Sep 17 00:00:00 2001 From: Junyang Shao Date: Fri, 22 Aug 2025 20:33:28 +0000 Subject: [PATCH] [dev.simd] simd: correct SumAbsDiff documentation Change-Id: I6bb093615f12bbac5ea4c013a1c47cd5d338fe43 Reviewed-on: https://go-review.googlesource.com/c/go/+/698516 Reviewed-by: David Chase LUCI-TryBot-Result: Go LUCI --- src/simd/_gen/simdgen/ops/MLOps/categories.yaml | 2 +- src/simd/ops_amd64.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/simd/_gen/simdgen/ops/MLOps/categories.yaml b/src/simd/_gen/simdgen/ops/MLOps/categories.yaml index 8e1ffeb131a..772a7b3cf67 100644 --- a/src/simd/_gen/simdgen/ops/MLOps/categories.yaml +++ b/src/simd/_gen/simdgen/ops/MLOps/categories.yaml @@ -49,5 +49,5 @@ commutative: false documentation: !string |- // NAME sums the absolute distance of the two input vectors, each adjacent 8 bytes as a group. The output sum will - // be a vector of word-sized elements whose each 8*n-th element contains the sum of the n-th input group. + // be a vector of word-sized elements whose each 4*n-th element contains the sum of the n-th input group. The other elements in the result vector are zeroed. // This method could be seen as the norm of the L1 distance of each adjacent 8-byte vector group of the two input vectors. diff --git a/src/simd/ops_amd64.go b/src/simd/ops_amd64.go index e600f7c1a0c..bce30aa2cb7 100644 --- a/src/simd/ops_amd64.go +++ b/src/simd/ops_amd64.go @@ -6819,21 +6819,21 @@ func (x Uint16x32) SubSaturated(y Uint16x32) Uint16x32 /* SumAbsDiff */ // SumAbsDiff sums the absolute distance of the two input vectors, each adjacent 8 bytes as a group. The output sum will -// be a vector of word-sized elements whose each 8*n-th element contains the sum of the n-th input group. +// be a vector of word-sized elements whose each 4*n-th element contains the sum of the n-th input group. The other elements in the result vector are zeroed. // This method could be seen as the norm of the L1 distance of each adjacent 8-byte vector group of the two input vectors. // // Asm: VPSADBW, CPU Feature: AVX func (x Uint8x16) SumAbsDiff(y Uint8x16) Uint16x8 // SumAbsDiff sums the absolute distance of the two input vectors, each adjacent 8 bytes as a group. The output sum will -// be a vector of word-sized elements whose each 8*n-th element contains the sum of the n-th input group. +// be a vector of word-sized elements whose each 4*n-th element contains the sum of the n-th input group. The other elements in the result vector are zeroed. // This method could be seen as the norm of the L1 distance of each adjacent 8-byte vector group of the two input vectors. // // Asm: VPSADBW, CPU Feature: AVX2 func (x Uint8x32) SumAbsDiff(y Uint8x32) Uint16x16 // SumAbsDiff sums the absolute distance of the two input vectors, each adjacent 8 bytes as a group. The output sum will -// be a vector of word-sized elements whose each 8*n-th element contains the sum of the n-th input group. +// be a vector of word-sized elements whose each 4*n-th element contains the sum of the n-th input group. The other elements in the result vector are zeroed. // This method could be seen as the norm of the L1 distance of each adjacent 8-byte vector group of the two input vectors. // // Asm: VPSADBW, CPU Feature: AVX512