Commit 47c21725 by Richard Henderson Committed by Richard Henderson

xtensa: Convert to fma.

        * config.gcc [xtensa] (extra_options): Add fused-madd.opt.
        * config/xtensa/xtensa.opt (mfused-madd): Remove.
        * config/xtensa/xtensa.c (TARGET_DEFAULT_TARGET_FLAGS): Remove
        MASK_FUSED_MADD.
        * config/xtensa/xtensa.md (fmasf4): Rename from muladdsf3; use
        * fma.
        (fnmasf4): Rename from mulsubsf3; use fma.

From-SVN: r166666
parent f1cb6795
2010-11-12 Richard Henderson <rth@redhat.com>
* config.gcc [xtensa] (extra_options): Add fused-madd.opt.
* config/xtensa/xtensa.opt (mfused-madd): Remove.
* config/xtensa/xtensa.c (TARGET_DEFAULT_TARGET_FLAGS): Remove
MASK_FUSED_MADD.
* config/xtensa/xtensa.md (fmasf4): Rename from muladdsf3; use fma.
(fnmasf4): Rename from mulsubsf3; use fma.
2010-11-12 Joern Rennecke <amylaar@spamcop.net>
Richard Henderson <rth@redhat.com>
......@@ -399,6 +399,9 @@ sh[123456789lbe]*-*-* | sh-*-*)
cpu_type=sh
need_64bit_hwint=yes
;;
xtensa*-*-*)
extra_options="${extra_options} fused-madd.opt"
;;
esac
tm_file=${cpu_type}/${cpu_type}.h
......
......@@ -193,7 +193,7 @@ static const struct default_options xtensa_option_optimization_table[] =
#define TARGET_ASM_SELECT_RTX_SECTION xtensa_select_rtx_section
#undef TARGET_DEFAULT_TARGET_FLAGS
#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_FUSED_MADD)
#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT)
#undef TARGET_LEGITIMIZE_ADDRESS
#define TARGET_LEGITIMIZE_ADDRESS xtensa_legitimize_address
......
......@@ -315,24 +315,25 @@
(set_attr "mode" "SF")
(set_attr "length" "3")])
(define_insn "muladdsf3"
(define_insn "fmasf4"
[(set (match_operand:SF 0 "register_operand" "=f")
(plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f")
(match_operand:SF 2 "register_operand" "f"))
(match_operand:SF 3 "register_operand" "0")))]
"TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
(fma:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")
(match_operand:SF 3 "register_operand" "0")))]
"TARGET_HARD_FLOAT"
"madd.s\t%0, %1, %2"
[(set_attr "type" "fmadd")
(set_attr "mode" "SF")
(set_attr "length" "3")])
(define_insn "mulsubsf3"
;; Note that (C - A*B) = (-A*B + C)
(define_insn "fnmasf4"
[(set (match_operand:SF 0 "register_operand" "=f")
(minus:SF (match_operand:SF 1 "register_operand" "0")
(mult:SF (match_operand:SF 2 "register_operand" "%f")
(match_operand:SF 3 "register_operand" "f"))))]
"TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
"msub.s\t%0, %2, %3"
(fma:SF (neg:SF (match_operand:SF 1 "register_operand" "f"))
(match_operand:SF 2 "register_operand" "f")
(match_operand:SF 3 "register_operand" "0")))]
"TARGET_HARD_FLOAT"
"msub.s\t%0, %1, %2"
[(set_attr "type" "fmadd")
(set_attr "mode" "SF")
(set_attr "length" "3")])
......
......@@ -22,10 +22,6 @@ mconst16
Target Report Mask(CONST16)
Use CONST16 instruction to load constants
mfused-madd
Target Report Mask(FUSED_MADD)
Enable fused multiply/add and multiply/subtract FP instructions
mforce-no-pic
Target Report Mask(FORCE_NO_PIC)
Disable position-independent code (PIC) for use in OS kernel code
......
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