Commit 1178e51a authored by Daniel Martí's avatar Daniel Martí

cmd/asm: VPERMQ's imm8 arg is an uint8

The imm8 argument consists of 4 2-bit indices, so it can take values up
to $255. However, the assembler was treating it as Yi8, which reads
"fits in int8". Add a Yu8 variant, to also keep backwards compatibility
with negative values possible with Yi8.

Fixes #24378.

Change-Id: I24ddb19c219b54d039a6c1bcdb903717d1c7c3b8
Reviewed-on: https://go-review.googlesource.com/100475
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarKeith Randall <khr@golang.org>
parent 0dfc740e
......@@ -8742,6 +8742,8 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
VPERMQ $7, (R11), Y11 // c443fd001b07
VPERMQ $7, Y2, Y11 // c463fd00da07
VPERMQ $7, Y11, Y11 // c443fd00db07
VPERMQ $-40, Y8, Y8 // c4407800c0d8
VPERMQ $216, Y8, Y8 // c443fd00c0d8
VPEXTRB $7, X2, (BX) // c4e379141307
VPEXTRB $7, X11, (BX) // c46379141b07
VPEXTRB $7, X2, (R11) // c4c379141307
......
......@@ -952,6 +952,9 @@ var yvex_xi3 = []ytab{
}
var yvex_vpermpd = []ytab{
{Zvex_i_rm_r, 2, argList{Yu8, Yym, Yyr}},
// Allow int8 for backwards compatibility with negative values
// like $-1.
{Zvex_i_rm_r, 2, argList{Yi8, Yym, Yyr}},
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment