nir: More NIR_MAX_VEC_COMPONENTS fixes

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6655>
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index f9ac4c8..8451ce2 100644
--- a/src/compiler/nir/nir_builder.h
+++ b/src/compiler/nir/nir_builder.h
@@ -1026,7 +1026,7 @@
 
    nir_alu_src alu = { NIR_SRC_INIT };
    alu.src = src;
-   for (int j = 0; j < 4; j++)
+   for (int j = 0; j < NIR_MAX_VEC_COMPONENTS; j++)
       alu.swizzle[j] = j;
 
    return nir_mov_alu(build, alu, num_components);
diff --git a/src/compiler/nir/nir_builtin_builder.c b/src/compiler/nir/nir_builtin_builder.c
index 3a66eba..690fa98 100644
--- a/src/compiler/nir/nir_builtin_builder.c
+++ b/src/compiler/nir/nir_builtin_builder.c
@@ -74,6 +74,8 @@
    case 2: return nir_fsqrt(b, nir_fdot2(b, vec, vec));
    case 3: return nir_fsqrt(b, nir_fdot3(b, vec, vec));
    case 4: return nir_fsqrt(b, nir_fdot4(b, vec, vec));
+   case 8: return nir_fsqrt(b, nir_fdot8(b, vec, vec));
+   case 16: return nir_fsqrt(b, nir_fdot16(b, vec, vec));
    default:
       unreachable("Invalid number of components");
    }
diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c
index d2cd590..fbe8e51 100644
--- a/src/compiler/nir/nir_lower_io.c
+++ b/src/compiler/nir/nir_lower_io.c
@@ -1414,7 +1414,7 @@
    if (intrin->intrinsic == nir_intrinsic_load_deref) {
       nir_ssa_def *value;
       if (vec_stride > scalar_size) {
-         nir_ssa_def *comps[4] = { NULL, };
+         nir_ssa_def *comps[NIR_MAX_VEC_COMPONENTS] = { NULL, };
          for (unsigned i = 0; i < intrin->num_components; i++) {
             unsigned comp_offset = i * vec_stride;
             nir_ssa_def *comp_addr = build_addr_iadd_imm(b, addr, addr_format,
diff --git a/src/compiler/nir/nir_opt_copy_propagate.c b/src/compiler/nir/nir_opt_copy_propagate.c
index 2f7e4bc..e67bcf3 100644
--- a/src/compiler/nir/nir_opt_copy_propagate.c
+++ b/src/compiler/nir/nir_opt_copy_propagate.c
@@ -68,7 +68,7 @@
 is_swizzleless_move(nir_alu_instr *instr)
 {
    if (is_move(instr)) {
-      for (unsigned i = 0; i < 4; i++) {
+      for (unsigned i = 0; i < NIR_MAX_VEC_COMPONENTS; i++) {
          if (!((instr->dest.write_mask >> i) & 1))
             break;
          if (instr->src[0].swizzle[i] != i)