MSP430: Fix inconsistent naming of hwmult libfuncs

The naming scheme used by GCC to reference MSP430 hardware multiply
library functions is inconsistent.

Sometimes the "GCC" names (e.g. mulsi2) are used, other times the
"MSPABI" names (e.g. __mspabi_mpyl) are used.

Also, sometimes an identifier for the hardware multiply support is
appended to the GCC name, when the functions are defined, but this is
not required.

This patch fixes those issues, so the names used to refer to the
hardware multiply library functions follow a consistent pattern.

gcc/ChangeLog:

	* config/msp430/msp430.c (msp430_output_labelref): Don't process mspabi
	hwmult library function names into GCC-style names.

libgcc/ChangeLog:

	* config/msp430/lib2hw_mul.S: Omit _hw* suffix from GCC names for
	hwmult library functions.

gcc/testsuite/ChangeLog:

	* gcc.target/msp430/rtx-cost-Os-f5series.c: Adjust test to use new
	hwmult library function name.
This commit is contained in:
Jozef Lawrynowicz 2020-11-15 21:03:06 +00:00
parent 814949ddce
commit c746fc40f4
3 changed files with 7 additions and 29 deletions

View File

@ -4031,28 +4031,6 @@ msp430_output_labelref (FILE *file, const char *name)
break;
}
/* If we have been given a specific MCU name then we may be
able to make use of its hardware multiply capabilities. */
if (msp430_has_hwmult ())
{
if (strcmp ("__mspabi_mpyi", name) == 0)
{
if (msp430_use_f5_series_hwmult ())
name = "__mulhi2_f5";
else
name = "__mulhi2";
}
else if (strcmp ("__mspabi_mpyl", name) == 0)
{
if (msp430_use_f5_series_hwmult ())
name = "__mulsi2_f5";
else if (msp430_use_32bit_hwmult ())
name = "__mulsi2_hw32";
else
name = "__mulsi2";
}
}
if (user_label_prefix[0] != 0)
fputs (user_label_prefix, file);

View File

@ -24,7 +24,7 @@ unsigned long res3;
** MOV.B #100, R14
** MOV.B #0, R15
** ...
** CALL.* #__mulsi2_f5
** CALL.* #__mspabi_mpyl_f5hw
** ...
*/
void foo (void)

View File

@ -353,9 +353,9 @@
mult1632 MPY, OP2, RESLO, RESHI
end_func __umulhisi2
start_func __mulsi2_hw32 __mspabi_mpyl __mspabi_mpyl_hw32
start_func __mulsi2 __mspabi_mpyl __mspabi_mpyl_hw32
mult32_hw MPY32L, MPY32H, OP2L, OP2H, RES0, RES1
end_func __mulsi2_hw32
end_func __mulsi2
start_func __mulsidi2 __mspabi_mpysll __mspabi_mpysll_hw32
mult3264_hw MPYS32L, MPYS32H, OP2L, OP2H, RES0, RES1, RES2, RES3
@ -373,9 +373,9 @@
as the second generation hardware, but they are accessed from different
memory registers. */
start_func __mulhi2_f5 __mspabi_mpyi __mspabi_mpyi_f5hw
start_func __mulhi2 __mspabi_mpyi __mspabi_mpyi_f5hw
mult16 MPY_F5, OP2_F5, RESLO_F5
end_func __mulhi2_f5
end_func __mulhi2
start_func __mulhisi2 __mspabi_mpysl __mspabi_mpysl_f5hw
mult1632 MPYS_F5, OP2_F5, RESLO_F5, RESHI_F5
@ -385,9 +385,9 @@
mult1632 MPY_F5, OP2_F5, RESLO_F5, RESHI_F5
end_func __umulhisi2
start_func __mulsi2_f5 __mspabi_mpyl __mspabi_mpyl_f5hw
start_func __mulsi2 __mspabi_mpyl __mspabi_mpyl_f5hw
mult32_hw MPY32L_F5, MPY32H_F5, OP2L_F5, OP2H_F5, RES0_F5, RES1_F5
end_func __mulsi2_f5
end_func __mulsi2
start_func __mulsidi2 __mspabi_mpysll __mspabi_mpysll_f5hw
mult3264_hw MPYS32L_F5, MPYS32H_F5, OP2L_F5, OP2H_F5, RES0_F5, RES1_F5, RES2_F5, RES3_F5