This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

S/390 backend coding style cleanup



This changes the s390 backend to comply fully (I hope!) with 
the GNU coding style rules.

Applied to mainline.


2001-08-11  Ulrich Weigand  <uweigand@de.ibm.com>
 
	* config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, 
	config/s390/s390-protos.h, config/s390/linux.h, config/s390/t-linux: 
	Clean up code: add missing comments and prototypes, fix warnings,
        remove obsolete code, fix spacing to conform to coding style.


Index: gcc/config/s390/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/linux.h,v
retrieving revision 1.2
diff -c -p -r1.2 linux.h
*** linux.h	2001/08/11 20:56:12	1.2
--- linux.h	2001/08/11 20:57:19
*************** do { fprintf ((FILE), "%s\t", ASM_QUAD);
*** 154,160 ****
  #undef ASM_OUTPUT_INT
  #define ASM_OUTPUT_INT(FILE, VALUE)             \
  do { fprintf (FILE, "%s\t", ASM_LONG);          \
!   output_addr_const (FILE,(VALUE));             \
    putc ('\n',FILE);                             \
   } while (0)
  
--- 154,160 ----
  #undef ASM_OUTPUT_INT
  #define ASM_OUTPUT_INT(FILE, VALUE)             \
  do { fprintf (FILE, "%s\t", ASM_LONG);          \
!   output_addr_const (FILE, (VALUE));            \
    putc ('\n',FILE);                             \
   } while (0)
  
*************** do { fprintf (FILE, "%s\t", ASM_LONG);  
*** 163,169 ****
  
  #define ASM_OUTPUT_SHORT(FILE, VALUE)           \
  ( fprintf (FILE, "%s ", ASM_SHORT),             \
!   output_addr_const (FILE,(VALUE)),             \
    putc ('\n',FILE))
  
  #define ASM_OUTPUT_CHAR(FILE, VALUE)            \
--- 163,169 ----
  
  #define ASM_OUTPUT_SHORT(FILE, VALUE)           \
  ( fprintf (FILE, "%s ", ASM_SHORT),             \
!   output_addr_const (FILE, (VALUE)),            \
    putc ('\n',FILE))
  
  #define ASM_OUTPUT_CHAR(FILE, VALUE)            \
*************** do {                                    
*** 284,290 ****
  /* This is how to output a command to make the user-level label named NAME
     defined for reference from other files.  */
  
! #define ASM_GLOBALIZE_LABEL(FILE,NAME)  \
    (fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE))
  
  #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
--- 284,290 ----
  /* This is how to output a command to make the user-level label named NAME
     defined for reference from other files.  */
  
! #define ASM_GLOBALIZE_LABEL(FILE, NAME)  \
    (fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE))
  
  #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
Index: gcc/config/s390/s390-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390-protos.h,v
retrieving revision 1.1
diff -c -p -r1.1 s390-protos.h
*** s390-protos.h	2001/07/13 13:10:42	1.1
--- s390-protos.h	2001/08/11 20:57:19
*************** along with GNU CC; see the file COPYING.
*** 19,88 ****
  the Free Software Foundation, 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
  
! /* Declare functions in s390.c and linux.c */
  
! #ifdef RTX_CODE
! 
! #ifdef TREE_CODE
! extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx, int));
! extern void s390_va_start PARAMS ((int, tree, rtx));
! 
! #endif /* TREE_CODE */
  
  extern int fp_operand PARAMS ((rtx, enum machine_mode));
  extern int s_operand PARAMS ((rtx, enum machine_mode));
! extern int larl_operand PARAMS ((rtx, enum machine_mode));
! extern int r_or_im8_operand PARAMS ((rtx, enum machine_mode));
! extern int r_or_s_operand PARAMS ((rtx, enum machine_mode)); 
  extern int r_or_s_or_im8_operand PARAMS ((rtx, enum machine_mode));
  extern int r_or_x_or_im16_operand PARAMS ((rtx, enum machine_mode));
  extern int bras_sym_operand PARAMS ((rtx, enum machine_mode));
  extern int load_multiple_operation PARAMS ((rtx, enum machine_mode));
  extern int store_multiple_operation PARAMS ((rtx, enum machine_mode));
! extern int dead_p PARAMS ((rtx, rtx));
! extern void print_operand PARAMS ((FILE *, rtx, char));
! extern void print_operand_address PARAMS ((FILE *, rtx));
  extern int legitimate_pic_operand_p PARAMS ((rtx));
  extern int legitimate_constant_p PARAMS ((rtx));
  
- extern int unsigned_comparison_operator PARAMS ((rtx));
- extern int unsigned_jump_follows_p PARAMS ((rtx));
- 
- extern void update_cc PARAMS ((rtx, rtx));
- 
- extern void s390_initialize_trampoline PARAMS ((rtx, rtx, rtx));
  extern void s390_output_symbolic_const PARAMS ((FILE *, rtx));
  extern int s390_adjust_cost PARAMS ((rtx, rtx, rtx, int));
- 
  extern int s390_stop_dump_lit_p PARAMS ((rtx));
  extern void s390_dump_literal_pool PARAMS ((rtx, rtx));
! extern void s390_expand_eh_epilogue PARAMS ((rtx, rtx, rtx));
! extern void s390_asm_output_external_libcall PARAMS ((FILE *, rtx));
! 
  #endif /* RTX_CODE */
  
  #ifdef TREE_CODE
! extern void s390_function_arg_advance PARAMS ((CUMULATIVE_ARGS *,
! 					       enum machine_mode,
! 					       tree, int));
! extern struct rtx_def *s390_function_arg PARAMS ((CUMULATIVE_ARGS *,
! 					     enum machine_mode, tree, int));
! extern int s390_function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *,
! 					       enum machine_mode, tree, int));
  extern int s390_function_arg_pass_by_reference PARAMS ((enum machine_mode, tree));
! extern void setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
! 					    enum machine_mode, tree,
! 					    int *, int));
! extern struct rtx_def *s390_va_arg PARAMS ((tree, tree));
! extern union tree_node *s390_build_va_list PARAMS ((void));
! extern void s390_asm_output_pool_prologue PARAMS ((FILE *, char *, tree, int));
! extern void encode_section_info PARAMS ((tree));
! 
  #endif /* TREE_CODE */
  
- 
- extern void s390_trampoline_template PARAMS ((FILE *));
- extern void s390_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
- extern void s390_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
- extern void s390_final_chunkify PARAMS ((int));
- extern int s390_arg_frame_offset PARAMS ((void));
--- 19,74 ----
  the Free Software Foundation, 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
  
! /* Declare functions in s390.c.  */
  
! extern void optimization_options PARAMS ((int, int));
! extern int s390_arg_frame_offset PARAMS ((void));
! extern void s390_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
! extern void s390_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
  
+ #ifdef RTX_CODE
+ extern int const0_operand PARAMS ((rtx, enum machine_mode));
+ extern int const1_operand PARAMS ((rtx, enum machine_mode));
+ extern int larl_operand PARAMS ((rtx, enum machine_mode));
  extern int fp_operand PARAMS ((rtx, enum machine_mode));
  extern int s_operand PARAMS ((rtx, enum machine_mode));
! extern int r_or_s_operand PARAMS ((rtx, enum machine_mode));
  extern int r_or_s_or_im8_operand PARAMS ((rtx, enum machine_mode));
  extern int r_or_x_or_im16_operand PARAMS ((rtx, enum machine_mode));
+ extern int r_or_im8_operand PARAMS ((rtx, enum machine_mode));
+ extern int tmxx_operand PARAMS ((rtx, enum machine_mode));
  extern int bras_sym_operand PARAMS ((rtx, enum machine_mode));
  extern int load_multiple_operation PARAMS ((rtx, enum machine_mode));
  extern int store_multiple_operation PARAMS ((rtx, enum machine_mode));
! 
! extern int s390_match_ccmode PARAMS ((rtx, enum machine_mode));
! extern int symbolic_reference_mentioned_p PARAMS ((rtx));
  extern int legitimate_pic_operand_p PARAMS ((rtx));
  extern int legitimate_constant_p PARAMS ((rtx));
+ extern int legitimate_address_p PARAMS ((enum machine_mode, rtx, int));
+ extern rtx legitimize_pic_address PARAMS ((rtx, rtx));
+ extern rtx legitimize_address PARAMS ((rtx, rtx, enum machine_mode));
+ extern void emit_pic_move PARAMS ((rtx *, enum machine_mode));
  
  extern void s390_output_symbolic_const PARAMS ((FILE *, rtx));
+ extern void print_operand_address PARAMS ((FILE *, rtx));
+ extern void print_operand PARAMS ((FILE *, rtx, int));
  extern int s390_adjust_cost PARAMS ((rtx, rtx, rtx, int));
  extern int s390_stop_dump_lit_p PARAMS ((rtx));
  extern void s390_dump_literal_pool PARAMS ((rtx, rtx));
! extern void s390_trampoline_template PARAMS ((FILE *));
! extern void s390_initialize_trampoline PARAMS ((rtx, rtx, rtx));
  #endif /* RTX_CODE */
  
  #ifdef TREE_CODE
! extern void s390_asm_output_pool_prologue PARAMS ((FILE *, const char *, tree, int));
  extern int s390_function_arg_pass_by_reference PARAMS ((enum machine_mode, tree));
! extern void s390_function_arg_advance PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
! extern tree s390_build_va_list PARAMS ((void));
! #ifdef RTX_CODE
! extern rtx s390_function_arg PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
! extern void s390_va_start PARAMS ((int, tree, rtx));
! extern rtx s390_va_arg PARAMS ((tree, tree));
! #endif /* RTX_CODE */
  #endif /* TREE_CODE */
  
Index: gcc/config/s390/s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.2
diff -c -p -r1.2 s390.c
*** s390.c	2001/08/11 20:56:12	1.2
--- s390.c	2001/08/11 20:57:24
*************** int  s390_function_count = 0;
*** 70,107 ****
     emitted.  */
  rtx s390_compare_op0, s390_compare_op1;
  
  
  struct s390_address
  {
    rtx base;
    rtx indx;
    rtx disp;
  };
  
- static int s390_match_ccmode_set 
-   PARAMS ((rtx set, int req_mode));
- static int base_n_index_p 
-   PARAMS ((rtx op));
- static int check_mode 
-   PARAMS ((register rtx op, enum machine_mode *mode));
- static int s390_decompose_address 
-   PARAMS ((register rtx addr, struct s390_address *out, int strict));
- static int check_mode 
-   PARAMS ((register rtx op, enum machine_mode *mode));
   
! /* Return TRUE or FALSE depending on whether every SET in INSN that
!    set the CC register has source and destination with matching CC modes, 
!    and that the CC mode is at least as constrained as REQ_MODE.  */
   
  static int
  s390_match_ccmode_set (set, req_mode)
       rtx set;
!      int req_mode;
  {
!   unsigned int set_mode;
  
    if (GET_CODE (set) != SET)
!     abort();
  
    if (GET_CODE (SET_DEST (set)) != REG || !CC_REGNO_P (REGNO (SET_DEST (set))))
      return 1;
--- 70,126 ----
     emitted.  */
  rtx s390_compare_op0, s390_compare_op1;
  
+ /* Structure used to hold the components of a S/390 memory
+    address.  A legitimate address on S/390 is of the general
+    form
+           base + index + displacement
+    where any of the components is optional.
  
+    base and index are registers of the class ADDR_REGS,
+    displacement is an unsigned 12-bit immediate constant.  */
+ 
  struct s390_address
  {
    rtx base;
    rtx indx;
    rtx disp;
  };
+ 
+ static int s390_match_ccmode_set PARAMS ((rtx, enum machine_mode));
+ static int base_n_index_p PARAMS ((rtx));
+ static int check_mode PARAMS ((rtx, enum machine_mode *));
+ static int s390_decompose_address PARAMS ((rtx, struct s390_address *, int));
+ static void output_branch_condition PARAMS ((FILE *, rtx));
+ static void output_inverse_branch_condition PARAMS ((FILE *, rtx));
+ static int reg_used_in_mem_p PARAMS ((int, rtx));
+ static int addr_generation_dependency_p PARAMS ((rtx, rtx));
+ static int other_chunk PARAMS ((int *, int, int));
+ static int far_away PARAMS ((int, int));
+ static rtx check_and_change_labels PARAMS ((rtx, int *));
+ static void s390_final_chunkify PARAMS ((int));
+ static int save_fprs_p PARAMS ((void));
+ static int cur_is_leaf_function PARAMS ((void));
+ static int save_fprs PARAMS ((FILE *, long, int));
+ static int restore_fprs PARAMS ((FILE *, long, int));
+ static void s390_output_constant_pool PARAMS ((FILE *));
+ static rtx s390_force_const_mem_late PARAMS ((rtx));
+ static rtx s390_force_const_mem_symbol PARAMS ((const char *, int, int));
+ static int s390_function_arg_size PARAMS ((enum machine_mode, tree));
  
   
! /* Return true if SET either doesn't set the CC register, or else
!    the source and destination have matching CC modes and that 
!    CC mode is at least as constrained as REQ_MODE.  */
   
  static int
  s390_match_ccmode_set (set, req_mode)
       rtx set;
!      enum machine_mode req_mode;
  {
!   enum machine_mode set_mode;
  
    if (GET_CODE (set) != SET)
!     abort ();
  
    if (GET_CODE (SET_DEST (set)) != REG || !CC_REGNO_P (REGNO (SET_DEST (set))))
      return 1;
*************** s390_match_ccmode_set (set, req_mode)
*** 132,141 ****
    return (GET_MODE (SET_SRC (set)) == set_mode);
  }
  
  int
  s390_match_ccmode (insn, req_mode)
       rtx insn;
!      int req_mode;
  {
    int i;
  
--- 151,164 ----
    return (GET_MODE (SET_SRC (set)) == set_mode);
  }
  
+ /* Return true if every SET in INSN that sets the CC register 
+    has source and destination with matching CC modes and that 
+    CC mode is at least as constrained as REQ_MODE.  */
+  
  int
  s390_match_ccmode (insn, req_mode)
       rtx insn;
!      enum machine_mode req_mode;
  {
    int i;
  
*************** s390_match_ccmode (insn, req_mode)
*** 154,163 ****
    return 1;
  }
  
  
  void
  optimization_options (level, size)
!      int level;
       int size ATTRIBUTE_UNUSED;
  {
  #ifdef HAVE_decrement_and_branch_on_count
--- 177,193 ----
    return 1;
  }
  
+ /* Change optimizations to be performed, depending on the 
+    optimization level.
+ 
+    LEVEL is the optimization level specified; 2 if `-O2' is
+    specified, 1 if `-O' is specified, and 0 if neither is specified.
+ 
+    SIZE is non-zero if `-Os' is specified and zero otherwise. */
  
  void
  optimization_options (level, size)
!      int level ATTRIBUTE_UNUSED;
       int size ATTRIBUTE_UNUSED;
  {
  #ifdef HAVE_decrement_and_branch_on_count
*************** enum reg_class regclass_map[FIRST_PSEUDO
*** 183,189 ****
  };
  
  
! /* Match exactly zero.  */
   
  int
  const0_operand (op, mode)
--- 213,221 ----
  };
  
  
! /* Return true if OP a (const_int 0) operand.
!    OP is the current operation.
!    MODE is the current operation mode.  */
   
  int
  const0_operand (op, mode)
*************** const0_operand (op, mode)
*** 193,199 ****
    return op == CONST0_RTX (mode);
  }
  
! /* Match exactly one.  */
   
  int
  const1_operand (op, mode)
--- 225,233 ----
    return op == CONST0_RTX (mode);
  }
  
! /* Return true if OP a (const_int 1) operand.
!    OP is the current operation.
!    MODE is the current operation mode.  */
   
  int
  const1_operand (op, mode)
*************** const1_operand (op, mode)
*** 202,213 ****
  {
    return op == CONST1_RTX (mode);
  }
-  
  
! /* Return 1 if OP needs base and index register.  */
  
  static int 
! base_n_index_p (rtx op)
  {
    if ((GET_CODE (op) == PLUS) &&
        (GET_CODE (XEXP (op, 0)) == PLUS ||
--- 236,247 ----
  {
    return op == CONST1_RTX (mode);
  }
  
! /* Return true if OP needs base and index register.  */
  
  static int 
! base_n_index_p (op)
!      register rtx op;
  {
    if ((GET_CODE (op) == PLUS) &&
        (GET_CODE (XEXP (op, 0)) == PLUS ||
*************** base_n_index_p (rtx op)
*** 217,223 ****
    return 0;
  }
  
! /* Check mode and mode of op, set it to mode of op, if VOIDmode.  */ 
  
  static int
  check_mode (op, mode)
--- 251,258 ----
    return 0;
  }
  
! /* Return true if the mode of operand OP matches MODE.
!    If MODE is set to VOIDmode, set it to the mode of OP.  */ 
  
  static int
  check_mode (op, mode)
*************** check_mode (op, mode)
*** 234,241 ****
    return 1;
  }
  
! 
! /* Return 1 if OP a valid operand for the LARL instruction.
     OP is the current operation.
     MODE is the current operation mode.  */
  
--- 269,275 ----
    return 1;
  }
  
! /* Return true if OP a valid operand for the LARL instruction.
     OP is the current operation.
     MODE is the current operation mode.  */
  
*************** larl_operand (op, mode)
*** 244,252 ****
       register rtx op;
       enum machine_mode mode;
  {
-   rtx sym;
-   register enum rtx_code code = GET_CODE (op);
- 
    if (! check_mode (op, &mode))
      return 0;
  
--- 278,283 ----
*************** larl_operand (op, mode)
*** 291,297 ****
    return 0;
  }
  
! /* Return 1 if OP is a valid FP-Register.
     OP is the current operation.
     MODE is the current operation mode.  */
  
--- 322,328 ----
    return 0;
  }
  
! /* Return true if OP is a valid FP-Register.
     OP is the current operation.
     MODE is the current operation mode.  */
  
*************** fp_operand (op, mode)
*** 309,315 ****
      return 0;
  }
  
! /* Return 1 if OP is a valid S operand for an RS, SI or SS type instruction.  */
  
  int
  s_operand (op, mode)
--- 340,348 ----
      return 0;
  }
  
! /* Return true if OP is a valid S operand for an RS, SI or SS type instruction.
!    OP is the current operation.
!    MODE is the current operation mode.  */
  
  int
  s_operand (op, mode)
*************** s_operand (op, mode)
*** 330,336 ****
  }
  
  /* Return 1 if OP is a valid R or S operand for an RS, SI or SS type
!    instruction.  */
  
  int
  r_or_s_operand (op, mode)
--- 363,371 ----
  }
  
  /* Return 1 if OP is a valid R or S operand for an RS, SI or SS type
!    instruction.
!    OP is the current operation.
!    MODE is the current operation mode.  */
  
  int
  r_or_s_operand (op, mode)
*************** r_or_s_operand (op, mode)
*** 351,358 ****
    return register_operand (op, mode);
  }
  
! /* Return 1 if OP is a valid R or S or immediate operand for 
!    RS, SI or SS type instruction.  */
  
  int
  r_or_s_or_im8_operand (op, mode)
--- 386,395 ----
    return register_operand (op, mode);
  }
  
! /* Return true if OP is a valid R or S or immediate operand for 
!    RS, SI or SS type instruction.
!    OP is the current operation.
!    MODE is the current operation mode.  */
  
  int
  r_or_s_or_im8_operand (op, mode)
*************** r_or_s_or_im8_operand (op, mode)
*** 373,380 ****
    return register_operand (op, mode) || immediate_operand (op, mode);
  }
  
! /* Return 1 if OP is a valid R or X or 16 bit immediate operand for 
!    RX, RR or RI type instruction.  */
  
  int
  r_or_x_or_im16_operand (op, mode)
--- 410,419 ----
    return register_operand (op, mode) || immediate_operand (op, mode);
  }
  
! /* Return true if OP is a valid R or X or 16 bit immediate operand for 
!    RX, RR or RI type instruction.
!    OP is the current operation.
!    MODE is the current operation mode.  */
  
  int
  r_or_x_or_im16_operand (op, mode)
*************** r_or_x_or_im16_operand (op, mode)
*** 390,397 ****
    return register_operand (op, mode) || memory_operand (op, mode);
  }
  
! /* Return 1 if OP is a valid R or 8 bit immediate operand for 
!    !!!!!!! type instruction.  */
  
  int
  r_or_im8_operand (op, mode)
--- 429,437 ----
    return register_operand (op, mode) || memory_operand (op, mode);
  }
  
! /* Return true if OP is a valid R or 8 bit immediate operand.
!    OP is the current operation.
!    MODE is the current operation mode.  */
  
  int
  r_or_im8_operand (op, mode)
*************** r_or_im8_operand (op, mode)
*** 407,420 ****
    return register_operand (op, mode) || memory_operand (op, mode);
  }
  
! /* Return 1 if OP is a valid operand for the 'test under mask'
     instruction with 16 bit immediate.  
!    The value should only have set bits in one halfword.  */ 
  
  int
  tmxx_operand (op, mode)
       register rtx op;
!      enum machine_mode mode;
  {
    rtx con;
    if (GET_CODE (op) == CONST_INT)
--- 447,462 ----
    return register_operand (op, mode) || memory_operand (op, mode);
  }
  
! /* Return true if OP is a valid operand for the 'test under mask'
     instruction with 16 bit immediate.  
!    The value should only have set bits in one halfword.
!    OP is the current operation.
!    MODE is the current operation mode.  */
  
  int
  tmxx_operand (op, mode)
       register rtx op;
!      enum machine_mode mode ATTRIBUTE_UNUSED;
  {
    rtx con;
    if (GET_CODE (op) == CONST_INT)
*************** tmxx_operand (op, mode)
*** 431,437 ****
  	  c = (unsigned HOST_WIDEST_INT) INTVAL (con);
  	  
  	  return ((c & 0xffff) ? ((c & 0xffffffffffff0000ULL)==0) : 
! 		  (c & 0xffff0000) ? ((c & 0xffffffff0000ffffULL)==0) :
  		  (c & 0xffff00000000ULL) ? ((c & 0xffff0000ffffffffULL)==0) :
  		  (c & 0xffff000000000000ULL) ? ((c & 0xffffffffffffULL)==0) : 1);
  		  
--- 473,479 ----
  	  c = (unsigned HOST_WIDEST_INT) INTVAL (con);
  	  
  	  return ((c & 0xffff) ? ((c & 0xffffffffffff0000ULL)==0) : 
! 		  (c & 0xffff0000U) ? ((c & 0xffffffff0000ffffULL)==0) :
  		  (c & 0xffff00000000ULL) ? ((c & 0xffff0000ffffffffULL)==0) :
  		  (c & 0xffff000000000000ULL) ? ((c & 0xffffffffffffULL)==0) : 1);
  		  
*************** tmxx_operand (op, mode)
*** 439,454 ****
      }
    return 0;
  }
- 
  
! /* Return 1 if valid operand for BRAS
     OP is the current operation.
     MODE is the current operation mode.  */
  
  int
  bras_sym_operand (op, mode)
       register rtx op;
!      enum machine_mode mode;
  {
    register enum rtx_code code = GET_CODE (op);
  
--- 481,495 ----
      }
    return 0;
  }
  
! /* Return true if OP is a valid operand for the BRAS instruction.
     OP is the current operation.
     MODE is the current operation mode.  */
  
  int
  bras_sym_operand (op, mode)
       register rtx op;
!      enum machine_mode mode ATTRIBUTE_UNUSED;
  {
    register enum rtx_code code = GET_CODE (op);
  
*************** bras_sym_operand (op, mode)
*** 465,472 ****
  }
  
  
! /* Return 1 if OP is a load multiple operation.  It is known to be a
!    PARALLEL and the first section will be tested.  */
  
  int
  load_multiple_operation (op, mode)
--- 506,515 ----
  }
  
  
! /* Return true if OP is a load multiple operation.  It is known to be a
!    PARALLEL and the first section will be tested. 
!    OP is the current operation.
!    MODE is the current operation mode.  */
  
  int
  load_multiple_operation (op, mode)
*************** load_multiple_operation (op, mode)
*** 509,515 ****
    return 1;
  }
  
! /* Similar, but tests for store multiple.  */
  
  int
  store_multiple_operation (op, mode)
--- 552,561 ----
    return 1;
  }
  
! /* Return true if OP is a store multiple operation.  It is known to be a
!    PARALLEL and the first section will be tested. 
!    OP is the current operation.
!    MODE is the current operation mode.  */
  
  int
  store_multiple_operation (op, mode)
*************** store_multiple_operation (op, mode)
*** 551,563 ****
  }
  
  
! /* Returns 1 if OP contains a symbol reference */
  
  int
  symbolic_reference_mentioned_p (op)
       rtx op;
  {
!   register char *fmt;
    register int i;
  
    if (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF)
--- 597,609 ----
  }
  
  
! /* Return true if OP contains a symbol reference */
  
  int
  symbolic_reference_mentioned_p (op)
       rtx op;
  {
!   register const char *fmt;
    register int i;
  
    if (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF)
*************** symbolic_reference_mentioned_p (op)
*** 583,588 ****
--- 629,638 ----
  }
  
  
+ /* Return true if OP is a legitimate general operand when 
+    generating PIC code.  It is given that flag_pic is on 
+    and that OP satisfies CONSTANT_P or is a CONST_DOUBLE.  */
+ 
  int
  legitimate_pic_operand_p (op)
       register rtx op;
*************** legitimate_pic_operand_p (op)
*** 601,606 ****
--- 651,659 ----
    return 0;
  }
  
+ /* Returns true if the constant value OP is a legitimate general operand.
+    It is given that OP satisfies CONSTANT_P or is a CONST_DOUBLE.  */
+ 
  int
  legitimate_constant_p (op)
       register rtx op;
*************** legitimate_constant_p (op)
*** 631,653 ****
    return 0;
  }
  
- 
- /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
-    that is a valid memory address for an instruction.
-    The MODE argument is the machine mode for the MEM expression
-    that wants to use this address.
- 
-    On S/390, legitimate addresses are:
- 	base				l    reg,(base)
- 	displacement			l    reg,disp
- 	base + displacement		l    reg,disp(base)
- 	index + base			l    reg,(base,index),reg
- 	(index + base) + displacement	l    reg,disp(base,index)
- 
-    It only recognizes address in canonical form.  LEGITIMIZE_ADDRESS should
-    convert common non-canonical forms to canonical form so that they will
-    be recognized.  */
  
  
  static int
  s390_decompose_address (addr, out, strict)
--- 684,700 ----
    return 0;
  }
  
  
+ /* Decompose a RTL expression ADDR for a memory address into
+    its components, returned in OUT.  The boolean STRICT 
+    specifies whether strict register checking applies.
+    Returns 0 if ADDR is not a valid memory address, nonzero
+    otherwise.  If OUT is NULL, don't return the components,
+    but check for validity only.
+ 
+    Note: Only addresses in canonical form are recognized.
+    LEGITIMIZE_ADDRESS should convert non-canonical forms to the
+    canonical form so that they will be recognized.  */
  
  static int
  s390_decompose_address (addr, out, strict)
*************** s390_decompose_address (addr, out, stric
*** 766,772 ****
            /* In some cases, we can accept an additional
               small constant offset.  Split these off here.  */
  
!           int offset = 0;
  
            if (GET_CODE (disp) == CONST
                && GET_CODE (XEXP (disp, 0)) == PLUS
--- 813,819 ----
            /* In some cases, we can accept an additional
               small constant offset.  Split these off here.  */
  
!           unsigned int offset = 0;
  
            if (GET_CODE (disp) == CONST
                && GET_CODE (XEXP (disp, 0)) == PLUS
*************** s390_decompose_address (addr, out, stric
*** 821,829 ****
    return TRUE;
  }
  
  int
  legitimate_address_p (mode, addr, strict)
!      enum machine_mode mode;
       register rtx addr;
       int strict;
  {
--- 868,879 ----
    return TRUE;
  }
  
+ /* Return nonzero if ADDR is a valid memory address.
+    STRICT specifies whether strict register checking applies.  */
+ 
  int
  legitimate_address_p (mode, addr, strict)
!      enum machine_mode mode ATTRIBUTE_UNUSED;
       register rtx addr;
       int strict;
  {
*************** legitimize_pic_address (orig, reg)
*** 956,962 ****
  	  if (GET_CODE (addr) == UNSPEC)
  	    {
  	      if (XVECLEN (addr, 0) != 1)
!                 abort();
                switch (XINT (addr, 1))
                  {
                    /* If someone moved an @GOT or lt-relative UNSPEC
--- 1006,1012 ----
  	  if (GET_CODE (addr) == UNSPEC)
  	    {
  	      if (XVECLEN (addr, 0) != 1)
!                 abort ();
                switch (XINT (addr, 1))
                  {
                    /* If someone moved an @GOT or lt-relative UNSPEC
*************** legitimize_pic_address (orig, reg)
*** 1002,1008 ****
                  }
  	    }
  	  else if (GET_CODE (addr) != PLUS)
! 	    abort();
  	}
        if (GET_CODE (addr) == PLUS)
  	{
--- 1052,1058 ----
                  }
  	    }
  	  else if (GET_CODE (addr) != PLUS)
! 	    abort ();
  	}
        if (GET_CODE (addr) == PLUS)
  	{
*************** legitimize_pic_address (orig, reg)
*** 1076,1084 ****
  	           && GET_CODE (op1) == CONST_INT)
              {
  	      if (XVECLEN (op0, 0) != 1)
!                 abort();
                if (XINT (op0, 1) != 100)
!                 abort();
  
                new = force_const_mem (SImode, orig);
              }
--- 1126,1134 ----
  	           && GET_CODE (op1) == CONST_INT)
              {
  	      if (XVECLEN (op0, 0) != 1)
!                 abort ();
                if (XINT (op0, 1) != 100)
!                 abort ();
  
                new = force_const_mem (SImode, orig);
              }
*************** emit_pic_move (operands, mode)
*** 1125,1143 ****
      operands[1] = legitimize_pic_address (operands[1], temp);
  }
  
! /* Try machine-dependent ways of modifying an illegitimate address
     to be legitimate.  If we find one, return the new, valid address.
-    This macro is used in only one place: `memory_address' in explow.c.
  
     OLDX is the address as it was before break_out_memory_refs was called.
     In some cases it is useful to look at this to decide what needs to be done.
  
!    MODE and WIN are passed so that this macro can use
!    GO_IF_LEGITIMATE_ADDRESS.
  
-    It is always safe for this macro to do nothing.  It exists to recognize
-    opportunities to optimize the output.
- 
     When -fpic is used, special handling is needed for symbolic references.
     See comments by legitimize_pic_address for details.  */
  
--- 1175,1188 ----
      operands[1] = legitimize_pic_address (operands[1], temp);
  }
  
! /* Try machine-dependent ways of modifying an illegitimate address X
     to be legitimate.  If we find one, return the new, valid address.
  
     OLDX is the address as it was before break_out_memory_refs was called.
     In some cases it is useful to look at this to decide what needs to be done.
  
!    MODE is the mode of the operand pointed to by X.
  
     When -fpic is used, special handling is needed for symbolic references.
     See comments by legitimize_pic_address for details.  */
  
*************** rtx
*** 1145,1151 ****
  legitimize_address (x, oldx, mode)
       register rtx x;
       register rtx oldx ATTRIBUTE_UNUSED;
!      enum machine_mode mode;
  {
    if (flag_pic && SYMBOLIC_CONST (x))
      return legitimize_pic_address (x, 0);
--- 1190,1196 ----
  legitimize_address (x, oldx, mode)
       register rtx x;
       register rtx oldx ATTRIBUTE_UNUSED;
!      enum machine_mode mode ATTRIBUTE_UNUSED;
  {
    if (flag_pic && SYMBOLIC_CONST (x))
      return legitimize_pic_address (x, 0);
*************** legitimize_address (x, oldx, mode)
*** 1154,1163 ****
  }
  
  
! /* Output branch conditions.  */
  
  static void
! output_branch_condition (FILE *file, rtx code)
  {
    switch (GET_CODE (code)) 
      {
--- 1199,1211 ----
  }
  
  
! /* Output branch condition code of CODE in assembler
!    syntax to stdio stream FILE.  */
  
  static void
! output_branch_condition (file, code)
!      FILE *file;
!      rtx code;
  {
    switch (GET_CODE (code)) 
      {
*************** output_branch_condition (FILE *file, rtx
*** 1188,1195 ****
      }
  }
  
  static void
! output_inverse_branch_condition (FILE *file, rtx code)
  {
    switch (GET_CODE (code)) 
      {
--- 1236,1248 ----
      }
  }
  
+ /* Output the inverse of the branch condition code of CODE 
+    in assembler syntax to stdio stream FILE.  */
+ 
  static void
! output_inverse_branch_condition (file, code)
!      FILE *file;
!      rtx code;
  {
    switch (GET_CODE (code)) 
      {
*************** output_inverse_branch_condition (FILE *f
*** 1220,1229 ****
      }
  }
  
! /* Output a symbolic constant.  */
  
  void
! s390_output_symbolic_const (FILE *file, rtx x)
  {
    switch (GET_CODE (x))
      {
--- 1273,1285 ----
      }
  }
  
! /* Output symbolic constant X in assembler syntax to 
!    stdio stream FILE.  */
  
  void
! s390_output_symbolic_const (file, x)
!      FILE *file;
!      rtx x;
  {
    switch (GET_CODE (x))
      {
*************** s390_output_symbolic_const (FILE *file, 
*** 1303,1312 ****
      }
  }
  
! /* Output an address operand.  */
  
  void
! print_operand_address (FILE *file, rtx addr)
  {
    struct s390_address ad;
  
--- 1359,1371 ----
      }
  }
  
! /* Output address operand ADDR in assembler syntax to 
!    stdio stream FILE.  */
  
  void
! print_operand_address (file, addr)
!      FILE *file;
!      rtx addr;
  {
    struct s390_address ad;
  
*************** print_operand_address (FILE *file, rtx a
*** 1325,1334 ****
      fprintf (file, "(%s)", reg_names[REGNO (ad.base)]);
  }
  
! /* Output an operand.  */
  
  void
! print_operand (FILE *file, rtx x, char code)
  {
    switch (code)
      {
--- 1384,1411 ----
      fprintf (file, "(%s)", reg_names[REGNO (ad.base)]);
  }
  
! /* Output operand X in assembler syntax to stdio stream FILE.  
!    CODE specified the format flag.  The following format flags 
!    are recognized:
! 
!     'C': print opcode suffix for branch condition.
!     'D': print opcode suffix for inverse branch condition.
!     'Y': print current constant pool address (pc-relative).
!     'y': print current constant pool address (absolute).
!     'O': print only the displacement of a memory reference.
!     'R': print only the base register of a memory reference.
!     'N': print the second word of a DImode operand.
!     'M': print the second word of a TImode operand.
! 
!     'b': print integer X as if it's a unsigned byte.
!     'x': print integer X as if it's a unsigned word.
!     'h': print integer X as if it's a signed word.  */
  
  void
! print_operand (file, x, code)
!      FILE *file;
!      rtx x;
!      int code;
  {
    switch (code)
      {
*************** print_operand (FILE *file, rtx x, char c
*** 1355,1361 ****
          if (GET_CODE (x) != MEM
              || !s390_decompose_address (XEXP (x, 0), &ad, TRUE)
              || ad.indx)
!           abort();
  
          if (ad.disp)
            s390_output_symbolic_const (file, ad.disp);
--- 1432,1438 ----
          if (GET_CODE (x) != MEM
              || !s390_decompose_address (XEXP (x, 0), &ad, TRUE)
              || ad.indx)
!           abort ();
  
          if (ad.disp)
            s390_output_symbolic_const (file, ad.disp);
*************** print_operand (FILE *file, rtx x, char c
*** 1371,1377 ****
          if (GET_CODE (x) != MEM
              || !s390_decompose_address (XEXP (x, 0), &ad, TRUE)
              || ad.indx)
!           abort();
  
          if (ad.base)
            fprintf (file, "%s", reg_names[REGNO (ad.base)]);
--- 1448,1454 ----
          if (GET_CODE (x) != MEM
              || !s390_decompose_address (XEXP (x, 0), &ad, TRUE)
              || ad.indx)
!           abort ();
  
          if (ad.base)
            fprintf (file, "%s", reg_names[REGNO (ad.base)]);
*************** print_operand (FILE *file, rtx x, char c
*** 1386,1392 ****
        else if (GET_CODE (x) == MEM)
  	x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 4));
        else
!         abort();
        break;
  
      case 'M':
--- 1463,1469 ----
        else if (GET_CODE (x) == MEM)
  	x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 4));
        else
!         abort ();
        break;
  
      case 'M':
*************** print_operand (FILE *file, rtx x, char c
*** 1395,1401 ****
        else if (GET_CODE (x) == MEM)
  	x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 8));
        else
!         abort();
        break;
      }
  
--- 1472,1478 ----
        else if (GET_CODE (x) == MEM)
  	x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 8));
        else
!         abort ();
        break;
      }
  
*************** print_operand (FILE *file, rtx x, char c
*** 1437,1447 ****
  
  #define DEBUG_SCHED 0
  
! /* True, if register regno is used  for forming a memory address in
!    a expression x.  */
  
  static int
! reg_used_in_mem_p (int regno, rtx x)
  {
    enum rtx_code code = GET_CODE (x);
    int i, j;
--- 1514,1526 ----
  
  #define DEBUG_SCHED 0
  
! /* Returns true if register REGNO is used  for forming 
!    a memory address in expression X.  */
  
  static int
! reg_used_in_mem_p (regno, x)
!      int regno;
!      rtx x;
  {
    enum rtx_code code = GET_CODE (x);
    int i, j;
*************** reg_used_in_mem_p (int regno, rtx x)
*** 1469,1479 ****
    return 0;
  }
  
! /* Returns true, if expression dep_rtx sets a address register
!    used by instruction insn to address memory.  */
  
  static int 
! addr_generation_dependency_p (rtx dep_rtx, rtx insn)
  {
    rtx target;
  
--- 1548,1560 ----
    return 0;
  }
  
! /* Returns true if expression DEP_RTX sets a address register
!    used by instruction INSN to address memory.  */
  
  static int 
! addr_generation_dependency_p (dep_rtx, insn)
!      rtx dep_rtx; 
!      rtx insn;
  {
    rtx target;
  
*************** addr_generation_dependency_p (rtx dep_rt
*** 1496,1511 ****
  }
  
  
! /* Data dependencies are all handled without delay. But if an register
!    is changed for a memory access, at least 4 cycle need to be put
!    between the set of the register and the use. Because of that,
!    the delays specified in the .md file needs to check and adjust
!    to the right cost.  */
  
  int
! s390_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost )
  {
!   rtx dep_rtx, dest, x;
    int i;
  
    /* If the dependence is an anti-dependence, there is no cost.  For an
--- 1577,1599 ----
  }
  
  
! /* Return the modified cost of the dependency of instruction INSN
!    on instruction DEP_INSN through the link LINK.  COST is the 
!    default cost of that dependency.
! 
!    Data dependencies are all handled without delay.  However, if a
!    register is modified and subsequently used as base or index 
!    register of a memory reference, at least 4 cycles need to pass
!    between setting and using the register to avoid pipeline stalls.  */
  
  int
! s390_adjust_cost (insn, link, dep_insn, cost)
!      rtx insn;
!      rtx link;
!      rtx dep_insn;
!      int cost;
  {
!   rtx dep_rtx;
    int i;
  
    /* If the dependence is an anti-dependence, there is no cost.  For an
*************** s390_adjust_cost (rtx insn, rtx link, rt
*** 1574,1594 ****
       dumped
       - in this case, a branch from one chunk to other chunk needs
         a reload of base register at the code label branched to.  */
- 
- 
- 
- rtx s390_pool_start_insn = NULL_RTX;
- 
- /* Count of actual pool in function (-1 -> before function).  */
  
  int s390_pool_count = -1;
  
  
  static int pool_stop_uid;
  
  
  void 
! s390_asm_output_pool_prologue (FILE *file, char *fname, tree fndecl, int size)
  {
  
    if (s390_pool_count>0) {
--- 1662,1692 ----
       dumped
       - in this case, a branch from one chunk to other chunk needs
         a reload of base register at the code label branched to.  */
  
+ /* Index of constant pool chunk that is currently being processed.
+    Set to -1 before function output has started.  */
  int s390_pool_count = -1;
  
+ /* First insn using the constant pool chunk that is currently being
+    processed.  */
+ rtx s390_pool_start_insn = NULL_RTX;
  
+ /* UID of last insn using the constant pool chunk that is currently 
+    being processed.  */
  static int pool_stop_uid;
  
+ /* Called from the ASM_OUTPUT_POOL_PROLOGUE macro to 
+    prepare for printing a literal pool chunk to stdio stream FILE.  
  
+    FNAME and FNDECL specify the name and type of the current function.
+    SIZE is the size in bytes of the current literal pool.  */
+  
  void 
! s390_asm_output_pool_prologue (file, fname, fndecl, size)
!      FILE *file;
!      const char *fname ATTRIBUTE_UNUSED;
!      tree fndecl;
!      int size ATTRIBUTE_UNUSED;
  {
  
    if (s390_pool_count>0) {
*************** s390_asm_output_pool_prologue (FILE *fil
*** 1600,1606 ****
  	fprintf (file, "\tlarl\t%s,.LT%X_%X\n", 
  		 reg_names[BASE_REGISTER],
  		 s390_function_count, s390_pool_count);
! 	readonly_data_section();
  	ASM_OUTPUT_ALIGN (file, floor_log2 (3));
  	fprintf (file, ".LT%X_%X:\t# Pool %d\n",
  		 s390_function_count, s390_pool_count, s390_pool_count);
--- 1698,1704 ----
  	fprintf (file, "\tlarl\t%s,.LT%X_%X\n", 
  		 reg_names[BASE_REGISTER],
  		 s390_function_count, s390_pool_count);
! 	readonly_data_section ();
  	ASM_OUTPUT_ALIGN (file, floor_log2 (3));
  	fprintf (file, ".LT%X_%X:\t# Pool %d\n",
  		 s390_function_count, s390_pool_count, s390_pool_count);
*************** s390_asm_output_pool_prologue (FILE *fil
*** 1614,1625 ****
      function_section (fndecl);
  }
  
! /* Check if other addr is in different chunk than my addr,
!    return symbol_ref to other pool in that case.  */
  
- 
  static int
! other_chunk (int *ltorg, int my_addr, int other_addr)
  {
    int ad, i=0, j=0;
  
--- 1712,1726 ----
      function_section (fndecl);
  }
  
! /* Return true if OTHER_ADDR is in different chunk than MY_ADDR.
!    LTORG points to a list of all literal pools inserted
!    into the current function.  */
  
  static int
! other_chunk (ltorg, my_addr, other_addr)
!      int *ltorg;
!      int my_addr;
!      int other_addr;
  {
    int ad, i=0, j=0;
  
*************** other_chunk (int *ltorg, int my_addr, in
*** 1639,1648 ****
    return 1;
  }
  
! /* Check, if other label is to far away to branch relative.  */
  
  static int 
! far_away (int my_addr, int other_addr)
  {
    /* In 64 bit mode we can jump +- 4GB.  */
    if (TARGET_64BIT)
--- 1740,1752 ----
    return 1;
  }
  
! /* Return true if OTHER_ADDR is too far away from MY_ADDR
!    to use a relative branch instruction.  */
  
  static int 
! far_away (my_addr, other_addr)
!      int my_addr;
!      int other_addr;
  {
    /* In 64 bit mode we can jump +- 4GB.  */
    if (TARGET_64BIT)
*************** far_away (int my_addr, int other_addr)
*** 1651,1661 ****
      return 1;
    return 0;
  }
- 
  
  
  static rtx 
! check_and_change_labels (rtx insn, int *ltorg_uids)
  {
    rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM);
    rtx target, jump;
--- 1755,1773 ----
      return 1;
    return 0;
  }
  
+ /* Go through all insns in the current function (starting
+    at INSN), replacing branch insn if necessary.  A branch
+    needs to be modified if either the distance to the 
+    target is too far to use a relative branch, or if the
+    target uses a different literal pool than the origin.
+    LTORG_UIDS points to a list of all literal pool insns
+    that have been inserted.  */
  
  static rtx 
! check_and_change_labels (insn, ltorg_uids)
!      rtx insn;
!      int *ltorg_uids;
  {
    rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM);
    rtx target, jump;
*************** check_and_change_labels (rtx insn, int *
*** 1792,1804 ****
    return insn;
  }
  
! static int chunk_max=0;
  
! void
! s390_final_chunkify (int chunkify)
  {
    rtx insn, ninsn, tmp;
!   int addr, naddr, uids;
  
    const char *asms;
  
--- 1904,1921 ----
    return insn;
  }
  
! /* Called from s390_function_prologue to make final adjustments
!    before outputting code.  CHUNKIFY specifies whether we need
!    to use multiple literal pools (because the total size of the
!    literals exceeds 4K).  */
  
! static void
! s390_final_chunkify (chunkify)
!      int chunkify;
  {
    rtx insn, ninsn, tmp;
!   int addr, naddr = 0, uids;
!   int chunk_max = 0;
  
    const char *asms;
  
*************** s390_final_chunkify (int chunkify)
*** 1850,1856 ****
  		  fprintf (stderr, "s390 multiple literalpool support:"
  			   "\n No code label between this insn %X %X",
  			   naddr, INSN_ADDRESSES (INSN_UID (tmp)));
! 		  abort();
  		}
  	    }
  	  if (tmp == NULL) 
--- 1967,1973 ----
  		  fprintf (stderr, "s390 multiple literalpool support:"
  			   "\n No code label between this insn %X %X",
  			   naddr, INSN_ADDRESSES (INSN_UID (tmp)));
! 		  abort ();
  		}
  	    }
  	  if (tmp == NULL) 
*************** s390_final_chunkify (int chunkify)
*** 1904,1916 ****
      }
    pool_stop_uid = ltorg_uids[0];
  }
- 
- /* Return 1 if next literal pool is reached (check for ltorg insn)
-    maybe should use unspec insn.  */
  
  
  int 
! s390_stop_dump_lit_p (rtx insn)
  {
    rtx body=PATTERN (insn);
    if (GET_CODE (body) == PARALLEL
--- 2021,2032 ----
      }
    pool_stop_uid = ltorg_uids[0];
  }
  
+ /* Return true if INSN is a 'ltorg' insn.  */
  
  int 
! s390_stop_dump_lit_p (insn)
!     rtx insn;
  {
    rtx body=PATTERN (insn);
    if (GET_CODE (body) == PARALLEL
*************** s390_stop_dump_lit_p (rtx insn)
*** 1926,1933 ****
      return 0;   
  }
  
  void
! s390_dump_literal_pool (rtx act_insn, rtx stop)
  {
    s390_pool_start_insn = act_insn;
    pool_stop_uid = INTVAL (stop);
--- 2042,2054 ----
      return 0;   
  }
  
+ /* Output literal pool chunk to be used for insns
+    between insn ACT_INSN and the insn with UID STOP.  */
+ 
  void
! s390_dump_literal_pool (act_insn, stop)
!      rtx act_insn;
!      rtx stop;
  {
    s390_pool_start_insn = act_insn;
    pool_stop_uid = INTVAL (stop);
*************** extern char *dwarf2out_cfi_label PARAMS 
*** 1942,1957 ****
  #endif
  
  /* Flag set in prologue, used in epilog to know
!   if stack is allocated or not.  */
! 
  static int leaf_function_flag;
! rtx s390_got_label;
  rtx s390_profile[10];
  int s390_nr_constants;
  
! /* Returns 1 if floating point registers need to be saved.  */
  
! static int save_fprs_p()
  {
    int i;
    if (!TARGET_64BIT)
--- 2063,2082 ----
  #endif
  
  /* Flag set in prologue, used in epilog to know
!    if stack is allocated or not.  */
  static int leaf_function_flag;
! 
! /* Symbol references needed by the profile code;
!    set up by the function prologue routine if necessary.  */
  rtx s390_profile[10];
+ 
+ /* Number of elements of current constant pool.  */
  int s390_nr_constants;
  
! /* Return true if floating point registers need to be saved.  */
  
! static int 
! save_fprs_p ()
  {
    int i;
    if (!TARGET_64BIT)
*************** static int save_fprs_p()
*** 1964,1971 ****
    return 0;
  }
  
! /* Current function is a leaf function, without automatics,
!    alloca or vararg stuff.  */
  
  static int
  cur_is_leaf_function ()
--- 2089,2096 ----
    return 0;
  }
  
! /* Return true if urrent function is a leaf function, 
!    without automatics, alloca or vararg stuff.  */
  
  static int
  cur_is_leaf_function ()
*************** cur_is_leaf_function ()
*** 1980,1989 ****
    return 0;
  }
  
! /* Calculate offset between argument pointer and frame pointer 
!    initialy after prologue.  */
  
! int s390_arg_frame_offset ()
  {
    int lsize =  get_frame_size () + current_function_outgoing_args_size
      + save_fprs_p () * 64;
--- 2105,2115 ----
    return 0;
  }
  
! /* Return offset between argument pointer and frame pointer 
!    initially after prologue.  */
  
! int 
! s390_arg_frame_offset ()
  {
    int lsize =  get_frame_size () + current_function_outgoing_args_size
      + save_fprs_p () * 64;
*************** int s390_arg_frame_offset ()
*** 1994,2002 ****
      return 2*STACK_POINTER_OFFSET + lsize;
  }
  
! /* Save Floating point register on current stack.  */
  
! static int save_fprs(FILE *file, long offset, int fp)
  {
    int i;
  
--- 2120,2134 ----
      return 2*STACK_POINTER_OFFSET + lsize;
  }
  
! /* Output code to stdio stream FILE to save floating point 
!    registers on current stack, at offset OFFSET to the frame
!    pointer register FP.  */
  
! static int 
! save_fprs (file, offset, fp)
!      FILE *file;
!      long offset;
!      int fp;
  {
    int i;
  
*************** static int save_fprs(FILE *file, long of
*** 2007,2028 ****
      {
        if (regs_ever_live[i] == 1)
  	{
! 	  fprintf (file, "\tstd\t%s,%d(%s)\n", reg_names[i], 
  		   (i-24) * 8 + offset, reg_names[fp]); 
  	}
      }
  }
  
! /* Restore Floating point register on current stack.  */
  
! static int restore_fprs(FILE *file, long offset, int fp)
  {
    int i;
  
    if (!TARGET_64BIT)
      return 0;
  
!   if (!save_fprs_p())
      return 0;
  
    if (offset < 0) 
--- 2139,2168 ----
      {
        if (regs_ever_live[i] == 1)
  	{
! 	  fprintf (file, "\tstd\t%s,%ld(%s)\n", reg_names[i], 
  		   (i-24) * 8 + offset, reg_names[fp]); 
  	}
      }
+ 
+   return 1;
  }
  
! /* Output code to stdio stream FILE to restore floating point 
!    registers from current stack, at offset OFFSET to the frame
!    pointer register FP.  */
  
! static int 
! restore_fprs (file, offset, fp)
!      FILE *file;
!      long offset;
!      int fp;
  {
    int i;
  
    if (!TARGET_64BIT)
      return 0;
  
!   if (!save_fprs_p ())
      return 0;
  
    if (offset < 0) 
*************** static int restore_fprs(FILE *file, long
*** 2038,2053 ****
      {
        if (regs_ever_live[i] == 1)
  	{
! 	  fprintf (file, "\tld\t%s,%d(%s)\n", reg_names[i], 
  		   (i-24) * 8 + offset, reg_names[fp]); 
  	}
      }
  }
  
! /* Output constant pool in function prologue (31 bit) or in readonly section.  */ 
  
! static int
! s390_output_constant_pool(FILE* file)
  {
    /* Output constant pool.  */
    if (s390_nr_constants || regs_ever_live[BASE_REGISTER])
--- 2178,2196 ----
      {
        if (regs_ever_live[i] == 1)
  	{
! 	  fprintf (file, "\tld\t%s,%ld(%s)\n", reg_names[i], 
  		   (i-24) * 8 + offset, reg_names[fp]); 
  	}
      }
+ 
+   return 1;
  }
  
! /* Output main constant pool to stdio stream FILE.  */ 
  
! static void
! s390_output_constant_pool (file)
!      FILE *file;
  {
    /* Output constant pool.  */
    if (s390_nr_constants || regs_ever_live[BASE_REGISTER])
*************** s390_output_constant_pool(FILE* file)
*** 2057,2063 ****
  	{
  	  fprintf (file, "\tlarl\t%s,.LT%X_%X\n", reg_names[BASE_REGISTER],
  		   s390_function_count, s390_pool_count);
! 	  readonly_data_section();
  	  ASM_OUTPUT_ALIGN (file, floor_log2 (3));
  	}
        else
--- 2200,2206 ----
  	{
  	  fprintf (file, "\tlarl\t%s,.LT%X_%X\n", reg_names[BASE_REGISTER],
  		   s390_function_count, s390_pool_count);
! 	  readonly_data_section ();
  	  ASM_OUTPUT_ALIGN (file, floor_log2 (3));
  	}
        else
*************** s390_output_constant_pool(FILE* file)
*** 2070,2086 ****
        fprintf (file, ".LTN%X_%X:\n", s390_function_count,
  	       s390_pool_count);
        if (TARGET_64BIT)
! 	function_section(current_function_decl);
        
        regs_ever_live[BASE_REGISTER] = 1;
      }
  }
- 
  
! /* This function generates the assembly code for function entry.  */
  
  static rtx
! s390_force_const_mem_late (rtx cst)
  {
    cst = force_const_mem (Pmode, cst);
  
--- 2213,2232 ----
        fprintf (file, ".LTN%X_%X:\n", s390_function_count,
  	       s390_pool_count);
        if (TARGET_64BIT)
! 	function_section (current_function_decl);
        
        regs_ever_live[BASE_REGISTER] = 1;
      }
  }
  
! /* Add constant CTX to the constant pool at a late time 
!    (after the initial pass to count the number of constants
!    was already done).  Returns the resulting constant 
!    pool reference.  */
  
  static rtx
! s390_force_const_mem_late (cst)
!      rtx cst;
  {
    cst = force_const_mem (Pmode, cst);
  
*************** s390_force_const_mem_late (rtx cst)
*** 2092,2099 ****
    return cst;
  }
  
  static rtx
! s390_force_const_mem_symbol (char *name, int func, int global)
  {
    rtx symbol;
  
--- 2238,2254 ----
    return cst;
  }
  
+ /* Add a reference to the symbol NAME to the constant pool.
+    FUNC specifies whether NAME refers to a function, while
+    GLOBAL specifies whether NAME is a global symbol.  Depending
+    on these flags, the appopriate PLT or GOT references are
+    generated.  Returns the constant pool reference.  */
+ 
  static rtx
! s390_force_const_mem_symbol (name, func, global)
!      const char *name;
!      int func;
!      int global;
  {
    rtx symbol;
  
*************** s390_force_const_mem_symbol (char *name,
*** 2121,2135 ****
    return s390_force_const_mem_late (symbol);
  }
  
! /* This function generates the assembly code for function entry.  */
  
  void
! s390_function_prologue (FILE *file, HOST_WIDE_INT lsize)
  {
    extern int profile_label_no;
    int i, j;
    long frame_size;
!   rtx stack_label = 0, got_label = 0, tmp;
    char *l;
    char b64[2] = " ";
    b64[0] = TARGET_64BIT ? 'g' : '\0';
--- 2276,2294 ----
    return s390_force_const_mem_late (symbol);
  }
  
! /* Output the function prologue assembly code to the 
!    stdio stream FILE.  The local frame size is passed
!    in LSIZE.  */
  
  void
! s390_function_prologue (file, lsize)
!      FILE *file;
!      HOST_WIDE_INT lsize;
  {
    extern int profile_label_no;
    int i, j;
    long frame_size;
!   rtx stack_label = 0, got_label = 0;
    char *l;
    char b64[2] = " ";
    b64[0] = TARGET_64BIT ? 'g' : '\0';
*************** s390_function_prologue (FILE *file, HOST
*** 2335,2348 ****
  	}
  
        
!       if (save_fprs_p() && frame_size > 4095) 
  	{
  	  int fp = 1;
- 	  int offset = 0;
  	  fprintf (file, "\tlgr\t%s,%s\n", reg_names[fp], 
  		   reg_names[STACK_POINTER_REGNUM]); 
  	  fprintf (file, "\taghi\t%s,-64\n", reg_names[fp]);
! 	  save_fprs(file, 0, fp);
  	}
  
        /* Decrement stack.  */
--- 2494,2506 ----
  	}
  
        
!       if (save_fprs_p () && frame_size > 4095) 
  	{
  	  int fp = 1;
  	  fprintf (file, "\tlgr\t%s,%s\n", reg_names[fp], 
  		   reg_names[STACK_POINTER_REGNUM]); 
  	  fprintf (file, "\taghi\t%s,-64\n", reg_names[fp]);
! 	  save_fprs (file, 0, fp);
  	}
  
        /* Decrement stack.  */
*************** s390_function_prologue (FILE *file, HOST
*** 2370,2376 ****
  	}
        else
  	{
! 	  fprintf (file, "\ta%shi\t%s,-%d\n",b64, 
  		   reg_names[STACK_POINTER_REGNUM], frame_size);
  	}
  #ifdef INCOMING_RETURN_ADDR_RTX
--- 2528,2534 ----
  	}
        else
  	{
! 	  fprintf (file, "\ta%shi\t%s,-%ld\n",b64, 
  		   reg_names[STACK_POINTER_REGNUM], frame_size);
  	}
  #ifdef INCOMING_RETURN_ADDR_RTX
*************** s390_function_prologue (FILE *file, HOST
*** 2432,2441 ****
    return;
  }
  
! /* This function generates the assembly code for function exit.  */
  
  void
! s390_function_epilogue (FILE *file, HOST_WIDE_INT lsize)
  {
  /* Register is call clobbered and not used for eh or return.  */
  #define FREE_REG 4
--- 2590,2603 ----
    return;
  }
  
! /* Output the function epilogue assembly code to the 
!    stdio stream FILE.  The local frame size is passed
!    in LSIZE.  */
  
  void
! s390_function_epilogue (file, lsize)
!      FILE *file;
!      HOST_WIDE_INT lsize;
  {
  /* Register is call clobbered and not used for eh or return.  */
  #define FREE_REG 4
*************** s390_function_epilogue (FILE *file, HOST
*** 2532,2552 ****
    return;
  }
  
- /* For structs of odd size the address is passed as reference. 
-    Complex number are also passes on the stack. 
- 
-    Note: We don't use mode, since a struct with the following format 
-    is BLKmode, but has size 4.
-    struct 
-      {
-        char a;
-        char b[3]
-      }. 
-    The ABI states, that this value has to be passed in register.  */
  
  
  static int
! s390_function_arg_size (enum machine_mode mode, tree type)
  {
    if (type)
      return int_size_in_bytes (type);
--- 2694,2708 ----
    return;
  }
  
  
+ /* Return the size in bytes of a function argument of 
+    type TYPE and/or mode MODE.  At least one of TYPE or
+    MODE must be specified.  */
  
  static int
! s390_function_arg_size (mode, type)
!      enum machine_mode mode;
!      tree type;
  {
    if (type)
      return int_size_in_bytes (type);
*************** s390_function_arg_size (enum machine_mod
*** 2556,2566 ****
      return GET_MODE_SIZE (mode);
  
    /* If we have neither type nor mode, abort */
!   fatal_error ("no type info available for BLKmode\n");
  }
  
  int
! s390_function_arg_pass_by_reference (enum machine_mode mode, tree type)
  {
    int size = s390_function_arg_size (mode, type);
  
--- 2712,2730 ----
      return GET_MODE_SIZE (mode);
  
    /* If we have neither type nor mode, abort */
!   abort ();
  }
  
+ /* Return 1 if a function argument of type TYPE and mode MODE
+    is to be passed by reference.  The ABI specifies that only
+    structures of size 1, 2, 4, or 8 bytes are passed by value,
+    all other structures (and complex numbers) are passed by
+    reference.  */
+ 
  int
! s390_function_arg_pass_by_reference (mode, type)
!      enum machine_mode mode;
!      tree type;
  {
    int size = s390_function_arg_size (mode, type);
  
*************** s390_function_arg_pass_by_reference (enu
*** 2579,2589 ****
  
  /* Update the data in CUM to advance over an argument of mode MODE and
     data type TYPE.  (TYPE is null for libcalls where that information
!    may not be available.).  */
  
  void
! s390_function_arg_advance (CUMULATIVE_ARGS * cum,
! 		      enum machine_mode mode, tree type, int named)
  {
    if (! TARGET_SOFT_FLOAT && (mode == DFmode || mode == SFmode))
      {
--- 2743,2758 ----
  
  /* Update the data in CUM to advance over an argument of mode MODE and
     data type TYPE.  (TYPE is null for libcalls where that information
!    may not be available.).  The boolean NAMED specifies whether the
!    argument is a named argument (as opposed to an unnamed argument
!    matching an ellipsis).  */
  
  void
! s390_function_arg_advance (cum, mode, type, named)
!      CUMULATIVE_ARGS *cum;
!      enum machine_mode mode;
!      tree type;
!      int named ATTRIBUTE_UNUSED;
  {
    if (! TARGET_SOFT_FLOAT && (mode == DFmode || mode == SFmode))
      {
*************** s390_function_arg_advance (CUMULATIVE_AR
*** 2600,2616 ****
      }
  }
  
  
- 
- /* Define where to put the arguments to a function.  Value is zero to push
-    the argument on the stack, or a hard register in which to store the
-    argument. Gprs 2-6 and Fprs 0 and 2 are used as arguments.
-    All integral values go into register, until all are used up, the rest
-    goes onto stack. The same is valid for floating-point values.  */
- 
  rtx
! s390_function_arg (CUMULATIVE_ARGS * cum,
! 	      enum machine_mode mode, tree type, int named)
  {
    if (s390_function_arg_pass_by_reference (mode, type))
        return 0;
--- 2769,2799 ----
      }
  }
  
+ /* Define where to put the arguments to a function.
+    Value is zero to push the argument on the stack,
+    or a hard register in which to store the argument.
+ 
+    MODE is the argument's machine mode.
+    TYPE is the data type of the argument (as a tree).
+     This is null for libcalls where that information may
+     not be available.
+    CUM is a variable of type CUMULATIVE_ARGS which gives info about
+     the preceding args and about the function being called.
+    NAMED is nonzero if this argument is a named parameter
+     (otherwise it is an extra parameter matching an ellipsis).  
+ 
+    On S/390, we use general purpose registers 2 through 6 to
+    pass integer, pointer, and certain structure arguments, and
+    floating point registers 0 and 2 (0, 2, 4, and 6 on 64-bit)
+    to pass floating point arguments.  All remaining arguments
+    are pushed to the stack.  */
  
  rtx
! s390_function_arg (cum, mode, type, named)
!      CUMULATIVE_ARGS *cum;
!      enum machine_mode mode;
!      tree type;
!      int named ATTRIBUTE_UNUSED;
  {
    if (s390_function_arg_pass_by_reference (mode, type))
        return 0;
*************** s390_function_arg (CUMULATIVE_ARGS * cum
*** 2635,2648 ****
  }
  
  
! /* Builtin va_list stuff
!    va_list is a structure of four elements:
!       __gpr:  number of named args passed in general purpose register 
!       __gpr:  number of named args passed in floating purpose register 
!       __overflow_arg_area:  address of area, where arguments are passed
!                           if they do not fit in gprs 2 to 6 and fpr 0 and 2
!       __reg_save_area:  address, where register passed args are saved 
!                       in prologue.  */
  
  tree
  s390_build_va_list ()
--- 2818,2844 ----
  }
  
  
! /* Create and return the va_list datatype.
! 
!    On S/390, va_list is an array type equivalent to
! 
!       typedef struct __va_list_tag
!         {
!             long __gpr;
!             long __fpr;
!             void *__overflow_arg_area;
!             void *__reg_save_area;
!             
!         } va_list[1];
! 
!    where __gpr and __fpr hold the number of general purpose
!    or floating point arguments used up to now, respectively,
!    __overflow_arg_area points to the stack location of the 
!    next argument passed on the stack, and __reg_save_area
!    always points to the start of the register area in the
!    call frame of the current function.  The function prologue
!    saves all registers used for argument passing into this
!    area if the function uses variable arguments.  */
  
  tree
  s390_build_va_list ()
*************** s390_build_va_list ()
*** 2681,2697 ****
    return build_array_type (record, build_index_type (size_zero_node));
  }
  
! /* Builtin va_start 
!    The va_list struct is set with the values.
!    gpr: compile time known got out of  current_function_args_info
!    fpr: compile time known got out of  current_function_args_info
!    overflow_arg_area: address passed with register 7 (incoming args register)
!                   (setup in prologue)
!    reg_save_area: address of save area where first 5 gprs and 2 fprs sare 
!                   saved (saved in prologue).  */
  
  void
! s390_va_start (int stdarg_p, tree valist, rtx nextarg)
  {
    HOST_WIDE_INT n_gpr, n_fpr;
    int off;
--- 2877,2901 ----
    return build_array_type (record, build_index_type (size_zero_node));
  }
  
! /* Implement va_start by filling the va_list structure VALIST.
!    STDARG_P is true if implementing __builtin_stdarg_va_start,
!    false if implementing __builtin_varargs_va_start.  NEXTARG
!    points to the first anonymous stack argument.
! 
!    The following global variables are used to initalize
!    the va_list structure:
! 
!      current_function_args_info:
!        holds number of gprs and fprs used for named arguments.
!      current_function_arg_offset_rtx:
!        holds the offset of the first anonymous stack argument
!        (relative to the virtual arg pointer).  */
  
  void
! s390_va_start (stdarg_p, valist, nextarg)
!      int stdarg_p;
!      tree valist;
!      rtx nextarg ATTRIBUTE_UNUSED;
  {
    HOST_WIDE_INT n_gpr, n_fpr;
    int off;
*************** s390_va_start (int stdarg_p, tree valist
*** 2748,2757 ****
    expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
  }
  
! 
! /* Builtin va_arg.  
     
!    Works like following:
     
     if (integral value) {
       if (size  <= 4 && args.gpr < 5 ||
--- 2952,2962 ----
    expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
  }
  
! /* Implement va_arg by updating the va_list structure 
!    VALIST as required to retrieve an argument of type
!    TYPE, and returning that argument. 
     
!    Generates code equivalent to:
     
     if (integral value) {
       if (size  <= 4 && args.gpr < 5 ||
*************** s390_va_start (int stdarg_p, tree valist
*** 2771,2779 ****
         ret = **args.overflow_arg_area++;
     } */
  
- 
  rtx
! s390_va_arg (tree valist, tree type)
  {
    tree f_gpr, f_fpr, f_ovf, f_sav;
    tree gpr, fpr, ovf, sav, reg, t, u;
--- 2976,2985 ----
         ret = **args.overflow_arg_area++;
     } */
  
  rtx
! s390_va_arg (valist, type)
!      tree valist;
!      tree type;
  {
    tree f_gpr, f_fpr, f_ovf, f_sav;
    tree gpr, fpr, ovf, sav, reg, t, u;
*************** s390_va_arg (tree valist, tree type)
*** 2931,2944 ****
  
    return addr_rtx;
  }
  
! /* Implementation of Trampoline
!    Gpr 1 is used as base register and for the jump
!    to the nested function. 
!    Gpr 0 is static chain.  */
  
  void
! s390_trampoline_template (FILE * file)
  {
    if (TARGET_64BIT)
      {
--- 3137,3153 ----
  
    return addr_rtx;
  }
+ 
  
! /* Output assembly code for the trampoline template to
!    stdio stream FILE.
  
+    On S/390, we use gpr 1 internally in the trampoline code;
+    gpr 0 is used to hold the static chain.  */
+ 
  void
! s390_trampoline_template (file)
!      FILE *file;
  {
    if (TARGET_64BIT)
      {
*************** s390_trampoline_template (FILE * file)
*** 2960,2965 ****
--- 3169,3178 ----
      }
  }
  
+ /* Emit RTL insns to initialize the variable parts of a trampoline.
+    FNADDR is an RTX for the address of the function's pure code.
+    CXT is an RTX for the static chain value for the function.  */
+ 
  void
  s390_initialize_trampoline (addr, fnaddr, cxt)
       rtx addr;
*************** s390_initialize_trampoline (addr, fnaddr
*** 2969,2977 ****
    emit_move_insn (gen_rtx 
  		  (MEM, Pmode,
  		   memory_address (Pmode, 
! 		   plus_constant (addr,(TARGET_64BIT ? 20 : 12) ))), cxt);
    emit_move_insn (gen_rtx
  		  (MEM, Pmode,
  		   memory_address (Pmode, 
! 		   plus_constant (addr,(TARGET_64BIT ? 28 : 16) ))), fnaddr);
  }
--- 3182,3190 ----
    emit_move_insn (gen_rtx 
  		  (MEM, Pmode,
  		   memory_address (Pmode, 
! 		   plus_constant (addr, (TARGET_64BIT ? 20 : 12) ))), cxt);
    emit_move_insn (gen_rtx
  		  (MEM, Pmode,
  		   memory_address (Pmode, 
! 		   plus_constant (addr, (TARGET_64BIT ? 28 : 16) ))), fnaddr);
  }
Index: gcc/config/s390/s390.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.h,v
retrieving revision 1.2
diff -c -p -r1.2 s390.h
*** s390.h	2001/08/11 20:56:12	1.2
--- s390.h	2001/08/11 20:57:29
*************** extern int target_flags;
*** 48,69 ****
     An empty string NAME is used to identify the default VALUE.  */
  
  #define TARGET_SWITCHES           		       		       \
! { { "hard-float",    1,N_("Use hardware fp")},         		       \
!   { "soft-float",   -1,N_("Don't use hardware fp")},	      	       \
!   { "backchain",     2,N_("Set backchain")},           		       \
!   { "no-backchain", -2,N_("Don't set backchain (faster, but debug harder")}, \
!   { "small-exec",    4,N_("Use bras for execucable < 64k")},           \
!   { "no-small-exec",-4,N_("Don't use bras")},            	       \
!   { "debug",         8,N_("Additional debug prints")},        	       \
!   { "no-debug",     -8,N_("Don't print additional debug prints")},     \
!   { "64",           16,N_("64 bit mode")},         	               \
!   { "31",          -16,N_("31 bit mode")},                             \
!   { "mvcle",        32,N_("mvcle use")},         	               \
!   { "no-mvcle",    -32,N_("mvc&ex")},                                  \
    { "", TARGET_DEFAULT, 0 } }
  
  /* Define this to change the optimizations performed by default.  */
! #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) optimization_options(LEVEL,SIZE)
  
  /* The current function count for create unique internal labels.  */
  
--- 48,69 ----
     An empty string NAME is used to identify the default VALUE.  */
  
  #define TARGET_SWITCHES           		       		       \
! { { "hard-float",    1, N_("Use hardware fp")},         		       \
!   { "soft-float",   -1, N_("Don't use hardware fp")},	      	       \
!   { "backchain",     2, N_("Set backchain")},           		       \
!   { "no-backchain", -2, N_("Don't set backchain (faster, but debug harder")}, \
!   { "small-exec",    4, N_("Use bras for execucable < 64k")},           \
!   { "no-small-exec",-4, N_("Don't use bras")},            	       \
!   { "debug",         8, N_("Additional debug prints")},        	       \
!   { "no-debug",     -8, N_("Don't print additional debug prints")},     \
!   { "64",           16, N_("64 bit mode")},         	               \
!   { "31",          -16, N_("31 bit mode")},                             \
!   { "mvcle",        32, N_("mvcle use")},         	               \
!   { "no-mvcle",    -32, N_("mvc&ex")},                                  \
    { "", TARGET_DEFAULT, 0 } }
  
  /* Define this to change the optimizations performed by default.  */
! #define OPTIMIZATION_OPTIONS(LEVEL, SIZE) optimization_options(LEVEL, SIZE)
  
  /* The current function count for create unique internal labels.  */
  
*************** if (INTEGRAL_MODE_P (MODE) &&	        	 
*** 213,219 ****
  
  /* Standard register usage.  */
   
! #define INT_REGNO_P(N)   ( (N) >= 0 && (N) < 16 )
  #ifdef IEEE_FLOAT
  #define FLOAT_REGNO_P(N) ( (N) >= 16 && (N) < 32 )
  #else
--- 213,219 ----
  
  /* Standard register usage.  */
   
! #define INT_REGNO_P(N)   ( (int)(N) >= 0 && (N) < 16 )
  #ifdef IEEE_FLOAT
  #define FLOAT_REGNO_P(N) ( (N) >= 16 && (N) < 32 )
  #else
*************** CUMULATIVE_ARGS;
*** 682,695 ****
     may not be available.) */
  
  #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)                    \
!   s390_function_arg_advance(&CUM, MODE, TYPE, NAMED)
  
  /* Define where to put the arguments to a function.  Value is zero to push
     the argument on the stack, or a hard register in which to store the
     argument.  */
  
  #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED)   \
!   s390_function_arg(&CUM, MODE, TYPE, NAMED)
  
  /* Define where to expect the arguments of a function.  Value is zero, if
     the argument is on the stack, or a hard register in which the argument
--- 682,695 ----
     may not be available.) */
  
  #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)                    \
!   s390_function_arg_advance (&CUM, MODE, TYPE, NAMED)
  
  /* Define where to put the arguments to a function.  Value is zero to push
     the argument on the stack, or a hard register in which to store the
     argument.  */
  
  #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED)   \
!   s390_function_arg (&CUM, MODE, TYPE, NAMED)
  
  /* Define where to expect the arguments of a function.  Value is zero, if
     the argument is on the stack, or a hard register in which the argument
*************** CUMULATIVE_ARGS;
*** 808,814 ****
  #define FUNCTION_PROFILER(FILE, LABELNO) 			\
  do {                                     			\
    extern rtx s390_profile[];  					\
!   extern s390_pool_count;     					\
    rtx tmp;                                    			\
    static char label[128];                     			\
    fprintf (FILE, "# function profiler \n");   			\
--- 808,814 ----
  #define FUNCTION_PROFILER(FILE, LABELNO) 			\
  do {                                     			\
    extern rtx s390_profile[];  					\
!   extern int s390_pool_count;     				\
    rtx tmp;                                    			\
    static char label[128];                     			\
    fprintf (FILE, "# function profiler \n");   			\
*************** do									           \
*** 1101,1107 ****
        {						                                   \
      	rtx tmp[1];	                                                           \
  	fprintf (FILE, "# block profiler %d block %d \n",                          \
! 			 profile_block_flag,BLOCKNO); 	                           \
  	output_asm_insn ("ipm   14", tmp);              		           \
  	output_asm_insn ("aghi  15,-224", tmp);                           	   \
  	output_asm_insn ("stmg  14,5,160(15)", tmp);             		   \
--- 1101,1107 ----
        {						                                   \
      	rtx tmp[1];	                                                           \
  	fprintf (FILE, "# block profiler %d block %d \n",                          \
! 			 profile_block_flag, BLOCKNO); 	                           \
  	output_asm_insn ("ipm   14", tmp);              		           \
  	output_asm_insn ("aghi  15,-224", tmp);                           	   \
  	output_asm_insn ("stmg  14,5,160(15)", tmp);             		   \
*************** do {                                    
*** 1325,1331 ****
    ((REGNO) < 16 || (unsigned) reg_renumber[REGNO] < 16)
  
  #define REGNO_OK_FOR_FP_P(REGNO)                                        \
!   FLOAT_REGNO_P(REGNO)
  
  /* Now macros that check whether X is a register and also,
     strictly, whether it is in a specified class.  */
--- 1325,1331 ----
    ((REGNO) < 16 || (unsigned) reg_renumber[REGNO] < 16)
  
  #define REGNO_OK_FOR_FP_P(REGNO)                                        \
!   FLOAT_REGNO_P (REGNO)
  
  /* Now macros that check whether X is a register and also,
     strictly, whether it is in a specified class.  */
*************** do {                                    
*** 1531,1537 ****
     After generation of rtl, the compiler makes no further distinction
     between pointers and any other objects of this machine mode.  */
  
! #define Pmode (TARGET_64BIT ? DImode : SImode)
  
  /* A function address in a call instruction is a byte address (for
     indexing purposes) so give the MEM rtx a byte's mode.  */
--- 1531,1537 ----
     After generation of rtl, the compiler makes no further distinction
     between pointers and any other objects of this machine mode.  */
  
! #define Pmode ((enum machine_mode) (TARGET_64BIT ? DImode : SImode))
  
  /* A function address in a call instruction is a byte address (for
     indexing purposes) so give the MEM rtx a byte's mode.  */
*************** do {                                    
*** 1689,1695 ****
  /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
     return the mode to be used for the comparison. */
   
! #define SELECT_CC_MODE(OP,X,Y)              \
   (   (OP) == EQ  || (OP) == NE  ? CCZmode   \
     : (OP) == LE  || (OP) == LT  ||          \
       (OP) == GE  || (OP) == GT  ? CCSmode   \
--- 1689,1695 ----
  /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
     return the mode to be used for the comparison. */
   
! #define SELECT_CC_MODE(OP, X, Y)            \
   (   (OP) == EQ  || (OP) == NE  ? CCZmode   \
     : (OP) == LE  || (OP) == LT  ||          \
       (OP) == GE  || (OP) == GT  ? CCSmode   \
*************** do {                                    
*** 1703,1710 ****
     since it hasn't been defined!  */
   
  extern struct rtx_def *s390_compare_op0, *s390_compare_op1;
-  
- extern int s390_match_ccmode PARAMS ((struct rtx_def *, int));
  
  
  /* How to refer to registers in assembler output.  This sequence is
--- 1703,1708 ----
*************** extern int s390_nr_constants;
*** 1809,1815 ****
      /* Mark entries referenced by other entries */			\
      for (pool = first_pool; pool; pool = pool->next)		       	\
        if (pool->mark)							\
!         mark_constants(pool->constant);					\
  								       	\
      s390_asm_output_pool_prologue (FILE, FUNNAME, fndecl, size);     	\
  }
--- 1807,1813 ----
      /* Mark entries referenced by other entries */			\
      for (pool = first_pool; pool; pool = pool->next)		       	\
        if (pool->mark)							\
!         mark_constants (pool->constant);					\
  								       	\
      s390_asm_output_pool_prologue (FILE, FUNNAME, fndecl, size);     	\
  }
Index: gcc/config/s390/s390.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.md,v
retrieving revision 1.2
diff -c -p -r1.2 s390.md
*** s390.md	2001/08/11 20:56:12	1.2
--- s390.md	2001/08/11 20:57:39
***************
*** 796,801 ****
--- 796,804 ----
  
        case 4: /* m <- m */
          return \"mvc\\t%O0(16,%R0),%1\";
+ 
+       default:
+         abort();
      }
  }"
    [(set_attr "op_type" "NN,NN,RS,RS,SS")
***************
*** 873,878 ****
--- 876,884 ----
  
        case 4: /* m <- m */
          return \"mvc\\t%O0(8,%R0),%1\";
+ 
+       default:
+         abort();
       }
  }"
    [(set_attr "op_type" "NN,NN,RS,RS,SS")
***************
*** 1085,1090 ****
--- 1091,1099 ----
  
        case 6: /* m <- m */
          return \"mvc\\t%O0(8,%R0),%1\";
+ 
+       default:
+         abort();
       }
  }"
    [(set_attr "op_type" "RR,RX,RX,RS,RS,NN,SS")
***************
*** 1132,1137 ****
--- 1141,1149 ----
  
        case 3: /* m <- m */
          return \"mvc\\t%O0(8,%R0),%1\";
+ 
+       default:
+         abort();
      }
  }"
    [(set_attr "op_type" "NN,RS,RS,SS")
***************
*** 2442,2448 ****
  
    operands[1] = force_reg (DFmode,operands[1]);
    emit_insn (gen_cmpdf (operands[1], force_const_mem (DFmode,
! 	CONST_DOUBLE_FROM_REAL_VALUE (0x80000000, DFmode))));
    emit_jump_insn (gen_blt (label1));
    emit_insn (gen_subdf3 (temp, operands[1], force_const_mem (DFmode,
  	CONST_DOUBLE_FROM_REAL_VALUE (0x100000000ULL, DFmode))));
--- 2454,2460 ----
  
    operands[1] = force_reg (DFmode,operands[1]);
    emit_insn (gen_cmpdf (operands[1], force_const_mem (DFmode,
! 	CONST_DOUBLE_FROM_REAL_VALUE (0x80000000ULL, DFmode))));
    emit_jump_insn (gen_blt (label1));
    emit_insn (gen_subdf3 (temp, operands[1], force_const_mem (DFmode,
  	CONST_DOUBLE_FROM_REAL_VALUE (0x100000000ULL, DFmode))));
***************
*** 2583,2589 ****
  
    operands[1] = force_reg (SFmode, operands[1]);
    emit_insn (gen_cmpsf (operands[1], force_const_mem (SFmode,
! 	CONST_DOUBLE_FROM_REAL_VALUE (0x80000000, SFmode))));
    emit_jump_insn (gen_blt (label1));
    emit_insn (gen_subsf3 (temp, operands[1], force_const_mem (SFmode,
  	CONST_DOUBLE_FROM_REAL_VALUE (0x100000000ULL, SFmode))));
--- 2595,2601 ----
  
    operands[1] = force_reg (SFmode, operands[1]);
    emit_insn (gen_cmpsf (operands[1], force_const_mem (SFmode,
! 	CONST_DOUBLE_FROM_REAL_VALUE (0x80000000ULL, SFmode))));
    emit_jump_insn (gen_blt (label1));
    emit_insn (gen_subsf3 (temp, operands[1], force_const_mem (SFmode,
  	CONST_DOUBLE_FROM_REAL_VALUE (0x100000000ULL, SFmode))));
***************
*** 2669,2675 ****
        rtx temp  = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
        rtx two31 = force_const_mem (DFmode,
                                     gen_rtx (CONST_DOUBLE, VOIDmode, cc0_rtx,
!                                             0x80000000, 0x4E000000));
  
        emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp));
        DONE;
--- 2681,2687 ----
        rtx temp  = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
        rtx two31 = force_const_mem (DFmode,
                                     gen_rtx (CONST_DOUBLE, VOIDmode, cc0_rtx,
!                                             0x80000000U, 0x4E000000U));
  
        emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp));
        DONE;
Index: gcc/config/s390/t-linux
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/t-linux,v
retrieving revision 1.1
diff -c -p -r1.1 t-linux
*** t-linux	2001/07/13 13:10:42	1.1
--- t-linux	2001/08/11 20:57:39
***************
*** 1,11 ****
  # The crtbegin and crtend must not depend on a small GOT
  CRTSTUFF_T_CFLAGS = -O2 -fPIC
  
- linux.o: $(srcdir)/config/s390/linux.c $(CONFIG_H) 
- 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/s390/linux.c
- 
  # Compile libgcc2.a with pic.
  TARGET_LIBGCC2_CFLAGS = -fPIC -include $(srcdir)/config/s390/fixdfdi.h
- 
- 
  
--- 1,6 ----
-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]