This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] x86: don't omit disambiguating suffixes from "fi*"
- From: "Jan Beulich" <JBeulich at suse dot com>
- To: <binutils at sourceware dot org>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Mon, 20 Nov 2017 06:07:37 -0700
- Subject: [PATCH] x86: don't omit disambiguating suffixes from "fi*"
- Authentication-results: sourceware.org; auth=none
"fi*" typically come in two (loads/stores: three) flavors, distinguished
by the suffix. Don't omit the 's' one when disassembling, and for
consistency also add the missing 's' ones for the testsuite inputs, even
if this will become a requirement only later.
---
I'd be fine with dropping the testsuite input changes here, moving them
to the patch where they will become a requirement (still WIP).
gas/
2017-11-20 Jan Beulich <jbeulich@suse.com>
* testsuite/gas/i386/opcode.s: Add 's' suffix to "fi*" not having
any suffix so far.
* testsuite/gas/i386/sse-noavx.s: Likewise.
* testsuite/gas/i386/sse3.s: Likewise.
* testsuite/gas/i386/x86-64-sse-noavx.s: Likewise.
* testsuite/gas/i386/x86-64-sse3.s: Likewise.
* testsuite/gas/i386/intel.d, testsuite/gas/i386/opcode.d,
testsuite/gas/i386/opcode-suffix.d, testsuite/gas/i386/sse3.d,
testsuite/gas/i386/sse-noavx.d, testsuite/gas/i386/x86-64-sse3.d,
testsuite/gas/i386/x86-64-sse-noavx.d,
testsuite/gas/i386/ilp32/x86-64-sse3.d,
testsuite/gas/i386/ilp32/x86-64-sse-noavx.d: Adjust expectations.
* testsuite/gas/i386/x86-64-reg-bad.{s,l}: New.
* testsuite/gas/i386/i386.exp: Run new test.
opcodes/
2017-11-20 Jan Beulich <jbeulich@suse.com>
* i386-dis.c (float_mem): Add suffixes to fi* in the "de" and
"df" groups.
--- a/gas/testsuite/gas/i386/ilp32/x86-64-sse-noavx.d
+++ b/gas/testsuite/gas/i386/ilp32/x86-64-sse-noavx.d
@@ -16,7 +16,8 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 0f 2d f7 cvtps2pi %xmm7,%mm6
[ ]*[a-f0-9]+: 66 0f 2c dc cvttpd2pi %xmm4,%mm3
[ ]*[a-f0-9]+: 0f 2c dc cvttps2pi %xmm4,%mm3
-[ ]*[a-f0-9]+: df 08 fisttp \(%rax\)
+[ ]*[a-f0-9]+: df 08 fisttps \(%rax\)
+[ ]*[a-f0-9]+: db 08 fisttpl \(%rax\)
[ ]*[a-f0-9]+: dd 08 fisttpll \(%rax\)
[ ]*[a-f0-9]+: 0f ae e8 lfence
[ ]*[a-f0-9]+: 0f f7 c7 maskmovq %mm7,%mm0
--- a/gas/testsuite/gas/i386/ilp32/x86-64-sse3.d
+++ b/gas/testsuite/gas/i386/ilp32/x86-64-sse3.d
@@ -11,7 +11,7 @@ Disassembly of section .text:
4: 66 0f d0 ca [ ]*addsubpd %xmm2,%xmm1
8: f2 0f d0 13 [ ]*addsubps \(%rbx\),%xmm2
c: f2 0f d0 dc [ ]*addsubps %xmm4,%xmm3
- 10: df 88 90 90 90 00 [ ]*fisttp 0x909090\(%rax\)
+ 10: df 88 90 90 90 00 [ ]*fisttps 0x909090\(%rax\)
16: db 88 90 90 90 00 [ ]*fisttpl 0x909090\(%rax\)
1c: dd 88 90 90 90 00 [ ]*fisttpll 0x909090\(%rax\)
22: 66 0f 7c 65 00 [ ]*haddpd 0x0\(%rbp\),%xmm4
--- a/gas/testsuite/gas/i386/intel.d
+++ b/gas/testsuite/gas/i386/intel.d
@@ -221,8 +221,8 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: db 90 90 90 90 90 [ ]*fistl -0x6f6f6f70\(%eax\)
[ ]*[a-f0-9]+: dc 90 90 90 90 90 [ ]*fcoml -0x6f6f6f70\(%eax\)
[ ]*[a-f0-9]+: dd 90 90 90 90 90 [ ]*fstl -0x6f6f6f70\(%eax\)
-[ ]*[a-f0-9]+: de 90 90 90 90 90 [ ]*ficom -0x6f6f6f70\(%eax\)
-[ ]*[a-f0-9]+: df 90 90 90 90 90 [ ]*fist -0x6f6f6f70\(%eax\)
+[ ]*[a-f0-9]+: de 90 90 90 90 90 [ ]*ficoms -0x6f6f6f70\(%eax\)
+[ ]*[a-f0-9]+: df 90 90 90 90 90 [ ]*fists -0x6f6f6f70\(%eax\)
[ ]*[a-f0-9]+: e0 90 [ ]*loopne (0x)?260.*
[ ]*[a-f0-9]+: e1 90 [ ]*loope (0x)?262.*
[ ]*[a-f0-9]+: e2 90 [ ]*loop (0x)?264.*
@@ -692,7 +692,7 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: de e3 fsubp %st,%st\(3\)
[ ]*[a-f0-9]+: de e3 fsubp %st,%st\(3\)
[ ]*[a-f0-9]+: de e3 fsubp %st,%st\(3\)
-[ ]*[a-f0-9]+: de 3b fidivr \(%ebx\)
+[ ]*[a-f0-9]+: de 3b fidivrs \(%ebx\)
[ ]*[a-f0-9]+: da 3b fidivrl \(%ebx\)
[ ]*[a-f0-9]+: 0f 4a 90 90 90 90 90 cmovp -0x6f6f6f70\(%eax\),%edx
[ ]*[a-f0-9]+: 0f 4b 90 90 90 90 90 cmovnp -0x6f6f6f70\(%eax\),%edx
--- a/gas/testsuite/gas/i386/opcode-suffix.d
+++ b/gas/testsuite/gas/i386/opcode-suffix.d
@@ -219,8 +219,8 @@ Disassembly of section .text:
*[0-9a-f]+: db 90 90 90 90 90[ ]+fistl[ ]+-0x6f6f6f70\(%eax\)
*[0-9a-f]+: dc 90 90 90 90 90[ ]+fcoml[ ]+-0x6f6f6f70\(%eax\)
*[0-9a-f]+: dd 90 90 90 90 90[ ]+fstl[ ]+-0x6f6f6f70\(%eax\)
- *[0-9a-f]+: de 90 90 90 90 90[ ]+ficom[ ]+-0x6f6f6f70\(%eax\)
- *[0-9a-f]+: df 90 90 90 90 90[ ]+fist[ ]+-0x6f6f6f70\(%eax\)
+ *[0-9a-f]+: de 90 90 90 90 90[ ]+ficoms[ ]+-0x6f6f6f70\(%eax\)
+ *[0-9a-f]+: df 90 90 90 90 90[ ]+fists[ ]+-0x6f6f6f70\(%eax\)
*[0-9a-f]+: e0 90[ ]+loopnel (0x)?25c.*
*[0-9a-f]+: e1 90[ ]+loopel (0x)?25e.*
*[0-9a-f]+: e2 90[ ]+loopl[ ]+(0x)?260.*
--- a/gas/testsuite/gas/i386/opcode.d
+++ b/gas/testsuite/gas/i386/opcode.d
@@ -218,8 +218,8 @@ Disassembly of section .text:
2ac: db 90 90 90 90 90 [ ]*fistl -0x6f6f6f70\(%eax\)
2b2: dc 90 90 90 90 90 [ ]*fcoml -0x6f6f6f70\(%eax\)
2b8: dd 90 90 90 90 90 [ ]*fstl -0x6f6f6f70\(%eax\)
- 2be: de 90 90 90 90 90 [ ]*ficom -0x6f6f6f70\(%eax\)
- 2c4: df 90 90 90 90 90 [ ]*fist -0x6f6f6f70\(%eax\)
+ 2be: de 90 90 90 90 90 [ ]*ficoms -0x6f6f6f70\(%eax\)
+ 2c4: df 90 90 90 90 90 [ ]*fists -0x6f6f6f70\(%eax\)
2ca: e0 90 [ ]*loopne (0x)?25c.*
2cc: e1 90 [ ]*loope (0x)?25e.*
2ce: e2 90 [ ]*loop (0x)?260.*
--- a/gas/testsuite/gas/i386/opcode.s
+++ b/gas/testsuite/gas/i386/opcode.s
@@ -211,8 +211,8 @@ foo:
fistl 0x90909090(%eax)
fcoml 0x90909090(%eax)
fstl 0x90909090(%eax)
- ficom 0x90909090(%eax)
- fist 0x90909090(%eax)
+ ficoms 0x90909090(%eax)
+ fists 0x90909090(%eax)
loopne .+2-0x70
loope .+2-0x70
loop .+2-0x70
--- a/gas/testsuite/gas/i386/sse-noavx.d
+++ b/gas/testsuite/gas/i386/sse-noavx.d
@@ -14,7 +14,8 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 0f 2d f7 cvtps2pi %xmm7,%mm6
[ ]*[a-f0-9]+: 66 0f 2c dc cvttpd2pi %xmm4,%mm3
[ ]*[a-f0-9]+: 0f 2c dc cvttps2pi %xmm4,%mm3
-[ ]*[a-f0-9]+: df 08 fisttp \(%eax\)
+[ ]*[a-f0-9]+: df 08 fisttps \(%eax\)
+[ ]*[a-f0-9]+: db 08 fisttpl \(%eax\)
[ ]*[a-f0-9]+: dd 08 fisttpll \(%eax\)
[ ]*[a-f0-9]+: 0f ae e8 lfence
[ ]*[a-f0-9]+: 0f f7 c7 maskmovq %mm7,%mm0
--- a/gas/testsuite/gas/i386/sse-noavx.s
+++ b/gas/testsuite/gas/i386/sse-noavx.s
@@ -9,8 +9,9 @@ _start:
cvtps2pi %xmm7,%mm6
cvttpd2pi %xmm4,%mm3
cvttps2pi %xmm4,%mm3
- fisttp (%eax)
- fisttpll (%eax)
+ fisttps (%eax)
+ fisttpl (%eax)
+ fisttpll (%eax)
lfence
maskmovq %mm7,%mm0
mfence
--- a/gas/testsuite/gas/i386/sse3.d
+++ b/gas/testsuite/gas/i386/sse3.d
@@ -10,7 +10,7 @@ Disassembly of section .text:
4: 66 0f d0 ca [ ]*addsubpd %xmm2,%xmm1
8: f2 0f d0 13 [ ]*addsubps \(%ebx\),%xmm2
c: f2 0f d0 dc [ ]*addsubps %xmm4,%xmm3
- 10: df 88 90 90 90 90 [ ]*fisttp -0x6f6f6f70\(%eax\)
+ 10: df 88 90 90 90 90 [ ]*fisttps -0x6f6f6f70\(%eax\)
16: db 88 90 90 90 90 [ ]*fisttpl -0x6f6f6f70\(%eax\)
1c: dd 88 90 90 90 90 [ ]*fisttpll -0x6f6f6f70\(%eax\)
22: 66 0f 7c 65 00 [ ]*haddpd 0x0\(%ebp\),%xmm4
--- a/gas/testsuite/gas/i386/sse3.s
+++ b/gas/testsuite/gas/i386/sse3.s
@@ -6,7 +6,7 @@ foo:
addsubpd %xmm2,%xmm1
addsubps (%ebx),%xmm2
addsubps %xmm4,%xmm3
- fisttp 0x90909090(%eax)
+ fisttps 0x90909090(%eax)
fisttpl 0x90909090(%eax)
fisttpll 0x90909090(%eax)
haddpd 0x0(%ebp),%xmm4
--- a/gas/testsuite/gas/i386/x86-64-sse-noavx.d
+++ b/gas/testsuite/gas/i386/x86-64-sse-noavx.d
@@ -15,7 +15,8 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 0f 2d f7 cvtps2pi %xmm7,%mm6
[ ]*[a-f0-9]+: 66 0f 2c dc cvttpd2pi %xmm4,%mm3
[ ]*[a-f0-9]+: 0f 2c dc cvttps2pi %xmm4,%mm3
-[ ]*[a-f0-9]+: df 08 fisttp \(%rax\)
+[ ]*[a-f0-9]+: df 08 fisttps \(%rax\)
+[ ]*[a-f0-9]+: db 08 fisttpl \(%rax\)
[ ]*[a-f0-9]+: dd 08 fisttpll \(%rax\)
[ ]*[a-f0-9]+: 0f ae e8 lfence
[ ]*[a-f0-9]+: 0f f7 c7 maskmovq %mm7,%mm0
--- a/gas/testsuite/gas/i386/x86-64-sse-noavx.s
+++ b/gas/testsuite/gas/i386/x86-64-sse-noavx.s
@@ -10,8 +10,9 @@ _start:
cvtps2pi %xmm7,%mm6
cvttpd2pi %xmm4,%mm3
cvttps2pi %xmm4,%mm3
- fisttp (%rax)
- fisttpll (%rax)
+ fisttps (%rax)
+ fisttpl (%rax)
+ fisttpll (%rax)
lfence
maskmovq %mm7,%mm0
mfence
--- a/gas/testsuite/gas/i386/x86-64-sse3.d
+++ b/gas/testsuite/gas/i386/x86-64-sse3.d
@@ -10,7 +10,7 @@ Disassembly of section .text:
4: 66 0f d0 ca [ ]*addsubpd %xmm2,%xmm1
8: f2 0f d0 13 [ ]*addsubps \(%rbx\),%xmm2
c: f2 0f d0 dc [ ]*addsubps %xmm4,%xmm3
- 10: df 88 90 90 90 00 [ ]*fisttp 0x909090\(%rax\)
+ 10: df 88 90 90 90 00 [ ]*fisttps 0x909090\(%rax\)
16: db 88 90 90 90 00 [ ]*fisttpl 0x909090\(%rax\)
1c: dd 88 90 90 90 00 [ ]*fisttpll 0x909090\(%rax\)
22: 66 0f 7c 65 00 [ ]*haddpd 0x0\(%rbp\),%xmm4
--- a/gas/testsuite/gas/i386/x86-64-sse3.s
+++ b/gas/testsuite/gas/i386/x86-64-sse3.s
@@ -6,7 +6,7 @@ foo:
addsubpd %xmm2,%xmm1
addsubps (%rbx),%xmm2
addsubps %xmm4,%xmm3
- fisttp 0x909090(%rax)
+ fisttps 0x909090(%rax)
fisttpl 0x909090(%rax)
fisttpll 0x909090(%rax)
haddpd 0x0(%rbp),%xmm4
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -13571,19 +13571,19 @@ static const char *float_mem[] = {
"fNsaveIC",
"fNstsw",
/* de */
- "fiadd",
- "fimul",
- "ficom",
- "ficomp",
- "fisub",
- "fisubr",
- "fidiv",
- "fidivr",
+ "fiadd{s|}",
+ "fimul{s|}",
+ "ficom{s|}",
+ "ficomp{s|}",
+ "fisub{s|}",
+ "fisubr{s|}",
+ "fidiv{s|}",
+ "fidivr{s|}",
/* df */
- "fild",
- "fisttp",
- "fist",
- "fistp",
+ "fild{s|}",
+ "fisttp{s|}",
+ "fist{s|}",
+ "fistp{s|}",
"fbld",
"fild{ll|}",
"fbstp",