dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel@daenzer.net>
To: Steven Fuerst <svfuerst@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [Patch v2 1/4] Replace i2f() in r600_blit.c with an optimized version.
Date: Tue, 14 Aug 2012 12:33:29 +0200	[thread overview]
Message-ID: <1344940409.17900.503.camel@thor.local> (raw)
In-Reply-To: <1344706222-3018-1-git-send-email-svfuerst@gmail.com>

On Sam, 2012-08-11 at 10:30 -0700, Steven Fuerst wrote: 
> We use __fls() to find the most significant bit.  Using that, the
> loop can be avoided.  A second trick is to use the behaviour of the
> rotate instructions to expand the range of the unsigned int to float
> conversion to the full 32 bits in a branchless way.
> 
> The routine is now exact up to 2^24.  Above that, we truncate which
> is equivalent to rounding towards zero.
> 
> Signed-off-by: Steven Fuerst <svfuerst@gmail.com>

It might be better to reorder the series to use a shared int2float first
and then optimize that. Either way though, although I haven't really
looked into the floating point encoding aspects, the series is

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer

      parent reply	other threads:[~2012-08-14 10:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-11 17:30 [Patch v2 1/4] Replace i2f() in r600_blit.c with an optimized version Steven Fuerst
2012-08-11 17:30 ` [Patch v2 2/4] Replace i2f() in r600_blit_kms.c " Steven Fuerst
2012-08-11 17:30 ` [Patch v2 3/4] Rename i2f() to int2float(), and make it global so one copy can be removed Steven Fuerst
2012-08-11 17:30 ` [Patch v2 4/4] Annotate int2float() as being a pure function Steven Fuerst
2012-08-14 10:33 ` Michel Dänzer [this message]

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=1344940409.17900.503.camel@thor.local \
    --to=michel@daenzer.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=svfuerst@gmail.com \
    /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