View | Details | Raw Unified | Return to bug 6957 | Differences between
and this patch

Collapse All | Expand All

(-)binutils/gas/config/tc-i386.c-cvs (-81 / +36 lines)
Lines 959-980 Link Here
959
    return;
959
    return;
960
960
961
  /* We need to decide which NOP sequence to use for 32bit and
961
  /* We need to decide which NOP sequence to use for 32bit and
962
     64bit. When -mtune= is used:
962
     64bit. When -march= is used:
963
963
964
     1. For PROCESSOR_I386, PROCESSOR_I486, PROCESSOR_PENTIUM and
964
     1. For PROCESSOR_I386, PROCESSOR_I486, PROCESSOR_PENTIUM and
965
     PROCESSOR_GENERIC32, f32_patt will be used.
965
     PROCESSOR_GENERIC32, PROCESSOR_PENTIUMPRO, f32_patt will be used.
966
     2. For PROCESSOR_PENTIUMPRO, PROCESSOR_PENTIUM4, PROCESSOR_NOCONA,
966
     2. For PROCESSOR_PENTIUM4, PROCESSOR_NOCONA, PROCESSOR_CORE,
967
     PROCESSOR_CORE, PROCESSOR_CORE2, and PROCESSOR_GENERIC64,
967
     PROCESSOR_CORE2, and PROCESSOR_GENERIC64, alt_long_patt will be
968
     alt_long_patt will be used.
968
     used.
969
     3. For PROCESSOR_ATHLON, PROCESSOR_K6, PROCESSOR_K8 and
969
     3. For PROCESSOR_ATHLON, PROCESSOR_K6, PROCESSOR_K8 and
970
     PROCESSOR_AMDFAM10, alt_short_patt will be used.
970
     PROCESSOR_AMDFAM10, alt_short_patt will be used.
971
971
972
     When -mtune= isn't used, alt_long_patt will be used if
972
     Not all i686 class CPUs support NOPL. Hence PROCESSOR_PENTIUMPRO
973
     cpu_arch_isa_flags has Cpu686. Otherwise, f32_patt will
973
     uses f32_patt rather than alt_long_patt allows binaries to run
974
     be used.
974
     on all i686 class CPUs with only a minor optimization loss versus
975
975
     the gain from CMOV optimisation.   */
976
     When -march= or .arch is used, we can't use anything beyond
977
     cpu_arch_isa_flags.   */
978
976
979
  if (flag_code == CODE_16BIT)
977
  if (flag_code == CODE_16BIT)
980
    {
978
    {
Lines 993-1072 Link Here
993
    {
991
    {
994
      const char *const *patt = NULL;
992
      const char *const *patt = NULL;
995
993
996
      if (cpu_arch_isa == PROCESSOR_UNKNOWN)
994
      switch (cpu_arch_isa)
997
	{
995
	{
998
	  /* PROCESSOR_UNKNOWN means that all ISAs may be used.  */
996
	  case PROCESSOR_UNKNOWN:
999
	  switch (cpu_arch_tune)
997
	  case PROCESSOR_I386:
1000
	    {
998
	  case PROCESSOR_I486:
1001
	    case PROCESSOR_UNKNOWN:
999
	  case PROCESSOR_PENTIUM:
1002
	      /* We use cpu_arch_isa_flags to check if we SHOULD
1000
	  case PROCESSOR_PENTIUMPRO:
1003
		 optimize for Cpu686.  */
1001
	  case PROCESSOR_GENERIC32:
1004
	      if (cpu_arch_isa_flags.bitfield.cpui686)
1002
	    patt = f32_patt;
1005
		patt = alt_long_patt;
1003
	    break;
1006
	      else
1004
	  case PROCESSOR_PENTIUM4:
1007
		patt = f32_patt;
1005
	  case PROCESSOR_NOCONA:
1008
	      break;
1006
	  case PROCESSOR_CORE:
1009
	    case PROCESSOR_PENTIUMPRO:
1007
	  case PROCESSOR_CORE2:
1010
	    case PROCESSOR_PENTIUM4:
1008
	    if (cpu_arch_isa_flags.bitfield.cpui686)
1011
	    case PROCESSOR_NOCONA:
1012
	    case PROCESSOR_CORE:
1013
	    case PROCESSOR_CORE2:
1014
	    case PROCESSOR_GENERIC64:
1015
	      patt = alt_long_patt;
1009
	      patt = alt_long_patt;
1016
	      break;
1010
	    else
1017
	    case PROCESSOR_K6:
1018
	    case PROCESSOR_ATHLON:
1019
	    case PROCESSOR_K8:
1020
	    case PROCESSOR_AMDFAM10:
1021
	      patt = alt_short_patt;
1022
	      break;
1023
	    case PROCESSOR_I386:
1024
	    case PROCESSOR_I486:
1025
	    case PROCESSOR_PENTIUM:
1026
	    case PROCESSOR_GENERIC32:
1027
	      patt = f32_patt;
1011
	      patt = f32_patt;
1028
	      break;
1012
	    break;
1029
	    }
1013
	  case PROCESSOR_K6:
1030
	}
1014
	  case PROCESSOR_ATHLON:
1031
      else
1015
	  case PROCESSOR_K8:
1032
	{
1016
	  case PROCESSOR_AMDFAM10:
1033
	  switch (cpu_arch_tune)
1017
	    if (cpu_arch_isa_flags.bitfield.cpui686)
1034
	    {
1035
	    case PROCESSOR_UNKNOWN:
1036
	      /* When cpu_arch_isa is set, cpu_arch_tune shouldn't be
1037
		 PROCESSOR_UNKNOWN.  */
1038
	      abort ();
1039
	      break;
1040
1041
	    case PROCESSOR_I386:
1042
	    case PROCESSOR_I486:
1043
	    case PROCESSOR_PENTIUM:
1044
	    case PROCESSOR_K6:
1045
	    case PROCESSOR_ATHLON:
1046
	    case PROCESSOR_K8:
1047
	    case PROCESSOR_AMDFAM10:
1048
	    case PROCESSOR_GENERIC32:
1049
	      /* We use cpu_arch_isa_flags to check if we CAN optimize
1050
		 for Cpu686.  */
1051
	      if (cpu_arch_isa_flags.bitfield.cpui686)
1052
		patt = alt_short_patt;
1053
	      else
1054
		patt = f32_patt;
1055
	      break;
1056
	    case PROCESSOR_PENTIUMPRO:
1057
	    case PROCESSOR_PENTIUM4:
1058
	    case PROCESSOR_NOCONA:
1059
	    case PROCESSOR_CORE:
1060
	    case PROCESSOR_CORE2:
1061
	      if (cpu_arch_isa_flags.bitfield.cpui686)
1062
		patt = alt_long_patt;
1063
	      else
1064
		patt = f32_patt;
1065
	      break;
1066
	    case PROCESSOR_GENERIC64:
1067
	      patt = alt_short_patt;
1018
	      patt = alt_short_patt;
1068
	      break;
1019
	    else
1069
	    }
1020
	      patt = f32_patt;
1021
	    break;
1022
	  case PROCESSOR_GENERIC64:
1023
	    patt = alt_long_patt;
1024
	    break;
1070
	}
1025
	}
1071
1026
1072
      if (patt == f32_patt)
1027
      if (patt == f32_patt)

Return to bug 6957