Add support for pentium-m and prescott

Jan Hubicka jh@suse.cz
Sat Feb 14 20:20:00 GMT 2004


Hi,
this patch adds support for pentium-m CPU (used by Centrino notebooks)
that is mostly like P3 but with SSE2 and new P4 with SSE3.  Intel
marketing scheme is confusing enough to use same name for P4 and P4 with
SSE3 but they attach letter 'E' to the MHZ number, so I added it as
pentium4e.

I also added pentium3m and pentium4m so it will be hopefully cleaner that these
are not pentium-m.

I would like to put this patch into 3.4 and equivalent probabily into 3.3 too
as we have support for SSE3 there but no -march switch to enable it so we are
forcing users to use funny combinations of -msseX flags.

Bootstrapped/regtested i686-pc-gnu-linux.  OK?
Honza

PS: What happent to the patch renaming PNI to SSA3 for mainline?

2004-02-14  Jan Hubicka  <jh@suse.cz>
	* config.gcc: Add support for pentium4e/pentium-m/pentium3m/pentium4m.
	* i386.c (override_options): Add support for new CPUs.
	* i386.h (TARGET_CPU_DEFAULT_NAMES): New names.
	(TARGET_CPU_DEFAULT_pentium_m, TARGET_CPU_DEFAULT_pentium4e): New constants.
	* invoke.texi: Extend documentation of -mtune/-march for new CPUs.
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.427
diff -c -3 -p -r1.427 config.gcc
*** config.gcc	7 Feb 2004 17:06:18 -0000	1.427
--- config.gcc	14 Feb 2004 19:15:16 -0000
*************** if test x$with_cpu = x ; then
*** 2103,2114 ****
          pentium2-*)
            with_cpu=pentium2
            ;;
!         pentium3-*)
            with_cpu=pentium3
            ;;
!         pentium4-*)
            with_cpu=pentium4
            ;;
          *)
            with_cpu=pentiumpro
            ;;
--- 2103,2120 ----
          pentium2-*)
            with_cpu=pentium2
            ;;
!         pentium3-*|pentium3m-*)
            with_cpu=pentium3
            ;;
!         pentium4-*|pentium4m-*)
            with_cpu=pentium4
            ;;
+         pentium4e-*)
+           with_cpu=pentium4e
+           ;;
+         pentium_m-*)
+           with_cpu=pentium-m
+           ;;
          *)
            with_cpu=pentiumpro
            ;;
*************** fi
*** 2276,2282 ****
  			| c3 | c3-2 | i686 | pentiumpro | pentium2 | pentium3 \
  			| pentium4 | k6 | k6-2 | k6-3 | athlon | athlon-tbird \
  			| athlon-4 | athlon-xp | athlon-mp | k8 | opteron \
! 			| athlon64 | athlon-fx)
  				# OK
  				;;
  			*)
--- 2282,2289 ----
  			| c3 | c3-2 | i686 | pentiumpro | pentium2 | pentium3 \
  			| pentium4 | k6 | k6-2 | k6-3 | athlon | athlon-tbird \
  			| athlon-4 | athlon-xp | athlon-mp | k8 | opteron \
! 			| athlon64 | athlon-fx | pentium4e | pentium-m \
! 			| pentium4m | pentium3m)
  				# OK
  				;;
  			*)
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.646
diff -c -3 -p -r1.646 i386.c
*** config/i386/i386.c	8 Feb 2004 23:08:40 -0000	1.646
--- config/i386/i386.c	14 Feb 2004 19:15:18 -0000
*************** override_options (void)
*** 1087,1095 ****
  	{
  	  PTA_SSE = 1,
  	  PTA_SSE2 = 2,
! 	  PTA_MMX = 4,
! 	  PTA_PREFETCH_SSE = 8,
! 	  PTA_3DNOW = 16,
  	  PTA_3DNOW_A = 64,
  	  PTA_64BIT = 128
  	} flags;
--- 1087,1096 ----
  	{
  	  PTA_SSE = 1,
  	  PTA_SSE2 = 2,
! 	  PTA_SSE3 = 4,
! 	  PTA_MMX = 8,
! 	  PTA_PREFETCH_SSE = 16,
! 	  PTA_3DNOW = 32,
  	  PTA_3DNOW_A = 64,
  	  PTA_64BIT = 128
  	} flags;
*************** override_options (void)
*** 1109,1116 ****
        {"pentiumpro", PROCESSOR_PENTIUMPRO, 0},
        {"pentium2", PROCESSOR_PENTIUMPRO, PTA_MMX},
        {"pentium3", PROCESSOR_PENTIUMPRO, PTA_MMX | PTA_SSE | PTA_PREFETCH_SSE},
!       {"pentium4", PROCESSOR_PENTIUM4, PTA_SSE | PTA_SSE2 |
! 				       PTA_MMX | PTA_PREFETCH_SSE},
        {"k6", PROCESSOR_K6, PTA_MMX},
        {"k6-2", PROCESSOR_K6, PTA_MMX | PTA_3DNOW},
        {"k6-3", PROCESSOR_K6, PTA_MMX | PTA_3DNOW},
--- 1110,1123 ----
        {"pentiumpro", PROCESSOR_PENTIUMPRO, 0},
        {"pentium2", PROCESSOR_PENTIUMPRO, PTA_MMX},
        {"pentium3", PROCESSOR_PENTIUMPRO, PTA_MMX | PTA_SSE | PTA_PREFETCH_SSE},
!       {"pentium3m", PROCESSOR_PENTIUMPRO, PTA_MMX | PTA_SSE | PTA_PREFETCH_SSE},
!       {"pentium-m", PROCESSOR_PENTIUMPRO, PTA_MMX | PTA_SSE | PTA_PREFETCH_SSE | PTA_SSE2},
!       {"pentium4", PROCESSOR_PENTIUM4, PTA_SSE | PTA_SSE2
! 				       | PTA_MMX | PTA_PREFETCH_SSE},
!       {"pentium4m", PROCESSOR_PENTIUM4, PTA_SSE | PTA_SSE2
! 				        | PTA_MMX | PTA_PREFETCH_SSE},
!       {"pentium4e", PROCESSOR_PENTIUM4, PTA_SSE | PTA_SSE2 | PTA_SSE3
! 				        | PTA_MMX | PTA_PREFETCH_SSE},
        {"k6", PROCESSOR_K6, PTA_MMX},
        {"k6-2", PROCESSOR_K6, PTA_MMX | PTA_3DNOW},
        {"k6-3", PROCESSOR_K6, PTA_MMX | PTA_3DNOW},
Index: config/i386/i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.375
diff -c -3 -p -r1.375 i386.h
*** config/i386/i386.h	7 Feb 2004 17:06:20 -0000	1.375
--- config/i386/i386.h	14 Feb 2004 19:15:18 -0000
*************** extern int x86_prefetch_sse;
*** 690,700 ****
  #define TARGET_CPU_DEFAULT_athlon 11
  #define TARGET_CPU_DEFAULT_athlon_sse 12
  #define TARGET_CPU_DEFAULT_k8 13
  
  #define TARGET_CPU_DEFAULT_NAMES {"i386", "i486", "pentium", "pentium-mmx",\
  				  "pentiumpro", "pentium2", "pentium3", \
  				  "pentium4", "k6", "k6-2", "k6-3",\
! 				  "athlon", "athlon-4", "k8"}
  
  #ifndef CC1_SPEC
  #define CC1_SPEC "%(cc1_cpu) "
--- 690,703 ----
  #define TARGET_CPU_DEFAULT_athlon 11
  #define TARGET_CPU_DEFAULT_athlon_sse 12
  #define TARGET_CPU_DEFAULT_k8 13
+ #define TARGET_CPU_DEFAULT_pentium_m 14
+ #define TARGET_CPU_DEFAULT_pentium4e 15
  
  #define TARGET_CPU_DEFAULT_NAMES {"i386", "i486", "pentium", "pentium-mmx",\
  				  "pentiumpro", "pentium2", "pentium3", \
  				  "pentium4", "k6", "k6-2", "k6-3",\
! 				  "athlon", "athlon-4", "k8", \
! 				  "pentium-m", "pentium4e"}
  
  #ifndef CC1_SPEC
  #define CC1_SPEC "%(cc1_cpu) "
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.408
diff -c -3 -p -r1.408 invoke.texi
*** doc/invoke.texi	6 Feb 2004 20:03:45 -0000	1.408
--- doc/invoke.texi	14 Feb 2004 19:15:21 -0000
*************** Intel PentiumMMX CPU based on Pentium co
*** 8109,8119 ****
  Intel PentiumPro CPU.
  @item pentium2
  Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
! @item pentium3
  Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
  support.
! @item pentium4
  Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
  @item k6
  AMD K6 CPU with MMX instruction set support.
  @item k6-2, k6-3
--- 8109,8125 ----
  Intel PentiumPro CPU.
  @item pentium2
  Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
! @item pentium3, pentium3m
  Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
  support.
! @item pentium-m
! Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
! support.  Used by Centrino notebooks.
! @item pentium4, pentium4m
  Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
+ @item pentium4e
+ Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
+ set support.
  @item k6
  AMD K6 CPU with MMX instruction set support.
  @item k6-2, k6-3



More information about the Gcc-patches mailing list