[Bug rtl-optimization/17236] inefficient code for long long multiply on x86

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Dec 18 18:20:00 GMT 2007



------- Comment #15 from ubizjak at gmail dot com  2007-12-18 18:20 -------
(In reply to comment #7)

>         mull    %ebx
>         leal    (%ecx,%edx), %esi   ; what the heck, a simple addl could do!
>         movl    %esi, %edx

Something disturbs RA to emit two DImode moves:

(insn:HI 10 36 37 2 m.c:2 (parallel [
            (set (reg:DI 0 ax)
                (mult:DI (zero_extend:DI (reg:SI 0 ax))
                    (zero_extend:DI (reg:SI 3 bx [orig:64 a ] [64]))))
            (clobber (reg:CC 17 flags))
        ]) 304 {*umulsidi3_insn} (nil))

(insn 37 10 11 2 m.c:2 (set (reg:DI 3 bx [61])
        (reg:DI 0 ax)) 88 {*movdi_2} (nil))

(note:HI 11 37 12 2 NOTE_INSN_DELETED)

(insn:HI 12 11 18 2 m.c:2 (parallel [
            (set (reg:SI 4 si [+4 ])
                (plus:SI (reg:SI 2 cx [62])
                    (reg:SI 4 si [+4 ])))
            (clobber (reg:CC 17 flags))
        ]) 249 {*addsi_1} (nil))

(insn:HI 18 12 24 2 m.c:4 (set (reg/i:DI 0 ax [ <result> ])
        (reg:DI 3 bx [61])) 88 {*movdi_2} (nil))

(insn 24 18 33 2 m.c:4 (use (reg/i:DI 0 ax [ <result> ])) -1 (nil))

Note two moves [(insn 36) and (insn 37)] around (insn 12).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17236



More information about the Gcc-bugs mailing list