Skip to content

Commit 63313a0

Browse files
aclementsgopherbot
authored andcommitted
simd/internal/spec: add Len and String
I had mistakenly thought these were in simd and not archsimd, but they're present everywhere (which makes sense!) Add them to spec, and update the plan to not exclude them. For #81819 Change-Id: I44420fbb297c77d575ca09f91ff952f06a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/853007 LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Austin Clements <austin@google.com> Reviewed-by: David Chase <drchase@google.com>
1 parent 5b82161 commit 63313a0

17 files changed

Lines changed: 888 additions & 224 deletions

‎src/simd/archsimd/_gen/SPEC-STATS.txt‎

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,49 +13,49 @@ String, Len, ToArch, and FromArch are excluded throughout (§2.7).
1313

1414
Heading for 100%:
1515

16-
spec coverage, by (receiver, name) (§1) 1823 / 2929 62% [spec-common, spec-all]
17-
docs sourced from spec (§3) 2958 / 3206 92% [gen-docs, comments-yaml, handwritten-fill, template-docs]
16+
spec coverage, by (receiver, name) (§1) 1919 / 3025 63% [spec-common, spec-all]
17+
docs sourced from spec (§3) 3126 / 3398 92% [gen-docs, comments-yaml, handwritten-fill, template-docs]
1818

1919
Heading for zero:
2020

2121
type mismatches with spec (§2) 0 -> 0 [fill-enforce]
2222
type divergence across targets (§2) 0 -> 0 [fill-enforce]
2323
spec coverage gaps in defined names (§5) 8 -> 0 [spec-all, convert-lo, mask-bits]
24-
hand-written doc conflicts with spec (§3) 164 -> 0 [doc-triage]
25-
simd mirror drift (§3) 0 -> 0 [comments-yaml]
24+
hand-written doc conflicts with spec (§3) 188 -> 0 [doc-triage]
25+
simd mirror drift (§3) 24 -> 0 [comments-yaml]
2626
categories.yaml entries (§4) 229 -> 0 [cat-rehome, compiler-ops-impl, cat-delete]
27-
midway/comments.yaml entries spec covers (§4) 0 -> 0 [comments-yaml, spec-all]
27+
midway/comments.yaml entries spec covers (§4) 2 -> 0 [comments-yaml, spec-all]
2828

2929

3030
## 1. Spec coverage of API [spec-common, spec-all]
3131

32-
by (target, receiver, name) 3934 / 5204 76%
33-
by (receiver, name) 1823 / 2929 62%
34-
by name 276 / 462 60%
32+
by (target, receiver, name) 4174 / 5444 77%
33+
by (receiver, name) 1919 / 3025 63%
34+
by name 278 / 464 60%
3535

3636
By build configuration:
3737

38-
amd64 1737 / 2692 65%
39-
arm64 1099 / 1311 84%
40-
wasm 750 / 829 90%
41-
portable 348 / 372 94%
38+
amd64 1833 / 2788 66%
39+
arm64 1171 / 1383 85%
40+
wasm 798 / 877 91%
41+
portable 372 / 396 94%
4242

4343
By generator (declarations per tool, counted once per tool per pair):
4444

45-
hand-written 502 / 561 89%
46-
midway 348 / 348 100%
47-
simdgen 1293 / 2272 57%
48-
tmplgen 373 / 421 89%
49-
wasmgen 337 / 392 86%
45+
hand-written 526 / 585 90%
46+
midway 372 / 372 100%
47+
simdgen 1347 / 2326 58%
48+
tmplgen 415 / 463 90%
49+
wasmgen 361 / 416 87%
5050

5151
High-drift-risk names (emitted by >1 generator):
5252

53-
covered 135 / 143 94% [spec-all]
54-
portable core (comments.yaml .common_methods) 65 / 65 100% [spec-common]
53+
covered 137 / 145 94% [spec-all]
54+
portable core (comments.yaml .common_methods) 67 / 67 100% [spec-common]
5555

56-
spec operations written so far 81
57-
expanding to distinct names 287
58-
expanding to (receiver, name) pairs 2672
56+
spec operations written so far 84
57+
expanding to distinct names 289
58+
expanding to (receiver, name) pairs 2784
5959

6060

6161
## 2. Signatures and names [named-results, fill-enforce]
@@ -87,11 +87,11 @@ argument agrees with any name:
8787
A declaration counts as sourced from spec when its doc comment begins with
8888
spec's text (a prefix test, because Fill leaves generator notes below).
8989

90-
covered declarations whose doc comes from spec 2958 / 3206 92% [gen-docs, comments-yaml, handwritten-fill, template-docs]
90+
covered declarations whose doc comes from spec 3126 / 3398 92% [gen-docs, comments-yaml, handwritten-fill, template-docs]
9191

92-
simd ∩ archsimd methods with matching docs 270 / 270 100% [gen-docs, comments-yaml]
92+
simd ∩ archsimd methods with matching docs 294 / 294 100% [gen-docs, comments-yaml]
9393

94-
hand-written doc conflicts with spec 164 -> 0 [doc-triage]
94+
hand-written doc conflicts with spec 188 -> 0 [doc-triage]
9595
archsimd/clmul_arm64.go 4 -> 0 [doc-triage]
9696
archsimd/extra_amd64.go 6 -> 0 [doc-triage]
9797
archsimd/maskrange_128.go 4 -> 0 [doc-triage]
@@ -104,8 +104,8 @@ hand-written doc conflicts with spec 164 -> 0 [doc-triage]
104104
archsimd/slicepart_amd64.go 4 -> 0 [doc-triage]
105105
archsimd/slicepart_arm64.go 12 -> 0 [doc-triage]
106106
archsimd/slicepart_wasm.go 12 -> 0 [doc-triage]
107-
simd_emulated.go 12 -> 0 [doc-triage]
108-
drifted docs in simd mirror (stubs vs emulated) 0 -> 0 [comments-yaml]
107+
simd_emulated.go 36 -> 0 [doc-triage]
108+
drifted docs in simd mirror (stubs vs emulated) 24 -> 0 [comments-yaml]
109109
mirrored declarations 372
110110

111111

@@ -132,7 +132,7 @@ compiler-only categories.yaml entries 42 -> 0 [compiler-ops-i
132132
regexpTag 25 -> 0 [cat-rehome]
133133
signed 6 -> 0 [cat-rehome]
134134

135-
midway/comments.yaml entries spec covers 0 -> 0 [comments-yaml, spec-all]
135+
midway/comments.yaml entries spec covers 2 -> 0 [comments-yaml, spec-all]
136136

137137
commutativity disagreements, spec vs categories.yaml 7 -> 0 [spec-all]
138138

@@ -153,13 +153,13 @@ Every name either side defines, less the 186 spec has never defined at all
153153

154154
relation names Σ|api - spec| Σ|spec - api|
155155
(-> 0) (review)
156-
api = spec 219 0 0
157-
api ⊂ spec 51 0 799
156+
api = spec 220 0 0
157+
api ⊂ spec 52 0 815
158158
api ⊃ spec 0 0 0
159159
overlapping 0 0 0
160160
disjoint 6 8 16
161161
api = ∅ 11 0 34
162-
total 287 8 849
162+
total 289 8 865
163163

164164
Names that disagree, with api - spec receivers (the defects):
165165

@@ -217,6 +217,7 @@ Names that disagree, with api - spec receivers (the defects):
217217
api - spec = Uint8x16
218218
IsNaN api ⊂ spec 6 8 0 2
219219
LeadingZeros api ⊂ spec 16 32 0 16
220+
Len api ⊂ spec 40 56 0 16
220221
Less api ⊂ spec 39 40 0 1
221222
LessEqual api ⊂ spec 39 40 0 1
222223
MulAdd api ⊂ spec 22 40 0 18

‎src/simd/archsimd/_gen/SPEC-TRANSITION.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ decay.
342342
tolerated-miss list converge: all three `ops_internal_*.go` files (amd64,
343343
arm64, sve) contain zero exported declarations, so every compiler-only
344344
operation falls outside `specfill`'s view without needing a category. The
345-
permanent residue is small and enumerable: the `String`, `Len`, `ToArch`
346-
methods and `xFromArch` functions.
345+
permanent residue is small and enumerable: the `ToArch` methods and
346+
`xFromArch` functions.
347347

348348
## 1.8 Named results
349349

‎src/simd/archsimd/_gen/cmd/specstats/input.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ func (f fact) archMethodKey() archMethodKey { return archMethodKey{f.target, f.p
9999
func (f fact) tool() string { t, _, _ := strings.Cut(f.gen, "/"); return t }
100100

101101
// nonSpecOp reports whether name is an operation that will never come from spec:
102-
// they are Go conventions (String, Len) or architecture bridge operations
103-
// (ToArch, FromArch). They are excluded from the fact table, and
102+
// specifically architecture bridge operations ToArch and FromArch.
103+
// They are excluded from the fact table, and
104104
// so from every denominator. See SPEC-TRANSITION.md §2.7.
105105
func nonSpecOp(name string) bool {
106-
return name == "String" || name == "Len" || name == "ToArch" || strings.HasSuffix(name, "FromArch")
106+
return name == "ToArch" || strings.HasSuffix(name, "FromArch")
107107
}
108108

109109
// loadOverlay builds a packages.Config.Overlay map from the scratch overlay

‎src/simd/archsimd/maskmerge_gen_arm64.go‎

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/simd/archsimd/ops_wasm.go‎

Lines changed: 18 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)