libFirm
tv.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 
28 #ifndef FIRM_TV_TV_H
29 #define FIRM_TV_TV_H
30 
31 #include <stddef.h>
32 #include "firm_types.h"
33 
34 #include "begin.h"
35 
100 FIRM_API ir_tarval *new_tarval_from_str(const char *str, size_t len,
101  ir_mode *mode);
102 
120 FIRM_API ir_tarval *new_integer_tarval_from_str(const char *str, size_t len,
121  char sign, unsigned char base,
122  ir_mode *mode);
123 
152 
164 
173 
202 
207 
218 
222 FIRM_API long double get_tarval_long_double(ir_tarval *tv);
223 
232 
239 
246 
253 
260 
267 
272 
278 
283 
288 
293 
298 
303 
308 
310 #define tarval_top tarval_undefined
311 
312 #define get_tarval_top() get_tarval_undefined()
313 
315 #define tarval_bottom tarval_bad
316 
317 #define get_tarval_bottom() get_tarval_bad()
318 
321 
324 
328 
331 
335 
339 
342 
345 
348 
355 
362 
367 
380 
404 
405 /*
406  * These function implement basic computations representable as opcodes
407  * in FIRM nodes.
408  *
409  * PARAMETERS
410  * tarval_neg:
411  * traval_abs:
412  * a - the tarval to operate on
413  *
414  * all others:
415  * a - the first operand tarval
416  * b - the second operand tarval
417  *
418  * RESULT
419  * If necessary a new tarval is constructed for the resulting value,
420  * or the one already carrying the computation result is retrieved and
421  * returned as result.
422  *
423  * NOTES
424  * The order the arguments are given in is important, imagine postfix
425  * notation.
426  * Illegal operations will trigger an assertion.
427  * The sort member of the struct mode defines which operations are valid
428  */
429 
438 
447 
457 
468 
478 
488 
498 
509 
518 
528 
538 
548 
558 
568 
574 
584 
590 
600 
606 
616 
620 FIRM_API int tarval_carry(void);
621 
630 typedef enum {
640 
645 typedef struct tarval_mode_info {
647  const char *mode_prefix;
649  const char *mode_suffix;
652 
664  const tarval_mode_info *modeinfo);
665 
676 
701 
728 FIRM_API unsigned char get_tarval_sub_bits(ir_tarval *tv, unsigned byte_ofs);
729 
737 
746 
755 
763 FIRM_API int tarval_snprintf(char *buf, size_t buflen, ir_tarval *tv);
764 
771 
779 
787 
796 
800 FIRM_API unsigned tarval_ieee754_get_exact(void);
801 
805 FIRM_API void tarval_enable_fp_ops(int enable);
806 
809 
816 
823 
830 
837 
846 FIRM_API int is_tarval(const void *thing);
847 
850 #include "end.h"
851 
852 #endif