Skip to content

Commit a2da210

Browse files
Damien Lespiaubradfitz
Damien Lespiau
authored andcommitted
cmd/internal/obj/x86: fix ANDPS encoding
ANDPS, like all others PS (Packed Single precision floats) instructions, need Ym: they don't use the 0x66 prefix. From the manual: NP 0F 54 /r ANDPS xmm1, xmm2/m128 NP meaning, quoting the manual: NP - Indicates the use of 66/F2/F3 prefixes (beyond those already part of the instructions opcode) are not allowed with the instruction. And indeed, the same instruction prefixed by 0x66 is ANDPD. Updates #14069 Change-Id: If312a6f1e77113ab8c0febe66bdb1b4171e41e0a Reviewed-on: https://go-review.googlesource.com/42090 Reviewed-by: Keith Randall <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent d1b544c commit a2da210

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/cmd/asm/internal/asm/testdata/amd64enc.s

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -412,14 +412,14 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
412412
ANDPD (R11), X11 // 66450f541b
413413
ANDPD X2, X11 // 66440f54da
414414
ANDPD X11, X11 // 66450f54db
415-
//TODO: ANDPS (BX), X2 // 0f5413
416-
//TODO: ANDPS (R11), X2 // 410f5413
417-
//TODO: ANDPS X2, X2 // 0f54d2
418-
//TODO: ANDPS X11, X2 // 410f54d3
419-
//TODO: ANDPS (BX), X11 // 440f541b
420-
//TODO: ANDPS (R11), X11 // 450f541b
421-
//TODO: ANDPS X2, X11 // 440f54da
422-
//TODO: ANDPS X11, X11 // 450f54db
415+
ANDPS (BX), X2 // 0f5413
416+
ANDPS (R11), X2 // 410f5413
417+
ANDPS X2, X2 // 0f54d2
418+
ANDPS X11, X2 // 410f54d3
419+
ANDPS (BX), X11 // 440f541b
420+
ANDPS (R11), X11 // 450f541b
421+
ANDPS X2, X11 // 440f54da
422+
ANDPS X11, X11 // 450f54db
423423
BEXTRL R9, (BX), DX // c4e230f713
424424
BEXTRL R9, (R11), DX // c4c230f713
425425
BEXTRL R9, DX, DX // c4e230f7d2

src/cmd/internal/obj/x86/asm6.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ var optab =
963963
{AANDNPD, yxm, Pq, [23]uint8{0x55}},
964964
{AANDNPS, yxm, Pm, [23]uint8{0x55}},
965965
{AANDPD, yxm, Pq, [23]uint8{0x54}},
966-
{AANDPS, yxm, Pq, [23]uint8{0x54}},
966+
{AANDPS, yxm, Pm, [23]uint8{0x54}},
967967
{AANDQ, yaddl, Pw, [23]uint8{0x83, 04, 0x25, 0x81, 04, 0x21, 0x23}},
968968
{AANDW, yaddl, Pe, [23]uint8{0x83, 04, 0x25, 0x81, 04, 0x21, 0x23}},
969969
{AARPL, yrl_ml, P32, [23]uint8{0x63}},

0 commit comments

Comments
 (0)