[llvm-commits] CVS: llvm-gcc/gcc/config/i386/i386.c i386.h

John Criswell criswell at cs.uiuc.edu
Mon Jan 3 14:34:55 PST 2005



Changes in directory llvm-gcc/gcc/config/i386:

i386.c updated: 1.1.1.2 -> 1.2
i386.h updated: 1.2 -> 1.3
---
Log message:

Applied patches from Markus F.X.J. Oberhumer for X86-64 support.
Most of the changes in i386.c disable the special va-args support for
X86-64.
I'm not sure what effect, if any, the i386.h alignment change has in real
code generation, but it doesn't seem to break anything and looks correct.


---
Diffs of the changes:  (+15 -5)

Index: llvm-gcc/gcc/config/i386/i386.c
diff -u llvm-gcc/gcc/config/i386/i386.c:1.1.1.2 llvm-gcc/gcc/config/i386/i386.c:1.2
--- llvm-gcc/gcc/config/i386/i386.c:1.1.1.2	Tue Jan 13 10:49:45 2004
+++ llvm-gcc/gcc/config/i386/i386.c	Mon Jan  3 16:34:39 2005
@@ -1381,9 +1381,15 @@
 	error ("-malign-double makes no sense in the 64bit mode");
       if (TARGET_RTD)
 	error ("-mrtd calling convention not supported in the 64bit mode");
+#if EMIT_LLVM
+      /* set to standard X86 values (using 64-bit long doubles under LLVM) */
+      target_flags &= ~(MASK_SSE2 | MASK_SSE | MASK_MMX | MASK_128BIT_LONG_DOUBLE);
+      ix86_fpmath = FPMATH_387;
+#else
       /* Enable by default the SSE and MMX builtins.  */
       target_flags |= (MASK_SSE2 | MASK_SSE | MASK_MMX | MASK_128BIT_LONG_DOUBLE);
       ix86_fpmath = FPMATH_SSE;
+#endif
      }
   else
     {
@@ -2795,7 +2801,8 @@
   tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl;
 
   /* For i386 we use plain pointer to argument area.  */
-  if (!TARGET_64BIT)
+  /* LLVM also uses the i386 standard version in 64-bit mode */
+  if (!TARGET_64BIT || EMIT_LLVM)
     return build_pointer_type (char_type_node);
 
   record = (*lang_hooks.types.make_type) (RECORD_TYPE);
@@ -2858,7 +2865,8 @@
   int stdarg_p;
   int i;
 
-  if (!TARGET_64BIT)
+  /* LLVM also uses the i386 standard version in 64-bit mode */
+  if (!TARGET_64BIT || EMIT_LLVM)
     return;
 
   /* Indicate to allocate space on the stack for varargs save area.  */
@@ -2948,7 +2956,8 @@
   tree gpr, fpr, ovf, sav, t;
 
   /* Only 64bit target needs something special.  */
-  if (!TARGET_64BIT)
+  /* LLVM also uses the i386 standard version in 64-bit mode */
+  if (!TARGET_64BIT || EMIT_LLVM)
     {
       std_expand_builtin_va_start (valist, nextarg);
       return;
@@ -3015,7 +3024,8 @@
   int indirect_p = 0;
 
   /* Only 64bit target needs something special.  */
-  if (!TARGET_64BIT)
+  /* LLVM also uses the i386 standard version in 64-bit mode */
+  if (!TARGET_64BIT || EMIT_LLVM)
     {
       return std_expand_builtin_va_arg (valist, type);
     }


Index: llvm-gcc/gcc/config/i386/i386.h
diff -u llvm-gcc/gcc/config/i386/i386.h:1.2 llvm-gcc/gcc/config/i386/i386.h:1.3
--- llvm-gcc/gcc/config/i386/i386.h:1.2	Thu Jan  8 17:03:36 2004
+++ llvm-gcc/gcc/config/i386/i386.h	Mon Jan  3 16:34:39 2005
@@ -826,7 +826,7 @@
 #if !EMIT_LLVM
 #define BIGGEST_ALIGNMENT 128
 #else
-#define BIGGEST_ALIGNMENT 32
+#define BIGGEST_ALIGNMENT 64
 #endif
 
 /* Decide whether a variable of mode MODE should be 128 bit aligned.  */






More information about the llvm-commits mailing list