]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/x86: fix ANDPS encoding
authorDamien Lespiau <damien.lespiau@intel.com>
Fri, 28 Apr 2017 14:20:38 +0000 (15:20 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 1 May 2017 18:32:52 +0000 (18:32 +0000)
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 <khr@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/asm/internal/asm/testdata/amd64enc.s
src/cmd/internal/obj/x86/asm6.go

index 22c948e165d644c920eaf4ee07cc2fe94f632e42..dbc4023f9f120258ccff55477d4524d1ef3f7ef0 100644 (file)
@@ -412,14 +412,14 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
        ANDPD (R11), X11                        // 66450f541b
        ANDPD X2, X11                           // 66440f54da
        ANDPD X11, X11                          // 66450f54db
-       //TODO: ANDPS (BX), X2                  // 0f5413
-       //TODO: ANDPS (R11), X2                 // 410f5413
-       //TODO: ANDPS X2, X2                    // 0f54d2
-       //TODO: ANDPS X11, X2                   // 410f54d3
-       //TODO: ANDPS (BX), X11                 // 440f541b
-       //TODO: ANDPS (R11), X11                // 450f541b
-       //TODO: ANDPS X2, X11                   // 440f54da
-       //TODO: ANDPS X11, X11                  // 450f54db
+       ANDPS (BX), X2                          // 0f5413
+       ANDPS (R11), X2                         // 410f5413
+       ANDPS X2, X2                            // 0f54d2
+       ANDPS X11, X2                           // 410f54d3
+       ANDPS (BX), X11                         // 440f541b
+       ANDPS (R11), X11                        // 450f541b
+       ANDPS X2, X11                           // 440f54da
+       ANDPS X11, X11                          // 450f54db
        BEXTRL R9, (BX), DX                     // c4e230f713
        BEXTRL R9, (R11), DX                    // c4c230f713
        BEXTRL R9, DX, DX                       // c4e230f7d2
index e2270747ce1bb2b96c9977807a1a25905dc29598..bcf9318e2e662d4ed431f1d7878b58b58acc5acc 100644 (file)
@@ -963,7 +963,7 @@ var optab =
        {AANDNPD, yxm, Pq, [23]uint8{0x55}},
        {AANDNPS, yxm, Pm, [23]uint8{0x55}},
        {AANDPD, yxm, Pq, [23]uint8{0x54}},
-       {AANDPS, yxm, Pq, [23]uint8{0x54}},
+       {AANDPS, yxm, Pm, [23]uint8{0x54}},
        {AANDQ, yaddl, Pw, [23]uint8{0x83, 04, 0x25, 0x81, 04, 0x21, 0x23}},
        {AANDW, yaddl, Pe, [23]uint8{0x83, 04, 0x25, 0x81, 04, 0x21, 0x23}},
        {AARPL, yrl_ml, P32, [23]uint8{0x63}},