-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/asm: wrong AVX512 instructions are miscompiled #57952
Comments
So should we produce an error in this case then? i.e., if there is a |
Yes, it's an error. An instruction without
But in the case of zeroing variant |
Change https://go.dev/cl/463229 mentions this issue: |
Thank you for such a quick fix! Great. |
Zeroing requires a non-K0 mask register be specified. (gcc enforces this when assembling.) The non-K0 restriction is already handled by the Yknot0 restriction. But if the mask register is missing altogether, we misassemble the instruction. Fixes golang#57952 Not sure if this is really worth mentioning in the release notes, but just in case I'll mark it. RELNOTE=yes Change-Id: I8f05d3155503f1f16d1b5ab9d67686fe5b64dfea Reviewed-on: https://go-review.googlesource.com/c/go/+/463229 Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Илья Токарь <tocarip@gmail.com> Reviewed-by: Iskander Sharipov <quasilyte@gmail.com>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
I compile this simple assembly procedure:
Because I used
.Z
suffix, it means the instruction needs a mask register. That is missing in this case -- it should be something likeVMOVDQA32.Z Z0, K1, Z1
.What did you expect to see?
Assembler message pointing out a syntax error.
What did you see instead?
The procedure is compiled into the following instructions (the output from GNU objdump):
When the program is run, we get a CPU exception:
The text was updated successfully, but these errors were encountered: