Skip to content

Commit b2f4e28

Browse files
committed
internal/simdgen: adjust type defs for masks and fix errors
Change-Id: I88b970c754450080c5780b7223808072f72dd61f Reviewed-on: https://go-review.googlesource.com/c/arch/+/679275 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: David Chase <[email protected]>
1 parent 61fd4bb commit b2f4e28

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

internal/simdgen/categories.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414
commutative: "true"
1515
extension: "AVX.*"
1616
- go: Sub
17-
commutative: "true"
17+
commutative: "false"
1818
extension: "AVX.*"
1919
- go: SaturatedSub
20-
commutative: "true"
20+
commutative: "false"
2121
extension: "AVX.*"
2222
- go: MaskedSub
2323
masked: "true"
24-
commutative: "true"
24+
commutative: "false"
2525
extension: "AVX.*"
2626
- go: MaskedSaturatedSub
2727
masked: "true"
28-
commutative: "true"
28+
commutative: "false"
2929
extension: "AVX.*"
3030
- go: PairwiseAdd
3131
commutative: "false"

internal/simdgen/gen_simdTypes.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ type {{$tsrc.Name}} struct {
4747
{{$tsrc.Fields}}
4848
}
4949
50+
{{- if ne $tsrc.Type "mask"}}
51+
5052
// Len returns the number of elements in a {{$tsrc.Name}}
5153
func (x {{$tsrc.Name}}) Len() int { return {{$tsrc.Lanes}} }
5254
@@ -60,6 +62,7 @@ func Load{{$tsrc.Name}}(y *[{{$tsrc.Lanes}}]{{$tsrc.Base}}) {{$tsrc.Name}}
6062
//go:noescape
6163
func (x {{$tsrc.Name}}) Store(y *[{{$tsrc.Lanes}}]{{$tsrc.Base}})
6264
65+
{{- end}}
6366
{{- end}}
6467
{{- end}}
6568
`

internal/simdgen/gen_simdssa.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ func writeSIMDSSA(directory string, ops []Operation) error {
148148
All string
149149
ZeroingMask string
150150
}{
151-
strings.Join(Imms, ", "),
152-
strings.Join(Regs[0], ", "),
153-
strings.Join(Regs[1], ", "),
154-
strings.Join(Regs[2], ", "),
155-
strings.Join(Regs[3], ", "),
156-
strings.Join(All, ", "),
157-
strings.Join(ZeroingMask, ", "),
151+
strings.Join(Imms, ",\n\t\t"),
152+
strings.Join(Regs[0], ",\n\t\t"),
153+
strings.Join(Regs[1], ",\n\t\t"),
154+
strings.Join(Regs[2], ",\n\t\t"),
155+
strings.Join(Regs[3], ",\n\t\t"),
156+
strings.Join(All, ",\n\t\t"),
157+
strings.Join(ZeroingMask, ",\n\t\t"),
158158
}
159159

160160
file, t, err := openFileAndPrepareTemplate(directory, "src/cmd/compile/internal/amd64/simdssa.go", simdssaTmpl)

internal/simdgen/ops/AddSub/categories.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414
commutative: "true"
1515
extension: "AVX.*"
1616
- go: Sub
17-
commutative: "true"
17+
commutative: "false"
1818
extension: "AVX.*"
1919
- go: SaturatedSub
20-
commutative: "true"
20+
commutative: "false"
2121
extension: "AVX.*"
2222
- go: MaskedSub
2323
masked: "true"
24-
commutative: "true"
24+
commutative: "false"
2525
extension: "AVX.*"
2626
- go: MaskedSaturatedSub
2727
masked: "true"
28-
commutative: "true"
28+
commutative: "false"
2929
extension: "AVX.*"
3030
- go: PairwiseAdd
3131
commutative: "false"

0 commit comments

Comments
 (0)