dri-devel Archive on 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 v3 3/3] Annotate int2float() as being a pure function.
Date: Wed, 15 Aug 2012 15:07:16 -0700	[thread overview]
Message-ID: <1345068436-19885-3-git-send-email-svfuerst@gmail.com> (raw)
In-Reply-To: <1345068436-19885-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.

Signed-off-by: Steven Fuerst <svfuerst@gmail.com>
---
 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 7d8ac42..661fec2 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-15 22:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-15 22:07 [PATCH v3 1/3] Rename i2f() to int2float(), and make it global so one copy can be removed Steven Fuerst
2012-08-15 22:07 ` [PATCH v3 2/3] Replace int2float() with an optimized version Steven Fuerst
2012-08-15 22:07 ` Steven Fuerst [this message]
2012-08-16  8:00 ` [PATCH v3 1/3] Rename i2f() to int2float(), and make it global so one copy can be removed 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=1345068436-19885-3-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox