gcc/libgcc
Jozef Lawrynowicz 703e049aa7 MSP430: Simplify and extend shift instruction patterns
The implementation of define_expand and define_insn patterns to handle
shifts in the MSP430 backend is inconsistent, resulting in missed
opportunities to make best use of the architecture's features.

There's now a single define_expand used as the entry point for all valid
shifts, and the decision to either use a helper function to perform the
shift (often required for the 430 ISA), or fall through to the
define_insn patterns can be made from that expander function.

Shifts by a constant amount have been grouped into one define_insn for
each type of shift, instead of having different define_insn patterns for
shifts by different amounts.

A new target option "-mmax-inline-shift=" has been added to allow tuning
of the number of shift instructions to emit inline, instead of using
a library helper function.

gcc/ChangeLog:

	* config/msp430/constraints.md (K): Change unused constraint to
	constraint to a const_int between 1 and 19.
	(P): New constraint.
	* config/msp430/msp430-protos.h (msp430x_logical_shift_right): Remove.
	(msp430_expand_shift): New.
	(msp430_output_asm_shift_insns): New.
	* config/msp430/msp430.c (msp430_rtx_costs): Remove shift costs.
	(CSH): Remove.
	(msp430_expand_helper): Remove hard-coded generation of some inline
	shift insns.
	(use_helper_for_const_shift): New.
	(msp430_expand_shift): New.
	(msp430_output_asm_shift_insns): New.
	(msp430_print_operand): Add new 'W' operand selector.
	(msp430x_logical_shift_right): Remove.
	* config/msp430/msp430.md (HPSI): New define_mode_iterator.
	(HDI): Likewise.
	(any_shift): New define_code_iterator.
	(shift_insn): New define_code_attr.
	Adjust unnamed insn patterns searched for by combine.
	(ashlhi3): Remove.
	(slli_1): Remove.
	(430x_shift_left): Remove.
	(slll_1): Remove.
	(slll_2): Remove.
	(ashlsi3): Remove.
	(ashldi3): Remove.
	(ashrhi3): Remove.
	(srai_1): Remove.
	(430x_arithmetic_shift_right): Remove.
	(srap_1): Remove.
	(srap_2): Remove.
	(sral_1): Remove.
	(sral_2): Remove.
	(ashrsi3): Remove.
	(ashrdi3): Remove.
	(lshrhi3): Remove.
	(srli_1): Remove.
	(430x_logical_shift_right): Remove.
	(srlp_1): Remove.
	(srll_1): Remove.
	(srll_2x): Remove.
	(lshrsi3): Remove.
	(lshrdi3): Remove.
	(<shift_insn><mode>3): New define_expand.
	(<shift_insn>hi3_430): New define_insn.
	(<shift_insn>si3_const): Likewise.
	(ashl<mode>3_430x): Likewise.
	(ashr<mode>3_430x): Likewise.
	(lshr<mode>3_430x): Likewise.
	(*bitbranch<mode>4_z): Replace renamed predicate msp430_bitpos with
	const_0_to_15_operand.
	* config/msp430/msp430.opt: New option -mmax-inline-shift=.
	* config/msp430/predicates.md (const_1_to_8_operand): New predicate.
	(const_0_to_15_operand): Rename msp430_bitpos predicate.
	(const_1_to_19_operand): New predicate.
	* doc/invoke.texi: Document -mmax-inline-shift=.

libgcc/ChangeLog:

	* config/msp430/slli.S (__gnu_mspabi_sllp): New.
	* config/msp430/srai.S (__gnu_mspabi_srap): New.
	* config/msp430/srli.S (__gnu_mspabi_srlp): New.

gcc/testsuite/ChangeLog:

	* gcc.target/msp430/emulate-srli.c: Fix expected assembler text.
	* gcc.target/msp430/max-inline-shift-430-no-opt.c: New test.
	* gcc.target/msp430/max-inline-shift-430.c: New test.
	* gcc.target/msp430/max-inline-shift-430x.c: New test.
2020-08-26 20:50:58 +01:00
..
config MSP430: Simplify and extend shift instruction patterns 2020-08-26 20:50:58 +01:00
soft-fp soft-fp: Update soft-fp from glibc 2019-05-17 07:37:39 -07:00
ChangeLog Daily bump. 2020-08-14 00:16:24 +00:00
Makefile.in build: Change conditional include and empty.mk to -include in Makefiles 2020-06-23 17:28:09 +00:00
config.host aix: Add GCC64 configuration and FAT target libraries. 2020-06-21 14:14:46 -04:00
config.in aarch64: Fix bootstrap with old binutils [PR93053] 2020-04-15 11:01:19 +02:00
configure gcc: xtensa: add -mabi option for call0/windowed ABI 2020-06-15 03:35:50 -07:00
configure.ac gcc: xtensa: add -mabi option for call0/windowed ABI 2020-06-15 03:35:50 -07:00
crtstuff.c Fix compilation of crtstuff.c when DEFAULT_USE_CXA_ATEXIT is false 2020-01-18 10:30:29 -05:00
dfp-bit.c Update copyright years. 2020-01-01 12:51:42 +01:00
dfp-bit.h Update copyright years. 2020-01-01 12:51:42 +01:00
divmod.c Update copyright years. 2020-01-01 12:51:42 +01:00
emutls.c Update copyright years. 2020-01-01 12:51:42 +01:00
enable-execute-stack-empty.c enable-execute-stack-empty.c (__enable_execute_stack): Add prototype. 2011-06-22 13:20:07 +02:00
enable-execute-stack-mprotect.c Update copyright years. 2020-01-01 12:51:42 +01:00
find-symver.awk Update copyright years. 2020-01-01 12:51:42 +01:00
fixed-bit.c Update copyright years. 2020-01-01 12:51:42 +01:00
fixed-bit.h Update copyright years. 2020-01-01 12:51:42 +01:00
fixed-obj.mk Makefile.in (fixed-funcs,fixed-conv-funcs): filter-out LIB2FUNCS_EXCLUDE before adding them to libgcc-objects, libgcc-s-objects. 2012-08-23 15:41:03 +00:00
floatunsidf.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
floatunsisf.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
floatunsitf.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
floatunsixf.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
fp-bit.c Update copyright years. 2020-01-01 12:51:42 +01:00
fp-bit.h Update copyright years. 2020-01-01 12:51:42 +01:00
gbl-ctors.h Update copyright years. 2020-01-01 12:51:42 +01:00
gcov.h Remove __gcov_flush. 2020-05-05 16:15:47 +02:00
gen-fixed.sh
generic-morestack-thread.c Update copyright years. 2020-01-01 12:51:42 +01:00
generic-morestack.c libgcc: use syscall rather than __mmap/__munmap 2020-04-07 11:30:10 -07:00
generic-morestack.h Update copyright years. 2020-01-01 12:51:42 +01:00
gstdint.h dfp.c (WORDS_BIGENDIAN): Define to 0 if not defined. 2008-06-11 00:43:09 +01:00
gthr-posix.h Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-single.h Update copyright years. 2020-01-01 12:51:42 +01:00
gthr.h Update copyright years. 2020-01-01 12:51:42 +01:00
libgcc-std.ver.in Update copyright years. 2020-01-01 12:51:42 +01:00
libgcc2.c Update copyright years. 2020-01-01 12:51:42 +01:00
libgcc2.h Update copyright years. 2020-01-01 12:51:42 +01:00
libgcov-driver-system.c gcov: create folders with 0777. 2020-07-23 12:20:40 +02:00
libgcov-driver.c libgcov: support overloaded malloc 2020-07-31 10:57:50 +02:00
libgcov-interface.c Remove __gcov_flush. 2020-05-05 16:15:47 +02:00
libgcov-merge.c Make TOPN counter dynamically allocated. 2020-06-02 12:11:02 +02:00
libgcov-profiler.c gcov: Fix build on AIX 2020-06-03 08:12:50 +02:00
libgcov-util.c Do not stream all zeros for gcda files. 2020-07-02 10:16:02 +02:00
libgcov.h libgcov: support overloaded malloc 2020-07-31 10:57:50 +02:00
memcmp.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
memcpy.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
memmove.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
memset.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
mkheader.sh Update copyright years. 2020-01-01 12:51:42 +01:00
mkmap-flat.awk Update copyright years. 2020-01-01 12:51:42 +01:00
mkmap-symver.awk Update copyright years. 2020-01-01 12:51:42 +01:00
offloadstuff.c Update copyright years. 2020-01-01 12:51:42 +01:00
shared-object.mk Add the nvptx port. 2014-11-10 16:12:42 +00:00
siditi-object.mk Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
static-object.mk Add the nvptx port. 2014-11-10 16:12:42 +00:00
sync.c Update copyright years. 2020-01-01 12:51:42 +01:00
udivhi3.c Update copyright years. 2020-01-01 12:51:42 +01:00
udivmod.c Update copyright years. 2020-01-01 12:51:42 +01:00
udivmodhi4.c Update copyright years. 2020-01-01 12:51:42 +01:00
udivmodsi4.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-arm-common.inc arm: Fix up arm installed unwind.h for use in pedantic modes [PR93615] 2020-02-10 14:35:31 +00:00
unwind-c.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-compat.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-compat.h Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-dw2-fde-compat.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-dw2-fde-dip.c nios2: Support for GOT-relative DW_EH_PE_datarel encoding. 2020-01-31 16:46:50 -08:00
unwind-dw2-fde.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-dw2-fde.h Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-dw2.c libgcc: fix the handling of return address mangling [PR94891] 2020-07-13 13:49:20 +01:00
unwind-dw2.h Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-generic.h Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-pe.h arm: Fix up arm installed unwind.h for use in pedantic modes [PR93615] 2020-02-10 14:35:31 +00:00
unwind-seh.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind-sjlj.c Update copyright years. 2020-01-01 12:51:42 +01:00
unwind.inc Update copyright years. 2020-01-01 12:51:42 +01:00
vtv_end.c Update copyright years. 2020-01-01 12:51:42 +01:00
vtv_end_preinit.c Update copyright years. 2020-01-01 12:51:42 +01:00
vtv_start.c Update copyright years. 2020-01-01 12:51:42 +01:00
vtv_start_preinit.c Update copyright years. 2020-01-01 12:51:42 +01:00