x86: rel types and generated tests

This commit is contained in:
Michael McLoughlin
2018-11-27 22:08:11 -08:00
parent 3881907ec8
commit 4395adacc8
13 changed files with 18188 additions and 19 deletions

19
internal/gen/util.go Normal file
View File

@@ -0,0 +1,19 @@
package gen
// cross returns the cross product of the lists in x.
func cross(x [][]string) [][]string {
r := [][]string{nil}
for _, s := range x {
var nxt [][]string
for _, pre := range r {
for _, a := range s {
concat := make([]string, len(pre), len(pre)+1)
copy(concat, pre)
concat = append(concat, a)
nxt = append(nxt, concat)
}
}
r = nxt
}
return r
}