Next: MODE_CC Condition Codes, Up: Condition Code
(cc0)
The file conditions.h defines a variable cc_status
to
describe how the condition code was computed (in case the interpretation of
the condition code depends on the instruction that it was set by). This
variable contains the RTL expressions on which the condition code is
currently based, and several standard flags.
Sometimes additional machine-specific flags must be defined in the machine
description header file. It can also add additional machine-specific
information by defining CC_STATUS_MDEP
.
C code for a data type which is used for declaring the
mdep
component ofcc_status
. It defaults toint
.This macro is not used on machines that do not use
cc0
.
A C expression to initialize the
mdep
field to “empty”. The default definition does nothing, since most machines don't use the field anyway. If you want to use the field, you should probably define this macro to initialize it.This macro is not used on machines that do not use
cc0
.
A C compound statement to set the components of
cc_status
appropriately for an insn insn whose body is exp. It is this macro's responsibility to recognize insns that set the condition code as a byproduct of other activity as well as those that explicitly set(cc0)
.This macro is not used on machines that do not use
cc0
.If there are insns that do not set the condition code but do alter other machine registers, this macro must check to see whether they invalidate the expressions that the condition code is recorded as reflecting. For example, on the 68000, insns that store in address registers do not set the condition code, which means that usually
NOTICE_UPDATE_CC
can leavecc_status
unaltered for such insns. But suppose that the previous insn set the condition code based on location ‘a4@(102)’ and the current insn stores a new value in ‘a4’. Although the condition code is not changed by this, it will no longer be true that it reflects the contents of ‘a4@(102)’. Therefore,NOTICE_UPDATE_CC
must altercc_status
in this case to say that nothing is known about the condition code value.The definition of
NOTICE_UPDATE_CC
must be prepared to deal with the results of peephole optimization: insns whose patterns areparallel
RTXs containing variousreg
,mem
or constants which are just the operands. The RTL structure of these insns is not sufficient to indicate what the insns actually do. WhatNOTICE_UPDATE_CC
should do when it sees one is just to runCC_STATUS_INIT
.A possible definition of
NOTICE_UPDATE_CC
is to call a function that looks at an attribute (see Insn Attributes) named, for example, ‘cc’. This avoids having detailed information about patterns in two places, the md file and inNOTICE_UPDATE_CC
.