aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2010-02-26 14:52:01 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2010-02-26 06:52:01 -0800
commita3af5e261521a29fc418f4125ce9a70f711844db (patch)
tree051265a5e5052cc78c76614600b4d97cd418492b /gcc
parent482b2e5b35aa5cb70d5d5c3ac3073fb432886a1c (diff)
downloadgcc-a3af5e261521a29fc418f4125ce9a70f711844db.zip
gcc-a3af5e261521a29fc418f4125ce9a70f711844db.tar.gz
gcc-a3af5e261521a29fc418f4125ce9a70f711844db.tar.bz2
Support --with-fpmath=sse for x86.
2010-02-26 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Support --with-fpmath=sse for x86. * config/i386/ssemath.h: New. * doc/install.texi (--with-fpmath=sse): Documented. From-SVN: r157090
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config.gcc34
-rw-r--r--gcc/config/i386/ssemath.h25
-rw-r--r--gcc/doc/install.texi5
4 files changed, 71 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 047ba5e..04c635c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2010-02-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config.gcc: Support --with-fpmath=sse for x86.
+
+ * config/i386/ssemath.h: New.
+
+ * doc/install.texi (--with-fpmath=sse): Documented.
+
2010-02-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43188
diff --git a/gcc/config.gcc b/gcc/config.gcc
index d2d4ad7..df84f50 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2835,7 +2835,18 @@ esac
# This block sets nothing except for with_arch.
if test x$with_arch = x ; then
case ${target} in
- i[34567]86-*-*|x86_64-*-*)
+ i[34567]86-*-darwin*)
+ # Don't set default arch for Darwin since it will set the default
+ # ISA to SSE2.
+ ;;
+ i[34567]86-*-*)
+ # Don't set default arch if --with-fpmath is used since it will set
+ # the default ISA to SSE2.
+ if test x$with_fpmath = x; then
+ with_arch=$arch
+ fi
+ ;;
+ x86_64-*-*)
with_arch=$arch
;;
esac
@@ -2856,6 +2867,27 @@ if test x$with_arch = x ; then
esac
fi
+# Support --with-fpmath.
+if test x$with_fpmath != x; then
+ case ${target} in
+ i[34567]86-*-* | x86_64-*-*)
+ case ${with_fpmath} in
+ sse)
+ tm_file="${tm_file} i386/ssemath.h"
+ ;;
+ *)
+ echo "Invalid --with-fpmath=$with_fpmath" 1>&2
+ exit 1
+ ;;
+ esac
+ ;;
+ *)
+ echo "--with-fpmath isn't supported for $target." 1>&2
+ exit 1
+ ;;
+ esac
+fi
+
# Similarly for --with-schedule.
if test x$with_schedule = x; then
case ${target} in
diff --git a/gcc/config/i386/ssemath.h b/gcc/config/i386/ssemath.h
new file mode 100644
index 0000000..357d6a3
--- /dev/null
+++ b/gcc/config/i386/ssemath.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 2010
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#undef TARGET_FPMATH_DEFAULT
+#define TARGET_FPMATH_DEFAULT (TARGET_SSE2 ? FPMATH_SSE : FPMATH_387)
+
+#undef TARGET_SUBTARGET32_ISA_DEFAULT
+#define TARGET_SUBTARGET32_ISA_DEFAULT \
+ (OPTION_MASK_ISA_MMX | OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_SSE2)
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 1370b47..0a50d6a 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1170,6 +1170,11 @@ of the arguments depend on the target.
Specify if the compiler should default to @option{-marm} or @option{-mthumb}.
This option is only supported on ARM targets.
+@item --with-fpmath=sse
+Specify if the compiler should default to @option{-msse2} and
+@option{-mfpmath=sse}. This option is only supported on i386 and
+x86-64 targets.
+
@item --with-divide=@var{type}
Specify how the compiler should generate code for checking for
division by zero. This option is only supported on the MIPS target.