diff options
Diffstat (limited to 'gas')
272 files changed, 12950 insertions, 252 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 9ad0f91..3954ade 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,17 @@ +2001-10-30 Hans-Peter Nilsson <hp@bitrange.com> + + * configure.in: Update for MMIX port. + * Makefile.am: Ditto. Regenerate dependencies. + * Makefile.in: Regenerate. + * configure: Regenerate. + * config/tc-mmix.h, config/tc-mmix.c: New files. + * doc/Makefile.am (CPU_DOCS): Add c-mmix.texi + * doc/Makefile.in: Regenerate. + * doc/all.texi: @set MMIX. + * doc/as.texinfo: Ditto. Add MMIX gas manpage option overview. + Include c-mmix.texi. + * doc/c-mmix.texi: New file. + 2001-10-24 Chris Demetriou <cgd@broadcom.com> * config/tc-mips.c (hilo_interlocks, cop_interlocks): Make diff --git a/gas/Makefile.am b/gas/Makefile.am index 3f927ae..71002e2 100644 --- a/gas/Makefile.am +++ b/gas/Makefile.am @@ -60,6 +60,7 @@ CPU_TYPES = \ m88k \ mcore \ mips \ + mmix \ mn10200 \ mn10300 \ ns32k \ @@ -112,7 +113,7 @@ CPU_OBJ_VALID = \ esac ;; \ coff) valid=yes; \ case $$c in \ - cris | i860) \ + cris | i860 | mmix) \ valid= ;; \ esac ;; \ ecoff) \ @@ -244,6 +245,7 @@ TARGET_CPU_CFILES = \ config/tc-m88k.c \ config/tc-mcore.c \ config/tc-mips.c \ + config/tc-mmix.c \ config/tc-mn10200.c \ config/tc-mn10300.c \ config/tc-ns32k.c \ @@ -287,6 +289,7 @@ TARGET_CPU_HFILES = \ config/tc-m88k.h \ config/tc-mcore.h \ config/tc-mips.h \ + config/tc-mmix.h \ config/tc-mn10200.h \ config/tc-mn10300.h \ config/tc-ns32k.h \ @@ -1209,6 +1212,11 @@ DEPTC_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/opcode/mips.h itbl-ops.h $(INCDIR)/elf/mips.h \ $(INCDIR)/elf/reloc-macros.h ecoff.h $(INCDIR)/coff/sym.h \ $(INCDIR)/coff/ecoff.h +DEPTC_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/mmix.h $(INCDIR)/safe-ctype.h dwarf2dbg.h DEPTC_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ @@ -1647,6 +1655,10 @@ DEPOBJ_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h +DEPOBJ_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h DEPOBJ_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1992,6 +2004,9 @@ DEP_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ DEP_mips_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h +DEP_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h DEP_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h diff --git a/gas/Makefile.in b/gas/Makefile.in index 7f36ef5..2d7897e 100644 --- a/gas/Makefile.in +++ b/gas/Makefile.in @@ -1,6 +1,6 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -171,6 +171,7 @@ CPU_TYPES = \ m88k \ mcore \ mips \ + mmix \ mn10200 \ mn10300 \ ns32k \ @@ -225,7 +226,7 @@ CPU_OBJ_VALID = \ esac ;; \ coff) valid=yes; \ case $$c in \ - cris | i860) \ + cris | i860 | mmix) \ valid= ;; \ esac ;; \ ecoff) \ @@ -361,6 +362,7 @@ TARGET_CPU_CFILES = \ config/tc-m88k.c \ config/tc-mcore.c \ config/tc-mips.c \ + config/tc-mmix.c \ config/tc-mn10200.c \ config/tc-mn10300.c \ config/tc-ns32k.c \ @@ -405,6 +407,7 @@ TARGET_CPU_HFILES = \ config/tc-m88k.h \ config/tc-mcore.h \ config/tc-mips.h \ + config/tc-mmix.h \ config/tc-mn10200.h \ config/tc-mn10300.h \ config/tc-ns32k.h \ @@ -970,6 +973,12 @@ DEPTC_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/reloc-macros.h ecoff.h $(INCDIR)/coff/sym.h \ $(INCDIR)/coff/ecoff.h +DEPTC_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/mmix.h $(INCDIR)/safe-ctype.h dwarf2dbg.h + DEPTC_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ @@ -1509,6 +1518,11 @@ DEPOBJ_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h +DEPOBJ_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h + DEPOBJ_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1953,6 +1967,10 @@ DEP_mips_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h +DEP_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h + DEP_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h @@ -2173,7 +2191,7 @@ configure configure.in gdbinit.in itbl-lex.c itbl-parse.c DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best SOURCES = $(itbl_test_SOURCES) $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) $(gasp_new_SOURCES) OBJECTS = $(itbl_test_OBJECTS) $(as_new_OBJECTS) $(gasp_new_OBJECTS) @@ -2334,7 +2352,7 @@ maintainer-clean-recursive: dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ - test "$$subdir" = "." && dot_seen=yes; \ + test "$$subdir" != "." || dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ diff --git a/gas/config/tc-mmix.c b/gas/config/tc-mmix.c new file mode 100644 index 0000000..b769807 --- /dev/null +++ b/gas/config/tc-mmix.c @@ -0,0 +1,4180 @@ +/* tc-mmix.c -- Assembler for Don Knuth's MMIX. + Copyright (C) 2001 Free Software Foundation. + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Knuth's assembler mmixal does not provide a relocatable format; mmo is + to be considered a final link-format. In the final link, we make mmo, + but for relocatable files, we use ELF. + + One goal is to provide a superset of what mmixal does, including + compatible syntax, but the main purpose is to serve GCC. */ + + +#include <stdio.h> +#include "as.h" +#include "subsegs.h" +#include "bfd.h" +#include "elf/mmix.h" +#include "opcode/mmix.h" +#include "safe-ctype.h" +#include "dwarf2dbg.h" +#include "obstack.h" + +/* Something to describe what we need to do with a fixup before output, + for example assert something of what it became or make a relocation. */ + +enum mmix_fixup_action + { + mmix_fixup_byte, + mmix_fixup_register, + mmix_fixup_register_or_adjust_for_byte + }; + +static int get_spec_regno PARAMS ((char *)); +static int get_operands PARAMS ((int, char *, expressionS[])); +static int get_putget_operands + PARAMS ((struct mmix_opcode *, char *, expressionS[])); +static void s_prefix PARAMS ((int)); +static void s_greg PARAMS ((int)); +static void s_loc PARAMS ((int)); +static void s_bspec PARAMS ((int)); +static void s_espec PARAMS ((int)); +static void mmix_s_local PARAMS ((int)); +static void mmix_greg_internal PARAMS ((char *)); +static void mmix_set_geta_branch_offset PARAMS ((char *, offsetT value)); +static void mmix_set_jmp_offset PARAMS ((char *, offsetT)); +static void mmix_fill_nops PARAMS ((char *, int)); +static int cmp_greg_symbol_fixes PARAMS ((const PTR, const PTR)); +static int cmp_greg_val_greg_symbol_fixes + PARAMS ((const PTR p1, const PTR p2)); +static void mmix_handle_rest_of_empty_line PARAMS ((void)); +static void mmix_discard_rest_of_line PARAMS ((void)); +static void mmix_byte PARAMS ((void)); +static void mmix_cons PARAMS ((int)); +static void mmix_frob_local_reloc PARAMS ((bfd *, asection *, PTR)); + +/* Continue the tradition of symbols.c; use control characters to enforce + magic. These are used when replacing e.g. 8F and 8B so we can handle + such labels correctly with the common parser hooks. */ +#define MAGIC_FB_BACKWARD_CHAR '\003' +#define MAGIC_FB_FORWARD_CHAR '\004' + +/* Copy the location of a frag to a fix. */ +#define COPY_FR_WHERE_TO_FX(FRAG, FIX) \ + do \ + { \ + (FIX)->fx_file = (FRAG)->fr_file; \ + (FIX)->fx_line = (FRAG)->fr_line; \ + } \ + while (0) + +const char *md_shortopts = "x"; +static int current_fb_label = -1; +static char *pending_label = NULL; + +static bfd_vma lowest_text_loc = (bfd_vma) -1; +static int text_has_contents = 0; + +/* The alignment of the previous instruction, and a boolean for whether we + want to avoid aligning the next WYDE, TETRA, OCTA or insn. */ +static int last_alignment = 0; +static int want_unaligned = 0; + +static bfd_vma lowest_data_loc = (bfd_vma) -1; +static int data_has_contents = 0; + +/* The fragS of the instruction being assembled. Only valid from within + md_assemble. */ +fragS *mmix_opcode_frag = NULL; + +/* Raw GREGs as appearing in input. These may be fewer than the number + after relaxing. */ +static int n_of_raw_gregs = 0; +static struct + { + char *label; + expressionS exp; + } mmix_raw_gregs[MAX_GREGS]; + +/* Fixups for all unique GREG registers. We store the fixups here in + md_convert_frag, then we use the array to convert + BFD_RELOC_MMIX_BASE_PLUS_OFFSET fixups in tc_gen_reloc. The index is + just a running number and is not supposed to be correlated to a + register number. */ +static fixS *mmix_gregs[MAX_GREGS]; +static int n_of_cooked_gregs = 0; + +/* Pointing to the register section we use for output. */ +static asection *real_reg_section; + +/* For each symbol; unknown or section symbol, we keep a list of GREG + definitions sorted on increasing offset. It seems no use keeping count + to allocate less room than the maximum number of gregs when we've found + one for a section or symbol. */ +struct mmix_symbol_gregs + { + int n_gregs; + struct mmix_symbol_greg_fixes + { + fixS *fix; + + /* A signed type, since we may have GREGs pointing slightly before the + contents of a section. */ + offsetT offs; + } greg_fixes[MAX_GREGS]; + }; + +/* Should read insert a colon on something that starts in column 0 on + this line? */ +static int label_without_colon_this_line = 1; + +/* Should we expand operands for external symbols? */ +static int expand_op = 1; + +/* Should we warn when expanding operands? FIXME: test-cases for when -x + is absent. */ +static int warn_on_expansion = 1; + +/* Should we merge non-zero GREG register definitions? */ +static int merge_gregs = 1; + +/* Should we emit built-in symbols? */ +static int predefined_syms = 1; + +/* Should we anything but the listed special register name (e.g. equated + symbols)? */ +static int equated_spec_regs = 1; + +/* Do we require standard GNU syntax? */ +int mmix_gnu_syntax = 0; + +/* Do we globalize all symbols? */ +int mmix_globalize_symbols = 0; + +/* Do we know that the next semicolon is at the end of the operands field + (in mmixal mode; constant 1 in GNU mode)? */ +int mmix_next_semicolon_is_eoln = 1; + +/* Do we have a BSPEC in progress? */ +static int doing_bspec = 0; +static char *bspec_file; +static unsigned int bspec_line; + +struct option md_longopts[] = + { +#define OPTION_RELAX (OPTION_MD_BASE) +#define OPTION_NOEXPAND (OPTION_RELAX + 1) +#define OPTION_NOMERGEGREG (OPTION_NOEXPAND + 1) +#define OPTION_NOSYMS (OPTION_NOMERGEGREG + 1) +#define OPTION_GNU_SYNTAX (OPTION_NOSYMS + 1) +#define OPTION_GLOBALIZE_SYMBOLS (OPTION_GNU_SYNTAX + 1) +#define OPTION_FIXED_SPEC_REGS (OPTION_GLOBALIZE_SYMBOLS + 1) + {"linkrelax", no_argument, NULL, OPTION_RELAX}, + {"no-expand", no_argument, NULL, OPTION_NOEXPAND}, + {"no-merge-gregs", no_argument, NULL, OPTION_NOMERGEGREG}, + {"no-predefined-syms", no_argument, NULL, OPTION_NOSYMS}, + {"gnu-syntax", no_argument, NULL, OPTION_GNU_SYNTAX}, + {"globalize-symbols", no_argument, NULL, OPTION_GLOBALIZE_SYMBOLS}, + {"fixed-special-register-names", no_argument, NULL, + OPTION_FIXED_SPEC_REGS}, + {NULL, no_argument, NULL, 0} + }; + +size_t md_longopts_size = sizeof (md_longopts); + +static struct hash_control *mmix_opcode_hash; + +/* We use these when implementing the PREFIX pseudo. */ +char *mmix_current_prefix; +struct obstack mmix_sym_obstack; + + +/* For MMIX, we encode the relax_substateT:s (in e.g. fr_substate) as one + bit length, and the relax-type shifted on top of that. There seems to + be no point in making the relaxation more fine-grained; the linker does + that better and we might interfere by changing non-optimal relaxations + into other insns that cannot be relaxed as easily. + + Groups for MMIX relaxing: + + 1. GETA + extra length: zero or three insns. + + 2. Bcc + extra length: zero or five insns. + + 3. PUSHJ + extra length: zero or four insns. + + 4. JMP + extra length: zero or four insns. */ + +#define STATE_GETA (1) +#define STATE_BCC (2) +#define STATE_PUSHJ (3) +#define STATE_JMP (4) +#define STATE_GREG (5) + +/* No fine-grainedness here. */ +#define STATE_LENGTH_MASK (1) + +#define STATE_ZERO (0) +#define STATE_MAX (1) + +/* More descriptive name for convenience. */ +/* FIXME: We should start on something different, not MAX. */ +#define STATE_UNDF STATE_MAX + +/* FIXME: For GREG, we must have other definitions; UNDF == MAX isn't + appropriate; we need it the other way round. This value together with + fragP->tc_frag_data shows what state the frag is in: tc_frag_data + non-NULL means 0, NULL means 8 bytes. */ +#define STATE_GREG_UNDF ENCODE_RELAX (STATE_GREG, STATE_ZERO) +#define STATE_GREG_DEF ENCODE_RELAX (STATE_GREG, STATE_MAX) + +/* These displacements are relative to the adress following the opcode + word of the instruction. The catch-all states have zero for "reach" + and "next" entries. */ + +#define GETA_0F (65536 * 4 - 8) +#define GETA_0B (-65536 * 4 - 4) + +#define GETA_MAX_LEN 4*4 +#define GETA_3F 0 +#define GETA_3B 0 + +#define BCC_0F GETA_0F +#define BCC_0B GETA_0B + +#define BCC_MAX_LEN 6*4 +#define BCC_5F GETA_3F +#define BCC_5B GETA_3B + +#define PUSHJ_0F GETA_0F +#define PUSHJ_0B GETA_0B + +#define PUSHJ_MAX_LEN 5*4 +#define PUSHJ_4F GETA_3F +#define PUSHJ_4B GETA_3B + +#define JMP_0F (65536 * 256 * 4 - 8) +#define JMP_0B (-65536 * 256 * 4 - 4) + +#define JMP_MAX_LEN 5*4 +#define JMP_4F 0 +#define JMP_4B 0 + +#define RELAX_ENCODE_SHIFT 1 +#define ENCODE_RELAX(what, length) (((what) << RELAX_ENCODE_SHIFT) + (length)) + +const relax_typeS mmix_relax_table[] = + { + /* Error sentinel (0, 0). */ + {1, 1, 0, 0}, + + /* Unused (0, 1). */ + {1, 1, 0, 0}, + + /* GETA (1, 0). */ + {GETA_0F, GETA_0B, 0, ENCODE_RELAX (STATE_GETA, STATE_MAX)}, + + /* GETA (1, 1). */ + {GETA_3F, GETA_3B, + GETA_MAX_LEN - 4, 0}, + + /* BCC (2, 0). */ + {BCC_0F, BCC_0B, 0, ENCODE_RELAX (STATE_BCC, STATE_MAX)}, + + /* BCC (2, 1). */ + {BCC_5F, BCC_5B, + BCC_MAX_LEN - 4, 0}, + + /* PUSHJ (3, 0). */ + {PUSHJ_0F, PUSHJ_0B, 0, ENCODE_RELAX (STATE_PUSHJ, STATE_MAX)}, + + /* PUSHJ (3, 1). */ + {PUSHJ_4F, PUSHJ_4B, + PUSHJ_MAX_LEN - 4, 0}, + + /* JMP (4, 0). */ + {JMP_0F, JMP_0B, 0, ENCODE_RELAX (STATE_JMP, STATE_MAX)}, + + /* JMP (4, 1). */ + {JMP_4F, JMP_4B, + JMP_MAX_LEN - 4, 0}, + + /* GREG (5, 0), (5, 1), though the table entry isn't used. */ + {0, 0, 0, 0}, {0, 0, 0, 0} +}; + +const pseudo_typeS md_pseudo_table[] = + { + /* Support " .greg sym,expr" syntax. */ + {"greg", s_greg, 0}, + + /* Support " .bspec expr" syntax. */ + {"bspec", s_bspec, 1}, + + /* Support " .espec" syntax. */ + {"espec", s_espec, 1}, + + /* Support " .local $45" syntax. */ + {"local", mmix_s_local, 1}, + + /* Support DWARF2 debugging info. */ + {"file", dwarf2_directive_file, 0}, + {"loc", dwarf2_directive_loc, 0}, + + {NULL, 0, 0} + }; + +const char mmix_comment_chars[] = "%!"; + +/* A ':' is a valid symbol character in mmixal. It's the prefix + delimiter, but other than that, it works like a symbol character, + except that we strip one off at the beginning of symbols. An '@' is a + symbol by itself (for the current location); space around it must not + be stripped. */ +const char mmix_symbol_chars[] = ":@"; + +const char line_comment_chars[] = "*#"; + +const char line_separator_chars[] = ";"; + +const char mmix_exp_chars[] = "eE"; + +const char mmix_flt_chars[] = "rf"; + + +/* Fill in the offset-related part of GETA or Bcc. */ + +static void +mmix_set_geta_branch_offset (opcodep, value) + char *opcodep; + offsetT value; +{ + if (value < 0) + { + value += 65536 * 4; + opcodep[0] |= 1; + } + + value /= 4; + md_number_to_chars (opcodep + 2, value, 2); +} + +/* Fill in the offset-related part of JMP. */ + +static void +mmix_set_jmp_offset (opcodep, value) + char *opcodep; + offsetT value; +{ + if (value < 0) + { + value += 65536 * 256 * 4; + opcodep[0] |= 1; + } + + value /= 4; + md_number_to_chars (opcodep + 1, value, 3); +} + +/* Fill in NOP:s for the expanded part of GETA/JMP/Bcc/PUSHJ. */ + +static void +mmix_fill_nops (opcodep, n) + char *opcodep; + int n; +{ + int i; + + for (i = 0; i < n; i++) + md_number_to_chars (opcodep + i*4, SWYM_INSN_BYTE << 24, 4); +} + +/* See macro md_parse_name in tc-mmix.h. */ + +int +mmix_current_location (fn, exp) + void (*fn) PARAMS ((expressionS *)); + expressionS *exp; +{ + (*fn) (exp); + + return 1; +} + +/* Get up to three operands, filling them into the exp array. + General idea and code stolen from the tic80 port. */ + +static int +get_operands (max_operands, s, exp) + int max_operands; + char *s; + expressionS exp[]; +{ + char *p = s; + int numexp = 0; + int nextchar = ','; + + while (nextchar == ',') + { + /* Skip leading whitespace */ + while (*p == ' ' || *p == '\t') + p++; + + /* Check to see if we have any operands left to parse */ + if (*p == 0 || *p == '\n' || *p == '\r') + { + break; + } + else if (numexp == max_operands) + { + /* This seems more sane than saying "too many operands". We'll + get here only if the trailing trash starts with a comma. */ + as_bad (_("invalid operands")); + mmix_discard_rest_of_line (); + return 0; + } + + /* Begin operand parsing at the current scan point. */ + + input_line_pointer = p; + expression (&exp[numexp]); + + if (exp[numexp].X_op == O_illegal) + { + as_bad (_("invalid operands")); + } + else if (exp[numexp].X_op == O_absent) + { + as_bad (_("missing operand")); + } + + numexp++; + p = input_line_pointer; + + /* Skip leading whitespace */ + while (*p == ' ' || *p == '\t') + p++; + nextchar = *p++; + } + + /* If we allow "naked" comments, ignore the rest of the line. */ + if (nextchar != ',') + { + mmix_handle_rest_of_empty_line (); + input_line_pointer--; + } + + /* Mark the end of the valid operands with an illegal expression. */ + exp[numexp].X_op = O_illegal; + + return (numexp); +} + +/* Get the value of a special register, or -1 if the name does not match + one. NAME is a null-terminated string. */ + +static int +get_spec_regno (name) + char *name; +{ + int i; + + if (name == NULL) + return -1; + + if (*name == ':') + name++; + + /* Well, it's a short array and we'll most often just match the first + entry, rJ. */ + for (i = 0; mmix_spec_regs[i].name != NULL; i++) + if (strcmp (name, mmix_spec_regs[i].name) == 0) + return mmix_spec_regs[i].number; + + return -1; +} + +/* For GET and PUT, parse the register names "manually", so we don't use + user labels. */ +static int +get_putget_operands (insn, operands, exp) + struct mmix_opcode *insn; + char *operands; + expressionS exp[]; +{ + expressionS *expp_reg; + expressionS *expp_sreg; + char *sregp = NULL; + char *sregend = operands; + char *p = operands; + char c = *sregend; + int regno; + + /* Skip leading whitespace */ + while (*p == ' ' || *p == '\t') + p++; + + input_line_pointer = p; + + if (insn->operands == mmix_operands_get) + { + expp_reg = &exp[0]; + expp_sreg = &exp[1]; + + expression (expp_reg); + + p = input_line_pointer; + + /* Skip whitespace */ + while (*p == ' ' || *p == '\t') + p++; + + if (*p == ',') + { + p++; + + /* Skip whitespace */ + while (*p == ' ' || *p == '\t') + p++; + sregp = p; + input_line_pointer = sregp; + c = get_symbol_end (); + sregend = input_line_pointer; + } + } + else + { + expp_sreg = &exp[0]; + expp_reg = &exp[1]; + + /* Initialize to error state in case we'll never call expression on + this operand. */ + expp_reg->X_op = O_illegal; + + sregp = p; + c = get_symbol_end (); + sregend = p = input_line_pointer; + *p = c; + + /* Skip whitespace */ + while (*p == ' ' || *p == '\t') + p++; + + if (*p == ',') + { + p++; + + /* Skip whitespace */ + while (*p == ' ' || *p == '\t') + p++; + + input_line_pointer = p; + expression (expp_reg); + } + *sregend = 0; + } + + regno = get_spec_regno (sregp); + *sregend = c; + + /* Let the caller issue errors; we've made sure the operands are + invalid. */ + if (expp_reg->X_op != O_illegal + && expp_reg->X_op != O_absent + && regno != -1) + { + expp_sreg->X_op = O_register; + expp_sreg->X_add_number = regno + 256; + } + + return 2; +} + +/* Handle MMIX-specific option. */ + +int +md_parse_option (c, arg) + int c; + char *arg ATTRIBUTE_UNUSED; +{ + switch (c) + { + case 'x': + warn_on_expansion = 0; + break; + + case OPTION_RELAX: + linkrelax = 1; + break; + + case OPTION_NOEXPAND: + expand_op = 0; + break; + + case OPTION_NOMERGEGREG: + merge_gregs = 0; + break; + + case OPTION_NOSYMS: + predefined_syms = 0; + equated_spec_regs = 0; + break; + + case OPTION_GNU_SYNTAX: + mmix_gnu_syntax = 1; + label_without_colon_this_line = 0; + break; + + case OPTION_GLOBALIZE_SYMBOLS: + mmix_globalize_symbols = 1; + break; + + case OPTION_FIXED_SPEC_REGS: + equated_spec_regs = 0; + break; + + default: + return 0; + } + + return 1; +} + +/* Display MMIX-specific help text. */ + +void +md_show_usage (stream) + FILE * stream; +{ + fprintf (stream, _(" MMIX-specific command line options:\n")); + fprintf (stream, _("\ + -fixed-special-register-names\n\ + Allow only the original special register names.\n")); + fprintf (stream, _("\ + -globalize-symbols Make all symbols global.\n")); + fprintf (stream, _("\ + -gnu-syntax Turn off mmixal syntax compatibility.\n")); + fprintf (stream, _("\ + -relax Create linker relaxable code.\n")); + fprintf (stream, _("\ + -no-predefined-syms Do not provide mmixal built-in constants.\n\ + Implies -fixed-special-register-names.\n")); + fprintf (stream, _("\ + -no-expand Do not expand GETA, branches, PUSHJ or JUMP\n\ + into multiple instructions.\n")); + fprintf (stream, _("\ + -no-merge-gregs Do not merge GREG definitions with nearby values.\n")); + fprintf (stream, _("\ + -x Do not warn when an operand to GETA, a branch,\n\ + PUSHJ or JUMP is not known to be within range.\n\ + The linker will catch any errors.\n")); +} + +/* Step to end of line, but don't step over the end of the line. */ + +static void +mmix_discard_rest_of_line () +{ + while (*input_line_pointer + && (! is_end_of_line [(unsigned char) *input_line_pointer] + || TC_EOL_IN_INSN (input_line_pointer))) + input_line_pointer++; +} + +/* Act as demand_empty_rest_of_line if we're in strict GNU syntax mode, + otherwise just ignore the rest of the line (and skip the end-of-line + delimiter). */ + +static void +mmix_handle_rest_of_empty_line () +{ + if (mmix_gnu_syntax) + demand_empty_rest_of_line (); + else + { + mmix_discard_rest_of_line (); + input_line_pointer++; + } +} + +/* Initialize GAS MMIX specifics. */ + +void +mmix_md_begin () +{ + int i; + const struct mmix_opcode *opcode; + + /* We assume nobody will use this, so don't allocate any room. */ + obstack_begin (&mmix_sym_obstack, 0); + + /* This will break the day the "lex" thingy changes. For now, it's the + only way to make ':' part of a name, and a name beginner. */ + lex_type [':'] = (LEX_NAME | LEX_BEGIN_NAME); + + mmix_opcode_hash = hash_new (); + + real_reg_section + = bfd_make_section_old_way (stdoutput, MMIX_REG_SECTION_NAME); + + for (opcode = mmix_opcodes; opcode->name; opcode++) + hash_insert (mmix_opcode_hash, opcode->name, (char *) opcode); + + /* We always insert the ordinary registers 0..255 as registers. */ + for (i = 0; i < 256; i++) + { + char buf[5]; + + /* Alternatively, we could diddle with '$' and the following number, + but keeping the registers as symbols helps keep parsing simple. */ + sprintf (buf, "$%d", i); + symbol_table_insert (symbol_new (buf, reg_section, i, + &zero_address_frag)); + } + + /* Insert mmixal built-in names if allowed. */ + if (predefined_syms) + { + for (i = 0; mmix_spec_regs[i].name != NULL; i++) + symbol_table_insert (symbol_new (mmix_spec_regs[i].name, + reg_section, + mmix_spec_regs[i].number + 256, + &zero_address_frag)); + + /* FIXME: Perhaps these should be recognized as specials; as field + names for those instructions. */ + symbol_table_insert (symbol_new ("ROUND_CURRENT", reg_section, 512, + &zero_address_frag)); + symbol_table_insert (symbol_new ("ROUND_OFF", reg_section, 512 + 1, + &zero_address_frag)); + symbol_table_insert (symbol_new ("ROUND_UP", reg_section, 512 + 2, + &zero_address_frag)); + symbol_table_insert (symbol_new ("ROUND_DOWN", reg_section, 512 + 3, + &zero_address_frag)); + symbol_table_insert (symbol_new ("ROUND_NEAR", reg_section, 512 + 4, + &zero_address_frag)); + } +} + +/* Assemble one insn in STR. */ + +void +md_assemble (str) + char *str; +{ + char *operands = str; + char modified_char = 0; + struct mmix_opcode *instruction; + fragS *opc_fragP = NULL; + int max_operands = 3; + + /* Note that the struct frag member fr_literal in frags.h is char[], so + I have to make this a plain char *. */ + /* unsigned */ char *opcodep = NULL; + + expressionS exp[4]; + int n_operands = 0; + + /* Move to end of opcode. */ + for (operands = str; + is_part_of_name (*operands); + ++operands) + ; + + if (ISSPACE (*operands)) + { + modified_char = *operands; + *operands++ = '\0'; + } + + instruction = (struct mmix_opcode *) hash_find (mmix_opcode_hash, str); + if (instruction == NULL) + { + as_bad (_("unknown opcode: `%s'"), str); + + /* Avoid "unhandled label" errors. */ + pending_label = NULL; + return; + } + + /* Put back the character after the opcode. */ + if (modified_char != 0) + operands[-1] = modified_char; + + input_line_pointer = operands; + + /* Is this a mmixal pseudodirective? */ + if (instruction->type == mmix_type_pseudo) + { + /* For mmixal compatibility, a label for an instruction (and + emitting pseudo) refers to the _aligned_ address. We emit the + label here for the pseudos that don't handle it themselves. When + having an fb-label, emit it here, and increment the counter after + the pseudo. */ + switch (instruction->operands) + { + case mmix_operands_loc: + case mmix_operands_byte: + case mmix_operands_prefix: + case mmix_operands_local: + case mmix_operands_bspec: + case mmix_operands_espec: + if (current_fb_label >= 0) + colon (fb_label_name (current_fb_label, 1)); + else if (pending_label != NULL) + { + colon (pending_label); + pending_label = NULL; + } + break; + + default: + break; + } + + /* Some of the pseudos emit contents, others don't. Set a + contents-emitted flag when we emit something into .text */ + switch (instruction->operands) + { + case mmix_operands_loc: + /* LOC */ + s_loc (0); + break; + + case mmix_operands_byte: + /* BYTE */ + mmix_byte (); + break; + + case mmix_operands_wyde: + /* WYDE */ + mmix_cons (2); + break; + + case mmix_operands_tetra: + /* TETRA */ + mmix_cons (4); + break; + + case mmix_operands_octa: + /* OCTA */ + mmix_cons (8); + break; + + case mmix_operands_prefix: + /* PREFIX */ + s_prefix (0); + break; + + case mmix_operands_local: + /* LOCAL */ + mmix_s_local (0); + break; + + case mmix_operands_bspec: + /* BSPEC */ + s_bspec (0); + break; + + case mmix_operands_espec: + /* ESPEC */ + s_espec (0); + break; + + default: + BAD_CASE (instruction->operands); + } + + /* These are all working like the pseudo functions in read.c:s_..., + in that they step over the end-of-line marker at the end of the + line. We don't want that here. */ + input_line_pointer--; + + /* Step up the fb-label counter if there was a definition on this + line. */ + if (current_fb_label >= 0) + { + fb_label_instance_inc (current_fb_label); + current_fb_label = -1; + } + + /* Reset any don't-align-next-datum request, unless this was a LOC + directive. */ + if (instruction->operands != mmix_operands_loc) + want_unaligned = 0; + + return; + } + + /* Not a pseudo; we *will* emit contents. */ + if (now_seg == data_section) + { + if (lowest_data_loc != (bfd_vma) -1 && (lowest_data_loc & 3) != 0) + { + if (data_has_contents) + as_bad (_("specified location wasn't TETRA-aligned")); + else if (want_unaligned) + as_bad (_("unaligned data at an absolute location is not supported")); + + lowest_data_loc &= ~(bfd_vma) 3; + lowest_data_loc += 4; + } + + data_has_contents = 1; + } + else if (now_seg == text_section) + { + if (lowest_text_loc != (bfd_vma) -1 && (lowest_text_loc & 3) != 0) + { + if (text_has_contents) + as_bad (_("specified location wasn't TETRA-aligned")); + else if (want_unaligned) + as_bad (_("unaligned data at an absolute location is not supported")); + + lowest_text_loc &= ~(bfd_vma) 3; + lowest_text_loc += 4; + } + + text_has_contents = 1; + } + + /* After a sequence of BYTEs or WYDEs, we need to get to instruction + alignment. For other pseudos, a ".p2align 2" is supposed to be + inserted by the user. */ + if (last_alignment < 2 && ! want_unaligned) + { + frag_align (2, 0, 0); + record_alignment (now_seg, 2); + last_alignment = 2; + } + else + /* Reset any don't-align-next-datum request. */ + want_unaligned = 0; + + /* For mmixal compatibility, a label for an instruction (and emitting + pseudo) refers to the _aligned_ address. So we have to emit the + label here. */ + if (pending_label != NULL) + { + colon (pending_label); + pending_label = NULL; + } + + /* We assume that mmix_opcodes keeps having unique mnemonics for each + opcode, so we don't have to iterate over more than one opcode; if the + syntax does not match, then there's a syntax error. */ + + /* Operands have little or no context and are all comma-separated; it is + easier to parse each expression first. */ + switch (instruction->operands) + { + case mmix_operands_reg_yz: + case mmix_operands_pop: + case mmix_operands_regaddr: + case mmix_operands_pushj: + case mmix_operands_get: + case mmix_operands_put: + case mmix_operands_set: + case mmix_operands_save: + case mmix_operands_unsave: + max_operands = 2; + break; + + case mmix_operands_sync: + case mmix_operands_jmp: + case mmix_operands_resume: + max_operands = 1; + break; + + /* The original 3 is fine for the rest. */ + default: + break; + } + + /* If this is GET or PUT, and we don't do allow those names to be + equated, we need to parse the names ourselves, so we don't pick up a + user label instead of the special register. */ + if (! equated_spec_regs + && (instruction->operands == mmix_operands_get + || instruction->operands == mmix_operands_put)) + n_operands = get_putget_operands (instruction, operands, exp); + else + n_operands = get_operands (max_operands, operands, exp); + + /* If there's a fb-label on the current line, set that label. This must + be done *after* evaluating expressions of operands, since neither a + "1B" nor a "1F" refers to "1H" on the same line. */ + if (current_fb_label >= 0) + { + fb_label_instance_inc (current_fb_label); + colon (fb_label_name (current_fb_label, 0)); + current_fb_label = -1; + } + + /* We also assume that the length of the instruction is determinable + from the first format character. Currently *all* the information is + in the first character. We need a self-contained frag since we want + the relocation to point to the instruction, not the variant part. */ + + opcodep = frag_more (4); + mmix_opcode_frag = opc_fragP = frag_now; + frag_now->fr_opcode = opcodep; + + /* Mark start of insn for DWARF2 debug features. */ + if (OUTPUT_FLAVOR == bfd_target_elf_flavour) + dwarf2_emit_insn (4); + + md_number_to_chars (opcodep, instruction->match, 4); + + switch (instruction->operands) + { + case mmix_operands_jmp: + if (n_operands == 0 && ! mmix_gnu_syntax) + /* Zeros are in place - nothing needs to be done when we have no + operands. */ + break; + + /* Add a frag for a JMP relaxation; we need room for max four + extra instructions. We don't do any work around here to check if + we can determine the offset right away. */ + if (n_operands != 1 || exp[0].X_op == O_register) + { + as_bad (_("invalid operand to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + if (expand_op) + frag_var (rs_machine_dependent, 4*4, 0, + ENCODE_RELAX (STATE_JMP, STATE_UNDF), + exp[0].X_add_symbol, + exp[0].X_add_number, + opcodep); + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal, 4, + exp + 0, 1, BFD_RELOC_MMIX_ADDR27); + break; + + case mmix_operands_pushj: + /* We take care of PUSHJ in full here. */ + if (n_operands != 2 + || ((exp[0].X_op == O_constant || exp[0].X_op == O_register) + && (exp[0].X_add_number > 255 || exp[0].X_add_number < 0))) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + if (exp[0].X_op == O_register || exp[0].X_op == O_constant) + opcodep[1] = exp[0].X_add_number; + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 1, + 1, exp + 0, 0, BFD_RELOC_MMIX_REG_OR_BYTE); + + if (expand_op) + frag_var (rs_machine_dependent, PUSHJ_MAX_LEN - 4, 0, + ENCODE_RELAX (STATE_PUSHJ, STATE_UNDF), + exp[1].X_add_symbol, + exp[1].X_add_number, + opcodep); + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal, 4, + exp + 1, 1, BFD_RELOC_MMIX_ADDR19); + break; + + case mmix_operands_regaddr: + /* GETA/branch: Add a frag for relaxation. We don't do any work + around here to check if we can determine the offset right away. */ + if (n_operands != 2 || exp[1].X_op == O_register) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + if (! expand_op) + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal, 4, + exp + 1, 1, BFD_RELOC_MMIX_ADDR19); + else if (instruction->type == mmix_type_condbranch) + frag_var (rs_machine_dependent, BCC_MAX_LEN - 4, 0, + ENCODE_RELAX (STATE_BCC, STATE_UNDF), + exp[1].X_add_symbol, + exp[1].X_add_number, + opcodep); + else + frag_var (rs_machine_dependent, GETA_MAX_LEN - 4, 0, + ENCODE_RELAX (STATE_GETA, STATE_UNDF), + exp[1].X_add_symbol, + exp[1].X_add_number, + opcodep); + break; + + default: + break; + } + + switch (instruction->operands) + { + case mmix_operands_regs: + /* We check the number of operands here, since we're in a + FALLTHROUGH sequence in the next switch. */ + if (n_operands != 3 || exp[2].X_op == O_constant) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + /* FALLTHROUGH. */ + case mmix_operands_regs_z: + if (n_operands != 3) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + /* FALLTHROUGH. */ + case mmix_operands_reg_yz: + case mmix_operands_roundregs_z: + case mmix_operands_roundregs: + case mmix_operands_regs_z_opt: + case mmix_operands_neg: + case mmix_operands_regaddr: + case mmix_operands_get: + case mmix_operands_set: + case mmix_operands_save: + if (n_operands < 1 + || (exp[0].X_op == O_register && exp[0].X_add_number > 255)) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + if (exp[0].X_op == O_register) + opcodep[1] = exp[0].X_add_number; + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 1, + 1, exp + 0, 0, BFD_RELOC_MMIX_REG); + break; + + default: + ; + } + + /* A corresponding once-over for those who take an 8-bit constant as + their first operand. */ + switch (instruction->operands) + { + case mmix_operands_pushgo: + /* PUSHGO: X is a constant, but can be expressed as a register. + We handle X here and use the common machinery of T,X,3,$ for + the rest of the operands. */ + if (n_operands < 2 + || ((exp[0].X_op == O_constant || exp[0].X_op == O_register) + && (exp[0].X_add_number > 255 || exp[0].X_add_number < 0))) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + else if (exp[0].X_op == O_constant || exp[0].X_op == O_register) + opcodep[1] = exp[0].X_add_number; + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 1, + 1, exp + 0, 0, BFD_RELOC_MMIX_REG_OR_BYTE); + break; + + case mmix_operands_pop: + if ((n_operands == 0 || n_operands == 1) && ! mmix_gnu_syntax) + break; + /* FALLTHROUGH. */ + case mmix_operands_x_regs_z: + if (n_operands < 1 + || (exp[0].X_op == O_constant + && (exp[0].X_add_number > 255 + || exp[0].X_add_number < 0))) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + if (exp[0].X_op == O_constant) + opcodep[1] = exp[0].X_add_number; + else + /* FIXME: This doesn't bring us unsignedness checking. */ + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 1, + 1, exp + 0, 0, BFD_RELOC_8); + default: + ; + } + + /* Handle the rest. */ + switch (instruction->operands) + { + case mmix_operands_set: + /* SET: Either two registers, "$X,$Y", with Z field as zero, or + "$X,YZ", meaning change the opcode to SETL. */ + if (n_operands != 2 + || (exp[1].X_op == O_constant + && (exp[1].X_add_number > 0xffff || exp[1].X_add_number < 0))) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + if (exp[1].X_op == O_constant) + { + /* There's an ambiguity with "SET $0,Y" when Y isn't defined + yet. To keep things simple, we assume that Y is then a + register, and only change the opcode if Y is defined at this + point. + + There's no compatibility problem with mmixal, since it emits + errors if the field is not defined at this point. */ + md_number_to_chars (opcodep, SETL_INSN_BYTE, 1); + + opcodep[2] = (exp[1].X_add_number >> 8) & 255; + opcodep[3] = exp[1].X_add_number & 255; + break; + } + /* FALLTHROUGH. */ + case mmix_operands_x_regs_z: + /* SYNCD: "X,$Y,$Z|Z". */ + /* FALLTHROUGH. */ + case mmix_operands_regs: + /* Three registers, $X,$Y,$Z. */ + /* FALLTHROUGH. */ + case mmix_operands_regs_z: + /* Operands "$X,$Y,$Z|Z", number of arguments checked above. */ + /* FALLTHROUGH. */ + case mmix_operands_pushgo: + /* Operands "$X|X,$Y,$Z|Z", optional Z. */ + /* FALLTHROUGH. */ + case mmix_operands_regs_z_opt: + /* Operands "$X,$Y,$Z|Z", with $Z|Z being optional, default 0. Any + operands not completely decided yet are postponed to later in + assembly (but not until link-time yet). */ + + if ((n_operands != 2 && n_operands != 3) + || (exp[1].X_op == O_register && exp[1].X_add_number > 255) + || (n_operands == 3 + && ((exp[2].X_op == O_register + && exp[2].X_add_number > 255 + && mmix_gnu_syntax) + || (exp[2].X_op == O_constant + && (exp[2].X_add_number > 255 + || exp[2].X_add_number < 0))))) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + if (n_operands == 2) + { + symbolS *sym; + + /* The last operand is immediate whenever we see just two + operands. */ + opcodep[0] |= IMM_OFFSET_BIT; + + /* Now, we could either have an implied "0" as the Z operand, or + it could be the constant of a "base address plus offset". It + depends on whether it is allowed; only memory operations, as + signified by instruction->type and "T" and "X" operand types, + and it depends on whether we find a register in the second + operand, exp[1]. */ + if (exp[1].X_op == O_register && exp[1].X_add_number <= 255) + { + /* A zero then; all done. */ + opcodep[2] = exp[1].X_add_number; + break; + } + + /* Not known as a register. Is base address plus offset + allowed, or can we assume that it is a register anyway? */ + if ((instruction->operands != mmix_operands_regs_z_opt + && instruction->operands != mmix_operands_x_regs_z + && instruction->operands != mmix_operands_pushgo) + || (instruction->type != mmix_type_memaccess_octa + && instruction->type != mmix_type_memaccess_tetra + && instruction->type != mmix_type_memaccess_wyde + && instruction->type != mmix_type_memaccess_byte + && instruction->type != mmix_type_memaccess_block + && instruction->type != mmix_type_jsr + && instruction->type != mmix_type_branch)) + { + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 2, + 1, exp + 1, 0, BFD_RELOC_MMIX_REG); + break; + } + + /* To avoid getting a NULL add_symbol for constants and then + catching a SEGV in write_relocs since it doesn't handle + constants well for relocs other than PC-relative, we need to + pass expressions as symbols and use fix_new, not fix_new_exp. */ + sym = make_expr_symbol (exp + 1); + + /* Now we know it can be a "base address plus offset". Add + proper fixup types so we can handle this later, when we've + parsed everything. */ + fix_new (opc_fragP, opcodep - opc_fragP->fr_literal + 2, + 8, sym, 0, 0, BFD_RELOC_MMIX_BASE_PLUS_OFFSET); + break; + } + + if (exp[1].X_op == O_register) + opcodep[2] = exp[1].X_add_number; + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 2, + 1, exp + 1, 0, BFD_RELOC_MMIX_REG); + + /* In mmixal compatibility mode, we allow special registers as + constants for the Z operand. They have 256 added to their + register numbers, so the right thing will happen if we just treat + those as constants. */ + if (exp[2].X_op == O_register && exp[2].X_add_number <= 255) + opcodep[3] = exp[2].X_add_number; + else if (exp[2].X_op == O_constant + || (exp[2].X_op == O_register && exp[2].X_add_number > 255)) + { + opcodep[3] = exp[2].X_add_number; + opcodep[0] |= IMM_OFFSET_BIT; + } + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 3, + 1, exp + 2, 0, + (instruction->operands == mmix_operands_set + || instruction->operands == mmix_operands_regs) + ? BFD_RELOC_MMIX_REG : BFD_RELOC_MMIX_REG_OR_BYTE); + break; + + case mmix_operands_pop: + /* POP, one eight and one 16-bit operand. */ + if (n_operands == 0 && ! mmix_gnu_syntax) + break; + if (n_operands == 1 && ! mmix_gnu_syntax) + goto a_single_24_bit_number_operand; + /* FALLTHROUGH. */ + case mmix_operands_reg_yz: + /* A register and a 16-bit unsigned number. */ + if (n_operands != 2 + || exp[1].X_op == O_register + || (exp[1].X_op == O_constant + && (exp[1].X_add_number > 0xffff || exp[1].X_add_number < 0))) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + if (exp[1].X_op == O_constant) + { + opcodep[2] = (exp[1].X_add_number >> 8) & 255; + opcodep[3] = exp[1].X_add_number & 255; + } + else + /* FIXME: This doesn't bring us unsignedness checking. */ + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 2, + 2, exp + 1, 0, BFD_RELOC_16); + break; + + case mmix_operands_jmp: + /* A JMP. Everyhing is already done. */ + break; + + case mmix_operands_roundregs: + /* Two registers with optional rounding mode or constant in between. */ + if ((n_operands == 3 && exp[2].X_op == O_constant) + || (n_operands == 2 && exp[1].X_op == O_constant)) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + /* FALLTHROUGH. */ + case mmix_operands_roundregs_z: + /* Like FLOT, "$X,ROUND_MODE,$Z|Z", but the rounding mode is + optional and can be the corresponding constant. */ + { + /* Which exp index holds the second operand (not the rounding + mode). */ + int op2no = n_operands - 1; + + if ((n_operands != 2 && n_operands != 3) + || ((exp[op2no].X_op == O_register + && exp[op2no].X_add_number > 255) + || (exp[op2no].X_op == O_constant + && (exp[op2no].X_add_number > 255 + || exp[op2no].X_add_number < 0))) + || (n_operands == 3 + /* We don't allow for the rounding mode to be deferred; it + must be determined in the "first pass". It cannot be a + symbol equated to a rounding mode, but defined after + the first use. */ + && ((exp[1].X_op == O_register + && exp[1].X_add_number < 512) + || (exp[1].X_op == O_constant + && exp[1].X_add_number < 0 + && exp[1].X_add_number > 4) + || (exp[1].X_op != O_register + && exp[1].X_op != O_constant)))) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + /* Add rounding mode if present. */ + if (n_operands == 3) + opcodep[2] = exp[1].X_add_number & 255; + + if (exp[op2no].X_op == O_register) + opcodep[3] = exp[op2no].X_add_number; + else if (exp[op2no].X_op == O_constant) + { + opcodep[3] = exp[op2no].X_add_number; + opcodep[0] |= IMM_OFFSET_BIT; + } + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 3, + 1, exp + op2no, 0, + instruction->operands == mmix_operands_roundregs + ? BFD_RELOC_MMIX_REG + : BFD_RELOC_MMIX_REG_OR_BYTE); + break; + } + + case mmix_operands_sync: + a_single_24_bit_number_operand: + if (n_operands != 1 + || exp[0].X_op == O_register + || (exp[0].X_op == O_constant + && (exp[0].X_add_number > 0xffffff || exp[0].X_add_number < 0))) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + if (exp[0].X_op == O_constant) + { + opcodep[1] = (exp[0].X_add_number >> 16) & 255; + opcodep[2] = (exp[0].X_add_number >> 8) & 255; + opcodep[3] = exp[0].X_add_number & 255; + } + else + /* FIXME: This doesn't bring us unsignedness checking. */ + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 1, + 3, exp + 0, 0, BFD_RELOC_24); + break; + + case mmix_operands_neg: + /* Operands "$X,Y,$Z|Z"; NEG or NEGU. Y is optional, 0 is default. */ + + if ((n_operands != 3 && n_operands != 2) + || (n_operands == 3 && exp[1].X_op == O_register) + || ((exp[1].X_op == O_constant || exp[1].X_op == O_register) + && (exp[1].X_add_number > 255 || exp[1].X_add_number < 0)) + || (n_operands == 3 + && ((exp[2].X_op == O_register && exp[2].X_add_number > 255) + || (exp[2].X_op == O_constant + && (exp[2].X_add_number > 255 + || exp[2].X_add_number < 0))))) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + if (n_operands == 2) + { + if (exp[1].X_op == O_register) + opcodep[3] = exp[1].X_add_number; + else if (exp[1].X_op == O_constant) + { + opcodep[3] = exp[1].X_add_number; + opcodep[0] |= IMM_OFFSET_BIT; + } + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 3, + 1, exp + 1, 0, BFD_RELOC_MMIX_REG_OR_BYTE); + break; + } + + if (exp[1].X_op == O_constant) + opcodep[2] = exp[1].X_add_number; + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 2, + 1, exp + 1, 0, BFD_RELOC_8); + + if (exp[2].X_op == O_register) + opcodep[3] = exp[2].X_add_number; + else if (exp[2].X_op == O_constant) + { + opcodep[3] = exp[2].X_add_number; + opcodep[0] |= IMM_OFFSET_BIT; + } + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 3, + 1, exp + 2, 0, BFD_RELOC_MMIX_REG_OR_BYTE); + break; + + case mmix_operands_regaddr: + /* A GETA/branch-type. */ + break; + + case mmix_operands_get: + /* "$X,spec_reg"; GET. + Like with rounding modes, we demand that the special register or + symbol is already defined when we get here at the point of use. */ + if (n_operands != 2 + || (exp[1].X_op == O_register + && (exp[1].X_add_number < 256 || exp[1].X_add_number >= 512)) + || (exp[1].X_op == O_constant + && (exp[1].X_add_number < 0 || exp[1].X_add_number > 256)) + || (exp[1].X_op != O_constant && exp[1].X_op != O_register)) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + opcodep[3] = exp[1].X_add_number - 256; + break; + + case mmix_operands_put: + /* "spec_reg,$Z|Z"; PUT. */ + if (n_operands != 2 + || (exp[0].X_op == O_register + && (exp[0].X_add_number < 256 || exp[0].X_add_number >= 512)) + || (exp[0].X_op == O_constant + && (exp[0].X_add_number < 0 || exp[0].X_add_number > 256)) + || (exp[0].X_op != O_constant && exp[0].X_op != O_register)) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + opcodep[1] = exp[0].X_add_number - 256; + + /* Note that the Y field is zero. */ + + if (exp[1].X_op == O_register) + opcodep[3] = exp[1].X_add_number; + else if (exp[1].X_op == O_constant) + { + opcodep[3] = exp[1].X_add_number; + opcodep[0] |= IMM_OFFSET_BIT; + } + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 3, + 1, exp + 1, 0, BFD_RELOC_MMIX_REG_OR_BYTE); + break; + + case mmix_operands_save: + /* "$X,0"; SAVE. */ + if (n_operands != 2 + || exp[1].X_op != O_constant + || exp[1].X_add_number != 0) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + break; + + case mmix_operands_unsave: + if (n_operands < 2 && ! mmix_gnu_syntax) + { + if (n_operands == 1) + { + if (exp[0].X_op == O_register) + opcodep[3] = exp[0].X_add_number; + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 3, + 1, exp, 0, BFD_RELOC_MMIX_REG); + } + break; + } + + /* "0,$Z"; UNSAVE. */ + if (n_operands != 2 + || exp[0].X_op != O_constant + || exp[0].X_add_number != 0 + || exp[1].X_op == O_constant + || (exp[1].X_op == O_register + && exp[1].X_add_number > 255)) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + if (exp[1].X_op == O_register) + opcodep[3] = exp[1].X_add_number; + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 3, + 1, exp + 1, 0, BFD_RELOC_MMIX_REG); + break; + + case mmix_operands_xyz_opt: + /* SWYM, TRIP, TRAP: zero, one, two or three operands. */ + if (n_operands == 0 && ! mmix_gnu_syntax) + /* Zeros are in place - nothing needs to be done for zero + operands. We don't allow this in GNU syntax mode, because it + was believed that the risk of missing to supply an operand is + higher than the benefit of not having to specify a zero. */ + ; + else if (n_operands == 1 && exp[0].X_op != O_register) + { + if (exp[0].X_op == O_constant) + { + if (exp[0].X_add_number > 255*255*255 + || exp[0].X_add_number < 0) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + else + { + opcodep[1] = (exp[0].X_add_number >> 16) & 255; + opcodep[2] = (exp[0].X_add_number >> 8) & 255; + opcodep[3] = exp[0].X_add_number & 255; + } + } + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 1, + 3, exp, 0, BFD_RELOC_24); + } + else if (n_operands == 2 + && exp[0].X_op != O_register + && exp[1].X_op != O_register) + { + /* Two operands. */ + + if (exp[0].X_op == O_constant) + { + if (exp[0].X_add_number > 255 + || exp[0].X_add_number < 0) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + else + opcodep[1] = exp[0].X_add_number & 255; + } + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 1, + 1, exp, 0, BFD_RELOC_8); + + if (exp[1].X_op == O_constant) + { + if (exp[1].X_add_number > 255*255 + || exp[1].X_add_number < 0) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + else + { + opcodep[2] = (exp[1].X_add_number >> 8) & 255; + opcodep[3] = exp[1].X_add_number & 255; + } + } + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 2, + 2, exp + 1, 0, BFD_RELOC_16); + } + else if (n_operands == 3 + && exp[0].X_op != O_register + && exp[1].X_op != O_register + && exp[2].X_op != O_register) + { + /* Three operands. */ + + if (exp[0].X_op == O_constant) + { + if (exp[0].X_add_number > 255 + || exp[0].X_add_number < 0) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + else + opcodep[1] = exp[0].X_add_number & 255; + } + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 1, + 1, exp, 0, BFD_RELOC_8); + + if (exp[1].X_op == O_constant) + { + if (exp[1].X_add_number > 255 + || exp[1].X_add_number < 0) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + else + opcodep[2] = exp[1].X_add_number & 255; + } + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 2, + 1, exp + 1, 0, BFD_RELOC_8); + + if (exp[2].X_op == O_constant) + { + if (exp[2].X_add_number > 255 + || exp[2].X_add_number < 0) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + else + opcodep[3] = exp[2].X_add_number & 255; + } + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 3, + 1, exp + 2, 0, BFD_RELOC_8); + } + else if (n_operands <= 3 + && (strcmp (instruction->name, "trip") == 0 + || strcmp (instruction->name, "trap") == 0)) + { + /* The meaning of operands to TRIP and TRAP are not defined, so + we add combinations not handled above here as we find them. */ + if (n_operands == 3) + { + /* Don't require non-register operands. Always generate + fixups, so we don't have to copy lots of code and create + maintanance problems. TRIP is supposed to be a rare + instruction, so the overhead should not matter. We + aren't allowed to fix_new_exp for an expression which is + an O_register at this point, however. */ + if (exp[0].X_op == O_register) + opcodep[1] = exp[0].X_add_number; + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 1, + 1, exp, 0, BFD_RELOC_MMIX_REG_OR_BYTE); + if (exp[1].X_op == O_register) + opcodep[2] = exp[1].X_add_number; + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 2, + 1, exp + 1, 0, BFD_RELOC_MMIX_REG_OR_BYTE); + if (exp[2].X_op == O_register) + opcodep[3] = exp[2].X_add_number; + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 3, + 1, exp + 2, 0, BFD_RELOC_MMIX_REG_OR_BYTE); + } + else if (n_operands == 2) + { + if (exp[0].X_op == O_register) + opcodep[2] = exp[0].X_add_number; + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 2, + 1, exp, 0, BFD_RELOC_MMIX_REG_OR_BYTE); + if (exp[1].X_op == O_register) + opcodep[3] = exp[1].X_add_number; + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 3, + 1, exp + 1, 0, BFD_RELOC_MMIX_REG_OR_BYTE); + } + else + { + as_bad (_("unsupported operands to %s: `%s'"), + instruction->name, operands); + return; + } + } + else + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + break; + + case mmix_operands_resume: + if (n_operands == 0 && ! mmix_gnu_syntax) + break; + + if (n_operands != 1 + || exp[0].X_op == O_register + || (exp[0].X_op == O_constant + && (exp[0].X_add_number < 0 + || exp[0].X_add_number > 255))) + { + as_bad (_("invalid operands to opcode %s: `%s'"), + instruction->name, operands); + return; + } + + if (exp[0].X_op == O_constant) + opcodep[3] = exp[0].X_add_number; + else + fix_new_exp (opc_fragP, opcodep - opc_fragP->fr_literal + 3, + 1, exp + 0, 0, BFD_RELOC_8); + break; + + case mmix_operands_pushj: + /* All is done for PUSHJ already. */ + break; + + default: + BAD_CASE (instruction->operands); + } +} + +/* For the benefit of insns that start with a digit, we assemble by way of + tc_unrecognized_line too, through this function. */ + +int +mmix_assemble_return_nonzero (str) + char *str; +{ + int last_error_count = had_errors (); + char *s2 = str; + char c; + + /* Normal instruction handling downcases, so we must too. */ + while (ISALNUM (*s2)) + { + if (ISUPPER ((unsigned char) *s2)) + *s2 = TOLOWER (*s2); + s2++; + } + + /* Cut the line for sake of the assembly. */ + for (s2 = str; *s2 && *s2 != '\n'; s2++) + ; + + c = *s2; + *s2 = 0; + md_assemble (str); + *s2 = c; + + return had_errors () == last_error_count; +} + +/* The PREFIX pseudo. */ + +static void +s_prefix (unused) + int unused ATTRIBUTE_UNUSED; +{ + char *p; + int c; + + SKIP_WHITESPACE (); + + p = input_line_pointer; + + c = get_symbol_end (); + + /* Reseting prefix? */ + if (*p == ':' && p[1] == 0) + mmix_current_prefix = NULL; + else + { + /* Put this prefix on the mmix symbols obstack. We could malloc and + free it separately, but then we'd have to worry about that. + People using up memory on prefixes have other problems. */ + obstack_grow (&mmix_sym_obstack, p, strlen (p) + 1); + p = obstack_finish (&mmix_sym_obstack); + + /* Accumulate prefixes, and strip a leading ':'. */ + if (mmix_current_prefix != NULL || *p == ':') + p = mmix_prefix_name (p); + + mmix_current_prefix = p; + } + + *input_line_pointer = c; + + mmix_handle_rest_of_empty_line (); +} + +/* We implement prefixes by using the tc_canonicalize_symbol_name hook, + and store each prefixed name on a (separate) obstack. This means that + the name is on the "notes" obstack in non-prefixed form and on the + mmix_sym_obstack in prefixed form, but currently it is not worth + rewriting the whole GAS symbol handling to improve "hooking" to avoid + that. (It might be worth a rewrite for other reasons, though). */ + +char * +mmix_prefix_name (shortname) + char *shortname; +{ + if (*shortname == ':') + return shortname + 1; + + if (mmix_current_prefix == NULL) + as_fatal (_("internal: mmix_prefix_name but empty prefix")); + + if (*shortname == '$') + return shortname; + + obstack_grow (&mmix_sym_obstack, mmix_current_prefix, + strlen (mmix_current_prefix)); + obstack_grow (&mmix_sym_obstack, shortname, strlen (shortname) + 1); + return obstack_finish (&mmix_sym_obstack); +} + +/* The GREG pseudo. At LABEL, we have the name of a symbol that we + want to make a register symbol, and which should be initialized with + the value in the expression at INPUT_LINE_POINTER (defaulting to 0). + Either and (perhaps less meaningful) both may be missing. LABEL must + be persistent, perhaps allocated on an obstack. */ + +static void +mmix_greg_internal (label) + char *label; +{ + expressionS *expP = &mmix_raw_gregs[n_of_raw_gregs].exp; + + /* Don't set the section to register contents section before the + expression has been parsed; it may refer to the current position. */ + expression (expP); + + /* FIXME: Check that no expression refers to the register contents + section. May need to be done in elf64-mmix.c. */ + if (expP->X_op == O_absent) + { + /* Default to zero if the expression was absent. */ + expP->X_op = O_constant; + expP->X_add_number = 0; + expP->X_unsigned = 0; + expP->X_add_symbol = NULL; + expP->X_op_symbol = NULL; + } + + /* We must handle prefixes here, as we save the labels and expressions + to be output later. */ + mmix_raw_gregs[n_of_raw_gregs].label + = mmix_current_prefix == NULL ? label : mmix_prefix_name (label); + + if (n_of_raw_gregs == MAX_GREGS - 1) + as_bad (_("too many GREG registers allocated (max %d)"), MAX_GREGS); + else + n_of_raw_gregs++; + + mmix_handle_rest_of_empty_line (); +} + +/* The ".greg label,expr" worker. */ + +static void +s_greg (unused) + int unused ATTRIBUTE_UNUSED; +{ + char *p; + char c; + p = input_line_pointer; + + /* This will skip over what can be a symbol and zero out the next + character, which we assume is a ',' or other meaningful delimiter. + What comes after that is the initializer expression for the + register. */ + c = get_symbol_end (); + + if (! is_end_of_line [(unsigned char) c]) + input_line_pointer++; + + if (*p) + { + /* The label must be persistent; it's not used until after all input + has been seen. */ + obstack_grow (&mmix_sym_obstack, p, strlen (p) + 1); + mmix_greg_internal (obstack_finish (&mmix_sym_obstack)); + } + else + mmix_greg_internal (NULL); +} + +/* The "BSPEC expr" worker. */ + +static void +s_bspec (unused) + int unused ATTRIBUTE_UNUSED; +{ + asection *expsec; + asection *sec; + char secname[sizeof (MMIX_OTHER_SPEC_SECTION_PREFIX) + 20] + = MMIX_OTHER_SPEC_SECTION_PREFIX; + expressionS exp; + int n; + + /* Get a constant expression which we can evaluate *now*. Supporting + more complex (though assembly-time computable) expressions is + feasible but Too Much Work for something of unknown usefulness like + BSPEC-ESPEC. */ + expsec = expression (&exp); + mmix_handle_rest_of_empty_line (); + + /* Check that we don't have another BSPEC in progress. */ + if (doing_bspec) + { + as_bad (_("BSPEC already active. Nesting is not supported.")); + return; + } + + if (exp.X_op != O_constant + || expsec != absolute_section + || exp.X_add_number < 0 + || exp.X_add_number > 65535) + { + as_bad (_("invalid BSPEC expression")); + exp.X_add_number = 0; + } + + n = (int) exp.X_add_number; + + sprintf (secname + strlen (MMIX_OTHER_SPEC_SECTION_PREFIX), "%d", n); + sec = bfd_get_section_by_name (stdoutput, secname); + if (sec == NULL) + { + /* We need a non-volatile name as it will be stored in the section + struct. */ + char *newsecname = xstrdup (secname); + sec = bfd_make_section (stdoutput, newsecname); + + if (sec == NULL) + as_fatal (_("can't create section %s"), newsecname); + + if (!bfd_set_section_flags (stdoutput, sec, + bfd_get_section_flags (stdoutput, sec) + | SEC_READONLY)) + as_fatal (_("can't set section flags for section %s"), newsecname); + } + + /* Tell ELF about the pending section change. */ + obj_elf_section_change_hook (); + subseg_set (sec, 0); + + /* Save position for missing ESPEC. */ + as_where (&bspec_file, &bspec_line); + + doing_bspec = 1; +} + +/* The "ESPEC" worker. */ + +static void +s_espec (unused) + int unused ATTRIBUTE_UNUSED; +{ + /* First, check that we *do* have a BSPEC in progress. */ + if (! doing_bspec) + { + as_bad (_("ESPEC without preceding BSPEC")); + return; + } + + mmix_handle_rest_of_empty_line (); + doing_bspec = 0; + + /* When we told ELF about the section change in s_bspec, it stored the + previous section for us so we can get at it with the equivalent of a + .previous pseudo. */ + obj_elf_previous (0); +} + +/* The " .local expr" and " local expr" worker. We make a BFD_MMIX_LOCAL + relocation against the current position against the expression. + Implementing this by means of contents in a section lost. */ + +static void +mmix_s_local (unused) + int unused ATTRIBUTE_UNUSED; +{ + expressionS exp; + + /* Don't set the section to register contents section before the + expression has been parsed; it may refer to the current position in + some contorted way. */ + expression (&exp); + + if (exp.X_op == O_absent) + { + as_bad (_("missing local expression")); + return; + } + else if (exp.X_op == O_register) + { + /* fix_new_exp doesn't like O_register. Should be configurable. + We're fine with a constant here, though. */ + exp.X_op = O_constant; + } + + fix_new_exp (frag_now, 0, 0, &exp, 0, BFD_RELOC_MMIX_LOCAL); + mmix_handle_rest_of_empty_line (); +} + +/* Set fragP->fr_var to the initial guess of the size of a relaxable insn + and return it. Sizes of other instructions are not known. This + function may be called multiple times. */ + +int +md_estimate_size_before_relax (fragP, segment) + fragS *fragP; + segT segment; +{ + int length; + +#define HANDLE_RELAXABLE(state) \ + case ENCODE_RELAX (state, STATE_UNDF): \ + if (fragP->fr_symbol != NULL \ + && S_GET_SEGMENT (fragP->fr_symbol) == segment) \ + { \ + /* The symbol lies in the same segment - a relaxable case. */ \ + fragP->fr_subtype \ + = ENCODE_RELAX (state, STATE_ZERO); \ + } \ + break; + + switch (fragP->fr_subtype) + { + HANDLE_RELAXABLE (STATE_GETA); + HANDLE_RELAXABLE (STATE_BCC); + HANDLE_RELAXABLE (STATE_PUSHJ); + HANDLE_RELAXABLE (STATE_JMP); + + case ENCODE_RELAX (STATE_GETA, STATE_ZERO): + case ENCODE_RELAX (STATE_BCC, STATE_ZERO): + case ENCODE_RELAX (STATE_PUSHJ, STATE_ZERO): + case ENCODE_RELAX (STATE_JMP, STATE_ZERO): + /* When relaxing a section for the second time, we don't need to do + anything except making sure that fr_var is set right. */ + break; + + case STATE_GREG_DEF: + length = fragP->tc_frag_data != NULL ? 0 : 8; + fragP->fr_var = length; + + /* Don't consult the relax_table; it isn't valid for this + relaxation. */ + return length; + break; + + default: + BAD_CASE (fragP->fr_subtype); + } + + length = mmix_relax_table[fragP->fr_subtype].rlx_length; + fragP->fr_var = length; + + return length; +} + +/* Turn a string in input_line_pointer into a floating point constant of type + type, and store the appropriate bytes in *litP. The number of LITTLENUMS + emitted is stored in *sizeP . An error message is returned, or NULL on + OK. */ + +char * +md_atof (type, litP, sizeP) + int type; + char *litP; + int *sizeP; +{ + int prec; + LITTLENUM_TYPE words[4]; + char *t; + int i; + + switch (type) + { + /* FIXME: Having 'f' in mmix_flt_chars (and here) makes it + problematic to also have a forward reference in an expression. + The testsuite wants it, and it's customary. + We'll deal with the real problems when they come; we share the + problem with most other ports. */ + case 'f': + case 'r': + prec = 2; + break; + case 'd': + prec = 4; + break; + default: + *sizeP = 0; + return _("bad call to md_atof"); + } + + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + + *sizeP = prec * 2; + + for (i = 0; i < prec; i++) + { + md_number_to_chars (litP, (valueT) words[i], 2); + litP += 2; + } + return NULL; +} + +/* Convert variable-sized frags into one or more fixups. */ + +void +md_convert_frag (abfd, sec, fragP) + bfd *abfd ATTRIBUTE_UNUSED; + segT sec ATTRIBUTE_UNUSED; + fragS *fragP; +{ + /* Pointer to first byte in variable-sized part of the frag. */ + char *var_partp; + + /* Pointer to first opcode byte in frag. */ + char *opcodep; + + /* Size in bytes of variable-sized part of frag. */ + int var_part_size = 0; + + /* This is part of *fragP. It contains all information about addresses + and offsets to varying parts. */ + symbolS *symbolP; + unsigned long var_part_offset; + + /* This is the frag for the opcode. It, rather than fragP, must be used + when emitting a frag for the opcode. */ + fragS *opc_fragP = fragP->tc_frag_data; + fixS *tmpfixP; + + /* Where, in file space, does addr point? */ + bfd_vma target_address; + bfd_vma opcode_address; + + know (fragP->fr_type == rs_machine_dependent); + + var_part_offset = fragP->fr_fix; + var_partp = fragP->fr_literal + var_part_offset; + opcodep = fragP->fr_opcode; + + symbolP = fragP->fr_symbol; + + target_address + = ((symbolP ? S_GET_VALUE (symbolP) : 0) + fragP->fr_offset); + + /* The opcode that would be extended is the last four "fixed" bytes. */ + opcode_address = fragP->fr_address + fragP->fr_fix - 4; + + switch (fragP->fr_subtype) + { + case ENCODE_RELAX (STATE_GETA, STATE_ZERO): + case ENCODE_RELAX (STATE_BCC, STATE_ZERO): + case ENCODE_RELAX (STATE_PUSHJ, STATE_ZERO): + mmix_set_geta_branch_offset (opcodep, target_address - opcode_address); + if (linkrelax) + { + tmpfixP + = fix_new (opc_fragP, opcodep - opc_fragP->fr_literal, 4, + fragP->fr_symbol, fragP->fr_offset, 1, + BFD_RELOC_MMIX_ADDR19); + COPY_FR_WHERE_TO_FX (fragP, tmpfixP); + } + var_part_size = 0; + break; + + case ENCODE_RELAX (STATE_JMP, STATE_ZERO): + mmix_set_jmp_offset (opcodep, target_address - opcode_address); + if (linkrelax) + { + tmpfixP + = fix_new (opc_fragP, opcodep - opc_fragP->fr_literal, 4, + fragP->fr_symbol, fragP->fr_offset, 1, + BFD_RELOC_MMIX_ADDR27); + COPY_FR_WHERE_TO_FX (fragP, tmpfixP); + } + var_part_size = 0; + break; + + case STATE_GREG_DEF: + if (fragP->tc_frag_data == NULL) + { + tmpfixP + = fix_new (fragP, var_partp - fragP->fr_literal, 8, + fragP->fr_symbol, fragP->fr_offset, 0, BFD_RELOC_64); + COPY_FR_WHERE_TO_FX (fragP, tmpfixP); + mmix_gregs[n_of_cooked_gregs++] = tmpfixP; + var_part_size = 8; + } + else + var_part_size = 0; + break; + +#define HANDLE_MAX_RELOC(state, reloc) \ + case ENCODE_RELAX (state, STATE_MAX): \ + var_part_size \ + = mmix_relax_table[ENCODE_RELAX (state, STATE_MAX)].rlx_length; \ + mmix_fill_nops (var_partp, var_part_size / 4); \ + if (warn_on_expansion) \ + as_warn_where (fragP->fr_file, fragP->fr_line, \ + _("operand out of range, instruction expanded")); \ + tmpfixP = fix_new (fragP, var_partp - fragP->fr_literal - 4, 8, \ + fragP->fr_symbol, fragP->fr_offset, 1, reloc); \ + COPY_FR_WHERE_TO_FX (fragP, tmpfixP); \ + break + + HANDLE_MAX_RELOC (STATE_GETA, BFD_RELOC_MMIX_GETA); + HANDLE_MAX_RELOC (STATE_BCC, BFD_RELOC_MMIX_CBRANCH); + HANDLE_MAX_RELOC (STATE_PUSHJ, BFD_RELOC_MMIX_PUSHJ); + HANDLE_MAX_RELOC (STATE_JMP, BFD_RELOC_MMIX_JMP); + + default: + BAD_CASE (fragP->fr_subtype); + break; + } + + fragP->fr_fix += var_part_size; + fragP->fr_var = 0; +} + +/* Applies the desired value to the specified location. + Also sets up addends for RELA type relocations. + Stolen from tc-mcore.c. + + Note that this function isn't called when linkrelax != 0. */ + +int +md_apply_fix3 (fixP, valp, segment) + fixS * fixP; + valueT * valp; + segT segment; +{ + char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; + /* Note: use offsetT because it is signed, valueT is unsigned. */ + offsetT val = (offsetT) * valp; + segT symsec + = (fixP->fx_addsy == NULL + ? absolute_section : S_GET_SEGMENT (fixP->fx_addsy)); + + /* If the fix is relative to a symbol which is not defined, or, (if + pcrel), not in the same segment as the fix, we cannot resolve it + here. */ + if (fixP->fx_addsy != NULL + && (! S_IS_DEFINED (fixP->fx_addsy) + || S_IS_WEAK (fixP->fx_addsy) + || (fixP->fx_pcrel && symsec != segment) + || (! fixP->fx_pcrel + && symsec != absolute_section + && ((fixP->fx_r_type != BFD_RELOC_MMIX_REG + && fixP->fx_r_type != BFD_RELOC_MMIX_REG_OR_BYTE) + || (symsec != reg_section + && symsec != real_reg_section))))) + { + fixP->fx_done = 0; + return 0; + } + else if (fixP->fx_r_type == BFD_RELOC_MMIX_LOCAL + || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT + || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) + { + /* These are never "fixed". */ + fixP->fx_done = 0; + return 0; + } + else + /* We assume every other relocation is "fixed". */ + fixP->fx_done = 1; + + switch (fixP->fx_r_type) + { + case BFD_RELOC_64: + case BFD_RELOC_32: + case BFD_RELOC_24: + case BFD_RELOC_16: + case BFD_RELOC_8: + case BFD_RELOC_64_PCREL: + case BFD_RELOC_32_PCREL: + case BFD_RELOC_24_PCREL: + case BFD_RELOC_16_PCREL: + case BFD_RELOC_8_PCREL: + md_number_to_chars (buf, val, fixP->fx_size); + break; + + case BFD_RELOC_MMIX_ADDR19: + if (expand_op) + { + /* This shouldn't happen. */ + BAD_CASE (fixP->fx_r_type); + break; + } + /* FALLTHROUGH. */ + case BFD_RELOC_MMIX_GETA: + case BFD_RELOC_MMIX_CBRANCH: + case BFD_RELOC_MMIX_PUSHJ: + /* If this fixup is out of range, punt to the linker to emit an + error. This should only happen with -no-expand. */ + if (val < -(((offsetT) 1 << 19)/2) + || val >= ((offsetT) 1 << 19)/2 - 1 + || (val & 3) != 0) + { + if (warn_on_expansion) + as_warn_where (fixP->fx_file, fixP->fx_line, + _("operand out of range")); + fixP->fx_done = 0; + val = 0; + } + mmix_set_geta_branch_offset (buf, val); + break; + + case BFD_RELOC_MMIX_ADDR27: + if (expand_op) + { + /* This shouldn't happen. */ + BAD_CASE (fixP->fx_r_type); + break; + } + /* FALLTHROUGH. */ + case BFD_RELOC_MMIX_JMP: + /* If this fixup is out of range, punt to the linker to emit an + error. This should only happen with -no-expand. */ + if (val < -(((offsetT) 1 << 27)/2) + || val >= ((offsetT) 1 << 27)/2 - 1 + || (val & 3) != 0) + { + if (warn_on_expansion) + as_warn_where (fixP->fx_file, fixP->fx_line, + _("operand out of range")); + fixP->fx_done = 0; + val = 0; + } + mmix_set_jmp_offset (buf, val); + break; + + case BFD_RELOC_MMIX_REG_OR_BYTE: + if (fixP->fx_addsy != NULL + && (S_GET_SEGMENT (fixP->fx_addsy) != real_reg_section + || S_GET_VALUE (fixP->fx_addsy) > 255) + && S_GET_SEGMENT (fixP->fx_addsy) != absolute_section) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid operands")); + buf[0] = val; + + /* If this reloc is for a Z field, we need to adjust + the opcode if we got a constant here. + FIXME: Can we make this more robust? */ + + if ((fixP->fx_where & 3) == 3 + && (fixP->fx_addsy == NULL + || S_GET_SEGMENT (fixP->fx_addsy) == absolute_section)) + buf[-3] |= IMM_OFFSET_BIT; + + /* We don't want this "symbol" appearing in output, because that + will fail. */ + if (fixP->fx_addsy + && S_GET_SEGMENT (fixP->fx_addsy) == real_reg_section) + symbol_clear_used_in_reloc (fixP->fx_addsy); + break; + + case BFD_RELOC_MMIX_REG: + if (fixP->fx_addsy == NULL + || S_GET_SEGMENT (fixP->fx_addsy) != real_reg_section + || S_GET_VALUE (fixP->fx_addsy) > 255) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid operands")); + *buf = val; + + if (fixP->fx_addsy + && S_GET_SEGMENT (fixP->fx_addsy) == real_reg_section) + symbol_clear_used_in_reloc (fixP->fx_addsy); + break; + + case BFD_RELOC_MMIX_BASE_PLUS_OFFSET: + /* These are never "fixed". */ + fixP->fx_done = 0; + return 0; + + case BFD_RELOC_MMIX_PUSHJ_1: + case BFD_RELOC_MMIX_PUSHJ_2: + case BFD_RELOC_MMIX_PUSHJ_3: + case BFD_RELOC_MMIX_CBRANCH_J: + case BFD_RELOC_MMIX_CBRANCH_1: + case BFD_RELOC_MMIX_CBRANCH_2: + case BFD_RELOC_MMIX_CBRANCH_3: + case BFD_RELOC_MMIX_GETA_1: + case BFD_RELOC_MMIX_GETA_2: + case BFD_RELOC_MMIX_GETA_3: + case BFD_RELOC_MMIX_JMP_1: + case BFD_RELOC_MMIX_JMP_2: + case BFD_RELOC_MMIX_JMP_3: + default: + BAD_CASE (fixP->fx_r_type); + break; + } + + if (fixP->fx_done) + /* Make sure that for completed fixups we have the value around for + use by e.g. mmix_frob_file. */ + fixP->fx_offset = val; + + return 0; /* Return value is ignored. */ +} + +/* A bsearch function for looking up a value against offsets for GREG + definitions. */ + +static int +cmp_greg_val_greg_symbol_fixes (p1, p2) + const PTR p1; + const PTR p2; +{ + offsetT val1 = *(offsetT *) p1; + offsetT val2 = ((struct mmix_symbol_greg_fixes *) p2)->offs; + + if (val1 >= val2 && val1 < val2 + 255) + return 0; + + if (val1 > val2) + return 1; + + return -1; +} + +/* Generate a machine-dependent relocation. */ + +arelent * +tc_gen_reloc (section, fixP) + asection *section ATTRIBUTE_UNUSED; + fixS *fixP; +{ + bfd_signed_vma val + = fixP->fx_offset + (fixP->fx_addsy ? S_GET_VALUE (fixP->fx_addsy) : 0); + arelent *relP; + bfd_reloc_code_real_type code = BFD_RELOC_NONE; + char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; + symbolS *addsy = fixP->fx_addsy; + asection *addsec = addsy == NULL ? NULL : S_GET_SEGMENT (addsy); + bfd_vma addend = fixP->fx_offset; + asymbol *baddsy = addsy != NULL ? symbol_get_bfdsym (addsy) : NULL; + + /* A single " LOCAL expression" in the wrong section will not work when + linking to MMO; relocations for zero-content sections are then + ignored. Normally, relocations would modify section contents, and + you'd never think or be able to do something like that. The + relocation resulting from a LOCAL directive doesn't have an obvious + and mandatory location. I can't figure out a way to do this better + than just helping the user around this limitation here; hopefully the + code using the local expression is around. Putting the LOCAL + semantics in a relocation still seems right; a section didn't do. */ + if (bfd_section_size (section->owner, section) == 0) + as_bad_where + (fixP->fx_file, fixP->fx_line, + fixP->fx_r_type == BFD_RELOC_MMIX_LOCAL + /* The BFD_RELOC_MMIX_LOCAL-specific message is supposed to be + user-friendly, though a little bit non-substantial. */ + ? _("directive LOCAL must be placed in code or data") + : _("internal confusion: relocation in a section without contents")); + + /* FIXME: Range tests for all these. */ + switch (fixP->fx_r_type) + { + case BFD_RELOC_64: + case BFD_RELOC_32: + case BFD_RELOC_24: + case BFD_RELOC_16: + case BFD_RELOC_8: + code = fixP->fx_r_type; + + if (addsy == NULL + || bfd_is_abs_section (S_GET_SEGMENT (addsy))) + { + /* Resolve this reloc now, as md_apply_fix3 would have done (not + called if -linkrelax). There is no point in keeping a reloc + to an absolute symbol. No reloc that is subject to + relaxation must be to an absolute symbol; difference + involving symbols in a specific section must be signalled as + an error if the relaxing cannot be expressed; having a reloc + to the resolved (now absolute) value does not help. */ + md_number_to_chars (buf, val, fixP->fx_size); + return NULL; + } + break; + + case BFD_RELOC_64_PCREL: + case BFD_RELOC_32_PCREL: + case BFD_RELOC_24_PCREL: + case BFD_RELOC_16_PCREL: + case BFD_RELOC_8_PCREL: + case BFD_RELOC_MMIX_LOCAL: + case BFD_RELOC_VTABLE_INHERIT: + case BFD_RELOC_VTABLE_ENTRY: + case BFD_RELOC_MMIX_GETA: + case BFD_RELOC_MMIX_GETA_1: + case BFD_RELOC_MMIX_GETA_2: + case BFD_RELOC_MMIX_GETA_3: + case BFD_RELOC_MMIX_CBRANCH: + case BFD_RELOC_MMIX_CBRANCH_J: + case BFD_RELOC_MMIX_CBRANCH_1: + case BFD_RELOC_MMIX_CBRANCH_2: + case BFD_RELOC_MMIX_CBRANCH_3: + case BFD_RELOC_MMIX_PUSHJ: + case BFD_RELOC_MMIX_PUSHJ_1: + case BFD_RELOC_MMIX_PUSHJ_2: + case BFD_RELOC_MMIX_PUSHJ_3: + case BFD_RELOC_MMIX_JMP: + case BFD_RELOC_MMIX_JMP_1: + case BFD_RELOC_MMIX_JMP_2: + case BFD_RELOC_MMIX_JMP_3: + case BFD_RELOC_MMIX_ADDR19: + case BFD_RELOC_MMIX_ADDR27: + code = fixP->fx_r_type; + break; + + case BFD_RELOC_MMIX_REG_OR_BYTE: + /* If we have this kind of relocation to an unknown symbol or to the + register contents section (that is, to a register), then we can't + resolve the relocation here. */ + if (addsy != NULL + && (bfd_is_und_section (S_GET_SEGMENT (addsy)) + || strcmp (bfd_get_section_name (addsec->owner, addsec), + MMIX_REG_CONTENTS_SECTION_NAME) == 0)) + { + code = fixP->fx_r_type; + break; + } + + /* If the relocation is not to the register section or to the + absolute section (a numeric value), then we have an error. */ + if (addsy != NULL + && (S_GET_SEGMENT (addsy) != real_reg_section + || val > 255 + || val < 0) + && ! bfd_is_abs_section (S_GET_SEGMENT (addsy))) + goto badop; + + /* Set the "immediate" bit of the insn if this relocation is to Z + field when the value is a numeric value, i.e. not a register. */ + if ((fixP->fx_where & 3) == 3 + && (addsy == NULL + || S_GET_SEGMENT (addsy) == absolute_section)) + buf[-3] |= IMM_OFFSET_BIT; + + buf[0] = val; + return NULL; + + case BFD_RELOC_MMIX_BASE_PLUS_OFFSET: + if (addsy != NULL + && strcmp (bfd_get_section_name (addsec->owner, addsec), + MMIX_REG_CONTENTS_SECTION_NAME) == 0) + { + /* This changed into a register; the relocation is for the + register-contents section. The constant part remains zero. */ + code = BFD_RELOC_MMIX_REG; + break; + } + + /* If we've found out that this was indeed a register, then replace + with the register number. The constant part is already zero. + + If we encounter any other defined symbol, then we must find a + suitable register and emit a reloc. */ + if (addsy == NULL + || S_GET_SEGMENT (addsy) != real_reg_section) + { + struct mmix_symbol_gregs *gregs; + struct mmix_symbol_greg_fixes *fix; + + if (S_IS_DEFINED (addsy)) + { + if (! symbol_section_p (addsy) + && ! bfd_is_abs_section (S_GET_SEGMENT (addsy))) + as_fatal (_("internal: BFD_RELOC_MMIX_BASE_PLUS_OFFSET not resolved to section")); + + /* If this is an absolute symbol sufficiently near + lowest_data_loc, then we canonicalize on the data + section. Note that val is signed here; we may subtract + lowest_data_loc which is unsigned. Careful with those + comparisons. */ + if (lowest_data_loc != (bfd_vma) -1 + && (bfd_vma) val + 256 > lowest_data_loc + && bfd_is_abs_section (S_GET_SEGMENT (addsy))) + { + val -= (offsetT) lowest_data_loc; + addsy = section_symbol (data_section); + } + /* Likewise text section. */ + else if (lowest_text_loc != (bfd_vma) -1 + && (bfd_vma) val + 256 > lowest_text_loc + && bfd_is_abs_section (S_GET_SEGMENT (addsy))) + { + val -= (offsetT) lowest_text_loc; + addsy = section_symbol (text_section); + } + } + + gregs = *symbol_get_tc (addsy); + + /* If that symbol does not have any associated GREG definitions, + we can't do anything. FIXME: implement allocate-on-demand in + the linker. */ + if (gregs == NULL + || (fix = bsearch (&val, gregs->greg_fixes, gregs->n_gregs, + sizeof (gregs->greg_fixes[0]), + cmp_greg_val_greg_symbol_fixes)) == NULL + /* The register must not point *after* the address we want. */ + || fix->offs > val + /* Neither must the register point more than 255 bytes + before the address we want. */ + || fix->offs + 255 < val) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("no suitable GREG definition for operands")); + return NULL; + } + else + { + /* Transform the base-plus-offset reloc for the actual area + to a reloc for the register with the address of the area. + Put addend for register in Z operand. */ + buf[1] = val - fix->offs; + code = BFD_RELOC_MMIX_REG; + baddsy + = (bfd_get_section_by_name (stdoutput, + MMIX_REG_CONTENTS_SECTION_NAME) + ->symbol); + + addend = fix->fix->fx_frag->fr_address + fix->fix->fx_where; + } + } + else if (S_GET_VALUE (addsy) > 255) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid operands")); + else + { + *buf = val; + return NULL; + } + break; + + case BFD_RELOC_MMIX_REG: + if (addsy != NULL + && (bfd_is_und_section (S_GET_SEGMENT (addsy)) + || strcmp (bfd_get_section_name (addsec->owner, addsec), + MMIX_REG_CONTENTS_SECTION_NAME) == 0)) + { + code = fixP->fx_r_type; + break; + } + + if (addsy != NULL + && (S_GET_SEGMENT (addsy) != real_reg_section + || val > 255 + || val < 0) + && ! bfd_is_und_section (S_GET_SEGMENT (addsy))) + /* Drop through to error message. */ + ; + else + { + buf[0] = val; + return NULL; + } + /* FALLTHROUGH. */ + + /* The others are supposed to be handled by md_apply_fix3. + FIXME: ... which isn't called when -linkrelax. Move over + md_apply_fix3 code here for everything reasonable. */ + badop: + default: + as_bad_where + (fixP->fx_file, fixP->fx_line, + _("operands were not reducible at assembly-time")); + + /* Unmark this symbol as used in a reloc, so we don't bump into a BFD + assert when trying to output reg_section. FIXME: A gas bug. */ + if (addsy) + symbol_clear_used_in_reloc (addsy); + return NULL; + } + + relP = (arelent *) xmalloc (sizeof (arelent)); + assert (relP != 0); + relP->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *relP->sym_ptr_ptr = baddsy; + relP->address = fixP->fx_frag->fr_address + fixP->fx_where; + + relP->addend = addend; + + /* If this had been a.out, we would have had a kludge for weak symbols + here. */ + + relP->howto = bfd_reloc_type_lookup (stdoutput, code); + if (! relP->howto) + { + const char *name; + + name = S_GET_NAME (addsy); + if (name == NULL) + name = _("<unknown>"); + as_fatal (_("cannot generate relocation type for symbol %s, code %s"), + name, bfd_get_reloc_code_name (code)); + } + + return relP; +} + +/* Do some reformatting of a line. FIXME: We could transform a mmixal + line into traditional (GNU?) format, unless #NO_APP, and get rid of all + ugly labels_without_colons etc. */ + +void +mmix_handle_mmixal () +{ + char *s0 = input_line_pointer; + char *s; + char *label = NULL; + char c; + + if (pending_label != NULL) + as_fatal (_("internal: unhandled label %s"), pending_label); + + if (mmix_gnu_syntax) + return; + + /* If the first character is a '.', then it's a pseudodirective, not a + label. Make GAS not handle label-without-colon on this line. We + also don't do mmixal-specific stuff on this line. */ + if (input_line_pointer[0] == '.') + { + label_without_colon_this_line = 0; + return; + } + + /* Don't handle empty lines here. */ + while (1) + { + if (*s0 == 0 || is_end_of_line [(unsigned int) *s0]) + return; + + if (! ISSPACE (*s0)) + break; + + s0++; + } + + /* If we're on a line with a label, check if it's a mmixal fb-label. + Save an indicator and skip the label; it must be set only after all + fb-labels of expressions are evaluated. */ + if (ISDIGIT (input_line_pointer[0]) + && input_line_pointer[1] == 'H' + && ISSPACE (input_line_pointer[2])) + { + char *s; + current_fb_label = input_line_pointer[0] - '0'; + + /* We have to skip the label, but also preserve the newlineness of + the previous character, since the caller checks that. It's a + mess we blame on the caller. */ + input_line_pointer[1] = input_line_pointer[-1]; + input_line_pointer += 2; + + s = input_line_pointer; + while (*s && ISSPACE (*s) && ! is_end_of_line[(unsigned int) *s]) + s++; + + /* For errors emitted here, the book-keeping is off by one; the + caller is about to bump the counters. Adjust the error messages. */ + if (is_end_of_line [(unsigned int) *s]) + { + char *name; + unsigned int line; + as_where (&name, &line); + as_bad_where (name, line + 1, + _("[0-9]H labels may not appear alone on a line")); + current_fb_label = -1; + } + if (*s == '.') + { + char *name; + unsigned int line; + as_where (&name, &line); + as_bad_where (name, line + 1, + _("[0-9]H labels do not mix with dot-pseudos")); + current_fb_label = -1; + } + } + else + { + current_fb_label = -1; + if (is_name_beginner (input_line_pointer[0])) + label = input_line_pointer; + } + + s0 = input_line_pointer; + /* Skip over label. */ + while (*s0 && is_part_of_name (*s0)) + s0++; + + /* Remove trailing ":" off labels, as they'd otherwise be considered + part of the name. But don't do it for local labels. */ + if (s0 != input_line_pointer && s0[-1] == ':' + && (s0 - 2 != input_line_pointer + || ! ISDIGIT (s0[-2]))) + s0[-1] = ' '; + else if (label != NULL) + { + /* For labels that don't end in ":", we save it so we can later give + it the same alignment and address as the associated instruction. */ + + /* Make room for the label including the ending nul. */ + int len_0 = s0 - label + 1; + + /* Save this label on the MMIX symbol obstack. Saving it on an + obstack is needless for "IS"-pseudos, but it's harmless and we + avoid a little code-cluttering. */ + obstack_grow (&mmix_sym_obstack, label, len_0); + pending_label = obstack_finish (&mmix_sym_obstack); + pending_label[len_0 - 1] = 0; + } + + while (*s0 && ISSPACE (*s0) && ! is_end_of_line [(unsigned int) *s0]) + s0++; + + if (pending_label != NULL && is_end_of_line [(unsigned int) *s0]) + /* Whoops, this was actually a lone label on a line. Like :-ended + labels, we don't attach such labels to the next instruction or + pseudo. */ + pending_label = NULL; + + /* Find local labels of operands. Look for "[0-9][FB]" where the + characters before and after are not part of words. Break if a single + or double quote is seen anywhere. It means we can't have local + labels as part of list with mixed quoted and unquoted members for + mmixal compatibility but we can't have it all. For the moment. + Replace the '<N>B' or '<N>F' with MAGIC_FB_BACKWARD_CHAR<N> and + MAGIC_FB_FORWARD_CHAR<N> respectively. */ + + /* First make sure we don't have any of the magic characters on the line + appearing as input. */ + s = s0; + while (*s) + { + c = *s++; + if (is_end_of_line [(unsigned int) c]) + break; + if (c == MAGIC_FB_BACKWARD_CHAR || c == MAGIC_FB_FORWARD_CHAR) + as_bad (_("invalid characters in input")); + } + + /* Scan again, this time looking for ';' after operands. */ + s = s0; + + /* Skip the insn. */ + while (*s + && ! ISSPACE (*s) + && *s != ';' + && ! is_end_of_line[(unsigned int) *s]) + s++; + + /* Skip the spaces after the insn. */ + while (*s + && ISSPACE (*s) + && *s != ';' + && ! is_end_of_line[(unsigned int) *s]) + s++; + + /* Skip the operands. While doing this, replace [0-9][BF] with + (MAGIC_FB_BACKWARD_CHAR|MAGIC_FB_FORWARD_CHAR)[0-9]. */ + while ((c = *s) != 0 + && ! ISSPACE (c) + && c != ';' + && ! is_end_of_line[(unsigned int) c]) + { + if (c == '"') + { + s++; + + /* FIXME: Test-case for semi-colon in string. */ + while (*s + && *s != '"' + && (! is_end_of_line [(unsigned int) *s] || *s == ';')) + s++; + + if (*s == '"') + s++; + } + else if (ISDIGIT (c)) + { + if ((s[1] != 'B' && s[1] != 'F') + || is_part_of_name (s[-1]) + || is_part_of_name (s[2])) + s++; + else + { + s[0] = (s[1] == 'B' + ? MAGIC_FB_BACKWARD_CHAR : MAGIC_FB_FORWARD_CHAR); + s[1] = c; + } + } + else + s++; + } + + /* Skip any spaces after the operands. */ + while (*s + && ISSPACE (*s) + && *s != ';' + && !is_end_of_line[(unsigned int) *s]) + s++; + + /* If we're now looking at a semi-colon, then it's an end-of-line + delimiter. */ + mmix_next_semicolon_is_eoln = (*s == ';'); + + /* Make IS into an EQU by replacing it with "= ". Only match upper-case + though; let lower-case be a syntax error. */ + s = s0; + if (s[0] == 'I' && s[1] == 'S' && ISSPACE (s[2])) + { + *s = '='; + s[1] = ' '; + + /* Since labels can start without ":", we have to handle "X IS 42" + in full here, or "X" will be parsed as a label to be set at ".". */ + input_line_pointer = s; + + /* Right after this function ends, line numbers will be bumped if + input_line_pointer[-1] = '\n'. We want accurate line numbers for + the equals call, so we bump them before the call, and make sure + they aren't bumped afterwards. */ + bump_line_counters (); + + /* A fb-label is valid as an IS-label. */ + if (current_fb_label >= 0) + { + char *fb_name; + + /* We need to save this name on our symbol obstack, since the + string we got in fb_label_name is volatile and will change + with every call to fb_label_name, like those resulting from + parsing the IS-operand. */ + fb_name = fb_label_name (current_fb_label, 1); + obstack_grow (&mmix_sym_obstack, fb_name, strlen (fb_name) + 1); + equals (obstack_finish (&mmix_sym_obstack), 0); + fb_label_instance_inc (current_fb_label); + current_fb_label = -1; + } + else + { + if (pending_label == NULL) + as_bad (_("empty label field for IS")); + else + equals (pending_label, 0); + pending_label = NULL; + } + + /* For mmixal, we can have comments without a comment-start + character. */ + mmix_handle_rest_of_empty_line (); + input_line_pointer--; + + input_line_pointer[-1] = ' '; + } + else if (s[0] == 'G' + && s[1] == 'R' + && strncmp (s, "GREG", 4) == 0 + && (ISSPACE (s[4]) || is_end_of_line[(unsigned char) s[4]])) + { + input_line_pointer = s + 4; + + /* Right after this function ends, line numbers will be bumped if + input_line_pointer[-1] = '\n'. We want accurate line numbers for + the s_greg call, so we bump them before the call, and make sure + they aren't bumped afterwards. */ + bump_line_counters (); + + /* A fb-label is valid as a GREG-label. */ + if (current_fb_label >= 0) + { + char *fb_name; + + /* We need to save this name on our symbol obstack, since the + string we got in fb_label_name is volatile and will change + with every call to fb_label_name, like those resulting from + parsing the IS-operand. */ + fb_name = fb_label_name (current_fb_label, 1); + + /* Make sure we save the canonical name and don't get bitten by + prefixes. */ + obstack_1grow (&mmix_sym_obstack, ':'); + obstack_grow (&mmix_sym_obstack, fb_name, strlen (fb_name) + 1); + mmix_greg_internal (obstack_finish (&mmix_sym_obstack)); + fb_label_instance_inc (current_fb_label); + current_fb_label = -1; + } + else + mmix_greg_internal (pending_label); + + /* Back up before the end-of-line marker that was skipped in + mmix_greg_internal. */ + input_line_pointer--; + input_line_pointer[-1] = ' '; + + pending_label = NULL; + } + else if (pending_label != NULL) + { + input_line_pointer += strlen (pending_label); + + /* See comment above about getting line numbers bumped. */ + input_line_pointer[-1] = '\n'; + } +} + +/* Give the value of an fb-label rewritten as in mmix_handle_mmixal, when + parsing an expression. + + On valid calls, input_line_pointer points at a MAGIC_FB_BACKWARD_CHAR + or MAGIC_FB_BACKWARD_CHAR, followed by an ascii digit for the label. + We fill in the label as an expression. */ + +void +mmix_fb_label (expP) + expressionS *expP; +{ + symbolS *sym; + char *fb_internal_name; + + /* This doesn't happen when not using mmixal syntax. */ + if (mmix_gnu_syntax + || (input_line_pointer[0] != MAGIC_FB_BACKWARD_CHAR + && input_line_pointer[0] != MAGIC_FB_FORWARD_CHAR)) + return; + + /* The current backward reference has augmentation 0. A forward + reference has augmentation 1, unless it's the same as a fb-label on + _this_ line, in which case we add one more so we don't refer to it. + This is the semantics of mmixal; it differs to that of common + fb-labels which refer to a here-label on the current line as a + backward reference. */ + fb_internal_name + = fb_label_name (input_line_pointer[1] - '0', + (input_line_pointer[0] == MAGIC_FB_FORWARD_CHAR ? 1 : 0) + + ((input_line_pointer[1] - '0' == current_fb_label + && input_line_pointer[0] == MAGIC_FB_FORWARD_CHAR) + ? 1 : 0)); + + input_line_pointer += 2; + sym = symbol_find_or_make (fb_internal_name); + + /* We don't have to clean up unrelated fields here; we just do what the + expr machinery does, but *not* just what it does for [0-9][fb], since + we need to treat those as ordinary symbols sometimes; see testcases + err-byte2.s and fb-2.s. */ + if (S_GET_SEGMENT (sym) == absolute_section) + { + expP->X_op = O_constant; + expP->X_add_number = S_GET_VALUE (sym); + } + else + { + expP->X_op = O_symbol; + expP->X_add_symbol = sym; + expP->X_add_number = 0; + } +} + +/* See whether we need to force a relocation into the output file. + This is used to force out switch and PC relative relocations when + relaxing. */ + +int +mmix_force_relocation (fixP) + fixS * fixP; +{ + if (fixP->fx_r_type == BFD_RELOC_MMIX_LOCAL + || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT + || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY + || fixP->fx_r_type == BFD_RELOC_MMIX_BASE_PLUS_OFFSET) + return 1; + + /* FIXME: This is dubious. Handling of weak symbols should have been + caught before we get here. */ + if ((fixP->fx_addsy && S_IS_WEAK (fixP->fx_addsy))) + return 1; + + if (linkrelax) + return 1; + + /* All our pcrel relocations are must-keep. Note that md_apply_fix3 is + called *after* this, and will handle getting rid of the presumed + reloc; a relocation isn't *forced* other than to be handled by + md_apply_fix3 (or tc_gen_reloc if linkrelax). */ + if (fixP->fx_pcrel) + return 1; + + return 0; +} + +/* The location from which a PC relative jump should be calculated, + given a PC relative reloc. */ + +long +md_pcrel_from_section (fixP, sec) + fixS * fixP; + segT sec; +{ + if (fixP->fx_addsy != (symbolS *) NULL + && (! S_IS_DEFINED (fixP->fx_addsy) + || S_GET_SEGMENT (fixP->fx_addsy) != sec)) + { + /* The symbol is undefined (or is defined but not in this section). + Let the linker figure it out. */ + return 0; + } + + return (fixP->fx_frag->fr_address + fixP->fx_where); +} + +/* Adjust the symbol table. We make reg_section relative to the real + register section. + + FIXME: There's a gas bug; should be fixed when the reg_section symbol + is "accidentally" saved for relocs which are really fixups that will be + fixed up. */ + +void +mmix_adjust_symtab () +{ + symbolS *sym; + symbolS *prevsym; + symbolS *regsec = section_symbol (reg_section); + segT realregsec = NULL; + + for (prevsym = sym = symbol_rootP; + sym != NULL; + prevsym = sym, sym = symbol_next (sym)) + if (S_GET_SEGMENT (sym) == reg_section) + { + if (sym == regsec + || (!S_IS_EXTERN (sym) && !symbol_used_in_reloc_p (sym))) + { + symbol_remove (sym, &symbol_rootP, &symbol_lastP); + + /* We make one extra turn, or we'll lose the next symbol. We + assume that the symbol we remove is not the symbol root + (.text normally is). */ + sym = prevsym; + } + else + { + /* Change section to the *real* register section, so it gets + proper treatment when writing it out. Only do this for + global symbols. This also means we don't have to check for + $0..$255. */ + if (realregsec == NULL) + realregsec + = bfd_make_section_old_way (stdoutput, MMIX_REG_SECTION_NAME); + + S_SET_SEGMENT (sym, realregsec); + } + } +} + +/* This is the expansion of LABELS_WITHOUT_COLONS. + We let md_start_line_hook tweak label_without_colon_this_line, and then + this function returns the tweaked value, and sets it to 1 for the next + line. FIXME: Very, very brittle. Not sure it works the way I + thought at the time I first wrote this. */ + +int +mmix_label_without_colon_this_line () +{ + int retval = label_without_colon_this_line; + + if (! mmix_gnu_syntax) + label_without_colon_this_line = 1; + + return retval; +} + +/* This is the expansion of md_relax_frag. We go through the ordinary + relax table function except when the frag is for a GREG. Then we have + to check whether there's another GREG by the same value that we can + join with. */ + +long +mmix_md_relax_frag (seg, fragP, stretch) + segT seg; + fragS *fragP; + long stretch; +{ + if (fragP->fr_subtype != STATE_GREG_DEF + && fragP->fr_subtype != STATE_GREG_UNDF) + return relax_frag (seg, fragP, stretch); + + /* If we're defined, we don't grow. */ + if (fragP->fr_subtype == STATE_GREG_DEF) + return 0; + + as_fatal (_("internal: unexpected relax type %d:%d"), + fragP->fr_type, fragP->fr_subtype); + return 0; +} + +/* Various things we punt until all input is seen. */ + +void +mmix_md_end () +{ + fragS *fragP; + symbolS *mainsym; + int i; + + /* The first frag of GREG:s going into the register contents section. */ + fragS *mmix_reg_contents_frags = NULL; + + /* Reset prefix. All labels reachable at this point must be + canonicalized. */ + mmix_current_prefix = NULL; + + if (doing_bspec) + as_bad_where (bspec_file, bspec_line, _("BSPEC without ESPEC.")); + + /* Emit the low LOC setting of .text. */ + if (text_has_contents && lowest_text_loc != (bfd_vma) -1) + { + symbolS *symbolP; + char locsymbol[sizeof (":") - 1 + + sizeof (MMIX_LOC_SECTION_START_SYMBOL_PREFIX) - 1 + + sizeof (".text")]; + + /* An exercise in non-ISO-C-ness, this one. */ + sprintf (locsymbol, ":%s%s", MMIX_LOC_SECTION_START_SYMBOL_PREFIX, + ".text"); + symbolP + = symbol_new (locsymbol, absolute_section, lowest_text_loc, + &zero_address_frag); + S_SET_EXTERNAL (symbolP); + } + + /* Ditto .data. */ + if (data_has_contents && lowest_data_loc != (bfd_vma) -1) + { + symbolS *symbolP; + char locsymbol[sizeof (":") - 1 + + sizeof (MMIX_LOC_SECTION_START_SYMBOL_PREFIX) - 1 + + sizeof (".data")]; + + sprintf (locsymbol, ":%s%s", MMIX_LOC_SECTION_START_SYMBOL_PREFIX, + ".data"); + symbolP + = symbol_new (locsymbol, absolute_section, lowest_data_loc, + &zero_address_frag); + S_SET_EXTERNAL (symbolP); + } + + /* Unless GNU syntax mode, set "Main" to be a function, so the + disassembler doesn't get confused when we write truly + mmixal-compatible code (and don't use .type). Similarly set it + global (regardless of -globalize-symbols), so the linker sees it as + the start symbol in ELF mode. */ + mainsym = symbol_find (MMIX_START_SYMBOL_NAME); + if (mainsym != NULL && ! mmix_gnu_syntax) + { + symbol_get_bfdsym (mainsym)->flags |= BSF_FUNCTION; + S_SET_EXTERNAL (mainsym); + } + + if (n_of_raw_gregs != 0) + { + /* Emit GREGs. They are collected in order of appearance, but must + be emitted in opposite order to both have section address regno*8 + and the same allocation order (within a file) as mmixal. */ + segT this_segment = now_seg; + subsegT this_subsegment = now_subseg; + asection *regsec + = bfd_make_section_old_way (stdoutput, + MMIX_REG_CONTENTS_SECTION_NAME); + subseg_set (regsec, 0); + + /* Finally emit the initialization-value. Emit a variable frag, which + we'll fix in md_estimate_size_before_relax. We set the initializer + for the tc_frag_data field to NULL, so we can use that field for + relaxation purposes. */ + mmix_opcode_frag = NULL; + + frag_grow (0); + mmix_reg_contents_frags = frag_now; + + for (i = n_of_raw_gregs - 1; i >= 0; i--) + { + if (mmix_raw_gregs[i].label != NULL) + /* There's a symbol. Let it refer to this location in the + register contents section. The symbol must be globalized + separately. */ + colon (mmix_raw_gregs[i].label); + + frag_var (rs_machine_dependent, 8, 0, STATE_GREG_UNDF, + make_expr_symbol (&mmix_raw_gregs[i].exp), 0, NULL); + } + + subseg_set (this_segment, this_subsegment); + } + + /* Iterate over frags resulting from GREGs and move those that evidently + have the same value together and point one to another. + + This works in time O(N^2) but since the upper bound for non-error use + is 223, it's best to keep this simpler algorithm. */ + for (fragP = mmix_reg_contents_frags; fragP != NULL; fragP = fragP->fr_next) + { + fragS **fpp; + fragS *fp = NULL; + fragS *osymfrag; + offsetT osymval; + expressionS *oexpP; + symbolS *symbolP = fragP->fr_symbol; + + if (fragP->fr_type != rs_machine_dependent + || fragP->fr_subtype != STATE_GREG_UNDF) + continue; + + /* Whatever the outcome, we will have this GREG judged merged or + non-merged. Since the tc_frag_data is NULL at this point, we + default to non-merged. */ + fragP->fr_subtype = STATE_GREG_DEF; + + /* If we're not supposed to merge GREG definitions, then just don't + look for equivalents. */ + if (! merge_gregs) + continue; + + osymval = (offsetT) S_GET_VALUE (symbolP); + osymfrag = symbol_get_frag (symbolP); + + /* If the symbol isn't defined, we can't say that another symbol + equals this frag, then. FIXME: We can look at the "deepest" + defined name; if a = c and b = c then obviously a == b. */ + if (! S_IS_DEFINED (symbolP)) + continue; + + oexpP = symbol_get_value_expression (fragP->fr_symbol); + + /* If the initialization value is zero, then we must not merge them. */ + if (oexpP->X_op == O_constant && osymval == 0) + continue; + + /* Iterate through the frags downward this one. If we find one that + has the same non-zero value, move it to after this one and point + to it as the equivalent. */ + for (fpp = &fragP->fr_next; *fpp != NULL; fpp = &fpp[0]->fr_next) + { + fp = *fpp; + + if (fp->fr_type != rs_machine_dependent + || fp->fr_subtype != STATE_GREG_UNDF) + continue; + + /* Calling S_GET_VALUE may simplify the symbol, changing from + expr_section etc. so call it first. */ + if ((offsetT) S_GET_VALUE (fp->fr_symbol) == osymval + && symbol_get_frag (fp->fr_symbol) == osymfrag) + { + /* Move the frag links so the one we found equivalent comes + after the current one, carefully considering that + sometimes fpp == &fragP->fr_next and the moves must be a + NOP then. */ + *fpp = fp->fr_next; + fp->fr_next = fragP->fr_next; + fragP->fr_next = fp; + break; + } + } + + if (*fpp != NULL) + fragP->tc_frag_data = fp; + } +} + +/* qsort function for mmix_symbol_gregs. */ + +static int +cmp_greg_symbol_fixes (parg, qarg) + const PTR parg; + const PTR qarg; +{ + const struct mmix_symbol_greg_fixes *p + = (const struct mmix_symbol_greg_fixes *) parg; + const struct mmix_symbol_greg_fixes *q + = (const struct mmix_symbol_greg_fixes *) qarg; + + return p->offs > q->offs ? 1 : p->offs < q->offs ? -1 : 0; +} + +/* Collect GREG definitions from mmix_gregs and hang them as lists sorted + on increasing offsets onto each section symbol or undefined symbol. + + Also, remove the register convenience section so it doesn't get output + as an ELF section. */ + +void +mmix_frob_file () +{ + int i; + struct mmix_symbol_gregs *all_greg_symbols[MAX_GREGS]; + int n_greg_symbols = 0; + + /* Collect all greg fixups and decorate each corresponding symbol with + the greg fixups for it. */ + for (i = 0; i < n_of_cooked_gregs; i++) + { + offsetT offs; + symbolS *sym; + struct mmix_symbol_gregs *gregs; + fixS *fixP; + + fixP = mmix_gregs[i]; + know (fixP->fx_r_type == BFD_RELOC_64); + + /* This case isn't doable in general anyway, methinks. */ + if (fixP->fx_subsy != NULL) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("GREG expression too complicated")); + continue; + } + + sym = fixP->fx_addsy; + offs = (offsetT) fixP->fx_offset; + + /* If the symbol is defined, then it must be resolved to a section + symbol at this time, or else we don't know how to handle it. */ + if (S_IS_DEFINED (sym)) + { + if (! symbol_section_p (sym) + && ! bfd_is_abs_section (S_GET_SEGMENT (sym))) + as_fatal (_("internal: GREG expression not resolved to section")); + + offs += S_GET_VALUE (sym); + } + + /* If this is an absolute symbol sufficiently near lowest_data_loc, + then we canonicalize on the data section. Note that offs is + signed here; we may subtract lowest_data_loc which is unsigned. + Careful with those comparisons. */ + if (lowest_data_loc != (bfd_vma) -1 + && (bfd_vma) offs + 256 > lowest_data_loc + && bfd_is_abs_section (S_GET_SEGMENT (sym))) + { + offs -= (offsetT) lowest_data_loc; + sym = section_symbol (data_section); + } + /* Likewise text section. */ + else if (lowest_text_loc != (bfd_vma) -1 + && (bfd_vma) offs + 256 > lowest_text_loc + && bfd_is_abs_section (S_GET_SEGMENT (sym))) + { + offs -= (offsetT) lowest_text_loc; + sym = section_symbol (text_section); + } + + gregs = *symbol_get_tc (sym); + + if (gregs == NULL) + { + gregs = xmalloc (sizeof (*gregs)); + gregs->n_gregs = 0; + symbol_set_tc (sym, &gregs); + all_greg_symbols[n_greg_symbols++] = gregs; + } + + gregs->greg_fixes[gregs->n_gregs].fix = fixP; + gregs->greg_fixes[gregs->n_gregs++].offs = offs; + } + + /* For each symbol having a GREG definition, sort those definitions on + offset. */ + for (i = 0; i < n_greg_symbols; i++) + qsort (all_greg_symbols[i]->greg_fixes, all_greg_symbols[i]->n_gregs, + sizeof (all_greg_symbols[i]->greg_fixes[0]), cmp_greg_symbol_fixes); + + if (real_reg_section != NULL) + { + asection **secpp; + + /* FIXME: Pass error state gracefully. */ + if (bfd_get_section_flags (stdoutput, real_reg_section) & SEC_HAS_CONTENTS) + as_fatal (_("register section has contents\n")); + + /* FIXME: This does not seem like the proper way to kill a section, + but it's the way it's done elsewhere, like elf64-alpha.c. */ + /* Really remove the section. */ + for (secpp = &stdoutput->sections; + *secpp != real_reg_section; + secpp = &(*secpp)->next) + ; + *secpp = (*secpp)->next; + --stdoutput->section_count; + } + +} + +/* Provide an expression for a built-in name provided when-used. + Either a symbol that is a handler; living in 0x10*[1..8] and having + name [DVWIOUZX]_Handler, or a mmixal built-in symbol. + + If the name isn't a built-in name and parsed into *EXPP, return zero. */ + +int +mmix_parse_predefined_name (name, expP) + char *name; + expressionS *expP; +{ + char *canon_name; + char *handler_charp; + const char handler_chars[] = "DVWIOUZX"; + symbolS *symp; + + if (! predefined_syms) + return 0; + + canon_name = tc_canonicalize_symbol_name (name); + + if (canon_name[1] == '_' + && strcmp (canon_name + 2, "Handler") == 0 + && (handler_charp = strchr (handler_chars, *canon_name)) != NULL) + { + /* If the symbol doesn't exist, provide one relative to the .text + section. + + FIXME: We should provide separate sections, mapped in the linker + script. */ + symp = symbol_find (name); + if (symp == NULL) + symp = symbol_new (name, text_section, + 0x10 * (handler_charp + 1 - handler_chars), + &zero_address_frag); + } + else + { + /* These symbols appear when referenced; needed for + mmixal-compatible programs. */ + unsigned int i; + + static const struct + { + const char *name; + valueT val; + } predefined_abs_syms[] = + { + {"Data_Segment", (valueT) 0x20 << 56}, + {"Pool_Segment", (valueT) 0x40 << 56}, + {"Stack_Segment", (valueT) 0x60 << 56}, + {"StdIn", 0}, + {"StdOut", 1}, + {"StdErr", 2}, + {"TextRead", 0}, + {"TextWrite", 1}, + {"BinaryRead", 2}, + {"BinaryWrite", 3}, + {"BinaryReadWrite", 4}, + {"Halt", 0}, + {"Fopen", 1}, + {"Fclose", 2}, + {"Fread", 3}, + {"Fgets", 4}, + {"Fgetws", 5}, + {"Fwrite", 6}, + {"Fputs", 7}, + {"Fputws", 8}, + {"Fseek", 9}, + {"Ftell", 10}, + {"D_BIT", 0x80}, + {"V_BIT", 0x40}, + {"W_BIT", 0x20}, + {"I_BIT", 0x10}, + {"O_BIT", 0x08}, + {"U_BIT", 0x04}, + {"Z_BIT", 0x02}, + {"X_BIT", 0x01}, + {"Inf", 0x7ff00000} + }; + + /* If it's already in the symbol table, we shouldn't do anything. */ + symp = symbol_find (name); + if (symp != NULL) + return 0; + + for (i = 0; + i < sizeof (predefined_abs_syms)/sizeof (predefined_abs_syms[0]); + i++) + if (strcmp (canon_name, predefined_abs_syms[i].name) == 0) + { + symbol_table_insert (symbol_new (predefined_abs_syms[i].name, + absolute_section, + predefined_abs_syms[i].val, + &zero_address_frag)); + + /* Let gas find the symbol we just created, through its + ordinary lookup. */ + return 0; + } + + /* Not one of those symbols. Let gas handle it. */ + return 0; + } + + expP->X_op = O_symbol; + expP->X_add_number = 0; + expP->X_add_symbol = symp; + expP->X_op_symbol = NULL; + + return 1; +} + +/* Worker for mmix_frob_file_before_adjust. */ + +static void +mmix_frob_local_reloc (abfd, sec, xxx) + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec; + PTR xxx ATTRIBUTE_UNUSED; +{ + segment_info_type *seginfo = seg_info (sec); + fixS *fixp; + + if (seginfo == NULL) + return; + + for (fixp = seginfo->fix_root; fixp; fixp = fixp->fx_next) + if (! fixp->fx_done && fixp->fx_addsy != NULL) + { + symbolS *sym = fixp->fx_addsy; + asection *section = S_GET_SEGMENT (sym); + + if (section == reg_section + && fixp->fx_r_type == BFD_RELOC_MMIX_LOCAL) + { + /* If the register is marked global, we don't need to replace + with the *real* register section since that will be done + when the symbol is changed. */ + if (! S_IS_EXTERNAL (sym)) + /* If it's a local symbol, we replace it with an anonymous + one with the same constant value. */ + fixp->fx_addsy = expr_build_uconstant (S_GET_VALUE (sym)); + } + } +} + +/* Change fixups for register symbols for BFD_MMIX_LOCAL to be for an + absolute symbol. */ + +void +mmix_frob_file_before_adjust () +{ + return; + bfd_map_over_sections (stdoutput, mmix_frob_local_reloc, (char *) 0); +} + +/* Just check that we don't have a BSPEC/ESPEC pair active when changing + sections "normally", and get knowledge about alignment from the new + section. */ + +void +mmix_md_elf_section_change_hook () +{ + if (doing_bspec) + as_bad (_("section change from within a BSPEC/ESPEC pair is not supported")); + + last_alignment = bfd_get_section_alignment (now_seg->owner, now_seg); + want_unaligned = 0; +} + +/* The LOC worker. This is like s_org, but we have to support changing + section too. */ + +static void +s_loc (ignore) + int ignore ATTRIBUTE_UNUSED; +{ + segT section; + expressionS exp; + char *p; + symbolS *sym; + offsetT off; + + /* Must not have a BSPEC in progress. */ + if (doing_bspec) + { + as_bad (_("directive LOC from within a BSPEC/ESPEC pair is not supported")); + return; + } + + section = expression (&exp); + + if (exp.X_op == O_illegal + || exp.X_op == O_absent + || exp.X_op == O_big + || section == undefined_section) + { + as_bad (_("invalid LOC expression")); + return; + } + + if (section == absolute_section) + { + /* Translate a constant into a suitable section. */ + + if (exp.X_add_number < ((offsetT) 0x20 << 56)) + { + /* Lower than Data_Segment - assume it's .text. */ + section = text_section; + + /* Save the lowest seen location, so we can pass on this + information to the linker. We don't actually org to this + location here, we just pass on information to the linker so + it can put the code there for us. */ + + /* If there was already a loc (that has to be set lower than + this one), we org at (this - lower). There's an implicit + "LOC 0" before any entered code. FIXME: handled by spurious + settings of text_has_contents. */ + if (exp.X_add_number < 0 + || exp.X_add_number < (offsetT) lowest_text_loc) + { + as_bad (_("LOC expression stepping backwards is not supported")); + exp.X_op = O_absent; + } + else + { + if (text_has_contents && lowest_text_loc == (bfd_vma) -1) + lowest_text_loc = 0; + + if (lowest_text_loc == (bfd_vma) -1) + { + lowest_text_loc = exp.X_add_number; + + /* We want only to change the section, not set an offset. */ + exp.X_op = O_absent; + } + else + exp.X_add_number -= lowest_text_loc; + } + } + else + { + /* Do the same for the .data section. */ + section = data_section; + + if (exp.X_add_number < (offsetT) lowest_data_loc) + { + as_bad (_("LOC expression stepping backwards is not supported")); + exp.X_op = O_absent; + } + else + { + if (data_has_contents && lowest_data_loc == (bfd_vma) -1) + lowest_data_loc = (bfd_vma) 0x20 << 56; + + if (lowest_data_loc == (bfd_vma) -1) + { + lowest_data_loc = exp.X_add_number; + + /* We want only to change the section, not set an offset. */ + exp.X_op = O_absent; + } + else + exp.X_add_number -= lowest_data_loc; + } + } + } + + if (section != now_seg) + { + obj_elf_section_change_hook (); + subseg_set (section, 0); + + /* Call our section change hooks using the official hook. */ + md_elf_section_change_hook (); + } + + if (exp.X_op != O_absent) + { + if (exp.X_op != O_constant && exp.X_op != O_symbol) + { + /* Handle complex expressions. */ + sym = make_expr_symbol (&exp); + off = 0; + } + else + { + sym = exp.X_add_symbol; + off = exp.X_add_number; + } + + p = frag_var (rs_org, 1, 1, (relax_substateT) 0, sym, off, (char *) 0); + *p = 0; + } + + mmix_handle_rest_of_empty_line (); +} + +/* The BYTE worker. We have to support sequences of mixed "strings", + numbers and other constant "first-pass" reducible expressions separated + by comma. */ + +static void +mmix_byte () +{ + unsigned int c; + char *start; + + if (now_seg == text_section) + text_has_contents = 1; + else if (now_seg == data_section) + data_has_contents = 1; + + do + { + SKIP_WHITESPACE (); + switch (*input_line_pointer) + { + case '\"': + ++input_line_pointer; + start = input_line_pointer; + while (is_a_char (c = next_char_of_string ())) + { + FRAG_APPEND_1_CHAR (c); + } + + if (input_line_pointer[-1] != '\"') + { + /* We will only get here in rare cases involving #NO_APP, + where the unterminated string is not recognized by the + preformatting pass. */ + as_bad (_("unterminated string")); + mmix_discard_rest_of_line (); + return; + } + break; + + default: + { + expressionS exp; + segT expseg = expression (&exp); + + /* We have to allow special register names as constant numbers. */ + if ((expseg != absolute_section && expseg != reg_section) + || (exp.X_op != O_constant + && (exp.X_op != O_register + || exp.X_add_number <= 255))) + { + as_bad (_("BYTE expression not a pure number")); + mmix_discard_rest_of_line (); + return; + } + else if ((exp.X_add_number > 255 && exp.X_op != O_register) + || exp.X_add_number < 0) + { + /* Note that mmixal does not allow negative numbers in + BYTE sequences, so neither should we. */ + as_bad (_("BYTE expression not in the range 0..255")); + mmix_discard_rest_of_line (); + return; + } + + FRAG_APPEND_1_CHAR (exp.X_add_number); + } + break; + } + + SKIP_WHITESPACE (); + c = *input_line_pointer++; + } + while (c == ','); + + input_line_pointer--; + + if (mmix_gnu_syntax) + demand_empty_rest_of_line (); + else + { + mmix_discard_rest_of_line (); + /* Do like demand_empty_rest_of_line and step over the end-of-line + boundary. */ + input_line_pointer++; + } + + /* Make sure we align for the next instruction. */ + last_alignment = 0; +} + +/* Like cons_worker, but we have to ignore "naked comments", not barf on + them. Implements WYDE, TETRA and OCTA. We're a little bit more + lenient than mmix_byte but FIXME: they should eventually merge. */ + +static void +mmix_cons (nbytes) + int nbytes; +{ + expressionS exp; + char *start; + + /* If we don't have any contents, then it's ok to have a specified start + address that is not a multiple of the max data size. We will then + align it as necessary when we get here. Otherwise, it's a fatal sin. */ + if (now_seg == text_section) + { + if (lowest_text_loc != (bfd_vma) -1 + && (lowest_text_loc & (nbytes - 1)) != 0) + { + if (text_has_contents) + as_bad (_("data item with alignment larger than location")); + else if (want_unaligned) + as_bad (_("unaligned data at an absolute location is not supported")); + + lowest_text_loc &= ~((bfd_vma) nbytes - 1); + lowest_text_loc += (bfd_vma) nbytes; + } + + text_has_contents = 1; + } + else if (now_seg == data_section) + { + if (lowest_data_loc != (bfd_vma) -1 + && (lowest_data_loc & (nbytes - 1)) != 0) + { + if (data_has_contents) + as_bad (_("data item with alignment larger than location")); + else if (want_unaligned) + as_bad (_("unaligned data at an absolute location is not supported")); + + lowest_data_loc &= ~((bfd_vma) nbytes - 1); + lowest_data_loc += (bfd_vma) nbytes; + } + + data_has_contents = 1; + } + + /* Always align these unless asked not to (valid for the current pseudo). */ + if (! want_unaligned) + { + last_alignment = nbytes == 2 ? 1 : (nbytes == 4 ? 2 : 3); + frag_align (last_alignment, 0, 0); + record_alignment (now_seg, last_alignment); + } + + /* For mmixal compatibility, a label for an instruction (and emitting + pseudo) refers to the _aligned_ address. So we have to emit the + label here. */ + if (current_fb_label >= 0) + colon (fb_label_name (current_fb_label, 1)); + else if (pending_label != NULL) + { + colon (pending_label); + pending_label = NULL; + } + + SKIP_WHITESPACE (); + + if (is_end_of_line [(unsigned int) *input_line_pointer]) + { + /* Default to zero if the expression was absent. */ + + exp.X_op = O_constant; + exp.X_add_number = 0; + exp.X_unsigned = 0; + exp.X_add_symbol = NULL; + exp.X_op_symbol = NULL; + emit_expr (&exp, (unsigned int) nbytes); + } + else + do + { + unsigned int c; + + switch (*input_line_pointer) + { + /* We support strings here too; each character takes up nbytes + bytes. */ + case '\"': + ++input_line_pointer; + start = input_line_pointer; + while (is_a_char (c = next_char_of_string ())) + { + exp.X_op = O_constant; + exp.X_add_number = c; + exp.X_unsigned = 1; + emit_expr (&exp, (unsigned int) nbytes); + } + + if (input_line_pointer[-1] != '\"') + { + /* We will only get here in rare cases involving #NO_APP, + where the unterminated string is not recognized by the + preformatting pass. */ + as_bad (_("unterminated string")); + mmix_discard_rest_of_line (); + return; + } + break; + + default: + { + expression (&exp); + emit_expr (&exp, (unsigned int) nbytes); + SKIP_WHITESPACE (); + } + break; + } + } + while (*input_line_pointer++ == ','); + + input_line_pointer--; /* Put terminator back into stream. */ + + mmix_handle_rest_of_empty_line (); + + /* We don't need to step up the counter for the current_fb_label here; + that's handled by the caller. */ +} + +/* The md_do_align worker. At present, we just record an alignment to + nullify the automatic alignment we do for WYDE, TETRA and OCTA, as gcc + does not use the unaligned macros when attribute packed is used. + Arguably this is a GCC bug. */ + +void +mmix_md_do_align (n, fill, len, max) + int n; + char *fill ATTRIBUTE_UNUSED; + int len ATTRIBUTE_UNUSED; + int max ATTRIBUTE_UNUSED; +{ + last_alignment = n; + want_unaligned = n == 0; +} diff --git a/gas/config/tc-mmix.h b/gas/config/tc-mmix.h new file mode 100644 index 0000000..3c7c71a --- /dev/null +++ b/gas/config/tc-mmix.h @@ -0,0 +1,214 @@ +/* tc-mmix.h -- Header file for tc-mmix.c. + Copyright (C) 2001 Free Software Foundation, Inc. + Written by Hans-Peter Nilsson (hp@bitrange.com). + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#define TC_MMIX + +/* See gas/doc/internals.texi for explanation of these macros. */ +#define TARGET_FORMAT "elf64-mmix" +#define TARGET_ARCH bfd_arch_mmix +#define TARGET_BYTES_BIG_ENDIAN 1 + +extern const char mmix_comment_chars[]; +#define tc_comment_chars mmix_comment_chars + +extern const char mmix_symbol_chars[]; +#define tc_symbol_chars mmix_symbol_chars + +extern const char mmix_exp_chars[]; +#define EXP_CHARS mmix_exp_chars + +extern const char mmix_flt_chars[]; +#define FLT_CHARS mmix_flt_chars + +/* "@" is a synonym for ".". */ +#define LEX_AT (LEX_BEGIN_NAME) + +extern int mmix_label_without_colon_this_line PARAMS ((void)); +#define LABELS_WITHOUT_COLONS mmix_label_without_colon_this_line () + +extern int mmix_next_semicolon_is_eoln; +#define TC_EOL_IN_INSN(p) (*(p) == ';' && ! mmix_next_semicolon_is_eoln) + +/* This is one direction we can get mmixal compatibility. */ +extern void mmix_handle_mmixal PARAMS ((void)); +#define md_start_line_hook mmix_handle_mmixal + +extern void mmix_md_begin PARAMS ((void)); +#define md_begin mmix_md_begin + +extern void mmix_md_end PARAMS ((void)); +#define md_end mmix_md_end + +extern int mmix_current_location \ + PARAMS ((void (*fn) (expressionS *), expressionS *)); +extern int mmix_parse_predefined_name PARAMS ((char *, expressionS *)); + +extern char *mmix_current_prefix; + +/* A bit ugly, since we "know" that there's a static function + current_location that does what we want. We also strip off a leading + ':' in another ugly way. + + The [DVWIOUZX]_Handler symbols are provided when-used. */ + +extern int mmix_gnu_syntax; +#define md_parse_name(name, exp, cpos) \ + (! mmix_gnu_syntax \ + && (name[0] == '@' \ + ? (! is_part_of_name (name[1]) \ + && mmix_current_location (current_location, exp)) \ + : ((name[0] == ':' || isupper (name[0])) \ + && mmix_parse_predefined_name (name, exp)))) + +extern char *mmix_prefix_name PARAMS ((char *)); + +/* We implement when *creating* a symbol, we also need to strip a ':' or + prepend a prefix. */ +#define tc_canonicalize_symbol_name(x) \ + (mmix_current_prefix == NULL && (x)[0] != ':' ? (x) : mmix_prefix_name (x)) + +#define md_undefined_symbol(x) NULL + +extern void mmix_fb_label PARAMS ((expressionS *)); + +/* Since integer_constant is local to expr.c, we have to make this a + macro. FIXME: Do it cleaner. */ +#define md_operand(exp) \ + do { \ + if (input_line_pointer[0] == '#') \ + { \ + input_line_pointer++; \ + integer_constant (16, (exp)); \ + } \ + else if (input_line_pointer[0] == '&' \ + && input_line_pointer[1] != '&') \ + as_bad (_("`&' serial number operator is not supported")); \ + else \ + mmix_fb_label (exp); \ + } while (0) + + +/* Gas dislikes the 2ADD, 8ADD etc. insns, so we have to assemble them in + the error-recovery loop. Hopefully there are no significant + differences. Also, space on a line isn't gracefully handled. */ +extern int mmix_assemble_return_nonzero PARAMS ((char *)); +#define tc_unrecognized_line(c) \ + ((c) == ' ' \ + || (((c) == '1' || (c) == '2' || (c) == '4' || (c) == '8') \ + && mmix_assemble_return_nonzero (input_line_pointer - 1))) + +#define md_number_to_chars number_to_chars_bigendian + +#define WORKING_DOT_WORD + +extern const struct relax_type mmix_relax_table[]; +#define TC_GENERIC_RELAX_TABLE mmix_relax_table + +/* We use the relax table for everything except the GREG frags. */ +extern long mmix_md_relax_frag PARAMS ((segT, fragS *, long)); +#define md_relax_frag mmix_md_relax_frag + +#define tc_fix_adjustable(X) \ + ((! (X)->fx_addsy \ + || (! S_IS_WEAK ((X)->fx_addsy) \ + && S_GET_SEGMENT ((X)->fx_addsy) != reg_section)) \ + && (X)->fx_r_type != BFD_RELOC_VTABLE_INHERIT \ + && (X)->fx_r_type != BFD_RELOC_VTABLE_ENTRY) + +/* Adjust symbols which are registers. */ +#define tc_adjust_symtab() mmix_adjust_symtab () +extern void mmix_adjust_symtab PARAMS ((void)); + +/* Avoid outputting GAS register section symbols. This happens when the + assembly had errors, and will propagate to an assert in BFD. FIXME: + It seems the symbol output when-errors is a bug in GAS. Fix that + some time. See also tc_gen_reloc. + + Here's where we make all symbols global, when so requested. + We must avoid doing that for expression symbols or section symbols, + though. */ +extern int mmix_globalize_symbols; +#define tc_frob_symbol(sym, punt) \ + do { \ + if (S_GET_SEGMENT (sym) == reg_section \ + || (symp) == section_symbol (absolute_section)) \ + (punt) = 1; \ + \ + if (mmix_globalize_symbols \ + && ! symbol_section_p (sym) \ + && symp != section_symbol (absolute_section) \ + && (! S_IS_LOCAL (sym) \ + || S_GET_SEGMENT (sym) == reg_section) \ + && (S_GET_SEGMENT (sym) != reg_section \ + || (S_GET_NAME (sym)[0] != '$' \ + && S_GET_VALUE (sym) < 256))) \ + S_SET_EXTERNAL (sym); \ + } while (0) + +/* When relaxing, we need to emit various relocs we otherwise wouldn't. */ +#define TC_FORCE_RELOCATION(fix) mmix_force_relocation (fix) +extern int mmix_force_relocation PARAMS ((struct fix *)); + +/* Call md_pcrel_from_section(), not md_pcrel_from(). */ +#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC) +extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); + +#define MD_APPLY_FIX3 + +#define TC_HANDLES_FX_DONE + +#define md_section_align(seg, size) (size) + +#define LISTING_HEADER "GAS for MMIX" + +/* The default of 4 means Bcc expansion looks like it's missing a line. */ +#define LISTING_LHS_CONT_LINES 5 + +extern fragS *mmix_opcode_frag; +#define TC_FRAG_TYPE fragS * +#define TC_FRAG_INIT(frag) (frag)->tc_frag_data = mmix_opcode_frag + +/* We need to associate each section symbol with a list of GREGs defined + for that section/segment and sorted on offset, between the point where + all symbols have been evaluated and all frags mapped, and when the + fixups are done and relocs are output. Similarly for each unknown + symbol. */ +extern void mmix_frob_file PARAMS ((void)); +#define tc_frob_file mmix_frob_file + +/* Used by mmix_frob_file. Hangs on section symbols and unknown symbols. */ +struct mmix_symbol_gregs; +#define TC_SYMFIELD_TYPE struct mmix_symbol_gregs * + +extern void mmix_frob_file_before_adjust PARAMS ((void)); +#define tc_frob_file_before_adjust mmix_frob_file_before_adjust + +extern void mmix_md_elf_section_change_hook PARAMS ((void)); +#define md_elf_section_change_hook mmix_md_elf_section_change_hook + +extern void mmix_md_do_align PARAMS ((int, char *, int, int)); +#define md_do_align(n, fill, len, max, label) \ + mmix_md_do_align (n, fill, len, max) + +/* Each insn is a tetrabyte (4 bytes) long, but if there are BYTE + sequences sprinkled in, we can get unaligned DWARF2 offsets, so let's + explicitly say one byte. */ +#define DWARF2_LINE_MIN_INSN_LENGTH 1 diff --git a/gas/configure b/gas/configure index 8e92869..a142949 100755 --- a/gas/configure +++ b/gas/configure @@ -55,7 +55,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -170,7 +169,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -341,11 +339,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -511,16 +504,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -559,12 +548,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:563: checking for Cygwin environment" >&5 +echo "configure:552: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 568 "configure" +#line 557 "configure" #include "confdefs.h" int main() { @@ -575,7 +564,7 @@ int main() { return __CYGWIN__; ; return 0; } EOF -if { (eval echo configure:579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -592,19 +581,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:596: checking for mingw32 environment" >&5 +echo "configure:585: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 601 "configure" +#line 590 "configure" #include "confdefs.h" int main() { return __MINGW32__; ; return 0; } EOF -if { (eval echo configure:608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -669,7 +658,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:673: checking host system type" >&5 +echo "configure:662: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -690,7 +679,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:694: checking target system type" >&5 +echo "configure:683: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -708,7 +697,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:712: checking build system type" >&5 +echo "configure:701: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -733,7 +722,7 @@ test "$host_alias" != "$target_alias" && # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:737: checking for $ac_word" >&5 +echo "configure:726: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -763,7 +752,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:767: checking for $ac_word" >&5 +echo "configure:756: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -814,7 +803,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:818: checking for $ac_word" >&5 +echo "configure:807: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -846,7 +835,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:850: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:839: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -857,12 +846,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 861 "configure" +#line 850 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -888,12 +877,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:892: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:881: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:897: checking whether we are using GNU C" >&5 +echo "configure:886: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -902,7 +891,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -921,7 +910,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:925: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:914: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -953,7 +942,7 @@ else fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:957: checking for POSIXized ISC" >&5 +echo "configure:946: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -987,7 +976,7 @@ BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:991: checking for a BSD compatible install" >&5 +echo "configure:980: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1040,7 +1029,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:1044: checking whether build environment is sane" >&5 +echo "configure:1033: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -1097,7 +1086,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1101: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1090: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1143,7 +1132,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1147: checking for working aclocal" >&5 +echo "configure:1136: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1156,7 +1145,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1160: checking for working autoconf" >&5 +echo "configure:1149: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1169,7 +1158,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1173: checking for working automake" >&5 +echo "configure:1162: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1182,7 +1171,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1186: checking for working autoheader" >&5 +echo "configure:1175: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1195,7 +1184,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1199: checking for working makeinfo" >&5 +echo "configure:1188: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1290,7 +1279,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1294: checking for ld used by GCC" >&5 +echo "configure:1283: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1320,10 +1309,10 @@ echo "configure:1294: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1324: checking for GNU ld" >&5 +echo "configure:1313: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1327: checking for non-GNU ld" >&5 +echo "configure:1316: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1358,7 +1347,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1362: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1351: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1375,7 +1364,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1379: checking for $LD option to reload object files" >&5 +echo "configure:1368: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1387,7 +1376,7 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1391: checking for BSD-compatible nm" >&5 +echo "configure:1380: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1425,7 +1414,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1429: checking whether ln -s works" >&5 +echo "configure:1418: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1446,7 +1435,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1450: checking how to recognise dependant libraries" >&5 +echo "configure:1439: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1610,13 +1599,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1614: checking for object suffix" >&5 +echo "configure:1603: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1636,7 +1625,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1640: checking for executable suffix" >&5 +echo "configure:1629: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1646,10 +1635,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1679,7 +1668,7 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:1683: checking for ${ac_tool_prefix}file" >&5 +echo "configure:1672: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1741,7 +1730,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:1745: checking for file" >&5 +echo "configure:1734: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1812,7 +1801,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1816: checking for $ac_word" >&5 +echo "configure:1805: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1844,7 +1833,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1848: checking for $ac_word" >&5 +echo "configure:1837: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1879,7 +1868,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1883: checking for $ac_word" >&5 +echo "configure:1872: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1911,7 +1900,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1915: checking for $ac_word" >&5 +echo "configure:1904: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1978,8 +1967,8 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1982 "configure"' > conftest.$ac_ext - if { (eval echo configure:1983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 1971 "configure"' > conftest.$ac_ext + if { (eval echo configure:1972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -2000,7 +1989,7 @@ case $host in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2004: checking whether the C compiler needs -belf" >&5 +echo "configure:1993: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2013,14 +2002,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <<EOF -#line 2017 "configure" +#line 2006 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:2024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2498,6 +2487,7 @@ EOF mips-*-elf* | mips-*-rtems* | mips-*-openbsd*) fmt=elf ;; mips-*-vxworks*) fmt=elf mips_stabs_elf=y ;; + mmix-*-*) fmt=elf bfd_gas=yes ;; mn10200-*-*) fmt=elf bfd_gas=yes ;; mn10300-*-*) fmt=elf bfd_gas=yes ;; openrisc-*-*) fmt=elf bfd_gas=yes ;; @@ -3093,7 +3083,7 @@ EOF # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3097: checking for $ac_word" >&5 +echo "configure:3087: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3123,7 +3113,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3127: checking for $ac_word" >&5 +echo "configure:3117: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3174,7 +3164,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3178: checking for $ac_word" >&5 +echo "configure:3168: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3206,7 +3196,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:3210: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:3200: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -3217,12 +3207,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 3221 "configure" +#line 3211 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:3226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -3248,12 +3238,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:3252: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:3242: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:3257: checking whether we are using GNU C" >&5 +echo "configure:3247: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3262,7 +3252,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3266: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -3281,7 +3271,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:3285: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:3275: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3318,7 +3308,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3322: checking for $ac_word" >&5 +echo "configure:3312: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3349,7 +3339,7 @@ done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:3353: checking how to run the C preprocessor" >&5 +echo "configure:3343: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3364,13 +3354,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 3368 "configure" +#line 3358 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3381,13 +3371,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 3385 "configure" +#line 3375 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3381: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3398,13 +3388,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 3402 "configure" +#line 3392 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3398: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3434,7 +3424,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3438: checking for $ac_word" >&5 +echo "configure:3428: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3467,7 +3457,7 @@ test -n "$LEX" || LEX=""$missing_dir/missing flex"" # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3471: checking for $ac_word" >&5 +echo "configure:3461: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3501,7 +3491,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:3505: checking for yywrap in -l$ac_lib" >&5 +echo "configure:3495: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3509,7 +3499,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <<EOF -#line 3513 "configure" +#line 3503 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3520,7 +3510,7 @@ int main() { yywrap() ; return 0; } EOF -if { (eval echo configure:3524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3543,7 +3533,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:3547: checking lex output file root" >&5 +echo "configure:3537: checking lex output file root" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3564,7 +3554,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:3568: checking whether yytext is a pointer" >&5 +echo "configure:3558: checking whether yytext is a pointer" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3576,14 +3566,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <<EOF -#line 3580 "configure" +#line 3570 "configure" #include "confdefs.h" `cat $LEX_OUTPUT_ROOT.c` int main() { ; return 0; } EOF -if { (eval echo configure:3587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes else @@ -3609,7 +3599,7 @@ ALL_LINGUAS= # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3613: checking for $ac_word" >&5 +echo "configure:3603: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3637,12 +3627,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3641: checking for ANSI C header files" >&5 +echo "configure:3631: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3646 "configure" +#line 3636 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -3650,7 +3640,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3667,7 +3657,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 3671 "configure" +#line 3661 "configure" #include "confdefs.h" #include <string.h> EOF @@ -3685,7 +3675,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 3689 "configure" +#line 3679 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -3706,7 +3696,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 3710 "configure" +#line 3700 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3717,7 +3707,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3741,12 +3731,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3745: checking for working const" >&5 +echo "configure:3735: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3750 "configure" +#line 3740 "configure" #include "confdefs.h" int main() { @@ -3795,7 +3785,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:3799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3816,21 +3806,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:3820: checking for inline" >&5 +echo "configure:3810: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 3827 "configure" +#line 3817 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:3834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -3856,12 +3846,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3860: checking for off_t" >&5 +echo "configure:3850: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3865 "configure" +#line 3855 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3889,12 +3879,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3893: checking for size_t" >&5 +echo "configure:3883: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3898 "configure" +#line 3888 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3924,19 +3914,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:3928: checking for working alloca.h" >&5 +echo "configure:3918: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3933 "configure" +#line 3923 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3957,12 +3947,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3961: checking for alloca" >&5 +echo "configure:3951: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3966 "configure" +#line 3956 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -3990,7 +3980,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:3994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -4022,12 +4012,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4026: checking whether alloca needs Cray hooks" >&5 +echo "configure:4016: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4031 "configure" +#line 4021 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -4052,12 +4042,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4056: checking for $ac_func" >&5 +echo "configure:4046: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4061 "configure" +#line 4051 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4080,7 +4070,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4107,7 +4097,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4111: checking stack direction for C alloca" >&5 +echo "configure:4101: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4115,7 +4105,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 4119 "configure" +#line 4109 "configure" #include "confdefs.h" find_stack_direction () { @@ -4134,7 +4124,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:4138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -4155,21 +4145,21 @@ EOF fi -for ac_hdr in unistd.h +for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4163: checking for $ac_hdr" >&5 +echo "configure:4153: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4168 "configure" +#line 4158 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4198,12 +4188,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4202: checking for $ac_func" >&5 +echo "configure:4192: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4207 "configure" +#line 4197 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4226,7 +4216,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4251,7 +4241,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:4255: checking for working mmap" >&5 +echo "configure:4245: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4259,7 +4249,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 4263 "configure" +#line 4253 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -4287,11 +4277,24 @@ else #include <fcntl.h> #include <sys/mman.h> +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif + +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif + +#if HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif + +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include <unistd.h> -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -4399,7 +4402,7 @@ main() } EOF -if { (eval echo configure:4403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -4427,17 +4430,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4431: checking for $ac_hdr" >&5 +echo "configure:4434: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4436 "configure" +#line 4439 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4467,12 +4470,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4471: checking for $ac_func" >&5 +echo "configure:4474: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4476 "configure" +#line 4479 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4495,7 +4498,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4524,12 +4527,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4528: checking for $ac_func" >&5 +echo "configure:4531: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4533 "configure" +#line 4536 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4552,7 +4555,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4586,19 +4589,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:4590: checking for LC_MESSAGES" >&5 +echo "configure:4593: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4595 "configure" +#line 4598 "configure" #include "confdefs.h" #include <locale.h> int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:4602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -4619,7 +4622,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:4623: checking whether NLS is requested" >&5 +echo "configure:4626: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -4639,7 +4642,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:4643: checking whether included gettext is requested" >&5 +echo "configure:4646: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -4658,17 +4661,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:4662: checking for libintl.h" >&5 +echo "configure:4665: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4667 "configure" +#line 4670 "configure" #include "confdefs.h" #include <libintl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4675: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4685,19 +4688,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:4689: checking for gettext in libc" >&5 +echo "configure:4692: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4694 "configure" +#line 4697 "configure" #include "confdefs.h" #include <libintl.h> int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:4701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -4713,7 +4716,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:4717: checking for bindtextdomain in -lintl" >&5 +echo "configure:4720: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4721,7 +4724,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4725 "configure" +#line 4728 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4732,7 +4735,7 @@ int main() { bindtextdomain() ; return 0; } EOF -if { (eval echo configure:4736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4748,19 +4751,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:4752: checking for gettext in libintl" >&5 +echo "configure:4755: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4757 "configure" +#line 4760 "configure" #include "confdefs.h" int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:4764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -4788,7 +4791,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4792: checking for $ac_word" >&5 +echo "configure:4795: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4822,12 +4825,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4826: checking for $ac_func" >&5 +echo "configure:4829: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4831 "configure" +#line 4834 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4850,7 +4853,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4877,7 +4880,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4881: checking for $ac_word" >&5 +echo "configure:4884: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4913,7 +4916,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4917: checking for $ac_word" >&5 +echo "configure:4920: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4945,7 +4948,7 @@ else fi cat > conftest.$ac_ext <<EOF -#line 4949 "configure" +#line 4952 "configure" #include "confdefs.h" int main() { @@ -4953,7 +4956,7 @@ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:4957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4985,7 +4988,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4989: checking for $ac_word" >&5 +echo "configure:4992: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5019,7 +5022,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5023: checking for $ac_word" >&5 +echo "configure:5026: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5055,7 +5058,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5059: checking for $ac_word" >&5 +echo "configure:5062: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5145,7 +5148,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:5149: checking for catalogs to be installed" >&5 +echo "configure:5152: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -5173,17 +5176,17 @@ echo "configure:5149: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:5177: checking for linux/version.h" >&5 +echo "configure:5180: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5182 "configure" +#line 5185 "configure" #include "confdefs.h" #include <linux/version.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5246,7 +5249,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:5250: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:5253: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -5271,7 +5274,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:5275: checking for executable suffix" >&5 +echo "configure:5278: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5281,10 +5284,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:5285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:5288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -5306,17 +5309,17 @@ for ac_hdr in string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h e do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5310: checking for $ac_hdr" >&5 +echo "configure:5313: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5315 "configure" +#line 5318 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5346,7 +5349,7 @@ done # Put this here so that autoconf's "cross-compiling" message doesn't confuse # people who are not cross-compiling but are compiling cross-assemblers. echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&6 -echo "configure:5350: checking whether compiling a cross-assembler" >&5 +echo "configure:5353: checking whether compiling a cross-assembler" >&5 if test "${host}" = "${target}"; then cross_gas=no else @@ -5361,19 +5364,19 @@ echo "$ac_t""$cross_gas" 1>&6 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:5365: checking for working alloca.h" >&5 +echo "configure:5368: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5370 "configure" +#line 5373 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:5377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -5394,12 +5397,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:5398: checking for alloca" >&5 +echo "configure:5401: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5403 "configure" +#line 5406 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -5427,7 +5430,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:5431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -5459,12 +5462,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:5463: checking whether alloca needs Cray hooks" >&5 +echo "configure:5466: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5468 "configure" +#line 5471 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -5489,12 +5492,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5493: checking for $ac_func" >&5 +echo "configure:5496: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5498 "configure" +#line 5501 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5517,7 +5520,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5544,7 +5547,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:5548: checking stack direction for C alloca" >&5 +echo "configure:5551: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5552,7 +5555,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 5556 "configure" +#line 5559 "configure" #include "confdefs.h" find_stack_direction () { @@ -5571,7 +5574,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:5575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -5593,21 +5596,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:5597: checking for inline" >&5 +echo "configure:5600: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 5604 "configure" +#line 5607 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:5611: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -5637,12 +5640,12 @@ esac for ac_func in unlink remove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5641: checking for $ac_func" >&5 +echo "configure:5644: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5646 "configure" +#line 5649 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5665,7 +5668,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5694,12 +5697,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5698: checking for $ac_func" >&5 +echo "configure:5701: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5703 "configure" +#line 5706 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5722,7 +5725,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5757,7 +5760,7 @@ case $host in ;; *-ncr-sysv4.3*) echo $ac_n "checking for _mwvalidcheckl in -lmw""... $ac_c" 1>&6 -echo "configure:5761: checking for _mwvalidcheckl in -lmw" >&5 +echo "configure:5764: checking for _mwvalidcheckl in -lmw" >&5 ac_lib_var=`echo mw'_'_mwvalidcheckl | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5765,7 +5768,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmw $LIBS" cat > conftest.$ac_ext <<EOF -#line 5769 "configure" +#line 5772 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5776,7 +5779,7 @@ int main() { _mwvalidcheckl() ; return 0; } EOF -if { (eval echo configure:5780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5797,7 +5800,7 @@ else fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5801: checking for main in -lm" >&5 +echo "configure:5804: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5805,14 +5808,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <<EOF -#line 5809 "configure" +#line 5812 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5835,7 +5838,7 @@ fi ;; *) echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5839: checking for main in -lm" >&5 +echo "configure:5842: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5843,14 +5846,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <<EOF -#line 5847 "configure" +#line 5850 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5881,12 +5884,12 @@ esac # enough, but on some of those systems, the assert macro relies on requoting # working properly! echo $ac_n "checking for working assert macro""... $ac_c" 1>&6 -echo "configure:5885: checking for working assert macro" >&5 +echo "configure:5888: checking for working assert macro" >&5 if eval "test \"`echo '$''{'gas_cv_assert_ok'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5890 "configure" +#line 5893 "configure" #include "confdefs.h" #include <assert.h> #include <stdio.h> @@ -5902,7 +5905,7 @@ assert (a == b ; return 0; } EOF -if { (eval echo configure:5906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_assert_ok=yes else @@ -5943,12 +5946,12 @@ gas_test_headers=" " echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6 -echo "configure:5947: checking whether declaration is required for strstr" >&5 +echo "configure:5950: checking whether declaration is required for strstr" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5952 "configure" +#line 5955 "configure" #include "confdefs.h" $gas_test_headers int main() { @@ -5959,7 +5962,7 @@ x = (f) strstr; ; return 0; } EOF -if { (eval echo configure:5963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_strstr=no else @@ -5980,12 +5983,12 @@ fi echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6 -echo "configure:5984: checking whether declaration is required for malloc" >&5 +echo "configure:5987: checking whether declaration is required for malloc" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5989 "configure" +#line 5992 "configure" #include "confdefs.h" $gas_test_headers int main() { @@ -5996,7 +5999,7 @@ x = (f) malloc; ; return 0; } EOF -if { (eval echo configure:6000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_malloc=no else @@ -6017,12 +6020,12 @@ fi echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6 -echo "configure:6021: checking whether declaration is required for free" >&5 +echo "configure:6024: checking whether declaration is required for free" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6026 "configure" +#line 6029 "configure" #include "confdefs.h" $gas_test_headers int main() { @@ -6033,7 +6036,7 @@ x = (f) free; ; return 0; } EOF -if { (eval echo configure:6037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_free=no else @@ -6054,12 +6057,12 @@ fi echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6 -echo "configure:6058: checking whether declaration is required for sbrk" >&5 +echo "configure:6061: checking whether declaration is required for sbrk" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_sbrk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6063 "configure" +#line 6066 "configure" #include "confdefs.h" $gas_test_headers int main() { @@ -6070,7 +6073,7 @@ x = (f) sbrk; ; return 0; } EOF -if { (eval echo configure:6074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_sbrk=no else @@ -6091,12 +6094,12 @@ fi echo $ac_n "checking whether declaration is required for environ""... $ac_c" 1>&6 -echo "configure:6095: checking whether declaration is required for environ" >&5 +echo "configure:6098: checking whether declaration is required for environ" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_environ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6100 "configure" +#line 6103 "configure" #include "confdefs.h" $gas_test_headers int main() { @@ -6107,7 +6110,7 @@ x = (f) environ; ; return 0; } EOF -if { (eval echo configure:6111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_environ=no else @@ -6131,12 +6134,12 @@ fi # for it? echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6 -echo "configure:6135: checking whether declaration is required for errno" >&5 +echo "configure:6138: checking whether declaration is required for errno" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6140 "configure" +#line 6143 "configure" #include "confdefs.h" #ifdef HAVE_ERRNO_H @@ -6151,7 +6154,7 @@ x = (f) errno; ; return 0; } EOF -if { (eval echo configure:6155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_errno=no else diff --git a/gas/configure.in b/gas/configure.in index b49ad92..9560855 100644 --- a/gas/configure.in +++ b/gas/configure.in @@ -359,6 +359,7 @@ changequote([,])dnl mips-*-elf* | mips-*-rtems* | mips-*-openbsd*) fmt=elf ;; mips-*-vxworks*) fmt=elf mips_stabs_elf=y ;; + mmix-*-*) fmt=elf bfd_gas=yes ;; mn10200-*-*) fmt=elf bfd_gas=yes ;; mn10300-*-*) fmt=elf bfd_gas=yes ;; openrisc-*-*) fmt=elf bfd_gas=yes ;; diff --git a/gas/doc/Makefile.am b/gas/doc/Makefile.am index d20c3c0..4d909bf 100644 --- a/gas/doc/Makefile.am +++ b/gas/doc/Makefile.am @@ -39,6 +39,7 @@ CPU_DOCS = \ c-m68k.texi \ c-m88k.texi \ c-mips.texi \ + c-mmix.texi \ c-ns32k.texi \ c-pdp11.texi \ c-pj.texi \ diff --git a/gas/doc/Makefile.in b/gas/doc/Makefile.in index f36b2a0..7a897d6 100644 --- a/gas/doc/Makefile.in +++ b/gas/doc/Makefile.in @@ -1,6 +1,6 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -149,6 +149,7 @@ CPU_DOCS = \ c-m68k.texi \ c-m88k.texi \ c-mips.texi \ + c-mmix.texi \ c-ns32k.texi \ c-pdp11.texi \ c-pj.texi \ @@ -185,7 +186,7 @@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: @@ -275,7 +276,7 @@ uninstall-info: else ii=; fi; \ list='$(INFO_DEPS)'; \ for file in $$list; do \ - test -z "$ii" \ + test -z "$$ii" \ || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ done @$(NORMAL_UNINSTALL) diff --git a/gas/doc/all.texi b/gas/doc/all.texi index 6ba731b..9253203 100644 --- a/gas/doc/all.texi +++ b/gas/doc/all.texi @@ -44,6 +44,7 @@ @set M880X0 @set MCORE @set MIPS +@set MMIX @set PDP11 @set PJ @set PPC diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo index 142cec1..603a6b9 100644 --- a/gas/doc/as.texinfo +++ b/gas/doc/as.texinfo @@ -43,6 +43,7 @@ @set M880X0 @set MCORE @set MIPS +@set MMIX @set PDP11 @set PJ @set PPC @@ -347,6 +348,11 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. [ --trap ] [ --break ] [ -n ] [ --emulation=@var{name} ] @end ifset +@ifset MMIX + [ --fixed-special-register-names ] [ --globalize-symbols ] + [ --gnu-syntax ] [ --relax ] [ --no-predefined-symbols ] + [ --no-expand ] [ --no-merge-gregs ] [ -x ] +@end ifset [ -- | @var{files} @dots{} ] @c man end @end smallexample @@ -880,6 +886,10 @@ Assemble for a little endian target. @end table @end ifset +@ifset MMIX +See the info pages for documentation of the MMIX-specific options. +@end ifset + @c man end @menu @@ -5566,6 +5576,9 @@ subject, see the hardware manufacturer's manual. @ifset MIPS * MIPS-Dependent:: MIPS Dependent Features @end ifset +@ifset MMIX +* MMIX-Dependent:: MMIX Dependent Features +@end ifset @ifset SH * SH-Dependent:: Hitachi SH Dependent Features @end ifset @@ -5693,6 +5706,10 @@ family. @include c-mips.texi @end ifset +@ifset MMIX +@include c-mmix.texi +@end ifset + @ifset NS32K @include c-ns32k.texi @end ifset diff --git a/gas/doc/c-mmix.texi b/gas/doc/c-mmix.texi new file mode 100644 index 0000000..8081a40 --- /dev/null +++ b/gas/doc/c-mmix.texi @@ -0,0 +1,559 @@ +@c Copyright 2001 Free Software Foundation, Inc. +@c This is part of the GAS manual. +@c For copying conditions, see the file as.texinfo. +@c MMIX description by Hans-Peter Nilsson, hp@bitrange.com +@ifset GENERIC +@page +@node MMIX-Dependent +@chapter MMIX Dependent Features +@end ifset +@ifclear GENERIC +@node Machine Dependencies +@chapter MMIX Dependent Features +@end ifclear + +@cindex MMIX support +@menu +* MMIX-Opts:: Command-line Options +* MMIX-Expand:: Instruction expansion +* MMIX-Syntax:: Syntax +* MMIX-mmixal:: Differences to @code{mmixal} syntax and semantics +@end menu + +@node MMIX-Opts +@section Command-line Options + +@cindex options, MMIX +@cindex MMIX options +The MMIX version of @code{@value{AS}} has some machine-dependent options. + +@cindex @samp{--fixed-special-register-names} command line option, MMIX +When @samp{--fixed-special-register-names} is specified, only the register +names specified in @ref{MMIX-Regs} are recognized in the instructions +@code{PUT} and @code{GET}. + +@cindex @samp{--globalize-symbols} command line option, MMIX +You can use the @samp{--globalize-symbols} to make all symbols global. +This option is useful when splitting up a @code{mmixal} program into +several files. + +@cindex @samp{--gnu-syntax} command line option, MMIX +The @samp{--gnu-syntax} turns off most syntax compatibility with +@code{mmixal}. Its usability is currently doubtful. + +@cindex @samp{--relax} command line option, MMIX +The @samp{--relax} option is not fully supported, but will eventually make +the object file prepared for linker relaxation. + +@cindex @samp{--no-predefined-syms} command line option, MMIX +If you want to avoid inadvertently calling a predefined symbol and would +rather get an error, for example when using @code{@value{AS}} with a +compiler or other machine-generated code, specify +@samp{--no-predefined-syms}. This turns off built-in predefined +definitions of all such symbols, including rounding-mode symbols, segment +symbols, @samp{BIT} symbols, and @code{TRAP} symbols used in @code{mmix} +``system calls''. It also turns off predefined special-register names, +except when used in @code{PUT} and @code{GET} instructions. + +@cindex @samp{--no-expand} command line option, MMIX +By default, some instructions are expanded to fit the size of the operand +or an external symbol (@pxref{MMIX-Expand}). By passing +@samp{--no-expand}, no such expansion will be done, instead causing errors +at link time if the operand does not fit. + +@cindex @samp{--no-merge-gregs} command line option, MMIX +The @code{mmixal} documentation (@pxref{MMIX-Syntax}) specifies that global +registers allocated with the @samp{GREG} directive (@pxref{MMIX-Pseudos}) and +initialized to the same non-zero value, will refer to the same global +register. This isn't strictly enforcable in @code{@value{AS}} since the +final addresses aren't known until link-time, but it will do an effort +unless the @samp{--no-merge-gregs} option is specified. (Register merging +isn't yet implemented in @code{@value{LD}}.) + +@cindex @samp{-x} command line option, MMIX +@code{@value{AS}} will warn every time it expands an instruction to fit an +operand unless the option @samp{-x} is specified. It is believed that +this behaviour is more useful than just mimicking @code{mmixal}'s +behaviour, in which instructions are only expanded if the @samp{-x} option +is specified, and assembly fails otherwise, when an instruction needs to +be expanded. It needs to be kept in mind that @code{mmixal} is both an +assembler and linker, while @code{@value{AS}} will expand instructions +that at link stage can be contracted. (Though linker relaxation isn't yet +implemented in @code{@value{LD}}.) + +@node MMIX-Expand +@section Instruction expansion + +@cindex instruction expansion, MMIX +When @code{@value{AS}} encounters an instruction with an operand that is +either not known or does not fit the operand size of the instruction, +@code{@value{AS}} (and @code{@value{LD}}) will expand the instruction into +a sequence of instructions semantically equivalent to the operand fitting +the instruction. Expansion will take place for the following +instructions: + +@table @asis +@item @samp{GETA} +Expands to a sequence of four instructions: @code{SETL}, @code{INCML}, +@code{INCMH} and @code{INCH}. The operand must be a multiple of four. +@item Conditional branches +A branch instruction is turned into a branch with the complemented +condition and prediction bit over five instructions; four instructions +setting @code{$255} to the operand value, which like with @code{GETA} must +be a multiple of four, and a final @code{GO $255,$255,0}. +@item @samp{PUSHJ} +Similar to expansion for conditional branches; four instructions set +@code{$255} to the operand value, followed by a @code{PUSHGO $255,$255,0}. +@item @samp{JMP} +Similar to conditional branches and @code{PUSHJ}. The final instruction +is @code{GO $255,$255,0}. +@end table + +The linker @code{@value{LD}} is expected to shrink these expansions for +code assembled with @samp{--relax} (though not currently implemented). + +@node MMIX-Syntax +@section Syntax + +The assembly syntax is supposed to be upward compatible with that +described in Sections 1.3 and 1.4 of @samp{The Art of Computer +Programming, Volume 1}. Draft versions of those chapters as well as other +MMIX information is located at +@emph{mmixsite} @emph{http://www-cs-faculty.stanford.edu/~knuth/mmix-news.html}. +Most code examples from the mmixal package located there should work +unmodified when assembled and linked as single files, with a few +noteworthy exceptions (@pxref{MMIX-mmixal}). + +Before an instruction is emitted, the current location is aligned to the +next four-byte boundary. If a label is defined at the beginning of the +line, its value will be the aligned value. + +In addition to the traditional hex-prefix @samp{0x}, a hexadecimal number +can also be specified by the prefix character @samp{#}. + +After all operands to an MMIX instruction or directive have been +specified, the rest of the line is ignored, treated as a comment. + +@menu +* MMIX-Chars:: Special Characters +* MMIX-Symbols:: Symbols +* MMIX-Regs:: Register Names +* MMIX-Pseudos:: Assembler Directives +@end menu + +@node MMIX-Chars +@subsection Special Characters +@cindex line comment characters, MMIX +@cindex MMIX line comment characters + +The characters @samp{*} and @samp{#} are line comment characters; each +start a comment at the beginning of a line, but only at the beginning of a +line. A @samp{#} prefixes a hexadecimal number if found elsewhere on a +line. + +Two other characters, @samp{%} and @samp{!}, each start a comment anywhere +on the line. Thus you can't use the @samp{modulus} and @samp{not} +operators in expressions normally associated with these two characters. + +A @samp{;} is a line separator, treated as a new-line, so separate +instructions can be specified on a single line. + +@node MMIX-Symbols +@subsection Symbols +The character @samp{:} is permitted in identifiers. There are two +exceptions to it being treated as any other symbol character: if a symbol +begins with @samp{:}, it means that the symbol is in the global namespace +and that the current prefix should not be prepended to that symbol +(@pxref{MMIX-Pseudos}). The @samp{:} is then not considered part of the +symbol. For a symbol in the label position (first on a line), a @samp{:} +at the end of a symbol is silently stripped off. A label is permitted, +but not required, to be followed by a @samp{:}, as with many other +assembly formats. + +The character @samp{@@} in an expression, is a synonym for @samp{.}, the +current location. + +In addition to the common forward and backward local symbol formats +(@pxref{Symbol Names}), they can be specified with upper-case @samp{B} and +@samp{F}, as in @samp{8B} and @samp{9F}. A local label defined for the +current position is written with a @samp{H} appended to the number: +@smallexample +3H LDB $0,$1,2 +@end smallexample +This and traditional local-label formats cannot be mixed: a label must be +defined and referred to using the same format. + +There's a minor caveat: just as for the ordinary local symbols, the local +symbols are translated into ordinary symbols using control characters are +to hide the ordinal number of the symbol. Unfortunately, these symbols +are not translated back in error messages. Thus you may see confusing +error messages when local symbols are used. Control characters +@samp{\003} (control-C) and @samp{\004} (control-D) are used for the +MMIX-specific local-symbol syntax. + +The symbol @samp{Main} is handled specially; it is always global. + +By defining the symbols @samp{__.MMIX.start..text} and +@samp{__.MMIX.start..data}, the address of respectively the @samp{.text} +and @samp{.data} segments of the final program can be defined, though when +linking more than one object file, the code or data in the object file +containing the symbol is not guaranteed to be start at that position; just +the final executable. @xref{MMIX-Pseudos}. + +@node MMIX-Regs +@subsection Register names +@cindex register names, MMIX +@cindex MMIX register names + +Local and global registers are specified as @samp{$0} to @samp{$255}. +The recognized special register names are @samp{rJ}, @samp{rA}, @samp{rB}, +@samp{rC}, @samp{rD}, @samp{rE}, @samp{rF}, @samp{rG}, @samp{rH}, +@samp{rI}, @samp{rK}, @samp{rL}, @samp{rM}, @samp{rN}, @samp{rO}, +@samp{rP}, @samp{rQ}, @samp{rR}, @samp{rS}, @samp{rT}, @samp{rU}, +@samp{rV}, @samp{rW}, @samp{rX}, @samp{rY}, @samp{rZ}, @samp{rBB}, +@samp{rTT}, @samp{rWW}, @samp{rXX}, @samp{rYY} and @samp{rZZ}. A leading +@samp{:} is optional for special register names. + +Local and global symbols can be equated to register names and used in +place of ordinary registers. + +Similarly for special registers, local and global symbols can be used. +Also, symbols equated from numbers and constant expressions are allowed in +place of a special register, except when either of the options +@code{--no-predefined-syms} and @code{--fixed-special-register-names} are +specified. Then only the special register names above are allowed for the +instructions having a special register operand; @code{GET} and @code{PUT}. + +@node MMIX-Pseudos +@subsection Assembler Directives +@cindex assembler directives, MMIX +@cindex pseudo-ops, MMIX +@cindex MMIX assembler directives +@cindex MMIX pseudo-ops + +@table @code +@item LOC +@cindex assembler directive LOC, MMIX +@cindex pseudo-op LOC, MMIX +@cindex MMIX assembler directive LOC +@cindex MMIX pseudo-op LOC + +@emph{MMIX-loc} +The @code{LOC} directive sets the current location to the value of the +operand field, which may include changing sections. If the operand is a +constant, the section is set to either @code{.data} if the value is +@code{0x2000000000000000} or larger, else it is set to @code{.text}. +Within a section, the current location may only be changed to +monotonically higher addresses. A LOC expression must be a previously +defined symbol or a ``pure'' constant. + +An example, which sets the label @var{prev} to the current location, and +updates the current location to eight bytes forward: +@smallexample +prev LOC @@+8 +@end smallexample + +When a LOC has a constant as its operand, a symbol +@code{__.MMIX.start..text} or @code{__.MMIX.start..data} is defined +depending on the address as mentioned above. Each such symbol is +interpreted as special by the linker, locating the section at that +address. Note that if multiple files are linked, the first object file +with that section will be mapped to that address (not necessarily the file +with the LOC definition). + +@item LOCAL +@cindex assembler directive LOCAL, MMIX +@cindex pseudo-op LOCAL, MMIX +@cindex MMIX assembler directive LOCAL +@cindex MMIX pseudo-op LOCAL + +@emph{MMIX-local} +Example: +@smallexample + LOCAL external_symbol + LOCAL 42 + .local asymbol +@end smallexample + +This directive-operation generates a link-time assertion that the operand +does not correspond to a global register. The operand is an expression +that at link-time resolves to a register symbol or a number. A number is +treated as the register having that number. There is one restriction on +the use of this directive: the pseudo-directive must be placed in a +section with contents, code or data. + +@item IS +@cindex assembler directive IS, MMIX +@cindex pseudo-op IS, MMIX +@cindex MMIX assembler directive IS +@cindex MMIX pseudo-op IS + +@emph{MMIX-is} +The @code{IS} directive: +@smallexample +asymbol IS an_expression +@end smallexample +sets the symbol @samp{asymbol} to @samp{an_expression}. A symbol may not +be set more than once using this directive. Local labels may be set using +this directive, for example: +@smallexample +5H IS @@+4 +@end smallexample + +@item GREG +@cindex assembler directive GREG, MMIX +@cindex pseudo-op GREG, MMIX +@cindex MMIX assembler directive GREG +@cindex MMIX pseudo-op GREG + +@emph{MMIX-greg} +This directive reserves a global register, gives it an initial value and +optionally gives it a symbolic name. Some examples: + +@smallexample +areg GREG +breg GREG data_value + GREG data_buffer + .greg creg, another_data_value +@end smallexample + +The symbolic register name can be used in place of a (non-special) +register. If a value isn't provided, it defaults to zero. Unless the +option @samp{--no-merge-gregs} is specified, non-zero registers allocated +with this directive may be eliminated by @code{@value{AS}}; another +register with the same value used in its place. +Any of the instructions +@samp{CSWAP}, +@samp{GO}, +@samp{LDA}, +@samp{LDBU}, +@samp{LDB}, +@samp{LDHT}, +@samp{LDOU}, +@samp{LDO}, +@samp{LDSF}, +@samp{LDTU}, +@samp{LDT}, +@samp{LDUNC}, +@samp{LDVTS}, +@samp{LDWU}, +@samp{LDW}, +@samp{PREGO}, +@samp{PRELD}, +@samp{PREST}, +@samp{PUSHGO}, +@samp{STBU}, +@samp{STB}, +@samp{STCO}, +@samp{STHT}, +@samp{STOU}, +@samp{STSF}, +@samp{STTU}, +@samp{STT}, +@samp{STUNC}, +@samp{SYNCD}, +@samp{SYNCID}, +can have a value nearby @emph{GREG-base}an initial value in place of its +second and third operands. Here, ``nearby'' is defined as within the +range 0@dots{}255 from the initial value of such an allocated register. + +@smallexample +buffer1 BYTE 0,0,0,0,0 +buffer2 BYTE 0,0,0,0,0 + @dots{} + GREG buffer1 + LDOU $42,buffer2 +@end smallexample +In the example above, the @samp{Y} field of the @code{LDOUI} instruction +(LDOU with a constant Z) will be replaced with the global register +allocated for @samp{buffer1}, and the @samp{Z} field will have the value +5, the offset from @samp{buffer1} to @samp{buffer2}. The result is +equivalent to this code: +@smallexample +buffer1 BYTE 0,0,0,0,0 +buffer2 BYTE 0,0,0,0,0 + @dots{} +tmpreg GREG buffer1 + LDOU $42,tmpreg,(buffer2-buffer1) +@end smallexample + +Global registers allocated with this directive are allocated in order +higher-to-lower within a file. Other than that, the exact order of +register allocation and elimination is undefined. For example, the order +is undefined when more than one file with such directives are linked +together. + +@item BYTE +@cindex assembler directive BYTE, MMIX +@cindex pseudo-op BYTE, MMIX +@cindex MMIX assembler directive BYTE +@cindex MMIX pseudo-op BYTE + +@emph{MMIX-byte} +The @samp{BYTE} directive takes a series of operands separated by a comma. +If an operand is a string (@pxref{Strings}), each character of that string +is emitted as a byte. Other operands must be constant expressions without +forward references, in the range 0@dots{}255. If you need operands having +expressions with forward references, use @samp{.byte} (@pxref{Byte}). An +operand can be omitted, defaulting to a zero value. + +@item WYDE +@itemx TETRA +@itemx OCTA +@cindex assembler directive WYDE, MMIX +@cindex pseudo-op WYDE, MMIX +@cindex MMIX assembler directive WYDE +@cindex MMIX pseudo-op WYDE +@cindex assembler directive TETRA, MMIX +@cindex pseudo-op TETRA, MMIX +@cindex MMIX assembler directive TETRA +@cindex MMIX pseudo-op TETRA +@cindex assembler directive OCTA, MMIX +@cindex pseudo-op OCTA, MMIX +@cindex MMIX assembler directive OCTA +@cindex MMIX pseudo-op OCTA + +@emph{MMIX-constants} +The directives @samp{WYDE}, @samp{TETRA} and @samp{OCTA} emit constants of +two, four and eight bytes size respectively. Before anything else happens +for the directive, the current location is aligned to the respective +constant-size bondary. If a label is defined at the beginning of the +line, its value will be that after the alignment. A single operand can be +omitted, defaulting to a zero value emitted for the directive. Operands +can be expressed as strings (@pxref{Strings}), in which case each +character in the string is emitted as a separate constant of the size +indicated by the directive. + +@item PREFIX +@cindex assembler directive PREFIX, MMIX +@cindex pseudo-op PREFIX, MMIX +@cindex MMIX assembler directive PREFIX +@cindex MMIX pseudo-op PREFIX + +@emph{MMIX-prefix} +The @samp{PREFIX} directive sets a symbol name prefix to be prepended to +all symbols (except local symbols, @pxref{MMIX-Symbols}), that are not +prefixed with @samp{:}, until the next @samp{PREFIX} directive. Such +prefixes accumulate. For example, +@smallexample + PREFIX a + PREFIX b +c IS 0 +@end smallexample +defines a symbol @samp{abc} with the value 0. + +@item BSPEC +@itemx ESPEC +@cindex assembler directive BSPEC, MMIX +@cindex pseudo-op BSPEC, MMIX +@cindex MMIX assembler directive BSPEC +@cindex MMIX pseudo-op BSPEC +@cindex assembler directive ESPEC, MMIX +@cindex pseudo-op ESPEC, MMIX +@cindex MMIX assembler directive ESPEC +@cindex MMIX pseudo-op ESPEC + +@emph{MMIX-spec} +A pair of @samp{BSPEC} and @samp{ESPEC} directives delimit a section of +special contents (without specified semantics). Example: +@smallexample + BSPEC 42 + TETRA 1,2,3 + ESPEC +@end smallexample +The single operand to @samp{BSPEC} must be number in the range +0@dots{}255. The @samp{BSPEC} number 80 is used by the GNU binutils +implementation. +@end table + +@node MMIX-mmixal +@section Differences to @code{mmixal} +@cindex mmixal differences +@cindex differences, mmixal + +The binutils @code{@value{AS}} and @code{@value{LD}} combination has a few +differences in function compared to @code{mmixal} (@pxref{MMIX-Syntax}). + +The replacement of a symbol with a GREG-allocated register +(@xref{MMIX-Pseudos}) is not handled the exactly same way in +@code{@value{AS}} as in @code{mmixal}. This is apparent in the +@code{mmixal} example file @code{inout.mms}, where different registers +with different offsets, eventually yielding the same address, are used in +the first instruction. This type of difference should however not affect +the function of any program unless it has specific assumptions about the +allocated register number. + +Line numbers (in the @samp{mmo} object format) are currently not +supported. + +Expression operator precedence is not that of mmixal: operator precedence +is that of the C programming language. It's recommended to use +parentheses to explicitly specify wanted operator precedence whenever more +than one type of operators are used. + +The serialize unary operator @code{&}, the fractional division operator +@samp{//}, the logical not operator @code{!} and the modulus operator +@samp{%} are not available. + +Symbols are not global by default, unless the option +@samp{--globalize-symbols} is passed. Use the @samp{.global} directive to +globalize symbols (@pxref{Global}). + +Operand syntax is a bit stricter with @code{@value{AS}} than +@code{mmixal}. For example, you can't say @code{addu 1,2,3}, instead you +must write @code{addu $1,$2,3}. + +You can't LOC to a lower address than those already visited +(i.e. ``backwards''). + +A LOC directive must come before any emitted code. + +Predefined symbols are visible as file-local symbols after use. (In the +ELF file, that is---the linked mmo file has no notion of a file-local +symbol.) + +Some mapping of constant expressions to sections in LOC expressions is +attempted, but that functionality is easily confused and should be avoided +unless compatibility with @code{mmixal} is required. A LOC expression to +@samp{0x2000000000000000} or higher, maps to the @samp{.data} section and +lower addresses map to the @samp{.text} section (@pxref{MMIX-Pseudos}). + +The code and data areas are each contiguous. Sparse programs with +far-away LOC directives will take up the same amount of space as a +contiguous program with zeros filled in the gaps between the LOC +directives. If you need sparse programs, you might try and get the wanted +effect with a linker script and splitting up the code parts into sections +(@pxref{Section}). Assembly code for this, to be compatible with +@code{mmixal}, would look something like: +@smallexample + .if 0 + LOC away_expression + .else + .section away,"ax" + .fi +@end smallexample +@code{@value{AS}} will not execute the LOC directive and @code{mmixal} +ignores the lines with @code{.}. This construct can be used generally to +help compatibility. + +Symbols can't be defined twice--not even to the same value. + +Instruction mnemonics are recognized case-insensitive, though the +@samp{IS} and @samp{GREG} pseudo-operations must be specified in +upper-case characters. + +There's no unicode support. + +The following is a list of programs in +@emph{http://www-cs-faculty.stanford.edu/~knuth/mmix-news.html} dated +2001-08-25 (md5sum c393470cfc86fac040487d22d2bf0172) that assembles with +@code{mmixal} but don't with @code{@value{AS}}: + +@table @code +@item silly.mms +LOC to a previous address. +@item sim.mms +Redefines symbol @samp{Done}. +@item test.mms +Uses the serial operator @samp{&}. +@end table diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 50e3674..d7667ff 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-10-30 Hans-Peter Nilsson <hp@bitrange.com> + + * gas/mmix: New testsuite directory. + 2001-10-24 Chris Demetriou <cgd@broadcom.com> * gas/mips/ld-empic.d: Remove extra whitespace at beginning of diff --git a/gas/testsuite/gas/mmix/1cjmp1b-n.d b/gas/testsuite/gas/mmix/1cjmp1b-n.d new file mode 100644 index 0000000..ddc4191 --- /dev/null +++ b/gas/testsuite/gas/mmix/1cjmp1b-n.d @@ -0,0 +1,12 @@ +# objdump: -dr +# source: 1cjmp1b.s +# as: -no-expand +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd000000 swym 0,0,0 + 4: f0000001 jmp 8 <Main\+0x8> + 8: f0000000 jmp 8 <Main\+0x8> + c: f1ffffff jmp 8 <Main\+0x8> diff --git a/gas/testsuite/gas/mmix/1cjmp1b-r.d b/gas/testsuite/gas/mmix/1cjmp1b-r.d new file mode 100644 index 0000000..8178ea8 --- /dev/null +++ b/gas/testsuite/gas/mmix/1cjmp1b-r.d @@ -0,0 +1,15 @@ +# objdump: -dr +# as: -linkrelax +# source: 1cjmp1b.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd000000 swym 0,0,0 + 4: f0000001 jmp 8 <Main\+0x8> + 4: R_MMIX_ADDR27 \.text\+0x8 + 8: f0000000 jmp 8 <Main\+0x8> + 8: R_MMIX_ADDR27 \.text\+0x8 + c: f1ffffff jmp 8 <Main\+0x8> + c: R_MMIX_ADDR27 \.text\+0x8 diff --git a/gas/testsuite/gas/mmix/1cjmp1b.d b/gas/testsuite/gas/mmix/1cjmp1b.d new file mode 100644 index 0000000..de7b9b9 --- /dev/null +++ b/gas/testsuite/gas/mmix/1cjmp1b.d @@ -0,0 +1,10 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd000000 swym 0,0,0 + 4: f0000001 jmp 8 <Main\+0x8> + 8: f0000000 jmp 8 <Main\+0x8> + c: f1ffffff jmp 8 <Main\+0x8> diff --git a/gas/testsuite/gas/mmix/1cjmp1b.l b/gas/testsuite/gas/mmix/1cjmp1b.l new file mode 100644 index 0000000..dbd30bd --- /dev/null +++ b/gas/testsuite/gas/mmix/1cjmp1b.l @@ -0,0 +1,14 @@ +GAS for MMIX .*/1cjmp1b.s page 1 + + + 1 0000 FD000000 Main SWYM 0,0,0 + 2 0004 F0000001 1: JMP 1f + 3 0008 F0000000 1: JMP 1b + 4 000c F1FFFFFF JMP 1b +GAS for MMIX .*/1cjmp1b.s page 2 + + +DEFINED SYMBOLS +.*/1cjmp1b.s:1 .text:0000000000000000 Main + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/1cjmp1b.s b/gas/testsuite/gas/mmix/1cjmp1b.s new file mode 100644 index 0000000..cf96265 --- /dev/null +++ b/gas/testsuite/gas/mmix/1cjmp1b.s @@ -0,0 +1,4 @@ +Main SWYM 0,0,0 +1: JMP 1f +1: JMP 1b + JMP 1b diff --git a/gas/testsuite/gas/mmix/1cjmp1brn.d b/gas/testsuite/gas/mmix/1cjmp1brn.d new file mode 100644 index 0000000..0ecc003 --- /dev/null +++ b/gas/testsuite/gas/mmix/1cjmp1brn.d @@ -0,0 +1,15 @@ +# objdump: -dr +# source: 1cjmp1b.s +# as: -linkrelax -no-expand +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd000000 swym 0,0,0 + 4: f0000000 jmp 4 <Main\+0x4> + 4: R_MMIX_ADDR27 \.text\+0x8 + 8: f0000000 jmp 8 <Main\+0x8> + 8: R_MMIX_ADDR27 \.text\+0x8 + c: f0000000 jmp c <Main\+0xc> + c: R_MMIX_ADDR27 \.text\+0x8 diff --git a/gas/testsuite/gas/mmix/1hjmp1b.d b/gas/testsuite/gas/mmix/1hjmp1b.d new file mode 100644 index 0000000..866c796 --- /dev/null +++ b/gas/testsuite/gas/mmix/1hjmp1b.d @@ -0,0 +1,10 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd000000 swym 0,0,0 + 4: f0000001 jmp 8 <Main\+0x8> + 8: f1ffffff jmp 4 <Main\+0x4> + c: f1ffffff jmp 8 <Main\+0x8> diff --git a/gas/testsuite/gas/mmix/1hjmp1b.l b/gas/testsuite/gas/mmix/1hjmp1b.l new file mode 100644 index 0000000..2222541 --- /dev/null +++ b/gas/testsuite/gas/mmix/1hjmp1b.l @@ -0,0 +1,14 @@ +GAS for MMIX .*/1hjmp1b.s page 1 + + + 1 0000 FD000000 Main SWYM 0,0,0 + 2 0004 F0000001 1H JMP 1F + 3 0008 F1FFFFFF 1H JMP 1B + 4 000c F1FFFFFF JMP 1B +GAS for MMIX .*/1hjmp1b.s page 2 + + +DEFINED SYMBOLS +.*/1hjmp1b.s:1 .text:0000000000000000 Main + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/1hjmp1b.s b/gas/testsuite/gas/mmix/1hjmp1b.s new file mode 100644 index 0000000..bff7551 --- /dev/null +++ b/gas/testsuite/gas/mmix/1hjmp1b.s @@ -0,0 +1,4 @@ +Main SWYM 0,0,0 +1H JMP 1F +1H JMP 1B + JMP 1B diff --git a/gas/testsuite/gas/mmix/align-1.d b/gas/testsuite/gas/mmix/align-1.d new file mode 100644 index 0000000..c4b4c41 --- /dev/null +++ b/gas/testsuite/gas/mmix/align-1.d @@ -0,0 +1,18 @@ +#objdump: -srt + +.*: file format elf64-mmix + +SYMBOL TABLE: +0000000000000000 l d \.text 0000000000000000 +0000000000000000 l d \.data 0000000000000000 +0000000000000000 l d \.bss 0000000000000000 +0000000000000002 l \.text 0000000000000000 a +0000000000000008 l \.text 0000000000000000 b +0000000000000010 l \.text 0000000000000000 c +000000000000001c g F \.text 0000000000000000 Main + + +Contents of section \.text: + 0000 00000001 02000000 00000003 04000000 .* + 0010 00000000 00000005 06000000 fd000102 .* +Contents of section \.data: diff --git a/gas/testsuite/gas/mmix/align-1.s b/gas/testsuite/gas/mmix/align-1.s new file mode 100644 index 0000000..5c90385 --- /dev/null +++ b/gas/testsuite/gas/mmix/align-1.s @@ -0,0 +1,11 @@ +# Check that alignment is applied for instructions and pseudos, and that +# labels to such entities are aligned. + + BYTE 0 +a WYDE 1 + BYTE 2 +b TETRA 3 + BYTE 4 +c OCTA 5 + BYTE 6 +Main SWYM 0,1,2 diff --git a/gas/testsuite/gas/mmix/basep-1.d b/gas/testsuite/gas/mmix/basep-1.d new file mode 100644 index 0000000..f2dcfae --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-1.d @@ -0,0 +1,10 @@ +#objdump: -dr + +.*: file format elf64-mmix + +Disassembly of section \.text: + +0+ <a>: + 0: 0000002a trap 0,0,42 + 4: 8d2b0034 ldo \$43,\$0,52 + 6: R_MMIX_REG \.MMIX\.reg_contents diff --git a/gas/testsuite/gas/mmix/basep-1.s b/gas/testsuite/gas/mmix/basep-1.s new file mode 100644 index 0000000..a10ea1c --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-1.s @@ -0,0 +1,4 @@ +# Simple base-plus-offset +b GREG @ +a TETRA 42 + LDO $43,a+52 diff --git a/gas/testsuite/gas/mmix/basep-2.d b/gas/testsuite/gas/mmix/basep-2.d new file mode 100644 index 0000000..09f2d9a --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-2.d @@ -0,0 +1,23 @@ +#as: --no-predefined-syms +#objdump: -dr + +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <a>: + 0: 0000002a trap 0,0,42 + 4: 8d2b0034 ldo \$43,\$0,52 + 6: R_MMIX_REG \.MMIX\.reg_contents\+0x8 + \.\.\. + +0000000000000108 <d>: + 108: 0000001c trap 0,0,28 + 10c: 8d8f000c ldo \$143,\$0,12 + 10e: R_MMIX_REG \.MMIX\.reg_contents + 110: 8df3000c ldo \$243,\$0,12 + 112: R_MMIX_REG \.MMIX\.reg_contents\+0x8 + 114: 23670028 addu \$103,\$0,40 + 116: R_MMIX_REG \.MMIX\.reg_contents + 118: 230d0018 addu \$13,\$0,24 + 11a: R_MMIX_REG \.MMIX\.reg_contents\+0x8 diff --git a/gas/testsuite/gas/mmix/basep-2.s b/gas/testsuite/gas/mmix/basep-2.s new file mode 100644 index 0000000..53012a8 --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-2.s @@ -0,0 +1,12 @@ +# Simple base-plus-offset +b GREG @ +a TETRA 42 + LDO $43,a+52 + + LOC @+256 +c GREG @ +d TETRA 28 + LDO $143,d+12 + LDO $243,a+12 + LDA $103,d+40 + LDA $13,a+24 diff --git a/gas/testsuite/gas/mmix/basep-3.d b/gas/testsuite/gas/mmix/basep-3.d new file mode 100644 index 0000000..87ed646 --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-3.d @@ -0,0 +1,13 @@ +#objdump: -dr + +.*: file format elf64-mmix + +Disassembly of section \.text: + +0+ <Main>: + 0: bf2a0000 pushgo \$42,\$0,0 + 2: R_MMIX_REG \.MMIX\.reg_contents + 4: fd000000 swym 0,0,0 + +0+8 <extfn>: + 8: f8000000 pop 0,0 diff --git a/gas/testsuite/gas/mmix/basep-3.s b/gas/testsuite/gas/mmix/basep-3.s new file mode 100644 index 0000000..20d7c1b --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-3.s @@ -0,0 +1,5 @@ +# PUSHGO is eligible for base-plus-offset addressing. + GREG fn +Main PUSHGO $42,fn + SWYM 0 +extfn POP 0,0 diff --git a/gas/testsuite/gas/mmix/bspec-1.d b/gas/testsuite/gas/mmix/bspec-1.d new file mode 100644 index 0000000..9775b36 --- /dev/null +++ b/gas/testsuite/gas/mmix/bspec-1.d @@ -0,0 +1,48 @@ +#readelf: -Ssr -x1 -x4 + +There are 9 section headers, starting at offset 0xa0: + +Section Headers: + \[Nr\] Name Type Address Offset + Size EntSize Flags Link Info Align + \[ 0\] NULL 0000000000000000 00000000 + 0000000000000000 0000000000000000 0 0 0 + \[ 1\] \.text PROGBITS 0000000000000000 00000040 + 0000000000000004 0000000000000000 AX 0 0 4 + \[ 2\] \.data PROGBITS 0000000000000000 00000044 + 0000000000000000 0000000000000000 WA 0 0 1 + \[ 3\] \.bss NOBITS 0000000000000000 00000044 + 0000000000000000 0000000000000000 WA 0 0 1 + \[ 4\] \.MMIX\.spec_data\.2 PROGBITS 0000000000000000 00000044 + 0000000000000004 0000000000000000 0 0 4 + \[ 5\] \.rela\.MMIX\.spec_d RELA 0000000000000000 00000378 + 0000000000000018 0000000000000018 7 4 8 + \[ 6\] \.shstrtab STRTAB 0000000000000000 00000048 + 0000000000000055 0000000000000000 0 0 1 + \[ 7\] \.symtab SYMTAB 0000000000000000 000002e0 + 0000000000000090 0000000000000018 8 5 8 + \[ 8\] \.strtab STRTAB 0000000000000000 00000370 + 0000000000000006 0000000000000000 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\) + I \(info\), L \(link order\), G \(group\), x \(unknown\) + O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) + +Relocation section '\.rela\.MMIX\.spec_data\.2' at offset 0x378 contains 1 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+Symbol's Value[ ]+Symbol's Name[ ]+Addend +0+ 0+500000004 R_MMIX_32 0+ forw \+ 0 + +Symbol table '\.symtab' contains 6 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 0+ 0 NOTYPE LOCAL DEFAULT UND + 1: 0+ 0 SECTION LOCAL DEFAULT 1 + 2: 0+ 0 SECTION LOCAL DEFAULT 2 + 3: 0+ 0 SECTION LOCAL DEFAULT 3 + 4: 0+ 0 SECTION LOCAL DEFAULT 4 + 5: 0+ 0 NOTYPE GLOBAL DEFAULT UND forw + +Hex dump of section '\.text': + 0x00000000 fd010203 .* + +Hex dump of section '\.MMIX\.spec_data\.2': + 0x00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/bspec-1.s b/gas/testsuite/gas/mmix/bspec-1.s new file mode 100644 index 0000000..f4a992b --- /dev/null +++ b/gas/testsuite/gas/mmix/bspec-1.s @@ -0,0 +1,4 @@ + SWYM 1,2,3 + BSPEC 2 + TETRA forw + ESPEC diff --git a/gas/testsuite/gas/mmix/bspec-2.d b/gas/testsuite/gas/mmix/bspec-2.d new file mode 100644 index 0000000..aef2758 --- /dev/null +++ b/gas/testsuite/gas/mmix/bspec-2.d @@ -0,0 +1,47 @@ +#readelf: -Sr -x1 -x4 +There are 11 section headers, starting at offset 0xe0: + +Section Headers: + \[Nr\] Name Type Address Offset + Size EntSize Flags Link Info Align + \[ 0\] NULL 0+ 0+ + 0+ 0+ 0 0 0 + \[ 1\] \.text PROGBITS 0+ 0+40 + 0+4 0+ AX 0 0 4 + \[ 2\] \.data PROGBITS 0+ 0+44 + 0+ 0+ WA 0 0 1 + \[ 3\] \.bss NOBITS 0+ 0+44 + 0+ 0+ WA 0 0 1 + \[ 4\] \.MMIX\.spec_data\.2 PROGBITS 0+ 0+48 + 0+10 0+ 0 0 8 + \[ 5\] \.rela\.MMIX\.spec_d RELA 0+ 0+470 + 0+30 0+18 9 4 8 + \[ 6\] \.MMIX\.spec_data\.3 PROGBITS 0+ 0+58 + 0+8 0+ 0 0 8 + \[ 7\] \.rela\.MMIX\.spec_d RELA 0+ 0+4a0 + 0+18 0+18 9 6 8 + \[ 8\] \.shstrtab STRTAB 0+ 0+60 + 0+7e 0+ 0 0 1 + \[ 9\] \.symtab SYMTAB 0+ 0+3a0 + 0+c0 0+18 10 6 8 + \[10\] \.strtab STRTAB 0+ 0+460 + 0+c 0+ 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\) + I \(info\), L \(link order\), G \(group\), x \(unknown\) + O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) + +Relocation section '\.rela\.MMIX\.spec_data\.2' at offset 0x470 contains 2 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+Symbol's Value[ ]+Symbol's Name[ ]+Addend +0+ 0+600000004 R_MMIX_32 0+ forw \+ 0 +0+8 0+700000005 R_MMIX_64 0+ other \+ 0 + +Relocation section '\.rela\.MMIX\.spec_data\.3' at offset 0x4a0 contains 1 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+Symbol's Value[ ]+Symbol's Name[ ]+Addend +0+ 0+700000005 R_MMIX_64 0+ other \+ 0 + +Hex dump of section '\.text': + 0x00000000 fd010203 .* + +Hex dump of section '\.MMIX\.spec_data\.2': + 0x00000000 00000000 0000002a 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/bspec-2.s b/gas/testsuite/gas/mmix/bspec-2.s new file mode 100644 index 0000000..aab1bee --- /dev/null +++ b/gas/testsuite/gas/mmix/bspec-2.s @@ -0,0 +1,11 @@ + SWYM 1,2,3 + BSPEC 2 + TETRA forw + ESPEC + BSPEC 3 + OCTA other + ESPEC + BSPEC 2 + TETRA 42 + OCTA other + ESPEC diff --git a/gas/testsuite/gas/mmix/builtin1.d b/gas/testsuite/gas/mmix/builtin1.d new file mode 100644 index 0000000..1733cf4 --- /dev/null +++ b/gas/testsuite/gas/mmix/builtin1.d @@ -0,0 +1,22 @@ +# objdump: -dtr + +# Make sure we can override a built-in symbol with a known constant, like +# with mmixal. + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+14 l \*ABS\* 0+ rJ +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ g F \.text 0+ Main + + +Disassembly of section \.text: + +0+ <Main>: + 0: fe050014 get \$5,rL + 4: fe060014 get \$6,rL + 8: f6140007 put rL,\$7 + c: f6140008 put rL,\$8 diff --git a/gas/testsuite/gas/mmix/builtin1.s b/gas/testsuite/gas/mmix/builtin1.s new file mode 100644 index 0000000..6c7c282 --- /dev/null +++ b/gas/testsuite/gas/mmix/builtin1.s @@ -0,0 +1,8 @@ +# When disallowing built-in names, we have to treat GET and PUT +# specially, so when parsing the special register operand we do +# not use the symbol table. +rJ IS 20 +Main GET $5,rJ + GET $6,:rJ + PUT rJ,$7 + PUT :rJ,$8 diff --git a/gas/testsuite/gas/mmix/builtin2.d b/gas/testsuite/gas/mmix/builtin2.d new file mode 100644 index 0000000..f0e1c6a --- /dev/null +++ b/gas/testsuite/gas/mmix/builtin2.d @@ -0,0 +1,24 @@ +# as: -no-predefined-syms +# objdump: -dtr +# source: builtin1.s + +# Make sure we don't look at the symbol table when parsing special +# register names. + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+14 l \*ABS\* 0+ rJ +0+ g F \.text 0+ Main + + +Disassembly of section \.text: + +0+ <Main>: + 0: fe050004 get \$5,rJ + 4: fe060004 get \$6,rJ + 8: f6040007 put rJ,\$7 + c: f6040008 put rJ,\$8 diff --git a/gas/testsuite/gas/mmix/builtin3.d b/gas/testsuite/gas/mmix/builtin3.d new file mode 100644 index 0000000..4c03230 --- /dev/null +++ b/gas/testsuite/gas/mmix/builtin3.d @@ -0,0 +1,24 @@ +# as: -fixed-special-register-names +# objdump: -dtr +# source: builtin1.s + +# Make sure we don't look at the symbol table when parsing special +# register names. + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+14 l \*ABS\* 0+ rJ +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ g F \.text 0+ Main + + +Disassembly of section \.text: + +0+ <Main>: + 0: fe050004 get \$5,rJ + 4: fe060004 get \$6,rJ + 8: f6040007 put rJ,\$7 + c: f6040008 put rJ,\$8 diff --git a/gas/testsuite/gas/mmix/byte-1.d b/gas/testsuite/gas/mmix/byte-1.d new file mode 100644 index 0000000..3f26d02 --- /dev/null +++ b/gas/testsuite/gas/mmix/byte-1.d @@ -0,0 +1,41 @@ +#readelf: -Ssrx1 +There are 7 section headers, starting at offset 0x88: + +Section Headers: + \[Nr\] Name Type Address Offset + Size EntSize Flags Link Info Align + \[ 0\] NULL 0000000000000000 00000000 + 0000000000000000 0000000000000000 0 0 0 + \[ 1\] \.text PROGBITS 0000000000000000 00000040 + 0000000000000018 0000000000000000 AX 0 0 4 + \[ 2\] \.data PROGBITS 0000000000000000 00000058 + 0000000000000000 0000000000000000 WA 0 0 1 + \[ 3\] \.bss NOBITS 0000000000000000 00000058 + 0000000000000000 0000000000000000 WA 0 0 1 + \[ 4\] \.shstrtab STRTAB 0000000000000000 00000058 + 000000000000002c 0000000000000000 0 0 1 + \[ 5\] \.symtab SYMTAB 0000000000000000 00000248 + 00000000000000c0 0000000000000018 6 7 8 + \[ 6\] \.strtab STRTAB 0000000000000000 00000308 + 0000000000000018 0000000000000000 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\) + I \(info\), L \(link order\), G \(group\), x \(unknown\) + O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) + +There are no relocations in this file\. + +Symbol table '\.symtab' contains 8 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 0+ 0 NOTYPE LOCAL DEFAULT UND + 1: 0+ 0 SECTION LOCAL DEFAULT 1 + 2: 0+ 0 SECTION LOCAL DEFAULT 2 + 3: 0+ 0 SECTION LOCAL DEFAULT 3 + 4: 0+2a 0 NOTYPE LOCAL DEFAULT ABS number + 5: 0+4 0 NOTYPE LOCAL DEFAULT 1 label + 6: 0+c 0 NOTYPE LOCAL DEFAULT 1 lab2 + 7: 0+ 0 FUNC GLOBAL DEFAULT 1 Main + +Hex dump of section '\.text': + 0x00000000 fd2b2a29 73747269 6e670aff 8e007374 .* + 0x00000010 72696e67 320a0000 .* diff --git a/gas/testsuite/gas/mmix/byte-1.s b/gas/testsuite/gas/mmix/byte-1.s new file mode 100644 index 0000000..d5f8401 --- /dev/null +++ b/gas/testsuite/gas/mmix/byte-1.s @@ -0,0 +1,6 @@ +# Test BYTE sequences, excercising code paths for valid input. +number IS 42 +Main SWYM 43,number,41 + +label BYTE "string",#a,255 +lab2 BYTE number+100,0,"string2",#a diff --git a/gas/testsuite/gas/mmix/bz-c.d b/gas/testsuite/gas/mmix/bz-c.d new file mode 100644 index 0000000..6043258 --- /dev/null +++ b/gas/testsuite/gas/mmix/bz-c.d @@ -0,0 +1,30 @@ +#as: -x +#objdump: -tdr + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d .text 0+ +0+ l d .data 0+ +0+ l d .bss 0+ +ffff0000ffff0000 l \*ABS\* 0+ i1 +ffff0000ffff0000 l \*ABS\* 0+ i2 +0+ g F .text 0+ Main + +Disassembly of section .text: + +0+ <Main>: + 0: 42ff0000 bz \$255,0 <Main> + 0: R_MMIX_CBRANCH \*ABS\*\+0xffff0000ffff0000 + 4: fd000000 swym 0,0,0 + 8: fd000000 swym 0,0,0 + c: fd000000 swym 0,0,0 + 10: fd000000 swym 0,0,0 + 14: fd000000 swym 0,0,0 + 18: 42ff0000 bz \$255,18 <Main\+0x18> + 18: R_MMIX_CBRANCH i2 + 1c: fd000000 swym 0,0,0 + 20: fd000000 swym 0,0,0 + 24: fd000000 swym 0,0,0 + 28: fd000000 swym 0,0,0 + 2c: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/bz-c.s b/gas/testsuite/gas/mmix/bz-c.s new file mode 100644 index 0000000..4591570 --- /dev/null +++ b/gas/testsuite/gas/mmix/bz-c.s @@ -0,0 +1,5 @@ +% BZ far away must not fail +i1 IS #ffff0000ffff0000 +Main BZ $255,i1 + BZ $255,i2 +i2 IS #ffff0000ffff0000 diff --git a/gas/testsuite/gas/mmix/comment-1.d b/gas/testsuite/gas/mmix/comment-1.d new file mode 100644 index 0000000..7c91eb9 --- /dev/null +++ b/gas/testsuite/gas/mmix/comment-1.d @@ -0,0 +1,69 @@ +#as: -no-expand +#readelf: -Ssrx1 -x6 + +There are 10 section headers, starting at offset 0x130: + +Section Headers: + \[Nr\] Name Type Address Offset + Size EntSize Flags Link Info Align + \[ 0\] NULL 0+ 0+ + 0+ 0+ 0 0 0 + \[ 1\] \.text PROGBITS 0+ 0+40 + 0+88 0+ AX 0 0 8 + \[ 2\] \.rela\.text RELA 0+ 0+4f8 + 0+78 0+18 8 1 8 + \[ 3\] \.data PROGBITS 0+ 0+c8 + 0+ 0+ WA 0 0 1 + \[ 4\] \.bss NOBITS 0+ 0+c8 + 0+ 0+ WA 0 0 1 + \[ 5\] \.MMIX\.spec_data\.4 PROGBITS 0+ 0+c8 + 0+ 0+ 0 0 1 + \[ 6\] \.MMIX\.reg_content PROGBITS 0+ 0+c8 + 0+8 0+ W 0 0 1 + \[ 7\] \.shstrtab STRTAB 0+ 0+d0 + 0+5d 0+ 0 0 1 + \[ 8\] \.symtab SYMTAB 0+ 0+3b0 + 0+120 0+18 9 8 8 + \[ 9\] \.strtab STRTAB 0+ 0+4d0 + 0+21 0+ 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\) + I \(info\), L \(link order\), G \(group\), x \(unknown\) + O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) + +Relocation section '\.rela\.text' at offset 0x4f8 contains 5 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+Symbol's Value[ ]+Symbol's Name[ ]+Addend +0+34 0+90000001e R_MMIX_ADDR19 0+ target \+ 2c +0+46 0+a00000002 R_MMIX_16 0+ target2 \+ 30 +0+48 0+b0000001f R_MMIX_ADDR27 0+ target3 \+ 38 +0+54 0+b0000001e R_MMIX_ADDR19 0+ target3 \+ 0 +0+78 0+23 R_MMIX_LOCAL 0+30 + +Symbol table '\.symtab' contains 12 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 0+ 0 NOTYPE LOCAL DEFAULT UND + 1: 0+ 0 SECTION LOCAL DEFAULT 1 + 2: 0+ 0 SECTION LOCAL DEFAULT 3 + 3: 0+ 0 SECTION LOCAL DEFAULT 4 + 4: 0+18 0 NOTYPE LOCAL DEFAULT ABS z + 5: 0+80 0 NOTYPE LOCAL DEFAULT 1 x + 6: 0+ 0 SECTION LOCAL DEFAULT 5 + 7: 0+ 0 SECTION LOCAL DEFAULT 6 + 8: 0+ 0 FUNC GLOBAL DEFAULT 1 Main + 9: 0+ 0 NOTYPE GLOBAL DEFAULT UND target + 10: 0+ 0 NOTYPE GLOBAL DEFAULT UND target2 + 11: 0+ 0 NOTYPE GLOBAL DEFAULT UND target3 + +Hex dump of section '\.text': + 0x0+ 0000007b 00010017 00010203 01030201 .* + 0x0+10 09050006 09070208 0509000a 050b030c .* + 0x0+20 230f1011 23121300 23141516 34170018 .* + 0x0+30 34191a1b 401c0000 b91d1e1f bf202122 .* + 0x0+40 c1232400 e0250000 f0000000 f8260027 .* + 0x0+50 f9000028 f2290000 fa2a0000 fb00002b .* + 0x0+60 f604002c fe2d0004 00000000 03020104 .* + 0x0+70 0007000c 00000014 00000000 0000001c .* + 0x0+80 fd221538 00000000 .* + +Hex dump of section '\.MMIX\.reg_contents': + 0x0+ 00000000 00000033 .* diff --git a/gas/testsuite/gas/mmix/comment-1.s b/gas/testsuite/gas/mmix/comment-1.s new file mode 100644 index 0000000..9186c6a --- /dev/null +++ b/gas/testsuite/gas/mmix/comment-1.s @@ -0,0 +1,46 @@ +# Check that "naked" comments are accepted and ignored on all different +# mnemonic types and pseudos. The goal is to use all combinations of +# operands where varying number of operands are allowed. If any +# combinations are missing, for simplicity, add them to another file. +Main TRAP 123 ignore; x y z + TRAP 1,23 all; x y z + TRAP 1,2,3 these; x y z + FCMP $3,$2,$1 comments; x y z + FLOT $5,6 and; x y z + FLOT $7,ROUND_UP,8 do; x y z + FIX $9,$10 nothing; x y z + FIX $11,ROUND_DOWN,$12 that; x y z + ADDU $15,$16,17 would make; x y z + LDA $18,$19 a; x y z + LDA $20,$21,22 difference; x y z + NEG $23,$24 in; x y z + NEG $25,26,$27 the; x y z + bn $28,target + 44 generated; x y z + SYNCD 29,$30,31 code; x y z + PUSHGO 32,$33,34 so; x y z + SET $35,$36 it; x y z + SETH $37,target2 + 48 is; x y z + JMP target3 + 56 as; x y z + POP 38,39 if; x y z + RESUME 40 it; x y z + PUSHJ $41,target3 had; x y z + SAVE $42,0 never; x y z + UNSAVE 0,$43 been; x y z + PUT rJ,$44 there; x y z + GET $45,rJ at all.; x y z + + LOC @+4 likewise; x y z + PREFIX : with; x y z + BYTE 3,2,1,0+4 the; x y z + WYDE 7,4+8 different; x y z + TETRA 8+12 pseudo; x y z + OCTA 12+16 ops,; x y z + LOCAL 48 they; x y z + BSPEC 49 too; x y z +# Specifying an operand field (although ignored) is necessary for a comment +# with a ';' to be ignorable and not interpreted as eoln, both for GAS and +# mmixal. + ESPEC 0 ignore; x y z + GREG 50 + 1 naked; x y z +z IS 9 + 8 + 7 comments; x y z +x SWYM 34,21,56 diff --git a/gas/testsuite/gas/mmix/comment-2.d b/gas/testsuite/gas/mmix/comment-2.d new file mode 100644 index 0000000..5530552 --- /dev/null +++ b/gas/testsuite/gas/mmix/comment-2.d @@ -0,0 +1,15 @@ +#objdump: -drt + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ g F \.text 0+ Main + + +Disassembly of section \.text: + +0+ <Main>: + 0: f801e240 pop 1,57920 diff --git a/gas/testsuite/gas/mmix/comment-2.s b/gas/testsuite/gas/mmix/comment-2.s new file mode 100644 index 0000000..105de1e --- /dev/null +++ b/gas/testsuite/gas/mmix/comment-2.s @@ -0,0 +1 @@ +Main POP 123456 ignore; x y z diff --git a/gas/testsuite/gas/mmix/comment-3.d b/gas/testsuite/gas/mmix/comment-3.d new file mode 100644 index 0000000..1e3f0ba --- /dev/null +++ b/gas/testsuite/gas/mmix/comment-3.d @@ -0,0 +1,21 @@ +#objdump: -srt + +.*: file format elf64-mmix + +SYMBOL TABLE: +0000000000000000 l d \.text 0000000000000000 +0000000000000000 l d \.data 0000000000000000 +0000000000000000 l d \.bss 0000000000000000 +0000000000000000 l \.MMIX\.reg_contents 0000000000000000 im +0000000000000000 l d \.MMIX\.reg_contents 0000000000000000 + + +RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]: +OFFSET TYPE VALUE +0000000000000000 R_MMIX_64 \.text + + +Contents of section \.text: +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/comment-3.s b/gas/testsuite/gas/mmix/comment-3.s new file mode 100644 index 0000000..6affde5 --- /dev/null +++ b/gas/testsuite/gas/mmix/comment-3.s @@ -0,0 +1,2 @@ +# If we aren't careful, '@' will be considered an operator. +im GREG @ home diff --git a/gas/testsuite/gas/mmix/cons-1.d b/gas/testsuite/gas/mmix/cons-1.d new file mode 100644 index 0000000..ab263b0 --- /dev/null +++ b/gas/testsuite/gas/mmix/cons-1.d @@ -0,0 +1,7 @@ +#objdump: -sr + +.*: file format elf64-mmix + +Contents of section \.text: + 0000 00000000 00000000 .* +Contents of section \.data: diff --git a/gas/testsuite/gas/mmix/cons-1.s b/gas/testsuite/gas/mmix/cons-1.s new file mode 100644 index 0000000..c12a38b --- /dev/null +++ b/gas/testsuite/gas/mmix/cons-1.s @@ -0,0 +1,2 @@ +# Empty expressions are a single zero. +d OCTA diff --git a/gas/testsuite/gas/mmix/cons-2.d b/gas/testsuite/gas/mmix/cons-2.d new file mode 100644 index 0000000..dbb8a07 --- /dev/null +++ b/gas/testsuite/gas/mmix/cons-2.d @@ -0,0 +1,14 @@ +#objdump: -str + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ g F \.text 0+ Main + +Contents of section \.text: + 0000 61623b00 00000000 00000000 00000064 .* + 0010 00000000 00000065 .* +Contents of section \.data: diff --git a/gas/testsuite/gas/mmix/cons-2.s b/gas/testsuite/gas/mmix/cons-2.s new file mode 100644 index 0000000..7597e82 --- /dev/null +++ b/gas/testsuite/gas/mmix/cons-2.s @@ -0,0 +1,4 @@ +# Character constants. We actually see e.g. 'b' as 98, so ww just check +# that we get the right output with this test. +Main BYTE 'a','b',';' + OCTA 'd','e' diff --git a/gas/testsuite/gas/mmix/err-bpo1.s b/gas/testsuite/gas/mmix/err-bpo1.s new file mode 100644 index 0000000..c658abf --- /dev/null +++ b/gas/testsuite/gas/mmix/err-bpo1.s @@ -0,0 +1,12 @@ +% { dg-do assemble { target mmix-*-* } } + +% SAVE, UNSAVE are not valid with base-plus-offset + + .data +buffer OCTA 0,0,0 + + .text + GREG buffer +Main SWYM 0 + SAVE buffer,0 % { dg-error "operands" "" } + UNSAVE 0,buffer % { dg-error "operands" "" } diff --git a/gas/testsuite/gas/mmix/err-bspec-1.s b/gas/testsuite/gas/mmix/err-bspec-1.s new file mode 100644 index 0000000..5216179 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-bspec-1.s @@ -0,0 +1,4 @@ +% { dg-do assemble { target mmix-*-* } } +Main SET $45,23 + BSPEC 5 % { dg-error "BSPEC without ESPEC" "" } + TETRA 4 diff --git a/gas/testsuite/gas/mmix/err-bspec-2.s b/gas/testsuite/gas/mmix/err-bspec-2.s new file mode 100644 index 0000000..90a12bb --- /dev/null +++ b/gas/testsuite/gas/mmix/err-bspec-2.s @@ -0,0 +1,7 @@ +% { dg-do assemble { target mmix-*-* } } +Main SET $45,23 + BSPEC 5 + TETRA 4 + BSPEC 6 % { dg-error "BSPEC already active" "" } + TETRA 5 + ESPEC diff --git a/gas/testsuite/gas/mmix/err-bspec-3.s b/gas/testsuite/gas/mmix/err-bspec-3.s new file mode 100644 index 0000000..d127680 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-bspec-3.s @@ -0,0 +1,4 @@ +% { dg-do assemble { target mmix-*-* } } +Main SET $45,23 + TETRA 4 + ESPEC % { dg-error "ESPEC without preceding BSPEC" "" } diff --git a/gas/testsuite/gas/mmix/err-bspec-4.s b/gas/testsuite/gas/mmix/err-bspec-4.s new file mode 100644 index 0000000..a4ce11b --- /dev/null +++ b/gas/testsuite/gas/mmix/err-bspec-4.s @@ -0,0 +1,7 @@ +% { dg-do assemble { target mmix-*-* } } +Main SET $45,23 + BSPEC 2 + TETRA 4 + ESPEC + TETRA 5 + ESPEC % { dg-error "ESPEC without preceding BSPEC" "" } diff --git a/gas/testsuite/gas/mmix/err-bspec-5.s b/gas/testsuite/gas/mmix/err-bspec-5.s new file mode 100644 index 0000000..8f1cdf0 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-bspec-5.s @@ -0,0 +1,23 @@ +% { dg-do assemble { target mmix-*-* } } +Main SET $45,23 +here SWYM 0,0,0 + BSPEC 0 + TETRA 4 + ESPEC + BSPEC 65535 + TETRA 4 + ESPEC + BSPEC 65536 % { dg-error "invalid BSPEC expression" "" } + TETRA 4 + ESPEC + BSPEC forw % { dg-error "invalid BSPEC expression" "" } + TETRA 4 + ESPEC + BSPEC here % { dg-error "invalid BSPEC expression" "" } + TETRA 4 + ESPEC + BSPEC -1 % { dg-error "invalid BSPEC expression" "" } + TETRA 4 + ESPEC + + diff --git a/gas/testsuite/gas/mmix/err-builtin.s b/gas/testsuite/gas/mmix/err-builtin.s new file mode 100644 index 0000000..68f97c4 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-builtin.s @@ -0,0 +1,14 @@ +% { dg-do assemble { target mmix-*-* } } +% { dg-options "-no-predefined-syms" } +% When disallowing built-in names, we have to treat GET and PUT +% specially, so when parsing the special register operand we do +% not use the symbol table. Make sure an error is emitted for +% invalid registers despite there being a valid user label and +% the construct being valid without the -no-builtin-syms option. +% FIXME: Another option? Or is this just the consequence? +RJ IS 4 +other IS 20 +Main GET $5,RJ % { dg-error "invalid operands" "" } + PUT other,$7 % { dg-error "invalid operands" "" } + GET garbage % { dg-error "invalid operands" "" } + PUT garbage % { dg-error "invalid operands" "" } diff --git a/gas/testsuite/gas/mmix/err-byte1.s b/gas/testsuite/gas/mmix/err-byte1.s new file mode 100644 index 0000000..28ad78e --- /dev/null +++ b/gas/testsuite/gas/mmix/err-byte1.s @@ -0,0 +1,11 @@ +% { dg-do assemble { target mmix-*-* } } +% { dg-error "unterminated string" "" { target mmix-*-* } 10 } +% { dg-bogus "end of file" "" { xfail mmix-*-* } 0 } + +# Note that the error is detected in the preformatter, before the text +# gets to the assembler. It also gets confused about the unterminated +# string. Well, at least we get error messages for it, so no worries. + +Main SWYM 0,0,0 + BYTE 2,"no end + BYTE 0 diff --git a/gas/testsuite/gas/mmix/err-byte2.s b/gas/testsuite/gas/mmix/err-byte2.s new file mode 100644 index 0000000..0db84ce --- /dev/null +++ b/gas/testsuite/gas/mmix/err-byte2.s @@ -0,0 +1,17 @@ +% { dg-do assemble { target mmix-*-* } } + +m1 IS -1 +zero IS 0 +zero2 IS 0 +1H IS 42 +2H IS 5 +Main SWYM 0,0,0 + BYTE 0 + BYTE -1 % { dg-error "BYTE expression not in the range 0..255" "" } + BYTE m1 % { dg-error "BYTE expression not in the range 0..255" "" } + BYTE zero2 + BYTE 1B+2B+55 + BYTE zero+m1 % { dg-error "BYTE expression not in the range 0..255" "" } + BYTE 255 + BYTE 256 % { dg-error "BYTE expression not in the range 0..255" "" } + BYTE unk+1 % { dg-error "BYTE expression not a pure number" "" } diff --git a/gas/testsuite/gas/mmix/err-case.s b/gas/testsuite/gas/mmix/err-case.s new file mode 100644 index 0000000..ef0ab68 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-case.s @@ -0,0 +1,8 @@ +% Check that lowercase pseudos with mmixal syntax (no dot prefix) aren't +% recognized. Since local is handled as an insn, it's actually +% misrecognized in lower case. +% { dg-do assemble { target mmix-*-* } } +Main SWYM 0,0,0 +X is 42 % { dg-error "unknown opcode: \`is\'" "" } + local 56 % { dg-error "unknown opcode: \`fatal\'" "" { xfail *-*-* } } +a greg 94 % { dg-error "unknown opcode: \`greg\'" "" } diff --git a/gas/testsuite/gas/mmix/err-fb-1.s b/gas/testsuite/gas/mmix/err-fb-1.s new file mode 100644 index 0000000..d2f0caf --- /dev/null +++ b/gas/testsuite/gas/mmix/err-fb-1.s @@ -0,0 +1,7 @@ +% { dg-do assemble { target mmix-*-* } } +% { dg-error "may not appear alone on a line" "" { target mmix-*-* } 5 } +% { dg-error "may not appear alone on a line" "" { target mmix-*-* } 6 } +0H .local 32 % { dg-error "do not mix with dot-pseudos" "" } +1H +2H +3H .set s,32 % { dg-error "do not mix with dot-pseudos" "" } diff --git a/gas/testsuite/gas/mmix/err-greg1.s b/gas/testsuite/gas/mmix/err-greg1.s new file mode 100644 index 0000000..8c6af66 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-greg1.s @@ -0,0 +1,10 @@ +% { dg-do assemble { target mmix-*-* } } + +% One more than greg9.s is one too many. +% The error is reported on the wrong line. Methinks that error is +% attributable to the .rept machinery. No xfail+bogus for this one. + +Main SWYM 0 + .rept 223 + GREG + .endr % { dg-error "too many GREG registers allocated" "" } diff --git a/gas/testsuite/gas/mmix/err-insn.s b/gas/testsuite/gas/mmix/err-insn.s new file mode 100644 index 0000000..5d95de2 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-insn.s @@ -0,0 +1,5 @@ +% { dg-do assemble { target mmix-*-* } } +Main SWYM 0,0,0 + FLOT $112,$223,$41 % { dg-error "invalid operands" "Y field of FLOT 1" } + FLOT $112,$223,141 % { dg-error "invalid operands" "Y field of FLOT 2" } + LDA $122,$203,256 % { dg-error "invalid operands" "Z field too large" } diff --git a/gas/testsuite/gas/mmix/err-is-1.s b/gas/testsuite/gas/mmix/err-is-1.s new file mode 100644 index 0000000..f82fb1a --- /dev/null +++ b/gas/testsuite/gas/mmix/err-is-1.s @@ -0,0 +1,4 @@ +% { dg-do assemble { target mmix-*-* } } + IS 42 % { dg-error "empty label field for IS" "" } +2H IS 1 + IS 2B % { dg-error "empty label field for IS" "" } diff --git a/gas/testsuite/gas/mmix/err-loc-1.s b/gas/testsuite/gas/mmix/err-loc-1.s new file mode 100644 index 0000000..9b51f84 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-loc-1.s @@ -0,0 +1,5 @@ +% { dg-do assemble { target mmix-*-* } } + LOC #200 +Main SET $45,23 + LOC #100 % { dg-error "LOC expression stepping backwards" "" } + SET $57,$67 diff --git a/gas/testsuite/gas/mmix/err-loc-2.s b/gas/testsuite/gas/mmix/err-loc-2.s new file mode 100644 index 0000000..599f0d2 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-loc-2.s @@ -0,0 +1,5 @@ +% { dg-do assemble { target mmix-*-* } } + LOC (#20 << 56) + #200 + TETRA 1 + LOC (#20 << 56) + #100 % { dg-error "LOC expression stepping backwards" "" } + TETRA 2 diff --git a/gas/testsuite/gas/mmix/err-loc-3.s b/gas/testsuite/gas/mmix/err-loc-3.s new file mode 100644 index 0000000..f2f6852 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-loc-3.s @@ -0,0 +1,4 @@ +% { dg-do assemble { target mmix-*-* } } + LOC (#20 << 56) + #202 + TETRA 1 + OCTA 1 % { dg-error "data item with alignment larger than location" "" } diff --git a/gas/testsuite/gas/mmix/err-loc-4.s b/gas/testsuite/gas/mmix/err-loc-4.s new file mode 100644 index 0000000..c5cabe1 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-loc-4.s @@ -0,0 +1,4 @@ +% { dg-do assemble { target mmix-*-* } } + LOC #201 + WYDE 1 + SWYM 1 % { dg-error "specified location wasn't TETRA-aligned" "" } diff --git a/gas/testsuite/gas/mmix/err-loc-5.s b/gas/testsuite/gas/mmix/err-loc-5.s new file mode 100644 index 0000000..f009417 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-loc-5.s @@ -0,0 +1,4 @@ +% { dg-do assemble { target mmix-*-* } } + LOC (#20<<56)|1 + .p2align 0 + SWYM 1 % { dg-error "unaligned data at an absolute location" "" } diff --git a/gas/testsuite/gas/mmix/err-loc-6.s b/gas/testsuite/gas/mmix/err-loc-6.s new file mode 100644 index 0000000..c11b2c3 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-loc-6.s @@ -0,0 +1,4 @@ +% { dg-do assemble { target mmix-*-* } } + LOC #201 + .p2align 0 + SWYM 1 % { dg-error "unaligned data at an absolute location" "" } diff --git a/gas/testsuite/gas/mmix/err-loc-7.s b/gas/testsuite/gas/mmix/err-loc-7.s new file mode 100644 index 0000000..47712e8 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-loc-7.s @@ -0,0 +1,4 @@ +% { dg-do assemble { target mmix-*-* } } + LOC (#20<<56)|1 + .p2align 0 + TETRA 1 % { dg-error "unaligned data at an absolute location" "" } diff --git a/gas/testsuite/gas/mmix/err-loc-8.s b/gas/testsuite/gas/mmix/err-loc-8.s new file mode 100644 index 0000000..8fc0d87 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-loc-8.s @@ -0,0 +1,4 @@ +% { dg-do assemble { target mmix-*-* } } + LOC #201 + .p2align 0 + TETRA 1 % { dg-error "unaligned data at an absolute location" "" } diff --git a/gas/testsuite/gas/mmix/err-local1.s b/gas/testsuite/gas/mmix/err-local1.s new file mode 100644 index 0000000..10c8575 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-local1.s @@ -0,0 +1,6 @@ +% { dg-do assemble { target mmix-*-* } } +% Check that error handling for the restrictions on LOCAL works. + LOCAL 128 % { dg-error "LOCAL must be placed in code or data" "" } + + LOC Data_Segment + OCTA 0 diff --git a/gas/testsuite/gas/mmix/err-local2.s b/gas/testsuite/gas/mmix/err-local2.s new file mode 100644 index 0000000..76ee849 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-local2.s @@ -0,0 +1,3 @@ +% { dg-do assemble { target mmix-*-* } } +% Check that error handling for the restrictions on LOCAL works. + LOCAL 128 % { dg-error "LOCAL must be placed in code or data" "" } diff --git a/gas/testsuite/gas/mmix/err-ser-1.s b/gas/testsuite/gas/mmix/err-ser-1.s new file mode 100644 index 0000000..fb9bdc1 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-ser-1.s @@ -0,0 +1,10 @@ +% { dg-do assemble { target mmix-*-* } } +% { dg-bogus "bad expression" "" { xfail mmix-*-* } 9 } +% { dg-bogus "bad expression" "" { xfail mmix-*-* } 10 } + +% Make sure we correctly diagnose the serial-number operator. +% We can't stop the "bad expression" error, though; hence the "bogus" errors. + +a IS 42 +Main TETRA &a<<8 { dg-error "serial number operator is not supported" "" } + TETRA 3+&a<<8 { dg-error "serial number operator is not supported" "" } diff --git a/gas/testsuite/gas/mmix/err-set.s b/gas/testsuite/gas/mmix/err-set.s new file mode 100644 index 0000000..23ac3c3 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-set.s @@ -0,0 +1,7 @@ +% { dg-do assemble { target mmix-*-* } } +Main SET $45,23 + SET $57,$67 % Valid, Z is 0. + SET $78,X % Valid, Z is 0. + SET $7,Y % { dg-error "invalid operands.*value of 967 too large" "" } +X IS $31 +Y IS 967 diff --git a/gas/testsuite/gas/mmix/expr-1.d b/gas/testsuite/gas/mmix/expr-1.d new file mode 100644 index 0000000..5f0fea9 --- /dev/null +++ b/gas/testsuite/gas/mmix/expr-1.d @@ -0,0 +1,7 @@ +# objdump: -s + +.*: file format elf64-mmix + +Contents of section \.text: + 0000 000000ab 00000100 .* +Contents of section \.data: diff --git a/gas/testsuite/gas/mmix/expr-1.s b/gas/testsuite/gas/mmix/expr-1.s new file mode 100644 index 0000000..bbd8a58 --- /dev/null +++ b/gas/testsuite/gas/mmix/expr-1.s @@ -0,0 +1,6 @@ +% Test expression example from TAOCP. Nothing problematic; does not have +% the known expression evaluation order mismatch problem. + +k IS #cdef00 +Main OCTA #ab<<32+k&~(k-1) + diff --git a/gas/testsuite/gas/mmix/fb-1.d b/gas/testsuite/gas/mmix/fb-1.d new file mode 100644 index 0000000..255cafc --- /dev/null +++ b/gas/testsuite/gas/mmix/fb-1.d @@ -0,0 +1,21 @@ +#objdump: -str + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l d \.MMIX\.reg_contents 0+ + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+2 R_MMIX_REG \.MMIX\.reg_contents + + +Contents of section \.text: + 0+ dd2d0038 .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0+ 00000000 aabbccdd 00000000 00112233 .* diff --git a/gas/testsuite/gas/mmix/fb-1.s b/gas/testsuite/gas/mmix/fb-1.s new file mode 100644 index 0000000..e4c4987 --- /dev/null +++ b/gas/testsuite/gas/mmix/fb-1.s @@ -0,0 +1,4 @@ +# FB-labels are valid in GREG definitions. +9H GREG #112233 +9H GREG #aabbccdd +1H MOR $45,9B,56 diff --git a/gas/testsuite/gas/mmix/fb-2.d b/gas/testsuite/gas/mmix/fb-2.d new file mode 100644 index 0000000..4e1519a --- /dev/null +++ b/gas/testsuite/gas/mmix/fb-2.d @@ -0,0 +1,33 @@ +#objdump: -str + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l d \.MMIX\.reg_contents 0+ +0+10 g \*ABS\* 0+ __\.MMIX\.start\.\.text + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+2a R_MMIX_REG \.MMIX\.reg_contents +0+30 R_MMIX_64 \.text\+0x0+28 +0+38 R_MMIX_64 \.text\+0x0+40 + + +RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]: +OFFSET TYPE VALUE +0+ R_MMIX_64 \.text\+0x0+5a + + +Contents of section \.text: + 0000 05000000 00000000 00000000 00000000 .* + 0010 00000000 00000000 00000000 00000000 .* + 0020 00000000 fd000000 231e0000 00000000 .* + 0030 00000000 00000000 00000000 00000000 .* + 0040 fd000000 002a002b 002b002c 00000000 .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/fb-2.s b/gas/testsuite/gas/mmix/fb-2.s new file mode 100644 index 0000000..40a57d5 --- /dev/null +++ b/gas/testsuite/gas/mmix/fb-2.s @@ -0,0 +1,20 @@ +# Test fb-label where the insn or pseudo on line with definition uses an +# argment with a same-number label. +1H IS 5 +0H LOC #10 +1H BYTE 1B +0H LOC 0B+#20+0F +0H IS 4 +1H IS 50 +1H GREG 1B+1F + SWYM +1H LDA $30,1B +1H OCTA 1B,1F +1H SWYM + +9H IS 42 + WYDE 9B,9F +9H IS 9B+1 + WYDE 9B,9F +9H IS 9B+1 + diff --git a/gas/testsuite/gas/mmix/get-op-r.d b/gas/testsuite/gas/mmix/get-op-r.d new file mode 100644 index 0000000..34fe207 --- /dev/null +++ b/gas/testsuite/gas/mmix/get-op-r.d @@ -0,0 +1,11 @@ +# objdump: -dr +# as: -linkrelax +# source: get-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fe7b0004 get \$123,rJ + 4: fe2d0013 get \$45,rG + 8: fef5001f get \$245,rZZ diff --git a/gas/testsuite/gas/mmix/get-op.d b/gas/testsuite/gas/mmix/get-op.d new file mode 100644 index 0000000..335f67d --- /dev/null +++ b/gas/testsuite/gas/mmix/get-op.d @@ -0,0 +1,9 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fe7b0004 get \$123,rJ + 4: fe2d0013 get \$45,rG + 8: fef5001f get \$245,rZZ diff --git a/gas/testsuite/gas/mmix/get-op.l b/gas/testsuite/gas/mmix/get-op.l new file mode 100644 index 0000000..104282a --- /dev/null +++ b/gas/testsuite/gas/mmix/get-op.l @@ -0,0 +1,17 @@ +GAS for MMIX .*/get-op\.s page 1 + + + 1 #.* + 2 #.* + 3 0000 FE7B0004 Main GET X,rJ + 4 0004 FE2D0013 GET \$45,rG + 5 0008 FEF5001F GET \$245,rZZ + 6 X IS \$123 +GAS for MMIX .*/get-op\.s page 2 + + +DEFINED SYMBOLS +.*/get-op\.s:3 \.text:0000000000000000 Main + \*REG\*:000000000000007b X + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/get-op.s b/gas/testsuite/gas/mmix/get-op.s new file mode 100644 index 0000000..1d49ae9 --- /dev/null +++ b/gas/testsuite/gas/mmix/get-op.s @@ -0,0 +1,6 @@ +# For 'g'-type operands: GET. +# +Main GET X,rJ + GET $45,rG + GET $245,rZZ +X IS $123 diff --git a/gas/testsuite/gas/mmix/geta-c.d b/gas/testsuite/gas/mmix/geta-c.d new file mode 100644 index 0000000..851018c --- /dev/null +++ b/gas/testsuite/gas/mmix/geta-c.d @@ -0,0 +1,26 @@ +#as: -x +#objdump: -tdr + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d .text 0+ +0+ l d .data 0+ +0+ l d .bss 0+ +ffff0000ffff0000 l \*ABS\* 0+ i1 +ffff0000ffff0000 l \*ABS\* 0+ i2 +0+ g F .text 0+ Main + +Disassembly of section .text: + +0+ <Main>: + 0: f4ff0000 geta \$255,0 <Main> + 0: R_MMIX_GETA \*ABS\*\+0xffff0000ffff0000 + 4: fd000000 swym 0,0,0 + 8: fd000000 swym 0,0,0 + c: fd000000 swym 0,0,0 + 10: f4ff0000 geta \$255,10 <Main\+0x10> + 10: R_MMIX_GETA i2 + 14: fd000000 swym 0,0,0 + 18: fd000000 swym 0,0,0 + 1c: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/geta-c.s b/gas/testsuite/gas/mmix/geta-c.s new file mode 100644 index 0000000..4fa12f3 --- /dev/null +++ b/gas/testsuite/gas/mmix/geta-c.s @@ -0,0 +1,5 @@ +% GETA with a large constant must not fail +i1 IS #ffff0000ffff0000 +Main GETA $255,i1 + GETA $255,i2 +i2 IS #ffff0000ffff0000 diff --git a/gas/testsuite/gas/mmix/geta-op-r.d b/gas/testsuite/gas/mmix/geta-op-r.d new file mode 100644 index 0000000..5620e1f --- /dev/null +++ b/gas/testsuite/gas/mmix/geta-op-r.d @@ -0,0 +1,37 @@ +# objdump: -dr +# as: -linkrelax +# source: geta-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd000000 swym 0,0,0 + +0000000000000004 <here>: + 4: fd000000 swym 0,0,0 + 8: f519ffff geta \$25,4 <here> + 8: R_MMIX_ADDR19 \.text\+0x4 + +000000000000000c <at>: + c: f4200000 geta \$32,c <at> + c: R_MMIX_ADDR19 \.text\+0xc + 10: 424e0008 bz \$78,30 <there> + 10: R_MMIX_ADDR19 \.text\+0x30 + 14: f35bfffc pushj \$91,4 <here> + 14: R_MMIX_ADDR19 \.text\+0x4 + 18: f387fffb pushj \$135,4 <here> + 18: R_MMIX_ADDR19 \.text\+0x4 + 1c: f4870005 geta \$135,30 <there> + 1c: R_MMIX_ADDR19 \.text\+0x30 + 20: f2870004 pushj \$135,30 <there> + 20: R_MMIX_ADDR19 \.text\+0x30 + 24: f2490003 pushj \$73,30 <there> + 24: R_MMIX_ADDR19 \.text\+0x30 + 28: f2380002 pushj \$56,30 <there> + 28: R_MMIX_ADDR19 \.text\+0x30 + 2c: 5f87fff6 pbev \$135,4 <here> + 2c: R_MMIX_ADDR19 \.text\+0x4 + +0000000000000030 <there>: + 30: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/geta-op.d b/gas/testsuite/gas/mmix/geta-op.d new file mode 100644 index 0000000..a169fe5 --- /dev/null +++ b/gas/testsuite/gas/mmix/geta-op.d @@ -0,0 +1,25 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd000000 swym 0,0,0 + +0000000000000004 <here>: + 4: fd000000 swym 0,0,0 + 8: f519ffff geta \$25,4 <here> + +000000000000000c <at>: + c: f4200000 geta \$32,c <at> + 10: 424e0008 bz \$78,30 <there> + 14: f35bfffc pushj \$91,4 <here> + 18: f387fffb pushj \$135,4 <here> + 1c: f4870005 geta \$135,30 <there> + 20: f2870004 pushj \$135,30 <there> + 24: f2490003 pushj \$73,30 <there> + 28: f2380002 pushj \$56,30 <there> + 2c: 5f87fff6 pbev \$135,4 <here> + +0000000000000030 <there>: + 30: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/geta-op.l b/gas/testsuite/gas/mmix/geta-op.l new file mode 100644 index 0000000..1d36dc4 --- /dev/null +++ b/gas/testsuite/gas/mmix/geta-op.l @@ -0,0 +1,31 @@ +GAS for MMIX .*/geta-op\.s page 1 + + + 1 #.* + 2 0000 FD000000 Main SWYM 0,0,0 + 3 0004 FD000000 here SWYM 0,0,0 + 4 0008 F519FFFF GETA \$25,here + 5 000c F4200000 at GETA \$32,at + 6 0010 424E0008 BZ \$78,there + 7 0014 F35BFFFC PUSHJ X0,here + 8 0018 F387FFFB PUSHJ X,here + 9 001c F4870005 GETA X,there + 10 0020 F2870004 PUSHJ X,there + 11 0024 F2490003 PUSHJ \$73,there + 12 0028 F2380002 PUSHJ 56,there + 13 002c 5F87FFF6 PBEV X,here + 14 0030 FD000000 there SWYM 0,0,0 + 15 X IS \$135 + 16 X0 IS 91 +GAS for MMIX .*/geta-op\.s page 2 + + +DEFINED SYMBOLS +.*/geta-op\.s:2 \.text:0000000000000000 Main +.*/geta-op\.s:3 \.text:0000000000000004 here +.*/geta-op\.s:5 \.text:000000000000000c at +.*/geta-op\.s:14 \.text:0000000000000030 there + \*ABS\*:000000000000005b X0 + \*REG\*:0000000000000087 X + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/geta-op.s b/gas/testsuite/gas/mmix/geta-op.s new file mode 100644 index 0000000..0715f78 --- /dev/null +++ b/gas/testsuite/gas/mmix/geta-op.s @@ -0,0 +1,16 @@ +# Simple GETA/BRANCH/PUSHJ operands. +Main SWYM 0,0,0 +here SWYM 0,0,0 + GETA $25,here +at GETA $32,at + BZ $78,there + PUSHJ X0,here + PUSHJ X,here + GETA X,there + PUSHJ X,there + PUSHJ $73,there + PUSHJ 56,there + PBEV X,here +there SWYM 0,0,0 +X IS $135 +X0 IS 91 diff --git a/gas/testsuite/gas/mmix/geta-opn.d b/gas/testsuite/gas/mmix/geta-opn.d new file mode 100644 index 0000000..82fa593 --- /dev/null +++ b/gas/testsuite/gas/mmix/geta-opn.d @@ -0,0 +1,27 @@ +# objdump: -dr +# source: geta-op.s +# as: -no-expand +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd000000 swym 0,0,0 + +0000000000000004 <here>: + 4: fd000000 swym 0,0,0 + 8: f519ffff geta \$25,4 <here> + +000000000000000c <at>: + c: f4200000 geta \$32,c <at> + 10: 424e0008 bz \$78,30 <there> + 14: f35bfffc pushj \$91,4 <here> + 18: f387fffb pushj \$135,4 <here> + 1c: f4870005 geta \$135,30 <there> + 20: f2870004 pushj \$135,30 <there> + 24: f2490003 pushj \$73,30 <there> + 28: f2380002 pushj \$56,30 <there> + 2c: 5f87fff6 pbev \$135,4 <here> + +0000000000000030 <there>: + 30: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/geta-oprn.d b/gas/testsuite/gas/mmix/geta-oprn.d new file mode 100644 index 0000000..346eaf1 --- /dev/null +++ b/gas/testsuite/gas/mmix/geta-oprn.d @@ -0,0 +1,37 @@ +# objdump: -dr +# as: -linkrelax -no-expand +# source: geta-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd000000 swym 0,0,0 + +0000000000000004 <here>: + 4: fd000000 swym 0,0,0 + 8: f4190000 geta \$25,8 <here\+0x4> + 8: R_MMIX_ADDR19 \.text\+0x4 + +000000000000000c <at>: + c: f4200000 geta \$32,c <at> + c: R_MMIX_ADDR19 \.text\+0xc + 10: 424e0000 bz \$78,10 <at\+0x4> + 10: R_MMIX_ADDR19 \.text\+0x30 + 14: f25b0000 pushj \$91,14 <at\+0x8> + 14: R_MMIX_ADDR19 \.text\+0x4 + 18: f2870000 pushj \$135,18 <at\+0xc> + 18: R_MMIX_ADDR19 \.text\+0x4 + 1c: f4870000 geta \$135,1c <at\+0x10> + 1c: R_MMIX_ADDR19 \.text\+0x30 + 20: f2870000 pushj \$135,20 <at\+0x14> + 20: R_MMIX_ADDR19 \.text\+0x30 + 24: f2490000 pushj \$73,24 <at\+0x18> + 24: R_MMIX_ADDR19 \.text\+0x30 + 28: f2380000 pushj \$56,28 <at\+0x1c> + 28: R_MMIX_ADDR19 \.text\+0x30 + 2c: 5e870000 pbev \$135,2c <at\+0x20> + 2c: R_MMIX_ADDR19 \.text\+0x4 + +0000000000000030 <there>: + 30: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/greg1.d b/gas/testsuite/gas/mmix/greg1.d new file mode 100644 index 0000000..9040498 --- /dev/null +++ b/gas/testsuite/gas/mmix/greg1.d @@ -0,0 +1,36 @@ +# objdump: -rst + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \.text 0+ D4 +0+4 l \.text 0+ E6 +0+ l \.MMIX\.reg_contents 0+ H9 +0+8 l \.MMIX\.reg_contents 0+ G8 +0+ l \.MMIX\.reg_contents 0+ F7 +0+18 l \.MMIX\.reg_contents 0+ D5 +0+20 l \.MMIX\.reg_contents 0+ C3 +0+28 l \.MMIX\.reg_contents 0+ B1 +0+30 l \.MMIX\.reg_contents 0+ A0 +0+0 l d \.MMIX\.reg_contents 0+ +0+c g F \.text 0+ Main + + +RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]: +OFFSET TYPE VALUE +0+ R_MMIX_64 \.text\+0x0+8 +0+10 R_MMIX_64 \.text\+0x0+1c +0+20 R_MMIX_64 \.text + + +Contents of section \.text: + 0000 e37b01c8 e3ea1edb fd020304 fd010203 .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000000 00000000 000000f7 .* + 0010 00000000 00000000 00000000 00000000 .* + 0020 00000000 00000000 00000000 00000001 .* + 0030 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/greg1.s b/gas/testsuite/gas/mmix/greg1.s new file mode 100644 index 0000000..0dc25d7 --- /dev/null +++ b/gas/testsuite/gas/mmix/greg1.s @@ -0,0 +1,17 @@ +# Use of GREG with mmixal syntax. +D4 SET $123,456 +E6 SET $234,7899 + +A0 GREG 0 +B1 GREG 1 +C3 GREG D4 +D5 GREG + GREG E6+24 +F7 GREG @ + GREG @ % Equivalent to F7, unless -no-merge-gregs. +G8 GREG #F7 +H9 GREG @ % Equivalent to F7, unless -no-merge-gregs. + + SWYM 2,3,4 +Main SWYM 1,2,3 + diff --git a/gas/testsuite/gas/mmix/greg1a.d b/gas/testsuite/gas/mmix/greg1a.d new file mode 100644 index 0000000..557d4b8 --- /dev/null +++ b/gas/testsuite/gas/mmix/greg1a.d @@ -0,0 +1,40 @@ +# source: greg1.s +# as: -no-merge-gregs +# objdump: -rst + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \.text 0+ D4 +0+4 l \.text 0+ E6 +0+ l \.MMIX\.reg_contents 0+ H9 +0+8 l \.MMIX\.reg_contents 0+ G8 +0+18 l \.MMIX\.reg_contents 0+ F7 +0+28 l \.MMIX\.reg_contents 0+ D5 +0+30 l \.MMIX\.reg_contents 0+ C3 +0+38 l \.MMIX\.reg_contents 0+ B1 +0+40 l \.MMIX\.reg_contents 0+ A0 +0+0 l d \.MMIX\.reg_contents 0+ +0+c g F \.text 0+ Main + + +RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]: +OFFSET TYPE VALUE +0+ R_MMIX_64 \.text\+0x0+8 +0+10 R_MMIX_64 \.text\+0x0+8 +0+18 R_MMIX_64 \.text\+0x0+8 +0+20 R_MMIX_64 \.text\+0x0+1c +0+30 R_MMIX_64 .text + +Contents of section \.text: + 0000 e37b01c8 e3ea1edb fd020304 fd010203 .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000000 00000000 000000f7 .* + 0010 00000000 00000000 00000000 00000000 .* + 0020 00000000 00000000 00000000 00000000 .* + 0030 00000000 00000000 00000000 00000001 .* + 0040 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/greg2.d b/gas/testsuite/gas/mmix/greg2.d new file mode 100644 index 0000000..9040498 --- /dev/null +++ b/gas/testsuite/gas/mmix/greg2.d @@ -0,0 +1,36 @@ +# objdump: -rst + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \.text 0+ D4 +0+4 l \.text 0+ E6 +0+ l \.MMIX\.reg_contents 0+ H9 +0+8 l \.MMIX\.reg_contents 0+ G8 +0+ l \.MMIX\.reg_contents 0+ F7 +0+18 l \.MMIX\.reg_contents 0+ D5 +0+20 l \.MMIX\.reg_contents 0+ C3 +0+28 l \.MMIX\.reg_contents 0+ B1 +0+30 l \.MMIX\.reg_contents 0+ A0 +0+0 l d \.MMIX\.reg_contents 0+ +0+c g F \.text 0+ Main + + +RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]: +OFFSET TYPE VALUE +0+ R_MMIX_64 \.text\+0x0+8 +0+10 R_MMIX_64 \.text\+0x0+1c +0+20 R_MMIX_64 \.text + + +Contents of section \.text: + 0000 e37b01c8 e3ea1edb fd020304 fd010203 .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000000 00000000 000000f7 .* + 0010 00000000 00000000 00000000 00000000 .* + 0020 00000000 00000000 00000000 00000001 .* + 0030 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/greg2.s b/gas/testsuite/gas/mmix/greg2.s new file mode 100644 index 0000000..15c91ba --- /dev/null +++ b/gas/testsuite/gas/mmix/greg2.s @@ -0,0 +1,21 @@ +# Use of .greg; non-mmixal syntax though somewhat corresponding to greg1. +# Note that use-before-definition is allowed. + .text + + .greg A0,0 + .greg B1,1 + .greg C3,D4 + .greg D5, + .greg ,E6+24 % Somewhat unusable, but hey... + .greg F7,.+8 + .greg ,.+8 + .greg G8,0xf7 + .greg H9,.+8 + +D4: + set $123,456 +E6: + set $234,7899 + swym 2,3,4 +Main: + swym 1,2,3 diff --git a/gas/testsuite/gas/mmix/greg2a.d b/gas/testsuite/gas/mmix/greg2a.d new file mode 100644 index 0000000..a2ebfe3 --- /dev/null +++ b/gas/testsuite/gas/mmix/greg2a.d @@ -0,0 +1,40 @@ +# source: greg2.s +# as: -no-merge-gregs +# objdump: -rst + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \.text 0+ D4 +0+4 l \.text 0+ E6 +0+ l \.MMIX\.reg_contents 0+ H9 +0+8 l \.MMIX\.reg_contents 0+ G8 +0+18 l \.MMIX\.reg_contents 0+ F7 +0+28 l \.MMIX\.reg_contents 0+ D5 +0+30 l \.MMIX\.reg_contents 0+ C3 +0+38 l \.MMIX\.reg_contents 0+ B1 +0+40 l \.MMIX\.reg_contents 0+ A0 +0+0 l d \.MMIX\.reg_contents 0+ +0+c g F \.text 0+ Main + + +RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]: +OFFSET TYPE VALUE +0+ R_MMIX_64 \.text\+0x0+8 +0+10 R_MMIX_64 \.text\+0x0+8 +0+18 R_MMIX_64 \.text\+0x0+8 +0+20 R_MMIX_64 \.text\+0x0+1c +0+30 R_MMIX_64 .text + +Contents of section \.text: + 0000 e37b01c8 e3ea1edb fd020304 fd010203 .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000000 00000000 000000f7 .* + 0010 00000000 00000000 00000000 00000000 .* + 0020 00000000 00000000 00000000 00000000 .* + 0030 00000000 00000000 00000000 00000001 .* + 0040 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/greg3.d b/gas/testsuite/gas/mmix/greg3.d new file mode 100644 index 0000000..4e73f0e --- /dev/null +++ b/gas/testsuite/gas/mmix/greg3.d @@ -0,0 +1,31 @@ +# objdump: -rst + +# Check that we emit the right relocations for greg operands. + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l d \.MMIX\.reg_contents 0+ +0+ g \.MMIX\.reg_contents 0+ areg +0+c g F \.text 0+ Main + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+2 R_MMIX_REG \.MMIX\.reg_contents +0+7 R_MMIX_REG_OR_BYTE \.MMIX\.reg_contents +0+a R_MMIX_REG \.MMIX\.reg_contents + +RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]: +OFFSET TYPE VALUE +0+ R_MMIX_64 \.text\+0x0+10 + +Contents of section \.text: + 0000 8f030010 8e030700 8f050004 fd000001 .* + 0010 fd000002 fd000003 fd000004 fd000005 .* + 0020 fd000006 .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/greg3.s b/gas/testsuite/gas/mmix/greg3.s new file mode 100644 index 0000000..dbbbd29 --- /dev/null +++ b/gas/testsuite/gas/mmix/greg3.s @@ -0,0 +1,11 @@ + .global areg +areg GREG Main+4 + LDOU $3,areg,16 + LDOU $3,$7,areg + LDOU $5,Main+8 +Main SWYM 1 + SWYM 2 + SWYM 3 + SWYM 4 + SWYM 5 + SWYM 6 diff --git a/gas/testsuite/gas/mmix/greg4.d b/gas/testsuite/gas/mmix/greg4.d new file mode 100644 index 0000000..77dd86a --- /dev/null +++ b/gas/testsuite/gas/mmix/greg4.d @@ -0,0 +1,29 @@ +#objdump: -str + +# Branches can have base-plus-offset operands too. + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+4 l \.text 0+ x +0+ l d \.MMIX\.reg_contents 0+ + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+a R_MMIX_REG \.MMIX\.reg_contents + + +RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]: +OFFSET TYPE VALUE +0+ R_MMIX_64 \.text + + +Contents of section \.text: + 0000 fd000000 fd000001 9f000004 .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/greg4.s b/gas/testsuite/gas/mmix/greg4.s new file mode 100644 index 0000000..dbf7478 --- /dev/null +++ b/gas/testsuite/gas/mmix/greg4.s @@ -0,0 +1,4 @@ + GREG @ + SWYM 0 +x SWYM 1 + GO $0,x diff --git a/gas/testsuite/gas/mmix/greg5.d b/gas/testsuite/gas/mmix/greg5.d new file mode 100644 index 0000000..71b007e --- /dev/null +++ b/gas/testsuite/gas/mmix/greg5.d @@ -0,0 +1,29 @@ +#objdump: -str + +# GAS must know that .data and expressions around #20 << 56 can be +# equivalent for GREGs. + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \.text 0+ t +2000000000000004 l \*ABS\* 0+ x +2000000000000000 l \*ABS\* 0+ Data_Segment +0+ l \.data 0+ y +0+ l d \.MMIX\.reg_contents 0+ +0+ g F \.text 0+ Main +2000000000000008 g \*ABS\* 0+ __\.MMIX\.start\.\.data + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+2 R_MMIX_REG \.MMIX\.reg_contents + +Contents of section \.text: + 0000 232c0004 .* +Contents of section \.data: + 0000 00000000 00000021 .* +Contents of section \.MMIX\.reg_contents: + 0000 20000000 00000004 .* diff --git a/gas/testsuite/gas/mmix/greg5.s b/gas/testsuite/gas/mmix/greg5.s new file mode 100644 index 0000000..745323e --- /dev/null +++ b/gas/testsuite/gas/mmix/greg5.s @@ -0,0 +1,9 @@ +t IS @ +x IS Data_Segment+4 + + LOC x+4 +y OCTA 33 + GREG x + + LOC t +Main LDA $44,y diff --git a/gas/testsuite/gas/mmix/greg6.d b/gas/testsuite/gas/mmix/greg6.d new file mode 100644 index 0000000..40ec5ce --- /dev/null +++ b/gas/testsuite/gas/mmix/greg6.d @@ -0,0 +1,36 @@ +#objdump: -str + +# GAS must know that .data and expressions around #20 << 56 can be +# equivalent for GREGs; like greg5 but the other way round. + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \.text 0+ t +2000000000000004 l \*ABS\* 0+ x +2000000000000000 l \*ABS\* 0+ Data_Segment +0+ l \.data 0+ y +0+ l d \.MMIX\.reg_contents 0+ +0+ g F \.text 0+ Main +2000000000000008 g \*ABS\* 0+ __\.MMIX\.start\.\.data + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+2 R_MMIX_REG \.MMIX\.reg_contents + + +RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]: +OFFSET TYPE VALUE +0+ R_MMIX_64 \.data + + +Contents of section \.text: + 0000 232c0054 .* +Contents of section \.data: + 0000 00000000 00000021 .* +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/greg6.s b/gas/testsuite/gas/mmix/greg6.s new file mode 100644 index 0000000..68ebaaa --- /dev/null +++ b/gas/testsuite/gas/mmix/greg6.s @@ -0,0 +1,11 @@ +t IS @ +x IS Data_Segment+4 + + LOC x+4 +y OCTA 33 + GREG y + + LOC t +Main LDA $44,x+88 + + diff --git a/gas/testsuite/gas/mmix/greg7.d b/gas/testsuite/gas/mmix/greg7.d new file mode 100644 index 0000000..c2b3897 --- /dev/null +++ b/gas/testsuite/gas/mmix/greg7.d @@ -0,0 +1,28 @@ +#objdump: -str + +# GAS must know that .text and expressions around 0 can be equivalent for +# GREGs. + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \.text 0+ t +0+4 l \*ABS\* 0+ x +0+ l \.text 0+ y +0+ l d \.MMIX\.reg_contents 0+ +0+8 g F \.text 0+ Main +0+8 g \*ABS\* 0+ __\.MMIX\.start\.\.text + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+a R_MMIX_REG \.MMIX\.reg_contents + +Contents of section \.text: + 0000 00000000 00000021 232c0004 00000000 .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000004 .* diff --git a/gas/testsuite/gas/mmix/greg7.s b/gas/testsuite/gas/mmix/greg7.s new file mode 100644 index 0000000..27dba87 --- /dev/null +++ b/gas/testsuite/gas/mmix/greg7.s @@ -0,0 +1,8 @@ +t IS @ +x IS 4 + + LOC x+4 +y OCTA 33 + GREG x + +Main LDA $44,y diff --git a/gas/testsuite/gas/mmix/greg8.d b/gas/testsuite/gas/mmix/greg8.d new file mode 100644 index 0000000..fead116 --- /dev/null +++ b/gas/testsuite/gas/mmix/greg8.d @@ -0,0 +1,33 @@ +#objdump: -str + +# GAS must know that .text and expressions around 0 can be +# equivalent for GREGs; like greg7 but the other way round. + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \.text 0+ t +0+4 l \*ABS\* 0+ x +0+ l \.text 0+ y +0+ l d \.MMIX\.reg_contents 0+ +0+8 g F \.text 0+ Main +0+8 g \*ABS\* 0+ __\.MMIX\.start\.\.text + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+a R_MMIX_REG \.MMIX\.reg_contents + + +RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]: +OFFSET TYPE VALUE +0+ R_MMIX_64 \.text + +Contents of section \.text: + 0000 00000000 00000021 232c0054 00000000 .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/greg8.s b/gas/testsuite/gas/mmix/greg8.s new file mode 100644 index 0000000..3778b97 --- /dev/null +++ b/gas/testsuite/gas/mmix/greg8.s @@ -0,0 +1,10 @@ +t IS @ +x IS 4 + + LOC x+4 +y OCTA 33 + GREG y + +Main LDA $44,x+88 + + diff --git a/gas/testsuite/gas/mmix/greg9.d b/gas/testsuite/gas/mmix/greg9.d new file mode 100644 index 0000000..0f8584e --- /dev/null +++ b/gas/testsuite/gas/mmix/greg9.d @@ -0,0 +1,14 @@ +# objdump: -h + +.*: file format elf64-mmix + +Sections: +Idx Name Size VMA LMA File off Algn + 0 \.text 0+4 0+ 0+ 0+40 2\*\*2 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 \.data 0+ 0+ 0+ 0+44 2\*\*0 + CONTENTS, ALLOC, LOAD, DATA + 2 \.bss 0+ 0+ 0+ 0+44 2\*\*0 + ALLOC + 3 \.MMIX\.reg_contents 0+6f0 0+ 0+ 0+44 2\*\*0 + CONTENTS diff --git a/gas/testsuite/gas/mmix/greg9.s b/gas/testsuite/gas/mmix/greg9.s new file mode 100644 index 0000000..dfbb185 --- /dev/null +++ b/gas/testsuite/gas/mmix/greg9.s @@ -0,0 +1,8 @@ +% Check that we can allocate max number of GREGs. +% A bit cheesy: we allocate anonymous GREGs with no handle. This isn't +% generally useful, but it helps keeping the number of lines down, and we +% check that the right thing happened in the object file. +Main SWYM 0 + .rept 222 + GREG + .endr diff --git a/gas/testsuite/gas/mmix/hex-r.d b/gas/testsuite/gas/mmix/hex-r.d new file mode 100644 index 0000000..6be6e1c --- /dev/null +++ b/gas/testsuite/gas/mmix/hex-r.d @@ -0,0 +1,11 @@ +# objdump: -dr +# as: -linkrelax +# source: hex.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: e3362009 setl \$54,0x2009 + 4: e320125e setl \$32,0x125e + 8: e31f00b1 setl \$31,0xb1 diff --git a/gas/testsuite/gas/mmix/hex.d b/gas/testsuite/gas/mmix/hex.d new file mode 100644 index 0000000..fab267c --- /dev/null +++ b/gas/testsuite/gas/mmix/hex.d @@ -0,0 +1,9 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: e3362009 setl \$54,0x2009 + 4: e320125e setl \$32,0x125e + 8: e31f00b1 setl \$31,0xb1 diff --git a/gas/testsuite/gas/mmix/hex.l b/gas/testsuite/gas/mmix/hex.l new file mode 100644 index 0000000..cabd7ad --- /dev/null +++ b/gas/testsuite/gas/mmix/hex.l @@ -0,0 +1,13 @@ +GAS for MMIX .*/hex\.s page 1 + + + 1 0000 E3362009 Main SETL \$54,#2009 + 2 0004 E320125E SETL \$32,42\+#1234 + 3 0008 E31F00B1 SETL \$31,#72\+63 +GAS for MMIX .*/hex\.s page 2 + + +DEFINED SYMBOLS +.*/hex\.s:1 \.text:0000000000000000 Main + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/hex.s b/gas/testsuite/gas/mmix/hex.s new file mode 100644 index 0000000..f7bff18 --- /dev/null +++ b/gas/testsuite/gas/mmix/hex.s @@ -0,0 +1,3 @@ +Main SETL $54,#2009 + SETL $32,42+#1234 + SETL $31,#72+63 diff --git a/gas/testsuite/gas/mmix/is-1.d b/gas/testsuite/gas/mmix/is-1.d new file mode 100644 index 0000000..1b6f32e --- /dev/null +++ b/gas/testsuite/gas/mmix/is-1.d @@ -0,0 +1,12 @@ +#objdump: -str + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ + +Contents of section \.text: + 0+ 00000026 0000001f 0000000d 0000001e .* +Contents of section \.data: diff --git a/gas/testsuite/gas/mmix/is-1.s b/gas/testsuite/gas/mmix/is-1.s new file mode 100644 index 0000000..2d331fe --- /dev/null +++ b/gas/testsuite/gas/mmix/is-1.s @@ -0,0 +1,7 @@ +# IS must handle a here-label. +9H IS 30 +7H IS 8F+7 +6H IS 2F + TETRA 7B,8F,6B,9B +8H IS 9B+1 +2H IS 13 diff --git a/gas/testsuite/gas/mmix/jmp-op-n.d b/gas/testsuite/gas/mmix/jmp-op-n.d new file mode 100644 index 0000000..4f2bca1 --- /dev/null +++ b/gas/testsuite/gas/mmix/jmp-op-n.d @@ -0,0 +1,23 @@ +# objdump: -dr +# source: jmp-op.s +# as: -no-expand +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd000000 swym 0,0,0 + +0000000000000004 <here>: + 4: fd000000 swym 0,0,0 + 8: f1ffffff jmp 4 <here> + +000000000000000c <at>: + c: f0000000 jmp c <at> + 10: f0000004 jmp 20 <there> + 14: f1fffffc jmp 4 <here> + 18: f0000002 jmp 20 <there> + 1c: f1fffffa jmp 4 <here> + +0000000000000020 <there>: + 20: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/jmp-op-r.d b/gas/testsuite/gas/mmix/jmp-op-r.d new file mode 100644 index 0000000..aa870dc --- /dev/null +++ b/gas/testsuite/gas/mmix/jmp-op-r.d @@ -0,0 +1,29 @@ +# objdump: -dr +# as: -linkrelax +# source: jmp-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd000000 swym 0,0,0 + +0000000000000004 <here>: + 4: fd000000 swym 0,0,0 + 8: f1ffffff jmp 4 <here> + 8: R_MMIX_ADDR27 \.text\+0x4 + +000000000000000c <at>: + c: f0000000 jmp c <at> + c: R_MMIX_ADDR27 \.text\+0xc + 10: f0000004 jmp 20 <there> + 10: R_MMIX_ADDR27 \.text\+0x20 + 14: f1fffffc jmp 4 <here> + 14: R_MMIX_ADDR27 \.text\+0x4 + 18: f0000002 jmp 20 <there> + 18: R_MMIX_ADDR27 \.text\+0x20 + 1c: f1fffffa jmp 4 <here> + 1c: R_MMIX_ADDR27 \.text\+0x4 + +0000000000000020 <there>: + 20: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/jmp-op.d b/gas/testsuite/gas/mmix/jmp-op.d new file mode 100644 index 0000000..01aa794 --- /dev/null +++ b/gas/testsuite/gas/mmix/jmp-op.d @@ -0,0 +1,21 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd000000 swym 0,0,0 + +0000000000000004 <here>: + 4: fd000000 swym 0,0,0 + 8: f1ffffff jmp 4 <here> + +000000000000000c <at>: + c: f0000000 jmp c <at> + 10: f0000004 jmp 20 <there> + 14: f1fffffc jmp 4 <here> + 18: f0000002 jmp 20 <there> + 1c: f1fffffa jmp 4 <here> + +0000000000000020 <there>: + 20: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/jmp-op.l b/gas/testsuite/gas/mmix/jmp-op.l new file mode 100644 index 0000000..92e119c --- /dev/null +++ b/gas/testsuite/gas/mmix/jmp-op.l @@ -0,0 +1,23 @@ +GAS for MMIX .*/jmp-op\.s page 1 + + + 1 #.* + 2 0000 FD000000 Main SWYM 0,0,0 + 3 0004 FD000000 here SWYM 0,0,0 + 4 0008 F1FFFFFF JMP here + 5 000c F0000000 at JMP at + 6 0010 F0000004 JMP there + 7 0014 F1FFFFFC JMP here + 8 0018 F0000002 JMP there + 9 001c F1FFFFFA JMP here + 10 0020 FD000000 there SWYM 0,0,0 +GAS for MMIX .*/jmp-op\.s page 2 + + +DEFINED SYMBOLS +.*/jmp-op\.s:2 \.text:0000000000000000 Main +.*/jmp-op\.s:3 \.text:0000000000000004 here +.*/jmp-op\.s:5 \.text:000000000000000c at +.*/jmp-op\.s:10 \.text:0000000000000020 there + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/jmp-op.s b/gas/testsuite/gas/mmix/jmp-op.s new file mode 100644 index 0000000..c27a70f --- /dev/null +++ b/gas/testsuite/gas/mmix/jmp-op.s @@ -0,0 +1,10 @@ +# A small jumble of JMP:s. +Main SWYM 0,0,0 +here SWYM 0,0,0 + JMP here +at JMP at + JMP there + JMP here + JMP there + JMP here +there SWYM 0,0,0 diff --git a/gas/testsuite/gas/mmix/jmp-oprn.d b/gas/testsuite/gas/mmix/jmp-oprn.d new file mode 100644 index 0000000..5d04103 --- /dev/null +++ b/gas/testsuite/gas/mmix/jmp-oprn.d @@ -0,0 +1,29 @@ +# objdump: -dr +# as: -linkrelax -no-expand +# source: jmp-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd000000 swym 0,0,0 + +0000000000000004 <here>: + 4: fd000000 swym 0,0,0 + 8: f0000000 jmp 8 <here\+0x4> + 8: R_MMIX_ADDR27 \.text\+0x4 + +000000000000000c <at>: + c: f0000000 jmp c <at> + c: R_MMIX_ADDR27 \.text\+0xc + 10: f0000000 jmp 10 <at\+0x4> + 10: R_MMIX_ADDR27 \.text\+0x20 + 14: f0000000 jmp 14 <at\+0x8> + 14: R_MMIX_ADDR27 \.text\+0x4 + 18: f0000000 jmp 18 <at\+0xc> + 18: R_MMIX_ADDR27 \.text\+0x20 + 1c: f0000000 jmp 1c <at\+0x10> + 1c: R_MMIX_ADDR27 \.text\+0x4 + +0000000000000020 <there>: + 20: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/jump-c.d b/gas/testsuite/gas/mmix/jump-c.d new file mode 100644 index 0000000..a256687 --- /dev/null +++ b/gas/testsuite/gas/mmix/jump-c.d @@ -0,0 +1,28 @@ +#as: -x +#objdump: -tdr + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d .text 0+ +0+ l d .data 0+ +0+ l d .bss 0+ +ffff0000ffff0000 l \*ABS\* 0+ i1 +ffff0000ffff0000 l \*ABS\* 0+ i2 +0+ g F .text 0+ Main + +Disassembly of section .text: + +0+ <Main>: + 0: f0000000 jmp 0 <Main> + 0: R_MMIX_JMP \*ABS\*\+0xffff0000ffff0000 + 4: fd000000 swym 0,0,0 + 8: fd000000 swym 0,0,0 + c: fd000000 swym 0,0,0 + 10: fd000000 swym 0,0,0 + 14: f0000000 jmp 14 <Main\+0x14> + 14: R_MMIX_JMP i2 + 18: fd000000 swym 0,0,0 + 1c: fd000000 swym 0,0,0 + 20: fd000000 swym 0,0,0 + 24: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/jump-c.s b/gas/testsuite/gas/mmix/jump-c.s new file mode 100644 index 0000000..917e686 --- /dev/null +++ b/gas/testsuite/gas/mmix/jump-c.s @@ -0,0 +1,5 @@ +% JMP with a large constant must not fail +i1 IS #ffff0000ffff0000 +Main JMP i1 + JMP i2 +i2 IS #ffff0000ffff0000 diff --git a/gas/testsuite/gas/mmix/list-in-n.d b/gas/testsuite/gas/mmix/list-in-n.d new file mode 100644 index 0000000..1124b77 --- /dev/null +++ b/gas/testsuite/gas/mmix/list-in-n.d @@ -0,0 +1,281 @@ +# objdump: -dr +# source: list-insns.s +# as: -no-expand +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 00000003 trap 0,0,3 + 4: 00030405 trap 3,4,5 + 8: 010c17f1 fcmp \$12,\$23,\$241 + c: 08700129 flot \$112,ROUND_OFF,\$41 + 10: 0970048d flot \$112,ROUND_NEAR,141 + 14: 08bf00f2 flot \$191,\$242 + 18: 09c3002a flot \$195,42 + 1c: 027acb04 fun \$122,\$203,\$4 + 20: 03661e28 feql \$102,\$30,\$40 + 24: 0a66000e flotu \$102,\$14 + 28: 0a84020e flotu \$132,ROUND_UP,\$14 + 2c: 0a660368 flotu \$102,ROUND_DOWN,\$104 + 30: 0aac048c flotu \$172,ROUND_NEAR,\$140 + 34: 0a010186 flotu \$1,ROUND_OFF,\$134 + 38: 0470df29 fadd \$112,\$223,\$41 + 3c: 05700129 fix \$112,ROUND_OFF,\$41 + 40: 050b008d fix \$11,\$141 + 44: 0c700129 sflot \$112,ROUND_OFF,\$41 + 48: 0d70048d sflot \$112,ROUND_NEAR,141 + 4c: 0670df29 fsub \$112,\$223,\$41 + 50: 0766000e fixu \$102,\$14 + 54: 0784020e fixu \$132,ROUND_UP,\$14 + 58: 0e0b008d sflotu \$11,\$141 + 5c: 0f70008d sflotu \$112,141 + 60: 0f70048d sflotu \$112,ROUND_NEAR,141 + 64: 0e700129 sflotu \$112,ROUND_OFF,\$41 + 68: 10661e28 fmul \$102,\$30,\$40 + 6c: 110cdf01 fcmpe \$12,\$223,\$1 + 70: 197acb2c mul \$122,\$203,44 + 74: 18661e28 mul \$102,\$30,\$40 + 78: 130cdf01 feqle \$12,\$223,\$1 + 7c: 120cdf0b fune \$12,\$223,\$11 + 80: 1b7ad52c mulu \$122,\$213,44 + 84: 1a841e28 mulu \$132,\$30,\$40 + 88: 140cdf0b fdiv \$12,\$223,\$11 + 8c: 1584020e fsqrt \$132,ROUND_UP,\$14 + 90: 150b008d fsqrt \$11,\$141 + 94: 1d7ad52c div \$122,\$213,44 + 98: 1c841e28 div \$132,\$30,\$40 + 9c: 160cdf0b frem \$12,\$223,\$11 + a0: 1784020e fint \$132,ROUND_UP,\$14 + a4: 170b008d fint \$11,\$141 + a8: 1e0cdf01 divu \$12,\$223,\$1 + ac: 1f7acbff divu \$122,\$203,255 + b0: 200cdf01 add \$12,\$223,\$1 + b4: 217acbff add \$122,\$203,255 + b8: 280cdf0b 2addu \$12,\$223,\$11 + bc: 297acb00 2addu \$122,\$203,0 + c0: 237acbff addu \$122,\$203,255 + c4: 220cdf0b addu \$12,\$223,\$11 + c8: 237acbff addu \$122,\$203,255 + cc: 220cdf0b addu \$12,\$223,\$11 + d0: 2b7acbcd 4addu \$122,\$203,205 + d4: 2a0cdf6f 4addu \$12,\$223,\$111 + d8: 240cdf0b sub \$12,\$223,\$11 + dc: 257acbcd sub \$122,\$203,205 + e0: 2c0cdf0b 8addu \$12,\$223,\$11 + e4: 2d7acbcd 8addu \$122,\$203,205 + e8: 2602df0b subu \$2,\$223,\$11 + ec: 270c14cd subu \$12,\$20,205 + f0: 2e02df0b 16addu \$2,\$223,\$11 + f4: 2f0c14cd 16addu \$12,\$20,205 + f8: 3002df0b cmp \$2,\$223,\$11 + fc: 310c14cd cmp \$12,\$20,205 + 100: 3802df0b sl \$2,\$223,\$11 + 104: 390c14cd sl \$12,\$20,205 + 108: 3202df0b cmpu \$2,\$223,\$11 + 10c: 330c14cd cmpu \$12,\$20,205 + 110: 3a02df0b slu \$2,\$223,\$11 + 114: 3b0c14cd slu \$12,\$20,205 + 118: 3402170b neg \$2,23,\$11 + 11c: 350c00cd neg \$12,0,205 + 120: 35c00acd neg \$192,10,205 + 124: 3d0c14cd sr \$12,\$20,205 + 128: 3c02df0b sr \$2,\$223,\$11 + 12c: 3602170b negu \$2,23,\$11 + 130: 370c00cd negu \$12,0,205 + 134: 3f0c14cd sru \$12,\$20,205 + 138: 3e02df0b sru \$2,\$223,\$11 + 13c: 40020001 bn \$2,140 <Main\+0x140> + 140: 4102ffff bn \$2,13c <Main\+0x13c> + 144: 4902ffff bnn \$2,140 <Main\+0x140> + 148: 4902ffff bnn \$2,144 <Main\+0x144> + 14c: 42ff0001 bz \$255,150 <Main\+0x150> + 150: 43ffffff bz \$255,14c <Main\+0x14c> + 154: 4aff0001 bnz \$255,158 <Main\+0x158> + 158: 4bffffff bnz \$255,154 <Main\+0x154> + 15c: 44190001 bp \$25,160 <Main\+0x160> + 160: 4519ffff bp \$25,15c <Main\+0x15c> + 164: 4c190001 bnp \$25,168 <Main\+0x168> + 168: 4d19ffff bnp \$25,164 <Main\+0x164> + 16c: 46190001 bod \$25,170 <Main\+0x170> + 170: 4719ffff bod \$25,16c <Main\+0x16c> + 174: 4e190001 bev \$25,178 <Main\+0x178> + 178: 4f19ffff bev \$25,174 <Main\+0x174> + 17c: 50020001 pbn \$2,180 <Main\+0x180> + 180: 5102ffff pbn \$2,17c <Main\+0x17c> + 184: 58020001 pbnn \$2,188 <Main\+0x188> + 188: 5902ffff pbnn \$2,184 <Main\+0x184> + 18c: 520c0001 pbz \$12,190 <Main\+0x190> + 190: 5316ffff pbz \$22,18c <Main\+0x18c> + 194: 5a200001 pbnz \$32,198 <Main\+0x198> + 198: 5b34ffff pbnz \$52,194 <Main\+0x194> + 19c: 56190001 pbod \$25,1a0 <Main\+0x1a0> + 1a0: 5719ffff pbod \$25,19c <Main\+0x19c> + 1a4: 5e190001 pbev \$25,1a8 <Main\+0x1a8> + 1a8: 5f19ffff pbev \$25,1a4 <Main\+0x1a4> + 1ac: 6002df0b csn \$2,\$223,\$11 + 1b0: 610c14cd csn \$12,\$20,205 + 1b4: 6802df0b csnn \$2,\$223,\$11 + 1b8: 690c14cd csnn \$12,\$20,205 + 1bc: 6202cb0b csz \$2,\$203,\$11 + 1c0: 630cc8cd csz \$12,\$200,205 + 1c4: 6a02cb0b csnz \$2,\$203,\$11 + 1c8: 6b0cc8cd csnz \$12,\$200,205 + 1cc: 6402cb0b csp \$2,\$203,\$11 + 1d0: 650cc8cd csp \$12,\$200,205 + 1d4: 6c02cb0b csnp \$2,\$203,\$11 + 1d8: 6d0cc8cd csnp \$12,\$200,205 + 1dc: 6602cb0b csod \$2,\$203,\$11 + 1e0: 670cc8cd csod \$12,\$200,205 + 1e4: 6e02cb0b csev \$2,\$203,\$11 + 1e8: 6f0cc8cd csev \$12,\$200,205 + 1ec: 7002df0b zsn \$2,\$223,\$11 + 1f0: 710c14cd zsn \$12,\$20,205 + 1f4: 7802df0b zsnn \$2,\$223,\$11 + 1f8: 790c14cd zsnn \$12,\$20,205 + 1fc: 7202cb0b zsz \$2,\$203,\$11 + 200: 730cc8cd zsz \$12,\$200,205 + 204: 7a02cb0b zsnz \$2,\$203,\$11 + 208: 7b0cc8cd zsnz \$12,\$200,205 + 20c: 7402cb0b zsp \$2,\$203,\$11 + 210: 750cc8cd zsp \$12,\$200,205 + 214: 7c02cb0b zsnp \$2,\$203,\$11 + 218: 7d0cc8cd zsnp \$12,\$200,205 + 21c: 7602cb0b zsod \$2,\$203,\$11 + 220: 770cc8cd zsod \$12,\$200,205 + 224: 7e02cb0b zsev \$2,\$203,\$11 + 228: 7f0cc8cd zsev \$12,\$200,205 + 22c: 8002000b ldb \$2,\$0,\$11 + 230: 810c14cd ldb \$12,\$20,205 + 234: 8802000b ldt \$2,\$0,\$11 + 238: 890c14cd ldt \$12,\$20,205 + 23c: 8202000b ldbu \$2,\$0,\$11 + 240: 830c14cd ldbu \$12,\$20,205 + 244: 8a02000b ldtu \$2,\$0,\$11 + 248: 8b0c14cd ldtu \$12,\$20,205 + 24c: 8402000b ldw \$2,\$0,\$11 + 250: 850c14cd ldw \$12,\$20,205 + 254: 8c02000b ldo \$2,\$0,\$11 + 258: 8d0c14cd ldo \$12,\$20,205 + 25c: 8602000b ldwu \$2,\$0,\$11 + 260: 870c14cd ldwu \$12,\$20,205 + 264: 8e02000b ldou \$2,\$0,\$11 + 268: 8f0c14cd ldou \$12,\$20,205 + 26c: 9802000b ldvts \$2,\$0,\$11 + 270: 990c14cd ldvts \$12,\$20,205 + 274: 9202000b ldht \$2,\$0,\$11 + 278: 930c14cd ldht \$12,\$20,205 + 27c: 9b7014cd preld 112,\$20,205 + 280: 9a7014e1 preld 112,\$20,\$225 + 284: 9402000b cswap \$2,\$0,\$11 + 288: 950c14cd cswap \$12,\$20,205 + 28c: 9d7014cd prego 112,\$20,205 + 290: 9c7014e1 prego 112,\$20,\$225 + 294: 9602000b ldunc \$2,\$0,\$11 + 298: 970c14cd ldunc \$12,\$20,205 + 29c: 9e02000b go \$2,\$0,\$11 + 2a0: 9f0c14cd go \$12,\$20,205 + 2a4: a0020a97 stb \$2,\$10,\$151 + 2a8: a10c14cd stb \$12,\$20,205 + 2ac: a8200a97 stt \$32,\$10,\$151 + 2b0: a90c14cd stt \$12,\$20,205 + 2b4: a2020a97 stbu \$2,\$10,\$151 + 2b8: a30c14cd stbu \$12,\$20,205 + 2bc: aa200a97 sttu \$32,\$10,\$151 + 2c0: ab0c14cd sttu \$12,\$20,205 + 2c4: a4020a97 stw \$2,\$10,\$151 + 2c8: a50cdccd stw \$12,\$220,205 + 2cc: ac20aa97 sto \$32,\$170,\$151 + 2d0: adb614f5 sto \$182,\$20,245 + 2d4: a6020a97 stwu \$2,\$10,\$151 + 2d8: a70cdccd stwu \$12,\$220,205 + 2dc: ae20aa97 stou \$32,\$170,\$151 + 2e0: afb614f5 stou \$182,\$20,245 + 2e4: b020aa97 stsf \$32,\$170,\$151 + 2e8: b1b614f5 stsf \$182,\$20,245 + 2ec: b97014cd syncd 112,\$20,205 + 2f0: b87014e1 syncd 112,\$20,\$225 + 2f4: b220aa97 stht \$32,\$170,\$151 + 2f8: b3b614f5 stht \$182,\$20,245 + 2fc: bb7014cd prest 112,\$20,205 + 300: ba7014e1 prest 112,\$20,\$225 + 304: b420aa97 stco 32,\$170,\$151 + 308: b5b614f5 stco 182,\$20,245 + 30c: bd7014cd syncid 112,\$20,205 + 310: bc0014e1 syncid 0,\$20,\$225 + 314: b620aa97 stunc \$32,\$170,\$151 + 318: b7b614f5 stunc \$182,\$20,245 + 31c: be20aa97 pushgo \$32,\$170,\$151 + 320: bfb614f5 pushgo \$182,\$20,245 + 324: c18ec800 set \$142,\$200 + 328: c020aa97 or \$32,\$170,\$151 + 32c: c1b614f5 or \$182,\$20,245 + 330: c820aa97 and \$32,\$170,\$151 + 334: c9b614f5 and \$182,\$20,245 + 338: c220aa97 orn \$32,\$170,\$151 + 33c: c3b614f5 orn \$182,\$20,245 + 340: ca20aa97 andn \$32,\$170,\$151 + 344: cbb614f5 andn \$182,\$20,245 + 348: c420aa97 nor \$32,\$170,\$151 + 34c: c5b614f5 nor \$182,\$20,245 + 350: cc20aa97 nand \$32,\$170,\$151 + 354: cdb614f5 nand \$182,\$20,245 + 358: c620aa97 xor \$32,\$170,\$151 + 35c: c7b614f5 xor \$182,\$20,245 + 360: ce20aa97 nxor \$32,\$170,\$151 + 364: cfb614f5 nxor \$182,\$20,245 + 368: d020aa97 bdif \$32,\$170,\$151 + 36c: d1b614f5 bdif \$182,\$20,245 + 370: d820aa97 mux \$32,\$170,\$151 + 374: d9b614f5 mux \$182,\$20,245 + 378: d220aa97 wdif \$32,\$170,\$151 + 37c: d3b614f5 wdif \$182,\$20,245 + 380: da20aa97 sadd \$32,\$170,\$151 + 384: dbb600f5 sadd \$182,\$0,245 + 388: d420aa97 tdif \$32,\$170,\$151 + 38c: d5b614f5 tdif \$182,\$20,245 + 390: dc20aa97 mor \$32,\$170,\$151 + 394: ddb614f5 mor \$182,\$20,245 + 398: d620aa97 odif \$32,\$170,\$151 + 39c: d7b614f5 odif \$182,\$20,245 + 3a0: de201197 mxor \$32,\$17,\$151 + 3a4: df52b418 mxor \$82,\$180,24 + 3a8: e004ffff seth \$4,0xffff + 3ac: e05e0000 seth \$94,0x0 + 3b0: e00400ff seth \$4,0xff + 3b4: e05e04d2 seth \$94,0x4d2 + 3b8: e15e04d2 setmh \$94,0x4d2 + 3bc: e85e04d2 orh \$94,0x4d2 + 3c0: e95e04d2 ormh \$94,0x4d2 + 3c4: e25e04d2 setml \$94,0x4d2 + 3c8: e35e04d2 setl \$94,0x4d2 + 3cc: ea5e04d2 orml \$94,0x4d2 + 3d0: eb5e04d2 orl \$94,0x4d2 + 3d4: e45e04d2 inch \$94,0x4d2 + 3d8: e55e04d2 incmh \$94,0x4d2 + 3dc: ec5e04d2 andnh \$94,0x4d2 + 3e0: ed5e04d2 andnmh \$94,0x4d2 + 3e4: e65e04d2 incml \$94,0x4d2 + 3e8: e75e04d2 incl \$94,0x4d2 + 3ec: ee5e04d2 andnml \$94,0x4d2 + 3f0: ef5e04d2 andnl \$94,0x4d2 + 3f4: f1ffffff jmp 3f0 <Main\+0x3f0> + 3f8: f0000001 jmp 3fc <Main\+0x3fc> + 3fc: f82afffe pop 42,65534 + 400: f90000ff resume 255 + 404: f9000000 resume 0 + 408: f9000001 resume 1 + 40c: f2190001 pushj \$25,410 <Main\+0x410> + 410: f319ffff pushj \$25,40c <Main\+0x40c> + 414: fa040000 save \$4,0 + 418: fb0000ea unsave 0,\$234 + 41c: f4190001 geta \$25,420 <Main\+0x420> + 420: f519ffff geta \$25,41c <Main\+0x41c> + 424: fc7a1201 sync 8000001 + 428: fd010203 swym 1,2,3 + 42c: fd000000 swym 0,0,0 + 430: f7040022 put rJ,34 + 434: f6040086 put rJ,\$134 + 438: feea0004 get \$234,rJ + 43c: ff000000 trip 0,0,0 + 440: ff050607 trip 5,6,7 diff --git a/gas/testsuite/gas/mmix/list-in-r.d b/gas/testsuite/gas/mmix/list-in-r.d new file mode 100644 index 0000000..7044b15 --- /dev/null +++ b/gas/testsuite/gas/mmix/list-in-r.d @@ -0,0 +1,315 @@ +# objdump: -dr +# as: -linkrelax +# source: list-insns.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 00000003 trap 0,0,3 + 4: 00030405 trap 3,4,5 + 8: 010c17f1 fcmp \$12,\$23,\$241 + c: 08700129 flot \$112,ROUND_OFF,\$41 + 10: 0970048d flot \$112,ROUND_NEAR,141 + 14: 08bf00f2 flot \$191,\$242 + 18: 09c3002a flot \$195,42 + 1c: 027acb04 fun \$122,\$203,\$4 + 20: 03661e28 feql \$102,\$30,\$40 + 24: 0a66000e flotu \$102,\$14 + 28: 0a84020e flotu \$132,ROUND_UP,\$14 + 2c: 0a660368 flotu \$102,ROUND_DOWN,\$104 + 30: 0aac048c flotu \$172,ROUND_NEAR,\$140 + 34: 0a010186 flotu \$1,ROUND_OFF,\$134 + 38: 0470df29 fadd \$112,\$223,\$41 + 3c: 05700129 fix \$112,ROUND_OFF,\$41 + 40: 050b008d fix \$11,\$141 + 44: 0c700129 sflot \$112,ROUND_OFF,\$41 + 48: 0d70048d sflot \$112,ROUND_NEAR,141 + 4c: 0670df29 fsub \$112,\$223,\$41 + 50: 0766000e fixu \$102,\$14 + 54: 0784020e fixu \$132,ROUND_UP,\$14 + 58: 0e0b008d sflotu \$11,\$141 + 5c: 0f70008d sflotu \$112,141 + 60: 0f70048d sflotu \$112,ROUND_NEAR,141 + 64: 0e700129 sflotu \$112,ROUND_OFF,\$41 + 68: 10661e28 fmul \$102,\$30,\$40 + 6c: 110cdf01 fcmpe \$12,\$223,\$1 + 70: 197acb2c mul \$122,\$203,44 + 74: 18661e28 mul \$102,\$30,\$40 + 78: 130cdf01 feqle \$12,\$223,\$1 + 7c: 120cdf0b fune \$12,\$223,\$11 + 80: 1b7ad52c mulu \$122,\$213,44 + 84: 1a841e28 mulu \$132,\$30,\$40 + 88: 140cdf0b fdiv \$12,\$223,\$11 + 8c: 1584020e fsqrt \$132,ROUND_UP,\$14 + 90: 150b008d fsqrt \$11,\$141 + 94: 1d7ad52c div \$122,\$213,44 + 98: 1c841e28 div \$132,\$30,\$40 + 9c: 160cdf0b frem \$12,\$223,\$11 + a0: 1784020e fint \$132,ROUND_UP,\$14 + a4: 170b008d fint \$11,\$141 + a8: 1e0cdf01 divu \$12,\$223,\$1 + ac: 1f7acbff divu \$122,\$203,255 + b0: 200cdf01 add \$12,\$223,\$1 + b4: 217acbff add \$122,\$203,255 + b8: 280cdf0b 2addu \$12,\$223,\$11 + bc: 297acb00 2addu \$122,\$203,0 + c0: 237acbff addu \$122,\$203,255 + c4: 220cdf0b addu \$12,\$223,\$11 + c8: 237acbff addu \$122,\$203,255 + cc: 220cdf0b addu \$12,\$223,\$11 + d0: 2b7acbcd 4addu \$122,\$203,205 + d4: 2a0cdf6f 4addu \$12,\$223,\$111 + d8: 240cdf0b sub \$12,\$223,\$11 + dc: 257acbcd sub \$122,\$203,205 + e0: 2c0cdf0b 8addu \$12,\$223,\$11 + e4: 2d7acbcd 8addu \$122,\$203,205 + e8: 2602df0b subu \$2,\$223,\$11 + ec: 270c14cd subu \$12,\$20,205 + f0: 2e02df0b 16addu \$2,\$223,\$11 + f4: 2f0c14cd 16addu \$12,\$20,205 + f8: 3002df0b cmp \$2,\$223,\$11 + fc: 310c14cd cmp \$12,\$20,205 + 100: 3802df0b sl \$2,\$223,\$11 + 104: 390c14cd sl \$12,\$20,205 + 108: 3202df0b cmpu \$2,\$223,\$11 + 10c: 330c14cd cmpu \$12,\$20,205 + 110: 3a02df0b slu \$2,\$223,\$11 + 114: 3b0c14cd slu \$12,\$20,205 + 118: 3402170b neg \$2,23,\$11 + 11c: 350c00cd neg \$12,0,205 + 120: 35c00acd neg \$192,10,205 + 124: 3d0c14cd sr \$12,\$20,205 + 128: 3c02df0b sr \$2,\$223,\$11 + 12c: 3602170b negu \$2,23,\$11 + 130: 370c00cd negu \$12,0,205 + 134: 3f0c14cd sru \$12,\$20,205 + 138: 3e02df0b sru \$2,\$223,\$11 + 13c: 40020001 bn \$2,140 <Main\+0x140> + 13c: R_MMIX_ADDR19 \.text\+0x140 + 140: 4102ffff bn \$2,13c <Main\+0x13c> + 140: R_MMIX_ADDR19 \.text\+0x13c + 144: 4902ffff bnn \$2,140 <Main\+0x140> + 144: R_MMIX_ADDR19 \.text\+0x140 + 148: 4902ffff bnn \$2,144 <Main\+0x144> + 148: R_MMIX_ADDR19 \.text\+0x144 + 14c: 42ff0001 bz \$255,150 <Main\+0x150> + 14c: R_MMIX_ADDR19 \.text\+0x150 + 150: 43ffffff bz \$255,14c <Main\+0x14c> + 150: R_MMIX_ADDR19 \.text\+0x14c + 154: 4aff0001 bnz \$255,158 <Main\+0x158> + 154: R_MMIX_ADDR19 \.text\+0x158 + 158: 4bffffff bnz \$255,154 <Main\+0x154> + 158: R_MMIX_ADDR19 \.text\+0x154 + 15c: 44190001 bp \$25,160 <Main\+0x160> + 15c: R_MMIX_ADDR19 \.text\+0x160 + 160: 4519ffff bp \$25,15c <Main\+0x15c> + 160: R_MMIX_ADDR19 \.text\+0x15c + 164: 4c190001 bnp \$25,168 <Main\+0x168> + 164: R_MMIX_ADDR19 \.text\+0x168 + 168: 4d19ffff bnp \$25,164 <Main\+0x164> + 168: R_MMIX_ADDR19 \.text\+0x164 + 16c: 46190001 bod \$25,170 <Main\+0x170> + 16c: R_MMIX_ADDR19 \.text\+0x170 + 170: 4719ffff bod \$25,16c <Main\+0x16c> + 170: R_MMIX_ADDR19 \.text\+0x16c + 174: 4e190001 bev \$25,178 <Main\+0x178> + 174: R_MMIX_ADDR19 \.text\+0x178 + 178: 4f19ffff bev \$25,174 <Main\+0x174> + 178: R_MMIX_ADDR19 \.text\+0x174 + 17c: 50020001 pbn \$2,180 <Main\+0x180> + 17c: R_MMIX_ADDR19 \.text\+0x180 + 180: 5102ffff pbn \$2,17c <Main\+0x17c> + 180: R_MMIX_ADDR19 \.text\+0x17c + 184: 58020001 pbnn \$2,188 <Main\+0x188> + 184: R_MMIX_ADDR19 \.text\+0x188 + 188: 5902ffff pbnn \$2,184 <Main\+0x184> + 188: R_MMIX_ADDR19 \.text\+0x184 + 18c: 520c0001 pbz \$12,190 <Main\+0x190> + 18c: R_MMIX_ADDR19 \.text\+0x190 + 190: 5316ffff pbz \$22,18c <Main\+0x18c> + 190: R_MMIX_ADDR19 \.text\+0x18c + 194: 5a200001 pbnz \$32,198 <Main\+0x198> + 194: R_MMIX_ADDR19 \.text\+0x198 + 198: 5b34ffff pbnz \$52,194 <Main\+0x194> + 198: R_MMIX_ADDR19 \.text\+0x194 + 19c: 56190001 pbod \$25,1a0 <Main\+0x1a0> + 19c: R_MMIX_ADDR19 \.text\+0x1a0 + 1a0: 5719ffff pbod \$25,19c <Main\+0x19c> + 1a0: R_MMIX_ADDR19 \.text\+0x19c + 1a4: 5e190001 pbev \$25,1a8 <Main\+0x1a8> + 1a4: R_MMIX_ADDR19 \.text\+0x1a8 + 1a8: 5f19ffff pbev \$25,1a4 <Main\+0x1a4> + 1a8: R_MMIX_ADDR19 \.text\+0x1a4 + 1ac: 6002df0b csn \$2,\$223,\$11 + 1b0: 610c14cd csn \$12,\$20,205 + 1b4: 6802df0b csnn \$2,\$223,\$11 + 1b8: 690c14cd csnn \$12,\$20,205 + 1bc: 6202cb0b csz \$2,\$203,\$11 + 1c0: 630cc8cd csz \$12,\$200,205 + 1c4: 6a02cb0b csnz \$2,\$203,\$11 + 1c8: 6b0cc8cd csnz \$12,\$200,205 + 1cc: 6402cb0b csp \$2,\$203,\$11 + 1d0: 650cc8cd csp \$12,\$200,205 + 1d4: 6c02cb0b csnp \$2,\$203,\$11 + 1d8: 6d0cc8cd csnp \$12,\$200,205 + 1dc: 6602cb0b csod \$2,\$203,\$11 + 1e0: 670cc8cd csod \$12,\$200,205 + 1e4: 6e02cb0b csev \$2,\$203,\$11 + 1e8: 6f0cc8cd csev \$12,\$200,205 + 1ec: 7002df0b zsn \$2,\$223,\$11 + 1f0: 710c14cd zsn \$12,\$20,205 + 1f4: 7802df0b zsnn \$2,\$223,\$11 + 1f8: 790c14cd zsnn \$12,\$20,205 + 1fc: 7202cb0b zsz \$2,\$203,\$11 + 200: 730cc8cd zsz \$12,\$200,205 + 204: 7a02cb0b zsnz \$2,\$203,\$11 + 208: 7b0cc8cd zsnz \$12,\$200,205 + 20c: 7402cb0b zsp \$2,\$203,\$11 + 210: 750cc8cd zsp \$12,\$200,205 + 214: 7c02cb0b zsnp \$2,\$203,\$11 + 218: 7d0cc8cd zsnp \$12,\$200,205 + 21c: 7602cb0b zsod \$2,\$203,\$11 + 220: 770cc8cd zsod \$12,\$200,205 + 224: 7e02cb0b zsev \$2,\$203,\$11 + 228: 7f0cc8cd zsev \$12,\$200,205 + 22c: 8002000b ldb \$2,\$0,\$11 + 230: 810c14cd ldb \$12,\$20,205 + 234: 8802000b ldt \$2,\$0,\$11 + 238: 890c14cd ldt \$12,\$20,205 + 23c: 8202000b ldbu \$2,\$0,\$11 + 240: 830c14cd ldbu \$12,\$20,205 + 244: 8a02000b ldtu \$2,\$0,\$11 + 248: 8b0c14cd ldtu \$12,\$20,205 + 24c: 8402000b ldw \$2,\$0,\$11 + 250: 850c14cd ldw \$12,\$20,205 + 254: 8c02000b ldo \$2,\$0,\$11 + 258: 8d0c14cd ldo \$12,\$20,205 + 25c: 8602000b ldwu \$2,\$0,\$11 + 260: 870c14cd ldwu \$12,\$20,205 + 264: 8e02000b ldou \$2,\$0,\$11 + 268: 8f0c14cd ldou \$12,\$20,205 + 26c: 9802000b ldvts \$2,\$0,\$11 + 270: 990c14cd ldvts \$12,\$20,205 + 274: 9202000b ldht \$2,\$0,\$11 + 278: 930c14cd ldht \$12,\$20,205 + 27c: 9b7014cd preld 112,\$20,205 + 280: 9a7014e1 preld 112,\$20,\$225 + 284: 9402000b cswap \$2,\$0,\$11 + 288: 950c14cd cswap \$12,\$20,205 + 28c: 9d7014cd prego 112,\$20,205 + 290: 9c7014e1 prego 112,\$20,\$225 + 294: 9602000b ldunc \$2,\$0,\$11 + 298: 970c14cd ldunc \$12,\$20,205 + 29c: 9e02000b go \$2,\$0,\$11 + 2a0: 9f0c14cd go \$12,\$20,205 + 2a4: a0020a97 stb \$2,\$10,\$151 + 2a8: a10c14cd stb \$12,\$20,205 + 2ac: a8200a97 stt \$32,\$10,\$151 + 2b0: a90c14cd stt \$12,\$20,205 + 2b4: a2020a97 stbu \$2,\$10,\$151 + 2b8: a30c14cd stbu \$12,\$20,205 + 2bc: aa200a97 sttu \$32,\$10,\$151 + 2c0: ab0c14cd sttu \$12,\$20,205 + 2c4: a4020a97 stw \$2,\$10,\$151 + 2c8: a50cdccd stw \$12,\$220,205 + 2cc: ac20aa97 sto \$32,\$170,\$151 + 2d0: adb614f5 sto \$182,\$20,245 + 2d4: a6020a97 stwu \$2,\$10,\$151 + 2d8: a70cdccd stwu \$12,\$220,205 + 2dc: ae20aa97 stou \$32,\$170,\$151 + 2e0: afb614f5 stou \$182,\$20,245 + 2e4: b020aa97 stsf \$32,\$170,\$151 + 2e8: b1b614f5 stsf \$182,\$20,245 + 2ec: b97014cd syncd 112,\$20,205 + 2f0: b87014e1 syncd 112,\$20,\$225 + 2f4: b220aa97 stht \$32,\$170,\$151 + 2f8: b3b614f5 stht \$182,\$20,245 + 2fc: bb7014cd prest 112,\$20,205 + 300: ba7014e1 prest 112,\$20,\$225 + 304: b420aa97 stco 32,\$170,\$151 + 308: b5b614f5 stco 182,\$20,245 + 30c: bd7014cd syncid 112,\$20,205 + 310: bc0014e1 syncid 0,\$20,\$225 + 314: b620aa97 stunc \$32,\$170,\$151 + 318: b7b614f5 stunc \$182,\$20,245 + 31c: be20aa97 pushgo \$32,\$170,\$151 + 320: bfb614f5 pushgo \$182,\$20,245 + 324: c18ec800 set \$142,\$200 + 328: c020aa97 or \$32,\$170,\$151 + 32c: c1b614f5 or \$182,\$20,245 + 330: c820aa97 and \$32,\$170,\$151 + 334: c9b614f5 and \$182,\$20,245 + 338: c220aa97 orn \$32,\$170,\$151 + 33c: c3b614f5 orn \$182,\$20,245 + 340: ca20aa97 andn \$32,\$170,\$151 + 344: cbb614f5 andn \$182,\$20,245 + 348: c420aa97 nor \$32,\$170,\$151 + 34c: c5b614f5 nor \$182,\$20,245 + 350: cc20aa97 nand \$32,\$170,\$151 + 354: cdb614f5 nand \$182,\$20,245 + 358: c620aa97 xor \$32,\$170,\$151 + 35c: c7b614f5 xor \$182,\$20,245 + 360: ce20aa97 nxor \$32,\$170,\$151 + 364: cfb614f5 nxor \$182,\$20,245 + 368: d020aa97 bdif \$32,\$170,\$151 + 36c: d1b614f5 bdif \$182,\$20,245 + 370: d820aa97 mux \$32,\$170,\$151 + 374: d9b614f5 mux \$182,\$20,245 + 378: d220aa97 wdif \$32,\$170,\$151 + 37c: d3b614f5 wdif \$182,\$20,245 + 380: da20aa97 sadd \$32,\$170,\$151 + 384: dbb600f5 sadd \$182,\$0,245 + 388: d420aa97 tdif \$32,\$170,\$151 + 38c: d5b614f5 tdif \$182,\$20,245 + 390: dc20aa97 mor \$32,\$170,\$151 + 394: ddb614f5 mor \$182,\$20,245 + 398: d620aa97 odif \$32,\$170,\$151 + 39c: d7b614f5 odif \$182,\$20,245 + 3a0: de201197 mxor \$32,\$17,\$151 + 3a4: df52b418 mxor \$82,\$180,24 + 3a8: e004ffff seth \$4,0xffff + 3ac: e05e0000 seth \$94,0x0 + 3b0: e00400ff seth \$4,0xff + 3b4: e05e04d2 seth \$94,0x4d2 + 3b8: e15e04d2 setmh \$94,0x4d2 + 3bc: e85e04d2 orh \$94,0x4d2 + 3c0: e95e04d2 ormh \$94,0x4d2 + 3c4: e25e04d2 setml \$94,0x4d2 + 3c8: e35e04d2 setl \$94,0x4d2 + 3cc: ea5e04d2 orml \$94,0x4d2 + 3d0: eb5e04d2 orl \$94,0x4d2 + 3d4: e45e04d2 inch \$94,0x4d2 + 3d8: e55e04d2 incmh \$94,0x4d2 + 3dc: ec5e04d2 andnh \$94,0x4d2 + 3e0: ed5e04d2 andnmh \$94,0x4d2 + 3e4: e65e04d2 incml \$94,0x4d2 + 3e8: e75e04d2 incl \$94,0x4d2 + 3ec: ee5e04d2 andnml \$94,0x4d2 + 3f0: ef5e04d2 andnl \$94,0x4d2 + 3f4: f1ffffff jmp 3f0 <Main\+0x3f0> + 3f4: R_MMIX_ADDR27 \.text\+0x3f0 + 3f8: f0000001 jmp 3fc <Main\+0x3fc> + 3f8: R_MMIX_ADDR27 \.text\+0x3fc + 3fc: f82afffe pop 42,65534 + 400: f90000ff resume 255 + 404: f9000000 resume 0 + 408: f9000001 resume 1 + 40c: f2190001 pushj \$25,410 <Main\+0x410> + 40c: R_MMIX_ADDR19 \.text\+0x410 + 410: f319ffff pushj \$25,40c <Main\+0x40c> + 410: R_MMIX_ADDR19 \.text\+0x40c + 414: fa040000 save \$4,0 + 418: fb0000ea unsave 0,\$234 + 41c: f4190001 geta \$25,420 <Main\+0x420> + 41c: R_MMIX_ADDR19 \.text\+0x420 + 420: f519ffff geta \$25,41c <Main\+0x41c> + 420: R_MMIX_ADDR19 \.text\+0x41c + 424: fc7a1201 sync 8000001 + 428: fd010203 swym 1,2,3 + 42c: fd000000 swym 0,0,0 + 430: f7040022 put rJ,34 + 434: f6040086 put rJ,\$134 + 438: feea0004 get \$234,rJ + 43c: ff000000 trip 0,0,0 + 440: ff050607 trip 5,6,7 diff --git a/gas/testsuite/gas/mmix/list-in-rn.d b/gas/testsuite/gas/mmix/list-in-rn.d new file mode 100644 index 0000000..a19d370 --- /dev/null +++ b/gas/testsuite/gas/mmix/list-in-rn.d @@ -0,0 +1,315 @@ +# objdump: -dr +# as: -no-expand -linkrelax +# source: list-insns.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 00000003 trap 0,0,3 + 4: 00030405 trap 3,4,5 + 8: 010c17f1 fcmp \$12,\$23,\$241 + c: 08700129 flot \$112,ROUND_OFF,\$41 + 10: 0970048d flot \$112,ROUND_NEAR,141 + 14: 08bf00f2 flot \$191,\$242 + 18: 09c3002a flot \$195,42 + 1c: 027acb04 fun \$122,\$203,\$4 + 20: 03661e28 feql \$102,\$30,\$40 + 24: 0a66000e flotu \$102,\$14 + 28: 0a84020e flotu \$132,ROUND_UP,\$14 + 2c: 0a660368 flotu \$102,ROUND_DOWN,\$104 + 30: 0aac048c flotu \$172,ROUND_NEAR,\$140 + 34: 0a010186 flotu \$1,ROUND_OFF,\$134 + 38: 0470df29 fadd \$112,\$223,\$41 + 3c: 05700129 fix \$112,ROUND_OFF,\$41 + 40: 050b008d fix \$11,\$141 + 44: 0c700129 sflot \$112,ROUND_OFF,\$41 + 48: 0d70048d sflot \$112,ROUND_NEAR,141 + 4c: 0670df29 fsub \$112,\$223,\$41 + 50: 0766000e fixu \$102,\$14 + 54: 0784020e fixu \$132,ROUND_UP,\$14 + 58: 0e0b008d sflotu \$11,\$141 + 5c: 0f70008d sflotu \$112,141 + 60: 0f70048d sflotu \$112,ROUND_NEAR,141 + 64: 0e700129 sflotu \$112,ROUND_OFF,\$41 + 68: 10661e28 fmul \$102,\$30,\$40 + 6c: 110cdf01 fcmpe \$12,\$223,\$1 + 70: 197acb2c mul \$122,\$203,44 + 74: 18661e28 mul \$102,\$30,\$40 + 78: 130cdf01 feqle \$12,\$223,\$1 + 7c: 120cdf0b fune \$12,\$223,\$11 + 80: 1b7ad52c mulu \$122,\$213,44 + 84: 1a841e28 mulu \$132,\$30,\$40 + 88: 140cdf0b fdiv \$12,\$223,\$11 + 8c: 1584020e fsqrt \$132,ROUND_UP,\$14 + 90: 150b008d fsqrt \$11,\$141 + 94: 1d7ad52c div \$122,\$213,44 + 98: 1c841e28 div \$132,\$30,\$40 + 9c: 160cdf0b frem \$12,\$223,\$11 + a0: 1784020e fint \$132,ROUND_UP,\$14 + a4: 170b008d fint \$11,\$141 + a8: 1e0cdf01 divu \$12,\$223,\$1 + ac: 1f7acbff divu \$122,\$203,255 + b0: 200cdf01 add \$12,\$223,\$1 + b4: 217acbff add \$122,\$203,255 + b8: 280cdf0b 2addu \$12,\$223,\$11 + bc: 297acb00 2addu \$122,\$203,0 + c0: 237acbff addu \$122,\$203,255 + c4: 220cdf0b addu \$12,\$223,\$11 + c8: 237acbff addu \$122,\$203,255 + cc: 220cdf0b addu \$12,\$223,\$11 + d0: 2b7acbcd 4addu \$122,\$203,205 + d4: 2a0cdf6f 4addu \$12,\$223,\$111 + d8: 240cdf0b sub \$12,\$223,\$11 + dc: 257acbcd sub \$122,\$203,205 + e0: 2c0cdf0b 8addu \$12,\$223,\$11 + e4: 2d7acbcd 8addu \$122,\$203,205 + e8: 2602df0b subu \$2,\$223,\$11 + ec: 270c14cd subu \$12,\$20,205 + f0: 2e02df0b 16addu \$2,\$223,\$11 + f4: 2f0c14cd 16addu \$12,\$20,205 + f8: 3002df0b cmp \$2,\$223,\$11 + fc: 310c14cd cmp \$12,\$20,205 + 100: 3802df0b sl \$2,\$223,\$11 + 104: 390c14cd sl \$12,\$20,205 + 108: 3202df0b cmpu \$2,\$223,\$11 + 10c: 330c14cd cmpu \$12,\$20,205 + 110: 3a02df0b slu \$2,\$223,\$11 + 114: 3b0c14cd slu \$12,\$20,205 + 118: 3402170b neg \$2,23,\$11 + 11c: 350c00cd neg \$12,0,205 + 120: 35c00acd neg \$192,10,205 + 124: 3d0c14cd sr \$12,\$20,205 + 128: 3c02df0b sr \$2,\$223,\$11 + 12c: 3602170b negu \$2,23,\$11 + 130: 370c00cd negu \$12,0,205 + 134: 3f0c14cd sru \$12,\$20,205 + 138: 3e02df0b sru \$2,\$223,\$11 + 13c: 40020000 bn \$2,.* + 13c: R_MMIX_ADDR19 \.text\+0x140 + 140: 40020000 bn \$2,.* + 140: R_MMIX_ADDR19 \.text\+0x13c + 144: 48020000 bnn \$2,.* + 144: R_MMIX_ADDR19 \.text\+0x140 + 148: 48020000 bnn \$2,.* + 148: R_MMIX_ADDR19 \.text\+0x144 + 14c: 42ff0000 bz \$255,.* + 14c: R_MMIX_ADDR19 \.text\+0x150 + 150: 42ff0000 bz \$255,.* + 150: R_MMIX_ADDR19 \.text\+0x14c + 154: 4aff0000 bnz \$255,.* + 154: R_MMIX_ADDR19 \.text\+0x158 + 158: 4aff0000 bnz \$255,.* + 158: R_MMIX_ADDR19 \.text\+0x154 + 15c: 44190000 bp \$25,.* + 15c: R_MMIX_ADDR19 \.text\+0x160 + 160: 44190000 bp \$25,.* + 160: R_MMIX_ADDR19 \.text\+0x15c + 164: 4c190000 bnp \$25,.* + 164: R_MMIX_ADDR19 \.text\+0x168 + 168: 4c190000 bnp \$25,.* + 168: R_MMIX_ADDR19 \.text\+0x164 + 16c: 46190000 bod \$25,.* + 16c: R_MMIX_ADDR19 \.text\+0x170 + 170: 46190000 bod \$25,.* + 170: R_MMIX_ADDR19 \.text\+0x16c + 174: 4e190000 bev \$25,.* + 174: R_MMIX_ADDR19 \.text\+0x178 + 178: 4e190000 bev \$25,.* + 178: R_MMIX_ADDR19 \.text\+0x174 + 17c: 50020000 pbn \$2,.* + 17c: R_MMIX_ADDR19 \.text\+0x180 + 180: 50020000 pbn \$2,.* + 180: R_MMIX_ADDR19 \.text\+0x17c + 184: 58020000 pbnn \$2,.* + 184: R_MMIX_ADDR19 \.text\+0x188 + 188: 58020000 pbnn \$2,.* + 188: R_MMIX_ADDR19 \.text\+0x184 + 18c: 520c0000 pbz \$12,.* + 18c: R_MMIX_ADDR19 \.text\+0x190 + 190: 52160000 pbz \$22,.* + 190: R_MMIX_ADDR19 \.text\+0x18c + 194: 5a200000 pbnz \$32,.* + 194: R_MMIX_ADDR19 \.text\+0x198 + 198: 5a340000 pbnz \$52,.* + 198: R_MMIX_ADDR19 \.text\+0x194 + 19c: 56190000 pbod \$25,.* + 19c: R_MMIX_ADDR19 \.text\+0x1a0 + 1a0: 56190000 pbod \$25,.* + 1a0: R_MMIX_ADDR19 \.text\+0x19c + 1a4: 5e190000 pbev \$25,.* + 1a4: R_MMIX_ADDR19 \.text\+0x1a8 + 1a8: 5e190000 pbev \$25,.* + 1a8: R_MMIX_ADDR19 \.text\+0x1a4 + 1ac: 6002df0b csn \$2,\$223,\$11 + 1b0: 610c14cd csn \$12,\$20,205 + 1b4: 6802df0b csnn \$2,\$223,\$11 + 1b8: 690c14cd csnn \$12,\$20,205 + 1bc: 6202cb0b csz \$2,\$203,\$11 + 1c0: 630cc8cd csz \$12,\$200,205 + 1c4: 6a02cb0b csnz \$2,\$203,\$11 + 1c8: 6b0cc8cd csnz \$12,\$200,205 + 1cc: 6402cb0b csp \$2,\$203,\$11 + 1d0: 650cc8cd csp \$12,\$200,205 + 1d4: 6c02cb0b csnp \$2,\$203,\$11 + 1d8: 6d0cc8cd csnp \$12,\$200,205 + 1dc: 6602cb0b csod \$2,\$203,\$11 + 1e0: 670cc8cd csod \$12,\$200,205 + 1e4: 6e02cb0b csev \$2,\$203,\$11 + 1e8: 6f0cc8cd csev \$12,\$200,205 + 1ec: 7002df0b zsn \$2,\$223,\$11 + 1f0: 710c14cd zsn \$12,\$20,205 + 1f4: 7802df0b zsnn \$2,\$223,\$11 + 1f8: 790c14cd zsnn \$12,\$20,205 + 1fc: 7202cb0b zsz \$2,\$203,\$11 + 200: 730cc8cd zsz \$12,\$200,205 + 204: 7a02cb0b zsnz \$2,\$203,\$11 + 208: 7b0cc8cd zsnz \$12,\$200,205 + 20c: 7402cb0b zsp \$2,\$203,\$11 + 210: 750cc8cd zsp \$12,\$200,205 + 214: 7c02cb0b zsnp \$2,\$203,\$11 + 218: 7d0cc8cd zsnp \$12,\$200,205 + 21c: 7602cb0b zsod \$2,\$203,\$11 + 220: 770cc8cd zsod \$12,\$200,205 + 224: 7e02cb0b zsev \$2,\$203,\$11 + 228: 7f0cc8cd zsev \$12,\$200,205 + 22c: 8002000b ldb \$2,\$0,\$11 + 230: 810c14cd ldb \$12,\$20,205 + 234: 8802000b ldt \$2,\$0,\$11 + 238: 890c14cd ldt \$12,\$20,205 + 23c: 8202000b ldbu \$2,\$0,\$11 + 240: 830c14cd ldbu \$12,\$20,205 + 244: 8a02000b ldtu \$2,\$0,\$11 + 248: 8b0c14cd ldtu \$12,\$20,205 + 24c: 8402000b ldw \$2,\$0,\$11 + 250: 850c14cd ldw \$12,\$20,205 + 254: 8c02000b ldo \$2,\$0,\$11 + 258: 8d0c14cd ldo \$12,\$20,205 + 25c: 8602000b ldwu \$2,\$0,\$11 + 260: 870c14cd ldwu \$12,\$20,205 + 264: 8e02000b ldou \$2,\$0,\$11 + 268: 8f0c14cd ldou \$12,\$20,205 + 26c: 9802000b ldvts \$2,\$0,\$11 + 270: 990c14cd ldvts \$12,\$20,205 + 274: 9202000b ldht \$2,\$0,\$11 + 278: 930c14cd ldht \$12,\$20,205 + 27c: 9b7014cd preld 112,\$20,205 + 280: 9a7014e1 preld 112,\$20,\$225 + 284: 9402000b cswap \$2,\$0,\$11 + 288: 950c14cd cswap \$12,\$20,205 + 28c: 9d7014cd prego 112,\$20,205 + 290: 9c7014e1 prego 112,\$20,\$225 + 294: 9602000b ldunc \$2,\$0,\$11 + 298: 970c14cd ldunc \$12,\$20,205 + 29c: 9e02000b go \$2,\$0,\$11 + 2a0: 9f0c14cd go \$12,\$20,205 + 2a4: a0020a97 stb \$2,\$10,\$151 + 2a8: a10c14cd stb \$12,\$20,205 + 2ac: a8200a97 stt \$32,\$10,\$151 + 2b0: a90c14cd stt \$12,\$20,205 + 2b4: a2020a97 stbu \$2,\$10,\$151 + 2b8: a30c14cd stbu \$12,\$20,205 + 2bc: aa200a97 sttu \$32,\$10,\$151 + 2c0: ab0c14cd sttu \$12,\$20,205 + 2c4: a4020a97 stw \$2,\$10,\$151 + 2c8: a50cdccd stw \$12,\$220,205 + 2cc: ac20aa97 sto \$32,\$170,\$151 + 2d0: adb614f5 sto \$182,\$20,245 + 2d4: a6020a97 stwu \$2,\$10,\$151 + 2d8: a70cdccd stwu \$12,\$220,205 + 2dc: ae20aa97 stou \$32,\$170,\$151 + 2e0: afb614f5 stou \$182,\$20,245 + 2e4: b020aa97 stsf \$32,\$170,\$151 + 2e8: b1b614f5 stsf \$182,\$20,245 + 2ec: b97014cd syncd 112,\$20,205 + 2f0: b87014e1 syncd 112,\$20,\$225 + 2f4: b220aa97 stht \$32,\$170,\$151 + 2f8: b3b614f5 stht \$182,\$20,245 + 2fc: bb7014cd prest 112,\$20,205 + 300: ba7014e1 prest 112,\$20,\$225 + 304: b420aa97 stco 32,\$170,\$151 + 308: b5b614f5 stco 182,\$20,245 + 30c: bd7014cd syncid 112,\$20,205 + 310: bc0014e1 syncid 0,\$20,\$225 + 314: b620aa97 stunc \$32,\$170,\$151 + 318: b7b614f5 stunc \$182,\$20,245 + 31c: be20aa97 pushgo \$32,\$170,\$151 + 320: bfb614f5 pushgo \$182,\$20,245 + 324: c18ec800 set \$142,\$200 + 328: c020aa97 or \$32,\$170,\$151 + 32c: c1b614f5 or \$182,\$20,245 + 330: c820aa97 and \$32,\$170,\$151 + 334: c9b614f5 and \$182,\$20,245 + 338: c220aa97 orn \$32,\$170,\$151 + 33c: c3b614f5 orn \$182,\$20,245 + 340: ca20aa97 andn \$32,\$170,\$151 + 344: cbb614f5 andn \$182,\$20,245 + 348: c420aa97 nor \$32,\$170,\$151 + 34c: c5b614f5 nor \$182,\$20,245 + 350: cc20aa97 nand \$32,\$170,\$151 + 354: cdb614f5 nand \$182,\$20,245 + 358: c620aa97 xor \$32,\$170,\$151 + 35c: c7b614f5 xor \$182,\$20,245 + 360: ce20aa97 nxor \$32,\$170,\$151 + 364: cfb614f5 nxor \$182,\$20,245 + 368: d020aa97 bdif \$32,\$170,\$151 + 36c: d1b614f5 bdif \$182,\$20,245 + 370: d820aa97 mux \$32,\$170,\$151 + 374: d9b614f5 mux \$182,\$20,245 + 378: d220aa97 wdif \$32,\$170,\$151 + 37c: d3b614f5 wdif \$182,\$20,245 + 380: da20aa97 sadd \$32,\$170,\$151 + 384: dbb600f5 sadd \$182,\$0,245 + 388: d420aa97 tdif \$32,\$170,\$151 + 38c: d5b614f5 tdif \$182,\$20,245 + 390: dc20aa97 mor \$32,\$170,\$151 + 394: ddb614f5 mor \$182,\$20,245 + 398: d620aa97 odif \$32,\$170,\$151 + 39c: d7b614f5 odif \$182,\$20,245 + 3a0: de201197 mxor \$32,\$17,\$151 + 3a4: df52b418 mxor \$82,\$180,24 + 3a8: e004ffff seth \$4,0xffff + 3ac: e05e0000 seth \$94,0x0 + 3b0: e00400ff seth \$4,0xff + 3b4: e05e04d2 seth \$94,0x4d2 + 3b8: e15e04d2 setmh \$94,0x4d2 + 3bc: e85e04d2 orh \$94,0x4d2 + 3c0: e95e04d2 ormh \$94,0x4d2 + 3c4: e25e04d2 setml \$94,0x4d2 + 3c8: e35e04d2 setl \$94,0x4d2 + 3cc: ea5e04d2 orml \$94,0x4d2 + 3d0: eb5e04d2 orl \$94,0x4d2 + 3d4: e45e04d2 inch \$94,0x4d2 + 3d8: e55e04d2 incmh \$94,0x4d2 + 3dc: ec5e04d2 andnh \$94,0x4d2 + 3e0: ed5e04d2 andnmh \$94,0x4d2 + 3e4: e65e04d2 incml \$94,0x4d2 + 3e8: e75e04d2 incl \$94,0x4d2 + 3ec: ee5e04d2 andnml \$94,0x4d2 + 3f0: ef5e04d2 andnl \$94,0x4d2 + 3f4: f0000000 jmp .* + 3f4: R_MMIX_ADDR27 \.text\+0x3f0 + 3f8: f0000000 jmp .* + 3f8: R_MMIX_ADDR27 \.text\+0x3fc + 3fc: f82afffe pop 42,65534 + 400: f90000ff resume 255 + 404: f9000000 resume 0 + 408: f9000001 resume 1 + 40c: f2190000 pushj \$25,.* + 40c: R_MMIX_ADDR19 \.text\+0x410 + 410: f2190000 pushj \$25,.* + 410: R_MMIX_ADDR19 \.text\+0x40c + 414: fa040000 save \$4,0 + 418: fb0000ea unsave 0,\$234 + 41c: f4190000 geta \$25,.* + 41c: R_MMIX_ADDR19 \.text\+0x420 + 420: f4190000 geta \$25,.* + 420: R_MMIX_ADDR19 \.text\+0x41c + 424: fc7a1201 sync 8000001 + 428: fd010203 swym 1,2,3 + 42c: fd000000 swym 0,0,0 + 430: f7040022 put rJ,34 + 434: f6040086 put rJ,\$134 + 438: feea0004 get \$234,rJ + 43c: ff000000 trip 0,0,0 + 440: ff050607 trip 5,6,7 diff --git a/gas/testsuite/gas/mmix/list-insns.d b/gas/testsuite/gas/mmix/list-insns.d new file mode 100644 index 0000000..ea617925 --- /dev/null +++ b/gas/testsuite/gas/mmix/list-insns.d @@ -0,0 +1,279 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 00000003 trap 0,0,3 + 4: 00030405 trap 3,4,5 + 8: 010c17f1 fcmp \$12,\$23,\$241 + c: 08700129 flot \$112,ROUND_OFF,\$41 + 10: 0970048d flot \$112,ROUND_NEAR,141 + 14: 08bf00f2 flot \$191,\$242 + 18: 09c3002a flot \$195,42 + 1c: 027acb04 fun \$122,\$203,\$4 + 20: 03661e28 feql \$102,\$30,\$40 + 24: 0a66000e flotu \$102,\$14 + 28: 0a84020e flotu \$132,ROUND_UP,\$14 + 2c: 0a660368 flotu \$102,ROUND_DOWN,\$104 + 30: 0aac048c flotu \$172,ROUND_NEAR,\$140 + 34: 0a010186 flotu \$1,ROUND_OFF,\$134 + 38: 0470df29 fadd \$112,\$223,\$41 + 3c: 05700129 fix \$112,ROUND_OFF,\$41 + 40: 050b008d fix \$11,\$141 + 44: 0c700129 sflot \$112,ROUND_OFF,\$41 + 48: 0d70048d sflot \$112,ROUND_NEAR,141 + 4c: 0670df29 fsub \$112,\$223,\$41 + 50: 0766000e fixu \$102,\$14 + 54: 0784020e fixu \$132,ROUND_UP,\$14 + 58: 0e0b008d sflotu \$11,\$141 + 5c: 0f70008d sflotu \$112,141 + 60: 0f70048d sflotu \$112,ROUND_NEAR,141 + 64: 0e700129 sflotu \$112,ROUND_OFF,\$41 + 68: 10661e28 fmul \$102,\$30,\$40 + 6c: 110cdf01 fcmpe \$12,\$223,\$1 + 70: 197acb2c mul \$122,\$203,44 + 74: 18661e28 mul \$102,\$30,\$40 + 78: 130cdf01 feqle \$12,\$223,\$1 + 7c: 120cdf0b fune \$12,\$223,\$11 + 80: 1b7ad52c mulu \$122,\$213,44 + 84: 1a841e28 mulu \$132,\$30,\$40 + 88: 140cdf0b fdiv \$12,\$223,\$11 + 8c: 1584020e fsqrt \$132,ROUND_UP,\$14 + 90: 150b008d fsqrt \$11,\$141 + 94: 1d7ad52c div \$122,\$213,44 + 98: 1c841e28 div \$132,\$30,\$40 + 9c: 160cdf0b frem \$12,\$223,\$11 + a0: 1784020e fint \$132,ROUND_UP,\$14 + a4: 170b008d fint \$11,\$141 + a8: 1e0cdf01 divu \$12,\$223,\$1 + ac: 1f7acbff divu \$122,\$203,255 + b0: 200cdf01 add \$12,\$223,\$1 + b4: 217acbff add \$122,\$203,255 + b8: 280cdf0b 2addu \$12,\$223,\$11 + bc: 297acb00 2addu \$122,\$203,0 + c0: 237acbff addu \$122,\$203,255 + c4: 220cdf0b addu \$12,\$223,\$11 + c8: 237acbff addu \$122,\$203,255 + cc: 220cdf0b addu \$12,\$223,\$11 + d0: 2b7acbcd 4addu \$122,\$203,205 + d4: 2a0cdf6f 4addu \$12,\$223,\$111 + d8: 240cdf0b sub \$12,\$223,\$11 + dc: 257acbcd sub \$122,\$203,205 + e0: 2c0cdf0b 8addu \$12,\$223,\$11 + e4: 2d7acbcd 8addu \$122,\$203,205 + e8: 2602df0b subu \$2,\$223,\$11 + ec: 270c14cd subu \$12,\$20,205 + f0: 2e02df0b 16addu \$2,\$223,\$11 + f4: 2f0c14cd 16addu \$12,\$20,205 + f8: 3002df0b cmp \$2,\$223,\$11 + fc: 310c14cd cmp \$12,\$20,205 + 100: 3802df0b sl \$2,\$223,\$11 + 104: 390c14cd sl \$12,\$20,205 + 108: 3202df0b cmpu \$2,\$223,\$11 + 10c: 330c14cd cmpu \$12,\$20,205 + 110: 3a02df0b slu \$2,\$223,\$11 + 114: 3b0c14cd slu \$12,\$20,205 + 118: 3402170b neg \$2,23,\$11 + 11c: 350c00cd neg \$12,0,205 + 120: 35c00acd neg \$192,10,205 + 124: 3d0c14cd sr \$12,\$20,205 + 128: 3c02df0b sr \$2,\$223,\$11 + 12c: 3602170b negu \$2,23,\$11 + 130: 370c00cd negu \$12,0,205 + 134: 3f0c14cd sru \$12,\$20,205 + 138: 3e02df0b sru \$2,\$223,\$11 + 13c: 40020001 bn \$2,140 <Main\+0x140> + 140: 4102ffff bn \$2,13c <Main\+0x13c> + 144: 4902ffff bnn \$2,140 <Main\+0x140> + 148: 4902ffff bnn \$2,144 <Main\+0x144> + 14c: 42ff0001 bz \$255,150 <Main\+0x150> + 150: 43ffffff bz \$255,14c <Main\+0x14c> + 154: 4aff0001 bnz \$255,158 <Main\+0x158> + 158: 4bffffff bnz \$255,154 <Main\+0x154> + 15c: 44190001 bp \$25,160 <Main\+0x160> + 160: 4519ffff bp \$25,15c <Main\+0x15c> + 164: 4c190001 bnp \$25,168 <Main\+0x168> + 168: 4d19ffff bnp \$25,164 <Main\+0x164> + 16c: 46190001 bod \$25,170 <Main\+0x170> + 170: 4719ffff bod \$25,16c <Main\+0x16c> + 174: 4e190001 bev \$25,178 <Main\+0x178> + 178: 4f19ffff bev \$25,174 <Main\+0x174> + 17c: 50020001 pbn \$2,180 <Main\+0x180> + 180: 5102ffff pbn \$2,17c <Main\+0x17c> + 184: 58020001 pbnn \$2,188 <Main\+0x188> + 188: 5902ffff pbnn \$2,184 <Main\+0x184> + 18c: 520c0001 pbz \$12,190 <Main\+0x190> + 190: 5316ffff pbz \$22,18c <Main\+0x18c> + 194: 5a200001 pbnz \$32,198 <Main\+0x198> + 198: 5b34ffff pbnz \$52,194 <Main\+0x194> + 19c: 56190001 pbod \$25,1a0 <Main\+0x1a0> + 1a0: 5719ffff pbod \$25,19c <Main\+0x19c> + 1a4: 5e190001 pbev \$25,1a8 <Main\+0x1a8> + 1a8: 5f19ffff pbev \$25,1a4 <Main\+0x1a4> + 1ac: 6002df0b csn \$2,\$223,\$11 + 1b0: 610c14cd csn \$12,\$20,205 + 1b4: 6802df0b csnn \$2,\$223,\$11 + 1b8: 690c14cd csnn \$12,\$20,205 + 1bc: 6202cb0b csz \$2,\$203,\$11 + 1c0: 630cc8cd csz \$12,\$200,205 + 1c4: 6a02cb0b csnz \$2,\$203,\$11 + 1c8: 6b0cc8cd csnz \$12,\$200,205 + 1cc: 6402cb0b csp \$2,\$203,\$11 + 1d0: 650cc8cd csp \$12,\$200,205 + 1d4: 6c02cb0b csnp \$2,\$203,\$11 + 1d8: 6d0cc8cd csnp \$12,\$200,205 + 1dc: 6602cb0b csod \$2,\$203,\$11 + 1e0: 670cc8cd csod \$12,\$200,205 + 1e4: 6e02cb0b csev \$2,\$203,\$11 + 1e8: 6f0cc8cd csev \$12,\$200,205 + 1ec: 7002df0b zsn \$2,\$223,\$11 + 1f0: 710c14cd zsn \$12,\$20,205 + 1f4: 7802df0b zsnn \$2,\$223,\$11 + 1f8: 790c14cd zsnn \$12,\$20,205 + 1fc: 7202cb0b zsz \$2,\$203,\$11 + 200: 730cc8cd zsz \$12,\$200,205 + 204: 7a02cb0b zsnz \$2,\$203,\$11 + 208: 7b0cc8cd zsnz \$12,\$200,205 + 20c: 7402cb0b zsp \$2,\$203,\$11 + 210: 750cc8cd zsp \$12,\$200,205 + 214: 7c02cb0b zsnp \$2,\$203,\$11 + 218: 7d0cc8cd zsnp \$12,\$200,205 + 21c: 7602cb0b zsod \$2,\$203,\$11 + 220: 770cc8cd zsod \$12,\$200,205 + 224: 7e02cb0b zsev \$2,\$203,\$11 + 228: 7f0cc8cd zsev \$12,\$200,205 + 22c: 8002000b ldb \$2,\$0,\$11 + 230: 810c14cd ldb \$12,\$20,205 + 234: 8802000b ldt \$2,\$0,\$11 + 238: 890c14cd ldt \$12,\$20,205 + 23c: 8202000b ldbu \$2,\$0,\$11 + 240: 830c14cd ldbu \$12,\$20,205 + 244: 8a02000b ldtu \$2,\$0,\$11 + 248: 8b0c14cd ldtu \$12,\$20,205 + 24c: 8402000b ldw \$2,\$0,\$11 + 250: 850c14cd ldw \$12,\$20,205 + 254: 8c02000b ldo \$2,\$0,\$11 + 258: 8d0c14cd ldo \$12,\$20,205 + 25c: 8602000b ldwu \$2,\$0,\$11 + 260: 870c14cd ldwu \$12,\$20,205 + 264: 8e02000b ldou \$2,\$0,\$11 + 268: 8f0c14cd ldou \$12,\$20,205 + 26c: 9802000b ldvts \$2,\$0,\$11 + 270: 990c14cd ldvts \$12,\$20,205 + 274: 9202000b ldht \$2,\$0,\$11 + 278: 930c14cd ldht \$12,\$20,205 + 27c: 9b7014cd preld 112,\$20,205 + 280: 9a7014e1 preld 112,\$20,\$225 + 284: 9402000b cswap \$2,\$0,\$11 + 288: 950c14cd cswap \$12,\$20,205 + 28c: 9d7014cd prego 112,\$20,205 + 290: 9c7014e1 prego 112,\$20,\$225 + 294: 9602000b ldunc \$2,\$0,\$11 + 298: 970c14cd ldunc \$12,\$20,205 + 29c: 9e02000b go \$2,\$0,\$11 + 2a0: 9f0c14cd go \$12,\$20,205 + 2a4: a0020a97 stb \$2,\$10,\$151 + 2a8: a10c14cd stb \$12,\$20,205 + 2ac: a8200a97 stt \$32,\$10,\$151 + 2b0: a90c14cd stt \$12,\$20,205 + 2b4: a2020a97 stbu \$2,\$10,\$151 + 2b8: a30c14cd stbu \$12,\$20,205 + 2bc: aa200a97 sttu \$32,\$10,\$151 + 2c0: ab0c14cd sttu \$12,\$20,205 + 2c4: a4020a97 stw \$2,\$10,\$151 + 2c8: a50cdccd stw \$12,\$220,205 + 2cc: ac20aa97 sto \$32,\$170,\$151 + 2d0: adb614f5 sto \$182,\$20,245 + 2d4: a6020a97 stwu \$2,\$10,\$151 + 2d8: a70cdccd stwu \$12,\$220,205 + 2dc: ae20aa97 stou \$32,\$170,\$151 + 2e0: afb614f5 stou \$182,\$20,245 + 2e4: b020aa97 stsf \$32,\$170,\$151 + 2e8: b1b614f5 stsf \$182,\$20,245 + 2ec: b97014cd syncd 112,\$20,205 + 2f0: b87014e1 syncd 112,\$20,\$225 + 2f4: b220aa97 stht \$32,\$170,\$151 + 2f8: b3b614f5 stht \$182,\$20,245 + 2fc: bb7014cd prest 112,\$20,205 + 300: ba7014e1 prest 112,\$20,\$225 + 304: b420aa97 stco 32,\$170,\$151 + 308: b5b614f5 stco 182,\$20,245 + 30c: bd7014cd syncid 112,\$20,205 + 310: bc0014e1 syncid 0,\$20,\$225 + 314: b620aa97 stunc \$32,\$170,\$151 + 318: b7b614f5 stunc \$182,\$20,245 + 31c: be20aa97 pushgo \$32,\$170,\$151 + 320: bfb614f5 pushgo \$182,\$20,245 + 324: c18ec800 set \$142,\$200 + 328: c020aa97 or \$32,\$170,\$151 + 32c: c1b614f5 or \$182,\$20,245 + 330: c820aa97 and \$32,\$170,\$151 + 334: c9b614f5 and \$182,\$20,245 + 338: c220aa97 orn \$32,\$170,\$151 + 33c: c3b614f5 orn \$182,\$20,245 + 340: ca20aa97 andn \$32,\$170,\$151 + 344: cbb614f5 andn \$182,\$20,245 + 348: c420aa97 nor \$32,\$170,\$151 + 34c: c5b614f5 nor \$182,\$20,245 + 350: cc20aa97 nand \$32,\$170,\$151 + 354: cdb614f5 nand \$182,\$20,245 + 358: c620aa97 xor \$32,\$170,\$151 + 35c: c7b614f5 xor \$182,\$20,245 + 360: ce20aa97 nxor \$32,\$170,\$151 + 364: cfb614f5 nxor \$182,\$20,245 + 368: d020aa97 bdif \$32,\$170,\$151 + 36c: d1b614f5 bdif \$182,\$20,245 + 370: d820aa97 mux \$32,\$170,\$151 + 374: d9b614f5 mux \$182,\$20,245 + 378: d220aa97 wdif \$32,\$170,\$151 + 37c: d3b614f5 wdif \$182,\$20,245 + 380: da20aa97 sadd \$32,\$170,\$151 + 384: dbb600f5 sadd \$182,\$0,245 + 388: d420aa97 tdif \$32,\$170,\$151 + 38c: d5b614f5 tdif \$182,\$20,245 + 390: dc20aa97 mor \$32,\$170,\$151 + 394: ddb614f5 mor \$182,\$20,245 + 398: d620aa97 odif \$32,\$170,\$151 + 39c: d7b614f5 odif \$182,\$20,245 + 3a0: de201197 mxor \$32,\$17,\$151 + 3a4: df52b418 mxor \$82,\$180,24 + 3a8: e004ffff seth \$4,0xffff + 3ac: e05e0000 seth \$94,0x0 + 3b0: e00400ff seth \$4,0xff + 3b4: e05e04d2 seth \$94,0x4d2 + 3b8: e15e04d2 setmh \$94,0x4d2 + 3bc: e85e04d2 orh \$94,0x4d2 + 3c0: e95e04d2 ormh \$94,0x4d2 + 3c4: e25e04d2 setml \$94,0x4d2 + 3c8: e35e04d2 setl \$94,0x4d2 + 3cc: ea5e04d2 orml \$94,0x4d2 + 3d0: eb5e04d2 orl \$94,0x4d2 + 3d4: e45e04d2 inch \$94,0x4d2 + 3d8: e55e04d2 incmh \$94,0x4d2 + 3dc: ec5e04d2 andnh \$94,0x4d2 + 3e0: ed5e04d2 andnmh \$94,0x4d2 + 3e4: e65e04d2 incml \$94,0x4d2 + 3e8: e75e04d2 incl \$94,0x4d2 + 3ec: ee5e04d2 andnml \$94,0x4d2 + 3f0: ef5e04d2 andnl \$94,0x4d2 + 3f4: f1ffffff jmp 3f0 <Main\+0x3f0> + 3f8: f0000001 jmp 3fc <Main\+0x3fc> + 3fc: f82afffe pop 42,65534 + 400: f90000ff resume 255 + 404: f9000000 resume 0 + 408: f9000001 resume 1 + 40c: f2190001 pushj \$25,410 <Main\+0x410> + 410: f319ffff pushj \$25,40c <Main\+0x40c> + 414: fa040000 save \$4,0 + 418: fb0000ea unsave 0,\$234 + 41c: f4190001 geta \$25,420 <Main\+0x420> + 420: f519ffff geta \$25,41c <Main\+0x41c> + 424: fc7a1201 sync 8000001 + 428: fd010203 swym 1,2,3 + 42c: fd000000 swym 0,0,0 + 430: f7040022 put rJ,34 + 434: f6040086 put rJ,\$134 + 438: feea0004 get \$234,rJ + 43c: ff000000 trip 0,0,0 + 440: ff050607 trip 5,6,7 diff --git a/gas/testsuite/gas/mmix/list-insns.l b/gas/testsuite/gas/mmix/list-insns.l new file mode 100644 index 0000000..858b2c7 --- /dev/null +++ b/gas/testsuite/gas/mmix/list-insns.l @@ -0,0 +1,301 @@ +GAS for MMIX .*/list-insns.s page 1 + + + 1 #.* + 2 #.* + 3 #.* + 4 #.* + 5 #.* + 6 #.* + 7 0000 00000003 Main TETRA 3 + 8 0004 00030405 TRAP 3,4,5 + 9 0008 010C17F1 FCMP \$12,\$23,\$241 + 10 000c 08700129 FLOT \$112,ROUND_OFF,\$41 + 11 0010 0970048D FLOT \$112,ROUND_NEAR,141 + 12 0014 08BF00F2 FLOT \$191,\$242 + 13 0018 09C3002A FLOT \$195,42 + 14 001c 027ACB04 FUN \$122,\$203,\$4 + 15 0020 03661E28 FEQL \$102,\$30,\$40 + 16 0024 0A66000E FLOTU \$102,\$14 + 17 0028 0A84020E FLOTU \$132,ROUND_UP,\$14 + 18 002c 0A660368 FLOTU \$102,ROUND_DOWN,\$104 + 19 0030 0AAC048C FLOTU \$172,ROUND_NEAR,\$140 + 20 0034 0A010186 FLOTU \$1,ROUND_OFF,\$134 + 21 0038 0470DF29 FADD \$112,\$223,\$41 + 22 003c 05700129 FIX \$112,ROUND_OFF,\$41 + 23 0040 050B008D FIX \$11,\$141 + 24 0044 0C700129 SFLOT \$112,ROUND_OFF,\$41 + 25 0048 0D70048D SFLOT \$112,ROUND_NEAR,141 + 26 004c 0670DF29 FSUB \$112,\$223,\$41 + 27 0050 0766000E FIXU \$102,\$14 + 28 0054 0784020E FIXU \$132,ROUND_UP,\$14 + 29 0058 0E0B008D SFLOTU \$11,\$141 + 30 005c 0F70008D SFLOTU \$112,141 + 31 0060 0F70048D SFLOTU \$112,ROUND_NEAR,141 + 32 0064 0E700129 SFLOTU \$112,ROUND_OFF,\$41 + 33 0068 10661E28 FMUL \$102,\$30,\$40 + 34 006c 110CDF01 FCMPE \$12,\$223,\$1 + 35 0070 197ACB2C MUL \$122,\$203,44 + 36 0074 18661E28 MUL \$102,\$30,\$40 + 37 0078 130CDF01 FEQLE \$12,\$223,\$1 + 38 007c 120CDF0B FUNE \$12,\$223,\$11 + 39 0080 1B7AD52C MULU \$122,\$213,44 + 40 0084 1A841E28 MULU \$132,\$30,\$40 + 41 0088 140CDF0B FDIV \$12,\$223,\$11 + 42 008c 1584020E FSQRT \$132,ROUND_UP,\$14 + 43 0090 150B008D FSQRT \$11,\$141 + 44 0094 1D7AD52C DIV \$122,\$213,44 + 45 0098 1C841E28 DIV \$132,\$30,\$40 + 46 009c 160CDF0B FREM \$12,\$223,\$11 + 47 00a0 1784020E FINT \$132,ROUND_UP,\$14 + 48 00a4 170B008D FINT \$11,\$141 + 49 00a8 1E0CDF01 DIVU \$12,\$223,\$1 + 50 00ac 1F7ACBFF DIVU \$122,\$203,255 + 51 00b0 200CDF01 ADD \$12,\$223,\$1 + 52 00b4 217ACBFF ADD \$122,\$203,255 + 53 00b8 280CDF0B 2ADDU \$12,\$223,\$11 + 54 00bc 297ACB00 2ADDU \$122,\$203,0 + 55 00c0 237ACBFF ADDU \$122,\$203,255 + 56 00c4 220CDF0B ADDU \$12,\$223,\$11 + 57 00c8 237ACBFF LDA \$122,\$203,255 +GAS for MMIX .*/list-insns.s page 2 + + + 58 00cc 220CDF0B LDA \$12,\$223,\$11 + 59 00d0 2B7ACBCD 4ADDU \$122,\$203,205 + 60 00d4 2A0CDF6F 4ADDU \$12,\$223,\$111 + 61 00d8 240CDF0B SUB \$12,\$223,\$11 + 62 00dc 257ACBCD SUB \$122,\$203,205 + 63 00e0 2C0CDF0B 8ADDU \$12,\$223,\$11 + 64 00e4 2D7ACBCD 8ADDU \$122,\$203,205 + 65 00e8 2602DF0B SUBU \$2,\$223,\$11 + 66 00ec 270C14CD SUBU \$12,\$20,205 + 67 00f0 2E02DF0B 16ADDU \$2,\$223,\$11 + 68 00f4 2F0C14CD 16ADDU \$12,\$20,205 + 69 00f8 3002DF0B CMP \$2,\$223,\$11 + 70 00fc 310C14CD CMP \$12,\$20,205 + 71 0100 3802DF0B SL \$2,\$223,\$11 + 72 0104 390C14CD SL \$12,\$20,205 + 73 0108 3202DF0B CMPU \$2,\$223,\$11 + 74 010c 330C14CD CMPU \$12,\$20,205 + 75 0110 3A02DF0B SLU \$2,\$223,\$11 + 76 0114 3B0C14CD SLU \$12,\$20,205 + 77 0118 3402170B NEG \$2,23,\$11 + 78 011c 350C00CD NEG \$12,0,205 + 79 0120 35C00ACD NEG \$192,10,205 + 80 0124 3D0C14CD SR \$12,\$20,205 + 81 0128 3C02DF0B SR \$2,\$223,\$11 + 82 012c 3602170B NEGU \$2,23,\$11 + 83 0130 370C00CD NEGU \$12,0,205 + 84 0134 3F0C14CD SRU \$12,\$20,205 + 85 0138 3E02DF0B SRU \$2,\$223,\$11 + 86 013c 40020001 1H BN \$2,2F + 87 0140 4102FFFF 2H BN \$2,1B + 88 0144 4902FFFF 1H BNN \$2,2B + 89 0148 4902FFFF 2H BNN \$2,1B + 90 014c 42FF0001 1H BZ \$255,2F + 91 0150 43FFFFFF 2H BZ \$255,1B + 92 0154 4AFF0001 1H BNZ \$255,2F + 93 0158 4BFFFFFF 2H BNZ \$255,1B + 94 015c 44190001 1H BP \$25,2F + 95 0160 4519FFFF 2H BP \$25,1B + 96 0164 4C190001 1H BNP \$25,2F + 97 0168 4D19FFFF 2H BNP \$25,1B + 98 016c 46190001 1H BOD \$25,2F + 99 0170 4719FFFF 2H BOD \$25,1B + 100 0174 4E190001 1H BEV \$25,2F + 101 0178 4F19FFFF 2H BEV \$25,1B + 102 017c 50020001 1H PBN \$2,2F + 103 0180 5102FFFF 2H PBN \$2,1B + 104 0184 58020001 1H PBNN \$2,2F + 105 0188 5902FFFF 2H PBNN \$2,1B + 106 018c 520C0001 1H PBZ \$12,2F + 107 0190 5316FFFF 2H PBZ \$22,1B + 108 0194 5A200001 1H PBNZ \$32,2F + 109 0198 5B34FFFF 2H PBNZ \$52,1B + 110 019c 56190001 1H PBOD \$25,2F + 111 01a0 5719FFFF 2H PBOD \$25,1B + 112 01a4 5E190001 1H PBEV \$25,2F + 113 01a8 5F19FFFF 2H PBEV \$25,1B + 114 01ac 6002DF0B CSN \$2,\$223,\$11 +GAS for MMIX .*/list-insns.s page 3 + + + 115 01b0 610C14CD CSN \$12,\$20,205 + 116 01b4 6802DF0B CSNN \$2,\$223,\$11 + 117 01b8 690C14CD CSNN \$12,\$20,205 + 118 01bc 6202CB0B CSZ \$2,\$203,\$11 + 119 01c0 630CC8CD CSZ \$12,\$200,205 + 120 01c4 6A02CB0B CSNZ \$2,\$203,\$11 + 121 01c8 6B0CC8CD CSNZ \$12,\$200,205 + 122 01cc 6402CB0B CSP \$2,\$203,\$11 + 123 01d0 650CC8CD CSP \$12,\$200,205 + 124 01d4 6C02CB0B CSNP \$2,\$203,\$11 + 125 01d8 6D0CC8CD CSNP \$12,\$200,205 + 126 01dc 6602CB0B CSOD \$2,\$203,\$11 + 127 01e0 670CC8CD CSOD \$12,\$200,205 + 128 01e4 6E02CB0B CSEV \$2,\$203,\$11 + 129 01e8 6F0CC8CD CSEV \$12,\$200,205 + 130 01ec 7002DF0B ZSN \$2,\$223,\$11 + 131 01f0 710C14CD ZSN \$12,\$20,205 + 132 01f4 7802DF0B ZSNN \$2,\$223,\$11 + 133 01f8 790C14CD ZSNN \$12,\$20,205 + 134 01fc 7202CB0B ZSZ \$2,\$203,\$11 + 135 0200 730CC8CD ZSZ \$12,\$200,205 + 136 0204 7A02CB0B ZSNZ \$2,\$203,\$11 + 137 0208 7B0CC8CD ZSNZ \$12,\$200,205 + 138 020c 7402CB0B ZSP \$2,\$203,\$11 + 139 0210 750CC8CD ZSP \$12,\$200,205 + 140 0214 7C02CB0B ZSNP \$2,\$203,\$11 + 141 0218 7D0CC8CD ZSNP \$12,\$200,205 + 142 021c 7602CB0B ZSOD \$2,\$203,\$11 + 143 0220 770CC8CD ZSOD \$12,\$200,205 + 144 0224 7E02CB0B ZSEV \$2,\$203,\$11 + 145 0228 7F0CC8CD ZSEV \$12,\$200,205 + 146 022c 8002000B LDB \$2,\$0,\$11 + 147 0230 810C14CD LDB \$12,\$20,205 + 148 0234 8802000B LDT \$2,\$0,\$11 + 149 0238 890C14CD LDT \$12,\$20,205 + 150 023c 8202000B LDBU \$2,\$0,\$11 + 151 0240 830C14CD LDBU \$12,\$20,205 + 152 0244 8A02000B LDTU \$2,\$0,\$11 + 153 0248 8B0C14CD LDTU \$12,\$20,205 + 154 024c 8402000B LDW \$2,\$0,\$11 + 155 0250 850C14CD LDW \$12,\$20,205 + 156 0254 8C02000B LDO \$2,\$0,\$11 + 157 0258 8D0C14CD LDO \$12,\$20,205 + 158 025c 8602000B LDWU \$2,\$0,\$11 + 159 0260 870C14CD LDWU \$12,\$20,205 + 160 0264 8E02000B LDOU \$2,\$0,\$11 + 161 0268 8F0C14CD LDOU \$12,\$20,205 + 162 026c 9802000B LDVTS \$2,\$0,\$11 + 163 0270 990C14CD LDVTS \$12,\$20,205 + 164 0274 9202000B LDHT \$2,\$0,\$11 + 165 0278 930C14CD LDHT \$12,\$20,205 + 166 027c 9B7014CD PRELD 112,\$20,205 + 167 0280 9A7014E1 PRELD 112,\$20,\$225 + 168 0284 9402000B CSWAP \$2,\$0,\$11 + 169 0288 950C14CD CSWAP \$12,\$20,205 + 170 028c 9D7014CD PREGO 112,\$20,205 + 171 0290 9C7014E1 PREGO 112,\$20,\$225 +GAS for MMIX .*/list-insns.s page 4 + + + 172 0294 9602000B LDUNC \$2,\$0,\$11 + 173 0298 970C14CD LDUNC \$12,\$20,205 + 174 029c 9E02000B GO \$2,\$0,\$11 + 175 02a0 9F0C14CD GO \$12,\$20,205 + 176 02a4 A0020A97 STB \$2,\$10,\$151 + 177 02a8 A10C14CD STB \$12,\$20,205 + 178 02ac A8200A97 STT \$32,\$10,\$151 + 179 02b0 A90C14CD STT \$12,\$20,205 + 180 02b4 A2020A97 STBU \$2,\$10,\$151 + 181 02b8 A30C14CD STBU \$12,\$20,205 + 182 02bc AA200A97 STTU \$32,\$10,\$151 + 183 02c0 AB0C14CD STTU \$12,\$20,205 + 184 02c4 A4020A97 STW \$2,\$10,\$151 + 185 02c8 A50CDCCD STW \$12,\$220,205 + 186 02cc AC20AA97 STO \$32,\$170,\$151 + 187 02d0 ADB614F5 STO \$182,\$20,245 + 188 02d4 A6020A97 STWU \$2,\$10,\$151 + 189 02d8 A70CDCCD STWU \$12,\$220,205 + 190 02dc AE20AA97 STOU \$32,\$170,\$151 + 191 02e0 AFB614F5 STOU \$182,\$20,245 + 192 02e4 B020AA97 STSF \$32,\$170,\$151 + 193 02e8 B1B614F5 STSF \$182,\$20,245 + 194 02ec B97014CD SYNCD 112,\$20,205 + 195 02f0 B87014E1 SYNCD 112,\$20,\$225 + 196 02f4 B220AA97 STHT \$32,\$170,\$151 + 197 02f8 B3B614F5 STHT \$182,\$20,245 + 198 02fc BB7014CD PREST 112,\$20,205 + 199 0300 BA7014E1 PREST 112,\$20,\$225 + 200 0304 B420AA97 STCO 32,\$170,\$151 + 201 0308 B5B614F5 STCO 182,\$20,245 + 202 030c BD7014CD SYNCID 112,\$20,205 + 203 0310 BC0014E1 SYNCID 0,\$20,\$225 + 204 0314 B620AA97 STUNC \$32,\$170,\$151 + 205 0318 B7B614F5 STUNC \$182,\$20,245 + 206 031c BE20AA97 PUSHGO \$32,\$170,\$151 + 207 0320 BFB614F5 PUSHGO \$182,\$20,245 + 208 0324 C18EC800 SET \$142,\$200 + 209 0328 C020AA97 OR \$32,\$170,\$151 + 210 032c C1B614F5 OR \$182,\$20,245 + 211 0330 C820AA97 AND \$32,\$170,\$151 + 212 0334 C9B614F5 AND \$182,\$20,245 + 213 0338 C220AA97 ORN \$32,\$170,\$151 + 214 033c C3B614F5 ORN \$182,\$20,245 + 215 0340 CA20AA97 ANDN \$32,\$170,\$151 + 216 0344 CBB614F5 ANDN \$182,\$20,245 + 217 0348 C420AA97 NOR \$32,\$170,\$151 + 218 034c C5B614F5 NOR \$182,\$20,245 + 219 0350 CC20AA97 NAND \$32,\$170,\$151 + 220 0354 CDB614F5 NAND \$182,\$20,245 + 221 0358 C620AA97 XOR \$32,\$170,\$151 + 222 035c C7B614F5 XOR \$182,\$20,245 + 223 0360 CE20AA97 NXOR \$32,\$170,\$151 + 224 0364 CFB614F5 NXOR \$182,\$20,245 + 225 0368 D020AA97 BDIF \$32,\$170,\$151 + 226 036c D1B614F5 BDIF \$182,\$20,245 + 227 0370 D820AA97 MUX \$32,\$170,\$151 + 228 0374 D9B614F5 MUX \$182,\$20,245 +GAS for MMIX .*/list-insns.s page 5 + + + 229 0378 D220AA97 WDIF \$32,\$170,\$151 + 230 037c D3B614F5 WDIF \$182,\$20,245 + 231 0380 DA20AA97 SADD \$32,\$170,\$151 + 232 0384 DBB600F5 SADD \$182,\$0,245 + 233 0388 D420AA97 TDIF \$32,\$170,\$151 + 234 038c D5B614F5 TDIF \$182,\$20,245 + 235 0390 DC20AA97 MOR \$32,\$170,\$151 + 236 0394 DDB614F5 MOR \$182,\$20,245 + 237 0398 D620AA97 ODIF \$32,\$170,\$151 + 238 039c D7B614F5 ODIF \$182,\$20,245 + 239 03a0 DE201197 MXOR \$32,\$17,\$151 + 240 03a4 DF52B418 MXOR \$82,\$180,24 + 241 03a8 E004FFFF SETH \$4,65535 + 242 03ac E05E0000 SETH \$94,0 + 243 03b0 E00400FF SETH \$4,255 + 244 03b4 E05E04D2 SETH \$94,1234 + 245 03b8 E15E04D2 SETMH \$94,1234 + 246 03bc E85E04D2 ORH \$94,1234 + 247 03c0 E95E04D2 ORMH \$94,1234 + 248 03c4 E25E04D2 SETML \$94,1234 + 249 03c8 E35E04D2 SETL \$94,1234 + 250 03cc EA5E04D2 ORML \$94,1234 + 251 03d0 EB5E04D2 ORL \$94,1234 + 252 03d4 E45E04D2 INCH \$94,1234 + 253 03d8 E55E04D2 INCMH \$94,1234 + 254 03dc EC5E04D2 ANDNH \$94,1234 + 255 03e0 ED5E04D2 ANDNMH \$94,1234 + 256 03e4 E65E04D2 INCML \$94,1234 + 257 03e8 E75E04D2 INCL \$94,1234 + 258 03ec EE5E04D2 ANDNML \$94,1234 + 259 03f0 EF5E04D2 0H ANDNL \$94,1234 + 260 03f4 F1FFFFFF JMP 0B + 261 03f8 F0000001 JMP 0F + 262 03fc F82AFFFE 0H POP 42,65534 + 263 0400 F90000FF RESUME 255 + 264 0404 F9000000 RESUME 0 + 265 0408 F9000001 RESUME 1 + 266 040c F2190001 1H PUSHJ \$25,2F + 267 0410 F319FFFF 2H PUSHJ \$25,1B + 268 0414 FA040000 SAVE \$4,0 + 269 0418 FB0000EA UNSAVE 0,\$234 + 270 041c F4190001 1H GETA \$25,2F + 271 0420 F519FFFF 2H GETA \$25,1B + 272 0424 FC7A1201 SYNC 8000001 + 273 0428 FD010203 SWYM 1,2,3 + 274 042c FD000000 SWYM 0,0,0 + 275 0430 F7040022 PUT rJ,34 + 276 0434 F6040086 PUT rJ,\$134 + 277 0438 FEEA0004 GET \$234,rJ + 278 043c FF000000 TRIP 0,0,0 + 279 0440 FF050607 TRIP 5,6,7 +GAS for MMIX .*/list-insns.s page 6 + + +DEFINED SYMBOLS +.*/list-insns.s:7 .text:0000000000000000 Main + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/list-insns.s b/gas/testsuite/gas/mmix/list-insns.s new file mode 100644 index 0000000..aed7696 --- /dev/null +++ b/gas/testsuite/gas/mmix/list-insns.s @@ -0,0 +1,279 @@ +# +# Somewhat complete instruction set and operand type check. No +# relocations or deferred register definitions here. +# +# +# +Main TETRA 3 + TRAP 3,4,5 + FCMP $12,$23,$241 + FLOT $112,ROUND_OFF,$41 + FLOT $112,ROUND_NEAR,141 + FLOT $191,$242 + FLOT $195,42 + FUN $122,$203,$4 + FEQL $102,$30,$40 + FLOTU $102,$14 + FLOTU $132,ROUND_UP,$14 + FLOTU $102,ROUND_DOWN,$104 + FLOTU $172,ROUND_NEAR,$140 + FLOTU $1,ROUND_OFF,$134 + FADD $112,$223,$41 + FIX $112,ROUND_OFF,$41 + FIX $11,$141 + SFLOT $112,ROUND_OFF,$41 + SFLOT $112,ROUND_NEAR,141 + FSUB $112,$223,$41 + FIXU $102,$14 + FIXU $132,ROUND_UP,$14 + SFLOTU $11,$141 + SFLOTU $112,141 + SFLOTU $112,ROUND_NEAR,141 + SFLOTU $112,ROUND_OFF,$41 + FMUL $102,$30,$40 + FCMPE $12,$223,$1 + MUL $122,$203,44 + MUL $102,$30,$40 + FEQLE $12,$223,$1 + FUNE $12,$223,$11 + MULU $122,$213,44 + MULU $132,$30,$40 + FDIV $12,$223,$11 + FSQRT $132,ROUND_UP,$14 + FSQRT $11,$141 + DIV $122,$213,44 + DIV $132,$30,$40 + FREM $12,$223,$11 + FINT $132,ROUND_UP,$14 + FINT $11,$141 + DIVU $12,$223,$1 + DIVU $122,$203,255 + ADD $12,$223,$1 + ADD $122,$203,255 + 2ADDU $12,$223,$11 + 2ADDU $122,$203,0 + ADDU $122,$203,255 + ADDU $12,$223,$11 + LDA $122,$203,255 + LDA $12,$223,$11 + 4ADDU $122,$203,205 + 4ADDU $12,$223,$111 + SUB $12,$223,$11 + SUB $122,$203,205 + 8ADDU $12,$223,$11 + 8ADDU $122,$203,205 + SUBU $2,$223,$11 + SUBU $12,$20,205 + 16ADDU $2,$223,$11 + 16ADDU $12,$20,205 + CMP $2,$223,$11 + CMP $12,$20,205 + SL $2,$223,$11 + SL $12,$20,205 + CMPU $2,$223,$11 + CMPU $12,$20,205 + SLU $2,$223,$11 + SLU $12,$20,205 + NEG $2,23,$11 + NEG $12,0,205 + NEG $192,10,205 + SR $12,$20,205 + SR $2,$223,$11 + NEGU $2,23,$11 + NEGU $12,0,205 + SRU $12,$20,205 + SRU $2,$223,$11 +1H BN $2,2F +2H BN $2,1B +1H BNN $2,2B +2H BNN $2,1B +1H BZ $255,2F +2H BZ $255,1B +1H BNZ $255,2F +2H BNZ $255,1B +1H BP $25,2F +2H BP $25,1B +1H BNP $25,2F +2H BNP $25,1B +1H BOD $25,2F +2H BOD $25,1B +1H BEV $25,2F +2H BEV $25,1B +1H PBN $2,2F +2H PBN $2,1B +1H PBNN $2,2F +2H PBNN $2,1B +1H PBZ $12,2F +2H PBZ $22,1B +1H PBNZ $32,2F +2H PBNZ $52,1B +1H PBOD $25,2F +2H PBOD $25,1B +1H PBEV $25,2F +2H PBEV $25,1B + CSN $2,$223,$11 + CSN $12,$20,205 + CSNN $2,$223,$11 + CSNN $12,$20,205 + CSZ $2,$203,$11 + CSZ $12,$200,205 + CSNZ $2,$203,$11 + CSNZ $12,$200,205 + CSP $2,$203,$11 + CSP $12,$200,205 + CSNP $2,$203,$11 + CSNP $12,$200,205 + CSOD $2,$203,$11 + CSOD $12,$200,205 + CSEV $2,$203,$11 + CSEV $12,$200,205 + ZSN $2,$223,$11 + ZSN $12,$20,205 + ZSNN $2,$223,$11 + ZSNN $12,$20,205 + ZSZ $2,$203,$11 + ZSZ $12,$200,205 + ZSNZ $2,$203,$11 + ZSNZ $12,$200,205 + ZSP $2,$203,$11 + ZSP $12,$200,205 + ZSNP $2,$203,$11 + ZSNP $12,$200,205 + ZSOD $2,$203,$11 + ZSOD $12,$200,205 + ZSEV $2,$203,$11 + ZSEV $12,$200,205 + LDB $2,$0,$11 + LDB $12,$20,205 + LDT $2,$0,$11 + LDT $12,$20,205 + LDBU $2,$0,$11 + LDBU $12,$20,205 + LDTU $2,$0,$11 + LDTU $12,$20,205 + LDW $2,$0,$11 + LDW $12,$20,205 + LDO $2,$0,$11 + LDO $12,$20,205 + LDWU $2,$0,$11 + LDWU $12,$20,205 + LDOU $2,$0,$11 + LDOU $12,$20,205 + LDVTS $2,$0,$11 + LDVTS $12,$20,205 + LDHT $2,$0,$11 + LDHT $12,$20,205 + PRELD 112,$20,205 + PRELD 112,$20,$225 + CSWAP $2,$0,$11 + CSWAP $12,$20,205 + PREGO 112,$20,205 + PREGO 112,$20,$225 + LDUNC $2,$0,$11 + LDUNC $12,$20,205 + GO $2,$0,$11 + GO $12,$20,205 + STB $2,$10,$151 + STB $12,$20,205 + STT $32,$10,$151 + STT $12,$20,205 + STBU $2,$10,$151 + STBU $12,$20,205 + STTU $32,$10,$151 + STTU $12,$20,205 + STW $2,$10,$151 + STW $12,$220,205 + STO $32,$170,$151 + STO $182,$20,245 + STWU $2,$10,$151 + STWU $12,$220,205 + STOU $32,$170,$151 + STOU $182,$20,245 + STSF $32,$170,$151 + STSF $182,$20,245 + SYNCD 112,$20,205 + SYNCD 112,$20,$225 + STHT $32,$170,$151 + STHT $182,$20,245 + PREST 112,$20,205 + PREST 112,$20,$225 + STCO 32,$170,$151 + STCO 182,$20,245 + SYNCID 112,$20,205 + SYNCID 0,$20,$225 + STUNC $32,$170,$151 + STUNC $182,$20,245 + PUSHGO $32,$170,$151 + PUSHGO $182,$20,245 + SET $142,$200 + OR $32,$170,$151 + OR $182,$20,245 + AND $32,$170,$151 + AND $182,$20,245 + ORN $32,$170,$151 + ORN $182,$20,245 + ANDN $32,$170,$151 + ANDN $182,$20,245 + NOR $32,$170,$151 + NOR $182,$20,245 + NAND $32,$170,$151 + NAND $182,$20,245 + XOR $32,$170,$151 + XOR $182,$20,245 + NXOR $32,$170,$151 + NXOR $182,$20,245 + BDIF $32,$170,$151 + BDIF $182,$20,245 + MUX $32,$170,$151 + MUX $182,$20,245 + WDIF $32,$170,$151 + WDIF $182,$20,245 + SADD $32,$170,$151 + SADD $182,$0,245 + TDIF $32,$170,$151 + TDIF $182,$20,245 + MOR $32,$170,$151 + MOR $182,$20,245 + ODIF $32,$170,$151 + ODIF $182,$20,245 + MXOR $32,$17,$151 + MXOR $82,$180,24 + SETH $4,65535 + SETH $94,0 + SETH $4,255 + SETH $94,1234 + SETMH $94,1234 + ORH $94,1234 + ORMH $94,1234 + SETML $94,1234 + SETL $94,1234 + ORML $94,1234 + ORL $94,1234 + INCH $94,1234 + INCMH $94,1234 + ANDNH $94,1234 + ANDNMH $94,1234 + INCML $94,1234 + INCL $94,1234 + ANDNML $94,1234 +0H ANDNL $94,1234 + JMP 0B + JMP 0F +0H POP 42,65534 + RESUME 255 + RESUME 0 + RESUME 1 +1H PUSHJ $25,2F +2H PUSHJ $25,1B + SAVE $4,0 + UNSAVE 0,$234 +1H GETA $25,2F +2H GETA $25,1B + SYNC 8000001 + SWYM 1,2,3 + SWYM 0,0,0 + PUT rJ,34 + PUT rJ,$134 + GET $234,rJ + TRIP 0,0,0 + TRIP 5,6,7 diff --git a/gas/testsuite/gas/mmix/list-pseudoints.l b/gas/testsuite/gas/mmix/list-pseudoints.l new file mode 100644 index 0000000..07124cb --- /dev/null +++ b/gas/testsuite/gas/mmix/list-pseudoints.l @@ -0,0 +1,20 @@ +GAS for MMIX .*/list-pseudoints.s page 1 + + + 1 start + 2 0000 424344EE tetra 0x424344ee + 3 start2 + 4 0004 00000000 octa 0xde0045007821329e + 4 DE004500 + 4 7821329E + 5 0010 07D9 wyde 2009 + 6 0012 99000000 byte 0x99 + 6 0000 +GAS for MMIX .*/list-pseudoints.s page 2 + + +DEFINED SYMBOLS +.*/list-pseudoints.s:1 .text:0000000000000000 start +.*/list-pseudoints.s:3 .text:0000000000000004 start2 + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/list-pseudoints.s b/gas/testsuite/gas/mmix/list-pseudoints.s new file mode 100644 index 0000000..b2b72b1 --- /dev/null +++ b/gas/testsuite/gas/mmix/list-pseudoints.s @@ -0,0 +1,6 @@ +start + tetra 0x424344ee +start2 + octa 0xde0045007821329e + wyde 2009 + byte 0x99 diff --git a/gas/testsuite/gas/mmix/list-textfirst b/gas/testsuite/gas/mmix/list-textfirst new file mode 100644 index 0000000..1168e93 --- /dev/null +++ b/gas/testsuite/gas/mmix/list-textfirst @@ -0,0 +1,5 @@ + data +here: + tetra 42 +.text + set $1,$2 diff --git a/gas/testsuite/gas/mmix/list-textfirst.l b/gas/testsuite/gas/mmix/list-textfirst.l new file mode 100644 index 0000000..328aadc --- /dev/null +++ b/gas/testsuite/gas/mmix/list-textfirst.l @@ -0,0 +1,17 @@ +GAS for MMIX .*/list-textfirst\.s page 1 + + + 1 \.data + 2 here: + 3 0000 0000002A tetra 42 + 4 \.text + 5 there: + 6 0000 EA \.byte 0xea +GAS for MMIX .*/list-textfirst\.s page 2 + + +DEFINED SYMBOLS +.*/list-textfirst\.s:2 \.data:0000000000000000 here +.*/list-textfirst\.s:5 \.text:0000000000000000 there + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/list-textfirst.s b/gas/testsuite/gas/mmix/list-textfirst.s new file mode 100644 index 0000000..c1a3784 --- /dev/null +++ b/gas/testsuite/gas/mmix/list-textfirst.s @@ -0,0 +1,6 @@ + .data +here: + tetra 42 +.text +there: + .byte 0xea diff --git a/gas/testsuite/gas/mmix/loc-1.d b/gas/testsuite/gas/mmix/loc-1.d new file mode 100644 index 0000000..2dd8670 --- /dev/null +++ b/gas/testsuite/gas/mmix/loc-1.d @@ -0,0 +1,45 @@ +#readelf: -Ssrx1 -x2 + +There are 7 section headers, starting at offset 0x90: + +Section Headers: + \[Nr\] Name Type Address Offset + Size EntSize Flags Link Info Align + \[ 0\] NULL 0000000000000000 00000000 + 0000000000000000 0000000000000000 0 0 0 + \[ 1\] \.text PROGBITS 0000000000000000 00000040 + 0000000000000020 0000000000000000 AX 0 0 4 + \[ 2\] \.data PROGBITS 0000000000000000 00000060 + 0000000000000004 0000000000000000 WA 0 0 4 + \[ 3\] \.bss NOBITS 0000000000000000 00000064 + 0000000000000000 0000000000000000 WA 0 0 1 + \[ 4\] \.shstrtab STRTAB 0000000000000000 00000064 + 000000000000002c 0000000000000000 0 0 1 + \[ 5\] \.symtab SYMTAB 0000000000000000 00000250 + 00000000000000c0 0000000000000018 6 6 8 + \[ 6\] \.strtab STRTAB 0000000000000000 00000310 + 000000000000002a 0000000000000000 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\) + I \(info\), L \(link order\), G \(group\), x \(unknown\) + O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) + +There are no relocations in this file\. + +Symbol table '\.symtab' contains 8 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 0+ 0 NOTYPE LOCAL DEFAULT UND + 1: 0+ 0 SECTION LOCAL DEFAULT 1 + 2: 0+ 0 SECTION LOCAL DEFAULT 2 + 3: 0+ 0 SECTION LOCAL DEFAULT 3 + 4: 0+4 0 NOTYPE LOCAL DEFAULT 1 m2 + 5: 2000000000000000 0 NOTYPE LOCAL DEFAULT ABS Data_Segment + 6: 0+ 0 FUNC GLOBAL DEFAULT 1 Main + 7: 2000000000000000 0 NOTYPE GLOBAL DEFAULT ABS __\.MMIX\.start\.\.data + +Hex dump of section '\.text': + 0x00000000 fd000000 00000000 00000000 00000000 .* + 0x00000010 00000000 00000000 00000000 fd010203 .* + +Hex dump of section '\.data': + 0x00000000 00000004 .* diff --git a/gas/testsuite/gas/mmix/loc-1.s b/gas/testsuite/gas/mmix/loc-1.s new file mode 100644 index 0000000..09dc220 --- /dev/null +++ b/gas/testsuite/gas/mmix/loc-1.s @@ -0,0 +1,7 @@ +# Check that we don't get anything strange from a single LOC to data and a +# LOC back (with an offset). +Main SWYM 0,0,0 +m2 LOC Data_Segment + TETRA 4 + LOC m2+24 + SWYM 1,2,3 diff --git a/gas/testsuite/gas/mmix/loc-2.d b/gas/testsuite/gas/mmix/loc-2.d new file mode 100644 index 0000000..0f90c05 --- /dev/null +++ b/gas/testsuite/gas/mmix/loc-2.d @@ -0,0 +1,39 @@ +#readelf: -Ssrx1 + +There are 7 section headers, starting at offset 0x78: + +Section Headers: + \[Nr\] Name Type Address Offset + Size EntSize Flags Link Info Align + \[ 0\] NULL 0000000000000000 00000000 + 0000000000000000 0000000000000000 0 0 0 + \[ 1\] \.text PROGBITS 0000000000000000 00000040 + 0000000000000008 0000000000000000 AX 0 0 4 + \[ 2\] \.data PROGBITS 0000000000000000 00000048 + 0000000000000000 0000000000000000 WA 0 0 1 + \[ 3\] \.bss NOBITS 0000000000000000 00000048 + 0000000000000000 0000000000000000 WA 0 0 1 + \[ 4\] \.shstrtab STRTAB 0000000000000000 00000048 + 000000000000002c 0000000000000000 0 0 1 + \[ 5\] \.symtab SYMTAB 0000000000000000 00000238 + 0000000000000090 0000000000000018 6 4 8 + \[ 6\] \.strtab STRTAB 0000000000000000 000002c8 + 000000000000001a 0000000000000000 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\) + I \(info\), L \(link order\), G \(group\), x \(unknown\) + O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) + +There are no relocations in this file\. + +Symbol table '\.symtab' contains 6 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 0+ 0 NOTYPE LOCAL DEFAULT UND + 1: 0+ 0 SECTION LOCAL DEFAULT 1 + 2: 0+ 0 SECTION LOCAL DEFAULT 2 + 3: 0+ 0 SECTION LOCAL DEFAULT 3 + 4: 0+4 0 FUNC GLOBAL DEFAULT 1 Main + 5: 0+100 0 NOTYPE GLOBAL DEFAULT ABS __\.MMIX\.start\.\.text + +Hex dump of section '\.text': + 0x00000000 fd010102 fd000070 .* diff --git a/gas/testsuite/gas/mmix/loc-2.s b/gas/testsuite/gas/mmix/loc-2.s new file mode 100644 index 0000000..243eeab --- /dev/null +++ b/gas/testsuite/gas/mmix/loc-2.s @@ -0,0 +1,5 @@ +# Check that a LOC before any code gets translated into the right +# symbol being set. + LOC 256 + SWYM 1,1,2 +Main SWYM 112 diff --git a/gas/testsuite/gas/mmix/loc-3.d b/gas/testsuite/gas/mmix/loc-3.d new file mode 100644 index 0000000..fa62639 --- /dev/null +++ b/gas/testsuite/gas/mmix/loc-3.d @@ -0,0 +1,43 @@ +#readelf: -Ssrx1 -x2 +There are 7 section headers, starting at offset 0x80: + +Section Headers: + \[Nr\] Name Type Address Offset + Size EntSize Flags Link Info Align + \[ 0\] NULL 0000000000000000 00000000 + 0000000000000000 0000000000000000 0 0 0 + \[ 1\] \.text PROGBITS 0000000000000000 00000040 + 000000000000000c 0000000000000000 AX 0 0 4 + \[ 2\] \.data PROGBITS 0000000000000000 0000004c + 0000000000000008 0000000000000000 WA 0 0 4 + \[ 3\] \.bss NOBITS 0000000000000000 00000054 + 0000000000000000 0000000000000000 WA 0 0 1 + \[ 4\] \.shstrtab STRTAB 0000000000000000 00000054 + 000000000000002c 0000000000000000 0 0 1 + \[ 5\] \.symtab SYMTAB 0000000000000000 00000240 + 00000000000000c0 0000000000000018 6 5 8 + \[ 6\] \.strtab STRTAB 0000000000000000 00000300 + 0000000000000030 0000000000000000 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\) + I \(info\), L \(link order\), G \(group\), x \(unknown\) + O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) + +There are no relocations in this file\. + +Symbol table '\.symtab' contains 8 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 0+ 0 NOTYPE LOCAL DEFAULT UND + 1: 0+ 0 SECTION LOCAL DEFAULT 1 + 2: 0+ 0 SECTION LOCAL DEFAULT 2 + 3: 0+ 0 SECTION LOCAL DEFAULT 3 + 4: 0+ 0 NOTYPE LOCAL DEFAULT 2 a + 5: 0+4 0 FUNC GLOBAL DEFAULT 1 Main + 6: 0+200 0 NOTYPE GLOBAL DEFAULT ABS __\.MMIX\.start\.\.text + 7: 2000000000000000 0 NOTYPE GLOBAL DEFAULT ABS __\.MMIX\.start\.\.data + +Hex dump of section '\.text': + 0x00000000 fd00038f fd090101 fd000065 .* + +Hex dump of section '\.data': + 0x00000000 00000010 00000040 .* diff --git a/gas/testsuite/gas/mmix/loc-3.s b/gas/testsuite/gas/mmix/loc-3.s new file mode 100644 index 0000000..92943b9 --- /dev/null +++ b/gas/testsuite/gas/mmix/loc-3.s @@ -0,0 +1,14 @@ +# Check that a little bit of LOC:ing back and forward between code and +# data section doesn't hurt. + LOC #20 << 56 +a TETRA 4*4 + + LOC #200 + SWYM 911 +Main SWYM 9,1,1 + + LOC a+4 + TETRA 8*8 + + LOC Main+4 + SWYM 101 diff --git a/gas/testsuite/gas/mmix/loc-4.d b/gas/testsuite/gas/mmix/loc-4.d new file mode 100644 index 0000000..6259f91 --- /dev/null +++ b/gas/testsuite/gas/mmix/loc-4.d @@ -0,0 +1,44 @@ +#readelf: -Ssrx1 -x2 +There are 7 section headers, starting at offset 0x88: + +Section Headers: + \[Nr\] Name Type Address Offset + Size EntSize Flags Link Info Align + \[ 0\] NULL 0000000000000000 00000000 + 0000000000000000 0000000000000000 0 0 0 + \[ 1\] \.text PROGBITS 0000000000000000 00000040 + 0000000000000018 0000000000000000 AX 0 0 4 + \[ 2\] \.data PROGBITS 0000000000000000 00000058 + 0000000000000004 0000000000000000 WA 0 0 4 + \[ 3\] \.bss NOBITS 0000000000000000 0000005c + 0000000000000000 0000000000000000 WA 0 0 1 + \[ 4\] \.shstrtab STRTAB 0000000000000000 0000005c + 000000000000002c 0000000000000000 0 0 1 + \[ 5\] \.symtab SYMTAB 0000000000000000 00000248 + 00000000000000c0 0000000000000018 6 5 8 + \[ 6\] \.strtab STRTAB 0000000000000000 00000308 + 000000000000003b 0000000000000000 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\) + I \(info\), L \(link order\), G \(group\), x \(unknown\) + O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) + +There are no relocations in this file\. + +Symbol table '\.symtab' contains 8 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 0+ 0 NOTYPE LOCAL DEFAULT UND + 1: 0+ 0 SECTION LOCAL DEFAULT 1 + 2: 0+ 0 SECTION LOCAL DEFAULT 2 + 3: 0+ 0 SECTION LOCAL DEFAULT 3 + 4: 2000000000000000 0 NOTYPE LOCAL DEFAULT ABS Data_Segment + 5: 0+14 0 FUNC GLOBAL DEFAULT 1 Main + 6: 0+ 0 NOTYPE GLOBAL DEFAULT ABS __\.MMIX\.start\.\.text + 7: 2000000000000000 0 NOTYPE GLOBAL DEFAULT ABS __\.MMIX\.start\.\.data + +Hex dump of section '\.text': + 0x00000000 fd001807 00000000 00000000 00000000 .* + 0x00000010 fd00038f fd090101 .* + +Hex dump of section '\.data': + 0x00000000 00000100 .* diff --git a/gas/testsuite/gas/mmix/loc-4.s b/gas/testsuite/gas/mmix/loc-4.s new file mode 100644 index 0000000..7dbd332 --- /dev/null +++ b/gas/testsuite/gas/mmix/loc-4.s @@ -0,0 +1,8 @@ +# Hit a few remaining code-paths. + SWYM 0,24,7 + LOC Data_Segment + TETRA 4*4*4*4 + + LOC #10 + SWYM 911 +Main SWYM 9,1,1 diff --git a/gas/testsuite/gas/mmix/loc-5.d b/gas/testsuite/gas/mmix/loc-5.d new file mode 100644 index 0000000..7f632f3 --- /dev/null +++ b/gas/testsuite/gas/mmix/loc-5.d @@ -0,0 +1,45 @@ +#readelf: -Ssrx1 -x2 +There are 7 section headers, starting at offset 0x98: + +Section Headers: + \[Nr\] Name Type Address Offset + Size EntSize Flags Link Info Align + \[ 0\] NULL 0+ 0+ + 0+ 0+ 0 0 0 + \[ 1\] \.text PROGBITS 0+ 0+40 + 0+8 0+ AX 0 0 4 + \[ 2\] \.data PROGBITS 0+ 0+48 + 0+24 0+ WA 0 0 4 + \[ 3\] \.bss NOBITS 0+ 0+6c + 0+ 0+ WA 0 0 1 + \[ 4\] \.shstrtab STRTAB 0+ 0+6c + 0+2c 0+ 0 0 1 + \[ 5\] \.symtab SYMTAB 0+ 0+258 + 0+c0 0+18 6 6 8 + \[ 6\] \.strtab STRTAB 0+ 0+318 + 0+29 0+ 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\) + I \(info\), L \(link order\), G \(group\), x \(unknown\) + O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) + +There are no relocations in this file\. + +Symbol table '\.symtab' contains 8 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 0+ 0 NOTYPE LOCAL DEFAULT UND + 1: 0+ 0 SECTION LOCAL DEFAULT 1 + 2: 0+ 0 SECTION LOCAL DEFAULT 2 + 3: 0+ 0 SECTION LOCAL DEFAULT 3 + 4: 0+ 0 NOTYPE LOCAL DEFAULT 1 t + 5: 2000000000000000 0 NOTYPE LOCAL DEFAULT ABS Data_Segment + 6: 0+4 0 FUNC GLOBAL DEFAULT 1 Main + 7: 2000000000000000 0 NOTYPE GLOBAL DEFAULT ABS __\.MMIX\.start\.\.data + +Hex dump of section '\.text': + 0x0+ fd001807 fd090101 .* + +Hex dump of section '\.data': + 0x0+ 00000100 00000000 00000000 00000000 .* + 0x00000010 00000000 00000000 00000000 00000000 .* + 0x00000020 00000038 .* diff --git a/gas/testsuite/gas/mmix/loc-5.s b/gas/testsuite/gas/mmix/loc-5.s new file mode 100644 index 0000000..a8ef214 --- /dev/null +++ b/gas/testsuite/gas/mmix/loc-5.s @@ -0,0 +1,11 @@ +# Hit a few remaining code-paths. +t SWYM 0,24,7 + + LOC Data_Segment + TETRA 4*4*4*4 + + LOC (#20 << 56) + #20 + TETRA 56 + + LOC t+4 +Main SWYM 9,1,1 diff --git a/gas/testsuite/gas/mmix/local-1.d b/gas/testsuite/gas/mmix/local-1.d new file mode 100644 index 0000000..51418f6 --- /dev/null +++ b/gas/testsuite/gas/mmix/local-1.d @@ -0,0 +1,38 @@ +# objdump: -xsr + +.*: file format elf64-mmix +.* +architecture: mmix, flags 0x00000011: +HAS_RELOC, HAS_SYMS +start address 0x0000000000000000 + +Sections: +Idx Name Size VMA LMA File off Algn + 0 \.text 00000004 0000000000000000 0000000000000000 00000040 2\*\*2 + CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE + 1 \.data 00000000 0000000000000000 0000000000000000 00000044 2\*\*0 + CONTENTS, ALLOC, LOAD, DATA + 2 \.bss 00000000 0000000000000000 0000000000000000 00000044 2\*\*0 + ALLOC +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+90 l \*REG\* 0+ reghere +0+2d l \*ABS\* 0+ consthere +0+ \*UND\* 0+ extreg + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+ R_MMIX_LOCAL extreg +0+ R_MMIX_LOCAL reghere +0+ R_MMIX_LOCAL consthere +0+ R_MMIX_LOCAL \*ABS\*\+0x0000000000000064 +0+ R_MMIX_LOCAL \*ABS\*\+0x00000000000000c8 + + +Contents of section \.text: + 0000 fd000000 .* + +Contents of section \.data: diff --git a/gas/testsuite/gas/mmix/local-1.s b/gas/testsuite/gas/mmix/local-1.s new file mode 100644 index 0000000..f65bbc1 --- /dev/null +++ b/gas/testsuite/gas/mmix/local-1.s @@ -0,0 +1,12 @@ + LOCAL extreg + LOCAL reghere + LOCAL consthere + LOCAL 100 + LOCAL $200 + +reghere IS $144 +consthere IS 45 + + # Restrictions on the implementation means we have to have the LOCAL in + # code or data. + SWYM 0,0,0 diff --git a/gas/testsuite/gas/mmix/locall1.d b/gas/testsuite/gas/mmix/locall1.d new file mode 100644 index 0000000..0921e63 --- /dev/null +++ b/gas/testsuite/gas/mmix/locall1.d @@ -0,0 +1,15 @@ +# objdump: -t + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+14 l \.text 0+ L9 +0+18 l \.text 0+ L12 +0+1c l \.text 0+ L21 +0+20 l \.text 0+ LC32 +0+24 l \.text 0+ LC23 +0+8 g \.text 0+ L:21 +0+10 g \.text 0+ LC:23 diff --git a/gas/testsuite/gas/mmix/locall1.s b/gas/testsuite/gas/mmix/locall1.s new file mode 100644 index 0000000..9550bd1 --- /dev/null +++ b/gas/testsuite/gas/mmix/locall1.s @@ -0,0 +1,14 @@ +% Get rid of labels that look compiler-generated, matching: "L.*:[0-9]+". +% Only if they're local, of course. + .global L:21 + .global LC:23 +L:9 SWYM 0 +L:12 SWYM 1 +L:21 SWYM 2 +LC:32 SWYM 3 +LC:23 SWYM 4 +L9 SWYM 10 +L12 SWYM 11 +L21 SWYM 12 +LC32 SWYM 13 +LC23 SWYM 14 diff --git a/gas/testsuite/gas/mmix/mmix-err.exp b/gas/testsuite/gas/mmix/mmix-err.exp new file mode 100644 index 0000000..b9c8371 --- /dev/null +++ b/gas/testsuite/gas/mmix/mmix-err.exp @@ -0,0 +1,30 @@ +# Copyright (C) 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +if { ! [istarget "mmix-*"] } { + return +} + +proc run_mmix_err_tests { } { + global srcdir subdir runtests + + load_lib gas-dg.exp + dg-init + dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/err-*.s]] "" "" + dg-finish +} + +run_mmix_err_tests diff --git a/gas/testsuite/gas/mmix/mmix-list.exp b/gas/testsuite/gas/mmix/mmix-list.exp new file mode 100644 index 0000000..6f62ceb --- /dev/null +++ b/gas/testsuite/gas/mmix/mmix-list.exp @@ -0,0 +1,48 @@ +# Copyright (C) 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +if { ! [istarget "mmix-*"] } { + return +} + +proc run_list_test { name opts } { + global srcdir subdir runtests + + if ![runtest_file_p $runtests $name] then { + return + } + + set testname "mmix list $name" + set file $srcdir/$subdir/$name + gas_run ${name}.s $opts ">&dump.out" + if { [regexp_diff "dump.out" "${file}.l"] } then { + fail $testname + verbose "output is [file_contents "dump.out"]" 2 + return + } + pass $testname +} + +proc run_mmix_list_tests { } { + global srcdir subdir runtests + foreach test_name [lsort [find ${srcdir}/${subdir} *.l]] { + # Keep basename. + regsub -all ".*/\(\[^\.\]*\)\.l$" $test_name "\\1" test_name + run_list_test $test_name "-a -x" + } +} + +run_mmix_list_tests diff --git a/gas/testsuite/gas/mmix/mmix.exp b/gas/testsuite/gas/mmix/mmix.exp new file mode 100644 index 0000000..139b895 --- /dev/null +++ b/gas/testsuite/gas/mmix/mmix.exp @@ -0,0 +1,38 @@ +# Copyright (C) 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +if { ! [istarget "mmix-*"] } { + return +} + +proc run_mmix_tests { } { + global srcdir subdir runtests + foreach test_name [lsort [find ${srcdir}/${subdir} *.d]] { + # Keep basename. + regsub -all ".*/\(\[^\.\]*\)\.d$" $test_name "\\1" test_name + + run_dump_test $test_name + } + + # FIXME: more tests needed. + # BFD_RELOC_MMIX_REG_OR_BYTE with symbol-difference with + # relaxable thing in between. + # + # Other normal reloc with symbol-difference with + # relaxable thing in between. +} + +run_mmix_tests diff --git a/gas/testsuite/gas/mmix/odd-1.d b/gas/testsuite/gas/mmix/odd-1.d new file mode 100644 index 0000000..0162e1d --- /dev/null +++ b/gas/testsuite/gas/mmix/odd-1.d @@ -0,0 +1,28 @@ +#objdump: -str + +# A few odd mmixal compatibility cases. + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \.MMIX\.reg_contents 0+ small +0+ l d \.MMIX\.reg_contents 0+ +0+ g F \.text 0+ Main + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+7 R_MMIX_REG_OR_BYTE \.MMIX\.reg_contents +0+f R_MMIX_REG \.MMIX\.reg_contents +0+15 R_MMIX_REG \.MMIX\.reg_contents +0+19 R_MMIX_REG \.MMIX\.reg_contents + +Contents of section \.text: + 0000 f9000000 ff016400 fb0000ff fb000000 .* + 0010 00000001 33000408 c1000200 0004022a .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000abc .* diff --git a/gas/testsuite/gas/mmix/odd-1.s b/gas/testsuite/gas/mmix/odd-1.s new file mode 100644 index 0000000..9a0a81f --- /dev/null +++ b/gas/testsuite/gas/mmix/odd-1.s @@ -0,0 +1,9 @@ +small GREG #abc +Main RESUME + TRIP 1,$100,small + UNSAVE $255 + UNSAVE small + TRAP 0,$1 + CMPU small,$4,rC + SET small,$2 + BYTE 0,4,rE,#2a diff --git a/gas/testsuite/gas/mmix/op-0-1.d b/gas/testsuite/gas/mmix/op-0-1.d new file mode 100644 index 0000000..56c51e8 --- /dev/null +++ b/gas/testsuite/gas/mmix/op-0-1.d @@ -0,0 +1,28 @@ +#objdump: -srt +#as: -x + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \*ABS\* 0+ zero0 +0+ l \*ABS\* 0+ zero1 +0+ l \*ABS\* 0+ zero2 +0+ g F \.text 0+ Main + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+ R_MMIX_JMP \*ABS\* +0+14 R_MMIX_GETA \*ABS\* +0+24 R_MMIX_PUSHJ \*ABS\* + + +Contents of section \.text: + 0000 f0000000 fd000000 fd000000 fd000000 .* + 0010 fd000000 f4070000 fd000000 fd000000 .* + 0020 fd000000 f2080000 fd000000 fd000000 .* + 0030 fd000000 fd000000 .* +Contents of section \.data: diff --git a/gas/testsuite/gas/mmix/op-0-1.s b/gas/testsuite/gas/mmix/op-0-1.s new file mode 100644 index 0000000..84f42a1 --- /dev/null +++ b/gas/testsuite/gas/mmix/op-0-1.s @@ -0,0 +1,8 @@ +zero0 IS 0 +zero1 IS 0 +zero2 IS 0 +Main JMP zero0 + GETA $7,zero1 + PUSHJ $8,zero2 + + diff --git a/gas/testsuite/gas/mmix/op-0-2.d b/gas/testsuite/gas/mmix/op-0-2.d new file mode 100644 index 0000000..4a3c668 --- /dev/null +++ b/gas/testsuite/gas/mmix/op-0-2.d @@ -0,0 +1,26 @@ +#source: op-0-1.s +#as: -no-expand +#objdump: -srt + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \*ABS\* 0+ zero0 +0+ l \*ABS\* 0+ zero1 +0+ l \*ABS\* 0+ zero2 +0+ g F \.text 0+ Main + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+ R_MMIX_ADDR27 \*ABS\* +0+4 R_MMIX_ADDR19 \*ABS\* +0+8 R_MMIX_ADDR19 \*ABS\* + + +Contents of section \.text: + 0000 f0000000 f4070000 f2080000 .* +Contents of section \.data: diff --git a/gas/testsuite/gas/mmix/pop-op-r.d b/gas/testsuite/gas/mmix/pop-op-r.d new file mode 100644 index 0000000..390f29d --- /dev/null +++ b/gas/testsuite/gas/mmix/pop-op-r.d @@ -0,0 +1,12 @@ +# objdump: -dr +# as: -linkrelax +# source: pop-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f8840def pop 132,3567 + 4: f8845678 pop 132,22136 + 8: f8170def pop 23,3567 + c: f8175678 pop 23,22136 diff --git a/gas/testsuite/gas/mmix/pop-op.d b/gas/testsuite/gas/mmix/pop-op.d new file mode 100644 index 0000000..3018fdf --- /dev/null +++ b/gas/testsuite/gas/mmix/pop-op.d @@ -0,0 +1,10 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f8840def pop 132,3567 + 4: f8845678 pop 132,22136 + 8: f8170def pop 23,3567 + c: f8175678 pop 23,22136 diff --git a/gas/testsuite/gas/mmix/pop-op.l b/gas/testsuite/gas/mmix/pop-op.l new file mode 100644 index 0000000..a600df1 --- /dev/null +++ b/gas/testsuite/gas/mmix/pop-op.l @@ -0,0 +1,21 @@ +GAS for MMIX .*/pop-op\.s page 1 + + + 1 #.* + 2 #.* + 3 0000 F8840DEF Main POP 132,3567 + 4 0004 F8845678 POP 132,YZ + 5 0008 F8170DEF POP X,3567 + 6 000c F8175678 POP X,YZ + 7 X IS 23 + 8 YZ IS #5678 + 9 +GAS for MMIX .*/pop-op\.s page 2 + + +DEFINED SYMBOLS +.*/pop-op\.s:3 \.text:0000000000000000 Main + \*ABS\*:0000000000005678 YZ + \*ABS\*:0000000000000017 X + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/pop-op.s b/gas/testsuite/gas/mmix/pop-op.s new file mode 100644 index 0000000..e781aed --- /dev/null +++ b/gas/testsuite/gas/mmix/pop-op.s @@ -0,0 +1,9 @@ +# Check different type of operands to SWYM etc. +# No need to check the canonical three constants. +Main POP 132,3567 + POP 132,YZ + POP X,3567 + POP X,YZ +X IS 23 +YZ IS #5678 + diff --git a/gas/testsuite/gas/mmix/prefix1.d b/gas/testsuite/gas/mmix/prefix1.d new file mode 100644 index 0000000..e82d60f --- /dev/null +++ b/gas/testsuite/gas/mmix/prefix1.d @@ -0,0 +1,38 @@ +# objdump: -rt + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \.text 0+ a +0+4 l \.text 0+ c +0+24 l \.text 0+ d +0+8 l \.text 0+ prea +0+c l \.text 0+ pre:c +0+10 l \.text 0+ prefixa +0+14 l \.text 0+ pre:fix:c +0+18 l \.text 0+ aprefixa +0+1c l \.text 0+ aprefix:c +0+20 l \.text 0+ a0 +0+ \*UND\* 0+ b +0+ \*UND\* 0+ preb +0+ \*UND\* 0+ pre:d +0+ \*UND\* 0+ prefixb +0+ \*UND\* 0+ pre:fix:d +0+ \*UND\* 0+ aprefixb +0+ \*UND\* 0+ aprefix:d + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+ R_MMIX_32 b +0+4 R_MMIX_32 \.text\+0x0+24 +0+8 R_MMIX_32 preb +0+c R_MMIX_32 pre:d +0+10 R_MMIX_32 prefixb +0+14 R_MMIX_32 pre:fix:d +0+18 R_MMIX_32 aprefixb +0+1c R_MMIX_32 aprefix:d +0+20 R_MMIX_32 \.text +0+24 R_MMIX_32 \.text\+0x0+4 diff --git a/gas/testsuite/gas/mmix/prefix1.s b/gas/testsuite/gas/mmix/prefix1.s new file mode 100644 index 0000000..b975e86 --- /dev/null +++ b/gas/testsuite/gas/mmix/prefix1.s @@ -0,0 +1,21 @@ +# Use of PREFIX; sanity check only. + .text +a TETRA b +:c TETRA :d + + PREFIX pre +a TETRA b +:pre:c TETRA :pre:d + + PREFIX fix +a TETRA b +:pre:fix:c TETRA :pre:fix:d + + PREFIX :aprefix +a TETRA b +:aprefix:c TETRA :aprefix:d + + PREFIX : +a0 TETRA a +d TETRA c + diff --git a/gas/testsuite/gas/mmix/prefix2.d b/gas/testsuite/gas/mmix/prefix2.d new file mode 100644 index 0000000..818761b --- /dev/null +++ b/gas/testsuite/gas/mmix/prefix2.d @@ -0,0 +1,15 @@ +# objdump: -dtr + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ g F \.text 0+ Main + + +Disassembly of section \.text: + +0+ <Main>: + 0: 220116e9 addu \$1,\$22,\$233 diff --git a/gas/testsuite/gas/mmix/prefix2.s b/gas/testsuite/gas/mmix/prefix2.s new file mode 100644 index 0000000..1c914d7 --- /dev/null +++ b/gas/testsuite/gas/mmix/prefix2.s @@ -0,0 +1,3 @@ +# Prefix must not interfere with register names. + PREFIX pre +:Main ADDU $1,$22,$233 diff --git a/gas/testsuite/gas/mmix/prefix3.d b/gas/testsuite/gas/mmix/prefix3.d new file mode 100644 index 0000000..ecd7538 --- /dev/null +++ b/gas/testsuite/gas/mmix/prefix3.d @@ -0,0 +1,32 @@ +#objdump: -str + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+8 l \.text 0+ someplace +0+ l \.text 0+ bc:h +0+8 l \.MMIX\.reg_contents 0+ a1 +0+ l \.MMIX\.reg_contents 0+ ba2 +0+ l d \.MMIX\.reg_contents 0+ +0+4 g F \.text 0+ Main + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+2 R_MMIX_REG \.MMIX\.reg_contents\+0x0+8 +0+6 R_MMIX_REG \.MMIX\.reg_contents + + +RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]: +OFFSET TYPE VALUE +0+8 R_MMIX_64 \.text\+0x0+8 + + +Contents of section \.text: + 0000 81ff0000 81fe0000 .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 0008aa52 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/prefix3.s b/gas/testsuite/gas/mmix/prefix3.s new file mode 100644 index 0000000..b597dad --- /dev/null +++ b/gas/testsuite/gas/mmix/prefix3.s @@ -0,0 +1,9 @@ +% Check that changing prefixes between the GREG definition, its use and +% the end of the assembly file does not change the GREG definition. +a1 GREG someplace + PREFIX b +a2 GREG 567890 + PREFIX c: +h LDB $255,:a1 +:Main LDB $254,:ba2 +:someplace IS @ diff --git a/gas/testsuite/gas/mmix/pseudo-1.d b/gas/testsuite/gas/mmix/pseudo-1.d new file mode 100644 index 0000000..293e2d9 --- /dev/null +++ b/gas/testsuite/gas/mmix/pseudo-1.d @@ -0,0 +1,16 @@ +#objdump: -str + +# Check that some pseudos get output right. + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ g F \.text 0+ Main + +Contents of section \.text: + 0000 00000020 00000020 00000020 00000020 .* + 0010 0000000a 00000000 .* +Contents of section \.data: diff --git a/gas/testsuite/gas/mmix/pseudo-1.s b/gas/testsuite/gas/mmix/pseudo-1.s new file mode 100644 index 0000000..dd74f36 --- /dev/null +++ b/gas/testsuite/gas/mmix/pseudo-1.s @@ -0,0 +1 @@ +Main TETRA " ",#a,0 diff --git a/gas/testsuite/gas/mmix/pushgo-op-r.d b/gas/testsuite/gas/mmix/pushgo-op-r.d new file mode 100644 index 0000000..d326ba4 --- /dev/null +++ b/gas/testsuite/gas/mmix/pushgo-op-r.d @@ -0,0 +1,64 @@ +# objdump: -dr +# as: -linkrelax +# source: pushgo-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: be170c43 pushgo \$23,\$12,\$67 + 4: becb0c43 pushgo \$203,\$12,\$67 + 8: be200c43 pushgo \$32,\$12,\$67 + c: be200c43 pushgo \$32,\$12,\$67 + 10: be172043 pushgo \$23,\$32,\$67 + 14: becb2043 pushgo \$203,\$32,\$67 + 18: bee88543 pushgo \$232,\$133,\$67 + 1c: bee88543 pushgo \$232,\$133,\$67 + 20: be170c49 pushgo \$23,\$12,\$73 + 24: becb0c49 pushgo \$203,\$12,\$73 + 28: be1f0ce9 pushgo \$31,\$12,\$233 + 2c: be1f0ce9 pushgo \$31,\$12,\$233 + 30: be1726d4 pushgo \$23,\$38,\$212 + 34: becb26d4 pushgo \$203,\$38,\$212 + 38: be04afb5 pushgo \$4,\$175,\$181 + 3c: be04afb5 pushgo \$4,\$175,\$181 + 40: bf170cb0 pushgo \$23,\$12,176 + 44: bfcb0cb0 pushgo \$203,\$12,176 + 48: bf200cb0 pushgo \$32,\$12,176 + 4c: bf200cb0 pushgo \$32,\$12,176 + 50: bf1720b0 pushgo \$23,\$32,176 + 54: bfcb20b0 pushgo \$203,\$32,176 + 58: bfe885b0 pushgo \$232,\$133,176 + 5c: bfe885b0 pushgo \$232,\$133,176 + 60: bf170ccb pushgo \$23,\$12,203 + 64: bfcb0ccb pushgo \$203,\$12,203 + 68: bf1f0cd5 pushgo \$31,\$12,213 + 6c: bf1f0cd5 pushgo \$31,\$12,213 + 70: bf1726d3 pushgo \$23,\$38,211 + 74: bfcb26d3 pushgo \$203,\$38,211 + 78: bf04afa1 pushgo \$4,\$175,161 + 7c: bf04afa1 pushgo \$4,\$175,161 + 80: bf170c00 pushgo \$23,\$12,0 + 84: bfcb0c00 pushgo \$203,\$12,0 + 88: bf290c00 pushgo \$41,\$12,0 + 8c: bff10c00 pushgo \$241,\$12,0 + 90: bf171b00 pushgo \$23,\$27,0 + 94: bfcb3000 pushgo \$203,\$48,0 + 98: bfdfdb00 pushgo \$223,\$219,0 + 9c: bfdfe500 pushgo \$223,\$229,0 + a0: bf170c00 pushgo \$23,\$12,0 + a4: bfcb0c00 pushgo \$203,\$12,0 + a8: bf200c00 pushgo \$32,\$12,0 + ac: bf200c00 pushgo \$32,\$12,0 + b0: bf172000 pushgo \$23,\$32,0 + b4: bfcb2000 pushgo \$203,\$32,0 + b8: bfe88500 pushgo \$232,\$133,0 + bc: bfe88500 pushgo \$232,\$133,0 + c0: bf170c00 pushgo \$23,\$12,0 + c4: bfcb0c00 pushgo \$203,\$12,0 + c8: bf1f0c00 pushgo \$31,\$12,0 + cc: bf1f0c00 pushgo \$31,\$12,0 + d0: bf172600 pushgo \$23,\$38,0 + d4: bfcb2600 pushgo \$203,\$38,0 + d8: bf04af00 pushgo \$4,\$175,0 + dc: bf04af00 pushgo \$4,\$175,0 diff --git a/gas/testsuite/gas/mmix/pushgo-op.d b/gas/testsuite/gas/mmix/pushgo-op.d new file mode 100644 index 0000000..ae3266d --- /dev/null +++ b/gas/testsuite/gas/mmix/pushgo-op.d @@ -0,0 +1,62 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: be170c43 pushgo \$23,\$12,\$67 + 4: becb0c43 pushgo \$203,\$12,\$67 + 8: be200c43 pushgo \$32,\$12,\$67 + c: be200c43 pushgo \$32,\$12,\$67 + 10: be172043 pushgo \$23,\$32,\$67 + 14: becb2043 pushgo \$203,\$32,\$67 + 18: bee88543 pushgo \$232,\$133,\$67 + 1c: bee88543 pushgo \$232,\$133,\$67 + 20: be170c49 pushgo \$23,\$12,\$73 + 24: becb0c49 pushgo \$203,\$12,\$73 + 28: be1f0ce9 pushgo \$31,\$12,\$233 + 2c: be1f0ce9 pushgo \$31,\$12,\$233 + 30: be1726d4 pushgo \$23,\$38,\$212 + 34: becb26d4 pushgo \$203,\$38,\$212 + 38: be04afb5 pushgo \$4,\$175,\$181 + 3c: be04afb5 pushgo \$4,\$175,\$181 + 40: bf170cb0 pushgo \$23,\$12,176 + 44: bfcb0cb0 pushgo \$203,\$12,176 + 48: bf200cb0 pushgo \$32,\$12,176 + 4c: bf200cb0 pushgo \$32,\$12,176 + 50: bf1720b0 pushgo \$23,\$32,176 + 54: bfcb20b0 pushgo \$203,\$32,176 + 58: bfe885b0 pushgo \$232,\$133,176 + 5c: bfe885b0 pushgo \$232,\$133,176 + 60: bf170ccb pushgo \$23,\$12,203 + 64: bfcb0ccb pushgo \$203,\$12,203 + 68: bf1f0cd5 pushgo \$31,\$12,213 + 6c: bf1f0cd5 pushgo \$31,\$12,213 + 70: bf1726d3 pushgo \$23,\$38,211 + 74: bfcb26d3 pushgo \$203,\$38,211 + 78: bf04afa1 pushgo \$4,\$175,161 + 7c: bf04afa1 pushgo \$4,\$175,161 + 80: bf170c00 pushgo \$23,\$12,0 + 84: bfcb0c00 pushgo \$203,\$12,0 + 88: bf290c00 pushgo \$41,\$12,0 + 8c: bff10c00 pushgo \$241,\$12,0 + 90: bf171b00 pushgo \$23,\$27,0 + 94: bfcb3000 pushgo \$203,\$48,0 + 98: bfdfdb00 pushgo \$223,\$219,0 + 9c: bfdfe500 pushgo \$223,\$229,0 + a0: bf170c00 pushgo \$23,\$12,0 + a4: bfcb0c00 pushgo \$203,\$12,0 + a8: bf200c00 pushgo \$32,\$12,0 + ac: bf200c00 pushgo \$32,\$12,0 + b0: bf172000 pushgo \$23,\$32,0 + b4: bfcb2000 pushgo \$203,\$32,0 + b8: bfe88500 pushgo \$232,\$133,0 + bc: bfe88500 pushgo \$232,\$133,0 + c0: bf170c00 pushgo \$23,\$12,0 + c4: bfcb0c00 pushgo \$203,\$12,0 + c8: bf1f0c00 pushgo \$31,\$12,0 + cc: bf1f0c00 pushgo \$31,\$12,0 + d0: bf172600 pushgo \$23,\$38,0 + d4: bfcb2600 pushgo \$203,\$38,0 + d8: bf04af00 pushgo \$4,\$175,0 + dc: bf04af00 pushgo \$4,\$175,0 diff --git a/gas/testsuite/gas/mmix/pushgo-op.l b/gas/testsuite/gas/mmix/pushgo-op.l new file mode 100644 index 0000000..511a807 --- /dev/null +++ b/gas/testsuite/gas/mmix/pushgo-op.l @@ -0,0 +1,87 @@ +GAS for MMIX .*/pushgo-op\.s page 1 + + + 1 #.* + 2 #.* + 3 0000 BE170C43 Main PUSHGO X,Y,Z + 4 0004 BECB0C43 PUSHGO XC,Y,Z + 5 0008 BE200C43 PUSHGO \$32,Y,Z + 6 000c BE200C43 PUSHGO 32,Y,Z + 7 0010 BE172043 PUSHGO X,\$32,Z + 8 0014 BECB2043 PUSHGO XC,\$32,Z + 9 0018 BEE88543 PUSHGO \$232,\$133,Z + 10 001c BEE88543 PUSHGO 232,\$133,Z + 11 0020 BE170C49 PUSHGO X,Y,\$73 + 12 0024 BECB0C49 PUSHGO XC,Y,\$73 + 13 0028 BE1F0CE9 PUSHGO \$31,Y,\$233 + 14 002c BE1F0CE9 PUSHGO 31,Y,\$233 + 15 0030 BE1726D4 PUSHGO X,\$38,\$212 + 16 0034 BECB26D4 PUSHGO XC,\$38,\$212 + 17 0038 BE04AFB5 PUSHGO \$4,\$175,\$181 + 18 003c BE04AFB5 PUSHGO 4,\$175,\$181 + 19 + 20 0040 BF170CB0 PUSHGO X,Y,Z0 + 21 0044 BFCB0CB0 PUSHGO XC,Y,Z0 + 22 0048 BF200CB0 PUSHGO \$32,Y,Z0 + 23 004c BF200CB0 PUSHGO 32,Y,Z0 + 24 0050 BF1720B0 PUSHGO X,\$32,Z0 + 25 0054 BFCB20B0 PUSHGO XC,\$32,Z0 + 26 0058 BFE885B0 PUSHGO \$232,\$133,Z0 + 27 005c BFE885B0 PUSHGO 232,\$133,Z0 + 28 0060 BF170CCB PUSHGO X,Y,203 + 29 0064 BFCB0CCB PUSHGO XC,Y,203 + 30 0068 BF1F0CD5 PUSHGO \$31,Y,213 + 31 006c BF1F0CD5 PUSHGO 31,Y,213 + 32 0070 BF1726D3 PUSHGO X,\$38,211 + 33 0074 BFCB26D3 PUSHGO XC,\$38,211 + 34 0078 BF04AFA1 PUSHGO \$4,\$175,161 + 35 007c BF04AFA1 PUSHGO 4,\$175,161 + 36 + 37 0080 BF170C00 PUSHGO X,Y + 38 0084 BFCB0C00 PUSHGO XC,Y + 39 + 40 0088 BF290C00 PUSHGO \$41,Y + 41 008c BFF10C00 PUSHGO 241,Y + 42 + 43 0090 BF171B00 PUSHGO X,\$27 + 44 0094 BFCB3000 PUSHGO XC,\$48 + 45 + 46 0098 BFDFDB00 PUSHGO \$223,\$219 + 47 009c BFDFE500 PUSHGO 223,\$229 + 48 + 49 00a0 BF170C00 PUSHGO X,Y,0 + 50 00a4 BFCB0C00 PUSHGO XC,Y,0 + 51 00a8 BF200C00 PUSHGO \$32,Y,0 + 52 00ac BF200C00 PUSHGO 32,Y,0 + 53 00b0 BF172000 PUSHGO X,\$32,0 + 54 00b4 BFCB2000 PUSHGO XC,\$32,0 + 55 00b8 BFE88500 PUSHGO \$232,\$133,0 + 56 00bc BFE88500 PUSHGO 232,\$133,0 + 57 00c0 BF170C00 PUSHGO X,Y,0 +GAS for MMIX .*/pushgo-op\.s page 2 + + + 58 00c4 BFCB0C00 PUSHGO XC,Y,0 + 59 00c8 BF1F0C00 PUSHGO \$31,Y,0 + 60 00cc BF1F0C00 PUSHGO 31,Y,0 + 61 00d0 BF172600 PUSHGO X,\$38,0 + 62 00d4 BFCB2600 PUSHGO XC,\$38,0 + 63 00d8 BF04AF00 PUSHGO \$4,\$175,0 + 64 00dc BF04AF00 PUSHGO 4,\$175,0 + 65 X IS \$23 + 66 XC IS 203 + 67 Y IS \$12 + 68 Z IS \$67 + 69 Z0 IS 176 +GAS for MMIX .*/pushgo-op\.s page 3 + + +DEFINED SYMBOLS +.*/pushgo-op\.s:3 \.text:0000000000000000 Main + \*REG\*:0000000000000017 X + \*REG\*:000000000000000c Y + \*REG\*:0000000000000043 Z + \*ABS\*:00000000000000cb XC + \*ABS\*:00000000000000b0 Z0 + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/pushgo-op.s b/gas/testsuite/gas/mmix/pushgo-op.s new file mode 100644 index 0000000..54ff0a8 --- /dev/null +++ b/gas/testsuite/gas/mmix/pushgo-op.s @@ -0,0 +1,69 @@ +# PUSHGO. Like T, but $X can be expressed as a constant. +# Using regt-op as a template caused this to go out of control. +Main PUSHGO X,Y,Z + PUSHGO XC,Y,Z + PUSHGO $32,Y,Z + PUSHGO 32,Y,Z + PUSHGO X,$32,Z + PUSHGO XC,$32,Z + PUSHGO $232,$133,Z + PUSHGO 232,$133,Z + PUSHGO X,Y,$73 + PUSHGO XC,Y,$73 + PUSHGO $31,Y,$233 + PUSHGO 31,Y,$233 + PUSHGO X,$38,$212 + PUSHGO XC,$38,$212 + PUSHGO $4,$175,$181 + PUSHGO 4,$175,$181 + + PUSHGO X,Y,Z0 + PUSHGO XC,Y,Z0 + PUSHGO $32,Y,Z0 + PUSHGO 32,Y,Z0 + PUSHGO X,$32,Z0 + PUSHGO XC,$32,Z0 + PUSHGO $232,$133,Z0 + PUSHGO 232,$133,Z0 + PUSHGO X,Y,203 + PUSHGO XC,Y,203 + PUSHGO $31,Y,213 + PUSHGO 31,Y,213 + PUSHGO X,$38,211 + PUSHGO XC,$38,211 + PUSHGO $4,$175,161 + PUSHGO 4,$175,161 + + PUSHGO X,Y + PUSHGO XC,Y + + PUSHGO $41,Y + PUSHGO 241,Y + + PUSHGO X,$27 + PUSHGO XC,$48 + + PUSHGO $223,$219 + PUSHGO 223,$229 + + PUSHGO X,Y,0 + PUSHGO XC,Y,0 + PUSHGO $32,Y,0 + PUSHGO 32,Y,0 + PUSHGO X,$32,0 + PUSHGO XC,$32,0 + PUSHGO $232,$133,0 + PUSHGO 232,$133,0 + PUSHGO X,Y,0 + PUSHGO XC,Y,0 + PUSHGO $31,Y,0 + PUSHGO 31,Y,0 + PUSHGO X,$38,0 + PUSHGO XC,$38,0 + PUSHGO $4,$175,0 + PUSHGO 4,$175,0 +X IS $23 +XC IS 203 +Y IS $12 +Z IS $67 +Z0 IS 176 diff --git a/gas/testsuite/gas/mmix/pushj-c.d b/gas/testsuite/gas/mmix/pushj-c.d new file mode 100644 index 0000000..c4c2746 --- /dev/null +++ b/gas/testsuite/gas/mmix/pushj-c.d @@ -0,0 +1,28 @@ +#as: -x +#objdump: -tdr + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d .text 0+ +0+ l d .data 0+ +0+ l d .bss 0+ +ffff0000ffff0000 l \*ABS\* 0+ i1 +ffff0000ffff0000 l \*ABS\* 0+ i2 +0+ g F .text 0+ Main + +Disassembly of section .text: + +0+ <Main>: + 0: f2010000 pushj \$1,0 <Main> + 0: R_MMIX_PUSHJ \*ABS\*\+0xffff0000ffff0000 + 4: fd000000 swym 0,0,0 + 8: fd000000 swym 0,0,0 + c: fd000000 swym 0,0,0 + 10: fd000000 swym 0,0,0 + 14: f2020000 pushj \$2,14 <Main\+0x14> + 14: R_MMIX_PUSHJ i2 + 18: fd000000 swym 0,0,0 + 1c: fd000000 swym 0,0,0 + 20: fd000000 swym 0,0,0 + 24: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/pushj-c.s b/gas/testsuite/gas/mmix/pushj-c.s new file mode 100644 index 0000000..a439401 --- /dev/null +++ b/gas/testsuite/gas/mmix/pushj-c.s @@ -0,0 +1,5 @@ +% PUSHJ far away must not fail +i1 IS #ffff0000ffff0000 +Main PUSHJ $1,i1 + PUSHJ $2,i2 +i2 IS #ffff0000ffff0000 diff --git a/gas/testsuite/gas/mmix/put-op-r.d b/gas/testsuite/gas/mmix/put-op-r.d new file mode 100644 index 0000000..e536c55 --- /dev/null +++ b/gas/testsuite/gas/mmix/put-op-r.d @@ -0,0 +1,17 @@ +# objdump: -dr +# as: -linkrelax +# source: put-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f604007b put rJ,\$123 + 4: f613002d put rG,\$45 + 8: f61f00f5 put rZZ,\$245 + c: f604006f put rJ,\$111 + 10: f713002d put rG,45 + 14: f71f00f5 put rZZ,245 + 18: f7040000 put rJ,0 + 1c: f7130000 put rG,0 + 20: f71f0000 put rZZ,0 diff --git a/gas/testsuite/gas/mmix/put-op.d b/gas/testsuite/gas/mmix/put-op.d new file mode 100644 index 0000000..1ec59a7 --- /dev/null +++ b/gas/testsuite/gas/mmix/put-op.d @@ -0,0 +1,15 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f604007b put rJ,\$123 + 4: f613002d put rG,\$45 + 8: f61f00f5 put rZZ,\$245 + c: f604006f put rJ,\$111 + 10: f713002d put rG,45 + 14: f71f00f5 put rZZ,245 + 18: f7040000 put rJ,0 + 1c: f7130000 put rG,0 + 20: f71f0000 put rZZ,0 diff --git a/gas/testsuite/gas/mmix/put-op.l b/gas/testsuite/gas/mmix/put-op.l new file mode 100644 index 0000000..5fa44f3 --- /dev/null +++ b/gas/testsuite/gas/mmix/put-op.l @@ -0,0 +1,27 @@ +GAS for MMIX .*/put-op\.s page 1 + + + 1 #.* + 2 #.* + 3 0000 F604007B Main PUT rJ,X + 4 0004 F613002D PUT rG,\$45 + 5 0008 F61F00F5 PUT rZZ,\$245 + 6 000c F604006F PUT rJ,X0 + 7 0010 F713002D PUT rG,45 + 8 0014 F71F00F5 PUT rZZ,245 + 9 0018 F7040000 PUT rJ,X00 + 10 001c F7130000 PUT rG,0 + 11 0020 F71F0000 PUT rZZ,0 + 12 X IS \$123 + 13 X0 IS \$111 + 14 X00 IS 0 +GAS for MMIX .*/put-op\.s page 2 + + +DEFINED SYMBOLS +.*/put-op\.s:3 \.text:0000000000000000 Main + \*REG\*:000000000000007b X + \*REG\*:000000000000006f X0 + \*ABS\*:0000000000000000 X00 + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/put-op.s b/gas/testsuite/gas/mmix/put-op.s new file mode 100644 index 0000000..193fff1 --- /dev/null +++ b/gas/testsuite/gas/mmix/put-op.s @@ -0,0 +1,14 @@ +# For 'p'-type operands: PUT. +# +Main PUT rJ,X + PUT rG,$45 + PUT rZZ,$245 + PUT rJ,X0 + PUT rG,45 + PUT rZZ,245 + PUT rJ,X00 + PUT rG,0 + PUT rZZ,0 +X IS $123 +X0 IS $111 +X00 IS 0 diff --git a/gas/testsuite/gas/mmix/reg-op-r.d b/gas/testsuite/gas/mmix/reg-op-r.d new file mode 100644 index 0000000..d26478b --- /dev/null +++ b/gas/testsuite/gas/mmix/reg-op-r.d @@ -0,0 +1,16 @@ +# objdump: -dr +# as: -linkrelax +# source: reg-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 10170c43 fmul \$23,\$12,\$67 + 4: 01200c43 fcmp \$32,\$12,\$67 + 8: 040c2043 fadd \$12,\$32,\$67 + c: 02e88543 fun \$232,\$133,\$67 + 10: 03170c49 feql \$23,\$12,\$73 + 14: 161f0ce9 frem \$31,\$12,\$233 + 18: 061726d4 fsub \$23,\$38,\$212 + 1c: 1304afb5 feqle \$4,\$175,\$181 diff --git a/gas/testsuite/gas/mmix/reg-op.d b/gas/testsuite/gas/mmix/reg-op.d new file mode 100644 index 0000000..816a108 --- /dev/null +++ b/gas/testsuite/gas/mmix/reg-op.d @@ -0,0 +1,14 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 10170c43 fmul \$23,\$12,\$67 + 4: 01200c43 fcmp \$32,\$12,\$67 + 8: 040c2043 fadd \$12,\$32,\$67 + c: 02e88543 fun \$232,\$133,\$67 + 10: 03170c49 feql \$23,\$12,\$73 + 14: 161f0ce9 frem \$31,\$12,\$233 + 18: 061726d4 fsub \$23,\$38,\$212 + 1c: 1304afb5 feqle \$4,\$175,\$181 diff --git a/gas/testsuite/gas/mmix/reg-op.l b/gas/testsuite/gas/mmix/reg-op.l new file mode 100644 index 0000000..e11a6fe --- /dev/null +++ b/gas/testsuite/gas/mmix/reg-op.l @@ -0,0 +1,26 @@ +GAS for MMIX .*/reg-op\.s page 1 + + + 1 #.* + 2 #.* + 3 0000 10170C43 Main FMUL X,Y,Z + 4 0004 01200C43 FCMP \$32,Y,Z + 5 0008 040C2043 FADD Y,\$32,Z + 6 000c 02E88543 FUN \$232,\$133,Z + 7 0010 03170C49 FEQL X,Y,\$73 + 8 0014 161F0CE9 FREM \$31,Y,\$233 + 9 0018 061726D4 FSUB X,\$38,\$212 + 10 001c 1304AFB5 FEQLE \$4,\$175,\$181 + 11 X IS \$23 + 12 Y IS \$12 + 13 Z IS \$67 +GAS for MMIX .*/reg-op\.s page 2 + + +DEFINED SYMBOLS +.*/reg-op\.s:3 \.text:0000000000000000 Main + \*REG\*:0000000000000017 X + \*REG\*:000000000000000c Y + \*REG\*:0000000000000043 Z + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/reg-op.s b/gas/testsuite/gas/mmix/reg-op.s new file mode 100644 index 0000000..0090cd9 --- /dev/null +++ b/gas/testsuite/gas/mmix/reg-op.s @@ -0,0 +1,13 @@ +# All-registers, '$'-type operands. +# +Main FMUL X,Y,Z + FCMP $32,Y,Z + FADD Y,$32,Z + FUN $232,$133,Z + FEQL X,Y,$73 + FREM $31,Y,$233 + FSUB X,$38,$212 + FEQLE $4,$175,$181 +X IS $23 +Y IS $12 +Z IS $67 diff --git a/gas/testsuite/gas/mmix/reg3-op-r.d b/gas/testsuite/gas/mmix/reg3-op-r.d new file mode 100644 index 0000000..98944ca --- /dev/null +++ b/gas/testsuite/gas/mmix/reg3-op-r.d @@ -0,0 +1,32 @@ +# objdump: -dr +# as: -linkrelax +# source: reg3-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 18170c43 mul \$23,\$12,\$67 + 4: 20200c43 add \$32,\$12,\$67 + 8: 2a0c2043 4addu \$12,\$32,\$67 + c: 2ce88543 8addu \$232,\$133,\$67 + 10: 2e170c49 16addu \$23,\$12,\$73 + 14: 3e1f0ce9 sru \$31,\$12,\$233 + 18: 601726d4 csn \$23,\$38,\$212 + 1c: 7c04afb5 zsnp \$4,\$175,\$181 + 20: 1b170cb0 mulu \$23,\$12,176 + 24: 39200cb0 sl \$32,\$12,176 + 28: 330c20b0 cmpu \$12,\$32,176 + 2c: 29e885b0 2addu \$232,\$133,176 + 30: df170ccb mxor \$23,\$12,203 + 34: c11f0cd5 or \$31,\$12,213 + 38: cd1726d3 nand \$23,\$38,211 + 3c: d304afa1 wdif \$4,\$175,161 + 40: db170c00 sadd \$23,\$12,0 + 44: df200c00 mxor \$32,\$12,0 + 48: c30c2000 orn \$12,\$32,0 + 4c: cbe88500 andn \$232,\$133,0 + 50: 2f170c00 16addu \$23,\$12,0 + 54: 391f0c00 sl \$31,\$12,0 + 58: 23172600 addu \$23,\$38,0 + 5c: 3104af00 cmp \$4,\$175,0 diff --git a/gas/testsuite/gas/mmix/reg3-op.d b/gas/testsuite/gas/mmix/reg3-op.d new file mode 100644 index 0000000..d11a6cb --- /dev/null +++ b/gas/testsuite/gas/mmix/reg3-op.d @@ -0,0 +1,30 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 18170c43 mul \$23,\$12,\$67 + 4: 20200c43 add \$32,\$12,\$67 + 8: 2a0c2043 4addu \$12,\$32,\$67 + c: 2ce88543 8addu \$232,\$133,\$67 + 10: 2e170c49 16addu \$23,\$12,\$73 + 14: 3e1f0ce9 sru \$31,\$12,\$233 + 18: 601726d4 csn \$23,\$38,\$212 + 1c: 7c04afb5 zsnp \$4,\$175,\$181 + 20: 1b170cb0 mulu \$23,\$12,176 + 24: 39200cb0 sl \$32,\$12,176 + 28: 330c20b0 cmpu \$12,\$32,176 + 2c: 29e885b0 2addu \$232,\$133,176 + 30: df170ccb mxor \$23,\$12,203 + 34: c11f0cd5 or \$31,\$12,213 + 38: cd1726d3 nand \$23,\$38,211 + 3c: d304afa1 wdif \$4,\$175,161 + 40: db170c00 sadd \$23,\$12,0 + 44: df200c00 mxor \$32,\$12,0 + 48: c30c2000 orn \$12,\$32,0 + 4c: cbe88500 andn \$232,\$133,0 + 50: 2f170c00 16addu \$23,\$12,0 + 54: 391f0c00 sl \$31,\$12,0 + 58: 23172600 addu \$23,\$38,0 + 5c: 3104af00 cmp \$4,\$175,0 diff --git a/gas/testsuite/gas/mmix/reg3-op.l b/gas/testsuite/gas/mmix/reg3-op.l new file mode 100644 index 0000000..e826d73 --- /dev/null +++ b/gas/testsuite/gas/mmix/reg3-op.l @@ -0,0 +1,46 @@ +GAS for MMIX .*/reg3-op\.s page 1 + + + 1 #.* + 2 #.* + 3 0000 18170C43 Main MUL X,Y,Z + 4 0004 20200C43 ADD \$32,Y,Z + 5 0008 2A0C2043 4ADDU Y,\$32,Z + 6 000c 2CE88543 8ADDU \$232,\$133,Z + 7 0010 2E170C49 16ADDU X,Y,\$73 + 8 0014 3E1F0CE9 SRU \$31,Y,\$233 + 9 0018 601726D4 CSN X,\$38,\$212 + 10 001c 7C04AFB5 ZSNP \$4,\$175,\$181 + 11 + 12 0020 1B170CB0 MULU X,Y,Z0 + 13 0024 39200CB0 SL \$32,Y,Z0 + 14 0028 330C20B0 CMPU Y,\$32,Z0 + 15 002c 29E885B0 2ADDU \$232,\$133,Z0 + 16 0030 DF170CCB MXOR X,Y,203 + 17 0034 C11F0CD5 OR \$31,Y,213 + 18 0038 CD1726D3 NAND X,\$38,211 + 19 003c D304AFA1 WDIF \$4,\$175,161 + 20 + 21 0040 DB170C00 SADD X,Y,0 + 22 0044 DF200C00 MXOR \$32,Y,0 + 23 0048 C30C2000 ORN Y,\$32,0 + 24 004c CBE88500 ANDN \$232,\$133,0 + 25 0050 2F170C00 16ADDU X,Y,0 + 26 0054 391F0C00 SL \$31,Y,0 + 27 0058 23172600 ADDU X,\$38,0 + 28 005c 3104AF00 CMP \$4,\$175,0 + 29 X IS \$23 + 30 Y IS \$12 + 31 Z IS \$67 + 32 Z0 IS 176 +GAS for MMIX .*/reg3-op\.s page 2 + + +DEFINED SYMBOLS +.*/reg3-op\.s:3 \.text:0000000000000000 Main + \*REG\*:0000000000000017 X + \*REG\*:000000000000000c Y + \*REG\*:0000000000000043 Z + \*ABS\*:00000000000000b0 Z0 + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/reg3-op.s b/gas/testsuite/gas/mmix/reg3-op.s new file mode 100644 index 0000000..9803e30 --- /dev/null +++ b/gas/testsuite/gas/mmix/reg3-op.s @@ -0,0 +1,32 @@ +# All-registers, '3'-type operands; third operand is +# register or constant. +Main MUL X,Y,Z + ADD $32,Y,Z + 4ADDU Y,$32,Z + 8ADDU $232,$133,Z + 16ADDU X,Y,$73 + SRU $31,Y,$233 + CSN X,$38,$212 + ZSNP $4,$175,$181 + + MULU X,Y,Z0 + SL $32,Y,Z0 + CMPU Y,$32,Z0 + 2ADDU $232,$133,Z0 + MXOR X,Y,203 + OR $31,Y,213 + NAND X,$38,211 + WDIF $4,$175,161 + + SADD X,Y,0 + MXOR $32,Y,0 + ORN Y,$32,0 + ANDN $232,$133,0 + 16ADDU X,Y,0 + SL $31,Y,0 + ADDU X,$38,0 + CMP $4,$175,0 +X IS $23 +Y IS $12 +Z IS $67 +Z0 IS 176 diff --git a/gas/testsuite/gas/mmix/regt-op-r.d b/gas/testsuite/gas/mmix/regt-op-r.d new file mode 100644 index 0000000..4a41f59 --- /dev/null +++ b/gas/testsuite/gas/mmix/regt-op-r.d @@ -0,0 +1,136 @@ +# objdump: -dr +# as: -linkrelax +# source: regt-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 22170c43 addu \$23,\$12,\$67 + 4: 88200c43 ldt \$32,\$12,\$67 + 8: 820c2043 ldbu \$12,\$32,\$67 + c: 8ae88543 ldtu \$232,\$133,\$67 + 10: 8c170c49 ldo \$23,\$12,\$73 + 14: 8e1f0ce9 ldou \$31,\$12,\$233 + 18: 841726d4 ldw \$23,\$38,\$212 + 1c: 8604afb5 ldwu \$4,\$175,\$181 + 20: 81170cb0 ldb \$23,\$12,176 + 24: 91200cb0 ldsf \$32,\$12,176 + 28: 990c20b0 ldvts \$12,\$32,176 + 2c: 97e885b0 ldunc \$232,\$133,176 + 30: b3170ccb stht \$23,\$12,203 + 34: 931f0cd5 ldht \$31,\$12,213 + 38: 951726d3 cswap \$23,\$38,211 + 3c: 9f04afa1 go \$4,\$175,161 + 40: 23170c00 addu \$23,\$12,0 + 44: 81170c00 ldb \$23,\$12,0 + 48: 89170c00 ldt \$23,\$12,0 + 4c: 83170c00 ldbu \$23,\$12,0 + 50: 8b170c00 ldtu \$23,\$12,0 + 54: 8d170c00 ldo \$23,\$12,0 + 58: 8f170c00 ldou \$23,\$12,0 + 5c: 85170c00 ldw \$23,\$12,0 + 60: 87170c00 ldwu \$23,\$12,0 + 64: 91170c00 ldsf \$23,\$12,0 + 68: 93170c00 ldht \$23,\$12,0 + 6c: 95170c00 cswap \$23,\$12,0 + 70: 97170c00 ldunc \$23,\$12,0 + 74: 99170c00 ldvts \$23,\$12,0 + 78: 9f170c00 go \$23,\$12,0 + 7c: a1170c00 stb \$23,\$12,0 + 80: a9170c00 stt \$23,\$12,0 + 84: a3170c00 stbu \$23,\$12,0 + 88: ab170c00 sttu \$23,\$12,0 + 8c: ad170c00 sto \$23,\$12,0 + 90: af170c00 stou \$23,\$12,0 + 94: a5170c00 stw \$23,\$12,0 + 98: a7170c00 stwu \$23,\$12,0 + 9c: b1170c00 stsf \$23,\$12,0 + a0: b3170c00 stht \$23,\$12,0 + a4: b7170c00 stunc \$23,\$12,0 + a8: 23290c00 addu \$41,\$12,0 + ac: 81790c00 ldb \$121,\$12,0 + b0: 894e0c00 ldt \$78,\$12,0 + b4: 837f0c00 ldbu \$127,\$12,0 + b8: 8b310c00 ldtu \$49,\$12,0 + bc: 8d340c00 ldo \$52,\$12,0 + c0: 8f2a0c00 ldou \$42,\$12,0 + c4: 857b0c00 ldw \$123,\$12,0 + c8: 87ea0c00 ldwu \$234,\$12,0 + cc: 91290c00 ldsf \$41,\$12,0 + d0: 93590c00 ldht \$89,\$12,0 + d4: 955d0c00 cswap \$93,\$12,0 + d8: 972a0c00 ldunc \$42,\$12,0 + dc: 99210c00 ldvts \$33,\$12,0 + e0: 9f3b0c00 go \$59,\$12,0 + e4: a13b0c00 stb \$59,\$12,0 + e8: a93b0c00 stt \$59,\$12,0 + ec: a33b0c00 stbu \$59,\$12,0 + f0: ab3b0c00 sttu \$59,\$12,0 + f4: ad3b0c00 sto \$59,\$12,0 + f8: af3b0c00 stou \$59,\$12,0 + fc: a53b0c00 stw \$59,\$12,0 + 100: a73b0c00 stwu \$59,\$12,0 + 104: b13b0c00 stsf \$59,\$12,0 + 108: b33b0c00 stht \$59,\$12,0 + 10c: b73b0c00 stunc \$59,\$12,0 + 110: 23171b00 addu \$23,\$27,0 + 114: 81173000 ldb \$23,\$48,0 + 118: 8917a800 ldt \$23,\$168,0 + 11c: 8317ea00 ldbu \$23,\$234,0 + 120: 8b17b000 ldtu \$23,\$176,0 + 124: 8d171d00 ldo \$23,\$29,0 + 128: 8f17de00 ldou \$23,\$222,0 + 12c: 8517de00 ldw \$23,\$222,0 + 130: 8717de00 ldwu \$23,\$222,0 + 134: 9117de00 ldsf \$23,\$222,0 + 138: 9317de00 ldht \$23,\$222,0 + 13c: 9517de00 cswap \$23,\$222,0 + 140: 9717de00 ldunc \$23,\$222,0 + 144: 9917de00 ldvts \$23,\$222,0 + 148: 9f17de00 go \$23,\$222,0 + 14c: a117de00 stb \$23,\$222,0 + 150: a917de00 stt \$23,\$222,0 + 154: a317de00 stbu \$23,\$222,0 + 158: ab17de00 sttu \$23,\$222,0 + 15c: ad17de00 sto \$23,\$222,0 + 160: af17de00 stou \$23,\$222,0 + 164: a517de00 stw \$23,\$222,0 + 168: a717de00 stwu \$23,\$222,0 + 16c: b117de00 stsf \$23,\$222,0 + 170: b317de00 stht \$23,\$222,0 + 174: b717de00 stunc \$23,\$222,0 + 178: 23dfdb00 addu \$223,\$219,0 + 17c: 81dfef00 ldb \$223,\$239,0 + 180: 89dfef00 ldt \$223,\$239,0 + 184: 83df1d00 ldbu \$223,\$29,0 + 188: 8bdfef00 ldtu \$223,\$239,0 + 18c: 8d17ef00 ldo \$23,\$239,0 + 190: 8fdfef00 ldou \$223,\$239,0 + 194: 85dfd100 ldw \$223,\$209,0 + 198: 877bef00 ldwu \$123,\$239,0 + 19c: 91dfef00 ldsf \$223,\$239,0 + 1a0: 93df1d00 ldht \$223,\$29,0 + 1a4: 95dfef00 cswap \$223,\$239,0 + 1a8: 977bef00 ldunc \$123,\$239,0 + 1ac: 99dfef00 ldvts \$223,\$239,0 + 1b0: 9fdfef00 go \$223,\$239,0 + 1b4: a1dfef00 stb \$223,\$239,0 + 1b8: a9dff900 stt \$223,\$249,0 + 1bc: a3cbef00 stbu \$203,\$239,0 + 1c0: ab49ef00 sttu \$73,\$239,0 + 1c4: addfef00 sto \$223,\$239,0 + 1c8: afdf2700 stou \$223,\$39,0 + 1cc: a5dfef00 stw \$223,\$239,0 + 1d0: a7e9ef00 stwu \$233,\$239,0 + 1d4: b1dfef00 stsf \$223,\$239,0 + 1d8: b3df1700 stht \$223,\$23,0 + 1dc: b7dfef00 stunc \$223,\$239,0 + 1e0: 9f170c00 go \$23,\$12,0 + 1e4: 99200c00 ldvts \$32,\$12,0 + 1e8: a10c2000 stb \$12,\$32,0 + 1ec: b7e88500 stunc \$232,\$133,0 + 1f0: a7170c00 stwu \$23,\$12,0 + 1f4: ad1f0c00 sto \$31,\$12,0 + 1f8: 9f172600 go \$23,\$38,0 + 1fc: 9504af00 cswap \$4,\$175,0 diff --git a/gas/testsuite/gas/mmix/regt-op.d b/gas/testsuite/gas/mmix/regt-op.d new file mode 100644 index 0000000..95ea3db --- /dev/null +++ b/gas/testsuite/gas/mmix/regt-op.d @@ -0,0 +1,134 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 22170c43 addu \$23,\$12,\$67 + 4: 88200c43 ldt \$32,\$12,\$67 + 8: 820c2043 ldbu \$12,\$32,\$67 + c: 8ae88543 ldtu \$232,\$133,\$67 + 10: 8c170c49 ldo \$23,\$12,\$73 + 14: 8e1f0ce9 ldou \$31,\$12,\$233 + 18: 841726d4 ldw \$23,\$38,\$212 + 1c: 8604afb5 ldwu \$4,\$175,\$181 + 20: 81170cb0 ldb \$23,\$12,176 + 24: 91200cb0 ldsf \$32,\$12,176 + 28: 990c20b0 ldvts \$12,\$32,176 + 2c: 97e885b0 ldunc \$232,\$133,176 + 30: b3170ccb stht \$23,\$12,203 + 34: 931f0cd5 ldht \$31,\$12,213 + 38: 951726d3 cswap \$23,\$38,211 + 3c: 9f04afa1 go \$4,\$175,161 + 40: 23170c00 addu \$23,\$12,0 + 44: 81170c00 ldb \$23,\$12,0 + 48: 89170c00 ldt \$23,\$12,0 + 4c: 83170c00 ldbu \$23,\$12,0 + 50: 8b170c00 ldtu \$23,\$12,0 + 54: 8d170c00 ldo \$23,\$12,0 + 58: 8f170c00 ldou \$23,\$12,0 + 5c: 85170c00 ldw \$23,\$12,0 + 60: 87170c00 ldwu \$23,\$12,0 + 64: 91170c00 ldsf \$23,\$12,0 + 68: 93170c00 ldht \$23,\$12,0 + 6c: 95170c00 cswap \$23,\$12,0 + 70: 97170c00 ldunc \$23,\$12,0 + 74: 99170c00 ldvts \$23,\$12,0 + 78: 9f170c00 go \$23,\$12,0 + 7c: a1170c00 stb \$23,\$12,0 + 80: a9170c00 stt \$23,\$12,0 + 84: a3170c00 stbu \$23,\$12,0 + 88: ab170c00 sttu \$23,\$12,0 + 8c: ad170c00 sto \$23,\$12,0 + 90: af170c00 stou \$23,\$12,0 + 94: a5170c00 stw \$23,\$12,0 + 98: a7170c00 stwu \$23,\$12,0 + 9c: b1170c00 stsf \$23,\$12,0 + a0: b3170c00 stht \$23,\$12,0 + a4: b7170c00 stunc \$23,\$12,0 + a8: 23290c00 addu \$41,\$12,0 + ac: 81790c00 ldb \$121,\$12,0 + b0: 894e0c00 ldt \$78,\$12,0 + b4: 837f0c00 ldbu \$127,\$12,0 + b8: 8b310c00 ldtu \$49,\$12,0 + bc: 8d340c00 ldo \$52,\$12,0 + c0: 8f2a0c00 ldou \$42,\$12,0 + c4: 857b0c00 ldw \$123,\$12,0 + c8: 87ea0c00 ldwu \$234,\$12,0 + cc: 91290c00 ldsf \$41,\$12,0 + d0: 93590c00 ldht \$89,\$12,0 + d4: 955d0c00 cswap \$93,\$12,0 + d8: 972a0c00 ldunc \$42,\$12,0 + dc: 99210c00 ldvts \$33,\$12,0 + e0: 9f3b0c00 go \$59,\$12,0 + e4: a13b0c00 stb \$59,\$12,0 + e8: a93b0c00 stt \$59,\$12,0 + ec: a33b0c00 stbu \$59,\$12,0 + f0: ab3b0c00 sttu \$59,\$12,0 + f4: ad3b0c00 sto \$59,\$12,0 + f8: af3b0c00 stou \$59,\$12,0 + fc: a53b0c00 stw \$59,\$12,0 + 100: a73b0c00 stwu \$59,\$12,0 + 104: b13b0c00 stsf \$59,\$12,0 + 108: b33b0c00 stht \$59,\$12,0 + 10c: b73b0c00 stunc \$59,\$12,0 + 110: 23171b00 addu \$23,\$27,0 + 114: 81173000 ldb \$23,\$48,0 + 118: 8917a800 ldt \$23,\$168,0 + 11c: 8317ea00 ldbu \$23,\$234,0 + 120: 8b17b000 ldtu \$23,\$176,0 + 124: 8d171d00 ldo \$23,\$29,0 + 128: 8f17de00 ldou \$23,\$222,0 + 12c: 8517de00 ldw \$23,\$222,0 + 130: 8717de00 ldwu \$23,\$222,0 + 134: 9117de00 ldsf \$23,\$222,0 + 138: 9317de00 ldht \$23,\$222,0 + 13c: 9517de00 cswap \$23,\$222,0 + 140: 9717de00 ldunc \$23,\$222,0 + 144: 9917de00 ldvts \$23,\$222,0 + 148: 9f17de00 go \$23,\$222,0 + 14c: a117de00 stb \$23,\$222,0 + 150: a917de00 stt \$23,\$222,0 + 154: a317de00 stbu \$23,\$222,0 + 158: ab17de00 sttu \$23,\$222,0 + 15c: ad17de00 sto \$23,\$222,0 + 160: af17de00 stou \$23,\$222,0 + 164: a517de00 stw \$23,\$222,0 + 168: a717de00 stwu \$23,\$222,0 + 16c: b117de00 stsf \$23,\$222,0 + 170: b317de00 stht \$23,\$222,0 + 174: b717de00 stunc \$23,\$222,0 + 178: 23dfdb00 addu \$223,\$219,0 + 17c: 81dfef00 ldb \$223,\$239,0 + 180: 89dfef00 ldt \$223,\$239,0 + 184: 83df1d00 ldbu \$223,\$29,0 + 188: 8bdfef00 ldtu \$223,\$239,0 + 18c: 8d17ef00 ldo \$23,\$239,0 + 190: 8fdfef00 ldou \$223,\$239,0 + 194: 85dfd100 ldw \$223,\$209,0 + 198: 877bef00 ldwu \$123,\$239,0 + 19c: 91dfef00 ldsf \$223,\$239,0 + 1a0: 93df1d00 ldht \$223,\$29,0 + 1a4: 95dfef00 cswap \$223,\$239,0 + 1a8: 977bef00 ldunc \$123,\$239,0 + 1ac: 99dfef00 ldvts \$223,\$239,0 + 1b0: 9fdfef00 go \$223,\$239,0 + 1b4: a1dfef00 stb \$223,\$239,0 + 1b8: a9dff900 stt \$223,\$249,0 + 1bc: a3cbef00 stbu \$203,\$239,0 + 1c0: ab49ef00 sttu \$73,\$239,0 + 1c4: addfef00 sto \$223,\$239,0 + 1c8: afdf2700 stou \$223,\$39,0 + 1cc: a5dfef00 stw \$223,\$239,0 + 1d0: a7e9ef00 stwu \$233,\$239,0 + 1d4: b1dfef00 stsf \$223,\$239,0 + 1d8: b3df1700 stht \$223,\$23,0 + 1dc: b7dfef00 stunc \$223,\$239,0 + 1e0: 9f170c00 go \$23,\$12,0 + 1e4: 99200c00 ldvts \$32,\$12,0 + 1e8: a10c2000 stb \$12,\$32,0 + 1ec: b7e88500 stunc \$232,\$133,0 + 1f0: a7170c00 stwu \$23,\$12,0 + 1f4: ad1f0c00 sto \$31,\$12,0 + 1f8: 9f172600 go \$23,\$38,0 + 1fc: 9504af00 cswap \$4,\$175,0 diff --git a/gas/testsuite/gas/mmix/regt-op.l b/gas/testsuite/gas/mmix/regt-op.l new file mode 100644 index 0000000..843d3fe --- /dev/null +++ b/gas/testsuite/gas/mmix/regt-op.l @@ -0,0 +1,160 @@ +GAS for MMIX .*/regt-op\.s page 1 + + + 1 #.* + 2 #.* + 3 0000 22170C43 Main LDA X,Y,Z + 4 0004 88200C43 LDT \$32,Y,Z + 5 0008 820C2043 LDBU Y,\$32,Z + 6 000c 8AE88543 LDTU \$232,\$133,Z + 7 0010 8C170C49 LDO X,Y,\$73 + 8 0014 8E1F0CE9 LDOU \$31,Y,\$233 + 9 0018 841726D4 LDW X,\$38,\$212 + 10 001c 8604AFB5 LDWU \$4,\$175,\$181 + 11 + 12 0020 81170CB0 LDB X,Y,Z0 + 13 0024 91200CB0 LDSF \$32,Y,Z0 + 14 0028 990C20B0 LDVTS Y,\$32,Z0 + 15 002c 97E885B0 LDUNC \$232,\$133,Z0 + 16 0030 B3170CCB STHT X,Y,203 + 17 0034 931F0CD5 LDHT \$31,Y,213 + 18 0038 951726D3 CSWAP X,\$38,211 + 19 003c 9F04AFA1 GO \$4,\$175,161 + 20 + 21 0040 23170C00 LDA X,Y + 22 0044 81170C00 LDB X,Y + 23 0048 89170C00 LDT X,Y + 24 004c 83170C00 LDBU X,Y + 25 0050 8B170C00 LDTU X,Y + 26 0054 8D170C00 LDO X,Y + 27 0058 8F170C00 LDOU X,Y + 28 005c 85170C00 LDW X,Y + 29 0060 87170C00 LDWU X,Y + 30 0064 91170C00 LDSF X,Y + 31 0068 93170C00 LDHT X,Y + 32 006c 95170C00 CSWAP X,Y + 33 0070 97170C00 LDUNC X,Y + 34 0074 99170C00 LDVTS X,Y + 35 0078 9F170C00 GO X,Y + 36 007c A1170C00 STB X,Y + 37 0080 A9170C00 STT X,Y + 38 0084 A3170C00 STBU X,Y + 39 0088 AB170C00 STTU X,Y + 40 008c AD170C00 STO X,Y + 41 0090 AF170C00 STOU X,Y + 42 0094 A5170C00 STW X,Y + 43 0098 A7170C00 STWU X,Y + 44 009c B1170C00 STSF X,Y + 45 00a0 B3170C00 STHT X,Y + 46 00a4 B7170C00 STUNC X,Y + 47 + 48 00a8 23290C00 LDA \$41,Y + 49 00ac 81790C00 LDB \$121,Y + 50 00b0 894E0C00 LDT \$78,Y + 51 00b4 837F0C00 LDBU \$127,Y + 52 00b8 8B310C00 LDTU \$49,Y + 53 00bc 8D340C00 LDO \$52,Y + 54 00c0 8F2A0C00 LDOU \$42,Y + 55 00c4 857B0C00 LDW \$123,Y + 56 00c8 87EA0C00 LDWU \$234,Y + 57 00cc 91290C00 LDSF \$41,Y +GAS for MMIX .*/regt-op\.s page 2 + + + 58 00d0 93590C00 LDHT \$89,Y + 59 00d4 955D0C00 CSWAP \$93,Y + 60 00d8 972A0C00 LDUNC \$42,Y + 61 00dc 99210C00 LDVTS \$33,Y + 62 00e0 9F3B0C00 GO \$59,Y + 63 00e4 A13B0C00 STB \$59,Y + 64 00e8 A93B0C00 STT \$59,Y + 65 00ec A33B0C00 STBU \$59,Y + 66 00f0 AB3B0C00 STTU \$59,Y + 67 00f4 AD3B0C00 STO \$59,Y + 68 00f8 AF3B0C00 STOU \$59,Y + 69 00fc A53B0C00 STW \$59,Y + 70 0100 A73B0C00 STWU \$59,Y + 71 0104 B13B0C00 STSF \$59,Y + 72 0108 B33B0C00 STHT \$59,Y + 73 010c B73B0C00 STUNC \$59,Y + 74 + 75 0110 23171B00 LDA X,\$27 + 76 0114 81173000 LDB X,\$48 + 77 0118 8917A800 LDT X,\$168 + 78 011c 8317EA00 LDBU X,\$234 + 79 0120 8B17B000 LDTU X,\$176 + 80 0124 8D171D00 LDO X,\$29 + 81 0128 8F17DE00 LDOU X,\$222 + 82 012c 8517DE00 LDW X,\$222 + 83 0130 8717DE00 LDWU X,\$222 + 84 0134 9117DE00 LDSF X,\$222 + 85 0138 9317DE00 LDHT X,\$222 + 86 013c 9517DE00 CSWAP X,\$222 + 87 0140 9717DE00 LDUNC X,\$222 + 88 0144 9917DE00 LDVTS X,\$222 + 89 0148 9F17DE00 GO X,\$222 + 90 014c A117DE00 STB X,\$222 + 91 0150 A917DE00 STT X,\$222 + 92 0154 A317DE00 STBU X,\$222 + 93 0158 AB17DE00 STTU X,\$222 + 94 015c AD17DE00 STO X,\$222 + 95 0160 AF17DE00 STOU X,\$222 + 96 0164 A517DE00 STW X,\$222 + 97 0168 A717DE00 STWU X,\$222 + 98 016c B117DE00 STSF X,\$222 + 99 0170 B317DE00 STHT X,\$222 + 100 0174 B717DE00 STUNC X,\$222 + 101 + 102 0178 23DFDB00 LDA \$223,\$219 + 103 017c 81DFEF00 LDB \$223,\$239 + 104 0180 89DFEF00 LDT \$223,\$239 + 105 0184 83DF1D00 LDBU \$223,\$29 + 106 0188 8BDFEF00 LDTU \$223,\$239 + 107 018c 8D17EF00 LDO \$23,\$239 + 108 0190 8FDFEF00 LDOU \$223,\$239 + 109 0194 85DFD100 LDW \$223,\$209 + 110 0198 877BEF00 LDWU \$123,\$239 + 111 019c 91DFEF00 LDSF \$223,\$239 + 112 01a0 93DF1D00 LDHT \$223,\$29 + 113 01a4 95DFEF00 CSWAP \$223,\$239 + 114 01a8 977BEF00 LDUNC \$123,\$239 +GAS for MMIX .*/regt-op\.s page 3 + + + 115 01ac 99DFEF00 LDVTS \$223,\$239 + 116 01b0 9FDFEF00 GO \$223,\$239 + 117 01b4 A1DFEF00 STB \$223,\$239 + 118 01b8 A9DFF900 STT \$223,\$249 + 119 01bc A3CBEF00 STBU \$203,\$239 + 120 01c0 AB49EF00 STTU \$73,\$239 + 121 01c4 ADDFEF00 STO \$223,\$239 + 122 01c8 AFDF2700 STOU \$223,\$39 + 123 01cc A5DFEF00 STW \$223,\$239 + 124 01d0 A7E9EF00 STWU \$233,\$239 + 125 01d4 B1DFEF00 STSF \$223,\$239 + 126 01d8 B3DF1700 STHT \$223,\$23 + 127 01dc B7DFEF00 STUNC \$223,\$239 + 128 + 129 01e0 9F170C00 GO X,Y,0 + 130 01e4 99200C00 LDVTS \$32,Y,0 + 131 01e8 A10C2000 STB Y,\$32,0 + 132 01ec B7E88500 STUNC \$232,\$133,0 + 133 01f0 A7170C00 STWU X,Y,0 + 134 01f4 AD1F0C00 STO \$31,Y,0 + 135 01f8 9F172600 GO X,\$38,0 + 136 01fc 9504AF00 CSWAP \$4,\$175,0 + 137 X IS \$23 + 138 Y IS \$12 + 139 Z IS \$67 + 140 Z0 IS 176 +GAS for MMIX .*/regt-op\.s page 4 + + +DEFINED SYMBOLS +.*/regt-op\.s:3 \.text:0000000000000000 Main + \*REG\*:0000000000000017 X + \*REG\*:000000000000000c Y + \*REG\*:0000000000000043 Z + \*ABS\*:00000000000000b0 Z0 + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/regt-op.s b/gas/testsuite/gas/mmix/regt-op.s new file mode 100644 index 0000000..57ecc0f --- /dev/null +++ b/gas/testsuite/gas/mmix/regt-op.s @@ -0,0 +1,140 @@ +# All-registers, 'T'-type operands; optional third operand is +# register or constant. +Main LDA X,Y,Z + LDT $32,Y,Z + LDBU Y,$32,Z + LDTU $232,$133,Z + LDO X,Y,$73 + LDOU $31,Y,$233 + LDW X,$38,$212 + LDWU $4,$175,$181 + + LDB X,Y,Z0 + LDSF $32,Y,Z0 + LDVTS Y,$32,Z0 + LDUNC $232,$133,Z0 + STHT X,Y,203 + LDHT $31,Y,213 + CSWAP X,$38,211 + GO $4,$175,161 + + LDA X,Y + LDB X,Y + LDT X,Y + LDBU X,Y + LDTU X,Y + LDO X,Y + LDOU X,Y + LDW X,Y + LDWU X,Y + LDSF X,Y + LDHT X,Y + CSWAP X,Y + LDUNC X,Y + LDVTS X,Y + GO X,Y + STB X,Y + STT X,Y + STBU X,Y + STTU X,Y + STO X,Y + STOU X,Y + STW X,Y + STWU X,Y + STSF X,Y + STHT X,Y + STUNC X,Y + + LDA $41,Y + LDB $121,Y + LDT $78,Y + LDBU $127,Y + LDTU $49,Y + LDO $52,Y + LDOU $42,Y + LDW $123,Y + LDWU $234,Y + LDSF $41,Y + LDHT $89,Y + CSWAP $93,Y + LDUNC $42,Y + LDVTS $33,Y + GO $59,Y + STB $59,Y + STT $59,Y + STBU $59,Y + STTU $59,Y + STO $59,Y + STOU $59,Y + STW $59,Y + STWU $59,Y + STSF $59,Y + STHT $59,Y + STUNC $59,Y + + LDA X,$27 + LDB X,$48 + LDT X,$168 + LDBU X,$234 + LDTU X,$176 + LDO X,$29 + LDOU X,$222 + LDW X,$222 + LDWU X,$222 + LDSF X,$222 + LDHT X,$222 + CSWAP X,$222 + LDUNC X,$222 + LDVTS X,$222 + GO X,$222 + STB X,$222 + STT X,$222 + STBU X,$222 + STTU X,$222 + STO X,$222 + STOU X,$222 + STW X,$222 + STWU X,$222 + STSF X,$222 + STHT X,$222 + STUNC X,$222 + + LDA $223,$219 + LDB $223,$239 + LDT $223,$239 + LDBU $223,$29 + LDTU $223,$239 + LDO $23,$239 + LDOU $223,$239 + LDW $223,$209 + LDWU $123,$239 + LDSF $223,$239 + LDHT $223,$29 + CSWAP $223,$239 + LDUNC $123,$239 + LDVTS $223,$239 + GO $223,$239 + STB $223,$239 + STT $223,$249 + STBU $203,$239 + STTU $73,$239 + STO $223,$239 + STOU $223,$39 + STW $223,$239 + STWU $233,$239 + STSF $223,$239 + STHT $223,$23 + STUNC $223,$239 + + GO X,Y,0 + LDVTS $32,Y,0 + STB Y,$32,0 + STUNC $232,$133,0 + STWU X,Y,0 + STO $31,Y,0 + GO X,$38,0 + CSWAP $4,$175,0 +X IS $23 +Y IS $12 +Z IS $67 +Z0 IS 176 diff --git a/gas/testsuite/gas/mmix/regx-op-r.d b/gas/testsuite/gas/mmix/regx-op-r.d new file mode 100644 index 0000000..5c174e1 --- /dev/null +++ b/gas/testsuite/gas/mmix/regx-op-r.d @@ -0,0 +1,36 @@ +# objdump: -dr +# as: -linkrelax +# source: regx-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 9a7b0c43 preld 123,\$12,\$67 + 4: 9c200c43 prego 32,\$12,\$67 + 8: b87b2043 syncd 123,\$32,\$67 + c: ba008543 prest 0,\$133,\$67 + 10: b47b0c49 stco 123,\$12,\$73 + 14: bc820ce9 syncid 130,\$12,\$233 + 18: 9a7b26d4 preld 123,\$38,\$212 + 1c: 9c01afb5 prego 1,\$175,\$181 + 20: b97b0cb0 syncd 123,\$12,176 + 24: bb200cb0 prest 32,\$12,176 + 28: b57b84b0 stco 123,\$132,176 + 2c: bde885b0 syncid 232,\$133,176 + 30: 9b7b0ccb preld 123,\$12,203 + 34: 9de70cd5 prego 231,\$12,213 + 38: b97b26d3 syncd 123,\$38,211 + 3c: bb04afa1 prest 4,\$175,161 + 40: b57b0c00 stco 123,\$12,0 + 44: bd170c00 syncid 23,\$12,0 + 48: 9b020c00 preld 2,\$12,0 + 4c: 9de88500 prego 232,\$133,0 + 50: b97b0c00 syncd 123,\$12,0 + 54: bb0d0c00 prest 13,\$12,0 + 58: b57b2600 stco 123,\$38,0 + 5c: bd04af00 syncid 4,\$175,0 + 60: 9b7b0c00 preld 123,\$12,0 + 64: 9d200c00 prego 32,\$12,0 + 68: b97b2000 syncd 123,\$32,0 + 6c: bbe88500 prest 232,\$133,0 diff --git a/gas/testsuite/gas/mmix/regx-op.d b/gas/testsuite/gas/mmix/regx-op.d new file mode 100644 index 0000000..c52eb04 --- /dev/null +++ b/gas/testsuite/gas/mmix/regx-op.d @@ -0,0 +1,34 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 9a7b0c43 preld 123,\$12,\$67 + 4: 9c200c43 prego 32,\$12,\$67 + 8: b87b2043 syncd 123,\$32,\$67 + c: ba008543 prest 0,\$133,\$67 + 10: b47b0c49 stco 123,\$12,\$73 + 14: bc820ce9 syncid 130,\$12,\$233 + 18: 9a7b26d4 preld 123,\$38,\$212 + 1c: 9c01afb5 prego 1,\$175,\$181 + 20: b97b0cb0 syncd 123,\$12,176 + 24: bb200cb0 prest 32,\$12,176 + 28: b57b84b0 stco 123,\$132,176 + 2c: bde885b0 syncid 232,\$133,176 + 30: 9b7b0ccb preld 123,\$12,203 + 34: 9de70cd5 prego 231,\$12,213 + 38: b97b26d3 syncd 123,\$38,211 + 3c: bb04afa1 prest 4,\$175,161 + 40: b57b0c00 stco 123,\$12,0 + 44: bd170c00 syncid 23,\$12,0 + 48: 9b020c00 preld 2,\$12,0 + 4c: 9de88500 prego 232,\$133,0 + 50: b97b0c00 syncd 123,\$12,0 + 54: bb0d0c00 prest 13,\$12,0 + 58: b57b2600 stco 123,\$38,0 + 5c: bd04af00 syncid 4,\$175,0 + 60: 9b7b0c00 preld 123,\$12,0 + 64: 9d200c00 prego 32,\$12,0 + 68: b97b2000 syncd 123,\$32,0 + 6c: bbe88500 prest 232,\$133,0 diff --git a/gas/testsuite/gas/mmix/regx-op.l b/gas/testsuite/gas/mmix/regx-op.l new file mode 100644 index 0000000..45a975d --- /dev/null +++ b/gas/testsuite/gas/mmix/regx-op.l @@ -0,0 +1,51 @@ +GAS for MMIX .*/regx-op\.s page 1 + + + 1 #.* + 2 #.* + 3 0000 9A7B0C43 Main PRELD X,Y,Z + 4 0004 9C200C43 PREGO 32,Y,Z + 5 0008 B87B2043 SYNCD X,\$32,Z + 6 000c BA008543 PREST 0,\$133,Z + 7 0010 B47B0C49 STCO X,Y,\$73 + 8 0014 BC820CE9 SYNCID 130,Y,\$233 + 9 0018 9A7B26D4 PRELD X,\$38,\$212 + 10 001c 9C01AFB5 PREGO 1,\$175,\$181 + 11 + 12 0020 B97B0CB0 SYNCD X,Y,Z0 + 13 0024 BB200CB0 PREST 32,Y,Z0 + 14 0028 B57B84B0 STCO X,\$132,Z0 + 15 002c BDE885B0 SYNCID 232,\$133,Z0 + 16 0030 9B7B0CCB PRELD X,Y,203 + 17 0034 9DE70CD5 PREGO 231,Y,213 + 18 0038 B97B26D3 SYNCD X,\$38,211 + 19 003c BB04AFA1 PREST 4,\$175,161 + 20 + 21 0040 B57B0C00 STCO X,Y,0 + 22 0044 BD170C00 SYNCID 23,Y,0 + 23 0048 9B020C00 PRELD 2,Y,0 + 24 004c 9DE88500 PREGO 232,\$133,0 + 25 0050 B97B0C00 SYNCD X,Y,0 + 26 0054 BB0D0C00 PREST 13,Y,0 + 27 0058 B57B2600 STCO X,\$38,0 + 28 005c BD04AF00 SYNCID 4,\$175,0 + 29 + 30 0060 9B7B0C00 PRELD X,Y + 31 0064 9D200C00 PREGO 32,Y + 32 0068 B97B2000 SYNCD X,\$32 + 33 006c BBE88500 PREST 232,\$133 + 34 X IS 123 + 35 Y IS \$12 + 36 Z IS \$67 + 37 Z0 IS 176 +GAS for MMIX .*/regx-op\.s page 2 + + +DEFINED SYMBOLS +.*/regx-op\.s:3 \.text:0000000000000000 Main + \*ABS\*:000000000000007b X + \*REG\*:000000000000000c Y + \*REG\*:0000000000000043 Z + \*ABS\*:00000000000000b0 Z0 + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/regx-op.s b/gas/testsuite/gas/mmix/regx-op.s new file mode 100644 index 0000000..1b8d776 --- /dev/null +++ b/gas/testsuite/gas/mmix/regx-op.s @@ -0,0 +1,37 @@ +# For insns where X is a constant: 'X'-type operands. +# +Main PRELD X,Y,Z + PREGO 32,Y,Z + SYNCD X,$32,Z + PREST 0,$133,Z + STCO X,Y,$73 + SYNCID 130,Y,$233 + PRELD X,$38,$212 + PREGO 1,$175,$181 + + SYNCD X,Y,Z0 + PREST 32,Y,Z0 + STCO X,$132,Z0 + SYNCID 232,$133,Z0 + PRELD X,Y,203 + PREGO 231,Y,213 + SYNCD X,$38,211 + PREST 4,$175,161 + + STCO X,Y,0 + SYNCID 23,Y,0 + PRELD 2,Y,0 + PREGO 232,$133,0 + SYNCD X,Y,0 + PREST 13,Y,0 + STCO X,$38,0 + SYNCID 4,$175,0 + + PRELD X,Y + PREGO 32,Y + SYNCD X,$32 + PREST 232,$133 +X IS 123 +Y IS $12 +Z IS $67 +Z0 IS 176 diff --git a/gas/testsuite/gas/mmix/regy-op-r.d b/gas/testsuite/gas/mmix/regy-op-r.d new file mode 100644 index 0000000..5d73bc2 --- /dev/null +++ b/gas/testsuite/gas/mmix/regy-op-r.d @@ -0,0 +1,36 @@ +# objdump: -dr +# as: -linkrelax +# source: regy-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 347b0c43 neg \$123,12,\$67 + 4: 36200c43 negu \$32,12,\$67 + 8: 347b2043 neg \$123,32,\$67 + c: 36008543 negu \$0,133,\$67 + 10: 347b0c49 neg \$123,12,\$73 + 14: 36820ce9 negu \$130,12,\$233 + 18: 347b26d4 neg \$123,38,\$212 + 1c: 3601afb5 negu \$1,175,\$181 + 20: 357b0cb0 neg \$123,12,176 + 24: 37200cb0 negu \$32,12,176 + 28: 357b84b0 neg \$123,132,176 + 2c: 37e885b0 negu \$232,133,176 + 30: 357b0ccb neg \$123,12,203 + 34: 37e70cd5 negu \$231,12,213 + 38: 357b26d3 neg \$123,38,211 + 3c: 3704afa1 negu \$4,175,161 + 40: 357b0c00 neg \$123,12,0 + 44: 37170c00 negu \$23,12,0 + 48: 35020c00 neg \$2,12,0 + 4c: 37e88500 negu \$232,133,0 + 50: 347b0043 neg \$123,0,\$67 + 54: 36200043 negu \$32,0,\$67 + 58: 357b0020 neg \$123,0,32 + 5c: 37e80085 negu \$232,0,133 + 60: 357b00b0 neg \$123,0,176 + 64: 372000b0 negu \$32,0,176 + 68: 347b0020 neg \$123,0,\$32 + 6c: 36e80085 negu \$232,0,\$133 diff --git a/gas/testsuite/gas/mmix/regy-op.d b/gas/testsuite/gas/mmix/regy-op.d new file mode 100644 index 0000000..5091e22 --- /dev/null +++ b/gas/testsuite/gas/mmix/regy-op.d @@ -0,0 +1,34 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 347b0c43 neg \$123,12,\$67 + 4: 36200c43 negu \$32,12,\$67 + 8: 347b2043 neg \$123,32,\$67 + c: 36008543 negu \$0,133,\$67 + 10: 347b0c49 neg \$123,12,\$73 + 14: 36820ce9 negu \$130,12,\$233 + 18: 347b26d4 neg \$123,38,\$212 + 1c: 3601afb5 negu \$1,175,\$181 + 20: 357b0cb0 neg \$123,12,176 + 24: 37200cb0 negu \$32,12,176 + 28: 357b84b0 neg \$123,132,176 + 2c: 37e885b0 negu \$232,133,176 + 30: 357b0ccb neg \$123,12,203 + 34: 37e70cd5 negu \$231,12,213 + 38: 357b26d3 neg \$123,38,211 + 3c: 3704afa1 negu \$4,175,161 + 40: 357b0c00 neg \$123,12,0 + 44: 37170c00 negu \$23,12,0 + 48: 35020c00 neg \$2,12,0 + 4c: 37e88500 negu \$232,133,0 + 50: 347b0043 neg \$123,0,\$67 + 54: 36200043 negu \$32,0,\$67 + 58: 357b0020 neg \$123,0,32 + 5c: 37e80085 negu \$232,0,133 + 60: 357b00b0 neg \$123,0,176 + 64: 372000b0 negu \$32,0,176 + 68: 347b0020 neg \$123,0,\$32 + 6c: 36e80085 negu \$232,0,\$133 diff --git a/gas/testsuite/gas/mmix/regy-op.l b/gas/testsuite/gas/mmix/regy-op.l new file mode 100644 index 0000000..ee97929 --- /dev/null +++ b/gas/testsuite/gas/mmix/regy-op.l @@ -0,0 +1,51 @@ +GAS for MMIX .*/regy-op\.s page 1 + + + 1 #.* + 2 #.* + 3 0000 347B0C43 Main NEG X,Y,Z + 4 0004 36200C43 NEGU \$32,Y,Z + 5 0008 347B2043 NEG X,32,Z + 6 000c 36008543 NEGU \$0,133,Z + 7 0010 347B0C49 NEG X,Y,\$73 + 8 0014 36820CE9 NEGU \$130,Y,\$233 + 9 0018 347B26D4 NEG X,38,\$212 + 10 001c 3601AFB5 NEGU \$1,175,\$181 + 11 + 12 0020 357B0CB0 NEG X,Y,Z0 + 13 0024 37200CB0 NEGU \$32,Y,Z0 + 14 0028 357B84B0 NEG X,132,Z0 + 15 002c 37E885B0 NEGU \$232,133,Z0 + 16 0030 357B0CCB NEG X,Y,203 + 17 0034 37E70CD5 NEGU \$231,Y,213 + 18 0038 357B26D3 NEG X,38,211 + 19 003c 3704AFA1 NEGU \$4,175,161 + 20 + 21 0040 357B0C00 NEG X,Y,0 + 22 0044 37170C00 NEGU \$23,Y,0 + 23 0048 35020C00 NEG \$2,Y,0 + 24 004c 37E88500 NEGU \$232,133,0 + 25 + 26 0050 347B0043 NEG X,Z + 27 0054 36200043 NEGU \$32,Z + 28 0058 357B0020 NEG X,32 + 29 005c 37E80085 NEGU \$232,133 + 30 0060 357B00B0 NEG X,Z0 + 31 0064 372000B0 NEGU \$32,Z0 + 32 0068 347B0020 NEG X,\$32 + 33 006c 36E80085 NEGU \$232,\$133 + 34 X IS \$123 + 35 Y IS 12 + 36 Z IS \$67 + 37 Z0 IS 176 +GAS for MMIX .*/regy-op\.s page 2 + + +DEFINED SYMBOLS +.*/regy-op\.s:3 \.text:0000000000000000 Main + \*REG\*:000000000000007b X + \*ABS\*:000000000000000c Y + \*REG\*:0000000000000043 Z + \*ABS\*:00000000000000b0 Z0 + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/regy-op.s b/gas/testsuite/gas/mmix/regy-op.s new file mode 100644 index 0000000..7cf75ce --- /dev/null +++ b/gas/testsuite/gas/mmix/regy-op.s @@ -0,0 +1,37 @@ +# For insns where Y is a constant: 'Y'-type operands. +# Only NEG and NEGU, actually. +Main NEG X,Y,Z + NEGU $32,Y,Z + NEG X,32,Z + NEGU $0,133,Z + NEG X,Y,$73 + NEGU $130,Y,$233 + NEG X,38,$212 + NEGU $1,175,$181 + + NEG X,Y,Z0 + NEGU $32,Y,Z0 + NEG X,132,Z0 + NEGU $232,133,Z0 + NEG X,Y,203 + NEGU $231,Y,213 + NEG X,38,211 + NEGU $4,175,161 + + NEG X,Y,0 + NEGU $23,Y,0 + NEG $2,Y,0 + NEGU $232,133,0 + + NEG X,Z + NEGU $32,Z + NEG X,32 + NEGU $232,133 + NEG X,Z0 + NEGU $32,Z0 + NEG X,$32 + NEGU $232,$133 +X IS $123 +Y IS 12 +Z IS $67 +Z0 IS 176 diff --git a/gas/testsuite/gas/mmix/relax1-n.d b/gas/testsuite/gas/mmix/relax1-n.d new file mode 100644 index 0000000..4df6a56 --- /dev/null +++ b/gas/testsuite/gas/mmix/relax1-n.d @@ -0,0 +1,90 @@ +#objdump: -dr +#as: -no-expand -x +#source: relax1.s +# +# FIXME: This test-case assumes that out-of-range errors cause relocs to +# be emitted, rather than errors emitted. + +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f0020009 jmp 80024 <l6> + +0000000000000004 <l0>: + 4: f0020008 jmp 80024 <l6> + +0000000000000008 <l1>: + 8: f0020007 jmp 80024 <l6> + +000000000000000c <l01>: + c: f0020006 jmp 80024 <l6> + 10: f407ffff geta \$7,4000c <nearfar1> + 14: f2bfffff pushj \$191,40010 <nearfar2> + +0000000000000018 <l2>: + 18: f000fffe jmp 40010 <nearfar2> + \.\.\. + 40004: 4d480000 bnp \$72,4 <l0> + 40008: f5040000 geta \$4,8 <l1> + +000000000004000c <nearfar1>: + 4000c: f3050000 pushj \$5,c <l01> + +0000000000040010 <nearfar2>: + 40010: f4090000 geta \$9,40010 <nearfar2> + 40010: R_MMIX_ADDR19 \.text\+0x8 + 40014: f20b0000 pushj \$11,40014 <nearfar2\+0x4> + 40014: R_MMIX_ADDR19 \.text\+0x80014 + +0000000000040018 <l4>: + 40018: 4437ffff bp \$55,80014 <l3> + ... + 80010: f1fdfffe jmp 8 <l1> + +0000000000080014 <l3>: + 80014: f1fdfffc jmp 4 <l0> + 80018: 47580000 bod \$88,40018 <l4> + 8001c: 46580000 bod \$88,8001c <l3\+0x8> + 8001c: R_MMIX_ADDR19 \.text\+0x40018 + 80020: f0000000 jmp 80020 <l3\+0xc> + 80020: R_MMIX_ADDR27 \.text\+0x4080020 + +0000000000080024 <l6>: + 80024: f0ffffff jmp 4080020 <l5> + 80028: 436ffffb bz \$111,80014 <l3> + \.\.\. + +0000000004080020 <l5>: + 4080020: f0000004 jmp 4080030 <l8> + 4080024: f1000000 jmp 80024 <l6> + 4080028: f0000000 jmp 4080028 <l5\+0x8> + 4080028: R_MMIX_ADDR27 \.text\+0x80024 + 408002c: 482c0000 bnn \$44,408002c <l5\+0xc> + 408002c: R_MMIX_ADDR19 \.text\+0x40c002c + +0000000004080030 <l8>: + 4080030: 482cffff bnn \$44,40c002c <l9> + 4080034: f1fffffb jmp 4080020 <l5> + 4080038: f1fffffa jmp 4080020 <l5> + \.\.\. + +00000000040c0028 <l10>: + 40c0028: f1fefffe jmp 4080020 <l5> + +00000000040c002c <l9>: + 40c002c: f0000003 jmp 40c0038 <l11> + +00000000040c0030 <l7>: + 40c0030: f3210000 pushj \$33,4080030 <l8> + 40c0034: f2210000 pushj \$33,40c0034 <l7\+0x4> + 40c0034: R_MMIX_ADDR19 \.text\+0x4080030 + +00000000040c0038 <l11>: + 40c0038: f1fefffa jmp 4080020 <l5> + 40c003c: f1fefffd jmp 4080030 <l8> + \.\.\. + 4100038: f53d0000 geta \$61,40c0038 <l11> + 410003c: f4480000 geta \$72,410003c <l11\+0x40004> + 410003c: R_MMIX_ADDR19 \.text\+0x40c0038 diff --git a/gas/testsuite/gas/mmix/relax1-r.d b/gas/testsuite/gas/mmix/relax1-r.d new file mode 100644 index 0000000..2c22d6c --- /dev/null +++ b/gas/testsuite/gas/mmix/relax1-r.d @@ -0,0 +1,145 @@ +#objdump: -dr +#as: -linkrelax -x +#source: relax1.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f0020019 jmp 80064 <l6> + 0: R_MMIX_ADDR27 \.text\+0x80064 + +0000000000000004 <l0>: + 4: f0020018 jmp 80064 <l6> + 4: R_MMIX_ADDR27 \.text\+0x80064 + +0000000000000008 <l1>: + 8: f0020017 jmp 80064 <l6> + 8: R_MMIX_ADDR27 \.text\+0x80064 + +000000000000000c <l01>: + c: f0020016 jmp 80064 <l6> + c: R_MMIX_ADDR27 \.text\+0x80064 + 10: f407ffff geta \$7,4000c <nearfar1> + 10: R_MMIX_ADDR19 \.text\+0x4000c + 14: f2bfffff pushj \$191,40010 <nearfar2> + 14: R_MMIX_ADDR19 \.text\+0x40010 + +0000000000000018 <l2>: + 18: f000fffe jmp 40010 <nearfar2> + 18: R_MMIX_ADDR27 \.text\+0x40010 + \.\.\. + 40004: 4d480000 bnp \$72,4 <l0> + 40004: R_MMIX_ADDR19 \.text\+0x4 + 40008: f5040000 geta \$4,8 <l1> + 40008: R_MMIX_ADDR19 \.text\+0x8 + +000000000004000c <nearfar1>: + 4000c: f3050000 pushj \$5,c <l01> + 4000c: R_MMIX_ADDR19 \.text\+0xc + +0000000000040010 <nearfar2>: + 40010: f4090000 geta \$9,40010 <nearfar2> + 40010: R_MMIX_GETA \.text\+0x8 + 40014: fd000000 swym 0,0,0 + 40018: fd000000 swym 0,0,0 + 4001c: fd000000 swym 0,0,0 + 40020: f20b0000 pushj \$11,40020 <nearfar2\+0x10> + 40020: R_MMIX_PUSHJ \.text\+0x80030 + 40024: fd000000 swym 0,0,0 + 40028: fd000000 swym 0,0,0 + 4002c: fd000000 swym 0,0,0 + 40030: fd000000 swym 0,0,0 + +0000000000040034 <l4>: + 40034: 4437ffff bp \$55,80030 <l3> + 40034: R_MMIX_ADDR19 \.text\+0x80030 + \.\.\. + 8002c: f1fdfff7 jmp 8 <l1> + 8002c: R_MMIX_ADDR27 \.text\+0x8 + +0000000000080030 <l3>: + 80030: f1fdfff5 jmp 4 <l0> + 80030: R_MMIX_ADDR27 \.text\+0x4 + 80034: 47580000 bod \$88,40034 <l4> + 80034: R_MMIX_ADDR19 \.text\+0x40034 + 80038: 46580000 bod \$88,80038 <l3\+0x8> + 80038: R_MMIX_CBRANCH \.text\+0x40034 + 8003c: fd000000 swym 0,0,0 + 80040: fd000000 swym 0,0,0 + 80044: fd000000 swym 0,0,0 + 80048: fd000000 swym 0,0,0 + 8004c: fd000000 swym 0,0,0 + 80050: f0000000 jmp 80050 <l3\+0x20> + 80050: R_MMIX_JMP \.text\+0x4080060 + 80054: fd000000 swym 0,0,0 + 80058: fd000000 swym 0,0,0 + 8005c: fd000000 swym 0,0,0 + 80060: fd000000 swym 0,0,0 + +0000000000080064 <l6>: + 80064: f0ffffff jmp 4080060 <l5> + 80064: R_MMIX_ADDR27 \.text\+0x4080060 + 80068: 436ffff2 bz \$111,80030 <l3> + 80068: R_MMIX_ADDR19 \.text\+0x80030 + \.\.\. + +0000000004080060 <l5>: + 4080060: f000000d jmp 4080094 <l8> + 4080060: R_MMIX_ADDR27 \.text\+0x4080094 + 4080064: f1000000 jmp 80064 <l6> + 4080064: R_MMIX_ADDR27 \.text\+0x80064 + 4080068: f0000000 jmp 4080068 <l5\+0x8> + 4080068: R_MMIX_JMP \.text\+0x80064 + 408006c: fd000000 swym 0,0,0 + 4080070: fd000000 swym 0,0,0 + 4080074: fd000000 swym 0,0,0 + 4080078: fd000000 swym 0,0,0 + 408007c: 482c0000 bnn \$44,408007c <l5\+0x1c> + 408007c: R_MMIX_CBRANCH \.text\+0x40c0090 + 4080080: fd000000 swym 0,0,0 + 4080084: fd000000 swym 0,0,0 + 4080088: fd000000 swym 0,0,0 + 408008c: fd000000 swym 0,0,0 + 4080090: fd000000 swym 0,0,0 + +0000000004080094 <l8>: + 4080094: 482cffff bnn \$44,40c0090 <l9> + 4080094: R_MMIX_ADDR19 \.text\+0x40c0090 + 4080098: f1fffff2 jmp 4080060 <l5> + 4080098: R_MMIX_ADDR27 \.text\+0x4080060 + 408009c: f1fffff1 jmp 4080060 <l5> + 408009c: R_MMIX_ADDR27 \.text\+0x4080060 + \.\.\. + +00000000040c008c <l10>: + 40c008c: f1fefff5 jmp 4080060 <l5> + 40c008c: R_MMIX_ADDR27 \.text\+0x4080060 + +00000000040c0090 <l9>: + 40c0090: f0000007 jmp 40c00ac <l11> + 40c0090: R_MMIX_ADDR27 \.text\+0x40c00ac + +00000000040c0094 <l7>: + 40c0094: f3210000 pushj \$33,4080094 <l8> + 40c0094: R_MMIX_ADDR19 \.text\+0x4080094 + 40c0098: f2210000 pushj \$33,40c0098 <l7\+0x4> + 40c0098: R_MMIX_PUSHJ \.text\+0x4080094 + 40c009c: fd000000 swym 0,0,0 + 40c00a0: fd000000 swym 0,0,0 + 40c00a4: fd000000 swym 0,0,0 + 40c00a8: fd000000 swym 0,0,0 + +00000000040c00ac <l11>: + 40c00ac: f1feffed jmp 4080060 <l5> + 40c00ac: R_MMIX_ADDR27 \.text\+0x4080060 + 40c00b0: f1fefff9 jmp 4080094 <l8> + 40c00b0: R_MMIX_ADDR27 \.text\+0x4080094 + \.\.\. + 41000ac: f53d0000 geta \$61,40c00ac <l11> + 41000ac: R_MMIX_ADDR19 \.text\+0x40c00ac + 41000b0: f4480000 geta \$72,41000b0 <l11\+0x40004> + 41000b0: R_MMIX_GETA \.text\+0x40c00ac + 41000b4: fd000000 swym 0,0,0 + 41000b8: fd000000 swym 0,0,0 + 41000bc: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/relax1-rn.d b/gas/testsuite/gas/mmix/relax1-rn.d new file mode 100644 index 0000000..20d0b1f --- /dev/null +++ b/gas/testsuite/gas/mmix/relax1-rn.d @@ -0,0 +1,117 @@ +#objdump: -dr +#as: -linkrelax -no-expand -x +#source: relax1.s +# +# FIXME: This test-case assumes that out-of-range errors (still) cause +# relocs to be emitted, rather than errors emitted. + +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f0000000 jmp 0 <Main> + 0: R_MMIX_ADDR27 \.text\+0x80024 + +0000000000000004 <l0>: + 4: f0000000 jmp 4 <l0> + 4: R_MMIX_ADDR27 \.text\+0x80024 + +0000000000000008 <l1>: + 8: f0000000 jmp 8 <l1> + 8: R_MMIX_ADDR27 \.text\+0x80024 + +000000000000000c <l01>: + c: f0000000 jmp c <l01> + c: R_MMIX_ADDR27 \.text\+0x80024 + 10: f4070000 geta \$7,10 <l01\+0x4> + 10: R_MMIX_ADDR19 \.text\+0x4000c + 14: f2bf0000 pushj \$191,14 <l01\+0x8> + 14: R_MMIX_ADDR19 \.text\+0x40010 + +0000000000000018 <l2>: + 18: f0000000 jmp 18 <l2> + 18: R_MMIX_ADDR27 \.text\+0x40010 + \.\.\. + 40004: 4c480000 bnp \$72,40004 <l2\+0x3ffec> + 40004: R_MMIX_ADDR19 \.text\+0x4 + 40008: f4040000 geta \$4,40008 <l2\+0x3fff0> + 40008: R_MMIX_ADDR19 \.text\+0x8 + +000000000004000c <nearfar1>: + 4000c: f2050000 pushj \$5,4000c <nearfar1> + 4000c: R_MMIX_ADDR19 \.text\+0xc + +0000000000040010 <nearfar2>: + 40010: f4090000 geta \$9,40010 <nearfar2> + 40010: R_MMIX_ADDR19 \.text\+0x8 + 40014: f20b0000 pushj \$11,40014 <nearfar2\+0x4> + 40014: R_MMIX_ADDR19 \.text\+0x80014 + +0000000000040018 <l4>: + 40018: 44370000 bp \$55,40018 <l4> + 40018: R_MMIX_ADDR19 \.text\+0x80014 + \.\.\. + 80010: f0000000 jmp 80010 <l4\+0x3fff8> + 80010: R_MMIX_ADDR27 \.text\+0x8 + +0000000000080014 <l3>: + 80014: f0000000 jmp 80014 <l3> + 80014: R_MMIX_ADDR27 \.text\+0x4 + 80018: 46580000 bod \$88,80018 <l3\+0x4> + 80018: R_MMIX_ADDR19 \.text\+0x40018 + 8001c: 46580000 bod \$88,8001c <l3\+0x8> + 8001c: R_MMIX_ADDR19 \.text\+0x40018 + 80020: f0000000 jmp 80020 <l3\+0xc> + 80020: R_MMIX_ADDR27 \.text\+0x4080020 + +0000000000080024 <l6>: + 80024: f0000000 jmp 80024 <l6> + 80024: R_MMIX_ADDR27 \.text\+0x4080020 + 80028: 426f0000 bz \$111,80028 <l6\+0x4> + 80028: R_MMIX_ADDR19 \.text\+0x80014 + \.\.\. + +0000000004080020 <l5>: + 4080020: f0000000 jmp 4080020 <l5> + 4080020: R_MMIX_ADDR27 \.text\+0x4080030 + 4080024: f0000000 jmp 4080024 <l5\+0x4> + 4080024: R_MMIX_ADDR27 \.text\+0x80024 + 4080028: f0000000 jmp 4080028 <l5\+0x8> + 4080028: R_MMIX_ADDR27 \.text\+0x80024 + 408002c: 482c0000 bnn \$44,408002c <l5\+0xc> + 408002c: R_MMIX_ADDR19 \.text\+0x40c002c + +0000000004080030 <l8>: + 4080030: 482c0000 bnn \$44,4080030 <l8> + 4080030: R_MMIX_ADDR19 \.text\+0x40c002c + 4080034: f0000000 jmp 4080034 <l8\+0x4> + 4080034: R_MMIX_ADDR27 \.text\+0x4080020 + 4080038: f0000000 jmp 4080038 <l8\+0x8> + 4080038: R_MMIX_ADDR27 \.text\+0x4080020 + \.\.\. + +00000000040c0028 <l10>: + 40c0028: f0000000 jmp 40c0028 <l10> + 40c0028: R_MMIX_ADDR27 \.text\+0x4080020 + +00000000040c002c <l9>: + 40c002c: f0000000 jmp 40c002c <l9> + 40c002c: R_MMIX_ADDR27 \.text\+0x40c0038 + +00000000040c0030 <l7>: + 40c0030: f2210000 pushj \$33,40c0030 <l7> + 40c0030: R_MMIX_ADDR19 \.text\+0x4080030 + 40c0034: f2210000 pushj \$33,40c0034 <l7\+0x4> + 40c0034: R_MMIX_ADDR19 \.text\+0x4080030 + +00000000040c0038 <l11>: + 40c0038: f0000000 jmp 40c0038 <l11> + 40c0038: R_MMIX_ADDR27 \.text\+0x4080020 + 40c003c: f0000000 jmp 40c003c <l11\+0x4> + 40c003c: R_MMIX_ADDR27 \.text\+0x4080030 + \.\.\. + 4100038: f43d0000 geta \$61,4100038 <l11\+0x40000> + 4100038: R_MMIX_ADDR19 \.text\+0x40c0038 + 410003c: f4480000 geta \$72,410003c <l11\+0x40004> + 410003c: R_MMIX_ADDR19 \.text\+0x40c0038 diff --git a/gas/testsuite/gas/mmix/relax1.d b/gas/testsuite/gas/mmix/relax1.d new file mode 100644 index 0000000..20776cd --- /dev/null +++ b/gas/testsuite/gas/mmix/relax1.d @@ -0,0 +1,118 @@ +#objdump: -dr +#as: -x + +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f0020019 jmp 80064 <l6> + +0000000000000004 <l0>: + 4: f0020018 jmp 80064 <l6> + +0000000000000008 <l1>: + 8: f0020017 jmp 80064 <l6> + +000000000000000c <l01>: + c: f0020016 jmp 80064 <l6> + 10: f407ffff geta \$7,4000c <nearfar1> + 14: f2bfffff pushj \$191,40010 <nearfar2> + +0000000000000018 <l2>: + 18: f000fffe jmp 40010 <nearfar2> + \.\.\. + 40004: 4d480000 bnp \$72,4 <l0> + 40008: f5040000 geta \$4,8 <l1> + +000000000004000c <nearfar1>: + 4000c: f3050000 pushj \$5,c <l01> + +0000000000040010 <nearfar2>: + 40010: f4090000 geta \$9,40010 <nearfar2> + 40010: R_MMIX_GETA \.text\+0x8 + 40014: fd000000 swym 0,0,0 + 40018: fd000000 swym 0,0,0 + 4001c: fd000000 swym 0,0,0 + 40020: f20b0000 pushj \$11,40020 <nearfar2\+0x10> + 40020: R_MMIX_PUSHJ \.text\+0x80030 + 40024: fd000000 swym 0,0,0 + 40028: fd000000 swym 0,0,0 + 4002c: fd000000 swym 0,0,0 + 40030: fd000000 swym 0,0,0 + +0000000000040034 <l4>: + 40034: 4437ffff bp \$55,80030 <l3> + \.\.\. + 8002c: f1fdfff7 jmp 8 <l1> + +0000000000080030 <l3>: + 80030: f1fdfff5 jmp 4 <l0> + 80034: 47580000 bod \$88,40034 <l4> + 80038: 46580000 bod \$88,80038 <l3\+0x8> + 80038: R_MMIX_CBRANCH \.text\+0x40034 + 8003c: fd000000 swym 0,0,0 + 80040: fd000000 swym 0,0,0 + 80044: fd000000 swym 0,0,0 + 80048: fd000000 swym 0,0,0 + 8004c: fd000000 swym 0,0,0 + 80050: f0000000 jmp 80050 <l3\+0x20> + 80050: R_MMIX_JMP \.text\+0x4080060 + 80054: fd000000 swym 0,0,0 + 80058: fd000000 swym 0,0,0 + 8005c: fd000000 swym 0,0,0 + 80060: fd000000 swym 0,0,0 + +0000000000080064 <l6>: + 80064: f0ffffff jmp 4080060 <l5> + 80068: 436ffff2 bz \$111,80030 <l3> + \.\.\. + +0000000004080060 <l5>: + 4080060: f000000d jmp 4080094 <l8> + 4080064: f1000000 jmp 80064 <l6> + 4080068: f0000000 jmp 4080068 <l5\+0x8> + 4080068: R_MMIX_JMP \.text\+0x80064 + 408006c: fd000000 swym 0,0,0 + 4080070: fd000000 swym 0,0,0 + 4080074: fd000000 swym 0,0,0 + 4080078: fd000000 swym 0,0,0 + 408007c: 482c0000 bnn \$44,408007c <l5\+0x1c> + 408007c: R_MMIX_CBRANCH \.text\+0x40c0090 + 4080080: fd000000 swym 0,0,0 + 4080084: fd000000 swym 0,0,0 + 4080088: fd000000 swym 0,0,0 + 408008c: fd000000 swym 0,0,0 + 4080090: fd000000 swym 0,0,0 + +0000000004080094 <l8>: + 4080094: 482cffff bnn \$44,40c0090 <l9> + 4080098: f1fffff2 jmp 4080060 <l5> + 408009c: f1fffff1 jmp 4080060 <l5> + \.\.\. + +00000000040c008c <l10>: + 40c008c: f1fefff5 jmp 4080060 <l5> + +00000000040c0090 <l9>: + 40c0090: f0000007 jmp 40c00ac <l11> + +00000000040c0094 <l7>: + 40c0094: f3210000 pushj \$33,4080094 <l8> + 40c0098: f2210000 pushj \$33,40c0098 <l7\+0x4> + 40c0098: R_MMIX_PUSHJ \.text\+0x4080094 + 40c009c: fd000000 swym 0,0,0 + 40c00a0: fd000000 swym 0,0,0 + 40c00a4: fd000000 swym 0,0,0 + 40c00a8: fd000000 swym 0,0,0 + +00000000040c00ac <l11>: + 40c00ac: f1feffed jmp 4080060 <l5> + 40c00b0: f1fefff9 jmp 4080094 <l8> + \.\.\. + 41000ac: f53d0000 geta \$61,40c00ac <l11> + 41000b0: f4480000 geta \$72,41000b0 <l11\+0x40004> + 41000b0: R_MMIX_GETA \.text\+0x40c00ac + 41000b4: fd000000 swym 0,0,0 + 41000b8: fd000000 swym 0,0,0 + 41000bc: fd000000 swym 0,0,0 diff --git a/gas/testsuite/gas/mmix/relax1.l b/gas/testsuite/gas/mmix/relax1.l new file mode 100644 index 0000000..77caae2 --- /dev/null +++ b/gas/testsuite/gas/mmix/relax1.l @@ -0,0 +1,128 @@ +GAS for MMIX .*/relax1\.s page 1 + + + 1 #.* + 2 #.* + 3 #.* + 4 0000 F0020019 Main JMP l6 + 5 0004 F0020018 l0 JMP l6 + 6 0008 F0020017 l1 JMP l6 + 7 000c F0020016 l01 JMP l6 + 8 0010 F407FFFF GETA \$7,nearfar1 % Within reach\. + 9 0014 F2BFFFFF PUSHJ \$191,nearfar2 % Within reach\. + 10 0018 F000FFFE l2 JMP nearfar2 % Dummy\. + 11 001c 00000000 \.space 65530\*4,0 + 11 00000000 + 11 00000000 + 11 00000000 + 11 00000000 + 11 00000000 + 12 40004 4D480000 BNP \$72,l0 % Within reach + 13 40008 F5040000 GETA \$4,l1 % Within reach\. + 14 4000c F3050000 nearfar1 PUSHJ 5,l01 % Within reach\. + 15 40010 F4090000 nearfar2 GETA \$9,l1 % Out of reach\. + 15 FD000000 + 15 FD000000 + 15 FD000000 + 16 40020 F20B0000 PUSHJ \$11,l3 % Out of reach\. + 16 FD000000 + 16 FD000000 + 16 FD000000 + 16 FD000000 + 17 40034 4437FFFF l4 BP \$55,l3 % Within reach\. + 18 40038 00000000 \.space 65533\*4,0 + 18 00000000 + 18 00000000 + 18 00000000 + 18 00000000 + 18 00000000 + 19 8002c F1FDFFF7 JMP l1 % Dummy\. + 20 80030 F1FDFFF5 l3 JMP l0 % Dummy\. + 21 80034 47580000 BOD \$88,l4 % Within reach\. + 22 80038 46580000 BOD \$88,l4 % Out of reach\. + 22 FD000000 + 22 FD000000 + 22 FD000000 + 22 FD000000 + 22 FD000000 + 23 80050 F0000000 JMP l5 % Out of reach\. + 23 FD000000 + 23 FD000000 + 23 FD000000 + 23 FD000000 + 24 80064 F0FFFFFF l6 JMP l5 % Within reach\. + 25 80068 436FFFF2 BZ \$111,l3 % Dummy\. + 26 8006c 00000000 \.space \(256\*256\*256-3\)\*4,0 + 26 00000000 + 26 00000000 + 26 00000000 + 26 00000000 + 26 00000000 +GAS for MMIX .*/relax1\.s page 2 + + + 27 4080060 F000000D l5 JMP l8 % Dummy\. + 28 4080064 F1000000 JMP l6 % Within reach + 29 4080068 F0000000 JMP l6 % Out of reach\. + 29 FD000000 + 29 FD000000 + 29 FD000000 + 29 FD000000 + 30 408007c 482C0000 BNN \$44,l9 % Out of reach\. + 30 FD000000 + 30 FD000000 + 30 FD000000 + 30 FD000000 + 30 FD000000 + 31 4080094 482CFFFF l8 BNN \$44,l9 % Within reach\. + 32 4080098 F1FFFFF2 JMP l5 % Dummy\. + 33 408009c F1FFFFF1 JMP l5 % Dummy\. + 34 40800a0 00000000 \.space 65531\*4,0 + 34 00000000 + 34 00000000 + 34 00000000 + 34 00000000 + 34 00000000 + 35 40c008c F1FEFFF5 l10 JMP l5 % Dummy\. + 36 40c0090 F0000007 l9 JMP l11 % Dummy + 37 40c0094 F3210000 l7 PUSHJ \$33,l8 % Within reach\. + 38 40c0098 F2210000 PUSHJ \$33,l8 % Out of reach\. + 38 FD000000 + 38 FD000000 + 38 FD000000 + 38 FD000000 + 39 40c00ac F1FEFFED l11 JMP l5 % Dummy\. + 40 40c00b0 F1FEFFF9 JMP l8 % Dummy\. + 41 40c00b4 00000000 \.space 65534\*4,0 + 41 00000000 + 41 00000000 + 41 00000000 + 41 00000000 + 41 00000000 + 42 41000ac F53D0000 GETA \$61,l11 % Within reach\. + 43 41000b0 F4480000 GETA \$72,l11 % Out of reach\. + 43 FD000000 + 43 FD000000 + 43 FD000000 +GAS for MMIX .*/relax1\.s page 3 + + +DEFINED SYMBOLS +.*/relax1\.s:4 \.text:0000000000000000 Main +.*/relax1\.s:24 \.text:0000000000080064 l6 +.*/relax1\.s:5 \.text:0000000000000004 l0 +.*/relax1\.s:6 \.text:0000000000000008 l1 +.*/relax1\.s:7 \.text:000000000000000c l01 +.*/relax1\.s:14 \.text:000000000004000c nearfar1 +.*/relax1\.s:15 \.text:0000000000040010 nearfar2 +.*/relax1\.s:10 \.text:0000000000000018 l2 +.*/relax1\.s:20 \.text:0000000000080030 l3 +.*/relax1\.s:17 \.text:0000000000040034 l4 +.*/relax1\.s:27 \.text:0000000004080060 l5 +.*/relax1\.s:31 \.text:0000000004080094 l8 +.*/relax1\.s:36 \.text:00000000040c0090 l9 +.*/relax1\.s:35 \.text:00000000040c008c l10 +.*/relax1\.s:39 \.text:00000000040c00ac l11 +.*/relax1\.s:37 \.text:00000000040c0094 l7 + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/relax1.s b/gas/testsuite/gas/mmix/relax1.s new file mode 100644 index 0000000..5135467 --- /dev/null +++ b/gas/testsuite/gas/mmix/relax1.s @@ -0,0 +1,43 @@ +# Relaxation border-cases: just-within reach, just-out-of-reach, forward +# and backward. Have a few variable-length thingies in-between so it +# doesn't get too easy. +Main JMP l6 +l0 JMP l6 +l1 JMP l6 +l01 JMP l6 + GETA $7,nearfar1 % Within reach. + PUSHJ $191,nearfar2 % Within reach. +l2 JMP nearfar2 % Dummy. + .space 65530*4,0 + BNP $72,l0 % Within reach + GETA $4,l1 % Within reach. +nearfar1 PUSHJ 5,l01 % Within reach. +nearfar2 GETA $9,l1 % Out of reach. + PUSHJ $11,l3 % Out of reach. +l4 BP $55,l3 % Within reach. + .space 65533*4,0 + JMP l1 % Dummy. +l3 JMP l0 % Dummy. + BOD $88,l4 % Within reach. + BOD $88,l4 % Out of reach. + JMP l5 % Out of reach. +l6 JMP l5 % Within reach. + BZ $111,l3 % Dummy. + .space (256*256*256-3)*4,0 +l5 JMP l8 % Dummy. + JMP l6 % Within reach + JMP l6 % Out of reach. + BNN $44,l9 % Out of reach. +l8 BNN $44,l9 % Within reach. + JMP l5 % Dummy. + JMP l5 % Dummy. + .space 65531*4,0 +l10 JMP l5 % Dummy. +l9 JMP l11 % Dummy +l7 PUSHJ $33,l8 % Within reach. + PUSHJ $33,l8 % Out of reach. +l11 JMP l5 % Dummy. + JMP l8 % Dummy. + .space 65534*4,0 + GETA $61,l11 % Within reach. + GETA $72,l11 % Out of reach. diff --git a/gas/testsuite/gas/mmix/reloc16-n.d b/gas/testsuite/gas/mmix/reloc16-n.d new file mode 100644 index 0000000..f37c0b7 --- /dev/null +++ b/gas/testsuite/gas/mmix/reloc16-n.d @@ -0,0 +1,14 @@ +# objdump: -dr +# as: -no-expand +# source: reloc16.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: e3040000 setl \$4,0x0 + 2: R_MMIX_16 foo + 4: f82d0000 pop 45,0 + 6: R_MMIX_16 bar\+0x2a + 8: fd2a0000 swym 42,0,0 + a: R_MMIX_16 baz\+0xfffffffffffff6d7 diff --git a/gas/testsuite/gas/mmix/reloc16-r.d b/gas/testsuite/gas/mmix/reloc16-r.d new file mode 100644 index 0000000..c56552f --- /dev/null +++ b/gas/testsuite/gas/mmix/reloc16-r.d @@ -0,0 +1,14 @@ +# objdump: -dr +# as: -linkrelax +# source: reloc16.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: e3040000 setl \$4,0x0 + 2: R_MMIX_16 foo + 4: f82d0000 pop 45,0 + 6: R_MMIX_16 bar\+0x2a + 8: fd2a0000 swym 42,0,0 + a: R_MMIX_16 baz\+0xfffffffffffff6d7 diff --git a/gas/testsuite/gas/mmix/reloc16.d b/gas/testsuite/gas/mmix/reloc16.d new file mode 100644 index 0000000..7b5cc84 --- /dev/null +++ b/gas/testsuite/gas/mmix/reloc16.d @@ -0,0 +1,12 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: e3040000 setl \$4,0x0 + 2: R_MMIX_16 foo + 4: f82d0000 pop 45,0 + 6: R_MMIX_16 bar\+0x2a + 8: fd2a0000 swym 42,0,0 + a: R_MMIX_16 baz\+0xfffffffffffff6d7 diff --git a/gas/testsuite/gas/mmix/reloc16.l b/gas/testsuite/gas/mmix/reloc16.l new file mode 100644 index 0000000..9432bac --- /dev/null +++ b/gas/testsuite/gas/mmix/reloc16.l @@ -0,0 +1,17 @@ +GAS for MMIX .*/reloc16\.s page 1 + + + 1 #.* + 2 0000 E3040000 Main SETL \$4,foo + 3 0004 F82D0000 POP 45,bar\+42 + 4 0008 FD2A0000 SWYM 42,baz-2345 +GAS for MMIX .*/reloc16\.s page 2 + + +DEFINED SYMBOLS +.*/reloc16\.s:2 \.text:0000000000000000 Main + +UNDEFINED SYMBOLS +foo +bar +baz diff --git a/gas/testsuite/gas/mmix/reloc16.s b/gas/testsuite/gas/mmix/reloc16.s new file mode 100644 index 0000000..7c798c6 --- /dev/null +++ b/gas/testsuite/gas/mmix/reloc16.s @@ -0,0 +1,4 @@ +# Simple relocations against 16-bit extern symbols. +Main SETL $4,foo + POP 45,bar+42 + SWYM 42,baz-2345 diff --git a/gas/testsuite/gas/mmix/reloc8-r.d b/gas/testsuite/gas/mmix/reloc8-r.d new file mode 100644 index 0000000..e6394e5 --- /dev/null +++ b/gas/testsuite/gas/mmix/reloc8-r.d @@ -0,0 +1,20 @@ +# objdump: -dr +# as: -linkrelax +# source: reloc8.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: b9002dea syncd 0,\$45,234 + 1: R_MMIX_8 foo + 4: 372f002a negu \$47,0,42 + 6: R_MMIX_8 bar\+0x30 + 8: fd00b26e swym 0,178,110 + 9: R_MMIX_8 baz\+0xfffffffffffffffe + c: ff000000 trip 0,0,0 + d: R_MMIX_8 fee\+0xffffffffffffffff + e: R_MMIX_8 fie\+0x1 + f: R_MMIX_8 foe\+0x3 + 10: f9000000 resume 0 + 13: R_MMIX_8 foobar\+0x8 diff --git a/gas/testsuite/gas/mmix/reloc8.d b/gas/testsuite/gas/mmix/reloc8.d new file mode 100644 index 0000000..b3f1ed6 --- /dev/null +++ b/gas/testsuite/gas/mmix/reloc8.d @@ -0,0 +1,18 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: b9002dea syncd 0,\$45,234 + 1: R_MMIX_8 foo + 4: 372f002a negu \$47,0,42 + 6: R_MMIX_8 bar\+0x30 + 8: fd00b26e swym 0,178,110 + 9: R_MMIX_8 baz\+0xfffffffffffffffe + c: ff000000 trip 0,0,0 + d: R_MMIX_8 fee\+0xffffffffffffffff + e: R_MMIX_8 fie\+0x1 + f: R_MMIX_8 foe\+0x3 + 10: f9000000 resume 0 + 13: R_MMIX_8 foobar\+0x8 diff --git a/gas/testsuite/gas/mmix/reloc8.l b/gas/testsuite/gas/mmix/reloc8.l new file mode 100644 index 0000000..2e84dea --- /dev/null +++ b/gas/testsuite/gas/mmix/reloc8.l @@ -0,0 +1,26 @@ +GAS for MMIX .*/reloc8\.s page 1 + + + 1 #.* + 2 0000 B9002DEA Main SYNCD foo,\$45,234 + 3 0004 372F002A NEGU \$47,bar\+48,localsym + 4 0008 FD00B26E SWYM baz-2,45678 + 5 000c FF000000 TRIP fee-1,fie\+1,foe\+3 + 6 0010 F9000000 RESUME foobar\+8 + 7 localsym IS 42 + 8 +GAS for MMIX .*/reloc8\.s page 2 + + +DEFINED SYMBOLS +.*/reloc8\.s:2 \.text:0000000000000000 Main + \*ABS\*:000000000000002a localsym + +UNDEFINED SYMBOLS +foo +bar +baz +fee +fie +foe +foobar diff --git a/gas/testsuite/gas/mmix/reloc8.s b/gas/testsuite/gas/mmix/reloc8.s new file mode 100644 index 0000000..e734a08 --- /dev/null +++ b/gas/testsuite/gas/mmix/reloc8.s @@ -0,0 +1,8 @@ +# Simple relocations against 8-bit extern symbols. +Main SYNCD foo,$45,234 + NEGU $47,bar+48,localsym + SWYM baz-2,45678 + TRIP fee-1,fie+1,foe+3 + RESUME foobar+8 +localsym IS 42 + diff --git a/gas/testsuite/gas/mmix/relocl-n.d b/gas/testsuite/gas/mmix/relocl-n.d new file mode 100644 index 0000000..7c22f0d --- /dev/null +++ b/gas/testsuite/gas/mmix/relocl-n.d @@ -0,0 +1,27 @@ +#objdump: -dr +#source: reloclab.s +#as: -no-expand +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f0000000 jmp 0 <Main> + 0: R_MMIX_ADDR27 foo\+0x8 + 4: f0000004 jmp 14 <here> + 8: f4080003 geta \$8,14 <here> + c: 46630002 bod \$99,14 <here> + 10: fd000000 swym 0,0,0 + +0000000000000014 <here>: + 14: 42de0000 bz \$222,14 <here> + 14: R_MMIX_ADDR19 bar\+0x10 + +0000000000000018 <there>: + 18: f4040000 geta \$4,18 <there> + 18: R_MMIX_ADDR19 baz + 1c: f2070000 pushj \$7,1c <there\+0x4> + 1c: R_MMIX_ADDR19 foobar + 20: f1fffffe jmp 18 <there> + 24: f558fffd geta \$88,18 <there> + 28: 476ffffc bod \$111,18 <there> diff --git a/gas/testsuite/gas/mmix/reloclab-r.d b/gas/testsuite/gas/mmix/reloclab-r.d new file mode 100644 index 0000000..5779849 --- /dev/null +++ b/gas/testsuite/gas/mmix/reloclab-r.d @@ -0,0 +1,49 @@ +#objdump: -dr +#as: -linkrelax -x +#source: reloclab.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f0000000 jmp 0 <Main> + 0: R_MMIX_JMP foo\+0x8 + 4: fd000000 swym 0,0,0 + 8: fd000000 swym 0,0,0 + c: fd000000 swym 0,0,0 + 10: fd000000 swym 0,0,0 + 14: f0000004 jmp 24 <here> + 14: R_MMIX_ADDR27 \.text\+0x24 + 18: f4080003 geta \$8,24 <here> + 18: R_MMIX_ADDR19 \.text\+0x24 + 1c: 46630002 bod \$99,24 <here> + 1c: R_MMIX_ADDR19 \.text\+0x24 + 20: fd000000 swym 0,0,0 + +0000000000000024 <here>: + 24: 42de0000 bz \$222,24 <here> + 24: R_MMIX_CBRANCH bar\+0x10 + 28: fd000000 swym 0,0,0 + 2c: fd000000 swym 0,0,0 + 30: fd000000 swym 0,0,0 + 34: fd000000 swym 0,0,0 + 38: fd000000 swym 0,0,0 + +000000000000003c <there>: + 3c: f4040000 geta \$4,3c <there> + 3c: R_MMIX_GETA baz + 40: fd000000 swym 0,0,0 + 44: fd000000 swym 0,0,0 + 48: fd000000 swym 0,0,0 + 4c: f2070000 pushj \$7,4c <there\+0x10> + 4c: R_MMIX_PUSHJ foobar + 50: fd000000 swym 0,0,0 + 54: fd000000 swym 0,0,0 + 58: fd000000 swym 0,0,0 + 5c: fd000000 swym 0,0,0 + 60: f1fffff7 jmp 3c <there> + 60: R_MMIX_ADDR27 \.text\+0x3c + 64: f558fff6 geta \$88,3c <there> + 64: R_MMIX_ADDR19 \.text\+0x3c + 68: 476ffff5 bod \$111,3c <there> + 68: R_MMIX_ADDR19 \.text\+0x3c diff --git a/gas/testsuite/gas/mmix/reloclab.d b/gas/testsuite/gas/mmix/reloclab.d new file mode 100644 index 0000000..a9c72f0 --- /dev/null +++ b/gas/testsuite/gas/mmix/reloclab.d @@ -0,0 +1,43 @@ +#objdump: -dr +#as: -x + +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f0000000 jmp 0 <Main> + 0: R_MMIX_JMP foo\+0x8 + 4: fd000000 swym 0,0,0 + 8: fd000000 swym 0,0,0 + c: fd000000 swym 0,0,0 + 10: fd000000 swym 0,0,0 + 14: f0000004 jmp 24 <here> + 18: f4080003 geta \$8,24 <here> + 1c: 46630002 bod \$99,24 <here> + 20: fd000000 swym 0,0,0 + +0000000000000024 <here>: + 24: 42de0000 bz \$222,24 <here> + 24: R_MMIX_CBRANCH bar\+0x10 + 28: fd000000 swym 0,0,0 + 2c: fd000000 swym 0,0,0 + 30: fd000000 swym 0,0,0 + 34: fd000000 swym 0,0,0 + 38: fd000000 swym 0,0,0 + +000000000000003c <there>: + 3c: f4040000 geta \$4,3c <there> + 3c: R_MMIX_GETA baz + 40: fd000000 swym 0,0,0 + 44: fd000000 swym 0,0,0 + 48: fd000000 swym 0,0,0 + 4c: f2070000 pushj \$7,4c <there\+0x10> + 4c: R_MMIX_PUSHJ foobar + 50: fd000000 swym 0,0,0 + 54: fd000000 swym 0,0,0 + 58: fd000000 swym 0,0,0 + 5c: fd000000 swym 0,0,0 + 60: f1fffff7 jmp 3c <there> + 64: f558fff6 geta \$88,3c <there> + 68: 476ffff5 bod \$111,3c <there> diff --git a/gas/testsuite/gas/mmix/reloclab.l b/gas/testsuite/gas/mmix/reloclab.l new file mode 100644 index 0000000..1045c5c --- /dev/null +++ b/gas/testsuite/gas/mmix/reloclab.l @@ -0,0 +1,46 @@ +GAS for MMIX .*/reloclab\.s page 1 + + + 1 #.* + 2 #.* + 3 #.* + 4 0000 F0000000 Main JMP foo\+8 + 4 FD000000 + 4 FD000000 + 4 FD000000 + 4 FD000000 + 5 0014 F0000004 JMP here + 6 0018 F4080003 GETA \$8,here + 7 001c 46630002 BOD \$99,here + 8 0020 FD000000 SWYM 0 + 9 0024 42DE0000 here BZ \$222,bar\+16 + 9 FD000000 + 9 FD000000 + 9 FD000000 + 9 FD000000 + 9 FD000000 + 10 003c F4040000 there GETA \$4,baz + 10 FD000000 + 10 FD000000 + 10 FD000000 + 11 004c F2070000 PUSHJ \$7,foobar + 11 FD000000 + 11 FD000000 + 11 FD000000 + 11 FD000000 + 12 0060 F1FFFFF7 JMP there + 13 0064 F558FFF6 GETA \$88,there + 14 0068 476FFFF5 BOD \$111,there +GAS for MMIX .*/reloclab\.s page 2 + + +DEFINED SYMBOLS +.*/reloclab\.s:4 \.text:0000000000000000 Main +.*/reloclab\.s:9 \.text:0000000000000024 here +.*/reloclab\.s:10 \.text:000000000000003c there + +UNDEFINED SYMBOLS +foo +bar +baz +foobar diff --git a/gas/testsuite/gas/mmix/reloclab.s b/gas/testsuite/gas/mmix/reloclab.s new file mode 100644 index 0000000..2066e04 --- /dev/null +++ b/gas/testsuite/gas/mmix/reloclab.s @@ -0,0 +1,14 @@ +# Different relocations for extern labels: GETA, PUSHJ, Bcc, JMP. +# Mix in different accesses to local labels to see that relaxing works for +# this case. +Main JMP foo+8 + JMP here + GETA $8,here + BOD $99,here + SWYM 0 +here BZ $222,bar+16 +there GETA $4,baz + PUSHJ $7,foobar + JMP there + GETA $88,there + BOD $111,there diff --git a/gas/testsuite/gas/mmix/reloclrn.d b/gas/testsuite/gas/mmix/reloclrn.d new file mode 100644 index 0000000..f065491 --- /dev/null +++ b/gas/testsuite/gas/mmix/reloclrn.d @@ -0,0 +1,33 @@ +# objdump: -dr +# as: -linkrelax -no-expand +# source: reloclab.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f0000000 jmp 0 <Main> + 0: R_MMIX_ADDR27 foo\+0x8 + 4: f0000000 jmp 4 <Main\+0x4> + 4: R_MMIX_ADDR27 \.text\+0x14 + 8: f4080000 geta \$8,8 <Main\+0x8> + 8: R_MMIX_ADDR19 \.text\+0x14 + c: 46630000 bod \$99,c <Main\+0xc> + c: R_MMIX_ADDR19 \.text\+0x14 + 10: fd000000 swym 0,0,0 + +0000000000000014 <here>: + 14: 42de0000 bz \$222,14 <here> + 14: R_MMIX_ADDR19 bar\+0x10 + +0000000000000018 <there>: + 18: f4040000 geta \$4,18 <there> + 18: R_MMIX_ADDR19 baz + 1c: f2070000 pushj \$7,1c <there\+0x4> + 1c: R_MMIX_ADDR19 foobar + 20: f0000000 jmp 20 <there\+0x8> + 20: R_MMIX_ADDR27 \.text\+0x18 + 24: f4580000 geta \$88,24 <there\+0xc> + 24: R_MMIX_ADDR19 \.text\+0x18 + 28: 466f0000 bod \$111,28 <there\+0x10> + 28: R_MMIX_ADDR19 \.text\+0x18 diff --git a/gas/testsuite/gas/mmix/relocxrn.d b/gas/testsuite/gas/mmix/relocxrn.d new file mode 100644 index 0000000..ff7f1db --- /dev/null +++ b/gas/testsuite/gas/mmix/relocxrn.d @@ -0,0 +1,14 @@ +# objdump: -dr +# as: -no-expand -linkrelax +# source: reloc16.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: e3040000 setl \$4,0x0 + 2: R_MMIX_16 foo + 4: f82d0000 pop 45,0 + 6: R_MMIX_16 bar\+0x2a + 8: fd2a0000 swym 42,0,0 + a: R_MMIX_16 baz\+0xfffffffffffff6d7 diff --git a/gas/testsuite/gas/mmix/resume-op-r.d b/gas/testsuite/gas/mmix/resume-op-r.d new file mode 100644 index 0000000..b435194 --- /dev/null +++ b/gas/testsuite/gas/mmix/resume-op-r.d @@ -0,0 +1,12 @@ +# objdump: -dr +# as: -linkrelax +# source: resume-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f9000001 resume 1 + 4: f9000000 resume 0 + 8: f9000001 resume 1 + c: f9000000 resume 0 diff --git a/gas/testsuite/gas/mmix/resume-op.d b/gas/testsuite/gas/mmix/resume-op.d new file mode 100644 index 0000000..f03fbaf --- /dev/null +++ b/gas/testsuite/gas/mmix/resume-op.d @@ -0,0 +1,10 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: f9000001 resume 1 + 4: f9000000 resume 0 + 8: f9000001 resume 1 + c: f9000000 resume 0 diff --git a/gas/testsuite/gas/mmix/resume-op.l b/gas/testsuite/gas/mmix/resume-op.l new file mode 100644 index 0000000..eae3067 --- /dev/null +++ b/gas/testsuite/gas/mmix/resume-op.l @@ -0,0 +1,20 @@ +GAS for MMIX .*/resume-op\.s page 1 + + + 1 # Test the 'z'-type operand, RESUME\. + 2 0000 F9000001 Main RESUME X + 3 0004 F9000000 RESUME 0 + 4 0008 F9000001 RESUME 1 + 5 000c F9000000 RESUME XX + 6 X IS 1 + 7 XX IS 0 + 8 +GAS for MMIX .*/resume-op\.s page 2 + + +DEFINED SYMBOLS +.*/resume-op\.s:2 \.text:0000000000000000 Main + \*ABS\*:0000000000000001 X + \*ABS\*:0000000000000000 XX + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/resume-op.s b/gas/testsuite/gas/mmix/resume-op.s new file mode 100644 index 0000000..a4a0c49 --- /dev/null +++ b/gas/testsuite/gas/mmix/resume-op.s @@ -0,0 +1,8 @@ +# Test the 'z'-type operand, RESUME. +Main RESUME X + RESUME 0 + RESUME 1 + RESUME XX +X IS 1 +XX IS 0 + diff --git a/gas/testsuite/gas/mmix/round2-op-r.d b/gas/testsuite/gas/mmix/round2-op-r.d new file mode 100644 index 0000000..37c9a4b --- /dev/null +++ b/gas/testsuite/gas/mmix/round2-op-r.d @@ -0,0 +1,19 @@ +# objdump: -dr +# as: -linkrelax +# source: round2-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 088700f4 flot \$135,\$244 + 4: 0a8700e9 flotu \$135,\$233 + 8: 0d85005b sflot \$133,91 + c: 177b00f4 fint \$123,\$244 + 10: 0c8500f4 sflot \$133,\$244 + 14: 0987005b flot \$135,91 + 18: 0f7b005b sflotu \$123,91 + 1c: 05ad00e9 fix \$173,\$233 + 20: 0bad00d5 flotu \$173,213 + 24: 078700f4 fixu \$135,\$244 + 28: 0b870077 flotu \$135,119 diff --git a/gas/testsuite/gas/mmix/round2-op.d b/gas/testsuite/gas/mmix/round2-op.d new file mode 100644 index 0000000..236727b --- /dev/null +++ b/gas/testsuite/gas/mmix/round2-op.d @@ -0,0 +1,17 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 088700f4 flot \$135,\$244 + 4: 0a8700e9 flotu \$135,\$233 + 8: 0d85005b sflot \$133,91 + c: 177b00f4 fint \$123,\$244 + 10: 0c8500f4 sflot \$133,\$244 + 14: 0987005b flot \$135,91 + 18: 0f7b005b sflotu \$123,91 + 1c: 05ad00e9 fix \$173,\$233 + 20: 0bad00d5 flotu \$173,213 + 24: 078700f4 fixu \$135,\$244 + 28: 0b870077 flotu \$135,119 diff --git a/gas/testsuite/gas/mmix/round2-op.l b/gas/testsuite/gas/mmix/round2-op.l new file mode 100644 index 0000000..303389d --- /dev/null +++ b/gas/testsuite/gas/mmix/round2-op.l @@ -0,0 +1,28 @@ +GAS for MMIX .*/round2-op\.s page 1 + + + 1 #.* + 2 0000 088700F4 Main FLOT X,Z + 3 0004 0A8700E9 FLOTU X,\$233 + 4 0008 0D85005B SFLOT \$133,Z0 + 5 000c 177B00F4 FINT \$123,Z + 6 0010 0C8500F4 SFLOT \$133,Z + 7 0014 0987005B FLOT X,Z0 + 8 0018 0F7B005B SFLOTU \$123,Z0 + 9 001c 05AD00E9 FIX \$173,\$233 + 10 0020 0BAD00D5 FLOTU \$173,213 + 11 0024 078700F4 FIXU X,Z + 12 0028 0B870077 FLOTU X,119 + 13 X IS \$135 + 14 Z IS \$244 + 15 Z0 IS 91 +GAS for MMIX .*/round2-op\.s page 2 + + +DEFINED SYMBOLS +.*/round2-op\.s:2 \.text:0000000000000000 Main + \*REG\*:0000000000000087 X + \*REG\*:00000000000000f4 Z + \*ABS\*:000000000000005b Z0 + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/round2-op.s b/gas/testsuite/gas/mmix/round2-op.s new file mode 100644 index 0000000..aafeb1a --- /dev/null +++ b/gas/testsuite/gas/mmix/round2-op.s @@ -0,0 +1,15 @@ +# Two-operand variants of "R" and "I". +Main FLOT X,Z + FLOTU X,$233 + SFLOT $133,Z0 + FINT $123,Z + SFLOT $133,Z + FLOT X,Z0 + SFLOTU $123,Z0 + FIX $173,$233 + FLOTU $173,213 + FIXU X,Z + FLOTU X,119 +X IS $135 +Z IS $244 +Z0 IS 91 diff --git a/gas/testsuite/gas/mmix/roundi-op-r.d b/gas/testsuite/gas/mmix/roundi-op-r.d new file mode 100644 index 0000000..d29c404 --- /dev/null +++ b/gas/testsuite/gas/mmix/roundi-op-r.d @@ -0,0 +1,22 @@ +# objdump: -dr +# as: -linkrelax +# source: roundi-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 088701f4 flot \$135,ROUND_OFF,\$244 + 4: 0a8702e9 flotu \$135,ROUND_UP,\$233 + 8: 0d85005b sflot \$133,91 + c: 0e7b04f4 sflotu \$123,ROUND_NEAR,\$244 + 10: 0c8500f4 sflot \$133,\$244 + 14: 0987005b flot \$135,91 + 18: 0f7b045b sflotu \$123,ROUND_NEAR,91 + 1c: 0987015b flot \$135,ROUND_OFF,91 + 20: 0aad02e9 flotu \$173,ROUND_UP,\$233 + 24: 0bad02d5 flotu \$173,ROUND_UP,213 + 28: 0c8700f4 sflot \$135,\$244 + 2c: 0b870277 flotu \$135,ROUND_UP,119 + 30: 0d87005b sflot \$135,91 + 34: 088700f4 flot \$135,\$244 diff --git a/gas/testsuite/gas/mmix/roundi-op.d b/gas/testsuite/gas/mmix/roundi-op.d new file mode 100644 index 0000000..f39bb9e --- /dev/null +++ b/gas/testsuite/gas/mmix/roundi-op.d @@ -0,0 +1,20 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: 088701f4 flot \$135,ROUND_OFF,\$244 + 4: 0a8702e9 flotu \$135,ROUND_UP,\$233 + 8: 0d85005b sflot \$133,91 + c: 0e7b04f4 sflotu \$123,ROUND_NEAR,\$244 + 10: 0c8500f4 sflot \$133,\$244 + 14: 0987005b flot \$135,91 + 18: 0f7b045b sflotu \$123,ROUND_NEAR,91 + 1c: 0987015b flot \$135,ROUND_OFF,91 + 20: 0aad02e9 flotu \$173,ROUND_UP,\$233 + 24: 0bad02d5 flotu \$173,ROUND_UP,213 + 28: 0c8700f4 sflot \$135,\$244 + 2c: 0b870277 flotu \$135,ROUND_UP,119 + 30: 0d87005b sflot \$135,91 + 34: 088700f4 flot \$135,\$244 diff --git a/gas/testsuite/gas/mmix/roundi-op.l b/gas/testsuite/gas/mmix/roundi-op.l new file mode 100644 index 0000000..5ac36fa --- /dev/null +++ b/gas/testsuite/gas/mmix/roundi-op.l @@ -0,0 +1,31 @@ +GAS for MMIX .*/roundi-op\.s page 1 + + + 1 #.* + 2 0000 088701F4 Main FLOT X,ROUND_OFF,Z + 3 0004 0A8702E9 FLOTU X,2,\$233 + 4 0008 0D85005B SFLOT \$133,0,Z0 + 5 000c 0E7B04F4 SFLOTU \$123,ROUND_NEAR,Z + 6 0010 0C8500F4 SFLOT \$133,0,Z + 7 0014 0987005B FLOT X,ROUND_CURRENT,Z0 + 8 0018 0F7B045B SFLOTU \$123,ROUND_NEAR,Z0 + 9 001c 0987015B FLOT X,ROUND_OFF,Z0 + 10 0020 0AAD02E9 FLOTU \$173,2,\$233 + 11 0024 0BAD02D5 FLOTU \$173,2,213 + 12 0028 0C8700F4 SFLOT X,0,Z + 13 002c 0B870277 FLOTU X,2,119 + 14 0030 0D87005B SFLOT X,0,Z0 + 15 0034 088700F4 FLOT X,ROUND_CURRENT,Z + 16 X IS \$135 + 17 Z IS \$244 + 18 Z0 IS 91 +GAS for MMIX .*/roundi-op\.s page 2 + + +DEFINED SYMBOLS +.*/roundi-op\.s:2 \.text:0000000000000000 Main + \*REG\*:0000000000000087 X + \*REG\*:00000000000000f4 Z + \*ABS\*:000000000000005b Z0 + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/roundi-op.s b/gas/testsuite/gas/mmix/roundi-op.s new file mode 100644 index 0000000..ecc503e --- /dev/null +++ b/gas/testsuite/gas/mmix/roundi-op.s @@ -0,0 +1,18 @@ +# Round-type "R". +Main FLOT X,ROUND_OFF,Z + FLOTU X,2,$233 + SFLOT $133,0,Z0 + SFLOTU $123,ROUND_NEAR,Z + SFLOT $133,0,Z + FLOT X,ROUND_CURRENT,Z0 + SFLOTU $123,ROUND_NEAR,Z0 + FLOT X,ROUND_OFF,Z0 + FLOTU $173,2,$233 + FLOTU $173,2,213 + SFLOT X,0,Z + FLOTU X,2,119 + SFLOT X,0,Z0 + FLOT X,ROUND_CURRENT,Z +X IS $135 +Z IS $244 +Z0 IS 91 diff --git a/gas/testsuite/gas/mmix/roundr-op-r.d b/gas/testsuite/gas/mmix/roundr-op-r.d new file mode 100644 index 0000000..ff2f0b0 --- /dev/null +++ b/gas/testsuite/gas/mmix/roundr-op-r.d @@ -0,0 +1,15 @@ +# objdump: -dr +# as: -linkrelax +# source: roundr-op.s +.*: file format elf64-mmix + +Disassembly of section .text: + +0000000000000000 <Main>: + 0: 178701f4 fint \$135,ROUND_OFF,\$244 + 4: 058702e9 fix \$135,ROUND_UP,\$233 + 8: 178500f4 fint \$133,\$244 + c: 157b04f4 fsqrt \$123,ROUND_NEAR,\$244 + 10: 17ad02e9 fint \$173,ROUND_UP,\$233 + 14: 058700f4 fix \$135,\$244 + 18: 078700f4 fixu \$135,\$244 diff --git a/gas/testsuite/gas/mmix/roundr-op.d b/gas/testsuite/gas/mmix/roundr-op.d new file mode 100644 index 0000000..fe595a3 --- /dev/null +++ b/gas/testsuite/gas/mmix/roundr-op.d @@ -0,0 +1,13 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section .text: + +0000000000000000 <Main>: + 0: 178701f4 fint \$135,ROUND_OFF,\$244 + 4: 058702e9 fix \$135,ROUND_UP,\$233 + 8: 178500f4 fint \$133,\$244 + c: 157b04f4 fsqrt \$123,ROUND_NEAR,\$244 + 10: 17ad02e9 fint \$173,ROUND_UP,\$233 + 14: 058700f4 fix \$135,\$244 + 18: 078700f4 fixu \$135,\$244 diff --git a/gas/testsuite/gas/mmix/roundr-op.l b/gas/testsuite/gas/mmix/roundr-op.l new file mode 100644 index 0000000..8948278 --- /dev/null +++ b/gas/testsuite/gas/mmix/roundr-op.l @@ -0,0 +1,22 @@ +GAS for MMIX .*/roundr-op\.s page 1 + + + 1 # Round-type "R"\. + 2 0000 178701F4 Main FINT X,ROUND_OFF,Z + 3 0004 058702E9 FIX X,2,\$233 + 4 0008 178500F4 FINT \$133,0,Z + 5 000c 157B04F4 FSQRT \$123,ROUND_NEAR,Z + 6 0010 17AD02E9 FINT \$173,2,\$233 + 7 0014 058700F4 FIX X,0,Z + 8 0018 078700F4 FIXU X,ROUND_CURRENT,Z + 9 X IS \$135 + 10 Z IS \$244 +GAS for MMIX .*/roundr-op\.s page 2 + + +DEFINED SYMBOLS +.*/roundr-op\.s:2 \.text:0000000000000000 Main + \*REG\*:0000000000000087 X + \*REG\*:00000000000000f4 Z + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/roundr-op.s b/gas/testsuite/gas/mmix/roundr-op.s new file mode 100644 index 0000000..9f2f661 --- /dev/null +++ b/gas/testsuite/gas/mmix/roundr-op.s @@ -0,0 +1,10 @@ +# Round-type "R". +Main FINT X,ROUND_OFF,Z + FIX X,2,$233 + FINT $133,0,Z + FSQRT $123,ROUND_NEAR,Z + FINT $173,2,$233 + FIX X,0,Z + FIXU X,ROUND_CURRENT,Z +X IS $135 +Z IS $244 diff --git a/gas/testsuite/gas/mmix/save-op-r.d b/gas/testsuite/gas/mmix/save-op-r.d new file mode 100644 index 0000000..dcec79d --- /dev/null +++ b/gas/testsuite/gas/mmix/save-op-r.d @@ -0,0 +1,11 @@ +# objdump: -dr +# as: -linkrelax +# source: save-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fa2d0000 save \$45,0 + 4: fa1f0000 save \$31,0 + 8: fa000000 save \$0,0 diff --git a/gas/testsuite/gas/mmix/save-op.d b/gas/testsuite/gas/mmix/save-op.d new file mode 100644 index 0000000..82e2f1e --- /dev/null +++ b/gas/testsuite/gas/mmix/save-op.d @@ -0,0 +1,9 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fa2d0000 save \$45,0 + 4: fa1f0000 save \$31,0 + 8: fa000000 save \$0,0 diff --git a/gas/testsuite/gas/mmix/save-op.l b/gas/testsuite/gas/mmix/save-op.l new file mode 100644 index 0000000..9967045 --- /dev/null +++ b/gas/testsuite/gas/mmix/save-op.l @@ -0,0 +1,19 @@ +GAS for MMIX .*/save-op.s page 1 + + + 1 #.* + 2 0000 FA2D0000 Main SAVE \$45,0 + 3 0004 FA1F0000 SAVE X,0 + 4 0008 FA000000 SAVE X0,0 + 5 X IS \$31 + 6 X0 IS \$0 + 7 +GAS for MMIX .*/save-op.s page 2 + + +DEFINED SYMBOLS +.*/save-op.s:2 .text:0000000000000000 Main + \*REG\*:000000000000001f X + \*REG\*:0000000000000000 X0 + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/save-op.s b/gas/testsuite/gas/mmix/save-op.s new file mode 100644 index 0000000..a6581ce --- /dev/null +++ b/gas/testsuite/gas/mmix/save-op.s @@ -0,0 +1,7 @@ +# Test the 's'-type operand, SAVE. +Main SAVE $45,0 + SAVE X,0 + SAVE X0,0 +X IS $31 +X0 IS $0 + diff --git a/gas/testsuite/gas/mmix/set-r.d b/gas/testsuite/gas/mmix/set-r.d new file mode 100644 index 0000000..cfbde5a --- /dev/null +++ b/gas/testsuite/gas/mmix/set-r.d @@ -0,0 +1,14 @@ +# objdump: -dr +# as: -linkrelax +# source: set.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: e32d0463 setl \$45,0x463 + 4: c1394300 set \$57,\$67 + 8: c14e1f00 set \$78,\$31 + c: e3750463 setl \$117,0x463 + 10: c1754300 set \$117,\$67 + 14: c1751f00 set \$117,\$31 diff --git a/gas/testsuite/gas/mmix/set.d b/gas/testsuite/gas/mmix/set.d new file mode 100644 index 0000000..d6c523c --- /dev/null +++ b/gas/testsuite/gas/mmix/set.d @@ -0,0 +1,12 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: e32d0463 setl \$45,0x463 + 4: c1394300 set \$57,\$67 + 8: c14e1f00 set \$78,\$31 + c: e3750463 setl \$117,0x463 + 10: c1754300 set \$117,\$67 + 14: c1751f00 set \$117,\$31 diff --git a/gas/testsuite/gas/mmix/set.l b/gas/testsuite/gas/mmix/set.l new file mode 100644 index 0000000..3d6059b --- /dev/null +++ b/gas/testsuite/gas/mmix/set.l @@ -0,0 +1,21 @@ +GAS for MMIX .*/set\.s page 1 + + + 1 #.* + 2 0000 E32D0463 Main SET \$45,1123 + 3 0004 C1394300 SET \$57,\$67 + 4 0008 C14E1F00 SET \$78,X + 5 000c E3750463 SET Y,1123 + 6 0010 C1754300 SET Y,\$67 + 7 0014 C1751F00 SET Y,X + 8 X IS \$31 + 9 Y IS \$117 +GAS for MMIX .*/set\.s page 2 + + +DEFINED SYMBOLS +.*/set\.s:2 \.text:0000000000000000 Main + \*REG\*:000000000000001f X + \*REG\*:0000000000000075 Y + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/set.s b/gas/testsuite/gas/mmix/set.s new file mode 100644 index 0000000..7af06da --- /dev/null +++ b/gas/testsuite/gas/mmix/set.s @@ -0,0 +1,9 @@ +# Test the 'r'-type operand and the mapping of SET to OR(I) and SETL. +Main SET $45,1123 + SET $57,$67 + SET $78,X + SET Y,1123 + SET Y,$67 + SET Y,X +X IS $31 +Y IS $117 diff --git a/gas/testsuite/gas/mmix/swym-op-r.d b/gas/testsuite/gas/mmix/swym-op-r.d new file mode 100644 index 0000000..80391f6 --- /dev/null +++ b/gas/testsuite/gas/mmix/swym-op-r.d @@ -0,0 +1,16 @@ +# objdump: -dr +# as: -linkrelax +# source: swym-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd840def swym 132,13,239 + 4: ff840def trip 132,13,239 + 8: 00845678 trap 132,86,120 + c: 00170def trap 23,13,239 + 10: 0023cace trap 35,202,206 + 14: ff170c43 trip 23,12,67 + 18: ff175678 trip 23,86,120 + 1c: fd12d687 swym 18,214,135 diff --git a/gas/testsuite/gas/mmix/swym-op.d b/gas/testsuite/gas/mmix/swym-op.d new file mode 100644 index 0000000..da5e43f --- /dev/null +++ b/gas/testsuite/gas/mmix/swym-op.d @@ -0,0 +1,14 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fd840def swym 132,13,239 + 4: ff840def trip 132,13,239 + 8: 00845678 trap 132,86,120 + c: 00170def trap 23,13,239 + 10: 0023cace trap 35,202,206 + 14: ff170c43 trip 23,12,67 + 18: ff175678 trip 23,86,120 + 1c: fd12d687 swym 18,214,135 diff --git a/gas/testsuite/gas/mmix/swym-op.l b/gas/testsuite/gas/mmix/swym-op.l new file mode 100644 index 0000000..c6de759 --- /dev/null +++ b/gas/testsuite/gas/mmix/swym-op.l @@ -0,0 +1,30 @@ +GAS for MMIX .*/swym-op\.s page 1 + + + 1 #.* + 2 #.* + 3 0000 FD840DEF Main SWYM 132,3567 + 4 0004 FF840DEF TRIP 132,3567 + 5 0008 00845678 TRAP 132,YZ + 6 000c 00170DEF TRAP X,3567 + 7 0010 0023CACE TRAP 2345678 + 8 0014 FF170C43 TRIP X,Y,Z + 9 0018 FF175678 TRIP X,YZ + 10 001c FD12D687 SWYM XYZ + 11 X IS 23 + 12 Y IS 12 + 13 Z IS 67 + 14 YZ IS #5678 + 15 XYZ IS 1234567 +GAS for MMIX .*/swym-op\.s page 2 + + +DEFINED SYMBOLS +.*/swym-op\.s:3 \.text:0000000000000000 Main + \*ABS\*:0000000000005678 YZ + \*ABS\*:0000000000000017 X + \*ABS\*:000000000000000c Y + \*ABS\*:0000000000000043 Z + \*ABS\*:000000000012d687 XYZ + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/swym-op.s b/gas/testsuite/gas/mmix/swym-op.s new file mode 100644 index 0000000..36eba57 --- /dev/null +++ b/gas/testsuite/gas/mmix/swym-op.s @@ -0,0 +1,15 @@ +# Check different type of operands to SWYM etc. +# No need to check the canonical three constants. +Main SWYM 132,3567 + TRIP 132,3567 + TRAP 132,YZ + TRAP X,3567 + TRAP 2345678 + TRIP X,Y,Z + TRIP X,YZ + SWYM XYZ +X IS 23 +Y IS 12 +Z IS 67 +YZ IS #5678 +XYZ IS 1234567 diff --git a/gas/testsuite/gas/mmix/sym-1.d b/gas/testsuite/gas/mmix/sym-1.d new file mode 100644 index 0000000..cd64ce4 --- /dev/null +++ b/gas/testsuite/gas/mmix/sym-1.d @@ -0,0 +1,51 @@ +#objdump: -dt + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d .text 0+ +0+ l d .data 0+ +0+ l d .bss 0+ +0+10 l .text 0+ scl1 +0+14 l .text 0+ :scl2 +0+20 l .text 0+ endcl1 +0+24 l .text 0+ endcl2: +0+ g F .text 0+ Main +0+4 g .text 0+ scg1 +0+8 g .text 0+ scg2 +0+c g .text 0+ :scg3 +0+18 g .text 0+ endcg1 +0+1c g .text 0+ endcg2: + + +Disassembly of section .text: + +0+ <Main>: + 0: fd000410 swym 0,4,16 + +0+4 <scg1>: + 4: fd100400 swym 16,4,0 + +0+8 <scg2>: + 8: fda12a1e swym 161,42,30 + +0+c <:scg3>: + c: fda32a14 swym 163,42,20 + +0+10 <scl1>: + 10: fd010203 swym 1,2,3 + +0+14 <:scl2>: + 14: fd010204 swym 1,2,4 + +0+18 <endcg1>: + 18: fd030201 swym 3,2,1 + +0+1c <endcg2:>: + 1c: fd030201 swym 3,2,1 + +0+20 <endcl1>: + 20: fd040302 swym 4,3,2 + +0+24 <endcl2:>: + 24: fd040302 swym 4,3,2 diff --git a/gas/testsuite/gas/mmix/sym-1.s b/gas/testsuite/gas/mmix/sym-1.s new file mode 100644 index 0000000..2db16fb --- /dev/null +++ b/gas/testsuite/gas/mmix/sym-1.s @@ -0,0 +1,19 @@ +# Test beginning and starting with ":"; it should be stripped off, but +# only one. A trailing ":" is stripped off at a label only. + +Main SWYM 0,4,16 + .global :scg1 + .global scg2 + .global ::scg3 + .global scg2 +:scg1 SWYM 16,4,0 +:scg2 SWYM 161,42,30 +::scg3 SWYM 163,42,20 +:scl1 SWYM 1,2,3 +::scl2 SWYM 1,2,4 + .global endcg1 + .global endcg2: +endcg1: SWYM 3,2,1 +endcg2:: SWYM 3,2,1 +endcl1: SWYM 4,3,2 +endcl2:: SWYM 4,3,2 diff --git a/gas/testsuite/gas/mmix/sync-op-r.d b/gas/testsuite/gas/mmix/sync-op-r.d new file mode 100644 index 0000000..e2ceb0d --- /dev/null +++ b/gas/testsuite/gas/mmix/sync-op-r.d @@ -0,0 +1,14 @@ +# objdump: -dr +# as: -linkrelax +# source: sync-op.s +.*: file format elf64-mmix + +Disassembly of section .text: + +0000000000000000 <Main>: + 0: fc6e6406 sync 7234566 + 4: fc000000 sync 0 + 8: fc000001 sync 1 + c: fc000000 sync 0 + 10: fc000001 sync 1 + 14: fc7c2242 sync 8135234 diff --git a/gas/testsuite/gas/mmix/sync-op.d b/gas/testsuite/gas/mmix/sync-op.d new file mode 100644 index 0000000..06836fc --- /dev/null +++ b/gas/testsuite/gas/mmix/sync-op.d @@ -0,0 +1,12 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section .text: + +0000000000000000 <Main>: + 0: fc6e6406 sync 7234566 + 4: fc000000 sync 0 + 8: fc000001 sync 1 + c: fc000000 sync 0 + 10: fc000001 sync 1 + 14: fc7c2242 sync 8135234 diff --git a/gas/testsuite/gas/mmix/sync-op.l b/gas/testsuite/gas/mmix/sync-op.l new file mode 100644 index 0000000..f97ab66 --- /dev/null +++ b/gas/testsuite/gas/mmix/sync-op.l @@ -0,0 +1,23 @@ +GAS for MMIX .*/sync-op\.s page 1 + + + 1 #.* + 2 0000 FC6E6406 Main SYNC 7234566 + 3 0004 FC000000 SYNC 0 + 4 0008 FC000001 SYNC 1 + 5 000c FC000000 SYNC Zz + 6 0010 FC000001 SYNC Zo + 7 0014 FC7C2242 SYNC Z + 8 Zz IS 0 + 9 Zo IS 1 + 10 Z IS 8135234 +GAS for MMIX .*/sync-op\.s page 2 + + +DEFINED SYMBOLS +.*/sync-op\.s:2 \.text:0000000000000000 Main + \*ABS\*:0000000000000000 Zz + \*ABS\*:0000000000000001 Zo + \*ABS\*:00000000007c2242 Z + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/sync-op.s b/gas/testsuite/gas/mmix/sync-op.s new file mode 100644 index 0000000..e4d9a21 --- /dev/null +++ b/gas/testsuite/gas/mmix/sync-op.s @@ -0,0 +1,10 @@ +# Test operands for SYNC. +Main SYNC 7234566 + SYNC 0 + SYNC 1 + SYNC Zz + SYNC Zo + SYNC Z +Zz IS 0 +Zo IS 1 +Z IS 8135234 diff --git a/gas/testsuite/gas/mmix/tst.s b/gas/testsuite/gas/mmix/tst.s new file mode 100644 index 0000000..af266e4 --- /dev/null +++ b/gas/testsuite/gas/mmix/tst.s @@ -0,0 +1,6 @@ +Main SWYM 0 +l1 GETA $5,foo + LDA $252,$34,127 + SWYM 0,bar,baz + GETA $56,Main + diff --git a/gas/testsuite/gas/mmix/two-op-r.d b/gas/testsuite/gas/mmix/two-op-r.d new file mode 100644 index 0000000..fcddeb9 --- /dev/null +++ b/gas/testsuite/gas/mmix/two-op-r.d @@ -0,0 +1,24 @@ +# objdump: -dr +# as: -linkrelax +# source: two-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: e0175840 seth \$23,0x5840 + 4: e12d5840 setmh \$45,0x5840 + 8: e8171ed4 orh \$23,0x1ed4 + c: e92d3039 ormh \$45,0x3039 + 10: e2175840 setml \$23,0x5840 + 14: e32d5840 setl \$45,0x5840 + 18: ea171ed4 orml \$23,0x1ed4 + 1c: eb2d3039 orl \$45,0x3039 + 20: e42d3039 inch \$45,0x3039 + 24: e5171ed4 incmh \$23,0x1ed4 + 28: ec2d5840 andnh \$45,0x5840 + 2c: ed175840 andnmh \$23,0x5840 + 30: e6175840 incml \$23,0x5840 + 34: e72d5840 incl \$45,0x5840 + 38: ee171ed4 andnml \$23,0x1ed4 + 3c: ef2d3039 andnl \$45,0x3039 diff --git a/gas/testsuite/gas/mmix/two-op.d b/gas/testsuite/gas/mmix/two-op.d new file mode 100644 index 0000000..38a3c3a --- /dev/null +++ b/gas/testsuite/gas/mmix/two-op.d @@ -0,0 +1,22 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: e0175840 seth \$23,0x5840 + 4: e12d5840 setmh \$45,0x5840 + 8: e8171ed4 orh \$23,0x1ed4 + c: e92d3039 ormh \$45,0x3039 + 10: e2175840 setml \$23,0x5840 + 14: e32d5840 setl \$45,0x5840 + 18: ea171ed4 orml \$23,0x1ed4 + 1c: eb2d3039 orl \$45,0x3039 + 20: e42d3039 inch \$45,0x3039 + 24: e5171ed4 incmh \$23,0x1ed4 + 28: ec2d5840 andnh \$45,0x5840 + 2c: ed175840 andnmh \$23,0x5840 + 30: e6175840 incml \$23,0x5840 + 34: e72d5840 incl \$45,0x5840 + 38: ee171ed4 andnml \$23,0x1ed4 + 3c: ef2d3039 andnl \$45,0x3039 diff --git a/gas/testsuite/gas/mmix/two-op.l b/gas/testsuite/gas/mmix/two-op.l new file mode 100644 index 0000000..fb05f30 --- /dev/null +++ b/gas/testsuite/gas/mmix/two-op.l @@ -0,0 +1,35 @@ +GAS for MMIX .*/two-op\.s page 1 + + + 1 #.* + 2 #.* + 3 0000 E0175840 Main SETH X,YZ + 4 0004 E12D5840 SETMH \$45,YZ + 5 0008 E8171ED4 ORH X,7892 + 6 000c E92D3039 ORMH \$45,12345 + 7 + 8 0010 E2175840 SETML X,YZ + 9 0014 E32D5840 SETL \$45,YZ + 10 0018 EA171ED4 ORML X,7892 + 11 001c EB2D3039 ORL \$45,12345 + 12 + 13 0020 E42D3039 INCH \$45,12345 + 14 0024 E5171ED4 INCMH X,7892 + 15 0028 EC2D5840 ANDNH \$45,YZ + 16 002c ED175840 ANDNMH X,YZ + 17 + 18 0030 E6175840 INCML X,YZ + 19 0034 E72D5840 INCL \$45,YZ + 20 0038 EE171ED4 ANDNML X,7892 + 21 003c EF2D3039 ANDNL \$45,12345 + 22 X IS \$23 + 23 YZ IS #5678\+456 +GAS for MMIX .*/two-op\.s page 2 + + +DEFINED SYMBOLS +.*/two-op\.s:3 \.text:0000000000000000 Main + \*REG\*:0000000000000017 X + \*ABS\*:0000000000005840 YZ + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/two-op.s b/gas/testsuite/gas/mmix/two-op.s new file mode 100644 index 0000000..25e2687 --- /dev/null +++ b/gas/testsuite/gas/mmix/two-op.s @@ -0,0 +1,23 @@ +# Two-operand insns; 16-bit operand. +# +Main SETH X,YZ + SETMH $45,YZ + ORH X,7892 + ORMH $45,12345 + + SETML X,YZ + SETL $45,YZ + ORML X,7892 + ORL $45,12345 + + INCH $45,12345 + INCMH X,7892 + ANDNH $45,YZ + ANDNMH X,YZ + + INCML X,YZ + INCL $45,YZ + ANDNML X,7892 + ANDNL $45,12345 +X IS $23 +YZ IS #5678+456 diff --git a/gas/testsuite/gas/mmix/unsave-op-r.d b/gas/testsuite/gas/mmix/unsave-op-r.d new file mode 100644 index 0000000..2aac70a --- /dev/null +++ b/gas/testsuite/gas/mmix/unsave-op-r.d @@ -0,0 +1,11 @@ +# objdump: -dr +# as: -linkrelax +# source: unsave-op.s +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fb00002d unsave 0,\$45 + 4: fb00001f unsave 0,\$31 + 8: fb000000 unsave 0,\$0 diff --git a/gas/testsuite/gas/mmix/unsave-op.d b/gas/testsuite/gas/mmix/unsave-op.d new file mode 100644 index 0000000..a3ad1be --- /dev/null +++ b/gas/testsuite/gas/mmix/unsave-op.d @@ -0,0 +1,9 @@ +# objdump: -dr +.*: file format elf64-mmix + +Disassembly of section \.text: + +0000000000000000 <Main>: + 0: fb00002d unsave 0,\$45 + 4: fb00001f unsave 0,\$31 + 8: fb000000 unsave 0,\$0 diff --git a/gas/testsuite/gas/mmix/unsave-op.l b/gas/testsuite/gas/mmix/unsave-op.l new file mode 100644 index 0000000..b89ea0d --- /dev/null +++ b/gas/testsuite/gas/mmix/unsave-op.l @@ -0,0 +1,19 @@ +GAS for MMIX .*/unsave-op.s page 1 + + + 1 #.* + 2 0000 FB00002D Main UNSAVE 0,\$45 + 3 0004 FB00001F UNSAVE 0,X + 4 0008 FB000000 UNSAVE 0,X0 + 5 X IS \$31 + 6 X0 IS \$0 + 7 +GAS for MMIX .*/unsave-op\.s page 2 + + +DEFINED SYMBOLS +.*/unsave-op.s:2 \.text:0000000000000000 Main + \*REG\*:000000000000001f X + \*REG\*:0000000000000000 X0 + +NO UNDEFINED SYMBOLS diff --git a/gas/testsuite/gas/mmix/unsave-op.s b/gas/testsuite/gas/mmix/unsave-op.s new file mode 100644 index 0000000..0e1a018 --- /dev/null +++ b/gas/testsuite/gas/mmix/unsave-op.s @@ -0,0 +1,7 @@ +# Test the 'u'-type operand, UNSAVE. +Main UNSAVE 0,$45 + UNSAVE 0,X + UNSAVE 0,X0 +X IS $31 +X0 IS $0 + diff --git a/gas/testsuite/gas/mmix/zerop-1.d b/gas/testsuite/gas/mmix/zerop-1.d new file mode 100644 index 0000000..d39133a --- /dev/null +++ b/gas/testsuite/gas/mmix/zerop-1.d @@ -0,0 +1,20 @@ +#objdump: -drt + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ g F \.text 0+ Main + + +Disassembly of section \.text: + +0+ <Main>: + 0: 00000000 trap 0,0,0 + 4: fd000000 swym 0,0,0 + 8: ff000000 trip 0,0,0 + c: f0000000 jmp c <Main\+0xc> + 10: f801e240 pop 1,57920 + 14: f8000000 pop 0,0 diff --git a/gas/testsuite/gas/mmix/zerop-1.s b/gas/testsuite/gas/mmix/zerop-1.s new file mode 100644 index 0000000..725af75 --- /dev/null +++ b/gas/testsuite/gas/mmix/zerop-1.s @@ -0,0 +1,9 @@ +# Check that we allow zero operands for some insns. +# Naked comments aren't supported when no operands are supplied; this +# matches mmixal behavior. +Main TRAP + SWYM + TRIP + JMP + POP 123456 + POP |