Adds "Vector Neural Network Instructions" instruction set.
These are added via the `opcodesextra` mechanism #345, since they're missing
from the opcodes database.
Contributed by @vsivsi. Extracted from #349 with some tweaks.
Co-authored-by: Vaughn Iverson <vsivsi@yahoo.com>
Adds "Vector Advanced Encryption Standard" instruction set.
These are added via the `opcodesextra` mechanism #345, since they're missing
from the opcodes database.
Contributed by @vsivsi. Extracted from #349 with minor tweaks.
Co-authored-by: Vaughn Iverson <vsivsi@yahoo.com>
Adds support for the GFNI "Galois Field New Instructions" instruction set.
These instructions are not included in the Opcodes database, therefore they're
added using the "extras" mechanism introduced in #345.
For simplicity, the loading phase is updated slightly so that AVX-512 form
expansion rules are applied after extras are added to the list. This greatly
reduces the number of forms that have to be specified by hand.
Based on #343Fixes#335
Co-authored-by: Klaus Post <klauspost@gmail.com>
* Bump CI to Go 1.19
* Update golang/go edwards25519 test
* Apply formatting to printer stubs output (to get correct comment formatting)
* Bump gofumpt version
Extends avo to support most AVX-512 instruction sets.
The instruction type is extended to support suffixes. The K family of opmask
registers is added to the register package, and the operand package is updated
to support the new operand types. Move instruction deduction in `Load` and
`Store` is extended to support KMOV* and VMOV* forms.
Internal code generation packages were overhauled. Instruction database loading
required various messy changes to account for the additional complexities of the
AVX-512 instruction sets. The internal/api package was added to introduce a
separation between instruction forms in the database, and the functions avo
provides to create them. This was required since with instruction suffixes there
is no longer a one-to-one mapping between instruction constructors and opcodes.
AVX-512 bloated generated source code size substantially, initially increasing
compilation and CI test times to an unacceptable level. Two changes were made to
address this:
1. Instruction constructors in the `x86` package moved to an optab-based
approach. This compiles substantially faster than the verbose code
generation we had before.
2. The most verbose code-generated tests are moved under build tags and
limited to a stress test mode. Stress test builds are run on
schedule but not in regular CI.
An example of AVX-512 accelerated 16-lane MD5 is provided to demonstrate and
test the new functionality.
Updates #20#163#229
Co-authored-by: Vaughn Iverson <vsivsi@yahoo.com>
Exposes a few functions on Context that are not available globally. This
oversight suggests that #33 or #133 would be reasonable. `Signature()` is
currently excluded because it causes a conflict for users who have
dot-imported both `build` and `gotypes`. For example:
18af27c3ce/build/base64/decode_asm.go (L13-L14)a88a5ae268/asm/asm.go (L6-L7)
Issue #100 demonstrated that register allocation for aliased registers is
fundamentally broken. The root of the issue is that currently accesses to the
same virtual register with different masks are treated as different registers.
This PR takes a different approach:
* Liveness analysis is masked: we now properly consider which parts of a register are live
* Register allocation produces a mapping from virtual to physical ID, and aliasing is applied later
In addition, a new pass ZeroExtend32BitOutputs accounts for the fact that 32-bit writes in 64-bit mode should actually be treated as 64-bit writes (the result is zero-extended).
Closes#100
Go added the TOPFRAME attribute in https://golang.org/cl/169726/. This diff adds the new attribute to avo, and also updates handling of the REFLECTMETHOD attribute.
It was pointed out #73 that Bytes() is a poor name for the size of the register in bytes. In idiomatic Go you would probably expect a Bytes() method to return []byte.
This diff changes the Bytes() to Size(). As a result the Size type also needed to be renamed, and Width seemed a reasonable choice.
Fixes#73
Provides a method on `gotypes.Component` to allow pointer dereference. This will enable `gotypes` helpers to be used with struct pointer arguments, for example.
Updates #53Fixes#54
By using Implement you can provide a definition of a function, taking the signature from a stub in the package. One major benefit of this approach is it makes it easy to handle external types in the function signature.
Updates #55
The Go assembler merges MOVD/MOVQ instruction forms. The logic in the
avo instruction loader was discarding the MOVD forms. This diff should
merge them correctly.
Updates #50
The Context.Label method and LABEL global function did not agree. Also
breaks the convention I'd like to set that capitalized functions must
agree with existing Go assembly syntax.
To help avoid a conflict with `avo.Label`, attributes were moved to
their own package.
Fixes#35
Previously GLOBL/DATA attributes are set to RODATA. This diff removes
that default and allows them to be set through the DataAttributes
context method.
Updates #2
Adds methods for referencing sub- or super-registers. For example, for
general purpose registers you can now reference As8(), As16(), ... and
for vector AsX(), AsY(), AsZ().
Closes#1