Skip to content

Commit 097aeb1

Browse files
aclementsgopherbot
authored andcommitted
internal/ximdgen: drop $xi/$xf shorthands
These were string shorthands for x86 integer and float suffixes, respectively, but in practice they were easy to confuse with unification variables (also $<varname>) and just required knowing more stuff in order to understand the unification rules. Drop them and just spell it out. Change-Id: I38a0446e428a92c9e89be4e90d1beff16e48e714 Reviewed-on: https://go-review.googlesource.com/c/arch/+/674177 Auto-Submit: Austin Clements <[email protected]> Reviewed-by: David Chase <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent ca84b2c commit 097aeb1

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

internal/simdgen/go.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# For binary operations, we constrain their two inputs and one output to the
33
# same Go type using a variable.
44
- go: Add
5-
asm: "V?PADD$xi|V?ADDP$xf"
5+
asm: "V?PADD[BWDQ]|V?ADDP[SD]"
66
in:
77
- go: $t
88
- go: $t
@@ -11,7 +11,7 @@
1111

1212
- go: Sub
1313
goarch: amd64
14-
asm: "V?PSUB$xi|V?SUBP$xf"
14+
asm: "V?PSUB[BWDQ]|V?SUBP[SD]"
1515
in:
1616
- go: $t
1717
- go: $t

internal/simdgen/main.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ var (
7272
flagDebugHTML = flag.String("debug-html", "", "write unification trace to `file.html`")
7373
)
7474

75-
var yamlSubs = strings.NewReplacer(
76-
"$xi", "[BWDQ]", // x86 integer suffixes
77-
"$xf", "[SD]", // x86 float suffixes
78-
)
79-
8075
func main() {
8176
flag.Parse()
8277

@@ -92,7 +87,7 @@ func main() {
9287
if *flagQ != "" {
9388
r := strings.NewReader(*flagQ)
9489
var def unify.Closure
95-
if err := def.Unmarshal(r, unify.UnmarshalOpts{Path: "<query>", StringReplacer: yamlSubs.Replace}); err != nil {
90+
if err := def.Unmarshal(r, unify.UnmarshalOpts{Path: "<query>"}); err != nil {
9691
log.Fatalf("parsing -q: %s", err)
9792
}
9893
inputs = append(inputs, def)
@@ -171,7 +166,7 @@ func loadValue(path string) (unify.Closure, error) {
171166
defer f.Close()
172167

173168
var c unify.Closure
174-
if err := c.Unmarshal(f, unify.UnmarshalOpts{StringReplacer: yamlSubs.Replace}); err != nil {
169+
if err := c.Unmarshal(f, unify.UnmarshalOpts{}); err != nil {
175170
return unify.Closure{}, fmt.Errorf("%s: %v", path, err)
176171
}
177172
return c, nil

0 commit comments

Comments
 (0)