]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.simd] simd: clean up mask load comments
authorJunyang Shao <shaojunyang@google.com>
Tue, 14 Oct 2025 16:15:38 +0000 (16:15 +0000)
committerJunyang Shao <shaojunyang@google.com>
Tue, 14 Oct 2025 19:26:48 +0000 (12:26 -0700)
Addressing a comment from CL 710915.

Change-Id: Id65f525130b5b626ea7017aebc93a4b3b0c93d84
Reviewed-on: https://go-review.googlesource.com/c/go/+/711780
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
src/simd/_gen/simdgen/gen_simdTypes.go
src/simd/types_amd64.go

index d443fff16ed7e8afaf198a8ca3c8b0cd9fe3b744..03bb4989d9d820daa35cb8a467c09421c449fd17 100644 (file)
@@ -182,13 +182,17 @@ func (x {{.Name}}) Store(y *[{{.Lanes}}]{{.Base}})
 
 const simdMaskFromValTemplate = `
 // {{.Name}}FromBits constructs a {{.Name}} from a bitmap value, where 1 means set for the indexed element, 0 means unset.
+{{- if ne .Lanes .LanesContainer}}
 // Only the lower {{.Lanes}} bits of y are used.
+{{- end}}
 //
 // Asm: KMOV{{.IntelSizeSuffix}}, CPU Feature: AVX512
 func {{.Name}}FromBits(y uint{{.LanesContainer}}) {{.Name}}
 
 // ToBits constructs a bitmap from a {{.Name}}, where 1 means set for the indexed element, 0 means unset.
+{{- if ne .Lanes .LanesContainer}}
 // Only the lower {{.Lanes}} bits of y are used.
+{{- end}}
 //
 // Asm: KMOV{{.IntelSizeSuffix}}, CPU Features: AVX512
 func (x {{.Name}}) ToBits() uint{{.LanesContainer}}
index 0136f49f9111a12deeec96857c90e52663dc98b8..dfa864b80204725de6a86575ffeb9e49d572aad6 100644 (file)
@@ -302,13 +302,11 @@ type Mask8x16 struct {
 }
 
 // Mask8x16FromBits constructs a Mask8x16 from a bitmap value, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 16 bits of y are used.
 //
 // Asm: KMOVB, CPU Feature: AVX512
 func Mask8x16FromBits(y uint16) Mask8x16
 
 // ToBits constructs a bitmap from a Mask8x16, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 16 bits of y are used.
 //
 // Asm: KMOVB, CPU Features: AVX512
 func (x Mask8x16) ToBits() uint16
@@ -320,13 +318,11 @@ type Mask16x8 struct {
 }
 
 // Mask16x8FromBits constructs a Mask16x8 from a bitmap value, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 8 bits of y are used.
 //
 // Asm: KMOVW, CPU Feature: AVX512
 func Mask16x8FromBits(y uint8) Mask16x8
 
 // ToBits constructs a bitmap from a Mask16x8, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 8 bits of y are used.
 //
 // Asm: KMOVW, CPU Features: AVX512
 func (x Mask16x8) ToBits() uint8
@@ -665,13 +661,11 @@ type Mask8x32 struct {
 }
 
 // Mask8x32FromBits constructs a Mask8x32 from a bitmap value, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 32 bits of y are used.
 //
 // Asm: KMOVB, CPU Feature: AVX512
 func Mask8x32FromBits(y uint32) Mask8x32
 
 // ToBits constructs a bitmap from a Mask8x32, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 32 bits of y are used.
 //
 // Asm: KMOVB, CPU Features: AVX512
 func (x Mask8x32) ToBits() uint32
@@ -683,13 +677,11 @@ type Mask16x16 struct {
 }
 
 // Mask16x16FromBits constructs a Mask16x16 from a bitmap value, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 16 bits of y are used.
 //
 // Asm: KMOVW, CPU Feature: AVX512
 func Mask16x16FromBits(y uint16) Mask16x16
 
 // ToBits constructs a bitmap from a Mask16x16, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 16 bits of y are used.
 //
 // Asm: KMOVW, CPU Features: AVX512
 func (x Mask16x16) ToBits() uint16
@@ -701,13 +693,11 @@ type Mask32x8 struct {
 }
 
 // Mask32x8FromBits constructs a Mask32x8 from a bitmap value, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 8 bits of y are used.
 //
 // Asm: KMOVD, CPU Feature: AVX512
 func Mask32x8FromBits(y uint8) Mask32x8
 
 // ToBits constructs a bitmap from a Mask32x8, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 8 bits of y are used.
 //
 // Asm: KMOVD, CPU Features: AVX512
 func (x Mask32x8) ToBits() uint8
@@ -1092,13 +1082,11 @@ type Mask8x64 struct {
 }
 
 // Mask8x64FromBits constructs a Mask8x64 from a bitmap value, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 64 bits of y are used.
 //
 // Asm: KMOVB, CPU Feature: AVX512
 func Mask8x64FromBits(y uint64) Mask8x64
 
 // ToBits constructs a bitmap from a Mask8x64, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 64 bits of y are used.
 //
 // Asm: KMOVB, CPU Features: AVX512
 func (x Mask8x64) ToBits() uint64
@@ -1110,13 +1098,11 @@ type Mask16x32 struct {
 }
 
 // Mask16x32FromBits constructs a Mask16x32 from a bitmap value, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 32 bits of y are used.
 //
 // Asm: KMOVW, CPU Feature: AVX512
 func Mask16x32FromBits(y uint32) Mask16x32
 
 // ToBits constructs a bitmap from a Mask16x32, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 32 bits of y are used.
 //
 // Asm: KMOVW, CPU Features: AVX512
 func (x Mask16x32) ToBits() uint32
@@ -1128,13 +1114,11 @@ type Mask32x16 struct {
 }
 
 // Mask32x16FromBits constructs a Mask32x16 from a bitmap value, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 16 bits of y are used.
 //
 // Asm: KMOVD, CPU Feature: AVX512
 func Mask32x16FromBits(y uint16) Mask32x16
 
 // ToBits constructs a bitmap from a Mask32x16, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 16 bits of y are used.
 //
 // Asm: KMOVD, CPU Features: AVX512
 func (x Mask32x16) ToBits() uint16
@@ -1146,13 +1130,11 @@ type Mask64x8 struct {
 }
 
 // Mask64x8FromBits constructs a Mask64x8 from a bitmap value, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 8 bits of y are used.
 //
 // Asm: KMOVQ, CPU Feature: AVX512
 func Mask64x8FromBits(y uint8) Mask64x8
 
 // ToBits constructs a bitmap from a Mask64x8, where 1 means set for the indexed element, 0 means unset.
-// Only the lower 8 bits of y are used.
 //
 // Asm: KMOVQ, CPU Features: AVX512
 func (x Mask64x8) ToBits() uint8