dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/3] Annotate int2float() as being a pure function.
@ 2012-08-06 23:42 Steven Fuerst
  0 siblings, 0 replies; only message in thread
From: Steven Fuerst @ 2012-08-06 23:42 UTC (permalink / raw)
  To: dri-devel; +Cc: Steven Fuerst

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 7c748ba..e3c2d48 100644
--- a/drivers/gpu/drm/radeon/r600_blit.c
+++ b/drivers/gpu/drm/radeon/r600_blit.c
@@ -501,7 +501,7 @@ set_default_state(drm_radeon_private_t *dev_priv)
  * This routine depends on the mod(32) behaviour of the rotate instructions
  * on x86.
  */
-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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-08-06 23:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-06 23:42 [PATCH 4/3] Annotate int2float() as being a pure function Steven Fuerst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox