[Mesa-dev] [PATCH 1/2] i965: Add an is_negative_one() method.
Kenneth Graunke
kenneth at whitecape.org
Thu Feb 12 16:54:04 PST 2015
On Thursday, February 12, 2015 03:36:36 PM Matt Turner wrote:
> ---
> src/mesa/drivers/dri/i965/brw_shader.cpp | 16 ++++++++++++++++
> src/mesa/drivers/dri/i965/brw_shader.h | 1 +
> 2 files changed, 17 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
> index 8b87d0d..d7b9c44 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
> @@ -734,6 +734,22 @@ backend_reg::is_one() const
> }
>
> bool
> +backend_reg::is_negative_one() const
> +{
> + if (file != IMM)
> + return false;
> +
> + switch (type) {
> + case BRW_REGISTER_TYPE_F:
> + return fixed_hw_reg.dw1.f == -1.0;
> + case BRW_REGISTER_TYPE_D:
> + return fixed_hw_reg.dw1.d == -1;
> + default:
> + return false;
> + }
> +}
> +
> +bool
> backend_reg::is_null() const
> {
> return file == HW_REG &&
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.h b/src/mesa/drivers/dri/i965/brw_shader.h
> index 4b5c573..7bff186 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.h
> +++ b/src/mesa/drivers/dri/i965/brw_shader.h
> @@ -51,6 +51,7 @@ struct backend_reg
> #ifdef __cplusplus
> bool is_zero() const;
> bool is_one() const;
> + bool is_negative_one() const;
> bool is_null() const;
> bool is_accumulator() const;
> #endif
>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150212/cc93ef6f/attachment.sig>
More information about the mesa-dev
mailing list