virtualization/app-emulation/qemu/files/0.14.1/0017-S-390-build-fix.patch

130 lines
5.6 KiB
Diff

From 024f781ab4af31ba5e14882b5661d4586ae26988 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Wed, 9 Feb 2011 18:35:21 +0100
Subject: [PATCH 17/17] S/390 build fix
---
target-s390x/op_helper.c | 22 +++++++++++-----------
target-s390x/translate.c | 2 +-
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/target-s390x/op_helper.c b/target-s390x/op_helper.c
index 20c83c5..46b71fc 100644
--- a/target-s390x/op_helper.c
+++ b/target-s390x/op_helper.c
@@ -738,7 +738,7 @@ uint32_t HELPER(tmxx)(uint64_t val, uint32_t mask)
uint32_t HELPER(abs_i32)(uint32_t reg, int32_t val)
{
uint32_t cc;
- if (val == 0x80000000UL) cc = 3;
+ if ((uint32_t)val == 0x80000000UL) cc = 3;
else if (val) cc = 1;
else cc = 0;
@@ -996,7 +996,7 @@ uint32_t HELPER(slbg)(uint32_t cc, uint32_t r1, uint64_t v1, uint64_t v2)
/* condition codes for binary FP ops */
static uint32_t set_cc_f32(float32 v1, float32 v2)
{
- if (float32_is_nan(v1) || float32_is_nan(v2)) return 3;
+ if (float32_is_any_nan(v1) || float32_is_any_nan(v2)) return 3;
else if (float32_eq(v1, v2, &env->fpu_status)) return 0;
else if (float32_lt(v1, v2, &env->fpu_status)) return 1;
else return 2;
@@ -1004,7 +1004,7 @@ static uint32_t set_cc_f32(float32 v1, float32 v2)
static uint32_t set_cc_f64(float64 v1, float64 v2)
{
- if (float64_is_nan(v1) || float64_is_nan(v2)) return 3;
+ if (float64_is_any_nan(v1) || float64_is_any_nan(v2)) return 3;
else if (float64_eq(v1, v2, &env->fpu_status)) return 0;
else if (float64_lt(v1, v2, &env->fpu_status)) return 1;
else return 2;
@@ -1013,7 +1013,7 @@ static uint32_t set_cc_f64(float64 v1, float64 v2)
/* condition codes for unary FP ops */
static uint32_t set_cc_nz_f32(float32 v)
{
- if (float32_is_nan(v)) return 3;
+ if (float32_is_any_nan(v)) return 3;
else if (float32_is_zero(v)) return 0;
else if (float32_is_neg(v)) return 1;
else return 2;
@@ -1021,7 +1021,7 @@ static uint32_t set_cc_nz_f32(float32 v)
static uint32_t set_cc_nz_f64(float64 v)
{
- if (float64_is_nan(v)) return 3;
+ if (float64_is_any_nan(v)) return 3;
else if (float64_is_zero(v)) return 0;
else if (float64_is_neg(v)) return 1;
else return 2;
@@ -1029,7 +1029,7 @@ static uint32_t set_cc_nz_f64(float64 v)
static uint32_t set_cc_nz_f128(float128 v)
{
- if (float128_is_nan(v)) return 3;
+ if (float128_is_any_nan(v)) return 3;
else if (float128_is_zero(v)) return 0;
else if (float128_is_neg(v)) return 1;
else return 2;
@@ -1350,7 +1350,7 @@ uint32_t HELPER(cxbr)(uint32_t f1, uint32_t f2)
CPU_QuadU v2;
v2.ll.upper = env->fregs[f2].ll;
v2.ll.lower = env->fregs[f2 + 2].ll;
- if (float128_is_nan(v1.q) || float128_is_nan(v2.q)) return 3;
+ if (float128_is_any_nan(v1.q) || float128_is_any_nan(v2.q)) return 3;
else if (float128_eq(v1.q, v2.q, &env->fpu_status)) return 0;
else if (float128_lt(v1.q, v2.q, &env->fpu_status)) return 1;
else return 2;
@@ -1463,7 +1463,7 @@ uint32_t HELPER(cgxbr)(uint32_t r1, uint32_t f2, uint32_t m3)
v2.ll.lower = env->fregs[f2 + 2].ll;
set_round_mode(m3);
env->regs[r1] = float128_to_int64(v2.q, &env->fpu_status);
- if (float128_is_nan(v2.q)) return 3;
+ if (float128_is_any_nan(v2.q)) return 3;
else if (float128_is_zero(v2.q)) return 0;
else if (float128_is_neg(v2.q)) return 1;
else return 2;
@@ -1611,7 +1611,7 @@ uint32_t HELPER(tceb)(uint32_t f1, uint64_t m2)
HELPER_LOG("%s: v1 0x%lx m2 0x%lx neg %d\n", __FUNCTION__, v1, m2, neg);
if (float32_is_zero(v1) && (m2 & (1 << (11-neg)))) cc = 1;
else if (float32_is_infinity(v1) && (m2 & (1 << (5-neg)))) cc = 1;
- else if (float32_is_nan(v1) && (m2 & (1 << (3-neg)))) cc = 1;
+ else if (float32_is_quiet_nan(v1) && (m2 & (1 << (3-neg)))) cc = 1;
else if (float32_is_signaling_nan(v1) && (m2 & (1 << (1-neg)))) cc = 1;
else /* assume normalized number */ if (m2 & (1 << (9-neg))) cc = 1;
/* FIXME: denormalized? */
@@ -1627,7 +1627,7 @@ uint32_t HELPER(tcdb)(uint32_t f1, uint64_t m2)
HELPER_LOG("%s: v1 0x%lx m2 0x%lx neg %d\n", __FUNCTION__, v1, m2, neg);
if (float64_is_zero(v1) && (m2 & (1 << (11-neg)))) cc = 1;
else if (float64_is_infinity(v1) && (m2 & (1 << (5-neg)))) cc = 1;
- else if (float64_is_nan(v1) && (m2 & (1 << (3-neg)))) cc = 1;
+ else if (float64_is_quiet_nan(v1) && (m2 & (1 << (3-neg)))) cc = 1;
else if (float64_is_signaling_nan(v1) && (m2 & (1 << (1-neg)))) cc = 1;
else /* assume normalized number */ if (m2 & (1 << (9-neg))) cc = 1;
/* FIXME: denormalized? */
@@ -1645,7 +1645,7 @@ uint32_t HELPER(tcxb)(uint32_t f1, uint64_t m2)
int neg = float128_is_neg(v1.q);
if (float128_is_zero(v1.q) && (m2 & (1 << (11-neg)))) cc = 1;
else if (float128_is_infinity(v1.q) && (m2 & (1 << (5-neg)))) cc = 1;
- else if (float128_is_nan(v1.q) && (m2 & (1 << (3-neg)))) cc = 1;
+ else if (float128_is_quiet_nan(v1.q) && (m2 & (1 << (3-neg)))) cc = 1;
else if (float128_is_signaling_nan(v1.q) && (m2 & (1 << (1-neg)))) cc = 1;
else /* assume normalized number */ if (m2 & (1 << (9-neg))) cc = 1;
/* FIXME: denormalized? */
diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index e08dcf4..189a60b 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -67,7 +67,7 @@ void cpu_dump_state(CPUState *env, FILE *f, fprintf_function cpu_fprintf,
}
}
for (i = 0; i < 16; i++) {
- cpu_fprintf(f, "F%02d=%016lx", i, (long)env->fregs[i].i);
+ cpu_fprintf(f, "F%02d=%016lx", i, (long)env->fregs[i].ll);
if ((i % 4) == 3) {
cpu_fprintf(f, "\n");
} else {
--
1.7.1