This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Curious REG_EQUAL note for multiplication

Thanks for your comment!

Michael Matz <> wrote:
>> (insn 87 86 88 ice.i:6 (parallel [
>>             (set (subreg:SI (reg:DI 220) 0)
>>                 (ashift:SI (subreg:SI (reg:DI 218) 0)
>>                     (const_int 9 [0x9])))
>>             (clobber (scratch:SI))
>>         ]) -1 (expr_list:REG_EQUAL (mult:DI (reg:DI 169)
>>             (const_int 1000000000 [0x3b9aca00]))
>>         (nil)))
>Have you checked that also the high part of reg 220 is set correctly?  In 
>any case, the note indeed is fishy but we don't have a better place to put 
>it anymore, since we removed the (set (reg x) (reg x)) finisher of 
>multireg libcall sequences.  That's actually bad, hmm...

Yep.  The previous two insns set the high part:

(insn 85 84 86 ice.i:6 (parallel [
            (set (subreg:SI (reg:DI 220) 4)
                (ashift:SI (subreg:SI (reg:DI 218) 4)
                    (const_int 9 [0x9])))
            (clobber (scratch:SI))
        ]) -1 (nil))

(insn 86 85 87 ice.i:6 (set (subreg:SI (reg:DI 220) 4)
        (ior:SI (reg:SI 221)
            (subreg:SI (reg:DI 220) 4))) -1 (nil))

> ... so maybe it would work, if you instead, when the modes are different, 
> emit a (set result result) insn yourself, and attach the note there?  
> Otherwise we probably get some const-fold regressions.

It looks that the insn 85-87 are for a DImode shift.  Perhaps
if a (set result result) insn is added to SH's ashldi3, that will
work, though it would be a bit hackish.

BTW, even with my patch, .cse1 dump shows 50 * 1000000000
(= 0xba43b7400) is folded:

(insn 86 85 87 2 ice2.i:6 (set (reg:SI 230 [+4 ])
        (const_int 11 [0xb])) 175 {movsi_ie} (nil))

(insn 87 86 108 2 ice2.i:6 (set (reg:SI 229)
        (const_int -1539607552 [0xffffffffa43b7400])) 175 {movsi_ie} (nil))

though I don't know how this folding is done without the reg


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]