Peter Targett's backwards compatibility and other arc fixes.

This commit is contained in:
Alan Modra 2001-05-12 15:14:53 +00:00
parent 4bba68155d
commit bcee8eb8ca
12 changed files with 253 additions and 193 deletions

View File

@ -1,3 +1,13 @@
2001-05-12 Peter Targett <peter.targett@arccores.com>
* 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.
* elf32-arc.c (arc_elf_object_p): Make E_ARC_MACH_ARC6 default
architecture.
(arc_elf_final_write_processing): Make bfd_mach_arc_6 default.
2001-05-11 Jakub Jelinek <jakub@redhat.com> 2001-05-11 Jakub Jelinek <jakub@redhat.com>
* elfxx-ia64.c (is_unwind_section_name): Consider linkonce unwind * elfxx-ia64.c (is_unwind_section_name): Consider linkonce unwind

View File

@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
print_name, \ print_name, \
4, /* section alignment power */ \ 4, /* section alignment power */ \
default_p, \ default_p, \
bfd_default_compatible, \ bfd_default_compatible, \
bfd_default_scan, \ bfd_default_scan, \
next, \ next, \
} }
@ -41,13 +41,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static const bfd_arch_info_type arch_info_struct[] = 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, "arc5", false, &arch_info_struct[1] ),
ARC ( bfd_mach_arc_6, "arc6", false, &arch_info_struct[2] ), ARC ( bfd_mach_arc_5, "base", false, &arch_info_struct[2] ),
ARC ( bfd_mach_arc_7, "arc7", false, &arch_info_struct[3] ), 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 ), ARC ( bfd_mach_arc_8, "arc8", false, NULL ),
}; };
const bfd_arch_info_type bfd_arc_arch = const bfd_arch_info_type bfd_arc_arch =
ARC ( bfd_mach_arc_5, "arc", true, &arch_info_struct[0] ); ARC ( bfd_mach_arc_6, "arc", true, &arch_info_struct[0] );
/* Utility routines. */ /* Utility routines. */

View File

@ -57,18 +57,18 @@ static reloc_howto_type elf_arc_howto_table[] =
/* A standard 32 bit relocation. */ /* A standard 32 bit relocation. */
HOWTO (R_ARC_32, /* type */ HOWTO (R_ARC_32, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ false, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */ bfd_elf_generic_reloc, /* special_function */
"R_ARC_32", /* name */ "R_ARC_32", /* name */
false, /* partial_inplace */ false, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ false), /* pcrel_offset */
/* A 26 bit absolute branch, right shifted by 2. */ /* A 26 bit absolute branch, right shifted by 2. */
HOWTO (R_ARC_B26, /* type */ HOWTO (R_ARC_B26, /* type */
@ -155,7 +155,7 @@ static boolean
arc_elf_object_p (abfd) arc_elf_object_p (abfd)
bfd *abfd; bfd *abfd;
{ {
int mach = bfd_mach_arc_5; int mach = bfd_mach_arc_6;
if (elf_elfheader(abfd)->e_machine == EM_ARC) if (elf_elfheader(abfd)->e_machine == EM_ARC)
{ {
@ -163,10 +163,10 @@ arc_elf_object_p (abfd)
switch (arch) switch (arch)
{ {
default:
case E_ARC_MACH_ARC5: case E_ARC_MACH_ARC5:
mach = bfd_mach_arc_5; mach = bfd_mach_arc_5;
break; break;
default:
case E_ARC_MACH_ARC6: case E_ARC_MACH_ARC6:
mach = bfd_mach_arc_6; mach = bfd_mach_arc_6;
break; break;
@ -193,10 +193,10 @@ arc_elf_final_write_processing (abfd, linker)
switch (bfd_get_mach (abfd)) switch (bfd_get_mach (abfd))
{ {
default:
case bfd_mach_arc_5: case bfd_mach_arc_5:
val = E_ARC_MACH_ARC5; val = E_ARC_MACH_ARC5;
break; break;
default:
case bfd_mach_arc_6: case bfd_mach_arc_6:
val = E_ARC_MACH_ARC6; val = E_ARC_MACH_ARC6;
break; break;

View File

@ -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> 2001-05-11 Jakub Jelinek <jakub@redhat.com>
* config/tc-ia64.c (special_linkonce_name): New. * config/tc-ia64.c (special_linkonce_name): New.

View File

@ -28,6 +28,7 @@
#include "opcode/arc.h" #include "opcode/arc.h"
#include "../opcodes/arc-ext.h" #include "../opcodes/arc-ext.h"
#include "elf/arc.h" #include "elf/arc.h"
#include "dwarf2dbg.h"
extern int arc_get_mach PARAMS ((char *)); extern int arc_get_mach PARAMS ((char *));
extern int arc_operand_type PARAMS ((int)); extern int arc_operand_type PARAMS ((int));
@ -76,7 +77,7 @@ const struct syntax_classes {
#define MAXSYNTAXCLASS (sizeof (syntaxclass) / sizeof (struct syntax_classes)) #define MAXSYNTAXCLASS (sizeof (syntaxclass) / sizeof (struct syntax_classes))
const pseudo_typeS md_pseudo_table[] = { 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 }, { "comm", arc_common, 0 },
{ "common", arc_common, 0 }, { "common", arc_common, 0 },
{ "lcomm", arc_common, 1 }, { "lcomm", arc_common, 1 },
@ -88,7 +89,10 @@ const pseudo_typeS md_pseudo_table[] = {
{ "4byte", cons, 4 }, { "4byte", cons, 4 },
{ "word", cons, 4 }, { "word", cons, 4 },
{ "option", arc_option, 0 }, { "option", arc_option, 0 },
{ "cpu", arc_option, 0 },
{ "block", s_space, 0 }, { "block", s_space, 0 },
{ "file", dwarf2_directive_file, 0 },
{ "loc", dwarf2_directive_loc, 0 },
{ "extcondcode", arc_extoper, 0 }, { "extcondcode", arc_extoper, 0 },
{ "extcoreregister", arc_extoper, 1 }, { "extcoreregister", arc_extoper, 1 },
{ "extauxregister", arc_extoper, 2 }, { "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 /* 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[] = "#;"; const char comment_chars[] = "#;";
/* This array holds the chars that only start a comment at the beginning of /* 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[] = ""; 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"; const char EXP_CHARS[] = "eE";
/* Chars that mean this number is a floating point constant */ /* Chars that mean this number is a floating point constant
/* As in 0f12.456 */ As in 0f12.456 or 0d1.2345e12. */
/* or 0d1.2345e12 */
const char FLT_CHARS[] = "rRsSfFdD"; const char FLT_CHARS[] = "rRsSfFdD";
/* Byte order. */ /* Byte order. */
@ -128,13 +131,13 @@ static int byte_order = DEFAULT_BYTE_ORDER;
static segT arcext_section; static segT arcext_section;
/* One of bfd_mach_arc_n. */ /* 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. */ /* Non-zero if the cpu type has been explicitly specified. */
static int mach_type_specified_p = 0; static int mach_type_specified_p = 0;
/* Non-zero if opcode tables have been initialized. /* 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 int cpu_tables_init_p = 0;
static struct hash_control *arc_suffix_hash = NULL; static struct hash_control *arc_suffix_hash = NULL;
@ -142,19 +145,20 @@ static struct hash_control *arc_suffix_hash = NULL;
const char *md_shortopts = ""; const char *md_shortopts = "";
struct option md_longopts[] = { struct option md_longopts[] = {
#define OPTION_EB (OPTION_MD_BASE + 0) #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) #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) #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) #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) #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) #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) #define OPTION_ARC (OPTION_MD_BASE + 6)
{"marc", no_argument, NULL, OPTION_ARC}, { "marc", no_argument, NULL, OPTION_ARC },
{ NULL, no_argument, NULL, 0 } { NULL, no_argument, NULL, 0 }
}; };
size_t md_longopts_size = sizeof (md_longopts); size_t md_longopts_size = sizeof (md_longopts);
@ -174,10 +178,10 @@ md_parse_option (c, arg)
{ {
switch (c) switch (c)
{ {
case OPTION_ARC:
case OPTION_ARC5: case OPTION_ARC5:
arc_mach_type = bfd_mach_arc_5; arc_mach_type = bfd_mach_arc_5;
break; break;
case OPTION_ARC:
case OPTION_ARC6: case OPTION_ARC6:
arc_mach_type = bfd_mach_arc_6; arc_mach_type = bfd_mach_arc_6;
break; break;
@ -214,7 +218,7 @@ ARC Options:\n\
/* This function is called once, at assembler startup time. It should /* 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. 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. */ command. */
void void
@ -226,16 +230,14 @@ md_begin ()
if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, arc_mach_type)) if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, arc_mach_type))
as_warn ("could not set architecture and machine"); as_warn ("could not set architecture and machine");
/* This call is necessary because we need to /* This call is necessary because we need to initialize `arc_operand_map'
initialize `arc_operand_map' which may be needed before we see the which may be needed before we see the first insn. */
first insn. */
arc_opcode_init_tables (arc_get_opcode_mach (arc_mach_type, arc_opcode_init_tables (arc_get_opcode_mach (arc_mach_type,
target_big_endian)); target_big_endian));
} }
/* Initialize the various opcode and operand tables. /* Initialize the various opcode and operand tables.
MACH is one of bfd_mach_arc_xxx. */ MACH is one of bfd_mach_arc_xxx. */
static void static void
init_opcode_tables (mach) init_opcode_tables (mach)
int mach; int mach;
@ -277,8 +279,10 @@ init_opcode_tables (mach)
continue; continue;
/* Use symbol_create here instead of symbol_new so we don't try to /* Use symbol_create here instead of symbol_new so we don't try to
output registers into the object file's symbol table. */ output registers into the object file's symbol table. */
symbol_table_insert (symbol_create (arc_reg_names[i].name, reg_section, symbol_table_insert (symbol_create (arc_reg_names[i].name,
(int) &arc_reg_names[i], &zero_address_frag)); reg_section,
(int) &arc_reg_names[i],
&zero_address_frag));
} }
/* Tell `.option' it's too late. */ /* 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 ``.''. */ that would screw up references to ``.''. */
struct arc_fixup { struct arc_fixup {
/* index into `arc_operands' */ /* index into `arc_operands' */
int opindex; int opindex;
expressionS exp; expressionS exp;
}; };
@ -381,7 +385,7 @@ md_assemble (str)
static int init_tables_p = 0; static int init_tables_p = 0;
/* Opcode table initialization is deferred until here because we have to /* 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) if (!init_tables_p)
{ {
init_opcode_tables (arc_mach_type); init_opcode_tables (arc_mach_type);
@ -866,6 +870,8 @@ md_assemble (str)
(bfd_reloc_code_real_type) reloc_type); (bfd_reloc_code_real_type) reloc_type);
} }
dwarf2_emit_insn (4);
/* All done. */ /* All done. */
return; return;
} }
@ -912,7 +918,7 @@ arc_extoper (opertype)
p++; p++;
} }
/* just after name is now '\0' */ /* just after name is now '\0' */
p = input_line_pointer; p = input_line_pointer;
*p = c; *p = c;
SKIP_WHITESPACE (); SKIP_WHITESPACE ();
@ -925,7 +931,7 @@ arc_extoper (opertype)
return; return;
} }
input_line_pointer++; /* skip ',' */ input_line_pointer++; /* skip ',' */
number = get_absolute_expression (); number = get_absolute_expression ();
if (number < 0) if (number < 0)
@ -948,7 +954,7 @@ arc_extoper (opertype)
return; return;
} }
input_line_pointer++; /* skip ',' */ input_line_pointer++; /* skip ',' */
mode = input_line_pointer; mode = input_line_pointer;
if (!strncmp (mode, "r|w", 3)) if (!strncmp (mode, "r|w", 3))
@ -990,7 +996,7 @@ arc_extoper (opertype)
return; return;
} }
input_line_pointer++; /* skip ',' */ input_line_pointer++; /* skip ',' */
if (!strncmp (input_line_pointer, "cannot_shortcut", 15)) if (!strncmp (input_line_pointer, "cannot_shortcut", 15))
{ {
@ -1155,7 +1161,7 @@ arc_extinst (ignore)
strcpy (syntax, name); strcpy (syntax, name);
name_len = strlen (name); name_len = strlen (name);
/* just after name is now '\0' */ /* just after name is now '\0' */
p = input_line_pointer; p = input_line_pointer;
*p = c; *p = c;
@ -1168,7 +1174,7 @@ arc_extinst (ignore)
return; return;
} }
input_line_pointer++; /* skip ',' */ input_line_pointer++; /* skip ',' */
opcode = get_absolute_expression (); opcode = get_absolute_expression ();
SKIP_WHITESPACE (); SKIP_WHITESPACE ();
@ -1180,7 +1186,7 @@ arc_extinst (ignore)
return; return;
} }
input_line_pointer++; /* skip ',' */ input_line_pointer++; /* skip ',' */
subopcode = get_absolute_expression (); subopcode = get_absolute_expression ();
if (subopcode < 0) if (subopcode < 0)
@ -1218,7 +1224,7 @@ arc_extinst (ignore)
return; return;
} }
input_line_pointer++; /* skip ',' */ input_line_pointer++; /* skip ',' */
for (i = 0; i < (int) MAXSUFFIXCLASS; i++) for (i = 0; i < (int) MAXSUFFIXCLASS; i++)
{ {
@ -1246,7 +1252,7 @@ arc_extinst (ignore)
return; return;
} }
input_line_pointer++; /* skip ',' */ input_line_pointer++; /* skip ',' */
for (i = 0; i < (int) MAXSYNTAXCLASS; i++) for (i = 0; i < (int) MAXSYNTAXCLASS; i++)
{ {
@ -1373,7 +1379,7 @@ arc_common (localScope)
name = input_line_pointer; name = input_line_pointer;
c = get_symbol_end (); c = get_symbol_end ();
/* just after name is now '\0' */ /* just after name is now '\0' */
p = input_line_pointer; p = input_line_pointer;
*p = c; *p = c;
SKIP_WHITESPACE (); SKIP_WHITESPACE ();
@ -1385,7 +1391,7 @@ arc_common (localScope)
return; return;
} }
input_line_pointer++; /* skip ',' */ input_line_pointer++; /* skip ',' */
size = get_absolute_expression (); size = get_absolute_expression ();
if (size < 0) if (size < 0)
@ -1437,7 +1443,7 @@ arc_common (localScope)
old_sec = now_seg; old_sec = now_seg;
old_subsec = now_subseg; old_subsec = now_subseg;
record_alignment (bss_section, align); 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) if (align)
/* Do alignment. */ /* Do alignment. */
@ -1631,12 +1637,13 @@ arc_code_symbol (expressionP)
{ {
expressionS two; expressionS two;
expressionP->X_op = O_right_shift; expressionP->X_op = O_right_shift;
expressionP->X_add_symbol->sy_value.X_op = O_constant;
two.X_op = O_constant; two.X_op = O_constant;
two.X_add_symbol = two.X_op_symbol = NULL; two.X_add_symbol = two.X_op_symbol = NULL;
two.X_add_number = 2; two.X_add_number = 2;
expressionP->X_op_symbol = make_expr_symbol (&two); expressionP->X_op_symbol = make_expr_symbol (&two);
} }
/* Allow %st(sym1-sym2) */ /* Allow %st(sym1-sym2) */
else if (expressionP->X_op == O_subtract else if (expressionP->X_op == O_subtract
&& expressionP->X_add_symbol != NULL && expressionP->X_add_symbol != NULL
&& expressionP->X_op_symbol != NULL && expressionP->X_op_symbol != NULL
@ -1687,7 +1694,8 @@ md_operand (expressionP)
arc_code_symbol (expressionP); arc_code_symbol (expressionP);
} }
else else
{ /* It could be a register. */ {
/* It could be a register. */
int i, l; int i, l;
struct arc_ext_operand_value *ext_oper = arc_ext_operands; struct arc_ext_operand_value *ext_oper = arc_ext_operands;
p++; p++;

View File

@ -66,3 +66,5 @@ arc_parse_cons_expression (EXP, NBYTES)
extern void arc_cons_fix_new (); extern void arc_cons_fix_new ();
#define TC_CONS_FIX_NEW(FRAG, WHERE, NBYTES, EXP) \ #define TC_CONS_FIX_NEW(FRAG, WHERE, NBYTES, EXP) \
arc_cons_fix_new (FRAG, WHERE, NBYTES, EXP) arc_cons_fix_new (FRAG, WHERE, NBYTES, EXP)
#define DWARF2_LINE_MIN_INSN_LENGTH 4

View File

@ -13,7 +13,7 @@
@chapter ARC Dependent Features @chapter ARC Dependent Features
@end ifclear @end ifclear
@set ARC_CORE_DEFAULT 5 @set ARC_CORE_DEFAULT 6
@cindex ARC support @cindex ARC support
@menu @menu

View File

@ -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> 2001-05-12 Alan Modra <amodra@one.net.au>
* gas/i386/sse2.s: Correct cvtps2dq, movdq2q, and movq2dq * gas/i386/sse2.s: Correct cvtps2dq, movdq2q, and movq2dq

View File

@ -23,5 +23,11 @@ Disassembly of section .text:
34: 02 02 01 14 14010202 st.di r1,\[r2,2\] 34: 02 02 01 14 14010202 st.di r1,\[r2,2\]
38: 03 02 01 15 15010203 st.a.di r1,\[r2,3\] 38: 03 02 01 15 15010203 st.a.di r1,\[r2,3\]
3c: 04 02 81 15 15810204 stw.a.di r1,\[r2,4\] 3c: 04 02 81 15 15810204 stw.a.di r1,\[r2,4\]
40: 00 02 01 12 12010200 sr r1,\[r2\] 40: 04 7c 06 10 10067c04 st 80,\[r12,4\]
44: 0e 82 1f 12 121f820e sr r1,\[0xe\] 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\]

View File

@ -14,5 +14,9 @@
st.a.di r1,[r2,3] st.a.di r1,[r2,3]
stw.a.di r1,[r2,4] stw.a.di r1,[r2,4]
st .L1,[r12,4]
st .L1@h30,[r12,4]
.L1:
sr r1,[r2] sr r1,[r2]
sr r1,[14] sr r1,[14]

View File

@ -1,3 +1,8 @@
2001-05-12 Peter Targett <peter.targett@arccores.com>
* arc-opc.c (arc_reg_names): Correct attribute for lp_count
register to r/w. Formatting fixes throughout file.
2001-05-12 Alan Modra <amodra@one.net.au> 2001-05-12 Alan Modra <amodra@one.net.au>
* i386-dis.c (prefix_user_table): Correct movq2dq, movdq2q, and * i386-dis.c (prefix_user_table): Correct movq2dq, movdq2q, and

View File

@ -382,7 +382,7 @@ const struct arc_operand_value arc_reg_names[] =
{ "r59", 59, REG, 0 }, { "r59", 59, REG, 0 },
/* Loop count register (24 bits). */ /* Loop count register (24 bits). */
{ "lp_count", 60, REG, ARC_REGISTER_READONLY }, { "lp_count", 60, REG, 0 },
/* Short immediate data indicator setting flags. */ /* Short immediate data indicator setting flags. */
{ "r61", 61, REG, ARC_REGISTER_READONLY }, { "r61", 61, REG, ARC_REGISTER_READONLY },
/* Long immediate data indicator setting flags. */ /* Long immediate data indicator setting flags. */
@ -694,21 +694,21 @@ insert_reg (insn, operand, mods, reg, value, errmsg)
{ {
int marker; int marker;
op_type = OP_SHIMM; op_type = OP_SHIMM;
/* forget about shimm as dest mlm. */ /* forget about shimm as dest mlm. */
if('a' != operand->fmt) if ('a' != operand->fmt)
{ {
shimm_p = 1; shimm_p = 1;
shimm = value; shimm = value;
flagshimm_handled_p = 1; flagshimm_handled_p = 1;
marker = flag_p ? ARC_REG_SHIMM_UPDATE : ARC_REG_SHIMM; marker = flag_p ? ARC_REG_SHIMM_UPDATE : ARC_REG_SHIMM;
} }
else else
{ {
/* don't request flag setting on shimm as dest. */ /* don't request flag setting on shimm as dest. */
marker = ARC_REG_SHIMM; marker = ARC_REG_SHIMM;
} }
insn |= marker << operand->shift; insn |= marker << operand->shift;
/* insn |= value & 511; - done later. */ /* insn |= value & 511; - done later. */
} }
@ -736,33 +736,33 @@ insert_reg (insn, operand, mods, reg, value, errmsg)
*errmsg = "auxiliary register not allowed here"; *errmsg = "auxiliary register not allowed here";
else else
{ {
if((insn & I(-1)) == I(2)) /* check for use validity. */ if ((insn & I(-1)) == I(2)) /* check for use validity. */
{ {
if(reg->flags & ARC_REGISTER_READONLY) if (reg->flags & ARC_REGISTER_READONLY)
*errmsg = "attempt to set readonly register"; *errmsg = "attempt to set readonly register";
} }
else else
{ {
if(reg->flags & ARC_REGISTER_WRITEONLY) if (reg->flags & ARC_REGISTER_WRITEONLY)
*errmsg = "attempt to read writeonly register"; *errmsg = "attempt to read writeonly register";
} }
insn |= ARC_REG_SHIMM << operand->shift; insn |= ARC_REG_SHIMM << operand->shift;
insn |= reg->value << arc_operands[reg->type].shift; insn |= reg->value << arc_operands[reg->type].shift;
} }
} }
else else
{ {
/* check for use validity. */ /* check for use validity. */
if('a' == operand->fmt || ((insn & I(-1)) < I(2))) if ('a' == operand->fmt || ((insn & I(-1)) < I(2)))
{ {
if(reg->flags & ARC_REGISTER_READONLY) if (reg->flags & ARC_REGISTER_READONLY)
*errmsg = "attempt to set readonly register"; *errmsg = "attempt to set readonly register";
} }
if('a' != operand->fmt) if ('a' != operand->fmt)
{ {
if(reg->flags & ARC_REGISTER_WRITEONLY) if (reg->flags & ARC_REGISTER_WRITEONLY)
*errmsg = "attempt to read writeonly register"; *errmsg = "attempt to read writeonly register";
} }
/* We should never get an invalid register number here. */ /* We should never get an invalid register number here. */
if ((unsigned int) reg->value > 60) if ((unsigned int) reg->value > 60)
{ {
@ -770,7 +770,7 @@ insert_reg (insn, operand, mods, reg, value, errmsg)
*errmsg = buf; *errmsg = buf;
} }
insn |= reg->value << operand->shift; insn |= reg->value << operand->shift;
op_type = OP_REG; op_type = OP_REG;
} }
} }
@ -784,9 +784,9 @@ insert_reg (insn, operand, mods, reg, value, errmsg)
break; break;
case 'c': case 'c':
if ((insn & I(-1)) == I(2)) if ((insn & I(-1)) == I(2))
ls_operand[LS_VALUE] = op_type; ls_operand[LS_VALUE] = op_type;
else else
ls_operand[LS_OFFSET] = op_type; ls_operand[LS_OFFSET] = op_type;
break; break;
case 'o': case 'O': case 'o': case 'O':
ls_operand[LS_OFFSET] = op_type; ls_operand[LS_OFFSET] = op_type;
@ -921,14 +921,14 @@ insert_base (insn, operand, mods, reg, value, errmsg)
else if (ARC_SHIMM_CONST_P (value) && !cond_p) else if (ARC_SHIMM_CONST_P (value) && !cond_p)
{ {
if (shimm_p && value != shimm) if (shimm_p && value != shimm)
{ {
/* convert the previous shimm operand to a limm. */ /* convert the previous shimm operand to a limm. */
limm_p = 1; limm_p = 1;
limm = shimm; limm = shimm;
insn &= ~C(-1); /* we know where the value is in insn. */ insn &= ~C(-1); /* we know where the value is in insn. */
insn |= C(ARC_REG_LIMM); insn |= C(ARC_REG_LIMM);
ls_operand[LS_VALUE] = OP_LIMM; ls_operand[LS_VALUE] = OP_LIMM;
} }
insn |= ARC_REG_SHIMM << operand->shift; insn |= ARC_REG_SHIMM << operand->shift;
shimm_p = 1; shimm_p = 1;
shimm = value; shimm = value;
@ -937,10 +937,10 @@ insert_base (insn, operand, mods, reg, value, errmsg)
else else
{ {
if (limm_p && value != limm) if (limm_p && value != limm)
{ {
*errmsg = "too many long constants"; *errmsg = "too many long constants";
return insn; return insn;
} }
limm_p = 1; limm_p = 1;
limm = value; limm = value;
insn |= B(ARC_REG_LIMM); insn |= B(ARC_REG_LIMM);
@ -970,8 +970,8 @@ insert_offset (insn, operand, mods, reg, value, errmsg)
myinsn = insert_reg (0,operand,mods,reg,value,errmsg) >> operand->shift; myinsn = insert_reg (0,operand,mods,reg,value,errmsg) >> operand->shift;
ls_operand[LS_OFFSET] = OP_REG; ls_operand[LS_OFFSET] = OP_REG;
if (operand->flags & ARC_OPERAND_LOAD) /* not if store, catch it later. */ if (operand->flags & ARC_OPERAND_LOAD) /* not if store, catch it later. */
if ((insn & I(-1)) != I(1)) /* not if opcode == 1, catch it later. */ if ((insn & I(-1)) != I(1)) /* not if opcode == 1, catch it later. */
insn |= C(myinsn); insn |= C(myinsn);
} }
else else
{ {
@ -989,23 +989,23 @@ insert_offset (insn, operand, mods, reg, value, errmsg)
} }
if ((cond_p && !limm_p) || (value < minval || value > maxval)) if ((cond_p && !limm_p) || (value < minval || value > maxval))
{ {
if (limm_p && value != limm) if (limm_p && value != limm)
{ {
*errmsg = "too many long constants"; *errmsg = "too many long constants";
} }
else else
{ {
limm_p = 1; limm_p = 1;
limm = value; limm = value;
if (operand->flags & ARC_OPERAND_STORE) if (operand->flags & ARC_OPERAND_STORE)
insn |= B(ARC_REG_LIMM); insn |= B(ARC_REG_LIMM);
if (operand->flags & ARC_OPERAND_LOAD) if (operand->flags & ARC_OPERAND_LOAD)
insn |= C(ARC_REG_LIMM); insn |= C(ARC_REG_LIMM);
ls_operand[LS_OFFSET] = OP_LIMM; ls_operand[LS_OFFSET] = OP_LIMM;
} }
} }
else else
{ {
if ((value < minval || value > maxval)) if ((value < minval || value > maxval))
*errmsg = "need too many limms"; *errmsg = "need too many limms";
else if (shimm_p && value != shimm) else if (shimm_p && value != shimm)
@ -1040,7 +1040,7 @@ insert_offset (insn, operand, mods, reg, value, errmsg)
shimm = value; shimm = value;
shimm_p = 1; shimm_p = 1;
ls_operand[LS_OFFSET] = OP_SHIMM; ls_operand[LS_OFFSET] = OP_SHIMM;
} }
} }
out: out:
return insn; return insn;
@ -1060,14 +1060,15 @@ extract_st_syntax (insn, operand, mods, opval, invalid)
((ls_operand[LS_VALUE] == (V) && \ ((ls_operand[LS_VALUE] == (V) && \
ls_operand[LS_BASE] == (B) && \ ls_operand[LS_BASE] == (B) && \
ls_operand[LS_OFFSET] == (O))) ls_operand[LS_OFFSET] == (O)))
if (!((ST_SYNTAX(OP_REG,OP_REG,OP_NONE) && (insn[0] & 511) == 0)
if (!((ST_SYNTAX(OP_REG,OP_REG,OP_NONE) && (insn[0] & 511) == 0)
|| ST_SYNTAX(OP_REG,OP_LIMM,OP_NONE) || ST_SYNTAX(OP_REG,OP_LIMM,OP_NONE)
|| (ST_SYNTAX(OP_SHIMM,OP_REG,OP_NONE) && (insn[0] & 511) == 0) || (ST_SYNTAX(OP_SHIMM,OP_REG,OP_NONE) && (insn[0] & 511) == 0)
|| (ST_SYNTAX(OP_SHIMM,OP_SHIMM,OP_NONE) && (insn[0] & 511) == 0) || (ST_SYNTAX(OP_SHIMM,OP_SHIMM,OP_NONE) && (insn[0] & 511) == 0)
|| ST_SYNTAX(OP_SHIMM,OP_LIMM,OP_NONE) || ST_SYNTAX(OP_SHIMM,OP_LIMM,OP_NONE)
|| ST_SYNTAX(OP_SHIMM,OP_LIMM,OP_SHIMM) || ST_SYNTAX(OP_SHIMM,OP_LIMM,OP_SHIMM)
|| ST_SYNTAX(OP_SHIMM,OP_SHIMM,OP_SHIMM) || ST_SYNTAX(OP_SHIMM,OP_SHIMM,OP_SHIMM)
|| (ST_SYNTAX(OP_LIMM,OP_REG,OP_NONE) && (insn[0] & 511) == 0) || (ST_SYNTAX(OP_LIMM,OP_REG,OP_NONE) && (insn[0] & 511) == 0)
|| ST_SYNTAX(OP_REG,OP_REG,OP_SHIMM) || ST_SYNTAX(OP_REG,OP_REG,OP_SHIMM)
|| ST_SYNTAX(OP_REG,OP_SHIMM,OP_SHIMM) || ST_SYNTAX(OP_REG,OP_SHIMM,OP_SHIMM)
|| ST_SYNTAX(OP_SHIMM,OP_REG,OP_SHIMM) || ST_SYNTAX(OP_SHIMM,OP_REG,OP_SHIMM)
@ -1086,13 +1087,13 @@ arc_limm_fixup_adjust(insn)
/* check for st shimm,[limm]. */ /* check for st shimm,[limm]. */
if ((insn & (I(-1) | C(-1) | B(-1))) == if ((insn & (I(-1) | C(-1) | B(-1))) ==
(I(2) | C(ARC_REG_SHIMM) | B(ARC_REG_LIMM))) (I(2) | C(ARC_REG_SHIMM) | B(ARC_REG_LIMM)))
{ {
retval = insn & 0x1ff; retval = insn & 0x1ff;
if (retval & 0x100) /* sign extend 9 bit offset. */ if (retval & 0x100) /* sign extend 9 bit offset. */
retval |= ~0x1ff; retval |= ~0x1ff;
} }
return(-retval); /* negate offset for return. */ return -retval; /* negate offset for return. */
} }
/* Used in st insns to do final syntax check. */ /* Used in st insns to do final syntax check. */
@ -1122,27 +1123,27 @@ insert_st_syntax (insn, operand, mods, reg, value, errmsg)
if (ST_SYNTAX(OP_REG,OP_SHIMM,OP_NONE) || ST_SYNTAX(OP_LIMM,OP_SHIMM,OP_NONE)) if (ST_SYNTAX(OP_REG,OP_SHIMM,OP_NONE) || ST_SYNTAX(OP_LIMM,OP_SHIMM,OP_NONE))
{ {
/* try to salvage this syntax. */ /* try to salvage this syntax. */
if (shimm & 0x1) /* odd shimms won't work. */ if (shimm & 0x1) /* odd shimms won't work. */
{ {
if (limm_p) /* do we have a limm already? */ if (limm_p) /* do we have a limm already? */
{ {
*errmsg = "impossible store"; *errmsg = "impossible store";
} }
limm_p = 1; limm_p = 1;
limm = shimm; limm = shimm;
shimm = 0; shimm = 0;
shimm_p = 0; shimm_p = 0;
insn = insn & ~(B(-1) | 511); insn = insn & ~(B(-1) | 511);
insn |= B(ARC_REG_LIMM); insn |= B(ARC_REG_LIMM);
ls_operand[LS_BASE] = OP_LIMM; ls_operand[LS_BASE] = OP_LIMM;
} }
else else
{ {
shimm >>= 1; shimm >>= 1;
insn = insn & ~511; insn = insn & ~511;
insn |= shimm; insn |= shimm;
ls_operand[LS_OFFSET] = OP_SHIMM; ls_operand[LS_OFFSET] = OP_SHIMM;
} }
} }
if (ST_SYNTAX(OP_SHIMM,OP_LIMM,OP_NONE)) if (ST_SYNTAX(OP_SHIMM,OP_LIMM,OP_NONE))
{ {
@ -1199,11 +1200,11 @@ insert_ld_syntax (insn, operand, mods, reg, value, errmsg)
int test = insn & I(-1); int test = insn & I(-1);
if (!(test == I(1))) if (!(test == I(1)))
{ {
if ((ls_operand[LS_DEST] == OP_SHIMM || ls_operand[LS_BASE] == OP_SHIMM if ((ls_operand[LS_DEST] == OP_SHIMM || ls_operand[LS_BASE] == OP_SHIMM
|| ls_operand[LS_OFFSET] == OP_SHIMM)) || ls_operand[LS_OFFSET] == OP_SHIMM))
*errmsg = "invalid load/shimm insn"; *errmsg = "invalid load/shimm insn";
} }
if (!(LD_SYNTAX(OP_REG,OP_REG,OP_NONE) if (!(LD_SYNTAX(OP_REG,OP_REG,OP_NONE)
|| LD_SYNTAX(OP_REG,OP_REG,OP_REG) || LD_SYNTAX(OP_REG,OP_REG,OP_REG)
|| LD_SYNTAX(OP_REG,OP_REG,OP_SHIMM) || LD_SYNTAX(OP_REG,OP_REG,OP_SHIMM)
@ -1211,7 +1212,7 @@ insert_ld_syntax (insn, operand, mods, reg, value, errmsg)
|| (LD_SYNTAX(OP_REG,OP_REG,OP_LIMM) && !(test == I(1))) || (LD_SYNTAX(OP_REG,OP_REG,OP_LIMM) && !(test == I(1)))
|| LD_SYNTAX(OP_REG,OP_SHIMM,OP_SHIMM) || LD_SYNTAX(OP_REG,OP_SHIMM,OP_SHIMM)
|| (LD_SYNTAX(OP_REG,OP_LIMM,OP_NONE) && (test == I(1))))) || (LD_SYNTAX(OP_REG,OP_LIMM,OP_NONE) && (test == I(1)))))
*errmsg = "ld operand error"; *errmsg = "ld operand error";
if (addrwb_p) if (addrwb_p)
{ {
if (ls_operand[LS_BASE] != OP_REG) if (ls_operand[LS_BASE] != OP_REG)
@ -1235,8 +1236,8 @@ extract_ld_syntax (insn, operand, mods, opval, invalid)
if (!(test == I(1))) if (!(test == I(1)))
{ {
if((ls_operand[LS_DEST] == OP_SHIMM || ls_operand[LS_BASE] == OP_SHIMM if ((ls_operand[LS_DEST] == OP_SHIMM || ls_operand[LS_BASE] == OP_SHIMM
|| ls_operand[LS_OFFSET] == OP_SHIMM)) || ls_operand[LS_OFFSET] == OP_SHIMM))
*invalid = 1; *invalid = 1;
} }
if (!((LD_SYNTAX(OP_REG,OP_REG,OP_NONE) && (test == I(1))) if (!((LD_SYNTAX(OP_REG,OP_REG,OP_NONE) && (test == I(1)))
@ -1326,8 +1327,8 @@ insert_jumpflags (insn, operand, mods, reg, value, errmsg)
*errmsg = "bad jump flags value"; *errmsg = "bad jump flags value";
} }
jumpflags_p = 1; jumpflags_p = 1;
limm = (limm & ((1 << operand->shift) - 1)) limm = ((limm & ((1 << operand->shift) - 1))
| ((value & ((1 << operand->bits) - 1)) << operand->shift); | ((value & ((1 << operand->bits) - 1)) << operand->shift));
return insn; return insn;
} }
@ -1397,7 +1398,7 @@ insert_absaddr (insn, operand, mods, reg, value, errmsg)
} }
else else
{ {
if(nullify != 0x02) if (nullify != 0x02)
{ {
*errmsg = "must specify .jd or no nullify suffix"; *errmsg = "must specify .jd or no nullify suffix";
} }
@ -1450,7 +1451,7 @@ extract_reg (insn, operand, mods, opval, invalid)
if (regno == ARC_REG_SHIMM) if (regno == ARC_REG_SHIMM)
{ {
op_type = OP_SHIMM; op_type = OP_SHIMM;
/* always return zero if dest is a shimm mlm. */ /* always return zero if dest is a shimm mlm. */
if ('a' != operand->fmt) if ('a' != operand->fmt)
{ {
@ -1492,10 +1493,10 @@ extract_reg (insn, operand, mods, opval, invalid)
value = insn[1]; value = insn[1];
limm_p = 1; limm_p = 1;
/* if this is a jump instruction (j,jl), show new pc correctly. */ /* if this is a jump instruction (j,jl), show new pc correctly. */
if(0x07 == ((*insn & I(-1)) >> 27)) if (0x07 == ((*insn & I(-1)) >> 27))
{ {
value = (value & 0xffffff); value = (value & 0xffffff);
} }
} }
/* It's a register, set OPVAL (that's the only way we distinguish registers /* It's a register, set OPVAL (that's the only way we distinguish registers
from constants here). */ from constants here). */
@ -1523,23 +1524,23 @@ extract_reg (insn, operand, mods, opval, invalid)
*opval = reg; *opval = reg;
} }
switch(operand->fmt) switch(operand->fmt)
{ {
case 'a': case 'a':
ls_operand[LS_DEST] = op_type; ls_operand[LS_DEST] = op_type;
break; break;
case 's': case 's':
ls_operand[LS_BASE] = op_type; ls_operand[LS_BASE] = op_type;
break; break;
case 'c': case 'c':
if((insn[0]& I(-1)) == I(2)) if ((insn[0]& I(-1)) == I(2))
ls_operand[LS_VALUE] = op_type; ls_operand[LS_VALUE] = op_type;
else else
ls_operand[LS_OFFSET] = op_type; ls_operand[LS_OFFSET] = op_type;
break; break;
case 'o': case 'O': case 'o': case 'O':
ls_operand[LS_OFFSET] = op_type; ls_operand[LS_OFFSET] = op_type;
break; break;
} }
return value; return value;
} }
@ -1633,8 +1634,8 @@ extract_jumpflags(insn, operand, mods, opval, invalid)
{ {
if (!flag_p || !limm_p) if (!flag_p || !limm_p)
*invalid = 1; *invalid = 1;
return((flag_p && limm_p) return ((flag_p && limm_p)
? (insn[1] >> operand->shift) & ((1 << operand->bits) -1): 0); ? (insn[1] >> operand->shift) & ((1 << operand->bits) -1): 0);
} }
/* extract st insn's offset. */ /* extract st insn's offset. */
@ -1654,7 +1655,7 @@ extract_st_offset (insn, operand, mods, opval, invalid)
value = insn[0] & 511; value = insn[0] & 511;
if ((operand->flags & ARC_OPERAND_SIGNED) && (value & 256)) if ((operand->flags & ARC_OPERAND_SIGNED) && (value & 256))
value -= 512; value -= 512;
if(value) if (value)
ls_operand[LS_OFFSET] = OP_SHIMM; ls_operand[LS_OFFSET] = OP_SHIMM;
} }
else else
@ -1686,9 +1687,9 @@ extract_ld_offset (insn, operand, mods, opval, invalid)
ls_operand[LS_OFFSET] = OP_SHIMM; ls_operand[LS_OFFSET] = OP_SHIMM;
return(value); return(value);
} }
/* if it isn't in the insn, it's concealed behind reg 'c'. */ /* if it isn't in the insn, it's concealed behind reg 'c'. */
return extract_reg(insn, return extract_reg (insn, &arc_operands[arc_operand_map['c']],
&arc_operands[arc_operand_map['c']], mods, opval, invalid); mods, opval, invalid);
} }
/* The only thing this does is set the `invalid' flag if B != C. /* The only thing this does is set the `invalid' flag if B != C.
@ -1779,8 +1780,8 @@ int
arc_insn_not_jl(insn) arc_insn_not_jl(insn)
arc_insn insn; arc_insn insn;
{ {
return (insn & (I(-1)|A(-1)|C(-1)|R(-1,7,1)|R(-1,9,1))) != return ((insn & (I(-1)|A(-1)|C(-1)|R(-1,7,1)|R(-1,9,1)))
(I(0x7) | R(-1,9,1)); != (I(0x7) | R(-1,9,1)));
} }
int int
@ -1814,11 +1815,11 @@ get_ext_suffix(s)
return(&suffix->operand); return(&suffix->operand);
suffix = suffix->next; suffix = suffix->next;
} }
return(NULL); return NULL;
} }
int int
arc_get_noshortcut_flag() arc_get_noshortcut_flag()
{ {
return(ARC_REGISTER_NOSHORT_CUT); return ARC_REGISTER_NOSHORT_CUT;
} }