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

cmd/asm: K0 register not available to AVX-512 instructions? #29893

Closed
rsc opened this issue Jan 23, 2019 · 2 comments
Closed

cmd/asm: K0 register not available to AVX-512 instructions? #29893

rsc opened this issue Jan 23, 2019 · 2 comments
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Jan 23, 2019

I expected that an instruction like:

VPSHUFB	Z1, Z8, K0, Z8

would assemble. But it does not. (asm: invalid instruction).
If I change the mask to K1 then it does.

Am I confused about what mask registers are available
in the AVX-512 instruction set, or is the assembler confused?

/cc @quasilyte @TocarIP

@rsc rsc added this to the Go1.13 milestone Jan 23, 2019
@TocarIP
Copy link
Contributor

TocarIP commented Jan 23, 2019

k0 is a zero register, and avx512 doesn't allow k0 as a write mask (it has the same encoding as no-mask version).
Gnu as also rejects it:

build$ cat a.s
vpshufb   %zmm0,%zmm0,%zmm0{%k1}  #works
vpshufb   %zmm0,%zmm0,%zmm0{%k0}
build$ as a.s
a.s: Assembler messages:
a.s:2: Error: `%k0' can't be used for write mask

@FiloSottile
Copy link
Contributor

Closing as working as intended. Reopen and retitle if you want the assembler to print a more informative error.

@golang golang locked and limited conversation to collaborators Jan 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants