MSP430: Add mul{hi,si} and {u,}mulsidi3 expanders
authorJozef Lawrynowicz <jozef.l@mittosystems.com>
Sun, 15 Nov 2020 21:03:10 +0000 (21:03 +0000)
committerJozef Lawrynowicz <jozef.l@mittosystems.com>
Wed, 18 Nov 2020 11:03:39 +0000 (11:03 +0000)
commite045b85836091f2461263a3c3f4f1972b3753f9d
tree7565c2a12be4e7efaeacbc0c109dd27d4ec5fa4d
parent30270bf042049bf6aee6184e0b7688d9ca7b479d
MSP430: Add mul{hi,si} and {u,}mulsidi3 expanders

GCC generates better code when multiplication operations, which require
library functions to perform, are caught in early in RTL, rather than
leaving the operation to be mapped to a library function later on.

When there is hardware multiply support, it is more efficient to perform
widening multiplication using the hardware multiplier instead of letting
GCC widen the arguments before calling the multiplication routine in the
wider mode.

gcc/ChangeLog:

* config/msp430/msp430.md (mulhi3): New.
(mulsi3): New.
(mulsidi3): Rename to *mulsidi3_inline.
(umulsidi3): Rename to *umulsidi3_inline.
(mulsidi3): New define_expand.
(umulsidi3): New define_expand.
gcc/config/msp430/msp430.md