Commit 234d14ac by Richard Sandiford Committed by Richard Sandiford

target-insns.def (extv, [...]): New targetm instruction patterns.

gcc/
	* target-insns.def (extv, extzv, insv): New targetm instruction
	patterns.
	* optabs.c (get_extraction_insn): Use them instead of HAVE_*/gen_*
	interface.
	* recog.c (simplify_while_replacing): Likewise.

From-SVN: r225432
parent 89f7b21f
2015-07-05 Richard Sandiford <richard.sandiford@arm.com> 2015-07-05 Richard Sandiford <richard.sandiford@arm.com>
* target-insns.def (extv, extzv, insv): New targetm instruction
patterns.
* optabs.c (get_extraction_insn): Use them instead of HAVE_*/gen_*
interface.
* recog.c (simplify_while_replacing): Likewise.
2015-07-05 Richard Sandiford <richard.sandiford@arm.com>
* target-insns.def (doloop_begin, doloop_end): New targetm * target-insns.def (doloop_begin, doloop_end): New targetm
instruction patterns. instruction patterns.
* loop-init.c: Include target.h. * loop-init.c: Include target.h.
......
...@@ -8416,18 +8416,6 @@ expand_jump_insn (enum insn_code icode, unsigned int nops, ...@@ -8416,18 +8416,6 @@ expand_jump_insn (enum insn_code icode, unsigned int nops,
} }
/* Reduce conditional compilation elsewhere. */ /* Reduce conditional compilation elsewhere. */
#ifndef HAVE_insv
#define HAVE_insv 0
#define CODE_FOR_insv CODE_FOR_nothing
#endif
#ifndef HAVE_extv
#define HAVE_extv 0
#define CODE_FOR_extv CODE_FOR_nothing
#endif
#ifndef HAVE_extzv
#define HAVE_extzv 0
#define CODE_FOR_extzv CODE_FOR_nothing
#endif
/* Enumerates the possible types of structure operand to an /* Enumerates the possible types of structure operand to an
extraction_insn. */ extraction_insn. */
...@@ -8512,25 +8500,25 @@ get_extraction_insn (extraction_insn *insn, ...@@ -8512,25 +8500,25 @@ get_extraction_insn (extraction_insn *insn,
switch (pattern) switch (pattern)
{ {
case EP_insv: case EP_insv:
if (HAVE_insv if (targetm.have_insv ()
&& get_traditional_extraction_insn (insn, type, mode, && get_traditional_extraction_insn (insn, type, mode,
CODE_FOR_insv, 0, 3)) targetm.code_for_insv, 0, 3))
return true; return true;
return get_optab_extraction_insn (insn, type, mode, insv_optab, return get_optab_extraction_insn (insn, type, mode, insv_optab,
insvmisalign_optab, 2); insvmisalign_optab, 2);
case EP_extv: case EP_extv:
if (HAVE_extv if (targetm.have_extv ()
&& get_traditional_extraction_insn (insn, type, mode, && get_traditional_extraction_insn (insn, type, mode,
CODE_FOR_extv, 1, 0)) targetm.code_for_extv, 1, 0))
return true; return true;
return get_optab_extraction_insn (insn, type, mode, extv_optab, return get_optab_extraction_insn (insn, type, mode, extv_optab,
extvmisalign_optab, 3); extvmisalign_optab, 3);
case EP_extzv: case EP_extzv:
if (HAVE_extzv if (targetm.have_extzv ()
&& get_traditional_extraction_insn (insn, type, mode, && get_traditional_extraction_insn (insn, type, mode,
CODE_FOR_extzv, 1, 0)) targetm.code_for_extzv, 1, 0))
return true; return true;
return get_optab_extraction_insn (insn, type, mode, extzv_optab, return get_optab_extraction_insn (insn, type, mode, extzv_optab,
extzvmisalign_optab, 3); extzvmisalign_optab, 3);
......
...@@ -566,15 +566,6 @@ cancel_changes (int num) ...@@ -566,15 +566,6 @@ cancel_changes (int num)
} }
/* Reduce conditional compilation elsewhere. */ /* Reduce conditional compilation elsewhere. */
#ifndef HAVE_extv
#define HAVE_extv 0
#define CODE_FOR_extv CODE_FOR_nothing
#endif
#ifndef HAVE_extzv
#define HAVE_extzv 0
#define CODE_FOR_extzv CODE_FOR_nothing
#endif
/* A subroutine of validate_replace_rtx_1 that tries to simplify the resulting /* A subroutine of validate_replace_rtx_1 that tries to simplify the resulting
rtx. */ rtx. */
...@@ -690,15 +681,15 @@ simplify_while_replacing (rtx *loc, rtx to, rtx_insn *object, ...@@ -690,15 +681,15 @@ simplify_while_replacing (rtx *loc, rtx to, rtx_insn *object,
machine_mode is_mode = GET_MODE (XEXP (x, 0)); machine_mode is_mode = GET_MODE (XEXP (x, 0));
int pos = INTVAL (XEXP (x, 2)); int pos = INTVAL (XEXP (x, 2));
if (GET_CODE (x) == ZERO_EXTRACT && HAVE_extzv) if (GET_CODE (x) == ZERO_EXTRACT && targetm.have_extzv ())
{ {
wanted_mode = insn_data[CODE_FOR_extzv].operand[1].mode; wanted_mode = insn_data[targetm.code_for_extzv].operand[1].mode;
if (wanted_mode == VOIDmode) if (wanted_mode == VOIDmode)
wanted_mode = word_mode; wanted_mode = word_mode;
} }
else if (GET_CODE (x) == SIGN_EXTRACT && HAVE_extv) else if (GET_CODE (x) == SIGN_EXTRACT && targetm.have_extv ())
{ {
wanted_mode = insn_data[CODE_FOR_extv].operand[1].mode; wanted_mode = insn_data[targetm.code_for_extv].operand[1].mode;
if (wanted_mode == VOIDmode) if (wanted_mode == VOIDmode)
wanted_mode = word_mode; wanted_mode = word_mode;
} }
......
...@@ -42,6 +42,9 @@ DEF_TARGET_INSN (doloop_begin, (rtx x0, rtx x1)) ...@@ -42,6 +42,9 @@ DEF_TARGET_INSN (doloop_begin, (rtx x0, rtx x1))
DEF_TARGET_INSN (doloop_end, (rtx x0, rtx x1)) DEF_TARGET_INSN (doloop_end, (rtx x0, rtx x1))
DEF_TARGET_INSN (epilogue, (void)) DEF_TARGET_INSN (epilogue, (void))
DEF_TARGET_INSN (exception_receiver, (void)) DEF_TARGET_INSN (exception_receiver, (void))
DEF_TARGET_INSN (extv, (rtx x0, rtx x1, rtx x2, rtx x3))
DEF_TARGET_INSN (extzv, (rtx x0, rtx x1, rtx x2, rtx x3))
DEF_TARGET_INSN (insv, (rtx x0, rtx x1, rtx x2, rtx x3))
DEF_TARGET_INSN (jump, (rtx x0)) DEF_TARGET_INSN (jump, (rtx x0))
DEF_TARGET_INSN (load_multiple, (rtx x0, rtx x1, rtx x2)) DEF_TARGET_INSN (load_multiple, (rtx x0, rtx x1, rtx x2))
DEF_TARGET_INSN (mem_signal_fence, (rtx x0)) DEF_TARGET_INSN (mem_signal_fence, (rtx x0))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment