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 <austin@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/internal/simdgen/go.yaml b/internal/simdgen/go.yaml
index efa5130..a066594 100644
--- a/internal/simdgen/go.yaml
+++ b/internal/simdgen/go.yaml
@@ -2,7 +2,7 @@
# For binary operations, we constrain their two inputs and one output to the
# same Go type using a variable.
- go: Add
- asm: "V?PADD$xi|V?ADDP$xf"
+ asm: "V?PADD[BWDQ]|V?ADDP[SD]"
in:
- go: $t
- go: $t
@@ -11,7 +11,7 @@
- go: Sub
goarch: amd64
- asm: "V?PSUB$xi|V?SUBP$xf"
+ asm: "V?PSUB[BWDQ]|V?SUBP[SD]"
in:
- go: $t
- go: $t
diff --git a/internal/simdgen/main.go b/internal/simdgen/main.go
index 91aa07c..82c31c0 100644
--- a/internal/simdgen/main.go
+++ b/internal/simdgen/main.go
@@ -72,11 +72,6 @@
flagDebugHTML = flag.String("debug-html", "", "write unification trace to `file.html`")
)
-var yamlSubs = strings.NewReplacer(
- "$xi", "[BWDQ]", // x86 integer suffixes
- "$xf", "[SD]", // x86 float suffixes
-)
-
func main() {
flag.Parse()
@@ -92,7 +87,7 @@
if *flagQ != "" {
r := strings.NewReader(*flagQ)
var def unify.Closure
- if err := def.Unmarshal(r, unify.UnmarshalOpts{Path: "<query>", StringReplacer: yamlSubs.Replace}); err != nil {
+ if err := def.Unmarshal(r, unify.UnmarshalOpts{Path: "<query>"}); err != nil {
log.Fatalf("parsing -q: %s", err)
}
inputs = append(inputs, def)
@@ -171,7 +166,7 @@
defer f.Close()
var c unify.Closure
- if err := c.Unmarshal(f, unify.UnmarshalOpts{StringReplacer: yamlSubs.Replace}); err != nil {
+ if err := c.Unmarshal(f, unify.UnmarshalOpts{}); err != nil {
return unify.Closure{}, fmt.Errorf("%s: %v", path, err)
}
return c, nil