As part of fixing failing third-party tests, this PR significantly
rearchitects their specification and execution.
Third-party tests are now specified in a much more flexible format allowing
more customization on a per-package level. In addition, third-party tests are
now used to auto-generate a Github Actions workflow to perform the tests in
parallel. This not only gives faster feedback on PRs, but will also allow us
to more quickly narrow down on which packages are failing. An additional
workflow also confirms that local execution of third-party tests is consistent
with the Github Actions version. This workflow only runs when tests/thirdparty
itself is changed.
Update github.com/klauspost/compress version.
Add github.com/klauspost/reedsolomon and github.com/minio/md5-simd.
Add `-mod=mod` to commands due to golang/go#44129.
Currently `avo` uses `BP` as a standard general-purpose register. However, `BP` is used for the frame pointer and should be callee-save. Under some circumstances, the Go assembler will do this automatically, but not always. At the moment `avo` can produce code that clobbers the `BP` register. Since Go 1.16 this code will also fail a new `go vet` check.
This PR provides a (currently sub-optimal) fix for the issue. It introduces an `EnsureBasePointerCalleeSaved` pass which will check if the base pointer is written to by a function, and if so will artificially ensure that the function has a non-zero frame size. This will trigger the Go assembler to automatically save and restore the BP register.
In addition, we update the `asmdecl` tool to `asmvet`, which includes the `framepointer` vet check.
Updates #156
Many of the instruction functions correctly match the size of immediate values, but they only accept unsigned immediates. This PR fixes the operand check functions for intermediate types to also accept the signed variants.
Fixes#181
This makes it easier to debug avogen: when you emit invalid syntax, you can inspect the generated file to determine what went wrong, instead of having only gofmt's error to work with.
An update to gofumpt caused the lint job to start failing:
https://github.com/mmcloughlin/avo/runs/638734114?check_suite_focus=true#step:7:688
The underlying issue is that the "join parameters" rule added to gofumpt
disagrees with output from go/types. It's possible to fix, but I don't
think it's important enough to deal with right now. Instead I'll pin the
gofumpt dependency to a version before that rule was added.
Pinning tool dependencies is a good idea anyway.
Adds @klauspost's S2 implementation to the third party test suite.
The full klauspost/compress tests are slow but we only care about the S2 sub-package. Therefore this PR also adds the option to only run a subset of the package tests, controlled by a "test" parameter in the JSON configuration.
Closes#130
Adds a regression test based on klauspost/compress#186. This necessitated some related changes:
* Mark "RET" as a terminal instruction
* printer refactor to maintain compatibility with asmfmt
* Tweaks to other regression tests to ensure they are run correctly in CI
Updates #100#65#8
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
Before printing a comment, remove trailing whitespace. Generation would output `// ` for empty comments. So we trim the whitespace off the end before printing.
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.
Updates modules handling so build passes in Go 1.13. Bypasses modules for tools install in bootstrap. Upgrades golangci-lint version to avoid bug with v1.17.1 under Go 1.13.
Fixes#95