From: Vince Weaver <vince@csl.cornell.edu>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] sparc 64-bit fsr problem
Date: Fri, 29 Aug 2008 16:03:15 -0400 (EDT) [thread overview]
Message-ID: <20080829160107.N71741@stanley.csl.cornell.edu> (raw)
In-Reply-To: <20080828172114.V64752@stanley.csl.cornell.edu>
> I've attempted to fix this myself but I am having trouble trying to get the
> gen_mov_reg_FCC0() and gen_mov_reg_FCC1() functions in
> target-sparc/translate.c to use 64-bit shifts.
I've managed to get things working, at least enough to run equake from the
spec2k benchmarks. The patch is below.
Vince
--- op_helper.c.orig 2008-08-28 17:25:22.000000000 -0400
+++ op_helper.c 2008-08-28 17:27:42.000000000 -0400
@@ -746,10 +746,10 @@
{ \
target_ulong new_fsr; \
\
- env->fsr &= ~((FSR_FCC1 | FSR_FCC0) << FS); \
+ env->fsr &= ~((target_ulong) (FSR_FCC1 | FSR_FCC0) << FS); \
switch (glue(size, _compare) (reg1, reg2, &env->fp_status)) { \
case float_relation_unordered: \
- new_fsr = (FSR_FCC1 | FSR_FCC0) << FS; \
+ new_fsr = (target_ulong)(FSR_FCC1 | FSR_FCC0) << FS; \
if ((env->fsr & FSR_NVM) || TRAP) { \
env->fsr |= new_fsr; \
env->fsr |= FSR_NVC; \
@@ -760,10 +760,10 @@
} \
break; \
case float_relation_less: \
- new_fsr = FSR_FCC0 << FS; \
+ new_fsr = (target_ulong)FSR_FCC0 << FS; \
break; \
case float_relation_greater: \
- new_fsr = FSR_FCC1 << FS; \
+ new_fsr = (target_ulong)FSR_FCC1 << FS; \
break; \
default: \
new_fsr = 0; \
--- translate.c.orig 2008-08-29 15:59:15.000000000 -0400
+++ translate.c 2008-08-29 15:59:57.000000000 -0400
@@ -999,7 +999,7 @@
static inline void gen_mov_reg_FCC0(TCGv reg, TCGv src,
unsigned int fcc_offset)
{
- tcg_gen_extu_i32_tl(reg, src);
+ tcg_gen_mov_tl(reg, src);
tcg_gen_shri_tl(reg, reg, FSR_FCC0_SHIFT + fcc_offset);
tcg_gen_andi_tl(reg, reg, 0x1);
}
@@ -1007,7 +1007,7 @@
static inline void gen_mov_reg_FCC1(TCGv reg, TCGv src,
unsigned int fcc_offset)
{
- tcg_gen_extu_i32_tl(reg, src);
+ tcg_gen_mov_tl(reg, src);
tcg_gen_shri_tl(reg, reg, FSR_FCC1_SHIFT + fcc_offset);
tcg_gen_andi_tl(reg, reg, 0x1);
}
next prev parent reply other threads:[~2008-08-29 20:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-28 21:32 [Qemu-devel] sparc 64-bit fsr problem Vince Weaver
2008-08-29 20:03 ` Vince Weaver [this message]
2008-08-29 20:31 ` Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080829160107.N71741@stanley.csl.cornell.edu \
--to=vince@csl.cornell.edu \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).