diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-01 22:12:06 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-01 22:12:06 +0000 |
commit | 7fdf924fdd970a78862e3b9367c91e27a9fbf648 (patch) | |
tree | 2ccde651c6617c4ca5c1a62e50f7aeca73c3d01b /target-sh4 | |
parent | cc4ba6a9826d94bb46f13856927f7883fd6b9d51 (diff) |
SH4: final conversion to TCG
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5125 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sh4')
-rw-r--r-- | target-sh4/helper.h | 1 | ||||
-rw-r--r-- | target-sh4/op.c | 27 | ||||
-rw-r--r-- | target-sh4/op_helper.c | 6 | ||||
-rw-r--r-- | target-sh4/translate.c | 8 |
4 files changed, 14 insertions, 28 deletions
diff --git a/target-sh4/helper.h b/target-sh4/helper.h index 19f5981e6b..994dc0820d 100644 --- a/target-sh4/helper.h +++ b/target-sh4/helper.h @@ -37,6 +37,7 @@ DEF_HELPER(uint32_t, helper_float_FT, (uint32_t)) DEF_HELPER(uint64_t, helper_float_DT, (uint32_t)) DEF_HELPER(uint32_t, helper_fmul_FT, (uint32_t, uint32_t)) DEF_HELPER(uint64_t, helper_fmul_DT, (uint64_t, uint64_t)) +DEF_HELPER(uint32_t, helper_fneg_T, (uint32_t)) DEF_HELPER(uint32_t, helper_fsub_FT, (uint32_t, uint32_t)) DEF_HELPER(uint64_t, helper_fsub_DT, (uint64_t, uint64_t)) DEF_HELPER(uint32_t, helper_fsqrt_FT, (uint32_t)) diff --git a/target-sh4/op.c b/target-sh4/op.c deleted file mode 100644 index 02d86fe768..0000000000 --- a/target-sh4/op.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * SH4 emulation - * - * Copyright (c) 2005 Samuel Tardieu - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include "exec.h" - -void OPPROTO op_fneg_frN(void) -{ - env->fregs[PARAM1] = float32_chs(env->fregs[PARAM1]); - RETURN(); -} - diff --git a/target-sh4/op_helper.c b/target-sh4/op_helper.c index 5d9c4146af..48a170f79c 100644 --- a/target-sh4/op_helper.c +++ b/target-sh4/op_helper.c @@ -489,6 +489,12 @@ uint64_t helper_fmul_DT(uint64_t t0, uint64_t t1) return *(uint64_t*)(&ret); } +uint32_t helper_fneg_T(uint32_t t0) +{ + float32 ret = float32_chs(*(float32*)&t0); + return *(uint32_t*)(&ret); +} + uint32_t helper_fsqrt_FT(uint32_t t0) { float32 ret = float32_sqrt(*(float32*)&t0, &env->fp_status); diff --git a/target-sh4/translate.c b/target-sh4/translate.c index 30362a8f19..ff43882796 100644 --- a/target-sh4/translate.c +++ b/target-sh4/translate.c @@ -1593,7 +1593,13 @@ void _decode_opc(DisasContext * ctx) } return; case 0xf04d: /* fneg FRn/DRn - FPSCR: Nothing */ - gen_op_fneg_frN(FREG(B11_8)); + { + TCGv fp = tcg_temp_new(TCG_TYPE_I32); + gen_load_fpr32(fp, FREG(B11_8)); + tcg_gen_helper_1_1(helper_fneg_T, fp, fp); + gen_store_fpr32(fp, FREG(B11_8)); + tcg_temp_free(fp); + } return; case 0xf05d: /* fabs FRn/DRn */ if (ctx->fpscr & FPSCR_PR) { |