Received: from eggs.gnu.org ([2001:4830:134:3::10]:42629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uljhh-0005bz-DG for qemu-devel@nongnu.org; Sun, 09 Jun 2013 13:46:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uljhg-0005LN-7I for qemu-devel@nongnu.org; Sun, 09 Jun 2013 13:46:57 -0400 Received: from smtprelay02.ispgateway.de ([80.67.18.14]:43622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uljhf-0005L2-Tl for qemu-devel@nongnu.org; Sun, 09 Jun 2013 13:46:56 -0400 Received: from [217.84.5.141] (helo=stokes.schwinge.homeip.net) by smtprelay02.ispgateway.de with esmtpa (Exim 4.68) (envelope-from ) id 1Uljhd-0000Jk-Rs for qemu-devel@nongnu.org; Sun, 09 Jun 2013 19:46:54 +0200 From: Thomas Schwinge In-Reply-To: <1360521050-29680-7-git-send-email-rth@twiddle.net> References: <1360521050-29680-1-git-send-email-rth@twiddle.net> <1360521050-29680-7-git-send-email-rth@twiddle.net> Date: Sun, 09 Jun 2013 19:46:29 +0200 Message-ID: <87vc5nxjm2.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Subject: [Qemu-devel] [PATCH] target-mips: 64-bit FPU for user-mode emulation. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, riku.voipio@iki.fi, macro@codesourcery.com, aurelien@aurel32.net --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Switch to 64-bit FPU only for n32 and n64 ABIs, but not o32. Fixup for commit 68473f15d4c9948986618f63828825beafcaf1cf. Signed-off-by: Thomas Schwinge =2D-- Hi! On Sun, 10 Feb 2013 10:30:46 -0800, Richard Henderson wro= te: > diff --git a/target-mips/translate.c b/target-mips/translate.c > index 3b77b53..b3b8dc6 100644 > --- a/target-mips/translate.c > +++ b/target-mips/translate.c > @@ -15972,6 +15972,14 @@ void cpu_state_reset(CPUMIPSState *env) >=20=20 > #if defined(CONFIG_USER_ONLY) > env->CP0_Status =3D (MIPS_HFLAG_UM << CP0St_KSU); > +# ifdef TARGET_MIPS64 > + /* Enable 64-bit register mode. */ > + env->CP0_Status |=3D (1 << CP0St_PX); > +# endif > +# ifdef TARGET_ABI_MIPSN64 > + /* Enable 64-bit address mode. */ > + env->CP0_Status |=3D (1 << CP0St_UX); > +# endif > /* Enable access to the CPUNum, SYNCI_Step, CC, and CCRes RDHWR > hardware registers. */ > env->CP0_HWREna |=3D 0x0000000F; > @@ -15981,6 +15989,11 @@ void cpu_state_reset(CPUMIPSState *env) > if (env->CP0_Config3 & (1 << CP0C3_DSPP)) { > env->CP0_Status |=3D (1 << CP0St_MX); > } > + /* Enable 64-bit FPU if the target cpu supports it. */ > + env->active_fpu.fcr0 =3D env->cpu_model->CP1_fcr0; > + if (env->active_fpu.fcr0 & (1 << FCR0_F64)) { > + env->CP0_Status |=3D (1 << CP0St_FR); > + } > #else > if (env->hflags & MIPS_HFLAG_BMASK) { > /* If the exception was raised from a delay slot, In my reading of the relevant documents, the latter change is not correct for o32, and empirically has "interesting" effects on the glibc math testsuite, for example. Keeping the FR register unset for o32 I'm proposing to fix with the following patch: =2D-- target-mips/translate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git target-mips/translate.c target-mips/translate.c index 0a53203..51837d4 100644 =2D-- target-mips/translate.c +++ target-mips/translate.c @@ -15962,10 +15962,12 @@ void cpu_state_reset(CPUMIPSState *env) if (env->CP0_Config3 & (1 << CP0C3_DSPP)) { env->CP0_Status |=3D (1 << CP0St_MX); } =2D /* Enable 64-bit FPU if the target cpu supports it. */ +# if defined(TARGET_ABI_MIPSN32) || defined(TARGET_ABI_MIPSN64) + /* Enable 64-bit FPU if the target CPU supports it. */ if (env->active_fpu.fcr0 & (1 << FCR0_F64)) { env->CP0_Status |=3D (1 << CP0St_FR); } +# endif #else if (env->hflags & MIPS_HFLAG_BMASK) { /* If the exception was raised from a delay slot, Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBAgAGBQJRtL91AAoJEGe3hdm9kOiiymsH/i8uwqai+Q0pREId6oyxiwG2 z8oKpK7QU2wOJjC4Cau5wsP5q6eTrLougvLIKVwSpBsVOp1TTzii9DaaQZj4O/yH FzmcDaGBtWJ0xQ6gTUizsGiEmb18hB1+moJjNWMIDx6whPeimm21uOYgaYbCsYIT Jx2vZFUMLAZgYkBLucJ+HPpZJmwHtI0G9aP6YDTWOYsqe16/EQQlyCMXqCDwFIiH TvZOs2p1vhcwbGbXTTGmaTzDBMG2ha2BIShLRHyMFVeBm/jsSn6S36Q2p1DcWcvg Pcrn6N8h8P1xuA2mcYL7VVzjAIquqvxfDeLn5qF0NBWnvN/4UhKS3VfLHqW50sM= =Z9y5 -----END PGP SIGNATURE----- --=-=-=--