[Mesa-dev] [PATCH 04/16] glsl: Expand constant_util

Matt Turner mattst88 at gmail.com
Sun Nov 16 19:41:35 PST 2014

On Sun, Nov 16, 2014 at 5:51 PM, Thomas Helland
<thomashelland90 at gmail.com> wrote:
> Add functions:
>   is_greater_than_one
>   is_less_than_zero
> Add variations like greater_than_or_equal_zero.
> ---
> This is not ideal computation-wise, as we are doing two
> iterations instead of one. The question is wether or not
> the extra code is worth the duplicaton.

Now that all of these functions are in a header, maybe the best thing
to do is to actually use macros?

Something like IS_CONSTANT(ir, operator, operand) so we can do
IS_CONSTANT(ir, >=, 0.0f) or something like that. What do other
compiler people think?

More information about the mesa-dev mailing list