Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: AVX-512 #217

Merged
merged 116 commits into from
Nov 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
fa029e9
Added support for AVX512 opmask registers (K0-K7)
vsivsi Dec 18, 2020
157a44d
add flags to Form type
mmcloughlin Dec 28, 2020
4543a24
process avx-512 features in opcodes
mmcloughlin Dec 29, 2020
af400e7
make asmtest error on unsupported operands
mmcloughlin Dec 29, 2020
563bea8
more operand types in asmtest
mmcloughlin Dec 29, 2020
6101b09
wip: loading avx512 instructions
mmcloughlin Dec 29, 2020
a7d5f20
asmtest passes
mmcloughlin Dec 29, 2020
b4e3203
internal/inst: avx-512 sanity checks
mmcloughlin Dec 29, 2020
a33e090
internal/inst,internal/gen: supported suffixes
mmcloughlin Dec 29, 2020
4d78ded
missing cite reference
mmcloughlin Dec 29, 2020
518fe2d
internal/gen: extend ctorstest
mmcloughlin Dec 30, 2020
50e6422
full code generation working again
mmcloughlin Dec 30, 2020
38221f2
internal/api: new package
mmcloughlin Dec 31, 2020
c5be023
internal/api: introduce Function type
mmcloughlin Dec 31, 2020
d021a3a
internal/gen: refactor to use api types
mmcloughlin Dec 31, 2020
542dfe7
regenerate
mmcloughlin Dec 31, 2020
a10cbef
internal/api: one function per suffix
mmcloughlin Dec 31, 2020
c5b93d4
ir: add suffixes to instruction type
mmcloughlin Dec 31, 2020
043bcb2
internal/gen: update ctorstest
mmcloughlin Dec 31, 2020
d3fa13a
reg,build: rename opmask types
mmcloughlin Dec 31, 2020
25cab1a
test: zeroing test work-in-progress
mmcloughlin Jan 1, 2021
c0de94e
tests: zeroing test
mmcloughlin Jan 1, 2021
fcd09c5
x86: test cases for zeroing/merging masking
mmcloughlin Jan 2, 2021
ad3ac5d
internal/inst: handle merging/zeroing modes
mmcloughlin Jan 2, 2021
1721b3b
internal/gen: include suffixes in documentation
mmcloughlin Jan 2, 2021
a61e1e4
printer: opcode suffix test
mmcloughlin Jan 2, 2021
0475f74
internal/api: test for duplicate form signatures
mmcloughlin Jan 2, 2021
c408fc5
x86: test for correct isa selection
mmcloughlin Jan 2, 2021
811f2f8
internal/api: improve test output
mmcloughlin Jan 2, 2021
53d74b2
all: enable AVX512CD
mmcloughlin Jan 2, 2021
9d5f72f
all: enable AVX512VL
mmcloughlin Jan 2, 2021
2b6c4e5
all: resolve VEX/EVEX forms
mmcloughlin Jan 3, 2021
8c62943
all: enable AVX512BW
mmcloughlin Jan 3, 2021
a2d3504
all: enable AVX512DQ
mmcloughlin Jan 3, 2021
db693e3
all: enable AVX512ER
mmcloughlin Jan 3, 2021
21a03e6
all: enable AVX512IFMA
mmcloughlin Jan 3, 2021
43d6327
internal/load: exclude AVX512PF
mmcloughlin Jan 3, 2021
1d8276b
all: enable AVX512VBMI
mmcloughlin Jan 3, 2021
20e9754
all: enable AVX512VPOPCNTDQ
mmcloughlin Jan 3, 2021
5e5094f
all: lint
mmcloughlin Jan 3, 2021
7aee7db
internal/gen: reduce duplication in ctors file
mmcloughlin Jan 3, 2021
93ca583
internal/load: refactor avx512 forms
mmcloughlin Jan 3, 2021
7d46725
internal: remove inst.M, make tests pass
mmcloughlin Jan 3, 2021
c5a7978
all: regenerate
mmcloughlin Jan 4, 2021
f96010e
operand: remove BCST type checks
mmcloughlin Jan 4, 2021
29163f5
internal/gen: remove bcst types
mmcloughlin Jan 4, 2021
88ef1dc
internal/gen: fix whitespace lint
mmcloughlin Jan 4, 2021
3e63f4f
internal/gen: variables for instruction arguments
mmcloughlin Jan 11, 2021
3873ca5
internal/gen: ctors benchmark
mmcloughlin Jan 11, 2021
ea5aaaa
internal/gen: extend constructor test
mmcloughlin Jan 16, 2021
d14471d
internal/gen,x86: opcodes enum
mmcloughlin Jan 17, 2021
8a0ef9d
internal/gen,x86: operand types enum
mmcloughlin Jan 17, 2021
82a5cf5
internal/gen,x86: implicit register enum
mmcloughlin Jan 18, 2021
bca113f
internal/gen,x86: optab types, arity, suffixes
mmcloughlin Jan 18, 2021
cad737f
x86: operand type matcher
mmcloughlin Jan 18, 2021
c6d8ec8
x86,internal/gen: generate forms list
mmcloughlin Jan 19, 2021
ed37d85
x86: isas in optab
mmcloughlin Jan 20, 2021
cd8286e
internal/inst: suffix classes
mmcloughlin Jan 20, 2021
91c5174
x86,internal/gen: Suffixes type
mmcloughlin Jan 24, 2021
278b35f
x86,internal/gen: SuffixesClass enum
mmcloughlin Jan 25, 2021
b34f866
x86,internal/gen: suffixes class in forms list
mmcloughlin Jan 25, 2021
fd3faa4
x86,internal/gen: stress tag for constructors test
mmcloughlin Jan 25, 2021
2efba8d
x86,internal/inst: nil suffixes class
mmcloughlin Jan 25, 2021
0573a87
wip
mmcloughlin Feb 22, 2021
e42e167
regenerate
mmcloughlin Nov 3, 2021
c7e6513
x86: populate base instruction properties
mmcloughlin Nov 6, 2021
d682a8f
x86,internal/gen: finish instruction builder
mmcloughlin Nov 6, 2021
dd8a859
internal/gen: extract enum type definitions
mmcloughlin Nov 6, 2021
db6a3b1
x86: tweak to instruction builder
mmcloughlin Nov 6, 2021
1daeab4
internal/gen: replace hardcoded type name
mmcloughlin Nov 6, 2021
ee6c183
internal/gen,x86: opcode to forms mapping
mmcloughlin Nov 6, 2021
3ca1552
internal/gen,x86: constructors use optab builder
mmcloughlin Nov 6, 2021
99dad6b
internal/gen,x86: passing constructors test
mmcloughlin Nov 6, 2021
d0eb7cd
tests/alloc/zeroing: missing go:build tag
mmcloughlin Nov 7, 2021
8281c6f
internal/inst,x86: limit massive generated tests to test-only mode
mmcloughlin Nov 8, 2021
c710f61
x86: move go:generate line to ctors_test
mmcloughlin Nov 8, 2021
27979f7
ci: enable test-only build
mmcloughlin Nov 8, 2021
255ea00
internal/gen: ensure blank line after build tag
mmcloughlin Nov 8, 2021
75e5901
internal/gen: limit test tag to generate step
mmcloughlin Nov 8, 2021
90844a7
ci: forgot ./... in generate step
mmcloughlin Nov 8, 2021
aa09f41
ci: switch to full generate
mmcloughlin Nov 8, 2021
8df5a5a
x86,internal/inst,ci: run tests during generation
mmcloughlin Nov 8, 2021
24e01ae
ci: back to full generate, remove AssertInstruction
mmcloughlin Nov 8, 2021
83938e7
ci: try just generating the tests
mmcloughlin Nov 8, 2021
9000590
ci: revert experimentation
mmcloughlin Nov 8, 2021
2f1778f
internal/gen,x86: separate benchmark and stress test
mmcloughlin Nov 10, 2021
1d58d89
x86: exclude ctors test from integration tests
mmcloughlin Nov 10, 2021
9263eb4
script: fix -tag should have been -tags
mmcloughlin Nov 10, 2021
d3c2064
ci: stress test
mmcloughlin Nov 10, 2021
a1633a7
ci: name the stress workflow correctly
mmcloughlin Nov 10, 2021
3d8ed0d
ci: set stress tag, run generate
mmcloughlin Nov 10, 2021
f59a808
ci: fix env var in stress workflow
mmcloughlin Nov 10, 2021
d89c060
internal/gen: reduce source code size for build instructions
mmcloughlin Nov 10, 2021
c03ab57
examples/md5x16: init
mmcloughlin Nov 11, 2021
42a11c2
tests/thirdparty: skip segmentio-asm test
mmcloughlin Nov 11, 2021
a10bf13
internal/gen,internal/api: doc strings
mmcloughlin Nov 11, 2021
a57d970
internal/gen,x86: make optab types private
mmcloughlin Nov 11, 2021
e0eed92
internal/gen,build: operand type checks in mov deduction
mmcloughlin Nov 11, 2021
23e5602
build,internal/gen: add KMOV and VMOV instructions to mov deduction
mmcloughlin Nov 11, 2021
9c47f05
examples/md5x16: first attempt at avx-512 md5
mmcloughlin Nov 12, 2021
3861320
all: bump to go1.13 for binary literals
mmcloughlin Nov 12, 2021
b596b39
examples/md5x16: basic test passing
mmcloughlin Nov 12, 2021
11c961a
examples/md5x16: require AVX512F
mmcloughlin Nov 12, 2021
f38713c
examples/md5x16: package docstring
mmcloughlin Nov 12, 2021
e437fc8
examples/md5: fix base pointer issue, test lengths
mmcloughlin Nov 12, 2021
1f10fa1
examples/md5x16: fix StringHeader -> SliceHeader
mmcloughlin Nov 12, 2021
ae0467c
examples/md5x16: tests with random data
mmcloughlin Nov 12, 2021
476b6f8
examples/md5x16: test active lanes
mmcloughlin Nov 12, 2021
e59b78c
examples/md5x16: missing isa check
mmcloughlin Nov 12, 2021
e0923fc
examples/md5x16: documentation
mmcloughlin Nov 12, 2021
bec2e07
examples: add md5x16 to readme
mmcloughlin Nov 12, 2021
893b2aa
build,internal/gen: generate tests for instruction methods
mmcloughlin Nov 13, 2021
c98a7f9
operand: checks tests
mmcloughlin Nov 13, 2021
ae4b968
ci: stress workflow on schedule only
mmcloughlin Nov 13, 2021
326d0f0
tweaks
mmcloughlin Nov 13, 2021
b27b29e
lint timeout
mmcloughlin Nov 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ jobs:
run: go test ./...
segmentio-asm:
runs-on: ubuntu-latest
if: false # skip: https://github.com/mmcloughlin/avo/issues/229
steps:
- name: Install Go
uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8 # v2.1.3
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/stress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: stress

permissions:
contents: read

on:
schedule:
- cron: '33 3 * * 6'

jobs:
test:
runs-on: ubuntu-latest
env:
GOFLAGS: -tags=stress
steps:
- name: Install Go
uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8 # v2.1.3
with:
go-version: 1.17.x
- name: Configure Go Environment
run: |
echo GOPATH=${{ runner.workspace }} >> $GITHUB_ENV
echo ${{ runner.workspace }}/bin >> $GITHUB_PATH
- name: Go Environment
run: go env
- name: Checkout code
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
with:
persist-credentials: false
- name: Bootstrap
run: ./script/bootstrap

- name: Generate
run: ./script/generate
- name: Status
run: git status

- name: Build
run: go build ./...
- name: Test
run: go test -bench . ./...
- name: Coverage
run: ./script/coverage

- name: Upload Stress Unit Test Coverage
uses: codecov/codecov-action@51d810878be5422784e86451c0e7c14e5860ec47 # v2.0.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: unittests.coverprofile
flags: stress
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
run:
timeout: 5m

linters:
enable-all: true
disable:
Expand Down Expand Up @@ -27,3 +30,5 @@ issues:
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked
# gocritic: https://github.com/go-critic/go-critic/issues/762
- ' with `(len|cap|real|imag)`'
# We want to allow all caps in certain cases.
- "ALL_CAPS in Go names"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ Implementations of full algorithms:
* **[sha1](examples/sha1):** [SHA-1](https://en.wikipedia.org/wiki/SHA-1) cryptographic hash.
* **[fnv1a](examples/fnv1a):** [FNV-1a](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function#FNV-1a_hash) hash function.
* **[dot](examples/dot):** Vector dot product.
* **[md5x16](examples/md5x16):** AVX-512 accelerated [MD5](https://en.wikipedia.org/wiki/MD5).
* **[geohash](examples/geohash):** Integer [geohash](https://en.wikipedia.org/wiki/Geohash) encoding.
* **[stadtx](examples/stadtx):** [`StadtX` hash](https://github.com/demerphq/BeagleHash) port from [dgryski/go-stadtx](https://github.com/dgryski/go-stadtx).

Expand Down
5 changes: 3 additions & 2 deletions build/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import (
"github.com/mmcloughlin/avo/reg"
)

//go:generate avogen -output zinstructions.go build
//go:generate avogen -output zinstructions_test.go buildtest

// Context maintains state for incrementally building an avo File.
type Context struct {
pkg *packages.Package
Expand Down Expand Up @@ -175,8 +178,6 @@ func (c *Context) activefunc() *ir.Function {
return c.function
}

//go:generate avogen -output zinstructions.go build

// StaticGlobal adds a new static data section to the file and returns a pointer to it.
func (c *Context) StaticGlobal(name string) operand.Mem {
c.global = ir.NewStaticGlobal(name)
Expand Down
3 changes: 3 additions & 0 deletions build/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ func YMM() reg.VecVirtual { return ctx.YMM() }
// ZMM allocates and returns a 512-bit vector register.
func ZMM() reg.VecVirtual { return ctx.ZMM() }

// K allocates and returns an opmask register.
func K() reg.OpmaskVirtual { return ctx.K() }

// Param returns a the named argument of the active function.
func Param(name string) gotypes.Component { return ctx.Param(name) }

Expand Down
Loading