i965: Use float calculations when double is unnecessary

Graphics / Mesa 3D Graphics Library / Mesa - Matt Turner [gmail.com] - 29 July 2015 11:34 UTC

Literals without an f/F suffix are of type double, and implicit conversion rules specify that the float in (float op double) be converted to a double before the operation is performed. I believe float execution was intended (in nearly all cases) or is sufficient (in the case of gen7_urb.c).

Removes a lot of float <-> double conversion instructions and replaces many double instructions with float instructions which are cheaper.

text data bss dec hex filename 4928659 195160 26192 5150011 4e953b i965_dri.so before 4928315 195152 26192 5149659 4e93db i965_dri.so after

c1da157 i965: Use float calculations when double is unnecessary.
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 22 ++++++++++----------
src/mesa/drivers/dri/i965/brw_fs.cpp | 4 ++--
src/mesa/drivers/dri/i965/brw_meta_fast_clear.c | 4 ++--
src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c | 4 ++--
src/mesa/drivers/dri/i965/brw_misc_state.c | 4 ++--
src/mesa/drivers/dri/i965/brw_sampler_state.c | 4 ++--
src/mesa/drivers/dri/i965/brw_sf_state.c | 9 ++++----
src/mesa/drivers/dri/i965/brw_state_cache.c | 2 +-
src/mesa/drivers/dri/i965/brw_util.h | 4 ++--
src/mesa/drivers/dri/i965/gen6_multisample_state.c | 4 ++--
src/mesa/drivers/dri/i965/gen6_sf_state.c | 2 +-
src/mesa/drivers/dri/i965/gen7_sf_state.c | 2 +-
src/mesa/drivers/dri/i965/gen7_urb.c | 2 +-
src/mesa/drivers/dri/i965/gen8_sf_state.c | 2 +-
14 files changed, 35 insertions(+), 34 deletions(-)

Upstream: cgit.freedesktop.org


  • Share