Commit 036ff63f by Richard Sandiford Committed by Richard Sandiford

frv-modes.def: Fix comment typos.

	* config/frv/frv-modes.def: Fix comment typos.
	(CC_NZ): Define new mode.
	* config/frv/frv-protos.h (frv_select_cc_mode): Declare.
	(condexec_intop_cmp_operator): Delete.
	* config/frv/frv.c (comparison_string): New function.
	(frv_print_operand): Use it to handle 'c' and 'C'.
	(relational_operator): Redefine in terms of integer_relational_operator
	and float_relational_operator.
	(signed_relational_operator, unsigned_relational_operator): Delete.
	(integer_relational_operator): New predicate, combining the above.
	Check the mode of the first operand but leave frv.md to check the rest.
	(float_relational_operator): Just check the mode of the first operand
	and leave frv.md to check the rest.
	(intop_compare_operator): Assume the result is compared with zero
	in mode CC_NZmode.  Allow PLUS and MINUS.  Leave frv.md to check
	the operand predicates.
	(condexec_intop_cmp_operator): Delete.
	(frv_ifcvt_modify_tests, frv_ifcvt_modify_multiple_tests)
	(frv_hard_regno_mode_ok): Handle CC_NZmode.
	(frv_select_cc_mode): New function.
	* config/frv/frv.h (SELECT_CC_MODE): Use frv_select_cc_mode.
	(REVERSIBLE_CC_MODE): Include CC_NZmode.
	(PREDICATE_CODES): Replace entries for signed_relational_operand and
	unsigned_relational_operator with one for integer_relational_operator.
	Delete entry for condexec_intop_cmp_operator.
	* config/frv/frv.md (movcc_nz, *internal_movcc_nz, reload_incc_nz)
	(reload_outcc_nz, *cmpsi_cc_nz, *cond_exec_cmpsi_cc_nz): New patterns.
	(*combo_intop_compare2, *combo_intop_compare4): Delete.
	(*combo_intop_compare1): Change mode to CC_NZ.
	(*combo_intop_compare2): Likewise.  Renamed from *combo_intop_compare3.
	(branch_{un,}signed_true, branch_{un,}signed_false)
	(*scc_{un,}signed, *scc_neg1_{un,}signed, *ck_{un,}signed)
	(*movqicc_internal1_{un,}signed, *movqicc_internal2_{un,}signed)
	(*movhicc_internal1_{un,}signed, *movhicc_internal2_{un,}signed)
	(*movsicc_internal1_{un,}signed, *movsicc_internal2_{un,}signed)
	(*movsfcc_has_fprs_{un,}signed, *movsfcc_no_fprs_{un,}signed)
	(*return_{unsigned_,}true, *return_{unsigned_,}false): Merge these
	pattern pairs.  Use integer_relational_operator.  Remove mode from
	icc_operand.

From-SVN: r91997
parent 2742a1ed
2004-12-10 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-modes.def: Fix comment typos.
(CC_NZ): Define new mode.
* config/frv/frv-protos.h (frv_select_cc_mode): Declare.
(condexec_intop_cmp_operator): Delete.
* config/frv/frv.c (comparison_string): New function.
(frv_print_operand): Use it to handle 'c' and 'C'.
(relational_operator): Redefine in terms of integer_relational_operator
and float_relational_operator.
(signed_relational_operator, unsigned_relational_operator): Delete.
(integer_relational_operator): New predicate, combining the above.
Check the mode of the first operand but leave frv.md to check the rest.
(float_relational_operator): Just check the mode of the first operand
and leave frv.md to check the rest.
(intop_compare_operator): Assume the result is compared with zero
in mode CC_NZmode. Allow PLUS and MINUS. Leave frv.md to check
the operand predicates.
(condexec_intop_cmp_operator): Delete.
(frv_ifcvt_modify_tests, frv_ifcvt_modify_multiple_tests)
(frv_hard_regno_mode_ok): Handle CC_NZmode.
(frv_select_cc_mode): New function.
* config/frv/frv.h (SELECT_CC_MODE): Use frv_select_cc_mode.
(REVERSIBLE_CC_MODE): Include CC_NZmode.
(PREDICATE_CODES): Replace entries for signed_relational_operand and
unsigned_relational_operator with one for integer_relational_operator.
Delete entry for condexec_intop_cmp_operator.
* config/frv/frv.md (movcc_nz, *internal_movcc_nz, reload_incc_nz)
(reload_outcc_nz, *cmpsi_cc_nz, *cond_exec_cmpsi_cc_nz): New patterns.
(*combo_intop_compare2, *combo_intop_compare4): Delete.
(*combo_intop_compare1): Change mode to CC_NZ.
(*combo_intop_compare2): Likewise. Renamed from *combo_intop_compare3.
(branch_{un,}signed_true, branch_{un,}signed_false)
(*scc_{un,}signed, *scc_neg1_{un,}signed, *ck_{un,}signed)
(*movqicc_internal1_{un,}signed, *movqicc_internal2_{un,}signed)
(*movhicc_internal1_{un,}signed, *movhicc_internal2_{un,}signed)
(*movsicc_internal1_{un,}signed, *movsicc_internal2_{un,}signed)
(*movsfcc_has_fprs_{un,}signed, *movsfcc_no_fprs_{un,}signed)
(*return_{unsigned_,}true, *return_{unsigned_,}false): Merge these
pattern pairs. Use integer_relational_operator. Remove mode from
icc_operand.
2004-12-10 Mark Dettinger <dettinge@de.ibm.com> 2004-12-10 Mark Dettinger <dettinge@de.ibm.com>
* config/s390/s390.c (struct processor_costs): New fields ml, * config/s390/s390.c (struct processor_costs): New fields ml,
......
...@@ -20,12 +20,14 @@ Boston, MA 02111-1307, USA. */ ...@@ -20,12 +20,14 @@ Boston, MA 02111-1307, USA. */
/* On the FRV, the CC modes used are: /* On the FRV, the CC modes used are:
CCmode set ICC's from comparing signed integers CCmode set ICCs from comparing signed integers
CC_UNSmode set ICC's from comparing unsigned integers CC_UNSmode set ICCs from comparing unsigned integers
CC_FPmode set FCC's from comparing floating point CC_NZmode set ICCs for comparisons that just need the Z and N flags
CC_CCRmode set CCR's to do conditional execution */ CC_FPmode set FCCs from comparing floating point
CC_CCRmode set CCRs to do conditional execution */
CC_MODE (CC_UNS); CC_MODE (CC_UNS);
CC_MODE (CC_NZ);
CC_MODE (CC_FP); CC_MODE (CC_FP);
CC_MODE (CC_CCR); CC_MODE (CC_CCR);
......
...@@ -138,6 +138,7 @@ extern int frv_hard_regno_nregs (int, enum machine_mode); ...@@ -138,6 +138,7 @@ extern int frv_hard_regno_nregs (int, enum machine_mode);
extern int frv_class_max_nregs (enum reg_class class, extern int frv_class_max_nregs (enum reg_class class,
enum machine_mode mode); enum machine_mode mode);
extern int frv_legitimate_constant_p (rtx); extern int frv_legitimate_constant_p (rtx);
extern enum machine_mode frv_select_cc_mode (enum rtx_code, rtx, rtx);
#endif /* RTX_CODE */ #endif /* RTX_CODE */
extern int direct_return_p (void); extern int direct_return_p (void);
...@@ -217,7 +218,6 @@ extern int condexec_sf_conv_operator (rtx, enum machine_mode); ...@@ -217,7 +218,6 @@ extern int condexec_sf_conv_operator (rtx, enum machine_mode);
extern int condexec_sf_add_operator (rtx, enum machine_mode); extern int condexec_sf_add_operator (rtx, enum machine_mode);
extern int condexec_memory_operand (rtx, enum machine_mode); extern int condexec_memory_operand (rtx, enum machine_mode);
extern int intop_compare_operator (rtx, enum machine_mode); extern int intop_compare_operator (rtx, enum machine_mode);
extern int condexec_intop_cmp_operator (rtx, enum machine_mode);
extern int acc_operand (rtx, enum machine_mode); extern int acc_operand (rtx, enum machine_mode);
extern int even_acc_operand (rtx, enum machine_mode); extern int even_acc_operand (rtx, enum machine_mode);
extern int quad_acc_operand (rtx, enum machine_mode); extern int quad_acc_operand (rtx, enum machine_mode);
......
...@@ -2384,12 +2384,7 @@ do { \ ...@@ -2384,12 +2384,7 @@ do { \
? CC_NOOVmode : CCmode)) ? CC_NOOVmode : CCmode))
You need not define this macro if `EXTRA_CC_MODES' is not defined. */ You need not define this macro if `EXTRA_CC_MODES' is not defined. */
#define SELECT_CC_MODE(OP, X, Y) \ #define SELECT_CC_MODE frv_select_cc_mode
(GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
? CC_FPmode \
: (((OP) == LEU || (OP) == GTU || (OP) == LTU || (OP) == GEU) \
? CC_UNSmode \
: CCmode))
/* A C expression whose value is one if it is always safe to reverse a /* A C expression whose value is one if it is always safe to reverse a
comparison whose mode is MODE. If `SELECT_CC_MODE' can ever return MODE for comparison whose mode is MODE. If `SELECT_CC_MODE' can ever return MODE for
...@@ -2405,7 +2400,8 @@ do { \ ...@@ -2405,7 +2400,8 @@ do { \
/* On frv, don't consider floating point comparisons to be reversible. In /* On frv, don't consider floating point comparisons to be reversible. In
theory, fp equality comparisons can be reversible. */ theory, fp equality comparisons can be reversible. */
#define REVERSIBLE_CC_MODE(MODE) ((MODE) == CCmode || (MODE) == CC_UNSmode) #define REVERSIBLE_CC_MODE(MODE) \
((MODE) == CCmode || (MODE) == CC_UNSmode || (MODE) == CC_NZmode)
/* Frv CCR_MODE's are not reversible. */ /* Frv CCR_MODE's are not reversible. */
#define REVERSE_CONDEXEC_PREDICATES_P(x,y) 0 #define REVERSE_CONDEXEC_PREDICATES_P(x,y) 0
...@@ -3051,8 +3047,8 @@ do { \ ...@@ -3051,8 +3047,8 @@ do { \
{ "uint16_operand", { CONST_INT }}, \ { "uint16_operand", { CONST_INT }}, \
{ "relational_operator", { EQ, NE, LE, LT, GE, GT, \ { "relational_operator", { EQ, NE, LE, LT, GE, GT, \
LEU, LTU, GEU, GTU }}, \ LEU, LTU, GEU, GTU }}, \
{ "signed_relational_operator", { EQ, NE, LE, LT, GE, GT }}, \ { "integer_relational_operator", { EQ, NE, LE, LT, GE, GT, \
{ "unsigned_relational_operator", { LEU, LTU, GEU, GTU }}, \ LEU, LTU, GEU, GTU }}, \
{ "float_relational_operator", { EQ, NE, LE, LT, GE, GT }}, \ { "float_relational_operator", { EQ, NE, LE, LT, GE, GT }}, \
{ "ccr_eqne_operator", { EQ, NE }}, \ { "ccr_eqne_operator", { EQ, NE }}, \
{ "minmax_operator", { SMIN, SMAX, UMIN, UMAX }}, \ { "minmax_operator", { SMIN, SMAX, UMIN, UMAX }}, \
...@@ -3065,8 +3061,6 @@ do { \ ...@@ -3065,8 +3061,6 @@ do { \
{ "condexec_sf_conv_operator", { ABS, NEG }}, \ { "condexec_sf_conv_operator", { ABS, NEG }}, \
{ "intop_compare_operator", { PLUS, MINUS, AND, IOR, XOR, \ { "intop_compare_operator", { PLUS, MINUS, AND, IOR, XOR, \
ASHIFT, ASHIFTRT, LSHIFTRT }}, \ ASHIFT, ASHIFTRT, LSHIFTRT }}, \
{ "condexec_intop_cmp_operator", { PLUS, MINUS, AND, IOR, XOR, \
ASHIFT, ASHIFTRT, LSHIFTRT }}, \
{ "fpr_or_int6_operand", { REG, SUBREG, CONST_INT }}, \ { "fpr_or_int6_operand", { REG, SUBREG, CONST_INT }}, \
{ "int6_operand", { CONST_INT }}, \ { "int6_operand", { CONST_INT }}, \
{ "int5_operand", { CONST_INT }}, \ { "int5_operand", { CONST_INT }}, \
......
2004-12-10 Richard Sandiford <rsandifo@redhat.com>
* gcc.c-torture/execute/20041210-1.c: New test.
2004-12-10 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2004-12-10 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/18731 PR c++/18731
......
/* The FR-V port used to fail this test because the andcc patterns
wrongly claimed to set the C and V flags. */
#include <limits.h>
int x[4] = { INT_MIN / 2, INT_MAX, 2, 4 };
int
main ()
{
if (x[0] < x[1])
if ((x[2] & x[3]) < 0)
abort ();
exit (0);
}
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