From 788e733664aab69e65bf5d5d228767cf4371f3ab Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Wed, 20 Apr 2011 13:04:23 +0200 Subject: target-i386: fix helper_fbld_ST0() wrt softfloat Reviewed-by: Peter Maydell Signed-off-by: Aurelien Jarno --- target-i386/op_helper.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'target-i386/op_helper.c') diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c index dce28fa054..943d217e6e 100644 --- a/target-i386/op_helper.c +++ b/target-i386/op_helper.c @@ -3920,9 +3920,10 @@ void helper_fbld_ST0(target_ulong ptr) v = ldub(ptr + i); val = (val * 100) + ((v >> 4) * 10) + (v & 0xf); } - tmp = val; - if (ldub(ptr + 9) & 0x80) - tmp = -tmp; + tmp = int64_to_floatx(val, &env->fp_status); + if (ldub(ptr + 9) & 0x80) { + floatx_chs(tmp); + } fpush(); ST0 = tmp; } -- cgit v1.2.3