From: Iago Toral Quiroga Date: Tue, 27 Sep 2016 10:23:44 +0000 (+0200) Subject: i965: fix subnr overflow in suboffset() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=66d8bd3b7e577b7ae4d0b29186dce95d615e2c40;p=mesa.git i965: fix subnr overflow in suboffset() Reviewed-by: Ian Romanick --- diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h index 3b46d27fcd2..8907c9c5c60 100644 --- a/src/mesa/drivers/dri/i965/brw_reg.h +++ b/src/mesa/drivers/dri/i965/brw_reg.h @@ -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