This is the mail archive of the gcc-patches@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]

[PATCH (0/7)] Improve use of Widening Multiplies


Hi all,

This patch series is intended to improve use of widening multiply, and widening multiply-and-accumulate instructions. This is primarily for the benefit of ARM targets, but should give some improvements to other targets also.

The patches provide a number of improvements:

 * Support for instructions that widen by more than one mode
   (e.g. from HImode to DImode).

 * Use of widening multiplies even when the input mode is narrower than
   the instruction uses. (e.g. Use HI->DI to do QI->DI).

 * Use of signed widening multiplies (of a larger mode) where unsigned
   multiplies are not available.

 * Support for input operands with mis-matched signedness, with or
   without usmul_widen_optab.

* Support for input operands with mis-matched mode [1].

 * Improved pattern matching in the widening_mult pass.
   * Recognition of true types, even if obscured by a cast.
   * Insertion of extra gimple statements where the existing code was
     incompatible with widening multiplies.
   * Recognition of widening multiply-and-accumulate even where the
     multiply expression was not widening.

The end result is that, on ARM, many many of the cases where the compiler would fall back to regular multiplies, extensions, and add instructions can now be handled with just one instruction.

For those interested in the before and after states, I have attached a couple of shell scripts. These generate test cases with many permutations of types and signedness.

[1] Operands of mis-matched mode are multiplied by extending the smaller one to match the larger one. Although this does not support mis-matched mode instructions directly, this ought to improve the chances of the combine pass doing The Right Thing. (Although this does depend on there being a suitable matched-mode instruction for widen_mult/expand to use.)

So, on to the patches ....

Andrew

Attachment: script2
Description: Text document

Attachment: script3
Description: Text document


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