diff mbox

[v2,4/4] Annotate int2float() as being a pure function.

Message ID 1344706222-3018-4-git-send-email-svfuerst@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Steven Fuerst Aug. 11, 2012, 5:30 p.m. UTC
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 mbox


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);