Bug 439685 compiler warning in callgrind/main.c
[valgrind.git] / VEX / priv / s390_defs.h
blob80d7336061dc45d54daab201f406f72b4748ed7e
1 /* -*- mode: C; c-basic-offset: 3; -*- */
3 /*---------------------------------------------------------------*/
4 /*--- begin s390_defs.h ---*/
5 /*---------------------------------------------------------------*/
7 /*
8 This file is part of Valgrind, a dynamic binary instrumentation
9 framework.
11 Copyright IBM Corp. 2010-2017
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, see <http://www.gnu.org/licenses/>.
26 The GNU General Public License is contained in the file COPYING.
29 #ifndef __VEX_S390_DEFS_H
30 #define __VEX_S390_DEFS_H
33 /* Condition code. The encoding of the enumerators matches the value of
34 the mask field in the various branch opcodes. */
35 typedef enum {
36 S390_CC_NEVER = 0,
37 S390_CC_OVFL = 1, /* overflow */
38 S390_CC_H = 2, /* A > B ; high */
39 S390_CC_NLE = 3, /* not low or equal */
40 S390_CC_L = 4, /* A < B ; low */
41 S390_CC_NHE = 5, /* not high or equal */
42 S390_CC_LH = 6, /* low or high */
43 S390_CC_NE = 7, /* A != B ; not zero */
44 S390_CC_E = 8, /* A == B ; zero */
45 S390_CC_NLH = 9, /* not low or high */
46 S390_CC_HE = 10, /* A >= B ; high or equal*/
47 S390_CC_NL = 11, /* not low */
48 S390_CC_LE = 12, /* A <= B ; low or equal */
49 S390_CC_NH = 13, /* not high */
50 S390_CC_NO = 14, /* not overflow */
51 S390_CC_ALWAYS = 15
52 } s390_cc_t;
55 /* Invert the condition code */
56 static __inline__ s390_cc_t
57 s390_cc_invert(s390_cc_t cond)
59 return S390_CC_ALWAYS - cond;
63 /* BFP Rounding mode as it is encoded in the m3 field of certain
64 instructions (e.g. CFEBR) */
65 typedef enum {
66 S390_BFP_ROUND_PER_FPC = 0,
67 S390_BFP_ROUND_NEAREST_AWAY = 1,
68 /* 2 is not allowed */
69 S390_BFP_ROUND_PREPARE_SHORT = 3,
70 S390_BFP_ROUND_NEAREST_EVEN = 4,
71 S390_BFP_ROUND_ZERO = 5,
72 S390_BFP_ROUND_POSINF = 6,
73 S390_BFP_ROUND_NEGINF = 7
74 } s390_bfp_round_t;
77 /* BFP Rounding mode as it is encoded in bits [29:31] of the FPC register.
78 Only rounding modes 0..3 are universally supported. Others require
79 additional hardware facilities. */
80 typedef enum {
81 S390_FPC_BFP_ROUND_NEAREST_EVEN = 0,
82 S390_FPC_BFP_ROUND_ZERO = 1,
83 S390_FPC_BFP_ROUND_POSINF = 2,
84 S390_FPC_BFP_ROUND_NEGINF = 3,
85 /* 4,5,6 are not allowed */
86 S390_FPC_BFP_ROUND_PREPARE_SHORT = 7 /* floating point extension facility */
87 } s390_fpc_bfp_round_t;
90 /* DFP Rounding mode as it is encoded in the m3 field of certain
91 instructions (e.g. CGDTR) */
92 typedef enum {
93 S390_DFP_ROUND_PER_FPC_0 = 0,
94 S390_DFP_ROUND_NEAREST_TIE_AWAY_0_1 = 1,
95 S390_DFP_ROUND_PER_FPC_2 = 2,
96 S390_DFP_ROUND_PREPARE_SHORT_3 = 3,
97 S390_DFP_ROUND_NEAREST_EVEN_4 = 4,
98 S390_DFP_ROUND_ZERO_5 = 5,
99 S390_DFP_ROUND_POSINF_6 = 6,
100 S390_DFP_ROUND_NEGINF_7 = 7,
101 S390_DFP_ROUND_NEAREST_EVEN_8 = 8,
102 S390_DFP_ROUND_ZERO_9 = 9,
103 S390_DFP_ROUND_POSINF_10 = 10,
104 S390_DFP_ROUND_NEGINF_11 = 11,
105 S390_DFP_ROUND_NEAREST_TIE_AWAY_0_12 = 12,
106 S390_DFP_ROUND_NEAREST_TIE_TOWARD_0 = 13,
107 S390_DFP_ROUND_AWAY_0 = 14,
108 S390_DFP_ROUND_PREPARE_SHORT_15 = 15
109 } s390_dfp_round_t;
112 /* DFP Rounding mode as it is encoded in bits [25:27] of the FPC register. */
113 typedef enum {
114 S390_FPC_DFP_ROUND_NEAREST_EVEN = 0,
115 S390_FPC_DFP_ROUND_ZERO = 1,
116 S390_FPC_DFP_ROUND_POSINF = 2,
117 S390_FPC_DFP_ROUND_NEGINF = 3,
118 S390_FPC_DFP_ROUND_NEAREST_AWAY_0 = 4,
119 S390_FPC_DFP_ROUND_NEAREST_TOWARD_0 = 5,
120 S390_FPC_DFP_ROUND_AWAY_ZERO = 6,
121 S390_FPC_DFP_ROUND_PREPARE_SHORT = 7
122 } s390_fpc_dfp_round_t;
124 /* PFPO function code as it is encoded in bits [33:55] of GR0
125 when PFPO insn is executed. */
126 typedef enum {
127 S390_PFPO_F32_TO_D32 = 0x010805,
128 S390_PFPO_F32_TO_D64 = 0x010905,
129 S390_PFPO_F32_TO_D128 = 0x010A05,
130 S390_PFPO_F64_TO_D32 = 0x010806,
131 S390_PFPO_F64_TO_D64 = 0x010906,
132 S390_PFPO_F64_TO_D128 = 0x010A06,
133 S390_PFPO_F128_TO_D32 = 0x010807,
134 S390_PFPO_F128_TO_D64 = 0x010907,
135 S390_PFPO_F128_TO_D128 = 0x010A07,
136 S390_PFPO_D32_TO_F32 = 0x010508,
137 S390_PFPO_D32_TO_F64 = 0x010608,
138 S390_PFPO_D32_TO_F128 = 0x010708,
139 S390_PFPO_D64_TO_F32 = 0x010509,
140 S390_PFPO_D64_TO_F64 = 0x010609,
141 S390_PFPO_D64_TO_F128 = 0x010709,
142 S390_PFPO_D128_TO_F32 = 0x01050A,
143 S390_PFPO_D128_TO_F64 = 0x01060A,
144 S390_PFPO_D128_TO_F128 = 0x01070A
145 } s390_pfpo_function_t;
147 /* PPNO function code as it is encoded in bits [57:63] of GR0
148 when PPNO insn is executed. */
149 typedef enum
151 S390_PPNO_QUERY = 0x00,
152 S390_PPNO_SHA512_GEN = 0x03,
153 S390_PPNO_SHA512_SEED = 0x83
154 } s390_ppno_function_t;
156 /* Size of parameter block for PPNO functions.
157 All values are in bytes.
159 #define S390_PPNO_PARAM_BLOCK_SIZE_QUERY 16
160 #define S390_PPNO_PARAM_BLOCK_SIZE_SHA512 240
162 /* Maximum length of modified memory for PPNO functions.
163 All values are in bytes.
165 #define S390_PPNO_MAX_SIZE_SHA512_SEED 512
166 #define S390_PPNO_MAX_SIZE_SHA512_GEN 64
169 /* The length of the longest mnemonic: locgrnhe */
170 #define S390_MAX_MNEMONIC_LEN 8
173 /*---------------------------------------------------------------*/
174 /*--- end s390_defs.h ---*/
175 /*---------------------------------------------------------------*/
177 #endif /* __VEX_S390_DEFS_H */