diff options
| author | Cherry Mui <cherryyz@google.com> | 2025-12-16 23:14:43 -0500 |
|---|---|---|
| committer | Cherry Mui <cherryyz@google.com> | 2025-12-17 07:31:27 -0800 |
| commit | 05e41225f6e7e707c196b57b16ade185a7c6aa06 (patch) | |
| tree | 8812d6ec94baaa42cb4e7a038d0dc44cf73785d1 /src/simd/archsimd/_gen | |
| parent | 516699848b7c19b2b7f80de82c66012719f6835b (diff) | |
| download | go-05e41225f6e7e707c196b57b16ade185a7c6aa06.tar.xz | |
simd/archsimd: reword documentation of As methods
Change-Id: Ifd6d3e5386383908435dd622e280edb6aa13fdab
Reviewed-on: https://go-review.googlesource.com/c/go/+/730660
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/archsimd/_gen')
| -rw-r--r-- | src/simd/archsimd/_gen/simdgen/gen_simdTypes.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/simd/archsimd/_gen/simdgen/gen_simdTypes.go b/src/simd/archsimd/_gen/simdgen/gen_simdTypes.go index ca4f73c738..baf035f31d 100644 --- a/src/simd/archsimd/_gen/simdgen/gen_simdTypes.go +++ b/src/simd/archsimd/_gen/simdgen/gen_simdTypes.go @@ -30,6 +30,13 @@ func (x simdType) ElemBits() int { return x.Size / x.Lanes } +func (x simdType) Article() string { + if strings.HasPrefix(x.Name, "Int") { + return "an" + } + return "a" // Float, Uint +} + // LanesContainer returns the smallest int/uint bit size that is // large enough to hold one bit for each lane. E.g., Mask32x4 // is 4 lanes, and a uint8 is the smallest uint that has 4 bits. @@ -395,8 +402,8 @@ func ({{.Op1NameAndType "x"}}) {{.Go}}({{.ImmName}} uint8, {{.Op2NameAndType "y" {{end}} {{define "vectorConversion"}} -// {{.Tdst.Name}} converts from {{.Tsrc.Name}} to {{.Tdst.Name}} -func (from {{.Tsrc.Name}}) As{{.Tdst.Name}}() (to {{.Tdst.Name}}) +// As{{.Tdst.Name}} returns {{.Tdst.Article}} {{.Tdst.Name}} with the same bit representation as x. +func (x {{.Tsrc.Name}}) As{{.Tdst.Name}}() {{.Tdst.Name}} {{end}} {{define "mask"}} |
