OSDN Git Service

* att.h (ASM_FILE_START): Use asm_dialect.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Dec 2001 15:41:30 +0000 (15:41 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Dec 2001 15:41:30 +0000 (15:41 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48160 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/att.h
gcc/config/i386/gas.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/linux.h
gcc/doc/invoke.texi

index 87586aa..b38f75f 100644 (file)
@@ -1,3 +1,25 @@
+Tue Dec 18 16:39:46 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.
+
 Tue Dec 18 16:37:42 CET 2001  Jan Hubicka  <jh@suse.cz>
 
        * libgcc2.c (__bb_exit_func): Kill -ax dumping code.
index df47f89..f16a5ea 100644 (file)
@@ -53,7 +53,7 @@ do                                                            \
 #define ASM_FILE_START(FILE)                                           \
   do {                                                                 \
        output_file_directive (FILE, main_input_filename);              \
-       if (target_flags & MASK_INTEL_SYNTAX)                           \
+       if (ix86_asm_dialect == ASM_INTEL)                              \
          fputs ("\t.intel_syntax\n", FILE);                            \
   } while (0)
 
index 4c39296..6c01b07 100644 (file)
@@ -166,7 +166,7 @@ Boston, MA 02111-1307, USA.  */
 #undef ASM_FILE_START
 #define ASM_FILE_START(FILE)                                           \
   do {                                                                 \
-       if (target_flags & MASK_INTEL_SYNTAX)                           \
+       if (ix86_asm_dialect == ASM_INTEL)                              \
          fputs ("\t.intel_syntax\n", FILE);                            \
         output_file_directive (FILE, main_input_filename);             \
   } while (0)
index 0c60bda..8bb7536 100644 (file)
@@ -586,8 +586,13 @@ struct ix86_frame
   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;
 
@@ -931,6 +936,15 @@ override_options ()
       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",
           ix86_cmodel_string, TARGET_64BIT ? "64" : "32");
index b38bdca..7b4056d 100644 (file)
@@ -131,14 +131,9 @@ extern int target_flags;
 #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 */
+#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)
@@ -188,10 +183,10 @@ extern int target_flags;
   (target_flags & MASK_OMIT_LEAF_FRAME_POINTER)
 
 /* Debug GO_IF_LEGITIMATE_ADDRESS */
-#define TARGET_DEBUG_ADDR (target_flags & MASK_DEBUG_ADDR)
+#define TARGET_DEBUG_ADDR (ix86_debug_addr_string != 0)
 
 /* Debug FUNCTION_ARG macros */
-#define TARGET_DEBUG_ARG (target_flags & MASK_DEBUG_ARG)
+#define TARGET_DEBUG_ARG (ix86_debug_arg_string != 0)
 
 /* 64bit Sledgehammer mode */
 #ifdef TARGET_BI_ARCH
@@ -273,7 +268,7 @@ extern int x86_prefetch_sse;
 #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 ASSEMBLER_DIALECT (ix86_asm_dialect)
 
 #define TARGET_SSE ((target_flags & (MASK_SSE | MASK_SSE2)) != 0)
 #define TARGET_SSE2 ((target_flags & MASK_SSE2) != 0)
@@ -292,10 +287,12 @@ extern int x86_prefetch_sse;
   { "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") },         \
+  { "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,                                    \
@@ -323,18 +320,11 @@ extern int x86_prefetch_sse;
   { "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,                        \
@@ -449,6 +439,12 @@ extern int ix86_arch;
     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                                            \
 }
 
@@ -482,7 +478,11 @@ extern int ix86_arch;
 %{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}}"
+%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
 \f
 #define TARGET_CPU_DEFAULT_i386 0
@@ -3138,6 +3138,14 @@ enum cmodel {
 #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 b7d7b3d..63006b3 100644 (file)
@@ -28,7 +28,7 @@ Boston, MA 02111-1307, USA.  */
 #define ASM_FILE_START(FILE)                                           \
   do {                                                                 \
        output_file_directive (FILE, main_input_filename);              \
-       if (target_flags & MASK_INTEL_SYNTAX)                           \
+       if (ix86_asm_dialect == ASM_INTEL)                              \
          fputs ("\t.intel_syntax\n", FILE);                            \
   } while (0)
 
index 8c5f1a6..d42df33 100644 (file)
@@ -474,7 +474,7 @@ in the following sections.
 @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
+-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
@@ -7534,9 +7534,10 @@ still experimental, because gcc register allocator does not model separate
 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 -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