From 7f7fafa6a1b6a295827ea9a8e7d19124e1ad243f Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sun, 5 Sep 2010 23:52:46 -0700 Subject: [PATCH] c: Fix convdf opcode --- orc/orcemulateopcodes.c | 4 +++- orc/orcprogram-c.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/orc/orcemulateopcodes.c b/orc/orcemulateopcodes.c index 7ccf40e..75abf57 100644 --- a/orc/orcemulateopcodes.c +++ b/orc/orcemulateopcodes.c @@ -4820,8 +4820,10 @@ emulate_convdf (OrcOpcodeExecutor *ex, int offset, int n) /* 1: convdf */ { orc_union64 _src1; + orc_union32 _dest; _src1.i = ORC_DENORMAL_DOUBLE(var32.i); - var33.f = _src1.f; + _dest.f = _src1.f; + var33.i = ORC_DENORMAL(_dest.i); } /* 2: storel */ ptr0[i] = var33; diff --git a/orc/orcprogram-c.c b/orc/orcprogram-c.c index 83c65c8..f084b75 100644 --- a/orc/orcprogram-c.c +++ b/orc/orcprogram-c.c @@ -1141,13 +1141,15 @@ c_rule_convdf (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40]; - c_get_name_float (dest, p, insn, insn->dest_args[0]); + c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union64 _src1;\n"); + ORC_ASM_CODE(p," orc_union32 _dest;\n"); ORC_ASM_CODE(p," _src1.i = ORC_DENORMAL_DOUBLE(%s);\n", src1); - ORC_ASM_CODE(p," %s = _src1.f;\n", dest); + ORC_ASM_CODE(p," _dest.f = _src1.f;\n"); + ORC_ASM_CODE(p," %s = ORC_DENORMAL(_dest.i);\n", dest); ORC_ASM_CODE(p, " }\n"); } -- 2.7.4