libFirm
irmode.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19 
26 #ifndef FIRM_IR_IRMODE_H
27 #define FIRM_IR_IRMODE_H
28 
29 #include "firm_types.h"
30 #include "begin.h"
31 
32 #include <stddef.h>
33 
50 typedef enum ir_mode_arithmetic {
51  irma_none = 1,
57  irma_ieee754 = 256,
61  irma_last = irma_x86_extended_float,
63 
80 FIRM_API ir_mode *new_int_mode(const char *name,
81  ir_mode_arithmetic arithmetic,
82  unsigned bit_size, int sign,
83  unsigned modulo_shift);
84 
90 FIRM_API ir_mode *new_reference_mode(const char *name,
91  ir_mode_arithmetic arithmetic,
92  unsigned bit_size,
93  unsigned modulo_shift);
94 
105 FIRM_API ir_mode *new_float_mode(const char *name,
106  ir_mode_arithmetic arithmetic,
107  unsigned exponent_size,
108  unsigned mantissa_size);
109 
118 FIRM_API int is_mode(const void *thing);
119 
121 FIRM_API ident *get_mode_ident(const ir_mode *mode);
122 
124 FIRM_API const char *get_mode_name(const ir_mode *mode);
125 
127 FIRM_API unsigned get_mode_size_bits(const ir_mode *mode);
128 
131 FIRM_API unsigned get_mode_size_bytes(const ir_mode *mode);
132 
136 FIRM_API int get_mode_sign(const ir_mode *mode);
137 
140 
147 FIRM_API unsigned int get_mode_modulo_shift(const ir_mode *mode);
148 
150 FIRM_API void *get_mode_link(const ir_mode *mode);
151 
153 FIRM_API void set_mode_link(ir_mode *mode, void *l);
154 
162 
170 
180 
189 
197 
204 
212 
220 
255 FIRM_API ir_mode *get_modeF(void);
257 FIRM_API ir_mode *get_modeD(void);
259 FIRM_API ir_mode *get_modeQ(void);
281 FIRM_API ir_mode *get_modeP(void);
283 FIRM_API ir_mode *get_modeb(void);
285 FIRM_API ir_mode *get_modeX(void);
289 FIRM_API ir_mode *get_modeM(void);
291 FIRM_API ir_mode *get_modeT(void);
296 
299 
302 
308 
314 
316 FIRM_API int mode_is_signed (const ir_mode *mode);
318 FIRM_API int mode_is_float (const ir_mode *mode);
320 FIRM_API int mode_is_int (const ir_mode *mode);
322 FIRM_API int mode_is_reference (const ir_mode *mode);
324 FIRM_API int mode_is_num (const ir_mode *mode);
326 FIRM_API int mode_is_data (const ir_mode *mode);
328 FIRM_API int mode_is_datab (const ir_mode *mode);
330 FIRM_API int mode_is_dataM (const ir_mode *mode);
331 
343 FIRM_API int smaller_mode(const ir_mode *sm, const ir_mode *lm);
344 
355 FIRM_API int values_in_mode(const ir_mode *sm, const ir_mode *lm);
356 
362 
368 
374 
379 FIRM_API int mode_honor_signed_zeros(const ir_mode *mode);
380 
385 
392 FIRM_API int mode_wrap_around(const ir_mode *mode);
393 
398 
402 FIRM_API void set_reference_mode_signed_eq(ir_mode *ref_mode, ir_mode *int_mode);
403 
408 
412 FIRM_API void set_reference_mode_unsigned_eq(ir_mode *ref_mode, ir_mode *int_mode);
413 
421 FIRM_API unsigned get_mode_mantissa_size(const ir_mode *mode);
422 
426 FIRM_API unsigned get_mode_exponent_size(const ir_mode *mode);
427 
433 FIRM_API int is_reinterpret_cast(const ir_mode *src, const ir_mode *dst);
434 
439 
441 FIRM_API size_t ir_get_n_modes(void);
442 
444 FIRM_API ir_mode *ir_get_mode(size_t num);
445 
448 #include "end.h"
449 
450 #endif