From 556059dd13a8a9a30b23eacbefbe7b85e74ce7b7 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 14 Sep 2018 11:21:15 +0200 Subject: x86: fold CRC32 templates Just like other insns having byte and word forms, these can also make use of the W modifier, which at the same time allows simplifying some other code a little bit. --- gas/ChangeLog | 5 +++++ gas/config/tc-i386.c | 18 +++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index fc17226..6b4b84d 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2018-09-14 Jan Beulich + + * config/tc-i386.c (process_suffix): Simplify CRC32 special + casing code. + 2018-09-13 H.J. Lu * config/tc-i386.c (build_vex_prefix): Swap destination and diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 40b4583..e8284e0 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -6056,27 +6056,23 @@ process_suffix (void) Destination register type is more significant than source register type. crc32 in SSE4.2 prefers source register type. */ - if (i.tm.base_opcode == 0xf20f38f1) + if (i.tm.base_opcode == 0xf20f38f0 && i.types[0].bitfield.reg) { - if (i.types[0].bitfield.reg && i.types[0].bitfield.word) + if (i.types[0].bitfield.byte) + i.suffix = BYTE_MNEM_SUFFIX; + else if (i.types[0].bitfield.word) i.suffix = WORD_MNEM_SUFFIX; - else if (i.types[0].bitfield.reg && i.types[0].bitfield.dword) + else if (i.types[0].bitfield.dword) i.suffix = LONG_MNEM_SUFFIX; - else if (i.types[0].bitfield.reg && i.types[0].bitfield.qword) + else if (i.types[0].bitfield.qword) i.suffix = QWORD_MNEM_SUFFIX; } - else if (i.tm.base_opcode == 0xf20f38f0) - { - if (i.types[0].bitfield.reg && i.types[0].bitfield.byte) - i.suffix = BYTE_MNEM_SUFFIX; - } if (!i.suffix) { int op; - if (i.tm.base_opcode == 0xf20f38f1 - || i.tm.base_opcode == 0xf20f38f0) + if (i.tm.base_opcode == 0xf20f38f0) { /* We have to know the operand size for crc32. */ as_bad (_("ambiguous memory operand size for `%s`"), -- cgit v1.1