Commit 9c575e20 by John David Anglin

predicates.md: Reorganize and simplify predicates.

	* config/pa/predicates.md: Reorganize and simplify predicates.
	Eliminate duplicate code checks.
	(arith_operand): Rename to arith14_operand
	(reg_or_ior_operand): Rename to reg_or_cint_ior_operand.
	* config/pa/pa.md: Use renamed operands.
	* config/pa/pa-protos.h (symbolic_operand): Delete declaration.
	(tls_symbolic_operand, function_label_operand, lhs_lshift_cint_operand,
	arith11_operand, adddi3_operand, indexed_memory_operand,
	symbolic_memory_operand, int11_operand, reg_or_cint_move_operand,
	arith5_operand, uint5_operand, pic_label_operand, plus_xor_ior_operator,
	borx_reg_operand, shadd_operand, arith_operand, read_only_operand,
	move_dest_operand, move_src_operand, prefetch_cc_operand,
	prefetch_nocc_operand, and_operand, ior_operand, arith32_operand,
	uint32_operand, reg_before_reload_operand, reg_or_0_operand,
	reg_or_0_or_nonsymb_mem_operand, pre_cint_operand, post_cint_operand,
	div_operand, int5_operand, movb_comparison_operator,
	ireg_or_int5_operand, call_operand_address, ior_operand, fp_reg_operand,
	arith_double_operand, ireg_operand, lhs_lshift_operand,
	pc_or_label_operand, non_hard_reg_operand, eq_neq_comparison_operator,
	integer_store_memory_operand): Likewise.
	* config/pa/pa.c (adddi3_operand): Move to predicates.md.
	(integer_store_memory_operand, read_only_operand,
	function_label_operand, borx_reg_operand,
	non_hard_reg_operand): Likewise.
	(eq_neq_comparison_operator): Delete unused operator.
	(legitimize_pic_address): Use VOIDmode for mode argument in calls to
	function_label_operand.
	(emit_move_sequence): Likewise.

From-SVN: r172588
parent 8dfb9f16
......@@ -21,14 +21,10 @@ along with GCC; see the file COPYING3. If not see
#ifdef RTX_CODE
/* Prototype function used in various macros. */
extern int symbolic_operand (rtx, enum machine_mode);
extern int tls_symbolic_operand (rtx);
extern rtx pa_eh_return_handler_rtx (void);
/* Used in insn-*.c. */
extern int following_call (rtx);
extern int function_label_operand (rtx, enum machine_mode);
extern int lhs_lshift_cint_operand (rtx, enum machine_mode);
/* Define functions in pa.c and used in insn-output.c. */
......@@ -58,44 +54,11 @@ extern void output_global_address (FILE *, rtx, int);
extern void print_operand (FILE *, rtx, int);
extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
extern void hppa_encode_label (rtx);
extern int arith11_operand (rtx, enum machine_mode);
extern int adddi3_operand (rtx, enum machine_mode);
extern int indexed_memory_operand (rtx, enum machine_mode);
extern int symbolic_expression_p (rtx);
extern int symbolic_memory_operand (rtx, enum machine_mode);
extern bool pa_tls_referenced_p (rtx);
extern int pa_adjust_insn_length (rtx, int);
extern int int11_operand (rtx, enum machine_mode);
extern int reg_or_cint_move_operand (rtx, enum machine_mode);
extern int arith5_operand (rtx, enum machine_mode);
extern int uint5_operand (rtx, enum machine_mode);
extern int pic_label_operand (rtx, enum machine_mode);
extern int plus_xor_ior_operator (rtx, enum machine_mode);
extern int borx_reg_operand (rtx, enum machine_mode);
extern int shadd_operand (rtx, enum machine_mode);
extern int arith_operand (rtx, enum machine_mode);
extern int read_only_operand (rtx, enum machine_mode);
extern int move_dest_operand (rtx, enum machine_mode);
extern int move_src_operand (rtx, enum machine_mode);
extern int prefetch_cc_operand (rtx, enum machine_mode);
extern int prefetch_nocc_operand (rtx, enum machine_mode);
extern int and_operand (rtx, enum machine_mode);
extern int ior_operand (rtx, enum machine_mode);
extern int arith32_operand (rtx, enum machine_mode);
extern int uint32_operand (rtx, enum machine_mode);
extern int reg_before_reload_operand (rtx, enum machine_mode);
extern int reg_or_0_operand (rtx, enum machine_mode);
extern int reg_or_0_or_nonsymb_mem_operand (rtx, enum machine_mode);
extern int pre_cint_operand (rtx, enum machine_mode);
extern int post_cint_operand (rtx, enum machine_mode);
extern int div_operand (rtx, enum machine_mode);
extern int int5_operand (rtx, enum machine_mode);
extern int movb_comparison_operator (rtx, enum machine_mode);
extern int ireg_or_int5_operand (rtx, enum machine_mode);
extern int fmpyaddoperands (rtx *);
extern int fmpysuboperands (rtx *);
extern int call_operand_address (rtx, enum machine_mode);
extern int ior_operand (rtx, enum machine_mode);
extern void emit_bcond_fp (rtx[]);
extern int emit_move_sequence (rtx *, enum machine_mode, rtx);
extern int emit_hpdiv_const (rtx *, int);
......@@ -111,24 +74,16 @@ extern int attr_length_save_restore_dltp (rtx);
extern struct rtx_def *return_addr_rtx (int, rtx);
extern int fp_reg_operand (rtx, enum machine_mode);
extern int arith_double_operand (rtx, enum machine_mode);
extern int ireg_operand (rtx, enum machine_mode);
extern int lhs_lshift_operand (rtx, enum machine_mode);
extern int pc_or_label_operand (rtx, enum machine_mode);
#ifdef ARGS_SIZE_RTX
/* expr.h defines ARGS_SIZE_RTX and `enum direction' */
#ifdef TREE_CODE
extern enum direction function_arg_padding (enum machine_mode, const_tree);
#endif
#endif /* ARGS_SIZE_RTX */
extern int non_hard_reg_operand (rtx, enum machine_mode);
extern int eq_neq_comparison_operator (rtx, enum machine_mode);
extern int insn_refs_are_delayed (rtx);
extern rtx get_deferred_plabel (rtx);
#endif /* RTX_CODE */
extern int integer_store_memory_operand (rtx, enum machine_mode);
extern int ldil_cint_p (HOST_WIDE_INT);
extern int zdepi_cint_p (unsigned HOST_WIDE_INT);
......
......@@ -739,35 +739,6 @@ cint_ok_for_move (HOST_WIDE_INT ival)
|| zdepi_cint_p (ival));
}
/* Return truth value of whether OP can be used as an operand in a
adddi3 insn. */
int
adddi3_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
|| (GET_CODE (op) == CONST_INT
&& (TARGET_64BIT ? INT_14_BITS (op) : INT_11_BITS (op))));
}
/* True iff the operand OP can be used as the destination operand of
an integer store. This also implies the operand could be used as
the source operand of an integer load. Symbolic, lo_sum and indexed
memory operands are not allowed. We accept reloading pseudos and
other memory operands. */
int
integer_store_memory_operand (rtx op, enum machine_mode mode)
{
return ((reload_in_progress
&& REG_P (op)
&& REGNO (op) >= FIRST_PSEUDO_REGISTER
&& reg_renumber [REGNO (op)] < 0)
|| (GET_CODE (op) == MEM
&& (reload_in_progress || memory_address_p (mode, XEXP (op, 0)))
&& !symbolic_memory_operand (op, VOIDmode)
&& !IS_LO_SUM_DLT_ADDR_P (XEXP (op, 0))
&& !IS_INDEX_ADDR_P (XEXP (op, 0))));
}
/* True iff ldil can be used to load this CONST_INT. The least
significant 11 bits of the value must be zero and the value must
not change sign when extended from 32 to 64 bits. */
......@@ -875,7 +846,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
tmp_reg = ((reload_in_progress || reload_completed)
? reg : gen_reg_rtx (Pmode));
if (function_label_operand (orig, mode))
if (function_label_operand (orig, VOIDmode))
{
/* Force function label into memory in word mode. */
orig = XEXP (force_const_mem (word_mode, orig), 0);
......@@ -1937,7 +1908,7 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
not consider them legitimate constants. Loop optimizations can
call the emit_move_xxx with one as a source. */
if ((GET_CODE (operand1) != HIGH && immediate_operand (operand1, mode))
|| function_label_operand (operand1, mode)
|| function_label_operand (operand1, VOIDmode)
|| (GET_CODE (operand1) == HIGH
&& symbolic_operand (XEXP (operand1, 0), mode)))
{
......@@ -1957,8 +1928,9 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
the memory location, then add in the constant part. */
if ((GET_CODE (operand1) == CONST
&& GET_CODE (XEXP (operand1, 0)) == PLUS
&& function_label_operand (XEXP (XEXP (operand1, 0), 0), Pmode))
|| function_label_operand (operand1, mode))
&& function_label_operand (XEXP (XEXP (operand1, 0), 0),
VOIDmode))
|| function_label_operand (operand1, VOIDmode))
{
rtx temp, const_part;
......@@ -2303,28 +2275,6 @@ reloc_needed (tree exp)
return reloc;
}
/* Does operand (which is a symbolic_operand) live in text space?
If so, SYMBOL_REF_FLAG, which is set by pa_encode_section_info,
will be true. */
int
read_only_operand (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (operand) == CONST)
operand = XEXP (XEXP (operand, 0), 0);
if (flag_pic)
{
if (GET_CODE (operand) == SYMBOL_REF)
return SYMBOL_REF_FLAG (operand) && !CONSTANT_POOL_ADDRESS_P (operand);
}
else
{
if (GET_CODE (operand) == SYMBOL_REF)
return SYMBOL_REF_FLAG (operand) || CONSTANT_POOL_ADDRESS_P (operand);
}
return 1;
}
/* Return the best assembler insn template
for moving operands[1] into operands[0] as a fullword. */
......@@ -8190,12 +8140,6 @@ pa_strip_name_encoding (const char *str)
return str;
}
int
function_label_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == SYMBOL_REF && FUNCTION_NAME_P (XSTR (op, 0));
}
/* Returns 1 if OP is a function label involved in a simple addition
with a constant. Used to keep certain patterns from matching
during instruction combination. */
......@@ -8207,7 +8151,7 @@ is_function_label_plus_const (rtx op)
op = XEXP (op, 0);
return (GET_CODE (op) == PLUS
&& function_label_operand (XEXP (op, 0), Pmode)
&& function_label_operand (XEXP (op, 0), VOIDmode)
&& GET_CODE (XEXP (op, 1)) == CONST_INT);
}
......@@ -8769,43 +8713,6 @@ shadd_constant_p (int val)
return 0;
}
/* Return 1 if OP is valid as a base or index register in a
REG+REG address. */
int
borx_reg_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) != REG)
return 0;
/* We must reject virtual registers as the only expressions that
can be instantiated are REG and REG+CONST. */
if (op == virtual_incoming_args_rtx
|| op == virtual_stack_vars_rtx
|| op == virtual_stack_dynamic_rtx
|| op == virtual_outgoing_args_rtx
|| op == virtual_cfa_rtx)
return 0;
/* While it's always safe to index off the frame pointer, it's not
profitable to do so when the frame pointer is being eliminated. */
if (!reload_completed
&& flag_omit_frame_pointer
&& !cfun->calls_alloca
&& op == frame_pointer_rtx)
return 0;
return register_operand (op, mode);
}
/* Return 1 if this operand is anything other than a hard register. */
int
non_hard_reg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return ! (GET_CODE (op) == REG && REGNO (op) < FIRST_PSEUDO_REGISTER);
}
/* Return TRUE if INSN branches forward. */
static bool
......@@ -8830,13 +8737,6 @@ forward_branch_p (rtx insn)
return false;
}
/* Return 1 if OP is an equality comparison, else return 0. */
int
eq_neq_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == EQ || GET_CODE (op) == NE);
}
/* Return 1 if INSN is in the delay slot of a call instruction. */
int
jump_in_call_delay (rtx insn)
......
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