aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2018-03-08 08:48:10 +0100
committerJan Beulich <jbeulich@suse.com>2018-03-08 08:48:10 +0100
commit548d0ee6e726c366fda3f37251f329ec51decc6d (patch)
tree3b8e59426f02dd6144f267eae167b145e8cc28b5 /gas
parent929f69fa966f9ed7a1a8cce19a168348295863c2 (diff)
downloadfsf-binutils-gdb-548d0ee6e726c366fda3f37251f329ec51decc6d.zip
fsf-binutils-gdb-548d0ee6e726c366fda3f37251f329ec51decc6d.tar.gz
fsf-binutils-gdb-548d0ee6e726c366fda3f37251f329ec51decc6d.tar.bz2
x86: simplify result processing of cpu_flags_match()
Make more obvious what the success and failure paths are, and in particular that what used to be at the "skip" label can't be reached by what used to be straight line code.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-i386.c40
2 files changed, 21 insertions, 24 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index d741855..d125b23 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
2018-03-08 Jan Beulich <jbeulich@suse.com>
+ * config/tc-i386.c (parse_insn): Move success return up. Combine
+ failure returns.
+
+2018-03-08 Jan Beulich <jbeulich@suse.com>
+
* config/tc-i386.c (cpu_flags_match): Add GFNI check to AVX
logic. Add respective logic for AVX512F.
* testsuite/gas/i386/arch-avx-1.s: Add GFNI test.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 7df5d028..67e8069 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -4487,34 +4487,26 @@ check_suffix:
{
supported |= cpu_flags_match (t);
if (supported == CPU_FLAGS_PERFECT_MATCH)
- goto skip;
- }
+ {
+ if (!cpu_arch_flags.bitfield.cpui386 && (flag_code != CODE_16BIT))
+ as_warn (_("use .code16 to ensure correct addressing mode"));
- if (!(supported & CPU_FLAGS_64BIT_MATCH))
- {
- as_bad (flag_code == CODE_64BIT
- ? _("`%s' is not supported in 64-bit mode")
- : _("`%s' is only supported in 64-bit mode"),
- current_templates->start->name);
- return NULL;
- }
- if (supported != CPU_FLAGS_PERFECT_MATCH)
- {
- as_bad (_("`%s' is not supported on `%s%s'"),
- current_templates->start->name,
- cpu_arch_name ? cpu_arch_name : default_arch,
- cpu_sub_arch_name ? cpu_sub_arch_name : "");
- return NULL;
+ return l;
+ }
}
-skip:
- if (!cpu_arch_flags.bitfield.cpui386
- && (flag_code != CODE_16BIT))
- {
- as_warn (_("use .code16 to ensure correct addressing mode"));
- }
+ if (!(supported & CPU_FLAGS_64BIT_MATCH))
+ as_bad (flag_code == CODE_64BIT
+ ? _("`%s' is not supported in 64-bit mode")
+ : _("`%s' is only supported in 64-bit mode"),
+ current_templates->start->name);
+ else
+ as_bad (_("`%s' is not supported on `%s%s'"),
+ current_templates->start->name,
+ cpu_arch_name ? cpu_arch_name : default_arch,
+ cpu_sub_arch_name ? cpu_sub_arch_name : "");
- return l;
+ return NULL;
}
static char *