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]
Other format: [Raw text]

RFA: Use .opt files for the VAX port


This patch makes the VAX port define its options using a .opt file.
Nothing to report really: it was a very straight-forward transition.

Tested by building cc1 for vax-ultix (which defaults to MASK_UNIX_ASM)
and vax-netbsd (which doesn't).  I tried each option by hand to make
sure it had the intended effect.  OK to install?

Richard


	* config/vax/vax.h (target_flags, MASK_UNIX_ASM, MASK_VAXC_ALIGNMENT)
	(MASK_G_FLOAT, TARGET_UNIX_ASM, TARGET_VAXC_ALIGNMENT, TARGET_G_FLOAT)
	(TARGET_SWITCHES): Delete.
	* config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Override default.
	* config/vax/vax.opt: New file.

Index: config/vax/vax.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/vax/vax.h,v
retrieving revision 1.69
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.69 vax.h
*** config/vax/vax.h	28 Nov 2004 12:01:20 -0000	1.69
--- config/vax/vax.h	7 Apr 2005 20:36:20 -0000
*************** #define TARGET_VERSION fprintf (stderr, 
*** 60,109 ****
  
  /* Run-time compilation parameters selecting different hardware subsets.  */
  
- extern int target_flags;
- 
- #define MASK_UNIX_ASM		1
- #define MASK_VAXC_ALIGNMENT	2
- #define MASK_G_FLOAT		4
- 
- 
- /* Macros used in the machine description to test the flags.  */
- 
- /* Nonzero if compiling code that Unix assembler can assemble.  */
- #define TARGET_UNIX_ASM (target_flags & MASK_UNIX_ASM)
- 
- /* Nonzero if compiling with VAX-11 "C" style structure alignment */
- #define	TARGET_VAXC_ALIGNMENT (target_flags & MASK_VAXC_ALIGNMENT)
- 
- /* Nonzero if compiling with `G'-format floating point */
- #define TARGET_G_FLOAT (target_flags & MASK_G_FLOAT)
- 
  /* Nonzero if ELF.  Redefined by vax/elf.h.  */
  #define TARGET_ELF 0
  
- /* Macro to define tables used to set the flags.
-    This is a list in braces of pairs in braces,
-    each pair being { "NAME", VALUE }
-    where VALUE is the bits to set or minus the bits to clear.
-    An empty string NAME is used to identify the default VALUE.  */
- 
- #define TARGET_SWITCHES						\
-   { {"unix", MASK_UNIX_ASM,					\
-      "Generate code for UNIX assembler"},  			\
-     {"gnu", -MASK_UNIX_ASM,					\
-      "Generate code for GNU assembler (gas)"},  		\
-     {"vaxc-alignment", MASK_VAXC_ALIGNMENT,			\
-      "Use VAXC structure conventions"}, 			\
-     {"g", MASK_G_FLOAT,						\
-      "Generate GFLOAT double precision code"},			\
-     {"g-float", MASK_G_FLOAT,					\
-      "Generate GFLOAT double precision code"},			\
-     {"d", -MASK_G_FLOAT,					\
-      "Generate DFLOAT double precision code"},			\
-     {"d-float", -MASK_G_FLOAT,					\
-      "Generate DFLOAT double precision code"},			\
-     { "", TARGET_DEFAULT, 0}}
- 
  /* Default target_flags if no switches specified.  */
  
  #ifndef TARGET_DEFAULT
--- 60,68 ----
Index: config/vax/vax.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/vax/vax.c,v
retrieving revision 1.59
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.59 vax.c
*** config/vax/vax.c	27 Mar 2005 10:48:27 -0000	1.59
--- config/vax/vax.c	7 Apr 2005 20:36:20 -0000
*************** #define TARGET_ASM_OUTPUT_MI_THUNK vax_o
*** 73,78 ****
--- 73,81 ----
  #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
  #define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall
  
+ #undef TARGET_DEFAULT_TARGET_FLAGS
+ #define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
+ 
  #undef TARGET_RTX_COSTS
  #define TARGET_RTX_COSTS vax_rtx_costs
  #undef TARGET_ADDRESS_COST
diff -c /dev/null config/vax/vax.opt
*** /dev/null	2005-03-29 10:04:47.000000000 +0100
--- config/vax/vax.opt	2005-04-05 05:40:46.000000000 +0100
***************
*** 0 ****
--- 1,48 ----
+ ; Options for the VAX port of the compiler.
+ 
+ ; Copyright (C) 2005 Free Software Foundation, Inc.
+ ;
+ ; This file is part of GCC.
+ ;
+ ; GCC is free software; you can redistribute it and/or modify it under
+ ; the terms of the GNU General Public License as published by the Free
+ ; Software Foundation; either version 2, or (at your option) any later
+ ; version.
+ ;
+ ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ ; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ ; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ ; for more details.
+ ;
+ ; You should have received a copy of the GNU General Public License
+ ; along with GCC; see the file COPYING.  If not, write to the Free
+ ; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ ; 02111-1307, USA.
+ 
+ md
+ Target RejectNegative InverseMask(G_FLOAT)
+ Target DFLOAT double precision code
+ 
+ md-float
+ Target RejectNegative InverseMask(G_FLOAT)
+ Target DFLOAT double precision code
+ 
+ mg
+ Target RejectNegative Mask(G_FLOAT)
+ Generate GFLOAT double precision code
+ 
+ mg-float
+ Target RejectNegative Mask(G_FLOAT) MaskExists
+ Generate GFLOAT double precision code
+ 
+ mgnu
+ Target RejectNegative InverseMask(UNIX_ASM)
+ Generate code for GNU assembler (gas)
+ 
+ munix
+ Target RejectNegative Mask(UNIX_ASM)
+ Generate code for UNIX assembler
+ 
+ mvaxc-alignment
+ Target RejectNegative Mask(VAXC_ALIGNMENT)
+ Use VAXC structure conventions


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