MSP430: Implement TARGET_RTX_COSTS
authorJozef Lawrynowicz <jozef.l@mittosystems.com>
Fri, 13 Nov 2020 15:35:42 +0000 (15:35 +0000)
committerJozef Lawrynowicz <jozef.l@mittosystems.com>
Fri, 13 Nov 2020 15:36:30 +0000 (15:36 +0000)
commitf62dd3982398d031bc26c853522c5f4e20ef08fc
tree66dd239c6da387cdb22bfc13a4c14042d9938722
parent953587a2b0fb171b94685f2808e906adb66d4f0b
MSP430: Implement TARGET_RTX_COSTS

Costs of MSP430 instructions are mostly just a function of the type and
number of operands; knowledge of the specific instruction often
isn't required to calculate the cost.
In these cases, TARGET_RTX_COSTS just needs to examine the operands to
calculate the cost of the expression.

For more complicated operations where library helper functions are
required, if the cost cannot be accurately calculated, it is estimated
and disparaged relative to the cost of a single instruction.

gcc/ChangeLog:

* config/msp430/msp430.c (use_helper_for_const_shift): Add forward
declaration.
Remove unused argument.
(struct msp430_multlib_costs): New struct.
(msp430_is_mem_indirect): New function.
(msp430_costs): Likewise.
(msp430_shift_costs): Likewise.
(msp430_muldiv_costs): Likewise.
(msp430_get_inner_dest_code): Likewise.
(msp430_single_op_cost): Likewise.
(msp430_rtx_costs): Rewrite from scratch.
(msp430_expand_shift): Adjust use_helper_for_const_shift call.
gcc/config/msp430/msp430.c