1 /* TV --- Target Values, aka Constant Table.
2 Copyright (C) 1995, 1996 Christian von Roques */
6 /****i* tv/implementation
13 * Internal storage for tarvals, 1st draft:
14 * Integers as well as pointers are stored in a hex formatted string holding
15 * 16 characters. Booleans are not stored as there are only two of them.
17 * Floats are just reinterpreted as byte strings, because I am not sure if
18 * there is loss if I convert float to long double and back and furthermore
19 * the implementation of a fully ieee compatible floating point emulation
20 * is not sensible for now
21 * With this information it is easy to decide the kind of stored value:
22 * Integers have size 16, floats 4, doubles 8, long doubles 12.
25 /* This implementation assumes:
26 * both host and target have IEEE-754 floating-point arithmetic. */
28 /* !!! float and double divides MUST NOT SIGNAL !!! */
29 /* @@@ query the floating-point expception status flags */
31 /* @@@ Problem: All Values are stored twice, once as Univ_*s and a 2nd
32 time in their real target mode. :-( */
34 #define MAX_INT_LENGTH 8
35 #define CHAR_BUFFER_SIZE ((MAX_INT_LENGTH) * 2)
41 #include <assert.h> /* assertions */
42 #include <stdlib.h> /* atoi() */
43 #include <string.h> /* nice things for strings */
47 #include "set.h" /* to store tarvals in */
48 #include "tune.h" /* some constants */
49 #include "entity_t.h" /* needed to store pointers to entities */
50 #include "irmode.h" /* defines modes etc */
52 #include "irnode.h" /* defines boolean return values */
57 /****************************************************************************
58 * local definitions and macros
59 ****************************************************************************/
61 # define TARVAL_VERIFY(a) tarval_verify((a))
63 # define TARVAL_VERIFY(a) ((void)0)
66 #define INSERT_TARVAL(tv) ((tarval*)set_insert(tarvals, (tv), sizeof(tarval), hash_tv((tv))))
67 #define FIND_TARVAL(tv) ((tarval*)set_find(tarvals, (tv), sizeof(tarval), hash_tv((tv))))
69 #define INSERT_VALUE(val, size) (set_insert(values, (val), size, hash_val((val), size)))
70 #define FIND_VALUE(val, size) (set_find(values, (val), size, hash_val((val), size)))
72 #define fail_verify(a) _fail_verify((a), __FILE__, __LINE__)
74 static long long count = 0;
75 # define ANNOUNCE() printf(__FILE__": call no. %lld (%s)\n", count++, __FUNCTION__);
77 # define ANNOUNCE() ((void)0)
79 /****************************************************************************
81 ****************************************************************************/
82 static struct set *tarvals; /* container for tarval structs */
83 static struct set *values; /* container for values */
85 /****************************************************************************
87 ****************************************************************************/
89 static int hash_val(const void *value, unsigned int length);
90 static int hash_tv(tarval *tv);
91 static void _fail_verify(tarval *tv, const char* file, int line)
93 /* print a memory image of the tarval and throw an assertion */
95 printf("%s:%d: Invalid tarval:\n mode: %s\n value: [%p]\n", file, line, get_mode_name(tv->mode), tv->value);
97 printf("%s:%d: Invalid tarval (null)", file, line);
101 inline static void tarval_verify(tarval *tv)
107 if ((tv == tarval_bad) || (tv == tarval_undefined)) return;
108 if ((tv == tarval_b_true) || (tv == tarval_b_false)) return;
110 if (!FIND_TARVAL(tv)) fail_verify(tv);
111 if (tv->length > 0 && !FIND_VALUE(tv->value, tv->length)) fail_verify(tv);
117 static int hash_tv(tarval *tv)
119 return ((unsigned int)tv->value ^ (unsigned int)tv->mode) + tv->length;
122 static int hash_val(const void *value, unsigned int length)
125 unsigned int hash = 0;
127 /* scramble the byte - array */
128 for (i = 0; i < length; i++)
130 hash += (hash << 5) ^ (hash >> 27) ^ ((char*)value)[i];
131 hash += (hash << 11) ^ (hash >> 17);
137 /* finds tarval with value/mode or creates new tarval */
138 static tarval *get_tarval(const void *value, int length, ir_mode *mode)
145 /* if there already is such a value, it is returned, else value
146 * is copied into the set */
147 tv.value = INSERT_VALUE(value, length);
151 /* if there is such a tarval, it is returned, else tv is copied
153 return (tarval *)INSERT_TARVAL(&tv);
157 * Returns non-zero if a tarval overflows.
159 * @todo Implementation did not work on all modes
161 static int overflows(tarval *tv)
163 switch (get_mode_sort(tv->mode))
166 case irms_int_number:
167 if (sc_comp(tv->value, get_mode_max(tv->mode)->value) == 1) return 1;
168 if (sc_comp(tv->value, get_mode_min(tv->mode)->value) == -1) return 1;
171 case irms_float_number:
172 if (fc_comp(tv->value, get_mode_max(tv->mode)->value) == 1) return 1;
173 if (fc_comp(tv->value, get_mode_min(tv->mode)->value) == -1) return 1;
184 * public variables declared in tv.h
187 tarval *tarval_undefined;
188 tarval *tarval_b_false;
189 tarval *tarval_b_true;
190 tarval *tarval_P_void;
193 * public functions declared in tv.h
197 * Constructors =============================================================
199 tarval *new_tarval_from_str(const char *str, size_t len, ir_mode *mode)
206 switch (get_mode_sort(mode))
212 case irms_internal_boolean:
213 /* match tTrRuUeE/fFaAlLsSeE */
214 if (strcasecmp(str, "true")) return tarval_b_true;
215 else if (strcasecmp(str, "false")) return tarval_b_true;
217 return atoi(str) ? tarval_b_true : tarval_b_false;
219 case irms_float_number:
220 fc_val_from_str(str, len);
221 return get_tarval(fc_get_buffer(), fc_get_buffer_length(), mode);
223 case irms_int_number:
225 sc_val_from_str(str, len);
226 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), mode);
229 return get_tarval(str, len, mode);
232 assert(0); /* can't be reached, can it? */
237 int tarval_is_str(tarval *tv)
242 return ((get_mode_sort(tv->mode) == reference) && (tv->value != NULL) && (tv->length > 0));
244 char *tarval_to_str(tarval *tv)
247 assert(tarval_is_str(tv));
248 return (char *)tv->value;
253 * helper function, creta a tarval from long
255 tarval *new_tarval_from_long(long l, ir_mode *mode)
258 assert(mode && !(get_mode_sort(mode) == irms_auxiliary));
260 switch(get_mode_sort(mode))
262 case irms_internal_boolean:
263 /* XXX C-Semantics ! */
264 return l ? tarval_b_true : tarval_b_false ;
266 case irms_int_number:
269 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), mode);
271 case irms_float_number:
272 return new_tarval_from_double((long double)l, mode);
275 return l ? tarval_bad : get_tarval(NULL, 0, mode); /* null pointer or tarval_bad */
283 /* returns non-zero if can be converted to long */
284 int tarval_is_long(tarval *tv)
287 return ((get_mode_sort(tv->mode) == irms_int_number) || (get_mode_sort(tv->mode) == irms_character));
290 /* this might overflow the machine's long, so use only with small values */
291 long tarval_to_long(tarval* tv)
294 assert(tv && get_mode_sort(tv->mode) == irms_int_number);
296 return sc_val_to_long(tv->value); /* might overflow */
299 tarval *new_tarval_from_double(long double d, ir_mode *mode)
302 assert(mode && (get_mode_sort(mode) == irms_float_number));
304 fc_val_from_float(d);
305 return get_tarval(fc_get_buffer(), fc_get_buffer_length(), mode);
308 /* returns non-zero if can be converted to double */
309 int tarval_is_double(tarval *tv)
314 return (get_mode_sort(tv->mode) == irms_float_number);
317 long double tarval_to_double(tarval *tv)
320 assert(tarval_is_double(tv));
322 return fc_val_to_float(tv->value);
325 /* The tarval represents the address of the entity. As the address must
326 be constant the entity must have as owner the global type. */
327 tarval *new_tarval_from_entity (entity *ent, ir_mode *mode)
331 assert(mode && (get_mode_sort(mode) == irms_reference));
333 return get_tarval((void *)ent, 0, mode);
335 int tarval_is_entity(tarval *tv)
339 /* tv->value == NULL means dereferencing a null pointer */
340 return ((get_mode_sort(tv->mode) == irms_reference) && (tv->value != NULL) && (tv->length == 0));
343 entity *tarval_to_entity(tarval *tv)
348 if (tarval_is_entity(tv))
349 return (entity *)tv->value;
351 assert(0 && "tarval did not represent an entity");
356 void free_tarval_entity(entity *ent) {
357 /* There can be a tarval referencing this entity. Even if the
358 tarval is not used by the code any more, it can still reference
359 the entity as tarvals live indepently of the entity referenced.
360 Further the tarval is hashed into a set. If a hash function
361 evaluation happens to collide with this tarval, we will vrfy that
362 it contains a proper entity and we will crash if the entity is
365 Unluckily, tarvals can neither be changed nor deleted, and to find
366 one, all existing reference modes have to be tried -> a facility
367 to retrieve all modes of a kind is needed. */
372 * Access routines for tarval fields ========================================
374 ir_mode *get_tarval_mode (tarval *tv) /* get the mode of the tarval */
382 * Special value query functions ============================================
384 * These functions calculate and return a tarval representing the requested
386 * The functions get_mode_{Max,Min,...} return tarvals retrieved from these
387 * functions, but these are stored on initialization of the irmode module and
388 * therefore the irmode functions should be prefered to the functions below.
391 tarval *get_tarval_bad(void)
396 tarval *get_tarval_undefined(void)
399 return tarval_undefined;
401 tarval *get_tarval_b_false(void)
404 return tarval_b_false;
406 tarval *get_tarval_b_true(void)
409 return tarval_b_true;
411 tarval *get_tarval_P_void(void)
414 return tarval_P_void;
417 tarval *get_tarval_max(ir_mode *mode)
422 switch(get_mode_sort(mode))
429 case irms_internal_boolean:
430 return tarval_b_true;
432 case irms_float_number:
433 fc_get_max(get_mode_size_bits(mode));
434 return get_tarval(fc_get_buffer(), fc_get_buffer_length(), mode);
436 case irms_int_number:
438 sc_max_from_bits(get_mode_size_bits(mode), mode_is_signed(mode));
439 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), mode);
444 tarval *get_tarval_min(ir_mode *mode)
449 switch(get_mode_sort(mode))
456 case irms_internal_boolean:
457 return tarval_b_false;
459 case irms_float_number:
460 fc_get_min(get_mode_size_bits(mode));
461 return get_tarval(fc_get_buffer(), fc_get_buffer_length(), mode);
463 case irms_int_number:
465 sc_min_from_bits(get_mode_size_bits(mode), mode_is_signed(mode));
466 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), mode);
471 tarval *get_tarval_null(ir_mode *mode)
476 switch(get_mode_sort(mode))
479 case irms_internal_boolean:
483 case irms_float_number:
484 return new_tarval_from_double(0.0, mode);
486 case irms_int_number:
488 return new_tarval_from_long(0l, mode);
491 return tarval_P_void;
496 tarval *get_tarval_one(ir_mode *mode)
501 switch(get_mode_sort(mode))
504 case irms_internal_boolean:
509 case irms_float_number:
510 return new_tarval_from_double(1.0, mode);
512 case irms_int_number:
514 return new_tarval_from_long(1l, mode);
520 tarval *get_tarval_nan(ir_mode *mode)
525 if (get_mode_sort(mode) == irms_float_number) {
527 return get_tarval(fc_get_buffer(), fc_get_buffer_length(), mode);
530 assert(0 && "tarval is not floating point");
535 tarval *get_tarval_inf(ir_mode *mode)
540 if (get_mode_sort(mode) == irms_float_number) {
542 return get_tarval(fc_get_buffer(), fc_get_buffer_length(), mode);
545 assert(0 && "tarval is not floating point");
551 * Arithmethic operations on tarvals ========================================
555 * test if negative number, 1 means 'yes'
557 int tarval_is_negative(tarval *a)
562 switch (get_mode_sort(a->mode))
564 case irms_int_number:
565 if (!mode_is_signed(a->mode)) return 0;
567 return sc_comp(a->value, get_mode_null(a->mode)->value) == -1 ? 1 : 0;
569 case irms_float_number:
570 return fc_comp(a->value, get_mode_null(a->mode)->value) == -1 ? 1 : 0;
573 assert(0 && "not implemented");
581 pnc_number tarval_cmp(tarval *a, tarval *b)
587 if (a == tarval_bad || b == tarval_bad) assert(0 && "Comparison with tarval_bad");
588 if (a == tarval_undefined || b == tarval_undefined) return False;
589 if (a == b) return Eq;
590 if (get_tarval_mode(a) != get_tarval_mode(b)) return Uo;
592 /* Here the two tarvals are unequal and of the same mode */
593 switch (get_mode_sort(a->mode))
598 case irms_float_number:
599 return (fc_comp(a->value, b->value)==1)?(Gt):(Lt);
601 case irms_int_number:
603 return (sc_comp(a->value, b->value)==1)?(Gt):(Lt);
605 case irms_internal_boolean:
606 return (a == tarval_b_true)?(Gt):(Lt);
615 * convert to other mode
617 tarval *tarval_convert_to(tarval *src, ir_mode *m)
625 if (src->mode == m) return src;
627 switch (get_mode_sort(src->mode))
632 case irms_float_number:
635 case irms_int_number:
636 switch (get_mode_sort(m))
638 case irms_int_number:
641 tv.length = src->length;
642 tv.value = src->value;
647 return INSERT_TARVAL(&tv);
649 case irms_internal_boolean:
650 /* XXX C semantics */
651 if (src == get_mode_null(src->mode)) return tarval_b_false;
652 else return tarval_b_true;
659 case irms_internal_boolean:
660 switch (get_mode_sort(m))
662 case irms_int_number:
663 if (src == tarval_b_true) return get_mode_one(m);
664 else return get_mode_null(m);
683 tarval *tarval_neg(tarval *a)
687 assert(mode_is_num(a->mode)); /* negation only for numerical values */
688 assert(mode_is_signed(a->mode)); /* negation is difficult without negative numbers, isn't it */
690 switch (get_mode_sort(a->mode))
692 case irms_int_number:
694 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
696 case irms_float_number:
698 return get_tarval(fc_get_buffer(), fc_get_buffer_length(), a->mode);
708 tarval *tarval_add(tarval *a, tarval *b)
713 assert((a->mode == b->mode) || (get_mode_sort(a->mode) == irms_character && mode_is_int(b->mode)));
715 switch (get_mode_sort(a->mode))
718 case irms_int_number:
719 /* modes of a,b are equal, so result has mode of a as this might be the character */
720 sc_add(a->value, b->value);
721 /* FIXME: Check for overflow */
722 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
724 case irms_float_number:
725 /* FIXME: Overflow/Underflow/transition to inf when mode < 80bit */
726 fc_add(a->value, b->value);
727 return get_tarval(fc_get_buffer(), fc_get_buffer_length(), a->mode);
737 tarval *tarval_sub(tarval *a, tarval *b)
742 assert((a->mode == b->mode) || (get_mode_sort(a->mode) == irms_character && mode_is_int(b->mode)));
744 switch (get_mode_sort(a->mode))
747 case irms_int_number:
748 /* modes of a,b are equal, so result has mode of a as this might be the character */
749 sc_sub(a->value, b->value);
750 /* FIXME: check for overflow */
751 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
753 case irms_float_number:
754 /* FIXME: Overflow/Underflow/transition to inf when mode < 80bit */
755 fc_add(a->value, b->value);
756 return get_tarval(fc_get_buffer(), fc_get_buffer_length(), a->mode);
766 tarval *tarval_mul(tarval *a, tarval *b)
771 assert((a->mode == b->mode) && mode_is_num(a->mode));
773 switch (get_mode_sort(a->mode))
775 case irms_int_number:
776 /* modes of a,b are equal */
777 sc_mul(a->value, b->value);
778 /* FIXME: check for overflow */
779 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
781 case irms_float_number:
782 /* FIXME: Overflow/Underflow/transition to inf when mode < 80bit */
783 fc_add(a->value, b->value);
784 return get_tarval(fc_get_buffer(), fc_get_buffer_length(), a->mode);
792 * floating point division
794 tarval *tarval_quo(tarval *a, tarval *b)
799 assert((a->mode == b->mode) && mode_is_float(a->mode));
801 /* FIXME: Overflow/Underflow/transition to inf when mode < 80bit */
802 fc_div(a->value, b->value);
803 return get_tarval(fc_get_buffer(), fc_get_buffer_length(), a->mode);
809 tarval *tarval_div(tarval *a, tarval *b)
814 assert((a->mode == b->mode) && mode_is_int(a->mode));
816 /* modes of a,b are equal */
817 sc_div(a->value, b->value);
818 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
824 tarval *tarval_mod(tarval *a, tarval *b)
829 assert((a->mode == b->mode) && mode_is_int(a->mode));
831 /* modes of a,b are equal */
832 sc_mod(a->value, b->value);
833 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
839 tarval *tarval_abs(tarval *a)
843 assert(mode_is_num(a->mode));
845 switch (get_mode_sort(a->mode))
847 case irms_int_number:
848 if (sc_comp(a->value, get_mode_null(a->mode)->value) == -1)
851 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
855 case irms_float_number:
867 tarval *tarval_and(tarval *a, tarval *b)
872 assert((a->mode == b->mode) && mode_is_int(a->mode));
874 sc_and(a->value, b->value);
875 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
881 tarval *tarval_or (tarval *a, tarval *b)
886 assert((a->mode == b->mode) && mode_is_int(a->mode));
888 sc_or(a->value, b->value);
889 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
893 * bitwise exclusive or (xor)
895 tarval *tarval_eor(tarval *a, tarval *b)
900 assert((a->mode == b->mode) && mode_is_int(a->mode));
902 sc_or(a->value, b->value);
903 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
909 tarval *tarval_shl(tarval *a, tarval *b)
914 assert(mode_is_int(a->mode) && mode_is_int(b->mode));
916 sc_shl(a->value, b->value, get_mode_size_bits(a->mode), mode_is_signed(a->mode));
917 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
921 * bitwise unsigned right shift
923 tarval *tarval_shr(tarval *a, tarval *b)
928 assert(mode_is_int(a->mode) && mode_is_int(b->mode));
930 sc_shr(a->value, b->value, get_mode_size_bits(a->mode), mode_is_signed(a->mode));
931 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
935 * bitwise signed right shift
937 tarval *tarval_shrs(tarval *a, tarval *b)
942 assert(mode_is_int(a->mode) && mode_is_int(b->mode));
944 sc_shrs(a->value, b->value, get_mode_size_bits(a->mode), mode_is_signed(a->mode));
945 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
951 tarval *tarval_rot(tarval *a, tarval *b)
956 assert(mode_is_int(a->mode) && mode_is_int(b->mode));
958 sc_rot(a->value, b->value, get_mode_size_bits(a->mode), mode_is_signed(a->mode));
959 return get_tarval(sc_get_buffer(), sc_get_buffer_length(), a->mode);
966 int tarval_snprintf(char *buf, size_t len, tarval *tv)
968 static const tarval_mode_info default_info = { TVO_NATIVE, NULL, NULL };
972 const tarval_mode_info *mode_info;
973 const char *prefix, *suffix;
977 mode_info = tv->mode->tv_priv;
979 mode_info = &default_info;
980 prefix = mode_info->mode_prefix ? mode_info->mode_prefix : "";
981 suffix = mode_info->mode_suffix ? mode_info->mode_suffix : "";
983 switch (get_mode_sort(tv->mode))
985 case irms_int_number:
987 switch (mode_info->mode_output) {
990 str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_DEC);
994 str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_OCT);
1000 str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_HEX);
1003 return snprintf(buf, len, "%s%s%s", prefix, str, suffix);
1005 case irms_float_number:
1006 return snprintf(buf, len, "%s%s%s", prefix, fc_print_dec(tv->value, tv_buf, sizeof(tv_buf)), suffix);
1008 case irms_reference:
1009 if (tv->value != NULL)
1010 if (tarval_is_entity(tv))
1011 if (get_entity_peculiarity((entity *)tv->value) == existent)
1012 return snprintf(buf, len, "&(%s)", get_entity_ld_name((entity *)tv->value));
1014 return snprintf(buf, len, "NULL");
1016 if (size > tv->length) {
1017 memcpy(buf, tv->value, tv->length);
1018 buf[tv->length] = '\0';
1022 memcpy(buf, tv->value, size-1);
1028 return snprintf(buf, len, "void");
1030 case irms_internal_boolean:
1031 switch (mode_info->mode_output) {
1037 return snprintf(buf, len, "%s%c%s", prefix, (tv == tarval_b_true) ? '1' : '0', suffix);
1041 return snprintf(buf, len, "%s%s%s", prefix, (tv == tarval_b_true) ? "true" : "false", suffix);
1044 case irms_auxiliary:
1045 return snprintf(buf, len, "<BAD>");
1051 char *tarval_bitpattern(tarval *tv)
1057 * access to the bitpattern
1059 unsigned char tarval_sub_bits(tarval *tv, unsigned byte_ofs)
1061 switch (get_mode_sort(tv->mode)) {
1062 case irms_int_number:
1063 case irms_character:
1064 return sc_sub_bits(tv->value, tv->length, byte_ofs);
1066 case irms_float_number:
1067 return fc_sub_bits(tv->value, get_mode_size_bits(tv->mode), byte_ofs);
1075 * Specify the output options of one mode.
1077 * This functions stores the modinfo, so DO NOT DESTROY it.
1079 * Returns zero on success.
1081 int tarval_set_mode_output_option(ir_mode *mode, const tarval_mode_info *modeinfo)
1085 mode->tv_priv = modeinfo;
1089 /* Identifying some tarvals ??? */
1090 /* Implemented in old tv.c as such:
1091 * return 0 for additive neutral,
1092 * 1 for multiplicative neutral,
1093 * -1 for bitwise-and neutral
1096 * Implemented for completeness */
1097 long tarval_classify(tarval *tv)
1100 if (!tv || tv == tarval_bad) return 2;
1102 if (tv == get_mode_null(tv->mode)) return 0;
1103 else if (tv == get_mode_one(tv->mode)) return 1;
1104 else if ((get_mode_sort(tv->mode) == irms_int_number)
1105 && (tv == new_tarval_from_long(-1, tv->mode))) return -1;
1111 * Initialization of the tarval module: called before init_mode()
1113 void init_tarval_1(void)
1116 /* initialize the sets holding the tarvals with a comparison function and
1117 * an initial size, which is the expected number of constants */
1118 tarvals = new_set(memcmp, TUNE_NCONSTANTS);
1119 values = new_set(memcmp, TUNE_NCONSTANTS);
1120 /* init with default precision */
1122 /* init_fltcalc(0); not yet*/
1126 * default mode_info for output as HEX
1128 static const tarval_mode_info hex_output = {
1135 * Initialization of the tarval module: called after init_mode()
1137 void init_tarval_2(void)
1141 tarval_bad = (tarval*)malloc(sizeof(tarval));
1142 tarval_bad->mode = NULL;
1144 tarval_undefined = (tarval*)malloc(sizeof(tarval));
1145 tarval_undefined->mode = NULL;
1147 tarval_b_true = (tarval*)malloc(sizeof(tarval));
1148 tarval_b_true->mode = mode_b;
1150 tarval_b_false = (tarval*)malloc(sizeof(tarval));
1151 tarval_b_false->mode = mode_b;
1153 tarval_P_void = (tarval*)malloc(sizeof(tarval));
1154 tarval_P_void->mode = mode_P;
1157 * assign output modes that are compatible with the
1158 * old implementation: Hex output
1160 tarval_set_mode_output_option(mode_U, &hex_output);
1161 tarval_set_mode_output_option(mode_C, &hex_output);
1162 tarval_set_mode_output_option(mode_Bs, &hex_output);
1163 tarval_set_mode_output_option(mode_Bu, &hex_output);
1164 tarval_set_mode_output_option(mode_Hs, &hex_output);
1165 tarval_set_mode_output_option(mode_Hu, &hex_output);
1166 tarval_set_mode_output_option(mode_Hs, &hex_output);
1167 tarval_set_mode_output_option(mode_Hu, &hex_output);
1168 tarval_set_mode_output_option(mode_Is, &hex_output);
1169 tarval_set_mode_output_option(mode_Iu, &hex_output);
1170 tarval_set_mode_output_option(mode_Ls, &hex_output);
1171 tarval_set_mode_output_option(mode_Lu, &hex_output);
1174 /****************************************************************************
1176 ****************************************************************************/