diff options
author | Matt Turner <[email protected]> | 2015-07-12 00:13:45 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2015-07-29 09:34:51 -0700 |
commit | c1da15709a0c0c2775bd9e534f67c60f7dc95ce8 (patch) | |
tree | 67fa5a5d7ad58315d8ca012239f5a83e74fd668d /src/mesa/drivers/dri/i965/brw_util.h | |
parent | c67ce2bd3b27a26d7f5665f296d307c0de39b720 (diff) |
i965: Use float calculations when double is unnecessary.
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
Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_util.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_util.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_util.h b/src/mesa/drivers/dri/i965/brw_util.h index 04e4e944118..68f4318d371 100644 --- a/src/mesa/drivers/dri/i965/brw_util.h +++ b/src/mesa/drivers/dri/i965/brw_util.h @@ -53,14 +53,14 @@ brw_get_line_width(struct brw_context *brw) float line_width = CLAMP(!brw->ctx.Multisample._Enabled && !brw->ctx.Line.SmoothFlag ? roundf(brw->ctx.Line.Width) : brw->ctx.Line.Width, - 0.0, brw->ctx.Const.MaxLineWidth); + 0.0f, brw->ctx.Const.MaxLineWidth); uint32_t line_width_u3_7 = U_FIXED(line_width, 7); /* Line width of 0 is not allowed when MSAA enabled */ if (brw->ctx.Multisample._Enabled) { if (line_width_u3_7 == 0) line_width_u3_7 = 1; - } else if (brw->ctx.Line.SmoothFlag && line_width < 1.5) { + } else if (brw->ctx.Line.SmoothFlag && line_width < 1.5f) { /* For 1 pixel line thickness or less, the general * anti-aliasing algorithm gives up, and a garbage line is * generated. Setting a Line Width of 0.0 specifies the |