This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: arc-elf32 corrections


OK to add aliases for selecting core variants in current (old) gcc-arc ports;
also change default core to v6 not v5 as previously used?
Plus minor correction to assembler (lp_count must be r/w)

Cheers,

Peter.


2001-01-15  Peter Targett  <peter.targett@arccores.com>

     * bfd/cpu-arc.c (arch_info_struct): Add entry 'base' representing
     old name for 'arc5' core versions.
     (bfd_arc_arch): Make bfd_mach_arc_6 default.
     Update copyright.

2001-01-15  Peter Targett  <peter.targett@arccores.com>

     * config/tc-arc.c: Update copyright and tidy source comments.
     (md_pseudo_table): Add directive .cpu back as an alias for
     .option.
     (arc_mach_type): Make bfd_mach_arc_6 default.
     (md_longopts): Add entry 'pre-v6' representing old command line
     option when assembling for 'arc5' core versions.
     (md_parse_option): Make OPTION_ARC same as OPTION_ARC6, for new
     default behaviour.
     * doc/c-arc.texi (ARC_CORE_DEFAULT): Update to new default.

2001-01-15  Peter Targett  <peter.targett@arccores.com>

     * opcodes/arc-opc.c (arc_reg_names): Correct attribute for
     lp_count register to r/w.
     Update copyright.


Index: bfd/cpu-arc.c
===================================================================
RCS file: /cvs/src/src/bfd/cpu-arc.c,v
retrieving revision 1.2
diff -c -3 -p -r1.2 cpu-arc.c
*** cpu-arc.c  2001/01/11 21:20:16 1.2
--- cpu-arc.c  2001/01/15 11:32:28
***************
*** 1,5 ****
  /* BFD support for the ARC processor
!    Copyright 1994, 1995, 1997 Free Software Foundation, Inc.
     Contributed by Doug Evans (dje@cygnus.com).

  This file is part of BFD, the Binary File Descriptor library.
--- 1,5 ----
  /* BFD support for the ARC processor
!    Copyright 1994, 1995, 1997, 2001 Free Software Foundation, Inc.
     Contributed by Doug Evans (dje@cygnus.com).

  This file is part of BFD, the Binary File Descriptor library.
*************** Foundation, Inc., 59 Temple Place - Suit
*** 41,53 ****
  static const bfd_arch_info_type arch_info_struct[] =
  {
    ARC ( bfd_mach_arc_5, "arc5", false, &arch_info_struct[1] ),
!   ARC ( bfd_mach_arc_6, "arc6", false, &arch_info_struct[2] ),
!   ARC ( bfd_mach_arc_7, "arc7", false, &arch_info_struct[3] ),
    ARC ( bfd_mach_arc_8, "arc8", false, NULL ),
  };

  const bfd_arch_info_type bfd_arc_arch =
!   ARC ( bfd_mach_arc_5, "arc", true, &arch_info_struct[0] );

  /* Utility routines.  */

--- 41,54 ----
  static const bfd_arch_info_type arch_info_struct[] =
  {
    ARC ( bfd_mach_arc_5, "arc5", false, &arch_info_struct[1] ),
!   ARC ( bfd_mach_arc_5, "base", false, &arch_info_struct[2] ),
!   ARC ( bfd_mach_arc_6, "arc6", false, &arch_info_struct[3] ),
!   ARC ( bfd_mach_arc_7, "arc7", false, &arch_info_struct[4] ),
    ARC ( bfd_mach_arc_8, "arc8", false, NULL ),
  };

  const bfd_arch_info_type bfd_arc_arch =
!   ARC ( bfd_mach_arc_6, "arc", true, &arch_info_struct[0] );

  /* Utility routines.  */

Index: gas/config/tc-arc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arc.c,v
retrieving revision 1.10
diff -c -3 -p -r1.10 tc-arc.c
*** tc-arc.c   2001/01/15 01:37:20 1.10
--- tc-arc.c   2001/01/15 11:32:29
***************
*** 1,5 ****
  /* tc-arc.c -- Assembler for the ARC
!    Copyright (C) 1994, 1995, 1997, 2000 Free Software Foundation, Inc.
     Contributed by Doug Evans (dje@cygnus.com).

     This file is part of GAS, the GNU Assembler.
--- 1,5 ----
  /* tc-arc.c -- Assembler for the ARC
!    Copyright (C) 1994, 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
     Contributed by Doug Evans (dje@cygnus.com).

     This file is part of GAS, the GNU Assembler.
*************** const struct syntax_classes {
*** 75,81 ****
  #define MAXSYNTAXCLASS (sizeof (syntaxclass) / sizeof (struct syntax_classes))

  const pseudo_typeS md_pseudo_table[] = {
!   { "align", s_align_bytes, 0 }, /* Defaulting is invalid (0) */
    { "comm", arc_common, 0 },
    { "common", arc_common, 0 },
    { "lcomm", arc_common, 1 },
--- 75,81 ----
  #define MAXSYNTAXCLASS (sizeof (syntaxclass) / sizeof (struct syntax_classes))

  const pseudo_typeS md_pseudo_table[] = {
!   { "align", s_align_bytes, 0 }, /* Defaulting is invalid (0)  */
    { "comm", arc_common, 0 },
    { "common", arc_common, 0 },
    { "lcomm", arc_common, 1 },
*************** const pseudo_typeS md_pseudo_table[] = {
*** 87,92 ****
--- 87,93 ----
    { "4byte", cons, 4 },
    { "word", cons, 4 },
    { "option", arc_option, 0 },
+   { "cpu", arc_option, 0 },
    { "block", s_space, 0 },
    { "extcondcode", arc_extoper, 0 },
    { "extcoreregister", arc_extoper, 1 },
*************** const pseudo_typeS md_pseudo_table[] = {
*** 96,102 ****
  };

  /* This array holds the chars that always start a comment.  If the
!    pre-processor is disabled, these aren't very useful */
  const char comment_chars[] = "#;";

  /* This array holds the chars that only start a comment at the beginning of
--- 97,103 ----
  };

  /* This array holds the chars that always start a comment.  If the
!    pre-processor is disabled, these aren't very useful.  */
  const char comment_chars[] = "#;";

  /* This array holds the chars that only start a comment at the beginning of
*************** const char line_comment_chars[] = "#";
*** 111,122 ****

  const char line_separator_chars[] = "";

! /* Chars that can be used to separate mant from exp in floating point nums */
  const char EXP_CHARS[] = "eE";

! /* Chars that mean this number is a floating point constant */
! /* As in 0f12.456 */
! /* or    0d1.2345e12 */
  const char FLT_CHARS[] = "rRsSfFdD";

  /* Byte order.  */
--- 112,122 ----

  const char line_separator_chars[] = "";

! /* Chars that can be used to separate mant from exp in floating point nums.  */
  const char EXP_CHARS[] = "eE";

! /* Chars that mean this number is a floating point constant
!    As in 0f12.456 or 0d1.2345e12.  */
  const char FLT_CHARS[] = "rRsSfFdD";

  /* Byte order.  */
*************** static int byte_order = DEFAULT_BYTE_ORD
*** 127,139 ****
  static segT arcext_section;

  /* One of bfd_mach_arc_n.  */
! static int arc_mach_type = bfd_mach_arc_5;

  /* Non-zero if the cpu type has been explicitly specified.  */
  static int mach_type_specified_p = 0;

  /* Non-zero if opcode tables have been initialized.
!    A .cpu command must appear before any instructions.  */
  static int cpu_tables_init_p = 0;

  static struct hash_control *arc_suffix_hash = NULL;
--- 127,139 ----
  static segT arcext_section;

  /* One of bfd_mach_arc_n.  */
! static int arc_mach_type = bfd_mach_arc_6;

  /* Non-zero if the cpu type has been explicitly specified.  */
  static int mach_type_specified_p = 0;

  /* Non-zero if opcode tables have been initialized.
!    A .option command must appear before any instructions.  */
  static int cpu_tables_init_p = 0;

  static struct hash_control *arc_suffix_hash = NULL;
*************** static struct hash_control *arc_suffix_h
*** 141,159 ****
  const char *md_shortopts = "";
  struct option md_longopts[] = {
  #define OPTION_EB (OPTION_MD_BASE + 0)
!   {"EB", no_argument, NULL, OPTION_EB},
  #define OPTION_EL (OPTION_MD_BASE + 1)
!   {"EL", no_argument, NULL, OPTION_EL},
  #define OPTION_ARC5 (OPTION_MD_BASE + 2)
!   {"marc5", no_argument, NULL, OPTION_ARC5},
  #define OPTION_ARC6 (OPTION_MD_BASE + 3)
!   {"marc6", no_argument, NULL, OPTION_ARC6},
  #define OPTION_ARC7 (OPTION_MD_BASE + 4)
!   {"marc7", no_argument, NULL, OPTION_ARC7},
  #define OPTION_ARC8 (OPTION_MD_BASE + 5)
!   {"marc8", no_argument, NULL, OPTION_ARC8},
  #define OPTION_ARC (OPTION_MD_BASE + 6)
!   {"marc", no_argument, NULL, OPTION_ARC},
    { NULL, no_argument, NULL, 0 }
  };
  size_t md_longopts_size = sizeof (md_longopts);
--- 141,160 ----
  const char *md_shortopts = "";
  struct option md_longopts[] = {
  #define OPTION_EB (OPTION_MD_BASE + 0)
!   { "EB", no_argument, NULL, OPTION_EB },
  #define OPTION_EL (OPTION_MD_BASE + 1)
!   { "EL", no_argument, NULL, OPTION_EL },
  #define OPTION_ARC5 (OPTION_MD_BASE + 2)
!   { "marc5", no_argument, NULL, OPTION_ARC5 },
!   { "pre-v6", no_argument, NULL, OPTION_ARC5 },
  #define OPTION_ARC6 (OPTION_MD_BASE + 3)
!   { "marc6", no_argument, NULL, OPTION_ARC6 },
  #define OPTION_ARC7 (OPTION_MD_BASE + 4)
!   { "marc7", no_argument, NULL, OPTION_ARC7 },
  #define OPTION_ARC8 (OPTION_MD_BASE + 5)
!   { "marc8", no_argument, NULL, OPTION_ARC8 },
  #define OPTION_ARC (OPTION_MD_BASE + 6)
!   { "marc", no_argument, NULL, OPTION_ARC },
    { NULL, no_argument, NULL, 0 }
  };
  size_t md_longopts_size = sizeof (md_longopts);
*************** md_parse_option (c, arg)
*** 173,182 ****
  {
    switch (c)
      {
-     case OPTION_ARC:
      case OPTION_ARC5:
        arc_mach_type = bfd_mach_arc_5;
        break;
      case OPTION_ARC6:
        arc_mach_type = bfd_mach_arc_6;
        break;
--- 174,183 ----
  {
    switch (c)
      {
      case OPTION_ARC5:
        arc_mach_type = bfd_mach_arc_5;
        break;
+     case OPTION_ARC:
      case OPTION_ARC6:
        arc_mach_type = bfd_mach_arc_6;
        break;
*************** ARC Options:\n\
*** 213,219 ****

  /* This function is called once, at assembler startup time.  It should
     set up all the tables, etc. that the MD part of the assembler will need.
!    Opcode selection is defered until later because we might see a .cpu
     command.  */

  void
--- 214,220 ----

  /* This function is called once, at assembler startup time.  It should
     set up all the tables, etc. that the MD part of the assembler will need.
!    Opcode selection is defered until later because we might see a .option
     command.  */

  void
*************** md_begin ()
*** 225,240 ****
    if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, arc_mach_type))
      as_warn ("could not set architecture and machine");

!   /* This call is necessary because we need to
!      initialize `arc_operand_map' which may be needed before we see the
!      first insn.  */
    arc_opcode_init_tables (arc_get_opcode_mach (arc_mach_type,
                                target_big_endian));
  }

  /* Initialize the various opcode and operand tables.
     MACH is one of bfd_mach_arc_xxx.  */
-
  static void
  init_opcode_tables (mach)
       int mach;
--- 226,239 ----
    if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, arc_mach_type))
      as_warn ("could not set architecture and machine");

!   /* This call is necessary because we need to initialize `arc_operand_map'
!      which may be needed before we see the first insn.  */
    arc_opcode_init_tables (arc_get_opcode_mach (arc_mach_type,
                                target_big_endian));
  }

  /* Initialize the various opcode and operand tables.
     MACH is one of bfd_mach_arc_xxx.  */
  static void
  init_opcode_tables (mach)
       int mach;
*************** arc_insert_operand (insn, operand, mods,
*** 356,362 ****
     that would screw up references to ``.''.  */

  struct arc_fixup {
!   /* index into `arc_operands' */
    int opindex;
    expressionS exp;
  };
--- 355,361 ----
     that would screw up references to ``.''.  */

  struct arc_fixup {
!   /* index into `arc_operands'  */
    int opindex;
    expressionS exp;
  };
*************** md_assemble (str)
*** 380,386 ****
    static int init_tables_p = 0;

    /* Opcode table initialization is deferred until here because we have to
!      wait for a possible .cpu command.  */
    if (!init_tables_p)
      {
        init_opcode_tables (arc_mach_type);
--- 379,385 ----
    static int init_tables_p = 0;

    /* Opcode table initialization is deferred until here because we have to
!      wait for a possible .option command.  */
    if (!init_tables_p)
      {
        init_opcode_tables (arc_mach_type);
*************** arc_extoper (opertype)
*** 911,917 ****
        p++;
      }

!   /* just after name is now '\0' */
    p = input_line_pointer;
    *p = c;
    SKIP_WHITESPACE ();
--- 910,916 ----
        p++;
      }

!   /* just after name is now '\0'  */
    p = input_line_pointer;
    *p = c;
    SKIP_WHITESPACE ();
*************** arc_extoper (opertype)
*** 924,930 ****
        return;
      }

!   input_line_pointer++;          /* skip ',' */
    number = get_absolute_expression ();

    if (number < 0)
--- 923,929 ----
        return;
      }

!   input_line_pointer++;     /* skip ','  */
    number = get_absolute_expression ();

    if (number < 0)
*************** arc_extoper (opertype)
*** 947,953 ****
       return;
     }

!       input_line_pointer++;      /* skip ',' */
        mode = input_line_pointer;

        if (!strncmp (mode, "r|w", 3))
--- 946,952 ----
       return;
     }

!       input_line_pointer++; /* skip ','  */
        mode = input_line_pointer;

        if (!strncmp (mode, "r|w", 3))
*************** arc_extoper (opertype)
*** 989,995 ****
           return;
         }

!      input_line_pointer++;             /* skip ',' */

       if (!strncmp (input_line_pointer, "cannot_shortcut", 15))
         {
--- 988,994 ----
           return;
         }

!      input_line_pointer++; /* skip ','  */

       if (!strncmp (input_line_pointer, "cannot_shortcut", 15))
         {
*************** arc_extinst (ignore)
*** 1154,1160 ****
    strcpy (syntax, name);
    name_len = strlen (name);

!   /* just after name is now '\0' */
    p = input_line_pointer;
    *p = c;

--- 1153,1159 ----
    strcpy (syntax, name);
    name_len = strlen (name);

!   /* just after name is now '\0'  */
    p = input_line_pointer;
    *p = c;

*************** arc_extinst (ignore)
*** 1167,1173 ****
        return;
      }

!   input_line_pointer++;          /* skip ',' */
    opcode = get_absolute_expression ();

    SKIP_WHITESPACE ();
--- 1166,1172 ----
        return;
      }

!   input_line_pointer++; /* skip ','  */
    opcode = get_absolute_expression ();

    SKIP_WHITESPACE ();
*************** arc_extinst (ignore)
*** 1179,1185 ****
        return;
      }

!   input_line_pointer++;          /* skip ',' */
    subopcode = get_absolute_expression ();

    if (subopcode < 0)
--- 1178,1184 ----
        return;
      }

!   input_line_pointer++;     /* skip ','  */
    subopcode = get_absolute_expression ();

    if (subopcode < 0)
*************** arc_extinst (ignore)
*** 1217,1223 ****
        return;
      }

!   input_line_pointer++;         /* skip ',' */

    for (i = 0; i < (int) MAXSUFFIXCLASS; i++)
      {
--- 1216,1222 ----
        return;
      }

!   input_line_pointer++; /* skip ','  */

    for (i = 0; i < (int) MAXSUFFIXCLASS; i++)
      {
*************** arc_extinst (ignore)
*** 1245,1251 ****
        return;
      }

!   input_line_pointer++;         /* skip ',' */

    for (i = 0; i < (int) MAXSYNTAXCLASS; i++)
      {
--- 1244,1250 ----
        return;
      }

!   input_line_pointer++; /* skip ','  */

    for (i = 0; i < (int) MAXSYNTAXCLASS; i++)
      {
*************** arc_common (localScope)
*** 1372,1378 ****

    name = input_line_pointer;
    c = get_symbol_end ();
!   /* just after name is now '\0' */
    p = input_line_pointer;
    *p = c;
    SKIP_WHITESPACE ();
--- 1371,1377 ----

    name = input_line_pointer;
    c = get_symbol_end ();
!   /* just after name is now '\0'  */
    p = input_line_pointer;
    *p = c;
    SKIP_WHITESPACE ();
*************** arc_common (localScope)
*** 1384,1390 ****
        return;
      }

!   input_line_pointer++;          /* skip ',' */
    size = get_absolute_expression ();

    if (size < 0)
--- 1383,1389 ----
        return;
      }

!   input_line_pointer++;     /* skip ','  */
    size = get_absolute_expression ();

    if (size < 0)
*************** arc_common (localScope)
*** 1436,1442 ****
        old_sec    = now_seg;
        old_subsec = now_subseg;
        record_alignment (bss_section, align);
!       subseg_set (bss_section, 0);  /* ??? subseg_set (bss_section, 1); ??? */

        if (align)
     /* Do alignment.  */
--- 1435,1441 ----
        old_sec    = now_seg;
        old_subsec = now_subseg;
        record_alignment (bss_section, align);
!       subseg_set (bss_section, 0);  /* ??? subseg_set (bss_section, 1); ???  */

        if (align)
     /* Do alignment.  */
*************** arc_code_symbol (expressionP)
*** 1635,1641 ****
        two.X_add_number = 2;
        expressionP->X_op_symbol = make_expr_symbol (&two);
      }
!   /* Allow %st(sym1-sym2) */
    else if (expressionP->X_op == O_subtract
        && expressionP->X_add_symbol != NULL
        && expressionP->X_op_symbol != NULL
--- 1634,1640 ----
        two.X_add_number = 2;
        expressionP->X_op_symbol = make_expr_symbol (&two);
      }
!   /* Allow %st(sym1-sym2)  */
    else if (expressionP->X_op == O_subtract
        && expressionP->X_add_symbol != NULL
        && expressionP->X_op_symbol != NULL
*************** md_operand (expressionP)
*** 1686,1692 ****
     arc_code_symbol (expressionP);
        }
      else
!       {       /* It could be a register.  */
     int i, l;
     struct arc_ext_operand_value *ext_oper = arc_ext_operands;
     p++;
--- 1685,1691 ----
     arc_code_symbol (expressionP);
        }
      else
!       { /* It could be a register.  */
     int i, l;
     struct arc_ext_operand_value *ext_oper = arc_ext_operands;
     p++;
Index: gas/doc/c-arc.texi
===================================================================
RCS file: /cvs/src/src/gas/doc/c-arc.texi,v
retrieving revision 1.1
diff -c -3 -p -r1.1 c-arc.texi
*** c-arc.texi 2001/01/12 17:50:59 1.1
--- c-arc.texi 2001/01/15 11:32:29
***************
*** 13,19 ****
  @chapter ARC Dependent Features
  @end ifclear

! @set ARC_CORE_DEFAULT 5

  @cindex ARC support
  @menu
--- 13,19 ----
  @chapter ARC Dependent Features
  @end ifclear

! @set ARC_CORE_DEFAULT 6

  @cindex ARC support
  @menu
Index: opcodes/arc-opc.c
===================================================================
RCS file: /cvs/src/src/opcodes/arc-opc.c,v
retrieving revision 1.3
diff -c -3 -p -r1.3 arc-opc.c
*** arc-opc.c  2001/01/11 21:20:19 1.3
--- arc-opc.c  2001/01/15 11:32:30
***************
*** 1,5 ****
  /* Opcode table for the ARC.
!    Copyright 1994, 1995, 1997, 1998, 2000 Free Software Foundation, Inc.
     Contributed by Doug Evans (dje@cygnus.com).

     This program is free software; you can redistribute it and/or modify
--- 1,5 ----
  /* Opcode table for the ARC.
!    Copyright 1994, 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
     Contributed by Doug Evans (dje@cygnus.com).

     This program is free software; you can redistribute it and/or modify
*************** const struct arc_operand_value arc_reg_n
*** 381,387 ****
    { "r59", 59, REG, 0 },

    /* Loop count register (24 bits).  */
!   { "lp_count", 60, REG, ARC_REGISTER_READONLY },
    /* Short immediate data indicator setting flags.  */
    { "r61", 61, REG, ARC_REGISTER_READONLY },
    /* Long immediate data indicator setting flags.  */
--- 381,387 ----
    { "r59", 59, REG, 0 },

    /* Loop count register (24 bits).  */
!   { "lp_count", 60, REG, 0 },
    /* Short immediate data indicator setting flags.  */
    { "r61", 61, REG, ARC_REGISTER_READONLY },
    /* Long immediate data indicator setting flags.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]