util: Move util_is_power_of_two to bitscan.h and rename to util_is_power_of_two_or_zero
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_gather.c
index 7d11dcd3b64a3f740e3d3c3bfe2a0374cd308a12..8cabe9ef01e1ec4c65de359632e8815c2c80b64e 100644 (file)
@@ -118,7 +118,7 @@ lp_build_gather_elem(struct gallivm_state *gallivm,
     */
    if (!aligned) {
       LLVMSetAlignment(res, 1);
-   } else if (!util_is_power_of_two(src_width)) {
+   } else if (!util_is_power_of_two_or_zero(src_width)) {
       /*
        * Full alignment is impossible, assume the caller really meant
        * the individual elements were aligned (e.g. 3x32bit format).
@@ -130,7 +130,7 @@ lp_build_gather_elem(struct gallivm_state *gallivm,
        * this should cover all the 3-channel formats.
        */
       if (((src_width / 24) * 24 == src_width) &&
-           util_is_power_of_two(src_width / 24)) {
+           util_is_power_of_two_or_zero(src_width / 24)) {
           LLVMSetAlignment(res, src_width / 24);
       } else {
          LLVMSetAlignment(res, 1);
@@ -199,7 +199,7 @@ lp_build_gather_elem_vec(struct gallivm_state *gallivm,
     */
    if (!aligned) {
       LLVMSetAlignment(res, 1);
-   } else if (!util_is_power_of_two(src_width)) {
+   } else if (!util_is_power_of_two_or_zero(src_width)) {
       /*
        * Full alignment is impossible, assume the caller really meant
        * the individual elements were aligned (e.g. 3x32bit format).
@@ -211,7 +211,7 @@ lp_build_gather_elem_vec(struct gallivm_state *gallivm,
        * this should cover all the 3-channel formats.
        */
       if (((src_width / 24) * 24 == src_width) &&
-           util_is_power_of_two(src_width / 24)) {
+           util_is_power_of_two_or_zero(src_width / 24)) {
           LLVMSetAlignment(res, src_width / 24);
       } else {
          LLVMSetAlignment(res, 1);