+2010-11-11 Richard Henderson <rth@redhat.com>
+
+ * config/fused-madd.opt: New file.
+ * config.gcc [i386-*, x86_64-*] (extra_options): Use it.
+ * config/i386/i386.c (ix86_extra_costs): Handle FMA.
+ (TARGET_DEFAULT_TARGET_FLAGS): Remove MASK_FUSED_MADD.
+ * config/i386/i386.opt (mfused-madd): Remove.
+ * config/i386/sse.md (split_fma): Remove.
+ (split_fms, split_fnma, split_fnms): Remove.
+
2010-11-12 Jakub Jelinek <jakub@redhat.com>
PR target/46088
cpu_type=i386
c_target_objs="i386-c.o"
cxx_target_objs="i386-c.o"
+ extra_options="${extra_options} fused-madd.opt"
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
cpu_type=i386
c_target_objs="i386-c.o"
cxx_target_objs="i386-c.o"
+ extra_options="${extra_options} fused-madd.opt"
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
--- /dev/null
+; -mfused-madd option (some targets only).
+;
+; 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/>.
+
+mfused-madd
+Target Undocumented Alias(ffp-contract=, fast, off) Warn(%<-mfused-madd%> is deprecated; use %<-ffp-contract=%> instead)
+
+; This comment is to ensure we retain the blank line above.
}
return false;
+ case FMA:
+ {
+ rtx sub;
+
+ gcc_assert (FLOAT_MODE_P (mode));
+ gcc_assert (TARGET_FMA || TARGET_FMA4);
+
+ /* ??? SSE scalar/vector cost should be used here. */
+ /* ??? Bald assumption that fma has the same cost as fmul. */
+ *total = cost->fmul;
+ *total += rtx_cost (XEXP (x, 1), FMA, speed);
+
+ /* Negate in op0 or op2 is free: FMS, FNMA, FNMS. */
+ sub = XEXP (x, 0);
+ if (GET_CODE (sub) == NEG)
+ sub = XEXP (x, 0);
+ *total += rtx_cost (sub, FMA, speed);
+
+ sub = XEXP (x, 2);
+ if (GET_CODE (sub) == NEG)
+ sub = XEXP (x, 0);
+ *total += rtx_cost (sub, FMA, speed);
+ return true;
+ }
+
case MULT:
if (SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)
{
#define TARGET_DEFAULT_TARGET_FLAGS \
(TARGET_DEFAULT \
| TARGET_SUBTARGET_DEFAULT \
- | TARGET_TLS_DIRECT_SEG_REFS_DEFAULT \
- | MASK_FUSED_MADD)
+ | TARGET_TLS_DIRECT_SEG_REFS_DEFAULT)
#undef TARGET_HANDLE_OPTION
#define TARGET_HANDLE_OPTION ix86_handle_option
Generate vzeroupper instruction before a transfer of control flow out of
the function.
-mfused-madd
-Target Report Mask(FUSED_MADD) Save
-Enable automatic generation of fused floating point multiply-add instructions
-if the ISA supports such instructions. The -mfused-madd option is on by
-default.
-
mdispatch-scheduler
Target RejectNegative Var(flag_dispatch_scheduler)
Do dispatch scheduling if processor is bdver1 and Haifa scheduling
;; (set (reg1) (mem (addr1)))
;; (set (reg2) (mult (reg1) (mem (addr2))))
;; (set (reg3) (plus (reg2) (mem (addr3))))
+;;
+;; ??? This is historic, pre-dating the gimple fma transformation.
+;; We could now properly represent that only one memory operand is
+;; allowed and not be penalized during optimization.
;; Intrinsic FMA operations.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
-;; Non-intrinsic versions, matched when fused-multiply-add is allowed.
-;;
-;; ??? If fused-madd were a generic flag, combine could do this without
-;; needing splitters here in the backend. Irritatingly, combine won't
-;; recognize many of these with mere splits, since only 3 or more insns
-;; are allowed to split during combine. Thankfully, there's always a
-;; split_all_insns pass that runs before reload.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(define_insn_and_split "*split_fma"
- [(set (match_operand:FMAMODE 0 "register_operand")
- (plus:FMAMODE
- (mult:FMAMODE
- (match_operand:FMAMODE 1 "nonimmediate_operand")
- (match_operand:FMAMODE 2 "nonimmediate_operand"))
- (match_operand:FMAMODE 3 "nonimmediate_operand")))]
- "TARGET_SSE_MATH && TARGET_FUSED_MADD
- && (TARGET_FMA || TARGET_FMA4)
- && !(reload_in_progress || reload_completed)"
- { gcc_unreachable (); }
- "&& 1"
- [(set (match_dup 0)
- (fma:FMAMODE
- (match_dup 1)
- (match_dup 2)
- (match_dup 3)))]
- "")
-
-;; Floating multiply and subtract.
-(define_insn_and_split "*split_fms"
- [(set (match_operand:FMAMODE 0 "register_operand")
- (minus:FMAMODE
- (mult:FMAMODE
- (match_operand:FMAMODE 1 "nonimmediate_operand")
- (match_operand:FMAMODE 2 "nonimmediate_operand"))
- (match_operand:FMAMODE 3 "nonimmediate_operand")))]
- "TARGET_SSE_MATH && TARGET_FUSED_MADD
- && (TARGET_FMA || TARGET_FMA4)
- && !(reload_in_progress || reload_completed)"
- { gcc_unreachable (); }
- "&& 1"
- [(set (match_dup 0)
- (fma:FMAMODE
- (match_dup 1)
- (match_dup 2)
- (neg:FMAMODE (match_dup 3))))]
- "")
-
-;; Floating point negative multiply and add.
-;; Recognize (-a * b + c) via the canonical form: c - (a * b).
-(define_insn_and_split "*split_fnma"
- [(set (match_operand:FMAMODE 0 "register_operand")
- (minus:FMAMODE
- (match_operand:FMAMODE 3 "nonimmediate_operand")
- (mult:FMAMODE
- (match_operand:FMAMODE 1 "nonimmediate_operand")
- (match_operand:FMAMODE 2 "nonimmediate_operand"))))]
- "TARGET_SSE_MATH && TARGET_FUSED_MADD
- && (TARGET_FMA || TARGET_FMA4)
- && !(reload_in_progress || reload_completed)"
- { gcc_unreachable (); }
- "&& 1"
- [(set (match_dup 0)
- (fma:FMAMODE
- (neg:FMAMODE (match_dup 1))
- (match_dup 2)
- (match_dup 3)))]
- "")
-
-;; Floating point negative multiply and subtract.
-;; Recognize (-a * b - c) via the canonical form: c - (-a * b).
-(define_insn_and_split "*split_fnms"
- [(set (match_operand:FMAMODE 0 "register_operand")
- (minus:FMAMODE
- (mult:FMAMODE
- (neg:FMAMODE
- (match_operand:FMAMODE 1 "nonimmediate_operand"))
- (match_operand:FMAMODE 2 "nonimmediate_operand"))
- (match_operand:FMAMODE 3 "nonimmediate_operand")))]
- "TARGET_SSE_MATH && TARGET_FUSED_MADD
- && (TARGET_FMA || TARGET_FMA4)
- && !(reload_in_progress || reload_completed)"
- { gcc_unreachable (); }
- "&& 1"
- [(set (match_dup 0)
- (fma:FMAMODE
- (neg:FMAMODE (match_dup 1))
- (match_dup 2)
- (neg:FMAMODE (match_dup 3))))]
- "")
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
;; Parallel single-precision floating point conversion operations
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+2010-11-11 Richard Henderson <rth@redhat.com>
+
+ * gcc.target/i386/sse-24.c: Use -ffp-contract.
+
2010-11-11 Jan Hubicka <jh@suse.cz>
* gcc.dg/tree-ssa/inline-5.c: Fix testcase.
/* PR target/44338 */
/* { dg-do compile } */
-/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -mno-fused-madd" } */
+/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -ffp-contract=off" } */
#include "sse-23.c"