diff mbox

[avr] Fix PR66956: Uses 32->64 widening mul instead of 32-bit mul libcall without MUL.

Message ID 55AE40F9.10500@gjlay.de
State New
Headers show

Commit Message

Georg-Johann Lay July 21, 2015, 12:54 p.m. UTC
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.

Comments

Denis Chertykov July 21, 2015, 4:27 p.m. UTC | #1
2015-07-21 15:54 GMT+03:00 Georg-Johann Lay <avr@gjlay.de>:
> 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?


Approved.
Please commit.

>
>
>         PR target/66956
>         * config/avr/avr-dimode.md (<extend_u>mulsidi3_insn)
>         (<extend_u>mulsidi3): Don't use if !AVR_HAVE_MUL.
>
diff mbox

Patch

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")])