summaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2007-10-23 22:52:09 +0000
committerH.J. Lu <hjl@lucon.org>2007-10-23 22:52:09 +0000
commit8cfec34ebed450fb58de7848cae0e6ef8a334f83 (patch)
tree17351999304a96daba8267237f5a156df20b4862 /opcodes
parent9962fc95ce4dc1e2006f665f0791a724808d064f (diff)
downloadbinutils-redhat-8cfec34ebed450fb58de7848cae0e6ef8a334f83.tar.gz
gas/testsuite/
2007-10-23 H.J. Lu <hongjiu.lu@intel.com> * gas/i386/katmai.s: Remove cmpps opcode test. * gas/i386/simd.s: Add tests for cmpss and cmpsd. * gas/i386/x86-64-simd.s: Likewise. * gas/i386/katmai.d: Updated. * gas/i386/simd-intel.d: Likewise. * gas/i386/simd-suffix.d: Likewise. * gas/i386/simd.d: Likewise. * gas/i386/x86-64-simd-intel.d: Likewise. * gas/i386/x86-64-simd-suffix.d: Likewise. * gas/i386/x86-64-simd.d: Likewise. opcodes/ 2007-10-23 H.J. Lu <hongjiu.lu@intel.com> * i386-dis.c (OP_SIMD_Suffix): Renamed to ... (CMP_Fixup): This. Rewrite. (OPSIMD): Renamed to ... (CMP): This. Updated. (prefix_table): Update PREFIX_0FC2 entry.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog8
-rw-r--r--opcodes/i386-dis.c50
2 files changed, 26 insertions, 32 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 9ca117e483..169032caf7 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,11 @@
+2007-10-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ * i386-dis.c (OP_SIMD_Suffix): Renamed to ...
+ (CMP_Fixup): This. Rewrite.
+ (OPSIMD): Renamed to ...
+ (CMP): This. Updated.
+ (prefix_table): Update PREFIX_0FC2 entry.
+
2007-10-22 H.J. Lu <hongjiu.lu@intel.com>
* i386-dis.c (prefix_table): Reordered by opcode.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index e4b7285f22..4e52288b62 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -95,7 +95,7 @@ static void OP_Mwait (int, int);
static void NOP_Fixup1 (int, int);
static void NOP_Fixup2 (int, int);
static void OP_3DNowSuffix (int, int);
-static void OP_SIMD_Suffix (int, int);
+static void CMP_Fixup (int, int);
static void BadOp (void);
static void REP_Fixup (int, int);
static void CMPXCHG8B_Fixup (int, int);
@@ -340,7 +340,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
#define EMCq { OP_EMC, q_mode }
#define MXC { OP_MXC, 0 }
#define OPSUF { OP_3DNowSuffix, 0 }
-#define OPSIMD { OP_SIMD_Suffix, 0 }
+#define CMP { CMP_Fixup, 0 }
#define XMM0 { XMM_Fixup, 0 }
/* Used handle "rep" prefix for string instructions. */
@@ -2091,10 +2091,10 @@ static const struct dis386 prefix_table[][4] = {
/* PREFIX_0FC2 */
{
- { "", { XM, EXx, OPSIMD } }, /* See OP_SIMD_SUFFIX. */
- { "", { XM, EXd, OPSIMD } },
- { "", { XM, EXx, OPSIMD } },
- { "", { XM, EXq, OPSIMD } },
+ { "cmpps", { XM, EXx, CMP } },
+ { "cmpss", { XM, EXd, CMP } },
+ { "cmppd", { XM, EXx, CMP } },
+ { "cmpsd", { XM, EXq, CMP } },
},
/* PREFIX_0FC7_REG_6 */
@@ -7737,42 +7737,28 @@ static const char *simd_cmp_op[] = {
};
static void
-OP_SIMD_Suffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
+CMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
unsigned int cmp_type;
FETCH_DATA (the_info, codep + 1);
- obufp = obuf + strlen (obuf);
cmp_type = *codep++ & 0xff;
if (cmp_type < 8)
{
- char suffix1 = 'p', suffix2 = 's';
- used_prefixes |= (prefixes & PREFIX_REPZ);
- if (prefixes & PREFIX_REPZ)
- suffix1 = 's';
- else
- {
- used_prefixes |= (prefixes & PREFIX_DATA);
- if (prefixes & PREFIX_DATA)
- suffix2 = 'd';
- else
- {
- used_prefixes |= (prefixes & PREFIX_REPNZ);
- if (prefixes & PREFIX_REPNZ)
- suffix1 = 's', suffix2 = 'd';
- }
- }
- sprintf (scratchbuf, "cmp%s%c%c",
- simd_cmp_op[cmp_type], suffix1, suffix2);
- used_prefixes |= (prefixes & PREFIX_REPZ);
- oappend (scratchbuf);
+ char suffix [3];
+ char *p = obuf + strlen (obuf) - 2;
+ suffix[0] = p[0];
+ suffix[1] = p[1];
+ suffix[2] = '\0';
+ sprintf (p, "%s%s", simd_cmp_op[cmp_type], suffix);
}
else
{
- /* We have a bad extension byte. Clean up. */
- op_out[0][0] = '\0';
- op_out[1][0] = '\0';
- BadOp ();
+ /* We have a reserved extension byte. Output it directly. */
+ scratchbuf[0] = '$';
+ print_operand_value (scratchbuf + 1, 1, cmp_type);
+ oappend (scratchbuf + intel_syntax);
+ scratchbuf[0] = '\0';
}
}