OSDN Git Service

Add setjmp/longjmp exception handling.
[pf3gnuchains/gcc-fork.git] / gcc / config / pa / pa.h
index 6dd822c..30a070b 100644 (file)
@@ -109,6 +109,9 @@ extern int target_flags;
    in shared libraries on hpux10.  */
 #define TARGET_LONG_LOAD_STORE (target_flags & 512)
 
+/* Use a faster sequence for indirect calls.  */
+#define TARGET_FAST_INDIRECT_CALLS (target_flags & 1024)
+
 /* Macro to define tables used to set the flags.
    This is a list in braces of pairs in braces,
    each pair being { "NAME", VALUE }
@@ -138,6 +141,8 @@ extern int target_flags;
    {"no-soft-float", -256},    \
    {"long-load-store", 512},   \
    {"no-long-load-store", -512},\
+   {"fast-indirect-calls", 1024},\
+   {"no-fast-indirect-calls", -1024},\
    {"linker-opt", 0},          \
    { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT}}
 
@@ -241,9 +246,6 @@ extern int target_flags;
 #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
 #endif
 
-/* Allow $ in identifiers.  */
-#define DOLLARS_IN_IDENTIFIERS 2
-
 /* Make gcc agree with <machine/ansi.h> */
 
 #define SIZE_TYPE "unsigned int"
@@ -265,16 +267,43 @@ extern int target_flags;
    linked executables and shared libraries.  */
 #define LDD_SUFFIX "chatr"
 /* Look for lines like "dynamic   /usr/lib/X11R5/libX11.sl"
-   or "static    /usr/lib/X11R5/libX11.sl".  */
+   or "static    /usr/lib/X11R5/libX11.sl". 
+
+   HPUX 10.20 also has lines like "static branch prediction ..."
+   so we filter that out explcitly.
+
+   We also try to bound our search for libraries with marker
+   lines.  What a pain.  */
 #define PARSE_LDD_OUTPUT(PTR)                                  \
 do {                                                           \
+  static int in_shlib_list = 0;                                        \
   while (*PTR == ' ') PTR++;                                   \
-  if (strncmp (PTR, "dynamic", sizeof ("dynamic") - 1) == 0)   \
+  if (strncmp (PTR, "shared library list:",                    \
+              sizeof ("shared library list:") - 1) == 0)       \
+    {                                                          \
+      PTR = 0;                                                 \
+      in_shlib_list = 1;                                       \
+    }                                                          \
+  else if (strncmp (PTR, "shared library binding:",            \
+                   sizeof ("shared library binding:") - 1) == 0)\
+    {                                                          \
+      PTR = 0;                                                 \
+      in_shlib_list = 0;                                       \
+    }                                                          \
+  else if (strncmp (PTR, "static branch prediction disabled",  \
+                   sizeof ("static branch prediction disabled") - 1) == 0)\
+    {                                                          \
+      PTR = 0;                                                 \
+      in_shlib_list = 0;                                       \
+    }                                                          \
+  else if (in_shlib_list                                       \
+          &&  strncmp (PTR, "dynamic", sizeof ("dynamic") - 1) == 0) \
     {                                                          \
       PTR += sizeof ("dynamic") - 1;                           \
       while (*p == ' ') PTR++;                                 \
     }                                                          \
-  else if (strncmp (PTR, "static", sizeof ("static") - 1) == 0)        \
+  else if (in_shlib_list                                       \
+          && strncmp (PTR, "static", sizeof ("static") - 1) == 0) \
     {                                                          \
       PTR += sizeof ("static") - 1;                            \
       while (*p == ' ') PTR++;                                 \
@@ -1050,6 +1079,18 @@ extern enum cmp_type hppa_branch_type;
        fprintf (FILE, ",ARGW%d=FR", (ARG1));} while (0)
 #endif
 
+#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
+{ char *my_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (THUNK_FNDECL)); \
+  char *target_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION)); \
+  output_function_prologue (FILE, 0); \
+  if (VAL_14_BITS_P (DELTA)) \
+    fprintf (FILE, "\tb %s\n\tldo %d(%%r26),%%r26\n", target_name, DELTA); \
+  else \
+    fprintf (FILE, "\taddil L%%%d,%r26\n\tb %s\n\tldo R%%%d(%%r1),%%r26\n", \
+            DELTA, target_name, DELTA); \
+  fprintf (FILE, "\n\t.EXIT\n\t.PROCEND\n"); \
+}
+
 #define ASM_OUTPUT_FUNCTION_PREFIX(FILE, NAME) \
   {                                                                    \
     char *name;                                                                \
@@ -1361,7 +1402,8 @@ extern struct rtx_def *hppa_builtin_saveregs ();
   ((C) == 'Q' ?                                                \
    (IS_RELOADING_PSEUDO_P (OP)                         \
     || (GET_CODE (OP) == MEM                           \
-       && memory_address_p (GET_MODE (OP), XEXP (OP, 0))\
+       && (memory_address_p (GET_MODE (OP), XEXP (OP, 0))\
+           || reload_in_progress)                      \
        && ! symbolic_memory_operand (OP, VOIDmode)     \
         && !(GET_CODE (XEXP (OP, 0)) == PLUS           \
             && (GET_CODE (XEXP (XEXP (OP, 0), 0)) == MULT\
@@ -1372,7 +1414,8 @@ extern struct rtx_def *hppa_builtin_saveregs ();
       && (GET_CODE (XEXP (XEXP (OP, 0), 0)) == MULT    \
          || GET_CODE (XEXP (XEXP (OP, 0), 1)) == MULT) \
       && (move_operand (OP, GET_MODE (OP))             \
-         || memory_address_p (GET_MODE (OP), XEXP (OP, 0))))\
+         || memory_address_p (GET_MODE (OP), XEXP (OP, 0))\
+         || reload_in_progress))                       \
    : ((C) == 'T' ?                                     \
       (GET_CODE (OP) == MEM                            \
        /* Using DFmode forces only short displacements \
@@ -1938,22 +1981,22 @@ do { fputs ("\t.SPACE $PRIVATE$\n\
     {                                                          \
       fputs ("\t.SPACE $TEXT$\n", FILE);                       \
       fprintf (FILE,                                           \
-              "\t.SUBSPA %s,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY,SORT=24\n", \
-              NAME);                                           \
+              "\t.SUBSPA %s%s%s,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY,SORT=24\n",\
+              TARGET_GAS ? "" : "$", NAME, TARGET_GAS ? "" : "$"); \
     }                                                          \
   else if (DECL && TREE_READONLY (DECL))                       \
     {                                                          \
       fputs ("\t.SPACE $TEXT$\n", FILE);                       \
       fprintf (FILE,                                           \
-              "\t.SUBSPA %s,QUAD=0,ALIGN=8,ACCESS=44,SORT=16\n", \
-              NAME);                                           \
+              "\t.SUBSPA %s%s%s,QUAD=0,ALIGN=8,ACCESS=44,SORT=16\n", \
+              TARGET_GAS ? "" : "$", NAME, TARGET_GAS ? "" : "$"); \
     }                                                          \
   else                                                         \
     {                                                          \
       fputs ("\t.SPACE $PRIVATE$\n", FILE);                    \
       fprintf (FILE,                                           \
               "\t.SUBSPA %s,QUAD=1,ALIGN=8,ACCESS=31,SORT=16\n", \
-              NAME);                                           \
+              TARGET_GAS ? "" : "$", NAME, TARGET_GAS ? "" : "$"); \
     }
 
 /* FIXME: HPUX ld generates incorrect GOT entries for "T" fixups
@@ -2126,11 +2169,6 @@ DTORS_SECTION_FUNCTION
   if (function_label_operand (VALUE, VOIDmode) \
       && !TARGET_PORTABLE_RUNTIME)             \
     fputs ("P%", FILE);                                \
-  if (in_section == in_named                   \
-      && ! strcmp (".gcc_except_table", in_named_name)\
-      && TARGET_GAS                            \
-      && ! TARGET_PORTABLE_RUNTIME)            \
-    fputs ("E%", FILE);                                \
   output_addr_const (FILE, (VALUE));           \
   fputs ("\n", FILE);}
 
@@ -2319,6 +2357,10 @@ extern struct rtx_def *legitimize_pic_address ();
 extern struct rtx_def *gen_cmp_fp ();
 extern void hppa_encode_label ();
 
+/* Declare functions defined in pa.c and used in templates.  */
+
+extern struct rtx_def *return_addr_rtx ();
+
 /* We want __gcc_plt_call to appear in every program built by
    gcc, so we make a reference to it out of __main.
    We use the asm statement to fool the optimizer into not
@@ -2335,17 +2377,17 @@ do {                                            \
     (*p++) ();                                 \
 } while (0)
 
-/* The current return address is in [%sp-20].  */
-#define RETURN_ADDR_RTX(COUNT, FRAME)                                          \
-  ((COUNT == 0)                                                                        \
-   ? gen_rtx (MEM, Pmode,                                                      \
-             memory_address (Pmode, plus_constant (FRAME,                      \
-                                                   -5 * UNITS_PER_WORD)))      \
-   : (rtx) 0)
+/* Find the return address associated with the frame given by
+   FRAMEADDR.  */
+#define RETURN_ADDR_RTX(COUNT, FRAMEADDR)                               \
+  (return_addr_rtx (COUNT, FRAMEADDR))
 
 /* Used to mask out junk bits from the return address, such as
    processor state, interrupt status, condition codes and the like.  */
-#define MASK_RETURN_ADDR \
-  /* The priviledge level is in the two low order bits, mask em out    \
+#define MASK_RETURN_ADDR                                               \
+  /* The privilege level is in the two low order bits, mask em out     \
      of the return address.  */                                                \
   (GEN_INT (0xfffffffc))
+
+/* The number of Pmode words for the setjmp buffer.  */
+#define JMP_BUF_SIZE 50