00001 /* Definitions for condition code handling in final.c and output routines. 00002 Copyright (C) 1987 Free Software Foundation, Inc. 00003 00004 This file is part of GCC. 00005 00006 GCC is free software; you can redistribute it and/or modify it under 00007 the terms of the GNU General Public License as published by the Free 00008 Software Foundation; either version 2, or (at your option) any later 00009 version. 00010 00011 GCC is distributed in the hope that it will be useful, but WITHOUT ANY 00012 WARRANTY; without even the implied warranty of MERCHANTABILITY or 00013 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00014 for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with GCC; see the file COPYING. If not, write to the Free 00018 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 00019 02110-1301, USA. */ 00020 00021 /* None of the things in the files exist if we don't use CC0. */ 00022 00023 #ifdef HAVE_cc0 00024 00025 /* The variable cc_status says how to interpret the condition code. 00026 It is set by output routines for an instruction that sets the cc's 00027 and examined by output routines for jump instructions. 00028 00029 cc_status contains two components named `value1' and `value2' 00030 that record two equivalent expressions for the values that the 00031 condition codes were set from. (Either or both may be null if 00032 there is no useful expression to record.) These fields are 00033 used for eliminating redundant test and compare instructions 00034 in the cases where the condition codes were already set by the 00035 previous instruction. 00036 00037 cc_status.flags contains flags which say that the condition codes 00038 were set in a nonstandard manner. The output of jump instructions 00039 uses these flags to compensate and produce the standard result 00040 with the nonstandard condition codes. Standard flags are defined here. 00041 The tm.h file can also define other machine-dependent flags. 00042 00043 cc_status also contains a machine-dependent component `mdep' 00044 whose type, `CC_STATUS_MDEP', may be defined as a macro in the 00045 tm.h file. */ 00046 00047 #ifndef CC_STATUS_MDEP 00048 #define CC_STATUS_MDEP int 00049 #endif 00050 00051 #ifndef CC_STATUS_MDEP_INIT 00052 #define CC_STATUS_MDEP_INIT 0 00053 #endif 00054 00055 typedef struct {int flags; rtx value1, value2; CC_STATUS_MDEP mdep;} CC_STATUS; 00056 00057 /* While outputting an insn as assembler code, 00058 this is the status BEFORE that insn. */ 00059 extern CC_STATUS cc_prev_status; 00060 00061 /* While outputting an insn as assembler code, 00062 this is being altered to the status AFTER that insn. */ 00063 extern CC_STATUS cc_status; 00064 00065 /* These are the machine-independent flags: */ 00066 00067 /* Set if the sign of the cc value is inverted: 00068 output a following jump-if-less as a jump-if-greater, etc. */ 00069 #define CC_REVERSED 1 00070 00071 /* This bit means that the current setting of the N bit is bogus 00072 and conditional jumps should use the Z bit in its place. 00073 This state obtains when an extraction of a signed single-bit field 00074 or an arithmetic shift right of a byte by 7 bits 00075 is turned into a btst, because btst does not set the N bit. */ 00076 #define CC_NOT_POSITIVE 2 00077 00078 /* This bit means that the current setting of the N bit is bogus 00079 and conditional jumps should pretend that the N bit is clear. 00080 Used after extraction of an unsigned bit 00081 or logical shift right of a byte by 7 bits is turned into a btst. 00082 The btst does not alter the N bit, but the result of that shift 00083 or extract is never negative. */ 00084 #define CC_NOT_NEGATIVE 4 00085 00086 /* This bit means that the current setting of the overflow flag 00087 is bogus and conditional jumps should pretend there is no overflow. */ 00088 /* ??? Note that for most targets this macro is misnamed as it applies 00089 to the carry flag, not the overflow flag. */ 00090 #define CC_NO_OVERFLOW 010 00091 00092 /* This bit means that what ought to be in the Z bit 00093 should be tested as the complement of the N bit. */ 00094 #define CC_Z_IN_NOT_N 020 00095 00096 /* This bit means that what ought to be in the Z bit 00097 should be tested as the N bit. */ 00098 #define CC_Z_IN_N 040 00099 00100 /* Nonzero if we must invert the sense of the following branch, i.e. 00101 change EQ to NE. This is not safe for IEEE floating point operations! 00102 It is intended for use only when a combination of arithmetic 00103 or logical insns can leave the condition codes set in a fortuitous 00104 (though inverted) state. */ 00105 #define CC_INVERTED 0100 00106 00107 /* Nonzero if we must convert signed condition operators to unsigned. 00108 This is only used by machine description files. */ 00109 #define CC_NOT_SIGNED 0200 00110 00111 /* This is how to initialize the variable cc_status. 00112 final does this at appropriate moments. */ 00113 00114 #define CC_STATUS_INIT \ 00115 (cc_status.flags = 0, cc_status.value1 = 0, cc_status.value2 = 0, \ 00116 CC_STATUS_MDEP_INIT) 00117 00118 #endif
1.5.6