From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TESJ5-0007vt-E3 for qemu-devel@nongnu.org; Wed, 19 Sep 2012 17:59:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TESJ4-0004Ei-HX for qemu-devel@nongnu.org; Wed, 19 Sep 2012 17:59:43 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:46127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TESJ4-0004EV-B9 for qemu-devel@nongnu.org; Wed, 19 Sep 2012 17:59:42 -0400 Received: by padfb10 with SMTP id fb10so58710pad.4 for ; Wed, 19 Sep 2012 14:59:41 -0700 (PDT) Sender: Richard Henderson Message-ID: <505A404B.8050303@twiddle.net> Date: Wed, 19 Sep 2012 14:59:39 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1348014239-6233-1-git-send-email-jcmvbkbc@gmail.com> <1348014239-6233-9-git-send-email-jcmvbkbc@gmail.com> In-Reply-To: <1348014239-6233-9-git-send-email-jcmvbkbc@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 08/10] target-xtensa: implement FP0 conversions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Filippov Cc: Blue Swirl , Peter Maydell , qemu-devel@nongnu.org On 09/18/2012 05:23 PM, Max Filippov wrote: > +uint32_t HELPER(ftoi)(float32 v, uint32_t rounding_mode, uint32_t scale) > +{ > + float_status fp_status = {0}; > + > + set_float_rounding_mode(rounding_mode, &fp_status); > + return float32_to_int32( > + float32_scalbn(v, scale, &fp_status), &fp_status); > +} > + > +uint32_t HELPER(ftoui)(float32 v, uint32_t rounding_mode, uint32_t scale) > +{ > + float_status fp_status = {0}; > + float32 res; > + > + set_float_rounding_mode(rounding_mode, &fp_status); > + > + res = float32_scalbn(v, scale, &fp_status); > + > + if (float32_is_neg(v) && !float32_is_any_nan(v)) { > + return float32_to_int32(res, &fp_status); > + } else { > + return float32_to_uint32(res, &fp_status); > + } > +} Are you really intending to discard any exceptions raised here? r~