This is the mail archive of the gcc-bugs@gcc.gnu.org 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: [Bug optimization/14255] New: i386 backend should be teachedhow to use divl


"bernie at develer dot com" <gcc-bugzilla@gcc.gnu.org> writes:

> When dividing a 64bit integer by a 32bit integer,
> GCC promotes everything to 64bits and generates
> dumb code calling *both* __divdi3 and __moddi3.

This ought to be addressable with a pattern of the form

  (parallel [
    (set (reg:SI quo)
         (truncate:SI (div:DI  (reg:DI dividend)
                               (zero_extend:DI (reg:SI divisor)))))
    (set (reg:SI rem)
         (truncate:SI (mod:DI  (reg:DI dividend)
                               (zero_extend:DI (reg:SI divisor)))))
    ])

but I am not sure where it goes in i386.md.

zw


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