diff options
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 18 | ||||
-rw-r--r-- | gas/config/tc-arc.c | 86 | ||||
-rw-r--r-- | gas/config/tc-arc.h | 2 | ||||
-rw-r--r-- | gas/doc/c-arc.texi | 2 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/st.d | 10 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/st.s | 6 |
7 files changed, 86 insertions, 43 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 21e5209..f0de913 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,21 @@ +2001-05-12 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. Add .file and .line for dwarf2 support. + (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. + (arc_code_symbol): Make symbol value for @h30 fixup expression + equal to O_constant. + (md_assemble): Call dwarf2_emit_insn. + Include "dwarf2dbg2.h". Formatting fixes throughout file. + * config/tc-arc.h (DWARF2_LINE_MIN_INSN_LENGTH): Define. + + * doc/c-arc.texi (ARC_CORE_DEFAULT): Update to new default. + 2001-05-11 Jakub Jelinek <jakub@redhat.com> * config/tc-ia64.c (special_linkonce_name): New. diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c index 778b24c..3cbd3c0 100644 --- a/gas/config/tc-arc.c +++ b/gas/config/tc-arc.c @@ -28,6 +28,7 @@ #include "opcode/arc.h" #include "../opcodes/arc-ext.h" #include "elf/arc.h" +#include "dwarf2dbg.h" extern int arc_get_mach PARAMS ((char *)); extern int arc_operand_type PARAMS ((int)); @@ -76,7 +77,7 @@ const struct syntax_classes { #define MAXSYNTAXCLASS (sizeof (syntaxclass) / sizeof (struct syntax_classes)) const pseudo_typeS md_pseudo_table[] = { - { "align", s_align_bytes, 0 }, /* Defaulting is invalid (0) */ + { "align", s_align_bytes, 0 }, /* Defaulting is invalid (0). */ { "comm", arc_common, 0 }, { "common", arc_common, 0 }, { "lcomm", arc_common, 1 }, @@ -88,7 +89,10 @@ const pseudo_typeS md_pseudo_table[] = { { "4byte", cons, 4 }, { "word", cons, 4 }, { "option", arc_option, 0 }, + { "cpu", arc_option, 0 }, { "block", s_space, 0 }, + { "file", dwarf2_directive_file, 0 }, + { "loc", dwarf2_directive_loc, 0 }, { "extcondcode", arc_extoper, 0 }, { "extcoreregister", arc_extoper, 1 }, { "extauxregister", arc_extoper, 2 }, @@ -97,7 +101,7 @@ const pseudo_typeS md_pseudo_table[] = { }; /* This array holds the chars that always start a comment. If the - pre-processor is disabled, these aren't very useful */ + 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 @@ -112,12 +116,11 @@ const char line_comment_chars[] = "#"; const char line_separator_chars[] = ""; -/* Chars that can be used to separate mant from exp in floating point nums */ +/* 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 */ +/* Chars that mean this number is a floating point constant + As in 0f12.456 or 0d1.2345e12. */ const char FLT_CHARS[] = "rRsSfFdD"; /* Byte order. */ @@ -128,13 +131,13 @@ static int byte_order = DEFAULT_BYTE_ORDER; static segT arcext_section; /* One of bfd_mach_arc_n. */ -static int arc_mach_type = bfd_mach_arc_5; +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 .cpu command must appear before any instructions. */ + A .option command must appear before any instructions. */ static int cpu_tables_init_p = 0; static struct hash_control *arc_suffix_hash = NULL; @@ -142,19 +145,20 @@ static struct hash_control *arc_suffix_hash = NULL; const char *md_shortopts = ""; struct option md_longopts[] = { #define OPTION_EB (OPTION_MD_BASE + 0) - {"EB", no_argument, NULL, OPTION_EB}, + { "EB", no_argument, NULL, OPTION_EB }, #define OPTION_EL (OPTION_MD_BASE + 1) - {"EL", no_argument, NULL, OPTION_EL}, + { "EL", no_argument, NULL, OPTION_EL }, #define OPTION_ARC5 (OPTION_MD_BASE + 2) - {"marc5", no_argument, NULL, OPTION_ARC5}, + { "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}, + { "marc6", no_argument, NULL, OPTION_ARC6 }, #define OPTION_ARC7 (OPTION_MD_BASE + 4) - {"marc7", no_argument, NULL, OPTION_ARC7}, + { "marc7", no_argument, NULL, OPTION_ARC7 }, #define OPTION_ARC8 (OPTION_MD_BASE + 5) - {"marc8", no_argument, NULL, OPTION_ARC8}, + { "marc8", no_argument, NULL, OPTION_ARC8 }, #define OPTION_ARC (OPTION_MD_BASE + 6) - {"marc", no_argument, NULL, OPTION_ARC}, + { "marc", no_argument, NULL, OPTION_ARC }, { NULL, no_argument, NULL, 0 } }; size_t md_longopts_size = sizeof (md_longopts); @@ -174,10 +178,10 @@ md_parse_option (c, arg) { switch (c) { - case OPTION_ARC: 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; @@ -214,7 +218,7 @@ ARC Options:\n\ /* 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 + Opcode selection is deferred until later because we might see a .option command. */ void @@ -226,16 +230,14 @@ md_begin () 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. */ + /* 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; @@ -277,8 +279,10 @@ init_opcode_tables (mach) continue; /* Use symbol_create here instead of symbol_new so we don't try to output registers into the object file's symbol table. */ - symbol_table_insert (symbol_create (arc_reg_names[i].name, reg_section, - (int) &arc_reg_names[i], &zero_address_frag)); + symbol_table_insert (symbol_create (arc_reg_names[i].name, + reg_section, + (int) &arc_reg_names[i], + &zero_address_frag)); } /* Tell `.option' it's too late. */ @@ -357,7 +361,7 @@ arc_insert_operand (insn, operand, mods, reg, val, file, line) that would screw up references to ``.''. */ struct arc_fixup { - /* index into `arc_operands' */ + /* index into `arc_operands' */ int opindex; expressionS exp; }; @@ -381,7 +385,7 @@ md_assemble (str) static int init_tables_p = 0; /* Opcode table initialization is deferred until here because we have to - wait for a possible .cpu command. */ + wait for a possible .option command. */ if (!init_tables_p) { init_opcode_tables (arc_mach_type); @@ -866,6 +870,8 @@ md_assemble (str) (bfd_reloc_code_real_type) reloc_type); } + dwarf2_emit_insn (4); + /* All done. */ return; } @@ -912,7 +918,7 @@ arc_extoper (opertype) p++; } - /* just after name is now '\0' */ + /* just after name is now '\0' */ p = input_line_pointer; *p = c; SKIP_WHITESPACE (); @@ -925,7 +931,7 @@ arc_extoper (opertype) return; } - input_line_pointer++; /* skip ',' */ + input_line_pointer++; /* skip ',' */ number = get_absolute_expression (); if (number < 0) @@ -948,7 +954,7 @@ arc_extoper (opertype) return; } - input_line_pointer++; /* skip ',' */ + input_line_pointer++; /* skip ',' */ mode = input_line_pointer; if (!strncmp (mode, "r|w", 3)) @@ -990,7 +996,7 @@ arc_extoper (opertype) return; } - input_line_pointer++; /* skip ',' */ + input_line_pointer++; /* skip ',' */ if (!strncmp (input_line_pointer, "cannot_shortcut", 15)) { @@ -1155,7 +1161,7 @@ arc_extinst (ignore) strcpy (syntax, name); name_len = strlen (name); - /* just after name is now '\0' */ + /* just after name is now '\0' */ p = input_line_pointer; *p = c; @@ -1168,7 +1174,7 @@ arc_extinst (ignore) return; } - input_line_pointer++; /* skip ',' */ + input_line_pointer++; /* skip ',' */ opcode = get_absolute_expression (); SKIP_WHITESPACE (); @@ -1180,7 +1186,7 @@ arc_extinst (ignore) return; } - input_line_pointer++; /* skip ',' */ + input_line_pointer++; /* skip ',' */ subopcode = get_absolute_expression (); if (subopcode < 0) @@ -1218,7 +1224,7 @@ arc_extinst (ignore) return; } - input_line_pointer++; /* skip ',' */ + input_line_pointer++; /* skip ',' */ for (i = 0; i < (int) MAXSUFFIXCLASS; i++) { @@ -1246,7 +1252,7 @@ arc_extinst (ignore) return; } - input_line_pointer++; /* skip ',' */ + input_line_pointer++; /* skip ',' */ for (i = 0; i < (int) MAXSYNTAXCLASS; i++) { @@ -1373,7 +1379,7 @@ arc_common (localScope) name = input_line_pointer; c = get_symbol_end (); - /* just after name is now '\0' */ + /* just after name is now '\0' */ p = input_line_pointer; *p = c; SKIP_WHITESPACE (); @@ -1385,7 +1391,7 @@ arc_common (localScope) return; } - input_line_pointer++; /* skip ',' */ + input_line_pointer++; /* skip ',' */ size = get_absolute_expression (); if (size < 0) @@ -1437,7 +1443,7 @@ arc_common (localScope) old_sec = now_seg; old_subsec = now_subseg; record_alignment (bss_section, align); - subseg_set (bss_section, 0); /* ??? subseg_set (bss_section, 1); ??? */ + subseg_set (bss_section, 0); /* ??? subseg_set (bss_section, 1); ??? */ if (align) /* Do alignment. */ @@ -1631,12 +1637,13 @@ arc_code_symbol (expressionP) { expressionS two; expressionP->X_op = O_right_shift; + expressionP->X_add_symbol->sy_value.X_op = O_constant; two.X_op = O_constant; two.X_add_symbol = two.X_op_symbol = NULL; two.X_add_number = 2; expressionP->X_op_symbol = make_expr_symbol (&two); } - /* Allow %st(sym1-sym2) */ + /* Allow %st(sym1-sym2) */ else if (expressionP->X_op == O_subtract && expressionP->X_add_symbol != NULL && expressionP->X_op_symbol != NULL @@ -1687,7 +1694,8 @@ md_operand (expressionP) arc_code_symbol (expressionP); } else - { /* It could be a register. */ + { + /* It could be a register. */ int i, l; struct arc_ext_operand_value *ext_oper = arc_ext_operands; p++; diff --git a/gas/config/tc-arc.h b/gas/config/tc-arc.h index 2aa790b..463400c 100644 --- a/gas/config/tc-arc.h +++ b/gas/config/tc-arc.h @@ -66,3 +66,5 @@ arc_parse_cons_expression (EXP, NBYTES) extern void arc_cons_fix_new (); #define TC_CONS_FIX_NEW(FRAG, WHERE, NBYTES, EXP) \ arc_cons_fix_new (FRAG, WHERE, NBYTES, EXP) + +#define DWARF2_LINE_MIN_INSN_LENGTH 4 diff --git a/gas/doc/c-arc.texi b/gas/doc/c-arc.texi index 56822de..700a01d 100644 --- a/gas/doc/c-arc.texi +++ b/gas/doc/c-arc.texi @@ -13,7 +13,7 @@ @chapter ARC Dependent Features @end ifclear -@set ARC_CORE_DEFAULT 5 +@set ARC_CORE_DEFAULT 6 @cindex ARC support @menu diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 5178586..0d688e9 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2001-05-12 Peter Targett <peter.targett@arccores.com> + + * gas/arc/st.s: Add test case @h30 fixup. + * gas/arc/st.d: Update to suit. + 2001-05-12 Alan Modra <amodra@one.net.au> * gas/i386/sse2.s: Correct cvtps2dq, movdq2q, and movq2dq diff --git a/gas/testsuite/gas/arc/st.d b/gas/testsuite/gas/arc/st.d index 0ed6b80..65ee840 100644 --- a/gas/testsuite/gas/arc/st.d +++ b/gas/testsuite/gas/arc/st.d @@ -23,5 +23,11 @@ Disassembly of section .text: 34: 02 02 01 14 14010202 st.di r1,\[r2,2\] 38: 03 02 01 15 15010203 st.a.di r1,\[r2,3\] 3c: 04 02 81 15 15810204 stw.a.di r1,\[r2,4\] - 40: 00 02 01 12 12010200 sr r1,\[r2\] - 44: 0e 82 1f 12 121f820e sr r1,\[0xe\] + 40: 04 7c 06 10 10067c04 st 80,\[r12,4\] + 44: 50 00 00 00 + 44: R_ARC_32 .text + 48: 04 7c 06 10 10067c04 st 20,\[r12,4\] + 4c: 14 00 00 00 + 4c: R_ARC_B26 .text + 50: 00 02 01 12 12010200 sr r1,\[r2\] + 54: 0e 82 1f 12 121f820e sr r1,\[0xe\] diff --git a/gas/testsuite/gas/arc/st.s b/gas/testsuite/gas/arc/st.s index 2754d27..38ba009 100644 --- a/gas/testsuite/gas/arc/st.s +++ b/gas/testsuite/gas/arc/st.s @@ -13,6 +13,10 @@ st.di r1,[r2,2] st.a.di r1,[r2,3] stw.a.di r1,[r2,4] - + + st .L1,[r12,4] + st .L1@h30,[r12,4] +.L1: + sr r1,[r2] sr r1,[14] |