summaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
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 aca611ea6f..5698397c20 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 6b6dbba827..6f62b938d8 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 d2b492762f..4701e6dbc3 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 1129df01bf..59916b6e07 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 89adf696a0..2f055807b0 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 0000000000..c0a47ddff4
--- /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 0000000000..10a12aa5e5
--- /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