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]

fix i386 MASK_ overlap problem



Hi,
this patch should solve the overlap of MASK_ bits.  I've removed the
debug swithes as disucssed with DJ and additionally I've replaced
-mintel-syntax/-mno-intel-syntax with -masm=dialect switch and deprecated
the former.
I beleive it is not widely used, as it has been broken in 3.0.

Honza

Mon Dec 17 19:06:19 CET 2001  Jan Hubicka  <jh@suse.cz>
	* att.h (ASM_FILE_START): Use asm_dialect.
	* linux.h (ASM_FILE_START): Likewise.
	* gas.h (ASM_FILE_START): Likewise.
	* i386.c (ix86_debug_arg_string, ix86_debug_addr_string,
	ix86_asm_string, ix86_asm_dialect): New.
	(override_options): Set asm_dialect.
	* i386.h (MASK_MIX_SSE_I387, MASK_INTEL_SYNTAX, MASK_DEBUG_ARG,
	MASK_DEBUG_ADDR): Kill.
	(MASK_64BIT, MASK_NO_RED_ZONE): renumber.
	(TARGET_DEBUG_ADDR, TARGET_DEBUG_ARG): Use string.
	(ASSEMBLER_DIALECT): Use asm_dialect.
	(TARGET_SWITCHES): Undocument deprecated items; deprecate intel-syntax;
	remove debug-addr and debug-arg.
	(TARGET_OPTIONS): Add debug-arg, debug-addr, asm.
	(asm_dialect): New enum.
	(ix86_debug_arg_string, ix86_debug_addr_string,
	ix86_asm_string, ix86_asm_dialect): Declare.
	* invoke.texi (-mintel-syntax): Remove.
	(-masm): Document.
Index: config/i386/att.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/att.h,v
retrieving revision 1.13
diff -c -3 -p -r1.13 att.h
*** att.h	2001/12/17 15:05:32	1.13
--- att.h	2001/12/17 18:11:18
*************** do								\
*** 53,59 ****
  #define ASM_FILE_START(FILE)						\
    do {									\
  	output_file_directive (FILE, main_input_filename);		\
! 	if (target_flags & MASK_INTEL_SYNTAX)				\
  	  fputs ("\t.intel_syntax\n", FILE);				\
    } while (0)
  
--- 53,59 ----
  #define ASM_FILE_START(FILE)						\
    do {									\
  	output_file_directive (FILE, main_input_filename);		\
! 	if (ix86_asm_dialect == ASM_INTEL)				\
  	  fputs ("\t.intel_syntax\n", FILE);				\
    } while (0)
  
Index: config/i386/gas.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/gas.h,v
retrieving revision 1.13
diff -c -3 -p -r1.13 gas.h
*** gas.h	2001/11/11 05:56:40	1.13
--- gas.h	2001/12/17 18:11:18
*************** Boston, MA 02111-1307, USA.  */
*** 166,172 ****
  #undef ASM_FILE_START
  #define ASM_FILE_START(FILE)						\
    do {									\
! 	if (target_flags & MASK_INTEL_SYNTAX)				\
  	  fputs ("\t.intel_syntax\n", FILE);				\
          output_file_directive (FILE, main_input_filename);		\
    } while (0)
--- 166,172 ----
  #undef ASM_FILE_START
  #define ASM_FILE_START(FILE)						\
    do {									\
! 	if (ix86_asm_dialect == ASM_INTEL)				\
  	  fputs ("\t.intel_syntax\n", FILE);				\
          output_file_directive (FILE, main_input_filename);		\
    } while (0)
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.348
diff -c -3 -p -r1.348 i386.c
*** i386.c	2001/12/17 15:05:32	1.348
--- i386.c	2001/12/17 18:11:21
*************** struct ix86_frame
*** 586,593 ****
--- 586,598 ----
    HOST_WIDE_INT stack_pointer_offset;
  };
  
+ /* Used to enable/disable debugging features.  */
+ const char *ix86_debug_arg_string, *ix86_debug_addr_string;
  /* Code model option as passed by user.  */
  const char *ix86_cmodel_string;
+ /* Asm dialect.  */
+ const char *ix86_asm_string;
+ enum cmodel ix86_asm_dialect = ASM_ATT;
  /* Parsed value.  */
  enum cmodel ix86_cmodel;
  
*************** override_options ()
*** 930,935 ****
--- 935,949 ----
        ix86_cmodel = CM_32;
        if (TARGET_64BIT)
  	ix86_cmodel = flag_pic ? CM_SMALL_PIC : CM_SMALL;
+     }
+   if (ix86_asm_string != 0)
+     {
+       if (!strcmp (ix86_asm_string, "intel"))
+ 	ix86_asm_dialect = ASM_INTEL;
+       else if (!strcmp (ix86_asm_string, "att"))
+ 	ix86_asm_dialect = ASM_ATT;
+       else
+ 	error ("bad value (%s) for -masm= switch", ix86_asm_string);
      }
    if ((TARGET_64BIT == 0) != (ix86_cmodel == CM_32))
      error ("code model `%s' not supported in the %s bit mode",
Index: config/i386/i386.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.h,v
retrieving revision 1.226
diff -c -3 -p -r1.226 i386.h
*** i386.h	2001/12/17 15:05:32	1.226
--- i386.h	2001/12/17 18:11:23
*************** extern int target_flags;
*** 131,144 ****
  #define MASK_3DNOW_A		0x00400000	/* Support Athlon 3Dnow builtins */
  #define MASK_3DNOW_A_SET	0x00800000
  #define MASK_128BIT_LONG_DOUBLE 0x01000000	/* long double size is 128bit */
! #define MASK_MIX_SSE_I387	0x02000000	/* Mix SSE and i387 instructions */
! #define MASK_64BIT		0x04000000	/* Produce 64bit code */
! #define MASK_NO_RED_ZONE	0x08000000	/* Do not use red zone */
! 
! /* Temporary codegen switches */
! #define MASK_INTEL_SYNTAX	0x10000000
! #define MASK_DEBUG_ARG		0x20000000	/* function_arg */   
! #define MASK_DEBUG_ADDR		0x40000000	/* GO_IF_LEGITIMATE_ADDRESS */
  
  /* Use the floating point instructions */
  #define TARGET_80387 (target_flags & MASK_80387)
--- 131,139 ----
  #define MASK_3DNOW_A		0x00400000	/* Support Athlon 3Dnow builtins */
  #define MASK_3DNOW_A_SET	0x00800000
  #define MASK_128BIT_LONG_DOUBLE 0x01000000	/* long double size is 128bit */
! #define MASK_64BIT		0x02000000	/* Produce 64bit code */
! /* ... overlap with subtarget options starts by 0x04000000.  */
! #define MASK_NO_RED_ZONE	0x04000000	/* Do not use red zone */
  
  /* Use the floating point instructions */
  #define TARGET_80387 (target_flags & MASK_80387)
*************** extern int target_flags;
*** 188,197 ****
    (target_flags & MASK_OMIT_LEAF_FRAME_POINTER)
  
  /* Debug GO_IF_LEGITIMATE_ADDRESS */
! #define TARGET_DEBUG_ADDR (target_flags & MASK_DEBUG_ADDR)
  
  /* Debug FUNCTION_ARG macros */
! #define TARGET_DEBUG_ARG (target_flags & MASK_DEBUG_ARG)
  
  /* 64bit Sledgehammer mode */
  #ifdef TARGET_BI_ARCH
--- 183,192 ----
    (target_flags & MASK_OMIT_LEAF_FRAME_POINTER)
  
  /* Debug GO_IF_LEGITIMATE_ADDRESS */
! #define TARGET_DEBUG_ADDR (ix86_debug_addr_string != 0)
  
  /* Debug FUNCTION_ARG macros */
! #define TARGET_DEBUG_ARG (ix86_debug_arg_string != 0)
  
  /* 64bit Sledgehammer mode */
  #ifdef TARGET_BI_ARCH
*************** extern int x86_prefetch_sse;
*** 273,279 ****
  #define TARGET_ALIGN_STRINGOPS (!(target_flags & MASK_NO_ALIGN_STROPS))
  #define TARGET_INLINE_ALL_STRINGOPS (target_flags & MASK_INLINE_ALL_STROPS)
  
! #define ASSEMBLER_DIALECT ((target_flags & MASK_INTEL_SYNTAX) != 0)
  
  #define TARGET_SSE ((target_flags & (MASK_SSE | MASK_SSE2)) != 0)
  #define TARGET_SSE2 ((target_flags & MASK_SSE2) != 0)
--- 268,274 ----
  #define TARGET_ALIGN_STRINGOPS (!(target_flags & MASK_NO_ALIGN_STROPS))
  #define TARGET_INLINE_ALL_STRINGOPS (target_flags & MASK_INLINE_ALL_STROPS)
  
! #define ASSEMBLER_DIALECT (ix86_asm_dialect)
  
  #define TARGET_SSE ((target_flags & (MASK_SSE | MASK_SSE2)) != 0)
  #define TARGET_SSE2 ((target_flags & MASK_SSE2) != 0)
*************** extern int x86_prefetch_sse;
*** 292,301 ****
    { "hard-float",		 MASK_80387, N_("Use hardware fp") },	      \
    { "soft-float",		-MASK_80387, N_("Do not use hardware fp") },  \
    { "no-soft-float",		 MASK_80387, N_("Use hardware fp") },	      \
!   { "386",			 0, N_("Same as -mcpu=i386") },		      \
!   { "486",			 0, N_("Same as -mcpu=i486") },		      \
!   { "pentium",			 0, N_("Same as -mcpu=pentium") },	      \
!   { "pentiumpro",		 0, N_("Same as -mcpu=pentiumpro") },	      \
    { "rtd",			 MASK_RTD,				      \
      N_("Alternate calling convention") },				      \
    { "no-rtd",			-MASK_RTD,				      \
--- 287,298 ----
    { "hard-float",		 MASK_80387, N_("Use hardware fp") },	      \
    { "soft-float",		-MASK_80387, N_("Do not use hardware fp") },  \
    { "no-soft-float",		 MASK_80387, N_("Use hardware fp") },	      \
!   { "386",			 0, N_("") /*Deprecated.*/},		      \
!   { "486",			 0, N_("") /*Deprecated.*/},		      \
!   { "pentium",			 0, N_("") /*Deprecated.*/},		      \
!   { "pentiumpro",		 0, N_("") /*Deprecated.*/},		      \
!   { "intel-syntax",		 0, N_("") /*Deprecated.*/},	 	      \
!   { "no-intel-syntax",		 0, N_("") /*Deprecated.*/},	 	      \
    { "rtd",			 MASK_RTD,				      \
      N_("Alternate calling convention") },				      \
    { "no-rtd",			-MASK_RTD,				      \
*************** extern int x86_prefetch_sse;
*** 323,340 ****
    { "omit-leaf-frame-pointer",	 MASK_OMIT_LEAF_FRAME_POINTER,		      \
      N_("Omit the frame pointer in leaf functions") },			      \
    { "no-omit-leaf-frame-pointer",-MASK_OMIT_LEAF_FRAME_POINTER, "" },	      \
-   { "debug-addr",		 MASK_DEBUG_ADDR, 0 /* undocumented */ },     \
-   { "no-debug-addr",		-MASK_DEBUG_ADDR, 0 /* undocumented */ },     \
-   { "debug-arg",		 MASK_DEBUG_ARG, 0 /* undocumented */ },      \
-   { "no-debug-arg",		-MASK_DEBUG_ARG, 0 /* undocumented */ },      \
    { "stack-arg-probe",		 MASK_STACK_PROBE,			      \
      N_("Enable stack probing") },					      \
    { "no-stack-arg-probe",	-MASK_STACK_PROBE, "" },		      \
    { "windows",			0, 0 /* undocumented */ },		      \
    { "dll",			0,  0 /* undocumented */ },		      \
-   { "intel-syntax",		MASK_INTEL_SYNTAX,			      \
-     N_("Emit Intel syntax assembler opcodes") },			      \
-   { "no-intel-syntax",		-MASK_INTEL_SYNTAX, "" },		      \
    { "align-stringops",		-MASK_NO_ALIGN_STROPS,			      \
      N_("Align destination of the string operations") },			      \
    { "no-align-stringops",	 MASK_NO_ALIGN_STROPS,			      \
--- 320,330 ----
*************** extern int ix86_arch;
*** 449,454 ****
--- 439,450 ----
      N_("Branches are this expensive (1-5, arbitrary units)") },	\
    { "cmodel=", &ix86_cmodel_string,				\
      N_("Use given x86-64 code model") },			\
+   { "debug-arg", &ix86_debug_arg_string,			\
+     N_("" /* Undocumented. */) },				\
+   { "debug-addr", &ix86_debug_addr_string,			\
+     N_("" /* Undocumented. */) },				\
+   { "asm=", &ix86_asm_string,					\
+     N_("Use given assembler dialect") },			\
    SUBTARGET_OPTIONS						\
  }
  
*************** extern int ix86_arch;
*** 482,488 ****
  %{mpentium:-mcpu=pentium \
  %n`-mpentium' is deprecated. Use `-march=pentium' or `-mcpu=pentium' instead.\n} \
  %{mpentiumpro:-mcpu=pentiumpro \
! %n`-mpentiumpro' is deprecated. Use `-march=pentiumpro' or `-mcpu=pentiumpro' instead.\n}}"
  #endif
  
  #define TARGET_CPU_DEFAULT_i386 0
--- 478,488 ----
  %{mpentium:-mcpu=pentium \
  %n`-mpentium' is deprecated. Use `-march=pentium' or `-mcpu=pentium' instead.\n} \
  %{mpentiumpro:-mcpu=pentiumpro \
! %n`-mpentiumpro' is deprecated. Use `-march=pentiumpro' or `-mcpu=pentiumpro' instead.\n} \
! %{mintel-syntax:-masm=intel \
! %n`-mintel-syntax' is deprecated. Use `-masm=intel' instead.\n} \
! %{mno-intel-syntax:-masm=att \
! %n`-mno-intel-syntax' is deprecated. Use `-masm=att' instead.\n}}"
  #endif
  
  #define TARGET_CPU_DEFAULT_i386 0
*************** enum cmodel {
*** 3138,3143 ****
--- 3138,3151 ----
  #define RED_ZONE_SIZE 128
  /* Reserved area of the red zone for temporaries.  */
  #define RED_ZONE_RESERVE 8
+ extern const char *ix86_debug_arg_string, *ix86_debug_addr_string;
+ 
+ enum asm_dialect {
+   ASM_ATT,
+   ASM_INTEL
+ };
+ extern const char *ix86_asm_string;
+ extern enum cmodel ix86_asm_dialect;
  /* Valud of -mcmodel specified by user.  */
  extern const char *ix86_cmodel_string;
  extern enum cmodel ix86_cmodel;
Index: config/i386/linux.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/linux.h,v
retrieving revision 1.32
diff -c -3 -p -r1.32 linux.h
*** linux.h	2001/12/17 15:05:32	1.32
--- linux.h	2001/12/17 18:11:23
*************** Boston, MA 02111-1307, USA.  */
*** 28,34 ****
  #define ASM_FILE_START(FILE)						\
    do {									\
  	output_file_directive (FILE, main_input_filename);		\
! 	if (target_flags & MASK_INTEL_SYNTAX)				\
  	  fputs ("\t.intel_syntax\n", FILE);				\
    } while (0)
  
--- 28,34 ----
  #define ASM_FILE_START(FILE)						\
    do {									\
  	output_file_directive (FILE, main_input_filename);		\
! 	if (ix86_asm_dialect == ASM_INTEL)				\
  	  fputs ("\t.intel_syntax\n", FILE);				\
    } while (0)
  
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/doc/invoke.texi,v
retrieving revision 1.91
diff -c -3 -p -r1.91 invoke.texi
*** invoke.texi	2001/12/14 11:20:27	1.91
--- invoke.texi	2001/12/17 18:11:27
*************** in the following sections.
*** 474,480 ****
  @emph{i386 and x86-64 Options}
  @gccoptlist{
  -mcpu=@var{cpu-type}  -march=@var{cpu-type} -mfpmath=@var{unit} @gol
! -mintel-syntax -mieee-fp  -mno-fancy-math-387 @gol
  -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
  -mno-wide-multiply  -mrtd  -malign-double @gol
  -mpreferred-stack-boundary=@var{num} @gol
--- 474,480 ----
  @emph{i386 and x86-64 Options}
  @gccoptlist{
  -mcpu=@var{cpu-type}  -march=@var{cpu-type} -mfpmath=@var{unit} @gol
! -masm=@var{dialect}  -mno-fancy-math-387 @gol
  -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
  -mno-wide-multiply  -mrtd  -malign-double @gol
  -mpreferred-stack-boundary=@var{num} @gol
*************** still experimental, because gcc register
*** 7555,7563 ****
  functional units well resulting in instable performance.
  @end table
  
! @item -mintel-syntax
! @opindex mintel-syntax
! Emit assembly using Intel syntax opcodes instead of AT&T syntax.
  
  @item -mieee-fp
  @itemx -mno-ieee-fp
--- 7555,7564 ----
  functional units well resulting in instable performance.
  @end table
  
! @item -masm=@var{dialect}
! @opindex masm=@var{dialect}
! Output asm instructions using selected @var{dialect}. Supported choices are
! @samp{intel} or @samp{att} (the default one).
  
  @item -mieee-fp
  @itemx -mno-ieee-fp


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