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

rsc opened this issue Jan 23, 2019 · 2 comments


Copy link

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


This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jan 23, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.