x86: fold redundant expressions in process_suffix()

There's no point repeatedly evaluating i.types[op].bitfield.reg.
This commit is contained in:
Jan Beulich 2018-03-08 08:50:13 +01:00 committed by Jan Beulich
parent 548d0ee6e7
commit 8819ada6c4
2 changed files with 18 additions and 20 deletions

View File

@ -1,3 +1,8 @@
2018-03-08 Jan Beulich <jbeulich@suse.com>
* config/tc-i386.c (process_suffix): Do common part of register
checks first.
2018-03-08 Jan Beulich <jbeulich@suse.com> 2018-03-08 Jan Beulich <jbeulich@suse.com>
* config/tc-i386.c (parse_insn): Move success return up. Combine * config/tc-i386.c (parse_insn): Move success return up. Combine

View File

@ -5736,29 +5736,22 @@ process_suffix (void)
if (!i.tm.operand_types[op].bitfield.inoutportreg if (!i.tm.operand_types[op].bitfield.inoutportreg
&& !i.tm.operand_types[op].bitfield.shiftcount) && !i.tm.operand_types[op].bitfield.shiftcount)
{ {
if (i.types[op].bitfield.reg && i.types[op].bitfield.byte) if (!i.types[op].bitfield.reg)
{ continue;
if (i.types[op].bitfield.byte)
i.suffix = BYTE_MNEM_SUFFIX; i.suffix = BYTE_MNEM_SUFFIX;
break; else if (i.types[op].bitfield.word)
}
if (i.types[op].bitfield.reg && i.types[op].bitfield.word)
{
i.suffix = WORD_MNEM_SUFFIX; i.suffix = WORD_MNEM_SUFFIX;
break; else if (i.types[op].bitfield.dword)
}
if (i.types[op].bitfield.reg && i.types[op].bitfield.dword)
{
i.suffix = LONG_MNEM_SUFFIX; i.suffix = LONG_MNEM_SUFFIX;
break; else if (i.types[op].bitfield.qword)
}
if (i.types[op].bitfield.reg && i.types[op].bitfield.qword)
{
i.suffix = QWORD_MNEM_SUFFIX; i.suffix = QWORD_MNEM_SUFFIX;
else
continue;
break; break;
} }
} }
} }
}
else if (i.suffix == BYTE_MNEM_SUFFIX) else if (i.suffix == BYTE_MNEM_SUFFIX)
{ {
if (intel_syntax if (intel_syntax