]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/cris/cris-modes.def
cris: Introduce CC_NZVCmode and CC_NZmode.
[thirdparty/gcc.git] / gcc / config / cris / cris-modes.def
1 /* Definitions of target machine for GNU compiler, for CRIS.
2 Copyright (C) 2002-2020 Free Software Foundation, Inc.
3
4 This file is part of GCC.
5
6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
10
11 GCC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
19
20 /* Node: Condition Code */
21
22 /* The mode used for condition-codes depends on both the way the
23 condition-codes are generated (the CC-setter, typically the compare
24 instruction), and used (the CC-user, typically a branch). For CRIS, we
25 have ordinary compares and incidental condition-code settings from
26 preceding instructions, setting a subset of N, Z, V and C to usable
27 values, from the perspective of comparing the result against zero
28 (fpcraz). The two subsets meaningful to gcc are all of N, Z, V, C
29 versus just N, Z; some CC-users care only about N and/or Z and some
30 that care about at least one of those flags together with V and/or C.
31 (FIXME: the result of testing a single bit using the btst instruction
32 should be described as a separate mode.)
33
34 The plain "CC_MODE (CC)" (which is always present in gcc), is used to
35 reflect the "unoptimized" state, where the CC-setter is a compare
36 against zero and the CC-user is any branch or s<condition> instruction,
37 before reload. After reload, a need for C or V is reflected as
38 CC_NZVCmode in both setters and users, and others remain CCmode, until
39 or if optimization of CC-setter and CC-users, when CCmode setters can
40 be changed or replaced by either CC_NZmode or CC_NZVCmode. To wit, all
41 users that require CC_NZVCmode must match only that mode at any time.
42 All other users must match all CCmodes. All setters that set only
43 CC_NZmode must set only that mode. All other setters must match
44 setting all CCmodes. */
45
46 /* Z and N flags only. For a condition-code setter: only the Z and N
47 flags are set to usable values, fpcraz. For a condition-code user: the
48 operation using the condition codes only care about the Z and N flags. */
49 CC_MODE (CC_NZ);
50
51 /* Z and N *and* V and C flags. For a condition-code setter: all flags
52 are set to usable values, fpcraz. For a condition-code user: at least
53 one of V and C are used and possibly N and Z too. */
54 CC_MODE (CC_NZVC);