summaryrefslogtreecommitdiffhomepage
path: root/ir/tv
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2014-12-31 07:45:15 +0100
committerMatthias Braun <matze@braunis.de>2014-12-31 07:45:15 +0100
commit72dbf35a852fced54eb1a7ec800c50ba0e4f4a54 (patch)
treefc214810e116696e36f82838b5b42e6fab3a0901 /ir/tv
parent874898aa31ce0bfd67cd016b4334ff53bdad4ca6 (diff)
assert for float mode in get_tarval_{small|epsilon}; remove unused get_tarval_minus_inf
Diffstat (limited to 'ir/tv')
-rw-r--r--ir/tv/tv.c24
-rw-r--r--ir/tv/tv_t.h2
2 files changed, 6 insertions, 20 deletions
diff --git a/ir/tv/tv.c b/ir/tv/tv.c
index f315771..c0df83f 100644
--- a/ir/tv/tv.c
+++ b/ir/tv/tv.c
@@ -406,34 +406,22 @@ ir_tarval *(get_tarval_b_true)(void)
ir_tarval *get_tarval_small(ir_mode *mode)
{
- if (!mode_is_float(mode))
- panic("mode %+F does not support small value");
- fp_value *buffer = (fp_value*)ALLOCAN(char, fp_value_size);
- const float_descriptor_t *desc = get_descriptor(mode);
+ assert(mode_is_float(mode));
+ fp_value *buffer = (fp_value*)ALLOCAN(char, fp_value_size);
+ const float_descriptor_t *desc = get_descriptor(mode);
fc_get_small(desc, buffer);
return get_fp_tarval(buffer, mode);
}
ir_tarval *get_tarval_epsilon(ir_mode *mode)
{
- if (!mode_is_float(mode))
- panic("mode %+F does not support small value");
- fp_value *buffer = (fp_value*)ALLOCAN(char, fp_value_size);
- const float_descriptor_t *desc = get_descriptor(mode);
+ assert(mode_is_float(mode));
+ fp_value *buffer = (fp_value*)ALLOCAN(char, fp_value_size);
+ const float_descriptor_t *desc = get_descriptor(mode);
fc_get_epsilon(desc, buffer);
return get_fp_tarval(buffer, mode);
}
-ir_tarval *get_tarval_minus_inf(ir_mode *mode)
-{
- if (!mode_is_float(mode))
- panic("mode %F does not support -inf value", mode);
- fp_value *buffer = (fp_value*)ALLOCAN(char, fp_value_size);
- const float_descriptor_t *desc = get_descriptor(mode);
- fc_get_inf(desc, buffer, true);
- return get_fp_tarval(buffer, mode);
-}
-
void init_mode_values(ir_mode* mode)
{
switch (get_mode_sort(mode)) {
diff --git a/ir/tv/tv_t.h b/ir/tv/tv_t.h
index 5b5e9de..1711bdf 100644
--- a/ir/tv/tv_t.h
+++ b/ir/tv/tv_t.h
@@ -135,8 +135,6 @@ ir_tarval *get_tarval_small(ir_mode *mode);
ir_tarval *get_tarval_epsilon(ir_mode *mode);
-ir_tarval *get_tarval_minus_inf(ir_mode *mode);
-
/**
* Get the @p idx'th bit of the internal representation of the given tarval
* @p tv.