b657c00243
Instead of (And64 x x) -> x (And32 x x) -> x (And16 x x) -> x (And8 x x) -> x we can now do: (And(64|32|16|8) x x) -> x Any part of an opcode can have a parenthesized, |-separated list of possibilites. The rule is then expanded using each piece of the | combo. If there are multiple | clauses, they get expanded in tandem. (All the first positions, then all the second positions, etc.) All places | opcodes appear must have the same count. A more complicated example: (MOV(L|SS)load [off1] {sym1} (LEAQ4 [off2] {sym2} ptr idx) mem) && is32Bit(off1+off2) && canMergeSym(sym1, sym2) -> (MOV(L|SS)loadidx4 [off1+off2] {mergeSym(sym1,sym2)} ptr idx mem) This meta-rule generates 2 rules, a MOVL and a MOVSS rule. This CL is carefully orchestrated to not change the generated rules file at all. In some cases, this means we can't align the rules nicely because it changes the whitespace in the generated code. I'll clean that up as a separate step. There are many more opportunites to compactify rules using this new mechanism. I've just done some examples, there's more to do. Change-Id: I8a5e748cd0761ccbb12d09b01925b2f1f4b2f608 Reviewed-on: https://go-review.googlesource.com/86595 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
favicon.ico | ||
LICENSE | ||
PATENTS | ||
README.md | ||
robots.txt |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Contributing
Go is the work of hundreds of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.