aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2012-06-22 16:42:08 +0000
committerRoland McGrath <roland@gnu.org>2012-06-22 16:42:08 +0000
commit29c048b696d4e93fe9f595d59fcb6239270e5a29 (patch)
tree82d345d16980f63360aa7e356b877025255a171f /gas
parent0a6d03060482e8eae207d4be1d6e8f6ff5e4d340 (diff)
downloadgdb-29c048b696d4e93fe9f595d59fcb6239270e5a29.zip
gdb-29c048b696d4e93fe9f595d59fcb6239270e5a29.tar.gz
gdb-29c048b696d4e93fe9f595d59fcb6239270e5a29.tar.bz2
gas/
* config/tc-i386.c (parse_insn): Don't complain about REP prefix when the template has opcode_modifier.repprefixok set. * NEWS: Mention the change. gas/testsuite/ * gas/i386/rep-bsf.d: New file. * gas/i386/rep-bsf.s: New file. * gas/i386/i386.exp: Add the new test. opcodes/ * i386-opc.h (RepPrefixOk): New enum constant. (i386_opcode_modifier): New bitfield 'repprefixok'. * i386-gen.c (opcode_modifiers): Add RepPrefixOk. * i386-opc.tbl: Add RepPrefixOk to bsf, bsr, and to all instructions that have IsString. * i386-tbl.h: Regenerate.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/NEWS2
-rw-r--r--gas/config/tc-i386.c6
-rw-r--r--gas/testsuite/ChangeLog6
-rw-r--r--gas/testsuite/gas/i386/i386.exp1
-rw-r--r--gas/testsuite/gas/i386/rep-bsf.d11
-rw-r--r--gas/testsuite/gas/i386/rep-bsf.s3
7 files changed, 32 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index aca611e..5698397 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-22 Roland McGrath <mcgrathr@google.com>
+
+ * config/tc-i386.c (parse_insn): Don't complain about REP prefix
+ when the template has opcode_modifier.repprefixok set.
+ * NEWS: Mention the change.
+
2012-06-18 Iain Sandoe <iain@codesourcery.com>
* configure.in: Check DECLS for free, getenv, malloc, realloc,
diff --git a/gas/NEWS b/gas/NEWS
index 6b6dbba..6f62b93 100644
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -13,6 +13,8 @@
* Add support for the Adapteva EPIPHANY architecture.
+* For x86, allow 'rep bsf' or 'rep bsr' syntax.
+
Changes in 2.22:
* Add support for the Tilera TILEPro and TILE-Gx architectures.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index d2b4927..4701e6d 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -3528,13 +3528,13 @@ skip:
as_warn (_("use .code16 to ensure correct addressing mode"));
}
- /* Check for rep/repne without a string instruction. */
+ /* Check for rep/repne without a string (or other allowed) instruction. */
if (expecting_string_instruction)
{
static templates override;
for (t = current_templates->start; t < current_templates->end; ++t)
- if (t->opcode_modifier.isstring)
+ if (t->opcode_modifier.repprefixok)
break;
if (t >= current_templates->end)
{
@@ -3543,7 +3543,7 @@ skip:
return NULL;
}
for (override.start = t; t < current_templates->end; ++t)
- if (!t->opcode_modifier.isstring)
+ if (!t->opcode_modifier.repprefixok)
break;
override.end = t;
current_templates = &override;
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 1129df0..59916b6 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-22 Roland McGrath <mcgrathr@google.com>
+
+ * gas/i386/rep-bsf.d: New file.
+ * gas/i386/rep-bsf.s: New file.
+ * gas/i386/i386.exp: Add the new test.
+
2012-06-13 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/ilp32/x86-64-dc_a.d: New.
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 89adf69..2f05580 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -264,6 +264,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
# Miscellaneous tests.
run_dump_test "pr12589-1"
+ run_dump_test "rep-bsf"
set ASFLAGS "$old_ASFLAGS"
}
diff --git a/gas/testsuite/gas/i386/rep-bsf.d b/gas/testsuite/gas/i386/rep-bsf.d
new file mode 100644
index 0000000..c0a47dd
--- /dev/null
+++ b/gas/testsuite/gas/i386/rep-bsf.d
@@ -0,0 +1,11 @@
+#objdump: -d
+#name: rep prefix on bsf/bsr
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+000 <bsf>:
+\s*[0-9]+:\s+f3 0f bc c1\s+tzcnt %ecx,%eax
+0+004 <bsr>:
+\s*[0-9]+:\s+f3 0f bd c1\s+lzcnt %ecx,%eax
diff --git a/gas/testsuite/gas/i386/rep-bsf.s b/gas/testsuite/gas/i386/rep-bsf.s
new file mode 100644
index 0000000..10a12aa
--- /dev/null
+++ b/gas/testsuite/gas/i386/rep-bsf.s
@@ -0,0 +1,3 @@
+ .text
+bsf: rep bsf %ecx, %eax
+bsr: rep bsr %ecx, %eax