aboutsummaryrefslogtreecommitdiff
path: root/target/hppa
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-03-25 13:26:10 -1000
committerRichard Henderson <richard.henderson@linaro.org>2024-05-15 10:03:44 +0200
commit3692ad21f558f1e3425a5d6cecc241d2601db022 (patch)
tree1799cdc5206db6f7dce970118b434ff57f532061 /target/hppa
parentf33a22c1a28f0ba7b9c2fef1953aa6f593da870d (diff)
downloadqemu-3692ad21f558f1e3425a5d6cecc241d2601db022.zip
qemu-3692ad21f558f1e3425a5d6cecc241d2601db022.tar.gz
qemu-3692ad21f558f1e3425a5d6cecc241d2601db022.tar.bz2
target/hppa: Use TCG_COND_TST* in trans_ftest
Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/hppa')
-rw-r--r--target/hppa/translate.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index efd4398..11d74bb 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -4311,6 +4311,8 @@ static bool trans_fcmp_d(DisasContext *ctx, arg_fclass2 *a)
static bool trans_ftest(DisasContext *ctx, arg_ftest *a)
{
+ TCGCond tc = TCG_COND_TSTNE;
+ uint32_t mask;
TCGv_i64 t;
nullify_over(ctx);
@@ -4319,21 +4321,18 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a)
tcg_gen_ld32u_i64(t, tcg_env, offsetof(CPUHPPAState, fr0_shadow));
if (a->y == 1) {
- int mask;
- bool inv = false;
-
switch (a->c) {
case 0: /* simple */
mask = R_FPSR_C_MASK;
break;
case 2: /* rej */
- inv = true;
+ tc = TCG_COND_TSTEQ;
/* fallthru */
case 1: /* acc */
mask = R_FPSR_C_MASK | R_FPSR_CQ_MASK;
break;
case 6: /* rej8 */
- inv = true;
+ tc = TCG_COND_TSTEQ;
/* fallthru */
case 5: /* acc8 */
mask = R_FPSR_C_MASK | R_FPSR_CQ0_6_MASK;
@@ -4351,21 +4350,12 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a)
gen_illegal(ctx);
return true;
}
- if (inv) {
- TCGv_i64 c = tcg_constant_i64(mask);
- tcg_gen_or_i64(t, t, c);
- ctx->null_cond = cond_make_tt(TCG_COND_EQ, t, c);
- } else {
- tcg_gen_andi_i64(t, t, mask);
- ctx->null_cond = cond_make_ti(TCG_COND_EQ, t, 0);
- }
} else {
unsigned cbit = (a->y ^ 1) - 1;
-
- tcg_gen_extract_i64(t, t, R_FPSR_CA0_SHIFT - cbit, 1);
- ctx->null_cond = cond_make_ti(TCG_COND_NE, t, 0);
+ mask = R_FPSR_CA0_MASK >> cbit;
}
+ ctx->null_cond = cond_make_ti(tc, t, mask);
return nullify_end(ctx);
}