Skip to content

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

@Yawning

Description

@Yawning

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions