aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/ns32k
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-03-07 04:45:05 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2004-03-07 04:45:05 +0000
commiteff3c926666b528977bce6cfc5b72e7585e3015d (patch)
treec571c0dd242d691e90b567d84790f2c2cdf59acb /gcc/config/ns32k
parent22ea6b4f7f314c605f25fcd224c0efb9f39eaa6d (diff)
downloadgcc-eff3c926666b528977bce6cfc5b72e7585e3015d.zip
gcc-eff3c926666b528977bce6cfc5b72e7585e3015d.tar.gz
gcc-eff3c926666b528977bce6cfc5b72e7585e3015d.tar.bz2
ns32k-protos.h: Add a prototype for ns32k_notice_update_cc.
* config/ns32k/ns32k-protos.h: Add a prototype for ns32k_notice_update_cc. * config/ns32k/ns32k.c (ns32k_notice_update_cc): New. * config/ns32k/ns32k.h (NOTICE_UPDATE_CC): Call ns32k_notice_update_cc. From-SVN: r79053
Diffstat (limited to 'gcc/config/ns32k')
-rw-r--r--gcc/config/ns32k/ns32k-protos.h1
-rw-r--r--gcc/config/ns32k/ns32k.c71
-rw-r--r--gcc/config/ns32k/ns32k.h46
3 files changed, 73 insertions, 45 deletions
diff --git a/gcc/config/ns32k/ns32k-protos.h b/gcc/config/ns32k/ns32k-protos.h
index b5a2328..76ab46d 100644
--- a/gcc/config/ns32k/ns32k-protos.h
+++ b/gcc/config/ns32k/ns32k-protos.h
@@ -34,6 +34,7 @@ extern void print_operand_address (FILE *, rtx);
extern const char *output_move_double (rtx *);
extern const char *output_shift_insn (rtx *);
extern int symbolic_reference_mentioned_p (rtx);
+extern void ns32k_notice_update_cc (rtx, rtx);
#endif /* RTX_CODE */
#ifdef TREE_CODE
diff --git a/gcc/config/ns32k/ns32k.c b/gcc/config/ns32k/ns32k.c
index 5b633ec..0bfa7dd 100644
--- a/gcc/config/ns32k/ns32k.c
+++ b/gcc/config/ns32k/ns32k.c
@@ -1568,3 +1568,74 @@ ns32k_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
{
return gen_rtx_REG (Pmode, NS32K_STRUCT_VALUE_REGNUM);
}
+
+/* Worker function for NOTICE_UPDATE_CC. */
+
+void
+ns32k_notice_update_cc (rtx exp, rtx insn ATTRIBUTE_UNUSED)
+{
+ if (GET_CODE (exp) == SET)
+ {
+ if (GET_CODE (SET_DEST (exp)) == CC0)
+ {
+ cc_status.flags = 0;
+ cc_status.value1 = SET_DEST (exp);
+ cc_status.value2 = SET_SRC (exp);
+ }
+ else if (GET_CODE (SET_SRC (exp)) == CALL)
+ {
+ CC_STATUS_INIT;
+ }
+ else if (GET_CODE (SET_DEST (exp)) == REG)
+ {
+ if (cc_status.value1
+ && reg_overlap_mentioned_p (SET_DEST (exp), cc_status.value1))
+ cc_status.value1 = 0;
+ if (cc_status.value2
+ && reg_overlap_mentioned_p (SET_DEST (exp), cc_status.value2))
+ cc_status.value2 = 0;
+ }
+ else if (GET_CODE (SET_DEST (exp)) == MEM)
+ {
+ CC_STATUS_INIT;
+ }
+ }
+ else if (GET_CODE (exp) == PARALLEL
+ && GET_CODE (XVECEXP (exp, 0, 0)) == SET)
+ {
+ if (GET_CODE (SET_DEST (XVECEXP (exp, 0, 0))) == CC0)
+ {
+ cc_status.flags = 0;
+ cc_status.value1 = SET_DEST (XVECEXP (exp, 0, 0));
+ cc_status.value2 = SET_SRC (XVECEXP (exp, 0, 0));
+ }
+ else if (GET_CODE (SET_DEST (XVECEXP (exp, 0, 0))) == REG)
+ {
+ if (cc_status.value1
+ && reg_overlap_mentioned_p (SET_DEST (XVECEXP (exp, 0, 0)),
+ cc_status.value1))
+ cc_status.value1 = 0;
+ if (cc_status.value2
+ && reg_overlap_mentioned_p (SET_DEST (XVECEXP (exp, 0, 0)),
+ cc_status.value2))
+ cc_status.value2 = 0;
+ }
+ else if (GET_CODE (SET_DEST (XVECEXP (exp, 0, 0))) == MEM)
+ {
+ CC_STATUS_INIT;
+ }
+ }
+ else if (GET_CODE (exp) == CALL)
+ {
+ /* all bets are off */
+ CC_STATUS_INIT;
+ }
+ else
+ {
+ /* nothing happens? CC_STATUS_INIT; */
+ }
+ if (cc_status.value1 && GET_CODE (cc_status.value1) == REG
+ && cc_status.value2
+ && reg_overlap_mentioned_p (cc_status.value1, cc_status.value2))
+ abort ();
+}
diff --git a/gcc/config/ns32k/ns32k.h b/gcc/config/ns32k/ns32k.h
index a31eba6..b4b1455 100644
--- a/gcc/config/ns32k/ns32k.h
+++ b/gcc/config/ns32k/ns32k.h
@@ -1174,51 +1174,7 @@ __transfer_from_trampoline () \
Do not alter them if the instruction would not alter the cc's. */
#define NOTICE_UPDATE_CC(EXP, INSN) \
-{ if (GET_CODE (EXP) == SET) \
- { if (GET_CODE (SET_DEST (EXP)) == CC0) \
- { cc_status.flags = 0; \
- cc_status.value1 = SET_DEST (EXP); \
- cc_status.value2 = SET_SRC (EXP); \
- } \
- else if (GET_CODE (SET_SRC (EXP)) == CALL) \
- { CC_STATUS_INIT; } \
- else if (GET_CODE (SET_DEST (EXP)) == REG) \
- { if (cc_status.value1 \
- && reg_overlap_mentioned_p (SET_DEST (EXP), cc_status.value1)) \
- cc_status.value1 = 0; \
- if (cc_status.value2 \
- && reg_overlap_mentioned_p (SET_DEST (EXP), cc_status.value2)) \
- cc_status.value2 = 0; \
- } \
- else if (GET_CODE (SET_DEST (EXP)) == MEM) \
- { CC_STATUS_INIT; } \
- } \
- else if (GET_CODE (EXP) == PARALLEL \
- && GET_CODE (XVECEXP (EXP, 0, 0)) == SET) \
- { if (GET_CODE (SET_DEST (XVECEXP (EXP, 0, 0))) == CC0) \
- { cc_status.flags = 0; \
- cc_status.value1 = SET_DEST (XVECEXP (EXP, 0, 0)); \
- cc_status.value2 = SET_SRC (XVECEXP (EXP, 0, 0)); \
- } \
- else if (GET_CODE (SET_DEST (XVECEXP (EXP, 0, 0))) == REG) \
- { if (cc_status.value1 \
- && reg_overlap_mentioned_p (SET_DEST (XVECEXP (EXP, 0, 0)), cc_status.value1)) \
- cc_status.value1 = 0; \
- if (cc_status.value2 \
- && reg_overlap_mentioned_p (SET_DEST (XVECEXP (EXP, 0, 0)), cc_status.value2)) \
- cc_status.value2 = 0; \
- } \
- else if (GET_CODE (SET_DEST (XVECEXP (EXP, 0, 0))) == MEM) \
- { CC_STATUS_INIT; } \
- } \
- else if (GET_CODE (EXP) == CALL) \
- { /* all bets are off */ CC_STATUS_INIT; } \
- else { /* nothing happens? CC_STATUS_INIT; */} \
- if (cc_status.value1 && GET_CODE (cc_status.value1) == REG \
- && cc_status.value2 \
- && reg_overlap_mentioned_p (cc_status.value1, cc_status.value2)) \
- abort (); \
-}
+ ns32k_notice_update_cc ((EXP), (INSN))
/* Describe the costs of the following register moves which are discouraged:
1.) Moves between the Floating point registers and the frame pointer and stack pointer