Hi Guys, I am applying the attached patch to reduce the number of multilibs for the MSP430 target. This is at the request of TI, on behalf of their customers, who complained that the toolchain was too large. The patch only affects MSP430 specific files, and parts of files. It does not touch anything else.
The patch removes the multilibs based upon the version of hardware multiply support that is used, and instead creates a separate set of libraries just containing the multiply routines. All normal libraries, and user created object files, now call the software multiply routines by default[*]. At link time however one of the specific hardware multiply libraries can be linked in to provide hardware based alternatives to the software multiply functions. As a side effect the patch also fixes a couple of unexpected failures in the gcc testsuite (gcc.dg/cleanup-[12|13|5].c). It also adds some new tests the MSP430 specific section of the gcc testsuite that check the behaviour of the multiply functions for all possible variations oh hardware multiply support. Cheers Nick [*] There is an exception to the all-files-call-software-multiply rule. If a file is compiled at -O3 or above, with a hardware multiply type specified as well, then the hardware functions will be used inline when appropriate. Hence no library should ever be compiled in this way, unless the builder is sure that it will only ever be used on the appropriate hardware. gcc/ChangeLog 2015-11-25 Nick Clifton <ni...@redhat.com> * config.gcc (extra_gcc_objs): Define for MSP430. * common/config/msp430/msp430-common.c (msp430_handle_option): Pass both -mmcu and -mcpu on to the back end if they are both defined. * config/msp430/msp430.c (hwmult_name): New function. (msp430_option_override): If an unrecognised MCU name is detected only warn if the user has not provided suitable -mhwmult and -mcpu options. Use msp430_warn_mcu to control warning messages. Generate warnings about conflicts between -mmcu and -mcpu and -mhwmult options. If neither -mcpu nor -mmcu have been specified but -mhwmult= f5series has the select the 430X isa. (msp430_no_hwmult): If -mmcu has not been specified and msp430_hwmult_type is AUTO then return true. * config/msp430/msp430.h (EXTRA_SPEC_FUNCTIONS): Define. (LIB_SPEC): Add hardware multiply library selection. * config/msp430/t-msp430: Delete hardware multiply multilibs. Add rule to build driver-msp430.o * config/msp430/driver-msp430.c: New file. * config/msp430/msp430.opt (warn-mcu): New option. * doc/invoke.texi: Update description of -mhwmult=auto. Document -mwarn-mcu option. gcc/testsuite/ChangeLog 2015-11-25 Nick Clifton <ni...@redhat.com> * gcc.target/msp430/msp_abi_div_funcs.c: New test. * gcc.target/msp430/mul_main.h: New test support file. * gcc.target/msp430/mul_none.c: New test. * gcc.target/msp430/mul_16bit.c: New test. * gcc.target/msp430/mul_32bit.c: New test. * gcc.target/msp430/mul_f5.c: New test. libgcc/ChangeLog 2015-12-04 Nick Clifton <ni...@redhat.com> * config/msp430/mpy.c (__mulhi3): Use a faster algorithm. Allow for the second argument being negative. * config.host (extra_parts): Define for MSP430. Create separate libraries for each of the hardware multiply formats. * config/msp430/lib2hw_mul.S: Build only the multiply routines that are needed. * config/msp430/lib2mul.c: Likewise. * config/msp430/t-msp430 (LIB2ADD): Remove lib2hw_mul.S. Add rules to build hardware multiply libraries. * config/msp430/lib2divSI.c: (__mspabi_divlu): Alias for __mspabi_divul function. (__mspabi_divllu): New stub function.
msp430.hwmul.patch.2.xz
Description: application/xz