Skip to content

Commit

Permalink
Annotate int2float() as being a pure function.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Fuerst authored and Alex Deucher committed Sep 20, 2012
1 parent 747f49b commit 9e9eb7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/r600_blit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/r600_blit_shaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9e9eb7c

Please sign in to comment.