i965: Fix undefined signed overflow in INTEL_MASK for bitfields of 31 bits.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 22 Jul 2016 04:58:56 +0000 (21:58 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Fri, 26 Aug 2016 01:36:06 +0000 (18:36 -0700)
Most likely we had only ever used this macro on bitfields of less than
31 bits -- That's going to change shortly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_defines.h

index 3d97fda84153d82e2460bb7335b58fa574dde334..f2994cb8ebd0930b2b0d740dd6ec8dbc786fdf31 100644 (file)
@@ -29,7 +29,7 @@
   *   Keith Whitwell <keithw@vmware.com>
   */
 
-#define INTEL_MASK(high, low) (((1<<((high)-(low)+1))-1)<<(low))
+#define INTEL_MASK(high, low) (((1u<<((high)-(low)+1))-1)<<(low))
 /* Using the GNU statement expression extension */
 #define SET_FIELD(value, field)                                         \
    ({                                                                   \