diff options
-rw-r--r-- | orc-test/orctest.c | 6 | ||||
-rw-r--r-- | orc/orcexecutor.c | 8 | ||||
-rw-r--r-- | orc/orcprogram.h | 1 | ||||
-rw-r--r-- | testsuite/show_parse.c | 6 |
4 files changed, 19 insertions, 2 deletions
diff --git a/orc-test/orctest.c b/orc-test/orctest.c index c9b873e..f4a66dc 100644 --- a/orc-test/orctest.c +++ b/orc-test/orctest.c @@ -568,7 +568,11 @@ orc_test_compare_output_full (OrcProgram *program, int flags) orc_array_set_pattern (dest_emul[i], ORC_OOB_VALUE); misalignment++; } else if (program->vars[i].vartype == ORC_VAR_TYPE_PARAM) { - orc_executor_set_param (ex, i, 2); + if (program->vars[i].is_float_param) { + orc_executor_set_param_float (ex, i, 2.0); + } else { + orc_executor_set_param (ex, i, 2); + } } } diff --git a/orc/orcexecutor.c b/orc/orcexecutor.c index df2ed94..fef9e67 100644 --- a/orc/orcexecutor.c +++ b/orc/orcexecutor.c @@ -101,6 +101,14 @@ orc_executor_set_param (OrcExecutor *ex, int var, int value) } void +orc_executor_set_param_float (OrcExecutor *ex, int var, float value) +{ + orc_union32 u; + u.f = value; + ex->params[var] = u.i; +} + +void orc_executor_set_param_str (OrcExecutor *ex, const char *name, int value) { int var; diff --git a/orc/orcprogram.h b/orc/orcprogram.h index 13d56ed..6cbe43b 100644 --- a/orc/orcprogram.h +++ b/orc/orcprogram.h @@ -640,6 +640,7 @@ void orc_executor_set_stride (OrcExecutor *ex, int var, int stride); void orc_executor_set_array_str (OrcExecutor *ex, const char *name, void *ptr); void orc_executor_set_param (OrcExecutor *ex, int var, int value); void orc_executor_set_param_str (OrcExecutor *ex, const char *name, int value); +void orc_executor_set_param_float (OrcExecutor *ex, int var, float value); int orc_executor_get_accumulator (OrcExecutor *ex, int var); int orc_executor_get_accumulator_str (OrcExecutor *ex, const char *name); void orc_executor_set_n (OrcExecutor *ex, int n); diff --git a/testsuite/show_parse.c b/testsuite/show_parse.c index 45ee92d..b932691 100644 --- a/testsuite/show_parse.c +++ b/testsuite/show_parse.c @@ -285,7 +285,11 @@ show (OrcProgram *program) dest[i-ORC_VAR_D1] = orc_array_new (n, m, program->vars[i].size, 0); orc_array_set_pattern (dest[i], ORC_OOB_VALUE); } else if (program->vars[i].vartype == ORC_VAR_TYPE_PARAM) { - orc_executor_set_param (ex, i, 2); + if (program->vars[i].is_float_param) { + orc_executor_set_param_float (ex, i, 2.0); + } else { + orc_executor_set_param (ex, i, 2); + } } } |