Hello!

As reported in [1] the host processor detection has not yet been updated
to recognize Intel Ivy Bridge and Haswell processors.
This small patch adds the detection of these processors and assumes
core-avx2 as march for unknown processors of the PENTIUMPRO family that
support AVX2.


Best regards

Christian Widmer


[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57927
2013-08-27  Christian Widmer  <sha...@umbrox.de>

    PR target/57927
    * config/i386/driver-i386.c (host_detect_local_cpu): Add detection of Ivy
    Bridge and Haswell processors and assume core-avx2 for unknown AVX2 capable
    processors

Index: gcc/config/i386/driver-i386.c
===================================================================
*** gcc/config/i386/driver-i386.c	(revision 202013)
--- gcc/config/i386/driver-i386.c	(working copy)
*************** const char *host_detect_local_cpu (int a
*** 662,667 ****
--- 662,675 ----
  	  /* Sandy Bridge.  */
  	  cpu = "corei7-avx";
  	  break;
+ 	case 0x3a:
+ 	  /* Ivy Bridge.  */
+ 	  cpu = "corei7-avx";
+ 	  break;
+ 	case 0x3c:
+ 	  /* Haswell.  */
+ 	  cpu = "core-avx2";
+ 	  break;
  	case 0x17:
  	case 0x1d:
  	  /* Penryn.  */
*************** const char *host_detect_local_cpu (int a
*** 675,682 ****
  	  if (arch)
  	    {
  	      /* This is unknown family 0x6 CPU.  */
! 	      if (has_avx)
! 		/* Assume Sandy Bridge.  */
  		cpu = "corei7-avx";
  	      else if (has_sse4_2)
  		{
--- 683,693 ----
  	  if (arch)
  	    {
  	      /* This is unknown family 0x6 CPU.  */
! 	      if (has_avx2)
! 		/* Assume Haswell.  */
! 		cpu = "core-avx2";
! 	      else if (has_avx)
! 		/* Assume Sandy/Ivy Bridge.  */
  		cpu = "corei7-avx";
  	      else if (has_sse4_2)
  		{

Reply via email to