@@ -9907,6 +9907,42 @@
;;
;; On BDVER1, all HI MULs use DoublePath
+(define_insn "*mul<mode>3_1_nf"
+ [(set (match_operand:SWIM248 0 "register_operand" "=r,r,r")
+ (mult:SWIM248
+ (match_operand:SWIM248 1 "nonimmediate_operand" "%rm,rm,0")
+ (match_operand:SWIM248 2 "<general_operand>" "K,<i>,<m>r")))]
+ "TARGET_APX_NF &&
+ !(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ "@
+ %{nf%} imul{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}
+ %{nf%} imul{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}
+ %{nf%} imul{<imodesuffix>}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "imul")
+ (set_attr "prefix_0f" "0,0,1")
+ (set (attr "athlon_decode")
+ (cond [(eq_attr "cpu" "athlon")
+ (const_string "vector")
+ (eq_attr "alternative" "1")
+ (const_string "vector")
+ (and (eq_attr "alternative" "2")
+ (ior (match_test "<MODE>mode == HImode")
+ (match_operand 1 "memory_operand")))
+ (const_string "vector")]
+ (const_string "direct")))
+ (set (attr "amdfam10_decode")
+ (cond [(and (eq_attr "alternative" "0,1")
+ (ior (match_test "<MODE>mode == HImode")
+ (match_operand 1 "memory_operand")))
+ (const_string "vector")]
+ (const_string "direct")))
+ (set (attr "bdver1_decode")
+ (if_then_else
+ (match_test "<MODE>mode == HImode")
+ (const_string "double")
+ (const_string "direct")))
+ (set_attr "mode" "<MODE>")])
+
(define_insn "*mul<mode>3_1"
[(set (match_operand:SWIM248 0 "register_operand" "=r,r,r")
(mult:SWIM248
@@ -9978,6 +10014,24 @@
;; MUL reg8 Direct
;; MUL mem8 Direct
+(define_insn "*mulqi3_1_nf"
+ [(set (match_operand:QI 0 "register_operand" "=a")
+ (mult:QI (match_operand:QI 1 "nonimmediate_operand" "%0")
+ (match_operand:QI 2 "nonimmediate_operand" "qm")))]
+ "TARGET_APX_NF &&
+ TARGET_QIMODE_MATH
+ && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ "%{nf%} mul{b}\t%2"
+ [(set_attr "type" "imul")
+ (set_attr "length_immediate" "0")
+ (set (attr "athlon_decode")
+ (if_then_else (eq_attr "cpu" "athlon")
+ (const_string "vector")
+ (const_string "direct")))
+ (set_attr "amdfam10_decode" "direct")
+ (set_attr "bdver1_decode" "direct")
+ (set_attr "mode" "QI")])
+
(define_insn "*mulqi3_1"
[(set (match_operand:QI 0 "register_operand" "=a")
(mult:QI (match_operand:QI 1 "nonimmediate_operand" "%0") @@ -11128,6 +11182,19 @@