From: Matt Turner Date: Thu, 13 Mar 2014 18:21:36 +0000 (-0700) Subject: i965/vec4: Add is_null() method to dst_reg. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=10dd6eca89951e0cb40e21c3b53caa33d8fcb383;p=mesa.git i965/vec4: Add is_null() method to dst_reg. Reviewed-by: Eric Anholt --- diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp index 702b182c579..62c2314fece 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp @@ -212,6 +212,14 @@ dst_reg::dst_reg(src_reg reg) this->fixed_hw_reg = reg.fixed_hw_reg; } +bool +dst_reg::is_null() const +{ + return file == HW_REG && + fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE && + fixed_hw_reg.nr == BRW_ARF_NULL; +} + bool vec4_instruction::is_send_from_grf() { diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h index 5e5ef036a66..159a5bdfbbb 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.h +++ b/src/mesa/drivers/dri/i965/brw_vec4.h @@ -194,6 +194,8 @@ public: explicit dst_reg(src_reg reg); + bool is_null() const; + int writemask; /**< Bitfield of WRITEMASK_[XYZW] */ src_reg *reladdr;