[Mesa-dev] [PATCH 3/5] i965: Move some asserts to unreachable.

Ian Romanick idr at freedesktop.org
Wed Feb 11 16:49:16 PST 2015


On 02/11/2015 04:42 PM, Eric Anholt wrote:
> If execution was supposed to be supported in this case, we'd run into
> trouble from completely uninitialized sat_imm values.  Shuts up compiler
> warnings.
> ---
>  src/mesa/drivers/dri/i965/brw_shader.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
> index 3eea088..c758f77 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
> @@ -607,10 +607,10 @@ brw_saturate_immediate(enum brw_reg_type type, struct brw_reg *reg)
>     case BRW_REGISTER_TYPE_V:
>     case BRW_REGISTER_TYPE_UV:
>     case BRW_REGISTER_TYPE_VF:
> -      assert(!"unimplemented: saturate vector immediate");
> +      unreachable(!"unimplemented: saturate vector immediate");

If you drop the ! from both places,

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

:)

>     case BRW_REGISTER_TYPE_DF:
>     case BRW_REGISTER_TYPE_HF:
> -      assert(!"unimplemented: saturate DF/HF immediate");
> +      unreachable(!"unimplemented: saturate DF/HF immediate");
>     }
>  
>     if (imm.ud != sat_imm.ud) {
> 



More information about the mesa-dev mailing list