]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Tune alignment for Intel Core i7
authorBernd Schmidt <bernds@codesourcery.com>
Tue, 2 Nov 2010 12:34:02 +0000 (12:34 +0000)
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>
Tue, 2 Nov 2010 12:34:02 +0000 (12:34 +0000)
* config/i386.h (TARGET_COREI7{_32,_64,}): New macros.
(enum processor_type): Update comment.  Add entries for Core i7.
* config/i386-c.c (ix86_target_macros_internal): Update.
* config/i386.c (m_COREI7{_32,_64}): New macros.
(m_GENERIC32, m_GENERIC64): Use generic tuning for Core i7.
(processor_target_table): Tune alignment for Core i7.
(ix86_option_override_internal): Use PROCESSOR_COREI7_*.

* doc/invoke.texi: Document "corei7" option value.

Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com>
From-SVN: r166177

gcc/ChangeLog
gcc/config/i386/i386-c.c
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/doc/invoke.texi

index b97cf78b4a736ac26bed0cafbfce412766e00242..83aa17691b3fdff22138740c58c27e8fbaad1db5 100644 (file)
@@ -1,3 +1,18 @@
+2010-11-02  Bernd Schmidt  <bernds@codesourcery.com>
+           Maxim Kuvyrkov  <maxim@codesourcery.com>
+
+       Tune alignment for Intel Core i7
+
+       * config/i386.h (TARGET_COREI7{_32,_64,}): New macros.
+       (enum processor_type): Update comment.  Add entries for Core i7.
+       * config/i386-c.c (ix86_target_macros_internal): Update.
+       * config/i386.c (m_COREI7{_32,_64}): New macros.
+       (m_GENERIC32, m_GENERIC64): Use generic tuning for Core i7.
+       (processor_target_table): Tune alignment for Core i7.
+       (ix86_option_override_internal): Use PROCESSOR_COREI7_*.
+
+       * doc/invoke.texi: Document "corei7" option value.
+
 2010-11-02  Bernd Schmidt  <bernds@codesourcery.com>
            Maxim Kuvyrkov  <maxim@codesourcery.com>
            H.J. Lu  <hjl.tools@gmail.com>
index 1846efbe6178a5a64cadcdf5ab0fc73ef2ecf4e8..3b4409e889a8ba6ffc1314bd6bf657e6dbd73815 100644 (file)
@@ -122,6 +122,11 @@ ix86_target_macros_internal (int isa_flag,
       def_or_undef (parse_in, "__core2");
       def_or_undef (parse_in, "__core2__");
       break;
+    case PROCESSOR_COREI7_32:
+    case PROCESSOR_COREI7_64:
+      def_or_undef (parse_in, "__corei7");
+      def_or_undef (parse_in, "__corei7__");
+      break;
     case PROCESSOR_ATOM:
       def_or_undef (parse_in, "__atom");
       def_or_undef (parse_in, "__atom__");
@@ -197,6 +202,10 @@ ix86_target_macros_internal (int isa_flag,
     case PROCESSOR_CORE2:
       def_or_undef (parse_in, "__tune_core2__");
       break;
+    case PROCESSOR_COREI7_32:
+    case PROCESSOR_COREI7_64:
+      def_or_undef (parse_in, "__tune_corei7__");
+      break;
     case PROCESSOR_ATOM:
       def_or_undef (parse_in, "__tune_atom__");
       break;
index 47c3bfe80d978d947413eb0f7b341a57a37feefc..84317e08a092f7972fc30af571923f7ec324610b 100644 (file)
@@ -1642,6 +1642,8 @@ const struct processor_costs *ix86_cost = &pentium_cost;
 #define m_PENT4  (1<<PROCESSOR_PENTIUM4)
 #define m_NOCONA  (1<<PROCESSOR_NOCONA)
 #define m_CORE2  (1<<PROCESSOR_CORE2)
+#define m_COREI7_32  (1<<PROCESSOR_COREI7_32)
+#define m_COREI7_64  (1<<PROCESSOR_COREI7_64)
 #define m_ATOM  (1<<PROCESSOR_ATOM)
 
 #define m_GEODE  (1<<PROCESSOR_GEODE)
@@ -1654,8 +1656,8 @@ const struct processor_costs *ix86_cost = &pentium_cost;
 #define m_BDVER1  (1<<PROCESSOR_BDVER1)
 #define m_AMD_MULTIPLE  (m_K8 | m_ATHLON | m_AMDFAM10 | m_BDVER1)
 
-#define m_GENERIC32 (1<<PROCESSOR_GENERIC32)
-#define m_GENERIC64 (1<<PROCESSOR_GENERIC64)
+#define m_GENERIC32 (1<<PROCESSOR_GENERIC32 | m_COREI7_32)
+#define m_GENERIC64 (1<<PROCESSOR_GENERIC64 | m_COREI7_64)
 
 /* Generic instruction choice should be common subset of supported CPUs
    (PPro/PENT4/NOCONA/CORE2/Athlon/K8).  */
@@ -2461,6 +2463,10 @@ static const struct ptt processor_target_table[PROCESSOR_max] =
   {&k8_cost, 16, 7, 16, 7, 16},
   {&nocona_cost, 0, 0, 0, 0, 0},
   {&core2_cost, 16, 10, 16, 10, 16},
+  /* Core i7 32-bit.  */
+  {&generic32_cost, 16, 10, 16, 10, 16},
+  /* Core i7 64-bit.  */
+  {&generic64_cost, 16, 10, 16, 10, 16},
   {&generic32_cost, 16, 7, 16, 7, 16},
   {&generic64_cost, 16, 10, 16, 10, 16},
   {&amdfam10_cost, 32, 24, 32, 7, 32},
@@ -3183,7 +3189,7 @@ ix86_option_override_internal (bool main_args_p)
       {"core2", PROCESSOR_CORE2, CPU_CORE2,
        PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
        | PTA_SSSE3 | PTA_CX16},
-      {"corei7", PROCESSOR_GENERIC64, CPU_GENERIC64,
+      {"corei7", PROCESSOR_COREI7_64, CPU_GENERIC64,
        PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
        | PTA_SSSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_CX16},
       {"atom", PROCESSOR_ATOM, CPU_ATOM,
@@ -3554,6 +3560,11 @@ ix86_option_override_internal (bool main_args_p)
                ix86_schedule = CPU_PENTIUMPRO;
                break;
 
+             case PROCESSOR_COREI7_64:
+               ix86_tune = PROCESSOR_COREI7_32;
+               ix86_schedule = CPU_PENTIUMPRO;
+               break;
+
              default:
                break;
              }
index 3c7f9f07ea137bc06bf98e8d503d289732c18fdd..1a2c3f33194961ca3e9709ba76b2d0256457c269 100644 (file)
@@ -239,6 +239,9 @@ extern const struct processor_costs ix86_size_cost;
 #define TARGET_ATHLON_K8 (TARGET_K8 || TARGET_ATHLON)
 #define TARGET_NOCONA (ix86_tune == PROCESSOR_NOCONA)
 #define TARGET_CORE2 (ix86_tune == PROCESSOR_CORE2)
+#define TARGET_COREI7_32 (ix86_tune == PROCESSOR_COREI7_32)
+#define TARGET_COREI7_64 (ix86_tune == PROCESSOR_COREI7_64)
+#define TARGET_COREI7 (TARGET_COREI7_32 || TARGET_COREI7_64)
 #define TARGET_GENERIC32 (ix86_tune == PROCESSOR_GENERIC32)
 #define TARGET_GENERIC64 (ix86_tune == PROCESSOR_GENERIC64)
 #define TARGET_GENERIC (TARGET_GENERIC32 || TARGET_GENERIC64)
@@ -2040,8 +2043,7 @@ do {                                                                      \
        "call " CRT_MKSTR(__USER_LABEL_PREFIX__) #FUNC "\n"     \
        TEXT_SECTION_ASM_OP);
 \f
-/* Which processor to schedule for. The cpu attribute defines a list that
-   mirrors this list, so changes to i386.md must be made at the same time.  */
+/* Which processor to tune code generation for.  */
 
 enum processor_type
 {
@@ -2056,6 +2058,8 @@ enum processor_type
   PROCESSOR_K8,
   PROCESSOR_NOCONA,
   PROCESSOR_CORE2,
+  PROCESSOR_COREI7_32,
+  PROCESSOR_COREI7_64,
   PROCESSOR_GENERIC32,
   PROCESSOR_GENERIC64,
   PROCESSOR_AMDFAM10,
index 4a605e315c3dbea0ffbaaf54487494f767768de3..0355344b4b082bfcb89524337556a0a07511895f 100644 (file)
@@ -12051,6 +12051,9 @@ SSE2 and SSE3 instruction set support.
 @item core2
 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
 instruction set support.
+@item corei7
+Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
+and SSE4.2 instruction set support.
 @item atom
 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
 instruction set support.