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]

PATCH: Convert target-specific builtins to gcc_target


This patch converts the target builtin macros MD_INIT_BUILTINS
and MD_EXPAND_BUILTIN to use the new gcc_target structure.  The
changes are straightforward.  (I also fixed a couple typos in c4x
that prevented it from building.)  Bootstraps on i686-pc-linux-gnu,
and builds on the other three affected targets.  OK to commit?

Stan

2001-07-07  Stan Shebs  <shebs@apple.com>

        * target.h (struct gcc_target): New fields init_builtins and
        expand_builtin.
        * target-def.h (TARGET_INIT_BUILTINS): New macro.
        (TARGET_EXPAND_BUILTIN): New macro.
        (TARGET_INITIALIZER): Add them.
        * builtins.c: Include target.h.
        (expand_builtin): Use targetm.expand_builtin.
        (default_init_builtins): New function.
        (default_expand_builtin): New function.
        * expr.h (default_init_builtins): Declare.
        (default_expand_builtin): Declare.
        * c-common.c: Include target.h.
        (c_common_nodes_and_builtins): Use targetm.init_builtins.
        * defaults.h (MD_INIT_BUILTINS): Remove.
        * Makefile.in (builtins.o): Depend on target.h.
        (c-common.o): Ditto.

        * config/arm/arm.c (TARGET_INIT_BUILTINS): Define.
        (TARGET_EXPAND_BUILTIN): Define.
        * config/arm/arm.h (MD_INIT_BUILTINS): Remove.
        (MD_EXPAND_BUILTIN): Remove.

        * config/c4x/c4x.c (TARGET_INIT_BUILTINS): Define.
        (TARGET_EXPAND_BUILTIN): Define.
        (c4x_init_builtins): Make endlink arg a local.
        (c4x_print_operand): Fix typos in adjust_address usages.
        * config/c4x/c4x-protos.h (c4x_init_builtins): Update decl.
        * config/c4x/c4x.h (MD_INIT_BUILTINS): Remove.
        (MD_EXPAND_BUILTIN): Remove.

        * config/i386/i386.c (TARGET_INIT_BUILTINS): Define.
        (TARGET_EXPAND_BUILTIN): Define.
        (ix86_init_mmx_sse_builtins): New function, was ix86_init_builtins.
        (ix86_init_builtins): Call new function only if TARGET_MMX.
        * config/i386/i386-protos.h (ix86_init_mmx_sse_builtins): Declare.
        * config/i386/i386.h (MD_INIT_BUILTINS): Remove.
        (MD_EXPAND_BUILTIN): Remove.

        * config/ia64/ia64.c (TARGET_INIT_BUILTINS): Define.
        (TARGET_EXPAND_BUILTIN): Define.
        * config/ia64/ia64.h (MD_INIT_BUILTINS): Remove.
        (MD_EXPAND_BUILTIN): Remove.

        * doc/tm.texi: Document these changes.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.690
diff -c -3 -p -r1.690 Makefile.in
*** Makefile.in	2001/07/06 18:39:56	1.690
--- Makefile.in	2001/07/07 16:08:44
*************** s-under: $(GCC_PASSES)
*** 1236,1242 ****
  
  c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
  	$(C_COMMON_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
! 	$(EXPR_H) $(TM_P_H) builtin-types.def
  
  c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
  	$(C_COMMON_H) flags.h toplev.h intl.h diagnostic.h
--- 1236,1242 ----
  
  c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
  	$(C_COMMON_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
! 	$(EXPR_H) $(TM_P_H) $(TARGET_H) builtin-types.def
  
  c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
  	$(C_COMMON_H) flags.h toplev.h intl.h diagnostic.h
*************** expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) 
*** 1377,1383 ****
     output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h \
     reload.h $(GGC_H) intl.h $(TM_P_H)
  builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
!    function.h $(REGS_H) $(EXPR_H) insn-config.h \
     $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
     except.h $(TM_P_H) $(PREDICT_H)
  calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h $(EXPR_H) \
--- 1377,1383 ----
     output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h \
     reload.h $(GGC_H) intl.h $(TM_P_H)
  builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
!    $(TARGET_H) function.h $(REGS_H) $(EXPR_H) insn-config.h \
     $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
     except.h $(TM_P_H) $(PREDICT_H)
  calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h $(EXPR_H) \
Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.103
diff -c -3 -p -r1.103 builtins.c
*** builtins.c	2001/07/02 19:47:38	1.103
--- builtins.c	2001/07/07 16:08:45
*************** Boston, MA 02111-1307, USA.  */
*** 38,43 ****
--- 38,44 ----
  #include "toplev.h"
  #include "predict.h"
  #include "tm_p.h"
+ #include "target.h"
  
  #define CALLED_AS_BUILT_IN(NODE) \
     (!strncmp (IDENTIFIER_POINTER (DECL_NAME (NODE)), "__builtin_", 10))
*************** expand_builtin (exp, target, subtarget, 
*** 3401,3410 ****
    tree arglist = TREE_OPERAND (exp, 1);
    enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
  
- #ifdef MD_EXPAND_BUILTIN
    if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
!     return MD_EXPAND_BUILTIN (exp, target, subtarget, mode, ignore);
! #endif
    
    /* When not optimizing, generate calls to library functions for a certain
       set of builtins.  */
--- 3402,3409 ----
    tree arglist = TREE_OPERAND (exp, 1);
    enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
  
    if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
!     return (*targetm.expand_builtin) (exp, target, subtarget, mode, ignore);
    
    /* When not optimizing, generate calls to library functions for a certain
       set of builtins.  */
*************** validate_arglist VPARAMS ((tree arglist,
*** 3896,3899 ****
--- 3895,3918 ----
      }
      arglist = TREE_CHAIN (arglist);
    } while (1);
+ }
+ 
+ /* Default version of target-specific builtin setup that does nothing.  */
+ 
+ void
+ default_init_builtins ()
+ {
+ }
+ 
+ /* Default target-specific builtin expander that does nothing.  */
+ 
+ rtx
+ default_expand_builtin (exp, target, subtarget, mode, ignore)
+      tree exp ATTRIBUTE_UNUSED;
+      rtx target ATTRIBUTE_UNUSED;
+      rtx subtarget ATTRIBUTE_UNUSED;
+      enum machine_mode mode ATTRIBUTE_UNUSED;
+      int ignore ATTRIBUTE_UNUSED;
+ {
+   return NULL_RTX;
  }
Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.239
diff -c -3 -p -r1.239 c-common.c
*** c-common.c	2001/07/01 23:23:28	1.239
--- c-common.c	2001/07/07 16:08:47
*************** Boston, MA 02111-1307, USA.  */
*** 33,38 ****
--- 33,39 ----
  #include "tm_p.h"
  #include "obstack.h"
  #include "cpplib.h"
+ #include "target.h"
  cpp_reader *parse_in;		/* Declared in c-lex.h.  */
  
  #undef WCHAR_TYPE_SIZE
*************** c_common_nodes_and_builtins ()
*** 3022,3028 ****
  				 c_language != clk_cplusplus)
  			       ? const_string_type_node : const_ptr_type_node);
  
!   MD_INIT_BUILTINS;
  
    /* This is special for C++ so functions can be overloaded.  */
    wchar_type_node = get_identifier (flag_short_wchar
--- 3023,3029 ----
  				 c_language != clk_cplusplus)
  			       ? const_string_type_node : const_ptr_type_node);
  
!   (*targetm.init_builtins) ();
  
    /* This is special for C++ so functions can be overloaded.  */
    wchar_type_node = get_identifier (flag_short_wchar
Index: defaults.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/defaults.h,v
retrieving revision 1.44
diff -c -3 -p -r1.44 defaults.h
*** defaults.h	2001/06/27 06:55:27	1.44
--- defaults.h	2001/07/07 16:08:49
*************** do {								\
*** 364,375 ****
  #define TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER true
  #endif
  
- /* Define this macro if you have any machine-specific builtin
-    functions that need to be defined.  It should be a C expression
-    that performs the necessary setup. */
- 
- #ifndef MD_INIT_BUILTINS
- #define MD_INIT_BUILTINS
- #endif
- 
  #endif  /* ! GCC_DEFAULTS_H */
--- 364,367 ----
Index: expr.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.h,v
retrieving revision 1.82
diff -c -3 -p -r1.82 expr.h
*** expr.h	2001/07/04 17:43:13	1.82
--- expr.h	2001/07/07 16:08:50
*************** extern rtx expand_builtin PARAMS ((tree,
*** 907,912 ****
--- 907,915 ----
  extern void std_expand_builtin_va_start PARAMS ((int, tree, rtx));
  extern rtx std_expand_builtin_va_arg PARAMS ((tree, tree));
  extern rtx expand_builtin_va_arg PARAMS ((tree, tree));
+ extern void default_init_builtins PARAMS ((void));
+ extern rtx default_expand_builtin PARAMS ((tree, rtx, rtx,
+ 					   enum machine_mode, int));
  #endif
  
  extern void expand_builtin_setjmp_setup PARAMS ((rtx, rtx));
Index: target-def.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/target-def.h,v
retrieving revision 1.4
diff -c -3 -p -r1.4 target-def.h
*** target-def.h	2001/07/06 18:40:00	1.4
--- target-def.h	2001/07/07 16:08:50
*************** Foundation, 59 Temple Place - Suite 330,
*** 39,44 ****
--- 39,48 ----
  #define TARGET_COMP_TYPE_ATTRIBUTES default_comp_type_attributes
  #define TARGET_SET_DEFAULT_TYPE_ATTRIBUTES default_set_default_type_attributes
  
+ /* In builtins.c.  */
+ #define TARGET_INIT_BUILTINS default_init_builtins
+ #define TARGET_EXPAND_BUILTIN default_expand_builtin
+ 
  /* The whole shebang.  */
  #define TARGET_INITIALIZER			\
  {						\
*************** Foundation, 59 Temple Place - Suite 330,
*** 48,52 ****
    TARGET_VALID_DECL_ATTRIBUTE,			\
    TARGET_VALID_TYPE_ATTRIBUTE,			\
    TARGET_COMP_TYPE_ATTRIBUTES,			\
!   TARGET_SET_DEFAULT_TYPE_ATTRIBUTES		\
  }
--- 52,58 ----
    TARGET_VALID_DECL_ATTRIBUTE,			\
    TARGET_VALID_TYPE_ATTRIBUTE,			\
    TARGET_COMP_TYPE_ATTRIBUTES,			\
!   TARGET_SET_DEFAULT_TYPE_ATTRIBUTES,		\
!   TARGET_INIT_BUILTINS,				\
!   TARGET_EXPAND_BUILTIN				\
  }
Index: target.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/target.h,v
retrieving revision 1.5
diff -c -3 -p -r1.5 target.h
*** target.h	2001/07/07 01:07:17	1.5
--- target.h	2001/07/07 16:08:50
*************** Foundation, 59 Temple Place - Suite 330,
*** 44,49 ****
--- 44,52 ----
     also allow us to gradually reduce the amount of conditional
     compilation that is scattered throughout GCC.  */
  
+ /* Forward declaration for the benefit of prototypes.  */
+ struct rtx_def;
+ 
  struct gcc_target
  {
    /* Functions that output assembler for the target.  */
*************** struct gcc_target
*** 81,86 ****
--- 84,99 ----
  
    /* Assign default attributes to the newly defined TYPE.  */
    void (* set_default_type_attributes) PARAMS ((tree type));
+ 
+   /* Set up target-specific built-in functions.  */
+   void (* init_builtins) PARAMS ((void));
+ 
+   /* Expand a target-specific builtin.  */
+   struct rtx_def * (* expand_builtin) PARAMS ((tree exp,
+ 					       struct rtx_def *target,
+ 					       struct rtx_def *subtarget,
+ 					       enum machine_mode mode,
+ 					       int ignore));
  };
  
  extern struct gcc_target targetm;
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.25
diff -c -3 -p -r1.25 tm.texi
*** tm.texi	2001/07/07 01:07:17	1.25
--- tm.texi	2001/07/07 16:08:56
*************** A C expression to cancel any machine dep
*** 8635,8644 ****
  converting code to conditional execution in the basic blocks
  @code{TEST_BB}, @code{THEN_BB}, @code{ELSE_BB}, and @code{JOIN_BB}.
  
! @findex MD_INIT_BUILTINS
! @item MD_INIT_BUILTINS
! Define this macro if you have any machine-specific built-in functions that
! need to be defined.  It should be a C expression that performs the
  necessary setup.
  
  Machine specific built-in functions can be useful to expand special machine
--- 8635,8643 ----
  converting code to conditional execution in the basic blocks
  @code{TEST_BB}, @code{THEN_BB}, @code{ELSE_BB}, and @code{JOIN_BB}.
  
! @deftypefn {Target Hook} void TARGET_INIT_BUILTINS ()
! Define this hook if you have any machine-specific built-in functions
! that need to be defined.  It should be a function that performs the
  necessary setup.
  
  Machine specific built-in functions can be useful to expand special machine
*************** To create a built-in function, call the 
*** 8650,8666 ****
  which is defined by the language front end.  You can use any type nodes set
  up by @code{build_common_tree_nodes} and @code{build_common_tree_nodes_2};
  only language front ends that use these two functions will use
! @samp{MD_INIT_BUILTINS}.
  
! @findex MD_EXPAND_BUILTIN
! @item MD_EXPAND_BUILTIN(@var{exp}, @var{target}, @var{subtarget}, @var{mode}, @var{ignore})
  
  Expand a call to a machine specific built-in function that was set up by
! @samp{MD_INIT_BUILTINS}.  @var{exp} is the expression for the function call;
! the result should go to @var{target} if that is convenient, and have mode
! @var{mode} if that is convenient.  @var{subtarget} may be used as the target
! for computing one of @var{exp}'s operands.  @var{ignore} is nonzero if the value
! is to be ignored.
! This macro should return the result of the call to the built-in function.
  
  @end table
--- 8649,8665 ----
  which is defined by the language front end.  You can use any type nodes set
  up by @code{build_common_tree_nodes} and @code{build_common_tree_nodes_2};
  only language front ends that use these two functions will use
! @samp{TARGET_INIT_BUILTINS}.
  
! @deftypefn {Target Hook} rtx TARGET_EXPAND_BUILTIN (tree @var{exp}, rtx @var{target}, rtx @var{subtarget}, enum machine_mode @var{mode}, int @var{ignore})
  
  Expand a call to a machine specific built-in function that was set up by
! @samp{TARGET_INIT_BUILTINS}.  @var{exp} is the expression for the
! function call; the result should go to @var{target} if that is
! convenient, and have mode @var{mode} if that is convenient.
! @var{subtarget} may be used as the target for computing one of
! @var{exp}'s operands.  @var{ignore} is nonzero if the value is to be
! ignored.  This function should return the result of the call to the
! built-in function.
  
  @end table
Index: config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.154
diff -c -3 -p -r1.154 arm.c
*** arm.c	2001/07/07 01:07:18	1.154
--- arm.c	2001/07/07 16:08:59
*************** static void	 arm_set_default_type_attrib
*** 148,153 ****
--- 148,159 ----
  #undef TARGET_SET_DEFAULT_TYPE_ATTRIBUTES
  #define TARGET_SET_DEFAULT_TYPE_ATTRIBUTES arm_set_default_type_attributes
  
+ #undef TARGET_INIT_BUILTINS
+ #define TARGET_INIT_BUILTINS arm_init_builtins
+ 
+ #undef TARGET_EXPAND_BUILTIN
+ #define TARGET_EXPAND_BUILTIN arm_expand_builtin
+ 
  struct gcc_target targetm = TARGET_INITIALIZER;
  
  /* Obstack for minipool constant handling.  */
Index: config/arm/arm.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.110
diff -c -3 -p -r1.110 arm.h
*** arm.h	2001/07/06 18:40:02	1.110
--- arm.h	2001/07/07 16:09:01
*************** enum arm_builtins
*** 2954,2967 ****
    ARM_BUILTIN_PREFETCH,
    ARM_BUILTIN_MAX
  };
- 
- #define MD_INIT_BUILTINS	\
-   do				\
-     {				\
-       arm_init_builtins ();	\
-     }				\
-   while (0)
- 
- #define MD_EXPAND_BUILTIN(EXP, TARGET, SUBTARGET, MODE, IGNORE) \
-     arm_expand_builtin ((EXP), (TARGET), (SUBTARGET), (MODE), (IGNORE))
  #endif /* ! GCC_ARM_H */
--- 2954,2957 ----
Index: config/c4x/c4x-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/c4x/c4x-protos.h,v
retrieving revision 1.18
diff -c -3 -p -r1.18 c4x-protos.h
*** c4x-protos.h	2001/06/26 18:08:36	1.18
--- c4x-protos.h	2001/07/07 16:09:01
*************** extern void c4x_va_start PARAMS ((int, t
*** 71,80 ****
  
  extern struct rtx_def *c4x_va_arg PARAMS ((tree, tree));
  
! extern rtx c4x_expand_builtin PARAMS((tree, rtx, rtx,
! 				      enum machine_mode, int));
  
! extern void c4x_init_builtins PARAMS((tree));
  
  #endif /* TREE_CODE and RTX_CODE*/
  
--- 71,80 ----
  
  extern struct rtx_def *c4x_va_arg PARAMS ((tree, tree));
  
! extern rtx c4x_expand_builtin PARAMS ((tree, rtx, rtx,
! 				       enum machine_mode, int));
  
! extern void c4x_init_builtins PARAMS ((void));
  
  #endif /* TREE_CODE and RTX_CODE*/
  
Index: config/c4x/c4x.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/c4x/c4x.c,v
retrieving revision 1.85
diff -c -3 -p -r1.85 c4x.c
*** c4x.c	2001/07/07 01:07:18	1.85
--- c4x.c	2001/07/07 16:09:02
*************** static int c4x_valid_type_attribute_p PA
*** 195,200 ****
--- 195,206 ----
  #undef TARGET_VALID_TYPE_ATTRIBUTE
  #define TARGET_VALID_TYPE_ATTRIBUTE c4x_valid_type_attribute_p
  
+ #undef TARGET_INIT_BUILTINS
+ #define TARGET_INIT_BUILTINS c4x_init_builtins
+ 
+ #undef TARGET_EXPAND_BUILTIN
+ #define TARGET_EXPAND_BUILTIN c4x_expand_builtin
+ 
  struct gcc_target targetm = TARGET_INITIALIZER;
  
  /* Called to register all of our global variables with the garbage
*************** c4x_print_operand (file, op, letter)
*** 1921,1927 ****
            if (GET_CODE(op1) == CONST_INT || GET_CODE(op1) == SYMBOL_REF)
  	    {
  	      asm_fprintf (file, "\t%s\t@", TARGET_C3X ? "ldp" : "ldpk");
! 	      output_address (XEXP (adjust_address (op, VOIDmodem, 1), 0));
  	      asm_fprintf (file, "\n");
  	    }
  	}
--- 1927,1933 ----
            if (GET_CODE(op1) == CONST_INT || GET_CODE(op1) == SYMBOL_REF)
  	    {
  	      asm_fprintf (file, "\t%s\t@", TARGET_C3X ? "ldp" : "ldpk");
! 	      output_address (XEXP (adjust_address (op, VOIDmode, 1), 0));
  	      asm_fprintf (file, "\n");
  	    }
  	}
*************** c4x_print_operand (file, op, letter)
*** 1943,1949 ****
        if (code == MEM && c4x_autoinc_operand (op, Pmode))
  	break;
        else if (code == MEM)
! 	output_address (XEXP (adjust_address (op, 1), VOIDmode, 0));
        else if (code == REG)
  	fprintf (file, "%s", reg_names[REGNO (op) + 1]);
        else
--- 1949,1955 ----
        if (code == MEM && c4x_autoinc_operand (op, Pmode))
  	break;
        else if (code == MEM)
! 	output_address (XEXP (adjust_address (op, VOIDmode, 1), 0));
        else if (code == REG)
  	fprintf (file, "%s", reg_names[REGNO (op) + 1]);
        else
*************** c4x_adjust_cost (insn, link, dep_insn, c
*** 5034,5042 ****
  }
  
  void
! c4x_init_builtins (endlink)
!      tree endlink;
  {
    builtin_function ("fast_ftoi",
  		    build_function_type 
  		    (integer_type_node,
--- 5040,5049 ----
  }
  
  void
! c4x_init_builtins ()
  {
+   tree endlink = void_list_node;
+ 
    builtin_function ("fast_ftoi",
  		    build_function_type 
  		    (integer_type_node,
Index: config/c4x/c4x.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/c4x/c4x.h,v
retrieving revision 1.77
diff -c -3 -p -r1.77 c4x.h
*** c4x.h	2001/06/26 18:08:37	1.77
--- c4x.h	2001/07/07 16:09:04
*************** enum c4x_builtins
*** 2751,2760 ****
    C4X_BUILTIN_FRIEEE,	/*	frieee	   (only C4x)	*/
    C4X_BUILTIN_RCPF	/*	fast_invf  (only C4x)	*/
  };
- 
- #define MD_INIT_BUILTINS do { \
-     c4x_init_builtins (void_list_node); \
-   } while (0)
- 
- #define MD_EXPAND_BUILTIN(EXP, TARGET, SUBTARGET, MODE, IGNORE) \
-     c4x_expand_builtin ((EXP), (TARGET), (SUBTARGET), (MODE), (IGNORE))
--- 2751,2753 ----
Index: config/i386/i386-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386-protos.h,v
retrieving revision 1.54
diff -c -3 -p -r1.54 i386-protos.h
*** i386-protos.h	2001/07/03 05:56:32	1.54
--- i386-protos.h	2001/07/07 16:09:04
*************** extern rtx function_arg PARAMS ((CUMULAT
*** 163,168 ****
--- 163,169 ----
  extern void function_arg_advance PARAMS ((CUMULATIVE_ARGS *, enum machine_mode,
  					tree, int));
  extern void ix86_init_builtins PARAMS ((void));
+ extern void ix86_init_mmx_sse_builtins PARAMS ((void));
  extern rtx ix86_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int));
  #endif
  
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.279
diff -c -3 -p -r1.279 i386.c
*** i386.c	2001/07/07 01:07:19	1.279
--- i386.c	2001/07/07 16:09:09
*************** static int ix86_comp_type_attributes PAR
*** 624,629 ****
--- 624,635 ----
  #undef TARGET_COMP_TYPE_ATTRIBUTES
  #define TARGET_COMP_TYPE_ATTRIBUTES ix86_comp_type_attributes
  
+ #undef TARGET_INIT_BUILTINS
+ #define TARGET_INIT_BUILTINS ix86_init_builtins
+ 
+ #undef TARGET_EXPAND_BUILTIN
+ #define TARGET_EXPAND_BUILTIN ix86_expand_builtin
+ 
  #if defined (OSF_OS) || defined (TARGET_OSF1ELF)
     static void ix86_osf_output_function_prologue PARAMS ((FILE *,
  							  HOST_WIDE_INT));
*************** static struct builtin_description bdesc_
*** 9335,9346 ****
    { CODE_FOR_cvttss2si, 0, IX86_BUILTIN_CVTTSS2SI, 0, 0 }
  
  };
  
! /* Expand all the target specific builtins.  This is not called if TARGET_MMX
     is zero.  Otherwise, if TARGET_SSE is not set, only expand the MMX
     builtins.  */
  void
! ix86_init_builtins ()
  {
    struct builtin_description * d;
    size_t i;
--- 9341,9360 ----
    { CODE_FOR_cvttss2si, 0, IX86_BUILTIN_CVTTSS2SI, 0, 0 }
  
  };
+ 
+ /* Set up all the target-specific builtins.  */
+ void
+ ix86_init_builtins ()
+ {
+   if (TARGET_MMX)
+     ix86_init_mmx_sse_builtins ();
+ }
  
! /* Set up all the MMX/SSE builtins.  This is not called if TARGET_MMX
     is zero.  Otherwise, if TARGET_SSE is not set, only expand the MMX
     builtins.  */
  void
! ix86_init_mmx_sse_builtins ()
  {
    struct builtin_description * d;
    size_t i;
Index: config/i386/i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.192
diff -c -3 -p -r1.192 i386.h
*** i386.h	2001/06/29 17:21:14	1.192
--- i386.h	2001/07/07 16:09:11
*************** enum ix86_builtins
*** 2176,2196 ****
  
    IX86_BUILTIN_MAX
  };
- 
- /* Initialize the target-specific builtin functions.  Only do something
-    if TARGET_MMX is nonzero; we take care in ix86_init_builtins not to
-    enable any SSE builtins if TARGET_SSE is zero.  */
- #define MD_INIT_BUILTINS	\
-   do				\
-     {				\
-       if (TARGET_MMX)		\
- 	ix86_init_builtins ();	\
-     }				\
-   while (0)
- 
- /* Expand a target-specific builtin function.  */
- #define MD_EXPAND_BUILTIN(EXP, TARGET, SUBTARGET, MODE, IGNORE) \
-   ix86_expand_builtin (EXP, TARGET, SUBTARGET, MODE, IGNORE)
  
  /* Define this macro if references to a symbol must be treated
     differently depending on something about the variable or
--- 2176,2181 ----
Index: config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.100
diff -c -3 -p -r1.100 ia64.c
*** ia64.c	2001/07/07 01:07:19	1.100
--- ia64.c	2001/07/07 16:09:14
*************** static void ia64_function_epilogue PARAM
*** 144,149 ****
--- 144,155 ----
  #undef TARGET_VALID_TYPE_ATTRIBUTE
  #define TARGET_VALID_TYPE_ATTRIBUTE ia64_valid_type_attribute
  
+ #undef TARGET_INIT_BUILTINS
+ #define TARGET_INIT_BUILTINS ia64_init_builtins
+ 
+ #undef TARGET_EXPAND_BUILTIN
+ #define TARGET_EXPAND_BUILTIN ia64_expand_builtin
+ 
  #undef TARGET_ASM_FUNCTION_PROLOGUE
  #define TARGET_ASM_FUNCTION_PROLOGUE ia64_output_function_prologue
  #undef TARGET_ASM_FUNCTION_EPILOGUE
Index: config/ia64/ia64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.h,v
retrieving revision 1.72
diff -c -3 -p -r1.72 ia64.h
*** ia64.h	2001/07/06 18:40:12	1.72
--- ia64.h	2001/07/07 16:09:21
*************** enum fetchop_code {
*** 2869,2879 ****
    IA64_ADD_OP, IA64_SUB_OP, IA64_OR_OP, IA64_AND_OP, IA64_XOR_OP, IA64_NAND_OP
  };
  
- #define MD_INIT_BUILTINS do { \
-     ia64_init_builtins (); \
-   } while (0)
- 
- #define MD_EXPAND_BUILTIN(EXP, TARGET, SUBTARGET, MODE, IGNORE) \
-     ia64_expand_builtin ((EXP), (TARGET), (SUBTARGET), (MODE), (IGNORE))
- 
  /* End of ia64.h */
--- 2869,2872 ----


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