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]

[Bug target/84756] Multiplication done twice just to get upper and lower parts of product


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84756

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
We immediately narrow "return (Longer)a*b;" to "return a*b;" which makes it
hard to CSE later.
If you can, it would be better to write the code as:
Longer mul = (Longer)a*b;
... use mul twice ...

Not sure what the best place would be for this optimization. Somewhere in RTL
when we don't care about signed/unsigned? Earlier in value numbering, checking
for each mult if a widening version is already available? Other, say like we
check if cos and sin are called on the same argument?

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