All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Fuerst <svfuerst@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Steven Fuerst <svfuerst@gmail.com>
Subject: [Patch v2 4/4] Annotate int2float() as being a pure function.
Date: Sat, 11 Aug 2012 10:30:22 -0700	[thread overview]
Message-ID: <1344706222-3018-4-git-send-email-svfuerst@gmail.com> (raw)
In-Reply-To: <1344706222-3018-1-git-send-email-svfuerst@gmail.com>

This allows gcc to fold duplicate calls into a single call.  Since
the current users do actually call it multiple times with the
same arguments, this is an obvious win.
---
 drivers/gpu/drm/radeon/r600_blit.c         |    2 +-
 drivers/gpu/drm/radeon/r600_blit_shaders.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600_blit.c b/drivers/gpu/drm/radeon/r600_blit.c
index 54980d8..b4304288 100644
--- a/drivers/gpu/drm/radeon/r600_blit.c
+++ b/drivers/gpu/drm/radeon/r600_blit.c
@@ -499,7 +499,7 @@ set_default_state(drm_radeon_private_t *dev_priv)
  * as the fractional bits will not fit in a float.  (It would be better to
  * round towards even as the fpu does, but that is slower.)
  */
-uint32_t int2float(uint32_t x)
+__pure uint32_t int2float(uint32_t x)
 {
 	uint32_t msb, exponent, fraction;
 
diff --git a/drivers/gpu/drm/radeon/r600_blit_shaders.h b/drivers/gpu/drm/radeon/r600_blit_shaders.h
index e17c2cb..2f3ce7a 100644
--- a/drivers/gpu/drm/radeon/r600_blit_shaders.h
+++ b/drivers/gpu/drm/radeon/r600_blit_shaders.h
@@ -35,5 +35,5 @@ extern const u32 r6xx_default_state[];
 extern const u32 r6xx_ps_size, r6xx_vs_size;
 extern const u32 r6xx_default_size, r7xx_default_size;
 
-uint32_t int2float(uint32_t x);
+__pure uint32_t int2float(uint32_t x);
 #endif
-- 
1.7.10.4

  parent reply	other threads:[~2012-08-11 17:31 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 ` Steven Fuerst [this message]
2012-08-14 10:33 ` [Patch v2 1/4] Replace i2f() in r600_blit.c with an optimized version Michel Dänzer

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=1344706222-3018-4-git-send-email-svfuerst@gmail.com \
    --to=svfuerst@gmail.com \
    --cc=dri-devel@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.