x86: drop dead code from build_modrm_byte()
authorJan Beulich <jbeulich@novell.com>
Thu, 26 Apr 2018 06:28:38 +0000 (08:28 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 26 Apr 2018 06:28:38 +0000 (08:28 +0200)
There are no templates with VexImmExt and ImmExt set at the same time.
There are also no VEX3SOURCES templates with CpuFMA. I assume both are
left-overs from the implementation of an early specification which was
later revised.

gas/ChangeLog
gas/config/tc-i386.c

index ce832e919d9add8ea9eb1d4f62194d0a57d0a3ee..057a45fb0fb03f08d5b88b4d3d922b44c9c68df8 100644 (file)
@@ -1,3 +1,9 @@
+2018-04-26  Jan Beulich  <jbeulich@suse.com>
+
+       * config/tc-i386.c (build_modrm_byte): Drop code dealing with
+       .veximmext and .immext set at the same time. Drop code dealing
+       with .cpufma when .vexsources == VEX3SOURCES.
+
 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
        Mickaël Guêné  <mickael.guene@st.com>
 
index 9bfec10a534c78c3ff82719db85db12ec9f8e335..014720ea3c2c5876c893289c7c0eee35d62952dc 100644 (file)
@@ -6567,22 +6567,16 @@ build_modrm_byte (void)
   unsigned int source, dest;
   int vex_3_sources;
 
-  /* The first operand of instructions with VEX prefix and 3 sources
-     must be VEX_Imm4.  */
   vex_3_sources = i.tm.opcode_modifier.vexsources == VEX3SOURCES;
   if (vex_3_sources)
     {
       unsigned int nds, reg_slot;
       expressionS *exp;
 
-      if (i.tm.opcode_modifier.veximmext
-          && i.tm.opcode_modifier.immext)
-        {
-          dest = i.operands - 2;
-          gas_assert (dest == 3);
-        }
-      else
-        dest = i.operands - 1;
+      gas_assert (!i.tm.opcode_modifier.veximmext
+                || !i.tm.opcode_modifier.immext);
+
+      dest = i.operands - 1;
       nds = dest - 1;
 
       /* There are 2 kinds of instructions:
@@ -6623,15 +6617,6 @@ build_modrm_byte (void)
               reg_slot = 0;
             }
 
-          /* FMA swaps REG and NDS.  */
-          if (i.tm.cpu_flags.bitfield.cpufma)
-            {
-              unsigned int tmp;
-              tmp = reg_slot;
-              reg_slot = nds;
-              nds = tmp;
-            }
-
           gas_assert (i.tm.operand_types[reg_slot].bitfield.regsimd);
           exp->X_op = O_constant;
           exp->X_add_number = register_number (i.op[reg_slot].regs) << 4;
This page took 0.0331 seconds and 4 git commands to generate.