Commit Graph

338 Commits

Author SHA1 Message Date
Michael McLoughlin
3d25f4574c doc: rounded avatars (#256)
Use weserv service to format avatars with circle masks. Make size configurable.

Tweak readme and adopters pages.

Updates #101
2022-04-18 00:49:52 -07:00
Michael McLoughlin
1cbd35f134 doc: Adopters page (#254)
Adds page with full list of `avo` adopters. Linked to from README.

Updates #101
2022-04-17 23:57:05 -07:00
Michael McLoughlin
57ea8119b7 doc: Adopters list in README (#252)
Adds a list of most popular projects using avo, based on Github Stars.

Auto-generated from the third-party packages list using docgen.

Updates #101
2022-04-17 22:38:54 -07:00
Michael McLoughlin
956d98e549 .github: configure dependabot (#253) 2022-04-17 21:39:58 -07:00
Michael McLoughlin
9fee3b0ead doc: generate README with docgen tool (#251)
Introduces a docgen tool for templated documentation generation, and uses it
to generate the README.

At the moment this change makes minimal difference to generating it with
embedmd. The difference is that docgen opens up the possibility to generate
documentation with more elaborate templating. The specific use case currently
in mind is including an adopters list that's kept in sync with the third-party
packages file.

Updates #101
2022-04-17 19:41:29 -07:00
Michael McLoughlin
3066c12247 go.mod: require go 1.16 (#250) 2022-04-17 19:18:59 -07:00
Michael McLoughlin
77ce540158 tests/thirdparty: add mmcloughlin/md4 (#249) 2022-04-17 14:08:30 -07:00
Michael McLoughlin
a25e011a06 tests/thirdparty: add oasisprotocol/deoxysii (#247)
Fixes #246
2022-04-16 21:25:22 -07:00
Michael McLoughlin
ed62fe0a03 tests/thirdparty: update packages metadata 2022-04-10 23:05:26 -07:00
Michael McLoughlin
a1840163c8 all: upgrade direct dependencies (#244) 2022-04-10 22:45:00 -07:00
Michael McLoughlin
b0c64b2e52 ci: bump to go 1.18 (#239) 2022-04-10 21:03:05 -07:00
Michael McLoughlin
72b8db9c80 all: upgrade golangci-lint and formatters (#240) 2022-03-27 15:31:26 -07:00
Michael McLoughlin
553930530f doc: update link to Filippo's live coding session
Fixes #236
2022-02-21 11:21:01 -08:00
Michael McLoughlin
af3e578ab4 tests/thirdparty: re-enable segmentio/asm (#232)
Fixes #229
2021-11-13 13:36:54 -08:00
Michael McLoughlin
68350e4e08 tests/thirdparty: add lukechampine/blake3 (#231)
Fixes #164
2021-11-12 22:22:50 -08:00
Michael McLoughlin
b76e849b5c all: AVX-512 (#217)
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>
2021-11-12 19:02:39 -08:00
Michael McLoughlin
2867bd7e01 tests/thirdparty: add skip option (#228)
Add the ability to skip third-party tests by specifying a known issue.
2021-11-10 18:44:28 -08:00
Michael McLoughlin
6c0ed1c4e8 tests/thirdparty: add filippo.io/edwards25519 (#227)
Updates #226
2021-11-07 18:29:47 -08:00
Michael McLoughlin
1de006d741 tests/thirdparty: use shallow clone (#224)
When trying to add a test case from the standard library, cloning golang/go
was taking forever. This PR switches to a shallow clone.
2021-11-07 16:30:50 -08:00
Michael McLoughlin
f355d27b13 tests/thirdparty: package metadata (#223)
Fetches third-party package metadata from Github.
2021-11-07 16:13:33 -08:00
Michael McLoughlin
afe2d539b8 tests/thirdparty: golang.org/x/crypto/curve25519 (#222) 2021-11-07 01:39:03 -07:00
Michael McLoughlin
14c87c7da2 tests/thirdparty: add oasisprotocol/curve25519-voi (#220)
Fixes #202
2021-11-06 22:42:31 -07:00
Michael McLoughlin
2ca6e5e9f6 tests/thirdparty: add ericlagergren/lwcrypto (#219)
Fixes #188
2021-11-06 22:30:43 -07:00
Michael McLoughlin
6acd6a048d tests: test functions with random signatures (#216)
Adds a test for function signature memory layout by generating functions with
random signatures. This confirms that the size and offsets computed by
`gotypes` agree with `asmdecl`.

Updates #191 #195
2021-10-30 18:22:24 -07:00
Michael McLoughlin
bcbebd5674 build: global Function() and SignatureExpr() (#215)
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)
2021-10-30 15:05:19 -07:00
Michael McLoughlin
4f7179b08e gotypes,tests: test case for issue #195 (#214)
Adds test cases for the bug in #195, similar to #212.

Updates #195
Updates #191
2021-10-30 13:47:55 -07:00
Michael McLoughlin
7de02518a2 gotypes: fix argument size for signatures without return types (#212)
This fixes a bug in argument size calculation in the case where the function
has no return values. Previously it was padding the argument struct to max
alignment, but this only happens if there are return values following.

Updates #191
2021-10-30 13:32:25 -07:00
Michael McLoughlin
e70c62b254 all: upgrade direct dependencies (#213) 2021-10-30 12:07:23 -07:00
Michael McLoughlin
1d235fb56e buildtags: Format only go:build lines for go 1.18+ (#211)
```
$ ./tmp/testgo161718.sh ./buildtags/ ./printer/
+ go1.16.8 test ./buildtags/ ./printer/
ok  	github.com/mmcloughlin/avo/buildtags	0.001s
ok  	github.com/mmcloughlin/avo/printer	0.002s
+ go1.17.2 test ./buildtags/ ./printer/
ok  	github.com/mmcloughlin/avo/buildtags	0.001s
ok  	github.com/mmcloughlin/avo/printer	0.002s
+ gotip test ./buildtags/ ./printer/
ok  	github.com/mmcloughlin/avo/buildtags	0.001s
ok  	github.com/mmcloughlin/avo/printer	0.002s
```

Updates #183
2021-10-30 00:10:16 -07:00
Michael McLoughlin
c48d61faf6 script: switch to go install for tools (#210) 2021-10-29 01:26:54 -07:00
Michael McLoughlin
9c70781236 all: go 1.17 (#197)
Bump CI Go versions to 1.16 and 1.17.
Update build tags with `go:build` equivalents.
Upgrade asmfmt tool for new `go:build` support.

Updates #183
2021-10-29 01:18:34 -07:00
Michael McLoughlin
79bee1a316 printer: constraints formatting (#209)
Uses `buildtag.Format` to format constraints in the assembly and stub file
printers. This will ensure `// + build` and `//go:build` syntax are used
consistent with the current Go version.

Updates #183
2021-10-29 01:08:02 -07:00
Michael McLoughlin
55d98ccf77 buildtags: go:build support (#208)
Implements formatting of constraints according to the current Go version
supported syntax. This is achieved by delegating to go/format and extracting
out the resulting comments.

Also provides functions to query for constraint syntax support, which are
mainly intended for writing version-dependent tests.

Updates #183
2021-10-29 00:43:49 -07:00
Michael McLoughlin
a5480393fc script: pin golangci-lint install script (#205) 2021-10-27 23:18:45 -07:00
Michael McLoughlin
9a44e522f4 script: switch to install.sh from golangci-lint repo (#203)
The goreleaser script has been deprecated:

goreleaser/godownloader#207
2021-10-27 23:07:44 -07:00
Michael McLoughlin
9c815a0581 tests/thirdparty: fix phoreproject-bls (#204)
This started failing under Go 1.17.2 due to a missing go mod tidy in the
root of the respository.
2021-10-27 23:03:23 -07:00
Michael McLoughlin
5e686673b2 tests/thirdparty: add segmentio/asm (#201)
Adds third-party test for https://github.com/segmentio/asm.

Fixes #200
2021-09-15 23:49:08 -07:00
Michael McLoughlin
8ff8e3b751 tests/thirdparty: fix and run as github workflow (#198)
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.
2021-09-15 23:25:51 -07:00
Michael McLoughlin
b935256fa5 ci: upgrade codecov action (#196)
Upgrades codecov-action in order to fix codecov errors CI, for example:

https://github.com/mmcloughlin/avo/runs/3389170262?check_suite_focus=true#step:10:11

See codecov/codecov-action#322.
2021-08-21 14:56:26 -07:00
Michael McLoughlin
3a219c8d3a ci: github actions hardening (#190)
Restrict permissions of github token. Pin action versions.

Following advice in briansmith/untrusted#50.
2021-04-27 21:42:09 -07:00
Michael McLoughlin
ec9535c905 doc: link to Filippo's live stream in README (#187)
Link to Filippo's live stream of rewriting the filippo.io/edwards25519 assembly with avo.

Reformat the "learn more" links in a list.
2021-04-21 22:03:43 -07:00
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