* include/opcode/tic6x.h: add tic6x_coding_dreg_(msb|lsb) field coding type in
[binutils-gdb.git] / gas / config / tc-tic6x.c
index 017254ac8acc729f5e30b2b1f7e2b977058969e2..7e11d0bb77b0d82a8cc185591bdcda39f418cb58 100644 (file)
@@ -1,6 +1,5 @@
 /* TI C6X assembler.
-   Copyright 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright 2010-2013 Free Software Foundation, Inc.
    Contributed by Joseph Myers <joseph@codesourcery.com>
                  Bernd Schmidt  <bernds@codesourcery.com>
 
@@ -693,7 +692,7 @@ static bfd_boolean tic6x_attributes_set_explicitly[NUM_KNOWN_OBJ_ATTRIBUTES];
 static void
 s_tic6x_c6xabi_attribute (int ignored ATTRIBUTE_UNUSED)
 {
-  int tag = s_vendor_attribute (OBJ_ATTR_PROC);
+  int tag = obj_elf_vendor_attribute (OBJ_ATTR_PROC);
 
   if (tag < NUM_KNOWN_OBJ_ATTRIBUTES)
     tic6x_attributes_set_explicitly[tag] = TRUE;
@@ -790,12 +789,12 @@ md_begin (void)
 
   /* We must construct a fake section similar to bfd_com_section
      but with the name .scommon.  */
-  scom_section                = bfd_com_section;
+  scom_section                = *bfd_com_section_ptr;
   scom_section.name           = ".scommon";
   scom_section.output_section = & scom_section;
   scom_section.symbol         = & scom_symbol;
   scom_section.symbol_ptr_ptr = & scom_section.symbol;
-  scom_symbol                 = * bfd_com_section.symbol;
+  scom_symbol                 = * bfd_com_section_ptr->symbol;
   scom_symbol.name            = ".scommon";
   scom_symbol.section         = & scom_section;
 }
@@ -2717,6 +2716,30 @@ tic6x_try_encode (tic6x_opcode_id id, tic6x_operand *operands,
          *fix_adda = FALSE;
          break;
 
+       case tic6x_coding_regpair_lsb:
+         switch (operands[opno].form)
+           {
+           case TIC6X_OP_REGPAIR:
+             value = operands[opno].value.reg.num;
+             break;
+
+           default:
+             abort ();
+           }
+         break;
+
+       case tic6x_coding_regpair_msb:
+         switch (operands[opno].form)
+           {
+           case TIC6X_OP_REGPAIR:
+             value = operands[opno].value.reg.num + 1;
+             break;
+
+           default:
+             abort ();
+           }
+         break;
+
        case tic6x_coding_reg:
          switch (operands[opno].form)
            {