Commit 7fdf924fdd970a78862e3b9367c91e27a9fbf648
1 parent
cc4ba6a9
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
Showing
5 changed files
with
14 additions
and
30 deletions
configure
| @@ -1427,10 +1427,8 @@ case "$target_cpu" in | @@ -1427,10 +1427,8 @@ case "$target_cpu" in | ||
| 1427 | ;; | 1427 | ;; |
| 1428 | sh4|sh4eb) | 1428 | sh4|sh4eb) |
| 1429 | echo "TARGET_ARCH=sh4" >> $config_mak | 1429 | echo "TARGET_ARCH=sh4" >> $config_mak |
| 1430 | - echo "CONFIG_DYNGEN_OP=yes" >> $config_mak | ||
| 1431 | echo "#define TARGET_ARCH \"sh4\"" >> $config_h | 1430 | echo "#define TARGET_ARCH \"sh4\"" >> $config_h |
| 1432 | echo "#define TARGET_SH4 1" >> $config_h | 1431 | echo "#define TARGET_SH4 1" >> $config_h |
| 1433 | - echo "#define CONFIG_DYNGEN_OP 1" >> $config_h | ||
| 1434 | bflt="yes" | 1432 | bflt="yes" |
| 1435 | ;; | 1433 | ;; |
| 1436 | sparc) | 1434 | sparc) |
target-sh4/helper.h
| @@ -37,6 +37,7 @@ DEF_HELPER(uint32_t, helper_float_FT, (uint32_t)) | @@ -37,6 +37,7 @@ DEF_HELPER(uint32_t, helper_float_FT, (uint32_t)) | ||
| 37 | DEF_HELPER(uint64_t, helper_float_DT, (uint32_t)) | 37 | DEF_HELPER(uint64_t, helper_float_DT, (uint32_t)) |
| 38 | DEF_HELPER(uint32_t, helper_fmul_FT, (uint32_t, uint32_t)) | 38 | DEF_HELPER(uint32_t, helper_fmul_FT, (uint32_t, uint32_t)) |
| 39 | DEF_HELPER(uint64_t, helper_fmul_DT, (uint64_t, uint64_t)) | 39 | DEF_HELPER(uint64_t, helper_fmul_DT, (uint64_t, uint64_t)) |
| 40 | +DEF_HELPER(uint32_t, helper_fneg_T, (uint32_t)) | ||
| 40 | DEF_HELPER(uint32_t, helper_fsub_FT, (uint32_t, uint32_t)) | 41 | DEF_HELPER(uint32_t, helper_fsub_FT, (uint32_t, uint32_t)) |
| 41 | DEF_HELPER(uint64_t, helper_fsub_DT, (uint64_t, uint64_t)) | 42 | DEF_HELPER(uint64_t, helper_fsub_DT, (uint64_t, uint64_t)) |
| 42 | DEF_HELPER(uint32_t, helper_fsqrt_FT, (uint32_t)) | 43 | DEF_HELPER(uint32_t, helper_fsqrt_FT, (uint32_t)) |
target-sh4/op.c deleted
100644 → 0
| 1 | -/* | ||
| 2 | - * SH4 emulation | ||
| 3 | - * | ||
| 4 | - * Copyright (c) 2005 Samuel Tardieu | ||
| 5 | - * | ||
| 6 | - * This library is free software; you can redistribute it and/or | ||
| 7 | - * modify it under the terms of the GNU Lesser General Public | ||
| 8 | - * License as published by the Free Software Foundation; either | ||
| 9 | - * version 2 of the License, or (at your option) any later version. | ||
| 10 | - * | ||
| 11 | - * This library is distributed in the hope that it will be useful, | ||
| 12 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 14 | - * Lesser General Public License for more details. | ||
| 15 | - * | ||
| 16 | - * You should have received a copy of the GNU Lesser General Public | ||
| 17 | - * License along with this library; if not, write to the Free Software | ||
| 18 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | - */ | ||
| 20 | -#include "exec.h" | ||
| 21 | - | ||
| 22 | -void OPPROTO op_fneg_frN(void) | ||
| 23 | -{ | ||
| 24 | - env->fregs[PARAM1] = float32_chs(env->fregs[PARAM1]); | ||
| 25 | - RETURN(); | ||
| 26 | -} | ||
| 27 | - |
target-sh4/op_helper.c
| @@ -489,6 +489,12 @@ uint64_t helper_fmul_DT(uint64_t t0, uint64_t t1) | @@ -489,6 +489,12 @@ uint64_t helper_fmul_DT(uint64_t t0, uint64_t t1) | ||
| 489 | return *(uint64_t*)(&ret); | 489 | return *(uint64_t*)(&ret); |
| 490 | } | 490 | } |
| 491 | 491 | ||
| 492 | +uint32_t helper_fneg_T(uint32_t t0) | ||
| 493 | +{ | ||
| 494 | + float32 ret = float32_chs(*(float32*)&t0); | ||
| 495 | + return *(uint32_t*)(&ret); | ||
| 496 | +} | ||
| 497 | + | ||
| 492 | uint32_t helper_fsqrt_FT(uint32_t t0) | 498 | uint32_t helper_fsqrt_FT(uint32_t t0) |
| 493 | { | 499 | { |
| 494 | float32 ret = float32_sqrt(*(float32*)&t0, &env->fp_status); | 500 | float32 ret = float32_sqrt(*(float32*)&t0, &env->fp_status); |
target-sh4/translate.c
| @@ -1593,7 +1593,13 @@ void _decode_opc(DisasContext * ctx) | @@ -1593,7 +1593,13 @@ void _decode_opc(DisasContext * ctx) | ||
| 1593 | } | 1593 | } |
| 1594 | return; | 1594 | return; |
| 1595 | case 0xf04d: /* fneg FRn/DRn - FPSCR: Nothing */ | 1595 | case 0xf04d: /* fneg FRn/DRn - FPSCR: Nothing */ |
| 1596 | - gen_op_fneg_frN(FREG(B11_8)); | 1596 | + { |
| 1597 | + TCGv fp = tcg_temp_new(TCG_TYPE_I32); | ||
| 1598 | + gen_load_fpr32(fp, FREG(B11_8)); | ||
| 1599 | + tcg_gen_helper_1_1(helper_fneg_T, fp, fp); | ||
| 1600 | + gen_store_fpr32(fp, FREG(B11_8)); | ||
| 1601 | + tcg_temp_free(fp); | ||
| 1602 | + } | ||
| 1597 | return; | 1603 | return; |
| 1598 | case 0xf05d: /* fabs FRn/DRn */ | 1604 | case 0xf05d: /* fabs FRn/DRn */ |
| 1599 | if (ctx->fpscr & FPSCR_PR) { | 1605 | if (ctx->fpscr & FPSCR_PR) { |