This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch,avr] Fix PR66956: Uses 32->64 widening mul instead of 32-bit mul libcall without MUL.
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Denis Chertykov <chertykov at gmail dot com>
- Date: Tue, 21 Jul 2015 14:54:17 +0200
- Subject: [patch,avr] Fix PR66956: Uses 32->64 widening mul instead of 32-bit mul libcall without MUL.
- Authentication-results: sourceware.org; auth=none
This works around an assumption in optabs, namely that if a widening-mul insn
is available but no mul<mode>3 insn, then the widening multiplication insn is
preferred over expanding the <mode> multiply as a libcall.
The problem occurs only if !AVR_HAVE_MUL, so I added that condition to
respective mulsidi3 patterns in avr-dimode.md.
Ok for trunk, 5-branch and 4_9-branch?
PR target/66956
* config/avr/avr-dimode.md (<extend_u>mulsidi3_insn)
(<extend_u>mulsidi3): Don't use if !AVR_HAVE_MUL.
Index: avr-dimode.md
===================================================================
--- avr-dimode.md (revision 226011)
+++ avr-dimode.md (working copy)
@@ -461,7 +461,8 @@ (define_expand "<extend_u>mulsidi3"
(match_operand:SI 2 "general_operand" "")
;; Just to mention the iterator
(clobber (any_extend:SI (match_dup 1)))])]
- "avr_have_dimode"
+ "avr_have_dimode
+ && AVR_HAVE_MUL"
{
avr_fix_inputs (operands, 1 << 2, regmask (SImode, 22));
emit_move_insn (gen_rtx_REG (SImode, 22), operands[1]);
@@ -480,7 +481,8 @@ (define_insn "<extend_u>mulsidi3_insn"
(any_extend:DI (reg:SI 22))))
(clobber (reg:HI REG_X))
(clobber (reg:HI REG_Z))]
- "avr_have_dimode"
+ "avr_have_dimode
+ && AVR_HAVE_MUL"
"%~call __<extend_u>mulsidi3"
[(set_attr "adjust_len" "call")
(set_attr "cc" "clobber")])