{ 1, -2},
{-1, -2}
};
- boolean cond[4];
unsigned i;
- memset(cond, 0, sizeof cond);
- cond[channel] = 1;
-
- a = LLVMBuildAnd(bld->builder, a, lp_build_const_mask_aos(type, cond), "");
+ a = LLVMBuildAnd(bld->builder, a,
+ lp_build_const_mask_aos(type, 1 << channel), "");
/*
* Build a type where each element is an integer that cover the four
*/
LLVMValueRef res;
struct lp_type type4;
- boolean cond[4];
+ unsigned cond = 0;
unsigned chan;
int shift;
* Start with a mixture of 1 and 0.
*/
for (chan = 0; chan < 4; ++chan) {
- cond[chan] = swizzles[chan] == PIPE_SWIZZLE_ONE ? TRUE : FALSE;
+ if (swizzles[chan] == PIPE_SWIZZLE_ONE) {
+ cond |= 1 << chan;
+ }
}
- res = lp_build_select_aos(bld, bld->one, bld->zero, cond);
+ res = lp_build_select_aos(bld, cond, bld->one, bld->zero);
/*
* Build a type where each element is an integer that cover the four