@@ -393,12 +393,16 @@ spu*-*-*)
s390*-*-*)
cpu_type=s390
need_64bit_hwint=yes
+ extra_options="${extra_options} fused-madd.opt"
;;
# Note the 'l'; we need to be able to match e.g. "shle" or "shl".
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