heur5 not available yet ;-)
[libfirm] / ir / tv / tc_calc.h
1
2 /** Should be at least 16 bit. */
3 typedef unsigned short tc_value_part;
4
5 /** Should be at least 32 bit */
6 typedef long tc_temp;
7
8 /**
9  * We need 64 + 2 bit for floating point support
10  */
11 #define TC_VALUE_SIZE          80
12 #define TC_VALUE_PART_SIZE     16
13 #define TC_VALUE_PART_MASK     0xFFFF
14 #define TC_VALUE_PART_MAX_UINT 0xFFFF
15 #define TC_VALUE_PART_SIGN_BIT 0x8000
16
17 #define NUM_VALUE_PARTS     (TC_VALUE_SIZE / TC_VALUE_PART_SIZE)
18
19 /**
20  * A two complement value. Note that the parts are store in BIG-Endian.
21  * this makes most loops counting towards zero and allows simple access
22  * to the sign bit.
23  */
24 typedef struct tc_value {
25         tc_value_part part[NUM_VALUE_PARTS];
26 } tc_value;
27
28
29 /**
30  * Every operation produces two bits. Carry and Overflow.
31  * Carry means unsigned overflow, Overflow means signed overflow.
32  */
33 extern int tc_Carry, tc_Overflow;