From baa0ae3aaacfcef6ae04beba78a2d2b06776e423 Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Fri, 19 Dec 2025 14:48:59 -0500 Subject: simd/archsimd: correct type and instruction for SaturateToUint8 It should be defined on unsigned types, not signed types, and use unsigned conversion instructions. Change-Id: I49694ccdf1d331cfde88591531c358d9886e83e6 Reviewed-on: https://go-review.googlesource.com/c/go/+/731500 LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase --- .../archsimd/_gen/simdgen/ops/Converts/go.yaml | 6 ++-- src/simd/archsimd/ops_amd64.go | 40 +++++++++++----------- 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src/simd') diff --git a/src/simd/archsimd/_gen/simdgen/ops/Converts/go.yaml b/src/simd/archsimd/_gen/simdgen/ops/Converts/go.yaml index 64cd4cb24e..1d688b434d 100644 --- a/src/simd/archsimd/_gen/simdgen/ops/Converts/go.yaml +++ b/src/simd/archsimd/_gen/simdgen/ops/Converts/go.yaml @@ -390,11 +390,11 @@ bits: 128 - go: SaturateToUint8 regexpTag: "convert" - asm: "VPMOVS[WDQ]B" + asm: "VPMOVUS[WDQ]B" in: - - base: int + - base: uint out: - - base: int + - base: uint bits: 128 - go: SaturateToInt8 regexpTag: "convert" diff --git a/src/simd/archsimd/ops_amd64.go b/src/simd/archsimd/ops_amd64.go index 8e32533aec..304c0c0796 100644 --- a/src/simd/archsimd/ops_amd64.go +++ b/src/simd/archsimd/ops_amd64.go @@ -5464,53 +5464,53 @@ func (x Int64x8) SaturateToInt32() Int32x8 // SaturateToUint8 converts element values to uint8 with unsigned saturation. // Results are packed to low elements in the returned vector, its upper elements are zeroed. // -// Asm: VPMOVSWB, CPU Feature: AVX512 -func (x Int16x8) SaturateToUint8() Int8x16 +// Asm: VPMOVUSWB, CPU Feature: AVX512 +func (x Uint16x8) SaturateToUint8() Uint8x16 // SaturateToUint8 converts element values to uint8 with unsigned saturation. // -// Asm: VPMOVSWB, CPU Feature: AVX512 -func (x Int16x16) SaturateToUint8() Int8x16 +// Asm: VPMOVUSWB, CPU Feature: AVX512 +func (x Uint16x16) SaturateToUint8() Uint8x16 // SaturateToUint8 converts element values to uint8 with unsigned saturation. -// Results are packed to low elements in the returned vector, its upper elements are zeroed. // -// Asm: VPMOVSDB, CPU Feature: AVX512 -func (x Int32x4) SaturateToUint8() Int8x16 +// Asm: VPMOVUSWB, CPU Feature: AVX512 +func (x Uint16x32) SaturateToUint8() Uint8x32 // SaturateToUint8 converts element values to uint8 with unsigned saturation. // Results are packed to low elements in the returned vector, its upper elements are zeroed. // -// Asm: VPMOVSDB, CPU Feature: AVX512 -func (x Int32x8) SaturateToUint8() Int8x16 +// Asm: VPMOVUSDB, CPU Feature: AVX512 +func (x Uint32x4) SaturateToUint8() Uint8x16 // SaturateToUint8 converts element values to uint8 with unsigned saturation. +// Results are packed to low elements in the returned vector, its upper elements are zeroed. // -// Asm: VPMOVSDB, CPU Feature: AVX512 -func (x Int32x16) SaturateToUint8() Int8x16 +// Asm: VPMOVUSDB, CPU Feature: AVX512 +func (x Uint32x8) SaturateToUint8() Uint8x16 // SaturateToUint8 converts element values to uint8 with unsigned saturation. -// Results are packed to low elements in the returned vector, its upper elements are zeroed. // -// Asm: VPMOVSQB, CPU Feature: AVX512 -func (x Int64x2) SaturateToUint8() Int8x16 +// Asm: VPMOVUSDB, CPU Feature: AVX512 +func (x Uint32x16) SaturateToUint8() Uint8x16 // SaturateToUint8 converts element values to uint8 with unsigned saturation. // Results are packed to low elements in the returned vector, its upper elements are zeroed. // -// Asm: VPMOVSQB, CPU Feature: AVX512 -func (x Int64x4) SaturateToUint8() Int8x16 +// Asm: VPMOVUSQB, CPU Feature: AVX512 +func (x Uint64x2) SaturateToUint8() Uint8x16 // SaturateToUint8 converts element values to uint8 with unsigned saturation. // Results are packed to low elements in the returned vector, its upper elements are zeroed. // -// Asm: VPMOVSQB, CPU Feature: AVX512 -func (x Int64x8) SaturateToUint8() Int8x16 +// Asm: VPMOVUSQB, CPU Feature: AVX512 +func (x Uint64x4) SaturateToUint8() Uint8x16 // SaturateToUint8 converts element values to uint8 with unsigned saturation. +// Results are packed to low elements in the returned vector, its upper elements are zeroed. // -// Asm: VPMOVUSWB, CPU Feature: AVX512 -func (x Uint16x32) SaturateToUint8() Uint8x32 +// Asm: VPMOVUSQB, CPU Feature: AVX512 +func (x Uint64x8) SaturateToUint8() Uint8x16 /* SaturateToUint16 */ -- cgit v1.3