* doc/Makefile.am (config.texi): Set top_srcdir.
[binutils-gdb.git] / gas / config / tc-ia64.h
index 8d2f4379db72dc047615e47ec2617e3345bbfb6e..f322fbf16fc1882ac7ee1f896639b6fcfc3b5485 100644 (file)
@@ -1,5 +1,6 @@
 /* tc-ia64.h -- Header file for tc-ia64.c.
-   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Free Software Foundation, Inc.
    Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
 
    This file is part of GAS, the GNU Assembler.
@@ -16,8 +17,8 @@
 
    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.  */
+   the Free Software Foundation, 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
 #include "opcode/ia64.h"
 #include "elf/ia64.h"
@@ -74,10 +75,13 @@ extern const char *ia64_target_format PARAMS ((void));
 #define NEED_INDEX_OPERATOR            /* [ ] is index operator */
 
 #define QUOTES_IN_INSN                 /* allow `string "foo;bar"' */
-#define LEX_AT         LEX_NAME        /* allow `@' inside name */
-#define LEX_QM         LEX_NAME        /* allow `?' inside name */
+#define LEX_AT         (LEX_NAME|LEX_BEGIN_NAME) /* allow `@' inside name */
+#define LEX_QM         (LEX_NAME|LEX_BEGIN_NAME) /* allow `?' inside name */
 #define LEX_HASH       LEX_END_NAME    /* allow `#' ending a name */
 
+extern const char ia64_symbol_chars[];
+#define tc_symbol_chars ia64_symbol_chars
+
 #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0
 
 struct ia64_fix
@@ -86,13 +90,15 @@ struct ia64_fix
     enum ia64_opnd opnd;
   };
 
-extern void ia64_do_align PARAMS((int n));
 extern void ia64_end_of_source PARAMS((void));
 extern void ia64_start_line PARAMS((void));
 extern int ia64_unrecognized_line PARAMS((int ch));
 extern void ia64_frob_label PARAMS((struct symbol *sym));
+#ifdef TE_HPUX
+extern int ia64_frob_symbol PARAMS((struct symbol *sym));
+#endif
 extern void ia64_flush_pending_output PARAMS((void));
-extern int ia64_parse_name (char *name, expressionS *e);
+extern int ia64_parse_name PARAMS((char *name, expressionS *e, char *nextP));
 extern int ia64_optimize_expr PARAMS((expressionS *l, operatorT op,
                                      expressionS *r));
 extern void ia64_cons_align PARAMS((int));
@@ -112,13 +118,18 @@ extern void ia64_handle_align PARAMS ((fragS *f));
 extern void ia64_after_parse_args PARAMS ((void));
 extern void ia64_dwarf2_emit_offset PARAMS ((symbolS *, unsigned int));
 extern void ia64_check_label PARAMS ((symbolS *));
+extern int ia64_estimate_size_before_relax (fragS *, asection *);
+extern void ia64_convert_frag (fragS *);
 
 #define md_end()                               ia64_end_of_source ()
 #define md_start_line_hook()           ia64_start_line ()
 #define tc_unrecognized_line(ch)       ia64_unrecognized_line (ch)
 #define tc_frob_label(s)               ia64_frob_label (s)
+#ifdef TE_HPUX
+#define tc_frob_symbol(s,p)            p |= ia64_frob_symbol (s)
+#endif /* TE_HPUX */
 #define md_flush_pending_output()      ia64_flush_pending_output ()
-#define md_parse_name(s,e,c)           ia64_parse_name (s, e)
+#define md_parse_name(s,e,c)           ia64_parse_name (s, e, c)
 #define tc_canonicalize_symbol_name(s) ia64_canonicalize_symbol_name (s)
 #define tc_canonicalize_section_name(s)        ia64_canonicalize_symbol_name (s)
 #define md_optimize_expr(l,o,r)                ia64_optimize_expr (l, o, r)
@@ -126,12 +137,12 @@ extern void ia64_check_label PARAMS ((symbolS *));
 #define TC_FORCE_RELOCATION(f)         ia64_force_relocation (f)
 #define tc_fix_adjustable(f)           ia64_fix_adjustable (f)
 #define MD_APPLY_SYM_VALUE(FIX)                0
-#define md_convert_frag(b,s,f)         as_fatal ("ia64_convert_frag")
+#define md_convert_frag(b,s,f)         ia64_convert_frag (f)
 #define md_create_long_jump(p,f,t,fr,s)        as_fatal ("ia64_create_long_jump")
 #define md_create_short_jump(p,f,t,fr,s) \
                                        as_fatal ("ia64_create_short_jump")
 #define md_estimate_size_before_relax(f,s) \
-                       (as_fatal ("ia64_estimate_size_before_relax"), 1)
+                                       ia64_estimate_size_before_relax(f,s)
 #define md_elf_section_letter          ia64_elf_section_letter
 #define md_elf_section_flags           ia64_elf_section_flags
 #define TC_FIX_TYPE                    struct ia64_fix
@@ -147,6 +158,18 @@ extern void ia64_check_label PARAMS ((symbolS *));
 #define TC_DWARF2_EMIT_OFFSET          ia64_dwarf2_emit_offset
 #define tc_check_label(l)              ia64_check_label (l)
 
+/* Record if an alignment frag should end with a stop bit.  */
+#define TC_FRAG_TYPE                   int
+#define TC_FRAG_INIT(FRAGP)            do {(FRAGP)->tc_frag_data = 0;}while (0)
+
+/* Give an error if a frag containing code is not aligned to a 16 byte
+   boundary.  */
+#define md_frag_check(FRAGP) \
+  if ((FRAGP)->has_code                                                        \
+      && (((FRAGP)->fr_address + (FRAGP)->insn_addr) & 15) != 0)       \
+     as_bad_where ((FRAGP)->fr_file, (FRAGP)->fr_line,                 \
+                  _("instruction address is not a multiple of 16"));
+
 #define MAX_MEM_FOR_RS_ALIGN_CODE  (15 + 16)
 
 #define WORKING_DOT_WORD       /* don't do broken word processing for now */
@@ -201,7 +224,7 @@ typedef enum
   bspstore_gr, bspstore_psprel, bspstore_sprel, rnat_when, rnat_gr,
   rnat_psprel, rnat_sprel, epilogue, label_state, copy_state,
   spill_psprel, spill_sprel, spill_reg, spill_psprel_p, spill_sprel_p,
-  spill_reg_p, unwabi
+  spill_reg_p, unwabi, endp
 } unw_record_type;
 
 /* These structures declare the fields that can be used in each of the
@@ -218,7 +241,7 @@ typedef struct unw_r_record
   struct
   {
     unsigned char *i;
-    unsigned long fr_mem;
+    unsigned int fr_mem;
     unsigned char gr_mem;
     unsigned char br_mem;
   } mask;
@@ -226,17 +249,22 @@ typedef struct unw_r_record
 
 typedef struct unw_p_record
 {
-  void *imask;
+  struct unw_rec_list *next;
   unsigned long t;
   unsigned long size;
-  unsigned long spoff;
-  unsigned long br;
-  unsigned long pspoff;
-  unsigned short gr;
-  unsigned short rmask;
-  unsigned short grmask;
-  unsigned long frmask;
-  unsigned short brmask;
+  union
+  {
+    unsigned long sp;
+    unsigned long psp;
+  } off;
+  union
+  {
+    unsigned short gr;
+    unsigned short br;
+  } r;
+  unsigned char grmask;
+  unsigned char brmask;
+  unsigned int frmask;
   unsigned char abi;
   unsigned char context;
 } unw_p_record;
@@ -251,10 +279,13 @@ typedef struct unw_b_record
 typedef struct unw_x_record
 {
   unsigned long t;
-  unsigned long spoff;
-  unsigned long pspoff;
+  union
+  {
+    unsigned long spoff;
+    unsigned long pspoff;
+    unsigned int reg;
+  } where;
   unsigned short reg;
-  unsigned short treg;
   unsigned short qp;
   unsigned short ab;   /* Value of the AB field..  */
   unsigned short xy;   /* Value of the XY field..  */