From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LUdiQ-0006GI-Cw for qemu-devel@nongnu.org; Wed, 04 Feb 2009 04:06:38 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LUdiP-0006Fa-HN for qemu-devel@nongnu.org; Wed, 04 Feb 2009 04:06:37 -0500 Received: from [199.232.76.173] (port=46498 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUdiO-0006FO-Eq for qemu-devel@nongnu.org; Wed, 04 Feb 2009 04:06:37 -0500 Received: from hall.aurel32.net ([88.191.82.174]:36263) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LUdiN-0006gl-RR for qemu-devel@nongnu.org; Wed, 04 Feb 2009 04:06:36 -0500 Date: Wed, 4 Feb 2009 10:06:31 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 06/14] Add v{max,min}fp instructions Message-ID: <20090204090631.GA19995@volta.aurel32.net> References: <1232657054-30100-1-git-send-email-froydnj@codesourcery.com> <1232657054-30100-7-git-send-email-froydnj@codesourcery.com> <20090203195113.GB18984@volta.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20090203195113.GB18984@volta.aurel32.net> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Nathan Froyd On Tue, Feb 03, 2009 at 08:51:13PM +0100, Aurelien Jarno wrote: > On Thu, Jan 22, 2009 at 12:44:06PM -0800, Nathan Froyd wrote: > > > > Signed-off-by: Nathan Froyd > > --- > > target-ppc/helper.h | 2 ++ > > target-ppc/op_helper.c | 19 +++++++++++++++++++ > > target-ppc/translate.c | 2 ++ > > 3 files changed, 23 insertions(+), 0 deletions(-) > > > > diff --git a/target-ppc/helper.h b/target-ppc/helper.h > > index 8c04ba7..ebdeabe 100644 > > --- a/target-ppc/helper.h > > +++ b/target-ppc/helper.h > > @@ -232,6 +232,8 @@ DEF_HELPER_3(vsum2sws, void, avr, avr, avr) > > DEF_HELPER_3(vsum4sbs, void, avr, avr, avr) > > DEF_HELPER_3(vsum4shs, void, avr, avr, avr) > > DEF_HELPER_3(vsum4ubs, void, avr, avr, avr) > > +DEF_HELPER_3(vmaxfp, void, avr, avr, avr) > > +DEF_HELPER_3(vminfp, void, avr, avr, avr) > > > > DEF_HELPER_1(efscfsi, i32, i32) > > DEF_HELPER_1(efscfui, i32, i32) > > diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c > > index 107f977..717bbd4 100644 > > --- a/target-ppc/op_helper.c > > +++ b/target-ppc/op_helper.c > > @@ -2252,6 +2252,25 @@ VMINMAX(uw, u32) > > #undef VMINMAX_DO > > #undef VMINMAX > > > > +#define VMINMAXFP(suffix, relation) \ > > + void helper_v##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ > > + { \ > > + int i; \ > > + for (i = 0; i < ARRAY_SIZE(r->f); i++) { \ > > + HANDLE_NAN2(r->f[i], a->f[i], b->f[i]) { \ > > + int rel = float32_compare_quiet(a->f[i], b->f[i], &env->vec_status); \ > > Given that we only care about lower / greater, I wonder if it would be > better to use float32_lt_quiet and reversing the arguments. > > > + if (rel == relation) { \ > > + r->f[i] = a->f[i]; \ > > + } else { \ > > + r->f[i] = b->f[i]; \ > > + } \ > > + } \ > > + } \ > > + } > > +VMINMAXFP(minfp, float_relation_less) > > +VMINMAXFP(maxfp, float_relation_greater) > > +#undef VMINMAXFP > > + > > void helper_vmladduhm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c) > > { > > int i; > > diff --git a/target-ppc/translate.c b/target-ppc/translate.c > > index 19abec1..35693e0 100644 > > --- a/target-ppc/translate.c > > +++ b/target-ppc/translate.c > > @@ -6395,6 +6395,8 @@ GEN_VXFORM(vsum4sbs, 4, 28); > > GEN_VXFORM(vsum4shs, 4, 25); > > GEN_VXFORM(vsum2sws, 4, 26); > > GEN_VXFORM(vsumsws, 4, 30); > > +GEN_VXFORM(vmaxfp, 5, 10); > > +GEN_VXFORM(vminfp, 5, 11); Note also that those values are wrong. The correct values are 0x10 and 0x11. > > > > #define GEN_VXRFORM1(opname, name, str, opc2, opc3) \ > > GEN_HANDLER2(name, str, 0x4, opc2, opc3, 0x00000000, PPC_ALTIVEC) \ > > -- > > 1.6.0.5 > > > > > > > > > > -- > Aurelien Jarno GPG: 1024D/F1BCDB73 > aurelien@aurel32.net http://www.aurel32.net > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net