diff options
author | David Brenken | 2019-06-24 09:03:36 +0200 |
---|---|---|
committer | Bastian Koppelmann | 2019-06-25 12:11:40 +0200 |
commit | 4e6fd2e3ad7b0c1c06902646dab53fb8088d89ec (patch) | |
tree | d600daf2fa4292fc96e9857e0f5a028f258741d4 /target | |
parent | tricore: add FTOIZ instruction (diff) | |
download | qemu-4e6fd2e3ad7b0c1c06902646dab53fb8088d89ec.tar.gz qemu-4e6fd2e3ad7b0c1c06902646dab53fb8088d89ec.tar.xz qemu-4e6fd2e3ad7b0c1c06902646dab53fb8088d89ec.zip |
tricore: add UTOF instruction
Signed-off-by: Andreas Konopik <andreas.konopik@efs-auto.de>
Signed-off-by: David Brenken <david.brenken@efs-auto.de>
Signed-off-by: Georg Hofstetter <georg.hofstetter@efs-auto.de>
Signed-off-by: Robert Rasche <robert.rasche@efs-auto.de>
Signed-off-by: Lars Biermanski <lars.biermanski@efs-auto.de>
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Message-Id: <20190624070339.4408-3-david.brenken@efs-auto.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Diffstat (limited to 'target')
-rw-r--r-- | target/tricore/fpu_helper.c | 16 | ||||
-rw-r--r-- | target/tricore/helper.h | 1 | ||||
-rw-r--r-- | target/tricore/translate.c | 3 |
3 files changed, 20 insertions, 0 deletions
diff --git a/target/tricore/fpu_helper.c b/target/tricore/fpu_helper.c index f079d9e939..432079c8e2 100644 --- a/target/tricore/fpu_helper.c +++ b/target/tricore/fpu_helper.c @@ -303,6 +303,22 @@ uint32_t helper_itof(CPUTriCoreState *env, uint32_t arg) return (uint32_t)f_result; } +uint32_t helper_utof(CPUTriCoreState *env, uint32_t arg) +{ + float32 f_result; + uint32_t flags; + + f_result = uint32_to_float32(arg, &env->fp_status); + + flags = f_get_excp_flags(env); + if (flags) { + f_update_psw_flags(env, flags); + } else { + env->FPU_FS = 0; + } + return (uint32_t)f_result; +} + uint32_t helper_ftoiz(CPUTriCoreState *env, uint32_t arg) { float32 f_arg = make_float32(arg); diff --git a/target/tricore/helper.h b/target/tricore/helper.h index 16b62edf7f..f1a5cb367e 100644 --- a/target/tricore/helper.h +++ b/target/tricore/helper.h @@ -111,6 +111,7 @@ DEF_HELPER_4(fmsub, i32, env, i32, i32, i32) DEF_HELPER_3(fcmp, i32, env, i32, i32) DEF_HELPER_2(ftoi, i32, env, i32) DEF_HELPER_2(itof, i32, env, i32) +DEF_HELPER_2(utof, i32, env, i32) DEF_HELPER_2(ftoiz, i32, env, i32) DEF_HELPER_2(ftouz, i32, env, i32) DEF_HELPER_2(updfl, void, env, i32) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 5e1c4f54b9..bd913d71a1 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -6747,6 +6747,9 @@ static void decode_rr_divide(CPUTriCoreState *env, DisasContext *ctx) case OPC2_32_RR_UPDFL: gen_helper_updfl(cpu_env, cpu_gpr_d[r1]); break; + case OPC2_32_RR_UTOF: + gen_helper_utof(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); + break; case OPC2_32_RR_FTOIZ: gen_helper_ftoiz(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); break; |