Commit 4d652a18 by Harsha Jagasia Committed by Harsha Jagasia

AMD bdver2 Enablement

2011-07-12  Harsha Jagasia  <harsha.jagasia@amd.com>

	AMD bdver2 Enablement
	* config.gcc (i[34567]86-*-linux* | ...): Add bdver2.
	(case ${target}): Add bdver2.
	* config/i386/driver-i386.c (host_detect_local_cpu): Let
	-march=native recognize bdver2 processors.
	* config/i386/i386-c.c (ix86_target_macros_internal): Add
	bdver2 def_and_undef
	* config/i386/i386.c (struct processor_costs bdver2_cost): New
	bdver2 cost table.
	(m_BDVER2): New definition.
	(m_AMD_MULTIPLE): Includes m_BDVER2.
	(initial_ix86_tune_features): Add bdver2 tuning.
	(processor_target_table): Add bdver2 entry.
	(static const char *const cpu_names): Add bdver2 entry.
	(ix86_option_override_internal): Add bdver2 instruction sets.
	(ix86_issue_rate): Add bdver2.
	(ix86_adjust_cost): Add bdver2.
	(has_dispatch): Add bdver2.
	* config/i386/i386.h (TARGET_BDVER2): New definition.
	(enum target_cpu_default): Add TARGET_CPU_DEFAULT_bdver2.
	(enum processor_type): Add PROCESSOR_BDVER2.
	* config/i386/i386.md (define_attr "cpu"): Add bdver2.
	* config/i386/i386.opt ( mdispatch-scheduler): Add bdver2 to
	description.

From-SVN: r176209
parent 5756d08c
2011-07-12 Harsha Jagasia <harsha.jagasia@amd.com>
AMD bdver2 Enablement
* config.gcc (i[34567]86-*-linux* | ...): Add bdver2.
(case ${target}): Add bdver2.
* config/i386/driver-i386.c (host_detect_local_cpu): Let
-march=native recognize bdver2 processors.
* config/i386/i386-c.c (ix86_target_macros_internal): Add
bdver2 def_and_undef
* config/i386/i386.c (struct processor_costs bdver2_cost): New
bdver2 cost table.
(m_BDVER2): New definition.
(m_AMD_MULTIPLE): Includes m_BDVER2.
(initial_ix86_tune_features): Add bdver2 tuning.
(processor_target_table): Add bdver2 entry.
(static const char *const cpu_names): Add bdver2 entry.
(ix86_option_override_internal): Add bdver2 instruction sets.
(ix86_issue_rate): Add bdver2.
(ix86_adjust_cost): Add bdver2.
(has_dispatch): Add bdver2.
* config/i386/i386.h (TARGET_BDVER2): New definition.
(enum target_cpu_default): Add TARGET_CPU_DEFAULT_bdver2.
(enum processor_type): Add PROCESSOR_BDVER2.
* config/i386/i386.md (define_attr "cpu"): Add bdver2.
* config/i386/i386.opt ( mdispatch-scheduler): Add bdver2 to
description.
2011-07-12 Richard Henderson <rth@redhat.com> 2011-07-12 Richard Henderson <rth@redhat.com>
PR target/49714 PR target/49714
......
...@@ -1289,7 +1289,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i ...@@ -1289,7 +1289,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
need_64bit_hwint=yes need_64bit_hwint=yes
need_64bit_isa=yes need_64bit_isa=yes
case X"${with_cpu}" in case X"${with_cpu}" in
Xgeneric|Xatom|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver1|Xbtver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3) Xgeneric|Xatom|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver2|Xbdver1|Xbtver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)
;; ;;
X) X)
if test x$with_cpu_64 = x; then if test x$with_cpu_64 = x; then
...@@ -1298,7 +1298,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i ...@@ -1298,7 +1298,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
;; ;;
*) *)
echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2 echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
echo "generic atom core2 corei7 corei7-avx nocona x86-64 bdver1 btver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2 echo "generic atom core2 corei7 corei7-avx nocona x86-64 bdver2 bdver1 btver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2
exit 1 exit 1
;; ;;
esac esac
...@@ -1414,7 +1414,7 @@ i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*) ...@@ -1414,7 +1414,7 @@ i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
need_64bit_hwint=yes need_64bit_hwint=yes
need_64bit_isa=yes need_64bit_isa=yes
case X"${with_cpu}" in case X"${with_cpu}" in
Xgeneric|Xatom|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver1|Xbtver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3) Xgeneric|Xatom|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver2|Xbdver1|Xbtver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)
;; ;;
X) X)
if test x$with_cpu_64 = x; then if test x$with_cpu_64 = x; then
...@@ -1423,7 +1423,7 @@ i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*) ...@@ -1423,7 +1423,7 @@ i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
;; ;;
*) *)
echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2 echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
echo "generic atom core2 corei7 corei7-avx nocona x86-64 bdver1 btver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2 echo "generic atom core2 corei7 corei7-avx nocona x86-64 bdver2 bdver1 btver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2
exit 1 exit 1
;; ;;
esac esac
...@@ -1493,7 +1493,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*) ...@@ -1493,7 +1493,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
if test x$enable_targets = xall; then if test x$enable_targets = xall; then
tm_defines="${tm_defines} TARGET_BI_ARCH=1" tm_defines="${tm_defines} TARGET_BI_ARCH=1"
case X"${with_cpu}" in case X"${with_cpu}" in
Xgeneric|Xatom|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver1|Xbtver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3) Xgeneric|Xatom|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver2|Xbdver1|Xbtver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)
;; ;;
X) X)
if test x$with_cpu_64 = x; then if test x$with_cpu_64 = x; then
...@@ -1502,7 +1502,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*) ...@@ -1502,7 +1502,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
;; ;;
*) *)
echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2 echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
echo "generic atom core2 corei7 Xcorei7-avx nocona x86-64 bdver1 btver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2 echo "generic atom core2 corei7 Xcorei7-avx nocona x86-64 bdver2 bdver1 btver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2
exit 1 exit 1
;; ;;
esac esac
...@@ -2748,6 +2748,10 @@ case ${target} in ...@@ -2748,6 +2748,10 @@ case ${target} in
;; ;;
i686-*-* | i786-*-*) i686-*-* | i786-*-*)
case ${target_noncanonical} in case ${target_noncanonical} in
bdver2-*)
arch=bdver2
cpu=bdver2
;;
bdver1-*) bdver1-*)
arch=bdver1 arch=bdver1
cpu=bdver1 cpu=bdver1
...@@ -2841,6 +2845,10 @@ case ${target} in ...@@ -2841,6 +2845,10 @@ case ${target} in
;; ;;
x86_64-*-*) x86_64-*-*)
case ${target_noncanonical} in case ${target_noncanonical} in
bdver2-*)
arch=bdver2
cpu=bdver2
;;
bdver1-*) bdver1-*)
arch=bdver1 arch=bdver1
cpu=bdver1 cpu=bdver1
...@@ -3276,8 +3284,9 @@ case "${target}" in ...@@ -3276,8 +3284,9 @@ case "${target}" in
;; ;;
"" | x86-64 | generic | native \ "" | x86-64 | generic | native \
| k8 | k8-sse3 | athlon64 | athlon64-sse3 | opteron \ | k8 | k8-sse3 | athlon64 | athlon64-sse3 | opteron \
| opteron-sse3 | athlon-fx | bdver1 | btver1 | amdfam10 \ | opteron-sse3 | athlon-fx | bdver2 | bdver1 | btver1 \
| barcelona | nocona | core2 | corei7 | corei7-avx | atom) | amdfam10 | barcelona | nocona | core2 | corei7 \
| corei7-avx | atom)
# OK # OK
;; ;;
*) *)
......
...@@ -499,6 +499,8 @@ const char *host_detect_local_cpu (int argc, const char **argv) ...@@ -499,6 +499,8 @@ const char *host_detect_local_cpu (int argc, const char **argv)
if (name == SIG_GEODE) if (name == SIG_GEODE)
processor = PROCESSOR_GEODE; processor = PROCESSOR_GEODE;
else if (has_bmi)
processor = PROCESSOR_BDVER2;
else if (has_xop) else if (has_xop)
processor = PROCESSOR_BDVER1; processor = PROCESSOR_BDVER1;
else if (has_sse4a && has_ssse3) else if (has_sse4a && has_ssse3)
...@@ -664,6 +666,9 @@ const char *host_detect_local_cpu (int argc, const char **argv) ...@@ -664,6 +666,9 @@ const char *host_detect_local_cpu (int argc, const char **argv)
case PROCESSOR_BDVER1: case PROCESSOR_BDVER1:
cpu = "bdver1"; cpu = "bdver1";
break; break;
case PROCESSOR_BDVER2:
cpu = "bdver2";
break;
case PROCESSOR_BTVER1: case PROCESSOR_BTVER1:
cpu = "btver1"; cpu = "btver1";
break; break;
......
...@@ -110,6 +110,10 @@ ix86_target_macros_internal (int isa_flag, ...@@ -110,6 +110,10 @@ ix86_target_macros_internal (int isa_flag,
def_or_undef (parse_in, "__bdver1"); def_or_undef (parse_in, "__bdver1");
def_or_undef (parse_in, "__bdver1__"); def_or_undef (parse_in, "__bdver1__");
break; break;
case PROCESSOR_BDVER2:
def_or_undef (parse_in, "__bdver2");
def_or_undef (parse_in, "__bdver2__");
break;
case PROCESSOR_BTVER1: case PROCESSOR_BTVER1:
def_or_undef (parse_in, "__btver1"); def_or_undef (parse_in, "__btver1");
def_or_undef (parse_in, "__btver1__"); def_or_undef (parse_in, "__btver1__");
...@@ -198,6 +202,9 @@ ix86_target_macros_internal (int isa_flag, ...@@ -198,6 +202,9 @@ ix86_target_macros_internal (int isa_flag,
case PROCESSOR_BDVER1: case PROCESSOR_BDVER1:
def_or_undef (parse_in, "__tune_bdver1__"); def_or_undef (parse_in, "__tune_bdver1__");
break; break;
case PROCESSOR_BDVER2:
def_or_undef (parse_in, "__tune_bdver2__");
break;
case PROCESSOR_BTVER1: case PROCESSOR_BTVER1:
def_or_undef (parse_in, "__tune_btver1__"); def_or_undef (parse_in, "__tune_btver1__");
break; break;
......
...@@ -242,6 +242,7 @@ extern const struct processor_costs ix86_size_cost; ...@@ -242,6 +242,7 @@ extern const struct processor_costs ix86_size_cost;
#define TARGET_GENERIC (TARGET_GENERIC32 || TARGET_GENERIC64) #define TARGET_GENERIC (TARGET_GENERIC32 || TARGET_GENERIC64)
#define TARGET_AMDFAM10 (ix86_tune == PROCESSOR_AMDFAM10) #define TARGET_AMDFAM10 (ix86_tune == PROCESSOR_AMDFAM10)
#define TARGET_BDVER1 (ix86_tune == PROCESSOR_BDVER1) #define TARGET_BDVER1 (ix86_tune == PROCESSOR_BDVER1)
#define TARGET_BDVER2 (ix86_tune == PROCESSOR_BDVER2)
#define TARGET_BTVER1 (ix86_tune == PROCESSOR_BTVER1) #define TARGET_BTVER1 (ix86_tune == PROCESSOR_BTVER1)
#define TARGET_ATOM (ix86_tune == PROCESSOR_ATOM) #define TARGET_ATOM (ix86_tune == PROCESSOR_ATOM)
...@@ -585,6 +586,7 @@ enum target_cpu_default ...@@ -585,6 +586,7 @@ enum target_cpu_default
TARGET_CPU_DEFAULT_k8, TARGET_CPU_DEFAULT_k8,
TARGET_CPU_DEFAULT_amdfam10, TARGET_CPU_DEFAULT_amdfam10,
TARGET_CPU_DEFAULT_bdver1, TARGET_CPU_DEFAULT_bdver1,
TARGET_CPU_DEFAULT_bdver2,
TARGET_CPU_DEFAULT_btver1, TARGET_CPU_DEFAULT_btver1,
TARGET_CPU_DEFAULT_max TARGET_CPU_DEFAULT_max
...@@ -2031,6 +2033,7 @@ enum processor_type ...@@ -2031,6 +2033,7 @@ enum processor_type
PROCESSOR_GENERIC64, PROCESSOR_GENERIC64,
PROCESSOR_AMDFAM10, PROCESSOR_AMDFAM10,
PROCESSOR_BDVER1, PROCESSOR_BDVER1,
PROCESSOR_BDVER2,
PROCESSOR_BTVER1, PROCESSOR_BTVER1,
PROCESSOR_ATOM, PROCESSOR_ATOM,
PROCESSOR_max PROCESSOR_max
......
...@@ -369,7 +369,7 @@ ...@@ -369,7 +369,7 @@
;; Processor type. ;; Processor type.
(define_attr "cpu" "none,pentium,pentiumpro,geode,k6,athlon,k8,core2,corei7, (define_attr "cpu" "none,pentium,pentiumpro,geode,k6,athlon,k8,core2,corei7,
atom,generic64,amdfam10,bdver1,btver1" atom,generic64,amdfam10,bdver1,bdver2,btver1"
(const (symbol_ref "ix86_schedule"))) (const (symbol_ref "ix86_schedule")))
;; A basic instruction type. Refinements due to arguments to be ;; A basic instruction type. Refinements due to arguments to be
......
...@@ -384,7 +384,7 @@ the function. ...@@ -384,7 +384,7 @@ the function.
mdispatch-scheduler mdispatch-scheduler
Target RejectNegative Var(flag_dispatch_scheduler) Target RejectNegative Var(flag_dispatch_scheduler)
Do dispatch scheduling if processor is bdver1 and Haifa scheduling Do dispatch scheduling if processor is bdver1 or bdver2 and Haifa scheduling
is selected. is selected.
mprefer-avx128 mprefer-avx128
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment