[go] simd: make function comment match function name

2 views
Skip to first unread message

shuang cui (Gerrit)

unread,
Jul 6, 2026, 10:56:39 AMJul 6
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

shuang cui has uploaded the change for review

Commit message

simd: make function comment match function name
Change-Id: Ia474eb19df92cfdb4122564a87a9837b4ff03348

Change diff

diff --git a/src/simd/internal/bridge/simd_emulated.go b/src/simd/internal/bridge/simd_emulated.go
index b6d0d72..440446d 100644
--- a/src/simd/internal/bridge/simd_emulated.go
+++ b/src/simd/internal/bridge/simd_emulated.go
@@ -12,7 +12,7 @@
"math/bits"
)

-// VectorSize returns the bit length of the emulated vector (fixed to 128).
+// VectorBitSize returns the bit length of the emulated vector (fixed to 128).
func VectorBitSize() int {
return 128
}
@@ -3210,65 +3210,65 @@
by16 = 0x0001000100010001
)

-// BroadcastInt8 fills the elements of a slice with its argument value.
+// BroadcastInt8s fills the elements of a slice with its argument value.
func BroadcastInt8s(x int8) Int8s {
v := (255 & uint64(x)) * by8
return Int8s{a: v, b: v}
}

-// BroadcastInt16 fills the elements of a slice with its argument value.
+// BroadcastInt16s fills the elements of a slice with its argument value.
func BroadcastInt16s(x int16) Int16s {
v := (65535 & uint64(x)) * by16
return Int16s{a: v, b: v}
}

-// BroadcastInt32 fills the elements of a slice with its argument value.
+// BroadcastInt32s fills the elements of a slice with its argument value.
func BroadcastInt32s(x int32) Int32s {
v := uint64(x) & 0xffffffff
v = v<<32 | v
return Int32s{a: v, b: v}
}

-// BroadcastInt64 fills the elements of a slice with its argument value.
+// BroadcastInt64s fills the elements of a slice with its argument value.
func BroadcastInt64s(x int64) Int64s {
v := uint64(x)
return Int64s{a: v, b: v}
}

-// BroadcastUint8 fills the elements of a slice with its argument value.
+// BroadcastUint8s fills the elements of a slice with its argument value.
func BroadcastUint8s(x uint8) Uint8s {
v := uint64(x) * by8
return Uint8s{a: v, b: v}

}

-// BroadcastUint16 fills the elements of a slice with its argument value.
+// BroadcastUint16s fills the elements of a slice with its argument value.
func BroadcastUint16s(x uint16) Uint16s {
v := uint64(x) * by16
return Uint16s{a: v, b: v}

}

-// BroadcastUint32 fills the elements of a slice with its argument value.
+// BroadcastUint32s fills the elements of a slice with its argument value.
func BroadcastUint32s(x uint32) Uint32s {
v := uint64(x)
v = v<<32 | v
return Uint32s{a: v, b: v}
}

-// BroadcastUint64 fills the elements of a slice with its argument value.
+// BroadcastUint64s fills the elements of a slice with its argument value.
func BroadcastUint64s(x uint64) Uint64s {
return Uint64s{a: x, b: x}
}

-// BroadcastFloat32 fills the elements of a slice with its argument value.
+// BroadcastFloat32s fills the elements of a slice with its argument value.
func BroadcastFloat32s(x float32) Float32s {
v := uint64(math.Float32bits(x))
v = v<<32 | v
return Float32s{a: v, b: v}
}

-// BroadcastFloat64 fills the elements of a slice with its argument value.
+// BroadcastFloat64s fills the elements of a slice with its argument value.
func BroadcastFloat64s(x float64) Float64s {
v := math.Float64bits(x)
return Float64s{a: v, b: v}
diff --git a/src/simd/ip_test.go b/src/simd/ip_test.go
index b88c499..cd16893 100644
--- a/src/simd/ip_test.go
+++ b/src/simd/ip_test.go
@@ -170,7 +170,7 @@
return z
}

-// BenchmarkIPnosimd1 is serial, just a vanilla inner product.
+// BenchmarkIPnosimd0 is serial, just a vanilla inner product.
func BenchmarkIPnosimd0(b *testing.B) {
x := make([]float32, ipBenchLen)
y := make([]float32, ipBenchLen)
diff --git a/src/simd/simd_emulated.go b/src/simd/simd_emulated.go
index 3737297..4bee6a1 100644
--- a/src/simd/simd_emulated.go
+++ b/src/simd/simd_emulated.go
@@ -12,7 +12,7 @@
"math/bits"
)

-// VectorSize returns the bit length of the emulated vector (fixed to 128).
+// VectorBitSize returns the bit length of the emulated vector (fixed to 128).
func VectorBitSize() int {
return 128
}
@@ -3210,65 +3210,65 @@
by16 = 0x0001000100010001
)

-// BroadcastInt8 fills the elements of a slice with its argument value.
+// BroadcastInt8s fills the elements of a slice with its argument value.
func BroadcastInt8s(x int8) Int8s {
v := (255 & uint64(x)) * by8
return Int8s{a: v, b: v}
}

-// BroadcastInt16 fills the elements of a slice with its argument value.
+// BroadcastInt16s fills the elements of a slice with its argument value.
func BroadcastInt16s(x int16) Int16s {
v := (65535 & uint64(x)) * by16
return Int16s{a: v, b: v}
}

-// BroadcastInt32 fills the elements of a slice with its argument value.
+// BroadcastInt32s fills the elements of a slice with its argument value.
func BroadcastInt32s(x int32) Int32s {
v := uint64(x) & 0xffffffff
v = v<<32 | v
return Int32s{a: v, b: v}
}

-// BroadcastInt64 fills the elements of a slice with its argument value.
+// BroadcastInt64s fills the elements of a slice with its argument value.
func BroadcastInt64s(x int64) Int64s {
v := uint64(x)
return Int64s{a: v, b: v}
}

-// BroadcastUint8 fills the elements of a slice with its argument value.
+// BroadcastUint8s fills the elements of a slice with its argument value.
func BroadcastUint8s(x uint8) Uint8s {
v := uint64(x) * by8
return Uint8s{a: v, b: v}

}

-// BroadcastUint16 fills the elements of a slice with its argument value.
+// BroadcastUint16s fills the elements of a slice with its argument value.
func BroadcastUint16s(x uint16) Uint16s {
v := uint64(x) * by16
return Uint16s{a: v, b: v}

}

-// BroadcastUint32 fills the elements of a slice with its argument value.
+// BroadcastUint32s fills the elements of a slice with its argument value.
func BroadcastUint32s(x uint32) Uint32s {
v := uint64(x)
v = v<<32 | v
return Uint32s{a: v, b: v}
}

-// BroadcastUint64 fills the elements of a slice with its argument value.
+// BroadcastUint64s fills the elements of a slice with its argument value.
func BroadcastUint64s(x uint64) Uint64s {
return Uint64s{a: x, b: x}
}

-// BroadcastFloat32 fills the elements of a slice with its argument value.
+// BroadcastFloat32s fills the elements of a slice with its argument value.
func BroadcastFloat32s(x float32) Float32s {
v := uint64(math.Float32bits(x))
v = v<<32 | v
return Float32s{a: v, b: v}
}

-// BroadcastFloat64 fills the elements of a slice with its argument value.
+// BroadcastFloat64s fills the elements of a slice with its argument value.
func BroadcastFloat64s(x float64) Float64s {
v := math.Float64bits(x)
return Float64s{a: v, b: v}
diff --git a/src/simd/simd_stubs.go b/src/simd/simd_stubs.go
index 5206290..25ed1a8 100644
--- a/src/simd/simd_stubs.go
+++ b/src/simd/simd_stubs.go
@@ -833,13 +833,13 @@
// Xor returns the bitwise XOR of x and y.
func (x Uint64s) Xor(y Uint64s) Uint64s

-// LoadFloat32 loads a slice of float32 into an Float32s vector.
+// LoadFloat32s loads a slice of float32 into an Float32s vector.
func LoadFloat32s([]float32) Float32s

-// LoadFloat32Part loads a partial slice of float32 into an Float32s vector, returning the vector and the number of elements loaded.
+// LoadFloat32sPart loads a partial slice of float32 into an Float32s vector, returning the vector and the number of elements loaded.
func LoadFloat32sPart([]float32) (Float32s, int)

-// BroadcastFloat32 fills the elements of a slice with its argument value.
+// BroadcastFloat32s fills the elements of a slice with its argument value.
func BroadcastFloat32s(float32) Float32s

// Abs returns the element-wise absolute value of x.
@@ -914,13 +914,13 @@
// ToBits reinterprets the vector bits as an unsigned integer vector.
func (x Float32s) ToBits() Uint32s

-// LoadFloat64 loads a slice of float64 into an Float64s vector.
+// LoadFloat64s loads a slice of float64 into an Float64s vector.
func LoadFloat64s([]float64) Float64s

-// LoadFloat64Part loads a partial slice of float64 into an Float64s vector, returning the vector and the number of elements loaded.
+// LoadFloat64sPart loads a partial slice of float64 into an Float64s vector, returning the vector and the number of elements loaded.
func LoadFloat64sPart([]float64) (Float64s, int)

-// BroadcastFloat64 fills the elements of a slice with its argument value.
+// BroadcastFloat64s fills the elements of a slice with its argument value.
func BroadcastFloat64s(float64) Float64s

// Abs returns the element-wise absolute value of x.

Change information

Files:
  • M src/simd/internal/bridge/simd_emulated.go
  • M src/simd/ip_test.go
  • M src/simd/simd_emulated.go
  • M src/simd/simd_stubs.go
Change size: M
Delta: 4 files changed, 29 insertions(+), 29 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ia474eb19df92cfdb4122564a87a9837b4ff03348
Gerrit-Change-Number: 797120
Gerrit-PatchSet: 1
Gerrit-Owner: shuang cui <imc...@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

shuang cui (Gerrit)

unread,
Jul 6, 2026, 10:57:06 AMJul 6
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

shuang cui voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ia474eb19df92cfdb4122564a87a9837b4ff03348
Gerrit-Change-Number: 797120
Gerrit-PatchSet: 1
Gerrit-Owner: shuang cui <imc...@gmail.com>
Gerrit-Reviewer: shuang cui <imc...@gmail.com>
Gerrit-Comment-Date: Mon, 06 Jul 2026 14:56:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Sean Liao (Gerrit)

unread,
Jul 20, 2026, 4:26:53 PM (yesterday) Jul 20
to shuang cui, goph...@pubsubhelper.golang.org, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com
Attention needed from shuang cui

Sean Liao voted Code-Review+2

Code-Review+2
Open in Gerrit

Related details

Attention is currently required from:
  • shuang cui
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ia474eb19df92cfdb4122564a87a9837b4ff03348
Gerrit-Change-Number: 797120
Gerrit-PatchSet: 1
Gerrit-Owner: shuang cui <imc...@gmail.com>
Gerrit-Reviewer: Sean Liao <se...@liao.dev>
Gerrit-Reviewer: shuang cui <imc...@gmail.com>
Gerrit-Attention: shuang cui <imc...@gmail.com>
Gerrit-Comment-Date: Mon, 20 Jul 2026 20:26:45 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Sean Liao (Gerrit)

unread,
Jul 20, 2026, 4:27:02 PM (yesterday) Jul 20
to shuang cui, goph...@pubsubhelper.golang.org, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com
Attention needed from shuang cui

Sean Liao voted Auto-Submit+1

Auto-Submit+1
Open in Gerrit

Related details

Attention is currently required from:
  • shuang cui
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ia474eb19df92cfdb4122564a87a9837b4ff03348
Gerrit-Change-Number: 797120
Gerrit-PatchSet: 1
Gerrit-Owner: shuang cui <imc...@gmail.com>
Gerrit-Reviewer: Sean Liao <se...@liao.dev>
Gerrit-Reviewer: shuang cui <imc...@gmail.com>
Gerrit-Attention: shuang cui <imc...@gmail.com>
Gerrit-Comment-Date: Mon, 20 Jul 2026 20:26:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Carlos Amedee (Gerrit)

unread,
5:35 PM (5 hours ago) 5:35 PM
to shuang cui, goph...@pubsubhelper.golang.org, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com
Attention needed from shuang cui

Carlos Amedee voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • shuang cui
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ia474eb19df92cfdb4122564a87a9837b4ff03348
Gerrit-Change-Number: 797120
Gerrit-PatchSet: 1
Gerrit-Owner: shuang cui <imc...@gmail.com>
Gerrit-Reviewer: Carlos Amedee <car...@golang.org>
Gerrit-Reviewer: Sean Liao <se...@liao.dev>
Gerrit-Reviewer: shuang cui <imc...@gmail.com>
Gerrit-Attention: shuang cui <imc...@gmail.com>
Gerrit-Comment-Date: Tue, 21 Jul 2026 21:35:34 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Cherry Mui (Gerrit)

unread,
7:24 PM (3 hours ago) 7:24 PM
to shuang cui, goph...@pubsubhelper.golang.org, Carlos Amedee, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com
Attention needed from shuang cui

Cherry Mui added 1 comment

File src/simd/simd_stubs.go
File-level comment, Patchset 1 (Latest):
Cherry Mui . unresolved

This file is generated. We should modify the generator instead.

Open in Gerrit

Related details

Attention is currently required from:
  • shuang cui
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ia474eb19df92cfdb4122564a87a9837b4ff03348
Gerrit-Change-Number: 797120
Gerrit-PatchSet: 1
Gerrit-Owner: shuang cui <imc...@gmail.com>
Gerrit-Reviewer: Carlos Amedee <car...@golang.org>
Gerrit-Reviewer: Sean Liao <se...@liao.dev>
Gerrit-Reviewer: shuang cui <imc...@gmail.com>
Gerrit-CC: Cherry Mui <cher...@google.com>
Gerrit-Attention: shuang cui <imc...@gmail.com>
Gerrit-Comment-Date: Tue, 21 Jul 2026 23:24:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Cherry Mui (Gerrit)

unread,
7:24 PM (3 hours ago) 7:24 PM
to shuang cui, goph...@pubsubhelper.golang.org, Carlos Amedee, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com
Attention needed from Sean Liao and shuang cui

Cherry Mui removed a vote from this change

Removed Auto-Submit+1 by Sean Liao <se...@liao.dev>
Open in Gerrit

Related details

Attention is currently required from:
  • Sean Liao
  • shuang cui
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: deleteVote
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ia474eb19df92cfdb4122564a87a9837b4ff03348
Gerrit-Change-Number: 797120
Gerrit-PatchSet: 1
Gerrit-Owner: shuang cui <imc...@gmail.com>
Gerrit-Reviewer: Carlos Amedee <car...@golang.org>
Gerrit-Reviewer: Sean Liao <se...@liao.dev>
Gerrit-Reviewer: shuang cui <imc...@gmail.com>
Gerrit-CC: Cherry Mui <cher...@google.com>
Gerrit-Attention: Sean Liao <se...@liao.dev>
Gerrit-Attention: shuang cui <imc...@gmail.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Sean Liao (Gerrit)

unread,
7:41 PM (3 hours ago) 7:41 PM
to shuang cui, goph...@pubsubhelper.golang.org, Cherry Mui, Carlos Amedee, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com
Attention needed from shuang cui

Sean Liao voted Code-Review+0

Code-Review+0
Open in Gerrit

Related details

Attention is currently required from:
  • shuang cui
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ia474eb19df92cfdb4122564a87a9837b4ff03348
Gerrit-Change-Number: 797120
Gerrit-PatchSet: 1
Gerrit-Owner: shuang cui <imc...@gmail.com>
Gerrit-Reviewer: Carlos Amedee <car...@golang.org>
Gerrit-Reviewer: Sean Liao <se...@liao.dev>
Gerrit-Reviewer: shuang cui <imc...@gmail.com>
Gerrit-CC: Cherry Mui <cher...@google.com>
Gerrit-Attention: shuang cui <imc...@gmail.com>
Gerrit-Comment-Date: Tue, 21 Jul 2026 23:41:49 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages