sparc: fix float to short conversion
[libfirm] / ir / tv / tv.c
index ff38cc5..b6bb770 100644 (file)
@@ -23,7 +23,6 @@
  *           values.
  * @date     2003
  * @author   Mathias Heil
- * @version  $Id$
  * @brief
  *
  * Values are stored in a format depending upon chosen arithmetic
@@ -637,7 +636,7 @@ ir_tarval *get_tarval_all_one(ir_mode *mode)
 
 int tarval_is_constant(ir_tarval *tv)
 {
-       int num_res = sizeof(reserved_tv) / sizeof(reserved_tv[0]);
+       size_t const num_res = ARRAY_SIZE(reserved_tv);
 
        /* reserved tarvals are NOT constants. Note that although
           tarval_b_true and tarval_b_false are reserved, they are constants of course. */
@@ -1485,6 +1484,7 @@ unsigned char get_tarval_sub_bits(ir_tarval *tv, unsigned byte_ofs)
        case irma_twos_complement:
                return sc_sub_bits(tv->value, get_mode_size_bits(tv->mode), byte_ofs);
        case irma_ieee754:
+       case irma_x86_extended_float:
                return fc_sub_bits((const fp_value*) tv->value, get_mode_size_bits(tv->mode), byte_ofs);
        default:
                panic("get_tarval_sub_bits(): arithmetic mode not supported");