aboutsummaryrefslogtreecommitdiff
path: root/gcc/common
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-12-04 17:24:30 +0000
committerNick Clifton <nickc@gcc.gnu.org>2015-12-04 17:24:30 +0000
commit04a9ae287f6d76c60464c57be98550a25b358c34 (patch)
tree567b5a149156fde352ef52d1373ff08ead34394d /gcc/common
parent4b5d538ba7ff4c9d69fd73e1bb2ce88e3fca7562 (diff)
downloadgcc-04a9ae287f6d76c60464c57be98550a25b358c34.zip
gcc-04a9ae287f6d76c60464c57be98550a25b358c34.tar.gz
gcc-04a9ae287f6d76c60464c57be98550a25b358c34.tar.bz2
gcc * 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. tests * 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 * 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. From-SVN: r231286
Diffstat (limited to 'gcc/common')
-rw-r--r--gcc/common/config/msp430/msp430-common.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/common/config/msp430/msp430-common.c b/gcc/common/config/msp430/msp430-common.c
index ce071d1..cbceab9 100644
--- a/gcc/common/config/msp430/msp430-common.c
+++ b/gcc/common/config/msp430/msp430-common.c
@@ -27,9 +27,9 @@
#include "opts.h"
#include "flags.h"
-/* Handle -mcpu= and -mmcu= here. We want to ensure that only one
- of these two options - the last specified on the command line -
- is passed on to the msp430 backend. */
+/* Check for generic -mcpu= and -mmcu= names here. If found then we
+ convert to a baseline cpu name. Otherwise we allow the option to
+ be passed on to the backend where it can be checked more fully. */
static bool
msp430_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
@@ -46,13 +46,11 @@ msp430_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
|| strcasecmp (decoded->arg, "430xv2") == 0)
{
target_cpu = "msp430x";
- target_mcu = NULL;
}
else if (strcasecmp (decoded->arg, "msp430") == 0
|| strcasecmp (decoded->arg, "430") == 0)
{
target_cpu = "msp430";
- target_mcu = NULL;
}
else
{
@@ -77,8 +75,6 @@ msp430_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
target_cpu = "msp430x";
target_mcu = NULL;
}
- else
- target_cpu = NULL;
break;
}