x86/Intel: drop pointless suffix setting for "tbyte ptr"
[deliverable/binutils-gdb.git] / gas / config / tc-i386-intel.c
index fd71afb75bdf9cdd7c2bb60e3dcefca65058b047..7d0a5b8d851e5b535db3fe269b46d35d87247209 100644 (file)
@@ -639,12 +639,7 @@ i386_intel_operand (char *operand_string, int got_a_float)
 
        case O_word_ptr:
          i.types[this_operand].bitfield.word = 1;
-         if ((current_templates->start->name[0] == 'l'
-              && current_templates->start->name[2] == 's'
-              && current_templates->start->name[3] == 0)
-             || current_templates->start->base_opcode == 0x62 /* bound */)
-           suffix = BYTE_MNEM_SUFFIX; /* so it will cause an error */
-         else if (got_a_float == 2)    /* "fi..." */
+         if (got_a_float == 2) /* "fi..." */
            suffix = SHORT_MNEM_SUFFIX;
          else
            suffix = WORD_MNEM_SUFFIX;
@@ -657,10 +652,12 @@ i386_intel_operand (char *operand_string, int got_a_float)
               && current_templates->start->name[3] == 0)
              || current_templates->start->base_opcode == 0x62 /* bound */)
            suffix = WORD_MNEM_SUFFIX;
-         else if (flag_code == CODE_16BIT
-                  && (current_templates->start->opcode_modifier.jump
-                      || current_templates->start->opcode_modifier.jumpdword))
-           suffix = LONG_DOUBLE_MNEM_SUFFIX;
+         else if (flag_code != CODE_32BIT
+                  && (current_templates->start->opcode_modifier.jump == JUMP
+                      || current_templates->start->opcode_modifier.jump
+                         == JUMP_DWORD))
+           suffix = flag_code == CODE_16BIT ? LONG_DOUBLE_MNEM_SUFFIX
+                                            : WORD_MNEM_SUFFIX;
          else if (got_a_float == 1)    /* "f..." */
            suffix = SHORT_MNEM_SUFFIX;
          else
@@ -679,8 +676,6 @@ i386_intel_operand (char *operand_string, int got_a_float)
                add_prefix (DATA_PREFIX_OPCODE);
              suffix = LONG_DOUBLE_MNEM_SUFFIX;
            }
-         else
-           suffix = BYTE_MNEM_SUFFIX; /* so it will cause an error */
          break;
 
        case O_qword_ptr:
@@ -696,8 +691,12 @@ i386_intel_operand (char *operand_string, int got_a_float)
          i.types[this_operand].bitfield.tbyte = 1;
          if (got_a_float == 1)
            suffix = LONG_DOUBLE_MNEM_SUFFIX;
+         else if ((current_templates->start->operand_types[0].bitfield.fword
+                   || current_templates->start->operand_types[0].bitfield.tbyte)
+                  && flag_code == CODE_64BIT)
+           suffix = QWORD_MNEM_SUFFIX; /* l[fgs]s, [ls][gi]dt */
          else
-           suffix = BYTE_MNEM_SUFFIX; /* so it will cause an error */
+           i.types[this_operand].bitfield.byte = 1; /* cause an error */
          break;
 
        case O_oword_ptr:
@@ -717,8 +716,8 @@ i386_intel_operand (char *operand_string, int got_a_float)
          suffix = LONG_DOUBLE_MNEM_SUFFIX;
          /* FALLTHROUGH */
        case O_near_ptr:
-         if (!current_templates->start->opcode_modifier.jump
-             && !current_templates->start->opcode_modifier.jumpdword)
+         if (current_templates->start->opcode_modifier.jump != JUMP
+             && current_templates->start->opcode_modifier.jump != JUMP_DWORD)
            suffix = got_a_float /* so it will cause an error */
                     ? BYTE_MNEM_SUFFIX
                     : LONG_DOUBLE_MNEM_SUFFIX;
@@ -739,9 +738,9 @@ i386_intel_operand (char *operand_string, int got_a_float)
     }
 
   /* Operands for jump/call need special consideration.  */
-  if (current_templates->start->opcode_modifier.jump
-      || current_templates->start->opcode_modifier.jumpdword
-      || current_templates->start->opcode_modifier.jumpintersegment)
+  if (current_templates->start->opcode_modifier.jump == JUMP
+      || current_templates->start->opcode_modifier.jump == JUMP_DWORD
+      || current_templates->start->opcode_modifier.jump == JUMP_INTERSEGMENT)
     {
       bfd_boolean jumpabsolute = FALSE;
 
@@ -857,9 +856,9 @@ i386_intel_operand (char *operand_string, int got_a_float)
             ljmp       0x9090,0x90909090
           */
 
-         if ((current_templates->start->opcode_modifier.jumpintersegment
-              || current_templates->start->opcode_modifier.jumpdword
-              || current_templates->start->opcode_modifier.jump)
+         if ((current_templates->start->opcode_modifier.jump == JUMP_INTERSEGMENT
+              || current_templates->start->opcode_modifier.jump == JUMP_DWORD
+              || current_templates->start->opcode_modifier.jump == JUMP)
              && this_operand == 1
              && intel_state.seg == NULL
              && i.mem_operands == 1
This page took 0.025898 seconds and 4 git commands to generate.