i965: fix subnr overflow in suboffset()
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 27 Sep 2016 10:23:44 +0000 (12:23 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Wed, 19 Oct 2016 09:48:21 +0000 (11:48 +0200)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_reg.h

index 3b46d27fcd26b4107c1a7542ac4443615f9d9592..8907c9c5c60e86083759bd7bc1f3fcbbfe5dfb09 100644 (file)
@@ -519,14 +519,6 @@ sechalf(struct brw_reg reg)
    return reg;
 }
 
-static inline struct brw_reg
-suboffset(struct brw_reg reg, unsigned delta)
-{
-   reg.subnr += delta * type_sz(reg.type);
-   return reg;
-}
-
-
 static inline struct brw_reg
 offset(struct brw_reg reg, unsigned delta)
 {
@@ -544,6 +536,11 @@ byte_offset(struct brw_reg reg, unsigned bytes)
    return reg;
 }
 
+static inline struct brw_reg
+suboffset(struct brw_reg reg, unsigned delta)
+{
+   return byte_offset(reg, delta * type_sz(reg.type));
+}
 
 /** Construct unsigned word[16] register */
 static inline struct brw_reg