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: "invalid instruction" error for VPERMQ. #24378

Closed
Yawning opened this issue Mar 13, 2018 · 2 comments
Closed

cmd/asm: "invalid instruction" error for VPERMQ. #24378

Yawning opened this issue Mar 13, 2018 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@Yawning
Copy link

Yawning commented Mar 13, 2018

What version of Go are you using (go version)?

go version go1.10 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

Ported assembly from an existing project (gas) to Go's dialect, which uses VPERMQ.

VPERMQ $0xd8,Y4,Y4
VPERMQ $0xd8,Y5,Y5
VPERMQ $0xd8,Y6,Y6
VPERMQ $0xd8,Y7,Y7

What did you expect to see?

Working output.

What did you see instead?

asm: invalid instruction: 00152 (/home/yawning/Documents/Development/go-workspace/src/git.schwanenlied.me/yawning/kyber.git/hwaccel_amd64.s:1183)	VPERMQ$216, Y4, Y4
asm: invalid instruction: 00152 (/home/yawning/Documents/Development/go-workspace/src/git.schwanenlied.me/yawning/kyber.git/hwaccel_amd64.s:1184)	VPERMQ$216, Y5, Y5
asm: invalid instruction: 00152 (/home/yawning/Documents/Development/go-workspace/src/git.schwanenlied.me/yawning/kyber.git/hwaccel_amd64.s:1185)	VPERMQ$216, Y6, Y6
asm: invalid instruction: 00152 (/home/yawning/Documents/Development/go-workspace/src/git.schwanenlied.me/yawning/kyber.git/hwaccel_amd64.s:1186)	VPERMQ$216, Y7, Y7

@mvdan tells me that the assembler is choking on the imm8 because it is > 127 due to the use of a int8 internally in the assembler, which is incorrect as the argument is 4 2-bit indices.

@mvdan
Copy link
Member

mvdan commented Mar 13, 2018

We think we have a fix for this; mailing it now.

@mvdan mvdan added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 13, 2018
@mvdan mvdan added this to the Go1.11 milestone Mar 13, 2018
@gopherbot
Copy link

Change https://golang.org/cl/100475 mentions this issue: cmd/asm: VPERMQ's imm8 arg is an uint8

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants