Commit Graph

297 Commits

Author SHA1 Message Date
Michael McLoughlin
6bad393fdc ci: bump to go 1.16 (#166)
Required updates to the thirdparty test suite due to modules changes in go toolchain.
2021-04-19 14:34:35 -07:00
Klaus Post
f798093d69 tests/thirdparty: update/add packages, fix modules (#186)
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.
2021-04-19 12:38:24 -07:00
Michael McLoughlin
c32f24fb1e pass: de-prioritize base pointer in register allocation (#184)
Updates #156
2021-04-18 19:22:09 -07:00
Michael McLoughlin
f295bde84c pass: ensure frame pointer register is saved (#174)
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
2021-04-18 18:37:56 -07:00
Jeremy Larkin
4592e16ebb operand: allow signed immediates to be matched by IsIMMX (#182)
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
2021-04-16 15:12:12 -07:00
Michael McLoughlin
3622eb09b9 pass: support priority in register allocator (#180)
Updates #156
2021-04-11 23:32:52 -07:00
Michael McLoughlin
060ad41ef0 ci: codecov informational mode (#179) 2021-04-11 22:54:05 -07:00
Michael McLoughlin
e9f28cafb8 attr: flag test methods (#177)
Adds a method to the Attribute type to test for each flag in the textflag.h header.
2021-04-11 13:25:13 -07:00
Michael McLoughlin
c5faaae583 attr: generate code from textflag.h (#176) 2021-04-10 23:45:40 -07:00
Michael McLoughlin
e5c9b4e5a6 script: use tools.mod for bootstrap (#175)
Replaces gobin with the preferred tools.mod solution for pinning tool dependencies.

Updates #166
2021-04-10 21:10:42 -07:00
Michael McLoughlin
3f5da8f6e4 all: upgrade direct dependencies (#172) 2021-04-06 23:24:52 -07:00
Michael McLoughlin
8f3c4ea0bf examples: cpu feature checks (#171)
Add necessary feature checks to the dot and geohash examples to prevent illegal instruction errors.

Fixes #170 #153
2021-04-06 22:24:58 -07:00
Josh Bleecher Snyder
599bdd1269 internal/cmd/avogen: write output file even when gofmt fails (#165)
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.
2021-01-03 19:29:11 -08:00
Michael McLoughlin
039ef47f4f doc: mention #assembly slack channel (#161) 2020-12-16 15:13:06 -08:00
Michael McLoughlin
45c8ae10fd ci: switch to env files (#160)
Switch to env files following the deprecation of set-env and add-path commands.

https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
2020-11-29 17:27:00 -08:00
Michael McLoughlin
5d2f697d26 all: upgrade dependencies (#159)
Upgrade dependencies with:

go get -u ./...
go mod tidy
2020-11-04 23:48:41 -08:00
Michael McLoughlin
fea6accff2 ci: upgrade to go 1.15 (#158) 2020-11-04 23:04:25 -08:00
Luke Champine
443f81d771 build: expose Instruction method on global context (#155) 2020-08-03 14:51:36 -07:00
Michael McLoughlin
4439b6b2c0 build: -pkg flag to specify package name (#150)
Allows override in the case where package name is incorrectly deduced from directory name.

Fixes #68
Fixes #147
2020-05-23 12:07:32 -07:00
Michael McLoughlin
fa88270b07 script: pin tool dependencies
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.
2020-05-03 22:38:06 -07:00
Michael McLoughlin
f891fe8d97 ci: test on go 1.14 (#138)
Add go 1.14 to CI testing. Upgrade golang.org/x/tools dependency to resolve golang/go#37617.
2020-04-25 01:27:57 -07:00
Michael McLoughlin
6df701fe67 tests/thirdparty: lukechampine/us/merkle/blake2b (#140)
Fixes #139
2020-03-02 20:22:53 -08:00
Michael McLoughlin
1859174b62 tests/thirdparty: blake3 (#137)
Adds blake3 to suite of third party tests.

Closes #136
2020-02-26 18:15:39 -08:00
Michael McLoughlin
fb157e1de8 doc: point at go.dev 2020-02-01 15:50:37 -05:00
Michael McLoughlin
d51141dc8f tests/thirdparty: add klauspost/compress/s2 (#131)
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
2020-01-28 23:27:12 -05:00
Michael McLoughlin
e089a6c93c tests/fixedbugs: regression test for issue 100 (#129)
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
2020-01-27 21:05:33 -08:00
Michael McLoughlin
5a144d9b53 doc: link to gophercon talk 2020-01-27 13:35:45 -08:00
Michael McLoughlin
f40d602170 reg,pass: refactor allocation of aliased registers (#121)
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
2020-01-22 22:50:40 -08:00
Michael McLoughlin
126469f13d pass: VerifyMemOperands (#127)
Introduces a pass to verify memory operands. This is added to a new
Verify pass, that in future could do much more.

Updates #125
2020-01-22 19:59:02 -08:00
Michael McLoughlin
ff7a160610 pass: allow consecutive labels (#123)
Fixes #122
2020-01-19 22:06:52 -08:00
Michael McLoughlin
cde7e9483b pass,printer: display required ISA features (#120)
Fixes #119
2020-01-19 16:45:09 -08:00
Klaus Post
b0ac74488c pass: "instruction should follow a label" info (#115)
Add the label in question to the error message.
2020-01-13 10:52:16 -08:00
Klaus Post
3c861c7c0b internal/prnt: trim trailing comment whitespace (#114)
Before printing a comment, remove trailing whitespace. Generation would output `// ` for empty comments. So we trim the whitespace off the end before printing.
2020-01-13 10:09:25 -08:00
Michael McLoughlin
205fc6a3d7 tests: integration tests for third-party packages (#112)
Closes #103
2020-01-06 22:56:38 -05:00
Michael McLoughlin
49adad921f ci: change schedule (#110)
Schedule CI early morning every Saturday. Trigger only on pushes to master.

Updates #106
2020-01-03 22:49:38 -08:00
Michael McLoughlin
9f9d2ca8cf Revert "ci: go version 1.x"
This reverts commit 5c45f0f96c.
2020-01-03 22:40:05 -08:00
Michael McLoughlin
5c45f0f96c ci: go version 1.x 2020-01-03 22:37:11 -08:00
Michael McLoughlin
07e91579e2 meta: remove build link
Removing link since the "Actions" tab returns 404 when not logged in.

Updates #106
2020-01-03 22:29:23 -08:00
Michael McLoughlin
3d189f08a9 ci: separate lint job (#109)
Updates #106
2020-01-03 22:06:24 -08:00
Michael McLoughlin
03ee750ed2 ci: disable travis (#108)
Deletes travis config and updates build badge.

Updates #106
2020-01-03 21:42:19 -08:00
Michael McLoughlin
3426f8bd2d ci: github actions (#107)
Github actions workflow for CI.

Updates #106
2020-01-03 17:32:09 -08:00
Michael McLoughlin
cfc6ecac41 tests/alloc/gp8: allocator test using all 8-bit registers (#102)
Updates #43
2019-12-20 15:31:35 -08:00
Koichi Shiraishi
15d6a9a17e attr,build: add TOPFRAME attribute (#98)
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.
2019-09-26 21:11:50 -07:00
Michael McLoughlin
c8004ba627 ir,build: pragma support (#97)
Adds support for arbitrary compiler directives.

Fixes #15
2019-09-16 11:01:48 -07:00
Michael McLoughlin
0bcbe82731 ci: fix build for go 1.13 (#96)
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
2019-09-15 14:43:44 -07:00
Michael McLoughlin
bb615f61ce all: formatting (#93)
Enforce stricter formatting and import grouping with gofumports.
2019-07-30 18:40:47 -07:00
Michael McLoughlin
d43efabdbe inst,ir: cancelling inputs (#92)
Adds support for a `CancellingInputs` instruction flag, to indicate cases like `XORQ R10, R10` where the instruction actually does not depend on the value of `R10` at all.

Closes #89
2019-07-28 17:58:49 -07:00
Michael McLoughlin
8f97788836 build: use packages.NeedImports (#91)
Use packages.NeedImports when loading packages. This fixes avo to account for a bugfix in golang/tools@aac0b97.

Closes #90
2019-07-20 20:34:38 -07:00
Michael McLoughlin
cad456ebde lint: bump golangci-lint to v1.17.1 (#88) 2019-06-13 11:44:24 -07:00
Michael McLoughlin
3355ecfbfd lint: stop using deprecated go/packages api (#87)
The packages.Load* constants have been deprecated in favor of packages.Need*.
2019-06-13 11:20:49 -07:00