[ir] Remove deprecated load/store robustness support * Only support majorness template variants of subgroup matrix load/store * Update tests to use new variants only * Simplify all logic to be in terms of array stride Bug: 529415904 Change-Id: I6f8d6d40d5cbe59fb1f35dbbe9e66696966ff7b7 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/333416 SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com> Reviewed-by: James Price <jrprice@google.com> Auto-Submit: Alan Baker <alanbaker@google.com> Commit-Queue: Alan Baker <alanbaker@google.com>
diff --git a/src/tint/lang/core/ir/transform/robustness.cc b/src/tint/lang/core/ir/transform/robustness.cc index a0980fb..bb67eaa 100644 --- a/src/tint/lang/core/ir/transform/robustness.cc +++ b/src/tint/lang/core/ir/transform/robustness.cc
@@ -156,10 +156,10 @@ }); } - // Predicate subgroup matrix loads and stores based on their offset and stride. + // Clamp subgroup matrix loads and stores based on their offset and stride. for (auto* call : subgroup_matrix_calls) { b.InsertBefore(call, [&] { // - PredicateSubgroupMatrixCall(call); + ClampSubgroupMatrixCall(call); }); } @@ -415,10 +415,14 @@ /// Clamp the indices and coordinates of a texture builtin call instruction to ensure they are /// within the limits of the texture that they are accessing. /// @param call the texture builtin call instruction - void PredicateSubgroupMatrixCall(ir::CoreBuiltinCall* call) { - // TODO(b/529415904): Clean up this function when deprecated variants are removed. + void ClampSubgroupMatrixCall(ir::CoreBuiltinCall* call) { const auto& args = call->Args(); + TINT_IR_ASSERT(ir, (call->Func() == BuiltinFn::kSubgroupMatrixLoad && + call->ExplicitTemplateParams().Length() == 2) || + (call->Func() == BuiltinFn::kSubgroupMatrixStore && + call->ExplicitTemplateParams().Length() == 1)); + // Extract the arguments from the call. auto* arr = args[0]; auto* offset = args[1]; @@ -426,45 +430,26 @@ Value* stride = nullptr; uint32_t stride_index = 0; const type::SubgroupMatrix* matrix_ty = nullptr; - bool majorness_template = false; if (call->Func() == BuiltinFn::kSubgroupMatrixLoad) { - if (call->ExplicitTemplateParams().Length() == 2) { - TINT_IR_ASSERT( - ir, std::holds_alternative<core::Majorness>(call->ExplicitTemplateParams()[1])); - col_major = std::get<core::Majorness>(call->ExplicitTemplateParams()[1]) == - core::Majorness::kColMajor; - stride = args[2]; - stride_index = 2; - majorness_template = true; - } else { - col_major = args[2]->As<Constant>()->Value()->ValueAs<bool>(); - stride = args[3]; - stride_index = 3; - } + TINT_IR_ASSERT( + ir, std::holds_alternative<core::Majorness>(call->ExplicitTemplateParams()[1])); + col_major = std::get<core::Majorness>(call->ExplicitTemplateParams()[1]) == + core::Majorness::kColMajor; + stride = args[2]; + stride_index = 2; matrix_ty = call->Result()->Type()->As<type::SubgroupMatrix>(); } else if (call->Func() == BuiltinFn::kSubgroupMatrixStore) { matrix_ty = args[2]->Type()->As<type::SubgroupMatrix>(); - if (call->ExplicitTemplateParams().Length() == 1) { - TINT_IR_ASSERT( - ir, std::holds_alternative<core::Majorness>(call->ExplicitTemplateParams()[0])); - col_major = std::get<core::Majorness>(call->ExplicitTemplateParams()[0]) == - core::Majorness::kColMajor; - stride = args[3]; - stride_index = 3; - majorness_template = true; - } else { - col_major = args[3]->As<Constant>()->Value()->ValueAs<bool>(); - stride = args[4]; - stride_index = 4; - } + TINT_IR_ASSERT( + ir, std::holds_alternative<core::Majorness>(call->ExplicitTemplateParams()[0])); + col_major = std::get<core::Majorness>(call->ExplicitTemplateParams()[0]) == + core::Majorness::kColMajor; + stride = args[3]; + stride_index = 3; } else { TINT_IR_UNREACHABLE(ir); } - // There are two paths through this code based on majorness_template. - // If majorness_template is true, then offset and stride are in terms of the array - // If majorness_template is false, then offset and stride are in terms of the matrix - // element. auto* arr_ty = arr->Type()->UnwrapPtr()->As<core::type::Array>(); const uint32_t arr_stride = arr_ty->ImplicitStride(); @@ -479,12 +464,9 @@ min_stride = matrix_ty->Columns(); major_dim = matrix_ty->Rows(); } - // Offset and stride of majorness templated versions are counted in elements of the scalar - // type. - if (majorness_template) { - // Note: max comes from situations like 8x8 u8 accessed from an array of vec4u. - min_stride = std::max(min_stride * matrix_ty->Type()->Size() / arr_stride, 1u); - } + // Offset and stride are counted in array stride. + // Note: max comes from situations like 8x8 u8 accessed from an array of vec4u. + min_stride = std::max(min_stride * matrix_ty->Type()->Size() / arr_stride, 1u); // Increase the stride so that it is at least `min_stride` if necessary. if (auto* const_stride = stride->As<Constant>()) { @@ -498,23 +480,18 @@ call->SetArg(stride_index, stride); // If we are not predicating, then clamping the stride is all we need to do. - if (!config.predicate_subgroup_matrix) { + if (!config.clamp_subgroup_matrix) { return; } - // Get the length of the array (in terms of matrix elements). + // Get the length of the array. TINT_IR_ASSERT(ir, arr_ty); Value* array_length = nullptr; if (arr_ty->ConstantCount()) { - array_length = b.Constant( - u32(arr_ty->ConstantCount().value() * arr_stride / matrix_ty->Type()->Size())); + array_length = b.Constant(u32(arr_ty->ConstantCount().value())); } else { TINT_IR_ASSERT(ir, arr_ty->Count()->Is<type::RuntimeArrayCount>()); array_length = b.Call(ty.u32(), core::BuiltinFn::kArrayLength, arr)->Result(0); - if (arr_stride != matrix_ty->Type()->Size()) { - array_length = - b.Multiply(array_length, u32(arr_stride / matrix_ty->Type()->Size()))->Result(); - } } // If the array length, offset, and stride are all constants, then we can determine if the @@ -523,79 +500,29 @@ uint32_t const_length = array_length->As<Constant>()->Value()->ValueAs<uint32_t>(); uint32_t const_stride = stride->As<Constant>()->Value()->ValueAs<uint32_t>(); uint32_t const_offset = offset->As<Constant>()->Value()->ValueAs<uint32_t>(); - if (majorness_template) { - // Put offset and stride in terms of matrix element type. - const_stride = const_stride * arr_stride / matrix_ty->Type()->Size(); - const_offset = const_offset * arr_stride / matrix_ty->Type()->Size(); - min_stride = min_stride * arr_stride / matrix_ty->Type()->Size(); - } uint32_t const_end = const_offset + (const_stride * (major_dim - 1)) + min_stride; if (const_end <= const_length) { return; } } - if (majorness_template) { - // Binding size is guaranteed to hold enough for `min_stride` matrix. So check if the - // array length is sufficient for the given parameters and, if not, use 0 offset and - // minimum stride. - b.InsertBefore(call, [&] { - // The beginning of the last row/column is at `offset + (major_dim-1)*stride`. - // We then add another `min_stride` elements to get to the end of the accessed - // memory. - // Convert last_slice and end into elements of the matrix element. - offset = b.InsertBitcastIfNeeded(ty.u32(), offset); - stride = b.InsertBitcastIfNeeded(ty.u32(), stride); - auto* last_slice = b.Add(offset, b.Multiply(stride, u32(major_dim - 1)))->Result(); - if (arr_stride != matrix_ty->Type()->Size()) { - last_slice = b.Multiply(last_slice, u32(arr_stride / matrix_ty->Type()->Size())) - ->Result(); - } - auto* end = - b.Add(last_slice, u32(min_stride * arr_stride / matrix_ty->Type()->Size())); - auto* in_bounds = b.LessThanEqual(end, array_length); - offset = b.Call(ty.u32(), BuiltinFn::kSelect, 0_u, offset, in_bounds)->Result(); - stride = b.Call(ty.u32(), BuiltinFn::kSelect, u32(min_stride), stride, in_bounds) - ->Result(); - call->SetArg(1, offset); - call->SetArg(stride_index, stride); - }); - return; - } - - // Predicate the builtin call depending on whether it is in bounds. - auto insertion_point = call->next; - call->Remove(); - b.InsertBefore(insertion_point, [&] { + // Binding size is guaranteed to hold enough for `min_stride` matrix. So check if the + // array length is sufficient for the given parameters and, if not, use 0 offset and + // minimum stride. + b.InsertBefore(call, [&] { // The beginning of the last row/column is at `offset + (major_dim-1)*stride`. - // We then add another `min_stride` elements to get to the end of the accessed memory. + // We then add another `min_stride` elements to get to the end of the accessed + // memory. offset = b.InsertBitcastIfNeeded(ty.u32(), offset); stride = b.InsertBitcastIfNeeded(ty.u32(), stride); - auto* last_slice = b.Add(offset, b.Multiply(stride, u32(major_dim - 1))); + auto* last_slice = b.Add(offset, b.Multiply(stride, u32(major_dim - 1)))->Result(); auto* end = b.Add(last_slice, u32(min_stride)); auto* in_bounds = b.LessThanEqual(end, array_length); - if (call->Func() == BuiltinFn::kSubgroupMatrixLoad) { - // Declare a variable to hold the result of the load, or a zero-initialized matrix. - auto* result = b.Var(ty.ptr<function>(matrix_ty)); - auto* load_result = b.InstructionResult(matrix_ty); - call->Result()->ReplaceAllUsesWith(load_result); - - auto* if_ = b.If(in_bounds); - b.Append(if_->True(), [&] { // - if_->True()->Append(call); - b.Store(result, call->Result()); - b.ExitIf(if_); - }); - b.LoadWithResult(load_result, result); - } else if (call->Func() == BuiltinFn::kSubgroupMatrixStore) { - auto* if_ = b.If(in_bounds); - b.Append(if_->True(), [&] { // - if_->True()->Append(call); - b.ExitIf(if_); - }); - } else { - TINT_IR_UNREACHABLE(ir); - } + offset = b.Call(ty.u32(), BuiltinFn::kSelect, 0_u, offset, in_bounds)->Result(); + stride = + b.Call(ty.u32(), BuiltinFn::kSelect, u32(min_stride), stride, in_bounds)->Result(); + call->SetArg(1, offset); + call->SetArg(stride_index, stride); }); } @@ -629,14 +556,10 @@ }, [&](const CoreBuiltinCall* call) { const type::SubgroupMatrix* mat_ty = nullptr; - // TODO(b/529415904): remove template checks when deprecated variants are - // removed. - if (call->Func() == BuiltinFn::kSubgroupMatrixLoad && - call->ExplicitTemplateParams().Length() == 2) { + if (call->Func() == BuiltinFn::kSubgroupMatrixLoad) { mat_ty = call->Result()->Type()->As<type::SubgroupMatrix>(); } - if (call->Func() == BuiltinFn::kSubgroupMatrixStore && - call->ExplicitTemplateParams().Length() == 1) { + if (call->Func() == BuiltinFn::kSubgroupMatrixStore) { mat_ty = call->Args()[2]->Type()->As<type::SubgroupMatrix>(); } if (mat_ty) {
diff --git a/src/tint/lang/core/ir/transform/robustness.h b/src/tint/lang/core/ir/transform/robustness.h index 37c6710..2e8db33 100644 --- a/src/tint/lang/core/ir/transform/robustness.h +++ b/src/tint/lang/core/ir/transform/robustness.h
@@ -53,9 +53,9 @@ /// Should accesses to pointers with the 'uniform' address space be clamped? bool clamp_uniform = true; - /// Should subgroup matrix builtins be predicated? - /// Note that the stride parameter will still be clamped if predication is disabled. - bool predicate_subgroup_matrix = true; + /// Should subgroup matrix builtins be clamped? + /// Note that the stride parameter will still be clamped if clamping is disabled. + bool clamp_subgroup_matrix = true; /// Bindings that should always be ignored. std::unordered_set<tint::BindingPoint> bindings_ignored; @@ -72,7 +72,7 @@ clamp_immediate_data, clamp_storage, clamp_uniform, - predicate_subgroup_matrix, + clamp_subgroup_matrix, bindings_ignored, disable_runtime_sized_array_index_clamping, use_integer_range_analysis);
diff --git a/src/tint/lang/core/ir/transform/robustness_test.cc b/src/tint/lang/core/ir/transform/robustness_test.cc index 44bdee1..ff79e2a 100644 --- a/src/tint/lang/core/ir/transform/robustness_test.cc +++ b/src/tint/lang/core/ir/transform/robustness_test.cc
@@ -3301,8 +3301,9 @@ auto* func = b.Function("foo", mat); b.Append(func->Block(), [&] { // Constant stride of 1 should be clamped to 4 even when predication is disabled. - auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 0_u, true, 1_u); + auto* load = + b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, + Vector<TemplateParameter, 2>{mat, Majorness::kColMajor}, arr, 0_u, 1_u); b.Return(func, load); }); @@ -3313,7 +3314,7 @@ %foo = func():subgroup_matrix_result<f32, 8, 4> { $B2: { - %3:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, 0u, true, 1u + %3:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, col_major> %arr, 0u, 1u ret %3 } } @@ -3332,15 +3333,9 @@ %5:u32 = add 0u, %4 %6:u32 = add %5, 4u %7:bool = lte %6, %3 - %8:ptr<function, subgroup_matrix_result<f32, 8, 4>, read_write> = var undef - if %7 [t: $B3] { # if_1 - $B3: { # true - %9:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, 0u, true, 4u - store %8, %9 - exit_if # if_1 - } - } - %10:subgroup_matrix_result<f32, 8, 4> = load %8 + %8:u32 = select 0u, 0u, %7 + %9:u32 = select 4u, 4u, %7 + %10:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, col_major> %arr, %8, %9 ret %10 } } @@ -3353,14 +3348,14 @@ %foo = func():subgroup_matrix_result<f32, 8, 4> { $B2: { - %3:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, 0u, true, 4u + %3:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, col_major> %arr, 0u, 4u ret %3 } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -3379,7 +3374,8 @@ func->SetParams({offset, stride}); b.Append(func->Block(), [&] { auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, offset, true, stride); + Vector<TemplateParameter, 2>{mat, Majorness::kColMajor}, arr, + offset, stride); b.Return(func, load); }); @@ -3390,7 +3386,7 @@ %foo = func(%offset:i32, %stride:i32):subgroup_matrix_result<f32, 8, 4> { $B2: { - %5:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, %offset, true, %stride + %5:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, col_major> %arr, %offset, %stride ret %5 } } @@ -3412,15 +3408,9 @@ %10:u32 = add %8, %9 %11:u32 = add %10, 4u %12:bool = lte %11, %7 - %13:ptr<function, subgroup_matrix_result<f32, 8, 4>, read_write> = var undef - if %12 [t: $B3] { # if_1 - $B3: { # true - %14:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, %offset, true, %6 - store %13, %14 - exit_if # if_1 - } - } - %15:subgroup_matrix_result<f32, 8, 4> = load %13 + %13:u32 = select 0u, %8, %12 + %14:u32 = select 4u, %6, %12 + %15:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, col_major> %arr, %13, %14 ret %15 } } @@ -3435,14 +3425,14 @@ $B2: { %5:u32 = bitcast<u32> %stride %6:u32 = max %5, 4u - %7:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, %offset, true, %6 + %7:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, col_major> %arr, %offset, %6 ret %7 } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -3457,7 +3447,7 @@ auto* func = b.Function("foo", mat); b.Append(func->Block(), [&] { - // Constant stride of 1 should be clamped to 4 even when predication is disabled. + // Constant stride of 1 should be clamped to 4 even when clamping is disabled. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, Vector<TemplateParameter, 2>{mat, core::Majorness::kColMajor}, arr, 16_u, 1_u); @@ -3512,7 +3502,7 @@ )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -3529,9 +3519,10 @@ auto* func = b.Function("foo", mat); b.Append(func->Block(), [&] { - // Constant stride of 1 should be clamped to 4 even when predication is disabled. - auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 0_u, true, 1_u); + // Constant stride of 1 should be clamped to 1 even when clamping is disabled. + auto* load = + b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, + Vector<TemplateParameter, 2>{mat, Majorness::kColMajor}, arr, 0_u, 1_u); b.Return(func, load); }); @@ -3542,7 +3533,7 @@ %foo = func():subgroup_matrix_result<i8, 8, 4> { $B2: { - %3:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>> %arr, 0u, true, 1u + %3:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, col_major> %arr, 0u, 1u ret %3 } } @@ -3557,21 +3548,14 @@ %foo = func():subgroup_matrix_result<i8, 8, 4> { $B2: { %3:u32 = arrayLength %arr - %4:u32 = mul %3, 4u - %5:u32 = mul 4u, 7u - %6:u32 = add 0u, %5 - %7:u32 = add %6, 4u - %8:bool = lte %7, %4 - %9:ptr<function, subgroup_matrix_result<i8, 8, 4>, read_write> = var undef - if %8 [t: $B3] { # if_1 - $B3: { # true - %10:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>> %arr, 0u, true, 4u - store %9, %10 - exit_if # if_1 - } - } - %11:subgroup_matrix_result<i8, 8, 4> = load %9 - ret %11 + %4:u32 = mul 1u, 7u + %5:u32 = add 0u, %4 + %6:u32 = add %5, 1u + %7:bool = lte %6, %3 + %8:u32 = select 0u, 0u, %7 + %9:u32 = select 1u, 1u, %7 + %10:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, col_major> %arr, %8, %9 + ret %10 } } )"; @@ -3583,14 +3567,14 @@ %foo = func():subgroup_matrix_result<i8, 8, 4> { $B2: { - %3:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>> %arr, 0u, true, 4u + %3:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, col_major> %arr, 0u, 1u ret %3 } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -3607,9 +3591,10 @@ auto* func = b.Function("foo", mat); b.Append(func->Block(), [&] { - // Constant stride of 1 should be clamped to 4 even when predication is disabled. - auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 0_u, true, 1_u); + // Constant stride of 1 should be clamped to 1 even when clamping is disabled. + auto* load = + b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, + Vector<TemplateParameter, 2>{mat, Majorness::kColMajor}, arr, 0_u, 1_u); b.Return(func, load); }); @@ -3620,7 +3605,7 @@ %foo = func():subgroup_matrix_result<u8, 8, 4> { $B2: { - %3:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>> %arr, 0u, true, 1u + %3:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>, col_major> %arr, 0u, 1u ret %3 } } @@ -3635,21 +3620,14 @@ %foo = func():subgroup_matrix_result<u8, 8, 4> { $B2: { %3:u32 = arrayLength %arr - %4:u32 = mul %3, 4u - %5:u32 = mul 4u, 7u - %6:u32 = add 0u, %5 - %7:u32 = add %6, 4u - %8:bool = lte %7, %4 - %9:ptr<function, subgroup_matrix_result<u8, 8, 4>, read_write> = var undef - if %8 [t: $B3] { # if_1 - $B3: { # true - %10:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>> %arr, 0u, true, 4u - store %9, %10 - exit_if # if_1 - } - } - %11:subgroup_matrix_result<u8, 8, 4> = load %9 - ret %11 + %4:u32 = mul 1u, 7u + %5:u32 = add 0u, %4 + %6:u32 = add %5, 1u + %7:bool = lte %6, %3 + %8:u32 = select 0u, 0u, %7 + %9:u32 = select 1u, 1u, %7 + %10:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>, col_major> %arr, %8, %9 + ret %10 } } )"; @@ -3661,14 +3639,14 @@ %foo = func():subgroup_matrix_result<u8, 8, 4> { $B2: { - %3:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>> %arr, 0u, true, 4u + %3:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>, col_major> %arr, 0u, 1u ret %3 } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -3685,9 +3663,10 @@ auto* stride = b.FunctionParam<u32>("stride"); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. + // Dynamic stride should be clamped with `max` even when clamping is disabled. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 0_u, true, stride); + Vector<TemplateParameter, 2>{mat, Majorness::kColMajor}, arr, + 0_u, stride); b.Return(func, load); }); @@ -3698,7 +3677,7 @@ %foo = func(%stride:u32):subgroup_matrix_result<f32, 8, 4> { $B2: { - %4:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, 0u, true, %stride + %4:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, col_major> %arr, 0u, %stride ret %4 } } @@ -3718,15 +3697,9 @@ %7:u32 = add 0u, %6 %8:u32 = add %7, 4u %9:bool = lte %8, %5 - %10:ptr<function, subgroup_matrix_result<f32, 8, 4>, read_write> = var undef - if %9 [t: $B3] { # if_1 - $B3: { # true - %11:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, 0u, true, %4 - store %10, %11 - exit_if # if_1 - } - } - %12:subgroup_matrix_result<f32, 8, 4> = load %10 + %10:u32 = select 0u, 0u, %9 + %11:u32 = select 4u, %4, %9 + %12:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, col_major> %arr, %10, %11 ret %12 } } @@ -3740,14 +3713,14 @@ %foo = func(%stride:u32):subgroup_matrix_result<f32, 8, 4> { $B2: { %4:u32 = max %stride, 4u - %5:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, 0u, true, %4 + %5:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, col_major> %arr, 0u, %4 ret %5 } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -3766,9 +3739,10 @@ auto* stride = b.FunctionParam<u32>("stride"); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. + // Dynamic stride should be clamped with `max` even when clamping is disabled. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 0_u, true, stride); + Vector<TemplateParameter, 2>{mat, Majorness::kColMajor}, arr, + 0_u, stride); b.Return(func, load); }); @@ -3779,7 +3753,7 @@ %foo = func(%stride:u32):subgroup_matrix_result<i8, 8, 4> { $B2: { - %4:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>> %arr, 0u, true, %stride + %4:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, col_major> %arr, 0u, %stride ret %4 } } @@ -3793,23 +3767,16 @@ %foo = func(%stride:u32):subgroup_matrix_result<i8, 8, 4> { $B2: { - %4:u32 = max %stride, 4u + %4:u32 = max %stride, 1u %5:u32 = arrayLength %arr - %6:u32 = mul %5, 4u - %7:u32 = mul %4, 7u - %8:u32 = add 0u, %7 - %9:u32 = add %8, 4u - %10:bool = lte %9, %6 - %11:ptr<function, subgroup_matrix_result<i8, 8, 4>, read_write> = var undef - if %10 [t: $B3] { # if_1 - $B3: { # true - %12:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>> %arr, 0u, true, %4 - store %11, %12 - exit_if # if_1 - } - } - %13:subgroup_matrix_result<i8, 8, 4> = load %11 - ret %13 + %6:u32 = mul %4, 7u + %7:u32 = add 0u, %6 + %8:u32 = add %7, 1u + %9:bool = lte %8, %5 + %10:u32 = select 0u, 0u, %9 + %11:u32 = select 1u, %4, %9 + %12:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, col_major> %arr, %10, %11 + ret %12 } } )"; @@ -3821,15 +3788,15 @@ %foo = func(%stride:u32):subgroup_matrix_result<i8, 8, 4> { $B2: { - %4:u32 = max %stride, 4u - %5:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>> %arr, 0u, true, %4 + %4:u32 = max %stride, 1u + %5:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, col_major> %arr, 0u, %4 ret %5 } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -3848,9 +3815,10 @@ auto* stride = b.FunctionParam<u32>("stride"); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. + // Dynamic stride should be clamped with `max` even when clamping is disabled. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 0_u, true, stride); + Vector<TemplateParameter, 2>{mat, Majorness::kColMajor}, arr, + 0_u, stride); b.Return(func, load); }); @@ -3861,7 +3829,7 @@ %foo = func(%stride:u32):subgroup_matrix_result<u8, 8, 4> { $B2: { - %4:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>> %arr, 0u, true, %stride + %4:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>, col_major> %arr, 0u, %stride ret %4 } } @@ -3875,23 +3843,16 @@ %foo = func(%stride:u32):subgroup_matrix_result<u8, 8, 4> { $B2: { - %4:u32 = max %stride, 4u + %4:u32 = max %stride, 1u %5:u32 = arrayLength %arr - %6:u32 = mul %5, 4u - %7:u32 = mul %4, 7u - %8:u32 = add 0u, %7 - %9:u32 = add %8, 4u - %10:bool = lte %9, %6 - %11:ptr<function, subgroup_matrix_result<u8, 8, 4>, read_write> = var undef - if %10 [t: $B3] { # if_1 - $B3: { # true - %12:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>> %arr, 0u, true, %4 - store %11, %12 - exit_if # if_1 - } - } - %13:subgroup_matrix_result<u8, 8, 4> = load %11 - ret %13 + %6:u32 = mul %4, 7u + %7:u32 = add 0u, %6 + %8:u32 = add %7, 1u + %9:bool = lte %8, %5 + %10:u32 = select 0u, 0u, %9 + %11:u32 = select 1u, %4, %9 + %12:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>, col_major> %arr, %10, %11 + ret %12 } } )"; @@ -3903,15 +3864,15 @@ %foo = func(%stride:u32):subgroup_matrix_result<u8, 8, 4> { $B2: { - %4:u32 = max %stride, 4u - %5:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>> %arr, 0u, true, %4 + %4:u32 = max %stride, 1u + %5:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>, col_major> %arr, 0u, %4 ret %5 } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -3928,9 +3889,10 @@ auto* stride = b.FunctionParam<u32>("stride"); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. + // Dynamic stride should be clamped with `max` even when clamping is disabled. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 0_u, false, stride); + Vector<TemplateParameter, 2>{mat, Majorness::kRowMajor}, arr, + 0_u, stride); b.Return(func, load); }); @@ -3941,7 +3903,7 @@ %foo = func(%stride:u32):subgroup_matrix_result<f32, 8, 4> { $B2: { - %4:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, 0u, false, %stride + %4:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, row_major> %arr, 0u, %stride ret %4 } } @@ -3961,15 +3923,9 @@ %7:u32 = add 0u, %6 %8:u32 = add %7, 8u %9:bool = lte %8, %5 - %10:ptr<function, subgroup_matrix_result<f32, 8, 4>, read_write> = var undef - if %9 [t: $B3] { # if_1 - $B3: { # true - %11:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, 0u, false, %4 - store %10, %11 - exit_if # if_1 - } - } - %12:subgroup_matrix_result<f32, 8, 4> = load %10 + %10:u32 = select 0u, 0u, %9 + %11:u32 = select 8u, %4, %9 + %12:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, row_major> %arr, %10, %11 ret %12 } } @@ -3983,14 +3939,14 @@ %foo = func(%stride:u32):subgroup_matrix_result<f32, 8, 4> { $B2: { %4:u32 = max %stride, 8u - %5:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, 0u, false, %4 + %5:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, row_major> %arr, 0u, %4 ret %5 } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -4009,9 +3965,10 @@ auto* stride = b.FunctionParam<u32>("stride"); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. + // Dynamic stride should be clamped with `max` even when clamping is disabled. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 0_u, false, stride); + Vector<TemplateParameter, 2>{mat, Majorness::kRowMajor}, arr, + 0_u, stride); b.Return(func, load); }); @@ -4022,7 +3979,7 @@ %foo = func(%stride:u32):subgroup_matrix_result<i8, 8, 4> { $B2: { - %4:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>> %arr, 0u, false, %stride + %4:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, row_major> %arr, 0u, %stride ret %4 } } @@ -4036,23 +3993,16 @@ %foo = func(%stride:u32):subgroup_matrix_result<i8, 8, 4> { $B2: { - %4:u32 = max %stride, 8u + %4:u32 = max %stride, 2u %5:u32 = arrayLength %arr - %6:u32 = mul %5, 4u - %7:u32 = mul %4, 3u - %8:u32 = add 0u, %7 - %9:u32 = add %8, 8u - %10:bool = lte %9, %6 - %11:ptr<function, subgroup_matrix_result<i8, 8, 4>, read_write> = var undef - if %10 [t: $B3] { # if_1 - $B3: { # true - %12:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>> %arr, 0u, false, %4 - store %11, %12 - exit_if # if_1 - } - } - %13:subgroup_matrix_result<i8, 8, 4> = load %11 - ret %13 + %6:u32 = mul %4, 3u + %7:u32 = add 0u, %6 + %8:u32 = add %7, 2u + %9:bool = lte %8, %5 + %10:u32 = select 0u, 0u, %9 + %11:u32 = select 2u, %4, %9 + %12:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, row_major> %arr, %10, %11 + ret %12 } } )"; @@ -4064,15 +4014,15 @@ %foo = func(%stride:u32):subgroup_matrix_result<i8, 8, 4> { $B2: { - %4:u32 = max %stride, 8u - %5:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>> %arr, 0u, false, %4 + %4:u32 = max %stride, 2u + %5:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, row_major> %arr, 0u, %4 ret %5 } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -4092,7 +4042,7 @@ auto* stride = b.FunctionParam<u32>("stride"); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. + // Dynamic stride should be clamped with `max` even when clamping is disabled. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, Vector<TemplateParameter, 2>{mat, core::Majorness::kRowMajor}, arr, 16_u, stride); @@ -4122,16 +4072,14 @@ $B2: { %4:u32 = max %stride, 2u %5:u32 = arrayLength %arr - %6:u32 = mul %5, 4u - %7:u32 = mul %4, 3u - %8:u32 = add 16u, %7 - %9:u32 = mul %8, 4u - %10:u32 = add %9, 8u - %11:bool = lte %10, %6 - %12:u32 = select 0u, 16u, %11 - %13:u32 = select 2u, %4, %11 - %14:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, row_major> %arr, %12, %13 - ret %14 + %6:u32 = mul %4, 3u + %7:u32 = add 16u, %6 + %8:u32 = add %7, 2u + %9:bool = lte %8, %5 + %10:u32 = select 0u, 16u, %9 + %11:u32 = select 2u, %4, %9 + %12:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, row_major> %arr, %10, %11 + ret %12 } } )"; @@ -4151,7 +4099,7 @@ )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -4170,9 +4118,10 @@ auto* stride = b.FunctionParam<u32>("stride"); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. + // Dynamic stride should be clamped with `max` even when clamping is disabled. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 0_u, false, stride); + Vector<TemplateParameter, 2>{mat, Majorness::kRowMajor}, arr, + 0_u, stride); b.Return(func, load); }); @@ -4183,7 +4132,7 @@ %foo = func(%stride:u32):subgroup_matrix_result<u8, 8, 4> { $B2: { - %4:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>> %arr, 0u, false, %stride + %4:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>, row_major> %arr, 0u, %stride ret %4 } } @@ -4197,23 +4146,16 @@ %foo = func(%stride:u32):subgroup_matrix_result<u8, 8, 4> { $B2: { - %4:u32 = max %stride, 8u + %4:u32 = max %stride, 2u %5:u32 = arrayLength %arr - %6:u32 = mul %5, 4u - %7:u32 = mul %4, 3u - %8:u32 = add 0u, %7 - %9:u32 = add %8, 8u - %10:bool = lte %9, %6 - %11:ptr<function, subgroup_matrix_result<u8, 8, 4>, read_write> = var undef - if %10 [t: $B3] { # if_1 - $B3: { # true - %12:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>> %arr, 0u, false, %4 - store %11, %12 - exit_if # if_1 - } - } - %13:subgroup_matrix_result<u8, 8, 4> = load %11 - ret %13 + %6:u32 = mul %4, 3u + %7:u32 = add 0u, %6 + %8:u32 = add %7, 2u + %9:bool = lte %8, %5 + %10:u32 = select 0u, 0u, %9 + %11:u32 = select 2u, %4, %9 + %12:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>, row_major> %arr, %10, %11 + ret %12 } } )"; @@ -4225,15 +4167,15 @@ %foo = func(%stride:u32):subgroup_matrix_result<u8, 8, 4> { $B2: { - %4:u32 = max %stride, 8u - %5:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>> %arr, 0u, false, %4 + %4:u32 = max %stride, 2u + %5:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>, row_major> %arr, 0u, %4 ret %5 } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -4249,9 +4191,10 @@ auto* stride = b.FunctionParam<u32>("stride"); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. + // Dynamic stride should be clamped with `max` even when clamping is disabled. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 0_u, true, stride); + Vector<TemplateParameter, 2>{mat, Majorness::kColMajor}, arr, + 0_u, stride); b.Return(func, load); }); @@ -4262,7 +4205,7 @@ %foo = func(%stride:u32):subgroup_matrix_result<f32, 8, 4> { $B2: { - %4:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, 0u, true, %stride + %4:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, col_major> %arr, 0u, %stride ret %4 } } @@ -4281,15 +4224,9 @@ %6:u32 = add 0u, %5 %7:u32 = add %6, 4u %8:bool = lte %7, 1024u - %9:ptr<function, subgroup_matrix_result<f32, 8, 4>, read_write> = var undef - if %8 [t: $B3] { # if_1 - $B3: { # true - %10:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, 0u, true, %4 - store %9, %10 - exit_if # if_1 - } - } - %11:subgroup_matrix_result<f32, 8, 4> = load %9 + %9:u32 = select 0u, 0u, %8 + %10:u32 = select 4u, %4, %8 + %11:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, col_major> %arr, %9, %10 ret %11 } } @@ -4303,14 +4240,14 @@ %foo = func(%stride:u32):subgroup_matrix_result<f32, 8, 4> { $B2: { %4:u32 = max %stride, 4u - %5:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, 0u, true, %4 + %5:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, col_major> %arr, 0u, %4 ret %5 } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -4328,9 +4265,10 @@ auto* stride = b.FunctionParam<u32>("stride"); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. + // Dynamic stride should be clamped with `max` even when clamping is disabled. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 0_u, true, stride); + Vector<TemplateParameter, 2>{mat, Majorness::kColMajor}, arr, + 0_u, stride); b.Return(func, load); }); @@ -4341,7 +4279,7 @@ %foo = func(%stride:u32):subgroup_matrix_result<i8, 8, 4> { $B2: { - %4:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>> %arr, 0u, true, %stride + %4:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, col_major> %arr, 0u, %stride ret %4 } } @@ -4355,20 +4293,14 @@ %foo = func(%stride:u32):subgroup_matrix_result<i8, 8, 4> { $B2: { - %4:u32 = max %stride, 4u + %4:u32 = max %stride, 1u %5:u32 = mul %4, 7u %6:u32 = add 0u, %5 - %7:u32 = add %6, 4u - %8:bool = lte %7, 4096u - %9:ptr<function, subgroup_matrix_result<i8, 8, 4>, read_write> = var undef - if %8 [t: $B3] { # if_1 - $B3: { # true - %10:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>> %arr, 0u, true, %4 - store %9, %10 - exit_if # if_1 - } - } - %11:subgroup_matrix_result<i8, 8, 4> = load %9 + %7:u32 = add %6, 1u + %8:bool = lte %7, 1024u + %9:u32 = select 0u, 0u, %8 + %10:u32 = select 1u, %4, %8 + %11:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, col_major> %arr, %9, %10 ret %11 } } @@ -4381,15 +4313,15 @@ %foo = func(%stride:u32):subgroup_matrix_result<i8, 8, 4> { $B2: { - %4:u32 = max %stride, 4u - %5:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>> %arr, 0u, true, %4 + %4:u32 = max %stride, 1u + %5:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, col_major> %arr, 0u, %4 ret %5 } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -4407,9 +4339,10 @@ auto* stride = b.FunctionParam<u32>("stride"); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. + // Dynamic stride should be clamped with `max` even when clamping is disabled. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 0_u, true, stride); + Vector<TemplateParameter, 2>{mat, Majorness::kColMajor}, arr, + 0_u, stride); b.Return(func, load); }); @@ -4420,7 +4353,7 @@ %foo = func(%stride:u32):subgroup_matrix_result<u8, 8, 4> { $B2: { - %4:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>> %arr, 0u, true, %stride + %4:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>, col_major> %arr, 0u, %stride ret %4 } } @@ -4434,20 +4367,14 @@ %foo = func(%stride:u32):subgroup_matrix_result<u8, 8, 4> { $B2: { - %4:u32 = max %stride, 4u + %4:u32 = max %stride, 1u %5:u32 = mul %4, 7u %6:u32 = add 0u, %5 - %7:u32 = add %6, 4u - %8:bool = lte %7, 4096u - %9:ptr<function, subgroup_matrix_result<u8, 8, 4>, read_write> = var undef - if %8 [t: $B3] { # if_1 - $B3: { # true - %10:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>> %arr, 0u, true, %4 - store %9, %10 - exit_if # if_1 - } - } - %11:subgroup_matrix_result<u8, 8, 4> = load %9 + %7:u32 = add %6, 1u + %8:bool = lte %7, 1024u + %9:u32 = select 0u, 0u, %8 + %10:u32 = select 1u, %4, %8 + %11:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>, col_major> %arr, %9, %10 ret %11 } } @@ -4460,21 +4387,21 @@ %foo = func(%stride:u32):subgroup_matrix_result<u8, 8, 4> { $B2: { - %4:u32 = max %stride, 4u - %5:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>> %arr, 0u, true, %4 + %4:u32 = max %stride, 1u + %5:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>, col_major> %arr, 0u, %4 ret %5 } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); } -// Test that we avoid any predication and clamping for fixed size arrays when all parameters are +// Test that we avoid any clamping for fixed size arrays when all parameters are // constant and in-bounds. TEST_P(IR_RobustnessTest, SubgroupMatrixLoad_WorkgroupFixedArray_ConstStrideAndOffset) { auto* arr = b.Var("arr", ty.ptr(workgroup, ty.array<f32, 1024>())); @@ -4487,7 +4414,8 @@ // The final row will start at 1016. Another full stride will take it past the 1024 limit, // but the transform should understand that only 8 elements are accessed on that row. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 920_u, false, 32_u); + Vector<TemplateParameter, 2>{mat, Majorness::kRowMajor}, arr, + 920_u, 32_u); b.Return(func, load); }); @@ -4498,7 +4426,7 @@ %foo = func():subgroup_matrix_result<f32, 8, 4> { $B2: { - %3:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>> %arr, 920u, false, 32u + %3:subgroup_matrix_result<f32, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<f32, 8, 4>, row_major> %arr, 920u, 32u ret %3 } } @@ -4508,7 +4436,7 @@ auto* expect = src; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(expect, str()); @@ -4527,7 +4455,8 @@ // The final row will start at 1016. Another full stride will take it past the 1024 limit, // but the transform should understand that only 8 elements are accessed on that row. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 920_u, false, 32_u); + Vector<TemplateParameter, 2>{mat, Majorness::kRowMajor}, arr, + 920_u, 32_u); b.Return(func, load); }); @@ -4538,7 +4467,7 @@ %foo = func():subgroup_matrix_result<i8, 8, 4> { $B2: { - %3:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>> %arr, 920u, false, 32u + %3:subgroup_matrix_result<i8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<i8, 8, 4>, row_major> %arr, 920u, 32u ret %3 } } @@ -4548,7 +4477,7 @@ auto* expect = src; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(expect, str()); @@ -4567,7 +4496,8 @@ // The final row will start at 1016. Another full stride will take it past the 1024 limit, // but the transform should understand that only 8 elements are accessed on that row. auto* load = b.CallExplicit(mat, BuiltinFn::kSubgroupMatrixLoad, - Vector<TemplateParameter, 1>{mat}, arr, 920_u, false, 32_u); + Vector<TemplateParameter, 2>{mat, Majorness::kRowMajor}, arr, + 920_u, 32_u); b.Return(func, load); }); @@ -4578,7 +4508,7 @@ %foo = func():subgroup_matrix_result<u8, 8, 4> { $B2: { - %3:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>> %arr, 920u, false, 32u + %3:subgroup_matrix_result<u8, 8, 4> = subgroupMatrixLoad<subgroup_matrix_result<u8, 8, 4>, row_major> %arr, 920u, 32u ret %3 } } @@ -4588,7 +4518,7 @@ auto* expect = src; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(expect, str()); @@ -4650,22 +4580,20 @@ $B2: { %5:u32 = max %stride, 1u %6:u32 = arrayLength %v - %7:u32 = mul %6, 16u - %8:u32 = mul %5, 7u - %9:u32 = add %offset, %8 - %10:u32 = mul %9, 16u - %11:u32 = add %10, 16u - %12:bool = lte %11, %7 - %13:u32 = select 0u, %offset, %12 - %14:u32 = select 1u, %5, %12 - %15:subgroup_matrix_left<u8, 8, 8> = subgroupMatrixLoad<subgroup_matrix_left<u8, 8, 8>, col_major> %v, %13, %14 + %7:u32 = mul %5, 7u + %8:u32 = add %offset, %7 + %9:u32 = add %8, 1u + %10:bool = lte %9, %6 + %11:u32 = select 0u, %offset, %10 + %12:u32 = select 1u, %5, %10 + %13:subgroup_matrix_left<u8, 8, 8> = subgroupMatrixLoad<subgroup_matrix_left<u8, 8, 8>, col_major> %v, %11, %12 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? robust : no_robust, str()); @@ -4727,22 +4655,20 @@ $B2: { %5:u32 = max %stride, 1u %6:u32 = arrayLength %v - %7:u32 = mul %6, 8u - %8:u32 = mul %5, 7u - %9:u32 = add %offset, %8 - %10:u32 = mul %9, 8u - %11:u32 = add %10, 8u - %12:bool = lte %11, %7 - %13:u32 = select 0u, %offset, %12 - %14:u32 = select 1u, %5, %12 - %15:subgroup_matrix_left<f16, 8, 8> = subgroupMatrixLoad<subgroup_matrix_left<f16, 8, 8>, col_major> %v, %13, %14 + %7:u32 = mul %5, 7u + %8:u32 = add %offset, %7 + %9:u32 = add %8, 1u + %10:bool = lte %9, %6 + %11:u32 = select 0u, %offset, %10 + %12:u32 = select 1u, %5, %10 + %13:subgroup_matrix_left<f16, 8, 8> = subgroupMatrixLoad<subgroup_matrix_left<f16, 8, 8>, col_major> %v, %11, %12 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? robust : no_robust, str()); @@ -4760,7 +4686,8 @@ func->AppendParam(value); b.Append(func->Block(), [&] { // Constant stride of 1 should be clamped to 4 even when predication is disabled. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 0_u, value, true, 1_u); + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kColMajor}, arr, 0_u, value, 1_u); b.Return(func); }); @@ -4771,7 +4698,7 @@ %foo = func(%value:subgroup_matrix_result<f32, 8, 4>):void { $B2: { - %4:void = subgroupMatrixStore %arr, 0u, %value, true, 1u + %4:void = subgroupMatrixStore<col_major> %arr, 0u, %value, 1u ret } } @@ -4790,12 +4717,9 @@ %6:u32 = add 0u, %5 %7:u32 = add %6, 4u %8:bool = lte %7, %4 - if %8 [t: $B3] { # if_1 - $B3: { # true - %9:void = subgroupMatrixStore %arr, 0u, %value, true, 4u - exit_if # if_1 - } - } + %9:u32 = select 0u, 0u, %8 + %10:u32 = select 4u, 4u, %8 + %11:void = subgroupMatrixStore<col_major> %arr, %9, %value, %10 ret } } @@ -4808,14 +4732,14 @@ %foo = func(%value:subgroup_matrix_result<f32, 8, 4>):void { $B2: { - %4:void = subgroupMatrixStore %arr, 0u, %value, true, 4u + %4:void = subgroupMatrixStore<col_major> %arr, 0u, %value, 4u ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -4834,7 +4758,9 @@ auto* stride = b.FunctionParam("stride", ty.i32()); func->SetParams({value, offset, stride}); b.Append(func->Block(), [&] { - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, offset, value, true, stride); + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kColMajor}, arr, offset, value, + stride); b.Return(func); }); @@ -4845,7 +4771,7 @@ %foo = func(%value:subgroup_matrix_result<f32, 8, 4>, %offset:i32, %stride:i32):void { $B2: { - %6:void = subgroupMatrixStore %arr, %offset, %value, true, %stride + %6:void = subgroupMatrixStore<col_major> %arr, %offset, %value, %stride ret } } @@ -4867,12 +4793,9 @@ %11:u32 = add %9, %10 %12:u32 = add %11, 4u %13:bool = lte %12, %8 - if %13 [t: $B3] { # if_1 - $B3: { # true - %14:void = subgroupMatrixStore %arr, %offset, %value, true, %7 - exit_if # if_1 - } - } + %14:u32 = select 0u, %9, %13 + %15:u32 = select 4u, %7, %13 + %16:void = subgroupMatrixStore<col_major> %arr, %14, %value, %15 ret } } @@ -4887,14 +4810,14 @@ $B2: { %6:u32 = bitcast<u32> %stride %7:u32 = max %6, 4u - %8:void = subgroupMatrixStore %arr, %offset, %value, true, %7 + %8:void = subgroupMatrixStore<col_major> %arr, %offset, %value, %7 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -4966,7 +4889,7 @@ )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -4985,8 +4908,9 @@ auto* value = b.FunctionParam("value", mat); func->AppendParam(value); b.Append(func->Block(), [&] { - // Constant stride of 1 should be clamped to 4 even when predication is disabled. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 0_u, value, true, 1_u); + // Constant stride of 1 should be clamped to 1 even when clamping is disabled. + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kColMajor}, arr, 0_u, value, 1_u); b.Return(func); }); @@ -4997,7 +4921,7 @@ %foo = func(%value:subgroup_matrix_result<i8, 8, 4>):void { $B2: { - %4:void = subgroupMatrixStore %arr, 0u, %value, true, 1u + %4:void = subgroupMatrixStore<col_major> %arr, 0u, %value, 1u ret } } @@ -5012,17 +4936,13 @@ %foo = func(%value:subgroup_matrix_result<i8, 8, 4>):void { $B2: { %4:u32 = arrayLength %arr - %5:u32 = mul %4, 4u - %6:u32 = mul 4u, 7u - %7:u32 = add 0u, %6 - %8:u32 = add %7, 4u - %9:bool = lte %8, %5 - if %9 [t: $B3] { # if_1 - $B3: { # true - %10:void = subgroupMatrixStore %arr, 0u, %value, true, 4u - exit_if # if_1 - } - } + %5:u32 = mul 1u, 7u + %6:u32 = add 0u, %5 + %7:u32 = add %6, 1u + %8:bool = lte %7, %4 + %9:u32 = select 0u, 0u, %8 + %10:u32 = select 1u, 1u, %8 + %11:void = subgroupMatrixStore<col_major> %arr, %9, %value, %10 ret } } @@ -5035,14 +4955,14 @@ %foo = func(%value:subgroup_matrix_result<i8, 8, 4>):void { $B2: { - %4:void = subgroupMatrixStore %arr, 0u, %value, true, 4u + %4:void = subgroupMatrixStore<col_major> %arr, 0u, %value, 1u ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -5061,8 +4981,9 @@ auto* value = b.FunctionParam("value", mat); func->AppendParam(value); b.Append(func->Block(), [&] { - // Constant stride of 1 should be clamped to 4 even when predication is disabled. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 0_u, value, true, 1_u); + // Constant stride of 1 should be clamped to 1 even when clamping is disabled. + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kColMajor}, arr, 0_u, value, 1_u); b.Return(func); }); @@ -5073,7 +4994,7 @@ %foo = func(%value:subgroup_matrix_result<u8, 8, 4>):void { $B2: { - %4:void = subgroupMatrixStore %arr, 0u, %value, true, 1u + %4:void = subgroupMatrixStore<col_major> %arr, 0u, %value, 1u ret } } @@ -5088,17 +5009,13 @@ %foo = func(%value:subgroup_matrix_result<u8, 8, 4>):void { $B2: { %4:u32 = arrayLength %arr - %5:u32 = mul %4, 4u - %6:u32 = mul 4u, 7u - %7:u32 = add 0u, %6 - %8:u32 = add %7, 4u - %9:bool = lte %8, %5 - if %9 [t: $B3] { # if_1 - $B3: { # true - %10:void = subgroupMatrixStore %arr, 0u, %value, true, 4u - exit_if # if_1 - } - } + %5:u32 = mul 1u, 7u + %6:u32 = add 0u, %5 + %7:u32 = add %6, 1u + %8:bool = lte %7, %4 + %9:u32 = select 0u, 0u, %8 + %10:u32 = select 1u, 1u, %8 + %11:void = subgroupMatrixStore<col_major> %arr, %9, %value, %10 ret } } @@ -5111,14 +5028,14 @@ %foo = func(%value:subgroup_matrix_result<u8, 8, 4>):void { $B2: { - %4:void = subgroupMatrixStore %arr, 0u, %value, true, 4u + %4:void = subgroupMatrixStore<col_major> %arr, 0u, %value, 1u ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -5137,8 +5054,9 @@ func->AppendParam(value); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 0_u, value, true, stride); + // Dynamic stride should be clamped with `max` even when clamping is disabled. + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kColMajor}, arr, 0_u, value, stride); b.Return(func); }); @@ -5149,7 +5067,7 @@ %foo = func(%value:subgroup_matrix_result<f32, 8, 4>, %stride:u32):void { $B2: { - %5:void = subgroupMatrixStore %arr, 0u, %value, true, %stride + %5:void = subgroupMatrixStore<col_major> %arr, 0u, %value, %stride ret } } @@ -5169,12 +5087,9 @@ %8:u32 = add 0u, %7 %9:u32 = add %8, 4u %10:bool = lte %9, %6 - if %10 [t: $B3] { # if_1 - $B3: { # true - %11:void = subgroupMatrixStore %arr, 0u, %value, true, %5 - exit_if # if_1 - } - } + %11:u32 = select 0u, 0u, %10 + %12:u32 = select 4u, %5, %10 + %13:void = subgroupMatrixStore<col_major> %arr, %11, %value, %12 ret } } @@ -5188,14 +5103,14 @@ %foo = func(%value:subgroup_matrix_result<f32, 8, 4>, %stride:u32):void { $B2: { %5:u32 = max %stride, 4u - %6:void = subgroupMatrixStore %arr, 0u, %value, true, %5 + %6:void = subgroupMatrixStore<col_major> %arr, 0u, %value, %5 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -5216,8 +5131,9 @@ func->AppendParam(value); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 0_u, value, true, stride); + // Dynamic stride should be clamped with `max` even when clamping is disabled. + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kColMajor}, arr, 0_u, value, stride); b.Return(func); }); @@ -5228,7 +5144,7 @@ %foo = func(%value:subgroup_matrix_result<i8, 8, 4>, %stride:u32):void { $B2: { - %5:void = subgroupMatrixStore %arr, 0u, %value, true, %stride + %5:void = subgroupMatrixStore<col_major> %arr, 0u, %value, %stride ret } } @@ -5242,19 +5158,15 @@ %foo = func(%value:subgroup_matrix_result<i8, 8, 4>, %stride:u32):void { $B2: { - %5:u32 = max %stride, 4u + %5:u32 = max %stride, 1u %6:u32 = arrayLength %arr - %7:u32 = mul %6, 4u - %8:u32 = mul %5, 7u - %9:u32 = add 0u, %8 - %10:u32 = add %9, 4u - %11:bool = lte %10, %7 - if %11 [t: $B3] { # if_1 - $B3: { # true - %12:void = subgroupMatrixStore %arr, 0u, %value, true, %5 - exit_if # if_1 - } - } + %7:u32 = mul %5, 7u + %8:u32 = add 0u, %7 + %9:u32 = add %8, 1u + %10:bool = lte %9, %6 + %11:u32 = select 0u, 0u, %10 + %12:u32 = select 1u, %5, %10 + %13:void = subgroupMatrixStore<col_major> %arr, %11, %value, %12 ret } } @@ -5267,15 +5179,15 @@ %foo = func(%value:subgroup_matrix_result<i8, 8, 4>, %stride:u32):void { $B2: { - %5:u32 = max %stride, 4u - %6:void = subgroupMatrixStore %arr, 0u, %value, true, %5 + %5:u32 = max %stride, 1u + %6:void = subgroupMatrixStore<col_major> %arr, 0u, %value, %5 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -5296,8 +5208,9 @@ func->AppendParam(value); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 0_u, value, true, stride); + // Dynamic stride should be clamped with `max` even when clamping is disabled. + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kColMajor}, arr, 0_u, value, stride); b.Return(func); }); @@ -5308,7 +5221,7 @@ %foo = func(%value:subgroup_matrix_result<u8, 8, 4>, %stride:u32):void { $B2: { - %5:void = subgroupMatrixStore %arr, 0u, %value, true, %stride + %5:void = subgroupMatrixStore<col_major> %arr, 0u, %value, %stride ret } } @@ -5322,19 +5235,15 @@ %foo = func(%value:subgroup_matrix_result<u8, 8, 4>, %stride:u32):void { $B2: { - %5:u32 = max %stride, 4u + %5:u32 = max %stride, 1u %6:u32 = arrayLength %arr - %7:u32 = mul %6, 4u - %8:u32 = mul %5, 7u - %9:u32 = add 0u, %8 - %10:u32 = add %9, 4u - %11:bool = lte %10, %7 - if %11 [t: $B3] { # if_1 - $B3: { # true - %12:void = subgroupMatrixStore %arr, 0u, %value, true, %5 - exit_if # if_1 - } - } + %7:u32 = mul %5, 7u + %8:u32 = add 0u, %7 + %9:u32 = add %8, 1u + %10:bool = lte %9, %6 + %11:u32 = select 0u, 0u, %10 + %12:u32 = select 1u, %5, %10 + %13:void = subgroupMatrixStore<col_major> %arr, %11, %value, %12 ret } } @@ -5347,15 +5256,15 @@ %foo = func(%value:subgroup_matrix_result<u8, 8, 4>, %stride:u32):void { $B2: { - %5:u32 = max %stride, 4u - %6:void = subgroupMatrixStore %arr, 0u, %value, true, %5 + %5:u32 = max %stride, 1u + %6:void = subgroupMatrixStore<col_major> %arr, 0u, %value, %5 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -5374,8 +5283,9 @@ func->AppendParam(value); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 0_u, value, false, stride); + // Dynamic stride should be clamped with `max` even when clamping is disabled. + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kRowMajor}, arr, 0_u, value, stride); b.Return(func); }); @@ -5386,7 +5296,7 @@ %foo = func(%value:subgroup_matrix_result<f32, 8, 4>, %stride:u32):void { $B2: { - %5:void = subgroupMatrixStore %arr, 0u, %value, false, %stride + %5:void = subgroupMatrixStore<row_major> %arr, 0u, %value, %stride ret } } @@ -5406,12 +5316,9 @@ %8:u32 = add 0u, %7 %9:u32 = add %8, 8u %10:bool = lte %9, %6 - if %10 [t: $B3] { # if_1 - $B3: { # true - %11:void = subgroupMatrixStore %arr, 0u, %value, false, %5 - exit_if # if_1 - } - } + %11:u32 = select 0u, 0u, %10 + %12:u32 = select 8u, %5, %10 + %13:void = subgroupMatrixStore<row_major> %arr, %11, %value, %12 ret } } @@ -5425,14 +5332,14 @@ %foo = func(%value:subgroup_matrix_result<f32, 8, 4>, %stride:u32):void { $B2: { %5:u32 = max %stride, 8u - %6:void = subgroupMatrixStore %arr, 0u, %value, false, %5 + %6:void = subgroupMatrixStore<row_major> %arr, 0u, %value, %5 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -5508,7 +5415,7 @@ )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -5529,8 +5436,9 @@ func->AppendParam(value); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 0_u, value, false, stride); + // Dynamic stride should be clamped with `max` even when clamping is disabled. + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kRowMajor}, arr, 0_u, value, stride); b.Return(func); }); @@ -5541,7 +5449,7 @@ %foo = func(%value:subgroup_matrix_result<i8, 8, 4>, %stride:u32):void { $B2: { - %5:void = subgroupMatrixStore %arr, 0u, %value, false, %stride + %5:void = subgroupMatrixStore<row_major> %arr, 0u, %value, %stride ret } } @@ -5555,19 +5463,15 @@ %foo = func(%value:subgroup_matrix_result<i8, 8, 4>, %stride:u32):void { $B2: { - %5:u32 = max %stride, 8u + %5:u32 = max %stride, 2u %6:u32 = arrayLength %arr - %7:u32 = mul %6, 4u - %8:u32 = mul %5, 3u - %9:u32 = add 0u, %8 - %10:u32 = add %9, 8u - %11:bool = lte %10, %7 - if %11 [t: $B3] { # if_1 - $B3: { # true - %12:void = subgroupMatrixStore %arr, 0u, %value, false, %5 - exit_if # if_1 - } - } + %7:u32 = mul %5, 3u + %8:u32 = add 0u, %7 + %9:u32 = add %8, 2u + %10:bool = lte %9, %6 + %11:u32 = select 0u, 0u, %10 + %12:u32 = select 2u, %5, %10 + %13:void = subgroupMatrixStore<row_major> %arr, %11, %value, %12 ret } } @@ -5580,15 +5484,15 @@ %foo = func(%value:subgroup_matrix_result<i8, 8, 4>, %stride:u32):void { $B2: { - %5:u32 = max %stride, 8u - %6:void = subgroupMatrixStore %arr, 0u, %value, false, %5 + %5:u32 = max %stride, 2u + %6:void = subgroupMatrixStore<row_major> %arr, 0u, %value, %5 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -5609,8 +5513,9 @@ func->AppendParam(value); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 0_u, value, false, stride); + // Dynamic stride should be clamped with `max` even when clamping is disabled. + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kRowMajor}, arr, 0_u, value, stride); b.Return(func); }); @@ -5621,7 +5526,7 @@ %foo = func(%value:subgroup_matrix_result<u8, 8, 4>, %stride:u32):void { $B2: { - %5:void = subgroupMatrixStore %arr, 0u, %value, false, %stride + %5:void = subgroupMatrixStore<row_major> %arr, 0u, %value, %stride ret } } @@ -5635,19 +5540,15 @@ %foo = func(%value:subgroup_matrix_result<u8, 8, 4>, %stride:u32):void { $B2: { - %5:u32 = max %stride, 8u + %5:u32 = max %stride, 2u %6:u32 = arrayLength %arr - %7:u32 = mul %6, 4u - %8:u32 = mul %5, 3u - %9:u32 = add 0u, %8 - %10:u32 = add %9, 8u - %11:bool = lte %10, %7 - if %11 [t: $B3] { # if_1 - $B3: { # true - %12:void = subgroupMatrixStore %arr, 0u, %value, false, %5 - exit_if # if_1 - } - } + %7:u32 = mul %5, 3u + %8:u32 = add 0u, %7 + %9:u32 = add %8, 2u + %10:bool = lte %9, %6 + %11:u32 = select 0u, 0u, %10 + %12:u32 = select 2u, %5, %10 + %13:void = subgroupMatrixStore<row_major> %arr, %11, %value, %12 ret } } @@ -5660,15 +5561,15 @@ %foo = func(%value:subgroup_matrix_result<u8, 8, 4>, %stride:u32):void { $B2: { - %5:u32 = max %stride, 8u - %6:void = subgroupMatrixStore %arr, 0u, %value, false, %5 + %5:u32 = max %stride, 2u + %6:void = subgroupMatrixStore<row_major> %arr, 0u, %value, %5 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -5686,8 +5587,9 @@ func->AppendParam(value); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 0_u, value, true, stride); + // Dynamic stride should be clamped with `max` even when clamping is disabled. + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kColMajor}, arr, 0_u, value, stride); b.Return(func); }); @@ -5698,7 +5600,7 @@ %foo = func(%value:subgroup_matrix_result<f32, 8, 4>, %stride:u32):void { $B2: { - %5:void = subgroupMatrixStore %arr, 0u, %value, true, %stride + %5:void = subgroupMatrixStore<col_major> %arr, 0u, %value, %stride ret } } @@ -5717,12 +5619,9 @@ %7:u32 = add 0u, %6 %8:u32 = add %7, 4u %9:bool = lte %8, 1024u - if %9 [t: $B3] { # if_1 - $B3: { # true - %10:void = subgroupMatrixStore %arr, 0u, %value, true, %5 - exit_if # if_1 - } - } + %10:u32 = select 0u, 0u, %9 + %11:u32 = select 4u, %5, %9 + %12:void = subgroupMatrixStore<col_major> %arr, %10, %value, %11 ret } } @@ -5736,14 +5635,14 @@ %foo = func(%value:subgroup_matrix_result<f32, 8, 4>, %stride:u32):void { $B2: { %5:u32 = max %stride, 4u - %6:void = subgroupMatrixStore %arr, 0u, %value, true, %5 + %6:void = subgroupMatrixStore<col_major> %arr, 0u, %value, %5 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -5763,8 +5662,9 @@ func->AppendParam(value); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 0_u, value, true, stride); + // Dynamic stride should be clamped with `max` even when clamping is disabled. + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kColMajor}, arr, 0_u, value, stride); b.Return(func); }); @@ -5775,7 +5675,7 @@ %foo = func(%value:subgroup_matrix_result<i8, 8, 4>, %stride:u32):void { $B2: { - %5:void = subgroupMatrixStore %arr, 0u, %value, true, %stride + %5:void = subgroupMatrixStore<col_major> %arr, 0u, %value, %stride ret } } @@ -5789,17 +5689,14 @@ %foo = func(%value:subgroup_matrix_result<i8, 8, 4>, %stride:u32):void { $B2: { - %5:u32 = max %stride, 4u + %5:u32 = max %stride, 1u %6:u32 = mul %5, 7u %7:u32 = add 0u, %6 - %8:u32 = add %7, 4u - %9:bool = lte %8, 4096u - if %9 [t: $B3] { # if_1 - $B3: { # true - %10:void = subgroupMatrixStore %arr, 0u, %value, true, %5 - exit_if # if_1 - } - } + %8:u32 = add %7, 1u + %9:bool = lte %8, 1024u + %10:u32 = select 0u, 0u, %9 + %11:u32 = select 1u, %5, %9 + %12:void = subgroupMatrixStore<col_major> %arr, %10, %value, %11 ret } } @@ -5812,15 +5709,15 @@ %foo = func(%value:subgroup_matrix_result<i8, 8, 4>, %stride:u32):void { $B2: { - %5:u32 = max %stride, 4u - %6:void = subgroupMatrixStore %arr, 0u, %value, true, %5 + %5:u32 = max %stride, 1u + %6:void = subgroupMatrixStore<col_major> %arr, 0u, %value, %5 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -5840,8 +5737,9 @@ func->AppendParam(value); func->AppendParam(stride); b.Append(func->Block(), [&] { - // Dynamic stride should be clamped with `max` even when predication is disabled. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 0_u, value, true, stride); + // Dynamic stride should be clamped with `max` even when clamping is disabled. + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kColMajor}, arr, 0_u, value, stride); b.Return(func); }); @@ -5852,7 +5750,7 @@ %foo = func(%value:subgroup_matrix_result<u8, 8, 4>, %stride:u32):void { $B2: { - %5:void = subgroupMatrixStore %arr, 0u, %value, true, %stride + %5:void = subgroupMatrixStore<col_major> %arr, 0u, %value, %stride ret } } @@ -5866,17 +5764,14 @@ %foo = func(%value:subgroup_matrix_result<u8, 8, 4>, %stride:u32):void { $B2: { - %5:u32 = max %stride, 4u + %5:u32 = max %stride, 1u %6:u32 = mul %5, 7u %7:u32 = add 0u, %6 - %8:u32 = add %7, 4u - %9:bool = lte %8, 4096u - if %9 [t: $B3] { # if_1 - $B3: { # true - %10:void = subgroupMatrixStore %arr, 0u, %value, true, %5 - exit_if # if_1 - } - } + %8:u32 = add %7, 1u + %9:bool = lte %8, 1024u + %10:u32 = select 0u, 0u, %9 + %11:u32 = select 1u, %5, %9 + %12:void = subgroupMatrixStore<col_major> %arr, %10, %value, %11 ret } } @@ -5889,15 +5784,15 @@ %foo = func(%value:subgroup_matrix_result<u8, 8, 4>, %stride:u32):void { $B2: { - %5:u32 = max %stride, 4u - %6:void = subgroupMatrixStore %arr, 0u, %value, true, %5 + %5:u32 = max %stride, 1u + %6:void = subgroupMatrixStore<col_major> %arr, 0u, %value, %5 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect_with_predication : expect_without_predication, str()); @@ -5917,7 +5812,8 @@ b.Append(func->Block(), [&] { // The final row will start at 1016. Another full stride will take it past the 1024 limit, // but the transform should understand that only 8 elements are accessed on that row. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 920_u, value, false, 32_u); + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kRowMajor}, arr, 920_u, value, 32_u); b.Return(func); }); @@ -5928,7 +5824,7 @@ %foo = func(%value:subgroup_matrix_result<f32, 8, 4>):void { $B2: { - %4:void = subgroupMatrixStore %arr, 920u, %value, false, 32u + %4:void = subgroupMatrixStore<row_major> %arr, 920u, %value, 32u ret } } @@ -5938,7 +5834,7 @@ auto* expect = src; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(expect, str()); @@ -5958,7 +5854,8 @@ b.Append(func->Block(), [&] { // The final row will start at 1016. Another full stride will take it past the 1024 limit, // but the transform should understand that only 8 elements are accessed on that row. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 920_u, value, false, 32_u); + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kRowMajor}, arr, 920_u, value, 32_u); b.Return(func); }); @@ -5969,7 +5866,7 @@ %foo = func(%value:subgroup_matrix_result<i8, 8, 4>):void { $B2: { - %4:void = subgroupMatrixStore %arr, 920u, %value, false, 32u + %4:void = subgroupMatrixStore<row_major> %arr, 920u, %value, 32u ret } } @@ -5979,7 +5876,7 @@ auto* expect = src; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(expect, str()); @@ -5999,7 +5896,8 @@ b.Append(func->Block(), [&] { // The final row will start at 1016. Another full stride will take it past the 1024 limit, // but the transform should understand that only 8 elements are accessed on that row. - b.Call(ty.void_(), BuiltinFn::kSubgroupMatrixStore, arr, 920_u, value, false, 32_u); + b.CallExplicit(ty.void_(), BuiltinFn::kSubgroupMatrixStore, + Vector<TemplateParameter, 1>{Majorness::kRowMajor}, arr, 920_u, value, 32_u); b.Return(func); }); @@ -6010,7 +5908,7 @@ %foo = func(%value:subgroup_matrix_result<u8, 8, 4>):void { $B2: { - %4:void = subgroupMatrixStore %arr, 920u, %value, false, 32u + %4:void = subgroupMatrixStore<row_major> %arr, 920u, %value, 32u ret } } @@ -6020,7 +5918,7 @@ auto* expect = src; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(expect, str()); @@ -6083,22 +5981,20 @@ $B2: { %6:u32 = max %stride, 1u %7:u32 = arrayLength %v - %8:u32 = mul %7, 16u - %9:u32 = mul %6, 7u - %10:u32 = add %offset, %9 - %11:u32 = mul %10, 16u - %12:u32 = add %11, 16u - %13:bool = lte %12, %8 - %14:u32 = select 0u, %offset, %13 - %15:u32 = select 1u, %6, %13 - %16:void = subgroupMatrixStore<col_major> %v, %14, %m, %15 + %8:u32 = mul %6, 7u + %9:u32 = add %offset, %8 + %10:u32 = add %9, 1u + %11:bool = lte %10, %7 + %12:u32 = select 0u, %offset, %11 + %13:u32 = select 1u, %6, %11 + %14:void = subgroupMatrixStore<col_major> %v, %12, %m, %13 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? robust : no_robust, str()); @@ -6161,22 +6057,20 @@ $B2: { %6:u32 = max %stride, 1u %7:u32 = arrayLength %v - %8:u32 = mul %7, 8u - %9:u32 = mul %6, 7u - %10:u32 = add %offset, %9 - %11:u32 = mul %10, 8u - %12:u32 = add %11, 8u - %13:bool = lte %12, %8 - %14:u32 = select 0u, %offset, %13 - %15:u32 = select 1u, %6, %13 - %16:void = subgroupMatrixStore<col_major> %v, %14, %m, %15 + %8:u32 = mul %6, 7u + %9:u32 = add %offset, %8 + %10:u32 = add %9, 1u + %11:bool = lte %10, %7 + %12:u32 = select 0u, %offset, %11 + %13:u32 = select 1u, %6, %11 + %14:void = subgroupMatrixStore<col_major> %v, %12, %m, %13 ret } } )"; RobustnessConfig cfg; - cfg.predicate_subgroup_matrix = GetParam(); + cfg.clamp_subgroup_matrix = GetParam(); Run(Robustness, cfg); EXPECT_EQ(GetParam() ? robust : no_robust, str()); @@ -6986,7 +6880,7 @@ RobustnessConfig cfg; cfg.clamp_storage = GetParam(); - cfg.predicate_subgroup_matrix = false; + cfg.clamp_subgroup_matrix = false; Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect : src, str()); @@ -7047,7 +6941,7 @@ RobustnessConfig cfg; cfg.clamp_storage = GetParam(); - cfg.predicate_subgroup_matrix = false; + cfg.clamp_subgroup_matrix = false; Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect : src, str()); @@ -7143,7 +7037,7 @@ RobustnessConfig cfg; cfg.clamp_storage = GetParam(); - cfg.predicate_subgroup_matrix = false; + cfg.clamp_subgroup_matrix = false; Run(Robustness, cfg); EXPECT_EQ(GetParam() ? expect : src, str());
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl index 373d047..5ff2398 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -14,43 +14,43 @@ void main() { uint v_1 = 0u; in0.GetDimensions(v_1); - bool v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_1 / 4u) * 2u)); + bool v_2 = (((0u + (16u * 7u)) + 4u) <= (v_1 / 4u)); Matrix_left_f16_8x8 m0 = Matrix_left_f16_8x8::Load(in0, (0u + (select(v_2, 0u, 0u) * 2u)), (select(v_2, 16u, 4u) * 2u), MatrixLayout::ColMajor); uint v_3 = 0u; v.GetDimensions(v_3); uint v_4 = asuint(int(0)); uint v_5 = asuint(int(16)); - bool v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= ((v_3 / 4u) * 2u)); + bool v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= (v_3 / 4u)); m0.Store(v, (0u + (select(v_6, v_4, 0u) * 2u)), (select(v_6, v_5, 4u) * 2u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_7 / 8u) * 4u)); + bool v_8 = (((0u + (16u * 7u)) + 2u) <= (v_7 / 8u)); Matrix_left_f16_8x8 m1 = Matrix_left_f16_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 2u)), (select(v_8, 16u, 2u) * 2u), MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 2u) + 8u) <= ((v_9 / 4u) * 2u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 4u) <= (v_9 / 4u)); m1.Store(v, (0u + (select(v_12, v_10, 0u) * 2u)), (select(v_12, v_11, 4u) * 2u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_13 / 16u) * 8u)); + bool v_14 = (((0u + (16u * 7u)) + 1u) <= (v_13 / 16u)); Matrix_left_f16_8x8 m2 = Matrix_left_f16_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 2u)), (select(v_14, 16u, 1u) * 2u), MatrixLayout::ColMajor); uint v_15 = 0u; v.GetDimensions(v_15); uint v_16 = asuint(int(0)); uint v_17 = asuint(int(16)); - bool v_18 = ((((v_16 + (v_17 * 7u)) * 2u) + 8u) <= ((v_15 / 4u) * 2u)); + bool v_18 = (((v_16 + (v_17 * 7u)) + 4u) <= (v_15 / 4u)); m2.Store(v, (0u + (select(v_18, v_16, 0u) * 2u)), (select(v_18, v_17, 4u) * 2u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_19 / 16u) * 8u)); + bool v_20 = (((0u + (16u * 7u)) + 1u) <= (v_19 / 16u)); Matrix_left_f16_8x8 m3 = Matrix_left_f16_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 2u)), (select(v_20, 16u, 1u) * 2u), MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 2u) + 8u) <= ((v_21 / 4u) * 2u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 4u) <= (v_21 / 4u)); m3.Store(v, (0u + (select(v_24, v_22, 0u) * 2u)), (select(v_24, v_23, 4u) * 2u), MatrixLayout::ColMajor); uint v_25 = 0u; in4.GetDimensions(v_25); @@ -60,27 +60,27 @@ v.GetDimensions(v_27); uint v_28 = asuint(int(0)); uint v_29 = asuint(int(16)); - bool v_30 = ((((v_28 + (v_29 * 7u)) * 2u) + 8u) <= ((v_27 / 4u) * 2u)); + bool v_30 = (((v_28 + (v_29 * 7u)) + 4u) <= (v_27 / 4u)); m4.Store(v, (0u + (select(v_30, v_28, 0u) * 2u)), (select(v_30, v_29, 4u) * 2u), MatrixLayout::ColMajor); uint v_31 = 0u; in5.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_31 / 4u) * 2u)); + bool v_32 = (((0u + (16u * 7u)) + 4u) <= (v_31 / 4u)); Matrix_left_f16_8x8 m5 = Matrix_left_f16_8x8::Load(in5, (0u + (select(v_32, 0u, 0u) * 2u)), (select(v_32, 16u, 4u) * 2u), MatrixLayout::ColMajor); uint v_33 = 0u; v.GetDimensions(v_33); uint v_34 = asuint(int(0)); uint v_35 = asuint(int(16)); - bool v_36 = ((((v_34 + (v_35 * 7u)) * 2u) + 8u) <= ((v_33 / 4u) * 2u)); + bool v_36 = (((v_34 + (v_35 * 7u)) + 4u) <= (v_33 / 4u)); m5.Store(v, (0u + (select(v_36, v_34, 0u) * 2u)), (select(v_36, v_35, 4u) * 2u), MatrixLayout::ColMajor); uint v_37 = 0u; in6.GetDimensions(v_37); - bool v_38 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_37 / 8u) * 4u)); + bool v_38 = (((0u + (16u * 7u)) + 2u) <= (v_37 / 8u)); Matrix_left_f16_8x8 m6 = Matrix_left_f16_8x8::Load(in6, (0u + (select(v_38, 0u, 0u) * 2u)), (select(v_38, 16u, 2u) * 2u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 2u) + 8u) <= ((v_39 / 4u) * 2u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 4u) <= (v_39 / 4u)); m6.Store(v, (0u + (select(v_42, v_40, 0u) * 2u)), (select(v_42, v_41, 4u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_col_major.wgsl.expected.msl index 5dc6c09..1b86e40 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_col_major.wgsl.expected.msl
@@ -50,37 +50,37 @@ kernel void v(const device tint_array<uint, 1>* in0 [[buffer(0)]], const device tint_array<int2, 1>* in1 [[buffer(1)]], const device tint_array<tint_packed_vec3_f32_array_element, 1>* in2 [[buffer(2)]], const device tint_array<uint4, 1>* in3 [[buffer(3)]], const device tint_array<half, 1>* in4 [[buffer(4)]], const device tint_array<half2, 1>* in5 [[buffer(5)]], const device tint_array<tint_packed_vec3_f16_array_element, 1>* in6 [[buffer(6)]], device tint_array<uint, 1>* out [[buffer(7)]], const constant tint_array<uint4, 2>* tint_storage_buffer_sizes [[buffer(30)]]) { tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.in0=in0, .in1=in1, .in2=in2, .in3=in3, .in4=in4, .in5=in5, .in6=in6, .out=out, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; tint_array_lengths_struct const v_1 = tint_array_lengths_struct{.tint_array_length_0_0=((*tint_module_vars.tint_storage_buffer_sizes)[0u].x / 4u), .tint_array_length_0_7=((*tint_module_vars.tint_storage_buffer_sizes)[1u].w / 4u), .tint_array_length_0_1=((*tint_module_vars.tint_storage_buffer_sizes)[0u].y / 8u), .tint_array_length_0_2=((*tint_module_vars.tint_storage_buffer_sizes)[0u].z / 16u), .tint_array_length_0_3=((*tint_module_vars.tint_storage_buffer_sizes)[0u].w / 16u), .tint_array_length_0_4=((*tint_module_vars.tint_storage_buffer_sizes)[1u].x / 2u), .tint_array_length_0_5=((*tint_module_vars.tint_storage_buffer_sizes)[1u].y / 4u), .tint_array_length_0_6=((*tint_module_vars.tint_storage_buffer_sizes)[1u].z / 8u)}; - bool const v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_0 * 2u)); + bool const v_2 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_0); simdgroup_half8x8 v_3 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_3, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in0) + (select(0u, 0u, v_2) * 4u)), ulong((select(4u, 16u, v_2) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 const m0 = v_3; uint const v_4 = as_type<uint>(0); uint const v_5 = as_type<uint>(16); - bool const v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_4, v_6) * 4u)), ulong((select(4u, v_5, v_6) * 2u)), ulong2(0ul), true)); - bool const v_7 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_1 * 4u)); + bool const v_7 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_1); simdgroup_half8x8 v_8 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_8, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (select(0u, 0u, v_7) * 8u)), ulong((select(2u, 16u, v_7) * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m1 = v_8; uint const v_9 = as_type<uint>(0); uint const v_10 = as_type<uint>(16); - bool const v_11 = ((((v_9 + (v_10 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_11 = (((v_9 + (v_10 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_9, v_11) * 4u)), ulong((select(4u, v_10, v_11) * 2u)), ulong2(0ul), true)); - bool const v_12 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_2 * 8u)); + bool const v_12 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_2); simdgroup_half8x8 v_13 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_13, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (select(0u, 0u, v_12) * 16u)), ulong((select(1u, 16u, v_12) * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m2 = v_13; uint const v_14 = as_type<uint>(0); uint const v_15 = as_type<uint>(16); - bool const v_16 = ((((v_14 + (v_15 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_16 = (((v_14 + (v_15 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_14, v_16) * 4u)), ulong((select(4u, v_15, v_16) * 2u)), ulong2(0ul), true)); - bool const v_17 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_3 * 8u)); + bool const v_17 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_3); simdgroup_half8x8 v_18 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_18, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (select(0u, 0u, v_17) * 16u)), ulong((select(1u, 16u, v_17) * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m3 = v_18; uint const v_19 = as_type<uint>(0); uint const v_20 = as_type<uint>(16); - bool const v_21 = ((((v_19 + (v_20 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_21 = (((v_19 + (v_20 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_19, v_21) * 4u)), ulong((select(4u, v_20, v_21) * 2u)), ulong2(0ul), true)); bool const v_22 = (((0u + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); simdgroup_half8x8 v_23 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); @@ -88,22 +88,22 @@ simdgroup_half8x8 const m4 = v_23; uint const v_24 = as_type<uint>(0); uint const v_25 = as_type<uint>(16); - bool const v_26 = ((((v_24 + (v_25 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_26 = (((v_24 + (v_25 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_24, v_26) * 4u)), ulong((select(4u, v_25, v_26) * 2u)), ulong2(0ul), true)); - bool const v_27 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_27 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); simdgroup_half8x8 v_28 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_28, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in5) + (select(0u, 0u, v_27) * 4u)), ulong((select(4u, 16u, v_27) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 const m5 = v_28; uint const v_29 = as_type<uint>(0); uint const v_30 = as_type<uint>(16); - bool const v_31 = ((((v_29 + (v_30 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_31 = (((v_29 + (v_30 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_29, v_31) * 4u)), ulong((select(4u, v_30, v_31) * 2u)), ulong2(0ul), true)); - bool const v_32 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_6 * 4u)); + bool const v_32 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_6); simdgroup_half8x8 v_33 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_33, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (select(0u, 0u, v_32) * 8u)), ulong((select(2u, 16u, v_32) * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m6 = v_33; uint const v_34 = as_type<uint>(0); uint const v_35 = as_type<uint>(16); - bool const v_36 = ((((v_34 + (v_35 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_36 = (((v_34 + (v_35 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_34, v_36) * 4u)), ulong((select(4u, v_35, v_36) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_col_major.wgsl.expected.spvasm index da974aa..ba96e11 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 267 +; Bound: 241 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,21 +128,21 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_2 = OpConstant %uint 2 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 - %67 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_0 + %uint_8 = OpConstant %uint 8 + %63 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_0 %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float @@ -158,197 +158,171 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_2 - %51 = OpIMul %uint %uint_16 %uint_7 - %54 = OpIAdd %uint %uint_0 %51 - %55 = OpIMul %uint %54 %uint_2 - %56 = OpIAdd %uint %55 %uint_8 - %58 = OpULessThanEqual %bool %56 %49 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_4 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - %m0 = OpCooperativeMatrixLoadKHR %67 %64 %uint_1 %61 None - %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %72 = OpArrayLength %uint %38 0 - %73 = OpIMul %uint %72 %uint_2 - %74 = OpBitcast %uint %int_0 - %76 = OpBitcast %uint %int_16 - %78 = OpIMul %uint %76 %uint_7 - %79 = OpIAdd %uint %74 %78 - %80 = OpIMul %uint %79 %uint_2 - %81 = OpIAdd %uint %80 %uint_8 - %82 = OpULessThanEqual %bool %81 %73 - %83 = OpSelect %uint %82 %74 %uint_0 - %84 = OpSelect %uint %82 %76 %uint_4 - %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %86 = OpAccessChain %_ptr_StorageBuffer_uint_0 %85 %83 - OpCooperativeMatrixStoreKHR %86 %m0 %uint_1 %84 NonPrivatePointer - %89 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %91 = OpArrayLength %uint %6 0 - %92 = OpIMul %uint %91 %uint_4 - %93 = OpIMul %uint %uint_16 %uint_7 - %94 = OpIAdd %uint %uint_0 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %92 - %98 = OpSelect %uint %97 %uint_0 %uint_0 - %99 = OpSelect %uint %97 %uint_16 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_v2int %100 %98 - %m1 = OpCooperativeMatrixLoadKHR %67 %101 %uint_1 %99 None - %104 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %105 = OpArrayLength %uint %38 0 - %106 = OpIMul %uint %105 %uint_2 - %107 = OpBitcast %uint %int_0 - %108 = OpBitcast %uint %int_16 - %109 = OpIMul %uint %108 %uint_7 - %110 = OpIAdd %uint %107 %109 - %111 = OpIMul %uint %110 %uint_2 - %112 = OpIAdd %uint %111 %uint_8 - %113 = OpULessThanEqual %bool %112 %106 - %114 = OpSelect %uint %113 %107 %uint_0 - %115 = OpSelect %uint %113 %108 %uint_4 - %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %117 = OpAccessChain %_ptr_StorageBuffer_uint_0 %116 %114 - OpCooperativeMatrixStoreKHR %117 %m1 %uint_1 %115 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %121 = OpArrayLength %uint %12 0 - %122 = OpIMul %uint %121 %uint_8 - %123 = OpIMul %uint %uint_16 %uint_7 - %124 = OpIAdd %uint %uint_0 %123 - %125 = OpIMul %uint %124 %uint_8 - %126 = OpIAdd %uint %125 %uint_8 - %127 = OpULessThanEqual %bool %126 %122 - %128 = OpSelect %uint %127 %uint_0 %uint_0 - %129 = OpSelect %uint %127 %uint_16 %uint_1 - %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %131 = OpAccessChain %_ptr_StorageBuffer_v3float %130 %128 - %m2 = OpCooperativeMatrixLoadKHR %67 %131 %uint_1 %129 None + %49 = OpIMul %uint %uint_16 %uint_7 + %52 = OpIAdd %uint %uint_0 %49 + %53 = OpIAdd %uint %52 %uint_4 + %55 = OpULessThanEqual %bool %53 %48 + %57 = OpSelect %uint %55 %uint_0 %uint_0 + %58 = OpSelect %uint %55 %uint_16 %uint_4 + %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %60 = OpAccessChain %_ptr_StorageBuffer_uint %59 %57 + %m0 = OpCooperativeMatrixLoadKHR %63 %60 %uint_1 %58 None + %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %69 = OpArrayLength %uint %38 0 + %70 = OpBitcast %uint %int_0 + %72 = OpBitcast %uint %int_16 + %74 = OpIMul %uint %72 %uint_7 + %75 = OpIAdd %uint %70 %74 + %76 = OpIAdd %uint %75 %uint_4 + %77 = OpULessThanEqual %bool %76 %69 + %78 = OpSelect %uint %77 %70 %uint_0 + %79 = OpSelect %uint %77 %72 %uint_4 + %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_uint_0 %80 %78 + OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %79 NonPrivatePointer + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %86 = OpArrayLength %uint %6 0 + %87 = OpIMul %uint %uint_16 %uint_7 + %88 = OpIAdd %uint %uint_0 %87 + %89 = OpIAdd %uint %88 %uint_2 + %91 = OpULessThanEqual %bool %89 %86 + %92 = OpSelect %uint %91 %uint_0 %uint_0 + %93 = OpSelect %uint %91 %uint_16 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %92 + %m1 = OpCooperativeMatrixLoadKHR %63 %95 %uint_1 %93 None + %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %99 = OpArrayLength %uint %38 0 + %100 = OpBitcast %uint %int_0 + %101 = OpBitcast %uint %int_16 + %102 = OpIMul %uint %101 %uint_7 + %103 = OpIAdd %uint %100 %102 + %104 = OpIAdd %uint %103 %uint_4 + %105 = OpULessThanEqual %bool %104 %99 + %106 = OpSelect %uint %105 %100 %uint_0 + %107 = OpSelect %uint %105 %101 %uint_4 + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 + OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %113 = OpArrayLength %uint %12 0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %uint_0 %114 + %116 = OpIAdd %uint %115 %uint_1 + %117 = OpULessThanEqual %bool %116 %113 + %118 = OpSelect %uint %117 %uint_0 %uint_0 + %119 = OpSelect %uint %117 %uint_16 %uint_1 + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 + %m2 = OpCooperativeMatrixLoadKHR %63 %121 %uint_1 %119 None + %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %125 = OpArrayLength %uint %38 0 + %126 = OpBitcast %uint %int_0 + %127 = OpBitcast %uint %int_16 + %128 = OpIMul %uint %127 %uint_7 + %129 = OpIAdd %uint %126 %128 + %130 = OpIAdd %uint %129 %uint_4 + %131 = OpULessThanEqual %bool %130 %125 + %132 = OpSelect %uint %131 %126 %uint_0 + %133 = OpSelect %uint %131 %127 %uint_4 %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %135 = OpArrayLength %uint %38 0 - %136 = OpIMul %uint %135 %uint_2 - %137 = OpBitcast %uint %int_0 - %138 = OpBitcast %uint %int_16 - %139 = OpIMul %uint %138 %uint_7 - %140 = OpIAdd %uint %137 %139 - %141 = OpIMul %uint %140 %uint_2 - %142 = OpIAdd %uint %141 %uint_8 - %143 = OpULessThanEqual %bool %142 %136 - %144 = OpSelect %uint %143 %137 %uint_0 - %145 = OpSelect %uint %143 %138 %uint_4 - %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %147 = OpAccessChain %_ptr_StorageBuffer_uint_0 %146 %144 - OpCooperativeMatrixStoreKHR %147 %m2 %uint_1 %145 NonPrivatePointer - %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %151 = OpArrayLength %uint %18 0 - %152 = OpIMul %uint %151 %uint_8 - %153 = OpIMul %uint %uint_16 %uint_7 - %154 = OpIAdd %uint %uint_0 %153 - %155 = OpIMul %uint %154 %uint_8 - %156 = OpIAdd %uint %155 %uint_8 - %157 = OpULessThanEqual %bool %156 %152 - %158 = OpSelect %uint %157 %uint_0 %uint_0 - %159 = OpSelect %uint %157 %uint_16 %uint_1 - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %161 = OpAccessChain %_ptr_StorageBuffer_v4uint %160 %158 - %m3 = OpCooperativeMatrixLoadKHR %67 %161 %uint_1 %159 None - %164 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %165 = OpArrayLength %uint %38 0 - %166 = OpIMul %uint %165 %uint_2 - %167 = OpBitcast %uint %int_0 - %168 = OpBitcast %uint %int_16 - %169 = OpIMul %uint %168 %uint_7 - %170 = OpIAdd %uint %167 %169 - %171 = OpIMul %uint %170 %uint_2 - %172 = OpIAdd %uint %171 %uint_8 - %173 = OpULessThanEqual %bool %172 %166 - %174 = OpSelect %uint %173 %167 %uint_0 - %175 = OpSelect %uint %173 %168 %uint_4 + %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 + OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %139 = OpArrayLength %uint %18 0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %uint_0 %140 + %142 = OpIAdd %uint %141 %uint_1 + %143 = OpULessThanEqual %bool %142 %139 + %144 = OpSelect %uint %143 %uint_0 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_1 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %63 %147 %uint_1 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %151 = OpArrayLength %uint %38 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_4 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_4 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpIMul %uint %uint_16 %uint_7 + %167 = OpIAdd %uint %uint_0 %166 + %168 = OpIAdd %uint %167 %uint_8 + %169 = OpULessThanEqual %bool %168 %165 + %170 = OpSelect %uint %169 %uint_0 %uint_0 + %171 = OpSelect %uint %169 %uint_16 %uint_8 + %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %173 = OpAccessChain %_ptr_StorageBuffer_half %172 %170 + %m4 = OpCooperativeMatrixLoadKHR %63 %173 %uint_1 %171 None %176 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %177 = OpAccessChain %_ptr_StorageBuffer_uint_0 %176 %174 - OpCooperativeMatrixStoreKHR %177 %m3 %uint_1 %175 NonPrivatePointer - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %181 = OpArrayLength %uint %23 0 - %182 = OpIMul %uint %uint_16 %uint_7 - %183 = OpIAdd %uint %uint_0 %182 - %184 = OpIAdd %uint %183 %uint_8 - %185 = OpULessThanEqual %bool %184 %181 - %186 = OpSelect %uint %185 %uint_0 %uint_0 - %187 = OpSelect %uint %185 %uint_16 %uint_8 - %188 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %189 = OpAccessChain %_ptr_StorageBuffer_half %188 %186 - %m4 = OpCooperativeMatrixLoadKHR %67 %189 %uint_1 %187 None - %192 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %193 = OpArrayLength %uint %38 0 - %194 = OpIMul %uint %193 %uint_2 - %195 = OpBitcast %uint %int_0 - %196 = OpBitcast %uint %int_16 - %197 = OpIMul %uint %196 %uint_7 - %198 = OpIAdd %uint %195 %197 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpIAdd %uint %199 %uint_8 - %201 = OpULessThanEqual %bool %200 %194 - %202 = OpSelect %uint %201 %195 %uint_0 - %203 = OpSelect %uint %201 %196 %uint_4 - %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %205 = OpAccessChain %_ptr_StorageBuffer_uint_0 %204 %202 - OpCooperativeMatrixStoreKHR %205 %m4 %uint_1 %203 NonPrivatePointer - %207 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %209 = OpArrayLength %uint %28 0 - %210 = OpIMul %uint %209 %uint_2 - %211 = OpIMul %uint %uint_16 %uint_7 - %212 = OpIAdd %uint %uint_0 %211 - %213 = OpIMul %uint %212 %uint_2 - %214 = OpIAdd %uint %213 %uint_8 - %215 = OpULessThanEqual %bool %214 %210 - %216 = OpSelect %uint %215 %uint_0 %uint_0 - %217 = OpSelect %uint %215 %uint_16 %uint_4 - %218 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %219 = OpAccessChain %_ptr_StorageBuffer_v2half %218 %216 - %m5 = OpCooperativeMatrixLoadKHR %67 %219 %uint_1 %217 None - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %223 = OpArrayLength %uint %38 0 - %224 = OpIMul %uint %223 %uint_2 - %225 = OpBitcast %uint %int_0 - %226 = OpBitcast %uint %int_16 - %227 = OpIMul %uint %226 %uint_7 - %228 = OpIAdd %uint %225 %227 - %229 = OpIMul %uint %228 %uint_2 - %230 = OpIAdd %uint %229 %uint_8 - %231 = OpULessThanEqual %bool %230 %224 - %232 = OpSelect %uint %231 %225 %uint_0 - %233 = OpSelect %uint %231 %226 %uint_4 - %234 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %235 = OpAccessChain %_ptr_StorageBuffer_uint_0 %234 %232 - OpCooperativeMatrixStoreKHR %235 %m5 %uint_1 %233 NonPrivatePointer - %237 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %239 = OpArrayLength %uint %33 0 - %240 = OpIMul %uint %239 %uint_4 - %241 = OpIMul %uint %uint_16 %uint_7 - %242 = OpIAdd %uint %uint_0 %241 - %243 = OpIMul %uint %242 %uint_4 - %244 = OpIAdd %uint %243 %uint_8 - %245 = OpULessThanEqual %bool %244 %240 - %246 = OpSelect %uint %245 %uint_0 %uint_0 - %247 = OpSelect %uint %245 %uint_16 %uint_2 - %248 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %249 = OpAccessChain %_ptr_StorageBuffer_v3half %248 %246 - %m6 = OpCooperativeMatrixLoadKHR %67 %249 %uint_1 %247 None - %252 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %253 = OpArrayLength %uint %38 0 - %254 = OpIMul %uint %253 %uint_2 - %255 = OpBitcast %uint %int_0 - %256 = OpBitcast %uint %int_16 - %257 = OpIMul %uint %256 %uint_7 - %258 = OpIAdd %uint %255 %257 - %259 = OpIMul %uint %258 %uint_2 - %260 = OpIAdd %uint %259 %uint_8 - %261 = OpULessThanEqual %bool %260 %254 - %262 = OpSelect %uint %261 %255 %uint_0 - %263 = OpSelect %uint %261 %256 %uint_4 - %264 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %265 = OpAccessChain %_ptr_StorageBuffer_uint_0 %264 %262 - OpCooperativeMatrixStoreKHR %265 %m6 %uint_1 %263 NonPrivatePointer + %177 = OpArrayLength %uint %38 0 + %178 = OpBitcast %uint %int_0 + %179 = OpBitcast %uint %int_16 + %180 = OpIMul %uint %179 %uint_7 + %181 = OpIAdd %uint %178 %180 + %182 = OpIAdd %uint %181 %uint_4 + %183 = OpULessThanEqual %bool %182 %177 + %184 = OpSelect %uint %183 %178 %uint_0 + %185 = OpSelect %uint %183 %179 %uint_4 + %186 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %187 = OpAccessChain %_ptr_StorageBuffer_uint_0 %186 %184 + OpCooperativeMatrixStoreKHR %187 %m4 %uint_1 %185 NonPrivatePointer + %189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %191 = OpArrayLength %uint %28 0 + %192 = OpIMul %uint %uint_16 %uint_7 + %193 = OpIAdd %uint %uint_0 %192 + %194 = OpIAdd %uint %193 %uint_4 + %195 = OpULessThanEqual %bool %194 %191 + %196 = OpSelect %uint %195 %uint_0 %uint_0 + %197 = OpSelect %uint %195 %uint_16 %uint_4 + %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %199 = OpAccessChain %_ptr_StorageBuffer_v2half %198 %196 + %m5 = OpCooperativeMatrixLoadKHR %63 %199 %uint_1 %197 None + %202 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %203 = OpArrayLength %uint %38 0 + %204 = OpBitcast %uint %int_0 + %205 = OpBitcast %uint %int_16 + %206 = OpIMul %uint %205 %uint_7 + %207 = OpIAdd %uint %204 %206 + %208 = OpIAdd %uint %207 %uint_4 + %209 = OpULessThanEqual %bool %208 %203 + %210 = OpSelect %uint %209 %204 %uint_0 + %211 = OpSelect %uint %209 %205 %uint_4 + %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %213 = OpAccessChain %_ptr_StorageBuffer_uint_0 %212 %210 + OpCooperativeMatrixStoreKHR %213 %m5 %uint_1 %211 NonPrivatePointer + %215 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %217 = OpArrayLength %uint %33 0 + %218 = OpIMul %uint %uint_16 %uint_7 + %219 = OpIAdd %uint %uint_0 %218 + %220 = OpIAdd %uint %219 %uint_2 + %221 = OpULessThanEqual %bool %220 %217 + %222 = OpSelect %uint %221 %uint_0 %uint_0 + %223 = OpSelect %uint %221 %uint_16 %uint_2 + %224 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %225 = OpAccessChain %_ptr_StorageBuffer_v3half %224 %222 + %m6 = OpCooperativeMatrixLoadKHR %63 %225 %uint_1 %223 None + %228 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %229 = OpArrayLength %uint %38 0 + %230 = OpBitcast %uint %int_0 + %231 = OpBitcast %uint %int_16 + %232 = OpIMul %uint %231 %uint_7 + %233 = OpIAdd %uint %230 %232 + %234 = OpIAdd %uint %233 %uint_4 + %235 = OpULessThanEqual %bool %234 %229 + %236 = OpSelect %uint %235 %230 %uint_0 + %237 = OpSelect %uint %235 %231 %uint_4 + %238 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %239 = OpAccessChain %_ptr_StorageBuffer_uint_0 %238 %236 + OpCooperativeMatrixStoreKHR %239 %m6 %uint_1 %237 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl index b876b6f..f8e5469 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -14,43 +14,43 @@ void main() { uint v_1 = 0u; in0.GetDimensions(v_1); - bool v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_1 / 4u) * 2u)); + bool v_2 = (((0u + (16u * 7u)) + 4u) <= (v_1 / 4u)); Matrix_left_f16_8x8 m0 = Matrix_left_f16_8x8::Load(in0, (0u + (select(v_2, 0u, 0u) * 2u)), (select(v_2, 16u, 4u) * 2u), MatrixLayout::RowMajor); uint v_3 = 0u; v.GetDimensions(v_3); uint v_4 = asuint(int(0)); uint v_5 = asuint(int(16)); - bool v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= ((v_3 / 4u) * 2u)); + bool v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= (v_3 / 4u)); m0.Store(v, (0u + (select(v_6, v_4, 0u) * 2u)), (select(v_6, v_5, 4u) * 2u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_7 / 8u) * 4u)); + bool v_8 = (((0u + (16u * 7u)) + 2u) <= (v_7 / 8u)); Matrix_left_f16_8x8 m1 = Matrix_left_f16_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 2u)), (select(v_8, 16u, 2u) * 2u), MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 2u) + 8u) <= ((v_9 / 4u) * 2u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 4u) <= (v_9 / 4u)); m1.Store(v, (0u + (select(v_12, v_10, 0u) * 2u)), (select(v_12, v_11, 4u) * 2u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_13 / 16u) * 8u)); + bool v_14 = (((0u + (16u * 7u)) + 1u) <= (v_13 / 16u)); Matrix_left_f16_8x8 m2 = Matrix_left_f16_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 2u)), (select(v_14, 16u, 1u) * 2u), MatrixLayout::RowMajor); uint v_15 = 0u; v.GetDimensions(v_15); uint v_16 = asuint(int(0)); uint v_17 = asuint(int(16)); - bool v_18 = ((((v_16 + (v_17 * 7u)) * 2u) + 8u) <= ((v_15 / 4u) * 2u)); + bool v_18 = (((v_16 + (v_17 * 7u)) + 4u) <= (v_15 / 4u)); m2.Store(v, (0u + (select(v_18, v_16, 0u) * 2u)), (select(v_18, v_17, 4u) * 2u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_19 / 16u) * 8u)); + bool v_20 = (((0u + (16u * 7u)) + 1u) <= (v_19 / 16u)); Matrix_left_f16_8x8 m3 = Matrix_left_f16_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 2u)), (select(v_20, 16u, 1u) * 2u), MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 2u) + 8u) <= ((v_21 / 4u) * 2u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 4u) <= (v_21 / 4u)); m3.Store(v, (0u + (select(v_24, v_22, 0u) * 2u)), (select(v_24, v_23, 4u) * 2u), MatrixLayout::ColMajor); uint v_25 = 0u; in4.GetDimensions(v_25); @@ -60,27 +60,27 @@ v.GetDimensions(v_27); uint v_28 = asuint(int(0)); uint v_29 = asuint(int(16)); - bool v_30 = ((((v_28 + (v_29 * 7u)) * 2u) + 8u) <= ((v_27 / 4u) * 2u)); + bool v_30 = (((v_28 + (v_29 * 7u)) + 4u) <= (v_27 / 4u)); m4.Store(v, (0u + (select(v_30, v_28, 0u) * 2u)), (select(v_30, v_29, 4u) * 2u), MatrixLayout::ColMajor); uint v_31 = 0u; in5.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_31 / 4u) * 2u)); + bool v_32 = (((0u + (16u * 7u)) + 4u) <= (v_31 / 4u)); Matrix_left_f16_8x8 m5 = Matrix_left_f16_8x8::Load(in5, (0u + (select(v_32, 0u, 0u) * 2u)), (select(v_32, 16u, 4u) * 2u), MatrixLayout::RowMajor); uint v_33 = 0u; v.GetDimensions(v_33); uint v_34 = asuint(int(0)); uint v_35 = asuint(int(16)); - bool v_36 = ((((v_34 + (v_35 * 7u)) * 2u) + 8u) <= ((v_33 / 4u) * 2u)); + bool v_36 = (((v_34 + (v_35 * 7u)) + 4u) <= (v_33 / 4u)); m5.Store(v, (0u + (select(v_36, v_34, 0u) * 2u)), (select(v_36, v_35, 4u) * 2u), MatrixLayout::ColMajor); uint v_37 = 0u; in6.GetDimensions(v_37); - bool v_38 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_37 / 8u) * 4u)); + bool v_38 = (((0u + (16u * 7u)) + 2u) <= (v_37 / 8u)); Matrix_left_f16_8x8 m6 = Matrix_left_f16_8x8::Load(in6, (0u + (select(v_38, 0u, 0u) * 2u)), (select(v_38, 16u, 2u) * 2u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 2u) + 8u) <= ((v_39 / 4u) * 2u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 4u) <= (v_39 / 4u)); m6.Store(v, (0u + (select(v_42, v_40, 0u) * 2u)), (select(v_42, v_41, 4u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_row_major.wgsl.expected.msl index bfaa1f1..10db296 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_row_major.wgsl.expected.msl
@@ -50,37 +50,37 @@ kernel void v(const device tint_array<uint, 1>* in0 [[buffer(0)]], const device tint_array<int2, 1>* in1 [[buffer(1)]], const device tint_array<tint_packed_vec3_f32_array_element, 1>* in2 [[buffer(2)]], const device tint_array<uint4, 1>* in3 [[buffer(3)]], const device tint_array<half, 1>* in4 [[buffer(4)]], const device tint_array<half2, 1>* in5 [[buffer(5)]], const device tint_array<tint_packed_vec3_f16_array_element, 1>* in6 [[buffer(6)]], device tint_array<uint, 1>* out [[buffer(7)]], const constant tint_array<uint4, 2>* tint_storage_buffer_sizes [[buffer(30)]]) { tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.in0=in0, .in1=in1, .in2=in2, .in3=in3, .in4=in4, .in5=in5, .in6=in6, .out=out, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; tint_array_lengths_struct const v_1 = tint_array_lengths_struct{.tint_array_length_0_0=((*tint_module_vars.tint_storage_buffer_sizes)[0u].x / 4u), .tint_array_length_0_7=((*tint_module_vars.tint_storage_buffer_sizes)[1u].w / 4u), .tint_array_length_0_1=((*tint_module_vars.tint_storage_buffer_sizes)[0u].y / 8u), .tint_array_length_0_2=((*tint_module_vars.tint_storage_buffer_sizes)[0u].z / 16u), .tint_array_length_0_3=((*tint_module_vars.tint_storage_buffer_sizes)[0u].w / 16u), .tint_array_length_0_4=((*tint_module_vars.tint_storage_buffer_sizes)[1u].x / 2u), .tint_array_length_0_5=((*tint_module_vars.tint_storage_buffer_sizes)[1u].y / 4u), .tint_array_length_0_6=((*tint_module_vars.tint_storage_buffer_sizes)[1u].z / 8u)}; - bool const v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_0 * 2u)); + bool const v_2 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_0); simdgroup_half8x8 v_3 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_3, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in0) + (select(0u, 0u, v_2) * 4u)), ulong((select(4u, 16u, v_2) * 2u)), ulong2(0ul), false)); simdgroup_half8x8 const m0 = v_3; uint const v_4 = as_type<uint>(0); uint const v_5 = as_type<uint>(16); - bool const v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_4, v_6) * 4u)), ulong((select(4u, v_5, v_6) * 2u)), ulong2(0ul), true)); - bool const v_7 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_1 * 4u)); + bool const v_7 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_1); simdgroup_half8x8 v_8 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_8, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (select(0u, 0u, v_7) * 8u)), ulong((select(2u, 16u, v_7) * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m1 = v_8; uint const v_9 = as_type<uint>(0); uint const v_10 = as_type<uint>(16); - bool const v_11 = ((((v_9 + (v_10 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_11 = (((v_9 + (v_10 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_9, v_11) * 4u)), ulong((select(4u, v_10, v_11) * 2u)), ulong2(0ul), true)); - bool const v_12 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_2 * 8u)); + bool const v_12 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_2); simdgroup_half8x8 v_13 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_13, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (select(0u, 0u, v_12) * 16u)), ulong((select(1u, 16u, v_12) * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m2 = v_13; uint const v_14 = as_type<uint>(0); uint const v_15 = as_type<uint>(16); - bool const v_16 = ((((v_14 + (v_15 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_16 = (((v_14 + (v_15 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_14, v_16) * 4u)), ulong((select(4u, v_15, v_16) * 2u)), ulong2(0ul), true)); - bool const v_17 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_3 * 8u)); + bool const v_17 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_3); simdgroup_half8x8 v_18 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_18, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (select(0u, 0u, v_17) * 16u)), ulong((select(1u, 16u, v_17) * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m3 = v_18; uint const v_19 = as_type<uint>(0); uint const v_20 = as_type<uint>(16); - bool const v_21 = ((((v_19 + (v_20 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_21 = (((v_19 + (v_20 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_19, v_21) * 4u)), ulong((select(4u, v_20, v_21) * 2u)), ulong2(0ul), true)); bool const v_22 = (((0u + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); simdgroup_half8x8 v_23 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); @@ -88,22 +88,22 @@ simdgroup_half8x8 const m4 = v_23; uint const v_24 = as_type<uint>(0); uint const v_25 = as_type<uint>(16); - bool const v_26 = ((((v_24 + (v_25 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_26 = (((v_24 + (v_25 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_24, v_26) * 4u)), ulong((select(4u, v_25, v_26) * 2u)), ulong2(0ul), true)); - bool const v_27 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_27 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); simdgroup_half8x8 v_28 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_28, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in5) + (select(0u, 0u, v_27) * 4u)), ulong((select(4u, 16u, v_27) * 2u)), ulong2(0ul), false)); simdgroup_half8x8 const m5 = v_28; uint const v_29 = as_type<uint>(0); uint const v_30 = as_type<uint>(16); - bool const v_31 = ((((v_29 + (v_30 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_31 = (((v_29 + (v_30 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_29, v_31) * 4u)), ulong((select(4u, v_30, v_31) * 2u)), ulong2(0ul), true)); - bool const v_32 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_6 * 4u)); + bool const v_32 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_6); simdgroup_half8x8 v_33 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_33, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (select(0u, 0u, v_32) * 8u)), ulong((select(2u, 16u, v_32) * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m6 = v_33; uint const v_34 = as_type<uint>(0); uint const v_35 = as_type<uint>(16); - bool const v_36 = ((((v_34 + (v_35 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_36 = (((v_34 + (v_35 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_34, v_36) * 4u)), ulong((select(4u, v_35, v_36) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_row_major.wgsl.expected.spvasm index 2bfdb1a..889e972 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 267 +; Bound: 241 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,21 +128,21 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_2 = OpConstant %uint 2 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 - %67 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_0 + %uint_8 = OpConstant %uint 8 + %63 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_0 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float @@ -158,197 +158,171 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_2 - %51 = OpIMul %uint %uint_16 %uint_7 - %54 = OpIAdd %uint %uint_0 %51 - %55 = OpIMul %uint %54 %uint_2 - %56 = OpIAdd %uint %55 %uint_8 - %58 = OpULessThanEqual %bool %56 %49 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_4 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - %m0 = OpCooperativeMatrixLoadKHR %67 %64 %uint_0 %61 None - %69 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %71 = OpArrayLength %uint %38 0 - %72 = OpIMul %uint %71 %uint_2 - %73 = OpBitcast %uint %int_0 - %75 = OpBitcast %uint %int_16 - %77 = OpIMul %uint %75 %uint_7 - %78 = OpIAdd %uint %73 %77 - %79 = OpIMul %uint %78 %uint_2 - %80 = OpIAdd %uint %79 %uint_8 - %81 = OpULessThanEqual %bool %80 %72 - %82 = OpSelect %uint %81 %73 %uint_0 - %83 = OpSelect %uint %81 %75 %uint_4 - %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %85 = OpAccessChain %_ptr_StorageBuffer_uint_0 %84 %82 - OpCooperativeMatrixStoreKHR %85 %m0 %uint_1 %83 NonPrivatePointer - %89 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %91 = OpArrayLength %uint %6 0 - %92 = OpIMul %uint %91 %uint_4 - %93 = OpIMul %uint %uint_16 %uint_7 - %94 = OpIAdd %uint %uint_0 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %92 - %98 = OpSelect %uint %97 %uint_0 %uint_0 - %99 = OpSelect %uint %97 %uint_16 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_v2int %100 %98 - %m1 = OpCooperativeMatrixLoadKHR %67 %101 %uint_0 %99 None - %104 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %105 = OpArrayLength %uint %38 0 - %106 = OpIMul %uint %105 %uint_2 - %107 = OpBitcast %uint %int_0 - %108 = OpBitcast %uint %int_16 - %109 = OpIMul %uint %108 %uint_7 - %110 = OpIAdd %uint %107 %109 - %111 = OpIMul %uint %110 %uint_2 - %112 = OpIAdd %uint %111 %uint_8 - %113 = OpULessThanEqual %bool %112 %106 - %114 = OpSelect %uint %113 %107 %uint_0 - %115 = OpSelect %uint %113 %108 %uint_4 - %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %117 = OpAccessChain %_ptr_StorageBuffer_uint_0 %116 %114 - OpCooperativeMatrixStoreKHR %117 %m1 %uint_1 %115 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %121 = OpArrayLength %uint %12 0 - %122 = OpIMul %uint %121 %uint_8 - %123 = OpIMul %uint %uint_16 %uint_7 - %124 = OpIAdd %uint %uint_0 %123 - %125 = OpIMul %uint %124 %uint_8 - %126 = OpIAdd %uint %125 %uint_8 - %127 = OpULessThanEqual %bool %126 %122 - %128 = OpSelect %uint %127 %uint_0 %uint_0 - %129 = OpSelect %uint %127 %uint_16 %uint_1 - %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %131 = OpAccessChain %_ptr_StorageBuffer_v3float %130 %128 - %m2 = OpCooperativeMatrixLoadKHR %67 %131 %uint_0 %129 None + %49 = OpIMul %uint %uint_16 %uint_7 + %52 = OpIAdd %uint %uint_0 %49 + %53 = OpIAdd %uint %52 %uint_4 + %55 = OpULessThanEqual %bool %53 %48 + %57 = OpSelect %uint %55 %uint_0 %uint_0 + %58 = OpSelect %uint %55 %uint_16 %uint_4 + %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %60 = OpAccessChain %_ptr_StorageBuffer_uint %59 %57 + %m0 = OpCooperativeMatrixLoadKHR %63 %60 %uint_0 %58 None + %66 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %68 = OpArrayLength %uint %38 0 + %69 = OpBitcast %uint %int_0 + %71 = OpBitcast %uint %int_16 + %73 = OpIMul %uint %71 %uint_7 + %74 = OpIAdd %uint %69 %73 + %75 = OpIAdd %uint %74 %uint_4 + %76 = OpULessThanEqual %bool %75 %68 + %77 = OpSelect %uint %76 %69 %uint_0 + %78 = OpSelect %uint %76 %71 %uint_4 + %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %80 = OpAccessChain %_ptr_StorageBuffer_uint_0 %79 %77 + OpCooperativeMatrixStoreKHR %80 %m0 %uint_1 %78 NonPrivatePointer + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %86 = OpArrayLength %uint %6 0 + %87 = OpIMul %uint %uint_16 %uint_7 + %88 = OpIAdd %uint %uint_0 %87 + %89 = OpIAdd %uint %88 %uint_2 + %91 = OpULessThanEqual %bool %89 %86 + %92 = OpSelect %uint %91 %uint_0 %uint_0 + %93 = OpSelect %uint %91 %uint_16 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %92 + %m1 = OpCooperativeMatrixLoadKHR %63 %95 %uint_0 %93 None + %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %99 = OpArrayLength %uint %38 0 + %100 = OpBitcast %uint %int_0 + %101 = OpBitcast %uint %int_16 + %102 = OpIMul %uint %101 %uint_7 + %103 = OpIAdd %uint %100 %102 + %104 = OpIAdd %uint %103 %uint_4 + %105 = OpULessThanEqual %bool %104 %99 + %106 = OpSelect %uint %105 %100 %uint_0 + %107 = OpSelect %uint %105 %101 %uint_4 + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 + OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %113 = OpArrayLength %uint %12 0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %uint_0 %114 + %116 = OpIAdd %uint %115 %uint_1 + %117 = OpULessThanEqual %bool %116 %113 + %118 = OpSelect %uint %117 %uint_0 %uint_0 + %119 = OpSelect %uint %117 %uint_16 %uint_1 + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 + %m2 = OpCooperativeMatrixLoadKHR %63 %121 %uint_0 %119 None + %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %125 = OpArrayLength %uint %38 0 + %126 = OpBitcast %uint %int_0 + %127 = OpBitcast %uint %int_16 + %128 = OpIMul %uint %127 %uint_7 + %129 = OpIAdd %uint %126 %128 + %130 = OpIAdd %uint %129 %uint_4 + %131 = OpULessThanEqual %bool %130 %125 + %132 = OpSelect %uint %131 %126 %uint_0 + %133 = OpSelect %uint %131 %127 %uint_4 %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %135 = OpArrayLength %uint %38 0 - %136 = OpIMul %uint %135 %uint_2 - %137 = OpBitcast %uint %int_0 - %138 = OpBitcast %uint %int_16 - %139 = OpIMul %uint %138 %uint_7 - %140 = OpIAdd %uint %137 %139 - %141 = OpIMul %uint %140 %uint_2 - %142 = OpIAdd %uint %141 %uint_8 - %143 = OpULessThanEqual %bool %142 %136 - %144 = OpSelect %uint %143 %137 %uint_0 - %145 = OpSelect %uint %143 %138 %uint_4 - %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %147 = OpAccessChain %_ptr_StorageBuffer_uint_0 %146 %144 - OpCooperativeMatrixStoreKHR %147 %m2 %uint_1 %145 NonPrivatePointer - %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %151 = OpArrayLength %uint %18 0 - %152 = OpIMul %uint %151 %uint_8 - %153 = OpIMul %uint %uint_16 %uint_7 - %154 = OpIAdd %uint %uint_0 %153 - %155 = OpIMul %uint %154 %uint_8 - %156 = OpIAdd %uint %155 %uint_8 - %157 = OpULessThanEqual %bool %156 %152 - %158 = OpSelect %uint %157 %uint_0 %uint_0 - %159 = OpSelect %uint %157 %uint_16 %uint_1 - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %161 = OpAccessChain %_ptr_StorageBuffer_v4uint %160 %158 - %m3 = OpCooperativeMatrixLoadKHR %67 %161 %uint_0 %159 None - %164 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %165 = OpArrayLength %uint %38 0 - %166 = OpIMul %uint %165 %uint_2 - %167 = OpBitcast %uint %int_0 - %168 = OpBitcast %uint %int_16 - %169 = OpIMul %uint %168 %uint_7 - %170 = OpIAdd %uint %167 %169 - %171 = OpIMul %uint %170 %uint_2 - %172 = OpIAdd %uint %171 %uint_8 - %173 = OpULessThanEqual %bool %172 %166 - %174 = OpSelect %uint %173 %167 %uint_0 - %175 = OpSelect %uint %173 %168 %uint_4 + %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 + OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %139 = OpArrayLength %uint %18 0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %uint_0 %140 + %142 = OpIAdd %uint %141 %uint_1 + %143 = OpULessThanEqual %bool %142 %139 + %144 = OpSelect %uint %143 %uint_0 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_1 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %63 %147 %uint_0 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %151 = OpArrayLength %uint %38 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_4 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_4 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpIMul %uint %uint_16 %uint_7 + %167 = OpIAdd %uint %uint_0 %166 + %168 = OpIAdd %uint %167 %uint_8 + %169 = OpULessThanEqual %bool %168 %165 + %170 = OpSelect %uint %169 %uint_0 %uint_0 + %171 = OpSelect %uint %169 %uint_16 %uint_8 + %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %173 = OpAccessChain %_ptr_StorageBuffer_half %172 %170 + %m4 = OpCooperativeMatrixLoadKHR %63 %173 %uint_0 %171 None %176 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %177 = OpAccessChain %_ptr_StorageBuffer_uint_0 %176 %174 - OpCooperativeMatrixStoreKHR %177 %m3 %uint_1 %175 NonPrivatePointer - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %181 = OpArrayLength %uint %23 0 - %182 = OpIMul %uint %uint_16 %uint_7 - %183 = OpIAdd %uint %uint_0 %182 - %184 = OpIAdd %uint %183 %uint_8 - %185 = OpULessThanEqual %bool %184 %181 - %186 = OpSelect %uint %185 %uint_0 %uint_0 - %187 = OpSelect %uint %185 %uint_16 %uint_8 - %188 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %189 = OpAccessChain %_ptr_StorageBuffer_half %188 %186 - %m4 = OpCooperativeMatrixLoadKHR %67 %189 %uint_0 %187 None - %192 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %193 = OpArrayLength %uint %38 0 - %194 = OpIMul %uint %193 %uint_2 - %195 = OpBitcast %uint %int_0 - %196 = OpBitcast %uint %int_16 - %197 = OpIMul %uint %196 %uint_7 - %198 = OpIAdd %uint %195 %197 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpIAdd %uint %199 %uint_8 - %201 = OpULessThanEqual %bool %200 %194 - %202 = OpSelect %uint %201 %195 %uint_0 - %203 = OpSelect %uint %201 %196 %uint_4 - %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %205 = OpAccessChain %_ptr_StorageBuffer_uint_0 %204 %202 - OpCooperativeMatrixStoreKHR %205 %m4 %uint_1 %203 NonPrivatePointer - %207 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %209 = OpArrayLength %uint %28 0 - %210 = OpIMul %uint %209 %uint_2 - %211 = OpIMul %uint %uint_16 %uint_7 - %212 = OpIAdd %uint %uint_0 %211 - %213 = OpIMul %uint %212 %uint_2 - %214 = OpIAdd %uint %213 %uint_8 - %215 = OpULessThanEqual %bool %214 %210 - %216 = OpSelect %uint %215 %uint_0 %uint_0 - %217 = OpSelect %uint %215 %uint_16 %uint_4 - %218 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %219 = OpAccessChain %_ptr_StorageBuffer_v2half %218 %216 - %m5 = OpCooperativeMatrixLoadKHR %67 %219 %uint_0 %217 None - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %223 = OpArrayLength %uint %38 0 - %224 = OpIMul %uint %223 %uint_2 - %225 = OpBitcast %uint %int_0 - %226 = OpBitcast %uint %int_16 - %227 = OpIMul %uint %226 %uint_7 - %228 = OpIAdd %uint %225 %227 - %229 = OpIMul %uint %228 %uint_2 - %230 = OpIAdd %uint %229 %uint_8 - %231 = OpULessThanEqual %bool %230 %224 - %232 = OpSelect %uint %231 %225 %uint_0 - %233 = OpSelect %uint %231 %226 %uint_4 - %234 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %235 = OpAccessChain %_ptr_StorageBuffer_uint_0 %234 %232 - OpCooperativeMatrixStoreKHR %235 %m5 %uint_1 %233 NonPrivatePointer - %237 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %239 = OpArrayLength %uint %33 0 - %240 = OpIMul %uint %239 %uint_4 - %241 = OpIMul %uint %uint_16 %uint_7 - %242 = OpIAdd %uint %uint_0 %241 - %243 = OpIMul %uint %242 %uint_4 - %244 = OpIAdd %uint %243 %uint_8 - %245 = OpULessThanEqual %bool %244 %240 - %246 = OpSelect %uint %245 %uint_0 %uint_0 - %247 = OpSelect %uint %245 %uint_16 %uint_2 - %248 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %249 = OpAccessChain %_ptr_StorageBuffer_v3half %248 %246 - %m6 = OpCooperativeMatrixLoadKHR %67 %249 %uint_0 %247 None - %252 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %253 = OpArrayLength %uint %38 0 - %254 = OpIMul %uint %253 %uint_2 - %255 = OpBitcast %uint %int_0 - %256 = OpBitcast %uint %int_16 - %257 = OpIMul %uint %256 %uint_7 - %258 = OpIAdd %uint %255 %257 - %259 = OpIMul %uint %258 %uint_2 - %260 = OpIAdd %uint %259 %uint_8 - %261 = OpULessThanEqual %bool %260 %254 - %262 = OpSelect %uint %261 %255 %uint_0 - %263 = OpSelect %uint %261 %256 %uint_4 - %264 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %265 = OpAccessChain %_ptr_StorageBuffer_uint_0 %264 %262 - OpCooperativeMatrixStoreKHR %265 %m6 %uint_1 %263 NonPrivatePointer + %177 = OpArrayLength %uint %38 0 + %178 = OpBitcast %uint %int_0 + %179 = OpBitcast %uint %int_16 + %180 = OpIMul %uint %179 %uint_7 + %181 = OpIAdd %uint %178 %180 + %182 = OpIAdd %uint %181 %uint_4 + %183 = OpULessThanEqual %bool %182 %177 + %184 = OpSelect %uint %183 %178 %uint_0 + %185 = OpSelect %uint %183 %179 %uint_4 + %186 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %187 = OpAccessChain %_ptr_StorageBuffer_uint_0 %186 %184 + OpCooperativeMatrixStoreKHR %187 %m4 %uint_1 %185 NonPrivatePointer + %189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %191 = OpArrayLength %uint %28 0 + %192 = OpIMul %uint %uint_16 %uint_7 + %193 = OpIAdd %uint %uint_0 %192 + %194 = OpIAdd %uint %193 %uint_4 + %195 = OpULessThanEqual %bool %194 %191 + %196 = OpSelect %uint %195 %uint_0 %uint_0 + %197 = OpSelect %uint %195 %uint_16 %uint_4 + %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %199 = OpAccessChain %_ptr_StorageBuffer_v2half %198 %196 + %m5 = OpCooperativeMatrixLoadKHR %63 %199 %uint_0 %197 None + %202 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %203 = OpArrayLength %uint %38 0 + %204 = OpBitcast %uint %int_0 + %205 = OpBitcast %uint %int_16 + %206 = OpIMul %uint %205 %uint_7 + %207 = OpIAdd %uint %204 %206 + %208 = OpIAdd %uint %207 %uint_4 + %209 = OpULessThanEqual %bool %208 %203 + %210 = OpSelect %uint %209 %204 %uint_0 + %211 = OpSelect %uint %209 %205 %uint_4 + %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %213 = OpAccessChain %_ptr_StorageBuffer_uint_0 %212 %210 + OpCooperativeMatrixStoreKHR %213 %m5 %uint_1 %211 NonPrivatePointer + %215 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %217 = OpArrayLength %uint %33 0 + %218 = OpIMul %uint %uint_16 %uint_7 + %219 = OpIAdd %uint %uint_0 %218 + %220 = OpIAdd %uint %219 %uint_2 + %221 = OpULessThanEqual %bool %220 %217 + %222 = OpSelect %uint %221 %uint_0 %uint_0 + %223 = OpSelect %uint %221 %uint_16 %uint_2 + %224 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %225 = OpAccessChain %_ptr_StorageBuffer_v3half %224 %222 + %m6 = OpCooperativeMatrixLoadKHR %63 %225 %uint_0 %223 None + %228 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %229 = OpArrayLength %uint %38 0 + %230 = OpBitcast %uint %int_0 + %231 = OpBitcast %uint %int_16 + %232 = OpIMul %uint %231 %uint_7 + %233 = OpIAdd %uint %230 %232 + %234 = OpIAdd %uint %233 %uint_4 + %235 = OpULessThanEqual %bool %234 %229 + %236 = OpSelect %uint %235 %230 %uint_0 + %237 = OpSelect %uint %235 %231 %uint_4 + %238 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %239 = OpAccessChain %_ptr_StorageBuffer_uint_0 %238 %236 + OpCooperativeMatrixStoreKHR %239 %m6 %uint_1 %237 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_col_major.wgsl.expected.dxc.hlsl index 32b461a..fe7a140 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_col_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 2u) + 8u) <= ((v_1 / 4u) * 2u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 4u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 2u)), (select(v_4, v_3, 4u) * 2u), MatrixLayout::ColMajor); Matrix_left_f16_8x8 m1 = Matrix_left_f16_8x8::Load(in1, 0u, 32u, MatrixLayout::ColMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 2u) + 8u) <= ((v_5 / 4u) * 2u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 4u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 2u)), (select(v_8, v_7, 4u) * 2u), MatrixLayout::ColMajor); Matrix_left_f16_8x8 m2 = Matrix_left_f16_8x8::Load(in2, 0u, 32u, MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 2u) + 8u) <= ((v_9 / 4u) * 2u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 4u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 2u)), (select(v_12, v_11, 4u) * 2u), MatrixLayout::ColMajor); Matrix_left_f16_8x8 m3 = Matrix_left_f16_8x8::Load(in3, 0u, 32u, MatrixLayout::ColMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 2u) + 8u) <= ((v_13 / 4u) * 2u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 4u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 2u)), (select(v_16, v_15, 4u) * 2u), MatrixLayout::ColMajor); Matrix_left_f16_8x8 m4 = Matrix_left_f16_8x8::Load(in4, 0u, 32u, MatrixLayout::ColMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 2u) + 8u) <= ((v_17 / 4u) * 2u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 4u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 2u)), (select(v_20, v_19, 4u) * 2u), MatrixLayout::ColMajor); Matrix_left_f16_8x8 m5 = Matrix_left_f16_8x8::Load(in5, 0u, 32u, MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 2u) + 8u) <= ((v_21 / 4u) * 2u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 4u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 2u)), (select(v_24, v_23, 4u) * 2u), MatrixLayout::ColMajor); Matrix_left_f16_8x8 m6 = Matrix_left_f16_8x8::Load(in6, 0u, 32u, MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 2u) + 8u) <= ((v_25 / 4u) * 2u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 4u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 2u)), (select(v_28, v_27, 4u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_col_major.wgsl.expected.msl index b53e636..cc07356 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_col_major.wgsl.expected.msl
@@ -48,48 +48,48 @@ simdgroup_half8x8 const m0 = v_2; uint const v_3 = as_type<uint>(0); uint const v_4 = as_type<uint>(16); - bool const v_5 = ((((v_3 + (v_4 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_5 = (((v_3 + (v_4 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_3, v_5) * 4u)), ulong((select(4u, v_4, v_5) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_6 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_6, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (as_type<uint>(0) * 8u)), ulong((16u * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m1 = v_6; uint const v_7 = as_type<uint>(0); uint const v_8 = as_type<uint>(16); - bool const v_9 = ((((v_7 + (v_8 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_9 = (((v_7 + (v_8 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_7, v_9) * 4u)), ulong((select(4u, v_8, v_9) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_10 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_10, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (as_type<uint>(0) * 16u)), ulong((16u * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m2 = v_10; uint const v_11 = as_type<uint>(0); uint const v_12 = as_type<uint>(16); - bool const v_13 = ((((v_11 + (v_12 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_13 = (((v_11 + (v_12 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_11, v_13) * 4u)), ulong((select(4u, v_12, v_13) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_14 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_14, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (as_type<uint>(0) * 16u)), ulong((16u * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m3 = v_14; uint const v_15 = as_type<uint>(0); uint const v_16 = as_type<uint>(16); - bool const v_17 = ((((v_15 + (v_16 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_17 = (((v_15 + (v_16 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_15, v_17) * 4u)), ulong((select(4u, v_16, v_17) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_18 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_18, (&(*tint_module_vars.in4)[0]), ulong(16u), ulong2(0ul), true)); simdgroup_half8x8 const m4 = v_18; uint const v_19 = as_type<uint>(0); uint const v_20 = as_type<uint>(16); - bool const v_21 = ((((v_19 + (v_20 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_21 = (((v_19 + (v_20 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_19, v_21) * 4u)), ulong((select(4u, v_20, v_21) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_22 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_22, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in5) + (as_type<uint>(0) * 4u)), ulong((16u * 2u)), ulong2(0ul), true)); simdgroup_half8x8 const m5 = v_22; uint const v_23 = as_type<uint>(0); uint const v_24 = as_type<uint>(16); - bool const v_25 = ((((v_23 + (v_24 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_25 = (((v_23 + (v_24 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_23, v_25) * 4u)), ulong((select(4u, v_24, v_25) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_26 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_26, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (as_type<uint>(0) * 8u)), ulong((16u * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m6 = v_26; uint const v_27 = as_type<uint>(0); uint const v_28 = as_type<uint>(16); - bool const v_29 = ((((v_27 + (v_28 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_29 = (((v_27 + (v_28 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_27, v_29) * 4u)), ulong((select(4u, v_28, v_29) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_col_major.wgsl.expected.spvasm index e7bfca2..7548070 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 201 +; Bound: 186 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -138,12 +138,11 @@ %uint_1 = OpConstant %uint 1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_2 = OpConstant %uint 2 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -164,126 +163,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_1 %uint_16 None %58 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %60 = OpArrayLength %uint %39 0 - %61 = OpIMul %uint %60 %uint_2 - %63 = OpBitcast %uint %int_0 - %65 = OpBitcast %uint %int_16 - %67 = OpIMul %uint %65 %uint_7 - %69 = OpIAdd %uint %63 %67 - %70 = OpIMul %uint %69 %uint_2 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %61 - %74 = OpSelect %uint %72 %63 %uint_0 - %75 = OpSelect %uint %72 %65 %uint_4 - %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %78 = OpAccessChain %_ptr_StorageBuffer_uint_0 %77 %74 - OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %75 NonPrivatePointer - %81 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %83 = OpAccessChain %_ptr_StorageBuffer_v2int %81 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %83 %uint_1 %uint_16 None - %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %87 = OpArrayLength %uint %39 0 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpBitcast %uint %int_0 - %90 = OpBitcast %uint %int_16 - %91 = OpIMul %uint %90 %uint_7 - %92 = OpIAdd %uint %89 %91 - %93 = OpIMul %uint %92 %uint_2 - %94 = OpIAdd %uint %93 %uint_8 - %95 = OpULessThanEqual %bool %94 %88 - %96 = OpSelect %uint %95 %89 %uint_0 - %97 = OpSelect %uint %95 %90 %uint_4 - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %99 = OpAccessChain %_ptr_StorageBuffer_uint_0 %98 %96 - OpCooperativeMatrixStoreKHR %99 %m1 %uint_1 %97 NonPrivatePointer - %101 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %103 = OpAccessChain %_ptr_StorageBuffer_v3float %101 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %103 %uint_1 %uint_16 None - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %107 = OpArrayLength %uint %39 0 - %108 = OpIMul %uint %107 %uint_2 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_2 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_4 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint_0 %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v4uint %121 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %123 %uint_1 %uint_16 None - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %127 = OpArrayLength %uint %39 0 - %128 = OpIMul %uint %127 %uint_2 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %128 - %136 = OpSelect %uint %135 %129 %uint_0 - %137 = OpSelect %uint %135 %130 %uint_4 - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_uint_0 %138 %136 - OpCooperativeMatrixStoreKHR %139 %m3 %uint_1 %137 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %143 = OpAccessChain %_ptr_StorageBuffer_half %141 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %143 %uint_1 %uint_16 None - %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %147 = OpArrayLength %uint %39 0 - %148 = OpIMul %uint %147 %uint_2 - %149 = OpBitcast %uint %int_0 - %150 = OpBitcast %uint %int_16 - %151 = OpIMul %uint %150 %uint_7 - %152 = OpIAdd %uint %149 %151 - %153 = OpIMul %uint %152 %uint_2 - %154 = OpIAdd %uint %153 %uint_8 - %155 = OpULessThanEqual %bool %154 %148 - %156 = OpSelect %uint %155 %149 %uint_0 - %157 = OpSelect %uint %155 %150 %uint_4 - %158 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %159 = OpAccessChain %_ptr_StorageBuffer_uint_0 %158 %156 - OpCooperativeMatrixStoreKHR %159 %m4 %uint_1 %157 NonPrivatePointer - %161 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %163 = OpAccessChain %_ptr_StorageBuffer_v2half %161 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %163 %uint_1 %uint_16 None - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %167 = OpArrayLength %uint %39 0 - %168 = OpIMul %uint %167 %uint_2 - %169 = OpBitcast %uint %int_0 - %170 = OpBitcast %uint %int_16 - %171 = OpIMul %uint %170 %uint_7 - %172 = OpIAdd %uint %169 %171 - %173 = OpIMul %uint %172 %uint_2 - %174 = OpIAdd %uint %173 %uint_8 - %175 = OpULessThanEqual %bool %174 %168 - %176 = OpSelect %uint %175 %169 %uint_0 - %177 = OpSelect %uint %175 %170 %uint_4 - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %179 = OpAccessChain %_ptr_StorageBuffer_uint_0 %178 %176 - OpCooperativeMatrixStoreKHR %179 %m5 %uint_1 %177 NonPrivatePointer - %181 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %183 = OpAccessChain %_ptr_StorageBuffer_v3half %181 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %183 %uint_1 %uint_16 None - %186 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %187 = OpArrayLength %uint %39 0 - %188 = OpIMul %uint %187 %uint_2 - %189 = OpBitcast %uint %int_0 - %190 = OpBitcast %uint %int_16 - %191 = OpIMul %uint %190 %uint_7 - %192 = OpIAdd %uint %189 %191 - %193 = OpIMul %uint %192 %uint_2 - %194 = OpIAdd %uint %193 %uint_8 - %195 = OpULessThanEqual %bool %194 %188 - %196 = OpSelect %uint %195 %189 %uint_0 - %197 = OpSelect %uint %195 %190 %uint_4 - %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %199 = OpAccessChain %_ptr_StorageBuffer_uint_0 %198 %196 - OpCooperativeMatrixStoreKHR %199 %m6 %uint_1 %197 NonPrivatePointer + %61 = OpBitcast %uint %int_0 + %63 = OpBitcast %uint %int_16 + %65 = OpIMul %uint %63 %uint_7 + %67 = OpIAdd %uint %61 %65 + %68 = OpIAdd %uint %67 %uint_4 + %70 = OpULessThanEqual %bool %68 %60 + %72 = OpSelect %uint %70 %61 %uint_0 + %73 = OpSelect %uint %70 %63 %uint_4 + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %75 = OpAccessChain %_ptr_StorageBuffer_uint_0 %74 %72 + OpCooperativeMatrixStoreKHR %75 %m0 %uint_1 %73 NonPrivatePointer + %78 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %80 = OpAccessChain %_ptr_StorageBuffer_v2int %78 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %80 %uint_1 %uint_16 None + %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %84 = OpArrayLength %uint %39 0 + %85 = OpBitcast %uint %int_0 + %86 = OpBitcast %uint %int_16 + %87 = OpIMul %uint %86 %uint_7 + %88 = OpIAdd %uint %85 %87 + %89 = OpIAdd %uint %88 %uint_4 + %90 = OpULessThanEqual %bool %89 %84 + %91 = OpSelect %uint %90 %85 %uint_0 + %92 = OpSelect %uint %90 %86 %uint_4 + %93 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %94 = OpAccessChain %_ptr_StorageBuffer_uint_0 %93 %91 + OpCooperativeMatrixStoreKHR %94 %m1 %uint_1 %92 NonPrivatePointer + %96 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %98 = OpAccessChain %_ptr_StorageBuffer_v3float %96 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %98 %uint_1 %uint_16 None + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %102 = OpArrayLength %uint %39 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_4 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_4 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint_0 %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_v4uint %114 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %116 %uint_1 %uint_16 None + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %120 = OpArrayLength %uint %39 0 + %121 = OpBitcast %uint %int_0 + %122 = OpBitcast %uint %int_16 + %123 = OpIMul %uint %122 %uint_7 + %124 = OpIAdd %uint %121 %123 + %125 = OpIAdd %uint %124 %uint_4 + %126 = OpULessThanEqual %bool %125 %120 + %127 = OpSelect %uint %126 %121 %uint_0 + %128 = OpSelect %uint %126 %122 %uint_4 + %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %130 = OpAccessChain %_ptr_StorageBuffer_uint_0 %129 %127 + OpCooperativeMatrixStoreKHR %130 %m3 %uint_1 %128 NonPrivatePointer + %132 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_half %132 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %134 %uint_1 %uint_16 None + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %138 = OpArrayLength %uint %39 0 + %139 = OpBitcast %uint %int_0 + %140 = OpBitcast %uint %int_16 + %141 = OpIMul %uint %140 %uint_7 + %142 = OpIAdd %uint %139 %141 + %143 = OpIAdd %uint %142 %uint_4 + %144 = OpULessThanEqual %bool %143 %138 + %145 = OpSelect %uint %144 %139 %uint_0 + %146 = OpSelect %uint %144 %140 %uint_4 + %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %148 = OpAccessChain %_ptr_StorageBuffer_uint_0 %147 %145 + OpCooperativeMatrixStoreKHR %148 %m4 %uint_1 %146 NonPrivatePointer + %150 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %152 = OpAccessChain %_ptr_StorageBuffer_v2half %150 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %152 %uint_1 %uint_16 None + %155 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %156 = OpArrayLength %uint %39 0 + %157 = OpBitcast %uint %int_0 + %158 = OpBitcast %uint %int_16 + %159 = OpIMul %uint %158 %uint_7 + %160 = OpIAdd %uint %157 %159 + %161 = OpIAdd %uint %160 %uint_4 + %162 = OpULessThanEqual %bool %161 %156 + %163 = OpSelect %uint %162 %157 %uint_0 + %164 = OpSelect %uint %162 %158 %uint_4 + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %166 = OpAccessChain %_ptr_StorageBuffer_uint_0 %165 %163 + OpCooperativeMatrixStoreKHR %166 %m5 %uint_1 %164 NonPrivatePointer + %168 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %170 = OpAccessChain %_ptr_StorageBuffer_v3half %168 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %170 %uint_1 %uint_16 None + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %174 = OpArrayLength %uint %39 0 + %175 = OpBitcast %uint %int_0 + %176 = OpBitcast %uint %int_16 + %177 = OpIMul %uint %176 %uint_7 + %178 = OpIAdd %uint %175 %177 + %179 = OpIAdd %uint %178 %uint_4 + %180 = OpULessThanEqual %bool %179 %174 + %181 = OpSelect %uint %180 %175 %uint_0 + %182 = OpSelect %uint %180 %176 %uint_4 + %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %184 = OpAccessChain %_ptr_StorageBuffer_uint_0 %183 %181 + OpCooperativeMatrixStoreKHR %184 %m6 %uint_1 %182 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_row_major.wgsl.expected.dxc.hlsl index 95c5b94..c390b57 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_row_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 2u) + 8u) <= ((v_1 / 4u) * 2u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 4u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 2u)), (select(v_4, v_3, 4u) * 2u), MatrixLayout::ColMajor); Matrix_left_f16_8x8 m1 = Matrix_left_f16_8x8::Load(in1, 0u, 32u, MatrixLayout::RowMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 2u) + 8u) <= ((v_5 / 4u) * 2u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 4u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 2u)), (select(v_8, v_7, 4u) * 2u), MatrixLayout::ColMajor); Matrix_left_f16_8x8 m2 = Matrix_left_f16_8x8::Load(in2, 0u, 32u, MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 2u) + 8u) <= ((v_9 / 4u) * 2u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 4u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 2u)), (select(v_12, v_11, 4u) * 2u), MatrixLayout::ColMajor); Matrix_left_f16_8x8 m3 = Matrix_left_f16_8x8::Load(in3, 0u, 32u, MatrixLayout::RowMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 2u) + 8u) <= ((v_13 / 4u) * 2u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 4u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 2u)), (select(v_16, v_15, 4u) * 2u), MatrixLayout::ColMajor); Matrix_left_f16_8x8 m4 = Matrix_left_f16_8x8::Load(in4, 0u, 32u, MatrixLayout::RowMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 2u) + 8u) <= ((v_17 / 4u) * 2u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 4u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 2u)), (select(v_20, v_19, 4u) * 2u), MatrixLayout::ColMajor); Matrix_left_f16_8x8 m5 = Matrix_left_f16_8x8::Load(in5, 0u, 32u, MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 2u) + 8u) <= ((v_21 / 4u) * 2u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 4u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 2u)), (select(v_24, v_23, 4u) * 2u), MatrixLayout::ColMajor); Matrix_left_f16_8x8 m6 = Matrix_left_f16_8x8::Load(in6, 0u, 32u, MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 2u) + 8u) <= ((v_25 / 4u) * 2u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 4u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 2u)), (select(v_28, v_27, 4u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_row_major.wgsl.expected.msl index 0ed871e..731812f 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_row_major.wgsl.expected.msl
@@ -48,48 +48,48 @@ simdgroup_half8x8 const m0 = v_2; uint const v_3 = as_type<uint>(0); uint const v_4 = as_type<uint>(16); - bool const v_5 = ((((v_3 + (v_4 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_5 = (((v_3 + (v_4 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_3, v_5) * 4u)), ulong((select(4u, v_4, v_5) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_6 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_6, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (as_type<uint>(0) * 8u)), ulong((16u * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m1 = v_6; uint const v_7 = as_type<uint>(0); uint const v_8 = as_type<uint>(16); - bool const v_9 = ((((v_7 + (v_8 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_9 = (((v_7 + (v_8 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_7, v_9) * 4u)), ulong((select(4u, v_8, v_9) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_10 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_10, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (as_type<uint>(0) * 16u)), ulong((16u * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m2 = v_10; uint const v_11 = as_type<uint>(0); uint const v_12 = as_type<uint>(16); - bool const v_13 = ((((v_11 + (v_12 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_13 = (((v_11 + (v_12 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_11, v_13) * 4u)), ulong((select(4u, v_12, v_13) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_14 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_14, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (as_type<uint>(0) * 16u)), ulong((16u * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m3 = v_14; uint const v_15 = as_type<uint>(0); uint const v_16 = as_type<uint>(16); - bool const v_17 = ((((v_15 + (v_16 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_17 = (((v_15 + (v_16 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_15, v_17) * 4u)), ulong((select(4u, v_16, v_17) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_18 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_18, (&(*tint_module_vars.in4)[0]), ulong(16u), ulong2(0ul), false)); simdgroup_half8x8 const m4 = v_18; uint const v_19 = as_type<uint>(0); uint const v_20 = as_type<uint>(16); - bool const v_21 = ((((v_19 + (v_20 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_21 = (((v_19 + (v_20 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_19, v_21) * 4u)), ulong((select(4u, v_20, v_21) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_22 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_22, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in5) + (as_type<uint>(0) * 4u)), ulong((16u * 2u)), ulong2(0ul), false)); simdgroup_half8x8 const m5 = v_22; uint const v_23 = as_type<uint>(0); uint const v_24 = as_type<uint>(16); - bool const v_25 = ((((v_23 + (v_24 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_25 = (((v_23 + (v_24 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_23, v_25) * 4u)), ulong((select(4u, v_24, v_25) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_26 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_26, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (as_type<uint>(0) * 8u)), ulong((16u * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m6 = v_26; uint const v_27 = as_type<uint>(0); uint const v_28 = as_type<uint>(16); - bool const v_29 = ((((v_27 + (v_28 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_29 = (((v_27 + (v_28 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_27, v_29) * 4u)), ulong((select(4u, v_28, v_29) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_row_major.wgsl.expected.spvasm index 04dcc8f..566f123 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f16_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 201 +; Bound: 186 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -137,12 +137,11 @@ %53 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_0 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_2 = OpConstant %uint 2 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 @@ -164,126 +163,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_0 %uint_16 None %57 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %59 = OpArrayLength %uint %39 0 - %60 = OpIMul %uint %59 %uint_2 - %62 = OpBitcast %uint %int_0 - %64 = OpBitcast %uint %int_16 - %66 = OpIMul %uint %64 %uint_7 - %68 = OpIAdd %uint %62 %66 - %69 = OpIMul %uint %68 %uint_2 - %70 = OpIAdd %uint %69 %uint_8 - %71 = OpULessThanEqual %bool %70 %60 - %73 = OpSelect %uint %71 %62 %uint_0 - %74 = OpSelect %uint %71 %64 %uint_4 - %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %77 = OpAccessChain %_ptr_StorageBuffer_uint_0 %76 %73 - OpCooperativeMatrixStoreKHR %77 %m0 %uint_1 %74 NonPrivatePointer - %81 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %83 = OpAccessChain %_ptr_StorageBuffer_v2int %81 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %83 %uint_0 %uint_16 None - %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %87 = OpArrayLength %uint %39 0 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpBitcast %uint %int_0 - %90 = OpBitcast %uint %int_16 - %91 = OpIMul %uint %90 %uint_7 - %92 = OpIAdd %uint %89 %91 - %93 = OpIMul %uint %92 %uint_2 - %94 = OpIAdd %uint %93 %uint_8 - %95 = OpULessThanEqual %bool %94 %88 - %96 = OpSelect %uint %95 %89 %uint_0 - %97 = OpSelect %uint %95 %90 %uint_4 - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %99 = OpAccessChain %_ptr_StorageBuffer_uint_0 %98 %96 - OpCooperativeMatrixStoreKHR %99 %m1 %uint_1 %97 NonPrivatePointer - %101 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %103 = OpAccessChain %_ptr_StorageBuffer_v3float %101 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %103 %uint_0 %uint_16 None - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %107 = OpArrayLength %uint %39 0 - %108 = OpIMul %uint %107 %uint_2 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_2 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_4 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint_0 %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v4uint %121 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %123 %uint_0 %uint_16 None - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %127 = OpArrayLength %uint %39 0 - %128 = OpIMul %uint %127 %uint_2 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %128 - %136 = OpSelect %uint %135 %129 %uint_0 - %137 = OpSelect %uint %135 %130 %uint_4 - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_uint_0 %138 %136 - OpCooperativeMatrixStoreKHR %139 %m3 %uint_1 %137 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %143 = OpAccessChain %_ptr_StorageBuffer_half %141 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %143 %uint_0 %uint_16 None - %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %147 = OpArrayLength %uint %39 0 - %148 = OpIMul %uint %147 %uint_2 - %149 = OpBitcast %uint %int_0 - %150 = OpBitcast %uint %int_16 - %151 = OpIMul %uint %150 %uint_7 - %152 = OpIAdd %uint %149 %151 - %153 = OpIMul %uint %152 %uint_2 - %154 = OpIAdd %uint %153 %uint_8 - %155 = OpULessThanEqual %bool %154 %148 - %156 = OpSelect %uint %155 %149 %uint_0 - %157 = OpSelect %uint %155 %150 %uint_4 - %158 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %159 = OpAccessChain %_ptr_StorageBuffer_uint_0 %158 %156 - OpCooperativeMatrixStoreKHR %159 %m4 %uint_1 %157 NonPrivatePointer - %161 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %163 = OpAccessChain %_ptr_StorageBuffer_v2half %161 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %163 %uint_0 %uint_16 None - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %167 = OpArrayLength %uint %39 0 - %168 = OpIMul %uint %167 %uint_2 - %169 = OpBitcast %uint %int_0 - %170 = OpBitcast %uint %int_16 - %171 = OpIMul %uint %170 %uint_7 - %172 = OpIAdd %uint %169 %171 - %173 = OpIMul %uint %172 %uint_2 - %174 = OpIAdd %uint %173 %uint_8 - %175 = OpULessThanEqual %bool %174 %168 - %176 = OpSelect %uint %175 %169 %uint_0 - %177 = OpSelect %uint %175 %170 %uint_4 - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %179 = OpAccessChain %_ptr_StorageBuffer_uint_0 %178 %176 - OpCooperativeMatrixStoreKHR %179 %m5 %uint_1 %177 NonPrivatePointer - %181 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %183 = OpAccessChain %_ptr_StorageBuffer_v3half %181 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %183 %uint_0 %uint_16 None - %186 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %187 = OpArrayLength %uint %39 0 - %188 = OpIMul %uint %187 %uint_2 - %189 = OpBitcast %uint %int_0 - %190 = OpBitcast %uint %int_16 - %191 = OpIMul %uint %190 %uint_7 - %192 = OpIAdd %uint %189 %191 - %193 = OpIMul %uint %192 %uint_2 - %194 = OpIAdd %uint %193 %uint_8 - %195 = OpULessThanEqual %bool %194 %188 - %196 = OpSelect %uint %195 %189 %uint_0 - %197 = OpSelect %uint %195 %190 %uint_4 - %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %199 = OpAccessChain %_ptr_StorageBuffer_uint_0 %198 %196 - OpCooperativeMatrixStoreKHR %199 %m6 %uint_1 %197 NonPrivatePointer + %60 = OpBitcast %uint %int_0 + %62 = OpBitcast %uint %int_16 + %64 = OpIMul %uint %62 %uint_7 + %66 = OpIAdd %uint %60 %64 + %67 = OpIAdd %uint %66 %uint_4 + %69 = OpULessThanEqual %bool %67 %59 + %71 = OpSelect %uint %69 %60 %uint_0 + %72 = OpSelect %uint %69 %62 %uint_4 + %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %74 = OpAccessChain %_ptr_StorageBuffer_uint_0 %73 %71 + OpCooperativeMatrixStoreKHR %74 %m0 %uint_1 %72 NonPrivatePointer + %78 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %80 = OpAccessChain %_ptr_StorageBuffer_v2int %78 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %80 %uint_0 %uint_16 None + %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %84 = OpArrayLength %uint %39 0 + %85 = OpBitcast %uint %int_0 + %86 = OpBitcast %uint %int_16 + %87 = OpIMul %uint %86 %uint_7 + %88 = OpIAdd %uint %85 %87 + %89 = OpIAdd %uint %88 %uint_4 + %90 = OpULessThanEqual %bool %89 %84 + %91 = OpSelect %uint %90 %85 %uint_0 + %92 = OpSelect %uint %90 %86 %uint_4 + %93 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %94 = OpAccessChain %_ptr_StorageBuffer_uint_0 %93 %91 + OpCooperativeMatrixStoreKHR %94 %m1 %uint_1 %92 NonPrivatePointer + %96 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %98 = OpAccessChain %_ptr_StorageBuffer_v3float %96 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %98 %uint_0 %uint_16 None + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %102 = OpArrayLength %uint %39 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_4 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_4 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint_0 %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_v4uint %114 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %116 %uint_0 %uint_16 None + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %120 = OpArrayLength %uint %39 0 + %121 = OpBitcast %uint %int_0 + %122 = OpBitcast %uint %int_16 + %123 = OpIMul %uint %122 %uint_7 + %124 = OpIAdd %uint %121 %123 + %125 = OpIAdd %uint %124 %uint_4 + %126 = OpULessThanEqual %bool %125 %120 + %127 = OpSelect %uint %126 %121 %uint_0 + %128 = OpSelect %uint %126 %122 %uint_4 + %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %130 = OpAccessChain %_ptr_StorageBuffer_uint_0 %129 %127 + OpCooperativeMatrixStoreKHR %130 %m3 %uint_1 %128 NonPrivatePointer + %132 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_half %132 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %134 %uint_0 %uint_16 None + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %138 = OpArrayLength %uint %39 0 + %139 = OpBitcast %uint %int_0 + %140 = OpBitcast %uint %int_16 + %141 = OpIMul %uint %140 %uint_7 + %142 = OpIAdd %uint %139 %141 + %143 = OpIAdd %uint %142 %uint_4 + %144 = OpULessThanEqual %bool %143 %138 + %145 = OpSelect %uint %144 %139 %uint_0 + %146 = OpSelect %uint %144 %140 %uint_4 + %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %148 = OpAccessChain %_ptr_StorageBuffer_uint_0 %147 %145 + OpCooperativeMatrixStoreKHR %148 %m4 %uint_1 %146 NonPrivatePointer + %150 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %152 = OpAccessChain %_ptr_StorageBuffer_v2half %150 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %152 %uint_0 %uint_16 None + %155 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %156 = OpArrayLength %uint %39 0 + %157 = OpBitcast %uint %int_0 + %158 = OpBitcast %uint %int_16 + %159 = OpIMul %uint %158 %uint_7 + %160 = OpIAdd %uint %157 %159 + %161 = OpIAdd %uint %160 %uint_4 + %162 = OpULessThanEqual %bool %161 %156 + %163 = OpSelect %uint %162 %157 %uint_0 + %164 = OpSelect %uint %162 %158 %uint_4 + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %166 = OpAccessChain %_ptr_StorageBuffer_uint_0 %165 %163 + OpCooperativeMatrixStoreKHR %166 %m5 %uint_1 %164 NonPrivatePointer + %168 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %170 = OpAccessChain %_ptr_StorageBuffer_v3half %168 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %170 %uint_0 %uint_16 None + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %174 = OpArrayLength %uint %39 0 + %175 = OpBitcast %uint %int_0 + %176 = OpBitcast %uint %int_16 + %177 = OpIMul %uint %176 %uint_7 + %178 = OpIAdd %uint %175 %177 + %179 = OpIAdd %uint %178 %uint_4 + %180 = OpULessThanEqual %bool %179 %174 + %181 = OpSelect %uint %180 %175 %uint_0 + %182 = OpSelect %uint %180 %176 %uint_4 + %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %184 = OpAccessChain %_ptr_StorageBuffer_uint_0 %183 %181 + OpCooperativeMatrixStoreKHR %184 %m6 %uint_1 %182 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl index cec780b..af30cc6 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -25,7 +25,7 @@ uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 8u) * 2u)); + bool v_10 = (((v_9 + (16u * 7u)) + 4u) <= (v_8 / 8u)); Matrix_left_f32_8x8 m1 = Matrix_left_f32_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_11 = 0u; v.GetDimensions(v_11); @@ -36,7 +36,7 @@ uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 16u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 16u)); Matrix_left_f32_8x8 m2 = Matrix_left_f32_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_18 = 0u; v.GetDimensions(v_18); @@ -47,7 +47,7 @@ uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 4u) + 8u) <= ((v_22 / 16u) * 4u)); + bool v_24 = (((v_23 + (16u * 7u)) + 2u) <= (v_22 / 16u)); Matrix_left_f32_8x8 m3 = Matrix_left_f32_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); @@ -69,7 +69,7 @@ uint v_36 = 0u; in6.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 2u) + 8u) <= ((v_36 / 8u) * 2u)); + bool v_38 = (((v_37 + (16u * 7u)) + 4u) <= (v_36 / 8u)); Matrix_left_f32_8x8 m6 = Matrix_left_f32_8x8::Load(in6, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_col_major.wgsl.expected.msl index 0eb410c..9473270 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_col_major.wgsl.expected.msl
@@ -58,7 +58,7 @@ bool const v_7 = (((v_5 + (v_6 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m0, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_5, v_7) * 4u)), ulong((select(8u, v_6, v_7) * 1u)), ulong2(0ul), true)); uint const v_8 = as_type<uint>(0); - bool const v_9 = ((((v_8 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_1 * 2u)); + bool const v_9 = (((v_8 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_1); simdgroup_float8x8 v_10 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_10, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (select(0u, v_8, v_9) * 8u)), ulong((select(4u, 16u, v_9) * 2u)), ulong2(0ul), true)); simdgroup_float8x8 const m1 = v_10; @@ -67,7 +67,7 @@ bool const v_13 = (((v_11 + (v_12 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m1, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_11, v_13) * 4u)), ulong((select(8u, v_12, v_13) * 1u)), ulong2(0ul), true)); uint const v_14 = as_type<uint>(0); - bool const v_15 = ((((v_14 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_2 * 4u)); + bool const v_15 = (((v_14 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_2); simdgroup_float8x8 v_16 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_16, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (select(0u, v_14, v_15) * 16u)), ulong((select(2u, 16u, v_15) * 4u)), ulong2(0ul), true)); simdgroup_float8x8 const m2 = v_16; @@ -76,7 +76,7 @@ bool const v_19 = (((v_17 + (v_18 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m2, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_17, v_19) * 4u)), ulong((select(8u, v_18, v_19) * 1u)), ulong2(0ul), true)); uint const v_20 = as_type<uint>(0); - bool const v_21 = ((((v_20 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_3 * 4u)); + bool const v_21 = (((v_20 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_3); simdgroup_float8x8 v_22 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_22, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (select(0u, v_20, v_21) * 16u)), ulong((select(2u, 16u, v_21) * 4u)), ulong2(0ul), true)); simdgroup_float8x8 const m3 = v_22; @@ -94,7 +94,7 @@ bool const v_31 = (((v_29 + (v_30 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m5, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_29, v_31) * 4u)), ulong((select(8u, v_30, v_31) * 1u)), ulong2(0ul), true)); uint const v_32 = as_type<uint>(0); - bool const v_33 = ((((v_32 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_33 = (((v_32 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); simdgroup_float8x8 v_34 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_34, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (select(0u, v_32, v_33) * 8u)), ulong((select(4u, 16u, v_33) * 2u)), ulong2(0ul), true)); simdgroup_float8x8 const m6 = v_34;
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_col_major.wgsl.expected.spvasm index 594a910..1368556 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 225 +; Bound: 217 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,10 +128,10 @@ %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -168,136 +168,128 @@ OpCooperativeMatrixStoreKHR %77 %m0 %uint_1 %75 NonPrivatePointer %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %82 = OpArrayLength %uint %6 0 - %83 = OpIMul %uint %82 %uint_2 - %85 = OpBitcast %uint %int_0 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %85 %86 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %83 - %91 = OpSelect %uint %90 %85 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_4 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %91 - %m1 = OpCooperativeMatrixLoadKHR %61 %95 %uint_1 %92 None - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %99 = OpArrayLength %uint %34 0 - %100 = OpBitcast %uint %int_0 - %101 = OpBitcast %uint %int_16 - %102 = OpIMul %uint %101 %uint_7 - %103 = OpIAdd %uint %100 %102 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %101 %uint_8 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 - OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %113 = OpArrayLength %uint %12 0 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIMul %uint %117 %uint_4 - %119 = OpIAdd %uint %118 %uint_8 - %120 = OpULessThanEqual %bool %119 %114 - %121 = OpSelect %uint %120 %115 %uint_0 - %122 = OpSelect %uint %120 %uint_16 %uint_2 - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 - %m2 = OpCooperativeMatrixLoadKHR %61 %124 %uint_1 %122 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %128 = OpArrayLength %uint %34 0 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %130 %uint_8 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 - OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %142 = OpArrayLength %uint %18 0 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpBitcast %uint %int_0 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %144 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %143 - %150 = OpSelect %uint %149 %144 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v4uint %152 %150 - %m3 = OpCooperativeMatrixLoadKHR %61 %153 %uint_1 %151 None - %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %157 = OpArrayLength %uint %34 0 - %158 = OpBitcast %uint %int_0 - %159 = OpBitcast %uint %int_16 - %160 = OpIMul %uint %159 %uint_7 - %161 = OpIAdd %uint %158 %160 - %162 = OpIAdd %uint %161 %uint_8 - %163 = OpULessThanEqual %bool %162 %157 - %164 = OpSelect %uint %163 %158 %uint_0 - %165 = OpSelect %uint %163 %159 %uint_8 - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 - OpCooperativeMatrixStoreKHR %167 %m3 %uint_1 %165 NonPrivatePointer - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %171 = OpArrayLength %uint %23 0 - %172 = OpBitcast %uint %int_0 - %173 = OpIMul %uint %uint_16 %uint_7 - %174 = OpIAdd %uint %172 %173 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %171 - %177 = OpSelect %uint %176 %172 %uint_0 - %178 = OpSelect %uint %176 %uint_16 %uint_8 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_v2half %179 %177 - %m5 = OpCooperativeMatrixLoadKHR %61 %180 %uint_1 %178 None - %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %184 = OpArrayLength %uint %34 0 - %185 = OpBitcast %uint %int_0 - %186 = OpBitcast %uint %int_16 - %187 = OpIMul %uint %186 %uint_7 - %188 = OpIAdd %uint %185 %187 - %189 = OpIAdd %uint %188 %uint_8 - %190 = OpULessThanEqual %bool %189 %184 - %191 = OpSelect %uint %190 %185 %uint_0 - %192 = OpSelect %uint %190 %186 %uint_8 - %193 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %194 = OpAccessChain %_ptr_StorageBuffer_uint_0 %193 %191 - OpCooperativeMatrixStoreKHR %194 %m5 %uint_1 %192 NonPrivatePointer - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %198 = OpArrayLength %uint %29 0 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpBitcast %uint %int_0 - %201 = OpIMul %uint %uint_16 %uint_7 - %202 = OpIAdd %uint %200 %201 - %203 = OpIMul %uint %202 %uint_2 - %204 = OpIAdd %uint %203 %uint_8 - %205 = OpULessThanEqual %bool %204 %199 - %206 = OpSelect %uint %205 %200 %uint_0 - %207 = OpSelect %uint %205 %uint_16 %uint_4 - %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %209 = OpAccessChain %_ptr_StorageBuffer_v3half %208 %206 - %m6 = OpCooperativeMatrixLoadKHR %61 %209 %uint_1 %207 None - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %213 = OpArrayLength %uint %34 0 - %214 = OpBitcast %uint %int_0 - %215 = OpBitcast %uint %int_16 - %216 = OpIMul %uint %215 %uint_7 - %217 = OpIAdd %uint %214 %216 - %218 = OpIAdd %uint %217 %uint_8 - %219 = OpULessThanEqual %bool %218 %213 - %220 = OpSelect %uint %219 %214 %uint_0 - %221 = OpSelect %uint %219 %215 %uint_8 - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %223 = OpAccessChain %_ptr_StorageBuffer_uint_0 %222 %220 - OpCooperativeMatrixStoreKHR %223 %m6 %uint_1 %221 NonPrivatePointer + %83 = OpBitcast %uint %int_0 + %84 = OpIMul %uint %uint_16 %uint_7 + %85 = OpIAdd %uint %83 %84 + %86 = OpIAdd %uint %85 %uint_4 + %88 = OpULessThanEqual %bool %86 %82 + %89 = OpSelect %uint %88 %83 %uint_0 + %90 = OpSelect %uint %88 %uint_16 %uint_4 + %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %92 = OpAccessChain %_ptr_StorageBuffer_v2int %91 %89 + %m1 = OpCooperativeMatrixLoadKHR %61 %92 %uint_1 %90 None + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %96 = OpArrayLength %uint %34 0 + %97 = OpBitcast %uint %int_0 + %98 = OpBitcast %uint %int_16 + %99 = OpIMul %uint %98 %uint_7 + %100 = OpIAdd %uint %97 %99 + %101 = OpIAdd %uint %100 %uint_8 + %102 = OpULessThanEqual %bool %101 %96 + %103 = OpSelect %uint %102 %97 %uint_0 + %104 = OpSelect %uint %102 %98 %uint_8 + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %106 = OpAccessChain %_ptr_StorageBuffer_uint_0 %105 %103 + OpCooperativeMatrixStoreKHR %106 %m1 %uint_1 %104 NonPrivatePointer + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %110 = OpArrayLength %uint %12 0 + %111 = OpBitcast %uint %int_0 + %112 = OpIMul %uint %uint_16 %uint_7 + %113 = OpIAdd %uint %111 %112 + %114 = OpIAdd %uint %113 %uint_2 + %116 = OpULessThanEqual %bool %114 %110 + %117 = OpSelect %uint %116 %111 %uint_0 + %118 = OpSelect %uint %116 %uint_16 %uint_2 + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %120 = OpAccessChain %_ptr_StorageBuffer_v3float %119 %117 + %m2 = OpCooperativeMatrixLoadKHR %61 %120 %uint_1 %118 None + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %124 = OpArrayLength %uint %34 0 + %125 = OpBitcast %uint %int_0 + %126 = OpBitcast %uint %int_16 + %127 = OpIMul %uint %126 %uint_7 + %128 = OpIAdd %uint %125 %127 + %129 = OpIAdd %uint %128 %uint_8 + %130 = OpULessThanEqual %bool %129 %124 + %131 = OpSelect %uint %130 %125 %uint_0 + %132 = OpSelect %uint %130 %126 %uint_8 + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_uint_0 %133 %131 + OpCooperativeMatrixStoreKHR %134 %m2 %uint_1 %132 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %138 = OpArrayLength %uint %18 0 + %139 = OpBitcast %uint %int_0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %139 %140 + %142 = OpIAdd %uint %141 %uint_2 + %143 = OpULessThanEqual %bool %142 %138 + %144 = OpSelect %uint %143 %139 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_2 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %61 %147 %uint_1 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %151 = OpArrayLength %uint %34 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_8 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_8 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpBitcast %uint %int_0 + %167 = OpIMul %uint %uint_16 %uint_7 + %168 = OpIAdd %uint %166 %167 + %169 = OpIAdd %uint %168 %uint_8 + %170 = OpULessThanEqual %bool %169 %165 + %171 = OpSelect %uint %170 %166 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_8 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_v2half %173 %171 + %m5 = OpCooperativeMatrixLoadKHR %61 %174 %uint_1 %172 None + %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %178 = OpArrayLength %uint %34 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_8 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_8 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m5 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %192 = OpArrayLength %uint %29 0 + %193 = OpBitcast %uint %int_0 + %194 = OpIMul %uint %uint_16 %uint_7 + %195 = OpIAdd %uint %193 %194 + %196 = OpIAdd %uint %195 %uint_4 + %197 = OpULessThanEqual %bool %196 %192 + %198 = OpSelect %uint %197 %193 %uint_0 + %199 = OpSelect %uint %197 %uint_16 %uint_4 + %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %201 = OpAccessChain %_ptr_StorageBuffer_v3half %200 %198 + %m6 = OpCooperativeMatrixLoadKHR %61 %201 %uint_1 %199 None + %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %205 = OpArrayLength %uint %34 0 + %206 = OpBitcast %uint %int_0 + %207 = OpBitcast %uint %int_16 + %208 = OpIMul %uint %207 %uint_7 + %209 = OpIAdd %uint %206 %208 + %210 = OpIAdd %uint %209 %uint_8 + %211 = OpULessThanEqual %bool %210 %205 + %212 = OpSelect %uint %211 %206 %uint_0 + %213 = OpSelect %uint %211 %207 %uint_8 + %214 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %215 = OpAccessChain %_ptr_StorageBuffer_uint_0 %214 %212 + OpCooperativeMatrixStoreKHR %215 %m6 %uint_1 %213 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl index 3d9f975..2570a0d 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -25,7 +25,7 @@ uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 8u) * 2u)); + bool v_10 = (((v_9 + (16u * 7u)) + 4u) <= (v_8 / 8u)); Matrix_left_f32_8x8 m1 = Matrix_left_f32_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_11 = 0u; v.GetDimensions(v_11); @@ -36,7 +36,7 @@ uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 16u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 16u)); Matrix_left_f32_8x8 m2 = Matrix_left_f32_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_18 = 0u; v.GetDimensions(v_18); @@ -47,7 +47,7 @@ uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 4u) + 8u) <= ((v_22 / 16u) * 4u)); + bool v_24 = (((v_23 + (16u * 7u)) + 2u) <= (v_22 / 16u)); Matrix_left_f32_8x8 m3 = Matrix_left_f32_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); @@ -69,7 +69,7 @@ uint v_36 = 0u; in6.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 2u) + 8u) <= ((v_36 / 8u) * 2u)); + bool v_38 = (((v_37 + (16u * 7u)) + 4u) <= (v_36 / 8u)); Matrix_left_f32_8x8 m6 = Matrix_left_f32_8x8::Load(in6, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_row_major.wgsl.expected.msl index 1a0d25f..9935840 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_row_major.wgsl.expected.msl
@@ -58,7 +58,7 @@ bool const v_7 = (((v_5 + (v_6 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m0, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_5, v_7) * 4u)), ulong((select(8u, v_6, v_7) * 1u)), ulong2(0ul), true)); uint const v_8 = as_type<uint>(0); - bool const v_9 = ((((v_8 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_1 * 2u)); + bool const v_9 = (((v_8 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_1); simdgroup_float8x8 v_10 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_10, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (select(0u, v_8, v_9) * 8u)), ulong((select(4u, 16u, v_9) * 2u)), ulong2(0ul), false)); simdgroup_float8x8 const m1 = v_10; @@ -67,7 +67,7 @@ bool const v_13 = (((v_11 + (v_12 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m1, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_11, v_13) * 4u)), ulong((select(8u, v_12, v_13) * 1u)), ulong2(0ul), true)); uint const v_14 = as_type<uint>(0); - bool const v_15 = ((((v_14 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_2 * 4u)); + bool const v_15 = (((v_14 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_2); simdgroup_float8x8 v_16 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_16, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (select(0u, v_14, v_15) * 16u)), ulong((select(2u, 16u, v_15) * 4u)), ulong2(0ul), false)); simdgroup_float8x8 const m2 = v_16; @@ -76,7 +76,7 @@ bool const v_19 = (((v_17 + (v_18 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m2, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_17, v_19) * 4u)), ulong((select(8u, v_18, v_19) * 1u)), ulong2(0ul), true)); uint const v_20 = as_type<uint>(0); - bool const v_21 = ((((v_20 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_3 * 4u)); + bool const v_21 = (((v_20 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_3); simdgroup_float8x8 v_22 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_22, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (select(0u, v_20, v_21) * 16u)), ulong((select(2u, 16u, v_21) * 4u)), ulong2(0ul), false)); simdgroup_float8x8 const m3 = v_22; @@ -94,7 +94,7 @@ bool const v_31 = (((v_29 + (v_30 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m5, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_29, v_31) * 4u)), ulong((select(8u, v_30, v_31) * 1u)), ulong2(0ul), true)); uint const v_32 = as_type<uint>(0); - bool const v_33 = ((((v_32 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_33 = (((v_32 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); simdgroup_float8x8 v_34 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_34, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (select(0u, v_32, v_33) * 8u)), ulong((select(4u, 16u, v_33) * 2u)), ulong2(0ul), false)); simdgroup_float8x8 const m6 = v_34;
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_row_major.wgsl.expected.spvasm index b00561e..d923ad4 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_f32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 225 +; Bound: 217 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,10 +128,10 @@ %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -168,136 +168,128 @@ OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %82 = OpArrayLength %uint %6 0 - %83 = OpIMul %uint %82 %uint_2 - %85 = OpBitcast %uint %int_0 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %85 %86 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %83 - %91 = OpSelect %uint %90 %85 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_4 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %91 - %m1 = OpCooperativeMatrixLoadKHR %61 %95 %uint_0 %92 None - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %99 = OpArrayLength %uint %34 0 - %100 = OpBitcast %uint %int_0 - %101 = OpBitcast %uint %int_16 - %102 = OpIMul %uint %101 %uint_7 - %103 = OpIAdd %uint %100 %102 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %101 %uint_8 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 - OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %113 = OpArrayLength %uint %12 0 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIMul %uint %117 %uint_4 - %119 = OpIAdd %uint %118 %uint_8 - %120 = OpULessThanEqual %bool %119 %114 - %121 = OpSelect %uint %120 %115 %uint_0 - %122 = OpSelect %uint %120 %uint_16 %uint_2 - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 - %m2 = OpCooperativeMatrixLoadKHR %61 %124 %uint_0 %122 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %128 = OpArrayLength %uint %34 0 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %130 %uint_8 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 - OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %142 = OpArrayLength %uint %18 0 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpBitcast %uint %int_0 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %144 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %143 - %150 = OpSelect %uint %149 %144 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v4uint %152 %150 - %m3 = OpCooperativeMatrixLoadKHR %61 %153 %uint_0 %151 None - %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %157 = OpArrayLength %uint %34 0 - %158 = OpBitcast %uint %int_0 - %159 = OpBitcast %uint %int_16 - %160 = OpIMul %uint %159 %uint_7 - %161 = OpIAdd %uint %158 %160 - %162 = OpIAdd %uint %161 %uint_8 - %163 = OpULessThanEqual %bool %162 %157 - %164 = OpSelect %uint %163 %158 %uint_0 - %165 = OpSelect %uint %163 %159 %uint_8 - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 - OpCooperativeMatrixStoreKHR %167 %m3 %uint_1 %165 NonPrivatePointer - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %171 = OpArrayLength %uint %23 0 - %172 = OpBitcast %uint %int_0 - %173 = OpIMul %uint %uint_16 %uint_7 - %174 = OpIAdd %uint %172 %173 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %171 - %177 = OpSelect %uint %176 %172 %uint_0 - %178 = OpSelect %uint %176 %uint_16 %uint_8 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_v2half %179 %177 - %m5 = OpCooperativeMatrixLoadKHR %61 %180 %uint_0 %178 None - %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %184 = OpArrayLength %uint %34 0 - %185 = OpBitcast %uint %int_0 - %186 = OpBitcast %uint %int_16 - %187 = OpIMul %uint %186 %uint_7 - %188 = OpIAdd %uint %185 %187 - %189 = OpIAdd %uint %188 %uint_8 - %190 = OpULessThanEqual %bool %189 %184 - %191 = OpSelect %uint %190 %185 %uint_0 - %192 = OpSelect %uint %190 %186 %uint_8 - %193 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %194 = OpAccessChain %_ptr_StorageBuffer_uint_0 %193 %191 - OpCooperativeMatrixStoreKHR %194 %m5 %uint_1 %192 NonPrivatePointer - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %198 = OpArrayLength %uint %29 0 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpBitcast %uint %int_0 - %201 = OpIMul %uint %uint_16 %uint_7 - %202 = OpIAdd %uint %200 %201 - %203 = OpIMul %uint %202 %uint_2 - %204 = OpIAdd %uint %203 %uint_8 - %205 = OpULessThanEqual %bool %204 %199 - %206 = OpSelect %uint %205 %200 %uint_0 - %207 = OpSelect %uint %205 %uint_16 %uint_4 - %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %209 = OpAccessChain %_ptr_StorageBuffer_v3half %208 %206 - %m6 = OpCooperativeMatrixLoadKHR %61 %209 %uint_0 %207 None - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %213 = OpArrayLength %uint %34 0 - %214 = OpBitcast %uint %int_0 - %215 = OpBitcast %uint %int_16 - %216 = OpIMul %uint %215 %uint_7 - %217 = OpIAdd %uint %214 %216 - %218 = OpIAdd %uint %217 %uint_8 - %219 = OpULessThanEqual %bool %218 %213 - %220 = OpSelect %uint %219 %214 %uint_0 - %221 = OpSelect %uint %219 %215 %uint_8 - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %223 = OpAccessChain %_ptr_StorageBuffer_uint_0 %222 %220 - OpCooperativeMatrixStoreKHR %223 %m6 %uint_1 %221 NonPrivatePointer + %83 = OpBitcast %uint %int_0 + %84 = OpIMul %uint %uint_16 %uint_7 + %85 = OpIAdd %uint %83 %84 + %86 = OpIAdd %uint %85 %uint_4 + %88 = OpULessThanEqual %bool %86 %82 + %89 = OpSelect %uint %88 %83 %uint_0 + %90 = OpSelect %uint %88 %uint_16 %uint_4 + %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %92 = OpAccessChain %_ptr_StorageBuffer_v2int %91 %89 + %m1 = OpCooperativeMatrixLoadKHR %61 %92 %uint_0 %90 None + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %96 = OpArrayLength %uint %34 0 + %97 = OpBitcast %uint %int_0 + %98 = OpBitcast %uint %int_16 + %99 = OpIMul %uint %98 %uint_7 + %100 = OpIAdd %uint %97 %99 + %101 = OpIAdd %uint %100 %uint_8 + %102 = OpULessThanEqual %bool %101 %96 + %103 = OpSelect %uint %102 %97 %uint_0 + %104 = OpSelect %uint %102 %98 %uint_8 + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %106 = OpAccessChain %_ptr_StorageBuffer_uint_0 %105 %103 + OpCooperativeMatrixStoreKHR %106 %m1 %uint_1 %104 NonPrivatePointer + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %110 = OpArrayLength %uint %12 0 + %111 = OpBitcast %uint %int_0 + %112 = OpIMul %uint %uint_16 %uint_7 + %113 = OpIAdd %uint %111 %112 + %114 = OpIAdd %uint %113 %uint_2 + %116 = OpULessThanEqual %bool %114 %110 + %117 = OpSelect %uint %116 %111 %uint_0 + %118 = OpSelect %uint %116 %uint_16 %uint_2 + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %120 = OpAccessChain %_ptr_StorageBuffer_v3float %119 %117 + %m2 = OpCooperativeMatrixLoadKHR %61 %120 %uint_0 %118 None + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %124 = OpArrayLength %uint %34 0 + %125 = OpBitcast %uint %int_0 + %126 = OpBitcast %uint %int_16 + %127 = OpIMul %uint %126 %uint_7 + %128 = OpIAdd %uint %125 %127 + %129 = OpIAdd %uint %128 %uint_8 + %130 = OpULessThanEqual %bool %129 %124 + %131 = OpSelect %uint %130 %125 %uint_0 + %132 = OpSelect %uint %130 %126 %uint_8 + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_uint_0 %133 %131 + OpCooperativeMatrixStoreKHR %134 %m2 %uint_1 %132 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %138 = OpArrayLength %uint %18 0 + %139 = OpBitcast %uint %int_0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %139 %140 + %142 = OpIAdd %uint %141 %uint_2 + %143 = OpULessThanEqual %bool %142 %138 + %144 = OpSelect %uint %143 %139 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_2 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %61 %147 %uint_0 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %151 = OpArrayLength %uint %34 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_8 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_8 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpBitcast %uint %int_0 + %167 = OpIMul %uint %uint_16 %uint_7 + %168 = OpIAdd %uint %166 %167 + %169 = OpIAdd %uint %168 %uint_8 + %170 = OpULessThanEqual %bool %169 %165 + %171 = OpSelect %uint %170 %166 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_8 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_v2half %173 %171 + %m5 = OpCooperativeMatrixLoadKHR %61 %174 %uint_0 %172 None + %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %178 = OpArrayLength %uint %34 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_8 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_8 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m5 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %192 = OpArrayLength %uint %29 0 + %193 = OpBitcast %uint %int_0 + %194 = OpIMul %uint %uint_16 %uint_7 + %195 = OpIAdd %uint %193 %194 + %196 = OpIAdd %uint %195 %uint_4 + %197 = OpULessThanEqual %bool %196 %192 + %198 = OpSelect %uint %197 %193 %uint_0 + %199 = OpSelect %uint %197 %uint_16 %uint_4 + %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %201 = OpAccessChain %_ptr_StorageBuffer_v3half %200 %198 + %m6 = OpCooperativeMatrixLoadKHR %61 %201 %uint_0 %199 None + %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %205 = OpArrayLength %uint %34 0 + %206 = OpBitcast %uint %int_0 + %207 = OpBitcast %uint %int_16 + %208 = OpIMul %uint %207 %uint_7 + %209 = OpIAdd %uint %206 %208 + %210 = OpIAdd %uint %209 %uint_8 + %211 = OpULessThanEqual %bool %210 %205 + %212 = OpSelect %uint %211 %206 %uint_0 + %213 = OpSelect %uint %211 %207 %uint_8 + %214 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %215 = OpAccessChain %_ptr_StorageBuffer_uint_0 %214 %212 + OpCooperativeMatrixStoreKHR %215 %m6 %uint_1 %213 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl index 2ece93f..2a68895 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -23,7 +23,7 @@ m0.Store(v, (0u + (select(v_6, v_4, 0u) * 4u)), (select(v_6, v_5, 8u) * 4u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_7 / 8u) * 2u)); + bool v_8 = (((0u + (16u * 7u)) + 4u) <= (v_7 / 8u)); Matrix_left_i32_8x8 m1 = Matrix_left_i32_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 4u)), (select(v_8, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); @@ -33,7 +33,7 @@ m1.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 8u) * 4u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_13 / 16u) * 4u)); + bool v_14 = (((0u + (16u * 7u)) + 2u) <= (v_13 / 16u)); Matrix_left_i32_8x8 m2 = Matrix_left_i32_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 4u)), (select(v_14, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; v.GetDimensions(v_15); @@ -43,7 +43,7 @@ m2.Store(v, (0u + (select(v_18, v_16, 0u) * 4u)), (select(v_18, v_17, 8u) * 4u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_19 / 16u) * 4u)); + bool v_20 = (((0u + (16u * 7u)) + 2u) <= (v_19 / 16u)); Matrix_left_i32_8x8 m3 = Matrix_left_i32_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 4u)), (select(v_20, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); @@ -63,7 +63,7 @@ m5.Store(v, (0u + (select(v_30, v_28, 0u) * 4u)), (select(v_30, v_29, 8u) * 4u), MatrixLayout::ColMajor); uint v_31 = 0u; in6.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_31 / 8u) * 2u)); + bool v_32 = (((0u + (16u * 7u)) + 4u) <= (v_31 / 8u)); Matrix_left_i32_8x8 m6 = Matrix_left_i32_8x8::Load(in6, (0u + (select(v_32, 0u, 0u) * 4u)), (select(v_32, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_33 = 0u; v.GetDimensions(v_33);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_col_major.wgsl.expected.spvasm index 551413f..d6e02ce 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 219 +; Bound: 211 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,10 +128,10 @@ %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -167,131 +167,123 @@ OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %81 = OpArrayLength %uint %6 0 - %82 = OpIMul %uint %81 %uint_2 - %84 = OpIMul %uint %uint_16 %uint_7 - %85 = OpIAdd %uint %uint_0 %84 - %86 = OpIMul %uint %85 %uint_2 - %87 = OpIAdd %uint %86 %uint_8 - %88 = OpULessThanEqual %bool %87 %82 - %89 = OpSelect %uint %88 %uint_0 %uint_0 - %90 = OpSelect %uint %88 %uint_16 %uint_4 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v2int %92 %89 - %m1 = OpCooperativeMatrixLoadKHR %59 %93 %uint_1 %90 None - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %97 = OpArrayLength %uint %34 0 - %98 = OpBitcast %uint %int_0 - %99 = OpBitcast %uint %int_16 - %100 = OpIMul %uint %99 %uint_7 - %101 = OpIAdd %uint %98 %100 - %102 = OpIAdd %uint %101 %uint_8 - %103 = OpULessThanEqual %bool %102 %97 - %104 = OpSelect %uint %103 %98 %uint_0 - %105 = OpSelect %uint %103 %99 %uint_8 - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %107 = OpAccessChain %_ptr_StorageBuffer_uint_0 %106 %104 - OpCooperativeMatrixStoreKHR %107 %m1 %uint_1 %105 NonPrivatePointer - %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %111 = OpArrayLength %uint %12 0 - %112 = OpIMul %uint %111 %uint_4 - %113 = OpIMul %uint %uint_16 %uint_7 - %114 = OpIAdd %uint %uint_0 %113 - %115 = OpIMul %uint %114 %uint_4 - %116 = OpIAdd %uint %115 %uint_8 - %117 = OpULessThanEqual %bool %116 %112 - %118 = OpSelect %uint %117 %uint_0 %uint_0 - %119 = OpSelect %uint %117 %uint_16 %uint_2 - %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 - %m2 = OpCooperativeMatrixLoadKHR %59 %121 %uint_1 %119 None - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %125 = OpArrayLength %uint %34 0 - %126 = OpBitcast %uint %int_0 - %127 = OpBitcast %uint %int_16 - %128 = OpIMul %uint %127 %uint_7 - %129 = OpIAdd %uint %126 %128 - %130 = OpIAdd %uint %129 %uint_8 - %131 = OpULessThanEqual %bool %130 %125 - %132 = OpSelect %uint %131 %126 %uint_0 - %133 = OpSelect %uint %131 %127 %uint_8 - %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 - OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %139 = OpArrayLength %uint %18 0 - %140 = OpIMul %uint %139 %uint_4 - %141 = OpIMul %uint %uint_16 %uint_7 - %142 = OpIAdd %uint %uint_0 %141 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpIAdd %uint %143 %uint_8 - %145 = OpULessThanEqual %bool %144 %140 - %146 = OpSelect %uint %145 %uint_0 %uint_0 - %147 = OpSelect %uint %145 %uint_16 %uint_2 - %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %149 = OpAccessChain %_ptr_StorageBuffer_v4uint %148 %146 - %m3 = OpCooperativeMatrixLoadKHR %59 %149 %uint_1 %147 None - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %153 = OpArrayLength %uint %34 0 - %154 = OpBitcast %uint %int_0 - %155 = OpBitcast %uint %int_16 - %156 = OpIMul %uint %155 %uint_7 - %157 = OpIAdd %uint %154 %156 - %158 = OpIAdd %uint %157 %uint_8 - %159 = OpULessThanEqual %bool %158 %153 - %160 = OpSelect %uint %159 %154 %uint_0 - %161 = OpSelect %uint %159 %155 %uint_8 - %162 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %163 = OpAccessChain %_ptr_StorageBuffer_uint_0 %162 %160 - OpCooperativeMatrixStoreKHR %163 %m3 %uint_1 %161 NonPrivatePointer - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %167 = OpArrayLength %uint %23 0 - %168 = OpIMul %uint %uint_16 %uint_7 - %169 = OpIAdd %uint %uint_0 %168 - %170 = OpIAdd %uint %169 %uint_8 - %171 = OpULessThanEqual %bool %170 %167 - %172 = OpSelect %uint %171 %uint_0 %uint_0 - %173 = OpSelect %uint %171 %uint_16 %uint_8 - %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %175 = OpAccessChain %_ptr_StorageBuffer_v2half %174 %172 - %m5 = OpCooperativeMatrixLoadKHR %59 %175 %uint_1 %173 None - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %179 = OpArrayLength %uint %34 0 - %180 = OpBitcast %uint %int_0 - %181 = OpBitcast %uint %int_16 - %182 = OpIMul %uint %181 %uint_7 - %183 = OpIAdd %uint %180 %182 - %184 = OpIAdd %uint %183 %uint_8 - %185 = OpULessThanEqual %bool %184 %179 - %186 = OpSelect %uint %185 %180 %uint_0 - %187 = OpSelect %uint %185 %181 %uint_8 - %188 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %189 = OpAccessChain %_ptr_StorageBuffer_uint_0 %188 %186 - OpCooperativeMatrixStoreKHR %189 %m5 %uint_1 %187 NonPrivatePointer - %191 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %193 = OpArrayLength %uint %29 0 - %194 = OpIMul %uint %193 %uint_2 - %195 = OpIMul %uint %uint_16 %uint_7 - %196 = OpIAdd %uint %uint_0 %195 - %197 = OpIMul %uint %196 %uint_2 - %198 = OpIAdd %uint %197 %uint_8 - %199 = OpULessThanEqual %bool %198 %194 - %200 = OpSelect %uint %199 %uint_0 %uint_0 - %201 = OpSelect %uint %199 %uint_16 %uint_4 - %202 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %203 = OpAccessChain %_ptr_StorageBuffer_v3half %202 %200 - %m6 = OpCooperativeMatrixLoadKHR %59 %203 %uint_1 %201 None - %206 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %207 = OpArrayLength %uint %34 0 - %208 = OpBitcast %uint %int_0 - %209 = OpBitcast %uint %int_16 - %210 = OpIMul %uint %209 %uint_7 - %211 = OpIAdd %uint %208 %210 - %212 = OpIAdd %uint %211 %uint_8 - %213 = OpULessThanEqual %bool %212 %207 - %214 = OpSelect %uint %213 %208 %uint_0 - %215 = OpSelect %uint %213 %209 %uint_8 - %216 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %217 = OpAccessChain %_ptr_StorageBuffer_uint_0 %216 %214 - OpCooperativeMatrixStoreKHR %217 %m6 %uint_1 %215 NonPrivatePointer + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_4 + %86 = OpULessThanEqual %bool %84 %81 + %87 = OpSelect %uint %86 %uint_0 %uint_0 + %88 = OpSelect %uint %86 %uint_16 %uint_4 + %89 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %90 = OpAccessChain %_ptr_StorageBuffer_v2int %89 %87 + %m1 = OpCooperativeMatrixLoadKHR %59 %90 %uint_1 %88 None + %93 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %94 = OpArrayLength %uint %34 0 + %95 = OpBitcast %uint %int_0 + %96 = OpBitcast %uint %int_16 + %97 = OpIMul %uint %96 %uint_7 + %98 = OpIAdd %uint %95 %97 + %99 = OpIAdd %uint %98 %uint_8 + %100 = OpULessThanEqual %bool %99 %94 + %101 = OpSelect %uint %100 %95 %uint_0 + %102 = OpSelect %uint %100 %96 %uint_8 + %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %104 = OpAccessChain %_ptr_StorageBuffer_uint_0 %103 %101 + OpCooperativeMatrixStoreKHR %104 %m1 %uint_1 %102 NonPrivatePointer + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %108 = OpArrayLength %uint %12 0 + %109 = OpIMul %uint %uint_16 %uint_7 + %110 = OpIAdd %uint %uint_0 %109 + %111 = OpIAdd %uint %110 %uint_2 + %113 = OpULessThanEqual %bool %111 %108 + %114 = OpSelect %uint %113 %uint_0 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_2 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v3float %116 %114 + %m2 = OpCooperativeMatrixLoadKHR %59 %117 %uint_1 %115 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %121 = OpArrayLength %uint %34 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_8 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_8 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m2 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %135 = OpArrayLength %uint %18 0 + %136 = OpIMul %uint %uint_16 %uint_7 + %137 = OpIAdd %uint %uint_0 %136 + %138 = OpIAdd %uint %137 %uint_2 + %139 = OpULessThanEqual %bool %138 %135 + %140 = OpSelect %uint %139 %uint_0 %uint_0 + %141 = OpSelect %uint %139 %uint_16 %uint_2 + %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %143 = OpAccessChain %_ptr_StorageBuffer_v4uint %142 %140 + %m3 = OpCooperativeMatrixLoadKHR %59 %143 %uint_1 %141 None + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %147 = OpArrayLength %uint %34 0 + %148 = OpBitcast %uint %int_0 + %149 = OpBitcast %uint %int_16 + %150 = OpIMul %uint %149 %uint_7 + %151 = OpIAdd %uint %148 %150 + %152 = OpIAdd %uint %151 %uint_8 + %153 = OpULessThanEqual %bool %152 %147 + %154 = OpSelect %uint %153 %148 %uint_0 + %155 = OpSelect %uint %153 %149 %uint_8 + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %157 = OpAccessChain %_ptr_StorageBuffer_uint_0 %156 %154 + OpCooperativeMatrixStoreKHR %157 %m3 %uint_1 %155 NonPrivatePointer + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %161 = OpArrayLength %uint %23 0 + %162 = OpIMul %uint %uint_16 %uint_7 + %163 = OpIAdd %uint %uint_0 %162 + %164 = OpIAdd %uint %163 %uint_8 + %165 = OpULessThanEqual %bool %164 %161 + %166 = OpSelect %uint %165 %uint_0 %uint_0 + %167 = OpSelect %uint %165 %uint_16 %uint_8 + %168 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %169 = OpAccessChain %_ptr_StorageBuffer_v2half %168 %166 + %m5 = OpCooperativeMatrixLoadKHR %59 %169 %uint_1 %167 None + %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %173 = OpArrayLength %uint %34 0 + %174 = OpBitcast %uint %int_0 + %175 = OpBitcast %uint %int_16 + %176 = OpIMul %uint %175 %uint_7 + %177 = OpIAdd %uint %174 %176 + %178 = OpIAdd %uint %177 %uint_8 + %179 = OpULessThanEqual %bool %178 %173 + %180 = OpSelect %uint %179 %174 %uint_0 + %181 = OpSelect %uint %179 %175 %uint_8 + %182 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %183 = OpAccessChain %_ptr_StorageBuffer_uint_0 %182 %180 + OpCooperativeMatrixStoreKHR %183 %m5 %uint_1 %181 NonPrivatePointer + %185 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %187 = OpArrayLength %uint %29 0 + %188 = OpIMul %uint %uint_16 %uint_7 + %189 = OpIAdd %uint %uint_0 %188 + %190 = OpIAdd %uint %189 %uint_4 + %191 = OpULessThanEqual %bool %190 %187 + %192 = OpSelect %uint %191 %uint_0 %uint_0 + %193 = OpSelect %uint %191 %uint_16 %uint_4 + %194 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %195 = OpAccessChain %_ptr_StorageBuffer_v3half %194 %192 + %m6 = OpCooperativeMatrixLoadKHR %59 %195 %uint_1 %193 None + %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %199 = OpArrayLength %uint %34 0 + %200 = OpBitcast %uint %int_0 + %201 = OpBitcast %uint %int_16 + %202 = OpIMul %uint %201 %uint_7 + %203 = OpIAdd %uint %200 %202 + %204 = OpIAdd %uint %203 %uint_8 + %205 = OpULessThanEqual %bool %204 %199 + %206 = OpSelect %uint %205 %200 %uint_0 + %207 = OpSelect %uint %205 %201 %uint_8 + %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %209 = OpAccessChain %_ptr_StorageBuffer_uint_0 %208 %206 + OpCooperativeMatrixStoreKHR %209 %m6 %uint_1 %207 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl index 3960f6e..19fe89a 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -23,7 +23,7 @@ m0.Store(v, (0u + (select(v_6, v_4, 0u) * 4u)), (select(v_6, v_5, 8u) * 4u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_7 / 8u) * 2u)); + bool v_8 = (((0u + (16u * 7u)) + 4u) <= (v_7 / 8u)); Matrix_left_i32_8x8 m1 = Matrix_left_i32_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 4u)), (select(v_8, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); @@ -33,7 +33,7 @@ m1.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 8u) * 4u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_13 / 16u) * 4u)); + bool v_14 = (((0u + (16u * 7u)) + 2u) <= (v_13 / 16u)); Matrix_left_i32_8x8 m2 = Matrix_left_i32_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 4u)), (select(v_14, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_15 = 0u; v.GetDimensions(v_15); @@ -43,7 +43,7 @@ m2.Store(v, (0u + (select(v_18, v_16, 0u) * 4u)), (select(v_18, v_17, 8u) * 4u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_19 / 16u) * 4u)); + bool v_20 = (((0u + (16u * 7u)) + 2u) <= (v_19 / 16u)); Matrix_left_i32_8x8 m3 = Matrix_left_i32_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 4u)), (select(v_20, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); @@ -63,7 +63,7 @@ m5.Store(v, (0u + (select(v_30, v_28, 0u) * 4u)), (select(v_30, v_29, 8u) * 4u), MatrixLayout::ColMajor); uint v_31 = 0u; in6.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_31 / 8u) * 2u)); + bool v_32 = (((0u + (16u * 7u)) + 4u) <= (v_31 / 8u)); Matrix_left_i32_8x8 m6 = Matrix_left_i32_8x8::Load(in6, (0u + (select(v_32, 0u, 0u) * 4u)), (select(v_32, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_33 = 0u; v.GetDimensions(v_33);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_row_major.wgsl.expected.spvasm index c550ecf..9f76058 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_i32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 219 +; Bound: 211 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,10 +128,10 @@ %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -167,131 +167,123 @@ OpCooperativeMatrixStoreKHR %75 %m0 %uint_1 %73 NonPrivatePointer %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %81 = OpArrayLength %uint %6 0 - %82 = OpIMul %uint %81 %uint_2 - %84 = OpIMul %uint %uint_16 %uint_7 - %85 = OpIAdd %uint %uint_0 %84 - %86 = OpIMul %uint %85 %uint_2 - %87 = OpIAdd %uint %86 %uint_8 - %88 = OpULessThanEqual %bool %87 %82 - %89 = OpSelect %uint %88 %uint_0 %uint_0 - %90 = OpSelect %uint %88 %uint_16 %uint_4 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v2int %92 %89 - %m1 = OpCooperativeMatrixLoadKHR %59 %93 %uint_0 %90 None - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %97 = OpArrayLength %uint %34 0 - %98 = OpBitcast %uint %int_0 - %99 = OpBitcast %uint %int_16 - %100 = OpIMul %uint %99 %uint_7 - %101 = OpIAdd %uint %98 %100 - %102 = OpIAdd %uint %101 %uint_8 - %103 = OpULessThanEqual %bool %102 %97 - %104 = OpSelect %uint %103 %98 %uint_0 - %105 = OpSelect %uint %103 %99 %uint_8 - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %107 = OpAccessChain %_ptr_StorageBuffer_uint_0 %106 %104 - OpCooperativeMatrixStoreKHR %107 %m1 %uint_1 %105 NonPrivatePointer - %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %111 = OpArrayLength %uint %12 0 - %112 = OpIMul %uint %111 %uint_4 - %113 = OpIMul %uint %uint_16 %uint_7 - %114 = OpIAdd %uint %uint_0 %113 - %115 = OpIMul %uint %114 %uint_4 - %116 = OpIAdd %uint %115 %uint_8 - %117 = OpULessThanEqual %bool %116 %112 - %118 = OpSelect %uint %117 %uint_0 %uint_0 - %119 = OpSelect %uint %117 %uint_16 %uint_2 - %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 - %m2 = OpCooperativeMatrixLoadKHR %59 %121 %uint_0 %119 None - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %125 = OpArrayLength %uint %34 0 - %126 = OpBitcast %uint %int_0 - %127 = OpBitcast %uint %int_16 - %128 = OpIMul %uint %127 %uint_7 - %129 = OpIAdd %uint %126 %128 - %130 = OpIAdd %uint %129 %uint_8 - %131 = OpULessThanEqual %bool %130 %125 - %132 = OpSelect %uint %131 %126 %uint_0 - %133 = OpSelect %uint %131 %127 %uint_8 - %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 - OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %139 = OpArrayLength %uint %18 0 - %140 = OpIMul %uint %139 %uint_4 - %141 = OpIMul %uint %uint_16 %uint_7 - %142 = OpIAdd %uint %uint_0 %141 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpIAdd %uint %143 %uint_8 - %145 = OpULessThanEqual %bool %144 %140 - %146 = OpSelect %uint %145 %uint_0 %uint_0 - %147 = OpSelect %uint %145 %uint_16 %uint_2 - %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %149 = OpAccessChain %_ptr_StorageBuffer_v4uint %148 %146 - %m3 = OpCooperativeMatrixLoadKHR %59 %149 %uint_0 %147 None - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %153 = OpArrayLength %uint %34 0 - %154 = OpBitcast %uint %int_0 - %155 = OpBitcast %uint %int_16 - %156 = OpIMul %uint %155 %uint_7 - %157 = OpIAdd %uint %154 %156 - %158 = OpIAdd %uint %157 %uint_8 - %159 = OpULessThanEqual %bool %158 %153 - %160 = OpSelect %uint %159 %154 %uint_0 - %161 = OpSelect %uint %159 %155 %uint_8 - %162 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %163 = OpAccessChain %_ptr_StorageBuffer_uint_0 %162 %160 - OpCooperativeMatrixStoreKHR %163 %m3 %uint_1 %161 NonPrivatePointer - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %167 = OpArrayLength %uint %23 0 - %168 = OpIMul %uint %uint_16 %uint_7 - %169 = OpIAdd %uint %uint_0 %168 - %170 = OpIAdd %uint %169 %uint_8 - %171 = OpULessThanEqual %bool %170 %167 - %172 = OpSelect %uint %171 %uint_0 %uint_0 - %173 = OpSelect %uint %171 %uint_16 %uint_8 - %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %175 = OpAccessChain %_ptr_StorageBuffer_v2half %174 %172 - %m5 = OpCooperativeMatrixLoadKHR %59 %175 %uint_0 %173 None - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %179 = OpArrayLength %uint %34 0 - %180 = OpBitcast %uint %int_0 - %181 = OpBitcast %uint %int_16 - %182 = OpIMul %uint %181 %uint_7 - %183 = OpIAdd %uint %180 %182 - %184 = OpIAdd %uint %183 %uint_8 - %185 = OpULessThanEqual %bool %184 %179 - %186 = OpSelect %uint %185 %180 %uint_0 - %187 = OpSelect %uint %185 %181 %uint_8 - %188 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %189 = OpAccessChain %_ptr_StorageBuffer_uint_0 %188 %186 - OpCooperativeMatrixStoreKHR %189 %m5 %uint_1 %187 NonPrivatePointer - %191 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %193 = OpArrayLength %uint %29 0 - %194 = OpIMul %uint %193 %uint_2 - %195 = OpIMul %uint %uint_16 %uint_7 - %196 = OpIAdd %uint %uint_0 %195 - %197 = OpIMul %uint %196 %uint_2 - %198 = OpIAdd %uint %197 %uint_8 - %199 = OpULessThanEqual %bool %198 %194 - %200 = OpSelect %uint %199 %uint_0 %uint_0 - %201 = OpSelect %uint %199 %uint_16 %uint_4 - %202 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %203 = OpAccessChain %_ptr_StorageBuffer_v3half %202 %200 - %m6 = OpCooperativeMatrixLoadKHR %59 %203 %uint_0 %201 None - %206 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %207 = OpArrayLength %uint %34 0 - %208 = OpBitcast %uint %int_0 - %209 = OpBitcast %uint %int_16 - %210 = OpIMul %uint %209 %uint_7 - %211 = OpIAdd %uint %208 %210 - %212 = OpIAdd %uint %211 %uint_8 - %213 = OpULessThanEqual %bool %212 %207 - %214 = OpSelect %uint %213 %208 %uint_0 - %215 = OpSelect %uint %213 %209 %uint_8 - %216 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %217 = OpAccessChain %_ptr_StorageBuffer_uint_0 %216 %214 - OpCooperativeMatrixStoreKHR %217 %m6 %uint_1 %215 NonPrivatePointer + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_4 + %86 = OpULessThanEqual %bool %84 %81 + %87 = OpSelect %uint %86 %uint_0 %uint_0 + %88 = OpSelect %uint %86 %uint_16 %uint_4 + %89 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %90 = OpAccessChain %_ptr_StorageBuffer_v2int %89 %87 + %m1 = OpCooperativeMatrixLoadKHR %59 %90 %uint_0 %88 None + %93 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %94 = OpArrayLength %uint %34 0 + %95 = OpBitcast %uint %int_0 + %96 = OpBitcast %uint %int_16 + %97 = OpIMul %uint %96 %uint_7 + %98 = OpIAdd %uint %95 %97 + %99 = OpIAdd %uint %98 %uint_8 + %100 = OpULessThanEqual %bool %99 %94 + %101 = OpSelect %uint %100 %95 %uint_0 + %102 = OpSelect %uint %100 %96 %uint_8 + %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %104 = OpAccessChain %_ptr_StorageBuffer_uint_0 %103 %101 + OpCooperativeMatrixStoreKHR %104 %m1 %uint_1 %102 NonPrivatePointer + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %108 = OpArrayLength %uint %12 0 + %109 = OpIMul %uint %uint_16 %uint_7 + %110 = OpIAdd %uint %uint_0 %109 + %111 = OpIAdd %uint %110 %uint_2 + %113 = OpULessThanEqual %bool %111 %108 + %114 = OpSelect %uint %113 %uint_0 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_2 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v3float %116 %114 + %m2 = OpCooperativeMatrixLoadKHR %59 %117 %uint_0 %115 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %121 = OpArrayLength %uint %34 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_8 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_8 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m2 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %135 = OpArrayLength %uint %18 0 + %136 = OpIMul %uint %uint_16 %uint_7 + %137 = OpIAdd %uint %uint_0 %136 + %138 = OpIAdd %uint %137 %uint_2 + %139 = OpULessThanEqual %bool %138 %135 + %140 = OpSelect %uint %139 %uint_0 %uint_0 + %141 = OpSelect %uint %139 %uint_16 %uint_2 + %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %143 = OpAccessChain %_ptr_StorageBuffer_v4uint %142 %140 + %m3 = OpCooperativeMatrixLoadKHR %59 %143 %uint_0 %141 None + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %147 = OpArrayLength %uint %34 0 + %148 = OpBitcast %uint %int_0 + %149 = OpBitcast %uint %int_16 + %150 = OpIMul %uint %149 %uint_7 + %151 = OpIAdd %uint %148 %150 + %152 = OpIAdd %uint %151 %uint_8 + %153 = OpULessThanEqual %bool %152 %147 + %154 = OpSelect %uint %153 %148 %uint_0 + %155 = OpSelect %uint %153 %149 %uint_8 + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %157 = OpAccessChain %_ptr_StorageBuffer_uint_0 %156 %154 + OpCooperativeMatrixStoreKHR %157 %m3 %uint_1 %155 NonPrivatePointer + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %161 = OpArrayLength %uint %23 0 + %162 = OpIMul %uint %uint_16 %uint_7 + %163 = OpIAdd %uint %uint_0 %162 + %164 = OpIAdd %uint %163 %uint_8 + %165 = OpULessThanEqual %bool %164 %161 + %166 = OpSelect %uint %165 %uint_0 %uint_0 + %167 = OpSelect %uint %165 %uint_16 %uint_8 + %168 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %169 = OpAccessChain %_ptr_StorageBuffer_v2half %168 %166 + %m5 = OpCooperativeMatrixLoadKHR %59 %169 %uint_0 %167 None + %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %173 = OpArrayLength %uint %34 0 + %174 = OpBitcast %uint %int_0 + %175 = OpBitcast %uint %int_16 + %176 = OpIMul %uint %175 %uint_7 + %177 = OpIAdd %uint %174 %176 + %178 = OpIAdd %uint %177 %uint_8 + %179 = OpULessThanEqual %bool %178 %173 + %180 = OpSelect %uint %179 %174 %uint_0 + %181 = OpSelect %uint %179 %175 %uint_8 + %182 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %183 = OpAccessChain %_ptr_StorageBuffer_uint_0 %182 %180 + OpCooperativeMatrixStoreKHR %183 %m5 %uint_1 %181 NonPrivatePointer + %185 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %187 = OpArrayLength %uint %29 0 + %188 = OpIMul %uint %uint_16 %uint_7 + %189 = OpIAdd %uint %uint_0 %188 + %190 = OpIAdd %uint %189 %uint_4 + %191 = OpULessThanEqual %bool %190 %187 + %192 = OpSelect %uint %191 %uint_0 %uint_0 + %193 = OpSelect %uint %191 %uint_16 %uint_4 + %194 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %195 = OpAccessChain %_ptr_StorageBuffer_v3half %194 %192 + %m6 = OpCooperativeMatrixLoadKHR %59 %195 %uint_0 %193 None + %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %199 = OpArrayLength %uint %34 0 + %200 = OpBitcast %uint %int_0 + %201 = OpBitcast %uint %int_16 + %202 = OpIMul %uint %201 %uint_7 + %203 = OpIAdd %uint %200 %202 + %204 = OpIAdd %uint %203 %uint_8 + %205 = OpULessThanEqual %bool %204 %199 + %206 = OpSelect %uint %205 %200 %uint_0 + %207 = OpSelect %uint %205 %201 %uint_8 + %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %209 = OpAccessChain %_ptr_StorageBuffer_uint_0 %208 %206 + OpCooperativeMatrixStoreKHR %209 %m6 %uint_1 %207 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl index 1035de3..ddb7317 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -15,79 +15,79 @@ uint v_1 = 0u; in0.GetDimensions(v_1); uint v_2 = asuint(int(0)); - bool v_3 = ((((v_2 + (16u * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_3 = (((v_2 + (16u * 7u)) + 2u) <= (v_1 / 4u)); Matrix_left_i8_8x8 m0 = Matrix_left_i8_8x8::Load(in0, (0u + (select(v_3, v_2, 0u) * 4u)), (select(v_3, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_4 = 0u; v.GetDimensions(v_4); uint v_5 = asuint(int(0)); uint v_6 = asuint(int(16)); - bool v_7 = ((((v_5 + (v_6 * 7u)) * 4u) + 8u) <= ((v_4 / 4u) * 4u)); + bool v_7 = (((v_5 + (v_6 * 7u)) + 2u) <= (v_4 / 4u)); m0.Store(v, (0u + (select(v_7, v_5, 0u) * 4u)), (select(v_7, v_6, 2u) * 4u), MatrixLayout::ColMajor); uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 8u) + 8u) <= ((v_8 / 8u) * 8u)); + bool v_10 = (((v_9 + (16u * 7u)) + 1u) <= (v_8 / 8u)); Matrix_left_i8_8x8 m1 = Matrix_left_i8_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_11 = 0u; v.GetDimensions(v_11); uint v_12 = asuint(int(0)); uint v_13 = asuint(int(16)); - bool v_14 = ((((v_12 + (v_13 * 7u)) * 4u) + 8u) <= ((v_11 / 4u) * 4u)); + bool v_14 = (((v_12 + (v_13 * 7u)) + 2u) <= (v_11 / 4u)); m1.Store(v, (0u + (select(v_14, v_12, 0u) * 4u)), (select(v_14, v_13, 2u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 16u) + 16u) <= ((v_15 / 16u) * 16u)); + bool v_17 = (((v_16 + (16u * 7u)) + 1u) <= (v_15 / 16u)); Matrix_left_i8_8x8 m2 = Matrix_left_i8_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_18 = 0u; v.GetDimensions(v_18); uint v_19 = asuint(int(0)); uint v_20 = asuint(int(16)); - bool v_21 = ((((v_19 + (v_20 * 7u)) * 4u) + 8u) <= ((v_18 / 4u) * 4u)); + bool v_21 = (((v_19 + (v_20 * 7u)) + 2u) <= (v_18 / 4u)); m2.Store(v, (0u + (select(v_21, v_19, 0u) * 4u)), (select(v_21, v_20, 2u) * 4u), MatrixLayout::ColMajor); uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 16u) + 16u) <= ((v_22 / 16u) * 16u)); + bool v_24 = (((v_23 + (16u * 7u)) + 1u) <= (v_22 / 16u)); Matrix_left_i8_8x8 m3 = Matrix_left_i8_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m3.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); uint v_29 = 0u; in4.GetDimensions(v_29); uint v_30 = asuint(int(0)); - bool v_31 = ((((v_30 + (16u * 7u)) * 2u) + 8u) <= ((v_29 / 2u) * 2u)); + bool v_31 = (((v_30 + (16u * 7u)) + 4u) <= (v_29 / 2u)); Matrix_left_i8_8x8 m4 = Matrix_left_i8_8x8::Load(in4, (0u + (select(v_31, v_30, 0u) * 4u)), (select(v_31, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_32 = 0u; v.GetDimensions(v_32); uint v_33 = asuint(int(0)); uint v_34 = asuint(int(16)); - bool v_35 = ((((v_33 + (v_34 * 7u)) * 4u) + 8u) <= ((v_32 / 4u) * 4u)); + bool v_35 = (((v_33 + (v_34 * 7u)) + 2u) <= (v_32 / 4u)); m4.Store(v, (0u + (select(v_35, v_33, 0u) * 4u)), (select(v_35, v_34, 2u) * 4u), MatrixLayout::ColMajor); uint v_36 = 0u; in5.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 4u) + 8u) <= ((v_36 / 4u) * 4u)); + bool v_38 = (((v_37 + (16u * 7u)) + 2u) <= (v_36 / 4u)); Matrix_left_i8_8x8 m5 = Matrix_left_i8_8x8::Load(in5, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 4u) + 8u) <= ((v_39 / 4u) * 4u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 2u) <= (v_39 / 4u)); m5.Store(v, (0u + (select(v_42, v_40, 0u) * 4u)), (select(v_42, v_41, 2u) * 4u), MatrixLayout::ColMajor); uint v_43 = 0u; in6.GetDimensions(v_43); uint v_44 = asuint(int(0)); - bool v_45 = ((((v_44 + (16u * 7u)) * 8u) + 8u) <= ((v_43 / 8u) * 8u)); + bool v_45 = (((v_44 + (16u * 7u)) + 1u) <= (v_43 / 8u)); Matrix_left_i8_8x8 m6 = Matrix_left_i8_8x8::Load(in6, (0u + (select(v_45, v_44, 0u) * 4u)), (select(v_45, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_46 = 0u; v.GetDimensions(v_46); uint v_47 = asuint(int(0)); uint v_48 = asuint(int(16)); - bool v_49 = ((((v_47 + (v_48 * 7u)) * 4u) + 8u) <= ((v_46 / 4u) * 4u)); + bool v_49 = (((v_47 + (v_48 * 7u)) + 2u) <= (v_46 / 4u)); m6.Store(v, (0u + (select(v_49, v_47, 0u) * 4u)), (select(v_49, v_48, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_col_major.wgsl.expected.spvasm index 947f1ca..49eb838 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 277 +; Bound: 249 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -129,17 +129,16 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %char = OpTypeInt 8 1 - %69 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_0 + %65 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_0 %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_16 = OpConstant %int 16 @@ -151,6 +150,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -160,206 +160,178 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_4 - %51 = OpBitcast %uint %int_0 - %53 = OpIMul %uint %uint_16 %uint_7 - %56 = OpIAdd %uint %51 %53 - %57 = OpIMul %uint %56 %uint_4 - %58 = OpIAdd %uint %57 %uint_8 - %60 = OpULessThanEqual %bool %58 %49 - %62 = OpSelect %uint %60 %51 %uint_0 - %63 = OpSelect %uint %60 %uint_16 %uint_2 - %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %66 = OpAccessChain %_ptr_StorageBuffer_uint %65 %62 - %m0 = OpCooperativeMatrixLoadKHR %69 %66 %uint_1 %63 None - %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %75 = OpArrayLength %uint %38 0 - %76 = OpIMul %uint %75 %uint_4 - %77 = OpBitcast %uint %int_0 - %78 = OpBitcast %uint %int_16 - %80 = OpIMul %uint %78 %uint_7 - %81 = OpIAdd %uint %77 %80 - %82 = OpIMul %uint %81 %uint_4 - %83 = OpIAdd %uint %82 %uint_8 - %84 = OpULessThanEqual %bool %83 %76 - %85 = OpSelect %uint %84 %77 %uint_0 - %86 = OpSelect %uint %84 %78 %uint_2 - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %88 = OpAccessChain %_ptr_StorageBuffer_uint_0 %87 %85 - OpCooperativeMatrixStoreKHR %88 %m0 %uint_1 %86 NonPrivatePointer - %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %93 = OpArrayLength %uint %6 0 - %94 = OpIMul %uint %93 %uint_8 - %95 = OpBitcast %uint %int_0 - %96 = OpIMul %uint %uint_16 %uint_7 - %97 = OpIAdd %uint %95 %96 - %98 = OpIMul %uint %97 %uint_8 - %99 = OpIAdd %uint %98 %uint_8 - %100 = OpULessThanEqual %bool %99 %94 - %101 = OpSelect %uint %100 %95 %uint_0 - %102 = OpSelect %uint %100 %uint_16 %uint_1 - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v2int %103 %101 - %m1 = OpCooperativeMatrixLoadKHR %69 %104 %uint_1 %102 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %108 = OpArrayLength %uint %38 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m1 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpArrayLength %uint %12 0 - %125 = OpIMul %uint %124 %uint_16 - %126 = OpBitcast %uint %int_0 - %127 = OpIMul %uint %uint_16 %uint_7 - %128 = OpIAdd %uint %126 %127 - %129 = OpIMul %uint %128 %uint_16 - %130 = OpIAdd %uint %129 %uint_16 - %131 = OpULessThanEqual %bool %130 %125 - %132 = OpSelect %uint %131 %126 %uint_0 - %133 = OpSelect %uint %131 %uint_16 %uint_1 - %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %135 = OpAccessChain %_ptr_StorageBuffer_v3float %134 %132 - %m2 = OpCooperativeMatrixLoadKHR %69 %135 %uint_1 %133 None - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %139 = OpArrayLength %uint %38 0 - %140 = OpIMul %uint %139 %uint_4 - %141 = OpBitcast %uint %int_0 - %142 = OpBitcast %uint %int_16 - %143 = OpIMul %uint %142 %uint_7 - %144 = OpIAdd %uint %141 %143 - %145 = OpIMul %uint %144 %uint_4 - %146 = OpIAdd %uint %145 %uint_8 - %147 = OpULessThanEqual %bool %146 %140 - %148 = OpSelect %uint %147 %141 %uint_0 - %149 = OpSelect %uint %147 %142 %uint_2 - %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %151 = OpAccessChain %_ptr_StorageBuffer_uint_0 %150 %148 - OpCooperativeMatrixStoreKHR %151 %m2 %uint_1 %149 NonPrivatePointer - %153 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %155 = OpArrayLength %uint %18 0 - %156 = OpIMul %uint %155 %uint_16 - %157 = OpBitcast %uint %int_0 - %158 = OpIMul %uint %uint_16 %uint_7 - %159 = OpIAdd %uint %157 %158 - %160 = OpIMul %uint %159 %uint_16 - %161 = OpIAdd %uint %160 %uint_16 - %162 = OpULessThanEqual %bool %161 %156 - %163 = OpSelect %uint %162 %157 %uint_0 - %164 = OpSelect %uint %162 %uint_16 %uint_1 - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %166 = OpAccessChain %_ptr_StorageBuffer_v4uint %165 %163 - %m3 = OpCooperativeMatrixLoadKHR %69 %166 %uint_1 %164 None - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %170 = OpArrayLength %uint %38 0 - %171 = OpIMul %uint %170 %uint_4 - %172 = OpBitcast %uint %int_0 - %173 = OpBitcast %uint %int_16 - %174 = OpIMul %uint %173 %uint_7 - %175 = OpIAdd %uint %172 %174 - %176 = OpIMul %uint %175 %uint_4 - %177 = OpIAdd %uint %176 %uint_8 - %178 = OpULessThanEqual %bool %177 %171 - %179 = OpSelect %uint %178 %172 %uint_0 - %180 = OpSelect %uint %178 %173 %uint_2 - %181 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %182 = OpAccessChain %_ptr_StorageBuffer_uint_0 %181 %179 - OpCooperativeMatrixStoreKHR %182 %m3 %uint_1 %180 NonPrivatePointer - %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %186 = OpArrayLength %uint %23 0 - %187 = OpIMul %uint %186 %uint_2 - %188 = OpBitcast %uint %int_0 - %189 = OpIMul %uint %uint_16 %uint_7 - %190 = OpIAdd %uint %188 %189 - %191 = OpIMul %uint %190 %uint_2 - %192 = OpIAdd %uint %191 %uint_8 - %193 = OpULessThanEqual %bool %192 %187 - %194 = OpSelect %uint %193 %188 %uint_0 - %195 = OpSelect %uint %193 %uint_16 %uint_4 - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %197 = OpAccessChain %_ptr_StorageBuffer_half %196 %194 - %m4 = OpCooperativeMatrixLoadKHR %69 %197 %uint_1 %195 None - %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %201 = OpArrayLength %uint %38 0 - %202 = OpIMul %uint %201 %uint_4 - %203 = OpBitcast %uint %int_0 - %204 = OpBitcast %uint %int_16 - %205 = OpIMul %uint %204 %uint_7 - %206 = OpIAdd %uint %203 %205 - %207 = OpIMul %uint %206 %uint_4 - %208 = OpIAdd %uint %207 %uint_8 - %209 = OpULessThanEqual %bool %208 %202 - %210 = OpSelect %uint %209 %203 %uint_0 - %211 = OpSelect %uint %209 %204 %uint_2 - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %213 = OpAccessChain %_ptr_StorageBuffer_uint_0 %212 %210 - OpCooperativeMatrixStoreKHR %213 %m4 %uint_1 %211 NonPrivatePointer - %215 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %217 = OpArrayLength %uint %28 0 - %218 = OpIMul %uint %217 %uint_4 - %219 = OpBitcast %uint %int_0 - %220 = OpIMul %uint %uint_16 %uint_7 - %221 = OpIAdd %uint %219 %220 - %222 = OpIMul %uint %221 %uint_4 - %223 = OpIAdd %uint %222 %uint_8 - %224 = OpULessThanEqual %bool %223 %218 - %225 = OpSelect %uint %224 %219 %uint_0 - %226 = OpSelect %uint %224 %uint_16 %uint_2 - %227 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %228 = OpAccessChain %_ptr_StorageBuffer_v2half %227 %225 - %m5 = OpCooperativeMatrixLoadKHR %69 %228 %uint_1 %226 None - %231 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %232 = OpArrayLength %uint %38 0 - %233 = OpIMul %uint %232 %uint_4 - %234 = OpBitcast %uint %int_0 - %235 = OpBitcast %uint %int_16 - %236 = OpIMul %uint %235 %uint_7 - %237 = OpIAdd %uint %234 %236 - %238 = OpIMul %uint %237 %uint_4 - %239 = OpIAdd %uint %238 %uint_8 - %240 = OpULessThanEqual %bool %239 %233 - %241 = OpSelect %uint %240 %234 %uint_0 - %242 = OpSelect %uint %240 %235 %uint_2 - %243 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %244 = OpAccessChain %_ptr_StorageBuffer_uint_0 %243 %241 - OpCooperativeMatrixStoreKHR %244 %m5 %uint_1 %242 NonPrivatePointer - %246 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %248 = OpArrayLength %uint %33 0 - %249 = OpIMul %uint %248 %uint_8 - %250 = OpBitcast %uint %int_0 - %251 = OpIMul %uint %uint_16 %uint_7 - %252 = OpIAdd %uint %250 %251 - %253 = OpIMul %uint %252 %uint_8 - %254 = OpIAdd %uint %253 %uint_8 - %255 = OpULessThanEqual %bool %254 %249 - %256 = OpSelect %uint %255 %250 %uint_0 - %257 = OpSelect %uint %255 %uint_16 %uint_1 - %258 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %259 = OpAccessChain %_ptr_StorageBuffer_v3half %258 %256 - %m6 = OpCooperativeMatrixLoadKHR %69 %259 %uint_1 %257 None - %262 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %263 = OpArrayLength %uint %38 0 - %264 = OpIMul %uint %263 %uint_4 - %265 = OpBitcast %uint %int_0 - %266 = OpBitcast %uint %int_16 - %267 = OpIMul %uint %266 %uint_7 - %268 = OpIAdd %uint %265 %267 - %269 = OpIMul %uint %268 %uint_4 - %270 = OpIAdd %uint %269 %uint_8 - %271 = OpULessThanEqual %bool %270 %264 - %272 = OpSelect %uint %271 %265 %uint_0 - %273 = OpSelect %uint %271 %266 %uint_2 - %274 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %275 = OpAccessChain %_ptr_StorageBuffer_uint_0 %274 %272 - OpCooperativeMatrixStoreKHR %275 %m6 %uint_1 %273 NonPrivatePointer + %49 = OpBitcast %uint %int_0 + %51 = OpIMul %uint %uint_16 %uint_7 + %54 = OpIAdd %uint %49 %51 + %55 = OpIAdd %uint %54 %uint_2 + %57 = OpULessThanEqual %bool %55 %48 + %59 = OpSelect %uint %57 %49 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_2 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + %m0 = OpCooperativeMatrixLoadKHR %65 %62 %uint_1 %60 None + %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %72 = OpArrayLength %uint %38 0 + %73 = OpBitcast %uint %int_0 + %74 = OpBitcast %uint %int_16 + %76 = OpIMul %uint %74 %uint_7 + %77 = OpIAdd %uint %73 %76 + %78 = OpIAdd %uint %77 %uint_2 + %79 = OpULessThanEqual %bool %78 %72 + %80 = OpSelect %uint %79 %73 %uint_0 + %81 = OpSelect %uint %79 %74 %uint_2 + %82 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %83 = OpAccessChain %_ptr_StorageBuffer_uint_0 %82 %80 + OpCooperativeMatrixStoreKHR %83 %m0 %uint_1 %81 NonPrivatePointer + %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %88 = OpArrayLength %uint %6 0 + %89 = OpBitcast %uint %int_0 + %90 = OpIMul %uint %uint_16 %uint_7 + %91 = OpIAdd %uint %89 %90 + %92 = OpIAdd %uint %91 %uint_1 + %93 = OpULessThanEqual %bool %92 %88 + %94 = OpSelect %uint %93 %89 %uint_0 + %95 = OpSelect %uint %93 %uint_16 %uint_1 + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %97 = OpAccessChain %_ptr_StorageBuffer_v2int %96 %94 + %m1 = OpCooperativeMatrixLoadKHR %65 %97 %uint_1 %95 None + %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %101 = OpArrayLength %uint %38 0 + %102 = OpBitcast %uint %int_0 + %103 = OpBitcast %uint %int_16 + %104 = OpIMul %uint %103 %uint_7 + %105 = OpIAdd %uint %102 %104 + %106 = OpIAdd %uint %105 %uint_2 + %107 = OpULessThanEqual %bool %106 %101 + %108 = OpSelect %uint %107 %102 %uint_0 + %109 = OpSelect %uint %107 %103 %uint_2 + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %111 = OpAccessChain %_ptr_StorageBuffer_uint_0 %110 %108 + OpCooperativeMatrixStoreKHR %111 %m1 %uint_1 %109 NonPrivatePointer + %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %115 = OpArrayLength %uint %12 0 + %116 = OpBitcast %uint %int_0 + %117 = OpIMul %uint %uint_16 %uint_7 + %118 = OpIAdd %uint %116 %117 + %119 = OpIAdd %uint %118 %uint_1 + %120 = OpULessThanEqual %bool %119 %115 + %121 = OpSelect %uint %120 %116 %uint_0 + %122 = OpSelect %uint %120 %uint_16 %uint_1 + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 + %m2 = OpCooperativeMatrixLoadKHR %65 %124 %uint_1 %122 None + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %128 = OpArrayLength %uint %38 0 + %129 = OpBitcast %uint %int_0 + %130 = OpBitcast %uint %int_16 + %131 = OpIMul %uint %130 %uint_7 + %132 = OpIAdd %uint %129 %131 + %133 = OpIAdd %uint %132 %uint_2 + %134 = OpULessThanEqual %bool %133 %128 + %135 = OpSelect %uint %134 %129 %uint_0 + %136 = OpSelect %uint %134 %130 %uint_2 + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 + OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer + %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %142 = OpArrayLength %uint %18 0 + %143 = OpBitcast %uint %int_0 + %144 = OpIMul %uint %uint_16 %uint_7 + %145 = OpIAdd %uint %143 %144 + %146 = OpIAdd %uint %145 %uint_1 + %147 = OpULessThanEqual %bool %146 %142 + %148 = OpSelect %uint %147 %143 %uint_0 + %149 = OpSelect %uint %147 %uint_16 %uint_1 + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %151 = OpAccessChain %_ptr_StorageBuffer_v4uint %150 %148 + %m3 = OpCooperativeMatrixLoadKHR %65 %151 %uint_1 %149 None + %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %155 = OpArrayLength %uint %38 0 + %156 = OpBitcast %uint %int_0 + %157 = OpBitcast %uint %int_16 + %158 = OpIMul %uint %157 %uint_7 + %159 = OpIAdd %uint %156 %158 + %160 = OpIAdd %uint %159 %uint_2 + %161 = OpULessThanEqual %bool %160 %155 + %162 = OpSelect %uint %161 %156 %uint_0 + %163 = OpSelect %uint %161 %157 %uint_2 + %164 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %165 = OpAccessChain %_ptr_StorageBuffer_uint_0 %164 %162 + OpCooperativeMatrixStoreKHR %165 %m3 %uint_1 %163 NonPrivatePointer + %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %169 = OpArrayLength %uint %23 0 + %170 = OpBitcast %uint %int_0 + %171 = OpIMul %uint %uint_16 %uint_7 + %172 = OpIAdd %uint %170 %171 + %173 = OpIAdd %uint %172 %uint_4 + %175 = OpULessThanEqual %bool %173 %169 + %176 = OpSelect %uint %175 %170 %uint_0 + %177 = OpSelect %uint %175 %uint_16 %uint_4 + %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %179 = OpAccessChain %_ptr_StorageBuffer_half %178 %176 + %m4 = OpCooperativeMatrixLoadKHR %65 %179 %uint_1 %177 None + %182 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %183 = OpArrayLength %uint %38 0 + %184 = OpBitcast %uint %int_0 + %185 = OpBitcast %uint %int_16 + %186 = OpIMul %uint %185 %uint_7 + %187 = OpIAdd %uint %184 %186 + %188 = OpIAdd %uint %187 %uint_2 + %189 = OpULessThanEqual %bool %188 %183 + %190 = OpSelect %uint %189 %184 %uint_0 + %191 = OpSelect %uint %189 %185 %uint_2 + %192 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %193 = OpAccessChain %_ptr_StorageBuffer_uint_0 %192 %190 + OpCooperativeMatrixStoreKHR %193 %m4 %uint_1 %191 NonPrivatePointer + %195 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %197 = OpArrayLength %uint %28 0 + %198 = OpBitcast %uint %int_0 + %199 = OpIMul %uint %uint_16 %uint_7 + %200 = OpIAdd %uint %198 %199 + %201 = OpIAdd %uint %200 %uint_2 + %202 = OpULessThanEqual %bool %201 %197 + %203 = OpSelect %uint %202 %198 %uint_0 + %204 = OpSelect %uint %202 %uint_16 %uint_2 + %205 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %206 = OpAccessChain %_ptr_StorageBuffer_v2half %205 %203 + %m5 = OpCooperativeMatrixLoadKHR %65 %206 %uint_1 %204 None + %209 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %210 = OpArrayLength %uint %38 0 + %211 = OpBitcast %uint %int_0 + %212 = OpBitcast %uint %int_16 + %213 = OpIMul %uint %212 %uint_7 + %214 = OpIAdd %uint %211 %213 + %215 = OpIAdd %uint %214 %uint_2 + %216 = OpULessThanEqual %bool %215 %210 + %217 = OpSelect %uint %216 %211 %uint_0 + %218 = OpSelect %uint %216 %212 %uint_2 + %219 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %220 = OpAccessChain %_ptr_StorageBuffer_uint_0 %219 %217 + OpCooperativeMatrixStoreKHR %220 %m5 %uint_1 %218 NonPrivatePointer + %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %224 = OpArrayLength %uint %33 0 + %225 = OpBitcast %uint %int_0 + %226 = OpIMul %uint %uint_16 %uint_7 + %227 = OpIAdd %uint %225 %226 + %228 = OpIAdd %uint %227 %uint_1 + %229 = OpULessThanEqual %bool %228 %224 + %230 = OpSelect %uint %229 %225 %uint_0 + %231 = OpSelect %uint %229 %uint_16 %uint_1 + %232 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %233 = OpAccessChain %_ptr_StorageBuffer_v3half %232 %230 + %m6 = OpCooperativeMatrixLoadKHR %65 %233 %uint_1 %231 None + %236 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %237 = OpArrayLength %uint %38 0 + %238 = OpBitcast %uint %int_0 + %239 = OpBitcast %uint %int_16 + %240 = OpIMul %uint %239 %uint_7 + %241 = OpIAdd %uint %238 %240 + %242 = OpIAdd %uint %241 %uint_2 + %243 = OpULessThanEqual %bool %242 %237 + %244 = OpSelect %uint %243 %238 %uint_0 + %245 = OpSelect %uint %243 %239 %uint_2 + %246 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %247 = OpAccessChain %_ptr_StorageBuffer_uint_0 %246 %244 + OpCooperativeMatrixStoreKHR %247 %m6 %uint_1 %245 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl index 2de768e..d72e762 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -15,79 +15,79 @@ uint v_1 = 0u; in0.GetDimensions(v_1); uint v_2 = asuint(int(0)); - bool v_3 = ((((v_2 + (16u * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_3 = (((v_2 + (16u * 7u)) + 2u) <= (v_1 / 4u)); Matrix_left_i8_8x8 m0 = Matrix_left_i8_8x8::Load(in0, (0u + (select(v_3, v_2, 0u) * 4u)), (select(v_3, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_4 = 0u; v.GetDimensions(v_4); uint v_5 = asuint(int(0)); uint v_6 = asuint(int(16)); - bool v_7 = ((((v_5 + (v_6 * 7u)) * 4u) + 8u) <= ((v_4 / 4u) * 4u)); + bool v_7 = (((v_5 + (v_6 * 7u)) + 2u) <= (v_4 / 4u)); m0.Store(v, (0u + (select(v_7, v_5, 0u) * 4u)), (select(v_7, v_6, 2u) * 4u), MatrixLayout::ColMajor); uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 8u) + 8u) <= ((v_8 / 8u) * 8u)); + bool v_10 = (((v_9 + (16u * 7u)) + 1u) <= (v_8 / 8u)); Matrix_left_i8_8x8 m1 = Matrix_left_i8_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_11 = 0u; v.GetDimensions(v_11); uint v_12 = asuint(int(0)); uint v_13 = asuint(int(16)); - bool v_14 = ((((v_12 + (v_13 * 7u)) * 4u) + 8u) <= ((v_11 / 4u) * 4u)); + bool v_14 = (((v_12 + (v_13 * 7u)) + 2u) <= (v_11 / 4u)); m1.Store(v, (0u + (select(v_14, v_12, 0u) * 4u)), (select(v_14, v_13, 2u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 16u) + 16u) <= ((v_15 / 16u) * 16u)); + bool v_17 = (((v_16 + (16u * 7u)) + 1u) <= (v_15 / 16u)); Matrix_left_i8_8x8 m2 = Matrix_left_i8_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_18 = 0u; v.GetDimensions(v_18); uint v_19 = asuint(int(0)); uint v_20 = asuint(int(16)); - bool v_21 = ((((v_19 + (v_20 * 7u)) * 4u) + 8u) <= ((v_18 / 4u) * 4u)); + bool v_21 = (((v_19 + (v_20 * 7u)) + 2u) <= (v_18 / 4u)); m2.Store(v, (0u + (select(v_21, v_19, 0u) * 4u)), (select(v_21, v_20, 2u) * 4u), MatrixLayout::ColMajor); uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 16u) + 16u) <= ((v_22 / 16u) * 16u)); + bool v_24 = (((v_23 + (16u * 7u)) + 1u) <= (v_22 / 16u)); Matrix_left_i8_8x8 m3 = Matrix_left_i8_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m3.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); uint v_29 = 0u; in4.GetDimensions(v_29); uint v_30 = asuint(int(0)); - bool v_31 = ((((v_30 + (16u * 7u)) * 2u) + 8u) <= ((v_29 / 2u) * 2u)); + bool v_31 = (((v_30 + (16u * 7u)) + 4u) <= (v_29 / 2u)); Matrix_left_i8_8x8 m4 = Matrix_left_i8_8x8::Load(in4, (0u + (select(v_31, v_30, 0u) * 4u)), (select(v_31, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_32 = 0u; v.GetDimensions(v_32); uint v_33 = asuint(int(0)); uint v_34 = asuint(int(16)); - bool v_35 = ((((v_33 + (v_34 * 7u)) * 4u) + 8u) <= ((v_32 / 4u) * 4u)); + bool v_35 = (((v_33 + (v_34 * 7u)) + 2u) <= (v_32 / 4u)); m4.Store(v, (0u + (select(v_35, v_33, 0u) * 4u)), (select(v_35, v_34, 2u) * 4u), MatrixLayout::ColMajor); uint v_36 = 0u; in5.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 4u) + 8u) <= ((v_36 / 4u) * 4u)); + bool v_38 = (((v_37 + (16u * 7u)) + 2u) <= (v_36 / 4u)); Matrix_left_i8_8x8 m5 = Matrix_left_i8_8x8::Load(in5, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 4u) + 8u) <= ((v_39 / 4u) * 4u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 2u) <= (v_39 / 4u)); m5.Store(v, (0u + (select(v_42, v_40, 0u) * 4u)), (select(v_42, v_41, 2u) * 4u), MatrixLayout::ColMajor); uint v_43 = 0u; in6.GetDimensions(v_43); uint v_44 = asuint(int(0)); - bool v_45 = ((((v_44 + (16u * 7u)) * 8u) + 8u) <= ((v_43 / 8u) * 8u)); + bool v_45 = (((v_44 + (16u * 7u)) + 1u) <= (v_43 / 8u)); Matrix_left_i8_8x8 m6 = Matrix_left_i8_8x8::Load(in6, (0u + (select(v_45, v_44, 0u) * 4u)), (select(v_45, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_46 = 0u; v.GetDimensions(v_46); uint v_47 = asuint(int(0)); uint v_48 = asuint(int(16)); - bool v_49 = ((((v_47 + (v_48 * 7u)) * 4u) + 8u) <= ((v_46 / 4u) * 4u)); + bool v_49 = (((v_47 + (v_48 * 7u)) + 2u) <= (v_46 / 4u)); m6.Store(v, (0u + (select(v_49, v_47, 0u) * 4u)), (select(v_49, v_48, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_row_major.wgsl.expected.spvasm index 79cb47c..27b4e44 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 277 +; Bound: 249 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -129,17 +129,16 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %char = OpTypeInt 8 1 - %69 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_0 + %65 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_0 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint @@ -151,6 +150,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -160,206 +160,178 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_4 - %51 = OpBitcast %uint %int_0 - %53 = OpIMul %uint %uint_16 %uint_7 - %56 = OpIAdd %uint %51 %53 - %57 = OpIMul %uint %56 %uint_4 - %58 = OpIAdd %uint %57 %uint_8 - %60 = OpULessThanEqual %bool %58 %49 - %62 = OpSelect %uint %60 %51 %uint_0 - %63 = OpSelect %uint %60 %uint_16 %uint_2 - %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %66 = OpAccessChain %_ptr_StorageBuffer_uint %65 %62 - %m0 = OpCooperativeMatrixLoadKHR %69 %66 %uint_0 %63 None - %72 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %74 = OpArrayLength %uint %38 0 - %75 = OpIMul %uint %74 %uint_4 - %76 = OpBitcast %uint %int_0 - %77 = OpBitcast %uint %int_16 - %79 = OpIMul %uint %77 %uint_7 - %80 = OpIAdd %uint %76 %79 - %81 = OpIMul %uint %80 %uint_4 - %82 = OpIAdd %uint %81 %uint_8 - %83 = OpULessThanEqual %bool %82 %75 - %84 = OpSelect %uint %83 %76 %uint_0 - %85 = OpSelect %uint %83 %77 %uint_2 - %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %87 = OpAccessChain %_ptr_StorageBuffer_uint_0 %86 %84 - OpCooperativeMatrixStoreKHR %87 %m0 %uint_1 %85 NonPrivatePointer - %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %93 = OpArrayLength %uint %6 0 - %94 = OpIMul %uint %93 %uint_8 - %95 = OpBitcast %uint %int_0 - %96 = OpIMul %uint %uint_16 %uint_7 - %97 = OpIAdd %uint %95 %96 - %98 = OpIMul %uint %97 %uint_8 - %99 = OpIAdd %uint %98 %uint_8 - %100 = OpULessThanEqual %bool %99 %94 - %101 = OpSelect %uint %100 %95 %uint_0 - %102 = OpSelect %uint %100 %uint_16 %uint_1 - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v2int %103 %101 - %m1 = OpCooperativeMatrixLoadKHR %69 %104 %uint_0 %102 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %108 = OpArrayLength %uint %38 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m1 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpArrayLength %uint %12 0 - %125 = OpIMul %uint %124 %uint_16 - %126 = OpBitcast %uint %int_0 - %127 = OpIMul %uint %uint_16 %uint_7 - %128 = OpIAdd %uint %126 %127 - %129 = OpIMul %uint %128 %uint_16 - %130 = OpIAdd %uint %129 %uint_16 - %131 = OpULessThanEqual %bool %130 %125 - %132 = OpSelect %uint %131 %126 %uint_0 - %133 = OpSelect %uint %131 %uint_16 %uint_1 - %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %135 = OpAccessChain %_ptr_StorageBuffer_v3float %134 %132 - %m2 = OpCooperativeMatrixLoadKHR %69 %135 %uint_0 %133 None - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %139 = OpArrayLength %uint %38 0 - %140 = OpIMul %uint %139 %uint_4 - %141 = OpBitcast %uint %int_0 - %142 = OpBitcast %uint %int_16 - %143 = OpIMul %uint %142 %uint_7 - %144 = OpIAdd %uint %141 %143 - %145 = OpIMul %uint %144 %uint_4 - %146 = OpIAdd %uint %145 %uint_8 - %147 = OpULessThanEqual %bool %146 %140 - %148 = OpSelect %uint %147 %141 %uint_0 - %149 = OpSelect %uint %147 %142 %uint_2 - %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %151 = OpAccessChain %_ptr_StorageBuffer_uint_0 %150 %148 - OpCooperativeMatrixStoreKHR %151 %m2 %uint_1 %149 NonPrivatePointer - %153 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %155 = OpArrayLength %uint %18 0 - %156 = OpIMul %uint %155 %uint_16 - %157 = OpBitcast %uint %int_0 - %158 = OpIMul %uint %uint_16 %uint_7 - %159 = OpIAdd %uint %157 %158 - %160 = OpIMul %uint %159 %uint_16 - %161 = OpIAdd %uint %160 %uint_16 - %162 = OpULessThanEqual %bool %161 %156 - %163 = OpSelect %uint %162 %157 %uint_0 - %164 = OpSelect %uint %162 %uint_16 %uint_1 - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %166 = OpAccessChain %_ptr_StorageBuffer_v4uint %165 %163 - %m3 = OpCooperativeMatrixLoadKHR %69 %166 %uint_0 %164 None - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %170 = OpArrayLength %uint %38 0 - %171 = OpIMul %uint %170 %uint_4 - %172 = OpBitcast %uint %int_0 - %173 = OpBitcast %uint %int_16 - %174 = OpIMul %uint %173 %uint_7 - %175 = OpIAdd %uint %172 %174 - %176 = OpIMul %uint %175 %uint_4 - %177 = OpIAdd %uint %176 %uint_8 - %178 = OpULessThanEqual %bool %177 %171 - %179 = OpSelect %uint %178 %172 %uint_0 - %180 = OpSelect %uint %178 %173 %uint_2 - %181 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %182 = OpAccessChain %_ptr_StorageBuffer_uint_0 %181 %179 - OpCooperativeMatrixStoreKHR %182 %m3 %uint_1 %180 NonPrivatePointer - %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %186 = OpArrayLength %uint %23 0 - %187 = OpIMul %uint %186 %uint_2 - %188 = OpBitcast %uint %int_0 - %189 = OpIMul %uint %uint_16 %uint_7 - %190 = OpIAdd %uint %188 %189 - %191 = OpIMul %uint %190 %uint_2 - %192 = OpIAdd %uint %191 %uint_8 - %193 = OpULessThanEqual %bool %192 %187 - %194 = OpSelect %uint %193 %188 %uint_0 - %195 = OpSelect %uint %193 %uint_16 %uint_4 - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %197 = OpAccessChain %_ptr_StorageBuffer_half %196 %194 - %m4 = OpCooperativeMatrixLoadKHR %69 %197 %uint_0 %195 None - %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %201 = OpArrayLength %uint %38 0 - %202 = OpIMul %uint %201 %uint_4 - %203 = OpBitcast %uint %int_0 - %204 = OpBitcast %uint %int_16 - %205 = OpIMul %uint %204 %uint_7 - %206 = OpIAdd %uint %203 %205 - %207 = OpIMul %uint %206 %uint_4 - %208 = OpIAdd %uint %207 %uint_8 - %209 = OpULessThanEqual %bool %208 %202 - %210 = OpSelect %uint %209 %203 %uint_0 - %211 = OpSelect %uint %209 %204 %uint_2 - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %213 = OpAccessChain %_ptr_StorageBuffer_uint_0 %212 %210 - OpCooperativeMatrixStoreKHR %213 %m4 %uint_1 %211 NonPrivatePointer - %215 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %217 = OpArrayLength %uint %28 0 - %218 = OpIMul %uint %217 %uint_4 - %219 = OpBitcast %uint %int_0 - %220 = OpIMul %uint %uint_16 %uint_7 - %221 = OpIAdd %uint %219 %220 - %222 = OpIMul %uint %221 %uint_4 - %223 = OpIAdd %uint %222 %uint_8 - %224 = OpULessThanEqual %bool %223 %218 - %225 = OpSelect %uint %224 %219 %uint_0 - %226 = OpSelect %uint %224 %uint_16 %uint_2 - %227 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %228 = OpAccessChain %_ptr_StorageBuffer_v2half %227 %225 - %m5 = OpCooperativeMatrixLoadKHR %69 %228 %uint_0 %226 None - %231 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %232 = OpArrayLength %uint %38 0 - %233 = OpIMul %uint %232 %uint_4 - %234 = OpBitcast %uint %int_0 - %235 = OpBitcast %uint %int_16 - %236 = OpIMul %uint %235 %uint_7 - %237 = OpIAdd %uint %234 %236 - %238 = OpIMul %uint %237 %uint_4 - %239 = OpIAdd %uint %238 %uint_8 - %240 = OpULessThanEqual %bool %239 %233 - %241 = OpSelect %uint %240 %234 %uint_0 - %242 = OpSelect %uint %240 %235 %uint_2 - %243 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %244 = OpAccessChain %_ptr_StorageBuffer_uint_0 %243 %241 - OpCooperativeMatrixStoreKHR %244 %m5 %uint_1 %242 NonPrivatePointer - %246 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %248 = OpArrayLength %uint %33 0 - %249 = OpIMul %uint %248 %uint_8 - %250 = OpBitcast %uint %int_0 - %251 = OpIMul %uint %uint_16 %uint_7 - %252 = OpIAdd %uint %250 %251 - %253 = OpIMul %uint %252 %uint_8 - %254 = OpIAdd %uint %253 %uint_8 - %255 = OpULessThanEqual %bool %254 %249 - %256 = OpSelect %uint %255 %250 %uint_0 - %257 = OpSelect %uint %255 %uint_16 %uint_1 - %258 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %259 = OpAccessChain %_ptr_StorageBuffer_v3half %258 %256 - %m6 = OpCooperativeMatrixLoadKHR %69 %259 %uint_0 %257 None - %262 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %263 = OpArrayLength %uint %38 0 - %264 = OpIMul %uint %263 %uint_4 - %265 = OpBitcast %uint %int_0 - %266 = OpBitcast %uint %int_16 - %267 = OpIMul %uint %266 %uint_7 - %268 = OpIAdd %uint %265 %267 - %269 = OpIMul %uint %268 %uint_4 - %270 = OpIAdd %uint %269 %uint_8 - %271 = OpULessThanEqual %bool %270 %264 - %272 = OpSelect %uint %271 %265 %uint_0 - %273 = OpSelect %uint %271 %266 %uint_2 - %274 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %275 = OpAccessChain %_ptr_StorageBuffer_uint_0 %274 %272 - OpCooperativeMatrixStoreKHR %275 %m6 %uint_1 %273 NonPrivatePointer + %49 = OpBitcast %uint %int_0 + %51 = OpIMul %uint %uint_16 %uint_7 + %54 = OpIAdd %uint %49 %51 + %55 = OpIAdd %uint %54 %uint_2 + %57 = OpULessThanEqual %bool %55 %48 + %59 = OpSelect %uint %57 %49 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_2 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + %m0 = OpCooperativeMatrixLoadKHR %65 %62 %uint_0 %60 None + %69 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %71 = OpArrayLength %uint %38 0 + %72 = OpBitcast %uint %int_0 + %73 = OpBitcast %uint %int_16 + %75 = OpIMul %uint %73 %uint_7 + %76 = OpIAdd %uint %72 %75 + %77 = OpIAdd %uint %76 %uint_2 + %78 = OpULessThanEqual %bool %77 %71 + %79 = OpSelect %uint %78 %72 %uint_0 + %80 = OpSelect %uint %78 %73 %uint_2 + %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %82 = OpAccessChain %_ptr_StorageBuffer_uint_0 %81 %79 + OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer + %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %88 = OpArrayLength %uint %6 0 + %89 = OpBitcast %uint %int_0 + %90 = OpIMul %uint %uint_16 %uint_7 + %91 = OpIAdd %uint %89 %90 + %92 = OpIAdd %uint %91 %uint_1 + %93 = OpULessThanEqual %bool %92 %88 + %94 = OpSelect %uint %93 %89 %uint_0 + %95 = OpSelect %uint %93 %uint_16 %uint_1 + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %97 = OpAccessChain %_ptr_StorageBuffer_v2int %96 %94 + %m1 = OpCooperativeMatrixLoadKHR %65 %97 %uint_0 %95 None + %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %101 = OpArrayLength %uint %38 0 + %102 = OpBitcast %uint %int_0 + %103 = OpBitcast %uint %int_16 + %104 = OpIMul %uint %103 %uint_7 + %105 = OpIAdd %uint %102 %104 + %106 = OpIAdd %uint %105 %uint_2 + %107 = OpULessThanEqual %bool %106 %101 + %108 = OpSelect %uint %107 %102 %uint_0 + %109 = OpSelect %uint %107 %103 %uint_2 + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %111 = OpAccessChain %_ptr_StorageBuffer_uint_0 %110 %108 + OpCooperativeMatrixStoreKHR %111 %m1 %uint_1 %109 NonPrivatePointer + %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %115 = OpArrayLength %uint %12 0 + %116 = OpBitcast %uint %int_0 + %117 = OpIMul %uint %uint_16 %uint_7 + %118 = OpIAdd %uint %116 %117 + %119 = OpIAdd %uint %118 %uint_1 + %120 = OpULessThanEqual %bool %119 %115 + %121 = OpSelect %uint %120 %116 %uint_0 + %122 = OpSelect %uint %120 %uint_16 %uint_1 + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 + %m2 = OpCooperativeMatrixLoadKHR %65 %124 %uint_0 %122 None + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %128 = OpArrayLength %uint %38 0 + %129 = OpBitcast %uint %int_0 + %130 = OpBitcast %uint %int_16 + %131 = OpIMul %uint %130 %uint_7 + %132 = OpIAdd %uint %129 %131 + %133 = OpIAdd %uint %132 %uint_2 + %134 = OpULessThanEqual %bool %133 %128 + %135 = OpSelect %uint %134 %129 %uint_0 + %136 = OpSelect %uint %134 %130 %uint_2 + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 + OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer + %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %142 = OpArrayLength %uint %18 0 + %143 = OpBitcast %uint %int_0 + %144 = OpIMul %uint %uint_16 %uint_7 + %145 = OpIAdd %uint %143 %144 + %146 = OpIAdd %uint %145 %uint_1 + %147 = OpULessThanEqual %bool %146 %142 + %148 = OpSelect %uint %147 %143 %uint_0 + %149 = OpSelect %uint %147 %uint_16 %uint_1 + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %151 = OpAccessChain %_ptr_StorageBuffer_v4uint %150 %148 + %m3 = OpCooperativeMatrixLoadKHR %65 %151 %uint_0 %149 None + %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %155 = OpArrayLength %uint %38 0 + %156 = OpBitcast %uint %int_0 + %157 = OpBitcast %uint %int_16 + %158 = OpIMul %uint %157 %uint_7 + %159 = OpIAdd %uint %156 %158 + %160 = OpIAdd %uint %159 %uint_2 + %161 = OpULessThanEqual %bool %160 %155 + %162 = OpSelect %uint %161 %156 %uint_0 + %163 = OpSelect %uint %161 %157 %uint_2 + %164 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %165 = OpAccessChain %_ptr_StorageBuffer_uint_0 %164 %162 + OpCooperativeMatrixStoreKHR %165 %m3 %uint_1 %163 NonPrivatePointer + %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %169 = OpArrayLength %uint %23 0 + %170 = OpBitcast %uint %int_0 + %171 = OpIMul %uint %uint_16 %uint_7 + %172 = OpIAdd %uint %170 %171 + %173 = OpIAdd %uint %172 %uint_4 + %175 = OpULessThanEqual %bool %173 %169 + %176 = OpSelect %uint %175 %170 %uint_0 + %177 = OpSelect %uint %175 %uint_16 %uint_4 + %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %179 = OpAccessChain %_ptr_StorageBuffer_half %178 %176 + %m4 = OpCooperativeMatrixLoadKHR %65 %179 %uint_0 %177 None + %182 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %183 = OpArrayLength %uint %38 0 + %184 = OpBitcast %uint %int_0 + %185 = OpBitcast %uint %int_16 + %186 = OpIMul %uint %185 %uint_7 + %187 = OpIAdd %uint %184 %186 + %188 = OpIAdd %uint %187 %uint_2 + %189 = OpULessThanEqual %bool %188 %183 + %190 = OpSelect %uint %189 %184 %uint_0 + %191 = OpSelect %uint %189 %185 %uint_2 + %192 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %193 = OpAccessChain %_ptr_StorageBuffer_uint_0 %192 %190 + OpCooperativeMatrixStoreKHR %193 %m4 %uint_1 %191 NonPrivatePointer + %195 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %197 = OpArrayLength %uint %28 0 + %198 = OpBitcast %uint %int_0 + %199 = OpIMul %uint %uint_16 %uint_7 + %200 = OpIAdd %uint %198 %199 + %201 = OpIAdd %uint %200 %uint_2 + %202 = OpULessThanEqual %bool %201 %197 + %203 = OpSelect %uint %202 %198 %uint_0 + %204 = OpSelect %uint %202 %uint_16 %uint_2 + %205 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %206 = OpAccessChain %_ptr_StorageBuffer_v2half %205 %203 + %m5 = OpCooperativeMatrixLoadKHR %65 %206 %uint_0 %204 None + %209 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %210 = OpArrayLength %uint %38 0 + %211 = OpBitcast %uint %int_0 + %212 = OpBitcast %uint %int_16 + %213 = OpIMul %uint %212 %uint_7 + %214 = OpIAdd %uint %211 %213 + %215 = OpIAdd %uint %214 %uint_2 + %216 = OpULessThanEqual %bool %215 %210 + %217 = OpSelect %uint %216 %211 %uint_0 + %218 = OpSelect %uint %216 %212 %uint_2 + %219 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %220 = OpAccessChain %_ptr_StorageBuffer_uint_0 %219 %217 + OpCooperativeMatrixStoreKHR %220 %m5 %uint_1 %218 NonPrivatePointer + %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %224 = OpArrayLength %uint %33 0 + %225 = OpBitcast %uint %int_0 + %226 = OpIMul %uint %uint_16 %uint_7 + %227 = OpIAdd %uint %225 %226 + %228 = OpIAdd %uint %227 %uint_1 + %229 = OpULessThanEqual %bool %228 %224 + %230 = OpSelect %uint %229 %225 %uint_0 + %231 = OpSelect %uint %229 %uint_16 %uint_1 + %232 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %233 = OpAccessChain %_ptr_StorageBuffer_v3half %232 %230 + %m6 = OpCooperativeMatrixLoadKHR %65 %233 %uint_0 %231 None + %236 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %237 = OpArrayLength %uint %38 0 + %238 = OpBitcast %uint %int_0 + %239 = OpBitcast %uint %int_16 + %240 = OpIMul %uint %239 %uint_7 + %241 = OpIAdd %uint %238 %240 + %242 = OpIAdd %uint %241 %uint_2 + %243 = OpULessThanEqual %bool %242 %237 + %244 = OpSelect %uint %243 %238 %uint_0 + %245 = OpSelect %uint %243 %239 %uint_2 + %246 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %247 = OpAccessChain %_ptr_StorageBuffer_uint_0 %246 %244 + OpCooperativeMatrixStoreKHR %247 %m6 %uint_1 %245 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_col_major.wgsl.expected.dxc.hlsl index fd0520a..0f85727 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_col_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 2u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 4u)), (select(v_4, v_3, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_i8_8x8 m1 = Matrix_left_i8_8x8::Load(in1, 0u, 64u, MatrixLayout::ColMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 4u) + 8u) <= ((v_5 / 4u) * 4u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 2u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 4u)), (select(v_8, v_7, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_i8_8x8 m2 = Matrix_left_i8_8x8::Load(in2, 0u, 64u, MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_i8_8x8 m3 = Matrix_left_i8_8x8::Load(in3, 0u, 64u, MatrixLayout::ColMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 4u) + 8u) <= ((v_13 / 4u) * 4u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 2u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 4u)), (select(v_16, v_15, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_i8_8x8 m4 = Matrix_left_i8_8x8::Load(in4, 0u, 64u, MatrixLayout::ColMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 4u) + 8u) <= ((v_17 / 4u) * 4u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 2u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 4u)), (select(v_20, v_19, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_i8_8x8 m5 = Matrix_left_i8_8x8::Load(in5, 0u, 64u, MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_i8_8x8 m6 = Matrix_left_i8_8x8::Load(in6, 0u, 64u, MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_col_major.wgsl.expected.spvasm index 19258a2..7c90ebf 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 202 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -140,12 +140,11 @@ %uint_1 = OpConstant %uint 1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -166,126 +165,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_1 %uint_16 None %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %61 = OpArrayLength %uint %39 0 - %62 = OpIMul %uint %61 %uint_4 - %64 = OpBitcast %uint %int_0 - %66 = OpBitcast %uint %int_16 - %68 = OpIMul %uint %66 %uint_7 - %70 = OpIAdd %uint %64 %68 - %71 = OpIMul %uint %70 %uint_4 - %72 = OpIAdd %uint %71 %uint_8 - %73 = OpULessThanEqual %bool %72 %62 - %75 = OpSelect %uint %73 %64 %uint_0 - %76 = OpSelect %uint %73 %66 %uint_2 - %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %79 = OpAccessChain %_ptr_StorageBuffer_uint_0 %78 %75 - OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %76 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %82 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %84 %uint_1 %uint_16 None - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %88 = OpArrayLength %uint %39 0 - %89 = OpIMul %uint %88 %uint_4 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_2 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint_0 %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v3float %102 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %104 %uint_1 %uint_16 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %108 = OpArrayLength %uint %39 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m2 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v4uint %122 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %124 %uint_1 %uint_16 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %128 = OpArrayLength %uint %39 0 - %129 = OpIMul %uint %128 %uint_4 - %130 = OpBitcast %uint %int_0 - %131 = OpBitcast %uint %int_16 - %132 = OpIMul %uint %131 %uint_7 - %133 = OpIAdd %uint %130 %132 - %134 = OpIMul %uint %133 %uint_4 - %135 = OpIAdd %uint %134 %uint_8 - %136 = OpULessThanEqual %bool %135 %129 - %137 = OpSelect %uint %136 %130 %uint_0 - %138 = OpSelect %uint %136 %131 %uint_2 - %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %140 = OpAccessChain %_ptr_StorageBuffer_uint_0 %139 %137 - OpCooperativeMatrixStoreKHR %140 %m3 %uint_1 %138 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %144 = OpAccessChain %_ptr_StorageBuffer_half %142 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %144 %uint_1 %uint_16 None - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %148 = OpArrayLength %uint %39 0 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpBitcast %uint %int_0 - %151 = OpBitcast %uint %int_16 - %152 = OpIMul %uint %151 %uint_7 - %153 = OpIAdd %uint %150 %152 - %154 = OpIMul %uint %153 %uint_4 - %155 = OpIAdd %uint %154 %uint_8 - %156 = OpULessThanEqual %bool %155 %149 - %157 = OpSelect %uint %156 %150 %uint_0 - %158 = OpSelect %uint %156 %151 %uint_2 - %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %160 = OpAccessChain %_ptr_StorageBuffer_uint_0 %159 %157 - OpCooperativeMatrixStoreKHR %160 %m4 %uint_1 %158 NonPrivatePointer - %162 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v2half %162 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %164 %uint_1 %uint_16 None - %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %168 = OpArrayLength %uint %39 0 - %169 = OpIMul %uint %168 %uint_4 - %170 = OpBitcast %uint %int_0 - %171 = OpBitcast %uint %int_16 - %172 = OpIMul %uint %171 %uint_7 - %173 = OpIAdd %uint %170 %172 - %174 = OpIMul %uint %173 %uint_4 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %169 - %177 = OpSelect %uint %176 %170 %uint_0 - %178 = OpSelect %uint %176 %171 %uint_2 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_uint_0 %179 %177 - OpCooperativeMatrixStoreKHR %180 %m5 %uint_1 %178 NonPrivatePointer - %182 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %184 = OpAccessChain %_ptr_StorageBuffer_v3half %182 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %184 %uint_1 %uint_16 None - %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %188 = OpArrayLength %uint %39 0 - %189 = OpIMul %uint %188 %uint_4 - %190 = OpBitcast %uint %int_0 - %191 = OpBitcast %uint %int_16 - %192 = OpIMul %uint %191 %uint_7 - %193 = OpIAdd %uint %190 %192 - %194 = OpIMul %uint %193 %uint_4 - %195 = OpIAdd %uint %194 %uint_8 - %196 = OpULessThanEqual %bool %195 %189 - %197 = OpSelect %uint %196 %190 %uint_0 - %198 = OpSelect %uint %196 %191 %uint_2 - %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %200 = OpAccessChain %_ptr_StorageBuffer_uint_0 %199 %197 - OpCooperativeMatrixStoreKHR %200 %m6 %uint_1 %198 NonPrivatePointer + %62 = OpBitcast %uint %int_0 + %64 = OpBitcast %uint %int_16 + %66 = OpIMul %uint %64 %uint_7 + %68 = OpIAdd %uint %62 %66 + %69 = OpIAdd %uint %68 %uint_2 + %71 = OpULessThanEqual %bool %69 %61 + %73 = OpSelect %uint %71 %62 %uint_0 + %74 = OpSelect %uint %71 %64 %uint_2 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_uint_0 %75 %73 + OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_1 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_1 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_2 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_2 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_1 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_2 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_2 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_1 %uint_16 None + %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_2 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_2 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_1 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_2 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_2 + %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_1 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_2 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_2 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_row_major.wgsl.expected.dxc.hlsl index d829e6b..01c6ba9 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_row_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 2u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 4u)), (select(v_4, v_3, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_i8_8x8 m1 = Matrix_left_i8_8x8::Load(in1, 0u, 64u, MatrixLayout::RowMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 4u) + 8u) <= ((v_5 / 4u) * 4u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 2u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 4u)), (select(v_8, v_7, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_i8_8x8 m2 = Matrix_left_i8_8x8::Load(in2, 0u, 64u, MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_i8_8x8 m3 = Matrix_left_i8_8x8::Load(in3, 0u, 64u, MatrixLayout::RowMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 4u) + 8u) <= ((v_13 / 4u) * 4u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 2u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 4u)), (select(v_16, v_15, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_i8_8x8 m4 = Matrix_left_i8_8x8::Load(in4, 0u, 64u, MatrixLayout::RowMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 4u) + 8u) <= ((v_17 / 4u) * 4u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 2u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 4u)), (select(v_20, v_19, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_i8_8x8 m5 = Matrix_left_i8_8x8::Load(in5, 0u, 64u, MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_i8_8x8 m6 = Matrix_left_i8_8x8::Load(in6, 0u, 64u, MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_row_major.wgsl.expected.spvasm index f2ce474..1fe5d27 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_i8_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 202 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -139,12 +139,11 @@ %53 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_0 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 @@ -166,126 +165,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_0 %uint_16 None %58 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %60 = OpArrayLength %uint %39 0 - %61 = OpIMul %uint %60 %uint_4 - %63 = OpBitcast %uint %int_0 - %65 = OpBitcast %uint %int_16 - %67 = OpIMul %uint %65 %uint_7 - %69 = OpIAdd %uint %63 %67 - %70 = OpIMul %uint %69 %uint_4 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %61 - %74 = OpSelect %uint %72 %63 %uint_0 - %75 = OpSelect %uint %72 %65 %uint_2 - %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %78 = OpAccessChain %_ptr_StorageBuffer_uint_0 %77 %74 - OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %75 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %82 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %84 %uint_0 %uint_16 None - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %88 = OpArrayLength %uint %39 0 - %89 = OpIMul %uint %88 %uint_4 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_2 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint_0 %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v3float %102 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %104 %uint_0 %uint_16 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %108 = OpArrayLength %uint %39 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m2 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v4uint %122 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %124 %uint_0 %uint_16 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %128 = OpArrayLength %uint %39 0 - %129 = OpIMul %uint %128 %uint_4 - %130 = OpBitcast %uint %int_0 - %131 = OpBitcast %uint %int_16 - %132 = OpIMul %uint %131 %uint_7 - %133 = OpIAdd %uint %130 %132 - %134 = OpIMul %uint %133 %uint_4 - %135 = OpIAdd %uint %134 %uint_8 - %136 = OpULessThanEqual %bool %135 %129 - %137 = OpSelect %uint %136 %130 %uint_0 - %138 = OpSelect %uint %136 %131 %uint_2 - %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %140 = OpAccessChain %_ptr_StorageBuffer_uint_0 %139 %137 - OpCooperativeMatrixStoreKHR %140 %m3 %uint_1 %138 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %144 = OpAccessChain %_ptr_StorageBuffer_half %142 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %144 %uint_0 %uint_16 None - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %148 = OpArrayLength %uint %39 0 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpBitcast %uint %int_0 - %151 = OpBitcast %uint %int_16 - %152 = OpIMul %uint %151 %uint_7 - %153 = OpIAdd %uint %150 %152 - %154 = OpIMul %uint %153 %uint_4 - %155 = OpIAdd %uint %154 %uint_8 - %156 = OpULessThanEqual %bool %155 %149 - %157 = OpSelect %uint %156 %150 %uint_0 - %158 = OpSelect %uint %156 %151 %uint_2 - %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %160 = OpAccessChain %_ptr_StorageBuffer_uint_0 %159 %157 - OpCooperativeMatrixStoreKHR %160 %m4 %uint_1 %158 NonPrivatePointer - %162 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v2half %162 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %164 %uint_0 %uint_16 None - %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %168 = OpArrayLength %uint %39 0 - %169 = OpIMul %uint %168 %uint_4 - %170 = OpBitcast %uint %int_0 - %171 = OpBitcast %uint %int_16 - %172 = OpIMul %uint %171 %uint_7 - %173 = OpIAdd %uint %170 %172 - %174 = OpIMul %uint %173 %uint_4 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %169 - %177 = OpSelect %uint %176 %170 %uint_0 - %178 = OpSelect %uint %176 %171 %uint_2 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_uint_0 %179 %177 - OpCooperativeMatrixStoreKHR %180 %m5 %uint_1 %178 NonPrivatePointer - %182 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %184 = OpAccessChain %_ptr_StorageBuffer_v3half %182 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %184 %uint_0 %uint_16 None - %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %188 = OpArrayLength %uint %39 0 - %189 = OpIMul %uint %188 %uint_4 - %190 = OpBitcast %uint %int_0 - %191 = OpBitcast %uint %int_16 - %192 = OpIMul %uint %191 %uint_7 - %193 = OpIAdd %uint %190 %192 - %194 = OpIMul %uint %193 %uint_4 - %195 = OpIAdd %uint %194 %uint_8 - %196 = OpULessThanEqual %bool %195 %189 - %197 = OpSelect %uint %196 %190 %uint_0 - %198 = OpSelect %uint %196 %191 %uint_2 - %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %200 = OpAccessChain %_ptr_StorageBuffer_uint_0 %199 %197 - OpCooperativeMatrixStoreKHR %200 %m6 %uint_1 %198 NonPrivatePointer + %61 = OpBitcast %uint %int_0 + %63 = OpBitcast %uint %int_16 + %65 = OpIMul %uint %63 %uint_7 + %67 = OpIAdd %uint %61 %65 + %68 = OpIAdd %uint %67 %uint_2 + %70 = OpULessThanEqual %bool %68 %60 + %72 = OpSelect %uint %70 %61 %uint_0 + %73 = OpSelect %uint %70 %63 %uint_2 + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %75 = OpAccessChain %_ptr_StorageBuffer_uint_0 %74 %72 + OpCooperativeMatrixStoreKHR %75 %m0 %uint_1 %73 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_0 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_0 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_2 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_2 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_0 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_2 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_2 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_0 %uint_16 None + %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_2 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_2 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_0 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_2 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_2 + %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_0 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_2 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_2 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl index 5c3ec99..064b987 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -25,7 +25,7 @@ uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 8u) * 2u)); + bool v_10 = (((v_9 + (16u * 7u)) + 4u) <= (v_8 / 8u)); Matrix_left_u32_8x8 m1 = Matrix_left_u32_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_11 = 0u; v.GetDimensions(v_11); @@ -36,7 +36,7 @@ uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 16u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 16u)); Matrix_left_u32_8x8 m2 = Matrix_left_u32_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_18 = 0u; v.GetDimensions(v_18); @@ -47,7 +47,7 @@ uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 4u) + 8u) <= ((v_22 / 16u) * 4u)); + bool v_24 = (((v_23 + (16u * 7u)) + 2u) <= (v_22 / 16u)); Matrix_left_u32_8x8 m3 = Matrix_left_u32_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); @@ -69,7 +69,7 @@ uint v_36 = 0u; in6.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 2u) + 8u) <= ((v_36 / 8u) * 2u)); + bool v_38 = (((v_37 + (16u * 7u)) + 4u) <= (v_36 / 8u)); Matrix_left_u32_8x8 m6 = Matrix_left_u32_8x8::Load(in6, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_col_major.wgsl.expected.spvasm index 930f414..8c85f4d 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 225 +; Bound: 217 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,10 +128,10 @@ %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -168,136 +168,128 @@ OpCooperativeMatrixStoreKHR %77 %m0 %uint_1 %75 NonPrivatePointer %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %82 = OpArrayLength %uint %6 0 - %83 = OpIMul %uint %82 %uint_2 - %85 = OpBitcast %uint %int_0 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %85 %86 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %83 - %91 = OpSelect %uint %90 %85 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_4 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %91 - %m1 = OpCooperativeMatrixLoadKHR %61 %95 %uint_1 %92 None - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %99 = OpArrayLength %uint %34 0 - %100 = OpBitcast %uint %int_0 - %101 = OpBitcast %uint %int_16 - %102 = OpIMul %uint %101 %uint_7 - %103 = OpIAdd %uint %100 %102 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %101 %uint_8 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 - OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %113 = OpArrayLength %uint %12 0 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIMul %uint %117 %uint_4 - %119 = OpIAdd %uint %118 %uint_8 - %120 = OpULessThanEqual %bool %119 %114 - %121 = OpSelect %uint %120 %115 %uint_0 - %122 = OpSelect %uint %120 %uint_16 %uint_2 - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 - %m2 = OpCooperativeMatrixLoadKHR %61 %124 %uint_1 %122 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %128 = OpArrayLength %uint %34 0 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %130 %uint_8 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 - OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %142 = OpArrayLength %uint %18 0 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpBitcast %uint %int_0 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %144 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %143 - %150 = OpSelect %uint %149 %144 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v4uint %152 %150 - %m3 = OpCooperativeMatrixLoadKHR %61 %153 %uint_1 %151 None - %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %157 = OpArrayLength %uint %34 0 - %158 = OpBitcast %uint %int_0 - %159 = OpBitcast %uint %int_16 - %160 = OpIMul %uint %159 %uint_7 - %161 = OpIAdd %uint %158 %160 - %162 = OpIAdd %uint %161 %uint_8 - %163 = OpULessThanEqual %bool %162 %157 - %164 = OpSelect %uint %163 %158 %uint_0 - %165 = OpSelect %uint %163 %159 %uint_8 - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 - OpCooperativeMatrixStoreKHR %167 %m3 %uint_1 %165 NonPrivatePointer - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %171 = OpArrayLength %uint %23 0 - %172 = OpBitcast %uint %int_0 - %173 = OpIMul %uint %uint_16 %uint_7 - %174 = OpIAdd %uint %172 %173 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %171 - %177 = OpSelect %uint %176 %172 %uint_0 - %178 = OpSelect %uint %176 %uint_16 %uint_8 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_v2half %179 %177 - %m5 = OpCooperativeMatrixLoadKHR %61 %180 %uint_1 %178 None - %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %184 = OpArrayLength %uint %34 0 - %185 = OpBitcast %uint %int_0 - %186 = OpBitcast %uint %int_16 - %187 = OpIMul %uint %186 %uint_7 - %188 = OpIAdd %uint %185 %187 - %189 = OpIAdd %uint %188 %uint_8 - %190 = OpULessThanEqual %bool %189 %184 - %191 = OpSelect %uint %190 %185 %uint_0 - %192 = OpSelect %uint %190 %186 %uint_8 - %193 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %194 = OpAccessChain %_ptr_StorageBuffer_uint_0 %193 %191 - OpCooperativeMatrixStoreKHR %194 %m5 %uint_1 %192 NonPrivatePointer - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %198 = OpArrayLength %uint %29 0 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpBitcast %uint %int_0 - %201 = OpIMul %uint %uint_16 %uint_7 - %202 = OpIAdd %uint %200 %201 - %203 = OpIMul %uint %202 %uint_2 - %204 = OpIAdd %uint %203 %uint_8 - %205 = OpULessThanEqual %bool %204 %199 - %206 = OpSelect %uint %205 %200 %uint_0 - %207 = OpSelect %uint %205 %uint_16 %uint_4 - %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %209 = OpAccessChain %_ptr_StorageBuffer_v3half %208 %206 - %m6 = OpCooperativeMatrixLoadKHR %61 %209 %uint_1 %207 None - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %213 = OpArrayLength %uint %34 0 - %214 = OpBitcast %uint %int_0 - %215 = OpBitcast %uint %int_16 - %216 = OpIMul %uint %215 %uint_7 - %217 = OpIAdd %uint %214 %216 - %218 = OpIAdd %uint %217 %uint_8 - %219 = OpULessThanEqual %bool %218 %213 - %220 = OpSelect %uint %219 %214 %uint_0 - %221 = OpSelect %uint %219 %215 %uint_8 - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %223 = OpAccessChain %_ptr_StorageBuffer_uint_0 %222 %220 - OpCooperativeMatrixStoreKHR %223 %m6 %uint_1 %221 NonPrivatePointer + %83 = OpBitcast %uint %int_0 + %84 = OpIMul %uint %uint_16 %uint_7 + %85 = OpIAdd %uint %83 %84 + %86 = OpIAdd %uint %85 %uint_4 + %88 = OpULessThanEqual %bool %86 %82 + %89 = OpSelect %uint %88 %83 %uint_0 + %90 = OpSelect %uint %88 %uint_16 %uint_4 + %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %92 = OpAccessChain %_ptr_StorageBuffer_v2int %91 %89 + %m1 = OpCooperativeMatrixLoadKHR %61 %92 %uint_1 %90 None + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %96 = OpArrayLength %uint %34 0 + %97 = OpBitcast %uint %int_0 + %98 = OpBitcast %uint %int_16 + %99 = OpIMul %uint %98 %uint_7 + %100 = OpIAdd %uint %97 %99 + %101 = OpIAdd %uint %100 %uint_8 + %102 = OpULessThanEqual %bool %101 %96 + %103 = OpSelect %uint %102 %97 %uint_0 + %104 = OpSelect %uint %102 %98 %uint_8 + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %106 = OpAccessChain %_ptr_StorageBuffer_uint_0 %105 %103 + OpCooperativeMatrixStoreKHR %106 %m1 %uint_1 %104 NonPrivatePointer + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %110 = OpArrayLength %uint %12 0 + %111 = OpBitcast %uint %int_0 + %112 = OpIMul %uint %uint_16 %uint_7 + %113 = OpIAdd %uint %111 %112 + %114 = OpIAdd %uint %113 %uint_2 + %116 = OpULessThanEqual %bool %114 %110 + %117 = OpSelect %uint %116 %111 %uint_0 + %118 = OpSelect %uint %116 %uint_16 %uint_2 + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %120 = OpAccessChain %_ptr_StorageBuffer_v3float %119 %117 + %m2 = OpCooperativeMatrixLoadKHR %61 %120 %uint_1 %118 None + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %124 = OpArrayLength %uint %34 0 + %125 = OpBitcast %uint %int_0 + %126 = OpBitcast %uint %int_16 + %127 = OpIMul %uint %126 %uint_7 + %128 = OpIAdd %uint %125 %127 + %129 = OpIAdd %uint %128 %uint_8 + %130 = OpULessThanEqual %bool %129 %124 + %131 = OpSelect %uint %130 %125 %uint_0 + %132 = OpSelect %uint %130 %126 %uint_8 + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_uint_0 %133 %131 + OpCooperativeMatrixStoreKHR %134 %m2 %uint_1 %132 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %138 = OpArrayLength %uint %18 0 + %139 = OpBitcast %uint %int_0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %139 %140 + %142 = OpIAdd %uint %141 %uint_2 + %143 = OpULessThanEqual %bool %142 %138 + %144 = OpSelect %uint %143 %139 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_2 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %61 %147 %uint_1 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %151 = OpArrayLength %uint %34 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_8 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_8 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpBitcast %uint %int_0 + %167 = OpIMul %uint %uint_16 %uint_7 + %168 = OpIAdd %uint %166 %167 + %169 = OpIAdd %uint %168 %uint_8 + %170 = OpULessThanEqual %bool %169 %165 + %171 = OpSelect %uint %170 %166 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_8 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_v2half %173 %171 + %m5 = OpCooperativeMatrixLoadKHR %61 %174 %uint_1 %172 None + %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %178 = OpArrayLength %uint %34 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_8 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_8 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m5 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %192 = OpArrayLength %uint %29 0 + %193 = OpBitcast %uint %int_0 + %194 = OpIMul %uint %uint_16 %uint_7 + %195 = OpIAdd %uint %193 %194 + %196 = OpIAdd %uint %195 %uint_4 + %197 = OpULessThanEqual %bool %196 %192 + %198 = OpSelect %uint %197 %193 %uint_0 + %199 = OpSelect %uint %197 %uint_16 %uint_4 + %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %201 = OpAccessChain %_ptr_StorageBuffer_v3half %200 %198 + %m6 = OpCooperativeMatrixLoadKHR %61 %201 %uint_1 %199 None + %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %205 = OpArrayLength %uint %34 0 + %206 = OpBitcast %uint %int_0 + %207 = OpBitcast %uint %int_16 + %208 = OpIMul %uint %207 %uint_7 + %209 = OpIAdd %uint %206 %208 + %210 = OpIAdd %uint %209 %uint_8 + %211 = OpULessThanEqual %bool %210 %205 + %212 = OpSelect %uint %211 %206 %uint_0 + %213 = OpSelect %uint %211 %207 %uint_8 + %214 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %215 = OpAccessChain %_ptr_StorageBuffer_uint_0 %214 %212 + OpCooperativeMatrixStoreKHR %215 %m6 %uint_1 %213 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl index 28d778c..059ae78 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -25,7 +25,7 @@ uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 8u) * 2u)); + bool v_10 = (((v_9 + (16u * 7u)) + 4u) <= (v_8 / 8u)); Matrix_left_u32_8x8 m1 = Matrix_left_u32_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_11 = 0u; v.GetDimensions(v_11); @@ -36,7 +36,7 @@ uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 16u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 16u)); Matrix_left_u32_8x8 m2 = Matrix_left_u32_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_18 = 0u; v.GetDimensions(v_18); @@ -47,7 +47,7 @@ uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 4u) + 8u) <= ((v_22 / 16u) * 4u)); + bool v_24 = (((v_23 + (16u * 7u)) + 2u) <= (v_22 / 16u)); Matrix_left_u32_8x8 m3 = Matrix_left_u32_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); @@ -69,7 +69,7 @@ uint v_36 = 0u; in6.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 2u) + 8u) <= ((v_36 / 8u) * 2u)); + bool v_38 = (((v_37 + (16u * 7u)) + 4u) <= (v_36 / 8u)); Matrix_left_u32_8x8 m6 = Matrix_left_u32_8x8::Load(in6, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_row_major.wgsl.expected.spvasm index d55046a..76854e6 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_u32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 225 +; Bound: 217 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,10 +128,10 @@ %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -168,136 +168,128 @@ OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %82 = OpArrayLength %uint %6 0 - %83 = OpIMul %uint %82 %uint_2 - %85 = OpBitcast %uint %int_0 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %85 %86 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %83 - %91 = OpSelect %uint %90 %85 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_4 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %91 - %m1 = OpCooperativeMatrixLoadKHR %61 %95 %uint_0 %92 None - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %99 = OpArrayLength %uint %34 0 - %100 = OpBitcast %uint %int_0 - %101 = OpBitcast %uint %int_16 - %102 = OpIMul %uint %101 %uint_7 - %103 = OpIAdd %uint %100 %102 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %101 %uint_8 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 - OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %113 = OpArrayLength %uint %12 0 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIMul %uint %117 %uint_4 - %119 = OpIAdd %uint %118 %uint_8 - %120 = OpULessThanEqual %bool %119 %114 - %121 = OpSelect %uint %120 %115 %uint_0 - %122 = OpSelect %uint %120 %uint_16 %uint_2 - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 - %m2 = OpCooperativeMatrixLoadKHR %61 %124 %uint_0 %122 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %128 = OpArrayLength %uint %34 0 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %130 %uint_8 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 - OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %142 = OpArrayLength %uint %18 0 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpBitcast %uint %int_0 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %144 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %143 - %150 = OpSelect %uint %149 %144 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v4uint %152 %150 - %m3 = OpCooperativeMatrixLoadKHR %61 %153 %uint_0 %151 None - %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %157 = OpArrayLength %uint %34 0 - %158 = OpBitcast %uint %int_0 - %159 = OpBitcast %uint %int_16 - %160 = OpIMul %uint %159 %uint_7 - %161 = OpIAdd %uint %158 %160 - %162 = OpIAdd %uint %161 %uint_8 - %163 = OpULessThanEqual %bool %162 %157 - %164 = OpSelect %uint %163 %158 %uint_0 - %165 = OpSelect %uint %163 %159 %uint_8 - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 - OpCooperativeMatrixStoreKHR %167 %m3 %uint_1 %165 NonPrivatePointer - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %171 = OpArrayLength %uint %23 0 - %172 = OpBitcast %uint %int_0 - %173 = OpIMul %uint %uint_16 %uint_7 - %174 = OpIAdd %uint %172 %173 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %171 - %177 = OpSelect %uint %176 %172 %uint_0 - %178 = OpSelect %uint %176 %uint_16 %uint_8 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_v2half %179 %177 - %m5 = OpCooperativeMatrixLoadKHR %61 %180 %uint_0 %178 None - %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %184 = OpArrayLength %uint %34 0 - %185 = OpBitcast %uint %int_0 - %186 = OpBitcast %uint %int_16 - %187 = OpIMul %uint %186 %uint_7 - %188 = OpIAdd %uint %185 %187 - %189 = OpIAdd %uint %188 %uint_8 - %190 = OpULessThanEqual %bool %189 %184 - %191 = OpSelect %uint %190 %185 %uint_0 - %192 = OpSelect %uint %190 %186 %uint_8 - %193 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %194 = OpAccessChain %_ptr_StorageBuffer_uint_0 %193 %191 - OpCooperativeMatrixStoreKHR %194 %m5 %uint_1 %192 NonPrivatePointer - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %198 = OpArrayLength %uint %29 0 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpBitcast %uint %int_0 - %201 = OpIMul %uint %uint_16 %uint_7 - %202 = OpIAdd %uint %200 %201 - %203 = OpIMul %uint %202 %uint_2 - %204 = OpIAdd %uint %203 %uint_8 - %205 = OpULessThanEqual %bool %204 %199 - %206 = OpSelect %uint %205 %200 %uint_0 - %207 = OpSelect %uint %205 %uint_16 %uint_4 - %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %209 = OpAccessChain %_ptr_StorageBuffer_v3half %208 %206 - %m6 = OpCooperativeMatrixLoadKHR %61 %209 %uint_0 %207 None - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %213 = OpArrayLength %uint %34 0 - %214 = OpBitcast %uint %int_0 - %215 = OpBitcast %uint %int_16 - %216 = OpIMul %uint %215 %uint_7 - %217 = OpIAdd %uint %214 %216 - %218 = OpIAdd %uint %217 %uint_8 - %219 = OpULessThanEqual %bool %218 %213 - %220 = OpSelect %uint %219 %214 %uint_0 - %221 = OpSelect %uint %219 %215 %uint_8 - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %223 = OpAccessChain %_ptr_StorageBuffer_uint_0 %222 %220 - OpCooperativeMatrixStoreKHR %223 %m6 %uint_1 %221 NonPrivatePointer + %83 = OpBitcast %uint %int_0 + %84 = OpIMul %uint %uint_16 %uint_7 + %85 = OpIAdd %uint %83 %84 + %86 = OpIAdd %uint %85 %uint_4 + %88 = OpULessThanEqual %bool %86 %82 + %89 = OpSelect %uint %88 %83 %uint_0 + %90 = OpSelect %uint %88 %uint_16 %uint_4 + %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %92 = OpAccessChain %_ptr_StorageBuffer_v2int %91 %89 + %m1 = OpCooperativeMatrixLoadKHR %61 %92 %uint_0 %90 None + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %96 = OpArrayLength %uint %34 0 + %97 = OpBitcast %uint %int_0 + %98 = OpBitcast %uint %int_16 + %99 = OpIMul %uint %98 %uint_7 + %100 = OpIAdd %uint %97 %99 + %101 = OpIAdd %uint %100 %uint_8 + %102 = OpULessThanEqual %bool %101 %96 + %103 = OpSelect %uint %102 %97 %uint_0 + %104 = OpSelect %uint %102 %98 %uint_8 + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %106 = OpAccessChain %_ptr_StorageBuffer_uint_0 %105 %103 + OpCooperativeMatrixStoreKHR %106 %m1 %uint_1 %104 NonPrivatePointer + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %110 = OpArrayLength %uint %12 0 + %111 = OpBitcast %uint %int_0 + %112 = OpIMul %uint %uint_16 %uint_7 + %113 = OpIAdd %uint %111 %112 + %114 = OpIAdd %uint %113 %uint_2 + %116 = OpULessThanEqual %bool %114 %110 + %117 = OpSelect %uint %116 %111 %uint_0 + %118 = OpSelect %uint %116 %uint_16 %uint_2 + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %120 = OpAccessChain %_ptr_StorageBuffer_v3float %119 %117 + %m2 = OpCooperativeMatrixLoadKHR %61 %120 %uint_0 %118 None + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %124 = OpArrayLength %uint %34 0 + %125 = OpBitcast %uint %int_0 + %126 = OpBitcast %uint %int_16 + %127 = OpIMul %uint %126 %uint_7 + %128 = OpIAdd %uint %125 %127 + %129 = OpIAdd %uint %128 %uint_8 + %130 = OpULessThanEqual %bool %129 %124 + %131 = OpSelect %uint %130 %125 %uint_0 + %132 = OpSelect %uint %130 %126 %uint_8 + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_uint_0 %133 %131 + OpCooperativeMatrixStoreKHR %134 %m2 %uint_1 %132 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %138 = OpArrayLength %uint %18 0 + %139 = OpBitcast %uint %int_0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %139 %140 + %142 = OpIAdd %uint %141 %uint_2 + %143 = OpULessThanEqual %bool %142 %138 + %144 = OpSelect %uint %143 %139 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_2 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %61 %147 %uint_0 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %151 = OpArrayLength %uint %34 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_8 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_8 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpBitcast %uint %int_0 + %167 = OpIMul %uint %uint_16 %uint_7 + %168 = OpIAdd %uint %166 %167 + %169 = OpIAdd %uint %168 %uint_8 + %170 = OpULessThanEqual %bool %169 %165 + %171 = OpSelect %uint %170 %166 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_8 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_v2half %173 %171 + %m5 = OpCooperativeMatrixLoadKHR %61 %174 %uint_0 %172 None + %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %178 = OpArrayLength %uint %34 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_8 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_8 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m5 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %192 = OpArrayLength %uint %29 0 + %193 = OpBitcast %uint %int_0 + %194 = OpIMul %uint %uint_16 %uint_7 + %195 = OpIAdd %uint %193 %194 + %196 = OpIAdd %uint %195 %uint_4 + %197 = OpULessThanEqual %bool %196 %192 + %198 = OpSelect %uint %197 %193 %uint_0 + %199 = OpSelect %uint %197 %uint_16 %uint_4 + %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %201 = OpAccessChain %_ptr_StorageBuffer_v3half %200 %198 + %m6 = OpCooperativeMatrixLoadKHR %61 %201 %uint_0 %199 None + %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %205 = OpArrayLength %uint %34 0 + %206 = OpBitcast %uint %int_0 + %207 = OpBitcast %uint %int_16 + %208 = OpIMul %uint %207 %uint_7 + %209 = OpIAdd %uint %206 %208 + %210 = OpIAdd %uint %209 %uint_8 + %211 = OpULessThanEqual %bool %210 %205 + %212 = OpSelect %uint %211 %206 %uint_0 + %213 = OpSelect %uint %211 %207 %uint_8 + %214 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %215 = OpAccessChain %_ptr_StorageBuffer_uint_0 %214 %212 + OpCooperativeMatrixStoreKHR %215 %m6 %uint_1 %213 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl index b5bd8bf..67a5891 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -14,73 +14,73 @@ void main() { uint v_1 = 0u; in0.GetDimensions(v_1); - bool v_2 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_2 = (((0u + (16u * 7u)) + 2u) <= (v_1 / 4u)); Matrix_left_u8_8x8 m0 = Matrix_left_u8_8x8::Load(in0, (0u + (select(v_2, 0u, 0u) * 4u)), (select(v_2, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_3 = 0u; v.GetDimensions(v_3); uint v_4 = asuint(int(0)); uint v_5 = asuint(int(16)); - bool v_6 = ((((v_4 + (v_5 * 7u)) * 4u) + 8u) <= ((v_3 / 4u) * 4u)); + bool v_6 = (((v_4 + (v_5 * 7u)) + 2u) <= (v_3 / 4u)); m0.Store(v, (0u + (select(v_6, v_4, 0u) * 4u)), (select(v_6, v_5, 2u) * 4u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_7 / 8u) * 8u)); + bool v_8 = (((0u + (16u * 7u)) + 1u) <= (v_7 / 8u)); Matrix_left_u8_8x8 m1 = Matrix_left_u8_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 4u)), (select(v_8, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m1.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_13 / 16u) * 16u)); + bool v_14 = (((0u + (16u * 7u)) + 1u) <= (v_13 / 16u)); Matrix_left_u8_8x8 m2 = Matrix_left_u8_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 4u)), (select(v_14, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; v.GetDimensions(v_15); uint v_16 = asuint(int(0)); uint v_17 = asuint(int(16)); - bool v_18 = ((((v_16 + (v_17 * 7u)) * 4u) + 8u) <= ((v_15 / 4u) * 4u)); + bool v_18 = (((v_16 + (v_17 * 7u)) + 2u) <= (v_15 / 4u)); m2.Store(v, (0u + (select(v_18, v_16, 0u) * 4u)), (select(v_18, v_17, 2u) * 4u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_19 / 16u) * 16u)); + bool v_20 = (((0u + (16u * 7u)) + 1u) <= (v_19 / 16u)); Matrix_left_u8_8x8 m3 = Matrix_left_u8_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 4u)), (select(v_20, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m3.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; in4.GetDimensions(v_25); - bool v_26 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_25 / 2u) * 2u)); + bool v_26 = (((0u + (16u * 7u)) + 4u) <= (v_25 / 2u)); Matrix_left_u8_8x8 m4 = Matrix_left_u8_8x8::Load(in4, (0u + (select(v_26, 0u, 0u) * 4u)), (select(v_26, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_27 = 0u; v.GetDimensions(v_27); uint v_28 = asuint(int(0)); uint v_29 = asuint(int(16)); - bool v_30 = ((((v_28 + (v_29 * 7u)) * 4u) + 8u) <= ((v_27 / 4u) * 4u)); + bool v_30 = (((v_28 + (v_29 * 7u)) + 2u) <= (v_27 / 4u)); m4.Store(v, (0u + (select(v_30, v_28, 0u) * 4u)), (select(v_30, v_29, 2u) * 4u), MatrixLayout::ColMajor); uint v_31 = 0u; in5.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_31 / 4u) * 4u)); + bool v_32 = (((0u + (16u * 7u)) + 2u) <= (v_31 / 4u)); Matrix_left_u8_8x8 m5 = Matrix_left_u8_8x8::Load(in5, (0u + (select(v_32, 0u, 0u) * 4u)), (select(v_32, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_33 = 0u; v.GetDimensions(v_33); uint v_34 = asuint(int(0)); uint v_35 = asuint(int(16)); - bool v_36 = ((((v_34 + (v_35 * 7u)) * 4u) + 8u) <= ((v_33 / 4u) * 4u)); + bool v_36 = (((v_34 + (v_35 * 7u)) + 2u) <= (v_33 / 4u)); m5.Store(v, (0u + (select(v_36, v_34, 0u) * 4u)), (select(v_36, v_35, 2u) * 4u), MatrixLayout::ColMajor); uint v_37 = 0u; in6.GetDimensions(v_37); - bool v_38 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_37 / 8u) * 8u)); + bool v_38 = (((0u + (16u * 7u)) + 1u) <= (v_37 / 8u)); Matrix_left_u8_8x8 m6 = Matrix_left_u8_8x8::Load(in6, (0u + (select(v_38, 0u, 0u) * 4u)), (select(v_38, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 4u) + 8u) <= ((v_39 / 4u) * 4u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 2u) <= (v_39 / 4u)); m6.Store(v, (0u + (select(v_42, v_40, 0u) * 4u)), (select(v_42, v_41, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_col_major.wgsl.expected.spvasm index 41c38d5..9da15ef 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 270 +; Bound: 242 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -129,16 +129,15 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %uchar = OpTypeInt 8 0 - %67 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_0 + %63 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_0 %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_0 = OpConstant %int 0 @@ -151,6 +150,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -160,199 +160,171 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_4 - %51 = OpIMul %uint %uint_16 %uint_7 - %54 = OpIAdd %uint %uint_0 %51 - %55 = OpIMul %uint %54 %uint_4 - %56 = OpIAdd %uint %55 %uint_8 - %58 = OpULessThanEqual %bool %56 %49 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_2 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - %m0 = OpCooperativeMatrixLoadKHR %67 %64 %uint_1 %61 None - %71 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %73 = OpArrayLength %uint %38 0 - %74 = OpIMul %uint %73 %uint_4 - %75 = OpBitcast %uint %int_0 - %77 = OpBitcast %uint %int_16 - %79 = OpIMul %uint %77 %uint_7 - %80 = OpIAdd %uint %75 %79 - %81 = OpIMul %uint %80 %uint_4 - %82 = OpIAdd %uint %81 %uint_8 - %83 = OpULessThanEqual %bool %82 %74 - %84 = OpSelect %uint %83 %75 %uint_0 - %85 = OpSelect %uint %83 %77 %uint_2 - %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %87 = OpAccessChain %_ptr_StorageBuffer_uint_0 %86 %84 - OpCooperativeMatrixStoreKHR %87 %m0 %uint_1 %85 NonPrivatePointer - %90 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %92 = OpArrayLength %uint %6 0 - %93 = OpIMul %uint %92 %uint_8 - %94 = OpIMul %uint %uint_16 %uint_7 - %95 = OpIAdd %uint %uint_0 %94 - %96 = OpIMul %uint %95 %uint_8 - %97 = OpIAdd %uint %96 %uint_8 - %98 = OpULessThanEqual %bool %97 %93 - %99 = OpSelect %uint %98 %uint_0 %uint_0 - %100 = OpSelect %uint %98 %uint_16 %uint_1 - %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %102 = OpAccessChain %_ptr_StorageBuffer_v2int %101 %99 - %m1 = OpCooperativeMatrixLoadKHR %67 %102 %uint_1 %100 None - %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %106 = OpArrayLength %uint %38 0 - %107 = OpIMul %uint %106 %uint_4 - %108 = OpBitcast %uint %int_0 - %109 = OpBitcast %uint %int_16 - %110 = OpIMul %uint %109 %uint_7 - %111 = OpIAdd %uint %108 %110 - %112 = OpIMul %uint %111 %uint_4 - %113 = OpIAdd %uint %112 %uint_8 - %114 = OpULessThanEqual %bool %113 %107 - %115 = OpSelect %uint %114 %108 %uint_0 - %116 = OpSelect %uint %114 %109 %uint_2 - %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %118 = OpAccessChain %_ptr_StorageBuffer_uint_0 %117 %115 - OpCooperativeMatrixStoreKHR %118 %m1 %uint_1 %116 NonPrivatePointer + %49 = OpIMul %uint %uint_16 %uint_7 + %52 = OpIAdd %uint %uint_0 %49 + %53 = OpIAdd %uint %52 %uint_2 + %55 = OpULessThanEqual %bool %53 %48 + %57 = OpSelect %uint %55 %uint_0 %uint_0 + %58 = OpSelect %uint %55 %uint_16 %uint_2 + %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %60 = OpAccessChain %_ptr_StorageBuffer_uint %59 %57 + %m0 = OpCooperativeMatrixLoadKHR %63 %60 %uint_1 %58 None + %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %70 = OpArrayLength %uint %38 0 + %71 = OpBitcast %uint %int_0 + %73 = OpBitcast %uint %int_16 + %75 = OpIMul %uint %73 %uint_7 + %76 = OpIAdd %uint %71 %75 + %77 = OpIAdd %uint %76 %uint_2 + %78 = OpULessThanEqual %bool %77 %70 + %79 = OpSelect %uint %78 %71 %uint_0 + %80 = OpSelect %uint %78 %73 %uint_2 + %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %82 = OpAccessChain %_ptr_StorageBuffer_uint_0 %81 %79 + OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %87 = OpArrayLength %uint %6 0 + %88 = OpIMul %uint %uint_16 %uint_7 + %89 = OpIAdd %uint %uint_0 %88 + %90 = OpIAdd %uint %89 %uint_1 + %91 = OpULessThanEqual %bool %90 %87 + %92 = OpSelect %uint %91 %uint_0 %uint_0 + %93 = OpSelect %uint %91 %uint_16 %uint_1 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %92 + %m1 = OpCooperativeMatrixLoadKHR %63 %95 %uint_1 %93 None + %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %99 = OpArrayLength %uint %38 0 + %100 = OpBitcast %uint %int_0 + %101 = OpBitcast %uint %int_16 + %102 = OpIMul %uint %101 %uint_7 + %103 = OpIAdd %uint %100 %102 + %104 = OpIAdd %uint %103 %uint_2 + %105 = OpULessThanEqual %bool %104 %99 + %106 = OpSelect %uint %105 %100 %uint_0 + %107 = OpSelect %uint %105 %101 %uint_2 + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 + OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %113 = OpArrayLength %uint %12 0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %uint_0 %114 + %116 = OpIAdd %uint %115 %uint_1 + %117 = OpULessThanEqual %bool %116 %113 + %118 = OpSelect %uint %117 %uint_0 %uint_0 + %119 = OpSelect %uint %117 %uint_16 %uint_1 %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %122 = OpArrayLength %uint %12 0 - %123 = OpIMul %uint %122 %uint_16 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %uint_0 %124 - %126 = OpIMul %uint %125 %uint_16 - %127 = OpIAdd %uint %126 %uint_16 - %128 = OpULessThanEqual %bool %127 %123 - %129 = OpSelect %uint %128 %uint_0 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_1 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_v3float %131 %129 - %m2 = OpCooperativeMatrixLoadKHR %67 %132 %uint_1 %130 None - %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %136 = OpArrayLength %uint %38 0 - %137 = OpIMul %uint %136 %uint_4 - %138 = OpBitcast %uint %int_0 - %139 = OpBitcast %uint %int_16 - %140 = OpIMul %uint %139 %uint_7 - %141 = OpIAdd %uint %138 %140 - %142 = OpIMul %uint %141 %uint_4 - %143 = OpIAdd %uint %142 %uint_8 - %144 = OpULessThanEqual %bool %143 %137 - %145 = OpSelect %uint %144 %138 %uint_0 - %146 = OpSelect %uint %144 %139 %uint_2 - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %148 = OpAccessChain %_ptr_StorageBuffer_uint_0 %147 %145 - OpCooperativeMatrixStoreKHR %148 %m2 %uint_1 %146 NonPrivatePointer - %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %152 = OpArrayLength %uint %18 0 - %153 = OpIMul %uint %152 %uint_16 - %154 = OpIMul %uint %uint_16 %uint_7 - %155 = OpIAdd %uint %uint_0 %154 - %156 = OpIMul %uint %155 %uint_16 - %157 = OpIAdd %uint %156 %uint_16 - %158 = OpULessThanEqual %bool %157 %153 - %159 = OpSelect %uint %158 %uint_0 %uint_0 - %160 = OpSelect %uint %158 %uint_16 %uint_1 - %161 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %162 = OpAccessChain %_ptr_StorageBuffer_v4uint %161 %159 - %m3 = OpCooperativeMatrixLoadKHR %67 %162 %uint_1 %160 None - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %166 = OpArrayLength %uint %38 0 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpBitcast %uint %int_0 - %169 = OpBitcast %uint %int_16 - %170 = OpIMul %uint %169 %uint_7 - %171 = OpIAdd %uint %168 %170 - %172 = OpIMul %uint %171 %uint_4 - %173 = OpIAdd %uint %172 %uint_8 - %174 = OpULessThanEqual %bool %173 %167 - %175 = OpSelect %uint %174 %168 %uint_0 - %176 = OpSelect %uint %174 %169 %uint_2 + %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 + %m2 = OpCooperativeMatrixLoadKHR %63 %121 %uint_1 %119 None + %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %125 = OpArrayLength %uint %38 0 + %126 = OpBitcast %uint %int_0 + %127 = OpBitcast %uint %int_16 + %128 = OpIMul %uint %127 %uint_7 + %129 = OpIAdd %uint %126 %128 + %130 = OpIAdd %uint %129 %uint_2 + %131 = OpULessThanEqual %bool %130 %125 + %132 = OpSelect %uint %131 %126 %uint_0 + %133 = OpSelect %uint %131 %127 %uint_2 + %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 + OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %139 = OpArrayLength %uint %18 0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %uint_0 %140 + %142 = OpIAdd %uint %141 %uint_1 + %143 = OpULessThanEqual %bool %142 %139 + %144 = OpSelect %uint %143 %uint_0 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_1 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %63 %147 %uint_1 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %151 = OpArrayLength %uint %38 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_2 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_2 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpIMul %uint %uint_16 %uint_7 + %167 = OpIAdd %uint %uint_0 %166 + %168 = OpIAdd %uint %167 %uint_4 + %170 = OpULessThanEqual %bool %168 %165 + %171 = OpSelect %uint %170 %uint_0 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_4 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_half %173 %171 + %m4 = OpCooperativeMatrixLoadKHR %63 %174 %uint_1 %172 None %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %178 = OpAccessChain %_ptr_StorageBuffer_uint_0 %177 %175 - OpCooperativeMatrixStoreKHR %178 %m3 %uint_1 %176 NonPrivatePointer - %180 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %182 = OpArrayLength %uint %23 0 - %183 = OpIMul %uint %182 %uint_2 - %184 = OpIMul %uint %uint_16 %uint_7 - %185 = OpIAdd %uint %uint_0 %184 - %186 = OpIMul %uint %185 %uint_2 - %187 = OpIAdd %uint %186 %uint_8 - %188 = OpULessThanEqual %bool %187 %183 - %189 = OpSelect %uint %188 %uint_0 %uint_0 - %190 = OpSelect %uint %188 %uint_16 %uint_4 - %191 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %192 = OpAccessChain %_ptr_StorageBuffer_half %191 %189 - %m4 = OpCooperativeMatrixLoadKHR %67 %192 %uint_1 %190 None - %195 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %196 = OpArrayLength %uint %38 0 - %197 = OpIMul %uint %196 %uint_4 - %198 = OpBitcast %uint %int_0 - %199 = OpBitcast %uint %int_16 - %200 = OpIMul %uint %199 %uint_7 - %201 = OpIAdd %uint %198 %200 - %202 = OpIMul %uint %201 %uint_4 - %203 = OpIAdd %uint %202 %uint_8 - %204 = OpULessThanEqual %bool %203 %197 - %205 = OpSelect %uint %204 %198 %uint_0 - %206 = OpSelect %uint %204 %199 %uint_2 - %207 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %208 = OpAccessChain %_ptr_StorageBuffer_uint_0 %207 %205 - OpCooperativeMatrixStoreKHR %208 %m4 %uint_1 %206 NonPrivatePointer - %210 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %212 = OpArrayLength %uint %28 0 - %213 = OpIMul %uint %212 %uint_4 - %214 = OpIMul %uint %uint_16 %uint_7 - %215 = OpIAdd %uint %uint_0 %214 - %216 = OpIMul %uint %215 %uint_4 - %217 = OpIAdd %uint %216 %uint_8 - %218 = OpULessThanEqual %bool %217 %213 - %219 = OpSelect %uint %218 %uint_0 %uint_0 - %220 = OpSelect %uint %218 %uint_16 %uint_2 - %221 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %222 = OpAccessChain %_ptr_StorageBuffer_v2half %221 %219 - %m5 = OpCooperativeMatrixLoadKHR %67 %222 %uint_1 %220 None - %225 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %226 = OpArrayLength %uint %38 0 - %227 = OpIMul %uint %226 %uint_4 - %228 = OpBitcast %uint %int_0 - %229 = OpBitcast %uint %int_16 - %230 = OpIMul %uint %229 %uint_7 - %231 = OpIAdd %uint %228 %230 - %232 = OpIMul %uint %231 %uint_4 - %233 = OpIAdd %uint %232 %uint_8 - %234 = OpULessThanEqual %bool %233 %227 - %235 = OpSelect %uint %234 %228 %uint_0 - %236 = OpSelect %uint %234 %229 %uint_2 - %237 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %238 = OpAccessChain %_ptr_StorageBuffer_uint_0 %237 %235 - OpCooperativeMatrixStoreKHR %238 %m5 %uint_1 %236 NonPrivatePointer - %240 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %242 = OpArrayLength %uint %33 0 - %243 = OpIMul %uint %242 %uint_8 - %244 = OpIMul %uint %uint_16 %uint_7 - %245 = OpIAdd %uint %uint_0 %244 - %246 = OpIMul %uint %245 %uint_8 - %247 = OpIAdd %uint %246 %uint_8 - %248 = OpULessThanEqual %bool %247 %243 - %249 = OpSelect %uint %248 %uint_0 %uint_0 - %250 = OpSelect %uint %248 %uint_16 %uint_1 - %251 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %252 = OpAccessChain %_ptr_StorageBuffer_v3half %251 %249 - %m6 = OpCooperativeMatrixLoadKHR %67 %252 %uint_1 %250 None - %255 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %256 = OpArrayLength %uint %38 0 - %257 = OpIMul %uint %256 %uint_4 - %258 = OpBitcast %uint %int_0 - %259 = OpBitcast %uint %int_16 - %260 = OpIMul %uint %259 %uint_7 - %261 = OpIAdd %uint %258 %260 - %262 = OpIMul %uint %261 %uint_4 - %263 = OpIAdd %uint %262 %uint_8 - %264 = OpULessThanEqual %bool %263 %257 - %265 = OpSelect %uint %264 %258 %uint_0 - %266 = OpSelect %uint %264 %259 %uint_2 - %267 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %268 = OpAccessChain %_ptr_StorageBuffer_uint_0 %267 %265 - OpCooperativeMatrixStoreKHR %268 %m6 %uint_1 %266 NonPrivatePointer + %178 = OpArrayLength %uint %38 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_2 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_2 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m4 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %192 = OpArrayLength %uint %28 0 + %193 = OpIMul %uint %uint_16 %uint_7 + %194 = OpIAdd %uint %uint_0 %193 + %195 = OpIAdd %uint %194 %uint_2 + %196 = OpULessThanEqual %bool %195 %192 + %197 = OpSelect %uint %196 %uint_0 %uint_0 + %198 = OpSelect %uint %196 %uint_16 %uint_2 + %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %200 = OpAccessChain %_ptr_StorageBuffer_v2half %199 %197 + %m5 = OpCooperativeMatrixLoadKHR %63 %200 %uint_1 %198 None + %203 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %204 = OpArrayLength %uint %38 0 + %205 = OpBitcast %uint %int_0 + %206 = OpBitcast %uint %int_16 + %207 = OpIMul %uint %206 %uint_7 + %208 = OpIAdd %uint %205 %207 + %209 = OpIAdd %uint %208 %uint_2 + %210 = OpULessThanEqual %bool %209 %204 + %211 = OpSelect %uint %210 %205 %uint_0 + %212 = OpSelect %uint %210 %206 %uint_2 + %213 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %214 = OpAccessChain %_ptr_StorageBuffer_uint_0 %213 %211 + OpCooperativeMatrixStoreKHR %214 %m5 %uint_1 %212 NonPrivatePointer + %216 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %218 = OpArrayLength %uint %33 0 + %219 = OpIMul %uint %uint_16 %uint_7 + %220 = OpIAdd %uint %uint_0 %219 + %221 = OpIAdd %uint %220 %uint_1 + %222 = OpULessThanEqual %bool %221 %218 + %223 = OpSelect %uint %222 %uint_0 %uint_0 + %224 = OpSelect %uint %222 %uint_16 %uint_1 + %225 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %226 = OpAccessChain %_ptr_StorageBuffer_v3half %225 %223 + %m6 = OpCooperativeMatrixLoadKHR %63 %226 %uint_1 %224 None + %229 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %230 = OpArrayLength %uint %38 0 + %231 = OpBitcast %uint %int_0 + %232 = OpBitcast %uint %int_16 + %233 = OpIMul %uint %232 %uint_7 + %234 = OpIAdd %uint %231 %233 + %235 = OpIAdd %uint %234 %uint_2 + %236 = OpULessThanEqual %bool %235 %230 + %237 = OpSelect %uint %236 %231 %uint_0 + %238 = OpSelect %uint %236 %232 %uint_2 + %239 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %240 = OpAccessChain %_ptr_StorageBuffer_uint_0 %239 %237 + OpCooperativeMatrixStoreKHR %240 %m6 %uint_1 %238 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl index bd12f5d..d005016 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -14,73 +14,73 @@ void main() { uint v_1 = 0u; in0.GetDimensions(v_1); - bool v_2 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_2 = (((0u + (16u * 7u)) + 2u) <= (v_1 / 4u)); Matrix_left_u8_8x8 m0 = Matrix_left_u8_8x8::Load(in0, (0u + (select(v_2, 0u, 0u) * 4u)), (select(v_2, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_3 = 0u; v.GetDimensions(v_3); uint v_4 = asuint(int(0)); uint v_5 = asuint(int(16)); - bool v_6 = ((((v_4 + (v_5 * 7u)) * 4u) + 8u) <= ((v_3 / 4u) * 4u)); + bool v_6 = (((v_4 + (v_5 * 7u)) + 2u) <= (v_3 / 4u)); m0.Store(v, (0u + (select(v_6, v_4, 0u) * 4u)), (select(v_6, v_5, 2u) * 4u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_7 / 8u) * 8u)); + bool v_8 = (((0u + (16u * 7u)) + 1u) <= (v_7 / 8u)); Matrix_left_u8_8x8 m1 = Matrix_left_u8_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 4u)), (select(v_8, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m1.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_13 / 16u) * 16u)); + bool v_14 = (((0u + (16u * 7u)) + 1u) <= (v_13 / 16u)); Matrix_left_u8_8x8 m2 = Matrix_left_u8_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 4u)), (select(v_14, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_15 = 0u; v.GetDimensions(v_15); uint v_16 = asuint(int(0)); uint v_17 = asuint(int(16)); - bool v_18 = ((((v_16 + (v_17 * 7u)) * 4u) + 8u) <= ((v_15 / 4u) * 4u)); + bool v_18 = (((v_16 + (v_17 * 7u)) + 2u) <= (v_15 / 4u)); m2.Store(v, (0u + (select(v_18, v_16, 0u) * 4u)), (select(v_18, v_17, 2u) * 4u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_19 / 16u) * 16u)); + bool v_20 = (((0u + (16u * 7u)) + 1u) <= (v_19 / 16u)); Matrix_left_u8_8x8 m3 = Matrix_left_u8_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 4u)), (select(v_20, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m3.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; in4.GetDimensions(v_25); - bool v_26 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_25 / 2u) * 2u)); + bool v_26 = (((0u + (16u * 7u)) + 4u) <= (v_25 / 2u)); Matrix_left_u8_8x8 m4 = Matrix_left_u8_8x8::Load(in4, (0u + (select(v_26, 0u, 0u) * 4u)), (select(v_26, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_27 = 0u; v.GetDimensions(v_27); uint v_28 = asuint(int(0)); uint v_29 = asuint(int(16)); - bool v_30 = ((((v_28 + (v_29 * 7u)) * 4u) + 8u) <= ((v_27 / 4u) * 4u)); + bool v_30 = (((v_28 + (v_29 * 7u)) + 2u) <= (v_27 / 4u)); m4.Store(v, (0u + (select(v_30, v_28, 0u) * 4u)), (select(v_30, v_29, 2u) * 4u), MatrixLayout::ColMajor); uint v_31 = 0u; in5.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_31 / 4u) * 4u)); + bool v_32 = (((0u + (16u * 7u)) + 2u) <= (v_31 / 4u)); Matrix_left_u8_8x8 m5 = Matrix_left_u8_8x8::Load(in5, (0u + (select(v_32, 0u, 0u) * 4u)), (select(v_32, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_33 = 0u; v.GetDimensions(v_33); uint v_34 = asuint(int(0)); uint v_35 = asuint(int(16)); - bool v_36 = ((((v_34 + (v_35 * 7u)) * 4u) + 8u) <= ((v_33 / 4u) * 4u)); + bool v_36 = (((v_34 + (v_35 * 7u)) + 2u) <= (v_33 / 4u)); m5.Store(v, (0u + (select(v_36, v_34, 0u) * 4u)), (select(v_36, v_35, 2u) * 4u), MatrixLayout::ColMajor); uint v_37 = 0u; in6.GetDimensions(v_37); - bool v_38 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_37 / 8u) * 8u)); + bool v_38 = (((0u + (16u * 7u)) + 1u) <= (v_37 / 8u)); Matrix_left_u8_8x8 m6 = Matrix_left_u8_8x8::Load(in6, (0u + (select(v_38, 0u, 0u) * 4u)), (select(v_38, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 4u) + 8u) <= ((v_39 / 4u) * 4u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 2u) <= (v_39 / 4u)); m6.Store(v, (0u + (select(v_42, v_40, 0u) * 4u)), (select(v_42, v_41, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_row_major.wgsl.expected.spvasm index 10caa7c..30db7c4 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 270 +; Bound: 242 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -129,16 +129,15 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %uchar = OpTypeInt 8 0 - %67 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_0 + %63 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_0 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 @@ -151,6 +150,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -160,199 +160,171 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_4 - %51 = OpIMul %uint %uint_16 %uint_7 - %54 = OpIAdd %uint %uint_0 %51 - %55 = OpIMul %uint %54 %uint_4 - %56 = OpIAdd %uint %55 %uint_8 - %58 = OpULessThanEqual %bool %56 %49 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_2 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - %m0 = OpCooperativeMatrixLoadKHR %67 %64 %uint_0 %61 None - %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %72 = OpArrayLength %uint %38 0 - %73 = OpIMul %uint %72 %uint_4 - %74 = OpBitcast %uint %int_0 - %76 = OpBitcast %uint %int_16 - %78 = OpIMul %uint %76 %uint_7 - %79 = OpIAdd %uint %74 %78 - %80 = OpIMul %uint %79 %uint_4 - %81 = OpIAdd %uint %80 %uint_8 - %82 = OpULessThanEqual %bool %81 %73 - %83 = OpSelect %uint %82 %74 %uint_0 - %84 = OpSelect %uint %82 %76 %uint_2 - %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %86 = OpAccessChain %_ptr_StorageBuffer_uint_0 %85 %83 - OpCooperativeMatrixStoreKHR %86 %m0 %uint_1 %84 NonPrivatePointer - %90 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %92 = OpArrayLength %uint %6 0 - %93 = OpIMul %uint %92 %uint_8 - %94 = OpIMul %uint %uint_16 %uint_7 - %95 = OpIAdd %uint %uint_0 %94 - %96 = OpIMul %uint %95 %uint_8 - %97 = OpIAdd %uint %96 %uint_8 - %98 = OpULessThanEqual %bool %97 %93 - %99 = OpSelect %uint %98 %uint_0 %uint_0 - %100 = OpSelect %uint %98 %uint_16 %uint_1 - %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %102 = OpAccessChain %_ptr_StorageBuffer_v2int %101 %99 - %m1 = OpCooperativeMatrixLoadKHR %67 %102 %uint_0 %100 None - %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %106 = OpArrayLength %uint %38 0 - %107 = OpIMul %uint %106 %uint_4 - %108 = OpBitcast %uint %int_0 - %109 = OpBitcast %uint %int_16 - %110 = OpIMul %uint %109 %uint_7 - %111 = OpIAdd %uint %108 %110 - %112 = OpIMul %uint %111 %uint_4 - %113 = OpIAdd %uint %112 %uint_8 - %114 = OpULessThanEqual %bool %113 %107 - %115 = OpSelect %uint %114 %108 %uint_0 - %116 = OpSelect %uint %114 %109 %uint_2 - %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %118 = OpAccessChain %_ptr_StorageBuffer_uint_0 %117 %115 - OpCooperativeMatrixStoreKHR %118 %m1 %uint_1 %116 NonPrivatePointer + %49 = OpIMul %uint %uint_16 %uint_7 + %52 = OpIAdd %uint %uint_0 %49 + %53 = OpIAdd %uint %52 %uint_2 + %55 = OpULessThanEqual %bool %53 %48 + %57 = OpSelect %uint %55 %uint_0 %uint_0 + %58 = OpSelect %uint %55 %uint_16 %uint_2 + %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %60 = OpAccessChain %_ptr_StorageBuffer_uint %59 %57 + %m0 = OpCooperativeMatrixLoadKHR %63 %60 %uint_0 %58 None + %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %69 = OpArrayLength %uint %38 0 + %70 = OpBitcast %uint %int_0 + %72 = OpBitcast %uint %int_16 + %74 = OpIMul %uint %72 %uint_7 + %75 = OpIAdd %uint %70 %74 + %76 = OpIAdd %uint %75 %uint_2 + %77 = OpULessThanEqual %bool %76 %69 + %78 = OpSelect %uint %77 %70 %uint_0 + %79 = OpSelect %uint %77 %72 %uint_2 + %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_uint_0 %80 %78 + OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %79 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %87 = OpArrayLength %uint %6 0 + %88 = OpIMul %uint %uint_16 %uint_7 + %89 = OpIAdd %uint %uint_0 %88 + %90 = OpIAdd %uint %89 %uint_1 + %91 = OpULessThanEqual %bool %90 %87 + %92 = OpSelect %uint %91 %uint_0 %uint_0 + %93 = OpSelect %uint %91 %uint_16 %uint_1 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %92 + %m1 = OpCooperativeMatrixLoadKHR %63 %95 %uint_0 %93 None + %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %99 = OpArrayLength %uint %38 0 + %100 = OpBitcast %uint %int_0 + %101 = OpBitcast %uint %int_16 + %102 = OpIMul %uint %101 %uint_7 + %103 = OpIAdd %uint %100 %102 + %104 = OpIAdd %uint %103 %uint_2 + %105 = OpULessThanEqual %bool %104 %99 + %106 = OpSelect %uint %105 %100 %uint_0 + %107 = OpSelect %uint %105 %101 %uint_2 + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 + OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %113 = OpArrayLength %uint %12 0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %uint_0 %114 + %116 = OpIAdd %uint %115 %uint_1 + %117 = OpULessThanEqual %bool %116 %113 + %118 = OpSelect %uint %117 %uint_0 %uint_0 + %119 = OpSelect %uint %117 %uint_16 %uint_1 %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %122 = OpArrayLength %uint %12 0 - %123 = OpIMul %uint %122 %uint_16 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %uint_0 %124 - %126 = OpIMul %uint %125 %uint_16 - %127 = OpIAdd %uint %126 %uint_16 - %128 = OpULessThanEqual %bool %127 %123 - %129 = OpSelect %uint %128 %uint_0 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_1 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_v3float %131 %129 - %m2 = OpCooperativeMatrixLoadKHR %67 %132 %uint_0 %130 None - %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %136 = OpArrayLength %uint %38 0 - %137 = OpIMul %uint %136 %uint_4 - %138 = OpBitcast %uint %int_0 - %139 = OpBitcast %uint %int_16 - %140 = OpIMul %uint %139 %uint_7 - %141 = OpIAdd %uint %138 %140 - %142 = OpIMul %uint %141 %uint_4 - %143 = OpIAdd %uint %142 %uint_8 - %144 = OpULessThanEqual %bool %143 %137 - %145 = OpSelect %uint %144 %138 %uint_0 - %146 = OpSelect %uint %144 %139 %uint_2 - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %148 = OpAccessChain %_ptr_StorageBuffer_uint_0 %147 %145 - OpCooperativeMatrixStoreKHR %148 %m2 %uint_1 %146 NonPrivatePointer - %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %152 = OpArrayLength %uint %18 0 - %153 = OpIMul %uint %152 %uint_16 - %154 = OpIMul %uint %uint_16 %uint_7 - %155 = OpIAdd %uint %uint_0 %154 - %156 = OpIMul %uint %155 %uint_16 - %157 = OpIAdd %uint %156 %uint_16 - %158 = OpULessThanEqual %bool %157 %153 - %159 = OpSelect %uint %158 %uint_0 %uint_0 - %160 = OpSelect %uint %158 %uint_16 %uint_1 - %161 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %162 = OpAccessChain %_ptr_StorageBuffer_v4uint %161 %159 - %m3 = OpCooperativeMatrixLoadKHR %67 %162 %uint_0 %160 None - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %166 = OpArrayLength %uint %38 0 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpBitcast %uint %int_0 - %169 = OpBitcast %uint %int_16 - %170 = OpIMul %uint %169 %uint_7 - %171 = OpIAdd %uint %168 %170 - %172 = OpIMul %uint %171 %uint_4 - %173 = OpIAdd %uint %172 %uint_8 - %174 = OpULessThanEqual %bool %173 %167 - %175 = OpSelect %uint %174 %168 %uint_0 - %176 = OpSelect %uint %174 %169 %uint_2 + %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 + %m2 = OpCooperativeMatrixLoadKHR %63 %121 %uint_0 %119 None + %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %125 = OpArrayLength %uint %38 0 + %126 = OpBitcast %uint %int_0 + %127 = OpBitcast %uint %int_16 + %128 = OpIMul %uint %127 %uint_7 + %129 = OpIAdd %uint %126 %128 + %130 = OpIAdd %uint %129 %uint_2 + %131 = OpULessThanEqual %bool %130 %125 + %132 = OpSelect %uint %131 %126 %uint_0 + %133 = OpSelect %uint %131 %127 %uint_2 + %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 + OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %139 = OpArrayLength %uint %18 0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %uint_0 %140 + %142 = OpIAdd %uint %141 %uint_1 + %143 = OpULessThanEqual %bool %142 %139 + %144 = OpSelect %uint %143 %uint_0 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_1 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %63 %147 %uint_0 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %151 = OpArrayLength %uint %38 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_2 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_2 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpIMul %uint %uint_16 %uint_7 + %167 = OpIAdd %uint %uint_0 %166 + %168 = OpIAdd %uint %167 %uint_4 + %170 = OpULessThanEqual %bool %168 %165 + %171 = OpSelect %uint %170 %uint_0 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_4 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_half %173 %171 + %m4 = OpCooperativeMatrixLoadKHR %63 %174 %uint_0 %172 None %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %178 = OpAccessChain %_ptr_StorageBuffer_uint_0 %177 %175 - OpCooperativeMatrixStoreKHR %178 %m3 %uint_1 %176 NonPrivatePointer - %180 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %182 = OpArrayLength %uint %23 0 - %183 = OpIMul %uint %182 %uint_2 - %184 = OpIMul %uint %uint_16 %uint_7 - %185 = OpIAdd %uint %uint_0 %184 - %186 = OpIMul %uint %185 %uint_2 - %187 = OpIAdd %uint %186 %uint_8 - %188 = OpULessThanEqual %bool %187 %183 - %189 = OpSelect %uint %188 %uint_0 %uint_0 - %190 = OpSelect %uint %188 %uint_16 %uint_4 - %191 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %192 = OpAccessChain %_ptr_StorageBuffer_half %191 %189 - %m4 = OpCooperativeMatrixLoadKHR %67 %192 %uint_0 %190 None - %195 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %196 = OpArrayLength %uint %38 0 - %197 = OpIMul %uint %196 %uint_4 - %198 = OpBitcast %uint %int_0 - %199 = OpBitcast %uint %int_16 - %200 = OpIMul %uint %199 %uint_7 - %201 = OpIAdd %uint %198 %200 - %202 = OpIMul %uint %201 %uint_4 - %203 = OpIAdd %uint %202 %uint_8 - %204 = OpULessThanEqual %bool %203 %197 - %205 = OpSelect %uint %204 %198 %uint_0 - %206 = OpSelect %uint %204 %199 %uint_2 - %207 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %208 = OpAccessChain %_ptr_StorageBuffer_uint_0 %207 %205 - OpCooperativeMatrixStoreKHR %208 %m4 %uint_1 %206 NonPrivatePointer - %210 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %212 = OpArrayLength %uint %28 0 - %213 = OpIMul %uint %212 %uint_4 - %214 = OpIMul %uint %uint_16 %uint_7 - %215 = OpIAdd %uint %uint_0 %214 - %216 = OpIMul %uint %215 %uint_4 - %217 = OpIAdd %uint %216 %uint_8 - %218 = OpULessThanEqual %bool %217 %213 - %219 = OpSelect %uint %218 %uint_0 %uint_0 - %220 = OpSelect %uint %218 %uint_16 %uint_2 - %221 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %222 = OpAccessChain %_ptr_StorageBuffer_v2half %221 %219 - %m5 = OpCooperativeMatrixLoadKHR %67 %222 %uint_0 %220 None - %225 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %226 = OpArrayLength %uint %38 0 - %227 = OpIMul %uint %226 %uint_4 - %228 = OpBitcast %uint %int_0 - %229 = OpBitcast %uint %int_16 - %230 = OpIMul %uint %229 %uint_7 - %231 = OpIAdd %uint %228 %230 - %232 = OpIMul %uint %231 %uint_4 - %233 = OpIAdd %uint %232 %uint_8 - %234 = OpULessThanEqual %bool %233 %227 - %235 = OpSelect %uint %234 %228 %uint_0 - %236 = OpSelect %uint %234 %229 %uint_2 - %237 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %238 = OpAccessChain %_ptr_StorageBuffer_uint_0 %237 %235 - OpCooperativeMatrixStoreKHR %238 %m5 %uint_1 %236 NonPrivatePointer - %240 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %242 = OpArrayLength %uint %33 0 - %243 = OpIMul %uint %242 %uint_8 - %244 = OpIMul %uint %uint_16 %uint_7 - %245 = OpIAdd %uint %uint_0 %244 - %246 = OpIMul %uint %245 %uint_8 - %247 = OpIAdd %uint %246 %uint_8 - %248 = OpULessThanEqual %bool %247 %243 - %249 = OpSelect %uint %248 %uint_0 %uint_0 - %250 = OpSelect %uint %248 %uint_16 %uint_1 - %251 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %252 = OpAccessChain %_ptr_StorageBuffer_v3half %251 %249 - %m6 = OpCooperativeMatrixLoadKHR %67 %252 %uint_0 %250 None - %255 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %256 = OpArrayLength %uint %38 0 - %257 = OpIMul %uint %256 %uint_4 - %258 = OpBitcast %uint %int_0 - %259 = OpBitcast %uint %int_16 - %260 = OpIMul %uint %259 %uint_7 - %261 = OpIAdd %uint %258 %260 - %262 = OpIMul %uint %261 %uint_4 - %263 = OpIAdd %uint %262 %uint_8 - %264 = OpULessThanEqual %bool %263 %257 - %265 = OpSelect %uint %264 %258 %uint_0 - %266 = OpSelect %uint %264 %259 %uint_2 - %267 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %268 = OpAccessChain %_ptr_StorageBuffer_uint_0 %267 %265 - OpCooperativeMatrixStoreKHR %268 %m6 %uint_1 %266 NonPrivatePointer + %178 = OpArrayLength %uint %38 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_2 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_2 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m4 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %192 = OpArrayLength %uint %28 0 + %193 = OpIMul %uint %uint_16 %uint_7 + %194 = OpIAdd %uint %uint_0 %193 + %195 = OpIAdd %uint %194 %uint_2 + %196 = OpULessThanEqual %bool %195 %192 + %197 = OpSelect %uint %196 %uint_0 %uint_0 + %198 = OpSelect %uint %196 %uint_16 %uint_2 + %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %200 = OpAccessChain %_ptr_StorageBuffer_v2half %199 %197 + %m5 = OpCooperativeMatrixLoadKHR %63 %200 %uint_0 %198 None + %203 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %204 = OpArrayLength %uint %38 0 + %205 = OpBitcast %uint %int_0 + %206 = OpBitcast %uint %int_16 + %207 = OpIMul %uint %206 %uint_7 + %208 = OpIAdd %uint %205 %207 + %209 = OpIAdd %uint %208 %uint_2 + %210 = OpULessThanEqual %bool %209 %204 + %211 = OpSelect %uint %210 %205 %uint_0 + %212 = OpSelect %uint %210 %206 %uint_2 + %213 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %214 = OpAccessChain %_ptr_StorageBuffer_uint_0 %213 %211 + OpCooperativeMatrixStoreKHR %214 %m5 %uint_1 %212 NonPrivatePointer + %216 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %218 = OpArrayLength %uint %33 0 + %219 = OpIMul %uint %uint_16 %uint_7 + %220 = OpIAdd %uint %uint_0 %219 + %221 = OpIAdd %uint %220 %uint_1 + %222 = OpULessThanEqual %bool %221 %218 + %223 = OpSelect %uint %222 %uint_0 %uint_0 + %224 = OpSelect %uint %222 %uint_16 %uint_1 + %225 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %226 = OpAccessChain %_ptr_StorageBuffer_v3half %225 %223 + %m6 = OpCooperativeMatrixLoadKHR %63 %226 %uint_0 %224 None + %229 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %230 = OpArrayLength %uint %38 0 + %231 = OpBitcast %uint %int_0 + %232 = OpBitcast %uint %int_16 + %233 = OpIMul %uint %232 %uint_7 + %234 = OpIAdd %uint %231 %233 + %235 = OpIAdd %uint %234 %uint_2 + %236 = OpULessThanEqual %bool %235 %230 + %237 = OpSelect %uint %236 %231 %uint_0 + %238 = OpSelect %uint %236 %232 %uint_2 + %239 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %240 = OpAccessChain %_ptr_StorageBuffer_uint_0 %239 %237 + OpCooperativeMatrixStoreKHR %240 %m6 %uint_1 %238 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_col_major.wgsl.expected.dxc.hlsl index 67b9b40..b7e069c 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_col_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 2u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 4u)), (select(v_4, v_3, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_u8_8x8 m1 = Matrix_left_u8_8x8::Load(in1, 0u, 64u, MatrixLayout::ColMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 4u) + 8u) <= ((v_5 / 4u) * 4u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 2u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 4u)), (select(v_8, v_7, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_u8_8x8 m2 = Matrix_left_u8_8x8::Load(in2, 0u, 64u, MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_u8_8x8 m3 = Matrix_left_u8_8x8::Load(in3, 0u, 64u, MatrixLayout::ColMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 4u) + 8u) <= ((v_13 / 4u) * 4u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 2u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 4u)), (select(v_16, v_15, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_u8_8x8 m4 = Matrix_left_u8_8x8::Load(in4, 0u, 64u, MatrixLayout::ColMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 4u) + 8u) <= ((v_17 / 4u) * 4u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 2u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 4u)), (select(v_20, v_19, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_u8_8x8 m5 = Matrix_left_u8_8x8::Load(in5, 0u, 64u, MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_u8_8x8 m6 = Matrix_left_u8_8x8::Load(in6, 0u, 64u, MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_col_major.wgsl.expected.spvasm index 7535f79..092bf4f 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 202 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -140,12 +140,11 @@ %uint_1 = OpConstant %uint 1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -166,126 +165,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_1 %uint_16 None %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %61 = OpArrayLength %uint %39 0 - %62 = OpIMul %uint %61 %uint_4 - %64 = OpBitcast %uint %int_0 - %66 = OpBitcast %uint %int_16 - %68 = OpIMul %uint %66 %uint_7 - %70 = OpIAdd %uint %64 %68 - %71 = OpIMul %uint %70 %uint_4 - %72 = OpIAdd %uint %71 %uint_8 - %73 = OpULessThanEqual %bool %72 %62 - %75 = OpSelect %uint %73 %64 %uint_0 - %76 = OpSelect %uint %73 %66 %uint_2 - %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %79 = OpAccessChain %_ptr_StorageBuffer_uint_0 %78 %75 - OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %76 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %82 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %84 %uint_1 %uint_16 None - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %88 = OpArrayLength %uint %39 0 - %89 = OpIMul %uint %88 %uint_4 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_2 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint_0 %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v3float %102 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %104 %uint_1 %uint_16 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %108 = OpArrayLength %uint %39 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m2 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v4uint %122 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %124 %uint_1 %uint_16 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %128 = OpArrayLength %uint %39 0 - %129 = OpIMul %uint %128 %uint_4 - %130 = OpBitcast %uint %int_0 - %131 = OpBitcast %uint %int_16 - %132 = OpIMul %uint %131 %uint_7 - %133 = OpIAdd %uint %130 %132 - %134 = OpIMul %uint %133 %uint_4 - %135 = OpIAdd %uint %134 %uint_8 - %136 = OpULessThanEqual %bool %135 %129 - %137 = OpSelect %uint %136 %130 %uint_0 - %138 = OpSelect %uint %136 %131 %uint_2 - %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %140 = OpAccessChain %_ptr_StorageBuffer_uint_0 %139 %137 - OpCooperativeMatrixStoreKHR %140 %m3 %uint_1 %138 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %144 = OpAccessChain %_ptr_StorageBuffer_half %142 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %144 %uint_1 %uint_16 None - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %148 = OpArrayLength %uint %39 0 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpBitcast %uint %int_0 - %151 = OpBitcast %uint %int_16 - %152 = OpIMul %uint %151 %uint_7 - %153 = OpIAdd %uint %150 %152 - %154 = OpIMul %uint %153 %uint_4 - %155 = OpIAdd %uint %154 %uint_8 - %156 = OpULessThanEqual %bool %155 %149 - %157 = OpSelect %uint %156 %150 %uint_0 - %158 = OpSelect %uint %156 %151 %uint_2 - %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %160 = OpAccessChain %_ptr_StorageBuffer_uint_0 %159 %157 - OpCooperativeMatrixStoreKHR %160 %m4 %uint_1 %158 NonPrivatePointer - %162 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v2half %162 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %164 %uint_1 %uint_16 None - %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %168 = OpArrayLength %uint %39 0 - %169 = OpIMul %uint %168 %uint_4 - %170 = OpBitcast %uint %int_0 - %171 = OpBitcast %uint %int_16 - %172 = OpIMul %uint %171 %uint_7 - %173 = OpIAdd %uint %170 %172 - %174 = OpIMul %uint %173 %uint_4 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %169 - %177 = OpSelect %uint %176 %170 %uint_0 - %178 = OpSelect %uint %176 %171 %uint_2 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_uint_0 %179 %177 - OpCooperativeMatrixStoreKHR %180 %m5 %uint_1 %178 NonPrivatePointer - %182 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %184 = OpAccessChain %_ptr_StorageBuffer_v3half %182 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %184 %uint_1 %uint_16 None - %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %188 = OpArrayLength %uint %39 0 - %189 = OpIMul %uint %188 %uint_4 - %190 = OpBitcast %uint %int_0 - %191 = OpBitcast %uint %int_16 - %192 = OpIMul %uint %191 %uint_7 - %193 = OpIAdd %uint %190 %192 - %194 = OpIMul %uint %193 %uint_4 - %195 = OpIAdd %uint %194 %uint_8 - %196 = OpULessThanEqual %bool %195 %189 - %197 = OpSelect %uint %196 %190 %uint_0 - %198 = OpSelect %uint %196 %191 %uint_2 - %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %200 = OpAccessChain %_ptr_StorageBuffer_uint_0 %199 %197 - OpCooperativeMatrixStoreKHR %200 %m6 %uint_1 %198 NonPrivatePointer + %62 = OpBitcast %uint %int_0 + %64 = OpBitcast %uint %int_16 + %66 = OpIMul %uint %64 %uint_7 + %68 = OpIAdd %uint %62 %66 + %69 = OpIAdd %uint %68 %uint_2 + %71 = OpULessThanEqual %bool %69 %61 + %73 = OpSelect %uint %71 %62 %uint_0 + %74 = OpSelect %uint %71 %64 %uint_2 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_uint_0 %75 %73 + OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_1 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_1 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_2 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_2 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_1 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_2 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_2 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_1 %uint_16 None + %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_2 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_2 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_1 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_2 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_2 + %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_1 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_2 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_2 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_row_major.wgsl.expected.dxc.hlsl index 364234c..78541fc 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_row_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 2u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 4u)), (select(v_4, v_3, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_u8_8x8 m1 = Matrix_left_u8_8x8::Load(in1, 0u, 64u, MatrixLayout::RowMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 4u) + 8u) <= ((v_5 / 4u) * 4u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 2u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 4u)), (select(v_8, v_7, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_u8_8x8 m2 = Matrix_left_u8_8x8::Load(in2, 0u, 64u, MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_u8_8x8 m3 = Matrix_left_u8_8x8::Load(in3, 0u, 64u, MatrixLayout::RowMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 4u) + 8u) <= ((v_13 / 4u) * 4u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 2u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 4u)), (select(v_16, v_15, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_u8_8x8 m4 = Matrix_left_u8_8x8::Load(in4, 0u, 64u, MatrixLayout::RowMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 4u) + 8u) <= ((v_17 / 4u) * 4u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 2u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 4u)), (select(v_20, v_19, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_u8_8x8 m5 = Matrix_left_u8_8x8::Load(in5, 0u, 64u, MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); Matrix_left_u8_8x8 m6 = Matrix_left_u8_8x8::Load(in6, 0u, 64u, MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_row_major.wgsl.expected.spvasm index 118fdf0..3a2cee4 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_left_u8_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 202 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -139,12 +139,11 @@ %53 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_0 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 @@ -166,126 +165,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_0 %uint_16 None %58 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %60 = OpArrayLength %uint %39 0 - %61 = OpIMul %uint %60 %uint_4 - %63 = OpBitcast %uint %int_0 - %65 = OpBitcast %uint %int_16 - %67 = OpIMul %uint %65 %uint_7 - %69 = OpIAdd %uint %63 %67 - %70 = OpIMul %uint %69 %uint_4 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %61 - %74 = OpSelect %uint %72 %63 %uint_0 - %75 = OpSelect %uint %72 %65 %uint_2 - %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %78 = OpAccessChain %_ptr_StorageBuffer_uint_0 %77 %74 - OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %75 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %82 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %84 %uint_0 %uint_16 None - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %88 = OpArrayLength %uint %39 0 - %89 = OpIMul %uint %88 %uint_4 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_2 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint_0 %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v3float %102 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %104 %uint_0 %uint_16 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %108 = OpArrayLength %uint %39 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m2 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v4uint %122 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %124 %uint_0 %uint_16 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %128 = OpArrayLength %uint %39 0 - %129 = OpIMul %uint %128 %uint_4 - %130 = OpBitcast %uint %int_0 - %131 = OpBitcast %uint %int_16 - %132 = OpIMul %uint %131 %uint_7 - %133 = OpIAdd %uint %130 %132 - %134 = OpIMul %uint %133 %uint_4 - %135 = OpIAdd %uint %134 %uint_8 - %136 = OpULessThanEqual %bool %135 %129 - %137 = OpSelect %uint %136 %130 %uint_0 - %138 = OpSelect %uint %136 %131 %uint_2 - %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %140 = OpAccessChain %_ptr_StorageBuffer_uint_0 %139 %137 - OpCooperativeMatrixStoreKHR %140 %m3 %uint_1 %138 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %144 = OpAccessChain %_ptr_StorageBuffer_half %142 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %144 %uint_0 %uint_16 None - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %148 = OpArrayLength %uint %39 0 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpBitcast %uint %int_0 - %151 = OpBitcast %uint %int_16 - %152 = OpIMul %uint %151 %uint_7 - %153 = OpIAdd %uint %150 %152 - %154 = OpIMul %uint %153 %uint_4 - %155 = OpIAdd %uint %154 %uint_8 - %156 = OpULessThanEqual %bool %155 %149 - %157 = OpSelect %uint %156 %150 %uint_0 - %158 = OpSelect %uint %156 %151 %uint_2 - %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %160 = OpAccessChain %_ptr_StorageBuffer_uint_0 %159 %157 - OpCooperativeMatrixStoreKHR %160 %m4 %uint_1 %158 NonPrivatePointer - %162 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v2half %162 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %164 %uint_0 %uint_16 None - %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %168 = OpArrayLength %uint %39 0 - %169 = OpIMul %uint %168 %uint_4 - %170 = OpBitcast %uint %int_0 - %171 = OpBitcast %uint %int_16 - %172 = OpIMul %uint %171 %uint_7 - %173 = OpIAdd %uint %170 %172 - %174 = OpIMul %uint %173 %uint_4 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %169 - %177 = OpSelect %uint %176 %170 %uint_0 - %178 = OpSelect %uint %176 %171 %uint_2 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_uint_0 %179 %177 - OpCooperativeMatrixStoreKHR %180 %m5 %uint_1 %178 NonPrivatePointer - %182 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %184 = OpAccessChain %_ptr_StorageBuffer_v3half %182 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %184 %uint_0 %uint_16 None - %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %188 = OpArrayLength %uint %39 0 - %189 = OpIMul %uint %188 %uint_4 - %190 = OpBitcast %uint %int_0 - %191 = OpBitcast %uint %int_16 - %192 = OpIMul %uint %191 %uint_7 - %193 = OpIAdd %uint %190 %192 - %194 = OpIMul %uint %193 %uint_4 - %195 = OpIAdd %uint %194 %uint_8 - %196 = OpULessThanEqual %bool %195 %189 - %197 = OpSelect %uint %196 %190 %uint_0 - %198 = OpSelect %uint %196 %191 %uint_2 - %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %200 = OpAccessChain %_ptr_StorageBuffer_uint_0 %199 %197 - OpCooperativeMatrixStoreKHR %200 %m6 %uint_1 %198 NonPrivatePointer + %61 = OpBitcast %uint %int_0 + %63 = OpBitcast %uint %int_16 + %65 = OpIMul %uint %63 %uint_7 + %67 = OpIAdd %uint %61 %65 + %68 = OpIAdd %uint %67 %uint_2 + %70 = OpULessThanEqual %bool %68 %60 + %72 = OpSelect %uint %70 %61 %uint_0 + %73 = OpSelect %uint %70 %63 %uint_2 + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %75 = OpAccessChain %_ptr_StorageBuffer_uint_0 %74 %72 + OpCooperativeMatrixStoreKHR %75 %m0 %uint_1 %73 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_0 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_0 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_2 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_2 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_0 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_2 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_2 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_0 %uint_16 None + %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_2 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_2 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_0 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_2 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_2 + %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_0 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_2 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_2 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl index a6da652..826825e 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -14,43 +14,43 @@ void main() { uint v_1 = 0u; in0.GetDimensions(v_1); - bool v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_1 / 4u) * 2u)); + bool v_2 = (((0u + (16u * 7u)) + 4u) <= (v_1 / 4u)); Matrix_result_f16_8x8 m0 = Matrix_result_f16_8x8::Load(in0, (0u + (select(v_2, 0u, 0u) * 2u)), (select(v_2, 16u, 4u) * 2u), MatrixLayout::ColMajor); uint v_3 = 0u; v.GetDimensions(v_3); uint v_4 = asuint(int(0)); uint v_5 = asuint(int(16)); - bool v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= ((v_3 / 4u) * 2u)); + bool v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= (v_3 / 4u)); m0.Store(v, (0u + (select(v_6, v_4, 0u) * 2u)), (select(v_6, v_5, 4u) * 2u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_7 / 8u) * 4u)); + bool v_8 = (((0u + (16u * 7u)) + 2u) <= (v_7 / 8u)); Matrix_result_f16_8x8 m1 = Matrix_result_f16_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 2u)), (select(v_8, 16u, 2u) * 2u), MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 2u) + 8u) <= ((v_9 / 4u) * 2u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 4u) <= (v_9 / 4u)); m1.Store(v, (0u + (select(v_12, v_10, 0u) * 2u)), (select(v_12, v_11, 4u) * 2u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_13 / 16u) * 8u)); + bool v_14 = (((0u + (16u * 7u)) + 1u) <= (v_13 / 16u)); Matrix_result_f16_8x8 m2 = Matrix_result_f16_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 2u)), (select(v_14, 16u, 1u) * 2u), MatrixLayout::ColMajor); uint v_15 = 0u; v.GetDimensions(v_15); uint v_16 = asuint(int(0)); uint v_17 = asuint(int(16)); - bool v_18 = ((((v_16 + (v_17 * 7u)) * 2u) + 8u) <= ((v_15 / 4u) * 2u)); + bool v_18 = (((v_16 + (v_17 * 7u)) + 4u) <= (v_15 / 4u)); m2.Store(v, (0u + (select(v_18, v_16, 0u) * 2u)), (select(v_18, v_17, 4u) * 2u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_19 / 16u) * 8u)); + bool v_20 = (((0u + (16u * 7u)) + 1u) <= (v_19 / 16u)); Matrix_result_f16_8x8 m3 = Matrix_result_f16_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 2u)), (select(v_20, 16u, 1u) * 2u), MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 2u) + 8u) <= ((v_21 / 4u) * 2u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 4u) <= (v_21 / 4u)); m3.Store(v, (0u + (select(v_24, v_22, 0u) * 2u)), (select(v_24, v_23, 4u) * 2u), MatrixLayout::ColMajor); uint v_25 = 0u; in4.GetDimensions(v_25); @@ -60,27 +60,27 @@ v.GetDimensions(v_27); uint v_28 = asuint(int(0)); uint v_29 = asuint(int(16)); - bool v_30 = ((((v_28 + (v_29 * 7u)) * 2u) + 8u) <= ((v_27 / 4u) * 2u)); + bool v_30 = (((v_28 + (v_29 * 7u)) + 4u) <= (v_27 / 4u)); m4.Store(v, (0u + (select(v_30, v_28, 0u) * 2u)), (select(v_30, v_29, 4u) * 2u), MatrixLayout::ColMajor); uint v_31 = 0u; in5.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_31 / 4u) * 2u)); + bool v_32 = (((0u + (16u * 7u)) + 4u) <= (v_31 / 4u)); Matrix_result_f16_8x8 m5 = Matrix_result_f16_8x8::Load(in5, (0u + (select(v_32, 0u, 0u) * 2u)), (select(v_32, 16u, 4u) * 2u), MatrixLayout::ColMajor); uint v_33 = 0u; v.GetDimensions(v_33); uint v_34 = asuint(int(0)); uint v_35 = asuint(int(16)); - bool v_36 = ((((v_34 + (v_35 * 7u)) * 2u) + 8u) <= ((v_33 / 4u) * 2u)); + bool v_36 = (((v_34 + (v_35 * 7u)) + 4u) <= (v_33 / 4u)); m5.Store(v, (0u + (select(v_36, v_34, 0u) * 2u)), (select(v_36, v_35, 4u) * 2u), MatrixLayout::ColMajor); uint v_37 = 0u; in6.GetDimensions(v_37); - bool v_38 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_37 / 8u) * 4u)); + bool v_38 = (((0u + (16u * 7u)) + 2u) <= (v_37 / 8u)); Matrix_result_f16_8x8 m6 = Matrix_result_f16_8x8::Load(in6, (0u + (select(v_38, 0u, 0u) * 2u)), (select(v_38, 16u, 2u) * 2u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 2u) + 8u) <= ((v_39 / 4u) * 2u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 4u) <= (v_39 / 4u)); m6.Store(v, (0u + (select(v_42, v_40, 0u) * 2u)), (select(v_42, v_41, 4u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_col_major.wgsl.expected.msl index 5dc6c09..1b86e40 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_col_major.wgsl.expected.msl
@@ -50,37 +50,37 @@ kernel void v(const device tint_array<uint, 1>* in0 [[buffer(0)]], const device tint_array<int2, 1>* in1 [[buffer(1)]], const device tint_array<tint_packed_vec3_f32_array_element, 1>* in2 [[buffer(2)]], const device tint_array<uint4, 1>* in3 [[buffer(3)]], const device tint_array<half, 1>* in4 [[buffer(4)]], const device tint_array<half2, 1>* in5 [[buffer(5)]], const device tint_array<tint_packed_vec3_f16_array_element, 1>* in6 [[buffer(6)]], device tint_array<uint, 1>* out [[buffer(7)]], const constant tint_array<uint4, 2>* tint_storage_buffer_sizes [[buffer(30)]]) { tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.in0=in0, .in1=in1, .in2=in2, .in3=in3, .in4=in4, .in5=in5, .in6=in6, .out=out, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; tint_array_lengths_struct const v_1 = tint_array_lengths_struct{.tint_array_length_0_0=((*tint_module_vars.tint_storage_buffer_sizes)[0u].x / 4u), .tint_array_length_0_7=((*tint_module_vars.tint_storage_buffer_sizes)[1u].w / 4u), .tint_array_length_0_1=((*tint_module_vars.tint_storage_buffer_sizes)[0u].y / 8u), .tint_array_length_0_2=((*tint_module_vars.tint_storage_buffer_sizes)[0u].z / 16u), .tint_array_length_0_3=((*tint_module_vars.tint_storage_buffer_sizes)[0u].w / 16u), .tint_array_length_0_4=((*tint_module_vars.tint_storage_buffer_sizes)[1u].x / 2u), .tint_array_length_0_5=((*tint_module_vars.tint_storage_buffer_sizes)[1u].y / 4u), .tint_array_length_0_6=((*tint_module_vars.tint_storage_buffer_sizes)[1u].z / 8u)}; - bool const v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_0 * 2u)); + bool const v_2 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_0); simdgroup_half8x8 v_3 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_3, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in0) + (select(0u, 0u, v_2) * 4u)), ulong((select(4u, 16u, v_2) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 const m0 = v_3; uint const v_4 = as_type<uint>(0); uint const v_5 = as_type<uint>(16); - bool const v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_4, v_6) * 4u)), ulong((select(4u, v_5, v_6) * 2u)), ulong2(0ul), true)); - bool const v_7 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_1 * 4u)); + bool const v_7 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_1); simdgroup_half8x8 v_8 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_8, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (select(0u, 0u, v_7) * 8u)), ulong((select(2u, 16u, v_7) * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m1 = v_8; uint const v_9 = as_type<uint>(0); uint const v_10 = as_type<uint>(16); - bool const v_11 = ((((v_9 + (v_10 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_11 = (((v_9 + (v_10 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_9, v_11) * 4u)), ulong((select(4u, v_10, v_11) * 2u)), ulong2(0ul), true)); - bool const v_12 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_2 * 8u)); + bool const v_12 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_2); simdgroup_half8x8 v_13 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_13, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (select(0u, 0u, v_12) * 16u)), ulong((select(1u, 16u, v_12) * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m2 = v_13; uint const v_14 = as_type<uint>(0); uint const v_15 = as_type<uint>(16); - bool const v_16 = ((((v_14 + (v_15 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_16 = (((v_14 + (v_15 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_14, v_16) * 4u)), ulong((select(4u, v_15, v_16) * 2u)), ulong2(0ul), true)); - bool const v_17 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_3 * 8u)); + bool const v_17 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_3); simdgroup_half8x8 v_18 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_18, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (select(0u, 0u, v_17) * 16u)), ulong((select(1u, 16u, v_17) * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m3 = v_18; uint const v_19 = as_type<uint>(0); uint const v_20 = as_type<uint>(16); - bool const v_21 = ((((v_19 + (v_20 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_21 = (((v_19 + (v_20 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_19, v_21) * 4u)), ulong((select(4u, v_20, v_21) * 2u)), ulong2(0ul), true)); bool const v_22 = (((0u + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); simdgroup_half8x8 v_23 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); @@ -88,22 +88,22 @@ simdgroup_half8x8 const m4 = v_23; uint const v_24 = as_type<uint>(0); uint const v_25 = as_type<uint>(16); - bool const v_26 = ((((v_24 + (v_25 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_26 = (((v_24 + (v_25 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_24, v_26) * 4u)), ulong((select(4u, v_25, v_26) * 2u)), ulong2(0ul), true)); - bool const v_27 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_27 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); simdgroup_half8x8 v_28 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_28, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in5) + (select(0u, 0u, v_27) * 4u)), ulong((select(4u, 16u, v_27) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 const m5 = v_28; uint const v_29 = as_type<uint>(0); uint const v_30 = as_type<uint>(16); - bool const v_31 = ((((v_29 + (v_30 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_31 = (((v_29 + (v_30 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_29, v_31) * 4u)), ulong((select(4u, v_30, v_31) * 2u)), ulong2(0ul), true)); - bool const v_32 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_6 * 4u)); + bool const v_32 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_6); simdgroup_half8x8 v_33 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_33, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (select(0u, 0u, v_32) * 8u)), ulong((select(2u, 16u, v_32) * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m6 = v_33; uint const v_34 = as_type<uint>(0); uint const v_35 = as_type<uint>(16); - bool const v_36 = ((((v_34 + (v_35 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_36 = (((v_34 + (v_35 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_34, v_36) * 4u)), ulong((select(4u, v_35, v_36) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_col_major.wgsl.expected.spvasm index 4b23317..4a0552c 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 267 +; Bound: 241 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,15 +128,15 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_2 = OpConstant %uint 2 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 - %67 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_2 + %uint_8 = OpConstant %uint 8 + %uint_2 = OpConstant %uint 2 + %63 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_2 %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_0 = OpConstant %int 0 @@ -158,197 +158,171 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_2 - %51 = OpIMul %uint %uint_16 %uint_7 - %54 = OpIAdd %uint %uint_0 %51 - %55 = OpIMul %uint %54 %uint_2 - %56 = OpIAdd %uint %55 %uint_8 - %58 = OpULessThanEqual %bool %56 %49 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_4 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - %m0 = OpCooperativeMatrixLoadKHR %67 %64 %uint_1 %61 None - %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %72 = OpArrayLength %uint %38 0 - %73 = OpIMul %uint %72 %uint_2 - %74 = OpBitcast %uint %int_0 - %76 = OpBitcast %uint %int_16 - %78 = OpIMul %uint %76 %uint_7 - %79 = OpIAdd %uint %74 %78 - %80 = OpIMul %uint %79 %uint_2 - %81 = OpIAdd %uint %80 %uint_8 - %82 = OpULessThanEqual %bool %81 %73 - %83 = OpSelect %uint %82 %74 %uint_0 - %84 = OpSelect %uint %82 %76 %uint_4 - %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %86 = OpAccessChain %_ptr_StorageBuffer_uint_0 %85 %83 - OpCooperativeMatrixStoreKHR %86 %m0 %uint_1 %84 NonPrivatePointer - %89 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %91 = OpArrayLength %uint %6 0 - %92 = OpIMul %uint %91 %uint_4 - %93 = OpIMul %uint %uint_16 %uint_7 - %94 = OpIAdd %uint %uint_0 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %92 - %98 = OpSelect %uint %97 %uint_0 %uint_0 - %99 = OpSelect %uint %97 %uint_16 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_v2int %100 %98 - %m1 = OpCooperativeMatrixLoadKHR %67 %101 %uint_1 %99 None - %104 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %105 = OpArrayLength %uint %38 0 - %106 = OpIMul %uint %105 %uint_2 - %107 = OpBitcast %uint %int_0 - %108 = OpBitcast %uint %int_16 - %109 = OpIMul %uint %108 %uint_7 - %110 = OpIAdd %uint %107 %109 - %111 = OpIMul %uint %110 %uint_2 - %112 = OpIAdd %uint %111 %uint_8 - %113 = OpULessThanEqual %bool %112 %106 - %114 = OpSelect %uint %113 %107 %uint_0 - %115 = OpSelect %uint %113 %108 %uint_4 - %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %117 = OpAccessChain %_ptr_StorageBuffer_uint_0 %116 %114 - OpCooperativeMatrixStoreKHR %117 %m1 %uint_1 %115 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %121 = OpArrayLength %uint %12 0 - %122 = OpIMul %uint %121 %uint_8 - %123 = OpIMul %uint %uint_16 %uint_7 - %124 = OpIAdd %uint %uint_0 %123 - %125 = OpIMul %uint %124 %uint_8 - %126 = OpIAdd %uint %125 %uint_8 - %127 = OpULessThanEqual %bool %126 %122 - %128 = OpSelect %uint %127 %uint_0 %uint_0 - %129 = OpSelect %uint %127 %uint_16 %uint_1 - %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %131 = OpAccessChain %_ptr_StorageBuffer_v3float %130 %128 - %m2 = OpCooperativeMatrixLoadKHR %67 %131 %uint_1 %129 None + %49 = OpIMul %uint %uint_16 %uint_7 + %52 = OpIAdd %uint %uint_0 %49 + %53 = OpIAdd %uint %52 %uint_4 + %55 = OpULessThanEqual %bool %53 %48 + %57 = OpSelect %uint %55 %uint_0 %uint_0 + %58 = OpSelect %uint %55 %uint_16 %uint_4 + %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %60 = OpAccessChain %_ptr_StorageBuffer_uint %59 %57 + %m0 = OpCooperativeMatrixLoadKHR %63 %60 %uint_1 %58 None + %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %70 = OpArrayLength %uint %38 0 + %71 = OpBitcast %uint %int_0 + %73 = OpBitcast %uint %int_16 + %75 = OpIMul %uint %73 %uint_7 + %76 = OpIAdd %uint %71 %75 + %77 = OpIAdd %uint %76 %uint_4 + %78 = OpULessThanEqual %bool %77 %70 + %79 = OpSelect %uint %78 %71 %uint_0 + %80 = OpSelect %uint %78 %73 %uint_4 + %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %82 = OpAccessChain %_ptr_StorageBuffer_uint_0 %81 %79 + OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %87 = OpArrayLength %uint %6 0 + %88 = OpIMul %uint %uint_16 %uint_7 + %89 = OpIAdd %uint %uint_0 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %87 + %92 = OpSelect %uint %91 %uint_0 %uint_0 + %93 = OpSelect %uint %91 %uint_16 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %92 + %m1 = OpCooperativeMatrixLoadKHR %63 %95 %uint_1 %93 None + %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %99 = OpArrayLength %uint %38 0 + %100 = OpBitcast %uint %int_0 + %101 = OpBitcast %uint %int_16 + %102 = OpIMul %uint %101 %uint_7 + %103 = OpIAdd %uint %100 %102 + %104 = OpIAdd %uint %103 %uint_4 + %105 = OpULessThanEqual %bool %104 %99 + %106 = OpSelect %uint %105 %100 %uint_0 + %107 = OpSelect %uint %105 %101 %uint_4 + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 + OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %113 = OpArrayLength %uint %12 0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %uint_0 %114 + %116 = OpIAdd %uint %115 %uint_1 + %117 = OpULessThanEqual %bool %116 %113 + %118 = OpSelect %uint %117 %uint_0 %uint_0 + %119 = OpSelect %uint %117 %uint_16 %uint_1 + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 + %m2 = OpCooperativeMatrixLoadKHR %63 %121 %uint_1 %119 None + %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %125 = OpArrayLength %uint %38 0 + %126 = OpBitcast %uint %int_0 + %127 = OpBitcast %uint %int_16 + %128 = OpIMul %uint %127 %uint_7 + %129 = OpIAdd %uint %126 %128 + %130 = OpIAdd %uint %129 %uint_4 + %131 = OpULessThanEqual %bool %130 %125 + %132 = OpSelect %uint %131 %126 %uint_0 + %133 = OpSelect %uint %131 %127 %uint_4 %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %135 = OpArrayLength %uint %38 0 - %136 = OpIMul %uint %135 %uint_2 - %137 = OpBitcast %uint %int_0 - %138 = OpBitcast %uint %int_16 - %139 = OpIMul %uint %138 %uint_7 - %140 = OpIAdd %uint %137 %139 - %141 = OpIMul %uint %140 %uint_2 - %142 = OpIAdd %uint %141 %uint_8 - %143 = OpULessThanEqual %bool %142 %136 - %144 = OpSelect %uint %143 %137 %uint_0 - %145 = OpSelect %uint %143 %138 %uint_4 - %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %147 = OpAccessChain %_ptr_StorageBuffer_uint_0 %146 %144 - OpCooperativeMatrixStoreKHR %147 %m2 %uint_1 %145 NonPrivatePointer - %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %151 = OpArrayLength %uint %18 0 - %152 = OpIMul %uint %151 %uint_8 - %153 = OpIMul %uint %uint_16 %uint_7 - %154 = OpIAdd %uint %uint_0 %153 - %155 = OpIMul %uint %154 %uint_8 - %156 = OpIAdd %uint %155 %uint_8 - %157 = OpULessThanEqual %bool %156 %152 - %158 = OpSelect %uint %157 %uint_0 %uint_0 - %159 = OpSelect %uint %157 %uint_16 %uint_1 - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %161 = OpAccessChain %_ptr_StorageBuffer_v4uint %160 %158 - %m3 = OpCooperativeMatrixLoadKHR %67 %161 %uint_1 %159 None - %164 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %165 = OpArrayLength %uint %38 0 - %166 = OpIMul %uint %165 %uint_2 - %167 = OpBitcast %uint %int_0 - %168 = OpBitcast %uint %int_16 - %169 = OpIMul %uint %168 %uint_7 - %170 = OpIAdd %uint %167 %169 - %171 = OpIMul %uint %170 %uint_2 - %172 = OpIAdd %uint %171 %uint_8 - %173 = OpULessThanEqual %bool %172 %166 - %174 = OpSelect %uint %173 %167 %uint_0 - %175 = OpSelect %uint %173 %168 %uint_4 + %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 + OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %139 = OpArrayLength %uint %18 0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %uint_0 %140 + %142 = OpIAdd %uint %141 %uint_1 + %143 = OpULessThanEqual %bool %142 %139 + %144 = OpSelect %uint %143 %uint_0 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_1 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %63 %147 %uint_1 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %151 = OpArrayLength %uint %38 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_4 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_4 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpIMul %uint %uint_16 %uint_7 + %167 = OpIAdd %uint %uint_0 %166 + %168 = OpIAdd %uint %167 %uint_8 + %169 = OpULessThanEqual %bool %168 %165 + %170 = OpSelect %uint %169 %uint_0 %uint_0 + %171 = OpSelect %uint %169 %uint_16 %uint_8 + %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %173 = OpAccessChain %_ptr_StorageBuffer_half %172 %170 + %m4 = OpCooperativeMatrixLoadKHR %63 %173 %uint_1 %171 None %176 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %177 = OpAccessChain %_ptr_StorageBuffer_uint_0 %176 %174 - OpCooperativeMatrixStoreKHR %177 %m3 %uint_1 %175 NonPrivatePointer - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %181 = OpArrayLength %uint %23 0 - %182 = OpIMul %uint %uint_16 %uint_7 - %183 = OpIAdd %uint %uint_0 %182 - %184 = OpIAdd %uint %183 %uint_8 - %185 = OpULessThanEqual %bool %184 %181 - %186 = OpSelect %uint %185 %uint_0 %uint_0 - %187 = OpSelect %uint %185 %uint_16 %uint_8 - %188 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %189 = OpAccessChain %_ptr_StorageBuffer_half %188 %186 - %m4 = OpCooperativeMatrixLoadKHR %67 %189 %uint_1 %187 None - %192 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %193 = OpArrayLength %uint %38 0 - %194 = OpIMul %uint %193 %uint_2 - %195 = OpBitcast %uint %int_0 - %196 = OpBitcast %uint %int_16 - %197 = OpIMul %uint %196 %uint_7 - %198 = OpIAdd %uint %195 %197 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpIAdd %uint %199 %uint_8 - %201 = OpULessThanEqual %bool %200 %194 - %202 = OpSelect %uint %201 %195 %uint_0 - %203 = OpSelect %uint %201 %196 %uint_4 - %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %205 = OpAccessChain %_ptr_StorageBuffer_uint_0 %204 %202 - OpCooperativeMatrixStoreKHR %205 %m4 %uint_1 %203 NonPrivatePointer - %207 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %209 = OpArrayLength %uint %28 0 - %210 = OpIMul %uint %209 %uint_2 - %211 = OpIMul %uint %uint_16 %uint_7 - %212 = OpIAdd %uint %uint_0 %211 - %213 = OpIMul %uint %212 %uint_2 - %214 = OpIAdd %uint %213 %uint_8 - %215 = OpULessThanEqual %bool %214 %210 - %216 = OpSelect %uint %215 %uint_0 %uint_0 - %217 = OpSelect %uint %215 %uint_16 %uint_4 - %218 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %219 = OpAccessChain %_ptr_StorageBuffer_v2half %218 %216 - %m5 = OpCooperativeMatrixLoadKHR %67 %219 %uint_1 %217 None - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %223 = OpArrayLength %uint %38 0 - %224 = OpIMul %uint %223 %uint_2 - %225 = OpBitcast %uint %int_0 - %226 = OpBitcast %uint %int_16 - %227 = OpIMul %uint %226 %uint_7 - %228 = OpIAdd %uint %225 %227 - %229 = OpIMul %uint %228 %uint_2 - %230 = OpIAdd %uint %229 %uint_8 - %231 = OpULessThanEqual %bool %230 %224 - %232 = OpSelect %uint %231 %225 %uint_0 - %233 = OpSelect %uint %231 %226 %uint_4 - %234 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %235 = OpAccessChain %_ptr_StorageBuffer_uint_0 %234 %232 - OpCooperativeMatrixStoreKHR %235 %m5 %uint_1 %233 NonPrivatePointer - %237 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %239 = OpArrayLength %uint %33 0 - %240 = OpIMul %uint %239 %uint_4 - %241 = OpIMul %uint %uint_16 %uint_7 - %242 = OpIAdd %uint %uint_0 %241 - %243 = OpIMul %uint %242 %uint_4 - %244 = OpIAdd %uint %243 %uint_8 - %245 = OpULessThanEqual %bool %244 %240 - %246 = OpSelect %uint %245 %uint_0 %uint_0 - %247 = OpSelect %uint %245 %uint_16 %uint_2 - %248 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %249 = OpAccessChain %_ptr_StorageBuffer_v3half %248 %246 - %m6 = OpCooperativeMatrixLoadKHR %67 %249 %uint_1 %247 None - %252 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %253 = OpArrayLength %uint %38 0 - %254 = OpIMul %uint %253 %uint_2 - %255 = OpBitcast %uint %int_0 - %256 = OpBitcast %uint %int_16 - %257 = OpIMul %uint %256 %uint_7 - %258 = OpIAdd %uint %255 %257 - %259 = OpIMul %uint %258 %uint_2 - %260 = OpIAdd %uint %259 %uint_8 - %261 = OpULessThanEqual %bool %260 %254 - %262 = OpSelect %uint %261 %255 %uint_0 - %263 = OpSelect %uint %261 %256 %uint_4 - %264 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %265 = OpAccessChain %_ptr_StorageBuffer_uint_0 %264 %262 - OpCooperativeMatrixStoreKHR %265 %m6 %uint_1 %263 NonPrivatePointer + %177 = OpArrayLength %uint %38 0 + %178 = OpBitcast %uint %int_0 + %179 = OpBitcast %uint %int_16 + %180 = OpIMul %uint %179 %uint_7 + %181 = OpIAdd %uint %178 %180 + %182 = OpIAdd %uint %181 %uint_4 + %183 = OpULessThanEqual %bool %182 %177 + %184 = OpSelect %uint %183 %178 %uint_0 + %185 = OpSelect %uint %183 %179 %uint_4 + %186 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %187 = OpAccessChain %_ptr_StorageBuffer_uint_0 %186 %184 + OpCooperativeMatrixStoreKHR %187 %m4 %uint_1 %185 NonPrivatePointer + %189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %191 = OpArrayLength %uint %28 0 + %192 = OpIMul %uint %uint_16 %uint_7 + %193 = OpIAdd %uint %uint_0 %192 + %194 = OpIAdd %uint %193 %uint_4 + %195 = OpULessThanEqual %bool %194 %191 + %196 = OpSelect %uint %195 %uint_0 %uint_0 + %197 = OpSelect %uint %195 %uint_16 %uint_4 + %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %199 = OpAccessChain %_ptr_StorageBuffer_v2half %198 %196 + %m5 = OpCooperativeMatrixLoadKHR %63 %199 %uint_1 %197 None + %202 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %203 = OpArrayLength %uint %38 0 + %204 = OpBitcast %uint %int_0 + %205 = OpBitcast %uint %int_16 + %206 = OpIMul %uint %205 %uint_7 + %207 = OpIAdd %uint %204 %206 + %208 = OpIAdd %uint %207 %uint_4 + %209 = OpULessThanEqual %bool %208 %203 + %210 = OpSelect %uint %209 %204 %uint_0 + %211 = OpSelect %uint %209 %205 %uint_4 + %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %213 = OpAccessChain %_ptr_StorageBuffer_uint_0 %212 %210 + OpCooperativeMatrixStoreKHR %213 %m5 %uint_1 %211 NonPrivatePointer + %215 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %217 = OpArrayLength %uint %33 0 + %218 = OpIMul %uint %uint_16 %uint_7 + %219 = OpIAdd %uint %uint_0 %218 + %220 = OpIAdd %uint %219 %uint_2 + %221 = OpULessThanEqual %bool %220 %217 + %222 = OpSelect %uint %221 %uint_0 %uint_0 + %223 = OpSelect %uint %221 %uint_16 %uint_2 + %224 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %225 = OpAccessChain %_ptr_StorageBuffer_v3half %224 %222 + %m6 = OpCooperativeMatrixLoadKHR %63 %225 %uint_1 %223 None + %228 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %229 = OpArrayLength %uint %38 0 + %230 = OpBitcast %uint %int_0 + %231 = OpBitcast %uint %int_16 + %232 = OpIMul %uint %231 %uint_7 + %233 = OpIAdd %uint %230 %232 + %234 = OpIAdd %uint %233 %uint_4 + %235 = OpULessThanEqual %bool %234 %229 + %236 = OpSelect %uint %235 %230 %uint_0 + %237 = OpSelect %uint %235 %231 %uint_4 + %238 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %239 = OpAccessChain %_ptr_StorageBuffer_uint_0 %238 %236 + OpCooperativeMatrixStoreKHR %239 %m6 %uint_1 %237 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl index 64ad8a5..9134610 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -14,43 +14,43 @@ void main() { uint v_1 = 0u; in0.GetDimensions(v_1); - bool v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_1 / 4u) * 2u)); + bool v_2 = (((0u + (16u * 7u)) + 4u) <= (v_1 / 4u)); Matrix_result_f16_8x8 m0 = Matrix_result_f16_8x8::Load(in0, (0u + (select(v_2, 0u, 0u) * 2u)), (select(v_2, 16u, 4u) * 2u), MatrixLayout::RowMajor); uint v_3 = 0u; v.GetDimensions(v_3); uint v_4 = asuint(int(0)); uint v_5 = asuint(int(16)); - bool v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= ((v_3 / 4u) * 2u)); + bool v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= (v_3 / 4u)); m0.Store(v, (0u + (select(v_6, v_4, 0u) * 2u)), (select(v_6, v_5, 4u) * 2u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_7 / 8u) * 4u)); + bool v_8 = (((0u + (16u * 7u)) + 2u) <= (v_7 / 8u)); Matrix_result_f16_8x8 m1 = Matrix_result_f16_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 2u)), (select(v_8, 16u, 2u) * 2u), MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 2u) + 8u) <= ((v_9 / 4u) * 2u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 4u) <= (v_9 / 4u)); m1.Store(v, (0u + (select(v_12, v_10, 0u) * 2u)), (select(v_12, v_11, 4u) * 2u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_13 / 16u) * 8u)); + bool v_14 = (((0u + (16u * 7u)) + 1u) <= (v_13 / 16u)); Matrix_result_f16_8x8 m2 = Matrix_result_f16_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 2u)), (select(v_14, 16u, 1u) * 2u), MatrixLayout::RowMajor); uint v_15 = 0u; v.GetDimensions(v_15); uint v_16 = asuint(int(0)); uint v_17 = asuint(int(16)); - bool v_18 = ((((v_16 + (v_17 * 7u)) * 2u) + 8u) <= ((v_15 / 4u) * 2u)); + bool v_18 = (((v_16 + (v_17 * 7u)) + 4u) <= (v_15 / 4u)); m2.Store(v, (0u + (select(v_18, v_16, 0u) * 2u)), (select(v_18, v_17, 4u) * 2u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_19 / 16u) * 8u)); + bool v_20 = (((0u + (16u * 7u)) + 1u) <= (v_19 / 16u)); Matrix_result_f16_8x8 m3 = Matrix_result_f16_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 2u)), (select(v_20, 16u, 1u) * 2u), MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 2u) + 8u) <= ((v_21 / 4u) * 2u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 4u) <= (v_21 / 4u)); m3.Store(v, (0u + (select(v_24, v_22, 0u) * 2u)), (select(v_24, v_23, 4u) * 2u), MatrixLayout::ColMajor); uint v_25 = 0u; in4.GetDimensions(v_25); @@ -60,27 +60,27 @@ v.GetDimensions(v_27); uint v_28 = asuint(int(0)); uint v_29 = asuint(int(16)); - bool v_30 = ((((v_28 + (v_29 * 7u)) * 2u) + 8u) <= ((v_27 / 4u) * 2u)); + bool v_30 = (((v_28 + (v_29 * 7u)) + 4u) <= (v_27 / 4u)); m4.Store(v, (0u + (select(v_30, v_28, 0u) * 2u)), (select(v_30, v_29, 4u) * 2u), MatrixLayout::ColMajor); uint v_31 = 0u; in5.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_31 / 4u) * 2u)); + bool v_32 = (((0u + (16u * 7u)) + 4u) <= (v_31 / 4u)); Matrix_result_f16_8x8 m5 = Matrix_result_f16_8x8::Load(in5, (0u + (select(v_32, 0u, 0u) * 2u)), (select(v_32, 16u, 4u) * 2u), MatrixLayout::RowMajor); uint v_33 = 0u; v.GetDimensions(v_33); uint v_34 = asuint(int(0)); uint v_35 = asuint(int(16)); - bool v_36 = ((((v_34 + (v_35 * 7u)) * 2u) + 8u) <= ((v_33 / 4u) * 2u)); + bool v_36 = (((v_34 + (v_35 * 7u)) + 4u) <= (v_33 / 4u)); m5.Store(v, (0u + (select(v_36, v_34, 0u) * 2u)), (select(v_36, v_35, 4u) * 2u), MatrixLayout::ColMajor); uint v_37 = 0u; in6.GetDimensions(v_37); - bool v_38 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_37 / 8u) * 4u)); + bool v_38 = (((0u + (16u * 7u)) + 2u) <= (v_37 / 8u)); Matrix_result_f16_8x8 m6 = Matrix_result_f16_8x8::Load(in6, (0u + (select(v_38, 0u, 0u) * 2u)), (select(v_38, 16u, 2u) * 2u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 2u) + 8u) <= ((v_39 / 4u) * 2u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 4u) <= (v_39 / 4u)); m6.Store(v, (0u + (select(v_42, v_40, 0u) * 2u)), (select(v_42, v_41, 4u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_row_major.wgsl.expected.msl index bfaa1f1..10db296 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_row_major.wgsl.expected.msl
@@ -50,37 +50,37 @@ kernel void v(const device tint_array<uint, 1>* in0 [[buffer(0)]], const device tint_array<int2, 1>* in1 [[buffer(1)]], const device tint_array<tint_packed_vec3_f32_array_element, 1>* in2 [[buffer(2)]], const device tint_array<uint4, 1>* in3 [[buffer(3)]], const device tint_array<half, 1>* in4 [[buffer(4)]], const device tint_array<half2, 1>* in5 [[buffer(5)]], const device tint_array<tint_packed_vec3_f16_array_element, 1>* in6 [[buffer(6)]], device tint_array<uint, 1>* out [[buffer(7)]], const constant tint_array<uint4, 2>* tint_storage_buffer_sizes [[buffer(30)]]) { tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.in0=in0, .in1=in1, .in2=in2, .in3=in3, .in4=in4, .in5=in5, .in6=in6, .out=out, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; tint_array_lengths_struct const v_1 = tint_array_lengths_struct{.tint_array_length_0_0=((*tint_module_vars.tint_storage_buffer_sizes)[0u].x / 4u), .tint_array_length_0_7=((*tint_module_vars.tint_storage_buffer_sizes)[1u].w / 4u), .tint_array_length_0_1=((*tint_module_vars.tint_storage_buffer_sizes)[0u].y / 8u), .tint_array_length_0_2=((*tint_module_vars.tint_storage_buffer_sizes)[0u].z / 16u), .tint_array_length_0_3=((*tint_module_vars.tint_storage_buffer_sizes)[0u].w / 16u), .tint_array_length_0_4=((*tint_module_vars.tint_storage_buffer_sizes)[1u].x / 2u), .tint_array_length_0_5=((*tint_module_vars.tint_storage_buffer_sizes)[1u].y / 4u), .tint_array_length_0_6=((*tint_module_vars.tint_storage_buffer_sizes)[1u].z / 8u)}; - bool const v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_0 * 2u)); + bool const v_2 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_0); simdgroup_half8x8 v_3 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_3, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in0) + (select(0u, 0u, v_2) * 4u)), ulong((select(4u, 16u, v_2) * 2u)), ulong2(0ul), false)); simdgroup_half8x8 const m0 = v_3; uint const v_4 = as_type<uint>(0); uint const v_5 = as_type<uint>(16); - bool const v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_4, v_6) * 4u)), ulong((select(4u, v_5, v_6) * 2u)), ulong2(0ul), true)); - bool const v_7 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_1 * 4u)); + bool const v_7 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_1); simdgroup_half8x8 v_8 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_8, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (select(0u, 0u, v_7) * 8u)), ulong((select(2u, 16u, v_7) * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m1 = v_8; uint const v_9 = as_type<uint>(0); uint const v_10 = as_type<uint>(16); - bool const v_11 = ((((v_9 + (v_10 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_11 = (((v_9 + (v_10 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_9, v_11) * 4u)), ulong((select(4u, v_10, v_11) * 2u)), ulong2(0ul), true)); - bool const v_12 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_2 * 8u)); + bool const v_12 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_2); simdgroup_half8x8 v_13 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_13, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (select(0u, 0u, v_12) * 16u)), ulong((select(1u, 16u, v_12) * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m2 = v_13; uint const v_14 = as_type<uint>(0); uint const v_15 = as_type<uint>(16); - bool const v_16 = ((((v_14 + (v_15 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_16 = (((v_14 + (v_15 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_14, v_16) * 4u)), ulong((select(4u, v_15, v_16) * 2u)), ulong2(0ul), true)); - bool const v_17 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_3 * 8u)); + bool const v_17 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_3); simdgroup_half8x8 v_18 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_18, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (select(0u, 0u, v_17) * 16u)), ulong((select(1u, 16u, v_17) * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m3 = v_18; uint const v_19 = as_type<uint>(0); uint const v_20 = as_type<uint>(16); - bool const v_21 = ((((v_19 + (v_20 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_21 = (((v_19 + (v_20 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_19, v_21) * 4u)), ulong((select(4u, v_20, v_21) * 2u)), ulong2(0ul), true)); bool const v_22 = (((0u + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); simdgroup_half8x8 v_23 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); @@ -88,22 +88,22 @@ simdgroup_half8x8 const m4 = v_23; uint const v_24 = as_type<uint>(0); uint const v_25 = as_type<uint>(16); - bool const v_26 = ((((v_24 + (v_25 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_26 = (((v_24 + (v_25 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_24, v_26) * 4u)), ulong((select(4u, v_25, v_26) * 2u)), ulong2(0ul), true)); - bool const v_27 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_27 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); simdgroup_half8x8 v_28 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_28, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in5) + (select(0u, 0u, v_27) * 4u)), ulong((select(4u, 16u, v_27) * 2u)), ulong2(0ul), false)); simdgroup_half8x8 const m5 = v_28; uint const v_29 = as_type<uint>(0); uint const v_30 = as_type<uint>(16); - bool const v_31 = ((((v_29 + (v_30 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_31 = (((v_29 + (v_30 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_29, v_31) * 4u)), ulong((select(4u, v_30, v_31) * 2u)), ulong2(0ul), true)); - bool const v_32 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_6 * 4u)); + bool const v_32 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_6); simdgroup_half8x8 v_33 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_33, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (select(0u, 0u, v_32) * 8u)), ulong((select(2u, 16u, v_32) * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m6 = v_33; uint const v_34 = as_type<uint>(0); uint const v_35 = as_type<uint>(16); - bool const v_36 = ((((v_34 + (v_35 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_36 = (((v_34 + (v_35 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_34, v_36) * 4u)), ulong((select(4u, v_35, v_36) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_row_major.wgsl.expected.spvasm index 86e55c4..6d18c4a 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 267 +; Bound: 241 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,15 +128,15 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_2 = OpConstant %uint 2 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 - %67 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_2 + %uint_8 = OpConstant %uint 8 + %uint_2 = OpConstant %uint 2 + %63 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_2 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 @@ -158,197 +158,171 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_2 - %51 = OpIMul %uint %uint_16 %uint_7 - %54 = OpIAdd %uint %uint_0 %51 - %55 = OpIMul %uint %54 %uint_2 - %56 = OpIAdd %uint %55 %uint_8 - %58 = OpULessThanEqual %bool %56 %49 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_4 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - %m0 = OpCooperativeMatrixLoadKHR %67 %64 %uint_0 %61 None - %69 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %71 = OpArrayLength %uint %38 0 - %72 = OpIMul %uint %71 %uint_2 - %73 = OpBitcast %uint %int_0 - %75 = OpBitcast %uint %int_16 - %77 = OpIMul %uint %75 %uint_7 - %78 = OpIAdd %uint %73 %77 - %79 = OpIMul %uint %78 %uint_2 - %80 = OpIAdd %uint %79 %uint_8 - %81 = OpULessThanEqual %bool %80 %72 - %82 = OpSelect %uint %81 %73 %uint_0 - %83 = OpSelect %uint %81 %75 %uint_4 - %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %85 = OpAccessChain %_ptr_StorageBuffer_uint_0 %84 %82 - OpCooperativeMatrixStoreKHR %85 %m0 %uint_1 %83 NonPrivatePointer - %89 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %91 = OpArrayLength %uint %6 0 - %92 = OpIMul %uint %91 %uint_4 - %93 = OpIMul %uint %uint_16 %uint_7 - %94 = OpIAdd %uint %uint_0 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %92 - %98 = OpSelect %uint %97 %uint_0 %uint_0 - %99 = OpSelect %uint %97 %uint_16 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_v2int %100 %98 - %m1 = OpCooperativeMatrixLoadKHR %67 %101 %uint_0 %99 None - %104 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %105 = OpArrayLength %uint %38 0 - %106 = OpIMul %uint %105 %uint_2 - %107 = OpBitcast %uint %int_0 - %108 = OpBitcast %uint %int_16 - %109 = OpIMul %uint %108 %uint_7 - %110 = OpIAdd %uint %107 %109 - %111 = OpIMul %uint %110 %uint_2 - %112 = OpIAdd %uint %111 %uint_8 - %113 = OpULessThanEqual %bool %112 %106 - %114 = OpSelect %uint %113 %107 %uint_0 - %115 = OpSelect %uint %113 %108 %uint_4 - %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %117 = OpAccessChain %_ptr_StorageBuffer_uint_0 %116 %114 - OpCooperativeMatrixStoreKHR %117 %m1 %uint_1 %115 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %121 = OpArrayLength %uint %12 0 - %122 = OpIMul %uint %121 %uint_8 - %123 = OpIMul %uint %uint_16 %uint_7 - %124 = OpIAdd %uint %uint_0 %123 - %125 = OpIMul %uint %124 %uint_8 - %126 = OpIAdd %uint %125 %uint_8 - %127 = OpULessThanEqual %bool %126 %122 - %128 = OpSelect %uint %127 %uint_0 %uint_0 - %129 = OpSelect %uint %127 %uint_16 %uint_1 - %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %131 = OpAccessChain %_ptr_StorageBuffer_v3float %130 %128 - %m2 = OpCooperativeMatrixLoadKHR %67 %131 %uint_0 %129 None + %49 = OpIMul %uint %uint_16 %uint_7 + %52 = OpIAdd %uint %uint_0 %49 + %53 = OpIAdd %uint %52 %uint_4 + %55 = OpULessThanEqual %bool %53 %48 + %57 = OpSelect %uint %55 %uint_0 %uint_0 + %58 = OpSelect %uint %55 %uint_16 %uint_4 + %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %60 = OpAccessChain %_ptr_StorageBuffer_uint %59 %57 + %m0 = OpCooperativeMatrixLoadKHR %63 %60 %uint_0 %58 None + %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %69 = OpArrayLength %uint %38 0 + %70 = OpBitcast %uint %int_0 + %72 = OpBitcast %uint %int_16 + %74 = OpIMul %uint %72 %uint_7 + %75 = OpIAdd %uint %70 %74 + %76 = OpIAdd %uint %75 %uint_4 + %77 = OpULessThanEqual %bool %76 %69 + %78 = OpSelect %uint %77 %70 %uint_0 + %79 = OpSelect %uint %77 %72 %uint_4 + %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_uint_0 %80 %78 + OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %79 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %87 = OpArrayLength %uint %6 0 + %88 = OpIMul %uint %uint_16 %uint_7 + %89 = OpIAdd %uint %uint_0 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %87 + %92 = OpSelect %uint %91 %uint_0 %uint_0 + %93 = OpSelect %uint %91 %uint_16 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %92 + %m1 = OpCooperativeMatrixLoadKHR %63 %95 %uint_0 %93 None + %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %99 = OpArrayLength %uint %38 0 + %100 = OpBitcast %uint %int_0 + %101 = OpBitcast %uint %int_16 + %102 = OpIMul %uint %101 %uint_7 + %103 = OpIAdd %uint %100 %102 + %104 = OpIAdd %uint %103 %uint_4 + %105 = OpULessThanEqual %bool %104 %99 + %106 = OpSelect %uint %105 %100 %uint_0 + %107 = OpSelect %uint %105 %101 %uint_4 + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 + OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %113 = OpArrayLength %uint %12 0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %uint_0 %114 + %116 = OpIAdd %uint %115 %uint_1 + %117 = OpULessThanEqual %bool %116 %113 + %118 = OpSelect %uint %117 %uint_0 %uint_0 + %119 = OpSelect %uint %117 %uint_16 %uint_1 + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 + %m2 = OpCooperativeMatrixLoadKHR %63 %121 %uint_0 %119 None + %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %125 = OpArrayLength %uint %38 0 + %126 = OpBitcast %uint %int_0 + %127 = OpBitcast %uint %int_16 + %128 = OpIMul %uint %127 %uint_7 + %129 = OpIAdd %uint %126 %128 + %130 = OpIAdd %uint %129 %uint_4 + %131 = OpULessThanEqual %bool %130 %125 + %132 = OpSelect %uint %131 %126 %uint_0 + %133 = OpSelect %uint %131 %127 %uint_4 %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %135 = OpArrayLength %uint %38 0 - %136 = OpIMul %uint %135 %uint_2 - %137 = OpBitcast %uint %int_0 - %138 = OpBitcast %uint %int_16 - %139 = OpIMul %uint %138 %uint_7 - %140 = OpIAdd %uint %137 %139 - %141 = OpIMul %uint %140 %uint_2 - %142 = OpIAdd %uint %141 %uint_8 - %143 = OpULessThanEqual %bool %142 %136 - %144 = OpSelect %uint %143 %137 %uint_0 - %145 = OpSelect %uint %143 %138 %uint_4 - %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %147 = OpAccessChain %_ptr_StorageBuffer_uint_0 %146 %144 - OpCooperativeMatrixStoreKHR %147 %m2 %uint_1 %145 NonPrivatePointer - %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %151 = OpArrayLength %uint %18 0 - %152 = OpIMul %uint %151 %uint_8 - %153 = OpIMul %uint %uint_16 %uint_7 - %154 = OpIAdd %uint %uint_0 %153 - %155 = OpIMul %uint %154 %uint_8 - %156 = OpIAdd %uint %155 %uint_8 - %157 = OpULessThanEqual %bool %156 %152 - %158 = OpSelect %uint %157 %uint_0 %uint_0 - %159 = OpSelect %uint %157 %uint_16 %uint_1 - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %161 = OpAccessChain %_ptr_StorageBuffer_v4uint %160 %158 - %m3 = OpCooperativeMatrixLoadKHR %67 %161 %uint_0 %159 None - %164 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %165 = OpArrayLength %uint %38 0 - %166 = OpIMul %uint %165 %uint_2 - %167 = OpBitcast %uint %int_0 - %168 = OpBitcast %uint %int_16 - %169 = OpIMul %uint %168 %uint_7 - %170 = OpIAdd %uint %167 %169 - %171 = OpIMul %uint %170 %uint_2 - %172 = OpIAdd %uint %171 %uint_8 - %173 = OpULessThanEqual %bool %172 %166 - %174 = OpSelect %uint %173 %167 %uint_0 - %175 = OpSelect %uint %173 %168 %uint_4 + %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 + OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %139 = OpArrayLength %uint %18 0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %uint_0 %140 + %142 = OpIAdd %uint %141 %uint_1 + %143 = OpULessThanEqual %bool %142 %139 + %144 = OpSelect %uint %143 %uint_0 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_1 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %63 %147 %uint_0 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %151 = OpArrayLength %uint %38 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_4 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_4 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpIMul %uint %uint_16 %uint_7 + %167 = OpIAdd %uint %uint_0 %166 + %168 = OpIAdd %uint %167 %uint_8 + %169 = OpULessThanEqual %bool %168 %165 + %170 = OpSelect %uint %169 %uint_0 %uint_0 + %171 = OpSelect %uint %169 %uint_16 %uint_8 + %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %173 = OpAccessChain %_ptr_StorageBuffer_half %172 %170 + %m4 = OpCooperativeMatrixLoadKHR %63 %173 %uint_0 %171 None %176 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %177 = OpAccessChain %_ptr_StorageBuffer_uint_0 %176 %174 - OpCooperativeMatrixStoreKHR %177 %m3 %uint_1 %175 NonPrivatePointer - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %181 = OpArrayLength %uint %23 0 - %182 = OpIMul %uint %uint_16 %uint_7 - %183 = OpIAdd %uint %uint_0 %182 - %184 = OpIAdd %uint %183 %uint_8 - %185 = OpULessThanEqual %bool %184 %181 - %186 = OpSelect %uint %185 %uint_0 %uint_0 - %187 = OpSelect %uint %185 %uint_16 %uint_8 - %188 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %189 = OpAccessChain %_ptr_StorageBuffer_half %188 %186 - %m4 = OpCooperativeMatrixLoadKHR %67 %189 %uint_0 %187 None - %192 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %193 = OpArrayLength %uint %38 0 - %194 = OpIMul %uint %193 %uint_2 - %195 = OpBitcast %uint %int_0 - %196 = OpBitcast %uint %int_16 - %197 = OpIMul %uint %196 %uint_7 - %198 = OpIAdd %uint %195 %197 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpIAdd %uint %199 %uint_8 - %201 = OpULessThanEqual %bool %200 %194 - %202 = OpSelect %uint %201 %195 %uint_0 - %203 = OpSelect %uint %201 %196 %uint_4 - %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %205 = OpAccessChain %_ptr_StorageBuffer_uint_0 %204 %202 - OpCooperativeMatrixStoreKHR %205 %m4 %uint_1 %203 NonPrivatePointer - %207 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %209 = OpArrayLength %uint %28 0 - %210 = OpIMul %uint %209 %uint_2 - %211 = OpIMul %uint %uint_16 %uint_7 - %212 = OpIAdd %uint %uint_0 %211 - %213 = OpIMul %uint %212 %uint_2 - %214 = OpIAdd %uint %213 %uint_8 - %215 = OpULessThanEqual %bool %214 %210 - %216 = OpSelect %uint %215 %uint_0 %uint_0 - %217 = OpSelect %uint %215 %uint_16 %uint_4 - %218 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %219 = OpAccessChain %_ptr_StorageBuffer_v2half %218 %216 - %m5 = OpCooperativeMatrixLoadKHR %67 %219 %uint_0 %217 None - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %223 = OpArrayLength %uint %38 0 - %224 = OpIMul %uint %223 %uint_2 - %225 = OpBitcast %uint %int_0 - %226 = OpBitcast %uint %int_16 - %227 = OpIMul %uint %226 %uint_7 - %228 = OpIAdd %uint %225 %227 - %229 = OpIMul %uint %228 %uint_2 - %230 = OpIAdd %uint %229 %uint_8 - %231 = OpULessThanEqual %bool %230 %224 - %232 = OpSelect %uint %231 %225 %uint_0 - %233 = OpSelect %uint %231 %226 %uint_4 - %234 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %235 = OpAccessChain %_ptr_StorageBuffer_uint_0 %234 %232 - OpCooperativeMatrixStoreKHR %235 %m5 %uint_1 %233 NonPrivatePointer - %237 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %239 = OpArrayLength %uint %33 0 - %240 = OpIMul %uint %239 %uint_4 - %241 = OpIMul %uint %uint_16 %uint_7 - %242 = OpIAdd %uint %uint_0 %241 - %243 = OpIMul %uint %242 %uint_4 - %244 = OpIAdd %uint %243 %uint_8 - %245 = OpULessThanEqual %bool %244 %240 - %246 = OpSelect %uint %245 %uint_0 %uint_0 - %247 = OpSelect %uint %245 %uint_16 %uint_2 - %248 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %249 = OpAccessChain %_ptr_StorageBuffer_v3half %248 %246 - %m6 = OpCooperativeMatrixLoadKHR %67 %249 %uint_0 %247 None - %252 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %253 = OpArrayLength %uint %38 0 - %254 = OpIMul %uint %253 %uint_2 - %255 = OpBitcast %uint %int_0 - %256 = OpBitcast %uint %int_16 - %257 = OpIMul %uint %256 %uint_7 - %258 = OpIAdd %uint %255 %257 - %259 = OpIMul %uint %258 %uint_2 - %260 = OpIAdd %uint %259 %uint_8 - %261 = OpULessThanEqual %bool %260 %254 - %262 = OpSelect %uint %261 %255 %uint_0 - %263 = OpSelect %uint %261 %256 %uint_4 - %264 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %265 = OpAccessChain %_ptr_StorageBuffer_uint_0 %264 %262 - OpCooperativeMatrixStoreKHR %265 %m6 %uint_1 %263 NonPrivatePointer + %177 = OpArrayLength %uint %38 0 + %178 = OpBitcast %uint %int_0 + %179 = OpBitcast %uint %int_16 + %180 = OpIMul %uint %179 %uint_7 + %181 = OpIAdd %uint %178 %180 + %182 = OpIAdd %uint %181 %uint_4 + %183 = OpULessThanEqual %bool %182 %177 + %184 = OpSelect %uint %183 %178 %uint_0 + %185 = OpSelect %uint %183 %179 %uint_4 + %186 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %187 = OpAccessChain %_ptr_StorageBuffer_uint_0 %186 %184 + OpCooperativeMatrixStoreKHR %187 %m4 %uint_1 %185 NonPrivatePointer + %189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %191 = OpArrayLength %uint %28 0 + %192 = OpIMul %uint %uint_16 %uint_7 + %193 = OpIAdd %uint %uint_0 %192 + %194 = OpIAdd %uint %193 %uint_4 + %195 = OpULessThanEqual %bool %194 %191 + %196 = OpSelect %uint %195 %uint_0 %uint_0 + %197 = OpSelect %uint %195 %uint_16 %uint_4 + %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %199 = OpAccessChain %_ptr_StorageBuffer_v2half %198 %196 + %m5 = OpCooperativeMatrixLoadKHR %63 %199 %uint_0 %197 None + %202 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %203 = OpArrayLength %uint %38 0 + %204 = OpBitcast %uint %int_0 + %205 = OpBitcast %uint %int_16 + %206 = OpIMul %uint %205 %uint_7 + %207 = OpIAdd %uint %204 %206 + %208 = OpIAdd %uint %207 %uint_4 + %209 = OpULessThanEqual %bool %208 %203 + %210 = OpSelect %uint %209 %204 %uint_0 + %211 = OpSelect %uint %209 %205 %uint_4 + %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %213 = OpAccessChain %_ptr_StorageBuffer_uint_0 %212 %210 + OpCooperativeMatrixStoreKHR %213 %m5 %uint_1 %211 NonPrivatePointer + %215 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %217 = OpArrayLength %uint %33 0 + %218 = OpIMul %uint %uint_16 %uint_7 + %219 = OpIAdd %uint %uint_0 %218 + %220 = OpIAdd %uint %219 %uint_2 + %221 = OpULessThanEqual %bool %220 %217 + %222 = OpSelect %uint %221 %uint_0 %uint_0 + %223 = OpSelect %uint %221 %uint_16 %uint_2 + %224 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %225 = OpAccessChain %_ptr_StorageBuffer_v3half %224 %222 + %m6 = OpCooperativeMatrixLoadKHR %63 %225 %uint_0 %223 None + %228 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %229 = OpArrayLength %uint %38 0 + %230 = OpBitcast %uint %int_0 + %231 = OpBitcast %uint %int_16 + %232 = OpIMul %uint %231 %uint_7 + %233 = OpIAdd %uint %230 %232 + %234 = OpIAdd %uint %233 %uint_4 + %235 = OpULessThanEqual %bool %234 %229 + %236 = OpSelect %uint %235 %230 %uint_0 + %237 = OpSelect %uint %235 %231 %uint_4 + %238 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %239 = OpAccessChain %_ptr_StorageBuffer_uint_0 %238 %236 + OpCooperativeMatrixStoreKHR %239 %m6 %uint_1 %237 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_col_major.wgsl.expected.dxc.hlsl index 768aec6..24f02f3 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_col_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 2u) + 8u) <= ((v_1 / 4u) * 2u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 4u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 2u)), (select(v_4, v_3, 4u) * 2u), MatrixLayout::ColMajor); Matrix_result_f16_8x8 m1 = Matrix_result_f16_8x8::Load(in1, 0u, 32u, MatrixLayout::ColMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 2u) + 8u) <= ((v_5 / 4u) * 2u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 4u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 2u)), (select(v_8, v_7, 4u) * 2u), MatrixLayout::ColMajor); Matrix_result_f16_8x8 m2 = Matrix_result_f16_8x8::Load(in2, 0u, 32u, MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 2u) + 8u) <= ((v_9 / 4u) * 2u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 4u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 2u)), (select(v_12, v_11, 4u) * 2u), MatrixLayout::ColMajor); Matrix_result_f16_8x8 m3 = Matrix_result_f16_8x8::Load(in3, 0u, 32u, MatrixLayout::ColMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 2u) + 8u) <= ((v_13 / 4u) * 2u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 4u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 2u)), (select(v_16, v_15, 4u) * 2u), MatrixLayout::ColMajor); Matrix_result_f16_8x8 m4 = Matrix_result_f16_8x8::Load(in4, 0u, 32u, MatrixLayout::ColMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 2u) + 8u) <= ((v_17 / 4u) * 2u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 4u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 2u)), (select(v_20, v_19, 4u) * 2u), MatrixLayout::ColMajor); Matrix_result_f16_8x8 m5 = Matrix_result_f16_8x8::Load(in5, 0u, 32u, MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 2u) + 8u) <= ((v_21 / 4u) * 2u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 4u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 2u)), (select(v_24, v_23, 4u) * 2u), MatrixLayout::ColMajor); Matrix_result_f16_8x8 m6 = Matrix_result_f16_8x8::Load(in6, 0u, 32u, MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 2u) + 8u) <= ((v_25 / 4u) * 2u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 4u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 2u)), (select(v_28, v_27, 4u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_col_major.wgsl.expected.msl index b53e636..cc07356 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_col_major.wgsl.expected.msl
@@ -48,48 +48,48 @@ simdgroup_half8x8 const m0 = v_2; uint const v_3 = as_type<uint>(0); uint const v_4 = as_type<uint>(16); - bool const v_5 = ((((v_3 + (v_4 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_5 = (((v_3 + (v_4 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_3, v_5) * 4u)), ulong((select(4u, v_4, v_5) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_6 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_6, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (as_type<uint>(0) * 8u)), ulong((16u * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m1 = v_6; uint const v_7 = as_type<uint>(0); uint const v_8 = as_type<uint>(16); - bool const v_9 = ((((v_7 + (v_8 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_9 = (((v_7 + (v_8 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_7, v_9) * 4u)), ulong((select(4u, v_8, v_9) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_10 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_10, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (as_type<uint>(0) * 16u)), ulong((16u * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m2 = v_10; uint const v_11 = as_type<uint>(0); uint const v_12 = as_type<uint>(16); - bool const v_13 = ((((v_11 + (v_12 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_13 = (((v_11 + (v_12 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_11, v_13) * 4u)), ulong((select(4u, v_12, v_13) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_14 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_14, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (as_type<uint>(0) * 16u)), ulong((16u * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m3 = v_14; uint const v_15 = as_type<uint>(0); uint const v_16 = as_type<uint>(16); - bool const v_17 = ((((v_15 + (v_16 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_17 = (((v_15 + (v_16 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_15, v_17) * 4u)), ulong((select(4u, v_16, v_17) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_18 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_18, (&(*tint_module_vars.in4)[0]), ulong(16u), ulong2(0ul), true)); simdgroup_half8x8 const m4 = v_18; uint const v_19 = as_type<uint>(0); uint const v_20 = as_type<uint>(16); - bool const v_21 = ((((v_19 + (v_20 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_21 = (((v_19 + (v_20 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_19, v_21) * 4u)), ulong((select(4u, v_20, v_21) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_22 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_22, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in5) + (as_type<uint>(0) * 4u)), ulong((16u * 2u)), ulong2(0ul), true)); simdgroup_half8x8 const m5 = v_22; uint const v_23 = as_type<uint>(0); uint const v_24 = as_type<uint>(16); - bool const v_25 = ((((v_23 + (v_24 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_25 = (((v_23 + (v_24 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_23, v_25) * 4u)), ulong((select(4u, v_24, v_25) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_26 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_26, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (as_type<uint>(0) * 8u)), ulong((16u * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m6 = v_26; uint const v_27 = as_type<uint>(0); uint const v_28 = as_type<uint>(16); - bool const v_29 = ((((v_27 + (v_28 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_29 = (((v_27 + (v_28 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_27, v_29) * 4u)), ulong((select(4u, v_28, v_29) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_col_major.wgsl.expected.spvasm index 1fdfc07..83d95a9 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 201 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -142,8 +142,8 @@ %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -164,126 +164,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_1 %uint_16 None %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %61 = OpArrayLength %uint %39 0 - %62 = OpIMul %uint %61 %uint_2 - %63 = OpBitcast %uint %int_0 - %65 = OpBitcast %uint %int_16 - %67 = OpIMul %uint %65 %uint_7 - %69 = OpIAdd %uint %63 %67 - %70 = OpIMul %uint %69 %uint_2 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %62 - %74 = OpSelect %uint %72 %63 %uint_0 - %75 = OpSelect %uint %72 %65 %uint_4 - %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %78 = OpAccessChain %_ptr_StorageBuffer_uint_0 %77 %74 - OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %75 NonPrivatePointer - %81 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %83 = OpAccessChain %_ptr_StorageBuffer_v2int %81 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %83 %uint_1 %uint_16 None - %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %87 = OpArrayLength %uint %39 0 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpBitcast %uint %int_0 - %90 = OpBitcast %uint %int_16 - %91 = OpIMul %uint %90 %uint_7 - %92 = OpIAdd %uint %89 %91 - %93 = OpIMul %uint %92 %uint_2 - %94 = OpIAdd %uint %93 %uint_8 - %95 = OpULessThanEqual %bool %94 %88 - %96 = OpSelect %uint %95 %89 %uint_0 - %97 = OpSelect %uint %95 %90 %uint_4 - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %99 = OpAccessChain %_ptr_StorageBuffer_uint_0 %98 %96 - OpCooperativeMatrixStoreKHR %99 %m1 %uint_1 %97 NonPrivatePointer - %101 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %103 = OpAccessChain %_ptr_StorageBuffer_v3float %101 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %103 %uint_1 %uint_16 None - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %107 = OpArrayLength %uint %39 0 - %108 = OpIMul %uint %107 %uint_2 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_2 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_4 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint_0 %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v4uint %121 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %123 %uint_1 %uint_16 None - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %127 = OpArrayLength %uint %39 0 - %128 = OpIMul %uint %127 %uint_2 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %128 - %136 = OpSelect %uint %135 %129 %uint_0 - %137 = OpSelect %uint %135 %130 %uint_4 + %62 = OpBitcast %uint %int_0 + %64 = OpBitcast %uint %int_16 + %66 = OpIMul %uint %64 %uint_7 + %68 = OpIAdd %uint %62 %66 + %69 = OpIAdd %uint %68 %uint_4 + %71 = OpULessThanEqual %bool %69 %61 + %73 = OpSelect %uint %71 %62 %uint_0 + %74 = OpSelect %uint %71 %64 %uint_4 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_uint_0 %75 %73 + OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_1 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_4 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_4 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_1 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_4 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_4 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_1 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_4 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_4 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_1 %uint_16 None %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_uint_0 %138 %136 - OpCooperativeMatrixStoreKHR %139 %m3 %uint_1 %137 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %143 = OpAccessChain %_ptr_StorageBuffer_half %141 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %143 %uint_1 %uint_16 None - %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %147 = OpArrayLength %uint %39 0 - %148 = OpIMul %uint %147 %uint_2 - %149 = OpBitcast %uint %int_0 - %150 = OpBitcast %uint %int_16 - %151 = OpIMul %uint %150 %uint_7 - %152 = OpIAdd %uint %149 %151 - %153 = OpIMul %uint %152 %uint_2 - %154 = OpIAdd %uint %153 %uint_8 - %155 = OpULessThanEqual %bool %154 %148 - %156 = OpSelect %uint %155 %149 %uint_0 - %157 = OpSelect %uint %155 %150 %uint_4 - %158 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %159 = OpAccessChain %_ptr_StorageBuffer_uint_0 %158 %156 - OpCooperativeMatrixStoreKHR %159 %m4 %uint_1 %157 NonPrivatePointer - %161 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %163 = OpAccessChain %_ptr_StorageBuffer_v2half %161 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %163 %uint_1 %uint_16 None + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_4 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_4 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_1 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_4 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_4 %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %167 = OpArrayLength %uint %39 0 - %168 = OpIMul %uint %167 %uint_2 - %169 = OpBitcast %uint %int_0 - %170 = OpBitcast %uint %int_16 - %171 = OpIMul %uint %170 %uint_7 - %172 = OpIAdd %uint %169 %171 - %173 = OpIMul %uint %172 %uint_2 - %174 = OpIAdd %uint %173 %uint_8 - %175 = OpULessThanEqual %bool %174 %168 - %176 = OpSelect %uint %175 %169 %uint_0 - %177 = OpSelect %uint %175 %170 %uint_4 - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %179 = OpAccessChain %_ptr_StorageBuffer_uint_0 %178 %176 - OpCooperativeMatrixStoreKHR %179 %m5 %uint_1 %177 NonPrivatePointer - %181 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %183 = OpAccessChain %_ptr_StorageBuffer_v3half %181 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %183 %uint_1 %uint_16 None - %186 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %187 = OpArrayLength %uint %39 0 - %188 = OpIMul %uint %187 %uint_2 - %189 = OpBitcast %uint %int_0 - %190 = OpBitcast %uint %int_16 - %191 = OpIMul %uint %190 %uint_7 - %192 = OpIAdd %uint %189 %191 - %193 = OpIMul %uint %192 %uint_2 - %194 = OpIAdd %uint %193 %uint_8 - %195 = OpULessThanEqual %bool %194 %188 - %196 = OpSelect %uint %195 %189 %uint_0 - %197 = OpSelect %uint %195 %190 %uint_4 - %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %199 = OpAccessChain %_ptr_StorageBuffer_uint_0 %198 %196 - OpCooperativeMatrixStoreKHR %199 %m6 %uint_1 %197 NonPrivatePointer + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_1 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_4 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_4 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_row_major.wgsl.expected.dxc.hlsl index e379b7f..64cff9b 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_row_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 2u) + 8u) <= ((v_1 / 4u) * 2u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 4u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 2u)), (select(v_4, v_3, 4u) * 2u), MatrixLayout::ColMajor); Matrix_result_f16_8x8 m1 = Matrix_result_f16_8x8::Load(in1, 0u, 32u, MatrixLayout::RowMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 2u) + 8u) <= ((v_5 / 4u) * 2u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 4u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 2u)), (select(v_8, v_7, 4u) * 2u), MatrixLayout::ColMajor); Matrix_result_f16_8x8 m2 = Matrix_result_f16_8x8::Load(in2, 0u, 32u, MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 2u) + 8u) <= ((v_9 / 4u) * 2u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 4u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 2u)), (select(v_12, v_11, 4u) * 2u), MatrixLayout::ColMajor); Matrix_result_f16_8x8 m3 = Matrix_result_f16_8x8::Load(in3, 0u, 32u, MatrixLayout::RowMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 2u) + 8u) <= ((v_13 / 4u) * 2u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 4u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 2u)), (select(v_16, v_15, 4u) * 2u), MatrixLayout::ColMajor); Matrix_result_f16_8x8 m4 = Matrix_result_f16_8x8::Load(in4, 0u, 32u, MatrixLayout::RowMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 2u) + 8u) <= ((v_17 / 4u) * 2u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 4u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 2u)), (select(v_20, v_19, 4u) * 2u), MatrixLayout::ColMajor); Matrix_result_f16_8x8 m5 = Matrix_result_f16_8x8::Load(in5, 0u, 32u, MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 2u) + 8u) <= ((v_21 / 4u) * 2u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 4u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 2u)), (select(v_24, v_23, 4u) * 2u), MatrixLayout::ColMajor); Matrix_result_f16_8x8 m6 = Matrix_result_f16_8x8::Load(in6, 0u, 32u, MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 2u) + 8u) <= ((v_25 / 4u) * 2u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 4u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 2u)), (select(v_28, v_27, 4u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_row_major.wgsl.expected.msl index 0ed871e..731812f 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_row_major.wgsl.expected.msl
@@ -48,48 +48,48 @@ simdgroup_half8x8 const m0 = v_2; uint const v_3 = as_type<uint>(0); uint const v_4 = as_type<uint>(16); - bool const v_5 = ((((v_3 + (v_4 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_5 = (((v_3 + (v_4 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_3, v_5) * 4u)), ulong((select(4u, v_4, v_5) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_6 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_6, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (as_type<uint>(0) * 8u)), ulong((16u * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m1 = v_6; uint const v_7 = as_type<uint>(0); uint const v_8 = as_type<uint>(16); - bool const v_9 = ((((v_7 + (v_8 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_9 = (((v_7 + (v_8 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_7, v_9) * 4u)), ulong((select(4u, v_8, v_9) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_10 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_10, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (as_type<uint>(0) * 16u)), ulong((16u * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m2 = v_10; uint const v_11 = as_type<uint>(0); uint const v_12 = as_type<uint>(16); - bool const v_13 = ((((v_11 + (v_12 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_13 = (((v_11 + (v_12 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_11, v_13) * 4u)), ulong((select(4u, v_12, v_13) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_14 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_14, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (as_type<uint>(0) * 16u)), ulong((16u * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m3 = v_14; uint const v_15 = as_type<uint>(0); uint const v_16 = as_type<uint>(16); - bool const v_17 = ((((v_15 + (v_16 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_17 = (((v_15 + (v_16 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_15, v_17) * 4u)), ulong((select(4u, v_16, v_17) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_18 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_18, (&(*tint_module_vars.in4)[0]), ulong(16u), ulong2(0ul), false)); simdgroup_half8x8 const m4 = v_18; uint const v_19 = as_type<uint>(0); uint const v_20 = as_type<uint>(16); - bool const v_21 = ((((v_19 + (v_20 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_21 = (((v_19 + (v_20 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_19, v_21) * 4u)), ulong((select(4u, v_20, v_21) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_22 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_22, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in5) + (as_type<uint>(0) * 4u)), ulong((16u * 2u)), ulong2(0ul), false)); simdgroup_half8x8 const m5 = v_22; uint const v_23 = as_type<uint>(0); uint const v_24 = as_type<uint>(16); - bool const v_25 = ((((v_23 + (v_24 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_25 = (((v_23 + (v_24 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_23, v_25) * 4u)), ulong((select(4u, v_24, v_25) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_26 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_26, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (as_type<uint>(0) * 8u)), ulong((16u * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m6 = v_26; uint const v_27 = as_type<uint>(0); uint const v_28 = as_type<uint>(16); - bool const v_29 = ((((v_27 + (v_28 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_29 = (((v_27 + (v_28 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_27, v_29) * 4u)), ulong((select(4u, v_28, v_29) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_row_major.wgsl.expected.spvasm index 60b139c..6931b38 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f16_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 201 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -141,8 +141,8 @@ %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 @@ -164,126 +164,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_0 %uint_16 None %58 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %60 = OpArrayLength %uint %39 0 - %61 = OpIMul %uint %60 %uint_2 - %62 = OpBitcast %uint %int_0 - %64 = OpBitcast %uint %int_16 - %66 = OpIMul %uint %64 %uint_7 - %68 = OpIAdd %uint %62 %66 - %69 = OpIMul %uint %68 %uint_2 - %70 = OpIAdd %uint %69 %uint_8 - %71 = OpULessThanEqual %bool %70 %61 - %73 = OpSelect %uint %71 %62 %uint_0 - %74 = OpSelect %uint %71 %64 %uint_4 - %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %77 = OpAccessChain %_ptr_StorageBuffer_uint_0 %76 %73 - OpCooperativeMatrixStoreKHR %77 %m0 %uint_1 %74 NonPrivatePointer - %81 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %83 = OpAccessChain %_ptr_StorageBuffer_v2int %81 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %83 %uint_0 %uint_16 None - %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %87 = OpArrayLength %uint %39 0 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpBitcast %uint %int_0 - %90 = OpBitcast %uint %int_16 - %91 = OpIMul %uint %90 %uint_7 - %92 = OpIAdd %uint %89 %91 - %93 = OpIMul %uint %92 %uint_2 - %94 = OpIAdd %uint %93 %uint_8 - %95 = OpULessThanEqual %bool %94 %88 - %96 = OpSelect %uint %95 %89 %uint_0 - %97 = OpSelect %uint %95 %90 %uint_4 - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %99 = OpAccessChain %_ptr_StorageBuffer_uint_0 %98 %96 - OpCooperativeMatrixStoreKHR %99 %m1 %uint_1 %97 NonPrivatePointer - %101 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %103 = OpAccessChain %_ptr_StorageBuffer_v3float %101 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %103 %uint_0 %uint_16 None - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %107 = OpArrayLength %uint %39 0 - %108 = OpIMul %uint %107 %uint_2 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_2 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_4 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint_0 %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v4uint %121 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %123 %uint_0 %uint_16 None - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %127 = OpArrayLength %uint %39 0 - %128 = OpIMul %uint %127 %uint_2 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %128 - %136 = OpSelect %uint %135 %129 %uint_0 - %137 = OpSelect %uint %135 %130 %uint_4 + %61 = OpBitcast %uint %int_0 + %63 = OpBitcast %uint %int_16 + %65 = OpIMul %uint %63 %uint_7 + %67 = OpIAdd %uint %61 %65 + %68 = OpIAdd %uint %67 %uint_4 + %70 = OpULessThanEqual %bool %68 %60 + %72 = OpSelect %uint %70 %61 %uint_0 + %73 = OpSelect %uint %70 %63 %uint_4 + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %75 = OpAccessChain %_ptr_StorageBuffer_uint_0 %74 %72 + OpCooperativeMatrixStoreKHR %75 %m0 %uint_1 %73 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_0 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_4 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_4 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_0 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_4 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_4 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_0 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_4 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_4 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_0 %uint_16 None %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_uint_0 %138 %136 - OpCooperativeMatrixStoreKHR %139 %m3 %uint_1 %137 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %143 = OpAccessChain %_ptr_StorageBuffer_half %141 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %143 %uint_0 %uint_16 None - %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %147 = OpArrayLength %uint %39 0 - %148 = OpIMul %uint %147 %uint_2 - %149 = OpBitcast %uint %int_0 - %150 = OpBitcast %uint %int_16 - %151 = OpIMul %uint %150 %uint_7 - %152 = OpIAdd %uint %149 %151 - %153 = OpIMul %uint %152 %uint_2 - %154 = OpIAdd %uint %153 %uint_8 - %155 = OpULessThanEqual %bool %154 %148 - %156 = OpSelect %uint %155 %149 %uint_0 - %157 = OpSelect %uint %155 %150 %uint_4 - %158 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %159 = OpAccessChain %_ptr_StorageBuffer_uint_0 %158 %156 - OpCooperativeMatrixStoreKHR %159 %m4 %uint_1 %157 NonPrivatePointer - %161 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %163 = OpAccessChain %_ptr_StorageBuffer_v2half %161 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %163 %uint_0 %uint_16 None + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_4 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_4 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_0 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_4 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_4 %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %167 = OpArrayLength %uint %39 0 - %168 = OpIMul %uint %167 %uint_2 - %169 = OpBitcast %uint %int_0 - %170 = OpBitcast %uint %int_16 - %171 = OpIMul %uint %170 %uint_7 - %172 = OpIAdd %uint %169 %171 - %173 = OpIMul %uint %172 %uint_2 - %174 = OpIAdd %uint %173 %uint_8 - %175 = OpULessThanEqual %bool %174 %168 - %176 = OpSelect %uint %175 %169 %uint_0 - %177 = OpSelect %uint %175 %170 %uint_4 - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %179 = OpAccessChain %_ptr_StorageBuffer_uint_0 %178 %176 - OpCooperativeMatrixStoreKHR %179 %m5 %uint_1 %177 NonPrivatePointer - %181 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %183 = OpAccessChain %_ptr_StorageBuffer_v3half %181 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %183 %uint_0 %uint_16 None - %186 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %187 = OpArrayLength %uint %39 0 - %188 = OpIMul %uint %187 %uint_2 - %189 = OpBitcast %uint %int_0 - %190 = OpBitcast %uint %int_16 - %191 = OpIMul %uint %190 %uint_7 - %192 = OpIAdd %uint %189 %191 - %193 = OpIMul %uint %192 %uint_2 - %194 = OpIAdd %uint %193 %uint_8 - %195 = OpULessThanEqual %bool %194 %188 - %196 = OpSelect %uint %195 %189 %uint_0 - %197 = OpSelect %uint %195 %190 %uint_4 - %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %199 = OpAccessChain %_ptr_StorageBuffer_uint_0 %198 %196 - OpCooperativeMatrixStoreKHR %199 %m6 %uint_1 %197 NonPrivatePointer + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_0 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_4 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_4 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl index 7bc1d15..df46637 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -25,7 +25,7 @@ uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 8u) * 2u)); + bool v_10 = (((v_9 + (16u * 7u)) + 4u) <= (v_8 / 8u)); Matrix_result_f32_8x8 m1 = Matrix_result_f32_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_11 = 0u; v.GetDimensions(v_11); @@ -36,7 +36,7 @@ uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 16u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 16u)); Matrix_result_f32_8x8 m2 = Matrix_result_f32_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_18 = 0u; v.GetDimensions(v_18); @@ -47,7 +47,7 @@ uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 4u) + 8u) <= ((v_22 / 16u) * 4u)); + bool v_24 = (((v_23 + (16u * 7u)) + 2u) <= (v_22 / 16u)); Matrix_result_f32_8x8 m3 = Matrix_result_f32_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); @@ -69,7 +69,7 @@ uint v_36 = 0u; in6.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 2u) + 8u) <= ((v_36 / 8u) * 2u)); + bool v_38 = (((v_37 + (16u * 7u)) + 4u) <= (v_36 / 8u)); Matrix_result_f32_8x8 m6 = Matrix_result_f32_8x8::Load(in6, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_col_major.wgsl.expected.msl index 0eb410c..9473270 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_col_major.wgsl.expected.msl
@@ -58,7 +58,7 @@ bool const v_7 = (((v_5 + (v_6 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m0, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_5, v_7) * 4u)), ulong((select(8u, v_6, v_7) * 1u)), ulong2(0ul), true)); uint const v_8 = as_type<uint>(0); - bool const v_9 = ((((v_8 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_1 * 2u)); + bool const v_9 = (((v_8 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_1); simdgroup_float8x8 v_10 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_10, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (select(0u, v_8, v_9) * 8u)), ulong((select(4u, 16u, v_9) * 2u)), ulong2(0ul), true)); simdgroup_float8x8 const m1 = v_10; @@ -67,7 +67,7 @@ bool const v_13 = (((v_11 + (v_12 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m1, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_11, v_13) * 4u)), ulong((select(8u, v_12, v_13) * 1u)), ulong2(0ul), true)); uint const v_14 = as_type<uint>(0); - bool const v_15 = ((((v_14 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_2 * 4u)); + bool const v_15 = (((v_14 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_2); simdgroup_float8x8 v_16 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_16, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (select(0u, v_14, v_15) * 16u)), ulong((select(2u, 16u, v_15) * 4u)), ulong2(0ul), true)); simdgroup_float8x8 const m2 = v_16; @@ -76,7 +76,7 @@ bool const v_19 = (((v_17 + (v_18 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m2, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_17, v_19) * 4u)), ulong((select(8u, v_18, v_19) * 1u)), ulong2(0ul), true)); uint const v_20 = as_type<uint>(0); - bool const v_21 = ((((v_20 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_3 * 4u)); + bool const v_21 = (((v_20 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_3); simdgroup_float8x8 v_22 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_22, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (select(0u, v_20, v_21) * 16u)), ulong((select(2u, 16u, v_21) * 4u)), ulong2(0ul), true)); simdgroup_float8x8 const m3 = v_22; @@ -94,7 +94,7 @@ bool const v_31 = (((v_29 + (v_30 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m5, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_29, v_31) * 4u)), ulong((select(8u, v_30, v_31) * 1u)), ulong2(0ul), true)); uint const v_32 = as_type<uint>(0); - bool const v_33 = ((((v_32 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_33 = (((v_32 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); simdgroup_float8x8 v_34 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_34, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (select(0u, v_32, v_33) * 8u)), ulong((select(4u, 16u, v_33) * 2u)), ulong2(0ul), true)); simdgroup_float8x8 const m6 = v_34;
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_col_major.wgsl.expected.spvasm index ecaca1a..afe0aec 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 225 +; Bound: 217 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -168,136 +168,128 @@ OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %76 NonPrivatePointer %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %83 = OpArrayLength %uint %6 0 - %84 = OpIMul %uint %83 %uint_2 - %85 = OpBitcast %uint %int_0 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %85 %86 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %84 - %91 = OpSelect %uint %90 %85 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_4 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %91 - %m1 = OpCooperativeMatrixLoadKHR %61 %95 %uint_1 %92 None - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %99 = OpArrayLength %uint %34 0 - %100 = OpBitcast %uint %int_0 - %101 = OpBitcast %uint %int_16 - %102 = OpIMul %uint %101 %uint_7 - %103 = OpIAdd %uint %100 %102 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %101 %uint_8 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 - OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %113 = OpArrayLength %uint %12 0 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIMul %uint %117 %uint_4 - %119 = OpIAdd %uint %118 %uint_8 - %120 = OpULessThanEqual %bool %119 %114 - %121 = OpSelect %uint %120 %115 %uint_0 - %122 = OpSelect %uint %120 %uint_16 %uint_2 - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 - %m2 = OpCooperativeMatrixLoadKHR %61 %124 %uint_1 %122 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %128 = OpArrayLength %uint %34 0 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %130 %uint_8 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 - OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %142 = OpArrayLength %uint %18 0 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpBitcast %uint %int_0 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %144 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %143 - %150 = OpSelect %uint %149 %144 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v4uint %152 %150 - %m3 = OpCooperativeMatrixLoadKHR %61 %153 %uint_1 %151 None - %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %157 = OpArrayLength %uint %34 0 - %158 = OpBitcast %uint %int_0 - %159 = OpBitcast %uint %int_16 - %160 = OpIMul %uint %159 %uint_7 - %161 = OpIAdd %uint %158 %160 - %162 = OpIAdd %uint %161 %uint_8 - %163 = OpULessThanEqual %bool %162 %157 - %164 = OpSelect %uint %163 %158 %uint_0 - %165 = OpSelect %uint %163 %159 %uint_8 - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 - OpCooperativeMatrixStoreKHR %167 %m3 %uint_1 %165 NonPrivatePointer - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %171 = OpArrayLength %uint %23 0 - %172 = OpBitcast %uint %int_0 - %173 = OpIMul %uint %uint_16 %uint_7 - %174 = OpIAdd %uint %172 %173 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %171 - %177 = OpSelect %uint %176 %172 %uint_0 - %178 = OpSelect %uint %176 %uint_16 %uint_8 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_v2half %179 %177 - %m5 = OpCooperativeMatrixLoadKHR %61 %180 %uint_1 %178 None - %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %184 = OpArrayLength %uint %34 0 - %185 = OpBitcast %uint %int_0 - %186 = OpBitcast %uint %int_16 - %187 = OpIMul %uint %186 %uint_7 - %188 = OpIAdd %uint %185 %187 - %189 = OpIAdd %uint %188 %uint_8 - %190 = OpULessThanEqual %bool %189 %184 - %191 = OpSelect %uint %190 %185 %uint_0 - %192 = OpSelect %uint %190 %186 %uint_8 - %193 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %194 = OpAccessChain %_ptr_StorageBuffer_uint_0 %193 %191 - OpCooperativeMatrixStoreKHR %194 %m5 %uint_1 %192 NonPrivatePointer - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %198 = OpArrayLength %uint %29 0 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpBitcast %uint %int_0 - %201 = OpIMul %uint %uint_16 %uint_7 - %202 = OpIAdd %uint %200 %201 - %203 = OpIMul %uint %202 %uint_2 - %204 = OpIAdd %uint %203 %uint_8 - %205 = OpULessThanEqual %bool %204 %199 - %206 = OpSelect %uint %205 %200 %uint_0 - %207 = OpSelect %uint %205 %uint_16 %uint_4 - %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %209 = OpAccessChain %_ptr_StorageBuffer_v3half %208 %206 - %m6 = OpCooperativeMatrixLoadKHR %61 %209 %uint_1 %207 None - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %213 = OpArrayLength %uint %34 0 - %214 = OpBitcast %uint %int_0 - %215 = OpBitcast %uint %int_16 - %216 = OpIMul %uint %215 %uint_7 - %217 = OpIAdd %uint %214 %216 - %218 = OpIAdd %uint %217 %uint_8 - %219 = OpULessThanEqual %bool %218 %213 - %220 = OpSelect %uint %219 %214 %uint_0 - %221 = OpSelect %uint %219 %215 %uint_8 - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %223 = OpAccessChain %_ptr_StorageBuffer_uint_0 %222 %220 - OpCooperativeMatrixStoreKHR %223 %m6 %uint_1 %221 NonPrivatePointer + %84 = OpBitcast %uint %int_0 + %85 = OpIMul %uint %uint_16 %uint_7 + %86 = OpIAdd %uint %84 %85 + %87 = OpIAdd %uint %86 %uint_4 + %89 = OpULessThanEqual %bool %87 %83 + %90 = OpSelect %uint %89 %84 %uint_0 + %91 = OpSelect %uint %89 %uint_16 %uint_4 + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %93 = OpAccessChain %_ptr_StorageBuffer_v2int %92 %90 + %m1 = OpCooperativeMatrixLoadKHR %61 %93 %uint_1 %91 None + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %97 = OpArrayLength %uint %34 0 + %98 = OpBitcast %uint %int_0 + %99 = OpBitcast %uint %int_16 + %100 = OpIMul %uint %99 %uint_7 + %101 = OpIAdd %uint %98 %100 + %102 = OpIAdd %uint %101 %uint_8 + %103 = OpULessThanEqual %bool %102 %97 + %104 = OpSelect %uint %103 %98 %uint_0 + %105 = OpSelect %uint %103 %99 %uint_8 + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %107 = OpAccessChain %_ptr_StorageBuffer_uint_0 %106 %104 + OpCooperativeMatrixStoreKHR %107 %m1 %uint_1 %105 NonPrivatePointer + %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %111 = OpArrayLength %uint %12 0 + %112 = OpBitcast %uint %int_0 + %113 = OpIMul %uint %uint_16 %uint_7 + %114 = OpIAdd %uint %112 %113 + %115 = OpIAdd %uint %114 %uint_2 + %116 = OpULessThanEqual %bool %115 %111 + %117 = OpSelect %uint %116 %112 %uint_0 + %118 = OpSelect %uint %116 %uint_16 %uint_2 + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %120 = OpAccessChain %_ptr_StorageBuffer_v3float %119 %117 + %m2 = OpCooperativeMatrixLoadKHR %61 %120 %uint_1 %118 None + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %124 = OpArrayLength %uint %34 0 + %125 = OpBitcast %uint %int_0 + %126 = OpBitcast %uint %int_16 + %127 = OpIMul %uint %126 %uint_7 + %128 = OpIAdd %uint %125 %127 + %129 = OpIAdd %uint %128 %uint_8 + %130 = OpULessThanEqual %bool %129 %124 + %131 = OpSelect %uint %130 %125 %uint_0 + %132 = OpSelect %uint %130 %126 %uint_8 + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_uint_0 %133 %131 + OpCooperativeMatrixStoreKHR %134 %m2 %uint_1 %132 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %138 = OpArrayLength %uint %18 0 + %139 = OpBitcast %uint %int_0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %139 %140 + %142 = OpIAdd %uint %141 %uint_2 + %143 = OpULessThanEqual %bool %142 %138 + %144 = OpSelect %uint %143 %139 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_2 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %61 %147 %uint_1 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %151 = OpArrayLength %uint %34 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_8 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_8 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpBitcast %uint %int_0 + %167 = OpIMul %uint %uint_16 %uint_7 + %168 = OpIAdd %uint %166 %167 + %169 = OpIAdd %uint %168 %uint_8 + %170 = OpULessThanEqual %bool %169 %165 + %171 = OpSelect %uint %170 %166 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_8 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_v2half %173 %171 + %m5 = OpCooperativeMatrixLoadKHR %61 %174 %uint_1 %172 None + %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %178 = OpArrayLength %uint %34 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_8 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_8 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m5 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %192 = OpArrayLength %uint %29 0 + %193 = OpBitcast %uint %int_0 + %194 = OpIMul %uint %uint_16 %uint_7 + %195 = OpIAdd %uint %193 %194 + %196 = OpIAdd %uint %195 %uint_4 + %197 = OpULessThanEqual %bool %196 %192 + %198 = OpSelect %uint %197 %193 %uint_0 + %199 = OpSelect %uint %197 %uint_16 %uint_4 + %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %201 = OpAccessChain %_ptr_StorageBuffer_v3half %200 %198 + %m6 = OpCooperativeMatrixLoadKHR %61 %201 %uint_1 %199 None + %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %205 = OpArrayLength %uint %34 0 + %206 = OpBitcast %uint %int_0 + %207 = OpBitcast %uint %int_16 + %208 = OpIMul %uint %207 %uint_7 + %209 = OpIAdd %uint %206 %208 + %210 = OpIAdd %uint %209 %uint_8 + %211 = OpULessThanEqual %bool %210 %205 + %212 = OpSelect %uint %211 %206 %uint_0 + %213 = OpSelect %uint %211 %207 %uint_8 + %214 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %215 = OpAccessChain %_ptr_StorageBuffer_uint_0 %214 %212 + OpCooperativeMatrixStoreKHR %215 %m6 %uint_1 %213 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl index fa45764..1c996bc 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -25,7 +25,7 @@ uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 8u) * 2u)); + bool v_10 = (((v_9 + (16u * 7u)) + 4u) <= (v_8 / 8u)); Matrix_result_f32_8x8 m1 = Matrix_result_f32_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_11 = 0u; v.GetDimensions(v_11); @@ -36,7 +36,7 @@ uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 16u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 16u)); Matrix_result_f32_8x8 m2 = Matrix_result_f32_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_18 = 0u; v.GetDimensions(v_18); @@ -47,7 +47,7 @@ uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 4u) + 8u) <= ((v_22 / 16u) * 4u)); + bool v_24 = (((v_23 + (16u * 7u)) + 2u) <= (v_22 / 16u)); Matrix_result_f32_8x8 m3 = Matrix_result_f32_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); @@ -69,7 +69,7 @@ uint v_36 = 0u; in6.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 2u) + 8u) <= ((v_36 / 8u) * 2u)); + bool v_38 = (((v_37 + (16u * 7u)) + 4u) <= (v_36 / 8u)); Matrix_result_f32_8x8 m6 = Matrix_result_f32_8x8::Load(in6, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_row_major.wgsl.expected.msl index 1a0d25f..9935840 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_row_major.wgsl.expected.msl
@@ -58,7 +58,7 @@ bool const v_7 = (((v_5 + (v_6 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m0, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_5, v_7) * 4u)), ulong((select(8u, v_6, v_7) * 1u)), ulong2(0ul), true)); uint const v_8 = as_type<uint>(0); - bool const v_9 = ((((v_8 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_1 * 2u)); + bool const v_9 = (((v_8 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_1); simdgroup_float8x8 v_10 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_10, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (select(0u, v_8, v_9) * 8u)), ulong((select(4u, 16u, v_9) * 2u)), ulong2(0ul), false)); simdgroup_float8x8 const m1 = v_10; @@ -67,7 +67,7 @@ bool const v_13 = (((v_11 + (v_12 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m1, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_11, v_13) * 4u)), ulong((select(8u, v_12, v_13) * 1u)), ulong2(0ul), true)); uint const v_14 = as_type<uint>(0); - bool const v_15 = ((((v_14 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_2 * 4u)); + bool const v_15 = (((v_14 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_2); simdgroup_float8x8 v_16 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_16, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (select(0u, v_14, v_15) * 16u)), ulong((select(2u, 16u, v_15) * 4u)), ulong2(0ul), false)); simdgroup_float8x8 const m2 = v_16; @@ -76,7 +76,7 @@ bool const v_19 = (((v_17 + (v_18 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m2, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_17, v_19) * 4u)), ulong((select(8u, v_18, v_19) * 1u)), ulong2(0ul), true)); uint const v_20 = as_type<uint>(0); - bool const v_21 = ((((v_20 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_3 * 4u)); + bool const v_21 = (((v_20 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_3); simdgroup_float8x8 v_22 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_22, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (select(0u, v_20, v_21) * 16u)), ulong((select(2u, 16u, v_21) * 4u)), ulong2(0ul), false)); simdgroup_float8x8 const m3 = v_22; @@ -94,7 +94,7 @@ bool const v_31 = (((v_29 + (v_30 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m5, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_29, v_31) * 4u)), ulong((select(8u, v_30, v_31) * 1u)), ulong2(0ul), true)); uint const v_32 = as_type<uint>(0); - bool const v_33 = ((((v_32 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_33 = (((v_32 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); simdgroup_float8x8 v_34 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_34, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (select(0u, v_32, v_33) * 8u)), ulong((select(4u, 16u, v_33) * 2u)), ulong2(0ul), false)); simdgroup_float8x8 const m6 = v_34;
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_row_major.wgsl.expected.spvasm index 97ad075..c6c5f89 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_f32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 225 +; Bound: 217 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -168,136 +168,128 @@ OpCooperativeMatrixStoreKHR %77 %m0 %uint_1 %75 NonPrivatePointer %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %83 = OpArrayLength %uint %6 0 - %84 = OpIMul %uint %83 %uint_2 - %85 = OpBitcast %uint %int_0 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %85 %86 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %84 - %91 = OpSelect %uint %90 %85 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_4 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %91 - %m1 = OpCooperativeMatrixLoadKHR %61 %95 %uint_0 %92 None - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %99 = OpArrayLength %uint %34 0 - %100 = OpBitcast %uint %int_0 - %101 = OpBitcast %uint %int_16 - %102 = OpIMul %uint %101 %uint_7 - %103 = OpIAdd %uint %100 %102 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %101 %uint_8 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 - OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %113 = OpArrayLength %uint %12 0 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIMul %uint %117 %uint_4 - %119 = OpIAdd %uint %118 %uint_8 - %120 = OpULessThanEqual %bool %119 %114 - %121 = OpSelect %uint %120 %115 %uint_0 - %122 = OpSelect %uint %120 %uint_16 %uint_2 - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 - %m2 = OpCooperativeMatrixLoadKHR %61 %124 %uint_0 %122 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %128 = OpArrayLength %uint %34 0 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %130 %uint_8 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 - OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %142 = OpArrayLength %uint %18 0 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpBitcast %uint %int_0 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %144 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %143 - %150 = OpSelect %uint %149 %144 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v4uint %152 %150 - %m3 = OpCooperativeMatrixLoadKHR %61 %153 %uint_0 %151 None - %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %157 = OpArrayLength %uint %34 0 - %158 = OpBitcast %uint %int_0 - %159 = OpBitcast %uint %int_16 - %160 = OpIMul %uint %159 %uint_7 - %161 = OpIAdd %uint %158 %160 - %162 = OpIAdd %uint %161 %uint_8 - %163 = OpULessThanEqual %bool %162 %157 - %164 = OpSelect %uint %163 %158 %uint_0 - %165 = OpSelect %uint %163 %159 %uint_8 - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 - OpCooperativeMatrixStoreKHR %167 %m3 %uint_1 %165 NonPrivatePointer - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %171 = OpArrayLength %uint %23 0 - %172 = OpBitcast %uint %int_0 - %173 = OpIMul %uint %uint_16 %uint_7 - %174 = OpIAdd %uint %172 %173 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %171 - %177 = OpSelect %uint %176 %172 %uint_0 - %178 = OpSelect %uint %176 %uint_16 %uint_8 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_v2half %179 %177 - %m5 = OpCooperativeMatrixLoadKHR %61 %180 %uint_0 %178 None - %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %184 = OpArrayLength %uint %34 0 - %185 = OpBitcast %uint %int_0 - %186 = OpBitcast %uint %int_16 - %187 = OpIMul %uint %186 %uint_7 - %188 = OpIAdd %uint %185 %187 - %189 = OpIAdd %uint %188 %uint_8 - %190 = OpULessThanEqual %bool %189 %184 - %191 = OpSelect %uint %190 %185 %uint_0 - %192 = OpSelect %uint %190 %186 %uint_8 - %193 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %194 = OpAccessChain %_ptr_StorageBuffer_uint_0 %193 %191 - OpCooperativeMatrixStoreKHR %194 %m5 %uint_1 %192 NonPrivatePointer - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %198 = OpArrayLength %uint %29 0 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpBitcast %uint %int_0 - %201 = OpIMul %uint %uint_16 %uint_7 - %202 = OpIAdd %uint %200 %201 - %203 = OpIMul %uint %202 %uint_2 - %204 = OpIAdd %uint %203 %uint_8 - %205 = OpULessThanEqual %bool %204 %199 - %206 = OpSelect %uint %205 %200 %uint_0 - %207 = OpSelect %uint %205 %uint_16 %uint_4 - %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %209 = OpAccessChain %_ptr_StorageBuffer_v3half %208 %206 - %m6 = OpCooperativeMatrixLoadKHR %61 %209 %uint_0 %207 None - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %213 = OpArrayLength %uint %34 0 - %214 = OpBitcast %uint %int_0 - %215 = OpBitcast %uint %int_16 - %216 = OpIMul %uint %215 %uint_7 - %217 = OpIAdd %uint %214 %216 - %218 = OpIAdd %uint %217 %uint_8 - %219 = OpULessThanEqual %bool %218 %213 - %220 = OpSelect %uint %219 %214 %uint_0 - %221 = OpSelect %uint %219 %215 %uint_8 - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %223 = OpAccessChain %_ptr_StorageBuffer_uint_0 %222 %220 - OpCooperativeMatrixStoreKHR %223 %m6 %uint_1 %221 NonPrivatePointer + %84 = OpBitcast %uint %int_0 + %85 = OpIMul %uint %uint_16 %uint_7 + %86 = OpIAdd %uint %84 %85 + %87 = OpIAdd %uint %86 %uint_4 + %89 = OpULessThanEqual %bool %87 %83 + %90 = OpSelect %uint %89 %84 %uint_0 + %91 = OpSelect %uint %89 %uint_16 %uint_4 + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %93 = OpAccessChain %_ptr_StorageBuffer_v2int %92 %90 + %m1 = OpCooperativeMatrixLoadKHR %61 %93 %uint_0 %91 None + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %97 = OpArrayLength %uint %34 0 + %98 = OpBitcast %uint %int_0 + %99 = OpBitcast %uint %int_16 + %100 = OpIMul %uint %99 %uint_7 + %101 = OpIAdd %uint %98 %100 + %102 = OpIAdd %uint %101 %uint_8 + %103 = OpULessThanEqual %bool %102 %97 + %104 = OpSelect %uint %103 %98 %uint_0 + %105 = OpSelect %uint %103 %99 %uint_8 + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %107 = OpAccessChain %_ptr_StorageBuffer_uint_0 %106 %104 + OpCooperativeMatrixStoreKHR %107 %m1 %uint_1 %105 NonPrivatePointer + %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %111 = OpArrayLength %uint %12 0 + %112 = OpBitcast %uint %int_0 + %113 = OpIMul %uint %uint_16 %uint_7 + %114 = OpIAdd %uint %112 %113 + %115 = OpIAdd %uint %114 %uint_2 + %116 = OpULessThanEqual %bool %115 %111 + %117 = OpSelect %uint %116 %112 %uint_0 + %118 = OpSelect %uint %116 %uint_16 %uint_2 + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %120 = OpAccessChain %_ptr_StorageBuffer_v3float %119 %117 + %m2 = OpCooperativeMatrixLoadKHR %61 %120 %uint_0 %118 None + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %124 = OpArrayLength %uint %34 0 + %125 = OpBitcast %uint %int_0 + %126 = OpBitcast %uint %int_16 + %127 = OpIMul %uint %126 %uint_7 + %128 = OpIAdd %uint %125 %127 + %129 = OpIAdd %uint %128 %uint_8 + %130 = OpULessThanEqual %bool %129 %124 + %131 = OpSelect %uint %130 %125 %uint_0 + %132 = OpSelect %uint %130 %126 %uint_8 + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_uint_0 %133 %131 + OpCooperativeMatrixStoreKHR %134 %m2 %uint_1 %132 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %138 = OpArrayLength %uint %18 0 + %139 = OpBitcast %uint %int_0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %139 %140 + %142 = OpIAdd %uint %141 %uint_2 + %143 = OpULessThanEqual %bool %142 %138 + %144 = OpSelect %uint %143 %139 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_2 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %61 %147 %uint_0 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %151 = OpArrayLength %uint %34 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_8 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_8 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpBitcast %uint %int_0 + %167 = OpIMul %uint %uint_16 %uint_7 + %168 = OpIAdd %uint %166 %167 + %169 = OpIAdd %uint %168 %uint_8 + %170 = OpULessThanEqual %bool %169 %165 + %171 = OpSelect %uint %170 %166 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_8 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_v2half %173 %171 + %m5 = OpCooperativeMatrixLoadKHR %61 %174 %uint_0 %172 None + %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %178 = OpArrayLength %uint %34 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_8 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_8 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m5 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %192 = OpArrayLength %uint %29 0 + %193 = OpBitcast %uint %int_0 + %194 = OpIMul %uint %uint_16 %uint_7 + %195 = OpIAdd %uint %193 %194 + %196 = OpIAdd %uint %195 %uint_4 + %197 = OpULessThanEqual %bool %196 %192 + %198 = OpSelect %uint %197 %193 %uint_0 + %199 = OpSelect %uint %197 %uint_16 %uint_4 + %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %201 = OpAccessChain %_ptr_StorageBuffer_v3half %200 %198 + %m6 = OpCooperativeMatrixLoadKHR %61 %201 %uint_0 %199 None + %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %205 = OpArrayLength %uint %34 0 + %206 = OpBitcast %uint %int_0 + %207 = OpBitcast %uint %int_16 + %208 = OpIMul %uint %207 %uint_7 + %209 = OpIAdd %uint %206 %208 + %210 = OpIAdd %uint %209 %uint_8 + %211 = OpULessThanEqual %bool %210 %205 + %212 = OpSelect %uint %211 %206 %uint_0 + %213 = OpSelect %uint %211 %207 %uint_8 + %214 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %215 = OpAccessChain %_ptr_StorageBuffer_uint_0 %214 %212 + OpCooperativeMatrixStoreKHR %215 %m6 %uint_1 %213 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl index 7bbc363..976ca3d 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -23,7 +23,7 @@ m0.Store(v, (0u + (select(v_6, v_4, 0u) * 4u)), (select(v_6, v_5, 8u) * 4u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_7 / 8u) * 2u)); + bool v_8 = (((0u + (16u * 7u)) + 4u) <= (v_7 / 8u)); Matrix_result_i32_8x8 m1 = Matrix_result_i32_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 4u)), (select(v_8, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); @@ -33,7 +33,7 @@ m1.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 8u) * 4u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_13 / 16u) * 4u)); + bool v_14 = (((0u + (16u * 7u)) + 2u) <= (v_13 / 16u)); Matrix_result_i32_8x8 m2 = Matrix_result_i32_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 4u)), (select(v_14, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; v.GetDimensions(v_15); @@ -43,7 +43,7 @@ m2.Store(v, (0u + (select(v_18, v_16, 0u) * 4u)), (select(v_18, v_17, 8u) * 4u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_19 / 16u) * 4u)); + bool v_20 = (((0u + (16u * 7u)) + 2u) <= (v_19 / 16u)); Matrix_result_i32_8x8 m3 = Matrix_result_i32_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 4u)), (select(v_20, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); @@ -63,7 +63,7 @@ m5.Store(v, (0u + (select(v_30, v_28, 0u) * 4u)), (select(v_30, v_29, 8u) * 4u), MatrixLayout::ColMajor); uint v_31 = 0u; in6.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_31 / 8u) * 2u)); + bool v_32 = (((0u + (16u * 7u)) + 4u) <= (v_31 / 8u)); Matrix_result_i32_8x8 m6 = Matrix_result_i32_8x8::Load(in6, (0u + (select(v_32, 0u, 0u) * 4u)), (select(v_32, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_33 = 0u; v.GetDimensions(v_33);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_col_major.wgsl.expected.spvasm index 775af82..fbdc3bb 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 219 +; Bound: 211 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -167,131 +167,123 @@ OpCooperativeMatrixStoreKHR %77 %m0 %uint_1 %75 NonPrivatePointer %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %82 = OpArrayLength %uint %6 0 - %83 = OpIMul %uint %82 %uint_2 - %84 = OpIMul %uint %uint_16 %uint_7 - %85 = OpIAdd %uint %uint_0 %84 - %86 = OpIMul %uint %85 %uint_2 - %87 = OpIAdd %uint %86 %uint_8 - %88 = OpULessThanEqual %bool %87 %83 - %89 = OpSelect %uint %88 %uint_0 %uint_0 - %90 = OpSelect %uint %88 %uint_16 %uint_4 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v2int %92 %89 - %m1 = OpCooperativeMatrixLoadKHR %59 %93 %uint_1 %90 None - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %97 = OpArrayLength %uint %34 0 - %98 = OpBitcast %uint %int_0 - %99 = OpBitcast %uint %int_16 - %100 = OpIMul %uint %99 %uint_7 - %101 = OpIAdd %uint %98 %100 - %102 = OpIAdd %uint %101 %uint_8 - %103 = OpULessThanEqual %bool %102 %97 - %104 = OpSelect %uint %103 %98 %uint_0 - %105 = OpSelect %uint %103 %99 %uint_8 - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %107 = OpAccessChain %_ptr_StorageBuffer_uint_0 %106 %104 - OpCooperativeMatrixStoreKHR %107 %m1 %uint_1 %105 NonPrivatePointer - %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %111 = OpArrayLength %uint %12 0 - %112 = OpIMul %uint %111 %uint_4 - %113 = OpIMul %uint %uint_16 %uint_7 - %114 = OpIAdd %uint %uint_0 %113 - %115 = OpIMul %uint %114 %uint_4 - %116 = OpIAdd %uint %115 %uint_8 - %117 = OpULessThanEqual %bool %116 %112 - %118 = OpSelect %uint %117 %uint_0 %uint_0 - %119 = OpSelect %uint %117 %uint_16 %uint_2 - %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 - %m2 = OpCooperativeMatrixLoadKHR %59 %121 %uint_1 %119 None - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %125 = OpArrayLength %uint %34 0 - %126 = OpBitcast %uint %int_0 - %127 = OpBitcast %uint %int_16 - %128 = OpIMul %uint %127 %uint_7 - %129 = OpIAdd %uint %126 %128 - %130 = OpIAdd %uint %129 %uint_8 - %131 = OpULessThanEqual %bool %130 %125 - %132 = OpSelect %uint %131 %126 %uint_0 - %133 = OpSelect %uint %131 %127 %uint_8 - %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 - OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %139 = OpArrayLength %uint %18 0 - %140 = OpIMul %uint %139 %uint_4 - %141 = OpIMul %uint %uint_16 %uint_7 - %142 = OpIAdd %uint %uint_0 %141 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpIAdd %uint %143 %uint_8 - %145 = OpULessThanEqual %bool %144 %140 - %146 = OpSelect %uint %145 %uint_0 %uint_0 - %147 = OpSelect %uint %145 %uint_16 %uint_2 - %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %149 = OpAccessChain %_ptr_StorageBuffer_v4uint %148 %146 - %m3 = OpCooperativeMatrixLoadKHR %59 %149 %uint_1 %147 None - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %153 = OpArrayLength %uint %34 0 - %154 = OpBitcast %uint %int_0 - %155 = OpBitcast %uint %int_16 - %156 = OpIMul %uint %155 %uint_7 - %157 = OpIAdd %uint %154 %156 - %158 = OpIAdd %uint %157 %uint_8 - %159 = OpULessThanEqual %bool %158 %153 - %160 = OpSelect %uint %159 %154 %uint_0 - %161 = OpSelect %uint %159 %155 %uint_8 - %162 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %163 = OpAccessChain %_ptr_StorageBuffer_uint_0 %162 %160 - OpCooperativeMatrixStoreKHR %163 %m3 %uint_1 %161 NonPrivatePointer - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %167 = OpArrayLength %uint %23 0 - %168 = OpIMul %uint %uint_16 %uint_7 - %169 = OpIAdd %uint %uint_0 %168 - %170 = OpIAdd %uint %169 %uint_8 - %171 = OpULessThanEqual %bool %170 %167 - %172 = OpSelect %uint %171 %uint_0 %uint_0 - %173 = OpSelect %uint %171 %uint_16 %uint_8 - %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %175 = OpAccessChain %_ptr_StorageBuffer_v2half %174 %172 - %m5 = OpCooperativeMatrixLoadKHR %59 %175 %uint_1 %173 None - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %179 = OpArrayLength %uint %34 0 - %180 = OpBitcast %uint %int_0 - %181 = OpBitcast %uint %int_16 - %182 = OpIMul %uint %181 %uint_7 - %183 = OpIAdd %uint %180 %182 - %184 = OpIAdd %uint %183 %uint_8 - %185 = OpULessThanEqual %bool %184 %179 - %186 = OpSelect %uint %185 %180 %uint_0 - %187 = OpSelect %uint %185 %181 %uint_8 - %188 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %189 = OpAccessChain %_ptr_StorageBuffer_uint_0 %188 %186 - OpCooperativeMatrixStoreKHR %189 %m5 %uint_1 %187 NonPrivatePointer - %191 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %193 = OpArrayLength %uint %29 0 - %194 = OpIMul %uint %193 %uint_2 - %195 = OpIMul %uint %uint_16 %uint_7 - %196 = OpIAdd %uint %uint_0 %195 - %197 = OpIMul %uint %196 %uint_2 - %198 = OpIAdd %uint %197 %uint_8 - %199 = OpULessThanEqual %bool %198 %194 - %200 = OpSelect %uint %199 %uint_0 %uint_0 - %201 = OpSelect %uint %199 %uint_16 %uint_4 - %202 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %203 = OpAccessChain %_ptr_StorageBuffer_v3half %202 %200 - %m6 = OpCooperativeMatrixLoadKHR %59 %203 %uint_1 %201 None - %206 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %207 = OpArrayLength %uint %34 0 - %208 = OpBitcast %uint %int_0 - %209 = OpBitcast %uint %int_16 - %210 = OpIMul %uint %209 %uint_7 - %211 = OpIAdd %uint %208 %210 - %212 = OpIAdd %uint %211 %uint_8 - %213 = OpULessThanEqual %bool %212 %207 - %214 = OpSelect %uint %213 %208 %uint_0 - %215 = OpSelect %uint %213 %209 %uint_8 - %216 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %217 = OpAccessChain %_ptr_StorageBuffer_uint_0 %216 %214 - OpCooperativeMatrixStoreKHR %217 %m6 %uint_1 %215 NonPrivatePointer + %83 = OpIMul %uint %uint_16 %uint_7 + %84 = OpIAdd %uint %uint_0 %83 + %85 = OpIAdd %uint %84 %uint_4 + %87 = OpULessThanEqual %bool %85 %82 + %88 = OpSelect %uint %87 %uint_0 %uint_0 + %89 = OpSelect %uint %87 %uint_16 %uint_4 + %90 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %91 = OpAccessChain %_ptr_StorageBuffer_v2int %90 %88 + %m1 = OpCooperativeMatrixLoadKHR %59 %91 %uint_1 %89 None + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %95 = OpArrayLength %uint %34 0 + %96 = OpBitcast %uint %int_0 + %97 = OpBitcast %uint %int_16 + %98 = OpIMul %uint %97 %uint_7 + %99 = OpIAdd %uint %96 %98 + %100 = OpIAdd %uint %99 %uint_8 + %101 = OpULessThanEqual %bool %100 %95 + %102 = OpSelect %uint %101 %96 %uint_0 + %103 = OpSelect %uint %101 %97 %uint_8 + %104 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %105 = OpAccessChain %_ptr_StorageBuffer_uint_0 %104 %102 + OpCooperativeMatrixStoreKHR %105 %m1 %uint_1 %103 NonPrivatePointer + %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %109 = OpArrayLength %uint %12 0 + %110 = OpIMul %uint %uint_16 %uint_7 + %111 = OpIAdd %uint %uint_0 %110 + %112 = OpIAdd %uint %111 %uint_2 + %113 = OpULessThanEqual %bool %112 %109 + %114 = OpSelect %uint %113 %uint_0 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_2 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v3float %116 %114 + %m2 = OpCooperativeMatrixLoadKHR %59 %117 %uint_1 %115 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %121 = OpArrayLength %uint %34 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_8 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_8 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m2 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %135 = OpArrayLength %uint %18 0 + %136 = OpIMul %uint %uint_16 %uint_7 + %137 = OpIAdd %uint %uint_0 %136 + %138 = OpIAdd %uint %137 %uint_2 + %139 = OpULessThanEqual %bool %138 %135 + %140 = OpSelect %uint %139 %uint_0 %uint_0 + %141 = OpSelect %uint %139 %uint_16 %uint_2 + %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %143 = OpAccessChain %_ptr_StorageBuffer_v4uint %142 %140 + %m3 = OpCooperativeMatrixLoadKHR %59 %143 %uint_1 %141 None + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %147 = OpArrayLength %uint %34 0 + %148 = OpBitcast %uint %int_0 + %149 = OpBitcast %uint %int_16 + %150 = OpIMul %uint %149 %uint_7 + %151 = OpIAdd %uint %148 %150 + %152 = OpIAdd %uint %151 %uint_8 + %153 = OpULessThanEqual %bool %152 %147 + %154 = OpSelect %uint %153 %148 %uint_0 + %155 = OpSelect %uint %153 %149 %uint_8 + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %157 = OpAccessChain %_ptr_StorageBuffer_uint_0 %156 %154 + OpCooperativeMatrixStoreKHR %157 %m3 %uint_1 %155 NonPrivatePointer + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %161 = OpArrayLength %uint %23 0 + %162 = OpIMul %uint %uint_16 %uint_7 + %163 = OpIAdd %uint %uint_0 %162 + %164 = OpIAdd %uint %163 %uint_8 + %165 = OpULessThanEqual %bool %164 %161 + %166 = OpSelect %uint %165 %uint_0 %uint_0 + %167 = OpSelect %uint %165 %uint_16 %uint_8 + %168 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %169 = OpAccessChain %_ptr_StorageBuffer_v2half %168 %166 + %m5 = OpCooperativeMatrixLoadKHR %59 %169 %uint_1 %167 None + %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %173 = OpArrayLength %uint %34 0 + %174 = OpBitcast %uint %int_0 + %175 = OpBitcast %uint %int_16 + %176 = OpIMul %uint %175 %uint_7 + %177 = OpIAdd %uint %174 %176 + %178 = OpIAdd %uint %177 %uint_8 + %179 = OpULessThanEqual %bool %178 %173 + %180 = OpSelect %uint %179 %174 %uint_0 + %181 = OpSelect %uint %179 %175 %uint_8 + %182 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %183 = OpAccessChain %_ptr_StorageBuffer_uint_0 %182 %180 + OpCooperativeMatrixStoreKHR %183 %m5 %uint_1 %181 NonPrivatePointer + %185 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %187 = OpArrayLength %uint %29 0 + %188 = OpIMul %uint %uint_16 %uint_7 + %189 = OpIAdd %uint %uint_0 %188 + %190 = OpIAdd %uint %189 %uint_4 + %191 = OpULessThanEqual %bool %190 %187 + %192 = OpSelect %uint %191 %uint_0 %uint_0 + %193 = OpSelect %uint %191 %uint_16 %uint_4 + %194 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %195 = OpAccessChain %_ptr_StorageBuffer_v3half %194 %192 + %m6 = OpCooperativeMatrixLoadKHR %59 %195 %uint_1 %193 None + %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %199 = OpArrayLength %uint %34 0 + %200 = OpBitcast %uint %int_0 + %201 = OpBitcast %uint %int_16 + %202 = OpIMul %uint %201 %uint_7 + %203 = OpIAdd %uint %200 %202 + %204 = OpIAdd %uint %203 %uint_8 + %205 = OpULessThanEqual %bool %204 %199 + %206 = OpSelect %uint %205 %200 %uint_0 + %207 = OpSelect %uint %205 %201 %uint_8 + %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %209 = OpAccessChain %_ptr_StorageBuffer_uint_0 %208 %206 + OpCooperativeMatrixStoreKHR %209 %m6 %uint_1 %207 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl index 1b5131b..d71729b 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -23,7 +23,7 @@ m0.Store(v, (0u + (select(v_6, v_4, 0u) * 4u)), (select(v_6, v_5, 8u) * 4u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_7 / 8u) * 2u)); + bool v_8 = (((0u + (16u * 7u)) + 4u) <= (v_7 / 8u)); Matrix_result_i32_8x8 m1 = Matrix_result_i32_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 4u)), (select(v_8, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); @@ -33,7 +33,7 @@ m1.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 8u) * 4u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_13 / 16u) * 4u)); + bool v_14 = (((0u + (16u * 7u)) + 2u) <= (v_13 / 16u)); Matrix_result_i32_8x8 m2 = Matrix_result_i32_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 4u)), (select(v_14, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_15 = 0u; v.GetDimensions(v_15); @@ -43,7 +43,7 @@ m2.Store(v, (0u + (select(v_18, v_16, 0u) * 4u)), (select(v_18, v_17, 8u) * 4u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_19 / 16u) * 4u)); + bool v_20 = (((0u + (16u * 7u)) + 2u) <= (v_19 / 16u)); Matrix_result_i32_8x8 m3 = Matrix_result_i32_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 4u)), (select(v_20, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); @@ -63,7 +63,7 @@ m5.Store(v, (0u + (select(v_30, v_28, 0u) * 4u)), (select(v_30, v_29, 8u) * 4u), MatrixLayout::ColMajor); uint v_31 = 0u; in6.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_31 / 8u) * 2u)); + bool v_32 = (((0u + (16u * 7u)) + 4u) <= (v_31 / 8u)); Matrix_result_i32_8x8 m6 = Matrix_result_i32_8x8::Load(in6, (0u + (select(v_32, 0u, 0u) * 4u)), (select(v_32, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_33 = 0u; v.GetDimensions(v_33);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_row_major.wgsl.expected.spvasm index a5e46bf..128fbc8 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_i32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 219 +; Bound: 211 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -167,131 +167,123 @@ OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %82 = OpArrayLength %uint %6 0 - %83 = OpIMul %uint %82 %uint_2 - %84 = OpIMul %uint %uint_16 %uint_7 - %85 = OpIAdd %uint %uint_0 %84 - %86 = OpIMul %uint %85 %uint_2 - %87 = OpIAdd %uint %86 %uint_8 - %88 = OpULessThanEqual %bool %87 %83 - %89 = OpSelect %uint %88 %uint_0 %uint_0 - %90 = OpSelect %uint %88 %uint_16 %uint_4 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v2int %92 %89 - %m1 = OpCooperativeMatrixLoadKHR %59 %93 %uint_0 %90 None - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %97 = OpArrayLength %uint %34 0 - %98 = OpBitcast %uint %int_0 - %99 = OpBitcast %uint %int_16 - %100 = OpIMul %uint %99 %uint_7 - %101 = OpIAdd %uint %98 %100 - %102 = OpIAdd %uint %101 %uint_8 - %103 = OpULessThanEqual %bool %102 %97 - %104 = OpSelect %uint %103 %98 %uint_0 - %105 = OpSelect %uint %103 %99 %uint_8 - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %107 = OpAccessChain %_ptr_StorageBuffer_uint_0 %106 %104 - OpCooperativeMatrixStoreKHR %107 %m1 %uint_1 %105 NonPrivatePointer - %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %111 = OpArrayLength %uint %12 0 - %112 = OpIMul %uint %111 %uint_4 - %113 = OpIMul %uint %uint_16 %uint_7 - %114 = OpIAdd %uint %uint_0 %113 - %115 = OpIMul %uint %114 %uint_4 - %116 = OpIAdd %uint %115 %uint_8 - %117 = OpULessThanEqual %bool %116 %112 - %118 = OpSelect %uint %117 %uint_0 %uint_0 - %119 = OpSelect %uint %117 %uint_16 %uint_2 - %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 - %m2 = OpCooperativeMatrixLoadKHR %59 %121 %uint_0 %119 None - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %125 = OpArrayLength %uint %34 0 - %126 = OpBitcast %uint %int_0 - %127 = OpBitcast %uint %int_16 - %128 = OpIMul %uint %127 %uint_7 - %129 = OpIAdd %uint %126 %128 - %130 = OpIAdd %uint %129 %uint_8 - %131 = OpULessThanEqual %bool %130 %125 - %132 = OpSelect %uint %131 %126 %uint_0 - %133 = OpSelect %uint %131 %127 %uint_8 - %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 - OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %139 = OpArrayLength %uint %18 0 - %140 = OpIMul %uint %139 %uint_4 - %141 = OpIMul %uint %uint_16 %uint_7 - %142 = OpIAdd %uint %uint_0 %141 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpIAdd %uint %143 %uint_8 - %145 = OpULessThanEqual %bool %144 %140 - %146 = OpSelect %uint %145 %uint_0 %uint_0 - %147 = OpSelect %uint %145 %uint_16 %uint_2 - %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %149 = OpAccessChain %_ptr_StorageBuffer_v4uint %148 %146 - %m3 = OpCooperativeMatrixLoadKHR %59 %149 %uint_0 %147 None - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %153 = OpArrayLength %uint %34 0 - %154 = OpBitcast %uint %int_0 - %155 = OpBitcast %uint %int_16 - %156 = OpIMul %uint %155 %uint_7 - %157 = OpIAdd %uint %154 %156 - %158 = OpIAdd %uint %157 %uint_8 - %159 = OpULessThanEqual %bool %158 %153 - %160 = OpSelect %uint %159 %154 %uint_0 - %161 = OpSelect %uint %159 %155 %uint_8 - %162 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %163 = OpAccessChain %_ptr_StorageBuffer_uint_0 %162 %160 - OpCooperativeMatrixStoreKHR %163 %m3 %uint_1 %161 NonPrivatePointer - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %167 = OpArrayLength %uint %23 0 - %168 = OpIMul %uint %uint_16 %uint_7 - %169 = OpIAdd %uint %uint_0 %168 - %170 = OpIAdd %uint %169 %uint_8 - %171 = OpULessThanEqual %bool %170 %167 - %172 = OpSelect %uint %171 %uint_0 %uint_0 - %173 = OpSelect %uint %171 %uint_16 %uint_8 - %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %175 = OpAccessChain %_ptr_StorageBuffer_v2half %174 %172 - %m5 = OpCooperativeMatrixLoadKHR %59 %175 %uint_0 %173 None - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %179 = OpArrayLength %uint %34 0 - %180 = OpBitcast %uint %int_0 - %181 = OpBitcast %uint %int_16 - %182 = OpIMul %uint %181 %uint_7 - %183 = OpIAdd %uint %180 %182 - %184 = OpIAdd %uint %183 %uint_8 - %185 = OpULessThanEqual %bool %184 %179 - %186 = OpSelect %uint %185 %180 %uint_0 - %187 = OpSelect %uint %185 %181 %uint_8 - %188 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %189 = OpAccessChain %_ptr_StorageBuffer_uint_0 %188 %186 - OpCooperativeMatrixStoreKHR %189 %m5 %uint_1 %187 NonPrivatePointer - %191 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %193 = OpArrayLength %uint %29 0 - %194 = OpIMul %uint %193 %uint_2 - %195 = OpIMul %uint %uint_16 %uint_7 - %196 = OpIAdd %uint %uint_0 %195 - %197 = OpIMul %uint %196 %uint_2 - %198 = OpIAdd %uint %197 %uint_8 - %199 = OpULessThanEqual %bool %198 %194 - %200 = OpSelect %uint %199 %uint_0 %uint_0 - %201 = OpSelect %uint %199 %uint_16 %uint_4 - %202 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %203 = OpAccessChain %_ptr_StorageBuffer_v3half %202 %200 - %m6 = OpCooperativeMatrixLoadKHR %59 %203 %uint_0 %201 None - %206 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %207 = OpArrayLength %uint %34 0 - %208 = OpBitcast %uint %int_0 - %209 = OpBitcast %uint %int_16 - %210 = OpIMul %uint %209 %uint_7 - %211 = OpIAdd %uint %208 %210 - %212 = OpIAdd %uint %211 %uint_8 - %213 = OpULessThanEqual %bool %212 %207 - %214 = OpSelect %uint %213 %208 %uint_0 - %215 = OpSelect %uint %213 %209 %uint_8 - %216 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %217 = OpAccessChain %_ptr_StorageBuffer_uint_0 %216 %214 - OpCooperativeMatrixStoreKHR %217 %m6 %uint_1 %215 NonPrivatePointer + %83 = OpIMul %uint %uint_16 %uint_7 + %84 = OpIAdd %uint %uint_0 %83 + %85 = OpIAdd %uint %84 %uint_4 + %87 = OpULessThanEqual %bool %85 %82 + %88 = OpSelect %uint %87 %uint_0 %uint_0 + %89 = OpSelect %uint %87 %uint_16 %uint_4 + %90 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %91 = OpAccessChain %_ptr_StorageBuffer_v2int %90 %88 + %m1 = OpCooperativeMatrixLoadKHR %59 %91 %uint_0 %89 None + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %95 = OpArrayLength %uint %34 0 + %96 = OpBitcast %uint %int_0 + %97 = OpBitcast %uint %int_16 + %98 = OpIMul %uint %97 %uint_7 + %99 = OpIAdd %uint %96 %98 + %100 = OpIAdd %uint %99 %uint_8 + %101 = OpULessThanEqual %bool %100 %95 + %102 = OpSelect %uint %101 %96 %uint_0 + %103 = OpSelect %uint %101 %97 %uint_8 + %104 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %105 = OpAccessChain %_ptr_StorageBuffer_uint_0 %104 %102 + OpCooperativeMatrixStoreKHR %105 %m1 %uint_1 %103 NonPrivatePointer + %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %109 = OpArrayLength %uint %12 0 + %110 = OpIMul %uint %uint_16 %uint_7 + %111 = OpIAdd %uint %uint_0 %110 + %112 = OpIAdd %uint %111 %uint_2 + %113 = OpULessThanEqual %bool %112 %109 + %114 = OpSelect %uint %113 %uint_0 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_2 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v3float %116 %114 + %m2 = OpCooperativeMatrixLoadKHR %59 %117 %uint_0 %115 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %121 = OpArrayLength %uint %34 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_8 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_8 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m2 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %135 = OpArrayLength %uint %18 0 + %136 = OpIMul %uint %uint_16 %uint_7 + %137 = OpIAdd %uint %uint_0 %136 + %138 = OpIAdd %uint %137 %uint_2 + %139 = OpULessThanEqual %bool %138 %135 + %140 = OpSelect %uint %139 %uint_0 %uint_0 + %141 = OpSelect %uint %139 %uint_16 %uint_2 + %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %143 = OpAccessChain %_ptr_StorageBuffer_v4uint %142 %140 + %m3 = OpCooperativeMatrixLoadKHR %59 %143 %uint_0 %141 None + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %147 = OpArrayLength %uint %34 0 + %148 = OpBitcast %uint %int_0 + %149 = OpBitcast %uint %int_16 + %150 = OpIMul %uint %149 %uint_7 + %151 = OpIAdd %uint %148 %150 + %152 = OpIAdd %uint %151 %uint_8 + %153 = OpULessThanEqual %bool %152 %147 + %154 = OpSelect %uint %153 %148 %uint_0 + %155 = OpSelect %uint %153 %149 %uint_8 + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %157 = OpAccessChain %_ptr_StorageBuffer_uint_0 %156 %154 + OpCooperativeMatrixStoreKHR %157 %m3 %uint_1 %155 NonPrivatePointer + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %161 = OpArrayLength %uint %23 0 + %162 = OpIMul %uint %uint_16 %uint_7 + %163 = OpIAdd %uint %uint_0 %162 + %164 = OpIAdd %uint %163 %uint_8 + %165 = OpULessThanEqual %bool %164 %161 + %166 = OpSelect %uint %165 %uint_0 %uint_0 + %167 = OpSelect %uint %165 %uint_16 %uint_8 + %168 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %169 = OpAccessChain %_ptr_StorageBuffer_v2half %168 %166 + %m5 = OpCooperativeMatrixLoadKHR %59 %169 %uint_0 %167 None + %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %173 = OpArrayLength %uint %34 0 + %174 = OpBitcast %uint %int_0 + %175 = OpBitcast %uint %int_16 + %176 = OpIMul %uint %175 %uint_7 + %177 = OpIAdd %uint %174 %176 + %178 = OpIAdd %uint %177 %uint_8 + %179 = OpULessThanEqual %bool %178 %173 + %180 = OpSelect %uint %179 %174 %uint_0 + %181 = OpSelect %uint %179 %175 %uint_8 + %182 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %183 = OpAccessChain %_ptr_StorageBuffer_uint_0 %182 %180 + OpCooperativeMatrixStoreKHR %183 %m5 %uint_1 %181 NonPrivatePointer + %185 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %187 = OpArrayLength %uint %29 0 + %188 = OpIMul %uint %uint_16 %uint_7 + %189 = OpIAdd %uint %uint_0 %188 + %190 = OpIAdd %uint %189 %uint_4 + %191 = OpULessThanEqual %bool %190 %187 + %192 = OpSelect %uint %191 %uint_0 %uint_0 + %193 = OpSelect %uint %191 %uint_16 %uint_4 + %194 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %195 = OpAccessChain %_ptr_StorageBuffer_v3half %194 %192 + %m6 = OpCooperativeMatrixLoadKHR %59 %195 %uint_0 %193 None + %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %199 = OpArrayLength %uint %34 0 + %200 = OpBitcast %uint %int_0 + %201 = OpBitcast %uint %int_16 + %202 = OpIMul %uint %201 %uint_7 + %203 = OpIAdd %uint %200 %202 + %204 = OpIAdd %uint %203 %uint_8 + %205 = OpULessThanEqual %bool %204 %199 + %206 = OpSelect %uint %205 %200 %uint_0 + %207 = OpSelect %uint %205 %201 %uint_8 + %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %209 = OpAccessChain %_ptr_StorageBuffer_uint_0 %208 %206 + OpCooperativeMatrixStoreKHR %209 %m6 %uint_1 %207 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl index 8b1d774..88523d7 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -15,79 +15,79 @@ uint v_1 = 0u; in0.GetDimensions(v_1); uint v_2 = asuint(int(0)); - bool v_3 = ((((v_2 + (16u * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_3 = (((v_2 + (16u * 7u)) + 2u) <= (v_1 / 4u)); Matrix_result_i8_8x8 m0 = Matrix_result_i8_8x8::Load(in0, (0u + (select(v_3, v_2, 0u) * 4u)), (select(v_3, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_4 = 0u; v.GetDimensions(v_4); uint v_5 = asuint(int(0)); uint v_6 = asuint(int(16)); - bool v_7 = ((((v_5 + (v_6 * 7u)) * 4u) + 8u) <= ((v_4 / 4u) * 4u)); + bool v_7 = (((v_5 + (v_6 * 7u)) + 2u) <= (v_4 / 4u)); m0.Store(v, (0u + (select(v_7, v_5, 0u) * 4u)), (select(v_7, v_6, 2u) * 4u), MatrixLayout::ColMajor); uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 8u) + 8u) <= ((v_8 / 8u) * 8u)); + bool v_10 = (((v_9 + (16u * 7u)) + 1u) <= (v_8 / 8u)); Matrix_result_i8_8x8 m1 = Matrix_result_i8_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_11 = 0u; v.GetDimensions(v_11); uint v_12 = asuint(int(0)); uint v_13 = asuint(int(16)); - bool v_14 = ((((v_12 + (v_13 * 7u)) * 4u) + 8u) <= ((v_11 / 4u) * 4u)); + bool v_14 = (((v_12 + (v_13 * 7u)) + 2u) <= (v_11 / 4u)); m1.Store(v, (0u + (select(v_14, v_12, 0u) * 4u)), (select(v_14, v_13, 2u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 16u) + 16u) <= ((v_15 / 16u) * 16u)); + bool v_17 = (((v_16 + (16u * 7u)) + 1u) <= (v_15 / 16u)); Matrix_result_i8_8x8 m2 = Matrix_result_i8_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_18 = 0u; v.GetDimensions(v_18); uint v_19 = asuint(int(0)); uint v_20 = asuint(int(16)); - bool v_21 = ((((v_19 + (v_20 * 7u)) * 4u) + 8u) <= ((v_18 / 4u) * 4u)); + bool v_21 = (((v_19 + (v_20 * 7u)) + 2u) <= (v_18 / 4u)); m2.Store(v, (0u + (select(v_21, v_19, 0u) * 4u)), (select(v_21, v_20, 2u) * 4u), MatrixLayout::ColMajor); uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 16u) + 16u) <= ((v_22 / 16u) * 16u)); + bool v_24 = (((v_23 + (16u * 7u)) + 1u) <= (v_22 / 16u)); Matrix_result_i8_8x8 m3 = Matrix_result_i8_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m3.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); uint v_29 = 0u; in4.GetDimensions(v_29); uint v_30 = asuint(int(0)); - bool v_31 = ((((v_30 + (16u * 7u)) * 2u) + 8u) <= ((v_29 / 2u) * 2u)); + bool v_31 = (((v_30 + (16u * 7u)) + 4u) <= (v_29 / 2u)); Matrix_result_i8_8x8 m4 = Matrix_result_i8_8x8::Load(in4, (0u + (select(v_31, v_30, 0u) * 4u)), (select(v_31, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_32 = 0u; v.GetDimensions(v_32); uint v_33 = asuint(int(0)); uint v_34 = asuint(int(16)); - bool v_35 = ((((v_33 + (v_34 * 7u)) * 4u) + 8u) <= ((v_32 / 4u) * 4u)); + bool v_35 = (((v_33 + (v_34 * 7u)) + 2u) <= (v_32 / 4u)); m4.Store(v, (0u + (select(v_35, v_33, 0u) * 4u)), (select(v_35, v_34, 2u) * 4u), MatrixLayout::ColMajor); uint v_36 = 0u; in5.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 4u) + 8u) <= ((v_36 / 4u) * 4u)); + bool v_38 = (((v_37 + (16u * 7u)) + 2u) <= (v_36 / 4u)); Matrix_result_i8_8x8 m5 = Matrix_result_i8_8x8::Load(in5, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 4u) + 8u) <= ((v_39 / 4u) * 4u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 2u) <= (v_39 / 4u)); m5.Store(v, (0u + (select(v_42, v_40, 0u) * 4u)), (select(v_42, v_41, 2u) * 4u), MatrixLayout::ColMajor); uint v_43 = 0u; in6.GetDimensions(v_43); uint v_44 = asuint(int(0)); - bool v_45 = ((((v_44 + (16u * 7u)) * 8u) + 8u) <= ((v_43 / 8u) * 8u)); + bool v_45 = (((v_44 + (16u * 7u)) + 1u) <= (v_43 / 8u)); Matrix_result_i8_8x8 m6 = Matrix_result_i8_8x8::Load(in6, (0u + (select(v_45, v_44, 0u) * 4u)), (select(v_45, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_46 = 0u; v.GetDimensions(v_46); uint v_47 = asuint(int(0)); uint v_48 = asuint(int(16)); - bool v_49 = ((((v_47 + (v_48 * 7u)) * 4u) + 8u) <= ((v_46 / 4u) * 4u)); + bool v_49 = (((v_47 + (v_48 * 7u)) + 2u) <= (v_46 / 4u)); m6.Store(v, (0u + (select(v_49, v_47, 0u) * 4u)), (select(v_49, v_48, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_col_major.wgsl.expected.spvasm index 507dc1e..c70da60 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 277 +; Bound: 249 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -129,17 +129,16 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %char = OpTypeInt 8 1 - %69 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_2 + %65 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_2 %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_16 = OpConstant %int 16 @@ -151,6 +150,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -160,206 +160,178 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_4 - %51 = OpBitcast %uint %int_0 - %53 = OpIMul %uint %uint_16 %uint_7 - %56 = OpIAdd %uint %51 %53 - %57 = OpIMul %uint %56 %uint_4 - %58 = OpIAdd %uint %57 %uint_8 - %60 = OpULessThanEqual %bool %58 %49 - %62 = OpSelect %uint %60 %51 %uint_0 - %63 = OpSelect %uint %60 %uint_16 %uint_2 - %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %66 = OpAccessChain %_ptr_StorageBuffer_uint %65 %62 - %m0 = OpCooperativeMatrixLoadKHR %69 %66 %uint_1 %63 None - %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %75 = OpArrayLength %uint %38 0 - %76 = OpIMul %uint %75 %uint_4 - %77 = OpBitcast %uint %int_0 - %78 = OpBitcast %uint %int_16 - %80 = OpIMul %uint %78 %uint_7 - %81 = OpIAdd %uint %77 %80 - %82 = OpIMul %uint %81 %uint_4 - %83 = OpIAdd %uint %82 %uint_8 - %84 = OpULessThanEqual %bool %83 %76 - %85 = OpSelect %uint %84 %77 %uint_0 - %86 = OpSelect %uint %84 %78 %uint_2 - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %88 = OpAccessChain %_ptr_StorageBuffer_uint_0 %87 %85 - OpCooperativeMatrixStoreKHR %88 %m0 %uint_1 %86 NonPrivatePointer - %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %93 = OpArrayLength %uint %6 0 - %94 = OpIMul %uint %93 %uint_8 - %95 = OpBitcast %uint %int_0 - %96 = OpIMul %uint %uint_16 %uint_7 - %97 = OpIAdd %uint %95 %96 - %98 = OpIMul %uint %97 %uint_8 - %99 = OpIAdd %uint %98 %uint_8 - %100 = OpULessThanEqual %bool %99 %94 - %101 = OpSelect %uint %100 %95 %uint_0 - %102 = OpSelect %uint %100 %uint_16 %uint_1 - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v2int %103 %101 - %m1 = OpCooperativeMatrixLoadKHR %69 %104 %uint_1 %102 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %108 = OpArrayLength %uint %38 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m1 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpArrayLength %uint %12 0 - %125 = OpIMul %uint %124 %uint_16 - %126 = OpBitcast %uint %int_0 - %127 = OpIMul %uint %uint_16 %uint_7 - %128 = OpIAdd %uint %126 %127 - %129 = OpIMul %uint %128 %uint_16 - %130 = OpIAdd %uint %129 %uint_16 - %131 = OpULessThanEqual %bool %130 %125 - %132 = OpSelect %uint %131 %126 %uint_0 - %133 = OpSelect %uint %131 %uint_16 %uint_1 - %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %135 = OpAccessChain %_ptr_StorageBuffer_v3float %134 %132 - %m2 = OpCooperativeMatrixLoadKHR %69 %135 %uint_1 %133 None - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %139 = OpArrayLength %uint %38 0 - %140 = OpIMul %uint %139 %uint_4 - %141 = OpBitcast %uint %int_0 - %142 = OpBitcast %uint %int_16 - %143 = OpIMul %uint %142 %uint_7 - %144 = OpIAdd %uint %141 %143 - %145 = OpIMul %uint %144 %uint_4 - %146 = OpIAdd %uint %145 %uint_8 - %147 = OpULessThanEqual %bool %146 %140 - %148 = OpSelect %uint %147 %141 %uint_0 - %149 = OpSelect %uint %147 %142 %uint_2 - %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %151 = OpAccessChain %_ptr_StorageBuffer_uint_0 %150 %148 - OpCooperativeMatrixStoreKHR %151 %m2 %uint_1 %149 NonPrivatePointer - %153 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %155 = OpArrayLength %uint %18 0 - %156 = OpIMul %uint %155 %uint_16 - %157 = OpBitcast %uint %int_0 - %158 = OpIMul %uint %uint_16 %uint_7 - %159 = OpIAdd %uint %157 %158 - %160 = OpIMul %uint %159 %uint_16 - %161 = OpIAdd %uint %160 %uint_16 - %162 = OpULessThanEqual %bool %161 %156 - %163 = OpSelect %uint %162 %157 %uint_0 - %164 = OpSelect %uint %162 %uint_16 %uint_1 - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %166 = OpAccessChain %_ptr_StorageBuffer_v4uint %165 %163 - %m3 = OpCooperativeMatrixLoadKHR %69 %166 %uint_1 %164 None - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %170 = OpArrayLength %uint %38 0 - %171 = OpIMul %uint %170 %uint_4 - %172 = OpBitcast %uint %int_0 - %173 = OpBitcast %uint %int_16 - %174 = OpIMul %uint %173 %uint_7 - %175 = OpIAdd %uint %172 %174 - %176 = OpIMul %uint %175 %uint_4 - %177 = OpIAdd %uint %176 %uint_8 - %178 = OpULessThanEqual %bool %177 %171 - %179 = OpSelect %uint %178 %172 %uint_0 - %180 = OpSelect %uint %178 %173 %uint_2 - %181 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %182 = OpAccessChain %_ptr_StorageBuffer_uint_0 %181 %179 - OpCooperativeMatrixStoreKHR %182 %m3 %uint_1 %180 NonPrivatePointer - %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %186 = OpArrayLength %uint %23 0 - %187 = OpIMul %uint %186 %uint_2 - %188 = OpBitcast %uint %int_0 - %189 = OpIMul %uint %uint_16 %uint_7 - %190 = OpIAdd %uint %188 %189 - %191 = OpIMul %uint %190 %uint_2 - %192 = OpIAdd %uint %191 %uint_8 - %193 = OpULessThanEqual %bool %192 %187 - %194 = OpSelect %uint %193 %188 %uint_0 - %195 = OpSelect %uint %193 %uint_16 %uint_4 - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %197 = OpAccessChain %_ptr_StorageBuffer_half %196 %194 - %m4 = OpCooperativeMatrixLoadKHR %69 %197 %uint_1 %195 None - %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %201 = OpArrayLength %uint %38 0 - %202 = OpIMul %uint %201 %uint_4 - %203 = OpBitcast %uint %int_0 - %204 = OpBitcast %uint %int_16 - %205 = OpIMul %uint %204 %uint_7 - %206 = OpIAdd %uint %203 %205 - %207 = OpIMul %uint %206 %uint_4 - %208 = OpIAdd %uint %207 %uint_8 - %209 = OpULessThanEqual %bool %208 %202 - %210 = OpSelect %uint %209 %203 %uint_0 - %211 = OpSelect %uint %209 %204 %uint_2 - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %213 = OpAccessChain %_ptr_StorageBuffer_uint_0 %212 %210 - OpCooperativeMatrixStoreKHR %213 %m4 %uint_1 %211 NonPrivatePointer - %215 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %217 = OpArrayLength %uint %28 0 - %218 = OpIMul %uint %217 %uint_4 - %219 = OpBitcast %uint %int_0 - %220 = OpIMul %uint %uint_16 %uint_7 - %221 = OpIAdd %uint %219 %220 - %222 = OpIMul %uint %221 %uint_4 - %223 = OpIAdd %uint %222 %uint_8 - %224 = OpULessThanEqual %bool %223 %218 - %225 = OpSelect %uint %224 %219 %uint_0 - %226 = OpSelect %uint %224 %uint_16 %uint_2 - %227 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %228 = OpAccessChain %_ptr_StorageBuffer_v2half %227 %225 - %m5 = OpCooperativeMatrixLoadKHR %69 %228 %uint_1 %226 None - %231 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %232 = OpArrayLength %uint %38 0 - %233 = OpIMul %uint %232 %uint_4 - %234 = OpBitcast %uint %int_0 - %235 = OpBitcast %uint %int_16 - %236 = OpIMul %uint %235 %uint_7 - %237 = OpIAdd %uint %234 %236 - %238 = OpIMul %uint %237 %uint_4 - %239 = OpIAdd %uint %238 %uint_8 - %240 = OpULessThanEqual %bool %239 %233 - %241 = OpSelect %uint %240 %234 %uint_0 - %242 = OpSelect %uint %240 %235 %uint_2 - %243 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %244 = OpAccessChain %_ptr_StorageBuffer_uint_0 %243 %241 - OpCooperativeMatrixStoreKHR %244 %m5 %uint_1 %242 NonPrivatePointer - %246 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %248 = OpArrayLength %uint %33 0 - %249 = OpIMul %uint %248 %uint_8 - %250 = OpBitcast %uint %int_0 - %251 = OpIMul %uint %uint_16 %uint_7 - %252 = OpIAdd %uint %250 %251 - %253 = OpIMul %uint %252 %uint_8 - %254 = OpIAdd %uint %253 %uint_8 - %255 = OpULessThanEqual %bool %254 %249 - %256 = OpSelect %uint %255 %250 %uint_0 - %257 = OpSelect %uint %255 %uint_16 %uint_1 - %258 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %259 = OpAccessChain %_ptr_StorageBuffer_v3half %258 %256 - %m6 = OpCooperativeMatrixLoadKHR %69 %259 %uint_1 %257 None - %262 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %263 = OpArrayLength %uint %38 0 - %264 = OpIMul %uint %263 %uint_4 - %265 = OpBitcast %uint %int_0 - %266 = OpBitcast %uint %int_16 - %267 = OpIMul %uint %266 %uint_7 - %268 = OpIAdd %uint %265 %267 - %269 = OpIMul %uint %268 %uint_4 - %270 = OpIAdd %uint %269 %uint_8 - %271 = OpULessThanEqual %bool %270 %264 - %272 = OpSelect %uint %271 %265 %uint_0 - %273 = OpSelect %uint %271 %266 %uint_2 - %274 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %275 = OpAccessChain %_ptr_StorageBuffer_uint_0 %274 %272 - OpCooperativeMatrixStoreKHR %275 %m6 %uint_1 %273 NonPrivatePointer + %49 = OpBitcast %uint %int_0 + %51 = OpIMul %uint %uint_16 %uint_7 + %54 = OpIAdd %uint %49 %51 + %55 = OpIAdd %uint %54 %uint_2 + %57 = OpULessThanEqual %bool %55 %48 + %59 = OpSelect %uint %57 %49 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_2 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + %m0 = OpCooperativeMatrixLoadKHR %65 %62 %uint_1 %60 None + %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %72 = OpArrayLength %uint %38 0 + %73 = OpBitcast %uint %int_0 + %74 = OpBitcast %uint %int_16 + %76 = OpIMul %uint %74 %uint_7 + %77 = OpIAdd %uint %73 %76 + %78 = OpIAdd %uint %77 %uint_2 + %79 = OpULessThanEqual %bool %78 %72 + %80 = OpSelect %uint %79 %73 %uint_0 + %81 = OpSelect %uint %79 %74 %uint_2 + %82 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %83 = OpAccessChain %_ptr_StorageBuffer_uint_0 %82 %80 + OpCooperativeMatrixStoreKHR %83 %m0 %uint_1 %81 NonPrivatePointer + %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %88 = OpArrayLength %uint %6 0 + %89 = OpBitcast %uint %int_0 + %90 = OpIMul %uint %uint_16 %uint_7 + %91 = OpIAdd %uint %89 %90 + %92 = OpIAdd %uint %91 %uint_1 + %93 = OpULessThanEqual %bool %92 %88 + %94 = OpSelect %uint %93 %89 %uint_0 + %95 = OpSelect %uint %93 %uint_16 %uint_1 + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %97 = OpAccessChain %_ptr_StorageBuffer_v2int %96 %94 + %m1 = OpCooperativeMatrixLoadKHR %65 %97 %uint_1 %95 None + %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %101 = OpArrayLength %uint %38 0 + %102 = OpBitcast %uint %int_0 + %103 = OpBitcast %uint %int_16 + %104 = OpIMul %uint %103 %uint_7 + %105 = OpIAdd %uint %102 %104 + %106 = OpIAdd %uint %105 %uint_2 + %107 = OpULessThanEqual %bool %106 %101 + %108 = OpSelect %uint %107 %102 %uint_0 + %109 = OpSelect %uint %107 %103 %uint_2 + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %111 = OpAccessChain %_ptr_StorageBuffer_uint_0 %110 %108 + OpCooperativeMatrixStoreKHR %111 %m1 %uint_1 %109 NonPrivatePointer + %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %115 = OpArrayLength %uint %12 0 + %116 = OpBitcast %uint %int_0 + %117 = OpIMul %uint %uint_16 %uint_7 + %118 = OpIAdd %uint %116 %117 + %119 = OpIAdd %uint %118 %uint_1 + %120 = OpULessThanEqual %bool %119 %115 + %121 = OpSelect %uint %120 %116 %uint_0 + %122 = OpSelect %uint %120 %uint_16 %uint_1 + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 + %m2 = OpCooperativeMatrixLoadKHR %65 %124 %uint_1 %122 None + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %128 = OpArrayLength %uint %38 0 + %129 = OpBitcast %uint %int_0 + %130 = OpBitcast %uint %int_16 + %131 = OpIMul %uint %130 %uint_7 + %132 = OpIAdd %uint %129 %131 + %133 = OpIAdd %uint %132 %uint_2 + %134 = OpULessThanEqual %bool %133 %128 + %135 = OpSelect %uint %134 %129 %uint_0 + %136 = OpSelect %uint %134 %130 %uint_2 + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 + OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer + %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %142 = OpArrayLength %uint %18 0 + %143 = OpBitcast %uint %int_0 + %144 = OpIMul %uint %uint_16 %uint_7 + %145 = OpIAdd %uint %143 %144 + %146 = OpIAdd %uint %145 %uint_1 + %147 = OpULessThanEqual %bool %146 %142 + %148 = OpSelect %uint %147 %143 %uint_0 + %149 = OpSelect %uint %147 %uint_16 %uint_1 + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %151 = OpAccessChain %_ptr_StorageBuffer_v4uint %150 %148 + %m3 = OpCooperativeMatrixLoadKHR %65 %151 %uint_1 %149 None + %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %155 = OpArrayLength %uint %38 0 + %156 = OpBitcast %uint %int_0 + %157 = OpBitcast %uint %int_16 + %158 = OpIMul %uint %157 %uint_7 + %159 = OpIAdd %uint %156 %158 + %160 = OpIAdd %uint %159 %uint_2 + %161 = OpULessThanEqual %bool %160 %155 + %162 = OpSelect %uint %161 %156 %uint_0 + %163 = OpSelect %uint %161 %157 %uint_2 + %164 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %165 = OpAccessChain %_ptr_StorageBuffer_uint_0 %164 %162 + OpCooperativeMatrixStoreKHR %165 %m3 %uint_1 %163 NonPrivatePointer + %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %169 = OpArrayLength %uint %23 0 + %170 = OpBitcast %uint %int_0 + %171 = OpIMul %uint %uint_16 %uint_7 + %172 = OpIAdd %uint %170 %171 + %173 = OpIAdd %uint %172 %uint_4 + %175 = OpULessThanEqual %bool %173 %169 + %176 = OpSelect %uint %175 %170 %uint_0 + %177 = OpSelect %uint %175 %uint_16 %uint_4 + %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %179 = OpAccessChain %_ptr_StorageBuffer_half %178 %176 + %m4 = OpCooperativeMatrixLoadKHR %65 %179 %uint_1 %177 None + %182 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %183 = OpArrayLength %uint %38 0 + %184 = OpBitcast %uint %int_0 + %185 = OpBitcast %uint %int_16 + %186 = OpIMul %uint %185 %uint_7 + %187 = OpIAdd %uint %184 %186 + %188 = OpIAdd %uint %187 %uint_2 + %189 = OpULessThanEqual %bool %188 %183 + %190 = OpSelect %uint %189 %184 %uint_0 + %191 = OpSelect %uint %189 %185 %uint_2 + %192 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %193 = OpAccessChain %_ptr_StorageBuffer_uint_0 %192 %190 + OpCooperativeMatrixStoreKHR %193 %m4 %uint_1 %191 NonPrivatePointer + %195 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %197 = OpArrayLength %uint %28 0 + %198 = OpBitcast %uint %int_0 + %199 = OpIMul %uint %uint_16 %uint_7 + %200 = OpIAdd %uint %198 %199 + %201 = OpIAdd %uint %200 %uint_2 + %202 = OpULessThanEqual %bool %201 %197 + %203 = OpSelect %uint %202 %198 %uint_0 + %204 = OpSelect %uint %202 %uint_16 %uint_2 + %205 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %206 = OpAccessChain %_ptr_StorageBuffer_v2half %205 %203 + %m5 = OpCooperativeMatrixLoadKHR %65 %206 %uint_1 %204 None + %209 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %210 = OpArrayLength %uint %38 0 + %211 = OpBitcast %uint %int_0 + %212 = OpBitcast %uint %int_16 + %213 = OpIMul %uint %212 %uint_7 + %214 = OpIAdd %uint %211 %213 + %215 = OpIAdd %uint %214 %uint_2 + %216 = OpULessThanEqual %bool %215 %210 + %217 = OpSelect %uint %216 %211 %uint_0 + %218 = OpSelect %uint %216 %212 %uint_2 + %219 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %220 = OpAccessChain %_ptr_StorageBuffer_uint_0 %219 %217 + OpCooperativeMatrixStoreKHR %220 %m5 %uint_1 %218 NonPrivatePointer + %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %224 = OpArrayLength %uint %33 0 + %225 = OpBitcast %uint %int_0 + %226 = OpIMul %uint %uint_16 %uint_7 + %227 = OpIAdd %uint %225 %226 + %228 = OpIAdd %uint %227 %uint_1 + %229 = OpULessThanEqual %bool %228 %224 + %230 = OpSelect %uint %229 %225 %uint_0 + %231 = OpSelect %uint %229 %uint_16 %uint_1 + %232 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %233 = OpAccessChain %_ptr_StorageBuffer_v3half %232 %230 + %m6 = OpCooperativeMatrixLoadKHR %65 %233 %uint_1 %231 None + %236 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %237 = OpArrayLength %uint %38 0 + %238 = OpBitcast %uint %int_0 + %239 = OpBitcast %uint %int_16 + %240 = OpIMul %uint %239 %uint_7 + %241 = OpIAdd %uint %238 %240 + %242 = OpIAdd %uint %241 %uint_2 + %243 = OpULessThanEqual %bool %242 %237 + %244 = OpSelect %uint %243 %238 %uint_0 + %245 = OpSelect %uint %243 %239 %uint_2 + %246 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %247 = OpAccessChain %_ptr_StorageBuffer_uint_0 %246 %244 + OpCooperativeMatrixStoreKHR %247 %m6 %uint_1 %245 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl index 85256d3..a22a8f5 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -15,79 +15,79 @@ uint v_1 = 0u; in0.GetDimensions(v_1); uint v_2 = asuint(int(0)); - bool v_3 = ((((v_2 + (16u * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_3 = (((v_2 + (16u * 7u)) + 2u) <= (v_1 / 4u)); Matrix_result_i8_8x8 m0 = Matrix_result_i8_8x8::Load(in0, (0u + (select(v_3, v_2, 0u) * 4u)), (select(v_3, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_4 = 0u; v.GetDimensions(v_4); uint v_5 = asuint(int(0)); uint v_6 = asuint(int(16)); - bool v_7 = ((((v_5 + (v_6 * 7u)) * 4u) + 8u) <= ((v_4 / 4u) * 4u)); + bool v_7 = (((v_5 + (v_6 * 7u)) + 2u) <= (v_4 / 4u)); m0.Store(v, (0u + (select(v_7, v_5, 0u) * 4u)), (select(v_7, v_6, 2u) * 4u), MatrixLayout::ColMajor); uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 8u) + 8u) <= ((v_8 / 8u) * 8u)); + bool v_10 = (((v_9 + (16u * 7u)) + 1u) <= (v_8 / 8u)); Matrix_result_i8_8x8 m1 = Matrix_result_i8_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_11 = 0u; v.GetDimensions(v_11); uint v_12 = asuint(int(0)); uint v_13 = asuint(int(16)); - bool v_14 = ((((v_12 + (v_13 * 7u)) * 4u) + 8u) <= ((v_11 / 4u) * 4u)); + bool v_14 = (((v_12 + (v_13 * 7u)) + 2u) <= (v_11 / 4u)); m1.Store(v, (0u + (select(v_14, v_12, 0u) * 4u)), (select(v_14, v_13, 2u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 16u) + 16u) <= ((v_15 / 16u) * 16u)); + bool v_17 = (((v_16 + (16u * 7u)) + 1u) <= (v_15 / 16u)); Matrix_result_i8_8x8 m2 = Matrix_result_i8_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_18 = 0u; v.GetDimensions(v_18); uint v_19 = asuint(int(0)); uint v_20 = asuint(int(16)); - bool v_21 = ((((v_19 + (v_20 * 7u)) * 4u) + 8u) <= ((v_18 / 4u) * 4u)); + bool v_21 = (((v_19 + (v_20 * 7u)) + 2u) <= (v_18 / 4u)); m2.Store(v, (0u + (select(v_21, v_19, 0u) * 4u)), (select(v_21, v_20, 2u) * 4u), MatrixLayout::ColMajor); uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 16u) + 16u) <= ((v_22 / 16u) * 16u)); + bool v_24 = (((v_23 + (16u * 7u)) + 1u) <= (v_22 / 16u)); Matrix_result_i8_8x8 m3 = Matrix_result_i8_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m3.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); uint v_29 = 0u; in4.GetDimensions(v_29); uint v_30 = asuint(int(0)); - bool v_31 = ((((v_30 + (16u * 7u)) * 2u) + 8u) <= ((v_29 / 2u) * 2u)); + bool v_31 = (((v_30 + (16u * 7u)) + 4u) <= (v_29 / 2u)); Matrix_result_i8_8x8 m4 = Matrix_result_i8_8x8::Load(in4, (0u + (select(v_31, v_30, 0u) * 4u)), (select(v_31, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_32 = 0u; v.GetDimensions(v_32); uint v_33 = asuint(int(0)); uint v_34 = asuint(int(16)); - bool v_35 = ((((v_33 + (v_34 * 7u)) * 4u) + 8u) <= ((v_32 / 4u) * 4u)); + bool v_35 = (((v_33 + (v_34 * 7u)) + 2u) <= (v_32 / 4u)); m4.Store(v, (0u + (select(v_35, v_33, 0u) * 4u)), (select(v_35, v_34, 2u) * 4u), MatrixLayout::ColMajor); uint v_36 = 0u; in5.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 4u) + 8u) <= ((v_36 / 4u) * 4u)); + bool v_38 = (((v_37 + (16u * 7u)) + 2u) <= (v_36 / 4u)); Matrix_result_i8_8x8 m5 = Matrix_result_i8_8x8::Load(in5, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 4u) + 8u) <= ((v_39 / 4u) * 4u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 2u) <= (v_39 / 4u)); m5.Store(v, (0u + (select(v_42, v_40, 0u) * 4u)), (select(v_42, v_41, 2u) * 4u), MatrixLayout::ColMajor); uint v_43 = 0u; in6.GetDimensions(v_43); uint v_44 = asuint(int(0)); - bool v_45 = ((((v_44 + (16u * 7u)) * 8u) + 8u) <= ((v_43 / 8u) * 8u)); + bool v_45 = (((v_44 + (16u * 7u)) + 1u) <= (v_43 / 8u)); Matrix_result_i8_8x8 m6 = Matrix_result_i8_8x8::Load(in6, (0u + (select(v_45, v_44, 0u) * 4u)), (select(v_45, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_46 = 0u; v.GetDimensions(v_46); uint v_47 = asuint(int(0)); uint v_48 = asuint(int(16)); - bool v_49 = ((((v_47 + (v_48 * 7u)) * 4u) + 8u) <= ((v_46 / 4u) * 4u)); + bool v_49 = (((v_47 + (v_48 * 7u)) + 2u) <= (v_46 / 4u)); m6.Store(v, (0u + (select(v_49, v_47, 0u) * 4u)), (select(v_49, v_48, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_row_major.wgsl.expected.spvasm index 9caa4bf..97a27d3 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 277 +; Bound: 249 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -129,17 +129,16 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %char = OpTypeInt 8 1 - %69 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_2 + %65 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_2 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint @@ -151,6 +150,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -160,206 +160,178 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_4 - %51 = OpBitcast %uint %int_0 - %53 = OpIMul %uint %uint_16 %uint_7 - %56 = OpIAdd %uint %51 %53 - %57 = OpIMul %uint %56 %uint_4 - %58 = OpIAdd %uint %57 %uint_8 - %60 = OpULessThanEqual %bool %58 %49 - %62 = OpSelect %uint %60 %51 %uint_0 - %63 = OpSelect %uint %60 %uint_16 %uint_2 - %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %66 = OpAccessChain %_ptr_StorageBuffer_uint %65 %62 - %m0 = OpCooperativeMatrixLoadKHR %69 %66 %uint_0 %63 None - %72 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %74 = OpArrayLength %uint %38 0 - %75 = OpIMul %uint %74 %uint_4 - %76 = OpBitcast %uint %int_0 - %77 = OpBitcast %uint %int_16 - %79 = OpIMul %uint %77 %uint_7 - %80 = OpIAdd %uint %76 %79 - %81 = OpIMul %uint %80 %uint_4 - %82 = OpIAdd %uint %81 %uint_8 - %83 = OpULessThanEqual %bool %82 %75 - %84 = OpSelect %uint %83 %76 %uint_0 - %85 = OpSelect %uint %83 %77 %uint_2 - %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %87 = OpAccessChain %_ptr_StorageBuffer_uint_0 %86 %84 - OpCooperativeMatrixStoreKHR %87 %m0 %uint_1 %85 NonPrivatePointer - %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %93 = OpArrayLength %uint %6 0 - %94 = OpIMul %uint %93 %uint_8 - %95 = OpBitcast %uint %int_0 - %96 = OpIMul %uint %uint_16 %uint_7 - %97 = OpIAdd %uint %95 %96 - %98 = OpIMul %uint %97 %uint_8 - %99 = OpIAdd %uint %98 %uint_8 - %100 = OpULessThanEqual %bool %99 %94 - %101 = OpSelect %uint %100 %95 %uint_0 - %102 = OpSelect %uint %100 %uint_16 %uint_1 - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v2int %103 %101 - %m1 = OpCooperativeMatrixLoadKHR %69 %104 %uint_0 %102 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %108 = OpArrayLength %uint %38 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m1 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpArrayLength %uint %12 0 - %125 = OpIMul %uint %124 %uint_16 - %126 = OpBitcast %uint %int_0 - %127 = OpIMul %uint %uint_16 %uint_7 - %128 = OpIAdd %uint %126 %127 - %129 = OpIMul %uint %128 %uint_16 - %130 = OpIAdd %uint %129 %uint_16 - %131 = OpULessThanEqual %bool %130 %125 - %132 = OpSelect %uint %131 %126 %uint_0 - %133 = OpSelect %uint %131 %uint_16 %uint_1 - %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %135 = OpAccessChain %_ptr_StorageBuffer_v3float %134 %132 - %m2 = OpCooperativeMatrixLoadKHR %69 %135 %uint_0 %133 None - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %139 = OpArrayLength %uint %38 0 - %140 = OpIMul %uint %139 %uint_4 - %141 = OpBitcast %uint %int_0 - %142 = OpBitcast %uint %int_16 - %143 = OpIMul %uint %142 %uint_7 - %144 = OpIAdd %uint %141 %143 - %145 = OpIMul %uint %144 %uint_4 - %146 = OpIAdd %uint %145 %uint_8 - %147 = OpULessThanEqual %bool %146 %140 - %148 = OpSelect %uint %147 %141 %uint_0 - %149 = OpSelect %uint %147 %142 %uint_2 - %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %151 = OpAccessChain %_ptr_StorageBuffer_uint_0 %150 %148 - OpCooperativeMatrixStoreKHR %151 %m2 %uint_1 %149 NonPrivatePointer - %153 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %155 = OpArrayLength %uint %18 0 - %156 = OpIMul %uint %155 %uint_16 - %157 = OpBitcast %uint %int_0 - %158 = OpIMul %uint %uint_16 %uint_7 - %159 = OpIAdd %uint %157 %158 - %160 = OpIMul %uint %159 %uint_16 - %161 = OpIAdd %uint %160 %uint_16 - %162 = OpULessThanEqual %bool %161 %156 - %163 = OpSelect %uint %162 %157 %uint_0 - %164 = OpSelect %uint %162 %uint_16 %uint_1 - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %166 = OpAccessChain %_ptr_StorageBuffer_v4uint %165 %163 - %m3 = OpCooperativeMatrixLoadKHR %69 %166 %uint_0 %164 None - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %170 = OpArrayLength %uint %38 0 - %171 = OpIMul %uint %170 %uint_4 - %172 = OpBitcast %uint %int_0 - %173 = OpBitcast %uint %int_16 - %174 = OpIMul %uint %173 %uint_7 - %175 = OpIAdd %uint %172 %174 - %176 = OpIMul %uint %175 %uint_4 - %177 = OpIAdd %uint %176 %uint_8 - %178 = OpULessThanEqual %bool %177 %171 - %179 = OpSelect %uint %178 %172 %uint_0 - %180 = OpSelect %uint %178 %173 %uint_2 - %181 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %182 = OpAccessChain %_ptr_StorageBuffer_uint_0 %181 %179 - OpCooperativeMatrixStoreKHR %182 %m3 %uint_1 %180 NonPrivatePointer - %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %186 = OpArrayLength %uint %23 0 - %187 = OpIMul %uint %186 %uint_2 - %188 = OpBitcast %uint %int_0 - %189 = OpIMul %uint %uint_16 %uint_7 - %190 = OpIAdd %uint %188 %189 - %191 = OpIMul %uint %190 %uint_2 - %192 = OpIAdd %uint %191 %uint_8 - %193 = OpULessThanEqual %bool %192 %187 - %194 = OpSelect %uint %193 %188 %uint_0 - %195 = OpSelect %uint %193 %uint_16 %uint_4 - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %197 = OpAccessChain %_ptr_StorageBuffer_half %196 %194 - %m4 = OpCooperativeMatrixLoadKHR %69 %197 %uint_0 %195 None - %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %201 = OpArrayLength %uint %38 0 - %202 = OpIMul %uint %201 %uint_4 - %203 = OpBitcast %uint %int_0 - %204 = OpBitcast %uint %int_16 - %205 = OpIMul %uint %204 %uint_7 - %206 = OpIAdd %uint %203 %205 - %207 = OpIMul %uint %206 %uint_4 - %208 = OpIAdd %uint %207 %uint_8 - %209 = OpULessThanEqual %bool %208 %202 - %210 = OpSelect %uint %209 %203 %uint_0 - %211 = OpSelect %uint %209 %204 %uint_2 - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %213 = OpAccessChain %_ptr_StorageBuffer_uint_0 %212 %210 - OpCooperativeMatrixStoreKHR %213 %m4 %uint_1 %211 NonPrivatePointer - %215 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %217 = OpArrayLength %uint %28 0 - %218 = OpIMul %uint %217 %uint_4 - %219 = OpBitcast %uint %int_0 - %220 = OpIMul %uint %uint_16 %uint_7 - %221 = OpIAdd %uint %219 %220 - %222 = OpIMul %uint %221 %uint_4 - %223 = OpIAdd %uint %222 %uint_8 - %224 = OpULessThanEqual %bool %223 %218 - %225 = OpSelect %uint %224 %219 %uint_0 - %226 = OpSelect %uint %224 %uint_16 %uint_2 - %227 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %228 = OpAccessChain %_ptr_StorageBuffer_v2half %227 %225 - %m5 = OpCooperativeMatrixLoadKHR %69 %228 %uint_0 %226 None - %231 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %232 = OpArrayLength %uint %38 0 - %233 = OpIMul %uint %232 %uint_4 - %234 = OpBitcast %uint %int_0 - %235 = OpBitcast %uint %int_16 - %236 = OpIMul %uint %235 %uint_7 - %237 = OpIAdd %uint %234 %236 - %238 = OpIMul %uint %237 %uint_4 - %239 = OpIAdd %uint %238 %uint_8 - %240 = OpULessThanEqual %bool %239 %233 - %241 = OpSelect %uint %240 %234 %uint_0 - %242 = OpSelect %uint %240 %235 %uint_2 - %243 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %244 = OpAccessChain %_ptr_StorageBuffer_uint_0 %243 %241 - OpCooperativeMatrixStoreKHR %244 %m5 %uint_1 %242 NonPrivatePointer - %246 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %248 = OpArrayLength %uint %33 0 - %249 = OpIMul %uint %248 %uint_8 - %250 = OpBitcast %uint %int_0 - %251 = OpIMul %uint %uint_16 %uint_7 - %252 = OpIAdd %uint %250 %251 - %253 = OpIMul %uint %252 %uint_8 - %254 = OpIAdd %uint %253 %uint_8 - %255 = OpULessThanEqual %bool %254 %249 - %256 = OpSelect %uint %255 %250 %uint_0 - %257 = OpSelect %uint %255 %uint_16 %uint_1 - %258 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %259 = OpAccessChain %_ptr_StorageBuffer_v3half %258 %256 - %m6 = OpCooperativeMatrixLoadKHR %69 %259 %uint_0 %257 None - %262 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %263 = OpArrayLength %uint %38 0 - %264 = OpIMul %uint %263 %uint_4 - %265 = OpBitcast %uint %int_0 - %266 = OpBitcast %uint %int_16 - %267 = OpIMul %uint %266 %uint_7 - %268 = OpIAdd %uint %265 %267 - %269 = OpIMul %uint %268 %uint_4 - %270 = OpIAdd %uint %269 %uint_8 - %271 = OpULessThanEqual %bool %270 %264 - %272 = OpSelect %uint %271 %265 %uint_0 - %273 = OpSelect %uint %271 %266 %uint_2 - %274 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %275 = OpAccessChain %_ptr_StorageBuffer_uint_0 %274 %272 - OpCooperativeMatrixStoreKHR %275 %m6 %uint_1 %273 NonPrivatePointer + %49 = OpBitcast %uint %int_0 + %51 = OpIMul %uint %uint_16 %uint_7 + %54 = OpIAdd %uint %49 %51 + %55 = OpIAdd %uint %54 %uint_2 + %57 = OpULessThanEqual %bool %55 %48 + %59 = OpSelect %uint %57 %49 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_2 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + %m0 = OpCooperativeMatrixLoadKHR %65 %62 %uint_0 %60 None + %69 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %71 = OpArrayLength %uint %38 0 + %72 = OpBitcast %uint %int_0 + %73 = OpBitcast %uint %int_16 + %75 = OpIMul %uint %73 %uint_7 + %76 = OpIAdd %uint %72 %75 + %77 = OpIAdd %uint %76 %uint_2 + %78 = OpULessThanEqual %bool %77 %71 + %79 = OpSelect %uint %78 %72 %uint_0 + %80 = OpSelect %uint %78 %73 %uint_2 + %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %82 = OpAccessChain %_ptr_StorageBuffer_uint_0 %81 %79 + OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer + %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %88 = OpArrayLength %uint %6 0 + %89 = OpBitcast %uint %int_0 + %90 = OpIMul %uint %uint_16 %uint_7 + %91 = OpIAdd %uint %89 %90 + %92 = OpIAdd %uint %91 %uint_1 + %93 = OpULessThanEqual %bool %92 %88 + %94 = OpSelect %uint %93 %89 %uint_0 + %95 = OpSelect %uint %93 %uint_16 %uint_1 + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %97 = OpAccessChain %_ptr_StorageBuffer_v2int %96 %94 + %m1 = OpCooperativeMatrixLoadKHR %65 %97 %uint_0 %95 None + %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %101 = OpArrayLength %uint %38 0 + %102 = OpBitcast %uint %int_0 + %103 = OpBitcast %uint %int_16 + %104 = OpIMul %uint %103 %uint_7 + %105 = OpIAdd %uint %102 %104 + %106 = OpIAdd %uint %105 %uint_2 + %107 = OpULessThanEqual %bool %106 %101 + %108 = OpSelect %uint %107 %102 %uint_0 + %109 = OpSelect %uint %107 %103 %uint_2 + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %111 = OpAccessChain %_ptr_StorageBuffer_uint_0 %110 %108 + OpCooperativeMatrixStoreKHR %111 %m1 %uint_1 %109 NonPrivatePointer + %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %115 = OpArrayLength %uint %12 0 + %116 = OpBitcast %uint %int_0 + %117 = OpIMul %uint %uint_16 %uint_7 + %118 = OpIAdd %uint %116 %117 + %119 = OpIAdd %uint %118 %uint_1 + %120 = OpULessThanEqual %bool %119 %115 + %121 = OpSelect %uint %120 %116 %uint_0 + %122 = OpSelect %uint %120 %uint_16 %uint_1 + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 + %m2 = OpCooperativeMatrixLoadKHR %65 %124 %uint_0 %122 None + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %128 = OpArrayLength %uint %38 0 + %129 = OpBitcast %uint %int_0 + %130 = OpBitcast %uint %int_16 + %131 = OpIMul %uint %130 %uint_7 + %132 = OpIAdd %uint %129 %131 + %133 = OpIAdd %uint %132 %uint_2 + %134 = OpULessThanEqual %bool %133 %128 + %135 = OpSelect %uint %134 %129 %uint_0 + %136 = OpSelect %uint %134 %130 %uint_2 + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 + OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer + %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %142 = OpArrayLength %uint %18 0 + %143 = OpBitcast %uint %int_0 + %144 = OpIMul %uint %uint_16 %uint_7 + %145 = OpIAdd %uint %143 %144 + %146 = OpIAdd %uint %145 %uint_1 + %147 = OpULessThanEqual %bool %146 %142 + %148 = OpSelect %uint %147 %143 %uint_0 + %149 = OpSelect %uint %147 %uint_16 %uint_1 + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %151 = OpAccessChain %_ptr_StorageBuffer_v4uint %150 %148 + %m3 = OpCooperativeMatrixLoadKHR %65 %151 %uint_0 %149 None + %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %155 = OpArrayLength %uint %38 0 + %156 = OpBitcast %uint %int_0 + %157 = OpBitcast %uint %int_16 + %158 = OpIMul %uint %157 %uint_7 + %159 = OpIAdd %uint %156 %158 + %160 = OpIAdd %uint %159 %uint_2 + %161 = OpULessThanEqual %bool %160 %155 + %162 = OpSelect %uint %161 %156 %uint_0 + %163 = OpSelect %uint %161 %157 %uint_2 + %164 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %165 = OpAccessChain %_ptr_StorageBuffer_uint_0 %164 %162 + OpCooperativeMatrixStoreKHR %165 %m3 %uint_1 %163 NonPrivatePointer + %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %169 = OpArrayLength %uint %23 0 + %170 = OpBitcast %uint %int_0 + %171 = OpIMul %uint %uint_16 %uint_7 + %172 = OpIAdd %uint %170 %171 + %173 = OpIAdd %uint %172 %uint_4 + %175 = OpULessThanEqual %bool %173 %169 + %176 = OpSelect %uint %175 %170 %uint_0 + %177 = OpSelect %uint %175 %uint_16 %uint_4 + %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %179 = OpAccessChain %_ptr_StorageBuffer_half %178 %176 + %m4 = OpCooperativeMatrixLoadKHR %65 %179 %uint_0 %177 None + %182 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %183 = OpArrayLength %uint %38 0 + %184 = OpBitcast %uint %int_0 + %185 = OpBitcast %uint %int_16 + %186 = OpIMul %uint %185 %uint_7 + %187 = OpIAdd %uint %184 %186 + %188 = OpIAdd %uint %187 %uint_2 + %189 = OpULessThanEqual %bool %188 %183 + %190 = OpSelect %uint %189 %184 %uint_0 + %191 = OpSelect %uint %189 %185 %uint_2 + %192 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %193 = OpAccessChain %_ptr_StorageBuffer_uint_0 %192 %190 + OpCooperativeMatrixStoreKHR %193 %m4 %uint_1 %191 NonPrivatePointer + %195 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %197 = OpArrayLength %uint %28 0 + %198 = OpBitcast %uint %int_0 + %199 = OpIMul %uint %uint_16 %uint_7 + %200 = OpIAdd %uint %198 %199 + %201 = OpIAdd %uint %200 %uint_2 + %202 = OpULessThanEqual %bool %201 %197 + %203 = OpSelect %uint %202 %198 %uint_0 + %204 = OpSelect %uint %202 %uint_16 %uint_2 + %205 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %206 = OpAccessChain %_ptr_StorageBuffer_v2half %205 %203 + %m5 = OpCooperativeMatrixLoadKHR %65 %206 %uint_0 %204 None + %209 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %210 = OpArrayLength %uint %38 0 + %211 = OpBitcast %uint %int_0 + %212 = OpBitcast %uint %int_16 + %213 = OpIMul %uint %212 %uint_7 + %214 = OpIAdd %uint %211 %213 + %215 = OpIAdd %uint %214 %uint_2 + %216 = OpULessThanEqual %bool %215 %210 + %217 = OpSelect %uint %216 %211 %uint_0 + %218 = OpSelect %uint %216 %212 %uint_2 + %219 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %220 = OpAccessChain %_ptr_StorageBuffer_uint_0 %219 %217 + OpCooperativeMatrixStoreKHR %220 %m5 %uint_1 %218 NonPrivatePointer + %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %224 = OpArrayLength %uint %33 0 + %225 = OpBitcast %uint %int_0 + %226 = OpIMul %uint %uint_16 %uint_7 + %227 = OpIAdd %uint %225 %226 + %228 = OpIAdd %uint %227 %uint_1 + %229 = OpULessThanEqual %bool %228 %224 + %230 = OpSelect %uint %229 %225 %uint_0 + %231 = OpSelect %uint %229 %uint_16 %uint_1 + %232 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %233 = OpAccessChain %_ptr_StorageBuffer_v3half %232 %230 + %m6 = OpCooperativeMatrixLoadKHR %65 %233 %uint_0 %231 None + %236 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %237 = OpArrayLength %uint %38 0 + %238 = OpBitcast %uint %int_0 + %239 = OpBitcast %uint %int_16 + %240 = OpIMul %uint %239 %uint_7 + %241 = OpIAdd %uint %238 %240 + %242 = OpIAdd %uint %241 %uint_2 + %243 = OpULessThanEqual %bool %242 %237 + %244 = OpSelect %uint %243 %238 %uint_0 + %245 = OpSelect %uint %243 %239 %uint_2 + %246 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %247 = OpAccessChain %_ptr_StorageBuffer_uint_0 %246 %244 + OpCooperativeMatrixStoreKHR %247 %m6 %uint_1 %245 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_col_major.wgsl.expected.dxc.hlsl index 3896542..376c299 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_col_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 2u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 4u)), (select(v_4, v_3, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_i8_8x8 m1 = Matrix_result_i8_8x8::Load(in1, 0u, 64u, MatrixLayout::ColMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 4u) + 8u) <= ((v_5 / 4u) * 4u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 2u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 4u)), (select(v_8, v_7, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_i8_8x8 m2 = Matrix_result_i8_8x8::Load(in2, 0u, 64u, MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_i8_8x8 m3 = Matrix_result_i8_8x8::Load(in3, 0u, 64u, MatrixLayout::ColMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 4u) + 8u) <= ((v_13 / 4u) * 4u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 2u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 4u)), (select(v_16, v_15, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_i8_8x8 m4 = Matrix_result_i8_8x8::Load(in4, 0u, 64u, MatrixLayout::ColMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 4u) + 8u) <= ((v_17 / 4u) * 4u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 2u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 4u)), (select(v_20, v_19, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_i8_8x8 m5 = Matrix_result_i8_8x8::Load(in5, 0u, 64u, MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_i8_8x8 m6 = Matrix_result_i8_8x8::Load(in6, 0u, 64u, MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_col_major.wgsl.expected.spvasm index 7764933..2b5aa62 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 202 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -141,7 +141,6 @@ %uint_1 = OpConstant %uint 1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -166,126 +165,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_1 %uint_16 None %60 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %62 = OpArrayLength %uint %39 0 - %63 = OpIMul %uint %62 %uint_4 - %65 = OpBitcast %uint %int_0 - %67 = OpBitcast %uint %int_16 - %69 = OpIMul %uint %67 %uint_7 - %71 = OpIAdd %uint %65 %69 - %72 = OpIMul %uint %71 %uint_4 - %73 = OpIAdd %uint %72 %uint_8 - %74 = OpULessThanEqual %bool %73 %63 - %76 = OpSelect %uint %74 %65 %uint_0 - %77 = OpSelect %uint %74 %67 %uint_2 - %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %79 = OpAccessChain %_ptr_StorageBuffer_uint_0 %78 %76 - OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %82 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %84 %uint_1 %uint_16 None - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %88 = OpArrayLength %uint %39 0 - %89 = OpIMul %uint %88 %uint_4 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_2 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint_0 %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v3float %102 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %104 %uint_1 %uint_16 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %108 = OpArrayLength %uint %39 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m2 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v4uint %122 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %124 %uint_1 %uint_16 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %128 = OpArrayLength %uint %39 0 - %129 = OpIMul %uint %128 %uint_4 - %130 = OpBitcast %uint %int_0 - %131 = OpBitcast %uint %int_16 - %132 = OpIMul %uint %131 %uint_7 - %133 = OpIAdd %uint %130 %132 - %134 = OpIMul %uint %133 %uint_4 - %135 = OpIAdd %uint %134 %uint_8 - %136 = OpULessThanEqual %bool %135 %129 - %137 = OpSelect %uint %136 %130 %uint_0 - %138 = OpSelect %uint %136 %131 %uint_2 - %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %140 = OpAccessChain %_ptr_StorageBuffer_uint_0 %139 %137 - OpCooperativeMatrixStoreKHR %140 %m3 %uint_1 %138 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %144 = OpAccessChain %_ptr_StorageBuffer_half %142 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %144 %uint_1 %uint_16 None - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %148 = OpArrayLength %uint %39 0 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpBitcast %uint %int_0 - %151 = OpBitcast %uint %int_16 - %152 = OpIMul %uint %151 %uint_7 - %153 = OpIAdd %uint %150 %152 - %154 = OpIMul %uint %153 %uint_4 - %155 = OpIAdd %uint %154 %uint_8 - %156 = OpULessThanEqual %bool %155 %149 - %157 = OpSelect %uint %156 %150 %uint_0 - %158 = OpSelect %uint %156 %151 %uint_2 - %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %160 = OpAccessChain %_ptr_StorageBuffer_uint_0 %159 %157 - OpCooperativeMatrixStoreKHR %160 %m4 %uint_1 %158 NonPrivatePointer - %162 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v2half %162 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %164 %uint_1 %uint_16 None - %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %168 = OpArrayLength %uint %39 0 - %169 = OpIMul %uint %168 %uint_4 - %170 = OpBitcast %uint %int_0 - %171 = OpBitcast %uint %int_16 - %172 = OpIMul %uint %171 %uint_7 - %173 = OpIAdd %uint %170 %172 - %174 = OpIMul %uint %173 %uint_4 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %169 - %177 = OpSelect %uint %176 %170 %uint_0 - %178 = OpSelect %uint %176 %171 %uint_2 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_uint_0 %179 %177 - OpCooperativeMatrixStoreKHR %180 %m5 %uint_1 %178 NonPrivatePointer - %182 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %184 = OpAccessChain %_ptr_StorageBuffer_v3half %182 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %184 %uint_1 %uint_16 None - %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %188 = OpArrayLength %uint %39 0 - %189 = OpIMul %uint %188 %uint_4 - %190 = OpBitcast %uint %int_0 - %191 = OpBitcast %uint %int_16 - %192 = OpIMul %uint %191 %uint_7 - %193 = OpIAdd %uint %190 %192 - %194 = OpIMul %uint %193 %uint_4 - %195 = OpIAdd %uint %194 %uint_8 - %196 = OpULessThanEqual %bool %195 %189 - %197 = OpSelect %uint %196 %190 %uint_0 - %198 = OpSelect %uint %196 %191 %uint_2 - %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %200 = OpAccessChain %_ptr_StorageBuffer_uint_0 %199 %197 - OpCooperativeMatrixStoreKHR %200 %m6 %uint_1 %198 NonPrivatePointer + %63 = OpBitcast %uint %int_0 + %65 = OpBitcast %uint %int_16 + %67 = OpIMul %uint %65 %uint_7 + %69 = OpIAdd %uint %63 %67 + %70 = OpIAdd %uint %69 %uint_2 + %71 = OpULessThanEqual %bool %70 %62 + %73 = OpSelect %uint %71 %63 %uint_0 + %74 = OpSelect %uint %71 %65 %uint_2 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_uint_0 %75 %73 + OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_1 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_1 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_2 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_2 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_1 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_2 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_2 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_1 %uint_16 None + %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_2 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_2 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_1 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_2 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_2 + %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_1 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_2 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_2 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_row_major.wgsl.expected.dxc.hlsl index 34a3dd7..889103e 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_row_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 2u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 4u)), (select(v_4, v_3, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_i8_8x8 m1 = Matrix_result_i8_8x8::Load(in1, 0u, 64u, MatrixLayout::RowMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 4u) + 8u) <= ((v_5 / 4u) * 4u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 2u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 4u)), (select(v_8, v_7, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_i8_8x8 m2 = Matrix_result_i8_8x8::Load(in2, 0u, 64u, MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_i8_8x8 m3 = Matrix_result_i8_8x8::Load(in3, 0u, 64u, MatrixLayout::RowMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 4u) + 8u) <= ((v_13 / 4u) * 4u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 2u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 4u)), (select(v_16, v_15, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_i8_8x8 m4 = Matrix_result_i8_8x8::Load(in4, 0u, 64u, MatrixLayout::RowMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 4u) + 8u) <= ((v_17 / 4u) * 4u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 2u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 4u)), (select(v_20, v_19, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_i8_8x8 m5 = Matrix_result_i8_8x8::Load(in5, 0u, 64u, MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_i8_8x8 m6 = Matrix_result_i8_8x8::Load(in6, 0u, 64u, MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_row_major.wgsl.expected.spvasm index 15cc539..49e7b1c 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_i8_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 202 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -140,7 +140,6 @@ %53 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_2 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -166,126 +165,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_0 %uint_16 None %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %61 = OpArrayLength %uint %39 0 - %62 = OpIMul %uint %61 %uint_4 - %64 = OpBitcast %uint %int_0 - %66 = OpBitcast %uint %int_16 - %68 = OpIMul %uint %66 %uint_7 - %70 = OpIAdd %uint %64 %68 - %71 = OpIMul %uint %70 %uint_4 - %72 = OpIAdd %uint %71 %uint_8 - %73 = OpULessThanEqual %bool %72 %62 - %75 = OpSelect %uint %73 %64 %uint_0 - %76 = OpSelect %uint %73 %66 %uint_2 - %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %78 = OpAccessChain %_ptr_StorageBuffer_uint_0 %77 %75 - OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %76 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %82 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %84 %uint_0 %uint_16 None - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %88 = OpArrayLength %uint %39 0 - %89 = OpIMul %uint %88 %uint_4 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_2 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint_0 %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v3float %102 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %104 %uint_0 %uint_16 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %108 = OpArrayLength %uint %39 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m2 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v4uint %122 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %124 %uint_0 %uint_16 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %128 = OpArrayLength %uint %39 0 - %129 = OpIMul %uint %128 %uint_4 - %130 = OpBitcast %uint %int_0 - %131 = OpBitcast %uint %int_16 - %132 = OpIMul %uint %131 %uint_7 - %133 = OpIAdd %uint %130 %132 - %134 = OpIMul %uint %133 %uint_4 - %135 = OpIAdd %uint %134 %uint_8 - %136 = OpULessThanEqual %bool %135 %129 - %137 = OpSelect %uint %136 %130 %uint_0 - %138 = OpSelect %uint %136 %131 %uint_2 - %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %140 = OpAccessChain %_ptr_StorageBuffer_uint_0 %139 %137 - OpCooperativeMatrixStoreKHR %140 %m3 %uint_1 %138 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %144 = OpAccessChain %_ptr_StorageBuffer_half %142 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %144 %uint_0 %uint_16 None - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %148 = OpArrayLength %uint %39 0 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpBitcast %uint %int_0 - %151 = OpBitcast %uint %int_16 - %152 = OpIMul %uint %151 %uint_7 - %153 = OpIAdd %uint %150 %152 - %154 = OpIMul %uint %153 %uint_4 - %155 = OpIAdd %uint %154 %uint_8 - %156 = OpULessThanEqual %bool %155 %149 - %157 = OpSelect %uint %156 %150 %uint_0 - %158 = OpSelect %uint %156 %151 %uint_2 - %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %160 = OpAccessChain %_ptr_StorageBuffer_uint_0 %159 %157 - OpCooperativeMatrixStoreKHR %160 %m4 %uint_1 %158 NonPrivatePointer - %162 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v2half %162 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %164 %uint_0 %uint_16 None - %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %168 = OpArrayLength %uint %39 0 - %169 = OpIMul %uint %168 %uint_4 - %170 = OpBitcast %uint %int_0 - %171 = OpBitcast %uint %int_16 - %172 = OpIMul %uint %171 %uint_7 - %173 = OpIAdd %uint %170 %172 - %174 = OpIMul %uint %173 %uint_4 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %169 - %177 = OpSelect %uint %176 %170 %uint_0 - %178 = OpSelect %uint %176 %171 %uint_2 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_uint_0 %179 %177 - OpCooperativeMatrixStoreKHR %180 %m5 %uint_1 %178 NonPrivatePointer - %182 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %184 = OpAccessChain %_ptr_StorageBuffer_v3half %182 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %184 %uint_0 %uint_16 None - %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %188 = OpArrayLength %uint %39 0 - %189 = OpIMul %uint %188 %uint_4 - %190 = OpBitcast %uint %int_0 - %191 = OpBitcast %uint %int_16 - %192 = OpIMul %uint %191 %uint_7 - %193 = OpIAdd %uint %190 %192 - %194 = OpIMul %uint %193 %uint_4 - %195 = OpIAdd %uint %194 %uint_8 - %196 = OpULessThanEqual %bool %195 %189 - %197 = OpSelect %uint %196 %190 %uint_0 - %198 = OpSelect %uint %196 %191 %uint_2 - %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %200 = OpAccessChain %_ptr_StorageBuffer_uint_0 %199 %197 - OpCooperativeMatrixStoreKHR %200 %m6 %uint_1 %198 NonPrivatePointer + %62 = OpBitcast %uint %int_0 + %64 = OpBitcast %uint %int_16 + %66 = OpIMul %uint %64 %uint_7 + %68 = OpIAdd %uint %62 %66 + %69 = OpIAdd %uint %68 %uint_2 + %70 = OpULessThanEqual %bool %69 %61 + %72 = OpSelect %uint %70 %62 %uint_0 + %73 = OpSelect %uint %70 %64 %uint_2 + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %75 = OpAccessChain %_ptr_StorageBuffer_uint_0 %74 %72 + OpCooperativeMatrixStoreKHR %75 %m0 %uint_1 %73 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_0 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_0 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_2 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_2 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_0 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_2 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_2 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_0 %uint_16 None + %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_2 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_2 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_0 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_2 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_2 + %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_0 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_2 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_2 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl index 6e225c6..ff9c41f 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -25,7 +25,7 @@ uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 8u) * 2u)); + bool v_10 = (((v_9 + (16u * 7u)) + 4u) <= (v_8 / 8u)); Matrix_result_u32_8x8 m1 = Matrix_result_u32_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_11 = 0u; v.GetDimensions(v_11); @@ -36,7 +36,7 @@ uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 16u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 16u)); Matrix_result_u32_8x8 m2 = Matrix_result_u32_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_18 = 0u; v.GetDimensions(v_18); @@ -47,7 +47,7 @@ uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 4u) + 8u) <= ((v_22 / 16u) * 4u)); + bool v_24 = (((v_23 + (16u * 7u)) + 2u) <= (v_22 / 16u)); Matrix_result_u32_8x8 m3 = Matrix_result_u32_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); @@ -69,7 +69,7 @@ uint v_36 = 0u; in6.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 2u) + 8u) <= ((v_36 / 8u) * 2u)); + bool v_38 = (((v_37 + (16u * 7u)) + 4u) <= (v_36 / 8u)); Matrix_result_u32_8x8 m6 = Matrix_result_u32_8x8::Load(in6, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_col_major.wgsl.expected.spvasm index f1599e7..0dbb9b2 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 225 +; Bound: 217 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -168,136 +168,128 @@ OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %76 NonPrivatePointer %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %83 = OpArrayLength %uint %6 0 - %84 = OpIMul %uint %83 %uint_2 - %85 = OpBitcast %uint %int_0 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %85 %86 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %84 - %91 = OpSelect %uint %90 %85 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_4 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %91 - %m1 = OpCooperativeMatrixLoadKHR %61 %95 %uint_1 %92 None - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %99 = OpArrayLength %uint %34 0 - %100 = OpBitcast %uint %int_0 - %101 = OpBitcast %uint %int_16 - %102 = OpIMul %uint %101 %uint_7 - %103 = OpIAdd %uint %100 %102 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %101 %uint_8 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 - OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %113 = OpArrayLength %uint %12 0 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIMul %uint %117 %uint_4 - %119 = OpIAdd %uint %118 %uint_8 - %120 = OpULessThanEqual %bool %119 %114 - %121 = OpSelect %uint %120 %115 %uint_0 - %122 = OpSelect %uint %120 %uint_16 %uint_2 - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 - %m2 = OpCooperativeMatrixLoadKHR %61 %124 %uint_1 %122 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %128 = OpArrayLength %uint %34 0 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %130 %uint_8 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 - OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %142 = OpArrayLength %uint %18 0 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpBitcast %uint %int_0 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %144 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %143 - %150 = OpSelect %uint %149 %144 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v4uint %152 %150 - %m3 = OpCooperativeMatrixLoadKHR %61 %153 %uint_1 %151 None - %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %157 = OpArrayLength %uint %34 0 - %158 = OpBitcast %uint %int_0 - %159 = OpBitcast %uint %int_16 - %160 = OpIMul %uint %159 %uint_7 - %161 = OpIAdd %uint %158 %160 - %162 = OpIAdd %uint %161 %uint_8 - %163 = OpULessThanEqual %bool %162 %157 - %164 = OpSelect %uint %163 %158 %uint_0 - %165 = OpSelect %uint %163 %159 %uint_8 - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 - OpCooperativeMatrixStoreKHR %167 %m3 %uint_1 %165 NonPrivatePointer - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %171 = OpArrayLength %uint %23 0 - %172 = OpBitcast %uint %int_0 - %173 = OpIMul %uint %uint_16 %uint_7 - %174 = OpIAdd %uint %172 %173 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %171 - %177 = OpSelect %uint %176 %172 %uint_0 - %178 = OpSelect %uint %176 %uint_16 %uint_8 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_v2half %179 %177 - %m5 = OpCooperativeMatrixLoadKHR %61 %180 %uint_1 %178 None - %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %184 = OpArrayLength %uint %34 0 - %185 = OpBitcast %uint %int_0 - %186 = OpBitcast %uint %int_16 - %187 = OpIMul %uint %186 %uint_7 - %188 = OpIAdd %uint %185 %187 - %189 = OpIAdd %uint %188 %uint_8 - %190 = OpULessThanEqual %bool %189 %184 - %191 = OpSelect %uint %190 %185 %uint_0 - %192 = OpSelect %uint %190 %186 %uint_8 - %193 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %194 = OpAccessChain %_ptr_StorageBuffer_uint_0 %193 %191 - OpCooperativeMatrixStoreKHR %194 %m5 %uint_1 %192 NonPrivatePointer - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %198 = OpArrayLength %uint %29 0 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpBitcast %uint %int_0 - %201 = OpIMul %uint %uint_16 %uint_7 - %202 = OpIAdd %uint %200 %201 - %203 = OpIMul %uint %202 %uint_2 - %204 = OpIAdd %uint %203 %uint_8 - %205 = OpULessThanEqual %bool %204 %199 - %206 = OpSelect %uint %205 %200 %uint_0 - %207 = OpSelect %uint %205 %uint_16 %uint_4 - %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %209 = OpAccessChain %_ptr_StorageBuffer_v3half %208 %206 - %m6 = OpCooperativeMatrixLoadKHR %61 %209 %uint_1 %207 None - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %213 = OpArrayLength %uint %34 0 - %214 = OpBitcast %uint %int_0 - %215 = OpBitcast %uint %int_16 - %216 = OpIMul %uint %215 %uint_7 - %217 = OpIAdd %uint %214 %216 - %218 = OpIAdd %uint %217 %uint_8 - %219 = OpULessThanEqual %bool %218 %213 - %220 = OpSelect %uint %219 %214 %uint_0 - %221 = OpSelect %uint %219 %215 %uint_8 - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %223 = OpAccessChain %_ptr_StorageBuffer_uint_0 %222 %220 - OpCooperativeMatrixStoreKHR %223 %m6 %uint_1 %221 NonPrivatePointer + %84 = OpBitcast %uint %int_0 + %85 = OpIMul %uint %uint_16 %uint_7 + %86 = OpIAdd %uint %84 %85 + %87 = OpIAdd %uint %86 %uint_4 + %89 = OpULessThanEqual %bool %87 %83 + %90 = OpSelect %uint %89 %84 %uint_0 + %91 = OpSelect %uint %89 %uint_16 %uint_4 + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %93 = OpAccessChain %_ptr_StorageBuffer_v2int %92 %90 + %m1 = OpCooperativeMatrixLoadKHR %61 %93 %uint_1 %91 None + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %97 = OpArrayLength %uint %34 0 + %98 = OpBitcast %uint %int_0 + %99 = OpBitcast %uint %int_16 + %100 = OpIMul %uint %99 %uint_7 + %101 = OpIAdd %uint %98 %100 + %102 = OpIAdd %uint %101 %uint_8 + %103 = OpULessThanEqual %bool %102 %97 + %104 = OpSelect %uint %103 %98 %uint_0 + %105 = OpSelect %uint %103 %99 %uint_8 + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %107 = OpAccessChain %_ptr_StorageBuffer_uint_0 %106 %104 + OpCooperativeMatrixStoreKHR %107 %m1 %uint_1 %105 NonPrivatePointer + %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %111 = OpArrayLength %uint %12 0 + %112 = OpBitcast %uint %int_0 + %113 = OpIMul %uint %uint_16 %uint_7 + %114 = OpIAdd %uint %112 %113 + %115 = OpIAdd %uint %114 %uint_2 + %116 = OpULessThanEqual %bool %115 %111 + %117 = OpSelect %uint %116 %112 %uint_0 + %118 = OpSelect %uint %116 %uint_16 %uint_2 + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %120 = OpAccessChain %_ptr_StorageBuffer_v3float %119 %117 + %m2 = OpCooperativeMatrixLoadKHR %61 %120 %uint_1 %118 None + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %124 = OpArrayLength %uint %34 0 + %125 = OpBitcast %uint %int_0 + %126 = OpBitcast %uint %int_16 + %127 = OpIMul %uint %126 %uint_7 + %128 = OpIAdd %uint %125 %127 + %129 = OpIAdd %uint %128 %uint_8 + %130 = OpULessThanEqual %bool %129 %124 + %131 = OpSelect %uint %130 %125 %uint_0 + %132 = OpSelect %uint %130 %126 %uint_8 + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_uint_0 %133 %131 + OpCooperativeMatrixStoreKHR %134 %m2 %uint_1 %132 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %138 = OpArrayLength %uint %18 0 + %139 = OpBitcast %uint %int_0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %139 %140 + %142 = OpIAdd %uint %141 %uint_2 + %143 = OpULessThanEqual %bool %142 %138 + %144 = OpSelect %uint %143 %139 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_2 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %61 %147 %uint_1 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %151 = OpArrayLength %uint %34 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_8 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_8 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpBitcast %uint %int_0 + %167 = OpIMul %uint %uint_16 %uint_7 + %168 = OpIAdd %uint %166 %167 + %169 = OpIAdd %uint %168 %uint_8 + %170 = OpULessThanEqual %bool %169 %165 + %171 = OpSelect %uint %170 %166 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_8 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_v2half %173 %171 + %m5 = OpCooperativeMatrixLoadKHR %61 %174 %uint_1 %172 None + %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %178 = OpArrayLength %uint %34 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_8 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_8 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m5 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %192 = OpArrayLength %uint %29 0 + %193 = OpBitcast %uint %int_0 + %194 = OpIMul %uint %uint_16 %uint_7 + %195 = OpIAdd %uint %193 %194 + %196 = OpIAdd %uint %195 %uint_4 + %197 = OpULessThanEqual %bool %196 %192 + %198 = OpSelect %uint %197 %193 %uint_0 + %199 = OpSelect %uint %197 %uint_16 %uint_4 + %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %201 = OpAccessChain %_ptr_StorageBuffer_v3half %200 %198 + %m6 = OpCooperativeMatrixLoadKHR %61 %201 %uint_1 %199 None + %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %205 = OpArrayLength %uint %34 0 + %206 = OpBitcast %uint %int_0 + %207 = OpBitcast %uint %int_16 + %208 = OpIMul %uint %207 %uint_7 + %209 = OpIAdd %uint %206 %208 + %210 = OpIAdd %uint %209 %uint_8 + %211 = OpULessThanEqual %bool %210 %205 + %212 = OpSelect %uint %211 %206 %uint_0 + %213 = OpSelect %uint %211 %207 %uint_8 + %214 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %215 = OpAccessChain %_ptr_StorageBuffer_uint_0 %214 %212 + OpCooperativeMatrixStoreKHR %215 %m6 %uint_1 %213 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl index 75c3962..02be136 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -25,7 +25,7 @@ uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 8u) * 2u)); + bool v_10 = (((v_9 + (16u * 7u)) + 4u) <= (v_8 / 8u)); Matrix_result_u32_8x8 m1 = Matrix_result_u32_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_11 = 0u; v.GetDimensions(v_11); @@ -36,7 +36,7 @@ uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 16u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 16u)); Matrix_result_u32_8x8 m2 = Matrix_result_u32_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_18 = 0u; v.GetDimensions(v_18); @@ -47,7 +47,7 @@ uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 4u) + 8u) <= ((v_22 / 16u) * 4u)); + bool v_24 = (((v_23 + (16u * 7u)) + 2u) <= (v_22 / 16u)); Matrix_result_u32_8x8 m3 = Matrix_result_u32_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); @@ -69,7 +69,7 @@ uint v_36 = 0u; in6.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 2u) + 8u) <= ((v_36 / 8u) * 2u)); + bool v_38 = (((v_37 + (16u * 7u)) + 4u) <= (v_36 / 8u)); Matrix_result_u32_8x8 m6 = Matrix_result_u32_8x8::Load(in6, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_row_major.wgsl.expected.spvasm index 2533bb3..f3452e4 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_u32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 225 +; Bound: 217 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -168,136 +168,128 @@ OpCooperativeMatrixStoreKHR %77 %m0 %uint_1 %75 NonPrivatePointer %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %83 = OpArrayLength %uint %6 0 - %84 = OpIMul %uint %83 %uint_2 - %85 = OpBitcast %uint %int_0 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %85 %86 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %84 - %91 = OpSelect %uint %90 %85 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_4 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %91 - %m1 = OpCooperativeMatrixLoadKHR %61 %95 %uint_0 %92 None - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %99 = OpArrayLength %uint %34 0 - %100 = OpBitcast %uint %int_0 - %101 = OpBitcast %uint %int_16 - %102 = OpIMul %uint %101 %uint_7 - %103 = OpIAdd %uint %100 %102 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %101 %uint_8 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 - OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %113 = OpArrayLength %uint %12 0 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIMul %uint %117 %uint_4 - %119 = OpIAdd %uint %118 %uint_8 - %120 = OpULessThanEqual %bool %119 %114 - %121 = OpSelect %uint %120 %115 %uint_0 - %122 = OpSelect %uint %120 %uint_16 %uint_2 - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 - %m2 = OpCooperativeMatrixLoadKHR %61 %124 %uint_0 %122 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %128 = OpArrayLength %uint %34 0 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %130 %uint_8 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 - OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %142 = OpArrayLength %uint %18 0 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpBitcast %uint %int_0 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %144 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %143 - %150 = OpSelect %uint %149 %144 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v4uint %152 %150 - %m3 = OpCooperativeMatrixLoadKHR %61 %153 %uint_0 %151 None - %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %157 = OpArrayLength %uint %34 0 - %158 = OpBitcast %uint %int_0 - %159 = OpBitcast %uint %int_16 - %160 = OpIMul %uint %159 %uint_7 - %161 = OpIAdd %uint %158 %160 - %162 = OpIAdd %uint %161 %uint_8 - %163 = OpULessThanEqual %bool %162 %157 - %164 = OpSelect %uint %163 %158 %uint_0 - %165 = OpSelect %uint %163 %159 %uint_8 - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 - OpCooperativeMatrixStoreKHR %167 %m3 %uint_1 %165 NonPrivatePointer - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %171 = OpArrayLength %uint %23 0 - %172 = OpBitcast %uint %int_0 - %173 = OpIMul %uint %uint_16 %uint_7 - %174 = OpIAdd %uint %172 %173 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %171 - %177 = OpSelect %uint %176 %172 %uint_0 - %178 = OpSelect %uint %176 %uint_16 %uint_8 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_v2half %179 %177 - %m5 = OpCooperativeMatrixLoadKHR %61 %180 %uint_0 %178 None - %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %184 = OpArrayLength %uint %34 0 - %185 = OpBitcast %uint %int_0 - %186 = OpBitcast %uint %int_16 - %187 = OpIMul %uint %186 %uint_7 - %188 = OpIAdd %uint %185 %187 - %189 = OpIAdd %uint %188 %uint_8 - %190 = OpULessThanEqual %bool %189 %184 - %191 = OpSelect %uint %190 %185 %uint_0 - %192 = OpSelect %uint %190 %186 %uint_8 - %193 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %194 = OpAccessChain %_ptr_StorageBuffer_uint_0 %193 %191 - OpCooperativeMatrixStoreKHR %194 %m5 %uint_1 %192 NonPrivatePointer - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %198 = OpArrayLength %uint %29 0 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpBitcast %uint %int_0 - %201 = OpIMul %uint %uint_16 %uint_7 - %202 = OpIAdd %uint %200 %201 - %203 = OpIMul %uint %202 %uint_2 - %204 = OpIAdd %uint %203 %uint_8 - %205 = OpULessThanEqual %bool %204 %199 - %206 = OpSelect %uint %205 %200 %uint_0 - %207 = OpSelect %uint %205 %uint_16 %uint_4 - %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %209 = OpAccessChain %_ptr_StorageBuffer_v3half %208 %206 - %m6 = OpCooperativeMatrixLoadKHR %61 %209 %uint_0 %207 None - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %213 = OpArrayLength %uint %34 0 - %214 = OpBitcast %uint %int_0 - %215 = OpBitcast %uint %int_16 - %216 = OpIMul %uint %215 %uint_7 - %217 = OpIAdd %uint %214 %216 - %218 = OpIAdd %uint %217 %uint_8 - %219 = OpULessThanEqual %bool %218 %213 - %220 = OpSelect %uint %219 %214 %uint_0 - %221 = OpSelect %uint %219 %215 %uint_8 - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %223 = OpAccessChain %_ptr_StorageBuffer_uint_0 %222 %220 - OpCooperativeMatrixStoreKHR %223 %m6 %uint_1 %221 NonPrivatePointer + %84 = OpBitcast %uint %int_0 + %85 = OpIMul %uint %uint_16 %uint_7 + %86 = OpIAdd %uint %84 %85 + %87 = OpIAdd %uint %86 %uint_4 + %89 = OpULessThanEqual %bool %87 %83 + %90 = OpSelect %uint %89 %84 %uint_0 + %91 = OpSelect %uint %89 %uint_16 %uint_4 + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %93 = OpAccessChain %_ptr_StorageBuffer_v2int %92 %90 + %m1 = OpCooperativeMatrixLoadKHR %61 %93 %uint_0 %91 None + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %97 = OpArrayLength %uint %34 0 + %98 = OpBitcast %uint %int_0 + %99 = OpBitcast %uint %int_16 + %100 = OpIMul %uint %99 %uint_7 + %101 = OpIAdd %uint %98 %100 + %102 = OpIAdd %uint %101 %uint_8 + %103 = OpULessThanEqual %bool %102 %97 + %104 = OpSelect %uint %103 %98 %uint_0 + %105 = OpSelect %uint %103 %99 %uint_8 + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %107 = OpAccessChain %_ptr_StorageBuffer_uint_0 %106 %104 + OpCooperativeMatrixStoreKHR %107 %m1 %uint_1 %105 NonPrivatePointer + %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %111 = OpArrayLength %uint %12 0 + %112 = OpBitcast %uint %int_0 + %113 = OpIMul %uint %uint_16 %uint_7 + %114 = OpIAdd %uint %112 %113 + %115 = OpIAdd %uint %114 %uint_2 + %116 = OpULessThanEqual %bool %115 %111 + %117 = OpSelect %uint %116 %112 %uint_0 + %118 = OpSelect %uint %116 %uint_16 %uint_2 + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %120 = OpAccessChain %_ptr_StorageBuffer_v3float %119 %117 + %m2 = OpCooperativeMatrixLoadKHR %61 %120 %uint_0 %118 None + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %124 = OpArrayLength %uint %34 0 + %125 = OpBitcast %uint %int_0 + %126 = OpBitcast %uint %int_16 + %127 = OpIMul %uint %126 %uint_7 + %128 = OpIAdd %uint %125 %127 + %129 = OpIAdd %uint %128 %uint_8 + %130 = OpULessThanEqual %bool %129 %124 + %131 = OpSelect %uint %130 %125 %uint_0 + %132 = OpSelect %uint %130 %126 %uint_8 + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_uint_0 %133 %131 + OpCooperativeMatrixStoreKHR %134 %m2 %uint_1 %132 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %138 = OpArrayLength %uint %18 0 + %139 = OpBitcast %uint %int_0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %139 %140 + %142 = OpIAdd %uint %141 %uint_2 + %143 = OpULessThanEqual %bool %142 %138 + %144 = OpSelect %uint %143 %139 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_2 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %61 %147 %uint_0 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %151 = OpArrayLength %uint %34 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_8 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_8 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpBitcast %uint %int_0 + %167 = OpIMul %uint %uint_16 %uint_7 + %168 = OpIAdd %uint %166 %167 + %169 = OpIAdd %uint %168 %uint_8 + %170 = OpULessThanEqual %bool %169 %165 + %171 = OpSelect %uint %170 %166 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_8 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_v2half %173 %171 + %m5 = OpCooperativeMatrixLoadKHR %61 %174 %uint_0 %172 None + %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %178 = OpArrayLength %uint %34 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_8 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_8 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m5 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %192 = OpArrayLength %uint %29 0 + %193 = OpBitcast %uint %int_0 + %194 = OpIMul %uint %uint_16 %uint_7 + %195 = OpIAdd %uint %193 %194 + %196 = OpIAdd %uint %195 %uint_4 + %197 = OpULessThanEqual %bool %196 %192 + %198 = OpSelect %uint %197 %193 %uint_0 + %199 = OpSelect %uint %197 %uint_16 %uint_4 + %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %201 = OpAccessChain %_ptr_StorageBuffer_v3half %200 %198 + %m6 = OpCooperativeMatrixLoadKHR %61 %201 %uint_0 %199 None + %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %205 = OpArrayLength %uint %34 0 + %206 = OpBitcast %uint %int_0 + %207 = OpBitcast %uint %int_16 + %208 = OpIMul %uint %207 %uint_7 + %209 = OpIAdd %uint %206 %208 + %210 = OpIAdd %uint %209 %uint_8 + %211 = OpULessThanEqual %bool %210 %205 + %212 = OpSelect %uint %211 %206 %uint_0 + %213 = OpSelect %uint %211 %207 %uint_8 + %214 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %215 = OpAccessChain %_ptr_StorageBuffer_uint_0 %214 %212 + OpCooperativeMatrixStoreKHR %215 %m6 %uint_1 %213 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl index 58e44fc..e81570e 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -14,73 +14,73 @@ void main() { uint v_1 = 0u; in0.GetDimensions(v_1); - bool v_2 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_2 = (((0u + (16u * 7u)) + 2u) <= (v_1 / 4u)); Matrix_result_u8_8x8 m0 = Matrix_result_u8_8x8::Load(in0, (0u + (select(v_2, 0u, 0u) * 4u)), (select(v_2, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_3 = 0u; v.GetDimensions(v_3); uint v_4 = asuint(int(0)); uint v_5 = asuint(int(16)); - bool v_6 = ((((v_4 + (v_5 * 7u)) * 4u) + 8u) <= ((v_3 / 4u) * 4u)); + bool v_6 = (((v_4 + (v_5 * 7u)) + 2u) <= (v_3 / 4u)); m0.Store(v, (0u + (select(v_6, v_4, 0u) * 4u)), (select(v_6, v_5, 2u) * 4u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_7 / 8u) * 8u)); + bool v_8 = (((0u + (16u * 7u)) + 1u) <= (v_7 / 8u)); Matrix_result_u8_8x8 m1 = Matrix_result_u8_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 4u)), (select(v_8, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m1.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_13 / 16u) * 16u)); + bool v_14 = (((0u + (16u * 7u)) + 1u) <= (v_13 / 16u)); Matrix_result_u8_8x8 m2 = Matrix_result_u8_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 4u)), (select(v_14, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; v.GetDimensions(v_15); uint v_16 = asuint(int(0)); uint v_17 = asuint(int(16)); - bool v_18 = ((((v_16 + (v_17 * 7u)) * 4u) + 8u) <= ((v_15 / 4u) * 4u)); + bool v_18 = (((v_16 + (v_17 * 7u)) + 2u) <= (v_15 / 4u)); m2.Store(v, (0u + (select(v_18, v_16, 0u) * 4u)), (select(v_18, v_17, 2u) * 4u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_19 / 16u) * 16u)); + bool v_20 = (((0u + (16u * 7u)) + 1u) <= (v_19 / 16u)); Matrix_result_u8_8x8 m3 = Matrix_result_u8_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 4u)), (select(v_20, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m3.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; in4.GetDimensions(v_25); - bool v_26 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_25 / 2u) * 2u)); + bool v_26 = (((0u + (16u * 7u)) + 4u) <= (v_25 / 2u)); Matrix_result_u8_8x8 m4 = Matrix_result_u8_8x8::Load(in4, (0u + (select(v_26, 0u, 0u) * 4u)), (select(v_26, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_27 = 0u; v.GetDimensions(v_27); uint v_28 = asuint(int(0)); uint v_29 = asuint(int(16)); - bool v_30 = ((((v_28 + (v_29 * 7u)) * 4u) + 8u) <= ((v_27 / 4u) * 4u)); + bool v_30 = (((v_28 + (v_29 * 7u)) + 2u) <= (v_27 / 4u)); m4.Store(v, (0u + (select(v_30, v_28, 0u) * 4u)), (select(v_30, v_29, 2u) * 4u), MatrixLayout::ColMajor); uint v_31 = 0u; in5.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_31 / 4u) * 4u)); + bool v_32 = (((0u + (16u * 7u)) + 2u) <= (v_31 / 4u)); Matrix_result_u8_8x8 m5 = Matrix_result_u8_8x8::Load(in5, (0u + (select(v_32, 0u, 0u) * 4u)), (select(v_32, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_33 = 0u; v.GetDimensions(v_33); uint v_34 = asuint(int(0)); uint v_35 = asuint(int(16)); - bool v_36 = ((((v_34 + (v_35 * 7u)) * 4u) + 8u) <= ((v_33 / 4u) * 4u)); + bool v_36 = (((v_34 + (v_35 * 7u)) + 2u) <= (v_33 / 4u)); m5.Store(v, (0u + (select(v_36, v_34, 0u) * 4u)), (select(v_36, v_35, 2u) * 4u), MatrixLayout::ColMajor); uint v_37 = 0u; in6.GetDimensions(v_37); - bool v_38 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_37 / 8u) * 8u)); + bool v_38 = (((0u + (16u * 7u)) + 1u) <= (v_37 / 8u)); Matrix_result_u8_8x8 m6 = Matrix_result_u8_8x8::Load(in6, (0u + (select(v_38, 0u, 0u) * 4u)), (select(v_38, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 4u) + 8u) <= ((v_39 / 4u) * 4u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 2u) <= (v_39 / 4u)); m6.Store(v, (0u + (select(v_42, v_40, 0u) * 4u)), (select(v_42, v_41, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_col_major.wgsl.expected.spvasm index 9796eb7..e29fd3d 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 270 +; Bound: 242 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -129,16 +129,15 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %uchar = OpTypeInt 8 0 - %67 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_2 + %63 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_2 %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_0 = OpConstant %int 0 @@ -151,6 +150,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -160,199 +160,171 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_4 - %51 = OpIMul %uint %uint_16 %uint_7 - %54 = OpIAdd %uint %uint_0 %51 - %55 = OpIMul %uint %54 %uint_4 - %56 = OpIAdd %uint %55 %uint_8 - %58 = OpULessThanEqual %bool %56 %49 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_2 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - %m0 = OpCooperativeMatrixLoadKHR %67 %64 %uint_1 %61 None - %71 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %73 = OpArrayLength %uint %38 0 - %74 = OpIMul %uint %73 %uint_4 - %75 = OpBitcast %uint %int_0 - %77 = OpBitcast %uint %int_16 - %79 = OpIMul %uint %77 %uint_7 - %80 = OpIAdd %uint %75 %79 - %81 = OpIMul %uint %80 %uint_4 - %82 = OpIAdd %uint %81 %uint_8 - %83 = OpULessThanEqual %bool %82 %74 - %84 = OpSelect %uint %83 %75 %uint_0 - %85 = OpSelect %uint %83 %77 %uint_2 - %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %87 = OpAccessChain %_ptr_StorageBuffer_uint_0 %86 %84 - OpCooperativeMatrixStoreKHR %87 %m0 %uint_1 %85 NonPrivatePointer - %90 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %92 = OpArrayLength %uint %6 0 - %93 = OpIMul %uint %92 %uint_8 - %94 = OpIMul %uint %uint_16 %uint_7 - %95 = OpIAdd %uint %uint_0 %94 - %96 = OpIMul %uint %95 %uint_8 - %97 = OpIAdd %uint %96 %uint_8 - %98 = OpULessThanEqual %bool %97 %93 - %99 = OpSelect %uint %98 %uint_0 %uint_0 - %100 = OpSelect %uint %98 %uint_16 %uint_1 - %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %102 = OpAccessChain %_ptr_StorageBuffer_v2int %101 %99 - %m1 = OpCooperativeMatrixLoadKHR %67 %102 %uint_1 %100 None - %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %106 = OpArrayLength %uint %38 0 - %107 = OpIMul %uint %106 %uint_4 - %108 = OpBitcast %uint %int_0 - %109 = OpBitcast %uint %int_16 - %110 = OpIMul %uint %109 %uint_7 - %111 = OpIAdd %uint %108 %110 - %112 = OpIMul %uint %111 %uint_4 - %113 = OpIAdd %uint %112 %uint_8 - %114 = OpULessThanEqual %bool %113 %107 - %115 = OpSelect %uint %114 %108 %uint_0 - %116 = OpSelect %uint %114 %109 %uint_2 - %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %118 = OpAccessChain %_ptr_StorageBuffer_uint_0 %117 %115 - OpCooperativeMatrixStoreKHR %118 %m1 %uint_1 %116 NonPrivatePointer + %49 = OpIMul %uint %uint_16 %uint_7 + %52 = OpIAdd %uint %uint_0 %49 + %53 = OpIAdd %uint %52 %uint_2 + %55 = OpULessThanEqual %bool %53 %48 + %57 = OpSelect %uint %55 %uint_0 %uint_0 + %58 = OpSelect %uint %55 %uint_16 %uint_2 + %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %60 = OpAccessChain %_ptr_StorageBuffer_uint %59 %57 + %m0 = OpCooperativeMatrixLoadKHR %63 %60 %uint_1 %58 None + %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %70 = OpArrayLength %uint %38 0 + %71 = OpBitcast %uint %int_0 + %73 = OpBitcast %uint %int_16 + %75 = OpIMul %uint %73 %uint_7 + %76 = OpIAdd %uint %71 %75 + %77 = OpIAdd %uint %76 %uint_2 + %78 = OpULessThanEqual %bool %77 %70 + %79 = OpSelect %uint %78 %71 %uint_0 + %80 = OpSelect %uint %78 %73 %uint_2 + %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %82 = OpAccessChain %_ptr_StorageBuffer_uint_0 %81 %79 + OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %87 = OpArrayLength %uint %6 0 + %88 = OpIMul %uint %uint_16 %uint_7 + %89 = OpIAdd %uint %uint_0 %88 + %90 = OpIAdd %uint %89 %uint_1 + %91 = OpULessThanEqual %bool %90 %87 + %92 = OpSelect %uint %91 %uint_0 %uint_0 + %93 = OpSelect %uint %91 %uint_16 %uint_1 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %92 + %m1 = OpCooperativeMatrixLoadKHR %63 %95 %uint_1 %93 None + %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %99 = OpArrayLength %uint %38 0 + %100 = OpBitcast %uint %int_0 + %101 = OpBitcast %uint %int_16 + %102 = OpIMul %uint %101 %uint_7 + %103 = OpIAdd %uint %100 %102 + %104 = OpIAdd %uint %103 %uint_2 + %105 = OpULessThanEqual %bool %104 %99 + %106 = OpSelect %uint %105 %100 %uint_0 + %107 = OpSelect %uint %105 %101 %uint_2 + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 + OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %113 = OpArrayLength %uint %12 0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %uint_0 %114 + %116 = OpIAdd %uint %115 %uint_1 + %117 = OpULessThanEqual %bool %116 %113 + %118 = OpSelect %uint %117 %uint_0 %uint_0 + %119 = OpSelect %uint %117 %uint_16 %uint_1 %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %122 = OpArrayLength %uint %12 0 - %123 = OpIMul %uint %122 %uint_16 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %uint_0 %124 - %126 = OpIMul %uint %125 %uint_16 - %127 = OpIAdd %uint %126 %uint_16 - %128 = OpULessThanEqual %bool %127 %123 - %129 = OpSelect %uint %128 %uint_0 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_1 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_v3float %131 %129 - %m2 = OpCooperativeMatrixLoadKHR %67 %132 %uint_1 %130 None - %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %136 = OpArrayLength %uint %38 0 - %137 = OpIMul %uint %136 %uint_4 - %138 = OpBitcast %uint %int_0 - %139 = OpBitcast %uint %int_16 - %140 = OpIMul %uint %139 %uint_7 - %141 = OpIAdd %uint %138 %140 - %142 = OpIMul %uint %141 %uint_4 - %143 = OpIAdd %uint %142 %uint_8 - %144 = OpULessThanEqual %bool %143 %137 - %145 = OpSelect %uint %144 %138 %uint_0 - %146 = OpSelect %uint %144 %139 %uint_2 - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %148 = OpAccessChain %_ptr_StorageBuffer_uint_0 %147 %145 - OpCooperativeMatrixStoreKHR %148 %m2 %uint_1 %146 NonPrivatePointer - %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %152 = OpArrayLength %uint %18 0 - %153 = OpIMul %uint %152 %uint_16 - %154 = OpIMul %uint %uint_16 %uint_7 - %155 = OpIAdd %uint %uint_0 %154 - %156 = OpIMul %uint %155 %uint_16 - %157 = OpIAdd %uint %156 %uint_16 - %158 = OpULessThanEqual %bool %157 %153 - %159 = OpSelect %uint %158 %uint_0 %uint_0 - %160 = OpSelect %uint %158 %uint_16 %uint_1 - %161 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %162 = OpAccessChain %_ptr_StorageBuffer_v4uint %161 %159 - %m3 = OpCooperativeMatrixLoadKHR %67 %162 %uint_1 %160 None - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %166 = OpArrayLength %uint %38 0 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpBitcast %uint %int_0 - %169 = OpBitcast %uint %int_16 - %170 = OpIMul %uint %169 %uint_7 - %171 = OpIAdd %uint %168 %170 - %172 = OpIMul %uint %171 %uint_4 - %173 = OpIAdd %uint %172 %uint_8 - %174 = OpULessThanEqual %bool %173 %167 - %175 = OpSelect %uint %174 %168 %uint_0 - %176 = OpSelect %uint %174 %169 %uint_2 + %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 + %m2 = OpCooperativeMatrixLoadKHR %63 %121 %uint_1 %119 None + %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %125 = OpArrayLength %uint %38 0 + %126 = OpBitcast %uint %int_0 + %127 = OpBitcast %uint %int_16 + %128 = OpIMul %uint %127 %uint_7 + %129 = OpIAdd %uint %126 %128 + %130 = OpIAdd %uint %129 %uint_2 + %131 = OpULessThanEqual %bool %130 %125 + %132 = OpSelect %uint %131 %126 %uint_0 + %133 = OpSelect %uint %131 %127 %uint_2 + %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 + OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %139 = OpArrayLength %uint %18 0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %uint_0 %140 + %142 = OpIAdd %uint %141 %uint_1 + %143 = OpULessThanEqual %bool %142 %139 + %144 = OpSelect %uint %143 %uint_0 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_1 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %63 %147 %uint_1 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %151 = OpArrayLength %uint %38 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_2 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_2 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpIMul %uint %uint_16 %uint_7 + %167 = OpIAdd %uint %uint_0 %166 + %168 = OpIAdd %uint %167 %uint_4 + %170 = OpULessThanEqual %bool %168 %165 + %171 = OpSelect %uint %170 %uint_0 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_4 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_half %173 %171 + %m4 = OpCooperativeMatrixLoadKHR %63 %174 %uint_1 %172 None %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %178 = OpAccessChain %_ptr_StorageBuffer_uint_0 %177 %175 - OpCooperativeMatrixStoreKHR %178 %m3 %uint_1 %176 NonPrivatePointer - %180 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %182 = OpArrayLength %uint %23 0 - %183 = OpIMul %uint %182 %uint_2 - %184 = OpIMul %uint %uint_16 %uint_7 - %185 = OpIAdd %uint %uint_0 %184 - %186 = OpIMul %uint %185 %uint_2 - %187 = OpIAdd %uint %186 %uint_8 - %188 = OpULessThanEqual %bool %187 %183 - %189 = OpSelect %uint %188 %uint_0 %uint_0 - %190 = OpSelect %uint %188 %uint_16 %uint_4 - %191 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %192 = OpAccessChain %_ptr_StorageBuffer_half %191 %189 - %m4 = OpCooperativeMatrixLoadKHR %67 %192 %uint_1 %190 None - %195 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %196 = OpArrayLength %uint %38 0 - %197 = OpIMul %uint %196 %uint_4 - %198 = OpBitcast %uint %int_0 - %199 = OpBitcast %uint %int_16 - %200 = OpIMul %uint %199 %uint_7 - %201 = OpIAdd %uint %198 %200 - %202 = OpIMul %uint %201 %uint_4 - %203 = OpIAdd %uint %202 %uint_8 - %204 = OpULessThanEqual %bool %203 %197 - %205 = OpSelect %uint %204 %198 %uint_0 - %206 = OpSelect %uint %204 %199 %uint_2 - %207 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %208 = OpAccessChain %_ptr_StorageBuffer_uint_0 %207 %205 - OpCooperativeMatrixStoreKHR %208 %m4 %uint_1 %206 NonPrivatePointer - %210 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %212 = OpArrayLength %uint %28 0 - %213 = OpIMul %uint %212 %uint_4 - %214 = OpIMul %uint %uint_16 %uint_7 - %215 = OpIAdd %uint %uint_0 %214 - %216 = OpIMul %uint %215 %uint_4 - %217 = OpIAdd %uint %216 %uint_8 - %218 = OpULessThanEqual %bool %217 %213 - %219 = OpSelect %uint %218 %uint_0 %uint_0 - %220 = OpSelect %uint %218 %uint_16 %uint_2 - %221 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %222 = OpAccessChain %_ptr_StorageBuffer_v2half %221 %219 - %m5 = OpCooperativeMatrixLoadKHR %67 %222 %uint_1 %220 None - %225 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %226 = OpArrayLength %uint %38 0 - %227 = OpIMul %uint %226 %uint_4 - %228 = OpBitcast %uint %int_0 - %229 = OpBitcast %uint %int_16 - %230 = OpIMul %uint %229 %uint_7 - %231 = OpIAdd %uint %228 %230 - %232 = OpIMul %uint %231 %uint_4 - %233 = OpIAdd %uint %232 %uint_8 - %234 = OpULessThanEqual %bool %233 %227 - %235 = OpSelect %uint %234 %228 %uint_0 - %236 = OpSelect %uint %234 %229 %uint_2 - %237 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %238 = OpAccessChain %_ptr_StorageBuffer_uint_0 %237 %235 - OpCooperativeMatrixStoreKHR %238 %m5 %uint_1 %236 NonPrivatePointer - %240 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %242 = OpArrayLength %uint %33 0 - %243 = OpIMul %uint %242 %uint_8 - %244 = OpIMul %uint %uint_16 %uint_7 - %245 = OpIAdd %uint %uint_0 %244 - %246 = OpIMul %uint %245 %uint_8 - %247 = OpIAdd %uint %246 %uint_8 - %248 = OpULessThanEqual %bool %247 %243 - %249 = OpSelect %uint %248 %uint_0 %uint_0 - %250 = OpSelect %uint %248 %uint_16 %uint_1 - %251 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %252 = OpAccessChain %_ptr_StorageBuffer_v3half %251 %249 - %m6 = OpCooperativeMatrixLoadKHR %67 %252 %uint_1 %250 None - %255 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %256 = OpArrayLength %uint %38 0 - %257 = OpIMul %uint %256 %uint_4 - %258 = OpBitcast %uint %int_0 - %259 = OpBitcast %uint %int_16 - %260 = OpIMul %uint %259 %uint_7 - %261 = OpIAdd %uint %258 %260 - %262 = OpIMul %uint %261 %uint_4 - %263 = OpIAdd %uint %262 %uint_8 - %264 = OpULessThanEqual %bool %263 %257 - %265 = OpSelect %uint %264 %258 %uint_0 - %266 = OpSelect %uint %264 %259 %uint_2 - %267 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %268 = OpAccessChain %_ptr_StorageBuffer_uint_0 %267 %265 - OpCooperativeMatrixStoreKHR %268 %m6 %uint_1 %266 NonPrivatePointer + %178 = OpArrayLength %uint %38 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_2 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_2 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m4 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %192 = OpArrayLength %uint %28 0 + %193 = OpIMul %uint %uint_16 %uint_7 + %194 = OpIAdd %uint %uint_0 %193 + %195 = OpIAdd %uint %194 %uint_2 + %196 = OpULessThanEqual %bool %195 %192 + %197 = OpSelect %uint %196 %uint_0 %uint_0 + %198 = OpSelect %uint %196 %uint_16 %uint_2 + %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %200 = OpAccessChain %_ptr_StorageBuffer_v2half %199 %197 + %m5 = OpCooperativeMatrixLoadKHR %63 %200 %uint_1 %198 None + %203 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %204 = OpArrayLength %uint %38 0 + %205 = OpBitcast %uint %int_0 + %206 = OpBitcast %uint %int_16 + %207 = OpIMul %uint %206 %uint_7 + %208 = OpIAdd %uint %205 %207 + %209 = OpIAdd %uint %208 %uint_2 + %210 = OpULessThanEqual %bool %209 %204 + %211 = OpSelect %uint %210 %205 %uint_0 + %212 = OpSelect %uint %210 %206 %uint_2 + %213 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %214 = OpAccessChain %_ptr_StorageBuffer_uint_0 %213 %211 + OpCooperativeMatrixStoreKHR %214 %m5 %uint_1 %212 NonPrivatePointer + %216 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %218 = OpArrayLength %uint %33 0 + %219 = OpIMul %uint %uint_16 %uint_7 + %220 = OpIAdd %uint %uint_0 %219 + %221 = OpIAdd %uint %220 %uint_1 + %222 = OpULessThanEqual %bool %221 %218 + %223 = OpSelect %uint %222 %uint_0 %uint_0 + %224 = OpSelect %uint %222 %uint_16 %uint_1 + %225 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %226 = OpAccessChain %_ptr_StorageBuffer_v3half %225 %223 + %m6 = OpCooperativeMatrixLoadKHR %63 %226 %uint_1 %224 None + %229 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %230 = OpArrayLength %uint %38 0 + %231 = OpBitcast %uint %int_0 + %232 = OpBitcast %uint %int_16 + %233 = OpIMul %uint %232 %uint_7 + %234 = OpIAdd %uint %231 %233 + %235 = OpIAdd %uint %234 %uint_2 + %236 = OpULessThanEqual %bool %235 %230 + %237 = OpSelect %uint %236 %231 %uint_0 + %238 = OpSelect %uint %236 %232 %uint_2 + %239 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %240 = OpAccessChain %_ptr_StorageBuffer_uint_0 %239 %237 + OpCooperativeMatrixStoreKHR %240 %m6 %uint_1 %238 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl index 4ea1462..1ab02fa 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -14,73 +14,73 @@ void main() { uint v_1 = 0u; in0.GetDimensions(v_1); - bool v_2 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_2 = (((0u + (16u * 7u)) + 2u) <= (v_1 / 4u)); Matrix_result_u8_8x8 m0 = Matrix_result_u8_8x8::Load(in0, (0u + (select(v_2, 0u, 0u) * 4u)), (select(v_2, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_3 = 0u; v.GetDimensions(v_3); uint v_4 = asuint(int(0)); uint v_5 = asuint(int(16)); - bool v_6 = ((((v_4 + (v_5 * 7u)) * 4u) + 8u) <= ((v_3 / 4u) * 4u)); + bool v_6 = (((v_4 + (v_5 * 7u)) + 2u) <= (v_3 / 4u)); m0.Store(v, (0u + (select(v_6, v_4, 0u) * 4u)), (select(v_6, v_5, 2u) * 4u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_7 / 8u) * 8u)); + bool v_8 = (((0u + (16u * 7u)) + 1u) <= (v_7 / 8u)); Matrix_result_u8_8x8 m1 = Matrix_result_u8_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 4u)), (select(v_8, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m1.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_13 / 16u) * 16u)); + bool v_14 = (((0u + (16u * 7u)) + 1u) <= (v_13 / 16u)); Matrix_result_u8_8x8 m2 = Matrix_result_u8_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 4u)), (select(v_14, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_15 = 0u; v.GetDimensions(v_15); uint v_16 = asuint(int(0)); uint v_17 = asuint(int(16)); - bool v_18 = ((((v_16 + (v_17 * 7u)) * 4u) + 8u) <= ((v_15 / 4u) * 4u)); + bool v_18 = (((v_16 + (v_17 * 7u)) + 2u) <= (v_15 / 4u)); m2.Store(v, (0u + (select(v_18, v_16, 0u) * 4u)), (select(v_18, v_17, 2u) * 4u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_19 / 16u) * 16u)); + bool v_20 = (((0u + (16u * 7u)) + 1u) <= (v_19 / 16u)); Matrix_result_u8_8x8 m3 = Matrix_result_u8_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 4u)), (select(v_20, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m3.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; in4.GetDimensions(v_25); - bool v_26 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_25 / 2u) * 2u)); + bool v_26 = (((0u + (16u * 7u)) + 4u) <= (v_25 / 2u)); Matrix_result_u8_8x8 m4 = Matrix_result_u8_8x8::Load(in4, (0u + (select(v_26, 0u, 0u) * 4u)), (select(v_26, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_27 = 0u; v.GetDimensions(v_27); uint v_28 = asuint(int(0)); uint v_29 = asuint(int(16)); - bool v_30 = ((((v_28 + (v_29 * 7u)) * 4u) + 8u) <= ((v_27 / 4u) * 4u)); + bool v_30 = (((v_28 + (v_29 * 7u)) + 2u) <= (v_27 / 4u)); m4.Store(v, (0u + (select(v_30, v_28, 0u) * 4u)), (select(v_30, v_29, 2u) * 4u), MatrixLayout::ColMajor); uint v_31 = 0u; in5.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_31 / 4u) * 4u)); + bool v_32 = (((0u + (16u * 7u)) + 2u) <= (v_31 / 4u)); Matrix_result_u8_8x8 m5 = Matrix_result_u8_8x8::Load(in5, (0u + (select(v_32, 0u, 0u) * 4u)), (select(v_32, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_33 = 0u; v.GetDimensions(v_33); uint v_34 = asuint(int(0)); uint v_35 = asuint(int(16)); - bool v_36 = ((((v_34 + (v_35 * 7u)) * 4u) + 8u) <= ((v_33 / 4u) * 4u)); + bool v_36 = (((v_34 + (v_35 * 7u)) + 2u) <= (v_33 / 4u)); m5.Store(v, (0u + (select(v_36, v_34, 0u) * 4u)), (select(v_36, v_35, 2u) * 4u), MatrixLayout::ColMajor); uint v_37 = 0u; in6.GetDimensions(v_37); - bool v_38 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_37 / 8u) * 8u)); + bool v_38 = (((0u + (16u * 7u)) + 1u) <= (v_37 / 8u)); Matrix_result_u8_8x8 m6 = Matrix_result_u8_8x8::Load(in6, (0u + (select(v_38, 0u, 0u) * 4u)), (select(v_38, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 4u) + 8u) <= ((v_39 / 4u) * 4u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 2u) <= (v_39 / 4u)); m6.Store(v, (0u + (select(v_42, v_40, 0u) * 4u)), (select(v_42, v_41, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_row_major.wgsl.expected.spvasm index 00e2350..c0e856d 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 270 +; Bound: 242 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -129,16 +129,15 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %uchar = OpTypeInt 8 0 - %67 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_2 + %63 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_2 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 @@ -151,6 +150,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -160,199 +160,171 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_4 - %51 = OpIMul %uint %uint_16 %uint_7 - %54 = OpIAdd %uint %uint_0 %51 - %55 = OpIMul %uint %54 %uint_4 - %56 = OpIAdd %uint %55 %uint_8 - %58 = OpULessThanEqual %bool %56 %49 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_2 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - %m0 = OpCooperativeMatrixLoadKHR %67 %64 %uint_0 %61 None - %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %72 = OpArrayLength %uint %38 0 - %73 = OpIMul %uint %72 %uint_4 - %74 = OpBitcast %uint %int_0 - %76 = OpBitcast %uint %int_16 - %78 = OpIMul %uint %76 %uint_7 - %79 = OpIAdd %uint %74 %78 - %80 = OpIMul %uint %79 %uint_4 - %81 = OpIAdd %uint %80 %uint_8 - %82 = OpULessThanEqual %bool %81 %73 - %83 = OpSelect %uint %82 %74 %uint_0 - %84 = OpSelect %uint %82 %76 %uint_2 - %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %86 = OpAccessChain %_ptr_StorageBuffer_uint_0 %85 %83 - OpCooperativeMatrixStoreKHR %86 %m0 %uint_1 %84 NonPrivatePointer - %90 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %92 = OpArrayLength %uint %6 0 - %93 = OpIMul %uint %92 %uint_8 - %94 = OpIMul %uint %uint_16 %uint_7 - %95 = OpIAdd %uint %uint_0 %94 - %96 = OpIMul %uint %95 %uint_8 - %97 = OpIAdd %uint %96 %uint_8 - %98 = OpULessThanEqual %bool %97 %93 - %99 = OpSelect %uint %98 %uint_0 %uint_0 - %100 = OpSelect %uint %98 %uint_16 %uint_1 - %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %102 = OpAccessChain %_ptr_StorageBuffer_v2int %101 %99 - %m1 = OpCooperativeMatrixLoadKHR %67 %102 %uint_0 %100 None - %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %106 = OpArrayLength %uint %38 0 - %107 = OpIMul %uint %106 %uint_4 - %108 = OpBitcast %uint %int_0 - %109 = OpBitcast %uint %int_16 - %110 = OpIMul %uint %109 %uint_7 - %111 = OpIAdd %uint %108 %110 - %112 = OpIMul %uint %111 %uint_4 - %113 = OpIAdd %uint %112 %uint_8 - %114 = OpULessThanEqual %bool %113 %107 - %115 = OpSelect %uint %114 %108 %uint_0 - %116 = OpSelect %uint %114 %109 %uint_2 - %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %118 = OpAccessChain %_ptr_StorageBuffer_uint_0 %117 %115 - OpCooperativeMatrixStoreKHR %118 %m1 %uint_1 %116 NonPrivatePointer + %49 = OpIMul %uint %uint_16 %uint_7 + %52 = OpIAdd %uint %uint_0 %49 + %53 = OpIAdd %uint %52 %uint_2 + %55 = OpULessThanEqual %bool %53 %48 + %57 = OpSelect %uint %55 %uint_0 %uint_0 + %58 = OpSelect %uint %55 %uint_16 %uint_2 + %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %60 = OpAccessChain %_ptr_StorageBuffer_uint %59 %57 + %m0 = OpCooperativeMatrixLoadKHR %63 %60 %uint_0 %58 None + %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %69 = OpArrayLength %uint %38 0 + %70 = OpBitcast %uint %int_0 + %72 = OpBitcast %uint %int_16 + %74 = OpIMul %uint %72 %uint_7 + %75 = OpIAdd %uint %70 %74 + %76 = OpIAdd %uint %75 %uint_2 + %77 = OpULessThanEqual %bool %76 %69 + %78 = OpSelect %uint %77 %70 %uint_0 + %79 = OpSelect %uint %77 %72 %uint_2 + %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_uint_0 %80 %78 + OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %79 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %87 = OpArrayLength %uint %6 0 + %88 = OpIMul %uint %uint_16 %uint_7 + %89 = OpIAdd %uint %uint_0 %88 + %90 = OpIAdd %uint %89 %uint_1 + %91 = OpULessThanEqual %bool %90 %87 + %92 = OpSelect %uint %91 %uint_0 %uint_0 + %93 = OpSelect %uint %91 %uint_16 %uint_1 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %92 + %m1 = OpCooperativeMatrixLoadKHR %63 %95 %uint_0 %93 None + %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %99 = OpArrayLength %uint %38 0 + %100 = OpBitcast %uint %int_0 + %101 = OpBitcast %uint %int_16 + %102 = OpIMul %uint %101 %uint_7 + %103 = OpIAdd %uint %100 %102 + %104 = OpIAdd %uint %103 %uint_2 + %105 = OpULessThanEqual %bool %104 %99 + %106 = OpSelect %uint %105 %100 %uint_0 + %107 = OpSelect %uint %105 %101 %uint_2 + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 + OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %113 = OpArrayLength %uint %12 0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %uint_0 %114 + %116 = OpIAdd %uint %115 %uint_1 + %117 = OpULessThanEqual %bool %116 %113 + %118 = OpSelect %uint %117 %uint_0 %uint_0 + %119 = OpSelect %uint %117 %uint_16 %uint_1 %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %122 = OpArrayLength %uint %12 0 - %123 = OpIMul %uint %122 %uint_16 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %uint_0 %124 - %126 = OpIMul %uint %125 %uint_16 - %127 = OpIAdd %uint %126 %uint_16 - %128 = OpULessThanEqual %bool %127 %123 - %129 = OpSelect %uint %128 %uint_0 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_1 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_v3float %131 %129 - %m2 = OpCooperativeMatrixLoadKHR %67 %132 %uint_0 %130 None - %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %136 = OpArrayLength %uint %38 0 - %137 = OpIMul %uint %136 %uint_4 - %138 = OpBitcast %uint %int_0 - %139 = OpBitcast %uint %int_16 - %140 = OpIMul %uint %139 %uint_7 - %141 = OpIAdd %uint %138 %140 - %142 = OpIMul %uint %141 %uint_4 - %143 = OpIAdd %uint %142 %uint_8 - %144 = OpULessThanEqual %bool %143 %137 - %145 = OpSelect %uint %144 %138 %uint_0 - %146 = OpSelect %uint %144 %139 %uint_2 - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %148 = OpAccessChain %_ptr_StorageBuffer_uint_0 %147 %145 - OpCooperativeMatrixStoreKHR %148 %m2 %uint_1 %146 NonPrivatePointer - %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %152 = OpArrayLength %uint %18 0 - %153 = OpIMul %uint %152 %uint_16 - %154 = OpIMul %uint %uint_16 %uint_7 - %155 = OpIAdd %uint %uint_0 %154 - %156 = OpIMul %uint %155 %uint_16 - %157 = OpIAdd %uint %156 %uint_16 - %158 = OpULessThanEqual %bool %157 %153 - %159 = OpSelect %uint %158 %uint_0 %uint_0 - %160 = OpSelect %uint %158 %uint_16 %uint_1 - %161 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %162 = OpAccessChain %_ptr_StorageBuffer_v4uint %161 %159 - %m3 = OpCooperativeMatrixLoadKHR %67 %162 %uint_0 %160 None - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %166 = OpArrayLength %uint %38 0 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpBitcast %uint %int_0 - %169 = OpBitcast %uint %int_16 - %170 = OpIMul %uint %169 %uint_7 - %171 = OpIAdd %uint %168 %170 - %172 = OpIMul %uint %171 %uint_4 - %173 = OpIAdd %uint %172 %uint_8 - %174 = OpULessThanEqual %bool %173 %167 - %175 = OpSelect %uint %174 %168 %uint_0 - %176 = OpSelect %uint %174 %169 %uint_2 + %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 + %m2 = OpCooperativeMatrixLoadKHR %63 %121 %uint_0 %119 None + %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %125 = OpArrayLength %uint %38 0 + %126 = OpBitcast %uint %int_0 + %127 = OpBitcast %uint %int_16 + %128 = OpIMul %uint %127 %uint_7 + %129 = OpIAdd %uint %126 %128 + %130 = OpIAdd %uint %129 %uint_2 + %131 = OpULessThanEqual %bool %130 %125 + %132 = OpSelect %uint %131 %126 %uint_0 + %133 = OpSelect %uint %131 %127 %uint_2 + %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 + OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %139 = OpArrayLength %uint %18 0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %uint_0 %140 + %142 = OpIAdd %uint %141 %uint_1 + %143 = OpULessThanEqual %bool %142 %139 + %144 = OpSelect %uint %143 %uint_0 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_1 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %63 %147 %uint_0 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %151 = OpArrayLength %uint %38 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_2 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_2 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpIMul %uint %uint_16 %uint_7 + %167 = OpIAdd %uint %uint_0 %166 + %168 = OpIAdd %uint %167 %uint_4 + %170 = OpULessThanEqual %bool %168 %165 + %171 = OpSelect %uint %170 %uint_0 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_4 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_half %173 %171 + %m4 = OpCooperativeMatrixLoadKHR %63 %174 %uint_0 %172 None %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %178 = OpAccessChain %_ptr_StorageBuffer_uint_0 %177 %175 - OpCooperativeMatrixStoreKHR %178 %m3 %uint_1 %176 NonPrivatePointer - %180 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %182 = OpArrayLength %uint %23 0 - %183 = OpIMul %uint %182 %uint_2 - %184 = OpIMul %uint %uint_16 %uint_7 - %185 = OpIAdd %uint %uint_0 %184 - %186 = OpIMul %uint %185 %uint_2 - %187 = OpIAdd %uint %186 %uint_8 - %188 = OpULessThanEqual %bool %187 %183 - %189 = OpSelect %uint %188 %uint_0 %uint_0 - %190 = OpSelect %uint %188 %uint_16 %uint_4 - %191 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %192 = OpAccessChain %_ptr_StorageBuffer_half %191 %189 - %m4 = OpCooperativeMatrixLoadKHR %67 %192 %uint_0 %190 None - %195 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %196 = OpArrayLength %uint %38 0 - %197 = OpIMul %uint %196 %uint_4 - %198 = OpBitcast %uint %int_0 - %199 = OpBitcast %uint %int_16 - %200 = OpIMul %uint %199 %uint_7 - %201 = OpIAdd %uint %198 %200 - %202 = OpIMul %uint %201 %uint_4 - %203 = OpIAdd %uint %202 %uint_8 - %204 = OpULessThanEqual %bool %203 %197 - %205 = OpSelect %uint %204 %198 %uint_0 - %206 = OpSelect %uint %204 %199 %uint_2 - %207 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %208 = OpAccessChain %_ptr_StorageBuffer_uint_0 %207 %205 - OpCooperativeMatrixStoreKHR %208 %m4 %uint_1 %206 NonPrivatePointer - %210 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %212 = OpArrayLength %uint %28 0 - %213 = OpIMul %uint %212 %uint_4 - %214 = OpIMul %uint %uint_16 %uint_7 - %215 = OpIAdd %uint %uint_0 %214 - %216 = OpIMul %uint %215 %uint_4 - %217 = OpIAdd %uint %216 %uint_8 - %218 = OpULessThanEqual %bool %217 %213 - %219 = OpSelect %uint %218 %uint_0 %uint_0 - %220 = OpSelect %uint %218 %uint_16 %uint_2 - %221 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %222 = OpAccessChain %_ptr_StorageBuffer_v2half %221 %219 - %m5 = OpCooperativeMatrixLoadKHR %67 %222 %uint_0 %220 None - %225 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %226 = OpArrayLength %uint %38 0 - %227 = OpIMul %uint %226 %uint_4 - %228 = OpBitcast %uint %int_0 - %229 = OpBitcast %uint %int_16 - %230 = OpIMul %uint %229 %uint_7 - %231 = OpIAdd %uint %228 %230 - %232 = OpIMul %uint %231 %uint_4 - %233 = OpIAdd %uint %232 %uint_8 - %234 = OpULessThanEqual %bool %233 %227 - %235 = OpSelect %uint %234 %228 %uint_0 - %236 = OpSelect %uint %234 %229 %uint_2 - %237 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %238 = OpAccessChain %_ptr_StorageBuffer_uint_0 %237 %235 - OpCooperativeMatrixStoreKHR %238 %m5 %uint_1 %236 NonPrivatePointer - %240 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %242 = OpArrayLength %uint %33 0 - %243 = OpIMul %uint %242 %uint_8 - %244 = OpIMul %uint %uint_16 %uint_7 - %245 = OpIAdd %uint %uint_0 %244 - %246 = OpIMul %uint %245 %uint_8 - %247 = OpIAdd %uint %246 %uint_8 - %248 = OpULessThanEqual %bool %247 %243 - %249 = OpSelect %uint %248 %uint_0 %uint_0 - %250 = OpSelect %uint %248 %uint_16 %uint_1 - %251 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %252 = OpAccessChain %_ptr_StorageBuffer_v3half %251 %249 - %m6 = OpCooperativeMatrixLoadKHR %67 %252 %uint_0 %250 None - %255 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %256 = OpArrayLength %uint %38 0 - %257 = OpIMul %uint %256 %uint_4 - %258 = OpBitcast %uint %int_0 - %259 = OpBitcast %uint %int_16 - %260 = OpIMul %uint %259 %uint_7 - %261 = OpIAdd %uint %258 %260 - %262 = OpIMul %uint %261 %uint_4 - %263 = OpIAdd %uint %262 %uint_8 - %264 = OpULessThanEqual %bool %263 %257 - %265 = OpSelect %uint %264 %258 %uint_0 - %266 = OpSelect %uint %264 %259 %uint_2 - %267 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %268 = OpAccessChain %_ptr_StorageBuffer_uint_0 %267 %265 - OpCooperativeMatrixStoreKHR %268 %m6 %uint_1 %266 NonPrivatePointer + %178 = OpArrayLength %uint %38 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_2 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_2 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m4 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %192 = OpArrayLength %uint %28 0 + %193 = OpIMul %uint %uint_16 %uint_7 + %194 = OpIAdd %uint %uint_0 %193 + %195 = OpIAdd %uint %194 %uint_2 + %196 = OpULessThanEqual %bool %195 %192 + %197 = OpSelect %uint %196 %uint_0 %uint_0 + %198 = OpSelect %uint %196 %uint_16 %uint_2 + %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %200 = OpAccessChain %_ptr_StorageBuffer_v2half %199 %197 + %m5 = OpCooperativeMatrixLoadKHR %63 %200 %uint_0 %198 None + %203 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %204 = OpArrayLength %uint %38 0 + %205 = OpBitcast %uint %int_0 + %206 = OpBitcast %uint %int_16 + %207 = OpIMul %uint %206 %uint_7 + %208 = OpIAdd %uint %205 %207 + %209 = OpIAdd %uint %208 %uint_2 + %210 = OpULessThanEqual %bool %209 %204 + %211 = OpSelect %uint %210 %205 %uint_0 + %212 = OpSelect %uint %210 %206 %uint_2 + %213 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %214 = OpAccessChain %_ptr_StorageBuffer_uint_0 %213 %211 + OpCooperativeMatrixStoreKHR %214 %m5 %uint_1 %212 NonPrivatePointer + %216 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %218 = OpArrayLength %uint %33 0 + %219 = OpIMul %uint %uint_16 %uint_7 + %220 = OpIAdd %uint %uint_0 %219 + %221 = OpIAdd %uint %220 %uint_1 + %222 = OpULessThanEqual %bool %221 %218 + %223 = OpSelect %uint %222 %uint_0 %uint_0 + %224 = OpSelect %uint %222 %uint_16 %uint_1 + %225 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %226 = OpAccessChain %_ptr_StorageBuffer_v3half %225 %223 + %m6 = OpCooperativeMatrixLoadKHR %63 %226 %uint_0 %224 None + %229 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %230 = OpArrayLength %uint %38 0 + %231 = OpBitcast %uint %int_0 + %232 = OpBitcast %uint %int_16 + %233 = OpIMul %uint %232 %uint_7 + %234 = OpIAdd %uint %231 %233 + %235 = OpIAdd %uint %234 %uint_2 + %236 = OpULessThanEqual %bool %235 %230 + %237 = OpSelect %uint %236 %231 %uint_0 + %238 = OpSelect %uint %236 %232 %uint_2 + %239 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %240 = OpAccessChain %_ptr_StorageBuffer_uint_0 %239 %237 + OpCooperativeMatrixStoreKHR %240 %m6 %uint_1 %238 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_col_major.wgsl.expected.dxc.hlsl index 0b85933..e3a47e0 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_col_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 2u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 4u)), (select(v_4, v_3, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_u8_8x8 m1 = Matrix_result_u8_8x8::Load(in1, 0u, 64u, MatrixLayout::ColMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 4u) + 8u) <= ((v_5 / 4u) * 4u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 2u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 4u)), (select(v_8, v_7, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_u8_8x8 m2 = Matrix_result_u8_8x8::Load(in2, 0u, 64u, MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_u8_8x8 m3 = Matrix_result_u8_8x8::Load(in3, 0u, 64u, MatrixLayout::ColMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 4u) + 8u) <= ((v_13 / 4u) * 4u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 2u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 4u)), (select(v_16, v_15, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_u8_8x8 m4 = Matrix_result_u8_8x8::Load(in4, 0u, 64u, MatrixLayout::ColMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 4u) + 8u) <= ((v_17 / 4u) * 4u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 2u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 4u)), (select(v_20, v_19, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_u8_8x8 m5 = Matrix_result_u8_8x8::Load(in5, 0u, 64u, MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_u8_8x8 m6 = Matrix_result_u8_8x8::Load(in6, 0u, 64u, MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_col_major.wgsl.expected.spvasm index c783725..dd0afe4 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 202 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -141,7 +141,6 @@ %uint_1 = OpConstant %uint 1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -166,126 +165,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_1 %uint_16 None %60 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %62 = OpArrayLength %uint %39 0 - %63 = OpIMul %uint %62 %uint_4 - %65 = OpBitcast %uint %int_0 - %67 = OpBitcast %uint %int_16 - %69 = OpIMul %uint %67 %uint_7 - %71 = OpIAdd %uint %65 %69 - %72 = OpIMul %uint %71 %uint_4 - %73 = OpIAdd %uint %72 %uint_8 - %74 = OpULessThanEqual %bool %73 %63 - %76 = OpSelect %uint %74 %65 %uint_0 - %77 = OpSelect %uint %74 %67 %uint_2 - %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %79 = OpAccessChain %_ptr_StorageBuffer_uint_0 %78 %76 - OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %82 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %84 %uint_1 %uint_16 None - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %88 = OpArrayLength %uint %39 0 - %89 = OpIMul %uint %88 %uint_4 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_2 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint_0 %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v3float %102 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %104 %uint_1 %uint_16 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %108 = OpArrayLength %uint %39 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m2 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v4uint %122 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %124 %uint_1 %uint_16 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %128 = OpArrayLength %uint %39 0 - %129 = OpIMul %uint %128 %uint_4 - %130 = OpBitcast %uint %int_0 - %131 = OpBitcast %uint %int_16 - %132 = OpIMul %uint %131 %uint_7 - %133 = OpIAdd %uint %130 %132 - %134 = OpIMul %uint %133 %uint_4 - %135 = OpIAdd %uint %134 %uint_8 - %136 = OpULessThanEqual %bool %135 %129 - %137 = OpSelect %uint %136 %130 %uint_0 - %138 = OpSelect %uint %136 %131 %uint_2 - %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %140 = OpAccessChain %_ptr_StorageBuffer_uint_0 %139 %137 - OpCooperativeMatrixStoreKHR %140 %m3 %uint_1 %138 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %144 = OpAccessChain %_ptr_StorageBuffer_half %142 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %144 %uint_1 %uint_16 None - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %148 = OpArrayLength %uint %39 0 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpBitcast %uint %int_0 - %151 = OpBitcast %uint %int_16 - %152 = OpIMul %uint %151 %uint_7 - %153 = OpIAdd %uint %150 %152 - %154 = OpIMul %uint %153 %uint_4 - %155 = OpIAdd %uint %154 %uint_8 - %156 = OpULessThanEqual %bool %155 %149 - %157 = OpSelect %uint %156 %150 %uint_0 - %158 = OpSelect %uint %156 %151 %uint_2 - %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %160 = OpAccessChain %_ptr_StorageBuffer_uint_0 %159 %157 - OpCooperativeMatrixStoreKHR %160 %m4 %uint_1 %158 NonPrivatePointer - %162 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v2half %162 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %164 %uint_1 %uint_16 None - %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %168 = OpArrayLength %uint %39 0 - %169 = OpIMul %uint %168 %uint_4 - %170 = OpBitcast %uint %int_0 - %171 = OpBitcast %uint %int_16 - %172 = OpIMul %uint %171 %uint_7 - %173 = OpIAdd %uint %170 %172 - %174 = OpIMul %uint %173 %uint_4 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %169 - %177 = OpSelect %uint %176 %170 %uint_0 - %178 = OpSelect %uint %176 %171 %uint_2 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_uint_0 %179 %177 - OpCooperativeMatrixStoreKHR %180 %m5 %uint_1 %178 NonPrivatePointer - %182 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %184 = OpAccessChain %_ptr_StorageBuffer_v3half %182 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %184 %uint_1 %uint_16 None - %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %188 = OpArrayLength %uint %39 0 - %189 = OpIMul %uint %188 %uint_4 - %190 = OpBitcast %uint %int_0 - %191 = OpBitcast %uint %int_16 - %192 = OpIMul %uint %191 %uint_7 - %193 = OpIAdd %uint %190 %192 - %194 = OpIMul %uint %193 %uint_4 - %195 = OpIAdd %uint %194 %uint_8 - %196 = OpULessThanEqual %bool %195 %189 - %197 = OpSelect %uint %196 %190 %uint_0 - %198 = OpSelect %uint %196 %191 %uint_2 - %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %200 = OpAccessChain %_ptr_StorageBuffer_uint_0 %199 %197 - OpCooperativeMatrixStoreKHR %200 %m6 %uint_1 %198 NonPrivatePointer + %63 = OpBitcast %uint %int_0 + %65 = OpBitcast %uint %int_16 + %67 = OpIMul %uint %65 %uint_7 + %69 = OpIAdd %uint %63 %67 + %70 = OpIAdd %uint %69 %uint_2 + %71 = OpULessThanEqual %bool %70 %62 + %73 = OpSelect %uint %71 %63 %uint_0 + %74 = OpSelect %uint %71 %65 %uint_2 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_uint_0 %75 %73 + OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_1 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_1 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_2 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_2 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_1 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_2 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_2 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_1 %uint_16 None + %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_2 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_2 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_1 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_2 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_2 + %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_1 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_2 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_2 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_row_major.wgsl.expected.dxc.hlsl index 07897dd..bca7a12 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_row_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 2u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 4u)), (select(v_4, v_3, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_u8_8x8 m1 = Matrix_result_u8_8x8::Load(in1, 0u, 64u, MatrixLayout::RowMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 4u) + 8u) <= ((v_5 / 4u) * 4u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 2u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 4u)), (select(v_8, v_7, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_u8_8x8 m2 = Matrix_result_u8_8x8::Load(in2, 0u, 64u, MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_u8_8x8 m3 = Matrix_result_u8_8x8::Load(in3, 0u, 64u, MatrixLayout::RowMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 4u) + 8u) <= ((v_13 / 4u) * 4u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 2u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 4u)), (select(v_16, v_15, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_u8_8x8 m4 = Matrix_result_u8_8x8::Load(in4, 0u, 64u, MatrixLayout::RowMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 4u) + 8u) <= ((v_17 / 4u) * 4u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 2u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 4u)), (select(v_20, v_19, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_u8_8x8 m5 = Matrix_result_u8_8x8::Load(in5, 0u, 64u, MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); Matrix_result_u8_8x8 m6 = Matrix_result_u8_8x8::Load(in6, 0u, 64u, MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_row_major.wgsl.expected.spvasm index 26110f9..d25a8dd 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_result_u8_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 202 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -140,7 +140,6 @@ %53 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_2 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -166,126 +165,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_0 %uint_16 None %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %61 = OpArrayLength %uint %39 0 - %62 = OpIMul %uint %61 %uint_4 - %64 = OpBitcast %uint %int_0 - %66 = OpBitcast %uint %int_16 - %68 = OpIMul %uint %66 %uint_7 - %70 = OpIAdd %uint %64 %68 - %71 = OpIMul %uint %70 %uint_4 - %72 = OpIAdd %uint %71 %uint_8 - %73 = OpULessThanEqual %bool %72 %62 - %75 = OpSelect %uint %73 %64 %uint_0 - %76 = OpSelect %uint %73 %66 %uint_2 - %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %78 = OpAccessChain %_ptr_StorageBuffer_uint_0 %77 %75 - OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %76 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %82 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %84 %uint_0 %uint_16 None - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %88 = OpArrayLength %uint %39 0 - %89 = OpIMul %uint %88 %uint_4 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_2 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint_0 %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v3float %102 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %104 %uint_0 %uint_16 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %108 = OpArrayLength %uint %39 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m2 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v4uint %122 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %124 %uint_0 %uint_16 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %128 = OpArrayLength %uint %39 0 - %129 = OpIMul %uint %128 %uint_4 - %130 = OpBitcast %uint %int_0 - %131 = OpBitcast %uint %int_16 - %132 = OpIMul %uint %131 %uint_7 - %133 = OpIAdd %uint %130 %132 - %134 = OpIMul %uint %133 %uint_4 - %135 = OpIAdd %uint %134 %uint_8 - %136 = OpULessThanEqual %bool %135 %129 - %137 = OpSelect %uint %136 %130 %uint_0 - %138 = OpSelect %uint %136 %131 %uint_2 - %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %140 = OpAccessChain %_ptr_StorageBuffer_uint_0 %139 %137 - OpCooperativeMatrixStoreKHR %140 %m3 %uint_1 %138 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %144 = OpAccessChain %_ptr_StorageBuffer_half %142 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %144 %uint_0 %uint_16 None - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %148 = OpArrayLength %uint %39 0 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpBitcast %uint %int_0 - %151 = OpBitcast %uint %int_16 - %152 = OpIMul %uint %151 %uint_7 - %153 = OpIAdd %uint %150 %152 - %154 = OpIMul %uint %153 %uint_4 - %155 = OpIAdd %uint %154 %uint_8 - %156 = OpULessThanEqual %bool %155 %149 - %157 = OpSelect %uint %156 %150 %uint_0 - %158 = OpSelect %uint %156 %151 %uint_2 - %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %160 = OpAccessChain %_ptr_StorageBuffer_uint_0 %159 %157 - OpCooperativeMatrixStoreKHR %160 %m4 %uint_1 %158 NonPrivatePointer - %162 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v2half %162 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %164 %uint_0 %uint_16 None - %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %168 = OpArrayLength %uint %39 0 - %169 = OpIMul %uint %168 %uint_4 - %170 = OpBitcast %uint %int_0 - %171 = OpBitcast %uint %int_16 - %172 = OpIMul %uint %171 %uint_7 - %173 = OpIAdd %uint %170 %172 - %174 = OpIMul %uint %173 %uint_4 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %169 - %177 = OpSelect %uint %176 %170 %uint_0 - %178 = OpSelect %uint %176 %171 %uint_2 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_uint_0 %179 %177 - OpCooperativeMatrixStoreKHR %180 %m5 %uint_1 %178 NonPrivatePointer - %182 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %184 = OpAccessChain %_ptr_StorageBuffer_v3half %182 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %184 %uint_0 %uint_16 None - %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %188 = OpArrayLength %uint %39 0 - %189 = OpIMul %uint %188 %uint_4 - %190 = OpBitcast %uint %int_0 - %191 = OpBitcast %uint %int_16 - %192 = OpIMul %uint %191 %uint_7 - %193 = OpIAdd %uint %190 %192 - %194 = OpIMul %uint %193 %uint_4 - %195 = OpIAdd %uint %194 %uint_8 - %196 = OpULessThanEqual %bool %195 %189 - %197 = OpSelect %uint %196 %190 %uint_0 - %198 = OpSelect %uint %196 %191 %uint_2 - %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %200 = OpAccessChain %_ptr_StorageBuffer_uint_0 %199 %197 - OpCooperativeMatrixStoreKHR %200 %m6 %uint_1 %198 NonPrivatePointer + %62 = OpBitcast %uint %int_0 + %64 = OpBitcast %uint %int_16 + %66 = OpIMul %uint %64 %uint_7 + %68 = OpIAdd %uint %62 %66 + %69 = OpIAdd %uint %68 %uint_2 + %70 = OpULessThanEqual %bool %69 %61 + %72 = OpSelect %uint %70 %62 %uint_0 + %73 = OpSelect %uint %70 %64 %uint_2 + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %75 = OpAccessChain %_ptr_StorageBuffer_uint_0 %74 %72 + OpCooperativeMatrixStoreKHR %75 %m0 %uint_1 %73 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_0 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_0 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_2 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_2 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_0 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_2 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_2 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_0 %uint_16 None + %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_2 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_2 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_0 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_2 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_2 + %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_0 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_2 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_2 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl index 94445bd..8becaa4 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -14,43 +14,43 @@ void main() { uint v_1 = 0u; in0.GetDimensions(v_1); - bool v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_1 / 4u) * 2u)); + bool v_2 = (((0u + (16u * 7u)) + 4u) <= (v_1 / 4u)); Matrix_right_f16_8x8 m0 = Matrix_right_f16_8x8::Load(in0, (0u + (select(v_2, 0u, 0u) * 2u)), (select(v_2, 16u, 4u) * 2u), MatrixLayout::ColMajor); uint v_3 = 0u; v.GetDimensions(v_3); uint v_4 = asuint(int(0)); uint v_5 = asuint(int(16)); - bool v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= ((v_3 / 4u) * 2u)); + bool v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= (v_3 / 4u)); m0.Store(v, (0u + (select(v_6, v_4, 0u) * 2u)), (select(v_6, v_5, 4u) * 2u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_7 / 8u) * 4u)); + bool v_8 = (((0u + (16u * 7u)) + 2u) <= (v_7 / 8u)); Matrix_right_f16_8x8 m1 = Matrix_right_f16_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 2u)), (select(v_8, 16u, 2u) * 2u), MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 2u) + 8u) <= ((v_9 / 4u) * 2u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 4u) <= (v_9 / 4u)); m1.Store(v, (0u + (select(v_12, v_10, 0u) * 2u)), (select(v_12, v_11, 4u) * 2u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_13 / 16u) * 8u)); + bool v_14 = (((0u + (16u * 7u)) + 1u) <= (v_13 / 16u)); Matrix_right_f16_8x8 m2 = Matrix_right_f16_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 2u)), (select(v_14, 16u, 1u) * 2u), MatrixLayout::ColMajor); uint v_15 = 0u; v.GetDimensions(v_15); uint v_16 = asuint(int(0)); uint v_17 = asuint(int(16)); - bool v_18 = ((((v_16 + (v_17 * 7u)) * 2u) + 8u) <= ((v_15 / 4u) * 2u)); + bool v_18 = (((v_16 + (v_17 * 7u)) + 4u) <= (v_15 / 4u)); m2.Store(v, (0u + (select(v_18, v_16, 0u) * 2u)), (select(v_18, v_17, 4u) * 2u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_19 / 16u) * 8u)); + bool v_20 = (((0u + (16u * 7u)) + 1u) <= (v_19 / 16u)); Matrix_right_f16_8x8 m3 = Matrix_right_f16_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 2u)), (select(v_20, 16u, 1u) * 2u), MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 2u) + 8u) <= ((v_21 / 4u) * 2u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 4u) <= (v_21 / 4u)); m3.Store(v, (0u + (select(v_24, v_22, 0u) * 2u)), (select(v_24, v_23, 4u) * 2u), MatrixLayout::ColMajor); uint v_25 = 0u; in4.GetDimensions(v_25); @@ -60,27 +60,27 @@ v.GetDimensions(v_27); uint v_28 = asuint(int(0)); uint v_29 = asuint(int(16)); - bool v_30 = ((((v_28 + (v_29 * 7u)) * 2u) + 8u) <= ((v_27 / 4u) * 2u)); + bool v_30 = (((v_28 + (v_29 * 7u)) + 4u) <= (v_27 / 4u)); m4.Store(v, (0u + (select(v_30, v_28, 0u) * 2u)), (select(v_30, v_29, 4u) * 2u), MatrixLayout::ColMajor); uint v_31 = 0u; in5.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_31 / 4u) * 2u)); + bool v_32 = (((0u + (16u * 7u)) + 4u) <= (v_31 / 4u)); Matrix_right_f16_8x8 m5 = Matrix_right_f16_8x8::Load(in5, (0u + (select(v_32, 0u, 0u) * 2u)), (select(v_32, 16u, 4u) * 2u), MatrixLayout::ColMajor); uint v_33 = 0u; v.GetDimensions(v_33); uint v_34 = asuint(int(0)); uint v_35 = asuint(int(16)); - bool v_36 = ((((v_34 + (v_35 * 7u)) * 2u) + 8u) <= ((v_33 / 4u) * 2u)); + bool v_36 = (((v_34 + (v_35 * 7u)) + 4u) <= (v_33 / 4u)); m5.Store(v, (0u + (select(v_36, v_34, 0u) * 2u)), (select(v_36, v_35, 4u) * 2u), MatrixLayout::ColMajor); uint v_37 = 0u; in6.GetDimensions(v_37); - bool v_38 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_37 / 8u) * 4u)); + bool v_38 = (((0u + (16u * 7u)) + 2u) <= (v_37 / 8u)); Matrix_right_f16_8x8 m6 = Matrix_right_f16_8x8::Load(in6, (0u + (select(v_38, 0u, 0u) * 2u)), (select(v_38, 16u, 2u) * 2u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 2u) + 8u) <= ((v_39 / 4u) * 2u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 4u) <= (v_39 / 4u)); m6.Store(v, (0u + (select(v_42, v_40, 0u) * 2u)), (select(v_42, v_41, 4u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_col_major.wgsl.expected.msl index 5dc6c09..1b86e40 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_col_major.wgsl.expected.msl
@@ -50,37 +50,37 @@ kernel void v(const device tint_array<uint, 1>* in0 [[buffer(0)]], const device tint_array<int2, 1>* in1 [[buffer(1)]], const device tint_array<tint_packed_vec3_f32_array_element, 1>* in2 [[buffer(2)]], const device tint_array<uint4, 1>* in3 [[buffer(3)]], const device tint_array<half, 1>* in4 [[buffer(4)]], const device tint_array<half2, 1>* in5 [[buffer(5)]], const device tint_array<tint_packed_vec3_f16_array_element, 1>* in6 [[buffer(6)]], device tint_array<uint, 1>* out [[buffer(7)]], const constant tint_array<uint4, 2>* tint_storage_buffer_sizes [[buffer(30)]]) { tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.in0=in0, .in1=in1, .in2=in2, .in3=in3, .in4=in4, .in5=in5, .in6=in6, .out=out, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; tint_array_lengths_struct const v_1 = tint_array_lengths_struct{.tint_array_length_0_0=((*tint_module_vars.tint_storage_buffer_sizes)[0u].x / 4u), .tint_array_length_0_7=((*tint_module_vars.tint_storage_buffer_sizes)[1u].w / 4u), .tint_array_length_0_1=((*tint_module_vars.tint_storage_buffer_sizes)[0u].y / 8u), .tint_array_length_0_2=((*tint_module_vars.tint_storage_buffer_sizes)[0u].z / 16u), .tint_array_length_0_3=((*tint_module_vars.tint_storage_buffer_sizes)[0u].w / 16u), .tint_array_length_0_4=((*tint_module_vars.tint_storage_buffer_sizes)[1u].x / 2u), .tint_array_length_0_5=((*tint_module_vars.tint_storage_buffer_sizes)[1u].y / 4u), .tint_array_length_0_6=((*tint_module_vars.tint_storage_buffer_sizes)[1u].z / 8u)}; - bool const v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_0 * 2u)); + bool const v_2 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_0); simdgroup_half8x8 v_3 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_3, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in0) + (select(0u, 0u, v_2) * 4u)), ulong((select(4u, 16u, v_2) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 const m0 = v_3; uint const v_4 = as_type<uint>(0); uint const v_5 = as_type<uint>(16); - bool const v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_4, v_6) * 4u)), ulong((select(4u, v_5, v_6) * 2u)), ulong2(0ul), true)); - bool const v_7 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_1 * 4u)); + bool const v_7 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_1); simdgroup_half8x8 v_8 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_8, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (select(0u, 0u, v_7) * 8u)), ulong((select(2u, 16u, v_7) * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m1 = v_8; uint const v_9 = as_type<uint>(0); uint const v_10 = as_type<uint>(16); - bool const v_11 = ((((v_9 + (v_10 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_11 = (((v_9 + (v_10 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_9, v_11) * 4u)), ulong((select(4u, v_10, v_11) * 2u)), ulong2(0ul), true)); - bool const v_12 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_2 * 8u)); + bool const v_12 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_2); simdgroup_half8x8 v_13 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_13, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (select(0u, 0u, v_12) * 16u)), ulong((select(1u, 16u, v_12) * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m2 = v_13; uint const v_14 = as_type<uint>(0); uint const v_15 = as_type<uint>(16); - bool const v_16 = ((((v_14 + (v_15 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_16 = (((v_14 + (v_15 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_14, v_16) * 4u)), ulong((select(4u, v_15, v_16) * 2u)), ulong2(0ul), true)); - bool const v_17 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_3 * 8u)); + bool const v_17 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_3); simdgroup_half8x8 v_18 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_18, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (select(0u, 0u, v_17) * 16u)), ulong((select(1u, 16u, v_17) * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m3 = v_18; uint const v_19 = as_type<uint>(0); uint const v_20 = as_type<uint>(16); - bool const v_21 = ((((v_19 + (v_20 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_21 = (((v_19 + (v_20 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_19, v_21) * 4u)), ulong((select(4u, v_20, v_21) * 2u)), ulong2(0ul), true)); bool const v_22 = (((0u + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); simdgroup_half8x8 v_23 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); @@ -88,22 +88,22 @@ simdgroup_half8x8 const m4 = v_23; uint const v_24 = as_type<uint>(0); uint const v_25 = as_type<uint>(16); - bool const v_26 = ((((v_24 + (v_25 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_26 = (((v_24 + (v_25 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_24, v_26) * 4u)), ulong((select(4u, v_25, v_26) * 2u)), ulong2(0ul), true)); - bool const v_27 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_27 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); simdgroup_half8x8 v_28 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_28, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in5) + (select(0u, 0u, v_27) * 4u)), ulong((select(4u, 16u, v_27) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 const m5 = v_28; uint const v_29 = as_type<uint>(0); uint const v_30 = as_type<uint>(16); - bool const v_31 = ((((v_29 + (v_30 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_31 = (((v_29 + (v_30 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_29, v_31) * 4u)), ulong((select(4u, v_30, v_31) * 2u)), ulong2(0ul), true)); - bool const v_32 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_6 * 4u)); + bool const v_32 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_6); simdgroup_half8x8 v_33 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_33, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (select(0u, 0u, v_32) * 8u)), ulong((select(2u, 16u, v_32) * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m6 = v_33; uint const v_34 = as_type<uint>(0); uint const v_35 = as_type<uint>(16); - bool const v_36 = ((((v_34 + (v_35 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_36 = (((v_34 + (v_35 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_34, v_36) * 4u)), ulong((select(4u, v_35, v_36) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_col_major.wgsl.expected.spvasm index fcf44a2..937cfca 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 267 +; Bound: 241 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,21 +128,21 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_2 = OpConstant %uint 2 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %uint_1 = OpConstant %uint 1 - %67 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_1 + %63 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_1 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float @@ -158,197 +158,171 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_2 - %51 = OpIMul %uint %uint_16 %uint_7 - %54 = OpIAdd %uint %uint_0 %51 - %55 = OpIMul %uint %54 %uint_2 - %56 = OpIAdd %uint %55 %uint_8 - %58 = OpULessThanEqual %bool %56 %49 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_4 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - %m0 = OpCooperativeMatrixLoadKHR %67 %64 %uint_1 %61 None - %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %72 = OpArrayLength %uint %38 0 - %73 = OpIMul %uint %72 %uint_2 - %74 = OpBitcast %uint %int_0 - %76 = OpBitcast %uint %int_16 - %78 = OpIMul %uint %76 %uint_7 - %79 = OpIAdd %uint %74 %78 - %80 = OpIMul %uint %79 %uint_2 - %81 = OpIAdd %uint %80 %uint_8 - %82 = OpULessThanEqual %bool %81 %73 - %83 = OpSelect %uint %82 %74 %uint_0 - %84 = OpSelect %uint %82 %76 %uint_4 - %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %86 = OpAccessChain %_ptr_StorageBuffer_uint_0 %85 %83 - OpCooperativeMatrixStoreKHR %86 %m0 %uint_1 %84 NonPrivatePointer - %89 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %91 = OpArrayLength %uint %6 0 - %92 = OpIMul %uint %91 %uint_4 - %93 = OpIMul %uint %uint_16 %uint_7 - %94 = OpIAdd %uint %uint_0 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %92 - %98 = OpSelect %uint %97 %uint_0 %uint_0 - %99 = OpSelect %uint %97 %uint_16 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_v2int %100 %98 - %m1 = OpCooperativeMatrixLoadKHR %67 %101 %uint_1 %99 None - %104 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %105 = OpArrayLength %uint %38 0 - %106 = OpIMul %uint %105 %uint_2 - %107 = OpBitcast %uint %int_0 - %108 = OpBitcast %uint %int_16 - %109 = OpIMul %uint %108 %uint_7 - %110 = OpIAdd %uint %107 %109 - %111 = OpIMul %uint %110 %uint_2 - %112 = OpIAdd %uint %111 %uint_8 - %113 = OpULessThanEqual %bool %112 %106 - %114 = OpSelect %uint %113 %107 %uint_0 - %115 = OpSelect %uint %113 %108 %uint_4 - %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %117 = OpAccessChain %_ptr_StorageBuffer_uint_0 %116 %114 - OpCooperativeMatrixStoreKHR %117 %m1 %uint_1 %115 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %121 = OpArrayLength %uint %12 0 - %122 = OpIMul %uint %121 %uint_8 - %123 = OpIMul %uint %uint_16 %uint_7 - %124 = OpIAdd %uint %uint_0 %123 - %125 = OpIMul %uint %124 %uint_8 - %126 = OpIAdd %uint %125 %uint_8 - %127 = OpULessThanEqual %bool %126 %122 - %128 = OpSelect %uint %127 %uint_0 %uint_0 - %129 = OpSelect %uint %127 %uint_16 %uint_1 - %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %131 = OpAccessChain %_ptr_StorageBuffer_v3float %130 %128 - %m2 = OpCooperativeMatrixLoadKHR %67 %131 %uint_1 %129 None + %49 = OpIMul %uint %uint_16 %uint_7 + %52 = OpIAdd %uint %uint_0 %49 + %53 = OpIAdd %uint %52 %uint_4 + %55 = OpULessThanEqual %bool %53 %48 + %57 = OpSelect %uint %55 %uint_0 %uint_0 + %58 = OpSelect %uint %55 %uint_16 %uint_4 + %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %60 = OpAccessChain %_ptr_StorageBuffer_uint %59 %57 + %m0 = OpCooperativeMatrixLoadKHR %63 %60 %uint_1 %58 None + %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %69 = OpArrayLength %uint %38 0 + %70 = OpBitcast %uint %int_0 + %72 = OpBitcast %uint %int_16 + %74 = OpIMul %uint %72 %uint_7 + %75 = OpIAdd %uint %70 %74 + %76 = OpIAdd %uint %75 %uint_4 + %77 = OpULessThanEqual %bool %76 %69 + %78 = OpSelect %uint %77 %70 %uint_0 + %79 = OpSelect %uint %77 %72 %uint_4 + %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_uint_0 %80 %78 + OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %79 NonPrivatePointer + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %86 = OpArrayLength %uint %6 0 + %87 = OpIMul %uint %uint_16 %uint_7 + %88 = OpIAdd %uint %uint_0 %87 + %89 = OpIAdd %uint %88 %uint_2 + %91 = OpULessThanEqual %bool %89 %86 + %92 = OpSelect %uint %91 %uint_0 %uint_0 + %93 = OpSelect %uint %91 %uint_16 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %92 + %m1 = OpCooperativeMatrixLoadKHR %63 %95 %uint_1 %93 None + %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %99 = OpArrayLength %uint %38 0 + %100 = OpBitcast %uint %int_0 + %101 = OpBitcast %uint %int_16 + %102 = OpIMul %uint %101 %uint_7 + %103 = OpIAdd %uint %100 %102 + %104 = OpIAdd %uint %103 %uint_4 + %105 = OpULessThanEqual %bool %104 %99 + %106 = OpSelect %uint %105 %100 %uint_0 + %107 = OpSelect %uint %105 %101 %uint_4 + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 + OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %113 = OpArrayLength %uint %12 0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %uint_0 %114 + %116 = OpIAdd %uint %115 %uint_1 + %117 = OpULessThanEqual %bool %116 %113 + %118 = OpSelect %uint %117 %uint_0 %uint_0 + %119 = OpSelect %uint %117 %uint_16 %uint_1 + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 + %m2 = OpCooperativeMatrixLoadKHR %63 %121 %uint_1 %119 None + %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %125 = OpArrayLength %uint %38 0 + %126 = OpBitcast %uint %int_0 + %127 = OpBitcast %uint %int_16 + %128 = OpIMul %uint %127 %uint_7 + %129 = OpIAdd %uint %126 %128 + %130 = OpIAdd %uint %129 %uint_4 + %131 = OpULessThanEqual %bool %130 %125 + %132 = OpSelect %uint %131 %126 %uint_0 + %133 = OpSelect %uint %131 %127 %uint_4 %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %135 = OpArrayLength %uint %38 0 - %136 = OpIMul %uint %135 %uint_2 - %137 = OpBitcast %uint %int_0 - %138 = OpBitcast %uint %int_16 - %139 = OpIMul %uint %138 %uint_7 - %140 = OpIAdd %uint %137 %139 - %141 = OpIMul %uint %140 %uint_2 - %142 = OpIAdd %uint %141 %uint_8 - %143 = OpULessThanEqual %bool %142 %136 - %144 = OpSelect %uint %143 %137 %uint_0 - %145 = OpSelect %uint %143 %138 %uint_4 - %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %147 = OpAccessChain %_ptr_StorageBuffer_uint_0 %146 %144 - OpCooperativeMatrixStoreKHR %147 %m2 %uint_1 %145 NonPrivatePointer - %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %151 = OpArrayLength %uint %18 0 - %152 = OpIMul %uint %151 %uint_8 - %153 = OpIMul %uint %uint_16 %uint_7 - %154 = OpIAdd %uint %uint_0 %153 - %155 = OpIMul %uint %154 %uint_8 - %156 = OpIAdd %uint %155 %uint_8 - %157 = OpULessThanEqual %bool %156 %152 - %158 = OpSelect %uint %157 %uint_0 %uint_0 - %159 = OpSelect %uint %157 %uint_16 %uint_1 - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %161 = OpAccessChain %_ptr_StorageBuffer_v4uint %160 %158 - %m3 = OpCooperativeMatrixLoadKHR %67 %161 %uint_1 %159 None - %164 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %165 = OpArrayLength %uint %38 0 - %166 = OpIMul %uint %165 %uint_2 - %167 = OpBitcast %uint %int_0 - %168 = OpBitcast %uint %int_16 - %169 = OpIMul %uint %168 %uint_7 - %170 = OpIAdd %uint %167 %169 - %171 = OpIMul %uint %170 %uint_2 - %172 = OpIAdd %uint %171 %uint_8 - %173 = OpULessThanEqual %bool %172 %166 - %174 = OpSelect %uint %173 %167 %uint_0 - %175 = OpSelect %uint %173 %168 %uint_4 + %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 + OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %139 = OpArrayLength %uint %18 0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %uint_0 %140 + %142 = OpIAdd %uint %141 %uint_1 + %143 = OpULessThanEqual %bool %142 %139 + %144 = OpSelect %uint %143 %uint_0 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_1 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %63 %147 %uint_1 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %151 = OpArrayLength %uint %38 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_4 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_4 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpIMul %uint %uint_16 %uint_7 + %167 = OpIAdd %uint %uint_0 %166 + %168 = OpIAdd %uint %167 %uint_8 + %169 = OpULessThanEqual %bool %168 %165 + %170 = OpSelect %uint %169 %uint_0 %uint_0 + %171 = OpSelect %uint %169 %uint_16 %uint_8 + %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %173 = OpAccessChain %_ptr_StorageBuffer_half %172 %170 + %m4 = OpCooperativeMatrixLoadKHR %63 %173 %uint_1 %171 None %176 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %177 = OpAccessChain %_ptr_StorageBuffer_uint_0 %176 %174 - OpCooperativeMatrixStoreKHR %177 %m3 %uint_1 %175 NonPrivatePointer - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %181 = OpArrayLength %uint %23 0 - %182 = OpIMul %uint %uint_16 %uint_7 - %183 = OpIAdd %uint %uint_0 %182 - %184 = OpIAdd %uint %183 %uint_8 - %185 = OpULessThanEqual %bool %184 %181 - %186 = OpSelect %uint %185 %uint_0 %uint_0 - %187 = OpSelect %uint %185 %uint_16 %uint_8 - %188 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %189 = OpAccessChain %_ptr_StorageBuffer_half %188 %186 - %m4 = OpCooperativeMatrixLoadKHR %67 %189 %uint_1 %187 None - %192 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %193 = OpArrayLength %uint %38 0 - %194 = OpIMul %uint %193 %uint_2 - %195 = OpBitcast %uint %int_0 - %196 = OpBitcast %uint %int_16 - %197 = OpIMul %uint %196 %uint_7 - %198 = OpIAdd %uint %195 %197 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpIAdd %uint %199 %uint_8 - %201 = OpULessThanEqual %bool %200 %194 - %202 = OpSelect %uint %201 %195 %uint_0 - %203 = OpSelect %uint %201 %196 %uint_4 - %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %205 = OpAccessChain %_ptr_StorageBuffer_uint_0 %204 %202 - OpCooperativeMatrixStoreKHR %205 %m4 %uint_1 %203 NonPrivatePointer - %207 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %209 = OpArrayLength %uint %28 0 - %210 = OpIMul %uint %209 %uint_2 - %211 = OpIMul %uint %uint_16 %uint_7 - %212 = OpIAdd %uint %uint_0 %211 - %213 = OpIMul %uint %212 %uint_2 - %214 = OpIAdd %uint %213 %uint_8 - %215 = OpULessThanEqual %bool %214 %210 - %216 = OpSelect %uint %215 %uint_0 %uint_0 - %217 = OpSelect %uint %215 %uint_16 %uint_4 - %218 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %219 = OpAccessChain %_ptr_StorageBuffer_v2half %218 %216 - %m5 = OpCooperativeMatrixLoadKHR %67 %219 %uint_1 %217 None - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %223 = OpArrayLength %uint %38 0 - %224 = OpIMul %uint %223 %uint_2 - %225 = OpBitcast %uint %int_0 - %226 = OpBitcast %uint %int_16 - %227 = OpIMul %uint %226 %uint_7 - %228 = OpIAdd %uint %225 %227 - %229 = OpIMul %uint %228 %uint_2 - %230 = OpIAdd %uint %229 %uint_8 - %231 = OpULessThanEqual %bool %230 %224 - %232 = OpSelect %uint %231 %225 %uint_0 - %233 = OpSelect %uint %231 %226 %uint_4 - %234 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %235 = OpAccessChain %_ptr_StorageBuffer_uint_0 %234 %232 - OpCooperativeMatrixStoreKHR %235 %m5 %uint_1 %233 NonPrivatePointer - %237 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %239 = OpArrayLength %uint %33 0 - %240 = OpIMul %uint %239 %uint_4 - %241 = OpIMul %uint %uint_16 %uint_7 - %242 = OpIAdd %uint %uint_0 %241 - %243 = OpIMul %uint %242 %uint_4 - %244 = OpIAdd %uint %243 %uint_8 - %245 = OpULessThanEqual %bool %244 %240 - %246 = OpSelect %uint %245 %uint_0 %uint_0 - %247 = OpSelect %uint %245 %uint_16 %uint_2 - %248 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %249 = OpAccessChain %_ptr_StorageBuffer_v3half %248 %246 - %m6 = OpCooperativeMatrixLoadKHR %67 %249 %uint_1 %247 None - %252 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %253 = OpArrayLength %uint %38 0 - %254 = OpIMul %uint %253 %uint_2 - %255 = OpBitcast %uint %int_0 - %256 = OpBitcast %uint %int_16 - %257 = OpIMul %uint %256 %uint_7 - %258 = OpIAdd %uint %255 %257 - %259 = OpIMul %uint %258 %uint_2 - %260 = OpIAdd %uint %259 %uint_8 - %261 = OpULessThanEqual %bool %260 %254 - %262 = OpSelect %uint %261 %255 %uint_0 - %263 = OpSelect %uint %261 %256 %uint_4 - %264 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %265 = OpAccessChain %_ptr_StorageBuffer_uint_0 %264 %262 - OpCooperativeMatrixStoreKHR %265 %m6 %uint_1 %263 NonPrivatePointer + %177 = OpArrayLength %uint %38 0 + %178 = OpBitcast %uint %int_0 + %179 = OpBitcast %uint %int_16 + %180 = OpIMul %uint %179 %uint_7 + %181 = OpIAdd %uint %178 %180 + %182 = OpIAdd %uint %181 %uint_4 + %183 = OpULessThanEqual %bool %182 %177 + %184 = OpSelect %uint %183 %178 %uint_0 + %185 = OpSelect %uint %183 %179 %uint_4 + %186 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %187 = OpAccessChain %_ptr_StorageBuffer_uint_0 %186 %184 + OpCooperativeMatrixStoreKHR %187 %m4 %uint_1 %185 NonPrivatePointer + %189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %191 = OpArrayLength %uint %28 0 + %192 = OpIMul %uint %uint_16 %uint_7 + %193 = OpIAdd %uint %uint_0 %192 + %194 = OpIAdd %uint %193 %uint_4 + %195 = OpULessThanEqual %bool %194 %191 + %196 = OpSelect %uint %195 %uint_0 %uint_0 + %197 = OpSelect %uint %195 %uint_16 %uint_4 + %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %199 = OpAccessChain %_ptr_StorageBuffer_v2half %198 %196 + %m5 = OpCooperativeMatrixLoadKHR %63 %199 %uint_1 %197 None + %202 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %203 = OpArrayLength %uint %38 0 + %204 = OpBitcast %uint %int_0 + %205 = OpBitcast %uint %int_16 + %206 = OpIMul %uint %205 %uint_7 + %207 = OpIAdd %uint %204 %206 + %208 = OpIAdd %uint %207 %uint_4 + %209 = OpULessThanEqual %bool %208 %203 + %210 = OpSelect %uint %209 %204 %uint_0 + %211 = OpSelect %uint %209 %205 %uint_4 + %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %213 = OpAccessChain %_ptr_StorageBuffer_uint_0 %212 %210 + OpCooperativeMatrixStoreKHR %213 %m5 %uint_1 %211 NonPrivatePointer + %215 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %217 = OpArrayLength %uint %33 0 + %218 = OpIMul %uint %uint_16 %uint_7 + %219 = OpIAdd %uint %uint_0 %218 + %220 = OpIAdd %uint %219 %uint_2 + %221 = OpULessThanEqual %bool %220 %217 + %222 = OpSelect %uint %221 %uint_0 %uint_0 + %223 = OpSelect %uint %221 %uint_16 %uint_2 + %224 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %225 = OpAccessChain %_ptr_StorageBuffer_v3half %224 %222 + %m6 = OpCooperativeMatrixLoadKHR %63 %225 %uint_1 %223 None + %228 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %229 = OpArrayLength %uint %38 0 + %230 = OpBitcast %uint %int_0 + %231 = OpBitcast %uint %int_16 + %232 = OpIMul %uint %231 %uint_7 + %233 = OpIAdd %uint %230 %232 + %234 = OpIAdd %uint %233 %uint_4 + %235 = OpULessThanEqual %bool %234 %229 + %236 = OpSelect %uint %235 %230 %uint_0 + %237 = OpSelect %uint %235 %231 %uint_4 + %238 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %239 = OpAccessChain %_ptr_StorageBuffer_uint_0 %238 %236 + OpCooperativeMatrixStoreKHR %239 %m6 %uint_1 %237 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl index b5dec46..5f864d3 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -14,43 +14,43 @@ void main() { uint v_1 = 0u; in0.GetDimensions(v_1); - bool v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_1 / 4u) * 2u)); + bool v_2 = (((0u + (16u * 7u)) + 4u) <= (v_1 / 4u)); Matrix_right_f16_8x8 m0 = Matrix_right_f16_8x8::Load(in0, (0u + (select(v_2, 0u, 0u) * 2u)), (select(v_2, 16u, 4u) * 2u), MatrixLayout::RowMajor); uint v_3 = 0u; v.GetDimensions(v_3); uint v_4 = asuint(int(0)); uint v_5 = asuint(int(16)); - bool v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= ((v_3 / 4u) * 2u)); + bool v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= (v_3 / 4u)); m0.Store(v, (0u + (select(v_6, v_4, 0u) * 2u)), (select(v_6, v_5, 4u) * 2u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_7 / 8u) * 4u)); + bool v_8 = (((0u + (16u * 7u)) + 2u) <= (v_7 / 8u)); Matrix_right_f16_8x8 m1 = Matrix_right_f16_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 2u)), (select(v_8, 16u, 2u) * 2u), MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 2u) + 8u) <= ((v_9 / 4u) * 2u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 4u) <= (v_9 / 4u)); m1.Store(v, (0u + (select(v_12, v_10, 0u) * 2u)), (select(v_12, v_11, 4u) * 2u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_13 / 16u) * 8u)); + bool v_14 = (((0u + (16u * 7u)) + 1u) <= (v_13 / 16u)); Matrix_right_f16_8x8 m2 = Matrix_right_f16_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 2u)), (select(v_14, 16u, 1u) * 2u), MatrixLayout::RowMajor); uint v_15 = 0u; v.GetDimensions(v_15); uint v_16 = asuint(int(0)); uint v_17 = asuint(int(16)); - bool v_18 = ((((v_16 + (v_17 * 7u)) * 2u) + 8u) <= ((v_15 / 4u) * 2u)); + bool v_18 = (((v_16 + (v_17 * 7u)) + 4u) <= (v_15 / 4u)); m2.Store(v, (0u + (select(v_18, v_16, 0u) * 2u)), (select(v_18, v_17, 4u) * 2u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_19 / 16u) * 8u)); + bool v_20 = (((0u + (16u * 7u)) + 1u) <= (v_19 / 16u)); Matrix_right_f16_8x8 m3 = Matrix_right_f16_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 2u)), (select(v_20, 16u, 1u) * 2u), MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 2u) + 8u) <= ((v_21 / 4u) * 2u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 4u) <= (v_21 / 4u)); m3.Store(v, (0u + (select(v_24, v_22, 0u) * 2u)), (select(v_24, v_23, 4u) * 2u), MatrixLayout::ColMajor); uint v_25 = 0u; in4.GetDimensions(v_25); @@ -60,27 +60,27 @@ v.GetDimensions(v_27); uint v_28 = asuint(int(0)); uint v_29 = asuint(int(16)); - bool v_30 = ((((v_28 + (v_29 * 7u)) * 2u) + 8u) <= ((v_27 / 4u) * 2u)); + bool v_30 = (((v_28 + (v_29 * 7u)) + 4u) <= (v_27 / 4u)); m4.Store(v, (0u + (select(v_30, v_28, 0u) * 2u)), (select(v_30, v_29, 4u) * 2u), MatrixLayout::ColMajor); uint v_31 = 0u; in5.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_31 / 4u) * 2u)); + bool v_32 = (((0u + (16u * 7u)) + 4u) <= (v_31 / 4u)); Matrix_right_f16_8x8 m5 = Matrix_right_f16_8x8::Load(in5, (0u + (select(v_32, 0u, 0u) * 2u)), (select(v_32, 16u, 4u) * 2u), MatrixLayout::RowMajor); uint v_33 = 0u; v.GetDimensions(v_33); uint v_34 = asuint(int(0)); uint v_35 = asuint(int(16)); - bool v_36 = ((((v_34 + (v_35 * 7u)) * 2u) + 8u) <= ((v_33 / 4u) * 2u)); + bool v_36 = (((v_34 + (v_35 * 7u)) + 4u) <= (v_33 / 4u)); m5.Store(v, (0u + (select(v_36, v_34, 0u) * 2u)), (select(v_36, v_35, 4u) * 2u), MatrixLayout::ColMajor); uint v_37 = 0u; in6.GetDimensions(v_37); - bool v_38 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_37 / 8u) * 4u)); + bool v_38 = (((0u + (16u * 7u)) + 2u) <= (v_37 / 8u)); Matrix_right_f16_8x8 m6 = Matrix_right_f16_8x8::Load(in6, (0u + (select(v_38, 0u, 0u) * 2u)), (select(v_38, 16u, 2u) * 2u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 2u) + 8u) <= ((v_39 / 4u) * 2u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 4u) <= (v_39 / 4u)); m6.Store(v, (0u + (select(v_42, v_40, 0u) * 2u)), (select(v_42, v_41, 4u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_row_major.wgsl.expected.msl index bfaa1f1..10db296 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_row_major.wgsl.expected.msl
@@ -50,37 +50,37 @@ kernel void v(const device tint_array<uint, 1>* in0 [[buffer(0)]], const device tint_array<int2, 1>* in1 [[buffer(1)]], const device tint_array<tint_packed_vec3_f32_array_element, 1>* in2 [[buffer(2)]], const device tint_array<uint4, 1>* in3 [[buffer(3)]], const device tint_array<half, 1>* in4 [[buffer(4)]], const device tint_array<half2, 1>* in5 [[buffer(5)]], const device tint_array<tint_packed_vec3_f16_array_element, 1>* in6 [[buffer(6)]], device tint_array<uint, 1>* out [[buffer(7)]], const constant tint_array<uint4, 2>* tint_storage_buffer_sizes [[buffer(30)]]) { tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.in0=in0, .in1=in1, .in2=in2, .in3=in3, .in4=in4, .in5=in5, .in6=in6, .out=out, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; tint_array_lengths_struct const v_1 = tint_array_lengths_struct{.tint_array_length_0_0=((*tint_module_vars.tint_storage_buffer_sizes)[0u].x / 4u), .tint_array_length_0_7=((*tint_module_vars.tint_storage_buffer_sizes)[1u].w / 4u), .tint_array_length_0_1=((*tint_module_vars.tint_storage_buffer_sizes)[0u].y / 8u), .tint_array_length_0_2=((*tint_module_vars.tint_storage_buffer_sizes)[0u].z / 16u), .tint_array_length_0_3=((*tint_module_vars.tint_storage_buffer_sizes)[0u].w / 16u), .tint_array_length_0_4=((*tint_module_vars.tint_storage_buffer_sizes)[1u].x / 2u), .tint_array_length_0_5=((*tint_module_vars.tint_storage_buffer_sizes)[1u].y / 4u), .tint_array_length_0_6=((*tint_module_vars.tint_storage_buffer_sizes)[1u].z / 8u)}; - bool const v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_0 * 2u)); + bool const v_2 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_0); simdgroup_half8x8 v_3 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_3, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in0) + (select(0u, 0u, v_2) * 4u)), ulong((select(4u, 16u, v_2) * 2u)), ulong2(0ul), false)); simdgroup_half8x8 const m0 = v_3; uint const v_4 = as_type<uint>(0); uint const v_5 = as_type<uint>(16); - bool const v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_4, v_6) * 4u)), ulong((select(4u, v_5, v_6) * 2u)), ulong2(0ul), true)); - bool const v_7 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_1 * 4u)); + bool const v_7 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_1); simdgroup_half8x8 v_8 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_8, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (select(0u, 0u, v_7) * 8u)), ulong((select(2u, 16u, v_7) * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m1 = v_8; uint const v_9 = as_type<uint>(0); uint const v_10 = as_type<uint>(16); - bool const v_11 = ((((v_9 + (v_10 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_11 = (((v_9 + (v_10 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_9, v_11) * 4u)), ulong((select(4u, v_10, v_11) * 2u)), ulong2(0ul), true)); - bool const v_12 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_2 * 8u)); + bool const v_12 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_2); simdgroup_half8x8 v_13 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_13, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (select(0u, 0u, v_12) * 16u)), ulong((select(1u, 16u, v_12) * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m2 = v_13; uint const v_14 = as_type<uint>(0); uint const v_15 = as_type<uint>(16); - bool const v_16 = ((((v_14 + (v_15 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_16 = (((v_14 + (v_15 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_14, v_16) * 4u)), ulong((select(4u, v_15, v_16) * 2u)), ulong2(0ul), true)); - bool const v_17 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_3 * 8u)); + bool const v_17 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_3); simdgroup_half8x8 v_18 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_18, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (select(0u, 0u, v_17) * 16u)), ulong((select(1u, 16u, v_17) * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m3 = v_18; uint const v_19 = as_type<uint>(0); uint const v_20 = as_type<uint>(16); - bool const v_21 = ((((v_19 + (v_20 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_21 = (((v_19 + (v_20 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_19, v_21) * 4u)), ulong((select(4u, v_20, v_21) * 2u)), ulong2(0ul), true)); bool const v_22 = (((0u + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); simdgroup_half8x8 v_23 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); @@ -88,22 +88,22 @@ simdgroup_half8x8 const m4 = v_23; uint const v_24 = as_type<uint>(0); uint const v_25 = as_type<uint>(16); - bool const v_26 = ((((v_24 + (v_25 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_26 = (((v_24 + (v_25 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_24, v_26) * 4u)), ulong((select(4u, v_25, v_26) * 2u)), ulong2(0ul), true)); - bool const v_27 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_27 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); simdgroup_half8x8 v_28 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_28, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in5) + (select(0u, 0u, v_27) * 4u)), ulong((select(4u, 16u, v_27) * 2u)), ulong2(0ul), false)); simdgroup_half8x8 const m5 = v_28; uint const v_29 = as_type<uint>(0); uint const v_30 = as_type<uint>(16); - bool const v_31 = ((((v_29 + (v_30 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_31 = (((v_29 + (v_30 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_29, v_31) * 4u)), ulong((select(4u, v_30, v_31) * 2u)), ulong2(0ul), true)); - bool const v_32 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_6 * 4u)); + bool const v_32 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_6); simdgroup_half8x8 v_33 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_33, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (select(0u, 0u, v_32) * 8u)), ulong((select(2u, 16u, v_32) * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m6 = v_33; uint const v_34 = as_type<uint>(0); uint const v_35 = as_type<uint>(16); - bool const v_36 = ((((v_34 + (v_35 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_36 = (((v_34 + (v_35 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_34, v_36) * 4u)), ulong((select(4u, v_35, v_36) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_row_major.wgsl.expected.spvasm index f1a40e6..5509e95 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 267 +; Bound: 241 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,21 +128,21 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_2 = OpConstant %uint 2 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %uint_1 = OpConstant %uint 1 - %67 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_1 + %63 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_1 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float @@ -158,197 +158,171 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_2 - %51 = OpIMul %uint %uint_16 %uint_7 - %54 = OpIAdd %uint %uint_0 %51 - %55 = OpIMul %uint %54 %uint_2 - %56 = OpIAdd %uint %55 %uint_8 - %58 = OpULessThanEqual %bool %56 %49 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_4 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - %m0 = OpCooperativeMatrixLoadKHR %67 %64 %uint_0 %61 None - %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %72 = OpArrayLength %uint %38 0 - %73 = OpIMul %uint %72 %uint_2 - %74 = OpBitcast %uint %int_0 - %76 = OpBitcast %uint %int_16 - %78 = OpIMul %uint %76 %uint_7 - %79 = OpIAdd %uint %74 %78 - %80 = OpIMul %uint %79 %uint_2 - %81 = OpIAdd %uint %80 %uint_8 - %82 = OpULessThanEqual %bool %81 %73 - %83 = OpSelect %uint %82 %74 %uint_0 - %84 = OpSelect %uint %82 %76 %uint_4 - %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %86 = OpAccessChain %_ptr_StorageBuffer_uint_0 %85 %83 - OpCooperativeMatrixStoreKHR %86 %m0 %uint_1 %84 NonPrivatePointer - %89 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %91 = OpArrayLength %uint %6 0 - %92 = OpIMul %uint %91 %uint_4 - %93 = OpIMul %uint %uint_16 %uint_7 - %94 = OpIAdd %uint %uint_0 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %92 - %98 = OpSelect %uint %97 %uint_0 %uint_0 - %99 = OpSelect %uint %97 %uint_16 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_v2int %100 %98 - %m1 = OpCooperativeMatrixLoadKHR %67 %101 %uint_0 %99 None - %104 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %105 = OpArrayLength %uint %38 0 - %106 = OpIMul %uint %105 %uint_2 - %107 = OpBitcast %uint %int_0 - %108 = OpBitcast %uint %int_16 - %109 = OpIMul %uint %108 %uint_7 - %110 = OpIAdd %uint %107 %109 - %111 = OpIMul %uint %110 %uint_2 - %112 = OpIAdd %uint %111 %uint_8 - %113 = OpULessThanEqual %bool %112 %106 - %114 = OpSelect %uint %113 %107 %uint_0 - %115 = OpSelect %uint %113 %108 %uint_4 - %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %117 = OpAccessChain %_ptr_StorageBuffer_uint_0 %116 %114 - OpCooperativeMatrixStoreKHR %117 %m1 %uint_1 %115 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %121 = OpArrayLength %uint %12 0 - %122 = OpIMul %uint %121 %uint_8 - %123 = OpIMul %uint %uint_16 %uint_7 - %124 = OpIAdd %uint %uint_0 %123 - %125 = OpIMul %uint %124 %uint_8 - %126 = OpIAdd %uint %125 %uint_8 - %127 = OpULessThanEqual %bool %126 %122 - %128 = OpSelect %uint %127 %uint_0 %uint_0 - %129 = OpSelect %uint %127 %uint_16 %uint_1 - %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %131 = OpAccessChain %_ptr_StorageBuffer_v3float %130 %128 - %m2 = OpCooperativeMatrixLoadKHR %67 %131 %uint_0 %129 None + %49 = OpIMul %uint %uint_16 %uint_7 + %52 = OpIAdd %uint %uint_0 %49 + %53 = OpIAdd %uint %52 %uint_4 + %55 = OpULessThanEqual %bool %53 %48 + %57 = OpSelect %uint %55 %uint_0 %uint_0 + %58 = OpSelect %uint %55 %uint_16 %uint_4 + %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %60 = OpAccessChain %_ptr_StorageBuffer_uint %59 %57 + %m0 = OpCooperativeMatrixLoadKHR %63 %60 %uint_0 %58 None + %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %69 = OpArrayLength %uint %38 0 + %70 = OpBitcast %uint %int_0 + %72 = OpBitcast %uint %int_16 + %74 = OpIMul %uint %72 %uint_7 + %75 = OpIAdd %uint %70 %74 + %76 = OpIAdd %uint %75 %uint_4 + %77 = OpULessThanEqual %bool %76 %69 + %78 = OpSelect %uint %77 %70 %uint_0 + %79 = OpSelect %uint %77 %72 %uint_4 + %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_uint_0 %80 %78 + OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %79 NonPrivatePointer + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %86 = OpArrayLength %uint %6 0 + %87 = OpIMul %uint %uint_16 %uint_7 + %88 = OpIAdd %uint %uint_0 %87 + %89 = OpIAdd %uint %88 %uint_2 + %91 = OpULessThanEqual %bool %89 %86 + %92 = OpSelect %uint %91 %uint_0 %uint_0 + %93 = OpSelect %uint %91 %uint_16 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %92 + %m1 = OpCooperativeMatrixLoadKHR %63 %95 %uint_0 %93 None + %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %99 = OpArrayLength %uint %38 0 + %100 = OpBitcast %uint %int_0 + %101 = OpBitcast %uint %int_16 + %102 = OpIMul %uint %101 %uint_7 + %103 = OpIAdd %uint %100 %102 + %104 = OpIAdd %uint %103 %uint_4 + %105 = OpULessThanEqual %bool %104 %99 + %106 = OpSelect %uint %105 %100 %uint_0 + %107 = OpSelect %uint %105 %101 %uint_4 + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 + OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %113 = OpArrayLength %uint %12 0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %uint_0 %114 + %116 = OpIAdd %uint %115 %uint_1 + %117 = OpULessThanEqual %bool %116 %113 + %118 = OpSelect %uint %117 %uint_0 %uint_0 + %119 = OpSelect %uint %117 %uint_16 %uint_1 + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 + %m2 = OpCooperativeMatrixLoadKHR %63 %121 %uint_0 %119 None + %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %125 = OpArrayLength %uint %38 0 + %126 = OpBitcast %uint %int_0 + %127 = OpBitcast %uint %int_16 + %128 = OpIMul %uint %127 %uint_7 + %129 = OpIAdd %uint %126 %128 + %130 = OpIAdd %uint %129 %uint_4 + %131 = OpULessThanEqual %bool %130 %125 + %132 = OpSelect %uint %131 %126 %uint_0 + %133 = OpSelect %uint %131 %127 %uint_4 %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %135 = OpArrayLength %uint %38 0 - %136 = OpIMul %uint %135 %uint_2 - %137 = OpBitcast %uint %int_0 - %138 = OpBitcast %uint %int_16 - %139 = OpIMul %uint %138 %uint_7 - %140 = OpIAdd %uint %137 %139 - %141 = OpIMul %uint %140 %uint_2 - %142 = OpIAdd %uint %141 %uint_8 - %143 = OpULessThanEqual %bool %142 %136 - %144 = OpSelect %uint %143 %137 %uint_0 - %145 = OpSelect %uint %143 %138 %uint_4 - %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %147 = OpAccessChain %_ptr_StorageBuffer_uint_0 %146 %144 - OpCooperativeMatrixStoreKHR %147 %m2 %uint_1 %145 NonPrivatePointer - %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %151 = OpArrayLength %uint %18 0 - %152 = OpIMul %uint %151 %uint_8 - %153 = OpIMul %uint %uint_16 %uint_7 - %154 = OpIAdd %uint %uint_0 %153 - %155 = OpIMul %uint %154 %uint_8 - %156 = OpIAdd %uint %155 %uint_8 - %157 = OpULessThanEqual %bool %156 %152 - %158 = OpSelect %uint %157 %uint_0 %uint_0 - %159 = OpSelect %uint %157 %uint_16 %uint_1 - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %161 = OpAccessChain %_ptr_StorageBuffer_v4uint %160 %158 - %m3 = OpCooperativeMatrixLoadKHR %67 %161 %uint_0 %159 None - %164 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %165 = OpArrayLength %uint %38 0 - %166 = OpIMul %uint %165 %uint_2 - %167 = OpBitcast %uint %int_0 - %168 = OpBitcast %uint %int_16 - %169 = OpIMul %uint %168 %uint_7 - %170 = OpIAdd %uint %167 %169 - %171 = OpIMul %uint %170 %uint_2 - %172 = OpIAdd %uint %171 %uint_8 - %173 = OpULessThanEqual %bool %172 %166 - %174 = OpSelect %uint %173 %167 %uint_0 - %175 = OpSelect %uint %173 %168 %uint_4 + %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 + OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %139 = OpArrayLength %uint %18 0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %uint_0 %140 + %142 = OpIAdd %uint %141 %uint_1 + %143 = OpULessThanEqual %bool %142 %139 + %144 = OpSelect %uint %143 %uint_0 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_1 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %63 %147 %uint_0 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %151 = OpArrayLength %uint %38 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_4 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_4 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpIMul %uint %uint_16 %uint_7 + %167 = OpIAdd %uint %uint_0 %166 + %168 = OpIAdd %uint %167 %uint_8 + %169 = OpULessThanEqual %bool %168 %165 + %170 = OpSelect %uint %169 %uint_0 %uint_0 + %171 = OpSelect %uint %169 %uint_16 %uint_8 + %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %173 = OpAccessChain %_ptr_StorageBuffer_half %172 %170 + %m4 = OpCooperativeMatrixLoadKHR %63 %173 %uint_0 %171 None %176 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %177 = OpAccessChain %_ptr_StorageBuffer_uint_0 %176 %174 - OpCooperativeMatrixStoreKHR %177 %m3 %uint_1 %175 NonPrivatePointer - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %181 = OpArrayLength %uint %23 0 - %182 = OpIMul %uint %uint_16 %uint_7 - %183 = OpIAdd %uint %uint_0 %182 - %184 = OpIAdd %uint %183 %uint_8 - %185 = OpULessThanEqual %bool %184 %181 - %186 = OpSelect %uint %185 %uint_0 %uint_0 - %187 = OpSelect %uint %185 %uint_16 %uint_8 - %188 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %189 = OpAccessChain %_ptr_StorageBuffer_half %188 %186 - %m4 = OpCooperativeMatrixLoadKHR %67 %189 %uint_0 %187 None - %192 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %193 = OpArrayLength %uint %38 0 - %194 = OpIMul %uint %193 %uint_2 - %195 = OpBitcast %uint %int_0 - %196 = OpBitcast %uint %int_16 - %197 = OpIMul %uint %196 %uint_7 - %198 = OpIAdd %uint %195 %197 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpIAdd %uint %199 %uint_8 - %201 = OpULessThanEqual %bool %200 %194 - %202 = OpSelect %uint %201 %195 %uint_0 - %203 = OpSelect %uint %201 %196 %uint_4 - %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %205 = OpAccessChain %_ptr_StorageBuffer_uint_0 %204 %202 - OpCooperativeMatrixStoreKHR %205 %m4 %uint_1 %203 NonPrivatePointer - %207 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %209 = OpArrayLength %uint %28 0 - %210 = OpIMul %uint %209 %uint_2 - %211 = OpIMul %uint %uint_16 %uint_7 - %212 = OpIAdd %uint %uint_0 %211 - %213 = OpIMul %uint %212 %uint_2 - %214 = OpIAdd %uint %213 %uint_8 - %215 = OpULessThanEqual %bool %214 %210 - %216 = OpSelect %uint %215 %uint_0 %uint_0 - %217 = OpSelect %uint %215 %uint_16 %uint_4 - %218 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %219 = OpAccessChain %_ptr_StorageBuffer_v2half %218 %216 - %m5 = OpCooperativeMatrixLoadKHR %67 %219 %uint_0 %217 None - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %223 = OpArrayLength %uint %38 0 - %224 = OpIMul %uint %223 %uint_2 - %225 = OpBitcast %uint %int_0 - %226 = OpBitcast %uint %int_16 - %227 = OpIMul %uint %226 %uint_7 - %228 = OpIAdd %uint %225 %227 - %229 = OpIMul %uint %228 %uint_2 - %230 = OpIAdd %uint %229 %uint_8 - %231 = OpULessThanEqual %bool %230 %224 - %232 = OpSelect %uint %231 %225 %uint_0 - %233 = OpSelect %uint %231 %226 %uint_4 - %234 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %235 = OpAccessChain %_ptr_StorageBuffer_uint_0 %234 %232 - OpCooperativeMatrixStoreKHR %235 %m5 %uint_1 %233 NonPrivatePointer - %237 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %239 = OpArrayLength %uint %33 0 - %240 = OpIMul %uint %239 %uint_4 - %241 = OpIMul %uint %uint_16 %uint_7 - %242 = OpIAdd %uint %uint_0 %241 - %243 = OpIMul %uint %242 %uint_4 - %244 = OpIAdd %uint %243 %uint_8 - %245 = OpULessThanEqual %bool %244 %240 - %246 = OpSelect %uint %245 %uint_0 %uint_0 - %247 = OpSelect %uint %245 %uint_16 %uint_2 - %248 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %249 = OpAccessChain %_ptr_StorageBuffer_v3half %248 %246 - %m6 = OpCooperativeMatrixLoadKHR %67 %249 %uint_0 %247 None - %252 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %253 = OpArrayLength %uint %38 0 - %254 = OpIMul %uint %253 %uint_2 - %255 = OpBitcast %uint %int_0 - %256 = OpBitcast %uint %int_16 - %257 = OpIMul %uint %256 %uint_7 - %258 = OpIAdd %uint %255 %257 - %259 = OpIMul %uint %258 %uint_2 - %260 = OpIAdd %uint %259 %uint_8 - %261 = OpULessThanEqual %bool %260 %254 - %262 = OpSelect %uint %261 %255 %uint_0 - %263 = OpSelect %uint %261 %256 %uint_4 - %264 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %265 = OpAccessChain %_ptr_StorageBuffer_uint_0 %264 %262 - OpCooperativeMatrixStoreKHR %265 %m6 %uint_1 %263 NonPrivatePointer + %177 = OpArrayLength %uint %38 0 + %178 = OpBitcast %uint %int_0 + %179 = OpBitcast %uint %int_16 + %180 = OpIMul %uint %179 %uint_7 + %181 = OpIAdd %uint %178 %180 + %182 = OpIAdd %uint %181 %uint_4 + %183 = OpULessThanEqual %bool %182 %177 + %184 = OpSelect %uint %183 %178 %uint_0 + %185 = OpSelect %uint %183 %179 %uint_4 + %186 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %187 = OpAccessChain %_ptr_StorageBuffer_uint_0 %186 %184 + OpCooperativeMatrixStoreKHR %187 %m4 %uint_1 %185 NonPrivatePointer + %189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %191 = OpArrayLength %uint %28 0 + %192 = OpIMul %uint %uint_16 %uint_7 + %193 = OpIAdd %uint %uint_0 %192 + %194 = OpIAdd %uint %193 %uint_4 + %195 = OpULessThanEqual %bool %194 %191 + %196 = OpSelect %uint %195 %uint_0 %uint_0 + %197 = OpSelect %uint %195 %uint_16 %uint_4 + %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %199 = OpAccessChain %_ptr_StorageBuffer_v2half %198 %196 + %m5 = OpCooperativeMatrixLoadKHR %63 %199 %uint_0 %197 None + %202 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %203 = OpArrayLength %uint %38 0 + %204 = OpBitcast %uint %int_0 + %205 = OpBitcast %uint %int_16 + %206 = OpIMul %uint %205 %uint_7 + %207 = OpIAdd %uint %204 %206 + %208 = OpIAdd %uint %207 %uint_4 + %209 = OpULessThanEqual %bool %208 %203 + %210 = OpSelect %uint %209 %204 %uint_0 + %211 = OpSelect %uint %209 %205 %uint_4 + %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %213 = OpAccessChain %_ptr_StorageBuffer_uint_0 %212 %210 + OpCooperativeMatrixStoreKHR %213 %m5 %uint_1 %211 NonPrivatePointer + %215 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %217 = OpArrayLength %uint %33 0 + %218 = OpIMul %uint %uint_16 %uint_7 + %219 = OpIAdd %uint %uint_0 %218 + %220 = OpIAdd %uint %219 %uint_2 + %221 = OpULessThanEqual %bool %220 %217 + %222 = OpSelect %uint %221 %uint_0 %uint_0 + %223 = OpSelect %uint %221 %uint_16 %uint_2 + %224 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %225 = OpAccessChain %_ptr_StorageBuffer_v3half %224 %222 + %m6 = OpCooperativeMatrixLoadKHR %63 %225 %uint_0 %223 None + %228 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %229 = OpArrayLength %uint %38 0 + %230 = OpBitcast %uint %int_0 + %231 = OpBitcast %uint %int_16 + %232 = OpIMul %uint %231 %uint_7 + %233 = OpIAdd %uint %230 %232 + %234 = OpIAdd %uint %233 %uint_4 + %235 = OpULessThanEqual %bool %234 %229 + %236 = OpSelect %uint %235 %230 %uint_0 + %237 = OpSelect %uint %235 %231 %uint_4 + %238 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %239 = OpAccessChain %_ptr_StorageBuffer_uint_0 %238 %236 + OpCooperativeMatrixStoreKHR %239 %m6 %uint_1 %237 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_col_major.wgsl.expected.dxc.hlsl index 67918a2..6514fe5 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_col_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 2u) + 8u) <= ((v_1 / 4u) * 2u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 4u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 2u)), (select(v_4, v_3, 4u) * 2u), MatrixLayout::ColMajor); Matrix_right_f16_8x8 m1 = Matrix_right_f16_8x8::Load(in1, 0u, 32u, MatrixLayout::ColMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 2u) + 8u) <= ((v_5 / 4u) * 2u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 4u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 2u)), (select(v_8, v_7, 4u) * 2u), MatrixLayout::ColMajor); Matrix_right_f16_8x8 m2 = Matrix_right_f16_8x8::Load(in2, 0u, 32u, MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 2u) + 8u) <= ((v_9 / 4u) * 2u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 4u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 2u)), (select(v_12, v_11, 4u) * 2u), MatrixLayout::ColMajor); Matrix_right_f16_8x8 m3 = Matrix_right_f16_8x8::Load(in3, 0u, 32u, MatrixLayout::ColMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 2u) + 8u) <= ((v_13 / 4u) * 2u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 4u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 2u)), (select(v_16, v_15, 4u) * 2u), MatrixLayout::ColMajor); Matrix_right_f16_8x8 m4 = Matrix_right_f16_8x8::Load(in4, 0u, 32u, MatrixLayout::ColMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 2u) + 8u) <= ((v_17 / 4u) * 2u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 4u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 2u)), (select(v_20, v_19, 4u) * 2u), MatrixLayout::ColMajor); Matrix_right_f16_8x8 m5 = Matrix_right_f16_8x8::Load(in5, 0u, 32u, MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 2u) + 8u) <= ((v_21 / 4u) * 2u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 4u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 2u)), (select(v_24, v_23, 4u) * 2u), MatrixLayout::ColMajor); Matrix_right_f16_8x8 m6 = Matrix_right_f16_8x8::Load(in6, 0u, 32u, MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 2u) + 8u) <= ((v_25 / 4u) * 2u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 4u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 2u)), (select(v_28, v_27, 4u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_col_major.wgsl.expected.msl index b53e636..cc07356 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_col_major.wgsl.expected.msl
@@ -48,48 +48,48 @@ simdgroup_half8x8 const m0 = v_2; uint const v_3 = as_type<uint>(0); uint const v_4 = as_type<uint>(16); - bool const v_5 = ((((v_3 + (v_4 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_5 = (((v_3 + (v_4 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_3, v_5) * 4u)), ulong((select(4u, v_4, v_5) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_6 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_6, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (as_type<uint>(0) * 8u)), ulong((16u * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m1 = v_6; uint const v_7 = as_type<uint>(0); uint const v_8 = as_type<uint>(16); - bool const v_9 = ((((v_7 + (v_8 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_9 = (((v_7 + (v_8 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_7, v_9) * 4u)), ulong((select(4u, v_8, v_9) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_10 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_10, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (as_type<uint>(0) * 16u)), ulong((16u * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m2 = v_10; uint const v_11 = as_type<uint>(0); uint const v_12 = as_type<uint>(16); - bool const v_13 = ((((v_11 + (v_12 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_13 = (((v_11 + (v_12 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_11, v_13) * 4u)), ulong((select(4u, v_12, v_13) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_14 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_14, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (as_type<uint>(0) * 16u)), ulong((16u * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m3 = v_14; uint const v_15 = as_type<uint>(0); uint const v_16 = as_type<uint>(16); - bool const v_17 = ((((v_15 + (v_16 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_17 = (((v_15 + (v_16 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_15, v_17) * 4u)), ulong((select(4u, v_16, v_17) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_18 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_18, (&(*tint_module_vars.in4)[0]), ulong(16u), ulong2(0ul), true)); simdgroup_half8x8 const m4 = v_18; uint const v_19 = as_type<uint>(0); uint const v_20 = as_type<uint>(16); - bool const v_21 = ((((v_19 + (v_20 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_21 = (((v_19 + (v_20 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_19, v_21) * 4u)), ulong((select(4u, v_20, v_21) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_22 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_22, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in5) + (as_type<uint>(0) * 4u)), ulong((16u * 2u)), ulong2(0ul), true)); simdgroup_half8x8 const m5 = v_22; uint const v_23 = as_type<uint>(0); uint const v_24 = as_type<uint>(16); - bool const v_25 = ((((v_23 + (v_24 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_25 = (((v_23 + (v_24 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_23, v_25) * 4u)), ulong((select(4u, v_24, v_25) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_26 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_26, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (as_type<uint>(0) * 8u)), ulong((16u * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m6 = v_26; uint const v_27 = as_type<uint>(0); uint const v_28 = as_type<uint>(16); - bool const v_29 = ((((v_27 + (v_28 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_29 = (((v_27 + (v_28 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_27, v_29) * 4u)), ulong((select(4u, v_28, v_29) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_col_major.wgsl.expected.spvasm index db05c2d..fe09904 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 201 +; Bound: 186 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -138,12 +138,11 @@ %53 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_2 = OpConstant %uint 2 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -164,126 +163,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_1 %uint_16 None %58 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %60 = OpArrayLength %uint %39 0 - %61 = OpIMul %uint %60 %uint_2 - %63 = OpBitcast %uint %int_0 - %65 = OpBitcast %uint %int_16 - %67 = OpIMul %uint %65 %uint_7 - %69 = OpIAdd %uint %63 %67 - %70 = OpIMul %uint %69 %uint_2 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %61 - %74 = OpSelect %uint %72 %63 %uint_0 - %75 = OpSelect %uint %72 %65 %uint_4 - %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %78 = OpAccessChain %_ptr_StorageBuffer_uint_0 %77 %74 - OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %75 NonPrivatePointer - %81 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %83 = OpAccessChain %_ptr_StorageBuffer_v2int %81 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %83 %uint_1 %uint_16 None - %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %87 = OpArrayLength %uint %39 0 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpBitcast %uint %int_0 - %90 = OpBitcast %uint %int_16 - %91 = OpIMul %uint %90 %uint_7 - %92 = OpIAdd %uint %89 %91 - %93 = OpIMul %uint %92 %uint_2 - %94 = OpIAdd %uint %93 %uint_8 - %95 = OpULessThanEqual %bool %94 %88 - %96 = OpSelect %uint %95 %89 %uint_0 - %97 = OpSelect %uint %95 %90 %uint_4 - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %99 = OpAccessChain %_ptr_StorageBuffer_uint_0 %98 %96 - OpCooperativeMatrixStoreKHR %99 %m1 %uint_1 %97 NonPrivatePointer - %101 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %103 = OpAccessChain %_ptr_StorageBuffer_v3float %101 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %103 %uint_1 %uint_16 None - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %107 = OpArrayLength %uint %39 0 - %108 = OpIMul %uint %107 %uint_2 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_2 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_4 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint_0 %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v4uint %121 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %123 %uint_1 %uint_16 None - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %127 = OpArrayLength %uint %39 0 - %128 = OpIMul %uint %127 %uint_2 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %128 - %136 = OpSelect %uint %135 %129 %uint_0 - %137 = OpSelect %uint %135 %130 %uint_4 - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_uint_0 %138 %136 - OpCooperativeMatrixStoreKHR %139 %m3 %uint_1 %137 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %143 = OpAccessChain %_ptr_StorageBuffer_half %141 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %143 %uint_1 %uint_16 None - %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %147 = OpArrayLength %uint %39 0 - %148 = OpIMul %uint %147 %uint_2 - %149 = OpBitcast %uint %int_0 - %150 = OpBitcast %uint %int_16 - %151 = OpIMul %uint %150 %uint_7 - %152 = OpIAdd %uint %149 %151 - %153 = OpIMul %uint %152 %uint_2 - %154 = OpIAdd %uint %153 %uint_8 - %155 = OpULessThanEqual %bool %154 %148 - %156 = OpSelect %uint %155 %149 %uint_0 - %157 = OpSelect %uint %155 %150 %uint_4 - %158 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %159 = OpAccessChain %_ptr_StorageBuffer_uint_0 %158 %156 - OpCooperativeMatrixStoreKHR %159 %m4 %uint_1 %157 NonPrivatePointer - %161 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %163 = OpAccessChain %_ptr_StorageBuffer_v2half %161 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %163 %uint_1 %uint_16 None - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %167 = OpArrayLength %uint %39 0 - %168 = OpIMul %uint %167 %uint_2 - %169 = OpBitcast %uint %int_0 - %170 = OpBitcast %uint %int_16 - %171 = OpIMul %uint %170 %uint_7 - %172 = OpIAdd %uint %169 %171 - %173 = OpIMul %uint %172 %uint_2 - %174 = OpIAdd %uint %173 %uint_8 - %175 = OpULessThanEqual %bool %174 %168 - %176 = OpSelect %uint %175 %169 %uint_0 - %177 = OpSelect %uint %175 %170 %uint_4 - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %179 = OpAccessChain %_ptr_StorageBuffer_uint_0 %178 %176 - OpCooperativeMatrixStoreKHR %179 %m5 %uint_1 %177 NonPrivatePointer - %181 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %183 = OpAccessChain %_ptr_StorageBuffer_v3half %181 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %183 %uint_1 %uint_16 None - %186 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %187 = OpArrayLength %uint %39 0 - %188 = OpIMul %uint %187 %uint_2 - %189 = OpBitcast %uint %int_0 - %190 = OpBitcast %uint %int_16 - %191 = OpIMul %uint %190 %uint_7 - %192 = OpIAdd %uint %189 %191 - %193 = OpIMul %uint %192 %uint_2 - %194 = OpIAdd %uint %193 %uint_8 - %195 = OpULessThanEqual %bool %194 %188 - %196 = OpSelect %uint %195 %189 %uint_0 - %197 = OpSelect %uint %195 %190 %uint_4 - %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %199 = OpAccessChain %_ptr_StorageBuffer_uint_0 %198 %196 - OpCooperativeMatrixStoreKHR %199 %m6 %uint_1 %197 NonPrivatePointer + %61 = OpBitcast %uint %int_0 + %63 = OpBitcast %uint %int_16 + %65 = OpIMul %uint %63 %uint_7 + %67 = OpIAdd %uint %61 %65 + %68 = OpIAdd %uint %67 %uint_4 + %70 = OpULessThanEqual %bool %68 %60 + %72 = OpSelect %uint %70 %61 %uint_0 + %73 = OpSelect %uint %70 %63 %uint_4 + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %75 = OpAccessChain %_ptr_StorageBuffer_uint_0 %74 %72 + OpCooperativeMatrixStoreKHR %75 %m0 %uint_1 %73 NonPrivatePointer + %78 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %80 = OpAccessChain %_ptr_StorageBuffer_v2int %78 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %80 %uint_1 %uint_16 None + %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %84 = OpArrayLength %uint %39 0 + %85 = OpBitcast %uint %int_0 + %86 = OpBitcast %uint %int_16 + %87 = OpIMul %uint %86 %uint_7 + %88 = OpIAdd %uint %85 %87 + %89 = OpIAdd %uint %88 %uint_4 + %90 = OpULessThanEqual %bool %89 %84 + %91 = OpSelect %uint %90 %85 %uint_0 + %92 = OpSelect %uint %90 %86 %uint_4 + %93 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %94 = OpAccessChain %_ptr_StorageBuffer_uint_0 %93 %91 + OpCooperativeMatrixStoreKHR %94 %m1 %uint_1 %92 NonPrivatePointer + %96 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %98 = OpAccessChain %_ptr_StorageBuffer_v3float %96 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %98 %uint_1 %uint_16 None + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %102 = OpArrayLength %uint %39 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_4 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_4 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint_0 %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_v4uint %114 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %116 %uint_1 %uint_16 None + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %120 = OpArrayLength %uint %39 0 + %121 = OpBitcast %uint %int_0 + %122 = OpBitcast %uint %int_16 + %123 = OpIMul %uint %122 %uint_7 + %124 = OpIAdd %uint %121 %123 + %125 = OpIAdd %uint %124 %uint_4 + %126 = OpULessThanEqual %bool %125 %120 + %127 = OpSelect %uint %126 %121 %uint_0 + %128 = OpSelect %uint %126 %122 %uint_4 + %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %130 = OpAccessChain %_ptr_StorageBuffer_uint_0 %129 %127 + OpCooperativeMatrixStoreKHR %130 %m3 %uint_1 %128 NonPrivatePointer + %132 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_half %132 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %134 %uint_1 %uint_16 None + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %138 = OpArrayLength %uint %39 0 + %139 = OpBitcast %uint %int_0 + %140 = OpBitcast %uint %int_16 + %141 = OpIMul %uint %140 %uint_7 + %142 = OpIAdd %uint %139 %141 + %143 = OpIAdd %uint %142 %uint_4 + %144 = OpULessThanEqual %bool %143 %138 + %145 = OpSelect %uint %144 %139 %uint_0 + %146 = OpSelect %uint %144 %140 %uint_4 + %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %148 = OpAccessChain %_ptr_StorageBuffer_uint_0 %147 %145 + OpCooperativeMatrixStoreKHR %148 %m4 %uint_1 %146 NonPrivatePointer + %150 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %152 = OpAccessChain %_ptr_StorageBuffer_v2half %150 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %152 %uint_1 %uint_16 None + %155 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %156 = OpArrayLength %uint %39 0 + %157 = OpBitcast %uint %int_0 + %158 = OpBitcast %uint %int_16 + %159 = OpIMul %uint %158 %uint_7 + %160 = OpIAdd %uint %157 %159 + %161 = OpIAdd %uint %160 %uint_4 + %162 = OpULessThanEqual %bool %161 %156 + %163 = OpSelect %uint %162 %157 %uint_0 + %164 = OpSelect %uint %162 %158 %uint_4 + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %166 = OpAccessChain %_ptr_StorageBuffer_uint_0 %165 %163 + OpCooperativeMatrixStoreKHR %166 %m5 %uint_1 %164 NonPrivatePointer + %168 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %170 = OpAccessChain %_ptr_StorageBuffer_v3half %168 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %170 %uint_1 %uint_16 None + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %174 = OpArrayLength %uint %39 0 + %175 = OpBitcast %uint %int_0 + %176 = OpBitcast %uint %int_16 + %177 = OpIMul %uint %176 %uint_7 + %178 = OpIAdd %uint %175 %177 + %179 = OpIAdd %uint %178 %uint_4 + %180 = OpULessThanEqual %bool %179 %174 + %181 = OpSelect %uint %180 %175 %uint_0 + %182 = OpSelect %uint %180 %176 %uint_4 + %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %184 = OpAccessChain %_ptr_StorageBuffer_uint_0 %183 %181 + OpCooperativeMatrixStoreKHR %184 %m6 %uint_1 %182 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_row_major.wgsl.expected.dxc.hlsl index e231f6f..0918a4d 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_row_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 2u) + 8u) <= ((v_1 / 4u) * 2u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 4u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 2u)), (select(v_4, v_3, 4u) * 2u), MatrixLayout::ColMajor); Matrix_right_f16_8x8 m1 = Matrix_right_f16_8x8::Load(in1, 0u, 32u, MatrixLayout::RowMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 2u) + 8u) <= ((v_5 / 4u) * 2u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 4u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 2u)), (select(v_8, v_7, 4u) * 2u), MatrixLayout::ColMajor); Matrix_right_f16_8x8 m2 = Matrix_right_f16_8x8::Load(in2, 0u, 32u, MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 2u) + 8u) <= ((v_9 / 4u) * 2u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 4u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 2u)), (select(v_12, v_11, 4u) * 2u), MatrixLayout::ColMajor); Matrix_right_f16_8x8 m3 = Matrix_right_f16_8x8::Load(in3, 0u, 32u, MatrixLayout::RowMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 2u) + 8u) <= ((v_13 / 4u) * 2u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 4u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 2u)), (select(v_16, v_15, 4u) * 2u), MatrixLayout::ColMajor); Matrix_right_f16_8x8 m4 = Matrix_right_f16_8x8::Load(in4, 0u, 32u, MatrixLayout::RowMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 2u) + 8u) <= ((v_17 / 4u) * 2u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 4u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 2u)), (select(v_20, v_19, 4u) * 2u), MatrixLayout::ColMajor); Matrix_right_f16_8x8 m5 = Matrix_right_f16_8x8::Load(in5, 0u, 32u, MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 2u) + 8u) <= ((v_21 / 4u) * 2u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 4u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 2u)), (select(v_24, v_23, 4u) * 2u), MatrixLayout::ColMajor); Matrix_right_f16_8x8 m6 = Matrix_right_f16_8x8::Load(in6, 0u, 32u, MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 2u) + 8u) <= ((v_25 / 4u) * 2u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 4u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 2u)), (select(v_28, v_27, 4u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_row_major.wgsl.expected.msl index 0ed871e..731812f 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_row_major.wgsl.expected.msl
@@ -48,48 +48,48 @@ simdgroup_half8x8 const m0 = v_2; uint const v_3 = as_type<uint>(0); uint const v_4 = as_type<uint>(16); - bool const v_5 = ((((v_3 + (v_4 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_5 = (((v_3 + (v_4 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_3, v_5) * 4u)), ulong((select(4u, v_4, v_5) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_6 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_6, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (as_type<uint>(0) * 8u)), ulong((16u * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m1 = v_6; uint const v_7 = as_type<uint>(0); uint const v_8 = as_type<uint>(16); - bool const v_9 = ((((v_7 + (v_8 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_9 = (((v_7 + (v_8 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_7, v_9) * 4u)), ulong((select(4u, v_8, v_9) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_10 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_10, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (as_type<uint>(0) * 16u)), ulong((16u * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m2 = v_10; uint const v_11 = as_type<uint>(0); uint const v_12 = as_type<uint>(16); - bool const v_13 = ((((v_11 + (v_12 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_13 = (((v_11 + (v_12 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_11, v_13) * 4u)), ulong((select(4u, v_12, v_13) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_14 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_14, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (as_type<uint>(0) * 16u)), ulong((16u * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m3 = v_14; uint const v_15 = as_type<uint>(0); uint const v_16 = as_type<uint>(16); - bool const v_17 = ((((v_15 + (v_16 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_17 = (((v_15 + (v_16 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_15, v_17) * 4u)), ulong((select(4u, v_16, v_17) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_18 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_18, (&(*tint_module_vars.in4)[0]), ulong(16u), ulong2(0ul), false)); simdgroup_half8x8 const m4 = v_18; uint const v_19 = as_type<uint>(0); uint const v_20 = as_type<uint>(16); - bool const v_21 = ((((v_19 + (v_20 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_21 = (((v_19 + (v_20 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_19, v_21) * 4u)), ulong((select(4u, v_20, v_21) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_22 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_22, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in5) + (as_type<uint>(0) * 4u)), ulong((16u * 2u)), ulong2(0ul), false)); simdgroup_half8x8 const m5 = v_22; uint const v_23 = as_type<uint>(0); uint const v_24 = as_type<uint>(16); - bool const v_25 = ((((v_23 + (v_24 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_25 = (((v_23 + (v_24 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_23, v_25) * 4u)), ulong((select(4u, v_24, v_25) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_26 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_26, reinterpret_cast<const device half*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (as_type<uint>(0) * 8u)), ulong((16u * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m6 = v_26; uint const v_27 = as_type<uint>(0); uint const v_28 = as_type<uint>(16); - bool const v_29 = ((((v_27 + (v_28 * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_7 * 2u)); + bool const v_29 = (((v_27 + (v_28 * 7u)) + 4u) <= v_1.tint_array_length_0_7); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_27, v_29) * 4u)), ulong((select(4u, v_28, v_29) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_row_major.wgsl.expected.spvasm index 87770e6..6231101 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f16_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 201 +; Bound: 186 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -138,12 +138,11 @@ %53 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_2 = OpConstant %uint 2 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -164,126 +163,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_0 %uint_16 None %58 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %60 = OpArrayLength %uint %39 0 - %61 = OpIMul %uint %60 %uint_2 - %63 = OpBitcast %uint %int_0 - %65 = OpBitcast %uint %int_16 - %67 = OpIMul %uint %65 %uint_7 - %69 = OpIAdd %uint %63 %67 - %70 = OpIMul %uint %69 %uint_2 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %61 - %74 = OpSelect %uint %72 %63 %uint_0 - %75 = OpSelect %uint %72 %65 %uint_4 - %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %78 = OpAccessChain %_ptr_StorageBuffer_uint_0 %77 %74 - OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %75 NonPrivatePointer - %81 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %83 = OpAccessChain %_ptr_StorageBuffer_v2int %81 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %83 %uint_0 %uint_16 None - %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %87 = OpArrayLength %uint %39 0 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpBitcast %uint %int_0 - %90 = OpBitcast %uint %int_16 - %91 = OpIMul %uint %90 %uint_7 - %92 = OpIAdd %uint %89 %91 - %93 = OpIMul %uint %92 %uint_2 - %94 = OpIAdd %uint %93 %uint_8 - %95 = OpULessThanEqual %bool %94 %88 - %96 = OpSelect %uint %95 %89 %uint_0 - %97 = OpSelect %uint %95 %90 %uint_4 - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %99 = OpAccessChain %_ptr_StorageBuffer_uint_0 %98 %96 - OpCooperativeMatrixStoreKHR %99 %m1 %uint_1 %97 NonPrivatePointer - %101 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %103 = OpAccessChain %_ptr_StorageBuffer_v3float %101 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %103 %uint_0 %uint_16 None - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %107 = OpArrayLength %uint %39 0 - %108 = OpIMul %uint %107 %uint_2 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_2 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_4 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint_0 %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v4uint %121 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %123 %uint_0 %uint_16 None - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %127 = OpArrayLength %uint %39 0 - %128 = OpIMul %uint %127 %uint_2 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %128 - %136 = OpSelect %uint %135 %129 %uint_0 - %137 = OpSelect %uint %135 %130 %uint_4 - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_uint_0 %138 %136 - OpCooperativeMatrixStoreKHR %139 %m3 %uint_1 %137 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %143 = OpAccessChain %_ptr_StorageBuffer_half %141 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %143 %uint_0 %uint_16 None - %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %147 = OpArrayLength %uint %39 0 - %148 = OpIMul %uint %147 %uint_2 - %149 = OpBitcast %uint %int_0 - %150 = OpBitcast %uint %int_16 - %151 = OpIMul %uint %150 %uint_7 - %152 = OpIAdd %uint %149 %151 - %153 = OpIMul %uint %152 %uint_2 - %154 = OpIAdd %uint %153 %uint_8 - %155 = OpULessThanEqual %bool %154 %148 - %156 = OpSelect %uint %155 %149 %uint_0 - %157 = OpSelect %uint %155 %150 %uint_4 - %158 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %159 = OpAccessChain %_ptr_StorageBuffer_uint_0 %158 %156 - OpCooperativeMatrixStoreKHR %159 %m4 %uint_1 %157 NonPrivatePointer - %161 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %163 = OpAccessChain %_ptr_StorageBuffer_v2half %161 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %163 %uint_0 %uint_16 None - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %167 = OpArrayLength %uint %39 0 - %168 = OpIMul %uint %167 %uint_2 - %169 = OpBitcast %uint %int_0 - %170 = OpBitcast %uint %int_16 - %171 = OpIMul %uint %170 %uint_7 - %172 = OpIAdd %uint %169 %171 - %173 = OpIMul %uint %172 %uint_2 - %174 = OpIAdd %uint %173 %uint_8 - %175 = OpULessThanEqual %bool %174 %168 - %176 = OpSelect %uint %175 %169 %uint_0 - %177 = OpSelect %uint %175 %170 %uint_4 - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %179 = OpAccessChain %_ptr_StorageBuffer_uint_0 %178 %176 - OpCooperativeMatrixStoreKHR %179 %m5 %uint_1 %177 NonPrivatePointer - %181 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %183 = OpAccessChain %_ptr_StorageBuffer_v3half %181 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %183 %uint_0 %uint_16 None - %186 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %187 = OpArrayLength %uint %39 0 - %188 = OpIMul %uint %187 %uint_2 - %189 = OpBitcast %uint %int_0 - %190 = OpBitcast %uint %int_16 - %191 = OpIMul %uint %190 %uint_7 - %192 = OpIAdd %uint %189 %191 - %193 = OpIMul %uint %192 %uint_2 - %194 = OpIAdd %uint %193 %uint_8 - %195 = OpULessThanEqual %bool %194 %188 - %196 = OpSelect %uint %195 %189 %uint_0 - %197 = OpSelect %uint %195 %190 %uint_4 - %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %199 = OpAccessChain %_ptr_StorageBuffer_uint_0 %198 %196 - OpCooperativeMatrixStoreKHR %199 %m6 %uint_1 %197 NonPrivatePointer + %61 = OpBitcast %uint %int_0 + %63 = OpBitcast %uint %int_16 + %65 = OpIMul %uint %63 %uint_7 + %67 = OpIAdd %uint %61 %65 + %68 = OpIAdd %uint %67 %uint_4 + %70 = OpULessThanEqual %bool %68 %60 + %72 = OpSelect %uint %70 %61 %uint_0 + %73 = OpSelect %uint %70 %63 %uint_4 + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %75 = OpAccessChain %_ptr_StorageBuffer_uint_0 %74 %72 + OpCooperativeMatrixStoreKHR %75 %m0 %uint_1 %73 NonPrivatePointer + %78 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %80 = OpAccessChain %_ptr_StorageBuffer_v2int %78 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %80 %uint_0 %uint_16 None + %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %84 = OpArrayLength %uint %39 0 + %85 = OpBitcast %uint %int_0 + %86 = OpBitcast %uint %int_16 + %87 = OpIMul %uint %86 %uint_7 + %88 = OpIAdd %uint %85 %87 + %89 = OpIAdd %uint %88 %uint_4 + %90 = OpULessThanEqual %bool %89 %84 + %91 = OpSelect %uint %90 %85 %uint_0 + %92 = OpSelect %uint %90 %86 %uint_4 + %93 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %94 = OpAccessChain %_ptr_StorageBuffer_uint_0 %93 %91 + OpCooperativeMatrixStoreKHR %94 %m1 %uint_1 %92 NonPrivatePointer + %96 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %98 = OpAccessChain %_ptr_StorageBuffer_v3float %96 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %98 %uint_0 %uint_16 None + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %102 = OpArrayLength %uint %39 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_4 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_4 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint_0 %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_v4uint %114 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %116 %uint_0 %uint_16 None + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %120 = OpArrayLength %uint %39 0 + %121 = OpBitcast %uint %int_0 + %122 = OpBitcast %uint %int_16 + %123 = OpIMul %uint %122 %uint_7 + %124 = OpIAdd %uint %121 %123 + %125 = OpIAdd %uint %124 %uint_4 + %126 = OpULessThanEqual %bool %125 %120 + %127 = OpSelect %uint %126 %121 %uint_0 + %128 = OpSelect %uint %126 %122 %uint_4 + %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %130 = OpAccessChain %_ptr_StorageBuffer_uint_0 %129 %127 + OpCooperativeMatrixStoreKHR %130 %m3 %uint_1 %128 NonPrivatePointer + %132 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_half %132 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %134 %uint_0 %uint_16 None + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %138 = OpArrayLength %uint %39 0 + %139 = OpBitcast %uint %int_0 + %140 = OpBitcast %uint %int_16 + %141 = OpIMul %uint %140 %uint_7 + %142 = OpIAdd %uint %139 %141 + %143 = OpIAdd %uint %142 %uint_4 + %144 = OpULessThanEqual %bool %143 %138 + %145 = OpSelect %uint %144 %139 %uint_0 + %146 = OpSelect %uint %144 %140 %uint_4 + %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %148 = OpAccessChain %_ptr_StorageBuffer_uint_0 %147 %145 + OpCooperativeMatrixStoreKHR %148 %m4 %uint_1 %146 NonPrivatePointer + %150 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %152 = OpAccessChain %_ptr_StorageBuffer_v2half %150 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %152 %uint_0 %uint_16 None + %155 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %156 = OpArrayLength %uint %39 0 + %157 = OpBitcast %uint %int_0 + %158 = OpBitcast %uint %int_16 + %159 = OpIMul %uint %158 %uint_7 + %160 = OpIAdd %uint %157 %159 + %161 = OpIAdd %uint %160 %uint_4 + %162 = OpULessThanEqual %bool %161 %156 + %163 = OpSelect %uint %162 %157 %uint_0 + %164 = OpSelect %uint %162 %158 %uint_4 + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %166 = OpAccessChain %_ptr_StorageBuffer_uint_0 %165 %163 + OpCooperativeMatrixStoreKHR %166 %m5 %uint_1 %164 NonPrivatePointer + %168 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %170 = OpAccessChain %_ptr_StorageBuffer_v3half %168 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %170 %uint_0 %uint_16 None + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %174 = OpArrayLength %uint %39 0 + %175 = OpBitcast %uint %int_0 + %176 = OpBitcast %uint %int_16 + %177 = OpIMul %uint %176 %uint_7 + %178 = OpIAdd %uint %175 %177 + %179 = OpIAdd %uint %178 %uint_4 + %180 = OpULessThanEqual %bool %179 %174 + %181 = OpSelect %uint %180 %175 %uint_0 + %182 = OpSelect %uint %180 %176 %uint_4 + %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %184 = OpAccessChain %_ptr_StorageBuffer_uint_0 %183 %181 + OpCooperativeMatrixStoreKHR %184 %m6 %uint_1 %182 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl index 2c86631..f0b6725 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -25,7 +25,7 @@ uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 8u) * 2u)); + bool v_10 = (((v_9 + (16u * 7u)) + 4u) <= (v_8 / 8u)); Matrix_right_f32_8x8 m1 = Matrix_right_f32_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_11 = 0u; v.GetDimensions(v_11); @@ -36,7 +36,7 @@ uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 16u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 16u)); Matrix_right_f32_8x8 m2 = Matrix_right_f32_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_18 = 0u; v.GetDimensions(v_18); @@ -47,7 +47,7 @@ uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 4u) + 8u) <= ((v_22 / 16u) * 4u)); + bool v_24 = (((v_23 + (16u * 7u)) + 2u) <= (v_22 / 16u)); Matrix_right_f32_8x8 m3 = Matrix_right_f32_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); @@ -69,7 +69,7 @@ uint v_36 = 0u; in6.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 2u) + 8u) <= ((v_36 / 8u) * 2u)); + bool v_38 = (((v_37 + (16u * 7u)) + 4u) <= (v_36 / 8u)); Matrix_right_f32_8x8 m6 = Matrix_right_f32_8x8::Load(in6, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_col_major.wgsl.expected.msl index 0eb410c..9473270 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_col_major.wgsl.expected.msl
@@ -58,7 +58,7 @@ bool const v_7 = (((v_5 + (v_6 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m0, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_5, v_7) * 4u)), ulong((select(8u, v_6, v_7) * 1u)), ulong2(0ul), true)); uint const v_8 = as_type<uint>(0); - bool const v_9 = ((((v_8 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_1 * 2u)); + bool const v_9 = (((v_8 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_1); simdgroup_float8x8 v_10 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_10, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (select(0u, v_8, v_9) * 8u)), ulong((select(4u, 16u, v_9) * 2u)), ulong2(0ul), true)); simdgroup_float8x8 const m1 = v_10; @@ -67,7 +67,7 @@ bool const v_13 = (((v_11 + (v_12 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m1, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_11, v_13) * 4u)), ulong((select(8u, v_12, v_13) * 1u)), ulong2(0ul), true)); uint const v_14 = as_type<uint>(0); - bool const v_15 = ((((v_14 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_2 * 4u)); + bool const v_15 = (((v_14 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_2); simdgroup_float8x8 v_16 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_16, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (select(0u, v_14, v_15) * 16u)), ulong((select(2u, 16u, v_15) * 4u)), ulong2(0ul), true)); simdgroup_float8x8 const m2 = v_16; @@ -76,7 +76,7 @@ bool const v_19 = (((v_17 + (v_18 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m2, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_17, v_19) * 4u)), ulong((select(8u, v_18, v_19) * 1u)), ulong2(0ul), true)); uint const v_20 = as_type<uint>(0); - bool const v_21 = ((((v_20 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_3 * 4u)); + bool const v_21 = (((v_20 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_3); simdgroup_float8x8 v_22 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_22, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (select(0u, v_20, v_21) * 16u)), ulong((select(2u, 16u, v_21) * 4u)), ulong2(0ul), true)); simdgroup_float8x8 const m3 = v_22; @@ -94,7 +94,7 @@ bool const v_31 = (((v_29 + (v_30 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m5, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_29, v_31) * 4u)), ulong((select(8u, v_30, v_31) * 1u)), ulong2(0ul), true)); uint const v_32 = as_type<uint>(0); - bool const v_33 = ((((v_32 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_33 = (((v_32 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); simdgroup_float8x8 v_34 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_34, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (select(0u, v_32, v_33) * 8u)), ulong((select(4u, 16u, v_33) * 2u)), ulong2(0ul), true)); simdgroup_float8x8 const m6 = v_34;
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_col_major.wgsl.expected.spvasm index 0b2b940..2c6bbf8 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 225 +; Bound: 217 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,10 +128,10 @@ %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -168,136 +168,128 @@ OpCooperativeMatrixStoreKHR %77 %m0 %uint_1 %75 NonPrivatePointer %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %82 = OpArrayLength %uint %6 0 - %83 = OpIMul %uint %82 %uint_2 - %85 = OpBitcast %uint %int_0 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %85 %86 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %83 - %91 = OpSelect %uint %90 %85 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_4 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %91 - %m1 = OpCooperativeMatrixLoadKHR %61 %95 %uint_1 %92 None - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %99 = OpArrayLength %uint %34 0 - %100 = OpBitcast %uint %int_0 - %101 = OpBitcast %uint %int_16 - %102 = OpIMul %uint %101 %uint_7 - %103 = OpIAdd %uint %100 %102 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %101 %uint_8 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 - OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %113 = OpArrayLength %uint %12 0 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIMul %uint %117 %uint_4 - %119 = OpIAdd %uint %118 %uint_8 - %120 = OpULessThanEqual %bool %119 %114 - %121 = OpSelect %uint %120 %115 %uint_0 - %122 = OpSelect %uint %120 %uint_16 %uint_2 - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 - %m2 = OpCooperativeMatrixLoadKHR %61 %124 %uint_1 %122 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %128 = OpArrayLength %uint %34 0 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %130 %uint_8 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 - OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %142 = OpArrayLength %uint %18 0 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpBitcast %uint %int_0 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %144 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %143 - %150 = OpSelect %uint %149 %144 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v4uint %152 %150 - %m3 = OpCooperativeMatrixLoadKHR %61 %153 %uint_1 %151 None - %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %157 = OpArrayLength %uint %34 0 - %158 = OpBitcast %uint %int_0 - %159 = OpBitcast %uint %int_16 - %160 = OpIMul %uint %159 %uint_7 - %161 = OpIAdd %uint %158 %160 - %162 = OpIAdd %uint %161 %uint_8 - %163 = OpULessThanEqual %bool %162 %157 - %164 = OpSelect %uint %163 %158 %uint_0 - %165 = OpSelect %uint %163 %159 %uint_8 - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 - OpCooperativeMatrixStoreKHR %167 %m3 %uint_1 %165 NonPrivatePointer - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %171 = OpArrayLength %uint %23 0 - %172 = OpBitcast %uint %int_0 - %173 = OpIMul %uint %uint_16 %uint_7 - %174 = OpIAdd %uint %172 %173 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %171 - %177 = OpSelect %uint %176 %172 %uint_0 - %178 = OpSelect %uint %176 %uint_16 %uint_8 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_v2half %179 %177 - %m5 = OpCooperativeMatrixLoadKHR %61 %180 %uint_1 %178 None - %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %184 = OpArrayLength %uint %34 0 - %185 = OpBitcast %uint %int_0 - %186 = OpBitcast %uint %int_16 - %187 = OpIMul %uint %186 %uint_7 - %188 = OpIAdd %uint %185 %187 - %189 = OpIAdd %uint %188 %uint_8 - %190 = OpULessThanEqual %bool %189 %184 - %191 = OpSelect %uint %190 %185 %uint_0 - %192 = OpSelect %uint %190 %186 %uint_8 - %193 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %194 = OpAccessChain %_ptr_StorageBuffer_uint_0 %193 %191 - OpCooperativeMatrixStoreKHR %194 %m5 %uint_1 %192 NonPrivatePointer - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %198 = OpArrayLength %uint %29 0 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpBitcast %uint %int_0 - %201 = OpIMul %uint %uint_16 %uint_7 - %202 = OpIAdd %uint %200 %201 - %203 = OpIMul %uint %202 %uint_2 - %204 = OpIAdd %uint %203 %uint_8 - %205 = OpULessThanEqual %bool %204 %199 - %206 = OpSelect %uint %205 %200 %uint_0 - %207 = OpSelect %uint %205 %uint_16 %uint_4 - %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %209 = OpAccessChain %_ptr_StorageBuffer_v3half %208 %206 - %m6 = OpCooperativeMatrixLoadKHR %61 %209 %uint_1 %207 None - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %213 = OpArrayLength %uint %34 0 - %214 = OpBitcast %uint %int_0 - %215 = OpBitcast %uint %int_16 - %216 = OpIMul %uint %215 %uint_7 - %217 = OpIAdd %uint %214 %216 - %218 = OpIAdd %uint %217 %uint_8 - %219 = OpULessThanEqual %bool %218 %213 - %220 = OpSelect %uint %219 %214 %uint_0 - %221 = OpSelect %uint %219 %215 %uint_8 - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %223 = OpAccessChain %_ptr_StorageBuffer_uint_0 %222 %220 - OpCooperativeMatrixStoreKHR %223 %m6 %uint_1 %221 NonPrivatePointer + %83 = OpBitcast %uint %int_0 + %84 = OpIMul %uint %uint_16 %uint_7 + %85 = OpIAdd %uint %83 %84 + %86 = OpIAdd %uint %85 %uint_4 + %88 = OpULessThanEqual %bool %86 %82 + %89 = OpSelect %uint %88 %83 %uint_0 + %90 = OpSelect %uint %88 %uint_16 %uint_4 + %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %92 = OpAccessChain %_ptr_StorageBuffer_v2int %91 %89 + %m1 = OpCooperativeMatrixLoadKHR %61 %92 %uint_1 %90 None + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %96 = OpArrayLength %uint %34 0 + %97 = OpBitcast %uint %int_0 + %98 = OpBitcast %uint %int_16 + %99 = OpIMul %uint %98 %uint_7 + %100 = OpIAdd %uint %97 %99 + %101 = OpIAdd %uint %100 %uint_8 + %102 = OpULessThanEqual %bool %101 %96 + %103 = OpSelect %uint %102 %97 %uint_0 + %104 = OpSelect %uint %102 %98 %uint_8 + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %106 = OpAccessChain %_ptr_StorageBuffer_uint_0 %105 %103 + OpCooperativeMatrixStoreKHR %106 %m1 %uint_1 %104 NonPrivatePointer + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %110 = OpArrayLength %uint %12 0 + %111 = OpBitcast %uint %int_0 + %112 = OpIMul %uint %uint_16 %uint_7 + %113 = OpIAdd %uint %111 %112 + %114 = OpIAdd %uint %113 %uint_2 + %116 = OpULessThanEqual %bool %114 %110 + %117 = OpSelect %uint %116 %111 %uint_0 + %118 = OpSelect %uint %116 %uint_16 %uint_2 + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %120 = OpAccessChain %_ptr_StorageBuffer_v3float %119 %117 + %m2 = OpCooperativeMatrixLoadKHR %61 %120 %uint_1 %118 None + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %124 = OpArrayLength %uint %34 0 + %125 = OpBitcast %uint %int_0 + %126 = OpBitcast %uint %int_16 + %127 = OpIMul %uint %126 %uint_7 + %128 = OpIAdd %uint %125 %127 + %129 = OpIAdd %uint %128 %uint_8 + %130 = OpULessThanEqual %bool %129 %124 + %131 = OpSelect %uint %130 %125 %uint_0 + %132 = OpSelect %uint %130 %126 %uint_8 + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_uint_0 %133 %131 + OpCooperativeMatrixStoreKHR %134 %m2 %uint_1 %132 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %138 = OpArrayLength %uint %18 0 + %139 = OpBitcast %uint %int_0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %139 %140 + %142 = OpIAdd %uint %141 %uint_2 + %143 = OpULessThanEqual %bool %142 %138 + %144 = OpSelect %uint %143 %139 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_2 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %61 %147 %uint_1 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %151 = OpArrayLength %uint %34 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_8 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_8 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpBitcast %uint %int_0 + %167 = OpIMul %uint %uint_16 %uint_7 + %168 = OpIAdd %uint %166 %167 + %169 = OpIAdd %uint %168 %uint_8 + %170 = OpULessThanEqual %bool %169 %165 + %171 = OpSelect %uint %170 %166 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_8 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_v2half %173 %171 + %m5 = OpCooperativeMatrixLoadKHR %61 %174 %uint_1 %172 None + %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %178 = OpArrayLength %uint %34 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_8 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_8 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m5 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %192 = OpArrayLength %uint %29 0 + %193 = OpBitcast %uint %int_0 + %194 = OpIMul %uint %uint_16 %uint_7 + %195 = OpIAdd %uint %193 %194 + %196 = OpIAdd %uint %195 %uint_4 + %197 = OpULessThanEqual %bool %196 %192 + %198 = OpSelect %uint %197 %193 %uint_0 + %199 = OpSelect %uint %197 %uint_16 %uint_4 + %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %201 = OpAccessChain %_ptr_StorageBuffer_v3half %200 %198 + %m6 = OpCooperativeMatrixLoadKHR %61 %201 %uint_1 %199 None + %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %205 = OpArrayLength %uint %34 0 + %206 = OpBitcast %uint %int_0 + %207 = OpBitcast %uint %int_16 + %208 = OpIMul %uint %207 %uint_7 + %209 = OpIAdd %uint %206 %208 + %210 = OpIAdd %uint %209 %uint_8 + %211 = OpULessThanEqual %bool %210 %205 + %212 = OpSelect %uint %211 %206 %uint_0 + %213 = OpSelect %uint %211 %207 %uint_8 + %214 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %215 = OpAccessChain %_ptr_StorageBuffer_uint_0 %214 %212 + OpCooperativeMatrixStoreKHR %215 %m6 %uint_1 %213 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl index d8c9289..3d4cea5 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -25,7 +25,7 @@ uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 8u) * 2u)); + bool v_10 = (((v_9 + (16u * 7u)) + 4u) <= (v_8 / 8u)); Matrix_right_f32_8x8 m1 = Matrix_right_f32_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_11 = 0u; v.GetDimensions(v_11); @@ -36,7 +36,7 @@ uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 16u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 16u)); Matrix_right_f32_8x8 m2 = Matrix_right_f32_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_18 = 0u; v.GetDimensions(v_18); @@ -47,7 +47,7 @@ uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 4u) + 8u) <= ((v_22 / 16u) * 4u)); + bool v_24 = (((v_23 + (16u * 7u)) + 2u) <= (v_22 / 16u)); Matrix_right_f32_8x8 m3 = Matrix_right_f32_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); @@ -69,7 +69,7 @@ uint v_36 = 0u; in6.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 2u) + 8u) <= ((v_36 / 8u) * 2u)); + bool v_38 = (((v_37 + (16u * 7u)) + 4u) <= (v_36 / 8u)); Matrix_right_f32_8x8 m6 = Matrix_right_f32_8x8::Load(in6, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_row_major.wgsl.expected.msl index 1a0d25f..9935840 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_row_major.wgsl.expected.msl
@@ -58,7 +58,7 @@ bool const v_7 = (((v_5 + (v_6 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m0, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_5, v_7) * 4u)), ulong((select(8u, v_6, v_7) * 1u)), ulong2(0ul), true)); uint const v_8 = as_type<uint>(0); - bool const v_9 = ((((v_8 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_1 * 2u)); + bool const v_9 = (((v_8 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_1); simdgroup_float8x8 v_10 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_10, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in1) + (select(0u, v_8, v_9) * 8u)), ulong((select(4u, 16u, v_9) * 2u)), ulong2(0ul), false)); simdgroup_float8x8 const m1 = v_10; @@ -67,7 +67,7 @@ bool const v_13 = (((v_11 + (v_12 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m1, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_11, v_13) * 4u)), ulong((select(8u, v_12, v_13) * 1u)), ulong2(0ul), true)); uint const v_14 = as_type<uint>(0); - bool const v_15 = ((((v_14 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_2 * 4u)); + bool const v_15 = (((v_14 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_2); simdgroup_float8x8 v_16 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_16, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in2) + (select(0u, v_14, v_15) * 16u)), ulong((select(2u, 16u, v_15) * 4u)), ulong2(0ul), false)); simdgroup_float8x8 const m2 = v_16; @@ -76,7 +76,7 @@ bool const v_19 = (((v_17 + (v_18 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m2, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_17, v_19) * 4u)), ulong((select(8u, v_18, v_19) * 1u)), ulong2(0ul), true)); uint const v_20 = as_type<uint>(0); - bool const v_21 = ((((v_20 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_3 * 4u)); + bool const v_21 = (((v_20 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_3); simdgroup_float8x8 v_22 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_22, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in3) + (select(0u, v_20, v_21) * 16u)), ulong((select(2u, 16u, v_21) * 4u)), ulong2(0ul), false)); simdgroup_float8x8 const m3 = v_22; @@ -94,7 +94,7 @@ bool const v_31 = (((v_29 + (v_30 * 7u)) + 8u) <= v_1.tint_array_length_0_6); (simdgroup_store(m5, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_29, v_31) * 4u)), ulong((select(8u, v_30, v_31) * 1u)), ulong2(0ul), true)); uint const v_32 = as_type<uint>(0); - bool const v_33 = ((((v_32 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_33 = (((v_32 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); simdgroup_float8x8 v_34 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); (simdgroup_load(v_34, reinterpret_cast<const device float*>(reinterpret_cast<const device char*>(tint_module_vars.in6) + (select(0u, v_32, v_33) * 8u)), ulong((select(4u, 16u, v_33) * 2u)), ulong2(0ul), false)); simdgroup_float8x8 const m6 = v_34;
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_row_major.wgsl.expected.spvasm index 2792c4b..1c8bc31 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_f32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 225 +; Bound: 217 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,10 +128,10 @@ %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -168,136 +168,128 @@ OpCooperativeMatrixStoreKHR %77 %m0 %uint_1 %75 NonPrivatePointer %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %82 = OpArrayLength %uint %6 0 - %83 = OpIMul %uint %82 %uint_2 - %85 = OpBitcast %uint %int_0 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %85 %86 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %83 - %91 = OpSelect %uint %90 %85 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_4 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %91 - %m1 = OpCooperativeMatrixLoadKHR %61 %95 %uint_0 %92 None - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %99 = OpArrayLength %uint %34 0 - %100 = OpBitcast %uint %int_0 - %101 = OpBitcast %uint %int_16 - %102 = OpIMul %uint %101 %uint_7 - %103 = OpIAdd %uint %100 %102 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %101 %uint_8 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 - OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %113 = OpArrayLength %uint %12 0 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIMul %uint %117 %uint_4 - %119 = OpIAdd %uint %118 %uint_8 - %120 = OpULessThanEqual %bool %119 %114 - %121 = OpSelect %uint %120 %115 %uint_0 - %122 = OpSelect %uint %120 %uint_16 %uint_2 - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 - %m2 = OpCooperativeMatrixLoadKHR %61 %124 %uint_0 %122 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %128 = OpArrayLength %uint %34 0 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %130 %uint_8 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 - OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %142 = OpArrayLength %uint %18 0 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpBitcast %uint %int_0 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %144 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %143 - %150 = OpSelect %uint %149 %144 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v4uint %152 %150 - %m3 = OpCooperativeMatrixLoadKHR %61 %153 %uint_0 %151 None - %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %157 = OpArrayLength %uint %34 0 - %158 = OpBitcast %uint %int_0 - %159 = OpBitcast %uint %int_16 - %160 = OpIMul %uint %159 %uint_7 - %161 = OpIAdd %uint %158 %160 - %162 = OpIAdd %uint %161 %uint_8 - %163 = OpULessThanEqual %bool %162 %157 - %164 = OpSelect %uint %163 %158 %uint_0 - %165 = OpSelect %uint %163 %159 %uint_8 - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 - OpCooperativeMatrixStoreKHR %167 %m3 %uint_1 %165 NonPrivatePointer - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %171 = OpArrayLength %uint %23 0 - %172 = OpBitcast %uint %int_0 - %173 = OpIMul %uint %uint_16 %uint_7 - %174 = OpIAdd %uint %172 %173 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %171 - %177 = OpSelect %uint %176 %172 %uint_0 - %178 = OpSelect %uint %176 %uint_16 %uint_8 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_v2half %179 %177 - %m5 = OpCooperativeMatrixLoadKHR %61 %180 %uint_0 %178 None - %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %184 = OpArrayLength %uint %34 0 - %185 = OpBitcast %uint %int_0 - %186 = OpBitcast %uint %int_16 - %187 = OpIMul %uint %186 %uint_7 - %188 = OpIAdd %uint %185 %187 - %189 = OpIAdd %uint %188 %uint_8 - %190 = OpULessThanEqual %bool %189 %184 - %191 = OpSelect %uint %190 %185 %uint_0 - %192 = OpSelect %uint %190 %186 %uint_8 - %193 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %194 = OpAccessChain %_ptr_StorageBuffer_uint_0 %193 %191 - OpCooperativeMatrixStoreKHR %194 %m5 %uint_1 %192 NonPrivatePointer - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %198 = OpArrayLength %uint %29 0 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpBitcast %uint %int_0 - %201 = OpIMul %uint %uint_16 %uint_7 - %202 = OpIAdd %uint %200 %201 - %203 = OpIMul %uint %202 %uint_2 - %204 = OpIAdd %uint %203 %uint_8 - %205 = OpULessThanEqual %bool %204 %199 - %206 = OpSelect %uint %205 %200 %uint_0 - %207 = OpSelect %uint %205 %uint_16 %uint_4 - %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %209 = OpAccessChain %_ptr_StorageBuffer_v3half %208 %206 - %m6 = OpCooperativeMatrixLoadKHR %61 %209 %uint_0 %207 None - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %213 = OpArrayLength %uint %34 0 - %214 = OpBitcast %uint %int_0 - %215 = OpBitcast %uint %int_16 - %216 = OpIMul %uint %215 %uint_7 - %217 = OpIAdd %uint %214 %216 - %218 = OpIAdd %uint %217 %uint_8 - %219 = OpULessThanEqual %bool %218 %213 - %220 = OpSelect %uint %219 %214 %uint_0 - %221 = OpSelect %uint %219 %215 %uint_8 - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %223 = OpAccessChain %_ptr_StorageBuffer_uint_0 %222 %220 - OpCooperativeMatrixStoreKHR %223 %m6 %uint_1 %221 NonPrivatePointer + %83 = OpBitcast %uint %int_0 + %84 = OpIMul %uint %uint_16 %uint_7 + %85 = OpIAdd %uint %83 %84 + %86 = OpIAdd %uint %85 %uint_4 + %88 = OpULessThanEqual %bool %86 %82 + %89 = OpSelect %uint %88 %83 %uint_0 + %90 = OpSelect %uint %88 %uint_16 %uint_4 + %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %92 = OpAccessChain %_ptr_StorageBuffer_v2int %91 %89 + %m1 = OpCooperativeMatrixLoadKHR %61 %92 %uint_0 %90 None + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %96 = OpArrayLength %uint %34 0 + %97 = OpBitcast %uint %int_0 + %98 = OpBitcast %uint %int_16 + %99 = OpIMul %uint %98 %uint_7 + %100 = OpIAdd %uint %97 %99 + %101 = OpIAdd %uint %100 %uint_8 + %102 = OpULessThanEqual %bool %101 %96 + %103 = OpSelect %uint %102 %97 %uint_0 + %104 = OpSelect %uint %102 %98 %uint_8 + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %106 = OpAccessChain %_ptr_StorageBuffer_uint_0 %105 %103 + OpCooperativeMatrixStoreKHR %106 %m1 %uint_1 %104 NonPrivatePointer + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %110 = OpArrayLength %uint %12 0 + %111 = OpBitcast %uint %int_0 + %112 = OpIMul %uint %uint_16 %uint_7 + %113 = OpIAdd %uint %111 %112 + %114 = OpIAdd %uint %113 %uint_2 + %116 = OpULessThanEqual %bool %114 %110 + %117 = OpSelect %uint %116 %111 %uint_0 + %118 = OpSelect %uint %116 %uint_16 %uint_2 + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %120 = OpAccessChain %_ptr_StorageBuffer_v3float %119 %117 + %m2 = OpCooperativeMatrixLoadKHR %61 %120 %uint_0 %118 None + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %124 = OpArrayLength %uint %34 0 + %125 = OpBitcast %uint %int_0 + %126 = OpBitcast %uint %int_16 + %127 = OpIMul %uint %126 %uint_7 + %128 = OpIAdd %uint %125 %127 + %129 = OpIAdd %uint %128 %uint_8 + %130 = OpULessThanEqual %bool %129 %124 + %131 = OpSelect %uint %130 %125 %uint_0 + %132 = OpSelect %uint %130 %126 %uint_8 + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_uint_0 %133 %131 + OpCooperativeMatrixStoreKHR %134 %m2 %uint_1 %132 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %138 = OpArrayLength %uint %18 0 + %139 = OpBitcast %uint %int_0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %139 %140 + %142 = OpIAdd %uint %141 %uint_2 + %143 = OpULessThanEqual %bool %142 %138 + %144 = OpSelect %uint %143 %139 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_2 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %61 %147 %uint_0 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %151 = OpArrayLength %uint %34 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_8 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_8 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpBitcast %uint %int_0 + %167 = OpIMul %uint %uint_16 %uint_7 + %168 = OpIAdd %uint %166 %167 + %169 = OpIAdd %uint %168 %uint_8 + %170 = OpULessThanEqual %bool %169 %165 + %171 = OpSelect %uint %170 %166 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_8 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_v2half %173 %171 + %m5 = OpCooperativeMatrixLoadKHR %61 %174 %uint_0 %172 None + %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %178 = OpArrayLength %uint %34 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_8 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_8 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m5 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %192 = OpArrayLength %uint %29 0 + %193 = OpBitcast %uint %int_0 + %194 = OpIMul %uint %uint_16 %uint_7 + %195 = OpIAdd %uint %193 %194 + %196 = OpIAdd %uint %195 %uint_4 + %197 = OpULessThanEqual %bool %196 %192 + %198 = OpSelect %uint %197 %193 %uint_0 + %199 = OpSelect %uint %197 %uint_16 %uint_4 + %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %201 = OpAccessChain %_ptr_StorageBuffer_v3half %200 %198 + %m6 = OpCooperativeMatrixLoadKHR %61 %201 %uint_0 %199 None + %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %205 = OpArrayLength %uint %34 0 + %206 = OpBitcast %uint %int_0 + %207 = OpBitcast %uint %int_16 + %208 = OpIMul %uint %207 %uint_7 + %209 = OpIAdd %uint %206 %208 + %210 = OpIAdd %uint %209 %uint_8 + %211 = OpULessThanEqual %bool %210 %205 + %212 = OpSelect %uint %211 %206 %uint_0 + %213 = OpSelect %uint %211 %207 %uint_8 + %214 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %215 = OpAccessChain %_ptr_StorageBuffer_uint_0 %214 %212 + OpCooperativeMatrixStoreKHR %215 %m6 %uint_1 %213 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl index bcd9e16..e31bdc0 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -23,7 +23,7 @@ m0.Store(v, (0u + (select(v_6, v_4, 0u) * 4u)), (select(v_6, v_5, 8u) * 4u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_7 / 8u) * 2u)); + bool v_8 = (((0u + (16u * 7u)) + 4u) <= (v_7 / 8u)); Matrix_right_i32_8x8 m1 = Matrix_right_i32_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 4u)), (select(v_8, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); @@ -33,7 +33,7 @@ m1.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 8u) * 4u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_13 / 16u) * 4u)); + bool v_14 = (((0u + (16u * 7u)) + 2u) <= (v_13 / 16u)); Matrix_right_i32_8x8 m2 = Matrix_right_i32_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 4u)), (select(v_14, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; v.GetDimensions(v_15); @@ -43,7 +43,7 @@ m2.Store(v, (0u + (select(v_18, v_16, 0u) * 4u)), (select(v_18, v_17, 8u) * 4u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_19 / 16u) * 4u)); + bool v_20 = (((0u + (16u * 7u)) + 2u) <= (v_19 / 16u)); Matrix_right_i32_8x8 m3 = Matrix_right_i32_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 4u)), (select(v_20, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); @@ -63,7 +63,7 @@ m5.Store(v, (0u + (select(v_30, v_28, 0u) * 4u)), (select(v_30, v_29, 8u) * 4u), MatrixLayout::ColMajor); uint v_31 = 0u; in6.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_31 / 8u) * 2u)); + bool v_32 = (((0u + (16u * 7u)) + 4u) <= (v_31 / 8u)); Matrix_right_i32_8x8 m6 = Matrix_right_i32_8x8::Load(in6, (0u + (select(v_32, 0u, 0u) * 4u)), (select(v_32, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_33 = 0u; v.GetDimensions(v_33);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_col_major.wgsl.expected.spvasm index 3a3ee16..345f189 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 219 +; Bound: 211 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,10 +128,10 @@ %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -167,131 +167,123 @@ OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %81 = OpArrayLength %uint %6 0 - %82 = OpIMul %uint %81 %uint_2 - %84 = OpIMul %uint %uint_16 %uint_7 - %85 = OpIAdd %uint %uint_0 %84 - %86 = OpIMul %uint %85 %uint_2 - %87 = OpIAdd %uint %86 %uint_8 - %88 = OpULessThanEqual %bool %87 %82 - %89 = OpSelect %uint %88 %uint_0 %uint_0 - %90 = OpSelect %uint %88 %uint_16 %uint_4 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v2int %92 %89 - %m1 = OpCooperativeMatrixLoadKHR %59 %93 %uint_1 %90 None - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %97 = OpArrayLength %uint %34 0 - %98 = OpBitcast %uint %int_0 - %99 = OpBitcast %uint %int_16 - %100 = OpIMul %uint %99 %uint_7 - %101 = OpIAdd %uint %98 %100 - %102 = OpIAdd %uint %101 %uint_8 - %103 = OpULessThanEqual %bool %102 %97 - %104 = OpSelect %uint %103 %98 %uint_0 - %105 = OpSelect %uint %103 %99 %uint_8 - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %107 = OpAccessChain %_ptr_StorageBuffer_uint_0 %106 %104 - OpCooperativeMatrixStoreKHR %107 %m1 %uint_1 %105 NonPrivatePointer - %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %111 = OpArrayLength %uint %12 0 - %112 = OpIMul %uint %111 %uint_4 - %113 = OpIMul %uint %uint_16 %uint_7 - %114 = OpIAdd %uint %uint_0 %113 - %115 = OpIMul %uint %114 %uint_4 - %116 = OpIAdd %uint %115 %uint_8 - %117 = OpULessThanEqual %bool %116 %112 - %118 = OpSelect %uint %117 %uint_0 %uint_0 - %119 = OpSelect %uint %117 %uint_16 %uint_2 - %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 - %m2 = OpCooperativeMatrixLoadKHR %59 %121 %uint_1 %119 None - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %125 = OpArrayLength %uint %34 0 - %126 = OpBitcast %uint %int_0 - %127 = OpBitcast %uint %int_16 - %128 = OpIMul %uint %127 %uint_7 - %129 = OpIAdd %uint %126 %128 - %130 = OpIAdd %uint %129 %uint_8 - %131 = OpULessThanEqual %bool %130 %125 - %132 = OpSelect %uint %131 %126 %uint_0 - %133 = OpSelect %uint %131 %127 %uint_8 - %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 - OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %139 = OpArrayLength %uint %18 0 - %140 = OpIMul %uint %139 %uint_4 - %141 = OpIMul %uint %uint_16 %uint_7 - %142 = OpIAdd %uint %uint_0 %141 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpIAdd %uint %143 %uint_8 - %145 = OpULessThanEqual %bool %144 %140 - %146 = OpSelect %uint %145 %uint_0 %uint_0 - %147 = OpSelect %uint %145 %uint_16 %uint_2 - %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %149 = OpAccessChain %_ptr_StorageBuffer_v4uint %148 %146 - %m3 = OpCooperativeMatrixLoadKHR %59 %149 %uint_1 %147 None - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %153 = OpArrayLength %uint %34 0 - %154 = OpBitcast %uint %int_0 - %155 = OpBitcast %uint %int_16 - %156 = OpIMul %uint %155 %uint_7 - %157 = OpIAdd %uint %154 %156 - %158 = OpIAdd %uint %157 %uint_8 - %159 = OpULessThanEqual %bool %158 %153 - %160 = OpSelect %uint %159 %154 %uint_0 - %161 = OpSelect %uint %159 %155 %uint_8 - %162 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %163 = OpAccessChain %_ptr_StorageBuffer_uint_0 %162 %160 - OpCooperativeMatrixStoreKHR %163 %m3 %uint_1 %161 NonPrivatePointer - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %167 = OpArrayLength %uint %23 0 - %168 = OpIMul %uint %uint_16 %uint_7 - %169 = OpIAdd %uint %uint_0 %168 - %170 = OpIAdd %uint %169 %uint_8 - %171 = OpULessThanEqual %bool %170 %167 - %172 = OpSelect %uint %171 %uint_0 %uint_0 - %173 = OpSelect %uint %171 %uint_16 %uint_8 - %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %175 = OpAccessChain %_ptr_StorageBuffer_v2half %174 %172 - %m5 = OpCooperativeMatrixLoadKHR %59 %175 %uint_1 %173 None - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %179 = OpArrayLength %uint %34 0 - %180 = OpBitcast %uint %int_0 - %181 = OpBitcast %uint %int_16 - %182 = OpIMul %uint %181 %uint_7 - %183 = OpIAdd %uint %180 %182 - %184 = OpIAdd %uint %183 %uint_8 - %185 = OpULessThanEqual %bool %184 %179 - %186 = OpSelect %uint %185 %180 %uint_0 - %187 = OpSelect %uint %185 %181 %uint_8 - %188 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %189 = OpAccessChain %_ptr_StorageBuffer_uint_0 %188 %186 - OpCooperativeMatrixStoreKHR %189 %m5 %uint_1 %187 NonPrivatePointer - %191 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %193 = OpArrayLength %uint %29 0 - %194 = OpIMul %uint %193 %uint_2 - %195 = OpIMul %uint %uint_16 %uint_7 - %196 = OpIAdd %uint %uint_0 %195 - %197 = OpIMul %uint %196 %uint_2 - %198 = OpIAdd %uint %197 %uint_8 - %199 = OpULessThanEqual %bool %198 %194 - %200 = OpSelect %uint %199 %uint_0 %uint_0 - %201 = OpSelect %uint %199 %uint_16 %uint_4 - %202 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %203 = OpAccessChain %_ptr_StorageBuffer_v3half %202 %200 - %m6 = OpCooperativeMatrixLoadKHR %59 %203 %uint_1 %201 None - %206 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %207 = OpArrayLength %uint %34 0 - %208 = OpBitcast %uint %int_0 - %209 = OpBitcast %uint %int_16 - %210 = OpIMul %uint %209 %uint_7 - %211 = OpIAdd %uint %208 %210 - %212 = OpIAdd %uint %211 %uint_8 - %213 = OpULessThanEqual %bool %212 %207 - %214 = OpSelect %uint %213 %208 %uint_0 - %215 = OpSelect %uint %213 %209 %uint_8 - %216 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %217 = OpAccessChain %_ptr_StorageBuffer_uint_0 %216 %214 - OpCooperativeMatrixStoreKHR %217 %m6 %uint_1 %215 NonPrivatePointer + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_4 + %86 = OpULessThanEqual %bool %84 %81 + %87 = OpSelect %uint %86 %uint_0 %uint_0 + %88 = OpSelect %uint %86 %uint_16 %uint_4 + %89 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %90 = OpAccessChain %_ptr_StorageBuffer_v2int %89 %87 + %m1 = OpCooperativeMatrixLoadKHR %59 %90 %uint_1 %88 None + %93 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %94 = OpArrayLength %uint %34 0 + %95 = OpBitcast %uint %int_0 + %96 = OpBitcast %uint %int_16 + %97 = OpIMul %uint %96 %uint_7 + %98 = OpIAdd %uint %95 %97 + %99 = OpIAdd %uint %98 %uint_8 + %100 = OpULessThanEqual %bool %99 %94 + %101 = OpSelect %uint %100 %95 %uint_0 + %102 = OpSelect %uint %100 %96 %uint_8 + %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %104 = OpAccessChain %_ptr_StorageBuffer_uint_0 %103 %101 + OpCooperativeMatrixStoreKHR %104 %m1 %uint_1 %102 NonPrivatePointer + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %108 = OpArrayLength %uint %12 0 + %109 = OpIMul %uint %uint_16 %uint_7 + %110 = OpIAdd %uint %uint_0 %109 + %111 = OpIAdd %uint %110 %uint_2 + %113 = OpULessThanEqual %bool %111 %108 + %114 = OpSelect %uint %113 %uint_0 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_2 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v3float %116 %114 + %m2 = OpCooperativeMatrixLoadKHR %59 %117 %uint_1 %115 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %121 = OpArrayLength %uint %34 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_8 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_8 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m2 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %135 = OpArrayLength %uint %18 0 + %136 = OpIMul %uint %uint_16 %uint_7 + %137 = OpIAdd %uint %uint_0 %136 + %138 = OpIAdd %uint %137 %uint_2 + %139 = OpULessThanEqual %bool %138 %135 + %140 = OpSelect %uint %139 %uint_0 %uint_0 + %141 = OpSelect %uint %139 %uint_16 %uint_2 + %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %143 = OpAccessChain %_ptr_StorageBuffer_v4uint %142 %140 + %m3 = OpCooperativeMatrixLoadKHR %59 %143 %uint_1 %141 None + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %147 = OpArrayLength %uint %34 0 + %148 = OpBitcast %uint %int_0 + %149 = OpBitcast %uint %int_16 + %150 = OpIMul %uint %149 %uint_7 + %151 = OpIAdd %uint %148 %150 + %152 = OpIAdd %uint %151 %uint_8 + %153 = OpULessThanEqual %bool %152 %147 + %154 = OpSelect %uint %153 %148 %uint_0 + %155 = OpSelect %uint %153 %149 %uint_8 + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %157 = OpAccessChain %_ptr_StorageBuffer_uint_0 %156 %154 + OpCooperativeMatrixStoreKHR %157 %m3 %uint_1 %155 NonPrivatePointer + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %161 = OpArrayLength %uint %23 0 + %162 = OpIMul %uint %uint_16 %uint_7 + %163 = OpIAdd %uint %uint_0 %162 + %164 = OpIAdd %uint %163 %uint_8 + %165 = OpULessThanEqual %bool %164 %161 + %166 = OpSelect %uint %165 %uint_0 %uint_0 + %167 = OpSelect %uint %165 %uint_16 %uint_8 + %168 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %169 = OpAccessChain %_ptr_StorageBuffer_v2half %168 %166 + %m5 = OpCooperativeMatrixLoadKHR %59 %169 %uint_1 %167 None + %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %173 = OpArrayLength %uint %34 0 + %174 = OpBitcast %uint %int_0 + %175 = OpBitcast %uint %int_16 + %176 = OpIMul %uint %175 %uint_7 + %177 = OpIAdd %uint %174 %176 + %178 = OpIAdd %uint %177 %uint_8 + %179 = OpULessThanEqual %bool %178 %173 + %180 = OpSelect %uint %179 %174 %uint_0 + %181 = OpSelect %uint %179 %175 %uint_8 + %182 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %183 = OpAccessChain %_ptr_StorageBuffer_uint_0 %182 %180 + OpCooperativeMatrixStoreKHR %183 %m5 %uint_1 %181 NonPrivatePointer + %185 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %187 = OpArrayLength %uint %29 0 + %188 = OpIMul %uint %uint_16 %uint_7 + %189 = OpIAdd %uint %uint_0 %188 + %190 = OpIAdd %uint %189 %uint_4 + %191 = OpULessThanEqual %bool %190 %187 + %192 = OpSelect %uint %191 %uint_0 %uint_0 + %193 = OpSelect %uint %191 %uint_16 %uint_4 + %194 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %195 = OpAccessChain %_ptr_StorageBuffer_v3half %194 %192 + %m6 = OpCooperativeMatrixLoadKHR %59 %195 %uint_1 %193 None + %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %199 = OpArrayLength %uint %34 0 + %200 = OpBitcast %uint %int_0 + %201 = OpBitcast %uint %int_16 + %202 = OpIMul %uint %201 %uint_7 + %203 = OpIAdd %uint %200 %202 + %204 = OpIAdd %uint %203 %uint_8 + %205 = OpULessThanEqual %bool %204 %199 + %206 = OpSelect %uint %205 %200 %uint_0 + %207 = OpSelect %uint %205 %201 %uint_8 + %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %209 = OpAccessChain %_ptr_StorageBuffer_uint_0 %208 %206 + OpCooperativeMatrixStoreKHR %209 %m6 %uint_1 %207 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl index cf5466b..a513f7f 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -23,7 +23,7 @@ m0.Store(v, (0u + (select(v_6, v_4, 0u) * 4u)), (select(v_6, v_5, 8u) * 4u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_7 / 8u) * 2u)); + bool v_8 = (((0u + (16u * 7u)) + 4u) <= (v_7 / 8u)); Matrix_right_i32_8x8 m1 = Matrix_right_i32_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 4u)), (select(v_8, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); @@ -33,7 +33,7 @@ m1.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 8u) * 4u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_13 / 16u) * 4u)); + bool v_14 = (((0u + (16u * 7u)) + 2u) <= (v_13 / 16u)); Matrix_right_i32_8x8 m2 = Matrix_right_i32_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 4u)), (select(v_14, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_15 = 0u; v.GetDimensions(v_15); @@ -43,7 +43,7 @@ m2.Store(v, (0u + (select(v_18, v_16, 0u) * 4u)), (select(v_18, v_17, 8u) * 4u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_19 / 16u) * 4u)); + bool v_20 = (((0u + (16u * 7u)) + 2u) <= (v_19 / 16u)); Matrix_right_i32_8x8 m3 = Matrix_right_i32_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 4u)), (select(v_20, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); @@ -63,7 +63,7 @@ m5.Store(v, (0u + (select(v_30, v_28, 0u) * 4u)), (select(v_30, v_29, 8u) * 4u), MatrixLayout::ColMajor); uint v_31 = 0u; in6.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_31 / 8u) * 2u)); + bool v_32 = (((0u + (16u * 7u)) + 4u) <= (v_31 / 8u)); Matrix_right_i32_8x8 m6 = Matrix_right_i32_8x8::Load(in6, (0u + (select(v_32, 0u, 0u) * 4u)), (select(v_32, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_33 = 0u; v.GetDimensions(v_33);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_row_major.wgsl.expected.spvasm index bca25a8..b4c0fe4 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_i32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 219 +; Bound: 211 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,10 +128,10 @@ %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -167,131 +167,123 @@ OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %81 = OpArrayLength %uint %6 0 - %82 = OpIMul %uint %81 %uint_2 - %84 = OpIMul %uint %uint_16 %uint_7 - %85 = OpIAdd %uint %uint_0 %84 - %86 = OpIMul %uint %85 %uint_2 - %87 = OpIAdd %uint %86 %uint_8 - %88 = OpULessThanEqual %bool %87 %82 - %89 = OpSelect %uint %88 %uint_0 %uint_0 - %90 = OpSelect %uint %88 %uint_16 %uint_4 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v2int %92 %89 - %m1 = OpCooperativeMatrixLoadKHR %59 %93 %uint_0 %90 None - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %97 = OpArrayLength %uint %34 0 - %98 = OpBitcast %uint %int_0 - %99 = OpBitcast %uint %int_16 - %100 = OpIMul %uint %99 %uint_7 - %101 = OpIAdd %uint %98 %100 - %102 = OpIAdd %uint %101 %uint_8 - %103 = OpULessThanEqual %bool %102 %97 - %104 = OpSelect %uint %103 %98 %uint_0 - %105 = OpSelect %uint %103 %99 %uint_8 - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %107 = OpAccessChain %_ptr_StorageBuffer_uint_0 %106 %104 - OpCooperativeMatrixStoreKHR %107 %m1 %uint_1 %105 NonPrivatePointer - %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %111 = OpArrayLength %uint %12 0 - %112 = OpIMul %uint %111 %uint_4 - %113 = OpIMul %uint %uint_16 %uint_7 - %114 = OpIAdd %uint %uint_0 %113 - %115 = OpIMul %uint %114 %uint_4 - %116 = OpIAdd %uint %115 %uint_8 - %117 = OpULessThanEqual %bool %116 %112 - %118 = OpSelect %uint %117 %uint_0 %uint_0 - %119 = OpSelect %uint %117 %uint_16 %uint_2 - %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 - %m2 = OpCooperativeMatrixLoadKHR %59 %121 %uint_0 %119 None - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %125 = OpArrayLength %uint %34 0 - %126 = OpBitcast %uint %int_0 - %127 = OpBitcast %uint %int_16 - %128 = OpIMul %uint %127 %uint_7 - %129 = OpIAdd %uint %126 %128 - %130 = OpIAdd %uint %129 %uint_8 - %131 = OpULessThanEqual %bool %130 %125 - %132 = OpSelect %uint %131 %126 %uint_0 - %133 = OpSelect %uint %131 %127 %uint_8 - %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 - OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %139 = OpArrayLength %uint %18 0 - %140 = OpIMul %uint %139 %uint_4 - %141 = OpIMul %uint %uint_16 %uint_7 - %142 = OpIAdd %uint %uint_0 %141 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpIAdd %uint %143 %uint_8 - %145 = OpULessThanEqual %bool %144 %140 - %146 = OpSelect %uint %145 %uint_0 %uint_0 - %147 = OpSelect %uint %145 %uint_16 %uint_2 - %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %149 = OpAccessChain %_ptr_StorageBuffer_v4uint %148 %146 - %m3 = OpCooperativeMatrixLoadKHR %59 %149 %uint_0 %147 None - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %153 = OpArrayLength %uint %34 0 - %154 = OpBitcast %uint %int_0 - %155 = OpBitcast %uint %int_16 - %156 = OpIMul %uint %155 %uint_7 - %157 = OpIAdd %uint %154 %156 - %158 = OpIAdd %uint %157 %uint_8 - %159 = OpULessThanEqual %bool %158 %153 - %160 = OpSelect %uint %159 %154 %uint_0 - %161 = OpSelect %uint %159 %155 %uint_8 - %162 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %163 = OpAccessChain %_ptr_StorageBuffer_uint_0 %162 %160 - OpCooperativeMatrixStoreKHR %163 %m3 %uint_1 %161 NonPrivatePointer - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %167 = OpArrayLength %uint %23 0 - %168 = OpIMul %uint %uint_16 %uint_7 - %169 = OpIAdd %uint %uint_0 %168 - %170 = OpIAdd %uint %169 %uint_8 - %171 = OpULessThanEqual %bool %170 %167 - %172 = OpSelect %uint %171 %uint_0 %uint_0 - %173 = OpSelect %uint %171 %uint_16 %uint_8 - %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %175 = OpAccessChain %_ptr_StorageBuffer_v2half %174 %172 - %m5 = OpCooperativeMatrixLoadKHR %59 %175 %uint_0 %173 None - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %179 = OpArrayLength %uint %34 0 - %180 = OpBitcast %uint %int_0 - %181 = OpBitcast %uint %int_16 - %182 = OpIMul %uint %181 %uint_7 - %183 = OpIAdd %uint %180 %182 - %184 = OpIAdd %uint %183 %uint_8 - %185 = OpULessThanEqual %bool %184 %179 - %186 = OpSelect %uint %185 %180 %uint_0 - %187 = OpSelect %uint %185 %181 %uint_8 - %188 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %189 = OpAccessChain %_ptr_StorageBuffer_uint_0 %188 %186 - OpCooperativeMatrixStoreKHR %189 %m5 %uint_1 %187 NonPrivatePointer - %191 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %193 = OpArrayLength %uint %29 0 - %194 = OpIMul %uint %193 %uint_2 - %195 = OpIMul %uint %uint_16 %uint_7 - %196 = OpIAdd %uint %uint_0 %195 - %197 = OpIMul %uint %196 %uint_2 - %198 = OpIAdd %uint %197 %uint_8 - %199 = OpULessThanEqual %bool %198 %194 - %200 = OpSelect %uint %199 %uint_0 %uint_0 - %201 = OpSelect %uint %199 %uint_16 %uint_4 - %202 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %203 = OpAccessChain %_ptr_StorageBuffer_v3half %202 %200 - %m6 = OpCooperativeMatrixLoadKHR %59 %203 %uint_0 %201 None - %206 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %207 = OpArrayLength %uint %34 0 - %208 = OpBitcast %uint %int_0 - %209 = OpBitcast %uint %int_16 - %210 = OpIMul %uint %209 %uint_7 - %211 = OpIAdd %uint %208 %210 - %212 = OpIAdd %uint %211 %uint_8 - %213 = OpULessThanEqual %bool %212 %207 - %214 = OpSelect %uint %213 %208 %uint_0 - %215 = OpSelect %uint %213 %209 %uint_8 - %216 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %217 = OpAccessChain %_ptr_StorageBuffer_uint_0 %216 %214 - OpCooperativeMatrixStoreKHR %217 %m6 %uint_1 %215 NonPrivatePointer + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_4 + %86 = OpULessThanEqual %bool %84 %81 + %87 = OpSelect %uint %86 %uint_0 %uint_0 + %88 = OpSelect %uint %86 %uint_16 %uint_4 + %89 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %90 = OpAccessChain %_ptr_StorageBuffer_v2int %89 %87 + %m1 = OpCooperativeMatrixLoadKHR %59 %90 %uint_0 %88 None + %93 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %94 = OpArrayLength %uint %34 0 + %95 = OpBitcast %uint %int_0 + %96 = OpBitcast %uint %int_16 + %97 = OpIMul %uint %96 %uint_7 + %98 = OpIAdd %uint %95 %97 + %99 = OpIAdd %uint %98 %uint_8 + %100 = OpULessThanEqual %bool %99 %94 + %101 = OpSelect %uint %100 %95 %uint_0 + %102 = OpSelect %uint %100 %96 %uint_8 + %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %104 = OpAccessChain %_ptr_StorageBuffer_uint_0 %103 %101 + OpCooperativeMatrixStoreKHR %104 %m1 %uint_1 %102 NonPrivatePointer + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %108 = OpArrayLength %uint %12 0 + %109 = OpIMul %uint %uint_16 %uint_7 + %110 = OpIAdd %uint %uint_0 %109 + %111 = OpIAdd %uint %110 %uint_2 + %113 = OpULessThanEqual %bool %111 %108 + %114 = OpSelect %uint %113 %uint_0 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_2 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v3float %116 %114 + %m2 = OpCooperativeMatrixLoadKHR %59 %117 %uint_0 %115 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %121 = OpArrayLength %uint %34 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_8 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_8 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m2 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %135 = OpArrayLength %uint %18 0 + %136 = OpIMul %uint %uint_16 %uint_7 + %137 = OpIAdd %uint %uint_0 %136 + %138 = OpIAdd %uint %137 %uint_2 + %139 = OpULessThanEqual %bool %138 %135 + %140 = OpSelect %uint %139 %uint_0 %uint_0 + %141 = OpSelect %uint %139 %uint_16 %uint_2 + %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %143 = OpAccessChain %_ptr_StorageBuffer_v4uint %142 %140 + %m3 = OpCooperativeMatrixLoadKHR %59 %143 %uint_0 %141 None + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %147 = OpArrayLength %uint %34 0 + %148 = OpBitcast %uint %int_0 + %149 = OpBitcast %uint %int_16 + %150 = OpIMul %uint %149 %uint_7 + %151 = OpIAdd %uint %148 %150 + %152 = OpIAdd %uint %151 %uint_8 + %153 = OpULessThanEqual %bool %152 %147 + %154 = OpSelect %uint %153 %148 %uint_0 + %155 = OpSelect %uint %153 %149 %uint_8 + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %157 = OpAccessChain %_ptr_StorageBuffer_uint_0 %156 %154 + OpCooperativeMatrixStoreKHR %157 %m3 %uint_1 %155 NonPrivatePointer + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %161 = OpArrayLength %uint %23 0 + %162 = OpIMul %uint %uint_16 %uint_7 + %163 = OpIAdd %uint %uint_0 %162 + %164 = OpIAdd %uint %163 %uint_8 + %165 = OpULessThanEqual %bool %164 %161 + %166 = OpSelect %uint %165 %uint_0 %uint_0 + %167 = OpSelect %uint %165 %uint_16 %uint_8 + %168 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %169 = OpAccessChain %_ptr_StorageBuffer_v2half %168 %166 + %m5 = OpCooperativeMatrixLoadKHR %59 %169 %uint_0 %167 None + %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %173 = OpArrayLength %uint %34 0 + %174 = OpBitcast %uint %int_0 + %175 = OpBitcast %uint %int_16 + %176 = OpIMul %uint %175 %uint_7 + %177 = OpIAdd %uint %174 %176 + %178 = OpIAdd %uint %177 %uint_8 + %179 = OpULessThanEqual %bool %178 %173 + %180 = OpSelect %uint %179 %174 %uint_0 + %181 = OpSelect %uint %179 %175 %uint_8 + %182 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %183 = OpAccessChain %_ptr_StorageBuffer_uint_0 %182 %180 + OpCooperativeMatrixStoreKHR %183 %m5 %uint_1 %181 NonPrivatePointer + %185 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %187 = OpArrayLength %uint %29 0 + %188 = OpIMul %uint %uint_16 %uint_7 + %189 = OpIAdd %uint %uint_0 %188 + %190 = OpIAdd %uint %189 %uint_4 + %191 = OpULessThanEqual %bool %190 %187 + %192 = OpSelect %uint %191 %uint_0 %uint_0 + %193 = OpSelect %uint %191 %uint_16 %uint_4 + %194 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %195 = OpAccessChain %_ptr_StorageBuffer_v3half %194 %192 + %m6 = OpCooperativeMatrixLoadKHR %59 %195 %uint_0 %193 None + %198 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %199 = OpArrayLength %uint %34 0 + %200 = OpBitcast %uint %int_0 + %201 = OpBitcast %uint %int_16 + %202 = OpIMul %uint %201 %uint_7 + %203 = OpIAdd %uint %200 %202 + %204 = OpIAdd %uint %203 %uint_8 + %205 = OpULessThanEqual %bool %204 %199 + %206 = OpSelect %uint %205 %200 %uint_0 + %207 = OpSelect %uint %205 %201 %uint_8 + %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %209 = OpAccessChain %_ptr_StorageBuffer_uint_0 %208 %206 + OpCooperativeMatrixStoreKHR %209 %m6 %uint_1 %207 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl index 95121f2..59ff3c5 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -15,79 +15,79 @@ uint v_1 = 0u; in0.GetDimensions(v_1); uint v_2 = asuint(int(0)); - bool v_3 = ((((v_2 + (16u * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_3 = (((v_2 + (16u * 7u)) + 2u) <= (v_1 / 4u)); Matrix_right_i8_8x8 m0 = Matrix_right_i8_8x8::Load(in0, (0u + (select(v_3, v_2, 0u) * 4u)), (select(v_3, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_4 = 0u; v.GetDimensions(v_4); uint v_5 = asuint(int(0)); uint v_6 = asuint(int(16)); - bool v_7 = ((((v_5 + (v_6 * 7u)) * 4u) + 8u) <= ((v_4 / 4u) * 4u)); + bool v_7 = (((v_5 + (v_6 * 7u)) + 2u) <= (v_4 / 4u)); m0.Store(v, (0u + (select(v_7, v_5, 0u) * 4u)), (select(v_7, v_6, 2u) * 4u), MatrixLayout::ColMajor); uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 8u) + 8u) <= ((v_8 / 8u) * 8u)); + bool v_10 = (((v_9 + (16u * 7u)) + 1u) <= (v_8 / 8u)); Matrix_right_i8_8x8 m1 = Matrix_right_i8_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_11 = 0u; v.GetDimensions(v_11); uint v_12 = asuint(int(0)); uint v_13 = asuint(int(16)); - bool v_14 = ((((v_12 + (v_13 * 7u)) * 4u) + 8u) <= ((v_11 / 4u) * 4u)); + bool v_14 = (((v_12 + (v_13 * 7u)) + 2u) <= (v_11 / 4u)); m1.Store(v, (0u + (select(v_14, v_12, 0u) * 4u)), (select(v_14, v_13, 2u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 16u) + 16u) <= ((v_15 / 16u) * 16u)); + bool v_17 = (((v_16 + (16u * 7u)) + 1u) <= (v_15 / 16u)); Matrix_right_i8_8x8 m2 = Matrix_right_i8_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_18 = 0u; v.GetDimensions(v_18); uint v_19 = asuint(int(0)); uint v_20 = asuint(int(16)); - bool v_21 = ((((v_19 + (v_20 * 7u)) * 4u) + 8u) <= ((v_18 / 4u) * 4u)); + bool v_21 = (((v_19 + (v_20 * 7u)) + 2u) <= (v_18 / 4u)); m2.Store(v, (0u + (select(v_21, v_19, 0u) * 4u)), (select(v_21, v_20, 2u) * 4u), MatrixLayout::ColMajor); uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 16u) + 16u) <= ((v_22 / 16u) * 16u)); + bool v_24 = (((v_23 + (16u * 7u)) + 1u) <= (v_22 / 16u)); Matrix_right_i8_8x8 m3 = Matrix_right_i8_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m3.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); uint v_29 = 0u; in4.GetDimensions(v_29); uint v_30 = asuint(int(0)); - bool v_31 = ((((v_30 + (16u * 7u)) * 2u) + 8u) <= ((v_29 / 2u) * 2u)); + bool v_31 = (((v_30 + (16u * 7u)) + 4u) <= (v_29 / 2u)); Matrix_right_i8_8x8 m4 = Matrix_right_i8_8x8::Load(in4, (0u + (select(v_31, v_30, 0u) * 4u)), (select(v_31, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_32 = 0u; v.GetDimensions(v_32); uint v_33 = asuint(int(0)); uint v_34 = asuint(int(16)); - bool v_35 = ((((v_33 + (v_34 * 7u)) * 4u) + 8u) <= ((v_32 / 4u) * 4u)); + bool v_35 = (((v_33 + (v_34 * 7u)) + 2u) <= (v_32 / 4u)); m4.Store(v, (0u + (select(v_35, v_33, 0u) * 4u)), (select(v_35, v_34, 2u) * 4u), MatrixLayout::ColMajor); uint v_36 = 0u; in5.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 4u) + 8u) <= ((v_36 / 4u) * 4u)); + bool v_38 = (((v_37 + (16u * 7u)) + 2u) <= (v_36 / 4u)); Matrix_right_i8_8x8 m5 = Matrix_right_i8_8x8::Load(in5, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 4u) + 8u) <= ((v_39 / 4u) * 4u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 2u) <= (v_39 / 4u)); m5.Store(v, (0u + (select(v_42, v_40, 0u) * 4u)), (select(v_42, v_41, 2u) * 4u), MatrixLayout::ColMajor); uint v_43 = 0u; in6.GetDimensions(v_43); uint v_44 = asuint(int(0)); - bool v_45 = ((((v_44 + (16u * 7u)) * 8u) + 8u) <= ((v_43 / 8u) * 8u)); + bool v_45 = (((v_44 + (16u * 7u)) + 1u) <= (v_43 / 8u)); Matrix_right_i8_8x8 m6 = Matrix_right_i8_8x8::Load(in6, (0u + (select(v_45, v_44, 0u) * 4u)), (select(v_45, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_46 = 0u; v.GetDimensions(v_46); uint v_47 = asuint(int(0)); uint v_48 = asuint(int(16)); - bool v_49 = ((((v_47 + (v_48 * 7u)) * 4u) + 8u) <= ((v_46 / 4u) * 4u)); + bool v_49 = (((v_47 + (v_48 * 7u)) + 2u) <= (v_46 / 4u)); m6.Store(v, (0u + (select(v_49, v_47, 0u) * 4u)), (select(v_49, v_48, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_col_major.wgsl.expected.spvasm index 75e12d6..a2e99b7 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 277 +; Bound: 249 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -129,18 +129,17 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %char = OpTypeInt 8 1 %uint_1 = OpConstant %uint 1 - %69 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_1 + %65 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_1 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint @@ -151,6 +150,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -160,206 +160,178 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_4 - %51 = OpBitcast %uint %int_0 - %53 = OpIMul %uint %uint_16 %uint_7 - %56 = OpIAdd %uint %51 %53 - %57 = OpIMul %uint %56 %uint_4 - %58 = OpIAdd %uint %57 %uint_8 - %60 = OpULessThanEqual %bool %58 %49 - %62 = OpSelect %uint %60 %51 %uint_0 - %63 = OpSelect %uint %60 %uint_16 %uint_2 - %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %66 = OpAccessChain %_ptr_StorageBuffer_uint %65 %62 - %m0 = OpCooperativeMatrixLoadKHR %69 %66 %uint_1 %63 None - %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %75 = OpArrayLength %uint %38 0 - %76 = OpIMul %uint %75 %uint_4 - %77 = OpBitcast %uint %int_0 - %78 = OpBitcast %uint %int_16 - %80 = OpIMul %uint %78 %uint_7 - %81 = OpIAdd %uint %77 %80 - %82 = OpIMul %uint %81 %uint_4 - %83 = OpIAdd %uint %82 %uint_8 - %84 = OpULessThanEqual %bool %83 %76 - %85 = OpSelect %uint %84 %77 %uint_0 - %86 = OpSelect %uint %84 %78 %uint_2 - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %88 = OpAccessChain %_ptr_StorageBuffer_uint_0 %87 %85 - OpCooperativeMatrixStoreKHR %88 %m0 %uint_1 %86 NonPrivatePointer - %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %93 = OpArrayLength %uint %6 0 - %94 = OpIMul %uint %93 %uint_8 - %95 = OpBitcast %uint %int_0 - %96 = OpIMul %uint %uint_16 %uint_7 - %97 = OpIAdd %uint %95 %96 - %98 = OpIMul %uint %97 %uint_8 - %99 = OpIAdd %uint %98 %uint_8 - %100 = OpULessThanEqual %bool %99 %94 - %101 = OpSelect %uint %100 %95 %uint_0 - %102 = OpSelect %uint %100 %uint_16 %uint_1 - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v2int %103 %101 - %m1 = OpCooperativeMatrixLoadKHR %69 %104 %uint_1 %102 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %108 = OpArrayLength %uint %38 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m1 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpArrayLength %uint %12 0 - %125 = OpIMul %uint %124 %uint_16 - %126 = OpBitcast %uint %int_0 - %127 = OpIMul %uint %uint_16 %uint_7 - %128 = OpIAdd %uint %126 %127 - %129 = OpIMul %uint %128 %uint_16 - %130 = OpIAdd %uint %129 %uint_16 - %131 = OpULessThanEqual %bool %130 %125 - %132 = OpSelect %uint %131 %126 %uint_0 - %133 = OpSelect %uint %131 %uint_16 %uint_1 - %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %135 = OpAccessChain %_ptr_StorageBuffer_v3float %134 %132 - %m2 = OpCooperativeMatrixLoadKHR %69 %135 %uint_1 %133 None - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %139 = OpArrayLength %uint %38 0 - %140 = OpIMul %uint %139 %uint_4 - %141 = OpBitcast %uint %int_0 - %142 = OpBitcast %uint %int_16 - %143 = OpIMul %uint %142 %uint_7 - %144 = OpIAdd %uint %141 %143 - %145 = OpIMul %uint %144 %uint_4 - %146 = OpIAdd %uint %145 %uint_8 - %147 = OpULessThanEqual %bool %146 %140 - %148 = OpSelect %uint %147 %141 %uint_0 - %149 = OpSelect %uint %147 %142 %uint_2 - %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %151 = OpAccessChain %_ptr_StorageBuffer_uint_0 %150 %148 - OpCooperativeMatrixStoreKHR %151 %m2 %uint_1 %149 NonPrivatePointer - %153 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %155 = OpArrayLength %uint %18 0 - %156 = OpIMul %uint %155 %uint_16 - %157 = OpBitcast %uint %int_0 - %158 = OpIMul %uint %uint_16 %uint_7 - %159 = OpIAdd %uint %157 %158 - %160 = OpIMul %uint %159 %uint_16 - %161 = OpIAdd %uint %160 %uint_16 - %162 = OpULessThanEqual %bool %161 %156 - %163 = OpSelect %uint %162 %157 %uint_0 - %164 = OpSelect %uint %162 %uint_16 %uint_1 - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %166 = OpAccessChain %_ptr_StorageBuffer_v4uint %165 %163 - %m3 = OpCooperativeMatrixLoadKHR %69 %166 %uint_1 %164 None - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %170 = OpArrayLength %uint %38 0 - %171 = OpIMul %uint %170 %uint_4 - %172 = OpBitcast %uint %int_0 - %173 = OpBitcast %uint %int_16 - %174 = OpIMul %uint %173 %uint_7 - %175 = OpIAdd %uint %172 %174 - %176 = OpIMul %uint %175 %uint_4 - %177 = OpIAdd %uint %176 %uint_8 - %178 = OpULessThanEqual %bool %177 %171 - %179 = OpSelect %uint %178 %172 %uint_0 - %180 = OpSelect %uint %178 %173 %uint_2 - %181 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %182 = OpAccessChain %_ptr_StorageBuffer_uint_0 %181 %179 - OpCooperativeMatrixStoreKHR %182 %m3 %uint_1 %180 NonPrivatePointer - %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %186 = OpArrayLength %uint %23 0 - %187 = OpIMul %uint %186 %uint_2 - %188 = OpBitcast %uint %int_0 - %189 = OpIMul %uint %uint_16 %uint_7 - %190 = OpIAdd %uint %188 %189 - %191 = OpIMul %uint %190 %uint_2 - %192 = OpIAdd %uint %191 %uint_8 - %193 = OpULessThanEqual %bool %192 %187 - %194 = OpSelect %uint %193 %188 %uint_0 - %195 = OpSelect %uint %193 %uint_16 %uint_4 - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %197 = OpAccessChain %_ptr_StorageBuffer_half %196 %194 - %m4 = OpCooperativeMatrixLoadKHR %69 %197 %uint_1 %195 None - %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %201 = OpArrayLength %uint %38 0 - %202 = OpIMul %uint %201 %uint_4 - %203 = OpBitcast %uint %int_0 - %204 = OpBitcast %uint %int_16 - %205 = OpIMul %uint %204 %uint_7 - %206 = OpIAdd %uint %203 %205 - %207 = OpIMul %uint %206 %uint_4 - %208 = OpIAdd %uint %207 %uint_8 - %209 = OpULessThanEqual %bool %208 %202 - %210 = OpSelect %uint %209 %203 %uint_0 - %211 = OpSelect %uint %209 %204 %uint_2 - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %213 = OpAccessChain %_ptr_StorageBuffer_uint_0 %212 %210 - OpCooperativeMatrixStoreKHR %213 %m4 %uint_1 %211 NonPrivatePointer - %215 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %217 = OpArrayLength %uint %28 0 - %218 = OpIMul %uint %217 %uint_4 - %219 = OpBitcast %uint %int_0 - %220 = OpIMul %uint %uint_16 %uint_7 - %221 = OpIAdd %uint %219 %220 - %222 = OpIMul %uint %221 %uint_4 - %223 = OpIAdd %uint %222 %uint_8 - %224 = OpULessThanEqual %bool %223 %218 - %225 = OpSelect %uint %224 %219 %uint_0 - %226 = OpSelect %uint %224 %uint_16 %uint_2 - %227 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %228 = OpAccessChain %_ptr_StorageBuffer_v2half %227 %225 - %m5 = OpCooperativeMatrixLoadKHR %69 %228 %uint_1 %226 None - %231 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %232 = OpArrayLength %uint %38 0 - %233 = OpIMul %uint %232 %uint_4 - %234 = OpBitcast %uint %int_0 - %235 = OpBitcast %uint %int_16 - %236 = OpIMul %uint %235 %uint_7 - %237 = OpIAdd %uint %234 %236 - %238 = OpIMul %uint %237 %uint_4 - %239 = OpIAdd %uint %238 %uint_8 - %240 = OpULessThanEqual %bool %239 %233 - %241 = OpSelect %uint %240 %234 %uint_0 - %242 = OpSelect %uint %240 %235 %uint_2 - %243 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %244 = OpAccessChain %_ptr_StorageBuffer_uint_0 %243 %241 - OpCooperativeMatrixStoreKHR %244 %m5 %uint_1 %242 NonPrivatePointer - %246 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %248 = OpArrayLength %uint %33 0 - %249 = OpIMul %uint %248 %uint_8 - %250 = OpBitcast %uint %int_0 - %251 = OpIMul %uint %uint_16 %uint_7 - %252 = OpIAdd %uint %250 %251 - %253 = OpIMul %uint %252 %uint_8 - %254 = OpIAdd %uint %253 %uint_8 - %255 = OpULessThanEqual %bool %254 %249 - %256 = OpSelect %uint %255 %250 %uint_0 - %257 = OpSelect %uint %255 %uint_16 %uint_1 - %258 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %259 = OpAccessChain %_ptr_StorageBuffer_v3half %258 %256 - %m6 = OpCooperativeMatrixLoadKHR %69 %259 %uint_1 %257 None - %262 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %263 = OpArrayLength %uint %38 0 - %264 = OpIMul %uint %263 %uint_4 - %265 = OpBitcast %uint %int_0 - %266 = OpBitcast %uint %int_16 - %267 = OpIMul %uint %266 %uint_7 - %268 = OpIAdd %uint %265 %267 - %269 = OpIMul %uint %268 %uint_4 - %270 = OpIAdd %uint %269 %uint_8 - %271 = OpULessThanEqual %bool %270 %264 - %272 = OpSelect %uint %271 %265 %uint_0 - %273 = OpSelect %uint %271 %266 %uint_2 - %274 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %275 = OpAccessChain %_ptr_StorageBuffer_uint_0 %274 %272 - OpCooperativeMatrixStoreKHR %275 %m6 %uint_1 %273 NonPrivatePointer + %49 = OpBitcast %uint %int_0 + %51 = OpIMul %uint %uint_16 %uint_7 + %54 = OpIAdd %uint %49 %51 + %55 = OpIAdd %uint %54 %uint_2 + %57 = OpULessThanEqual %bool %55 %48 + %59 = OpSelect %uint %57 %49 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_2 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + %m0 = OpCooperativeMatrixLoadKHR %65 %62 %uint_1 %60 None + %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %72 = OpArrayLength %uint %38 0 + %73 = OpBitcast %uint %int_0 + %74 = OpBitcast %uint %int_16 + %76 = OpIMul %uint %74 %uint_7 + %77 = OpIAdd %uint %73 %76 + %78 = OpIAdd %uint %77 %uint_2 + %79 = OpULessThanEqual %bool %78 %72 + %80 = OpSelect %uint %79 %73 %uint_0 + %81 = OpSelect %uint %79 %74 %uint_2 + %82 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %83 = OpAccessChain %_ptr_StorageBuffer_uint_0 %82 %80 + OpCooperativeMatrixStoreKHR %83 %m0 %uint_1 %81 NonPrivatePointer + %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %88 = OpArrayLength %uint %6 0 + %89 = OpBitcast %uint %int_0 + %90 = OpIMul %uint %uint_16 %uint_7 + %91 = OpIAdd %uint %89 %90 + %92 = OpIAdd %uint %91 %uint_1 + %93 = OpULessThanEqual %bool %92 %88 + %94 = OpSelect %uint %93 %89 %uint_0 + %95 = OpSelect %uint %93 %uint_16 %uint_1 + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %97 = OpAccessChain %_ptr_StorageBuffer_v2int %96 %94 + %m1 = OpCooperativeMatrixLoadKHR %65 %97 %uint_1 %95 None + %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %101 = OpArrayLength %uint %38 0 + %102 = OpBitcast %uint %int_0 + %103 = OpBitcast %uint %int_16 + %104 = OpIMul %uint %103 %uint_7 + %105 = OpIAdd %uint %102 %104 + %106 = OpIAdd %uint %105 %uint_2 + %107 = OpULessThanEqual %bool %106 %101 + %108 = OpSelect %uint %107 %102 %uint_0 + %109 = OpSelect %uint %107 %103 %uint_2 + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %111 = OpAccessChain %_ptr_StorageBuffer_uint_0 %110 %108 + OpCooperativeMatrixStoreKHR %111 %m1 %uint_1 %109 NonPrivatePointer + %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %115 = OpArrayLength %uint %12 0 + %116 = OpBitcast %uint %int_0 + %117 = OpIMul %uint %uint_16 %uint_7 + %118 = OpIAdd %uint %116 %117 + %119 = OpIAdd %uint %118 %uint_1 + %120 = OpULessThanEqual %bool %119 %115 + %121 = OpSelect %uint %120 %116 %uint_0 + %122 = OpSelect %uint %120 %uint_16 %uint_1 + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 + %m2 = OpCooperativeMatrixLoadKHR %65 %124 %uint_1 %122 None + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %128 = OpArrayLength %uint %38 0 + %129 = OpBitcast %uint %int_0 + %130 = OpBitcast %uint %int_16 + %131 = OpIMul %uint %130 %uint_7 + %132 = OpIAdd %uint %129 %131 + %133 = OpIAdd %uint %132 %uint_2 + %134 = OpULessThanEqual %bool %133 %128 + %135 = OpSelect %uint %134 %129 %uint_0 + %136 = OpSelect %uint %134 %130 %uint_2 + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 + OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer + %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %142 = OpArrayLength %uint %18 0 + %143 = OpBitcast %uint %int_0 + %144 = OpIMul %uint %uint_16 %uint_7 + %145 = OpIAdd %uint %143 %144 + %146 = OpIAdd %uint %145 %uint_1 + %147 = OpULessThanEqual %bool %146 %142 + %148 = OpSelect %uint %147 %143 %uint_0 + %149 = OpSelect %uint %147 %uint_16 %uint_1 + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %151 = OpAccessChain %_ptr_StorageBuffer_v4uint %150 %148 + %m3 = OpCooperativeMatrixLoadKHR %65 %151 %uint_1 %149 None + %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %155 = OpArrayLength %uint %38 0 + %156 = OpBitcast %uint %int_0 + %157 = OpBitcast %uint %int_16 + %158 = OpIMul %uint %157 %uint_7 + %159 = OpIAdd %uint %156 %158 + %160 = OpIAdd %uint %159 %uint_2 + %161 = OpULessThanEqual %bool %160 %155 + %162 = OpSelect %uint %161 %156 %uint_0 + %163 = OpSelect %uint %161 %157 %uint_2 + %164 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %165 = OpAccessChain %_ptr_StorageBuffer_uint_0 %164 %162 + OpCooperativeMatrixStoreKHR %165 %m3 %uint_1 %163 NonPrivatePointer + %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %169 = OpArrayLength %uint %23 0 + %170 = OpBitcast %uint %int_0 + %171 = OpIMul %uint %uint_16 %uint_7 + %172 = OpIAdd %uint %170 %171 + %173 = OpIAdd %uint %172 %uint_4 + %175 = OpULessThanEqual %bool %173 %169 + %176 = OpSelect %uint %175 %170 %uint_0 + %177 = OpSelect %uint %175 %uint_16 %uint_4 + %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %179 = OpAccessChain %_ptr_StorageBuffer_half %178 %176 + %m4 = OpCooperativeMatrixLoadKHR %65 %179 %uint_1 %177 None + %182 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %183 = OpArrayLength %uint %38 0 + %184 = OpBitcast %uint %int_0 + %185 = OpBitcast %uint %int_16 + %186 = OpIMul %uint %185 %uint_7 + %187 = OpIAdd %uint %184 %186 + %188 = OpIAdd %uint %187 %uint_2 + %189 = OpULessThanEqual %bool %188 %183 + %190 = OpSelect %uint %189 %184 %uint_0 + %191 = OpSelect %uint %189 %185 %uint_2 + %192 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %193 = OpAccessChain %_ptr_StorageBuffer_uint_0 %192 %190 + OpCooperativeMatrixStoreKHR %193 %m4 %uint_1 %191 NonPrivatePointer + %195 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %197 = OpArrayLength %uint %28 0 + %198 = OpBitcast %uint %int_0 + %199 = OpIMul %uint %uint_16 %uint_7 + %200 = OpIAdd %uint %198 %199 + %201 = OpIAdd %uint %200 %uint_2 + %202 = OpULessThanEqual %bool %201 %197 + %203 = OpSelect %uint %202 %198 %uint_0 + %204 = OpSelect %uint %202 %uint_16 %uint_2 + %205 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %206 = OpAccessChain %_ptr_StorageBuffer_v2half %205 %203 + %m5 = OpCooperativeMatrixLoadKHR %65 %206 %uint_1 %204 None + %209 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %210 = OpArrayLength %uint %38 0 + %211 = OpBitcast %uint %int_0 + %212 = OpBitcast %uint %int_16 + %213 = OpIMul %uint %212 %uint_7 + %214 = OpIAdd %uint %211 %213 + %215 = OpIAdd %uint %214 %uint_2 + %216 = OpULessThanEqual %bool %215 %210 + %217 = OpSelect %uint %216 %211 %uint_0 + %218 = OpSelect %uint %216 %212 %uint_2 + %219 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %220 = OpAccessChain %_ptr_StorageBuffer_uint_0 %219 %217 + OpCooperativeMatrixStoreKHR %220 %m5 %uint_1 %218 NonPrivatePointer + %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %224 = OpArrayLength %uint %33 0 + %225 = OpBitcast %uint %int_0 + %226 = OpIMul %uint %uint_16 %uint_7 + %227 = OpIAdd %uint %225 %226 + %228 = OpIAdd %uint %227 %uint_1 + %229 = OpULessThanEqual %bool %228 %224 + %230 = OpSelect %uint %229 %225 %uint_0 + %231 = OpSelect %uint %229 %uint_16 %uint_1 + %232 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %233 = OpAccessChain %_ptr_StorageBuffer_v3half %232 %230 + %m6 = OpCooperativeMatrixLoadKHR %65 %233 %uint_1 %231 None + %236 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %237 = OpArrayLength %uint %38 0 + %238 = OpBitcast %uint %int_0 + %239 = OpBitcast %uint %int_16 + %240 = OpIMul %uint %239 %uint_7 + %241 = OpIAdd %uint %238 %240 + %242 = OpIAdd %uint %241 %uint_2 + %243 = OpULessThanEqual %bool %242 %237 + %244 = OpSelect %uint %243 %238 %uint_0 + %245 = OpSelect %uint %243 %239 %uint_2 + %246 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %247 = OpAccessChain %_ptr_StorageBuffer_uint_0 %246 %244 + OpCooperativeMatrixStoreKHR %247 %m6 %uint_1 %245 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl index 38fb4a8..ebab3bc 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -15,79 +15,79 @@ uint v_1 = 0u; in0.GetDimensions(v_1); uint v_2 = asuint(int(0)); - bool v_3 = ((((v_2 + (16u * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_3 = (((v_2 + (16u * 7u)) + 2u) <= (v_1 / 4u)); Matrix_right_i8_8x8 m0 = Matrix_right_i8_8x8::Load(in0, (0u + (select(v_3, v_2, 0u) * 4u)), (select(v_3, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_4 = 0u; v.GetDimensions(v_4); uint v_5 = asuint(int(0)); uint v_6 = asuint(int(16)); - bool v_7 = ((((v_5 + (v_6 * 7u)) * 4u) + 8u) <= ((v_4 / 4u) * 4u)); + bool v_7 = (((v_5 + (v_6 * 7u)) + 2u) <= (v_4 / 4u)); m0.Store(v, (0u + (select(v_7, v_5, 0u) * 4u)), (select(v_7, v_6, 2u) * 4u), MatrixLayout::ColMajor); uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 8u) + 8u) <= ((v_8 / 8u) * 8u)); + bool v_10 = (((v_9 + (16u * 7u)) + 1u) <= (v_8 / 8u)); Matrix_right_i8_8x8 m1 = Matrix_right_i8_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_11 = 0u; v.GetDimensions(v_11); uint v_12 = asuint(int(0)); uint v_13 = asuint(int(16)); - bool v_14 = ((((v_12 + (v_13 * 7u)) * 4u) + 8u) <= ((v_11 / 4u) * 4u)); + bool v_14 = (((v_12 + (v_13 * 7u)) + 2u) <= (v_11 / 4u)); m1.Store(v, (0u + (select(v_14, v_12, 0u) * 4u)), (select(v_14, v_13, 2u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 16u) + 16u) <= ((v_15 / 16u) * 16u)); + bool v_17 = (((v_16 + (16u * 7u)) + 1u) <= (v_15 / 16u)); Matrix_right_i8_8x8 m2 = Matrix_right_i8_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_18 = 0u; v.GetDimensions(v_18); uint v_19 = asuint(int(0)); uint v_20 = asuint(int(16)); - bool v_21 = ((((v_19 + (v_20 * 7u)) * 4u) + 8u) <= ((v_18 / 4u) * 4u)); + bool v_21 = (((v_19 + (v_20 * 7u)) + 2u) <= (v_18 / 4u)); m2.Store(v, (0u + (select(v_21, v_19, 0u) * 4u)), (select(v_21, v_20, 2u) * 4u), MatrixLayout::ColMajor); uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 16u) + 16u) <= ((v_22 / 16u) * 16u)); + bool v_24 = (((v_23 + (16u * 7u)) + 1u) <= (v_22 / 16u)); Matrix_right_i8_8x8 m3 = Matrix_right_i8_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m3.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); uint v_29 = 0u; in4.GetDimensions(v_29); uint v_30 = asuint(int(0)); - bool v_31 = ((((v_30 + (16u * 7u)) * 2u) + 8u) <= ((v_29 / 2u) * 2u)); + bool v_31 = (((v_30 + (16u * 7u)) + 4u) <= (v_29 / 2u)); Matrix_right_i8_8x8 m4 = Matrix_right_i8_8x8::Load(in4, (0u + (select(v_31, v_30, 0u) * 4u)), (select(v_31, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_32 = 0u; v.GetDimensions(v_32); uint v_33 = asuint(int(0)); uint v_34 = asuint(int(16)); - bool v_35 = ((((v_33 + (v_34 * 7u)) * 4u) + 8u) <= ((v_32 / 4u) * 4u)); + bool v_35 = (((v_33 + (v_34 * 7u)) + 2u) <= (v_32 / 4u)); m4.Store(v, (0u + (select(v_35, v_33, 0u) * 4u)), (select(v_35, v_34, 2u) * 4u), MatrixLayout::ColMajor); uint v_36 = 0u; in5.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 4u) + 8u) <= ((v_36 / 4u) * 4u)); + bool v_38 = (((v_37 + (16u * 7u)) + 2u) <= (v_36 / 4u)); Matrix_right_i8_8x8 m5 = Matrix_right_i8_8x8::Load(in5, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 4u) + 8u) <= ((v_39 / 4u) * 4u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 2u) <= (v_39 / 4u)); m5.Store(v, (0u + (select(v_42, v_40, 0u) * 4u)), (select(v_42, v_41, 2u) * 4u), MatrixLayout::ColMajor); uint v_43 = 0u; in6.GetDimensions(v_43); uint v_44 = asuint(int(0)); - bool v_45 = ((((v_44 + (16u * 7u)) * 8u) + 8u) <= ((v_43 / 8u) * 8u)); + bool v_45 = (((v_44 + (16u * 7u)) + 1u) <= (v_43 / 8u)); Matrix_right_i8_8x8 m6 = Matrix_right_i8_8x8::Load(in6, (0u + (select(v_45, v_44, 0u) * 4u)), (select(v_45, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_46 = 0u; v.GetDimensions(v_46); uint v_47 = asuint(int(0)); uint v_48 = asuint(int(16)); - bool v_49 = ((((v_47 + (v_48 * 7u)) * 4u) + 8u) <= ((v_46 / 4u) * 4u)); + bool v_49 = (((v_47 + (v_48 * 7u)) + 2u) <= (v_46 / 4u)); m6.Store(v, (0u + (select(v_49, v_47, 0u) * 4u)), (select(v_49, v_48, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_row_major.wgsl.expected.spvasm index 984dfa0..2ec5bd2 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 277 +; Bound: 249 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -129,18 +129,17 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %char = OpTypeInt 8 1 %uint_1 = OpConstant %uint 1 - %69 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_1 + %65 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_1 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint @@ -151,6 +150,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -160,206 +160,178 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_4 - %51 = OpBitcast %uint %int_0 - %53 = OpIMul %uint %uint_16 %uint_7 - %56 = OpIAdd %uint %51 %53 - %57 = OpIMul %uint %56 %uint_4 - %58 = OpIAdd %uint %57 %uint_8 - %60 = OpULessThanEqual %bool %58 %49 - %62 = OpSelect %uint %60 %51 %uint_0 - %63 = OpSelect %uint %60 %uint_16 %uint_2 - %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %66 = OpAccessChain %_ptr_StorageBuffer_uint %65 %62 - %m0 = OpCooperativeMatrixLoadKHR %69 %66 %uint_0 %63 None - %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %75 = OpArrayLength %uint %38 0 - %76 = OpIMul %uint %75 %uint_4 - %77 = OpBitcast %uint %int_0 - %78 = OpBitcast %uint %int_16 - %80 = OpIMul %uint %78 %uint_7 - %81 = OpIAdd %uint %77 %80 - %82 = OpIMul %uint %81 %uint_4 - %83 = OpIAdd %uint %82 %uint_8 - %84 = OpULessThanEqual %bool %83 %76 - %85 = OpSelect %uint %84 %77 %uint_0 - %86 = OpSelect %uint %84 %78 %uint_2 - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %88 = OpAccessChain %_ptr_StorageBuffer_uint_0 %87 %85 - OpCooperativeMatrixStoreKHR %88 %m0 %uint_1 %86 NonPrivatePointer - %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %93 = OpArrayLength %uint %6 0 - %94 = OpIMul %uint %93 %uint_8 - %95 = OpBitcast %uint %int_0 - %96 = OpIMul %uint %uint_16 %uint_7 - %97 = OpIAdd %uint %95 %96 - %98 = OpIMul %uint %97 %uint_8 - %99 = OpIAdd %uint %98 %uint_8 - %100 = OpULessThanEqual %bool %99 %94 - %101 = OpSelect %uint %100 %95 %uint_0 - %102 = OpSelect %uint %100 %uint_16 %uint_1 - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v2int %103 %101 - %m1 = OpCooperativeMatrixLoadKHR %69 %104 %uint_0 %102 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %108 = OpArrayLength %uint %38 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m1 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpArrayLength %uint %12 0 - %125 = OpIMul %uint %124 %uint_16 - %126 = OpBitcast %uint %int_0 - %127 = OpIMul %uint %uint_16 %uint_7 - %128 = OpIAdd %uint %126 %127 - %129 = OpIMul %uint %128 %uint_16 - %130 = OpIAdd %uint %129 %uint_16 - %131 = OpULessThanEqual %bool %130 %125 - %132 = OpSelect %uint %131 %126 %uint_0 - %133 = OpSelect %uint %131 %uint_16 %uint_1 - %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %135 = OpAccessChain %_ptr_StorageBuffer_v3float %134 %132 - %m2 = OpCooperativeMatrixLoadKHR %69 %135 %uint_0 %133 None - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %139 = OpArrayLength %uint %38 0 - %140 = OpIMul %uint %139 %uint_4 - %141 = OpBitcast %uint %int_0 - %142 = OpBitcast %uint %int_16 - %143 = OpIMul %uint %142 %uint_7 - %144 = OpIAdd %uint %141 %143 - %145 = OpIMul %uint %144 %uint_4 - %146 = OpIAdd %uint %145 %uint_8 - %147 = OpULessThanEqual %bool %146 %140 - %148 = OpSelect %uint %147 %141 %uint_0 - %149 = OpSelect %uint %147 %142 %uint_2 - %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %151 = OpAccessChain %_ptr_StorageBuffer_uint_0 %150 %148 - OpCooperativeMatrixStoreKHR %151 %m2 %uint_1 %149 NonPrivatePointer - %153 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %155 = OpArrayLength %uint %18 0 - %156 = OpIMul %uint %155 %uint_16 - %157 = OpBitcast %uint %int_0 - %158 = OpIMul %uint %uint_16 %uint_7 - %159 = OpIAdd %uint %157 %158 - %160 = OpIMul %uint %159 %uint_16 - %161 = OpIAdd %uint %160 %uint_16 - %162 = OpULessThanEqual %bool %161 %156 - %163 = OpSelect %uint %162 %157 %uint_0 - %164 = OpSelect %uint %162 %uint_16 %uint_1 - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %166 = OpAccessChain %_ptr_StorageBuffer_v4uint %165 %163 - %m3 = OpCooperativeMatrixLoadKHR %69 %166 %uint_0 %164 None - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %170 = OpArrayLength %uint %38 0 - %171 = OpIMul %uint %170 %uint_4 - %172 = OpBitcast %uint %int_0 - %173 = OpBitcast %uint %int_16 - %174 = OpIMul %uint %173 %uint_7 - %175 = OpIAdd %uint %172 %174 - %176 = OpIMul %uint %175 %uint_4 - %177 = OpIAdd %uint %176 %uint_8 - %178 = OpULessThanEqual %bool %177 %171 - %179 = OpSelect %uint %178 %172 %uint_0 - %180 = OpSelect %uint %178 %173 %uint_2 - %181 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %182 = OpAccessChain %_ptr_StorageBuffer_uint_0 %181 %179 - OpCooperativeMatrixStoreKHR %182 %m3 %uint_1 %180 NonPrivatePointer - %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %186 = OpArrayLength %uint %23 0 - %187 = OpIMul %uint %186 %uint_2 - %188 = OpBitcast %uint %int_0 - %189 = OpIMul %uint %uint_16 %uint_7 - %190 = OpIAdd %uint %188 %189 - %191 = OpIMul %uint %190 %uint_2 - %192 = OpIAdd %uint %191 %uint_8 - %193 = OpULessThanEqual %bool %192 %187 - %194 = OpSelect %uint %193 %188 %uint_0 - %195 = OpSelect %uint %193 %uint_16 %uint_4 - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %197 = OpAccessChain %_ptr_StorageBuffer_half %196 %194 - %m4 = OpCooperativeMatrixLoadKHR %69 %197 %uint_0 %195 None - %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %201 = OpArrayLength %uint %38 0 - %202 = OpIMul %uint %201 %uint_4 - %203 = OpBitcast %uint %int_0 - %204 = OpBitcast %uint %int_16 - %205 = OpIMul %uint %204 %uint_7 - %206 = OpIAdd %uint %203 %205 - %207 = OpIMul %uint %206 %uint_4 - %208 = OpIAdd %uint %207 %uint_8 - %209 = OpULessThanEqual %bool %208 %202 - %210 = OpSelect %uint %209 %203 %uint_0 - %211 = OpSelect %uint %209 %204 %uint_2 - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %213 = OpAccessChain %_ptr_StorageBuffer_uint_0 %212 %210 - OpCooperativeMatrixStoreKHR %213 %m4 %uint_1 %211 NonPrivatePointer - %215 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %217 = OpArrayLength %uint %28 0 - %218 = OpIMul %uint %217 %uint_4 - %219 = OpBitcast %uint %int_0 - %220 = OpIMul %uint %uint_16 %uint_7 - %221 = OpIAdd %uint %219 %220 - %222 = OpIMul %uint %221 %uint_4 - %223 = OpIAdd %uint %222 %uint_8 - %224 = OpULessThanEqual %bool %223 %218 - %225 = OpSelect %uint %224 %219 %uint_0 - %226 = OpSelect %uint %224 %uint_16 %uint_2 - %227 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %228 = OpAccessChain %_ptr_StorageBuffer_v2half %227 %225 - %m5 = OpCooperativeMatrixLoadKHR %69 %228 %uint_0 %226 None - %231 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %232 = OpArrayLength %uint %38 0 - %233 = OpIMul %uint %232 %uint_4 - %234 = OpBitcast %uint %int_0 - %235 = OpBitcast %uint %int_16 - %236 = OpIMul %uint %235 %uint_7 - %237 = OpIAdd %uint %234 %236 - %238 = OpIMul %uint %237 %uint_4 - %239 = OpIAdd %uint %238 %uint_8 - %240 = OpULessThanEqual %bool %239 %233 - %241 = OpSelect %uint %240 %234 %uint_0 - %242 = OpSelect %uint %240 %235 %uint_2 - %243 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %244 = OpAccessChain %_ptr_StorageBuffer_uint_0 %243 %241 - OpCooperativeMatrixStoreKHR %244 %m5 %uint_1 %242 NonPrivatePointer - %246 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %248 = OpArrayLength %uint %33 0 - %249 = OpIMul %uint %248 %uint_8 - %250 = OpBitcast %uint %int_0 - %251 = OpIMul %uint %uint_16 %uint_7 - %252 = OpIAdd %uint %250 %251 - %253 = OpIMul %uint %252 %uint_8 - %254 = OpIAdd %uint %253 %uint_8 - %255 = OpULessThanEqual %bool %254 %249 - %256 = OpSelect %uint %255 %250 %uint_0 - %257 = OpSelect %uint %255 %uint_16 %uint_1 - %258 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %259 = OpAccessChain %_ptr_StorageBuffer_v3half %258 %256 - %m6 = OpCooperativeMatrixLoadKHR %69 %259 %uint_0 %257 None - %262 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %263 = OpArrayLength %uint %38 0 - %264 = OpIMul %uint %263 %uint_4 - %265 = OpBitcast %uint %int_0 - %266 = OpBitcast %uint %int_16 - %267 = OpIMul %uint %266 %uint_7 - %268 = OpIAdd %uint %265 %267 - %269 = OpIMul %uint %268 %uint_4 - %270 = OpIAdd %uint %269 %uint_8 - %271 = OpULessThanEqual %bool %270 %264 - %272 = OpSelect %uint %271 %265 %uint_0 - %273 = OpSelect %uint %271 %266 %uint_2 - %274 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %275 = OpAccessChain %_ptr_StorageBuffer_uint_0 %274 %272 - OpCooperativeMatrixStoreKHR %275 %m6 %uint_1 %273 NonPrivatePointer + %49 = OpBitcast %uint %int_0 + %51 = OpIMul %uint %uint_16 %uint_7 + %54 = OpIAdd %uint %49 %51 + %55 = OpIAdd %uint %54 %uint_2 + %57 = OpULessThanEqual %bool %55 %48 + %59 = OpSelect %uint %57 %49 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_2 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + %m0 = OpCooperativeMatrixLoadKHR %65 %62 %uint_0 %60 None + %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %72 = OpArrayLength %uint %38 0 + %73 = OpBitcast %uint %int_0 + %74 = OpBitcast %uint %int_16 + %76 = OpIMul %uint %74 %uint_7 + %77 = OpIAdd %uint %73 %76 + %78 = OpIAdd %uint %77 %uint_2 + %79 = OpULessThanEqual %bool %78 %72 + %80 = OpSelect %uint %79 %73 %uint_0 + %81 = OpSelect %uint %79 %74 %uint_2 + %82 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %83 = OpAccessChain %_ptr_StorageBuffer_uint_0 %82 %80 + OpCooperativeMatrixStoreKHR %83 %m0 %uint_1 %81 NonPrivatePointer + %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %88 = OpArrayLength %uint %6 0 + %89 = OpBitcast %uint %int_0 + %90 = OpIMul %uint %uint_16 %uint_7 + %91 = OpIAdd %uint %89 %90 + %92 = OpIAdd %uint %91 %uint_1 + %93 = OpULessThanEqual %bool %92 %88 + %94 = OpSelect %uint %93 %89 %uint_0 + %95 = OpSelect %uint %93 %uint_16 %uint_1 + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %97 = OpAccessChain %_ptr_StorageBuffer_v2int %96 %94 + %m1 = OpCooperativeMatrixLoadKHR %65 %97 %uint_0 %95 None + %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %101 = OpArrayLength %uint %38 0 + %102 = OpBitcast %uint %int_0 + %103 = OpBitcast %uint %int_16 + %104 = OpIMul %uint %103 %uint_7 + %105 = OpIAdd %uint %102 %104 + %106 = OpIAdd %uint %105 %uint_2 + %107 = OpULessThanEqual %bool %106 %101 + %108 = OpSelect %uint %107 %102 %uint_0 + %109 = OpSelect %uint %107 %103 %uint_2 + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %111 = OpAccessChain %_ptr_StorageBuffer_uint_0 %110 %108 + OpCooperativeMatrixStoreKHR %111 %m1 %uint_1 %109 NonPrivatePointer + %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %115 = OpArrayLength %uint %12 0 + %116 = OpBitcast %uint %int_0 + %117 = OpIMul %uint %uint_16 %uint_7 + %118 = OpIAdd %uint %116 %117 + %119 = OpIAdd %uint %118 %uint_1 + %120 = OpULessThanEqual %bool %119 %115 + %121 = OpSelect %uint %120 %116 %uint_0 + %122 = OpSelect %uint %120 %uint_16 %uint_1 + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 + %m2 = OpCooperativeMatrixLoadKHR %65 %124 %uint_0 %122 None + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %128 = OpArrayLength %uint %38 0 + %129 = OpBitcast %uint %int_0 + %130 = OpBitcast %uint %int_16 + %131 = OpIMul %uint %130 %uint_7 + %132 = OpIAdd %uint %129 %131 + %133 = OpIAdd %uint %132 %uint_2 + %134 = OpULessThanEqual %bool %133 %128 + %135 = OpSelect %uint %134 %129 %uint_0 + %136 = OpSelect %uint %134 %130 %uint_2 + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 + OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer + %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %142 = OpArrayLength %uint %18 0 + %143 = OpBitcast %uint %int_0 + %144 = OpIMul %uint %uint_16 %uint_7 + %145 = OpIAdd %uint %143 %144 + %146 = OpIAdd %uint %145 %uint_1 + %147 = OpULessThanEqual %bool %146 %142 + %148 = OpSelect %uint %147 %143 %uint_0 + %149 = OpSelect %uint %147 %uint_16 %uint_1 + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %151 = OpAccessChain %_ptr_StorageBuffer_v4uint %150 %148 + %m3 = OpCooperativeMatrixLoadKHR %65 %151 %uint_0 %149 None + %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %155 = OpArrayLength %uint %38 0 + %156 = OpBitcast %uint %int_0 + %157 = OpBitcast %uint %int_16 + %158 = OpIMul %uint %157 %uint_7 + %159 = OpIAdd %uint %156 %158 + %160 = OpIAdd %uint %159 %uint_2 + %161 = OpULessThanEqual %bool %160 %155 + %162 = OpSelect %uint %161 %156 %uint_0 + %163 = OpSelect %uint %161 %157 %uint_2 + %164 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %165 = OpAccessChain %_ptr_StorageBuffer_uint_0 %164 %162 + OpCooperativeMatrixStoreKHR %165 %m3 %uint_1 %163 NonPrivatePointer + %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %169 = OpArrayLength %uint %23 0 + %170 = OpBitcast %uint %int_0 + %171 = OpIMul %uint %uint_16 %uint_7 + %172 = OpIAdd %uint %170 %171 + %173 = OpIAdd %uint %172 %uint_4 + %175 = OpULessThanEqual %bool %173 %169 + %176 = OpSelect %uint %175 %170 %uint_0 + %177 = OpSelect %uint %175 %uint_16 %uint_4 + %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %179 = OpAccessChain %_ptr_StorageBuffer_half %178 %176 + %m4 = OpCooperativeMatrixLoadKHR %65 %179 %uint_0 %177 None + %182 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %183 = OpArrayLength %uint %38 0 + %184 = OpBitcast %uint %int_0 + %185 = OpBitcast %uint %int_16 + %186 = OpIMul %uint %185 %uint_7 + %187 = OpIAdd %uint %184 %186 + %188 = OpIAdd %uint %187 %uint_2 + %189 = OpULessThanEqual %bool %188 %183 + %190 = OpSelect %uint %189 %184 %uint_0 + %191 = OpSelect %uint %189 %185 %uint_2 + %192 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %193 = OpAccessChain %_ptr_StorageBuffer_uint_0 %192 %190 + OpCooperativeMatrixStoreKHR %193 %m4 %uint_1 %191 NonPrivatePointer + %195 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %197 = OpArrayLength %uint %28 0 + %198 = OpBitcast %uint %int_0 + %199 = OpIMul %uint %uint_16 %uint_7 + %200 = OpIAdd %uint %198 %199 + %201 = OpIAdd %uint %200 %uint_2 + %202 = OpULessThanEqual %bool %201 %197 + %203 = OpSelect %uint %202 %198 %uint_0 + %204 = OpSelect %uint %202 %uint_16 %uint_2 + %205 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %206 = OpAccessChain %_ptr_StorageBuffer_v2half %205 %203 + %m5 = OpCooperativeMatrixLoadKHR %65 %206 %uint_0 %204 None + %209 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %210 = OpArrayLength %uint %38 0 + %211 = OpBitcast %uint %int_0 + %212 = OpBitcast %uint %int_16 + %213 = OpIMul %uint %212 %uint_7 + %214 = OpIAdd %uint %211 %213 + %215 = OpIAdd %uint %214 %uint_2 + %216 = OpULessThanEqual %bool %215 %210 + %217 = OpSelect %uint %216 %211 %uint_0 + %218 = OpSelect %uint %216 %212 %uint_2 + %219 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %220 = OpAccessChain %_ptr_StorageBuffer_uint_0 %219 %217 + OpCooperativeMatrixStoreKHR %220 %m5 %uint_1 %218 NonPrivatePointer + %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %224 = OpArrayLength %uint %33 0 + %225 = OpBitcast %uint %int_0 + %226 = OpIMul %uint %uint_16 %uint_7 + %227 = OpIAdd %uint %225 %226 + %228 = OpIAdd %uint %227 %uint_1 + %229 = OpULessThanEqual %bool %228 %224 + %230 = OpSelect %uint %229 %225 %uint_0 + %231 = OpSelect %uint %229 %uint_16 %uint_1 + %232 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %233 = OpAccessChain %_ptr_StorageBuffer_v3half %232 %230 + %m6 = OpCooperativeMatrixLoadKHR %65 %233 %uint_0 %231 None + %236 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %237 = OpArrayLength %uint %38 0 + %238 = OpBitcast %uint %int_0 + %239 = OpBitcast %uint %int_16 + %240 = OpIMul %uint %239 %uint_7 + %241 = OpIAdd %uint %238 %240 + %242 = OpIAdd %uint %241 %uint_2 + %243 = OpULessThanEqual %bool %242 %237 + %244 = OpSelect %uint %243 %238 %uint_0 + %245 = OpSelect %uint %243 %239 %uint_2 + %246 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %247 = OpAccessChain %_ptr_StorageBuffer_uint_0 %246 %244 + OpCooperativeMatrixStoreKHR %247 %m6 %uint_1 %245 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_col_major.wgsl.expected.dxc.hlsl index 09da929..9328980 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_col_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 2u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 4u)), (select(v_4, v_3, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_i8_8x8 m1 = Matrix_right_i8_8x8::Load(in1, 0u, 64u, MatrixLayout::ColMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 4u) + 8u) <= ((v_5 / 4u) * 4u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 2u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 4u)), (select(v_8, v_7, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_i8_8x8 m2 = Matrix_right_i8_8x8::Load(in2, 0u, 64u, MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_i8_8x8 m3 = Matrix_right_i8_8x8::Load(in3, 0u, 64u, MatrixLayout::ColMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 4u) + 8u) <= ((v_13 / 4u) * 4u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 2u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 4u)), (select(v_16, v_15, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_i8_8x8 m4 = Matrix_right_i8_8x8::Load(in4, 0u, 64u, MatrixLayout::ColMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 4u) + 8u) <= ((v_17 / 4u) * 4u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 2u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 4u)), (select(v_20, v_19, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_i8_8x8 m5 = Matrix_right_i8_8x8::Load(in5, 0u, 64u, MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_i8_8x8 m6 = Matrix_right_i8_8x8::Load(in6, 0u, 64u, MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_col_major.wgsl.expected.spvasm index c548a66..52ec0b5 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 202 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -140,12 +140,11 @@ %53 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -166,126 +165,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_1 %uint_16 None %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %61 = OpArrayLength %uint %39 0 - %62 = OpIMul %uint %61 %uint_4 - %64 = OpBitcast %uint %int_0 - %66 = OpBitcast %uint %int_16 - %68 = OpIMul %uint %66 %uint_7 - %70 = OpIAdd %uint %64 %68 - %71 = OpIMul %uint %70 %uint_4 - %72 = OpIAdd %uint %71 %uint_8 - %73 = OpULessThanEqual %bool %72 %62 - %75 = OpSelect %uint %73 %64 %uint_0 - %76 = OpSelect %uint %73 %66 %uint_2 - %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %79 = OpAccessChain %_ptr_StorageBuffer_uint_0 %78 %75 - OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %76 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %82 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %84 %uint_1 %uint_16 None - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %88 = OpArrayLength %uint %39 0 - %89 = OpIMul %uint %88 %uint_4 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_2 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint_0 %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v3float %102 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %104 %uint_1 %uint_16 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %108 = OpArrayLength %uint %39 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m2 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v4uint %122 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %124 %uint_1 %uint_16 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %128 = OpArrayLength %uint %39 0 - %129 = OpIMul %uint %128 %uint_4 - %130 = OpBitcast %uint %int_0 - %131 = OpBitcast %uint %int_16 - %132 = OpIMul %uint %131 %uint_7 - %133 = OpIAdd %uint %130 %132 - %134 = OpIMul %uint %133 %uint_4 - %135 = OpIAdd %uint %134 %uint_8 - %136 = OpULessThanEqual %bool %135 %129 - %137 = OpSelect %uint %136 %130 %uint_0 - %138 = OpSelect %uint %136 %131 %uint_2 - %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %140 = OpAccessChain %_ptr_StorageBuffer_uint_0 %139 %137 - OpCooperativeMatrixStoreKHR %140 %m3 %uint_1 %138 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %144 = OpAccessChain %_ptr_StorageBuffer_half %142 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %144 %uint_1 %uint_16 None - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %148 = OpArrayLength %uint %39 0 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpBitcast %uint %int_0 - %151 = OpBitcast %uint %int_16 - %152 = OpIMul %uint %151 %uint_7 - %153 = OpIAdd %uint %150 %152 - %154 = OpIMul %uint %153 %uint_4 - %155 = OpIAdd %uint %154 %uint_8 - %156 = OpULessThanEqual %bool %155 %149 - %157 = OpSelect %uint %156 %150 %uint_0 - %158 = OpSelect %uint %156 %151 %uint_2 - %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %160 = OpAccessChain %_ptr_StorageBuffer_uint_0 %159 %157 - OpCooperativeMatrixStoreKHR %160 %m4 %uint_1 %158 NonPrivatePointer - %162 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v2half %162 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %164 %uint_1 %uint_16 None - %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %168 = OpArrayLength %uint %39 0 - %169 = OpIMul %uint %168 %uint_4 - %170 = OpBitcast %uint %int_0 - %171 = OpBitcast %uint %int_16 - %172 = OpIMul %uint %171 %uint_7 - %173 = OpIAdd %uint %170 %172 - %174 = OpIMul %uint %173 %uint_4 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %169 - %177 = OpSelect %uint %176 %170 %uint_0 - %178 = OpSelect %uint %176 %171 %uint_2 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_uint_0 %179 %177 - OpCooperativeMatrixStoreKHR %180 %m5 %uint_1 %178 NonPrivatePointer - %182 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %184 = OpAccessChain %_ptr_StorageBuffer_v3half %182 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %184 %uint_1 %uint_16 None - %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %188 = OpArrayLength %uint %39 0 - %189 = OpIMul %uint %188 %uint_4 - %190 = OpBitcast %uint %int_0 - %191 = OpBitcast %uint %int_16 - %192 = OpIMul %uint %191 %uint_7 - %193 = OpIAdd %uint %190 %192 - %194 = OpIMul %uint %193 %uint_4 - %195 = OpIAdd %uint %194 %uint_8 - %196 = OpULessThanEqual %bool %195 %189 - %197 = OpSelect %uint %196 %190 %uint_0 - %198 = OpSelect %uint %196 %191 %uint_2 - %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %200 = OpAccessChain %_ptr_StorageBuffer_uint_0 %199 %197 - OpCooperativeMatrixStoreKHR %200 %m6 %uint_1 %198 NonPrivatePointer + %62 = OpBitcast %uint %int_0 + %64 = OpBitcast %uint %int_16 + %66 = OpIMul %uint %64 %uint_7 + %68 = OpIAdd %uint %62 %66 + %69 = OpIAdd %uint %68 %uint_2 + %71 = OpULessThanEqual %bool %69 %61 + %73 = OpSelect %uint %71 %62 %uint_0 + %74 = OpSelect %uint %71 %64 %uint_2 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_uint_0 %75 %73 + OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_1 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_1 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_2 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_2 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_1 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_2 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_2 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_1 %uint_16 None + %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_2 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_2 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_1 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_2 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_2 + %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_1 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_2 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_2 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_row_major.wgsl.expected.dxc.hlsl index b08219f..1ca626a 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_row_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 2u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 4u)), (select(v_4, v_3, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_i8_8x8 m1 = Matrix_right_i8_8x8::Load(in1, 0u, 64u, MatrixLayout::RowMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 4u) + 8u) <= ((v_5 / 4u) * 4u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 2u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 4u)), (select(v_8, v_7, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_i8_8x8 m2 = Matrix_right_i8_8x8::Load(in2, 0u, 64u, MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_i8_8x8 m3 = Matrix_right_i8_8x8::Load(in3, 0u, 64u, MatrixLayout::RowMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 4u) + 8u) <= ((v_13 / 4u) * 4u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 2u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 4u)), (select(v_16, v_15, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_i8_8x8 m4 = Matrix_right_i8_8x8::Load(in4, 0u, 64u, MatrixLayout::RowMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 4u) + 8u) <= ((v_17 / 4u) * 4u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 2u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 4u)), (select(v_20, v_19, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_i8_8x8 m5 = Matrix_right_i8_8x8::Load(in5, 0u, 64u, MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_i8_8x8 m6 = Matrix_right_i8_8x8::Load(in6, 0u, 64u, MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_row_major.wgsl.expected.spvasm index f73dfe6..f47b11b 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_i8_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 202 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -140,12 +140,11 @@ %53 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -166,126 +165,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_0 %uint_16 None %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %61 = OpArrayLength %uint %39 0 - %62 = OpIMul %uint %61 %uint_4 - %64 = OpBitcast %uint %int_0 - %66 = OpBitcast %uint %int_16 - %68 = OpIMul %uint %66 %uint_7 - %70 = OpIAdd %uint %64 %68 - %71 = OpIMul %uint %70 %uint_4 - %72 = OpIAdd %uint %71 %uint_8 - %73 = OpULessThanEqual %bool %72 %62 - %75 = OpSelect %uint %73 %64 %uint_0 - %76 = OpSelect %uint %73 %66 %uint_2 - %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %79 = OpAccessChain %_ptr_StorageBuffer_uint_0 %78 %75 - OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %76 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %82 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %84 %uint_0 %uint_16 None - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %88 = OpArrayLength %uint %39 0 - %89 = OpIMul %uint %88 %uint_4 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_2 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint_0 %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v3float %102 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %104 %uint_0 %uint_16 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %108 = OpArrayLength %uint %39 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m2 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v4uint %122 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %124 %uint_0 %uint_16 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %128 = OpArrayLength %uint %39 0 - %129 = OpIMul %uint %128 %uint_4 - %130 = OpBitcast %uint %int_0 - %131 = OpBitcast %uint %int_16 - %132 = OpIMul %uint %131 %uint_7 - %133 = OpIAdd %uint %130 %132 - %134 = OpIMul %uint %133 %uint_4 - %135 = OpIAdd %uint %134 %uint_8 - %136 = OpULessThanEqual %bool %135 %129 - %137 = OpSelect %uint %136 %130 %uint_0 - %138 = OpSelect %uint %136 %131 %uint_2 - %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %140 = OpAccessChain %_ptr_StorageBuffer_uint_0 %139 %137 - OpCooperativeMatrixStoreKHR %140 %m3 %uint_1 %138 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %144 = OpAccessChain %_ptr_StorageBuffer_half %142 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %144 %uint_0 %uint_16 None - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %148 = OpArrayLength %uint %39 0 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpBitcast %uint %int_0 - %151 = OpBitcast %uint %int_16 - %152 = OpIMul %uint %151 %uint_7 - %153 = OpIAdd %uint %150 %152 - %154 = OpIMul %uint %153 %uint_4 - %155 = OpIAdd %uint %154 %uint_8 - %156 = OpULessThanEqual %bool %155 %149 - %157 = OpSelect %uint %156 %150 %uint_0 - %158 = OpSelect %uint %156 %151 %uint_2 - %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %160 = OpAccessChain %_ptr_StorageBuffer_uint_0 %159 %157 - OpCooperativeMatrixStoreKHR %160 %m4 %uint_1 %158 NonPrivatePointer - %162 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v2half %162 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %164 %uint_0 %uint_16 None - %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %168 = OpArrayLength %uint %39 0 - %169 = OpIMul %uint %168 %uint_4 - %170 = OpBitcast %uint %int_0 - %171 = OpBitcast %uint %int_16 - %172 = OpIMul %uint %171 %uint_7 - %173 = OpIAdd %uint %170 %172 - %174 = OpIMul %uint %173 %uint_4 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %169 - %177 = OpSelect %uint %176 %170 %uint_0 - %178 = OpSelect %uint %176 %171 %uint_2 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_uint_0 %179 %177 - OpCooperativeMatrixStoreKHR %180 %m5 %uint_1 %178 NonPrivatePointer - %182 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %184 = OpAccessChain %_ptr_StorageBuffer_v3half %182 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %184 %uint_0 %uint_16 None - %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %188 = OpArrayLength %uint %39 0 - %189 = OpIMul %uint %188 %uint_4 - %190 = OpBitcast %uint %int_0 - %191 = OpBitcast %uint %int_16 - %192 = OpIMul %uint %191 %uint_7 - %193 = OpIAdd %uint %190 %192 - %194 = OpIMul %uint %193 %uint_4 - %195 = OpIAdd %uint %194 %uint_8 - %196 = OpULessThanEqual %bool %195 %189 - %197 = OpSelect %uint %196 %190 %uint_0 - %198 = OpSelect %uint %196 %191 %uint_2 - %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %200 = OpAccessChain %_ptr_StorageBuffer_uint_0 %199 %197 - OpCooperativeMatrixStoreKHR %200 %m6 %uint_1 %198 NonPrivatePointer + %62 = OpBitcast %uint %int_0 + %64 = OpBitcast %uint %int_16 + %66 = OpIMul %uint %64 %uint_7 + %68 = OpIAdd %uint %62 %66 + %69 = OpIAdd %uint %68 %uint_2 + %71 = OpULessThanEqual %bool %69 %61 + %73 = OpSelect %uint %71 %62 %uint_0 + %74 = OpSelect %uint %71 %64 %uint_2 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_uint_0 %75 %73 + OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_0 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_0 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_2 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_2 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_0 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_2 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_2 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_0 %uint_16 None + %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_2 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_2 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_0 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_2 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_2 + %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_0 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_2 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_2 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl index 7a7e8b7..06a4ab4 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -25,7 +25,7 @@ uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 8u) * 2u)); + bool v_10 = (((v_9 + (16u * 7u)) + 4u) <= (v_8 / 8u)); Matrix_right_u32_8x8 m1 = Matrix_right_u32_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_11 = 0u; v.GetDimensions(v_11); @@ -36,7 +36,7 @@ uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 16u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 16u)); Matrix_right_u32_8x8 m2 = Matrix_right_u32_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_18 = 0u; v.GetDimensions(v_18); @@ -47,7 +47,7 @@ uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 4u) + 8u) <= ((v_22 / 16u) * 4u)); + bool v_24 = (((v_23 + (16u * 7u)) + 2u) <= (v_22 / 16u)); Matrix_right_u32_8x8 m3 = Matrix_right_u32_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); @@ -69,7 +69,7 @@ uint v_36 = 0u; in6.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 2u) + 8u) <= ((v_36 / 8u) * 2u)); + bool v_38 = (((v_37 + (16u * 7u)) + 4u) <= (v_36 / 8u)); Matrix_right_u32_8x8 m6 = Matrix_right_u32_8x8::Load(in6, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_col_major.wgsl.expected.spvasm index ce61981..fd6f6b2 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 225 +; Bound: 217 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,10 +128,10 @@ %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -168,136 +168,128 @@ OpCooperativeMatrixStoreKHR %77 %m0 %uint_1 %75 NonPrivatePointer %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %82 = OpArrayLength %uint %6 0 - %83 = OpIMul %uint %82 %uint_2 - %85 = OpBitcast %uint %int_0 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %85 %86 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %83 - %91 = OpSelect %uint %90 %85 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_4 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %91 - %m1 = OpCooperativeMatrixLoadKHR %61 %95 %uint_1 %92 None - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %99 = OpArrayLength %uint %34 0 - %100 = OpBitcast %uint %int_0 - %101 = OpBitcast %uint %int_16 - %102 = OpIMul %uint %101 %uint_7 - %103 = OpIAdd %uint %100 %102 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %101 %uint_8 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 - OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %113 = OpArrayLength %uint %12 0 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIMul %uint %117 %uint_4 - %119 = OpIAdd %uint %118 %uint_8 - %120 = OpULessThanEqual %bool %119 %114 - %121 = OpSelect %uint %120 %115 %uint_0 - %122 = OpSelect %uint %120 %uint_16 %uint_2 - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 - %m2 = OpCooperativeMatrixLoadKHR %61 %124 %uint_1 %122 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %128 = OpArrayLength %uint %34 0 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %130 %uint_8 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 - OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %142 = OpArrayLength %uint %18 0 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpBitcast %uint %int_0 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %144 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %143 - %150 = OpSelect %uint %149 %144 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v4uint %152 %150 - %m3 = OpCooperativeMatrixLoadKHR %61 %153 %uint_1 %151 None - %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %157 = OpArrayLength %uint %34 0 - %158 = OpBitcast %uint %int_0 - %159 = OpBitcast %uint %int_16 - %160 = OpIMul %uint %159 %uint_7 - %161 = OpIAdd %uint %158 %160 - %162 = OpIAdd %uint %161 %uint_8 - %163 = OpULessThanEqual %bool %162 %157 - %164 = OpSelect %uint %163 %158 %uint_0 - %165 = OpSelect %uint %163 %159 %uint_8 - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 - OpCooperativeMatrixStoreKHR %167 %m3 %uint_1 %165 NonPrivatePointer - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %171 = OpArrayLength %uint %23 0 - %172 = OpBitcast %uint %int_0 - %173 = OpIMul %uint %uint_16 %uint_7 - %174 = OpIAdd %uint %172 %173 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %171 - %177 = OpSelect %uint %176 %172 %uint_0 - %178 = OpSelect %uint %176 %uint_16 %uint_8 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_v2half %179 %177 - %m5 = OpCooperativeMatrixLoadKHR %61 %180 %uint_1 %178 None - %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %184 = OpArrayLength %uint %34 0 - %185 = OpBitcast %uint %int_0 - %186 = OpBitcast %uint %int_16 - %187 = OpIMul %uint %186 %uint_7 - %188 = OpIAdd %uint %185 %187 - %189 = OpIAdd %uint %188 %uint_8 - %190 = OpULessThanEqual %bool %189 %184 - %191 = OpSelect %uint %190 %185 %uint_0 - %192 = OpSelect %uint %190 %186 %uint_8 - %193 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %194 = OpAccessChain %_ptr_StorageBuffer_uint_0 %193 %191 - OpCooperativeMatrixStoreKHR %194 %m5 %uint_1 %192 NonPrivatePointer - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %198 = OpArrayLength %uint %29 0 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpBitcast %uint %int_0 - %201 = OpIMul %uint %uint_16 %uint_7 - %202 = OpIAdd %uint %200 %201 - %203 = OpIMul %uint %202 %uint_2 - %204 = OpIAdd %uint %203 %uint_8 - %205 = OpULessThanEqual %bool %204 %199 - %206 = OpSelect %uint %205 %200 %uint_0 - %207 = OpSelect %uint %205 %uint_16 %uint_4 - %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %209 = OpAccessChain %_ptr_StorageBuffer_v3half %208 %206 - %m6 = OpCooperativeMatrixLoadKHR %61 %209 %uint_1 %207 None - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %213 = OpArrayLength %uint %34 0 - %214 = OpBitcast %uint %int_0 - %215 = OpBitcast %uint %int_16 - %216 = OpIMul %uint %215 %uint_7 - %217 = OpIAdd %uint %214 %216 - %218 = OpIAdd %uint %217 %uint_8 - %219 = OpULessThanEqual %bool %218 %213 - %220 = OpSelect %uint %219 %214 %uint_0 - %221 = OpSelect %uint %219 %215 %uint_8 - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %223 = OpAccessChain %_ptr_StorageBuffer_uint_0 %222 %220 - OpCooperativeMatrixStoreKHR %223 %m6 %uint_1 %221 NonPrivatePointer + %83 = OpBitcast %uint %int_0 + %84 = OpIMul %uint %uint_16 %uint_7 + %85 = OpIAdd %uint %83 %84 + %86 = OpIAdd %uint %85 %uint_4 + %88 = OpULessThanEqual %bool %86 %82 + %89 = OpSelect %uint %88 %83 %uint_0 + %90 = OpSelect %uint %88 %uint_16 %uint_4 + %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %92 = OpAccessChain %_ptr_StorageBuffer_v2int %91 %89 + %m1 = OpCooperativeMatrixLoadKHR %61 %92 %uint_1 %90 None + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %96 = OpArrayLength %uint %34 0 + %97 = OpBitcast %uint %int_0 + %98 = OpBitcast %uint %int_16 + %99 = OpIMul %uint %98 %uint_7 + %100 = OpIAdd %uint %97 %99 + %101 = OpIAdd %uint %100 %uint_8 + %102 = OpULessThanEqual %bool %101 %96 + %103 = OpSelect %uint %102 %97 %uint_0 + %104 = OpSelect %uint %102 %98 %uint_8 + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %106 = OpAccessChain %_ptr_StorageBuffer_uint_0 %105 %103 + OpCooperativeMatrixStoreKHR %106 %m1 %uint_1 %104 NonPrivatePointer + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %110 = OpArrayLength %uint %12 0 + %111 = OpBitcast %uint %int_0 + %112 = OpIMul %uint %uint_16 %uint_7 + %113 = OpIAdd %uint %111 %112 + %114 = OpIAdd %uint %113 %uint_2 + %116 = OpULessThanEqual %bool %114 %110 + %117 = OpSelect %uint %116 %111 %uint_0 + %118 = OpSelect %uint %116 %uint_16 %uint_2 + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %120 = OpAccessChain %_ptr_StorageBuffer_v3float %119 %117 + %m2 = OpCooperativeMatrixLoadKHR %61 %120 %uint_1 %118 None + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %124 = OpArrayLength %uint %34 0 + %125 = OpBitcast %uint %int_0 + %126 = OpBitcast %uint %int_16 + %127 = OpIMul %uint %126 %uint_7 + %128 = OpIAdd %uint %125 %127 + %129 = OpIAdd %uint %128 %uint_8 + %130 = OpULessThanEqual %bool %129 %124 + %131 = OpSelect %uint %130 %125 %uint_0 + %132 = OpSelect %uint %130 %126 %uint_8 + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_uint_0 %133 %131 + OpCooperativeMatrixStoreKHR %134 %m2 %uint_1 %132 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %138 = OpArrayLength %uint %18 0 + %139 = OpBitcast %uint %int_0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %139 %140 + %142 = OpIAdd %uint %141 %uint_2 + %143 = OpULessThanEqual %bool %142 %138 + %144 = OpSelect %uint %143 %139 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_2 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %61 %147 %uint_1 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %151 = OpArrayLength %uint %34 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_8 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_8 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpBitcast %uint %int_0 + %167 = OpIMul %uint %uint_16 %uint_7 + %168 = OpIAdd %uint %166 %167 + %169 = OpIAdd %uint %168 %uint_8 + %170 = OpULessThanEqual %bool %169 %165 + %171 = OpSelect %uint %170 %166 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_8 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_v2half %173 %171 + %m5 = OpCooperativeMatrixLoadKHR %61 %174 %uint_1 %172 None + %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %178 = OpArrayLength %uint %34 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_8 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_8 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m5 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %192 = OpArrayLength %uint %29 0 + %193 = OpBitcast %uint %int_0 + %194 = OpIMul %uint %uint_16 %uint_7 + %195 = OpIAdd %uint %193 %194 + %196 = OpIAdd %uint %195 %uint_4 + %197 = OpULessThanEqual %bool %196 %192 + %198 = OpSelect %uint %197 %193 %uint_0 + %199 = OpSelect %uint %197 %uint_16 %uint_4 + %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %201 = OpAccessChain %_ptr_StorageBuffer_v3half %200 %198 + %m6 = OpCooperativeMatrixLoadKHR %61 %201 %uint_1 %199 None + %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %205 = OpArrayLength %uint %34 0 + %206 = OpBitcast %uint %int_0 + %207 = OpBitcast %uint %int_16 + %208 = OpIMul %uint %207 %uint_7 + %209 = OpIAdd %uint %206 %208 + %210 = OpIAdd %uint %209 %uint_8 + %211 = OpULessThanEqual %bool %210 %205 + %212 = OpSelect %uint %211 %206 %uint_0 + %213 = OpSelect %uint %211 %207 %uint_8 + %214 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %215 = OpAccessChain %_ptr_StorageBuffer_uint_0 %214 %212 + OpCooperativeMatrixStoreKHR %215 %m6 %uint_1 %213 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl index de2987b..800c666 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -25,7 +25,7 @@ uint v_8 = 0u; in1.GetDimensions(v_8); uint v_9 = asuint(int(0)); - bool v_10 = ((((v_9 + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 8u) * 2u)); + bool v_10 = (((v_9 + (16u * 7u)) + 4u) <= (v_8 / 8u)); Matrix_right_u32_8x8 m1 = Matrix_right_u32_8x8::Load(in1, (0u + (select(v_10, v_9, 0u) * 4u)), (select(v_10, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_11 = 0u; v.GetDimensions(v_11); @@ -36,7 +36,7 @@ uint v_15 = 0u; in2.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 16u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 16u)); Matrix_right_u32_8x8 m2 = Matrix_right_u32_8x8::Load(in2, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_18 = 0u; v.GetDimensions(v_18); @@ -47,7 +47,7 @@ uint v_22 = 0u; in3.GetDimensions(v_22); uint v_23 = asuint(int(0)); - bool v_24 = ((((v_23 + (16u * 7u)) * 4u) + 8u) <= ((v_22 / 16u) * 4u)); + bool v_24 = (((v_23 + (16u * 7u)) + 2u) <= (v_22 / 16u)); Matrix_right_u32_8x8 m3 = Matrix_right_u32_8x8::Load(in3, (0u + (select(v_24, v_23, 0u) * 4u)), (select(v_24, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); @@ -69,7 +69,7 @@ uint v_36 = 0u; in6.GetDimensions(v_36); uint v_37 = asuint(int(0)); - bool v_38 = ((((v_37 + (16u * 7u)) * 2u) + 8u) <= ((v_36 / 8u) * 2u)); + bool v_38 = (((v_37 + (16u * 7u)) + 4u) <= (v_36 / 8u)); Matrix_right_u32_8x8 m6 = Matrix_right_u32_8x8::Load(in6, (0u + (select(v_38, v_37, 0u) * 4u)), (select(v_38, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39);
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_row_major.wgsl.expected.spvasm index 677cd40..6e15b12 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_u32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 225 +; Bound: 217 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -128,10 +128,10 @@ %int_16 = OpConstant %int 16 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -168,136 +168,128 @@ OpCooperativeMatrixStoreKHR %77 %m0 %uint_1 %75 NonPrivatePointer %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %82 = OpArrayLength %uint %6 0 - %83 = OpIMul %uint %82 %uint_2 - %85 = OpBitcast %uint %int_0 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %85 %86 - %88 = OpIMul %uint %87 %uint_2 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %83 - %91 = OpSelect %uint %90 %85 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_4 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %91 - %m1 = OpCooperativeMatrixLoadKHR %61 %95 %uint_0 %92 None - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %99 = OpArrayLength %uint %34 0 - %100 = OpBitcast %uint %int_0 - %101 = OpBitcast %uint %int_16 - %102 = OpIMul %uint %101 %uint_7 - %103 = OpIAdd %uint %100 %102 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %101 %uint_8 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 - OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %113 = OpArrayLength %uint %12 0 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIMul %uint %117 %uint_4 - %119 = OpIAdd %uint %118 %uint_8 - %120 = OpULessThanEqual %bool %119 %114 - %121 = OpSelect %uint %120 %115 %uint_0 - %122 = OpSelect %uint %120 %uint_16 %uint_2 - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v3float %123 %121 - %m2 = OpCooperativeMatrixLoadKHR %61 %124 %uint_0 %122 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %128 = OpArrayLength %uint %34 0 - %129 = OpBitcast %uint %int_0 - %130 = OpBitcast %uint %int_16 - %131 = OpIMul %uint %130 %uint_7 - %132 = OpIAdd %uint %129 %131 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %130 %uint_8 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_uint_0 %137 %135 - OpCooperativeMatrixStoreKHR %138 %m2 %uint_1 %136 NonPrivatePointer - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %142 = OpArrayLength %uint %18 0 - %143 = OpIMul %uint %142 %uint_4 - %144 = OpBitcast %uint %int_0 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %144 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %143 - %150 = OpSelect %uint %149 %144 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v4uint %152 %150 - %m3 = OpCooperativeMatrixLoadKHR %61 %153 %uint_0 %151 None - %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %157 = OpArrayLength %uint %34 0 - %158 = OpBitcast %uint %int_0 - %159 = OpBitcast %uint %int_16 - %160 = OpIMul %uint %159 %uint_7 - %161 = OpIAdd %uint %158 %160 - %162 = OpIAdd %uint %161 %uint_8 - %163 = OpULessThanEqual %bool %162 %157 - %164 = OpSelect %uint %163 %158 %uint_0 - %165 = OpSelect %uint %163 %159 %uint_8 - %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 - OpCooperativeMatrixStoreKHR %167 %m3 %uint_1 %165 NonPrivatePointer - %169 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %171 = OpArrayLength %uint %23 0 - %172 = OpBitcast %uint %int_0 - %173 = OpIMul %uint %uint_16 %uint_7 - %174 = OpIAdd %uint %172 %173 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %171 - %177 = OpSelect %uint %176 %172 %uint_0 - %178 = OpSelect %uint %176 %uint_16 %uint_8 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_v2half %179 %177 - %m5 = OpCooperativeMatrixLoadKHR %61 %180 %uint_0 %178 None - %183 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %184 = OpArrayLength %uint %34 0 - %185 = OpBitcast %uint %int_0 - %186 = OpBitcast %uint %int_16 - %187 = OpIMul %uint %186 %uint_7 - %188 = OpIAdd %uint %185 %187 - %189 = OpIAdd %uint %188 %uint_8 - %190 = OpULessThanEqual %bool %189 %184 - %191 = OpSelect %uint %190 %185 %uint_0 - %192 = OpSelect %uint %190 %186 %uint_8 - %193 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %194 = OpAccessChain %_ptr_StorageBuffer_uint_0 %193 %191 - OpCooperativeMatrixStoreKHR %194 %m5 %uint_1 %192 NonPrivatePointer - %196 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %198 = OpArrayLength %uint %29 0 - %199 = OpIMul %uint %198 %uint_2 - %200 = OpBitcast %uint %int_0 - %201 = OpIMul %uint %uint_16 %uint_7 - %202 = OpIAdd %uint %200 %201 - %203 = OpIMul %uint %202 %uint_2 - %204 = OpIAdd %uint %203 %uint_8 - %205 = OpULessThanEqual %bool %204 %199 - %206 = OpSelect %uint %205 %200 %uint_0 - %207 = OpSelect %uint %205 %uint_16 %uint_4 - %208 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %209 = OpAccessChain %_ptr_StorageBuffer_v3half %208 %206 - %m6 = OpCooperativeMatrixLoadKHR %61 %209 %uint_0 %207 None - %212 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %213 = OpArrayLength %uint %34 0 - %214 = OpBitcast %uint %int_0 - %215 = OpBitcast %uint %int_16 - %216 = OpIMul %uint %215 %uint_7 - %217 = OpIAdd %uint %214 %216 - %218 = OpIAdd %uint %217 %uint_8 - %219 = OpULessThanEqual %bool %218 %213 - %220 = OpSelect %uint %219 %214 %uint_0 - %221 = OpSelect %uint %219 %215 %uint_8 - %222 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 - %223 = OpAccessChain %_ptr_StorageBuffer_uint_0 %222 %220 - OpCooperativeMatrixStoreKHR %223 %m6 %uint_1 %221 NonPrivatePointer + %83 = OpBitcast %uint %int_0 + %84 = OpIMul %uint %uint_16 %uint_7 + %85 = OpIAdd %uint %83 %84 + %86 = OpIAdd %uint %85 %uint_4 + %88 = OpULessThanEqual %bool %86 %82 + %89 = OpSelect %uint %88 %83 %uint_0 + %90 = OpSelect %uint %88 %uint_16 %uint_4 + %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %92 = OpAccessChain %_ptr_StorageBuffer_v2int %91 %89 + %m1 = OpCooperativeMatrixLoadKHR %61 %92 %uint_0 %90 None + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %96 = OpArrayLength %uint %34 0 + %97 = OpBitcast %uint %int_0 + %98 = OpBitcast %uint %int_16 + %99 = OpIMul %uint %98 %uint_7 + %100 = OpIAdd %uint %97 %99 + %101 = OpIAdd %uint %100 %uint_8 + %102 = OpULessThanEqual %bool %101 %96 + %103 = OpSelect %uint %102 %97 %uint_0 + %104 = OpSelect %uint %102 %98 %uint_8 + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %106 = OpAccessChain %_ptr_StorageBuffer_uint_0 %105 %103 + OpCooperativeMatrixStoreKHR %106 %m1 %uint_1 %104 NonPrivatePointer + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %110 = OpArrayLength %uint %12 0 + %111 = OpBitcast %uint %int_0 + %112 = OpIMul %uint %uint_16 %uint_7 + %113 = OpIAdd %uint %111 %112 + %114 = OpIAdd %uint %113 %uint_2 + %116 = OpULessThanEqual %bool %114 %110 + %117 = OpSelect %uint %116 %111 %uint_0 + %118 = OpSelect %uint %116 %uint_16 %uint_2 + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %120 = OpAccessChain %_ptr_StorageBuffer_v3float %119 %117 + %m2 = OpCooperativeMatrixLoadKHR %61 %120 %uint_0 %118 None + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %124 = OpArrayLength %uint %34 0 + %125 = OpBitcast %uint %int_0 + %126 = OpBitcast %uint %int_16 + %127 = OpIMul %uint %126 %uint_7 + %128 = OpIAdd %uint %125 %127 + %129 = OpIAdd %uint %128 %uint_8 + %130 = OpULessThanEqual %bool %129 %124 + %131 = OpSelect %uint %130 %125 %uint_0 + %132 = OpSelect %uint %130 %126 %uint_8 + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %134 = OpAccessChain %_ptr_StorageBuffer_uint_0 %133 %131 + OpCooperativeMatrixStoreKHR %134 %m2 %uint_1 %132 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %138 = OpArrayLength %uint %18 0 + %139 = OpBitcast %uint %int_0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %139 %140 + %142 = OpIAdd %uint %141 %uint_2 + %143 = OpULessThanEqual %bool %142 %138 + %144 = OpSelect %uint %143 %139 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_2 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %61 %147 %uint_0 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %151 = OpArrayLength %uint %34 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_8 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_8 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpBitcast %uint %int_0 + %167 = OpIMul %uint %uint_16 %uint_7 + %168 = OpIAdd %uint %166 %167 + %169 = OpIAdd %uint %168 %uint_8 + %170 = OpULessThanEqual %bool %169 %165 + %171 = OpSelect %uint %170 %166 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_8 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_v2half %173 %171 + %m5 = OpCooperativeMatrixLoadKHR %61 %174 %uint_0 %172 None + %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %178 = OpArrayLength %uint %34 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_8 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_8 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m5 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %192 = OpArrayLength %uint %29 0 + %193 = OpBitcast %uint %int_0 + %194 = OpIMul %uint %uint_16 %uint_7 + %195 = OpIAdd %uint %193 %194 + %196 = OpIAdd %uint %195 %uint_4 + %197 = OpULessThanEqual %bool %196 %192 + %198 = OpSelect %uint %197 %193 %uint_0 + %199 = OpSelect %uint %197 %uint_16 %uint_4 + %200 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %201 = OpAccessChain %_ptr_StorageBuffer_v3half %200 %198 + %m6 = OpCooperativeMatrixLoadKHR %61 %201 %uint_0 %199 None + %204 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %205 = OpArrayLength %uint %34 0 + %206 = OpBitcast %uint %int_0 + %207 = OpBitcast %uint %int_16 + %208 = OpIMul %uint %207 %uint_7 + %209 = OpIAdd %uint %206 %208 + %210 = OpIAdd %uint %209 %uint_8 + %211 = OpULessThanEqual %bool %210 %205 + %212 = OpSelect %uint %211 %206 %uint_0 + %213 = OpSelect %uint %211 %207 %uint_8 + %214 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %34 %uint_0 + %215 = OpAccessChain %_ptr_StorageBuffer_uint_0 %214 %212 + OpCooperativeMatrixStoreKHR %215 %m6 %uint_1 %213 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl index 2704529..b89c2c7 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -14,73 +14,73 @@ void main() { uint v_1 = 0u; in0.GetDimensions(v_1); - bool v_2 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_2 = (((0u + (16u * 7u)) + 2u) <= (v_1 / 4u)); Matrix_right_u8_8x8 m0 = Matrix_right_u8_8x8::Load(in0, (0u + (select(v_2, 0u, 0u) * 4u)), (select(v_2, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_3 = 0u; v.GetDimensions(v_3); uint v_4 = asuint(int(0)); uint v_5 = asuint(int(16)); - bool v_6 = ((((v_4 + (v_5 * 7u)) * 4u) + 8u) <= ((v_3 / 4u) * 4u)); + bool v_6 = (((v_4 + (v_5 * 7u)) + 2u) <= (v_3 / 4u)); m0.Store(v, (0u + (select(v_6, v_4, 0u) * 4u)), (select(v_6, v_5, 2u) * 4u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_7 / 8u) * 8u)); + bool v_8 = (((0u + (16u * 7u)) + 1u) <= (v_7 / 8u)); Matrix_right_u8_8x8 m1 = Matrix_right_u8_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 4u)), (select(v_8, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m1.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_13 / 16u) * 16u)); + bool v_14 = (((0u + (16u * 7u)) + 1u) <= (v_13 / 16u)); Matrix_right_u8_8x8 m2 = Matrix_right_u8_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 4u)), (select(v_14, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; v.GetDimensions(v_15); uint v_16 = asuint(int(0)); uint v_17 = asuint(int(16)); - bool v_18 = ((((v_16 + (v_17 * 7u)) * 4u) + 8u) <= ((v_15 / 4u) * 4u)); + bool v_18 = (((v_16 + (v_17 * 7u)) + 2u) <= (v_15 / 4u)); m2.Store(v, (0u + (select(v_18, v_16, 0u) * 4u)), (select(v_18, v_17, 2u) * 4u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_19 / 16u) * 16u)); + bool v_20 = (((0u + (16u * 7u)) + 1u) <= (v_19 / 16u)); Matrix_right_u8_8x8 m3 = Matrix_right_u8_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 4u)), (select(v_20, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m3.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; in4.GetDimensions(v_25); - bool v_26 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_25 / 2u) * 2u)); + bool v_26 = (((0u + (16u * 7u)) + 4u) <= (v_25 / 2u)); Matrix_right_u8_8x8 m4 = Matrix_right_u8_8x8::Load(in4, (0u + (select(v_26, 0u, 0u) * 4u)), (select(v_26, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_27 = 0u; v.GetDimensions(v_27); uint v_28 = asuint(int(0)); uint v_29 = asuint(int(16)); - bool v_30 = ((((v_28 + (v_29 * 7u)) * 4u) + 8u) <= ((v_27 / 4u) * 4u)); + bool v_30 = (((v_28 + (v_29 * 7u)) + 2u) <= (v_27 / 4u)); m4.Store(v, (0u + (select(v_30, v_28, 0u) * 4u)), (select(v_30, v_29, 2u) * 4u), MatrixLayout::ColMajor); uint v_31 = 0u; in5.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_31 / 4u) * 4u)); + bool v_32 = (((0u + (16u * 7u)) + 2u) <= (v_31 / 4u)); Matrix_right_u8_8x8 m5 = Matrix_right_u8_8x8::Load(in5, (0u + (select(v_32, 0u, 0u) * 4u)), (select(v_32, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_33 = 0u; v.GetDimensions(v_33); uint v_34 = asuint(int(0)); uint v_35 = asuint(int(16)); - bool v_36 = ((((v_34 + (v_35 * 7u)) * 4u) + 8u) <= ((v_33 / 4u) * 4u)); + bool v_36 = (((v_34 + (v_35 * 7u)) + 2u) <= (v_33 / 4u)); m5.Store(v, (0u + (select(v_36, v_34, 0u) * 4u)), (select(v_36, v_35, 2u) * 4u), MatrixLayout::ColMajor); uint v_37 = 0u; in6.GetDimensions(v_37); - bool v_38 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_37 / 8u) * 8u)); + bool v_38 = (((0u + (16u * 7u)) + 1u) <= (v_37 / 8u)); Matrix_right_u8_8x8 m6 = Matrix_right_u8_8x8::Load(in6, (0u + (select(v_38, 0u, 0u) * 4u)), (select(v_38, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 4u) + 8u) <= ((v_39 / 4u) * 4u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 2u) <= (v_39 / 4u)); m6.Store(v, (0u + (select(v_42, v_40, 0u) * 4u)), (select(v_42, v_41, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_col_major.wgsl.expected.spvasm index 004c21c..66a4866 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 270 +; Bound: 242 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -129,17 +129,16 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %uchar = OpTypeInt 8 0 %uint_1 = OpConstant %uint 1 - %67 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_1 + %63 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_1 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 @@ -151,6 +150,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -160,199 +160,171 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_4 - %51 = OpIMul %uint %uint_16 %uint_7 - %54 = OpIAdd %uint %uint_0 %51 - %55 = OpIMul %uint %54 %uint_4 - %56 = OpIAdd %uint %55 %uint_8 - %58 = OpULessThanEqual %bool %56 %49 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_2 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - %m0 = OpCooperativeMatrixLoadKHR %67 %64 %uint_1 %61 None - %71 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %73 = OpArrayLength %uint %38 0 - %74 = OpIMul %uint %73 %uint_4 - %75 = OpBitcast %uint %int_0 - %77 = OpBitcast %uint %int_16 - %79 = OpIMul %uint %77 %uint_7 - %80 = OpIAdd %uint %75 %79 - %81 = OpIMul %uint %80 %uint_4 - %82 = OpIAdd %uint %81 %uint_8 - %83 = OpULessThanEqual %bool %82 %74 - %84 = OpSelect %uint %83 %75 %uint_0 - %85 = OpSelect %uint %83 %77 %uint_2 - %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %87 = OpAccessChain %_ptr_StorageBuffer_uint_0 %86 %84 - OpCooperativeMatrixStoreKHR %87 %m0 %uint_1 %85 NonPrivatePointer - %90 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %92 = OpArrayLength %uint %6 0 - %93 = OpIMul %uint %92 %uint_8 - %94 = OpIMul %uint %uint_16 %uint_7 - %95 = OpIAdd %uint %uint_0 %94 - %96 = OpIMul %uint %95 %uint_8 - %97 = OpIAdd %uint %96 %uint_8 - %98 = OpULessThanEqual %bool %97 %93 - %99 = OpSelect %uint %98 %uint_0 %uint_0 - %100 = OpSelect %uint %98 %uint_16 %uint_1 - %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %102 = OpAccessChain %_ptr_StorageBuffer_v2int %101 %99 - %m1 = OpCooperativeMatrixLoadKHR %67 %102 %uint_1 %100 None - %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %106 = OpArrayLength %uint %38 0 - %107 = OpIMul %uint %106 %uint_4 - %108 = OpBitcast %uint %int_0 - %109 = OpBitcast %uint %int_16 - %110 = OpIMul %uint %109 %uint_7 - %111 = OpIAdd %uint %108 %110 - %112 = OpIMul %uint %111 %uint_4 - %113 = OpIAdd %uint %112 %uint_8 - %114 = OpULessThanEqual %bool %113 %107 - %115 = OpSelect %uint %114 %108 %uint_0 - %116 = OpSelect %uint %114 %109 %uint_2 - %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %118 = OpAccessChain %_ptr_StorageBuffer_uint_0 %117 %115 - OpCooperativeMatrixStoreKHR %118 %m1 %uint_1 %116 NonPrivatePointer + %49 = OpIMul %uint %uint_16 %uint_7 + %52 = OpIAdd %uint %uint_0 %49 + %53 = OpIAdd %uint %52 %uint_2 + %55 = OpULessThanEqual %bool %53 %48 + %57 = OpSelect %uint %55 %uint_0 %uint_0 + %58 = OpSelect %uint %55 %uint_16 %uint_2 + %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %60 = OpAccessChain %_ptr_StorageBuffer_uint %59 %57 + %m0 = OpCooperativeMatrixLoadKHR %63 %60 %uint_1 %58 None + %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %70 = OpArrayLength %uint %38 0 + %71 = OpBitcast %uint %int_0 + %73 = OpBitcast %uint %int_16 + %75 = OpIMul %uint %73 %uint_7 + %76 = OpIAdd %uint %71 %75 + %77 = OpIAdd %uint %76 %uint_2 + %78 = OpULessThanEqual %bool %77 %70 + %79 = OpSelect %uint %78 %71 %uint_0 + %80 = OpSelect %uint %78 %73 %uint_2 + %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %82 = OpAccessChain %_ptr_StorageBuffer_uint_0 %81 %79 + OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %87 = OpArrayLength %uint %6 0 + %88 = OpIMul %uint %uint_16 %uint_7 + %89 = OpIAdd %uint %uint_0 %88 + %90 = OpIAdd %uint %89 %uint_1 + %91 = OpULessThanEqual %bool %90 %87 + %92 = OpSelect %uint %91 %uint_0 %uint_0 + %93 = OpSelect %uint %91 %uint_16 %uint_1 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %92 + %m1 = OpCooperativeMatrixLoadKHR %63 %95 %uint_1 %93 None + %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %99 = OpArrayLength %uint %38 0 + %100 = OpBitcast %uint %int_0 + %101 = OpBitcast %uint %int_16 + %102 = OpIMul %uint %101 %uint_7 + %103 = OpIAdd %uint %100 %102 + %104 = OpIAdd %uint %103 %uint_2 + %105 = OpULessThanEqual %bool %104 %99 + %106 = OpSelect %uint %105 %100 %uint_0 + %107 = OpSelect %uint %105 %101 %uint_2 + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 + OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %113 = OpArrayLength %uint %12 0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %uint_0 %114 + %116 = OpIAdd %uint %115 %uint_1 + %117 = OpULessThanEqual %bool %116 %113 + %118 = OpSelect %uint %117 %uint_0 %uint_0 + %119 = OpSelect %uint %117 %uint_16 %uint_1 %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %122 = OpArrayLength %uint %12 0 - %123 = OpIMul %uint %122 %uint_16 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %uint_0 %124 - %126 = OpIMul %uint %125 %uint_16 - %127 = OpIAdd %uint %126 %uint_16 - %128 = OpULessThanEqual %bool %127 %123 - %129 = OpSelect %uint %128 %uint_0 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_1 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_v3float %131 %129 - %m2 = OpCooperativeMatrixLoadKHR %67 %132 %uint_1 %130 None - %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %136 = OpArrayLength %uint %38 0 - %137 = OpIMul %uint %136 %uint_4 - %138 = OpBitcast %uint %int_0 - %139 = OpBitcast %uint %int_16 - %140 = OpIMul %uint %139 %uint_7 - %141 = OpIAdd %uint %138 %140 - %142 = OpIMul %uint %141 %uint_4 - %143 = OpIAdd %uint %142 %uint_8 - %144 = OpULessThanEqual %bool %143 %137 - %145 = OpSelect %uint %144 %138 %uint_0 - %146 = OpSelect %uint %144 %139 %uint_2 - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %148 = OpAccessChain %_ptr_StorageBuffer_uint_0 %147 %145 - OpCooperativeMatrixStoreKHR %148 %m2 %uint_1 %146 NonPrivatePointer - %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %152 = OpArrayLength %uint %18 0 - %153 = OpIMul %uint %152 %uint_16 - %154 = OpIMul %uint %uint_16 %uint_7 - %155 = OpIAdd %uint %uint_0 %154 - %156 = OpIMul %uint %155 %uint_16 - %157 = OpIAdd %uint %156 %uint_16 - %158 = OpULessThanEqual %bool %157 %153 - %159 = OpSelect %uint %158 %uint_0 %uint_0 - %160 = OpSelect %uint %158 %uint_16 %uint_1 - %161 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %162 = OpAccessChain %_ptr_StorageBuffer_v4uint %161 %159 - %m3 = OpCooperativeMatrixLoadKHR %67 %162 %uint_1 %160 None - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %166 = OpArrayLength %uint %38 0 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpBitcast %uint %int_0 - %169 = OpBitcast %uint %int_16 - %170 = OpIMul %uint %169 %uint_7 - %171 = OpIAdd %uint %168 %170 - %172 = OpIMul %uint %171 %uint_4 - %173 = OpIAdd %uint %172 %uint_8 - %174 = OpULessThanEqual %bool %173 %167 - %175 = OpSelect %uint %174 %168 %uint_0 - %176 = OpSelect %uint %174 %169 %uint_2 + %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 + %m2 = OpCooperativeMatrixLoadKHR %63 %121 %uint_1 %119 None + %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %125 = OpArrayLength %uint %38 0 + %126 = OpBitcast %uint %int_0 + %127 = OpBitcast %uint %int_16 + %128 = OpIMul %uint %127 %uint_7 + %129 = OpIAdd %uint %126 %128 + %130 = OpIAdd %uint %129 %uint_2 + %131 = OpULessThanEqual %bool %130 %125 + %132 = OpSelect %uint %131 %126 %uint_0 + %133 = OpSelect %uint %131 %127 %uint_2 + %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 + OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %139 = OpArrayLength %uint %18 0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %uint_0 %140 + %142 = OpIAdd %uint %141 %uint_1 + %143 = OpULessThanEqual %bool %142 %139 + %144 = OpSelect %uint %143 %uint_0 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_1 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %63 %147 %uint_1 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %151 = OpArrayLength %uint %38 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_2 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_2 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpIMul %uint %uint_16 %uint_7 + %167 = OpIAdd %uint %uint_0 %166 + %168 = OpIAdd %uint %167 %uint_4 + %170 = OpULessThanEqual %bool %168 %165 + %171 = OpSelect %uint %170 %uint_0 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_4 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_half %173 %171 + %m4 = OpCooperativeMatrixLoadKHR %63 %174 %uint_1 %172 None %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %178 = OpAccessChain %_ptr_StorageBuffer_uint_0 %177 %175 - OpCooperativeMatrixStoreKHR %178 %m3 %uint_1 %176 NonPrivatePointer - %180 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %182 = OpArrayLength %uint %23 0 - %183 = OpIMul %uint %182 %uint_2 - %184 = OpIMul %uint %uint_16 %uint_7 - %185 = OpIAdd %uint %uint_0 %184 - %186 = OpIMul %uint %185 %uint_2 - %187 = OpIAdd %uint %186 %uint_8 - %188 = OpULessThanEqual %bool %187 %183 - %189 = OpSelect %uint %188 %uint_0 %uint_0 - %190 = OpSelect %uint %188 %uint_16 %uint_4 - %191 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %192 = OpAccessChain %_ptr_StorageBuffer_half %191 %189 - %m4 = OpCooperativeMatrixLoadKHR %67 %192 %uint_1 %190 None - %195 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %196 = OpArrayLength %uint %38 0 - %197 = OpIMul %uint %196 %uint_4 - %198 = OpBitcast %uint %int_0 - %199 = OpBitcast %uint %int_16 - %200 = OpIMul %uint %199 %uint_7 - %201 = OpIAdd %uint %198 %200 - %202 = OpIMul %uint %201 %uint_4 - %203 = OpIAdd %uint %202 %uint_8 - %204 = OpULessThanEqual %bool %203 %197 - %205 = OpSelect %uint %204 %198 %uint_0 - %206 = OpSelect %uint %204 %199 %uint_2 - %207 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %208 = OpAccessChain %_ptr_StorageBuffer_uint_0 %207 %205 - OpCooperativeMatrixStoreKHR %208 %m4 %uint_1 %206 NonPrivatePointer - %210 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %212 = OpArrayLength %uint %28 0 - %213 = OpIMul %uint %212 %uint_4 - %214 = OpIMul %uint %uint_16 %uint_7 - %215 = OpIAdd %uint %uint_0 %214 - %216 = OpIMul %uint %215 %uint_4 - %217 = OpIAdd %uint %216 %uint_8 - %218 = OpULessThanEqual %bool %217 %213 - %219 = OpSelect %uint %218 %uint_0 %uint_0 - %220 = OpSelect %uint %218 %uint_16 %uint_2 - %221 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %222 = OpAccessChain %_ptr_StorageBuffer_v2half %221 %219 - %m5 = OpCooperativeMatrixLoadKHR %67 %222 %uint_1 %220 None - %225 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %226 = OpArrayLength %uint %38 0 - %227 = OpIMul %uint %226 %uint_4 - %228 = OpBitcast %uint %int_0 - %229 = OpBitcast %uint %int_16 - %230 = OpIMul %uint %229 %uint_7 - %231 = OpIAdd %uint %228 %230 - %232 = OpIMul %uint %231 %uint_4 - %233 = OpIAdd %uint %232 %uint_8 - %234 = OpULessThanEqual %bool %233 %227 - %235 = OpSelect %uint %234 %228 %uint_0 - %236 = OpSelect %uint %234 %229 %uint_2 - %237 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %238 = OpAccessChain %_ptr_StorageBuffer_uint_0 %237 %235 - OpCooperativeMatrixStoreKHR %238 %m5 %uint_1 %236 NonPrivatePointer - %240 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %242 = OpArrayLength %uint %33 0 - %243 = OpIMul %uint %242 %uint_8 - %244 = OpIMul %uint %uint_16 %uint_7 - %245 = OpIAdd %uint %uint_0 %244 - %246 = OpIMul %uint %245 %uint_8 - %247 = OpIAdd %uint %246 %uint_8 - %248 = OpULessThanEqual %bool %247 %243 - %249 = OpSelect %uint %248 %uint_0 %uint_0 - %250 = OpSelect %uint %248 %uint_16 %uint_1 - %251 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %252 = OpAccessChain %_ptr_StorageBuffer_v3half %251 %249 - %m6 = OpCooperativeMatrixLoadKHR %67 %252 %uint_1 %250 None - %255 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %256 = OpArrayLength %uint %38 0 - %257 = OpIMul %uint %256 %uint_4 - %258 = OpBitcast %uint %int_0 - %259 = OpBitcast %uint %int_16 - %260 = OpIMul %uint %259 %uint_7 - %261 = OpIAdd %uint %258 %260 - %262 = OpIMul %uint %261 %uint_4 - %263 = OpIAdd %uint %262 %uint_8 - %264 = OpULessThanEqual %bool %263 %257 - %265 = OpSelect %uint %264 %258 %uint_0 - %266 = OpSelect %uint %264 %259 %uint_2 - %267 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %268 = OpAccessChain %_ptr_StorageBuffer_uint_0 %267 %265 - OpCooperativeMatrixStoreKHR %268 %m6 %uint_1 %266 NonPrivatePointer + %178 = OpArrayLength %uint %38 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_2 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_2 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m4 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %192 = OpArrayLength %uint %28 0 + %193 = OpIMul %uint %uint_16 %uint_7 + %194 = OpIAdd %uint %uint_0 %193 + %195 = OpIAdd %uint %194 %uint_2 + %196 = OpULessThanEqual %bool %195 %192 + %197 = OpSelect %uint %196 %uint_0 %uint_0 + %198 = OpSelect %uint %196 %uint_16 %uint_2 + %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %200 = OpAccessChain %_ptr_StorageBuffer_v2half %199 %197 + %m5 = OpCooperativeMatrixLoadKHR %63 %200 %uint_1 %198 None + %203 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %204 = OpArrayLength %uint %38 0 + %205 = OpBitcast %uint %int_0 + %206 = OpBitcast %uint %int_16 + %207 = OpIMul %uint %206 %uint_7 + %208 = OpIAdd %uint %205 %207 + %209 = OpIAdd %uint %208 %uint_2 + %210 = OpULessThanEqual %bool %209 %204 + %211 = OpSelect %uint %210 %205 %uint_0 + %212 = OpSelect %uint %210 %206 %uint_2 + %213 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %214 = OpAccessChain %_ptr_StorageBuffer_uint_0 %213 %211 + OpCooperativeMatrixStoreKHR %214 %m5 %uint_1 %212 NonPrivatePointer + %216 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %218 = OpArrayLength %uint %33 0 + %219 = OpIMul %uint %uint_16 %uint_7 + %220 = OpIAdd %uint %uint_0 %219 + %221 = OpIAdd %uint %220 %uint_1 + %222 = OpULessThanEqual %bool %221 %218 + %223 = OpSelect %uint %222 %uint_0 %uint_0 + %224 = OpSelect %uint %222 %uint_16 %uint_1 + %225 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %226 = OpAccessChain %_ptr_StorageBuffer_v3half %225 %223 + %m6 = OpCooperativeMatrixLoadKHR %63 %226 %uint_1 %224 None + %229 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %230 = OpArrayLength %uint %38 0 + %231 = OpBitcast %uint %int_0 + %232 = OpBitcast %uint %int_16 + %233 = OpIMul %uint %232 %uint_7 + %234 = OpIAdd %uint %231 %233 + %235 = OpIAdd %uint %234 %uint_2 + %236 = OpULessThanEqual %bool %235 %230 + %237 = OpSelect %uint %236 %231 %uint_0 + %238 = OpSelect %uint %236 %232 %uint_2 + %239 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %240 = OpAccessChain %_ptr_StorageBuffer_uint_0 %239 %237 + OpCooperativeMatrixStoreKHR %240 %m6 %uint_1 %238 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl index ba5a25e..c246276 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -14,73 +14,73 @@ void main() { uint v_1 = 0u; in0.GetDimensions(v_1); - bool v_2 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_2 = (((0u + (16u * 7u)) + 2u) <= (v_1 / 4u)); Matrix_right_u8_8x8 m0 = Matrix_right_u8_8x8::Load(in0, (0u + (select(v_2, 0u, 0u) * 4u)), (select(v_2, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_3 = 0u; v.GetDimensions(v_3); uint v_4 = asuint(int(0)); uint v_5 = asuint(int(16)); - bool v_6 = ((((v_4 + (v_5 * 7u)) * 4u) + 8u) <= ((v_3 / 4u) * 4u)); + bool v_6 = (((v_4 + (v_5 * 7u)) + 2u) <= (v_3 / 4u)); m0.Store(v, (0u + (select(v_6, v_4, 0u) * 4u)), (select(v_6, v_5, 2u) * 4u), MatrixLayout::ColMajor); uint v_7 = 0u; in1.GetDimensions(v_7); - bool v_8 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_7 / 8u) * 8u)); + bool v_8 = (((0u + (16u * 7u)) + 1u) <= (v_7 / 8u)); Matrix_right_u8_8x8 m1 = Matrix_right_u8_8x8::Load(in1, (0u + (select(v_8, 0u, 0u) * 4u)), (select(v_8, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m1.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); uint v_13 = 0u; in2.GetDimensions(v_13); - bool v_14 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_13 / 16u) * 16u)); + bool v_14 = (((0u + (16u * 7u)) + 1u) <= (v_13 / 16u)); Matrix_right_u8_8x8 m2 = Matrix_right_u8_8x8::Load(in2, (0u + (select(v_14, 0u, 0u) * 4u)), (select(v_14, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_15 = 0u; v.GetDimensions(v_15); uint v_16 = asuint(int(0)); uint v_17 = asuint(int(16)); - bool v_18 = ((((v_16 + (v_17 * 7u)) * 4u) + 8u) <= ((v_15 / 4u) * 4u)); + bool v_18 = (((v_16 + (v_17 * 7u)) + 2u) <= (v_15 / 4u)); m2.Store(v, (0u + (select(v_18, v_16, 0u) * 4u)), (select(v_18, v_17, 2u) * 4u), MatrixLayout::ColMajor); uint v_19 = 0u; in3.GetDimensions(v_19); - bool v_20 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_19 / 16u) * 16u)); + bool v_20 = (((0u + (16u * 7u)) + 1u) <= (v_19 / 16u)); Matrix_right_u8_8x8 m3 = Matrix_right_u8_8x8::Load(in3, (0u + (select(v_20, 0u, 0u) * 4u)), (select(v_20, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m3.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); uint v_25 = 0u; in4.GetDimensions(v_25); - bool v_26 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_25 / 2u) * 2u)); + bool v_26 = (((0u + (16u * 7u)) + 4u) <= (v_25 / 2u)); Matrix_right_u8_8x8 m4 = Matrix_right_u8_8x8::Load(in4, (0u + (select(v_26, 0u, 0u) * 4u)), (select(v_26, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_27 = 0u; v.GetDimensions(v_27); uint v_28 = asuint(int(0)); uint v_29 = asuint(int(16)); - bool v_30 = ((((v_28 + (v_29 * 7u)) * 4u) + 8u) <= ((v_27 / 4u) * 4u)); + bool v_30 = (((v_28 + (v_29 * 7u)) + 2u) <= (v_27 / 4u)); m4.Store(v, (0u + (select(v_30, v_28, 0u) * 4u)), (select(v_30, v_29, 2u) * 4u), MatrixLayout::ColMajor); uint v_31 = 0u; in5.GetDimensions(v_31); - bool v_32 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_31 / 4u) * 4u)); + bool v_32 = (((0u + (16u * 7u)) + 2u) <= (v_31 / 4u)); Matrix_right_u8_8x8 m5 = Matrix_right_u8_8x8::Load(in5, (0u + (select(v_32, 0u, 0u) * 4u)), (select(v_32, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_33 = 0u; v.GetDimensions(v_33); uint v_34 = asuint(int(0)); uint v_35 = asuint(int(16)); - bool v_36 = ((((v_34 + (v_35 * 7u)) * 4u) + 8u) <= ((v_33 / 4u) * 4u)); + bool v_36 = (((v_34 + (v_35 * 7u)) + 2u) <= (v_33 / 4u)); m5.Store(v, (0u + (select(v_36, v_34, 0u) * 4u)), (select(v_36, v_35, 2u) * 4u), MatrixLayout::ColMajor); uint v_37 = 0u; in6.GetDimensions(v_37); - bool v_38 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_37 / 8u) * 8u)); + bool v_38 = (((0u + (16u * 7u)) + 1u) <= (v_37 / 8u)); Matrix_right_u8_8x8 m6 = Matrix_right_u8_8x8::Load(in6, (0u + (select(v_38, 0u, 0u) * 4u)), (select(v_38, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_39 = 0u; v.GetDimensions(v_39); uint v_40 = asuint(int(0)); uint v_41 = asuint(int(16)); - bool v_42 = ((((v_40 + (v_41 * 7u)) * 4u) + 8u) <= ((v_39 / 4u) * 4u)); + bool v_42 = (((v_40 + (v_41 * 7u)) + 2u) <= (v_39 / 4u)); m6.Store(v, (0u + (select(v_42, v_40, 0u) * 4u)), (select(v_42, v_41, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_row_major.wgsl.expected.spvasm index 1663ce5..9cf03f0 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 270 +; Bound: 242 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -129,17 +129,16 @@ %43 = OpTypeFunction %void %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %uint_8 = OpConstant %uint 8 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_3 = OpConstant %uint 3 + %uint_8 = OpConstant %uint 8 %uchar = OpTypeInt 8 0 %uint_1 = OpConstant %uint 1 - %67 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_1 + %63 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_1 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 @@ -151,6 +150,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -160,199 +160,171 @@ %44 = OpLabel %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %48 = OpArrayLength %uint %1 0 - %49 = OpIMul %uint %48 %uint_4 - %51 = OpIMul %uint %uint_16 %uint_7 - %54 = OpIAdd %uint %uint_0 %51 - %55 = OpIMul %uint %54 %uint_4 - %56 = OpIAdd %uint %55 %uint_8 - %58 = OpULessThanEqual %bool %56 %49 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_2 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - %m0 = OpCooperativeMatrixLoadKHR %67 %64 %uint_0 %61 None - %71 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %73 = OpArrayLength %uint %38 0 - %74 = OpIMul %uint %73 %uint_4 - %75 = OpBitcast %uint %int_0 - %77 = OpBitcast %uint %int_16 - %79 = OpIMul %uint %77 %uint_7 - %80 = OpIAdd %uint %75 %79 - %81 = OpIMul %uint %80 %uint_4 - %82 = OpIAdd %uint %81 %uint_8 - %83 = OpULessThanEqual %bool %82 %74 - %84 = OpSelect %uint %83 %75 %uint_0 - %85 = OpSelect %uint %83 %77 %uint_2 - %86 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %87 = OpAccessChain %_ptr_StorageBuffer_uint_0 %86 %84 - OpCooperativeMatrixStoreKHR %87 %m0 %uint_1 %85 NonPrivatePointer - %90 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %92 = OpArrayLength %uint %6 0 - %93 = OpIMul %uint %92 %uint_8 - %94 = OpIMul %uint %uint_16 %uint_7 - %95 = OpIAdd %uint %uint_0 %94 - %96 = OpIMul %uint %95 %uint_8 - %97 = OpIAdd %uint %96 %uint_8 - %98 = OpULessThanEqual %bool %97 %93 - %99 = OpSelect %uint %98 %uint_0 %uint_0 - %100 = OpSelect %uint %98 %uint_16 %uint_1 - %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %102 = OpAccessChain %_ptr_StorageBuffer_v2int %101 %99 - %m1 = OpCooperativeMatrixLoadKHR %67 %102 %uint_0 %100 None - %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %106 = OpArrayLength %uint %38 0 - %107 = OpIMul %uint %106 %uint_4 - %108 = OpBitcast %uint %int_0 - %109 = OpBitcast %uint %int_16 - %110 = OpIMul %uint %109 %uint_7 - %111 = OpIAdd %uint %108 %110 - %112 = OpIMul %uint %111 %uint_4 - %113 = OpIAdd %uint %112 %uint_8 - %114 = OpULessThanEqual %bool %113 %107 - %115 = OpSelect %uint %114 %108 %uint_0 - %116 = OpSelect %uint %114 %109 %uint_2 - %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %118 = OpAccessChain %_ptr_StorageBuffer_uint_0 %117 %115 - OpCooperativeMatrixStoreKHR %118 %m1 %uint_1 %116 NonPrivatePointer + %49 = OpIMul %uint %uint_16 %uint_7 + %52 = OpIAdd %uint %uint_0 %49 + %53 = OpIAdd %uint %52 %uint_2 + %55 = OpULessThanEqual %bool %53 %48 + %57 = OpSelect %uint %55 %uint_0 %uint_0 + %58 = OpSelect %uint %55 %uint_16 %uint_2 + %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %60 = OpAccessChain %_ptr_StorageBuffer_uint %59 %57 + %m0 = OpCooperativeMatrixLoadKHR %63 %60 %uint_0 %58 None + %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %70 = OpArrayLength %uint %38 0 + %71 = OpBitcast %uint %int_0 + %73 = OpBitcast %uint %int_16 + %75 = OpIMul %uint %73 %uint_7 + %76 = OpIAdd %uint %71 %75 + %77 = OpIAdd %uint %76 %uint_2 + %78 = OpULessThanEqual %bool %77 %70 + %79 = OpSelect %uint %78 %71 %uint_0 + %80 = OpSelect %uint %78 %73 %uint_2 + %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %82 = OpAccessChain %_ptr_StorageBuffer_uint_0 %81 %79 + OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %87 = OpArrayLength %uint %6 0 + %88 = OpIMul %uint %uint_16 %uint_7 + %89 = OpIAdd %uint %uint_0 %88 + %90 = OpIAdd %uint %89 %uint_1 + %91 = OpULessThanEqual %bool %90 %87 + %92 = OpSelect %uint %91 %uint_0 %uint_0 + %93 = OpSelect %uint %91 %uint_16 %uint_1 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_v2int %94 %92 + %m1 = OpCooperativeMatrixLoadKHR %63 %95 %uint_0 %93 None + %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %99 = OpArrayLength %uint %38 0 + %100 = OpBitcast %uint %int_0 + %101 = OpBitcast %uint %int_16 + %102 = OpIMul %uint %101 %uint_7 + %103 = OpIAdd %uint %100 %102 + %104 = OpIAdd %uint %103 %uint_2 + %105 = OpULessThanEqual %bool %104 %99 + %106 = OpSelect %uint %105 %100 %uint_0 + %107 = OpSelect %uint %105 %101 %uint_2 + %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %109 = OpAccessChain %_ptr_StorageBuffer_uint_0 %108 %106 + OpCooperativeMatrixStoreKHR %109 %m1 %uint_1 %107 NonPrivatePointer + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %113 = OpArrayLength %uint %12 0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %uint_0 %114 + %116 = OpIAdd %uint %115 %uint_1 + %117 = OpULessThanEqual %bool %116 %113 + %118 = OpSelect %uint %117 %uint_0 %uint_0 + %119 = OpSelect %uint %117 %uint_16 %uint_1 %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %122 = OpArrayLength %uint %12 0 - %123 = OpIMul %uint %122 %uint_16 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %uint_0 %124 - %126 = OpIMul %uint %125 %uint_16 - %127 = OpIAdd %uint %126 %uint_16 - %128 = OpULessThanEqual %bool %127 %123 - %129 = OpSelect %uint %128 %uint_0 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_1 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_v3float %131 %129 - %m2 = OpCooperativeMatrixLoadKHR %67 %132 %uint_0 %130 None - %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %136 = OpArrayLength %uint %38 0 - %137 = OpIMul %uint %136 %uint_4 - %138 = OpBitcast %uint %int_0 - %139 = OpBitcast %uint %int_16 - %140 = OpIMul %uint %139 %uint_7 - %141 = OpIAdd %uint %138 %140 - %142 = OpIMul %uint %141 %uint_4 - %143 = OpIAdd %uint %142 %uint_8 - %144 = OpULessThanEqual %bool %143 %137 - %145 = OpSelect %uint %144 %138 %uint_0 - %146 = OpSelect %uint %144 %139 %uint_2 - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %148 = OpAccessChain %_ptr_StorageBuffer_uint_0 %147 %145 - OpCooperativeMatrixStoreKHR %148 %m2 %uint_1 %146 NonPrivatePointer - %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %152 = OpArrayLength %uint %18 0 - %153 = OpIMul %uint %152 %uint_16 - %154 = OpIMul %uint %uint_16 %uint_7 - %155 = OpIAdd %uint %uint_0 %154 - %156 = OpIMul %uint %155 %uint_16 - %157 = OpIAdd %uint %156 %uint_16 - %158 = OpULessThanEqual %bool %157 %153 - %159 = OpSelect %uint %158 %uint_0 %uint_0 - %160 = OpSelect %uint %158 %uint_16 %uint_1 - %161 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %162 = OpAccessChain %_ptr_StorageBuffer_v4uint %161 %159 - %m3 = OpCooperativeMatrixLoadKHR %67 %162 %uint_0 %160 None - %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %166 = OpArrayLength %uint %38 0 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpBitcast %uint %int_0 - %169 = OpBitcast %uint %int_16 - %170 = OpIMul %uint %169 %uint_7 - %171 = OpIAdd %uint %168 %170 - %172 = OpIMul %uint %171 %uint_4 - %173 = OpIAdd %uint %172 %uint_8 - %174 = OpULessThanEqual %bool %173 %167 - %175 = OpSelect %uint %174 %168 %uint_0 - %176 = OpSelect %uint %174 %169 %uint_2 + %121 = OpAccessChain %_ptr_StorageBuffer_v3float %120 %118 + %m2 = OpCooperativeMatrixLoadKHR %63 %121 %uint_0 %119 None + %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %125 = OpArrayLength %uint %38 0 + %126 = OpBitcast %uint %int_0 + %127 = OpBitcast %uint %int_16 + %128 = OpIMul %uint %127 %uint_7 + %129 = OpIAdd %uint %126 %128 + %130 = OpIAdd %uint %129 %uint_2 + %131 = OpULessThanEqual %bool %130 %125 + %132 = OpSelect %uint %131 %126 %uint_0 + %133 = OpSelect %uint %131 %127 %uint_2 + %134 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %134 %132 + OpCooperativeMatrixStoreKHR %135 %m2 %uint_1 %133 NonPrivatePointer + %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %139 = OpArrayLength %uint %18 0 + %140 = OpIMul %uint %uint_16 %uint_7 + %141 = OpIAdd %uint %uint_0 %140 + %142 = OpIAdd %uint %141 %uint_1 + %143 = OpULessThanEqual %bool %142 %139 + %144 = OpSelect %uint %143 %uint_0 %uint_0 + %145 = OpSelect %uint %143 %uint_16 %uint_1 + %146 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %147 = OpAccessChain %_ptr_StorageBuffer_v4uint %146 %144 + %m3 = OpCooperativeMatrixLoadKHR %63 %147 %uint_0 %145 None + %150 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %151 = OpArrayLength %uint %38 0 + %152 = OpBitcast %uint %int_0 + %153 = OpBitcast %uint %int_16 + %154 = OpIMul %uint %153 %uint_7 + %155 = OpIAdd %uint %152 %154 + %156 = OpIAdd %uint %155 %uint_2 + %157 = OpULessThanEqual %bool %156 %151 + %158 = OpSelect %uint %157 %152 %uint_0 + %159 = OpSelect %uint %157 %153 %uint_2 + %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %161 = OpAccessChain %_ptr_StorageBuffer_uint_0 %160 %158 + OpCooperativeMatrixStoreKHR %161 %m3 %uint_1 %159 NonPrivatePointer + %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %165 = OpArrayLength %uint %23 0 + %166 = OpIMul %uint %uint_16 %uint_7 + %167 = OpIAdd %uint %uint_0 %166 + %168 = OpIAdd %uint %167 %uint_4 + %170 = OpULessThanEqual %bool %168 %165 + %171 = OpSelect %uint %170 %uint_0 %uint_0 + %172 = OpSelect %uint %170 %uint_16 %uint_4 + %173 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %174 = OpAccessChain %_ptr_StorageBuffer_half %173 %171 + %m4 = OpCooperativeMatrixLoadKHR %63 %174 %uint_0 %172 None %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %178 = OpAccessChain %_ptr_StorageBuffer_uint_0 %177 %175 - OpCooperativeMatrixStoreKHR %178 %m3 %uint_1 %176 NonPrivatePointer - %180 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %182 = OpArrayLength %uint %23 0 - %183 = OpIMul %uint %182 %uint_2 - %184 = OpIMul %uint %uint_16 %uint_7 - %185 = OpIAdd %uint %uint_0 %184 - %186 = OpIMul %uint %185 %uint_2 - %187 = OpIAdd %uint %186 %uint_8 - %188 = OpULessThanEqual %bool %187 %183 - %189 = OpSelect %uint %188 %uint_0 %uint_0 - %190 = OpSelect %uint %188 %uint_16 %uint_4 - %191 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %192 = OpAccessChain %_ptr_StorageBuffer_half %191 %189 - %m4 = OpCooperativeMatrixLoadKHR %67 %192 %uint_0 %190 None - %195 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %196 = OpArrayLength %uint %38 0 - %197 = OpIMul %uint %196 %uint_4 - %198 = OpBitcast %uint %int_0 - %199 = OpBitcast %uint %int_16 - %200 = OpIMul %uint %199 %uint_7 - %201 = OpIAdd %uint %198 %200 - %202 = OpIMul %uint %201 %uint_4 - %203 = OpIAdd %uint %202 %uint_8 - %204 = OpULessThanEqual %bool %203 %197 - %205 = OpSelect %uint %204 %198 %uint_0 - %206 = OpSelect %uint %204 %199 %uint_2 - %207 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %208 = OpAccessChain %_ptr_StorageBuffer_uint_0 %207 %205 - OpCooperativeMatrixStoreKHR %208 %m4 %uint_1 %206 NonPrivatePointer - %210 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %212 = OpArrayLength %uint %28 0 - %213 = OpIMul %uint %212 %uint_4 - %214 = OpIMul %uint %uint_16 %uint_7 - %215 = OpIAdd %uint %uint_0 %214 - %216 = OpIMul %uint %215 %uint_4 - %217 = OpIAdd %uint %216 %uint_8 - %218 = OpULessThanEqual %bool %217 %213 - %219 = OpSelect %uint %218 %uint_0 %uint_0 - %220 = OpSelect %uint %218 %uint_16 %uint_2 - %221 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %222 = OpAccessChain %_ptr_StorageBuffer_v2half %221 %219 - %m5 = OpCooperativeMatrixLoadKHR %67 %222 %uint_0 %220 None - %225 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %226 = OpArrayLength %uint %38 0 - %227 = OpIMul %uint %226 %uint_4 - %228 = OpBitcast %uint %int_0 - %229 = OpBitcast %uint %int_16 - %230 = OpIMul %uint %229 %uint_7 - %231 = OpIAdd %uint %228 %230 - %232 = OpIMul %uint %231 %uint_4 - %233 = OpIAdd %uint %232 %uint_8 - %234 = OpULessThanEqual %bool %233 %227 - %235 = OpSelect %uint %234 %228 %uint_0 - %236 = OpSelect %uint %234 %229 %uint_2 - %237 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %238 = OpAccessChain %_ptr_StorageBuffer_uint_0 %237 %235 - OpCooperativeMatrixStoreKHR %238 %m5 %uint_1 %236 NonPrivatePointer - %240 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %242 = OpArrayLength %uint %33 0 - %243 = OpIMul %uint %242 %uint_8 - %244 = OpIMul %uint %uint_16 %uint_7 - %245 = OpIAdd %uint %uint_0 %244 - %246 = OpIMul %uint %245 %uint_8 - %247 = OpIAdd %uint %246 %uint_8 - %248 = OpULessThanEqual %bool %247 %243 - %249 = OpSelect %uint %248 %uint_0 %uint_0 - %250 = OpSelect %uint %248 %uint_16 %uint_1 - %251 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %252 = OpAccessChain %_ptr_StorageBuffer_v3half %251 %249 - %m6 = OpCooperativeMatrixLoadKHR %67 %252 %uint_0 %250 None - %255 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %256 = OpArrayLength %uint %38 0 - %257 = OpIMul %uint %256 %uint_4 - %258 = OpBitcast %uint %int_0 - %259 = OpBitcast %uint %int_16 - %260 = OpIMul %uint %259 %uint_7 - %261 = OpIAdd %uint %258 %260 - %262 = OpIMul %uint %261 %uint_4 - %263 = OpIAdd %uint %262 %uint_8 - %264 = OpULessThanEqual %bool %263 %257 - %265 = OpSelect %uint %264 %258 %uint_0 - %266 = OpSelect %uint %264 %259 %uint_2 - %267 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 - %268 = OpAccessChain %_ptr_StorageBuffer_uint_0 %267 %265 - OpCooperativeMatrixStoreKHR %268 %m6 %uint_1 %266 NonPrivatePointer + %178 = OpArrayLength %uint %38 0 + %179 = OpBitcast %uint %int_0 + %180 = OpBitcast %uint %int_16 + %181 = OpIMul %uint %180 %uint_7 + %182 = OpIAdd %uint %179 %181 + %183 = OpIAdd %uint %182 %uint_2 + %184 = OpULessThanEqual %bool %183 %178 + %185 = OpSelect %uint %184 %179 %uint_0 + %186 = OpSelect %uint %184 %180 %uint_2 + %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %188 = OpAccessChain %_ptr_StorageBuffer_uint_0 %187 %185 + OpCooperativeMatrixStoreKHR %188 %m4 %uint_1 %186 NonPrivatePointer + %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %192 = OpArrayLength %uint %28 0 + %193 = OpIMul %uint %uint_16 %uint_7 + %194 = OpIAdd %uint %uint_0 %193 + %195 = OpIAdd %uint %194 %uint_2 + %196 = OpULessThanEqual %bool %195 %192 + %197 = OpSelect %uint %196 %uint_0 %uint_0 + %198 = OpSelect %uint %196 %uint_16 %uint_2 + %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %200 = OpAccessChain %_ptr_StorageBuffer_v2half %199 %197 + %m5 = OpCooperativeMatrixLoadKHR %63 %200 %uint_0 %198 None + %203 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %204 = OpArrayLength %uint %38 0 + %205 = OpBitcast %uint %int_0 + %206 = OpBitcast %uint %int_16 + %207 = OpIMul %uint %206 %uint_7 + %208 = OpIAdd %uint %205 %207 + %209 = OpIAdd %uint %208 %uint_2 + %210 = OpULessThanEqual %bool %209 %204 + %211 = OpSelect %uint %210 %205 %uint_0 + %212 = OpSelect %uint %210 %206 %uint_2 + %213 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %214 = OpAccessChain %_ptr_StorageBuffer_uint_0 %213 %211 + OpCooperativeMatrixStoreKHR %214 %m5 %uint_1 %212 NonPrivatePointer + %216 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %218 = OpArrayLength %uint %33 0 + %219 = OpIMul %uint %uint_16 %uint_7 + %220 = OpIAdd %uint %uint_0 %219 + %221 = OpIAdd %uint %220 %uint_1 + %222 = OpULessThanEqual %bool %221 %218 + %223 = OpSelect %uint %222 %uint_0 %uint_0 + %224 = OpSelect %uint %222 %uint_16 %uint_1 + %225 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %226 = OpAccessChain %_ptr_StorageBuffer_v3half %225 %223 + %m6 = OpCooperativeMatrixLoadKHR %63 %226 %uint_0 %224 None + %229 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %230 = OpArrayLength %uint %38 0 + %231 = OpBitcast %uint %int_0 + %232 = OpBitcast %uint %int_16 + %233 = OpIMul %uint %232 %uint_7 + %234 = OpIAdd %uint %231 %233 + %235 = OpIAdd %uint %234 %uint_2 + %236 = OpULessThanEqual %bool %235 %230 + %237 = OpSelect %uint %236 %231 %uint_0 + %238 = OpSelect %uint %236 %232 %uint_2 + %239 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %38 %uint_0 + %240 = OpAccessChain %_ptr_StorageBuffer_uint_0 %239 %237 + OpCooperativeMatrixStoreKHR %240 %m6 %uint_1 %238 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_col_major.wgsl.expected.dxc.hlsl index f268ede..a398eb7b3 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_col_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 2u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 4u)), (select(v_4, v_3, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_u8_8x8 m1 = Matrix_right_u8_8x8::Load(in1, 0u, 64u, MatrixLayout::ColMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 4u) + 8u) <= ((v_5 / 4u) * 4u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 2u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 4u)), (select(v_8, v_7, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_u8_8x8 m2 = Matrix_right_u8_8x8::Load(in2, 0u, 64u, MatrixLayout::ColMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_u8_8x8 m3 = Matrix_right_u8_8x8::Load(in3, 0u, 64u, MatrixLayout::ColMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 4u) + 8u) <= ((v_13 / 4u) * 4u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 2u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 4u)), (select(v_16, v_15, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_u8_8x8 m4 = Matrix_right_u8_8x8::Load(in4, 0u, 64u, MatrixLayout::ColMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 4u) + 8u) <= ((v_17 / 4u) * 4u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 2u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 4u)), (select(v_20, v_19, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_u8_8x8 m5 = Matrix_right_u8_8x8::Load(in5, 0u, 64u, MatrixLayout::ColMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_u8_8x8 m6 = Matrix_right_u8_8x8::Load(in6, 0u, 64u, MatrixLayout::ColMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_col_major.wgsl.expected.spvasm index d3424ca..6395f49 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 202 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -140,12 +140,11 @@ %53 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -166,126 +165,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_1 %uint_16 None %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %61 = OpArrayLength %uint %39 0 - %62 = OpIMul %uint %61 %uint_4 - %64 = OpBitcast %uint %int_0 - %66 = OpBitcast %uint %int_16 - %68 = OpIMul %uint %66 %uint_7 - %70 = OpIAdd %uint %64 %68 - %71 = OpIMul %uint %70 %uint_4 - %72 = OpIAdd %uint %71 %uint_8 - %73 = OpULessThanEqual %bool %72 %62 - %75 = OpSelect %uint %73 %64 %uint_0 - %76 = OpSelect %uint %73 %66 %uint_2 - %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %79 = OpAccessChain %_ptr_StorageBuffer_uint_0 %78 %75 - OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %76 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %82 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %84 %uint_1 %uint_16 None - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %88 = OpArrayLength %uint %39 0 - %89 = OpIMul %uint %88 %uint_4 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_2 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint_0 %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v3float %102 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %104 %uint_1 %uint_16 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %108 = OpArrayLength %uint %39 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m2 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v4uint %122 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %124 %uint_1 %uint_16 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %128 = OpArrayLength %uint %39 0 - %129 = OpIMul %uint %128 %uint_4 - %130 = OpBitcast %uint %int_0 - %131 = OpBitcast %uint %int_16 - %132 = OpIMul %uint %131 %uint_7 - %133 = OpIAdd %uint %130 %132 - %134 = OpIMul %uint %133 %uint_4 - %135 = OpIAdd %uint %134 %uint_8 - %136 = OpULessThanEqual %bool %135 %129 - %137 = OpSelect %uint %136 %130 %uint_0 - %138 = OpSelect %uint %136 %131 %uint_2 - %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %140 = OpAccessChain %_ptr_StorageBuffer_uint_0 %139 %137 - OpCooperativeMatrixStoreKHR %140 %m3 %uint_1 %138 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %144 = OpAccessChain %_ptr_StorageBuffer_half %142 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %144 %uint_1 %uint_16 None - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %148 = OpArrayLength %uint %39 0 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpBitcast %uint %int_0 - %151 = OpBitcast %uint %int_16 - %152 = OpIMul %uint %151 %uint_7 - %153 = OpIAdd %uint %150 %152 - %154 = OpIMul %uint %153 %uint_4 - %155 = OpIAdd %uint %154 %uint_8 - %156 = OpULessThanEqual %bool %155 %149 - %157 = OpSelect %uint %156 %150 %uint_0 - %158 = OpSelect %uint %156 %151 %uint_2 - %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %160 = OpAccessChain %_ptr_StorageBuffer_uint_0 %159 %157 - OpCooperativeMatrixStoreKHR %160 %m4 %uint_1 %158 NonPrivatePointer - %162 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v2half %162 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %164 %uint_1 %uint_16 None - %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %168 = OpArrayLength %uint %39 0 - %169 = OpIMul %uint %168 %uint_4 - %170 = OpBitcast %uint %int_0 - %171 = OpBitcast %uint %int_16 - %172 = OpIMul %uint %171 %uint_7 - %173 = OpIAdd %uint %170 %172 - %174 = OpIMul %uint %173 %uint_4 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %169 - %177 = OpSelect %uint %176 %170 %uint_0 - %178 = OpSelect %uint %176 %171 %uint_2 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_uint_0 %179 %177 - OpCooperativeMatrixStoreKHR %180 %m5 %uint_1 %178 NonPrivatePointer - %182 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %184 = OpAccessChain %_ptr_StorageBuffer_v3half %182 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %184 %uint_1 %uint_16 None - %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %188 = OpArrayLength %uint %39 0 - %189 = OpIMul %uint %188 %uint_4 - %190 = OpBitcast %uint %int_0 - %191 = OpBitcast %uint %int_16 - %192 = OpIMul %uint %191 %uint_7 - %193 = OpIAdd %uint %190 %192 - %194 = OpIMul %uint %193 %uint_4 - %195 = OpIAdd %uint %194 %uint_8 - %196 = OpULessThanEqual %bool %195 %189 - %197 = OpSelect %uint %196 %190 %uint_0 - %198 = OpSelect %uint %196 %191 %uint_2 - %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %200 = OpAccessChain %_ptr_StorageBuffer_uint_0 %199 %197 - OpCooperativeMatrixStoreKHR %200 %m6 %uint_1 %198 NonPrivatePointer + %62 = OpBitcast %uint %int_0 + %64 = OpBitcast %uint %int_16 + %66 = OpIMul %uint %64 %uint_7 + %68 = OpIAdd %uint %62 %66 + %69 = OpIAdd %uint %68 %uint_2 + %71 = OpULessThanEqual %bool %69 %61 + %73 = OpSelect %uint %71 %62 %uint_0 + %74 = OpSelect %uint %71 %64 %uint_2 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_uint_0 %75 %73 + OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_1 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_1 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_2 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_2 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_1 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_2 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_2 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_1 %uint_16 None + %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_2 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_2 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_1 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_2 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_2 + %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_1 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_2 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_2 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_row_major.wgsl.expected.dxc.hlsl index a45d933..fe55599 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_row_major.wgsl.expected.dxc.hlsl
@@ -17,49 +17,49 @@ v.GetDimensions(v_1); uint v_2 = asuint(int(0)); uint v_3 = asuint(int(16)); - bool v_4 = ((((v_2 + (v_3 * 7u)) * 4u) + 8u) <= ((v_1 / 4u) * 4u)); + bool v_4 = (((v_2 + (v_3 * 7u)) + 2u) <= (v_1 / 4u)); m0.Store(v, (0u + (select(v_4, v_2, 0u) * 4u)), (select(v_4, v_3, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_u8_8x8 m1 = Matrix_right_u8_8x8::Load(in1, 0u, 64u, MatrixLayout::RowMajor); uint v_5 = 0u; v.GetDimensions(v_5); uint v_6 = asuint(int(0)); uint v_7 = asuint(int(16)); - bool v_8 = ((((v_6 + (v_7 * 7u)) * 4u) + 8u) <= ((v_5 / 4u) * 4u)); + bool v_8 = (((v_6 + (v_7 * 7u)) + 2u) <= (v_5 / 4u)); m1.Store(v, (0u + (select(v_8, v_6, 0u) * 4u)), (select(v_8, v_7, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_u8_8x8 m2 = Matrix_right_u8_8x8::Load(in2, 0u, 64u, MatrixLayout::RowMajor); uint v_9 = 0u; v.GetDimensions(v_9); uint v_10 = asuint(int(0)); uint v_11 = asuint(int(16)); - bool v_12 = ((((v_10 + (v_11 * 7u)) * 4u) + 8u) <= ((v_9 / 4u) * 4u)); + bool v_12 = (((v_10 + (v_11 * 7u)) + 2u) <= (v_9 / 4u)); m2.Store(v, (0u + (select(v_12, v_10, 0u) * 4u)), (select(v_12, v_11, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_u8_8x8 m3 = Matrix_right_u8_8x8::Load(in3, 0u, 64u, MatrixLayout::RowMajor); uint v_13 = 0u; v.GetDimensions(v_13); uint v_14 = asuint(int(0)); uint v_15 = asuint(int(16)); - bool v_16 = ((((v_14 + (v_15 * 7u)) * 4u) + 8u) <= ((v_13 / 4u) * 4u)); + bool v_16 = (((v_14 + (v_15 * 7u)) + 2u) <= (v_13 / 4u)); m3.Store(v, (0u + (select(v_16, v_14, 0u) * 4u)), (select(v_16, v_15, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_u8_8x8 m4 = Matrix_right_u8_8x8::Load(in4, 0u, 64u, MatrixLayout::RowMajor); uint v_17 = 0u; v.GetDimensions(v_17); uint v_18 = asuint(int(0)); uint v_19 = asuint(int(16)); - bool v_20 = ((((v_18 + (v_19 * 7u)) * 4u) + 8u) <= ((v_17 / 4u) * 4u)); + bool v_20 = (((v_18 + (v_19 * 7u)) + 2u) <= (v_17 / 4u)); m4.Store(v, (0u + (select(v_20, v_18, 0u) * 4u)), (select(v_20, v_19, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_u8_8x8 m5 = Matrix_right_u8_8x8::Load(in5, 0u, 64u, MatrixLayout::RowMajor); uint v_21 = 0u; v.GetDimensions(v_21); uint v_22 = asuint(int(0)); uint v_23 = asuint(int(16)); - bool v_24 = ((((v_22 + (v_23 * 7u)) * 4u) + 8u) <= ((v_21 / 4u) * 4u)); + bool v_24 = (((v_22 + (v_23 * 7u)) + 2u) <= (v_21 / 4u)); m5.Store(v, (0u + (select(v_24, v_22, 0u) * 4u)), (select(v_24, v_23, 2u) * 4u), MatrixLayout::ColMajor); Matrix_right_u8_8x8 m6 = Matrix_right_u8_8x8::Load(in6, 0u, 64u, MatrixLayout::RowMajor); uint v_25 = 0u; v.GetDimensions(v_25); uint v_26 = asuint(int(0)); uint v_27 = asuint(int(16)); - bool v_28 = ((((v_26 + (v_27 * 7u)) * 4u) + 8u) <= ((v_25 / 4u) * 4u)); + bool v_28 = (((v_26 + (v_27 * 7u)) + 2u) <= (v_25 / 4u)); m6.Store(v, (0u + (select(v_28, v_26, 0u) * 4u)), (select(v_28, v_27, 2u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_row_major.wgsl.expected.spvasm index 089e368..456f31b 100644 --- a/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/storage_right_u8_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 202 +; Bound: 187 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -140,12 +140,11 @@ %53 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__arr_v2int_uint_1024 = OpTypePointer StorageBuffer %_arr_v2int_uint_1024 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -166,126 +165,112 @@ %m0 = OpCooperativeMatrixLoadKHR %53 %50 %uint_0 %uint_16 None %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 %61 = OpArrayLength %uint %39 0 - %62 = OpIMul %uint %61 %uint_4 - %64 = OpBitcast %uint %int_0 - %66 = OpBitcast %uint %int_16 - %68 = OpIMul %uint %66 %uint_7 - %70 = OpIAdd %uint %64 %68 - %71 = OpIMul %uint %70 %uint_4 - %72 = OpIAdd %uint %71 %uint_8 - %73 = OpULessThanEqual %bool %72 %62 - %75 = OpSelect %uint %73 %64 %uint_0 - %76 = OpSelect %uint %73 %66 %uint_2 - %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %79 = OpAccessChain %_ptr_StorageBuffer_uint_0 %78 %75 - OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %76 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %82 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %53 %84 %uint_0 %uint_16 None - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %88 = OpArrayLength %uint %39 0 - %89 = OpIMul %uint %88 %uint_4 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_2 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint_0 %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v3float %102 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %53 %104 %uint_0 %uint_16 None - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %108 = OpArrayLength %uint %39 0 - %109 = OpIMul %uint %108 %uint_4 - %110 = OpBitcast %uint %int_0 - %111 = OpBitcast %uint %int_16 - %112 = OpIMul %uint %111 %uint_7 - %113 = OpIAdd %uint %110 %112 - %114 = OpIMul %uint %113 %uint_4 - %115 = OpIAdd %uint %114 %uint_8 - %116 = OpULessThanEqual %bool %115 %109 - %117 = OpSelect %uint %116 %110 %uint_0 - %118 = OpSelect %uint %116 %111 %uint_2 - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %120 = OpAccessChain %_ptr_StorageBuffer_uint_0 %119 %117 - OpCooperativeMatrixStoreKHR %120 %m2 %uint_1 %118 NonPrivatePointer - %122 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 - %124 = OpAccessChain %_ptr_StorageBuffer_v4uint %122 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %53 %124 %uint_0 %uint_16 None - %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %128 = OpArrayLength %uint %39 0 - %129 = OpIMul %uint %128 %uint_4 - %130 = OpBitcast %uint %int_0 - %131 = OpBitcast %uint %int_16 - %132 = OpIMul %uint %131 %uint_7 - %133 = OpIAdd %uint %130 %132 - %134 = OpIMul %uint %133 %uint_4 - %135 = OpIAdd %uint %134 %uint_8 - %136 = OpULessThanEqual %bool %135 %129 - %137 = OpSelect %uint %136 %130 %uint_0 - %138 = OpSelect %uint %136 %131 %uint_2 - %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %140 = OpAccessChain %_ptr_StorageBuffer_uint_0 %139 %137 - OpCooperativeMatrixStoreKHR %140 %m3 %uint_1 %138 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 - %144 = OpAccessChain %_ptr_StorageBuffer_half %142 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %53 %144 %uint_0 %uint_16 None - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %148 = OpArrayLength %uint %39 0 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpBitcast %uint %int_0 - %151 = OpBitcast %uint %int_16 - %152 = OpIMul %uint %151 %uint_7 - %153 = OpIAdd %uint %150 %152 - %154 = OpIMul %uint %153 %uint_4 - %155 = OpIAdd %uint %154 %uint_8 - %156 = OpULessThanEqual %bool %155 %149 - %157 = OpSelect %uint %156 %150 %uint_0 - %158 = OpSelect %uint %156 %151 %uint_2 - %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %160 = OpAccessChain %_ptr_StorageBuffer_uint_0 %159 %157 - OpCooperativeMatrixStoreKHR %160 %m4 %uint_1 %158 NonPrivatePointer - %162 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v2half %162 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %53 %164 %uint_0 %uint_16 None - %167 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %168 = OpArrayLength %uint %39 0 - %169 = OpIMul %uint %168 %uint_4 - %170 = OpBitcast %uint %int_0 - %171 = OpBitcast %uint %int_16 - %172 = OpIMul %uint %171 %uint_7 - %173 = OpIAdd %uint %170 %172 - %174 = OpIMul %uint %173 %uint_4 - %175 = OpIAdd %uint %174 %uint_8 - %176 = OpULessThanEqual %bool %175 %169 - %177 = OpSelect %uint %176 %170 %uint_0 - %178 = OpSelect %uint %176 %171 %uint_2 - %179 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %180 = OpAccessChain %_ptr_StorageBuffer_uint_0 %179 %177 - OpCooperativeMatrixStoreKHR %180 %m5 %uint_1 %178 NonPrivatePointer - %182 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 - %184 = OpAccessChain %_ptr_StorageBuffer_v3half %182 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %53 %184 %uint_0 %uint_16 None - %187 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %188 = OpArrayLength %uint %39 0 - %189 = OpIMul %uint %188 %uint_4 - %190 = OpBitcast %uint %int_0 - %191 = OpBitcast %uint %int_16 - %192 = OpIMul %uint %191 %uint_7 - %193 = OpIAdd %uint %190 %192 - %194 = OpIMul %uint %193 %uint_4 - %195 = OpIAdd %uint %194 %uint_8 - %196 = OpULessThanEqual %bool %195 %189 - %197 = OpSelect %uint %196 %190 %uint_0 - %198 = OpSelect %uint %196 %191 %uint_2 - %199 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 - %200 = OpAccessChain %_ptr_StorageBuffer_uint_0 %199 %197 - OpCooperativeMatrixStoreKHR %200 %m6 %uint_1 %198 NonPrivatePointer + %62 = OpBitcast %uint %int_0 + %64 = OpBitcast %uint %int_16 + %66 = OpIMul %uint %64 %uint_7 + %68 = OpIAdd %uint %62 %66 + %69 = OpIAdd %uint %68 %uint_2 + %71 = OpULessThanEqual %bool %69 %61 + %73 = OpSelect %uint %71 %62 %uint_0 + %74 = OpSelect %uint %71 %64 %uint_2 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_uint_0 %75 %73 + OpCooperativeMatrixStoreKHR %76 %m0 %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__arr_v2int_uint_1024 %7 %uint_0 + %81 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %53 %81 %uint_0 %uint_16 None + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %85 = OpArrayLength %uint %39 0 + %86 = OpBitcast %uint %int_0 + %87 = OpBitcast %uint %int_16 + %88 = OpIMul %uint %87 %uint_7 + %89 = OpIAdd %uint %86 %88 + %90 = OpIAdd %uint %89 %uint_2 + %91 = OpULessThanEqual %bool %90 %85 + %92 = OpSelect %uint %91 %86 %uint_0 + %93 = OpSelect %uint %91 %87 %uint_2 + %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %95 = OpAccessChain %_ptr_StorageBuffer_uint_0 %94 %92 + OpCooperativeMatrixStoreKHR %95 %m1 %uint_1 %93 NonPrivatePointer + %97 = OpAccessChain %_ptr_StorageBuffer__arr_v3float_uint_1024 %13 %uint_0 + %99 = OpAccessChain %_ptr_StorageBuffer_v3float %97 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %53 %99 %uint_0 %uint_16 None + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %103 = OpArrayLength %uint %39 0 + %104 = OpBitcast %uint %int_0 + %105 = OpBitcast %uint %int_16 + %106 = OpIMul %uint %105 %uint_7 + %107 = OpIAdd %uint %104 %106 + %108 = OpIAdd %uint %107 %uint_2 + %109 = OpULessThanEqual %bool %108 %103 + %110 = OpSelect %uint %109 %104 %uint_0 + %111 = OpSelect %uint %109 %105 %uint_2 + %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %113 = OpAccessChain %_ptr_StorageBuffer_uint_0 %112 %110 + OpCooperativeMatrixStoreKHR %113 %m2 %uint_1 %111 NonPrivatePointer + %115 = OpAccessChain %_ptr_StorageBuffer__arr_v4uint_uint_1024 %19 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %53 %117 %uint_0 %uint_16 None + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %121 = OpArrayLength %uint %39 0 + %122 = OpBitcast %uint %int_0 + %123 = OpBitcast %uint %int_16 + %124 = OpIMul %uint %123 %uint_7 + %125 = OpIAdd %uint %122 %124 + %126 = OpIAdd %uint %125 %uint_2 + %127 = OpULessThanEqual %bool %126 %121 + %128 = OpSelect %uint %127 %122 %uint_0 + %129 = OpSelect %uint %127 %123 %uint_2 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_uint_0 %130 %128 + OpCooperativeMatrixStoreKHR %131 %m3 %uint_1 %129 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %24 %uint_0 + %135 = OpAccessChain %_ptr_StorageBuffer_half %133 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %53 %135 %uint_0 %uint_16 None + %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %139 = OpArrayLength %uint %39 0 + %140 = OpBitcast %uint %int_0 + %141 = OpBitcast %uint %int_16 + %142 = OpIMul %uint %141 %uint_7 + %143 = OpIAdd %uint %140 %142 + %144 = OpIAdd %uint %143 %uint_2 + %145 = OpULessThanEqual %bool %144 %139 + %146 = OpSelect %uint %145 %140 %uint_0 + %147 = OpSelect %uint %145 %141 %uint_2 + %148 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %149 = OpAccessChain %_ptr_StorageBuffer_uint_0 %148 %146 + OpCooperativeMatrixStoreKHR %149 %m4 %uint_1 %147 NonPrivatePointer + %151 = OpAccessChain %_ptr_StorageBuffer__arr_v2half_uint_1024 %29 %uint_0 + %153 = OpAccessChain %_ptr_StorageBuffer_v2half %151 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %53 %153 %uint_0 %uint_16 None + %156 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %157 = OpArrayLength %uint %39 0 + %158 = OpBitcast %uint %int_0 + %159 = OpBitcast %uint %int_16 + %160 = OpIMul %uint %159 %uint_7 + %161 = OpIAdd %uint %158 %160 + %162 = OpIAdd %uint %161 %uint_2 + %163 = OpULessThanEqual %bool %162 %157 + %164 = OpSelect %uint %163 %158 %uint_0 + %165 = OpSelect %uint %163 %159 %uint_2 + %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %167 = OpAccessChain %_ptr_StorageBuffer_uint_0 %166 %164 + OpCooperativeMatrixStoreKHR %167 %m5 %uint_1 %165 NonPrivatePointer + %169 = OpAccessChain %_ptr_StorageBuffer__arr_v3half_uint_1024 %34 %uint_0 + %171 = OpAccessChain %_ptr_StorageBuffer_v3half %169 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %53 %171 %uint_0 %uint_16 None + %174 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %175 = OpArrayLength %uint %39 0 + %176 = OpBitcast %uint %int_0 + %177 = OpBitcast %uint %int_16 + %178 = OpIMul %uint %177 %uint_7 + %179 = OpIAdd %uint %176 %178 + %180 = OpIAdd %uint %179 %uint_2 + %181 = OpULessThanEqual %bool %180 %175 + %182 = OpSelect %uint %181 %176 %uint_0 + %183 = OpSelect %uint %181 %177 %uint_2 + %184 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %39 %uint_0 + %185 = OpAccessChain %_ptr_StorageBuffer_uint_0 %184 %182 + OpCooperativeMatrixStoreKHR %185 %m6 %uint_1 %183 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_col_major.wgsl.expected.msl index caae71e..0ba060f 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_col_major.wgsl.expected.msl
@@ -75,49 +75,49 @@ simdgroup_half8x8 const m0 = v_3; uint const v_4 = as_type<uint>(0); uint const v_5 = as_type<uint>(16); - bool const v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_4, v_6) * 4u)), ulong((select(4u, v_5, v_6) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_7 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_7, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in1) + (0u * 8u)), ulong((16u * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m1 = v_7; uint const v_8 = as_type<uint>(0); uint const v_9 = as_type<uint>(16); - bool const v_10 = ((((v_8 + (v_9 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_10 = (((v_8 + (v_9 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_8, v_10) * 4u)), ulong((select(4u, v_9, v_10) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_11 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_11, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in2) + (0u * 16u)), ulong((16u * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m2 = v_11; uint const v_12 = as_type<uint>(0); uint const v_13 = as_type<uint>(16); - bool const v_14 = ((((v_12 + (v_13 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_14 = (((v_12 + (v_13 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_12, v_14) * 4u)), ulong((select(4u, v_13, v_14) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_15 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_15, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in3) + (0u * 16u)), ulong((16u * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m3 = v_15; uint const v_16 = as_type<uint>(0); uint const v_17 = as_type<uint>(16); - bool const v_18 = ((((v_16 + (v_17 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_18 = (((v_16 + (v_17 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_16, v_18) * 4u)), ulong((select(4u, v_17, v_18) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_19 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_19, (&(*tint_module_vars.in4)[0u]), ulong(16u), ulong2(0ul), true)); simdgroup_half8x8 const m4 = v_19; uint const v_20 = as_type<uint>(0); uint const v_21 = as_type<uint>(16); - bool const v_22 = ((((v_20 + (v_21 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_22 = (((v_20 + (v_21 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_20, v_22) * 4u)), ulong((select(4u, v_21, v_22) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_23 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_23, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in5) + (0u * 4u)), ulong((16u * 2u)), ulong2(0ul), true)); simdgroup_half8x8 const m5 = v_23; uint const v_24 = as_type<uint>(0); uint const v_25 = as_type<uint>(16); - bool const v_26 = ((((v_24 + (v_25 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_26 = (((v_24 + (v_25 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_24, v_26) * 4u)), ulong((select(4u, v_25, v_26) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_27 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_27, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in6) + (0u * 8u)), ulong((16u * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m6 = v_27; uint const v_28 = as_type<uint>(0); uint const v_29 = as_type<uint>(16); - bool const v_30 = ((((v_28 + (v_29 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_30 = (((v_28 + (v_29 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_28, v_30) * 4u)), ulong((select(4u, v_29, v_30) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_col_major.wgsl.expected.spvasm index 6f9377f..4eda621 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 214 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -92,8 +92,8 @@ %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_Workgroup_v2int = OpTypePointer Workgroup %v2int %_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float @@ -101,14 +101,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %197 = OpConstantNull %v2int - %199 = OpConstantNull %v3float - %201 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %205 = OpConstantNull %v2half - %207 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %210 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -120,26 +120,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %192 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %193 None - OpBranchConditional %192 %194 %193 - %194 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %193 = OpLabel - %195 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %195 %uint_0 NonPrivatePointer - %196 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %196 %197 NonPrivatePointer - %198 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %198 %199 NonPrivatePointer - %200 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %200 %201 NonPrivatePointer - %202 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %202 %half_0x0p_0 NonPrivatePointer - %204 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %204 %205 NonPrivatePointer - %206 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %206 %207 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -150,126 +150,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_1 %uint_16 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %64 = OpArrayLength %uint %32 0 - %65 = OpIMul %uint %64 %uint_2 - %66 = OpBitcast %uint %int_0 - %68 = OpBitcast %uint %int_16 - %70 = OpIMul %uint %68 %uint_7 - %72 = OpIAdd %uint %66 %70 - %73 = OpIMul %uint %72 %uint_2 - %74 = OpIAdd %uint %73 %uint_8 - %75 = OpULessThanEqual %bool %74 %65 - %77 = OpSelect %uint %75 %66 %uint_0 - %78 = OpSelect %uint %75 %68 %uint_4 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_uint %80 %77 - OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %78 NonPrivatePointer - %84 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %84 %uint_1 %uint_16 NonPrivatePointer - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %88 = OpArrayLength %uint %32 0 - %89 = OpIMul %uint %88 %uint_2 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_2 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_4 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %102 %uint_1 %uint_16 NonPrivatePointer - %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %106 = OpArrayLength %uint %32 0 - %107 = OpIMul %uint %106 %uint_2 - %108 = OpBitcast %uint %int_0 - %109 = OpBitcast %uint %int_16 - %110 = OpIMul %uint %109 %uint_7 - %111 = OpIAdd %uint %108 %110 - %112 = OpIMul %uint %111 %uint_2 - %113 = OpIAdd %uint %112 %uint_8 - %114 = OpULessThanEqual %bool %113 %107 - %115 = OpSelect %uint %114 %108 %uint_0 - %116 = OpSelect %uint %114 %109 %uint_4 + %65 = OpBitcast %uint %int_0 + %67 = OpBitcast %uint %int_16 + %69 = OpIMul %uint %67 %uint_7 + %71 = OpIAdd %uint %65 %69 + %72 = OpIAdd %uint %71 %uint_4 + %74 = OpULessThanEqual %bool %72 %64 + %76 = OpSelect %uint %74 %65 %uint_0 + %77 = OpSelect %uint %74 %67 %uint_4 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_uint %78 %76 + OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_1 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_4 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_4 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_1 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_4 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_4 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_1 %uint_16 NonPrivatePointer %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %118 = OpAccessChain %_ptr_StorageBuffer_uint %117 %115 - OpCooperativeMatrixStoreKHR %118 %m2 %uint_1 %116 NonPrivatePointer - %120 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %120 %uint_1 %uint_16 NonPrivatePointer - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %124 = OpArrayLength %uint %32 0 - %125 = OpIMul %uint %124 %uint_2 - %126 = OpBitcast %uint %int_0 - %127 = OpBitcast %uint %int_16 - %128 = OpIMul %uint %127 %uint_7 - %129 = OpIAdd %uint %126 %128 - %130 = OpIMul %uint %129 %uint_2 - %131 = OpIAdd %uint %130 %uint_8 - %132 = OpULessThanEqual %bool %131 %125 - %133 = OpSelect %uint %132 %126 %uint_0 - %134 = OpSelect %uint %132 %127 %uint_4 - %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %136 = OpAccessChain %_ptr_StorageBuffer_uint %135 %133 - OpCooperativeMatrixStoreKHR %136 %m3 %uint_1 %134 NonPrivatePointer - %138 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %138 %uint_1 %uint_16 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %142 = OpArrayLength %uint %32 0 - %143 = OpIMul %uint %142 %uint_2 - %144 = OpBitcast %uint %int_0 - %145 = OpBitcast %uint %int_16 - %146 = OpIMul %uint %145 %uint_7 - %147 = OpIAdd %uint %144 %146 - %148 = OpIMul %uint %147 %uint_2 - %149 = OpIAdd %uint %148 %uint_8 - %150 = OpULessThanEqual %bool %149 %143 - %151 = OpSelect %uint %150 %144 %uint_0 - %152 = OpSelect %uint %150 %145 %uint_4 - %153 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %154 = OpAccessChain %_ptr_StorageBuffer_uint %153 %151 - OpCooperativeMatrixStoreKHR %154 %m4 %uint_1 %152 NonPrivatePointer - %156 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %156 %uint_1 %uint_16 NonPrivatePointer + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_4 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_4 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_1 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_4 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_4 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_1 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_4 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_4 %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %160 = OpArrayLength %uint %32 0 - %161 = OpIMul %uint %160 %uint_2 - %162 = OpBitcast %uint %int_0 - %163 = OpBitcast %uint %int_16 - %164 = OpIMul %uint %163 %uint_7 - %165 = OpIAdd %uint %162 %164 - %166 = OpIMul %uint %165 %uint_2 - %167 = OpIAdd %uint %166 %uint_8 - %168 = OpULessThanEqual %bool %167 %161 - %169 = OpSelect %uint %168 %162 %uint_0 - %170 = OpSelect %uint %168 %163 %uint_4 - %171 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %172 = OpAccessChain %_ptr_StorageBuffer_uint %171 %169 - OpCooperativeMatrixStoreKHR %172 %m5 %uint_1 %170 NonPrivatePointer - %174 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %174 %uint_1 %uint_16 NonPrivatePointer - %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %178 = OpArrayLength %uint %32 0 - %179 = OpIMul %uint %178 %uint_2 - %180 = OpBitcast %uint %int_0 - %181 = OpBitcast %uint %int_16 - %182 = OpIMul %uint %181 %uint_7 - %183 = OpIAdd %uint %180 %182 - %184 = OpIMul %uint %183 %uint_2 - %185 = OpIAdd %uint %184 %uint_8 - %186 = OpULessThanEqual %bool %185 %179 - %187 = OpSelect %uint %186 %180 %uint_0 - %188 = OpSelect %uint %186 %181 %uint_4 - %189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %190 = OpAccessChain %_ptr_StorageBuffer_uint %189 %187 - OpCooperativeMatrixStoreKHR %190 %m6 %uint_1 %188 NonPrivatePointer + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_1 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_4 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_4 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %210 - %211 = OpLabel - %212 = OpLoad %uint %main_local_invocation_index_Input None - %213 = OpFunctionCall %void %main_inner %212 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_row_major.wgsl.expected.msl index 8f9102d..e3d2657 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_row_major.wgsl.expected.msl
@@ -75,49 +75,49 @@ simdgroup_half8x8 const m0 = v_3; uint const v_4 = as_type<uint>(0); uint const v_5 = as_type<uint>(16); - bool const v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_4, v_6) * 4u)), ulong((select(4u, v_5, v_6) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_7 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_7, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in1) + (0u * 8u)), ulong((16u * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m1 = v_7; uint const v_8 = as_type<uint>(0); uint const v_9 = as_type<uint>(16); - bool const v_10 = ((((v_8 + (v_9 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_10 = (((v_8 + (v_9 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_8, v_10) * 4u)), ulong((select(4u, v_9, v_10) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_11 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_11, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in2) + (0u * 16u)), ulong((16u * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m2 = v_11; uint const v_12 = as_type<uint>(0); uint const v_13 = as_type<uint>(16); - bool const v_14 = ((((v_12 + (v_13 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_14 = (((v_12 + (v_13 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_12, v_14) * 4u)), ulong((select(4u, v_13, v_14) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_15 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_15, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in3) + (0u * 16u)), ulong((16u * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m3 = v_15; uint const v_16 = as_type<uint>(0); uint const v_17 = as_type<uint>(16); - bool const v_18 = ((((v_16 + (v_17 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_18 = (((v_16 + (v_17 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_16, v_18) * 4u)), ulong((select(4u, v_17, v_18) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_19 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_19, (&(*tint_module_vars.in4)[0u]), ulong(16u), ulong2(0ul), false)); simdgroup_half8x8 const m4 = v_19; uint const v_20 = as_type<uint>(0); uint const v_21 = as_type<uint>(16); - bool const v_22 = ((((v_20 + (v_21 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_22 = (((v_20 + (v_21 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_20, v_22) * 4u)), ulong((select(4u, v_21, v_22) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_23 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_23, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in5) + (0u * 4u)), ulong((16u * 2u)), ulong2(0ul), false)); simdgroup_half8x8 const m5 = v_23; uint const v_24 = as_type<uint>(0); uint const v_25 = as_type<uint>(16); - bool const v_26 = ((((v_24 + (v_25 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_26 = (((v_24 + (v_25 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_24, v_26) * 4u)), ulong((select(4u, v_25, v_26) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_27 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_27, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in6) + (0u * 8u)), ulong((16u * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m6 = v_27; uint const v_28 = as_type<uint>(0); uint const v_29 = as_type<uint>(16); - bool const v_30 = ((((v_28 + (v_29 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_30 = (((v_28 + (v_29 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_28, v_30) * 4u)), ulong((select(4u, v_29, v_30) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_row_major.wgsl.expected.spvasm index adbd317..cc7e304 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_f16_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 214 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -91,8 +91,8 @@ %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_Workgroup_v2int = OpTypePointer Workgroup %v2int @@ -101,14 +101,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %197 = OpConstantNull %v2int - %199 = OpConstantNull %v3float - %201 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %205 = OpConstantNull %v2half - %207 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %210 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -120,26 +120,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %192 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %193 None - OpBranchConditional %192 %194 %193 - %194 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %193 = OpLabel - %195 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %195 %uint_0 NonPrivatePointer - %196 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %196 %197 NonPrivatePointer - %198 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %198 %199 NonPrivatePointer - %200 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %200 %201 NonPrivatePointer - %202 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %202 %half_0x0p_0 NonPrivatePointer - %204 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %204 %205 NonPrivatePointer - %206 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %206 %207 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -150,126 +150,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_0 %uint_16 NonPrivatePointer %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %63 = OpArrayLength %uint %32 0 - %64 = OpIMul %uint %63 %uint_2 - %65 = OpBitcast %uint %int_0 - %67 = OpBitcast %uint %int_16 - %69 = OpIMul %uint %67 %uint_7 - %71 = OpIAdd %uint %65 %69 - %72 = OpIMul %uint %71 %uint_2 - %73 = OpIAdd %uint %72 %uint_8 - %74 = OpULessThanEqual %bool %73 %64 - %76 = OpSelect %uint %74 %65 %uint_0 - %77 = OpSelect %uint %74 %67 %uint_4 - %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %80 = OpAccessChain %_ptr_StorageBuffer_uint %79 %76 - OpCooperativeMatrixStoreKHR %80 %m0 %uint_1 %77 NonPrivatePointer - %84 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %84 %uint_0 %uint_16 NonPrivatePointer - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %88 = OpArrayLength %uint %32 0 - %89 = OpIMul %uint %88 %uint_2 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_2 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_4 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %102 %uint_0 %uint_16 NonPrivatePointer - %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %106 = OpArrayLength %uint %32 0 - %107 = OpIMul %uint %106 %uint_2 - %108 = OpBitcast %uint %int_0 - %109 = OpBitcast %uint %int_16 - %110 = OpIMul %uint %109 %uint_7 - %111 = OpIAdd %uint %108 %110 - %112 = OpIMul %uint %111 %uint_2 - %113 = OpIAdd %uint %112 %uint_8 - %114 = OpULessThanEqual %bool %113 %107 - %115 = OpSelect %uint %114 %108 %uint_0 - %116 = OpSelect %uint %114 %109 %uint_4 + %64 = OpBitcast %uint %int_0 + %66 = OpBitcast %uint %int_16 + %68 = OpIMul %uint %66 %uint_7 + %70 = OpIAdd %uint %64 %68 + %71 = OpIAdd %uint %70 %uint_4 + %73 = OpULessThanEqual %bool %71 %63 + %75 = OpSelect %uint %73 %64 %uint_0 + %76 = OpSelect %uint %73 %66 %uint_4 + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %78 = OpAccessChain %_ptr_StorageBuffer_uint %77 %75 + OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %76 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_0 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_4 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_4 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_0 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_4 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_4 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_0 %uint_16 NonPrivatePointer %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %118 = OpAccessChain %_ptr_StorageBuffer_uint %117 %115 - OpCooperativeMatrixStoreKHR %118 %m2 %uint_1 %116 NonPrivatePointer - %120 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %120 %uint_0 %uint_16 NonPrivatePointer - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %124 = OpArrayLength %uint %32 0 - %125 = OpIMul %uint %124 %uint_2 - %126 = OpBitcast %uint %int_0 - %127 = OpBitcast %uint %int_16 - %128 = OpIMul %uint %127 %uint_7 - %129 = OpIAdd %uint %126 %128 - %130 = OpIMul %uint %129 %uint_2 - %131 = OpIAdd %uint %130 %uint_8 - %132 = OpULessThanEqual %bool %131 %125 - %133 = OpSelect %uint %132 %126 %uint_0 - %134 = OpSelect %uint %132 %127 %uint_4 - %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %136 = OpAccessChain %_ptr_StorageBuffer_uint %135 %133 - OpCooperativeMatrixStoreKHR %136 %m3 %uint_1 %134 NonPrivatePointer - %138 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %138 %uint_0 %uint_16 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %142 = OpArrayLength %uint %32 0 - %143 = OpIMul %uint %142 %uint_2 - %144 = OpBitcast %uint %int_0 - %145 = OpBitcast %uint %int_16 - %146 = OpIMul %uint %145 %uint_7 - %147 = OpIAdd %uint %144 %146 - %148 = OpIMul %uint %147 %uint_2 - %149 = OpIAdd %uint %148 %uint_8 - %150 = OpULessThanEqual %bool %149 %143 - %151 = OpSelect %uint %150 %144 %uint_0 - %152 = OpSelect %uint %150 %145 %uint_4 - %153 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %154 = OpAccessChain %_ptr_StorageBuffer_uint %153 %151 - OpCooperativeMatrixStoreKHR %154 %m4 %uint_1 %152 NonPrivatePointer - %156 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %156 %uint_0 %uint_16 NonPrivatePointer + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_4 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_4 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_0 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_4 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_4 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_0 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_4 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_4 %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %160 = OpArrayLength %uint %32 0 - %161 = OpIMul %uint %160 %uint_2 - %162 = OpBitcast %uint %int_0 - %163 = OpBitcast %uint %int_16 - %164 = OpIMul %uint %163 %uint_7 - %165 = OpIAdd %uint %162 %164 - %166 = OpIMul %uint %165 %uint_2 - %167 = OpIAdd %uint %166 %uint_8 - %168 = OpULessThanEqual %bool %167 %161 - %169 = OpSelect %uint %168 %162 %uint_0 - %170 = OpSelect %uint %168 %163 %uint_4 - %171 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %172 = OpAccessChain %_ptr_StorageBuffer_uint %171 %169 - OpCooperativeMatrixStoreKHR %172 %m5 %uint_1 %170 NonPrivatePointer - %174 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %174 %uint_0 %uint_16 NonPrivatePointer - %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %178 = OpArrayLength %uint %32 0 - %179 = OpIMul %uint %178 %uint_2 - %180 = OpBitcast %uint %int_0 - %181 = OpBitcast %uint %int_16 - %182 = OpIMul %uint %181 %uint_7 - %183 = OpIAdd %uint %180 %182 - %184 = OpIMul %uint %183 %uint_2 - %185 = OpIAdd %uint %184 %uint_8 - %186 = OpULessThanEqual %bool %185 %179 - %187 = OpSelect %uint %186 %180 %uint_0 - %188 = OpSelect %uint %186 %181 %uint_4 - %189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %190 = OpAccessChain %_ptr_StorageBuffer_uint %189 %187 - OpCooperativeMatrixStoreKHR %190 %m6 %uint_1 %188 NonPrivatePointer + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_0 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_4 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_4 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %210 - %211 = OpLabel - %212 = OpLoad %uint %main_local_invocation_index_Input None - %213 = OpFunctionCall %void %main_inner %212 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_i8_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_i8_sized_array_col_major.wgsl.expected.spvasm index ffa488f..2570609 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_i8_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_i8_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 215 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -91,7 +91,6 @@ %uint_1 = OpConstant %uint 1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -103,14 +102,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %198 = OpConstantNull %v2int - %200 = OpConstantNull %v3float - %202 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %206 = OpConstantNull %v2half - %208 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %211 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -122,26 +121,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %193 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %194 None - OpBranchConditional %193 %195 %194 - %195 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %194 = OpLabel - %196 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %196 %uint_0 NonPrivatePointer - %197 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %197 %198 NonPrivatePointer - %199 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %199 %200 NonPrivatePointer - %201 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %201 %202 NonPrivatePointer - %203 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %203 %half_0x0p_0 NonPrivatePointer - %205 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %205 %206 NonPrivatePointer - %207 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %207 %208 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -152,126 +151,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_1 %uint_16 NonPrivatePointer %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %65 = OpArrayLength %uint %32 0 - %66 = OpIMul %uint %65 %uint_4 - %68 = OpBitcast %uint %int_0 - %70 = OpBitcast %uint %int_16 - %72 = OpIMul %uint %70 %uint_7 - %74 = OpIAdd %uint %68 %72 - %75 = OpIMul %uint %74 %uint_4 - %76 = OpIAdd %uint %75 %uint_8 - %77 = OpULessThanEqual %bool %76 %66 - %79 = OpSelect %uint %77 %68 %uint_0 - %80 = OpSelect %uint %77 %70 %uint_2 - %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %82 = OpAccessChain %_ptr_StorageBuffer_uint %81 %79 - OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer - %85 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %85 %uint_1 %uint_16 NonPrivatePointer - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %89 = OpArrayLength %uint %32 0 - %90 = OpIMul %uint %89 %uint_4 - %91 = OpBitcast %uint %int_0 - %92 = OpBitcast %uint %int_16 - %93 = OpIMul %uint %92 %uint_7 - %94 = OpIAdd %uint %91 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %90 - %98 = OpSelect %uint %97 %91 %uint_0 - %99 = OpSelect %uint %97 %92 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_uint %100 %98 - OpCooperativeMatrixStoreKHR %101 %m1 %uint_1 %99 NonPrivatePointer - %103 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %103 %uint_1 %uint_16 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %107 = OpArrayLength %uint %32 0 - %108 = OpIMul %uint %107 %uint_4 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_4 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_2 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %121 %uint_1 %uint_16 NonPrivatePointer - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %125 = OpArrayLength %uint %32 0 - %126 = OpIMul %uint %125 %uint_4 - %127 = OpBitcast %uint %int_0 - %128 = OpBitcast %uint %int_16 - %129 = OpIMul %uint %128 %uint_7 - %130 = OpIAdd %uint %127 %129 - %131 = OpIMul %uint %130 %uint_4 - %132 = OpIAdd %uint %131 %uint_8 - %133 = OpULessThanEqual %bool %132 %126 - %134 = OpSelect %uint %133 %127 %uint_0 - %135 = OpSelect %uint %133 %128 %uint_2 - %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %137 = OpAccessChain %_ptr_StorageBuffer_uint %136 %134 - OpCooperativeMatrixStoreKHR %137 %m3 %uint_1 %135 NonPrivatePointer - %139 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %139 %uint_1 %uint_16 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %143 = OpArrayLength %uint %32 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpBitcast %uint %int_0 - %146 = OpBitcast %uint %int_16 - %147 = OpIMul %uint %146 %uint_7 - %148 = OpIAdd %uint %145 %147 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpIAdd %uint %149 %uint_8 - %151 = OpULessThanEqual %bool %150 %144 - %152 = OpSelect %uint %151 %145 %uint_0 - %153 = OpSelect %uint %151 %146 %uint_2 - %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %155 = OpAccessChain %_ptr_StorageBuffer_uint %154 %152 - OpCooperativeMatrixStoreKHR %155 %m4 %uint_1 %153 NonPrivatePointer - %157 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %157 %uint_1 %uint_16 NonPrivatePointer - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %161 = OpArrayLength %uint %32 0 - %162 = OpIMul %uint %161 %uint_4 - %163 = OpBitcast %uint %int_0 - %164 = OpBitcast %uint %int_16 - %165 = OpIMul %uint %164 %uint_7 - %166 = OpIAdd %uint %163 %165 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpIAdd %uint %167 %uint_8 - %169 = OpULessThanEqual %bool %168 %162 - %170 = OpSelect %uint %169 %163 %uint_0 - %171 = OpSelect %uint %169 %164 %uint_2 - %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %173 = OpAccessChain %_ptr_StorageBuffer_uint %172 %170 - OpCooperativeMatrixStoreKHR %173 %m5 %uint_1 %171 NonPrivatePointer - %175 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %175 %uint_1 %uint_16 NonPrivatePointer - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %179 = OpArrayLength %uint %32 0 - %180 = OpIMul %uint %179 %uint_4 - %181 = OpBitcast %uint %int_0 - %182 = OpBitcast %uint %int_16 - %183 = OpIMul %uint %182 %uint_7 - %184 = OpIAdd %uint %181 %183 - %185 = OpIMul %uint %184 %uint_4 - %186 = OpIAdd %uint %185 %uint_8 - %187 = OpULessThanEqual %bool %186 %180 - %188 = OpSelect %uint %187 %181 %uint_0 - %189 = OpSelect %uint %187 %182 %uint_2 - %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %191 = OpAccessChain %_ptr_StorageBuffer_uint %190 %188 - OpCooperativeMatrixStoreKHR %191 %m6 %uint_1 %189 NonPrivatePointer + %66 = OpBitcast %uint %int_0 + %68 = OpBitcast %uint %int_16 + %70 = OpIMul %uint %68 %uint_7 + %72 = OpIAdd %uint %66 %70 + %73 = OpIAdd %uint %72 %uint_2 + %74 = OpULessThanEqual %bool %73 %65 + %76 = OpSelect %uint %74 %66 %uint_0 + %77 = OpSelect %uint %74 %68 %uint_2 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_uint %78 %76 + OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_1 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_2 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_2 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_1 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_2 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_2 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_1 %uint_16 NonPrivatePointer + %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_2 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_2 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_1 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_2 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_2 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_1 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_2 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_2 + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_1 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_2 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_2 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %211 - %212 = OpLabel - %213 = OpLoad %uint %main_local_invocation_index_Input None - %214 = OpFunctionCall %void %main_inner %213 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_i8_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_i8_sized_array_row_major.wgsl.expected.spvasm index 14c9a84..41266e9 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_i8_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_i8_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 215 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -90,7 +90,6 @@ %57 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_0 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -103,14 +102,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %198 = OpConstantNull %v2int - %200 = OpConstantNull %v3float - %202 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %206 = OpConstantNull %v2half - %208 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %211 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -122,26 +121,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %193 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %194 None - OpBranchConditional %193 %195 %194 - %195 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %194 = OpLabel - %196 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %196 %uint_0 NonPrivatePointer - %197 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %197 %198 NonPrivatePointer - %199 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %199 %200 NonPrivatePointer - %201 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %201 %202 NonPrivatePointer - %203 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %203 %half_0x0p_0 NonPrivatePointer - %205 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %205 %206 NonPrivatePointer - %207 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %207 %208 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -152,126 +151,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_0 %uint_16 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %64 = OpArrayLength %uint %32 0 - %65 = OpIMul %uint %64 %uint_4 - %67 = OpBitcast %uint %int_0 - %69 = OpBitcast %uint %int_16 - %71 = OpIMul %uint %69 %uint_7 - %73 = OpIAdd %uint %67 %71 - %74 = OpIMul %uint %73 %uint_4 - %75 = OpIAdd %uint %74 %uint_8 - %76 = OpULessThanEqual %bool %75 %65 - %78 = OpSelect %uint %76 %67 %uint_0 - %79 = OpSelect %uint %76 %69 %uint_2 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_uint %80 %78 - OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %79 NonPrivatePointer - %85 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %85 %uint_0 %uint_16 NonPrivatePointer - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %89 = OpArrayLength %uint %32 0 - %90 = OpIMul %uint %89 %uint_4 - %91 = OpBitcast %uint %int_0 - %92 = OpBitcast %uint %int_16 - %93 = OpIMul %uint %92 %uint_7 - %94 = OpIAdd %uint %91 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %90 - %98 = OpSelect %uint %97 %91 %uint_0 - %99 = OpSelect %uint %97 %92 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_uint %100 %98 - OpCooperativeMatrixStoreKHR %101 %m1 %uint_1 %99 NonPrivatePointer - %103 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %103 %uint_0 %uint_16 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %107 = OpArrayLength %uint %32 0 - %108 = OpIMul %uint %107 %uint_4 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_4 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_2 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %121 %uint_0 %uint_16 NonPrivatePointer - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %125 = OpArrayLength %uint %32 0 - %126 = OpIMul %uint %125 %uint_4 - %127 = OpBitcast %uint %int_0 - %128 = OpBitcast %uint %int_16 - %129 = OpIMul %uint %128 %uint_7 - %130 = OpIAdd %uint %127 %129 - %131 = OpIMul %uint %130 %uint_4 - %132 = OpIAdd %uint %131 %uint_8 - %133 = OpULessThanEqual %bool %132 %126 - %134 = OpSelect %uint %133 %127 %uint_0 - %135 = OpSelect %uint %133 %128 %uint_2 - %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %137 = OpAccessChain %_ptr_StorageBuffer_uint %136 %134 - OpCooperativeMatrixStoreKHR %137 %m3 %uint_1 %135 NonPrivatePointer - %139 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %139 %uint_0 %uint_16 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %143 = OpArrayLength %uint %32 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpBitcast %uint %int_0 - %146 = OpBitcast %uint %int_16 - %147 = OpIMul %uint %146 %uint_7 - %148 = OpIAdd %uint %145 %147 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpIAdd %uint %149 %uint_8 - %151 = OpULessThanEqual %bool %150 %144 - %152 = OpSelect %uint %151 %145 %uint_0 - %153 = OpSelect %uint %151 %146 %uint_2 - %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %155 = OpAccessChain %_ptr_StorageBuffer_uint %154 %152 - OpCooperativeMatrixStoreKHR %155 %m4 %uint_1 %153 NonPrivatePointer - %157 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %157 %uint_0 %uint_16 NonPrivatePointer - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %161 = OpArrayLength %uint %32 0 - %162 = OpIMul %uint %161 %uint_4 - %163 = OpBitcast %uint %int_0 - %164 = OpBitcast %uint %int_16 - %165 = OpIMul %uint %164 %uint_7 - %166 = OpIAdd %uint %163 %165 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpIAdd %uint %167 %uint_8 - %169 = OpULessThanEqual %bool %168 %162 - %170 = OpSelect %uint %169 %163 %uint_0 - %171 = OpSelect %uint %169 %164 %uint_2 - %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %173 = OpAccessChain %_ptr_StorageBuffer_uint %172 %170 - OpCooperativeMatrixStoreKHR %173 %m5 %uint_1 %171 NonPrivatePointer - %175 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %175 %uint_0 %uint_16 NonPrivatePointer - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %179 = OpArrayLength %uint %32 0 - %180 = OpIMul %uint %179 %uint_4 - %181 = OpBitcast %uint %int_0 - %182 = OpBitcast %uint %int_16 - %183 = OpIMul %uint %182 %uint_7 - %184 = OpIAdd %uint %181 %183 - %185 = OpIMul %uint %184 %uint_4 - %186 = OpIAdd %uint %185 %uint_8 - %187 = OpULessThanEqual %bool %186 %180 - %188 = OpSelect %uint %187 %181 %uint_0 - %189 = OpSelect %uint %187 %182 %uint_2 - %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %191 = OpAccessChain %_ptr_StorageBuffer_uint %190 %188 - OpCooperativeMatrixStoreKHR %191 %m6 %uint_1 %189 NonPrivatePointer + %65 = OpBitcast %uint %int_0 + %67 = OpBitcast %uint %int_16 + %69 = OpIMul %uint %67 %uint_7 + %71 = OpIAdd %uint %65 %69 + %72 = OpIAdd %uint %71 %uint_2 + %73 = OpULessThanEqual %bool %72 %64 + %75 = OpSelect %uint %73 %65 %uint_0 + %76 = OpSelect %uint %73 %67 %uint_2 + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %78 = OpAccessChain %_ptr_StorageBuffer_uint %77 %75 + OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %76 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_0 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_2 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_2 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_0 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_2 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_2 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_0 %uint_16 NonPrivatePointer + %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_2 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_2 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_0 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_2 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_2 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_0 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_2 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_2 + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_0 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_2 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_2 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %211 - %212 = OpLabel - %213 = OpLoad %uint %main_local_invocation_index_Input None - %214 = OpFunctionCall %void %main_inner %213 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_u8_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_u8_sized_array_col_major.wgsl.expected.spvasm index 5a81f0f..11fb039 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_u8_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_u8_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 215 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -91,7 +91,6 @@ %uint_1 = OpConstant %uint 1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -103,14 +102,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %198 = OpConstantNull %v2int - %200 = OpConstantNull %v3float - %202 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %206 = OpConstantNull %v2half - %208 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %211 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -122,26 +121,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %193 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %194 None - OpBranchConditional %193 %195 %194 - %195 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %194 = OpLabel - %196 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %196 %uint_0 NonPrivatePointer - %197 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %197 %198 NonPrivatePointer - %199 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %199 %200 NonPrivatePointer - %201 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %201 %202 NonPrivatePointer - %203 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %203 %half_0x0p_0 NonPrivatePointer - %205 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %205 %206 NonPrivatePointer - %207 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %207 %208 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -152,126 +151,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_1 %uint_16 NonPrivatePointer %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %65 = OpArrayLength %uint %32 0 - %66 = OpIMul %uint %65 %uint_4 - %68 = OpBitcast %uint %int_0 - %70 = OpBitcast %uint %int_16 - %72 = OpIMul %uint %70 %uint_7 - %74 = OpIAdd %uint %68 %72 - %75 = OpIMul %uint %74 %uint_4 - %76 = OpIAdd %uint %75 %uint_8 - %77 = OpULessThanEqual %bool %76 %66 - %79 = OpSelect %uint %77 %68 %uint_0 - %80 = OpSelect %uint %77 %70 %uint_2 - %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %82 = OpAccessChain %_ptr_StorageBuffer_uint %81 %79 - OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer - %85 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %85 %uint_1 %uint_16 NonPrivatePointer - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %89 = OpArrayLength %uint %32 0 - %90 = OpIMul %uint %89 %uint_4 - %91 = OpBitcast %uint %int_0 - %92 = OpBitcast %uint %int_16 - %93 = OpIMul %uint %92 %uint_7 - %94 = OpIAdd %uint %91 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %90 - %98 = OpSelect %uint %97 %91 %uint_0 - %99 = OpSelect %uint %97 %92 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_uint %100 %98 - OpCooperativeMatrixStoreKHR %101 %m1 %uint_1 %99 NonPrivatePointer - %103 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %103 %uint_1 %uint_16 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %107 = OpArrayLength %uint %32 0 - %108 = OpIMul %uint %107 %uint_4 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_4 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_2 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %121 %uint_1 %uint_16 NonPrivatePointer - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %125 = OpArrayLength %uint %32 0 - %126 = OpIMul %uint %125 %uint_4 - %127 = OpBitcast %uint %int_0 - %128 = OpBitcast %uint %int_16 - %129 = OpIMul %uint %128 %uint_7 - %130 = OpIAdd %uint %127 %129 - %131 = OpIMul %uint %130 %uint_4 - %132 = OpIAdd %uint %131 %uint_8 - %133 = OpULessThanEqual %bool %132 %126 - %134 = OpSelect %uint %133 %127 %uint_0 - %135 = OpSelect %uint %133 %128 %uint_2 - %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %137 = OpAccessChain %_ptr_StorageBuffer_uint %136 %134 - OpCooperativeMatrixStoreKHR %137 %m3 %uint_1 %135 NonPrivatePointer - %139 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %139 %uint_1 %uint_16 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %143 = OpArrayLength %uint %32 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpBitcast %uint %int_0 - %146 = OpBitcast %uint %int_16 - %147 = OpIMul %uint %146 %uint_7 - %148 = OpIAdd %uint %145 %147 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpIAdd %uint %149 %uint_8 - %151 = OpULessThanEqual %bool %150 %144 - %152 = OpSelect %uint %151 %145 %uint_0 - %153 = OpSelect %uint %151 %146 %uint_2 - %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %155 = OpAccessChain %_ptr_StorageBuffer_uint %154 %152 - OpCooperativeMatrixStoreKHR %155 %m4 %uint_1 %153 NonPrivatePointer - %157 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %157 %uint_1 %uint_16 NonPrivatePointer - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %161 = OpArrayLength %uint %32 0 - %162 = OpIMul %uint %161 %uint_4 - %163 = OpBitcast %uint %int_0 - %164 = OpBitcast %uint %int_16 - %165 = OpIMul %uint %164 %uint_7 - %166 = OpIAdd %uint %163 %165 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpIAdd %uint %167 %uint_8 - %169 = OpULessThanEqual %bool %168 %162 - %170 = OpSelect %uint %169 %163 %uint_0 - %171 = OpSelect %uint %169 %164 %uint_2 - %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %173 = OpAccessChain %_ptr_StorageBuffer_uint %172 %170 - OpCooperativeMatrixStoreKHR %173 %m5 %uint_1 %171 NonPrivatePointer - %175 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %175 %uint_1 %uint_16 NonPrivatePointer - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %179 = OpArrayLength %uint %32 0 - %180 = OpIMul %uint %179 %uint_4 - %181 = OpBitcast %uint %int_0 - %182 = OpBitcast %uint %int_16 - %183 = OpIMul %uint %182 %uint_7 - %184 = OpIAdd %uint %181 %183 - %185 = OpIMul %uint %184 %uint_4 - %186 = OpIAdd %uint %185 %uint_8 - %187 = OpULessThanEqual %bool %186 %180 - %188 = OpSelect %uint %187 %181 %uint_0 - %189 = OpSelect %uint %187 %182 %uint_2 - %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %191 = OpAccessChain %_ptr_StorageBuffer_uint %190 %188 - OpCooperativeMatrixStoreKHR %191 %m6 %uint_1 %189 NonPrivatePointer + %66 = OpBitcast %uint %int_0 + %68 = OpBitcast %uint %int_16 + %70 = OpIMul %uint %68 %uint_7 + %72 = OpIAdd %uint %66 %70 + %73 = OpIAdd %uint %72 %uint_2 + %74 = OpULessThanEqual %bool %73 %65 + %76 = OpSelect %uint %74 %66 %uint_0 + %77 = OpSelect %uint %74 %68 %uint_2 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_uint %78 %76 + OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_1 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_2 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_2 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_1 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_2 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_2 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_1 %uint_16 NonPrivatePointer + %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_2 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_2 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_1 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_2 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_2 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_1 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_2 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_2 + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_1 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_2 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_2 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %211 - %212 = OpLabel - %213 = OpLoad %uint %main_local_invocation_index_Input None - %214 = OpFunctionCall %void %main_inner %213 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_u8_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_u8_sized_array_row_major.wgsl.expected.spvasm index 5f4f83e..909056e 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_left_u8_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_left_u8_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 215 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -90,7 +90,6 @@ %57 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_0 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -103,14 +102,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %198 = OpConstantNull %v2int - %200 = OpConstantNull %v3float - %202 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %206 = OpConstantNull %v2half - %208 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %211 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -122,26 +121,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %193 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %194 None - OpBranchConditional %193 %195 %194 - %195 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %194 = OpLabel - %196 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %196 %uint_0 NonPrivatePointer - %197 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %197 %198 NonPrivatePointer - %199 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %199 %200 NonPrivatePointer - %201 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %201 %202 NonPrivatePointer - %203 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %203 %half_0x0p_0 NonPrivatePointer - %205 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %205 %206 NonPrivatePointer - %207 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %207 %208 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -152,126 +151,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_0 %uint_16 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %64 = OpArrayLength %uint %32 0 - %65 = OpIMul %uint %64 %uint_4 - %67 = OpBitcast %uint %int_0 - %69 = OpBitcast %uint %int_16 - %71 = OpIMul %uint %69 %uint_7 - %73 = OpIAdd %uint %67 %71 - %74 = OpIMul %uint %73 %uint_4 - %75 = OpIAdd %uint %74 %uint_8 - %76 = OpULessThanEqual %bool %75 %65 - %78 = OpSelect %uint %76 %67 %uint_0 - %79 = OpSelect %uint %76 %69 %uint_2 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_uint %80 %78 - OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %79 NonPrivatePointer - %85 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %85 %uint_0 %uint_16 NonPrivatePointer - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %89 = OpArrayLength %uint %32 0 - %90 = OpIMul %uint %89 %uint_4 - %91 = OpBitcast %uint %int_0 - %92 = OpBitcast %uint %int_16 - %93 = OpIMul %uint %92 %uint_7 - %94 = OpIAdd %uint %91 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %90 - %98 = OpSelect %uint %97 %91 %uint_0 - %99 = OpSelect %uint %97 %92 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_uint %100 %98 - OpCooperativeMatrixStoreKHR %101 %m1 %uint_1 %99 NonPrivatePointer - %103 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %103 %uint_0 %uint_16 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %107 = OpArrayLength %uint %32 0 - %108 = OpIMul %uint %107 %uint_4 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_4 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_2 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %121 %uint_0 %uint_16 NonPrivatePointer - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %125 = OpArrayLength %uint %32 0 - %126 = OpIMul %uint %125 %uint_4 - %127 = OpBitcast %uint %int_0 - %128 = OpBitcast %uint %int_16 - %129 = OpIMul %uint %128 %uint_7 - %130 = OpIAdd %uint %127 %129 - %131 = OpIMul %uint %130 %uint_4 - %132 = OpIAdd %uint %131 %uint_8 - %133 = OpULessThanEqual %bool %132 %126 - %134 = OpSelect %uint %133 %127 %uint_0 - %135 = OpSelect %uint %133 %128 %uint_2 - %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %137 = OpAccessChain %_ptr_StorageBuffer_uint %136 %134 - OpCooperativeMatrixStoreKHR %137 %m3 %uint_1 %135 NonPrivatePointer - %139 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %139 %uint_0 %uint_16 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %143 = OpArrayLength %uint %32 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpBitcast %uint %int_0 - %146 = OpBitcast %uint %int_16 - %147 = OpIMul %uint %146 %uint_7 - %148 = OpIAdd %uint %145 %147 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpIAdd %uint %149 %uint_8 - %151 = OpULessThanEqual %bool %150 %144 - %152 = OpSelect %uint %151 %145 %uint_0 - %153 = OpSelect %uint %151 %146 %uint_2 - %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %155 = OpAccessChain %_ptr_StorageBuffer_uint %154 %152 - OpCooperativeMatrixStoreKHR %155 %m4 %uint_1 %153 NonPrivatePointer - %157 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %157 %uint_0 %uint_16 NonPrivatePointer - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %161 = OpArrayLength %uint %32 0 - %162 = OpIMul %uint %161 %uint_4 - %163 = OpBitcast %uint %int_0 - %164 = OpBitcast %uint %int_16 - %165 = OpIMul %uint %164 %uint_7 - %166 = OpIAdd %uint %163 %165 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpIAdd %uint %167 %uint_8 - %169 = OpULessThanEqual %bool %168 %162 - %170 = OpSelect %uint %169 %163 %uint_0 - %171 = OpSelect %uint %169 %164 %uint_2 - %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %173 = OpAccessChain %_ptr_StorageBuffer_uint %172 %170 - OpCooperativeMatrixStoreKHR %173 %m5 %uint_1 %171 NonPrivatePointer - %175 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %175 %uint_0 %uint_16 NonPrivatePointer - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %179 = OpArrayLength %uint %32 0 - %180 = OpIMul %uint %179 %uint_4 - %181 = OpBitcast %uint %int_0 - %182 = OpBitcast %uint %int_16 - %183 = OpIMul %uint %182 %uint_7 - %184 = OpIAdd %uint %181 %183 - %185 = OpIMul %uint %184 %uint_4 - %186 = OpIAdd %uint %185 %uint_8 - %187 = OpULessThanEqual %bool %186 %180 - %188 = OpSelect %uint %187 %181 %uint_0 - %189 = OpSelect %uint %187 %182 %uint_2 - %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %191 = OpAccessChain %_ptr_StorageBuffer_uint %190 %188 - OpCooperativeMatrixStoreKHR %191 %m6 %uint_1 %189 NonPrivatePointer + %65 = OpBitcast %uint %int_0 + %67 = OpBitcast %uint %int_16 + %69 = OpIMul %uint %67 %uint_7 + %71 = OpIAdd %uint %65 %69 + %72 = OpIAdd %uint %71 %uint_2 + %73 = OpULessThanEqual %bool %72 %64 + %75 = OpSelect %uint %73 %65 %uint_0 + %76 = OpSelect %uint %73 %67 %uint_2 + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %78 = OpAccessChain %_ptr_StorageBuffer_uint %77 %75 + OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %76 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_0 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_2 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_2 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_0 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_2 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_2 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_0 %uint_16 NonPrivatePointer + %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_2 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_2 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_0 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_2 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_2 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_0 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_2 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_2 + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_0 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_2 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_2 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %211 - %212 = OpLabel - %213 = OpLoad %uint %main_local_invocation_index_Input None - %214 = OpFunctionCall %void %main_inner %213 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_col_major.wgsl.expected.msl index caae71e..0ba060f 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_col_major.wgsl.expected.msl
@@ -75,49 +75,49 @@ simdgroup_half8x8 const m0 = v_3; uint const v_4 = as_type<uint>(0); uint const v_5 = as_type<uint>(16); - bool const v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_4, v_6) * 4u)), ulong((select(4u, v_5, v_6) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_7 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_7, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in1) + (0u * 8u)), ulong((16u * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m1 = v_7; uint const v_8 = as_type<uint>(0); uint const v_9 = as_type<uint>(16); - bool const v_10 = ((((v_8 + (v_9 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_10 = (((v_8 + (v_9 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_8, v_10) * 4u)), ulong((select(4u, v_9, v_10) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_11 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_11, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in2) + (0u * 16u)), ulong((16u * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m2 = v_11; uint const v_12 = as_type<uint>(0); uint const v_13 = as_type<uint>(16); - bool const v_14 = ((((v_12 + (v_13 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_14 = (((v_12 + (v_13 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_12, v_14) * 4u)), ulong((select(4u, v_13, v_14) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_15 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_15, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in3) + (0u * 16u)), ulong((16u * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m3 = v_15; uint const v_16 = as_type<uint>(0); uint const v_17 = as_type<uint>(16); - bool const v_18 = ((((v_16 + (v_17 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_18 = (((v_16 + (v_17 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_16, v_18) * 4u)), ulong((select(4u, v_17, v_18) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_19 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_19, (&(*tint_module_vars.in4)[0u]), ulong(16u), ulong2(0ul), true)); simdgroup_half8x8 const m4 = v_19; uint const v_20 = as_type<uint>(0); uint const v_21 = as_type<uint>(16); - bool const v_22 = ((((v_20 + (v_21 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_22 = (((v_20 + (v_21 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_20, v_22) * 4u)), ulong((select(4u, v_21, v_22) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_23 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_23, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in5) + (0u * 4u)), ulong((16u * 2u)), ulong2(0ul), true)); simdgroup_half8x8 const m5 = v_23; uint const v_24 = as_type<uint>(0); uint const v_25 = as_type<uint>(16); - bool const v_26 = ((((v_24 + (v_25 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_26 = (((v_24 + (v_25 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_24, v_26) * 4u)), ulong((select(4u, v_25, v_26) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_27 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_27, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in6) + (0u * 8u)), ulong((16u * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m6 = v_27; uint const v_28 = as_type<uint>(0); uint const v_29 = as_type<uint>(16); - bool const v_30 = ((((v_28 + (v_29 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_30 = (((v_28 + (v_29 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_28, v_30) * 4u)), ulong((select(4u, v_29, v_30) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_col_major.wgsl.expected.spvasm index e92a734..790309e 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 214 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -92,8 +92,8 @@ %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_Workgroup_v2int = OpTypePointer Workgroup %v2int %_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float @@ -101,14 +101,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %197 = OpConstantNull %v2int - %199 = OpConstantNull %v3float - %201 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %205 = OpConstantNull %v2half - %207 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %210 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -120,26 +120,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %192 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %193 None - OpBranchConditional %192 %194 %193 - %194 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %193 = OpLabel - %195 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %195 %uint_0 NonPrivatePointer - %196 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %196 %197 NonPrivatePointer - %198 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %198 %199 NonPrivatePointer - %200 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %200 %201 NonPrivatePointer - %202 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %202 %half_0x0p_0 NonPrivatePointer - %204 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %204 %205 NonPrivatePointer - %206 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %206 %207 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -150,126 +150,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_1 %uint_16 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %64 = OpArrayLength %uint %32 0 - %65 = OpIMul %uint %64 %uint_2 - %66 = OpBitcast %uint %int_0 - %68 = OpBitcast %uint %int_16 - %70 = OpIMul %uint %68 %uint_7 - %72 = OpIAdd %uint %66 %70 - %73 = OpIMul %uint %72 %uint_2 - %74 = OpIAdd %uint %73 %uint_8 - %75 = OpULessThanEqual %bool %74 %65 - %77 = OpSelect %uint %75 %66 %uint_0 - %78 = OpSelect %uint %75 %68 %uint_4 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_uint %80 %77 - OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %78 NonPrivatePointer - %84 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %84 %uint_1 %uint_16 NonPrivatePointer - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %88 = OpArrayLength %uint %32 0 - %89 = OpIMul %uint %88 %uint_2 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_2 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_4 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %102 %uint_1 %uint_16 NonPrivatePointer - %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %106 = OpArrayLength %uint %32 0 - %107 = OpIMul %uint %106 %uint_2 - %108 = OpBitcast %uint %int_0 - %109 = OpBitcast %uint %int_16 - %110 = OpIMul %uint %109 %uint_7 - %111 = OpIAdd %uint %108 %110 - %112 = OpIMul %uint %111 %uint_2 - %113 = OpIAdd %uint %112 %uint_8 - %114 = OpULessThanEqual %bool %113 %107 - %115 = OpSelect %uint %114 %108 %uint_0 - %116 = OpSelect %uint %114 %109 %uint_4 + %65 = OpBitcast %uint %int_0 + %67 = OpBitcast %uint %int_16 + %69 = OpIMul %uint %67 %uint_7 + %71 = OpIAdd %uint %65 %69 + %72 = OpIAdd %uint %71 %uint_4 + %74 = OpULessThanEqual %bool %72 %64 + %76 = OpSelect %uint %74 %65 %uint_0 + %77 = OpSelect %uint %74 %67 %uint_4 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_uint %78 %76 + OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_1 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_4 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_4 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_1 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_4 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_4 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_1 %uint_16 NonPrivatePointer %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %118 = OpAccessChain %_ptr_StorageBuffer_uint %117 %115 - OpCooperativeMatrixStoreKHR %118 %m2 %uint_1 %116 NonPrivatePointer - %120 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %120 %uint_1 %uint_16 NonPrivatePointer - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %124 = OpArrayLength %uint %32 0 - %125 = OpIMul %uint %124 %uint_2 - %126 = OpBitcast %uint %int_0 - %127 = OpBitcast %uint %int_16 - %128 = OpIMul %uint %127 %uint_7 - %129 = OpIAdd %uint %126 %128 - %130 = OpIMul %uint %129 %uint_2 - %131 = OpIAdd %uint %130 %uint_8 - %132 = OpULessThanEqual %bool %131 %125 - %133 = OpSelect %uint %132 %126 %uint_0 - %134 = OpSelect %uint %132 %127 %uint_4 - %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %136 = OpAccessChain %_ptr_StorageBuffer_uint %135 %133 - OpCooperativeMatrixStoreKHR %136 %m3 %uint_1 %134 NonPrivatePointer - %138 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %138 %uint_1 %uint_16 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %142 = OpArrayLength %uint %32 0 - %143 = OpIMul %uint %142 %uint_2 - %144 = OpBitcast %uint %int_0 - %145 = OpBitcast %uint %int_16 - %146 = OpIMul %uint %145 %uint_7 - %147 = OpIAdd %uint %144 %146 - %148 = OpIMul %uint %147 %uint_2 - %149 = OpIAdd %uint %148 %uint_8 - %150 = OpULessThanEqual %bool %149 %143 - %151 = OpSelect %uint %150 %144 %uint_0 - %152 = OpSelect %uint %150 %145 %uint_4 - %153 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %154 = OpAccessChain %_ptr_StorageBuffer_uint %153 %151 - OpCooperativeMatrixStoreKHR %154 %m4 %uint_1 %152 NonPrivatePointer - %156 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %156 %uint_1 %uint_16 NonPrivatePointer + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_4 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_4 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_1 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_4 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_4 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_1 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_4 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_4 %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %160 = OpArrayLength %uint %32 0 - %161 = OpIMul %uint %160 %uint_2 - %162 = OpBitcast %uint %int_0 - %163 = OpBitcast %uint %int_16 - %164 = OpIMul %uint %163 %uint_7 - %165 = OpIAdd %uint %162 %164 - %166 = OpIMul %uint %165 %uint_2 - %167 = OpIAdd %uint %166 %uint_8 - %168 = OpULessThanEqual %bool %167 %161 - %169 = OpSelect %uint %168 %162 %uint_0 - %170 = OpSelect %uint %168 %163 %uint_4 - %171 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %172 = OpAccessChain %_ptr_StorageBuffer_uint %171 %169 - OpCooperativeMatrixStoreKHR %172 %m5 %uint_1 %170 NonPrivatePointer - %174 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %174 %uint_1 %uint_16 NonPrivatePointer - %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %178 = OpArrayLength %uint %32 0 - %179 = OpIMul %uint %178 %uint_2 - %180 = OpBitcast %uint %int_0 - %181 = OpBitcast %uint %int_16 - %182 = OpIMul %uint %181 %uint_7 - %183 = OpIAdd %uint %180 %182 - %184 = OpIMul %uint %183 %uint_2 - %185 = OpIAdd %uint %184 %uint_8 - %186 = OpULessThanEqual %bool %185 %179 - %187 = OpSelect %uint %186 %180 %uint_0 - %188 = OpSelect %uint %186 %181 %uint_4 - %189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %190 = OpAccessChain %_ptr_StorageBuffer_uint %189 %187 - OpCooperativeMatrixStoreKHR %190 %m6 %uint_1 %188 NonPrivatePointer + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_1 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_4 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_4 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %210 - %211 = OpLabel - %212 = OpLoad %uint %main_local_invocation_index_Input None - %213 = OpFunctionCall %void %main_inner %212 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_row_major.wgsl.expected.msl index 8f9102d..e3d2657 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_row_major.wgsl.expected.msl
@@ -75,49 +75,49 @@ simdgroup_half8x8 const m0 = v_3; uint const v_4 = as_type<uint>(0); uint const v_5 = as_type<uint>(16); - bool const v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_4, v_6) * 4u)), ulong((select(4u, v_5, v_6) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_7 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_7, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in1) + (0u * 8u)), ulong((16u * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m1 = v_7; uint const v_8 = as_type<uint>(0); uint const v_9 = as_type<uint>(16); - bool const v_10 = ((((v_8 + (v_9 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_10 = (((v_8 + (v_9 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_8, v_10) * 4u)), ulong((select(4u, v_9, v_10) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_11 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_11, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in2) + (0u * 16u)), ulong((16u * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m2 = v_11; uint const v_12 = as_type<uint>(0); uint const v_13 = as_type<uint>(16); - bool const v_14 = ((((v_12 + (v_13 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_14 = (((v_12 + (v_13 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_12, v_14) * 4u)), ulong((select(4u, v_13, v_14) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_15 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_15, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in3) + (0u * 16u)), ulong((16u * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m3 = v_15; uint const v_16 = as_type<uint>(0); uint const v_17 = as_type<uint>(16); - bool const v_18 = ((((v_16 + (v_17 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_18 = (((v_16 + (v_17 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_16, v_18) * 4u)), ulong((select(4u, v_17, v_18) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_19 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_19, (&(*tint_module_vars.in4)[0u]), ulong(16u), ulong2(0ul), false)); simdgroup_half8x8 const m4 = v_19; uint const v_20 = as_type<uint>(0); uint const v_21 = as_type<uint>(16); - bool const v_22 = ((((v_20 + (v_21 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_22 = (((v_20 + (v_21 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_20, v_22) * 4u)), ulong((select(4u, v_21, v_22) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_23 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_23, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in5) + (0u * 4u)), ulong((16u * 2u)), ulong2(0ul), false)); simdgroup_half8x8 const m5 = v_23; uint const v_24 = as_type<uint>(0); uint const v_25 = as_type<uint>(16); - bool const v_26 = ((((v_24 + (v_25 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_26 = (((v_24 + (v_25 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_24, v_26) * 4u)), ulong((select(4u, v_25, v_26) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_27 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_27, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in6) + (0u * 8u)), ulong((16u * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m6 = v_27; uint const v_28 = as_type<uint>(0); uint const v_29 = as_type<uint>(16); - bool const v_30 = ((((v_28 + (v_29 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_30 = (((v_28 + (v_29 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_28, v_30) * 4u)), ulong((select(4u, v_29, v_30) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_row_major.wgsl.expected.spvasm index 80cf7df..f342740 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_f16_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 214 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -91,8 +91,8 @@ %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_Workgroup_v2int = OpTypePointer Workgroup %v2int @@ -101,14 +101,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %197 = OpConstantNull %v2int - %199 = OpConstantNull %v3float - %201 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %205 = OpConstantNull %v2half - %207 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %210 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -120,26 +120,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %192 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %193 None - OpBranchConditional %192 %194 %193 - %194 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %193 = OpLabel - %195 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %195 %uint_0 NonPrivatePointer - %196 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %196 %197 NonPrivatePointer - %198 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %198 %199 NonPrivatePointer - %200 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %200 %201 NonPrivatePointer - %202 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %202 %half_0x0p_0 NonPrivatePointer - %204 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %204 %205 NonPrivatePointer - %206 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %206 %207 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -150,126 +150,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_0 %uint_16 NonPrivatePointer %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %63 = OpArrayLength %uint %32 0 - %64 = OpIMul %uint %63 %uint_2 - %65 = OpBitcast %uint %int_0 - %67 = OpBitcast %uint %int_16 - %69 = OpIMul %uint %67 %uint_7 - %71 = OpIAdd %uint %65 %69 - %72 = OpIMul %uint %71 %uint_2 - %73 = OpIAdd %uint %72 %uint_8 - %74 = OpULessThanEqual %bool %73 %64 - %76 = OpSelect %uint %74 %65 %uint_0 - %77 = OpSelect %uint %74 %67 %uint_4 - %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %80 = OpAccessChain %_ptr_StorageBuffer_uint %79 %76 - OpCooperativeMatrixStoreKHR %80 %m0 %uint_1 %77 NonPrivatePointer - %84 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %84 %uint_0 %uint_16 NonPrivatePointer - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %88 = OpArrayLength %uint %32 0 - %89 = OpIMul %uint %88 %uint_2 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_2 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_4 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %102 %uint_0 %uint_16 NonPrivatePointer - %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %106 = OpArrayLength %uint %32 0 - %107 = OpIMul %uint %106 %uint_2 - %108 = OpBitcast %uint %int_0 - %109 = OpBitcast %uint %int_16 - %110 = OpIMul %uint %109 %uint_7 - %111 = OpIAdd %uint %108 %110 - %112 = OpIMul %uint %111 %uint_2 - %113 = OpIAdd %uint %112 %uint_8 - %114 = OpULessThanEqual %bool %113 %107 - %115 = OpSelect %uint %114 %108 %uint_0 - %116 = OpSelect %uint %114 %109 %uint_4 + %64 = OpBitcast %uint %int_0 + %66 = OpBitcast %uint %int_16 + %68 = OpIMul %uint %66 %uint_7 + %70 = OpIAdd %uint %64 %68 + %71 = OpIAdd %uint %70 %uint_4 + %73 = OpULessThanEqual %bool %71 %63 + %75 = OpSelect %uint %73 %64 %uint_0 + %76 = OpSelect %uint %73 %66 %uint_4 + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %78 = OpAccessChain %_ptr_StorageBuffer_uint %77 %75 + OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %76 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_0 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_4 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_4 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_0 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_4 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_4 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_0 %uint_16 NonPrivatePointer %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %118 = OpAccessChain %_ptr_StorageBuffer_uint %117 %115 - OpCooperativeMatrixStoreKHR %118 %m2 %uint_1 %116 NonPrivatePointer - %120 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %120 %uint_0 %uint_16 NonPrivatePointer - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %124 = OpArrayLength %uint %32 0 - %125 = OpIMul %uint %124 %uint_2 - %126 = OpBitcast %uint %int_0 - %127 = OpBitcast %uint %int_16 - %128 = OpIMul %uint %127 %uint_7 - %129 = OpIAdd %uint %126 %128 - %130 = OpIMul %uint %129 %uint_2 - %131 = OpIAdd %uint %130 %uint_8 - %132 = OpULessThanEqual %bool %131 %125 - %133 = OpSelect %uint %132 %126 %uint_0 - %134 = OpSelect %uint %132 %127 %uint_4 - %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %136 = OpAccessChain %_ptr_StorageBuffer_uint %135 %133 - OpCooperativeMatrixStoreKHR %136 %m3 %uint_1 %134 NonPrivatePointer - %138 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %138 %uint_0 %uint_16 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %142 = OpArrayLength %uint %32 0 - %143 = OpIMul %uint %142 %uint_2 - %144 = OpBitcast %uint %int_0 - %145 = OpBitcast %uint %int_16 - %146 = OpIMul %uint %145 %uint_7 - %147 = OpIAdd %uint %144 %146 - %148 = OpIMul %uint %147 %uint_2 - %149 = OpIAdd %uint %148 %uint_8 - %150 = OpULessThanEqual %bool %149 %143 - %151 = OpSelect %uint %150 %144 %uint_0 - %152 = OpSelect %uint %150 %145 %uint_4 - %153 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %154 = OpAccessChain %_ptr_StorageBuffer_uint %153 %151 - OpCooperativeMatrixStoreKHR %154 %m4 %uint_1 %152 NonPrivatePointer - %156 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %156 %uint_0 %uint_16 NonPrivatePointer + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_4 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_4 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_0 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_4 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_4 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_0 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_4 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_4 %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %160 = OpArrayLength %uint %32 0 - %161 = OpIMul %uint %160 %uint_2 - %162 = OpBitcast %uint %int_0 - %163 = OpBitcast %uint %int_16 - %164 = OpIMul %uint %163 %uint_7 - %165 = OpIAdd %uint %162 %164 - %166 = OpIMul %uint %165 %uint_2 - %167 = OpIAdd %uint %166 %uint_8 - %168 = OpULessThanEqual %bool %167 %161 - %169 = OpSelect %uint %168 %162 %uint_0 - %170 = OpSelect %uint %168 %163 %uint_4 - %171 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %172 = OpAccessChain %_ptr_StorageBuffer_uint %171 %169 - OpCooperativeMatrixStoreKHR %172 %m5 %uint_1 %170 NonPrivatePointer - %174 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %174 %uint_0 %uint_16 NonPrivatePointer - %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %178 = OpArrayLength %uint %32 0 - %179 = OpIMul %uint %178 %uint_2 - %180 = OpBitcast %uint %int_0 - %181 = OpBitcast %uint %int_16 - %182 = OpIMul %uint %181 %uint_7 - %183 = OpIAdd %uint %180 %182 - %184 = OpIMul %uint %183 %uint_2 - %185 = OpIAdd %uint %184 %uint_8 - %186 = OpULessThanEqual %bool %185 %179 - %187 = OpSelect %uint %186 %180 %uint_0 - %188 = OpSelect %uint %186 %181 %uint_4 - %189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %190 = OpAccessChain %_ptr_StorageBuffer_uint %189 %187 - OpCooperativeMatrixStoreKHR %190 %m6 %uint_1 %188 NonPrivatePointer + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_0 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_4 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_4 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %210 - %211 = OpLabel - %212 = OpLoad %uint %main_local_invocation_index_Input None - %213 = OpFunctionCall %void %main_inner %212 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_i8_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_i8_sized_array_col_major.wgsl.expected.spvasm index 9556517..25af7ab 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_i8_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_i8_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 215 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -91,7 +91,6 @@ %uint_1 = OpConstant %uint 1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -103,14 +102,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %198 = OpConstantNull %v2int - %200 = OpConstantNull %v3float - %202 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %206 = OpConstantNull %v2half - %208 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %211 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -122,26 +121,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %193 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %194 None - OpBranchConditional %193 %195 %194 - %195 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %194 = OpLabel - %196 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %196 %uint_0 NonPrivatePointer - %197 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %197 %198 NonPrivatePointer - %199 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %199 %200 NonPrivatePointer - %201 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %201 %202 NonPrivatePointer - %203 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %203 %half_0x0p_0 NonPrivatePointer - %205 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %205 %206 NonPrivatePointer - %207 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %207 %208 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -152,126 +151,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_1 %uint_16 NonPrivatePointer %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %65 = OpArrayLength %uint %32 0 - %66 = OpIMul %uint %65 %uint_4 - %68 = OpBitcast %uint %int_0 - %70 = OpBitcast %uint %int_16 - %72 = OpIMul %uint %70 %uint_7 - %74 = OpIAdd %uint %68 %72 - %75 = OpIMul %uint %74 %uint_4 - %76 = OpIAdd %uint %75 %uint_8 - %77 = OpULessThanEqual %bool %76 %66 - %79 = OpSelect %uint %77 %68 %uint_0 - %80 = OpSelect %uint %77 %70 %uint_2 - %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %82 = OpAccessChain %_ptr_StorageBuffer_uint %81 %79 - OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer - %85 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %85 %uint_1 %uint_16 NonPrivatePointer - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %89 = OpArrayLength %uint %32 0 - %90 = OpIMul %uint %89 %uint_4 - %91 = OpBitcast %uint %int_0 - %92 = OpBitcast %uint %int_16 - %93 = OpIMul %uint %92 %uint_7 - %94 = OpIAdd %uint %91 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %90 - %98 = OpSelect %uint %97 %91 %uint_0 - %99 = OpSelect %uint %97 %92 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_uint %100 %98 - OpCooperativeMatrixStoreKHR %101 %m1 %uint_1 %99 NonPrivatePointer - %103 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %103 %uint_1 %uint_16 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %107 = OpArrayLength %uint %32 0 - %108 = OpIMul %uint %107 %uint_4 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_4 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_2 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %121 %uint_1 %uint_16 NonPrivatePointer - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %125 = OpArrayLength %uint %32 0 - %126 = OpIMul %uint %125 %uint_4 - %127 = OpBitcast %uint %int_0 - %128 = OpBitcast %uint %int_16 - %129 = OpIMul %uint %128 %uint_7 - %130 = OpIAdd %uint %127 %129 - %131 = OpIMul %uint %130 %uint_4 - %132 = OpIAdd %uint %131 %uint_8 - %133 = OpULessThanEqual %bool %132 %126 - %134 = OpSelect %uint %133 %127 %uint_0 - %135 = OpSelect %uint %133 %128 %uint_2 - %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %137 = OpAccessChain %_ptr_StorageBuffer_uint %136 %134 - OpCooperativeMatrixStoreKHR %137 %m3 %uint_1 %135 NonPrivatePointer - %139 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %139 %uint_1 %uint_16 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %143 = OpArrayLength %uint %32 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpBitcast %uint %int_0 - %146 = OpBitcast %uint %int_16 - %147 = OpIMul %uint %146 %uint_7 - %148 = OpIAdd %uint %145 %147 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpIAdd %uint %149 %uint_8 - %151 = OpULessThanEqual %bool %150 %144 - %152 = OpSelect %uint %151 %145 %uint_0 - %153 = OpSelect %uint %151 %146 %uint_2 - %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %155 = OpAccessChain %_ptr_StorageBuffer_uint %154 %152 - OpCooperativeMatrixStoreKHR %155 %m4 %uint_1 %153 NonPrivatePointer - %157 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %157 %uint_1 %uint_16 NonPrivatePointer - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %161 = OpArrayLength %uint %32 0 - %162 = OpIMul %uint %161 %uint_4 - %163 = OpBitcast %uint %int_0 - %164 = OpBitcast %uint %int_16 - %165 = OpIMul %uint %164 %uint_7 - %166 = OpIAdd %uint %163 %165 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpIAdd %uint %167 %uint_8 - %169 = OpULessThanEqual %bool %168 %162 - %170 = OpSelect %uint %169 %163 %uint_0 - %171 = OpSelect %uint %169 %164 %uint_2 - %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %173 = OpAccessChain %_ptr_StorageBuffer_uint %172 %170 - OpCooperativeMatrixStoreKHR %173 %m5 %uint_1 %171 NonPrivatePointer - %175 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %175 %uint_1 %uint_16 NonPrivatePointer - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %179 = OpArrayLength %uint %32 0 - %180 = OpIMul %uint %179 %uint_4 - %181 = OpBitcast %uint %int_0 - %182 = OpBitcast %uint %int_16 - %183 = OpIMul %uint %182 %uint_7 - %184 = OpIAdd %uint %181 %183 - %185 = OpIMul %uint %184 %uint_4 - %186 = OpIAdd %uint %185 %uint_8 - %187 = OpULessThanEqual %bool %186 %180 - %188 = OpSelect %uint %187 %181 %uint_0 - %189 = OpSelect %uint %187 %182 %uint_2 - %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %191 = OpAccessChain %_ptr_StorageBuffer_uint %190 %188 - OpCooperativeMatrixStoreKHR %191 %m6 %uint_1 %189 NonPrivatePointer + %66 = OpBitcast %uint %int_0 + %68 = OpBitcast %uint %int_16 + %70 = OpIMul %uint %68 %uint_7 + %72 = OpIAdd %uint %66 %70 + %73 = OpIAdd %uint %72 %uint_2 + %74 = OpULessThanEqual %bool %73 %65 + %76 = OpSelect %uint %74 %66 %uint_0 + %77 = OpSelect %uint %74 %68 %uint_2 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_uint %78 %76 + OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_1 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_2 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_2 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_1 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_2 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_2 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_1 %uint_16 NonPrivatePointer + %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_2 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_2 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_1 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_2 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_2 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_1 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_2 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_2 + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_1 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_2 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_2 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %211 - %212 = OpLabel - %213 = OpLoad %uint %main_local_invocation_index_Input None - %214 = OpFunctionCall %void %main_inner %213 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_i8_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_i8_sized_array_row_major.wgsl.expected.spvasm index d15ee05..3532559 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_i8_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_i8_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 215 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -90,7 +90,6 @@ %57 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_2 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -103,14 +102,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %198 = OpConstantNull %v2int - %200 = OpConstantNull %v3float - %202 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %206 = OpConstantNull %v2half - %208 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %211 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -122,26 +121,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %193 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %194 None - OpBranchConditional %193 %195 %194 - %195 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %194 = OpLabel - %196 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %196 %uint_0 NonPrivatePointer - %197 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %197 %198 NonPrivatePointer - %199 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %199 %200 NonPrivatePointer - %201 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %201 %202 NonPrivatePointer - %203 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %203 %half_0x0p_0 NonPrivatePointer - %205 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %205 %206 NonPrivatePointer - %207 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %207 %208 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -152,126 +151,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_0 %uint_16 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %64 = OpArrayLength %uint %32 0 - %65 = OpIMul %uint %64 %uint_4 - %67 = OpBitcast %uint %int_0 - %69 = OpBitcast %uint %int_16 - %71 = OpIMul %uint %69 %uint_7 - %73 = OpIAdd %uint %67 %71 - %74 = OpIMul %uint %73 %uint_4 - %75 = OpIAdd %uint %74 %uint_8 - %76 = OpULessThanEqual %bool %75 %65 - %78 = OpSelect %uint %76 %67 %uint_0 - %79 = OpSelect %uint %76 %69 %uint_2 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_uint %80 %78 - OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %79 NonPrivatePointer - %85 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %85 %uint_0 %uint_16 NonPrivatePointer - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %89 = OpArrayLength %uint %32 0 - %90 = OpIMul %uint %89 %uint_4 - %91 = OpBitcast %uint %int_0 - %92 = OpBitcast %uint %int_16 - %93 = OpIMul %uint %92 %uint_7 - %94 = OpIAdd %uint %91 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %90 - %98 = OpSelect %uint %97 %91 %uint_0 - %99 = OpSelect %uint %97 %92 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_uint %100 %98 - OpCooperativeMatrixStoreKHR %101 %m1 %uint_1 %99 NonPrivatePointer - %103 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %103 %uint_0 %uint_16 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %107 = OpArrayLength %uint %32 0 - %108 = OpIMul %uint %107 %uint_4 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_4 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_2 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %121 %uint_0 %uint_16 NonPrivatePointer - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %125 = OpArrayLength %uint %32 0 - %126 = OpIMul %uint %125 %uint_4 - %127 = OpBitcast %uint %int_0 - %128 = OpBitcast %uint %int_16 - %129 = OpIMul %uint %128 %uint_7 - %130 = OpIAdd %uint %127 %129 - %131 = OpIMul %uint %130 %uint_4 - %132 = OpIAdd %uint %131 %uint_8 - %133 = OpULessThanEqual %bool %132 %126 - %134 = OpSelect %uint %133 %127 %uint_0 - %135 = OpSelect %uint %133 %128 %uint_2 - %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %137 = OpAccessChain %_ptr_StorageBuffer_uint %136 %134 - OpCooperativeMatrixStoreKHR %137 %m3 %uint_1 %135 NonPrivatePointer - %139 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %139 %uint_0 %uint_16 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %143 = OpArrayLength %uint %32 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpBitcast %uint %int_0 - %146 = OpBitcast %uint %int_16 - %147 = OpIMul %uint %146 %uint_7 - %148 = OpIAdd %uint %145 %147 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpIAdd %uint %149 %uint_8 - %151 = OpULessThanEqual %bool %150 %144 - %152 = OpSelect %uint %151 %145 %uint_0 - %153 = OpSelect %uint %151 %146 %uint_2 - %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %155 = OpAccessChain %_ptr_StorageBuffer_uint %154 %152 - OpCooperativeMatrixStoreKHR %155 %m4 %uint_1 %153 NonPrivatePointer - %157 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %157 %uint_0 %uint_16 NonPrivatePointer - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %161 = OpArrayLength %uint %32 0 - %162 = OpIMul %uint %161 %uint_4 - %163 = OpBitcast %uint %int_0 - %164 = OpBitcast %uint %int_16 - %165 = OpIMul %uint %164 %uint_7 - %166 = OpIAdd %uint %163 %165 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpIAdd %uint %167 %uint_8 - %169 = OpULessThanEqual %bool %168 %162 - %170 = OpSelect %uint %169 %163 %uint_0 - %171 = OpSelect %uint %169 %164 %uint_2 - %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %173 = OpAccessChain %_ptr_StorageBuffer_uint %172 %170 - OpCooperativeMatrixStoreKHR %173 %m5 %uint_1 %171 NonPrivatePointer - %175 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %175 %uint_0 %uint_16 NonPrivatePointer - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %179 = OpArrayLength %uint %32 0 - %180 = OpIMul %uint %179 %uint_4 - %181 = OpBitcast %uint %int_0 - %182 = OpBitcast %uint %int_16 - %183 = OpIMul %uint %182 %uint_7 - %184 = OpIAdd %uint %181 %183 - %185 = OpIMul %uint %184 %uint_4 - %186 = OpIAdd %uint %185 %uint_8 - %187 = OpULessThanEqual %bool %186 %180 - %188 = OpSelect %uint %187 %181 %uint_0 - %189 = OpSelect %uint %187 %182 %uint_2 - %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %191 = OpAccessChain %_ptr_StorageBuffer_uint %190 %188 - OpCooperativeMatrixStoreKHR %191 %m6 %uint_1 %189 NonPrivatePointer + %65 = OpBitcast %uint %int_0 + %67 = OpBitcast %uint %int_16 + %69 = OpIMul %uint %67 %uint_7 + %71 = OpIAdd %uint %65 %69 + %72 = OpIAdd %uint %71 %uint_2 + %73 = OpULessThanEqual %bool %72 %64 + %75 = OpSelect %uint %73 %65 %uint_0 + %76 = OpSelect %uint %73 %67 %uint_2 + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %78 = OpAccessChain %_ptr_StorageBuffer_uint %77 %75 + OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %76 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_0 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_2 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_2 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_0 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_2 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_2 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_0 %uint_16 NonPrivatePointer + %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_2 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_2 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_0 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_2 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_2 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_0 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_2 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_2 + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_0 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_2 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_2 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %211 - %212 = OpLabel - %213 = OpLoad %uint %main_local_invocation_index_Input None - %214 = OpFunctionCall %void %main_inner %213 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_u8_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_u8_sized_array_col_major.wgsl.expected.spvasm index 117c786..9942e0a 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_u8_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_u8_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 215 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -91,7 +91,6 @@ %uint_1 = OpConstant %uint 1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -103,14 +102,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %198 = OpConstantNull %v2int - %200 = OpConstantNull %v3float - %202 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %206 = OpConstantNull %v2half - %208 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %211 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -122,26 +121,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %193 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %194 None - OpBranchConditional %193 %195 %194 - %195 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %194 = OpLabel - %196 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %196 %uint_0 NonPrivatePointer - %197 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %197 %198 NonPrivatePointer - %199 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %199 %200 NonPrivatePointer - %201 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %201 %202 NonPrivatePointer - %203 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %203 %half_0x0p_0 NonPrivatePointer - %205 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %205 %206 NonPrivatePointer - %207 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %207 %208 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -152,126 +151,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_1 %uint_16 NonPrivatePointer %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %65 = OpArrayLength %uint %32 0 - %66 = OpIMul %uint %65 %uint_4 - %68 = OpBitcast %uint %int_0 - %70 = OpBitcast %uint %int_16 - %72 = OpIMul %uint %70 %uint_7 - %74 = OpIAdd %uint %68 %72 - %75 = OpIMul %uint %74 %uint_4 - %76 = OpIAdd %uint %75 %uint_8 - %77 = OpULessThanEqual %bool %76 %66 - %79 = OpSelect %uint %77 %68 %uint_0 - %80 = OpSelect %uint %77 %70 %uint_2 - %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %82 = OpAccessChain %_ptr_StorageBuffer_uint %81 %79 - OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer - %85 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %85 %uint_1 %uint_16 NonPrivatePointer - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %89 = OpArrayLength %uint %32 0 - %90 = OpIMul %uint %89 %uint_4 - %91 = OpBitcast %uint %int_0 - %92 = OpBitcast %uint %int_16 - %93 = OpIMul %uint %92 %uint_7 - %94 = OpIAdd %uint %91 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %90 - %98 = OpSelect %uint %97 %91 %uint_0 - %99 = OpSelect %uint %97 %92 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_uint %100 %98 - OpCooperativeMatrixStoreKHR %101 %m1 %uint_1 %99 NonPrivatePointer - %103 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %103 %uint_1 %uint_16 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %107 = OpArrayLength %uint %32 0 - %108 = OpIMul %uint %107 %uint_4 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_4 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_2 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %121 %uint_1 %uint_16 NonPrivatePointer - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %125 = OpArrayLength %uint %32 0 - %126 = OpIMul %uint %125 %uint_4 - %127 = OpBitcast %uint %int_0 - %128 = OpBitcast %uint %int_16 - %129 = OpIMul %uint %128 %uint_7 - %130 = OpIAdd %uint %127 %129 - %131 = OpIMul %uint %130 %uint_4 - %132 = OpIAdd %uint %131 %uint_8 - %133 = OpULessThanEqual %bool %132 %126 - %134 = OpSelect %uint %133 %127 %uint_0 - %135 = OpSelect %uint %133 %128 %uint_2 - %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %137 = OpAccessChain %_ptr_StorageBuffer_uint %136 %134 - OpCooperativeMatrixStoreKHR %137 %m3 %uint_1 %135 NonPrivatePointer - %139 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %139 %uint_1 %uint_16 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %143 = OpArrayLength %uint %32 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpBitcast %uint %int_0 - %146 = OpBitcast %uint %int_16 - %147 = OpIMul %uint %146 %uint_7 - %148 = OpIAdd %uint %145 %147 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpIAdd %uint %149 %uint_8 - %151 = OpULessThanEqual %bool %150 %144 - %152 = OpSelect %uint %151 %145 %uint_0 - %153 = OpSelect %uint %151 %146 %uint_2 - %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %155 = OpAccessChain %_ptr_StorageBuffer_uint %154 %152 - OpCooperativeMatrixStoreKHR %155 %m4 %uint_1 %153 NonPrivatePointer - %157 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %157 %uint_1 %uint_16 NonPrivatePointer - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %161 = OpArrayLength %uint %32 0 - %162 = OpIMul %uint %161 %uint_4 - %163 = OpBitcast %uint %int_0 - %164 = OpBitcast %uint %int_16 - %165 = OpIMul %uint %164 %uint_7 - %166 = OpIAdd %uint %163 %165 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpIAdd %uint %167 %uint_8 - %169 = OpULessThanEqual %bool %168 %162 - %170 = OpSelect %uint %169 %163 %uint_0 - %171 = OpSelect %uint %169 %164 %uint_2 - %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %173 = OpAccessChain %_ptr_StorageBuffer_uint %172 %170 - OpCooperativeMatrixStoreKHR %173 %m5 %uint_1 %171 NonPrivatePointer - %175 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %175 %uint_1 %uint_16 NonPrivatePointer - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %179 = OpArrayLength %uint %32 0 - %180 = OpIMul %uint %179 %uint_4 - %181 = OpBitcast %uint %int_0 - %182 = OpBitcast %uint %int_16 - %183 = OpIMul %uint %182 %uint_7 - %184 = OpIAdd %uint %181 %183 - %185 = OpIMul %uint %184 %uint_4 - %186 = OpIAdd %uint %185 %uint_8 - %187 = OpULessThanEqual %bool %186 %180 - %188 = OpSelect %uint %187 %181 %uint_0 - %189 = OpSelect %uint %187 %182 %uint_2 - %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %191 = OpAccessChain %_ptr_StorageBuffer_uint %190 %188 - OpCooperativeMatrixStoreKHR %191 %m6 %uint_1 %189 NonPrivatePointer + %66 = OpBitcast %uint %int_0 + %68 = OpBitcast %uint %int_16 + %70 = OpIMul %uint %68 %uint_7 + %72 = OpIAdd %uint %66 %70 + %73 = OpIAdd %uint %72 %uint_2 + %74 = OpULessThanEqual %bool %73 %65 + %76 = OpSelect %uint %74 %66 %uint_0 + %77 = OpSelect %uint %74 %68 %uint_2 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_uint %78 %76 + OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_1 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_2 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_2 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_1 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_2 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_2 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_1 %uint_16 NonPrivatePointer + %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_2 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_2 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_1 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_2 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_2 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_1 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_2 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_2 + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_1 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_2 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_2 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %211 - %212 = OpLabel - %213 = OpLoad %uint %main_local_invocation_index_Input None - %214 = OpFunctionCall %void %main_inner %213 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_u8_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_u8_sized_array_row_major.wgsl.expected.spvasm index 127d7fd..1ce3d29 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_result_u8_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_result_u8_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 215 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -90,7 +90,6 @@ %57 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_2 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -103,14 +102,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %198 = OpConstantNull %v2int - %200 = OpConstantNull %v3float - %202 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %206 = OpConstantNull %v2half - %208 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %211 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -122,26 +121,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %193 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %194 None - OpBranchConditional %193 %195 %194 - %195 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %194 = OpLabel - %196 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %196 %uint_0 NonPrivatePointer - %197 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %197 %198 NonPrivatePointer - %199 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %199 %200 NonPrivatePointer - %201 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %201 %202 NonPrivatePointer - %203 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %203 %half_0x0p_0 NonPrivatePointer - %205 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %205 %206 NonPrivatePointer - %207 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %207 %208 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -152,126 +151,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_0 %uint_16 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %64 = OpArrayLength %uint %32 0 - %65 = OpIMul %uint %64 %uint_4 - %67 = OpBitcast %uint %int_0 - %69 = OpBitcast %uint %int_16 - %71 = OpIMul %uint %69 %uint_7 - %73 = OpIAdd %uint %67 %71 - %74 = OpIMul %uint %73 %uint_4 - %75 = OpIAdd %uint %74 %uint_8 - %76 = OpULessThanEqual %bool %75 %65 - %78 = OpSelect %uint %76 %67 %uint_0 - %79 = OpSelect %uint %76 %69 %uint_2 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_uint %80 %78 - OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %79 NonPrivatePointer - %85 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %85 %uint_0 %uint_16 NonPrivatePointer - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %89 = OpArrayLength %uint %32 0 - %90 = OpIMul %uint %89 %uint_4 - %91 = OpBitcast %uint %int_0 - %92 = OpBitcast %uint %int_16 - %93 = OpIMul %uint %92 %uint_7 - %94 = OpIAdd %uint %91 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %90 - %98 = OpSelect %uint %97 %91 %uint_0 - %99 = OpSelect %uint %97 %92 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_uint %100 %98 - OpCooperativeMatrixStoreKHR %101 %m1 %uint_1 %99 NonPrivatePointer - %103 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %103 %uint_0 %uint_16 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %107 = OpArrayLength %uint %32 0 - %108 = OpIMul %uint %107 %uint_4 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_4 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_2 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %121 %uint_0 %uint_16 NonPrivatePointer - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %125 = OpArrayLength %uint %32 0 - %126 = OpIMul %uint %125 %uint_4 - %127 = OpBitcast %uint %int_0 - %128 = OpBitcast %uint %int_16 - %129 = OpIMul %uint %128 %uint_7 - %130 = OpIAdd %uint %127 %129 - %131 = OpIMul %uint %130 %uint_4 - %132 = OpIAdd %uint %131 %uint_8 - %133 = OpULessThanEqual %bool %132 %126 - %134 = OpSelect %uint %133 %127 %uint_0 - %135 = OpSelect %uint %133 %128 %uint_2 - %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %137 = OpAccessChain %_ptr_StorageBuffer_uint %136 %134 - OpCooperativeMatrixStoreKHR %137 %m3 %uint_1 %135 NonPrivatePointer - %139 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %139 %uint_0 %uint_16 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %143 = OpArrayLength %uint %32 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpBitcast %uint %int_0 - %146 = OpBitcast %uint %int_16 - %147 = OpIMul %uint %146 %uint_7 - %148 = OpIAdd %uint %145 %147 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpIAdd %uint %149 %uint_8 - %151 = OpULessThanEqual %bool %150 %144 - %152 = OpSelect %uint %151 %145 %uint_0 - %153 = OpSelect %uint %151 %146 %uint_2 - %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %155 = OpAccessChain %_ptr_StorageBuffer_uint %154 %152 - OpCooperativeMatrixStoreKHR %155 %m4 %uint_1 %153 NonPrivatePointer - %157 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %157 %uint_0 %uint_16 NonPrivatePointer - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %161 = OpArrayLength %uint %32 0 - %162 = OpIMul %uint %161 %uint_4 - %163 = OpBitcast %uint %int_0 - %164 = OpBitcast %uint %int_16 - %165 = OpIMul %uint %164 %uint_7 - %166 = OpIAdd %uint %163 %165 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpIAdd %uint %167 %uint_8 - %169 = OpULessThanEqual %bool %168 %162 - %170 = OpSelect %uint %169 %163 %uint_0 - %171 = OpSelect %uint %169 %164 %uint_2 - %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %173 = OpAccessChain %_ptr_StorageBuffer_uint %172 %170 - OpCooperativeMatrixStoreKHR %173 %m5 %uint_1 %171 NonPrivatePointer - %175 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %175 %uint_0 %uint_16 NonPrivatePointer - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %179 = OpArrayLength %uint %32 0 - %180 = OpIMul %uint %179 %uint_4 - %181 = OpBitcast %uint %int_0 - %182 = OpBitcast %uint %int_16 - %183 = OpIMul %uint %182 %uint_7 - %184 = OpIAdd %uint %181 %183 - %185 = OpIMul %uint %184 %uint_4 - %186 = OpIAdd %uint %185 %uint_8 - %187 = OpULessThanEqual %bool %186 %180 - %188 = OpSelect %uint %187 %181 %uint_0 - %189 = OpSelect %uint %187 %182 %uint_2 - %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %191 = OpAccessChain %_ptr_StorageBuffer_uint %190 %188 - OpCooperativeMatrixStoreKHR %191 %m6 %uint_1 %189 NonPrivatePointer + %65 = OpBitcast %uint %int_0 + %67 = OpBitcast %uint %int_16 + %69 = OpIMul %uint %67 %uint_7 + %71 = OpIAdd %uint %65 %69 + %72 = OpIAdd %uint %71 %uint_2 + %73 = OpULessThanEqual %bool %72 %64 + %75 = OpSelect %uint %73 %65 %uint_0 + %76 = OpSelect %uint %73 %67 %uint_2 + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %78 = OpAccessChain %_ptr_StorageBuffer_uint %77 %75 + OpCooperativeMatrixStoreKHR %78 %m0 %uint_1 %76 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_0 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_2 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_2 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_0 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_2 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_2 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_0 %uint_16 NonPrivatePointer + %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_2 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_2 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_0 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_2 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_2 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_0 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_2 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_2 + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_0 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_2 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_2 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %211 - %212 = OpLabel - %213 = OpLoad %uint %main_local_invocation_index_Input None - %214 = OpFunctionCall %void %main_inner %213 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_col_major.wgsl.expected.msl index caae71e..0ba060f 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_col_major.wgsl.expected.msl
@@ -75,49 +75,49 @@ simdgroup_half8x8 const m0 = v_3; uint const v_4 = as_type<uint>(0); uint const v_5 = as_type<uint>(16); - bool const v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_4, v_6) * 4u)), ulong((select(4u, v_5, v_6) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_7 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_7, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in1) + (0u * 8u)), ulong((16u * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m1 = v_7; uint const v_8 = as_type<uint>(0); uint const v_9 = as_type<uint>(16); - bool const v_10 = ((((v_8 + (v_9 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_10 = (((v_8 + (v_9 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_8, v_10) * 4u)), ulong((select(4u, v_9, v_10) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_11 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_11, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in2) + (0u * 16u)), ulong((16u * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m2 = v_11; uint const v_12 = as_type<uint>(0); uint const v_13 = as_type<uint>(16); - bool const v_14 = ((((v_12 + (v_13 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_14 = (((v_12 + (v_13 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_12, v_14) * 4u)), ulong((select(4u, v_13, v_14) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_15 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_15, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in3) + (0u * 16u)), ulong((16u * 8u)), ulong2(0ul), true)); simdgroup_half8x8 const m3 = v_15; uint const v_16 = as_type<uint>(0); uint const v_17 = as_type<uint>(16); - bool const v_18 = ((((v_16 + (v_17 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_18 = (((v_16 + (v_17 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_16, v_18) * 4u)), ulong((select(4u, v_17, v_18) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_19 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_19, (&(*tint_module_vars.in4)[0u]), ulong(16u), ulong2(0ul), true)); simdgroup_half8x8 const m4 = v_19; uint const v_20 = as_type<uint>(0); uint const v_21 = as_type<uint>(16); - bool const v_22 = ((((v_20 + (v_21 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_22 = (((v_20 + (v_21 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_20, v_22) * 4u)), ulong((select(4u, v_21, v_22) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_23 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_23, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in5) + (0u * 4u)), ulong((16u * 2u)), ulong2(0ul), true)); simdgroup_half8x8 const m5 = v_23; uint const v_24 = as_type<uint>(0); uint const v_25 = as_type<uint>(16); - bool const v_26 = ((((v_24 + (v_25 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_26 = (((v_24 + (v_25 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_24, v_26) * 4u)), ulong((select(4u, v_25, v_26) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_27 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_27, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in6) + (0u * 8u)), ulong((16u * 4u)), ulong2(0ul), true)); simdgroup_half8x8 const m6 = v_27; uint const v_28 = as_type<uint>(0); uint const v_29 = as_type<uint>(16); - bool const v_30 = ((((v_28 + (v_29 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_30 = (((v_28 + (v_29 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_28, v_30) * 4u)), ulong((select(4u, v_29, v_30) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_col_major.wgsl.expected.spvasm index 9838da8..a6d942d 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 214 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -92,8 +92,8 @@ %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_Workgroup_v2int = OpTypePointer Workgroup %v2int %_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float @@ -101,14 +101,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %197 = OpConstantNull %v2int - %199 = OpConstantNull %v3float - %201 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %205 = OpConstantNull %v2half - %207 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %210 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -120,26 +120,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %192 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %193 None - OpBranchConditional %192 %194 %193 - %194 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %193 = OpLabel - %195 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %195 %uint_0 NonPrivatePointer - %196 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %196 %197 NonPrivatePointer - %198 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %198 %199 NonPrivatePointer - %200 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %200 %201 NonPrivatePointer - %202 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %202 %half_0x0p_0 NonPrivatePointer - %204 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %204 %205 NonPrivatePointer - %206 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %206 %207 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -150,126 +150,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_1 %uint_16 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %64 = OpArrayLength %uint %32 0 - %65 = OpIMul %uint %64 %uint_2 - %66 = OpBitcast %uint %int_0 - %68 = OpBitcast %uint %int_16 - %70 = OpIMul %uint %68 %uint_7 - %72 = OpIAdd %uint %66 %70 - %73 = OpIMul %uint %72 %uint_2 - %74 = OpIAdd %uint %73 %uint_8 - %75 = OpULessThanEqual %bool %74 %65 - %77 = OpSelect %uint %75 %66 %uint_0 - %78 = OpSelect %uint %75 %68 %uint_4 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_uint %80 %77 - OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %78 NonPrivatePointer - %84 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %84 %uint_1 %uint_16 NonPrivatePointer - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %88 = OpArrayLength %uint %32 0 - %89 = OpIMul %uint %88 %uint_2 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_2 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_4 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %102 %uint_1 %uint_16 NonPrivatePointer - %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %106 = OpArrayLength %uint %32 0 - %107 = OpIMul %uint %106 %uint_2 - %108 = OpBitcast %uint %int_0 - %109 = OpBitcast %uint %int_16 - %110 = OpIMul %uint %109 %uint_7 - %111 = OpIAdd %uint %108 %110 - %112 = OpIMul %uint %111 %uint_2 - %113 = OpIAdd %uint %112 %uint_8 - %114 = OpULessThanEqual %bool %113 %107 - %115 = OpSelect %uint %114 %108 %uint_0 - %116 = OpSelect %uint %114 %109 %uint_4 + %65 = OpBitcast %uint %int_0 + %67 = OpBitcast %uint %int_16 + %69 = OpIMul %uint %67 %uint_7 + %71 = OpIAdd %uint %65 %69 + %72 = OpIAdd %uint %71 %uint_4 + %74 = OpULessThanEqual %bool %72 %64 + %76 = OpSelect %uint %74 %65 %uint_0 + %77 = OpSelect %uint %74 %67 %uint_4 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_uint %78 %76 + OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_1 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_4 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_4 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_1 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_4 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_4 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_1 %uint_16 NonPrivatePointer %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %118 = OpAccessChain %_ptr_StorageBuffer_uint %117 %115 - OpCooperativeMatrixStoreKHR %118 %m2 %uint_1 %116 NonPrivatePointer - %120 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %120 %uint_1 %uint_16 NonPrivatePointer - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %124 = OpArrayLength %uint %32 0 - %125 = OpIMul %uint %124 %uint_2 - %126 = OpBitcast %uint %int_0 - %127 = OpBitcast %uint %int_16 - %128 = OpIMul %uint %127 %uint_7 - %129 = OpIAdd %uint %126 %128 - %130 = OpIMul %uint %129 %uint_2 - %131 = OpIAdd %uint %130 %uint_8 - %132 = OpULessThanEqual %bool %131 %125 - %133 = OpSelect %uint %132 %126 %uint_0 - %134 = OpSelect %uint %132 %127 %uint_4 - %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %136 = OpAccessChain %_ptr_StorageBuffer_uint %135 %133 - OpCooperativeMatrixStoreKHR %136 %m3 %uint_1 %134 NonPrivatePointer - %138 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %138 %uint_1 %uint_16 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %142 = OpArrayLength %uint %32 0 - %143 = OpIMul %uint %142 %uint_2 - %144 = OpBitcast %uint %int_0 - %145 = OpBitcast %uint %int_16 - %146 = OpIMul %uint %145 %uint_7 - %147 = OpIAdd %uint %144 %146 - %148 = OpIMul %uint %147 %uint_2 - %149 = OpIAdd %uint %148 %uint_8 - %150 = OpULessThanEqual %bool %149 %143 - %151 = OpSelect %uint %150 %144 %uint_0 - %152 = OpSelect %uint %150 %145 %uint_4 - %153 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %154 = OpAccessChain %_ptr_StorageBuffer_uint %153 %151 - OpCooperativeMatrixStoreKHR %154 %m4 %uint_1 %152 NonPrivatePointer - %156 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %156 %uint_1 %uint_16 NonPrivatePointer + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_4 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_4 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_1 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_4 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_4 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_1 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_4 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_4 %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %160 = OpArrayLength %uint %32 0 - %161 = OpIMul %uint %160 %uint_2 - %162 = OpBitcast %uint %int_0 - %163 = OpBitcast %uint %int_16 - %164 = OpIMul %uint %163 %uint_7 - %165 = OpIAdd %uint %162 %164 - %166 = OpIMul %uint %165 %uint_2 - %167 = OpIAdd %uint %166 %uint_8 - %168 = OpULessThanEqual %bool %167 %161 - %169 = OpSelect %uint %168 %162 %uint_0 - %170 = OpSelect %uint %168 %163 %uint_4 - %171 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %172 = OpAccessChain %_ptr_StorageBuffer_uint %171 %169 - OpCooperativeMatrixStoreKHR %172 %m5 %uint_1 %170 NonPrivatePointer - %174 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %174 %uint_1 %uint_16 NonPrivatePointer - %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %178 = OpArrayLength %uint %32 0 - %179 = OpIMul %uint %178 %uint_2 - %180 = OpBitcast %uint %int_0 - %181 = OpBitcast %uint %int_16 - %182 = OpIMul %uint %181 %uint_7 - %183 = OpIAdd %uint %180 %182 - %184 = OpIMul %uint %183 %uint_2 - %185 = OpIAdd %uint %184 %uint_8 - %186 = OpULessThanEqual %bool %185 %179 - %187 = OpSelect %uint %186 %180 %uint_0 - %188 = OpSelect %uint %186 %181 %uint_4 - %189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %190 = OpAccessChain %_ptr_StorageBuffer_uint %189 %187 - OpCooperativeMatrixStoreKHR %190 %m6 %uint_1 %188 NonPrivatePointer + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_1 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_4 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_4 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %210 - %211 = OpLabel - %212 = OpLoad %uint %main_local_invocation_index_Input None - %213 = OpFunctionCall %void %main_inner %212 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_row_major.wgsl.expected.msl index 8f9102d..e3d2657 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_row_major.wgsl.expected.msl
@@ -75,49 +75,49 @@ simdgroup_half8x8 const m0 = v_3; uint const v_4 = as_type<uint>(0); uint const v_5 = as_type<uint>(16); - bool const v_6 = ((((v_4 + (v_5 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_6 = (((v_4 + (v_5 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m0, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_4, v_6) * 4u)), ulong((select(4u, v_5, v_6) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_7 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_7, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in1) + (0u * 8u)), ulong((16u * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m1 = v_7; uint const v_8 = as_type<uint>(0); uint const v_9 = as_type<uint>(16); - bool const v_10 = ((((v_8 + (v_9 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_10 = (((v_8 + (v_9 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m1, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_8, v_10) * 4u)), ulong((select(4u, v_9, v_10) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_11 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_11, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in2) + (0u * 16u)), ulong((16u * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m2 = v_11; uint const v_12 = as_type<uint>(0); uint const v_13 = as_type<uint>(16); - bool const v_14 = ((((v_12 + (v_13 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_14 = (((v_12 + (v_13 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m2, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_12, v_14) * 4u)), ulong((select(4u, v_13, v_14) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_15 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_15, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in3) + (0u * 16u)), ulong((16u * 8u)), ulong2(0ul), false)); simdgroup_half8x8 const m3 = v_15; uint const v_16 = as_type<uint>(0); uint const v_17 = as_type<uint>(16); - bool const v_18 = ((((v_16 + (v_17 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_18 = (((v_16 + (v_17 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m3, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_16, v_18) * 4u)), ulong((select(4u, v_17, v_18) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_19 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_19, (&(*tint_module_vars.in4)[0u]), ulong(16u), ulong2(0ul), false)); simdgroup_half8x8 const m4 = v_19; uint const v_20 = as_type<uint>(0); uint const v_21 = as_type<uint>(16); - bool const v_22 = ((((v_20 + (v_21 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_22 = (((v_20 + (v_21 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m4, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_20, v_22) * 4u)), ulong((select(4u, v_21, v_22) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_23 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_23, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in5) + (0u * 4u)), ulong((16u * 2u)), ulong2(0ul), false)); simdgroup_half8x8 const m5 = v_23; uint const v_24 = as_type<uint>(0); uint const v_25 = as_type<uint>(16); - bool const v_26 = ((((v_24 + (v_25 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_26 = (((v_24 + (v_25 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m5, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_24, v_26) * 4u)), ulong((select(4u, v_25, v_26) * 2u)), ulong2(0ul), true)); simdgroup_half8x8 v_27 = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); (simdgroup_load(v_27, reinterpret_cast<threadgroup half*>(reinterpret_cast<threadgroup char*>(tint_module_vars.in6) + (0u * 8u)), ulong((16u * 4u)), ulong2(0ul), false)); simdgroup_half8x8 const m6 = v_27; uint const v_28 = as_type<uint>(0); uint const v_29 = as_type<uint>(16); - bool const v_30 = ((((v_28 + (v_29 * 7u)) * 2u) + 8u) <= (v_2.tint_array_length_0_0 * 2u)); + bool const v_30 = (((v_28 + (v_29 * 7u)) + 4u) <= v_2.tint_array_length_0_0); (simdgroup_store(m6, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out) + (select(0u, v_28, v_30) * 4u)), ulong((select(4u, v_29, v_30) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_row_major.wgsl.expected.spvasm index fd8947b..38b25ae 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_f16_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 214 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -92,8 +92,8 @@ %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_Workgroup_v2int = OpTypePointer Workgroup %v2int %_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float @@ -101,14 +101,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %197 = OpConstantNull %v2int - %199 = OpConstantNull %v3float - %201 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %205 = OpConstantNull %v2half - %207 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %210 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -120,26 +120,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %192 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %193 None - OpBranchConditional %192 %194 %193 - %194 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %193 = OpLabel - %195 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %195 %uint_0 NonPrivatePointer - %196 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %196 %197 NonPrivatePointer - %198 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %198 %199 NonPrivatePointer - %200 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %200 %201 NonPrivatePointer - %202 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %202 %half_0x0p_0 NonPrivatePointer - %204 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %204 %205 NonPrivatePointer - %206 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %206 %207 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -150,126 +150,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_0 %uint_16 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %64 = OpArrayLength %uint %32 0 - %65 = OpIMul %uint %64 %uint_2 - %66 = OpBitcast %uint %int_0 - %68 = OpBitcast %uint %int_16 - %70 = OpIMul %uint %68 %uint_7 - %72 = OpIAdd %uint %66 %70 - %73 = OpIMul %uint %72 %uint_2 - %74 = OpIAdd %uint %73 %uint_8 - %75 = OpULessThanEqual %bool %74 %65 - %77 = OpSelect %uint %75 %66 %uint_0 - %78 = OpSelect %uint %75 %68 %uint_4 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_uint %80 %77 - OpCooperativeMatrixStoreKHR %81 %m0 %uint_1 %78 NonPrivatePointer - %84 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %84 %uint_0 %uint_16 NonPrivatePointer - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %88 = OpArrayLength %uint %32 0 - %89 = OpIMul %uint %88 %uint_2 - %90 = OpBitcast %uint %int_0 - %91 = OpBitcast %uint %int_16 - %92 = OpIMul %uint %91 %uint_7 - %93 = OpIAdd %uint %90 %92 - %94 = OpIMul %uint %93 %uint_2 - %95 = OpIAdd %uint %94 %uint_8 - %96 = OpULessThanEqual %bool %95 %89 - %97 = OpSelect %uint %96 %90 %uint_0 - %98 = OpSelect %uint %96 %91 %uint_4 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_uint %99 %97 - OpCooperativeMatrixStoreKHR %100 %m1 %uint_1 %98 NonPrivatePointer - %102 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %102 %uint_0 %uint_16 NonPrivatePointer - %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %106 = OpArrayLength %uint %32 0 - %107 = OpIMul %uint %106 %uint_2 - %108 = OpBitcast %uint %int_0 - %109 = OpBitcast %uint %int_16 - %110 = OpIMul %uint %109 %uint_7 - %111 = OpIAdd %uint %108 %110 - %112 = OpIMul %uint %111 %uint_2 - %113 = OpIAdd %uint %112 %uint_8 - %114 = OpULessThanEqual %bool %113 %107 - %115 = OpSelect %uint %114 %108 %uint_0 - %116 = OpSelect %uint %114 %109 %uint_4 + %65 = OpBitcast %uint %int_0 + %67 = OpBitcast %uint %int_16 + %69 = OpIMul %uint %67 %uint_7 + %71 = OpIAdd %uint %65 %69 + %72 = OpIAdd %uint %71 %uint_4 + %74 = OpULessThanEqual %bool %72 %64 + %76 = OpSelect %uint %74 %65 %uint_0 + %77 = OpSelect %uint %74 %67 %uint_4 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_uint %78 %76 + OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_0 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_4 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_4 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_0 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_4 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_4 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_0 %uint_16 NonPrivatePointer %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %118 = OpAccessChain %_ptr_StorageBuffer_uint %117 %115 - OpCooperativeMatrixStoreKHR %118 %m2 %uint_1 %116 NonPrivatePointer - %120 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %120 %uint_0 %uint_16 NonPrivatePointer - %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %124 = OpArrayLength %uint %32 0 - %125 = OpIMul %uint %124 %uint_2 - %126 = OpBitcast %uint %int_0 - %127 = OpBitcast %uint %int_16 - %128 = OpIMul %uint %127 %uint_7 - %129 = OpIAdd %uint %126 %128 - %130 = OpIMul %uint %129 %uint_2 - %131 = OpIAdd %uint %130 %uint_8 - %132 = OpULessThanEqual %bool %131 %125 - %133 = OpSelect %uint %132 %126 %uint_0 - %134 = OpSelect %uint %132 %127 %uint_4 - %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %136 = OpAccessChain %_ptr_StorageBuffer_uint %135 %133 - OpCooperativeMatrixStoreKHR %136 %m3 %uint_1 %134 NonPrivatePointer - %138 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %138 %uint_0 %uint_16 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %142 = OpArrayLength %uint %32 0 - %143 = OpIMul %uint %142 %uint_2 - %144 = OpBitcast %uint %int_0 - %145 = OpBitcast %uint %int_16 - %146 = OpIMul %uint %145 %uint_7 - %147 = OpIAdd %uint %144 %146 - %148 = OpIMul %uint %147 %uint_2 - %149 = OpIAdd %uint %148 %uint_8 - %150 = OpULessThanEqual %bool %149 %143 - %151 = OpSelect %uint %150 %144 %uint_0 - %152 = OpSelect %uint %150 %145 %uint_4 - %153 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %154 = OpAccessChain %_ptr_StorageBuffer_uint %153 %151 - OpCooperativeMatrixStoreKHR %154 %m4 %uint_1 %152 NonPrivatePointer - %156 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %156 %uint_0 %uint_16 NonPrivatePointer + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_4 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_4 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_0 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_4 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_4 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_0 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_4 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_4 %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %160 = OpArrayLength %uint %32 0 - %161 = OpIMul %uint %160 %uint_2 - %162 = OpBitcast %uint %int_0 - %163 = OpBitcast %uint %int_16 - %164 = OpIMul %uint %163 %uint_7 - %165 = OpIAdd %uint %162 %164 - %166 = OpIMul %uint %165 %uint_2 - %167 = OpIAdd %uint %166 %uint_8 - %168 = OpULessThanEqual %bool %167 %161 - %169 = OpSelect %uint %168 %162 %uint_0 - %170 = OpSelect %uint %168 %163 %uint_4 - %171 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %172 = OpAccessChain %_ptr_StorageBuffer_uint %171 %169 - OpCooperativeMatrixStoreKHR %172 %m5 %uint_1 %170 NonPrivatePointer - %174 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %174 %uint_0 %uint_16 NonPrivatePointer - %177 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %178 = OpArrayLength %uint %32 0 - %179 = OpIMul %uint %178 %uint_2 - %180 = OpBitcast %uint %int_0 - %181 = OpBitcast %uint %int_16 - %182 = OpIMul %uint %181 %uint_7 - %183 = OpIAdd %uint %180 %182 - %184 = OpIMul %uint %183 %uint_2 - %185 = OpIAdd %uint %184 %uint_8 - %186 = OpULessThanEqual %bool %185 %179 - %187 = OpSelect %uint %186 %180 %uint_0 - %188 = OpSelect %uint %186 %181 %uint_4 - %189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %190 = OpAccessChain %_ptr_StorageBuffer_uint %189 %187 - OpCooperativeMatrixStoreKHR %190 %m6 %uint_1 %188 NonPrivatePointer + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_0 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_4 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_4 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %210 - %211 = OpLabel - %212 = OpLoad %uint %main_local_invocation_index_Input None - %213 = OpFunctionCall %void %main_inner %212 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_i8_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_i8_sized_array_col_major.wgsl.expected.spvasm index 2daf859..cb6ee3b 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_i8_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_i8_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 215 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -91,7 +91,6 @@ %57 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -103,14 +102,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %198 = OpConstantNull %v2int - %200 = OpConstantNull %v3float - %202 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %206 = OpConstantNull %v2half - %208 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %211 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -122,26 +121,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %193 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %194 None - OpBranchConditional %193 %195 %194 - %195 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %194 = OpLabel - %196 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %196 %uint_0 NonPrivatePointer - %197 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %197 %198 NonPrivatePointer - %199 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %199 %200 NonPrivatePointer - %201 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %201 %202 NonPrivatePointer - %203 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %203 %half_0x0p_0 NonPrivatePointer - %205 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %205 %206 NonPrivatePointer - %207 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %207 %208 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -152,126 +151,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_1 %uint_16 NonPrivatePointer %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %65 = OpArrayLength %uint %32 0 - %66 = OpIMul %uint %65 %uint_4 - %68 = OpBitcast %uint %int_0 - %70 = OpBitcast %uint %int_16 - %72 = OpIMul %uint %70 %uint_7 - %74 = OpIAdd %uint %68 %72 - %75 = OpIMul %uint %74 %uint_4 - %76 = OpIAdd %uint %75 %uint_8 - %77 = OpULessThanEqual %bool %76 %66 - %79 = OpSelect %uint %77 %68 %uint_0 - %80 = OpSelect %uint %77 %70 %uint_2 - %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %82 = OpAccessChain %_ptr_StorageBuffer_uint %81 %79 - OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer - %85 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %85 %uint_1 %uint_16 NonPrivatePointer - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %89 = OpArrayLength %uint %32 0 - %90 = OpIMul %uint %89 %uint_4 - %91 = OpBitcast %uint %int_0 - %92 = OpBitcast %uint %int_16 - %93 = OpIMul %uint %92 %uint_7 - %94 = OpIAdd %uint %91 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %90 - %98 = OpSelect %uint %97 %91 %uint_0 - %99 = OpSelect %uint %97 %92 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_uint %100 %98 - OpCooperativeMatrixStoreKHR %101 %m1 %uint_1 %99 NonPrivatePointer - %103 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %103 %uint_1 %uint_16 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %107 = OpArrayLength %uint %32 0 - %108 = OpIMul %uint %107 %uint_4 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_4 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_2 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %121 %uint_1 %uint_16 NonPrivatePointer - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %125 = OpArrayLength %uint %32 0 - %126 = OpIMul %uint %125 %uint_4 - %127 = OpBitcast %uint %int_0 - %128 = OpBitcast %uint %int_16 - %129 = OpIMul %uint %128 %uint_7 - %130 = OpIAdd %uint %127 %129 - %131 = OpIMul %uint %130 %uint_4 - %132 = OpIAdd %uint %131 %uint_8 - %133 = OpULessThanEqual %bool %132 %126 - %134 = OpSelect %uint %133 %127 %uint_0 - %135 = OpSelect %uint %133 %128 %uint_2 - %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %137 = OpAccessChain %_ptr_StorageBuffer_uint %136 %134 - OpCooperativeMatrixStoreKHR %137 %m3 %uint_1 %135 NonPrivatePointer - %139 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %139 %uint_1 %uint_16 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %143 = OpArrayLength %uint %32 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpBitcast %uint %int_0 - %146 = OpBitcast %uint %int_16 - %147 = OpIMul %uint %146 %uint_7 - %148 = OpIAdd %uint %145 %147 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpIAdd %uint %149 %uint_8 - %151 = OpULessThanEqual %bool %150 %144 - %152 = OpSelect %uint %151 %145 %uint_0 - %153 = OpSelect %uint %151 %146 %uint_2 - %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %155 = OpAccessChain %_ptr_StorageBuffer_uint %154 %152 - OpCooperativeMatrixStoreKHR %155 %m4 %uint_1 %153 NonPrivatePointer - %157 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %157 %uint_1 %uint_16 NonPrivatePointer - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %161 = OpArrayLength %uint %32 0 - %162 = OpIMul %uint %161 %uint_4 - %163 = OpBitcast %uint %int_0 - %164 = OpBitcast %uint %int_16 - %165 = OpIMul %uint %164 %uint_7 - %166 = OpIAdd %uint %163 %165 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpIAdd %uint %167 %uint_8 - %169 = OpULessThanEqual %bool %168 %162 - %170 = OpSelect %uint %169 %163 %uint_0 - %171 = OpSelect %uint %169 %164 %uint_2 - %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %173 = OpAccessChain %_ptr_StorageBuffer_uint %172 %170 - OpCooperativeMatrixStoreKHR %173 %m5 %uint_1 %171 NonPrivatePointer - %175 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %175 %uint_1 %uint_16 NonPrivatePointer - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %179 = OpArrayLength %uint %32 0 - %180 = OpIMul %uint %179 %uint_4 - %181 = OpBitcast %uint %int_0 - %182 = OpBitcast %uint %int_16 - %183 = OpIMul %uint %182 %uint_7 - %184 = OpIAdd %uint %181 %183 - %185 = OpIMul %uint %184 %uint_4 - %186 = OpIAdd %uint %185 %uint_8 - %187 = OpULessThanEqual %bool %186 %180 - %188 = OpSelect %uint %187 %181 %uint_0 - %189 = OpSelect %uint %187 %182 %uint_2 - %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %191 = OpAccessChain %_ptr_StorageBuffer_uint %190 %188 - OpCooperativeMatrixStoreKHR %191 %m6 %uint_1 %189 NonPrivatePointer + %66 = OpBitcast %uint %int_0 + %68 = OpBitcast %uint %int_16 + %70 = OpIMul %uint %68 %uint_7 + %72 = OpIAdd %uint %66 %70 + %73 = OpIAdd %uint %72 %uint_2 + %74 = OpULessThanEqual %bool %73 %65 + %76 = OpSelect %uint %74 %66 %uint_0 + %77 = OpSelect %uint %74 %68 %uint_2 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_uint %78 %76 + OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_1 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_2 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_2 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_1 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_2 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_2 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_1 %uint_16 NonPrivatePointer + %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_2 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_2 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_1 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_2 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_2 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_1 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_2 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_2 + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_1 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_2 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_2 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %211 - %212 = OpLabel - %213 = OpLoad %uint %main_local_invocation_index_Input None - %214 = OpFunctionCall %void %main_inner %213 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_i8_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_i8_sized_array_row_major.wgsl.expected.spvasm index 872b52c..157559b 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_i8_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_i8_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 215 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -91,7 +91,6 @@ %57 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -103,14 +102,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %198 = OpConstantNull %v2int - %200 = OpConstantNull %v3float - %202 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %206 = OpConstantNull %v2half - %208 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %211 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -122,26 +121,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %193 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %194 None - OpBranchConditional %193 %195 %194 - %195 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %194 = OpLabel - %196 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %196 %uint_0 NonPrivatePointer - %197 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %197 %198 NonPrivatePointer - %199 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %199 %200 NonPrivatePointer - %201 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %201 %202 NonPrivatePointer - %203 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %203 %half_0x0p_0 NonPrivatePointer - %205 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %205 %206 NonPrivatePointer - %207 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %207 %208 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -152,126 +151,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_0 %uint_16 NonPrivatePointer %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %65 = OpArrayLength %uint %32 0 - %66 = OpIMul %uint %65 %uint_4 - %68 = OpBitcast %uint %int_0 - %70 = OpBitcast %uint %int_16 - %72 = OpIMul %uint %70 %uint_7 - %74 = OpIAdd %uint %68 %72 - %75 = OpIMul %uint %74 %uint_4 - %76 = OpIAdd %uint %75 %uint_8 - %77 = OpULessThanEqual %bool %76 %66 - %79 = OpSelect %uint %77 %68 %uint_0 - %80 = OpSelect %uint %77 %70 %uint_2 - %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %82 = OpAccessChain %_ptr_StorageBuffer_uint %81 %79 - OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer - %85 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %85 %uint_0 %uint_16 NonPrivatePointer - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %89 = OpArrayLength %uint %32 0 - %90 = OpIMul %uint %89 %uint_4 - %91 = OpBitcast %uint %int_0 - %92 = OpBitcast %uint %int_16 - %93 = OpIMul %uint %92 %uint_7 - %94 = OpIAdd %uint %91 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %90 - %98 = OpSelect %uint %97 %91 %uint_0 - %99 = OpSelect %uint %97 %92 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_uint %100 %98 - OpCooperativeMatrixStoreKHR %101 %m1 %uint_1 %99 NonPrivatePointer - %103 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %103 %uint_0 %uint_16 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %107 = OpArrayLength %uint %32 0 - %108 = OpIMul %uint %107 %uint_4 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_4 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_2 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %121 %uint_0 %uint_16 NonPrivatePointer - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %125 = OpArrayLength %uint %32 0 - %126 = OpIMul %uint %125 %uint_4 - %127 = OpBitcast %uint %int_0 - %128 = OpBitcast %uint %int_16 - %129 = OpIMul %uint %128 %uint_7 - %130 = OpIAdd %uint %127 %129 - %131 = OpIMul %uint %130 %uint_4 - %132 = OpIAdd %uint %131 %uint_8 - %133 = OpULessThanEqual %bool %132 %126 - %134 = OpSelect %uint %133 %127 %uint_0 - %135 = OpSelect %uint %133 %128 %uint_2 - %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %137 = OpAccessChain %_ptr_StorageBuffer_uint %136 %134 - OpCooperativeMatrixStoreKHR %137 %m3 %uint_1 %135 NonPrivatePointer - %139 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %139 %uint_0 %uint_16 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %143 = OpArrayLength %uint %32 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpBitcast %uint %int_0 - %146 = OpBitcast %uint %int_16 - %147 = OpIMul %uint %146 %uint_7 - %148 = OpIAdd %uint %145 %147 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpIAdd %uint %149 %uint_8 - %151 = OpULessThanEqual %bool %150 %144 - %152 = OpSelect %uint %151 %145 %uint_0 - %153 = OpSelect %uint %151 %146 %uint_2 - %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %155 = OpAccessChain %_ptr_StorageBuffer_uint %154 %152 - OpCooperativeMatrixStoreKHR %155 %m4 %uint_1 %153 NonPrivatePointer - %157 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %157 %uint_0 %uint_16 NonPrivatePointer - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %161 = OpArrayLength %uint %32 0 - %162 = OpIMul %uint %161 %uint_4 - %163 = OpBitcast %uint %int_0 - %164 = OpBitcast %uint %int_16 - %165 = OpIMul %uint %164 %uint_7 - %166 = OpIAdd %uint %163 %165 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpIAdd %uint %167 %uint_8 - %169 = OpULessThanEqual %bool %168 %162 - %170 = OpSelect %uint %169 %163 %uint_0 - %171 = OpSelect %uint %169 %164 %uint_2 - %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %173 = OpAccessChain %_ptr_StorageBuffer_uint %172 %170 - OpCooperativeMatrixStoreKHR %173 %m5 %uint_1 %171 NonPrivatePointer - %175 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %175 %uint_0 %uint_16 NonPrivatePointer - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %179 = OpArrayLength %uint %32 0 - %180 = OpIMul %uint %179 %uint_4 - %181 = OpBitcast %uint %int_0 - %182 = OpBitcast %uint %int_16 - %183 = OpIMul %uint %182 %uint_7 - %184 = OpIAdd %uint %181 %183 - %185 = OpIMul %uint %184 %uint_4 - %186 = OpIAdd %uint %185 %uint_8 - %187 = OpULessThanEqual %bool %186 %180 - %188 = OpSelect %uint %187 %181 %uint_0 - %189 = OpSelect %uint %187 %182 %uint_2 - %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %191 = OpAccessChain %_ptr_StorageBuffer_uint %190 %188 - OpCooperativeMatrixStoreKHR %191 %m6 %uint_1 %189 NonPrivatePointer + %66 = OpBitcast %uint %int_0 + %68 = OpBitcast %uint %int_16 + %70 = OpIMul %uint %68 %uint_7 + %72 = OpIAdd %uint %66 %70 + %73 = OpIAdd %uint %72 %uint_2 + %74 = OpULessThanEqual %bool %73 %65 + %76 = OpSelect %uint %74 %66 %uint_0 + %77 = OpSelect %uint %74 %68 %uint_2 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_uint %78 %76 + OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_0 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_2 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_2 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_0 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_2 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_2 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_0 %uint_16 NonPrivatePointer + %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_2 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_2 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_0 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_2 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_2 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_0 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_2 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_2 + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_0 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_2 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_2 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %211 - %212 = OpLabel - %213 = OpLoad %uint %main_local_invocation_index_Input None - %214 = OpFunctionCall %void %main_inner %213 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_u8_sized_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_u8_sized_array_col_major.wgsl.expected.spvasm index 040c698..286323e 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_u8_sized_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_u8_sized_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 215 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -91,7 +91,6 @@ %57 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -103,14 +102,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %198 = OpConstantNull %v2int - %200 = OpConstantNull %v3float - %202 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %206 = OpConstantNull %v2half - %208 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %211 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -122,26 +121,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %193 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %194 None - OpBranchConditional %193 %195 %194 - %195 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %194 = OpLabel - %196 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %196 %uint_0 NonPrivatePointer - %197 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %197 %198 NonPrivatePointer - %199 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %199 %200 NonPrivatePointer - %201 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %201 %202 NonPrivatePointer - %203 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %203 %half_0x0p_0 NonPrivatePointer - %205 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %205 %206 NonPrivatePointer - %207 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %207 %208 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -152,126 +151,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_1 %uint_16 NonPrivatePointer %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %65 = OpArrayLength %uint %32 0 - %66 = OpIMul %uint %65 %uint_4 - %68 = OpBitcast %uint %int_0 - %70 = OpBitcast %uint %int_16 - %72 = OpIMul %uint %70 %uint_7 - %74 = OpIAdd %uint %68 %72 - %75 = OpIMul %uint %74 %uint_4 - %76 = OpIAdd %uint %75 %uint_8 - %77 = OpULessThanEqual %bool %76 %66 - %79 = OpSelect %uint %77 %68 %uint_0 - %80 = OpSelect %uint %77 %70 %uint_2 - %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %82 = OpAccessChain %_ptr_StorageBuffer_uint %81 %79 - OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer - %85 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %85 %uint_1 %uint_16 NonPrivatePointer - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %89 = OpArrayLength %uint %32 0 - %90 = OpIMul %uint %89 %uint_4 - %91 = OpBitcast %uint %int_0 - %92 = OpBitcast %uint %int_16 - %93 = OpIMul %uint %92 %uint_7 - %94 = OpIAdd %uint %91 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %90 - %98 = OpSelect %uint %97 %91 %uint_0 - %99 = OpSelect %uint %97 %92 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_uint %100 %98 - OpCooperativeMatrixStoreKHR %101 %m1 %uint_1 %99 NonPrivatePointer - %103 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %103 %uint_1 %uint_16 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %107 = OpArrayLength %uint %32 0 - %108 = OpIMul %uint %107 %uint_4 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_4 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_2 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %121 %uint_1 %uint_16 NonPrivatePointer - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %125 = OpArrayLength %uint %32 0 - %126 = OpIMul %uint %125 %uint_4 - %127 = OpBitcast %uint %int_0 - %128 = OpBitcast %uint %int_16 - %129 = OpIMul %uint %128 %uint_7 - %130 = OpIAdd %uint %127 %129 - %131 = OpIMul %uint %130 %uint_4 - %132 = OpIAdd %uint %131 %uint_8 - %133 = OpULessThanEqual %bool %132 %126 - %134 = OpSelect %uint %133 %127 %uint_0 - %135 = OpSelect %uint %133 %128 %uint_2 - %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %137 = OpAccessChain %_ptr_StorageBuffer_uint %136 %134 - OpCooperativeMatrixStoreKHR %137 %m3 %uint_1 %135 NonPrivatePointer - %139 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %139 %uint_1 %uint_16 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %143 = OpArrayLength %uint %32 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpBitcast %uint %int_0 - %146 = OpBitcast %uint %int_16 - %147 = OpIMul %uint %146 %uint_7 - %148 = OpIAdd %uint %145 %147 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpIAdd %uint %149 %uint_8 - %151 = OpULessThanEqual %bool %150 %144 - %152 = OpSelect %uint %151 %145 %uint_0 - %153 = OpSelect %uint %151 %146 %uint_2 - %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %155 = OpAccessChain %_ptr_StorageBuffer_uint %154 %152 - OpCooperativeMatrixStoreKHR %155 %m4 %uint_1 %153 NonPrivatePointer - %157 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %157 %uint_1 %uint_16 NonPrivatePointer - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %161 = OpArrayLength %uint %32 0 - %162 = OpIMul %uint %161 %uint_4 - %163 = OpBitcast %uint %int_0 - %164 = OpBitcast %uint %int_16 - %165 = OpIMul %uint %164 %uint_7 - %166 = OpIAdd %uint %163 %165 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpIAdd %uint %167 %uint_8 - %169 = OpULessThanEqual %bool %168 %162 - %170 = OpSelect %uint %169 %163 %uint_0 - %171 = OpSelect %uint %169 %164 %uint_2 - %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %173 = OpAccessChain %_ptr_StorageBuffer_uint %172 %170 - OpCooperativeMatrixStoreKHR %173 %m5 %uint_1 %171 NonPrivatePointer - %175 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %175 %uint_1 %uint_16 NonPrivatePointer - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %179 = OpArrayLength %uint %32 0 - %180 = OpIMul %uint %179 %uint_4 - %181 = OpBitcast %uint %int_0 - %182 = OpBitcast %uint %int_16 - %183 = OpIMul %uint %182 %uint_7 - %184 = OpIAdd %uint %181 %183 - %185 = OpIMul %uint %184 %uint_4 - %186 = OpIAdd %uint %185 %uint_8 - %187 = OpULessThanEqual %bool %186 %180 - %188 = OpSelect %uint %187 %181 %uint_0 - %189 = OpSelect %uint %187 %182 %uint_2 - %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %191 = OpAccessChain %_ptr_StorageBuffer_uint %190 %188 - OpCooperativeMatrixStoreKHR %191 %m6 %uint_1 %189 NonPrivatePointer + %66 = OpBitcast %uint %int_0 + %68 = OpBitcast %uint %int_16 + %70 = OpIMul %uint %68 %uint_7 + %72 = OpIAdd %uint %66 %70 + %73 = OpIAdd %uint %72 %uint_2 + %74 = OpULessThanEqual %bool %73 %65 + %76 = OpSelect %uint %74 %66 %uint_0 + %77 = OpSelect %uint %74 %68 %uint_2 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_uint %78 %76 + OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_1 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_2 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_2 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_1 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_2 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_2 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_1 %uint_16 NonPrivatePointer + %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_2 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_2 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_1 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_2 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_2 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_1 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_2 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_2 + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_1 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_2 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_2 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %211 - %212 = OpLabel - %213 = OpLoad %uint %main_local_invocation_index_Input None - %214 = OpFunctionCall %void %main_inner %213 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_u8_sized_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_u8_sized_array_row_major.wgsl.expected.spvasm index e44afbb..d288730 100644 --- a/test/tint/builtins/subgroupMatrixLoad/workgroup_right_u8_sized_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixLoad/workgroup_right_u8_sized_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 215 +; Bound: 200 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -91,7 +91,6 @@ %57 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_1 %uint_16 = OpConstant %uint 16 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_16 = OpConstant %int 16 %uint_7 = OpConstant %uint 7 @@ -103,14 +102,14 @@ %_ptr_Workgroup_half = OpTypePointer Workgroup %half %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half - %198 = OpConstantNull %v2int - %200 = OpConstantNull %v3float - %202 = OpConstantNull %v4uint + %183 = OpConstantNull %v2int + %185 = OpConstantNull %v3float + %187 = OpConstantNull %v4uint %half_0x0p_0 = OpConstant %half 0x0p+0 - %206 = OpConstantNull %v2half - %208 = OpConstantNull %v3half + %191 = OpConstantNull %v2half + %193 = OpConstantNull %v3half %uint_64 = OpConstant %uint 64 - %211 = OpTypeFunction %void + %196 = OpTypeFunction %void %main_inner = OpFunction %void None %41 %tint_local_index = OpFunctionParameter %uint %42 = OpLabel @@ -122,26 +121,26 @@ OpLoopMerge %47 %45 None OpBranch %44 %44 = OpLabel - %193 = OpUGreaterThanEqual %bool %48 %uint_1024 - OpSelectionMerge %194 None - OpBranchConditional %193 %195 %194 - %195 = OpLabel + %178 = OpUGreaterThanEqual %bool %48 %uint_1024 + OpSelectionMerge %179 None + OpBranchConditional %178 %180 %179 + %180 = OpLabel OpBranch %47 - %194 = OpLabel - %196 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 - OpStore %196 %uint_0 NonPrivatePointer - %197 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 - OpStore %197 %198 NonPrivatePointer - %199 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 - OpStore %199 %200 NonPrivatePointer - %201 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 - OpStore %201 %202 NonPrivatePointer - %203 = OpAccessChain %_ptr_Workgroup_half %in4 %48 - OpStore %203 %half_0x0p_0 NonPrivatePointer - %205 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 - OpStore %205 %206 NonPrivatePointer - %207 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 - OpStore %207 %208 NonPrivatePointer + %179 = OpLabel + %181 = OpAccessChain %_ptr_Workgroup_uint %in0 %48 + OpStore %181 %uint_0 NonPrivatePointer + %182 = OpAccessChain %_ptr_Workgroup_v2int %in1 %48 + OpStore %182 %183 NonPrivatePointer + %184 = OpAccessChain %_ptr_Workgroup_v3float %in2 %48 + OpStore %184 %185 NonPrivatePointer + %186 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %48 + OpStore %186 %187 NonPrivatePointer + %188 = OpAccessChain %_ptr_Workgroup_half %in4 %48 + OpStore %188 %half_0x0p_0 NonPrivatePointer + %190 = OpAccessChain %_ptr_Workgroup_v2half %in5 %48 + OpStore %190 %191 NonPrivatePointer + %192 = OpAccessChain %_ptr_Workgroup_v3half %in6 %48 + OpStore %192 %193 NonPrivatePointer OpBranch %45 %45 = OpLabel %49 = OpIAdd %uint %48 %uint_64 @@ -152,126 +151,112 @@ %m0 = OpCooperativeMatrixLoadKHR %57 %53 %uint_0 %uint_16 NonPrivatePointer %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 %65 = OpArrayLength %uint %32 0 - %66 = OpIMul %uint %65 %uint_4 - %68 = OpBitcast %uint %int_0 - %70 = OpBitcast %uint %int_16 - %72 = OpIMul %uint %70 %uint_7 - %74 = OpIAdd %uint %68 %72 - %75 = OpIMul %uint %74 %uint_4 - %76 = OpIAdd %uint %75 %uint_8 - %77 = OpULessThanEqual %bool %76 %66 - %79 = OpSelect %uint %77 %68 %uint_0 - %80 = OpSelect %uint %77 %70 %uint_2 - %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %82 = OpAccessChain %_ptr_StorageBuffer_uint %81 %79 - OpCooperativeMatrixStoreKHR %82 %m0 %uint_1 %80 NonPrivatePointer - %85 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 - %m1 = OpCooperativeMatrixLoadKHR %57 %85 %uint_0 %uint_16 NonPrivatePointer - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %89 = OpArrayLength %uint %32 0 - %90 = OpIMul %uint %89 %uint_4 - %91 = OpBitcast %uint %int_0 - %92 = OpBitcast %uint %int_16 - %93 = OpIMul %uint %92 %uint_7 - %94 = OpIAdd %uint %91 %93 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIAdd %uint %95 %uint_8 - %97 = OpULessThanEqual %bool %96 %90 - %98 = OpSelect %uint %97 %91 %uint_0 - %99 = OpSelect %uint %97 %92 %uint_2 - %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %101 = OpAccessChain %_ptr_StorageBuffer_uint %100 %98 - OpCooperativeMatrixStoreKHR %101 %m1 %uint_1 %99 NonPrivatePointer - %103 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 - %m2 = OpCooperativeMatrixLoadKHR %57 %103 %uint_0 %uint_16 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %107 = OpArrayLength %uint %32 0 - %108 = OpIMul %uint %107 %uint_4 - %109 = OpBitcast %uint %int_0 - %110 = OpBitcast %uint %int_16 - %111 = OpIMul %uint %110 %uint_7 - %112 = OpIAdd %uint %109 %111 - %113 = OpIMul %uint %112 %uint_4 - %114 = OpIAdd %uint %113 %uint_8 - %115 = OpULessThanEqual %bool %114 %108 - %116 = OpSelect %uint %115 %109 %uint_0 - %117 = OpSelect %uint %115 %110 %uint_2 - %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %119 = OpAccessChain %_ptr_StorageBuffer_uint %118 %116 - OpCooperativeMatrixStoreKHR %119 %m2 %uint_1 %117 NonPrivatePointer - %121 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 - %m3 = OpCooperativeMatrixLoadKHR %57 %121 %uint_0 %uint_16 NonPrivatePointer - %124 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %125 = OpArrayLength %uint %32 0 - %126 = OpIMul %uint %125 %uint_4 - %127 = OpBitcast %uint %int_0 - %128 = OpBitcast %uint %int_16 - %129 = OpIMul %uint %128 %uint_7 - %130 = OpIAdd %uint %127 %129 - %131 = OpIMul %uint %130 %uint_4 - %132 = OpIAdd %uint %131 %uint_8 - %133 = OpULessThanEqual %bool %132 %126 - %134 = OpSelect %uint %133 %127 %uint_0 - %135 = OpSelect %uint %133 %128 %uint_2 - %136 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %137 = OpAccessChain %_ptr_StorageBuffer_uint %136 %134 - OpCooperativeMatrixStoreKHR %137 %m3 %uint_1 %135 NonPrivatePointer - %139 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 - %m4 = OpCooperativeMatrixLoadKHR %57 %139 %uint_0 %uint_16 NonPrivatePointer - %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %143 = OpArrayLength %uint %32 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpBitcast %uint %int_0 - %146 = OpBitcast %uint %int_16 - %147 = OpIMul %uint %146 %uint_7 - %148 = OpIAdd %uint %145 %147 - %149 = OpIMul %uint %148 %uint_4 - %150 = OpIAdd %uint %149 %uint_8 - %151 = OpULessThanEqual %bool %150 %144 - %152 = OpSelect %uint %151 %145 %uint_0 - %153 = OpSelect %uint %151 %146 %uint_2 - %154 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %155 = OpAccessChain %_ptr_StorageBuffer_uint %154 %152 - OpCooperativeMatrixStoreKHR %155 %m4 %uint_1 %153 NonPrivatePointer - %157 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 - %m5 = OpCooperativeMatrixLoadKHR %57 %157 %uint_0 %uint_16 NonPrivatePointer - %160 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %161 = OpArrayLength %uint %32 0 - %162 = OpIMul %uint %161 %uint_4 - %163 = OpBitcast %uint %int_0 - %164 = OpBitcast %uint %int_16 - %165 = OpIMul %uint %164 %uint_7 - %166 = OpIAdd %uint %163 %165 - %167 = OpIMul %uint %166 %uint_4 - %168 = OpIAdd %uint %167 %uint_8 - %169 = OpULessThanEqual %bool %168 %162 - %170 = OpSelect %uint %169 %163 %uint_0 - %171 = OpSelect %uint %169 %164 %uint_2 - %172 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %173 = OpAccessChain %_ptr_StorageBuffer_uint %172 %170 - OpCooperativeMatrixStoreKHR %173 %m5 %uint_1 %171 NonPrivatePointer - %175 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 - %m6 = OpCooperativeMatrixLoadKHR %57 %175 %uint_0 %uint_16 NonPrivatePointer - %178 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %179 = OpArrayLength %uint %32 0 - %180 = OpIMul %uint %179 %uint_4 - %181 = OpBitcast %uint %int_0 - %182 = OpBitcast %uint %int_16 - %183 = OpIMul %uint %182 %uint_7 - %184 = OpIAdd %uint %181 %183 - %185 = OpIMul %uint %184 %uint_4 - %186 = OpIAdd %uint %185 %uint_8 - %187 = OpULessThanEqual %bool %186 %180 - %188 = OpSelect %uint %187 %181 %uint_0 - %189 = OpSelect %uint %187 %182 %uint_2 - %190 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 - %191 = OpAccessChain %_ptr_StorageBuffer_uint %190 %188 - OpCooperativeMatrixStoreKHR %191 %m6 %uint_1 %189 NonPrivatePointer + %66 = OpBitcast %uint %int_0 + %68 = OpBitcast %uint %int_16 + %70 = OpIMul %uint %68 %uint_7 + %72 = OpIAdd %uint %66 %70 + %73 = OpIAdd %uint %72 %uint_2 + %74 = OpULessThanEqual %bool %73 %65 + %76 = OpSelect %uint %74 %66 %uint_0 + %77 = OpSelect %uint %74 %68 %uint_2 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_uint %78 %76 + OpCooperativeMatrixStoreKHR %79 %m0 %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_Workgroup_v2int %in1 %uint_0 + %m1 = OpCooperativeMatrixLoadKHR %57 %82 %uint_0 %uint_16 NonPrivatePointer + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %86 = OpArrayLength %uint %32 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_16 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_2 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_2 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %m1 %uint_1 %94 NonPrivatePointer + %98 = OpAccessChain %_ptr_Workgroup_v3float %in2 %uint_0 + %m2 = OpCooperativeMatrixLoadKHR %57 %98 %uint_0 %uint_16 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %102 = OpArrayLength %uint %32 0 + %103 = OpBitcast %uint %int_0 + %104 = OpBitcast %uint %int_16 + %105 = OpIMul %uint %104 %uint_7 + %106 = OpIAdd %uint %103 %105 + %107 = OpIAdd %uint %106 %uint_2 + %108 = OpULessThanEqual %bool %107 %102 + %109 = OpSelect %uint %108 %103 %uint_0 + %110 = OpSelect %uint %108 %104 %uint_2 + %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %112 = OpAccessChain %_ptr_StorageBuffer_uint %111 %109 + OpCooperativeMatrixStoreKHR %112 %m2 %uint_1 %110 NonPrivatePointer + %114 = OpAccessChain %_ptr_Workgroup_v4uint %in3 %uint_0 + %m3 = OpCooperativeMatrixLoadKHR %57 %114 %uint_0 %uint_16 NonPrivatePointer + %117 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %118 = OpArrayLength %uint %32 0 + %119 = OpBitcast %uint %int_0 + %120 = OpBitcast %uint %int_16 + %121 = OpIMul %uint %120 %uint_7 + %122 = OpIAdd %uint %119 %121 + %123 = OpIAdd %uint %122 %uint_2 + %124 = OpULessThanEqual %bool %123 %118 + %125 = OpSelect %uint %124 %119 %uint_0 + %126 = OpSelect %uint %124 %120 %uint_2 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_uint %127 %125 + OpCooperativeMatrixStoreKHR %128 %m3 %uint_1 %126 NonPrivatePointer + %130 = OpAccessChain %_ptr_Workgroup_half %in4 %uint_0 + %m4 = OpCooperativeMatrixLoadKHR %57 %130 %uint_0 %uint_16 NonPrivatePointer + %133 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %134 = OpArrayLength %uint %32 0 + %135 = OpBitcast %uint %int_0 + %136 = OpBitcast %uint %int_16 + %137 = OpIMul %uint %136 %uint_7 + %138 = OpIAdd %uint %135 %137 + %139 = OpIAdd %uint %138 %uint_2 + %140 = OpULessThanEqual %bool %139 %134 + %141 = OpSelect %uint %140 %135 %uint_0 + %142 = OpSelect %uint %140 %136 %uint_2 + %143 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %144 = OpAccessChain %_ptr_StorageBuffer_uint %143 %141 + OpCooperativeMatrixStoreKHR %144 %m4 %uint_1 %142 NonPrivatePointer + %146 = OpAccessChain %_ptr_Workgroup_v2half %in5 %uint_0 + %m5 = OpCooperativeMatrixLoadKHR %57 %146 %uint_0 %uint_16 NonPrivatePointer + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %150 = OpArrayLength %uint %32 0 + %151 = OpBitcast %uint %int_0 + %152 = OpBitcast %uint %int_16 + %153 = OpIMul %uint %152 %uint_7 + %154 = OpIAdd %uint %151 %153 + %155 = OpIAdd %uint %154 %uint_2 + %156 = OpULessThanEqual %bool %155 %150 + %157 = OpSelect %uint %156 %151 %uint_0 + %158 = OpSelect %uint %156 %152 %uint_2 + %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %160 = OpAccessChain %_ptr_StorageBuffer_uint %159 %157 + OpCooperativeMatrixStoreKHR %160 %m5 %uint_1 %158 NonPrivatePointer + %162 = OpAccessChain %_ptr_Workgroup_v3half %in6 %uint_0 + %m6 = OpCooperativeMatrixLoadKHR %57 %162 %uint_0 %uint_16 NonPrivatePointer + %165 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %166 = OpArrayLength %uint %32 0 + %167 = OpBitcast %uint %int_0 + %168 = OpBitcast %uint %int_16 + %169 = OpIMul %uint %168 %uint_7 + %170 = OpIAdd %uint %167 %169 + %171 = OpIAdd %uint %170 %uint_2 + %172 = OpULessThanEqual %bool %171 %166 + %173 = OpSelect %uint %172 %167 %uint_0 + %174 = OpSelect %uint %172 %168 %uint_2 + %175 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %32 %uint_0 + %176 = OpAccessChain %_ptr_StorageBuffer_uint %175 %173 + OpCooperativeMatrixStoreKHR %176 %m6 %uint_1 %174 NonPrivatePointer OpReturn OpFunctionEnd - %main = OpFunction %void None %211 - %212 = OpLabel - %213 = OpLoad %uint %main_local_invocation_index_Input None - %214 = OpFunctionCall %void %main_inner %213 + %main = OpFunction %void None %196 + %197 = OpLabel + %198 = OpLoad %uint %main_local_invocation_index_Input None + %199 = OpFunctionCall %void %main_inner %198 OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl index 47f9bf8..c57d69f 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -14,19 +14,19 @@ Matrix_left_f16_8x8 m = Matrix_left_f16_8x8::Splat(float16_t(0.0h)); uint v = 0u; out0.GetDimensions(v); - bool v_1 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v / 4u) * 2u)); + bool v_1 = (((0u + (16u * 7u)) + 4u) <= (v / 4u)); m.Store(out0, (0u + (select(v_1, 0u, 0u) * 2u)), (select(v_1, 16u, 4u) * 2u), MatrixLayout::ColMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_2 / 8u) * 4u)); + bool v_3 = (((0u + (16u * 7u)) + 2u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 2u)), (select(v_3, 16u, 2u) * 2u), MatrixLayout::ColMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_4 / 16u) * 8u)); + bool v_5 = (((0u + (16u * 7u)) + 1u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 2u)), (select(v_5, 16u, 1u) * 2u), MatrixLayout::ColMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_6 / 16u) * 8u)); + bool v_7 = (((0u + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 2u)), (select(v_7, 16u, 1u) * 2u), MatrixLayout::ColMajor); uint v_8 = 0u; out4.GetDimensions(v_8); @@ -34,11 +34,11 @@ m.Store(out4, (0u + (select(v_9, 0u, 0u) * 2u)), (select(v_9, 16u, 8u) * 2u), MatrixLayout::ColMajor); uint v_10 = 0u; out5.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_10 / 4u) * 2u)); + bool v_11 = (((0u + (16u * 7u)) + 4u) <= (v_10 / 4u)); m.Store(out5, (0u + (select(v_11, 0u, 0u) * 2u)), (select(v_11, 16u, 4u) * 2u), MatrixLayout::ColMajor); uint v_12 = 0u; out6.GetDimensions(v_12); - bool v_13 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_12 / 8u) * 4u)); + bool v_13 = (((0u + (16u * 7u)) + 2u) <= (v_12 / 8u)); m.Store(out6, (0u + (select(v_13, 0u, 0u) * 2u)), (select(v_13, 16u, 2u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_col_major.wgsl.expected.msl index b99f197..43504d9 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_col_major.wgsl.expected.msl
@@ -49,18 +49,18 @@ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.out0=out0, .out1=out1, .out2=out2, .out3=out3, .out4=out4, .out5=out5, .out6=out6, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; tint_array_lengths_struct const v_1 = tint_array_lengths_struct{.tint_array_length_0_0=((*tint_module_vars.tint_storage_buffer_sizes)[0u].x / 4u), .tint_array_length_0_1=((*tint_module_vars.tint_storage_buffer_sizes)[0u].y / 8u), .tint_array_length_0_2=((*tint_module_vars.tint_storage_buffer_sizes)[0u].z / 16u), .tint_array_length_0_3=((*tint_module_vars.tint_storage_buffer_sizes)[0u].w / 16u), .tint_array_length_0_4=((*tint_module_vars.tint_storage_buffer_sizes)[1u].x / 2u), .tint_array_length_0_5=((*tint_module_vars.tint_storage_buffer_sizes)[1u].y / 4u), .tint_array_length_0_6=((*tint_module_vars.tint_storage_buffer_sizes)[1u].z / 8u)}; simdgroup_half8x8 const m = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); - bool const v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_0 * 2u)); + bool const v_2 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_0); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out0) + (select(0u, 0u, v_2) * 4u)), ulong((select(4u, 16u, v_2) * 2u)), ulong2(0ul), true)); - bool const v_3 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_1 * 4u)); + bool const v_3 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_1); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out1) + (select(0u, 0u, v_3) * 8u)), ulong((select(2u, 16u, v_3) * 4u)), ulong2(0ul), true)); - bool const v_4 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_2 * 8u)); + bool const v_4 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_2); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out2) + (select(0u, 0u, v_4) * 16u)), ulong((select(1u, 16u, v_4) * 8u)), ulong2(0ul), true)); - bool const v_5 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_3 * 8u)); + bool const v_5 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_3); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out3) + (select(0u, 0u, v_5) * 16u)), ulong((select(1u, 16u, v_5) * 8u)), ulong2(0ul), true)); bool const v_6 = (((0u + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); (simdgroup_store(m, (&(*tint_module_vars.out4)[select(0u, 0u, v_6)]), ulong(select(8u, 16u, v_6)), ulong2(0ul), true)); - bool const v_7 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_7 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out5) + (select(0u, 0u, v_7) * 4u)), ulong((select(4u, 16u, v_7) * 2u)), ulong2(0ul), true)); - bool const v_8 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_6 * 4u)); + bool const v_8 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_6); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out6) + (select(0u, 0u, v_8) * 8u)), ulong((select(2u, 16u, v_8) * 4u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_col_major.wgsl.expected.spvasm index 30968f2..071d3f0 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 156 +; Bound: 144 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -110,14 +110,14 @@ %43 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_0 %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_2 = OpConstant %uint 2 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float @@ -133,92 +133,80 @@ %41 = OpLabel %47 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %49 = OpArrayLength %uint %1 0 - %50 = OpIMul %uint %49 %uint_2 - %52 = OpIMul %uint %uint_16 %uint_7 - %55 = OpIAdd %uint %uint_0 %52 - %56 = OpIMul %uint %55 %uint_2 - %57 = OpIAdd %uint %56 %uint_8 - %58 = OpULessThanEqual %bool %57 %50 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_4 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - OpCooperativeMatrixStoreKHR %64 %m %uint_1 %61 NonPrivatePointer - %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %70 = OpArrayLength %uint %6 0 - %71 = OpIMul %uint %70 %uint_4 - %72 = OpIMul %uint %uint_16 %uint_7 - %73 = OpIAdd %uint %uint_0 %72 - %74 = OpIMul %uint %73 %uint_4 - %75 = OpIAdd %uint %74 %uint_8 - %76 = OpULessThanEqual %bool %75 %71 - %77 = OpSelect %uint %76 %uint_0 %uint_0 - %78 = OpSelect %uint %76 %uint_16 %uint_2 - %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %80 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %77 - OpCooperativeMatrixStoreKHR %80 %m %uint_1 %78 NonPrivatePointer - %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %85 = OpArrayLength %uint %12 0 - %86 = OpIMul %uint %85 %uint_8 - %87 = OpIMul %uint %uint_16 %uint_7 - %88 = OpIAdd %uint %uint_0 %87 - %89 = OpIMul %uint %88 %uint_8 - %90 = OpIAdd %uint %89 %uint_8 - %91 = OpULessThanEqual %bool %90 %86 - %92 = OpSelect %uint %91 %uint_0 %uint_0 - %93 = OpSelect %uint %91 %uint_16 %uint_1 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v3float %94 %92 - OpCooperativeMatrixStoreKHR %95 %m %uint_1 %93 NonPrivatePointer - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %100 = OpArrayLength %uint %18 0 - %101 = OpIMul %uint %100 %uint_8 - %102 = OpIMul %uint %uint_16 %uint_7 - %103 = OpIAdd %uint %uint_0 %102 - %104 = OpIMul %uint %103 %uint_8 - %105 = OpIAdd %uint %104 %uint_8 - %106 = OpULessThanEqual %bool %105 %101 - %107 = OpSelect %uint %106 %uint_0 %uint_0 - %108 = OpSelect %uint %106 %uint_16 %uint_1 - %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %110 = OpAccessChain %_ptr_StorageBuffer_v4uint %109 %107 - OpCooperativeMatrixStoreKHR %110 %m %uint_1 %108 NonPrivatePointer - %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %115 = OpArrayLength %uint %23 0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %uint_0 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %115 - %120 = OpSelect %uint %119 %uint_0 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_1 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %128 = OpArrayLength %uint %28 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpIMul %uint %uint_16 %uint_7 - %131 = OpIAdd %uint %uint_0 %130 - %132 = OpIMul %uint %131 %uint_2 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %129 - %135 = OpSelect %uint %134 %uint_0 %uint_0 - %136 = OpSelect %uint %134 %uint_16 %uint_4 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_v2half %137 %135 - OpCooperativeMatrixStoreKHR %138 %m %uint_1 %136 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %143 = OpArrayLength %uint %33 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %uint_0 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %144 - %150 = OpSelect %uint %149 %uint_0 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v3half %152 %150 - OpCooperativeMatrixStoreKHR %153 %m %uint_1 %151 NonPrivatePointer + %50 = OpIMul %uint %uint_16 %uint_7 + %53 = OpIAdd %uint %uint_0 %50 + %54 = OpIAdd %uint %53 %uint_4 + %56 = OpULessThanEqual %bool %54 %49 + %58 = OpSelect %uint %56 %uint_0 %uint_0 + %59 = OpSelect %uint %56 %uint_16 %uint_4 + %60 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %61 = OpAccessChain %_ptr_StorageBuffer_uint %60 %58 + OpCooperativeMatrixStoreKHR %61 %m %uint_1 %59 NonPrivatePointer + %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %67 = OpArrayLength %uint %6 0 + %68 = OpIMul %uint %uint_16 %uint_7 + %69 = OpIAdd %uint %uint_0 %68 + %70 = OpIAdd %uint %69 %uint_2 + %72 = OpULessThanEqual %bool %70 %67 + %73 = OpSelect %uint %72 %uint_0 %uint_0 + %74 = OpSelect %uint %72 %uint_16 %uint_2 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %73 + OpCooperativeMatrixStoreKHR %76 %m %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %81 = OpArrayLength %uint %12 0 + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_1 + %85 = OpULessThanEqual %bool %84 %81 + %86 = OpSelect %uint %85 %uint_0 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_1 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %uint_0 %95 + %97 = OpIAdd %uint %96 %uint_1 + %98 = OpULessThanEqual %bool %97 %94 + %99 = OpSelect %uint %98 %uint_0 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_1 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_1 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpIMul %uint %uint_16 %uint_7 + %109 = OpIAdd %uint %uint_0 %108 + %110 = OpIAdd %uint %109 %uint_8 + %111 = OpULessThanEqual %bool %110 %107 + %112 = OpSelect %uint %111 %uint_0 %uint_0 + %113 = OpSelect %uint %111 %uint_16 %uint_8 + %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %115 = OpAccessChain %_ptr_StorageBuffer_half %114 %112 + OpCooperativeMatrixStoreKHR %115 %m %uint_1 %113 NonPrivatePointer + %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %120 = OpArrayLength %uint %28 0 + %121 = OpIMul %uint %uint_16 %uint_7 + %122 = OpIAdd %uint %uint_0 %121 + %123 = OpIAdd %uint %122 %uint_4 + %124 = OpULessThanEqual %bool %123 %120 + %125 = OpSelect %uint %124 %uint_0 %uint_0 + %126 = OpSelect %uint %124 %uint_16 %uint_4 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_v2half %127 %125 + OpCooperativeMatrixStoreKHR %128 %m %uint_1 %126 NonPrivatePointer + %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %133 = OpArrayLength %uint %33 0 + %134 = OpIMul %uint %uint_16 %uint_7 + %135 = OpIAdd %uint %uint_0 %134 + %136 = OpIAdd %uint %135 %uint_2 + %137 = OpULessThanEqual %bool %136 %133 + %138 = OpSelect %uint %137 %uint_0 %uint_0 + %139 = OpSelect %uint %137 %uint_16 %uint_2 + %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %141 = OpAccessChain %_ptr_StorageBuffer_v3half %140 %138 + OpCooperativeMatrixStoreKHR %141 %m %uint_1 %139 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl index 6faf578..38f378c 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -14,19 +14,19 @@ Matrix_left_f16_8x8 m = Matrix_left_f16_8x8::Splat(float16_t(0.0h)); uint v = 0u; out0.GetDimensions(v); - bool v_1 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v / 4u) * 2u)); + bool v_1 = (((0u + (16u * 7u)) + 4u) <= (v / 4u)); m.Store(out0, (0u + (select(v_1, 0u, 0u) * 2u)), (select(v_1, 16u, 4u) * 2u), MatrixLayout::RowMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_2 / 8u) * 4u)); + bool v_3 = (((0u + (16u * 7u)) + 2u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 2u)), (select(v_3, 16u, 2u) * 2u), MatrixLayout::RowMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_4 / 16u) * 8u)); + bool v_5 = (((0u + (16u * 7u)) + 1u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 2u)), (select(v_5, 16u, 1u) * 2u), MatrixLayout::RowMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_6 / 16u) * 8u)); + bool v_7 = (((0u + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 2u)), (select(v_7, 16u, 1u) * 2u), MatrixLayout::RowMajor); uint v_8 = 0u; out4.GetDimensions(v_8); @@ -34,11 +34,11 @@ m.Store(out4, (0u + (select(v_9, 0u, 0u) * 2u)), (select(v_9, 16u, 8u) * 2u), MatrixLayout::RowMajor); uint v_10 = 0u; out5.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_10 / 4u) * 2u)); + bool v_11 = (((0u + (16u * 7u)) + 4u) <= (v_10 / 4u)); m.Store(out5, (0u + (select(v_11, 0u, 0u) * 2u)), (select(v_11, 16u, 4u) * 2u), MatrixLayout::RowMajor); uint v_12 = 0u; out6.GetDimensions(v_12); - bool v_13 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_12 / 8u) * 4u)); + bool v_13 = (((0u + (16u * 7u)) + 2u) <= (v_12 / 8u)); m.Store(out6, (0u + (select(v_13, 0u, 0u) * 2u)), (select(v_13, 16u, 2u) * 2u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_row_major.wgsl.expected.msl index 03a2279..4ed85da 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_row_major.wgsl.expected.msl
@@ -49,18 +49,18 @@ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.out0=out0, .out1=out1, .out2=out2, .out3=out3, .out4=out4, .out5=out5, .out6=out6, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; tint_array_lengths_struct const v_1 = tint_array_lengths_struct{.tint_array_length_0_0=((*tint_module_vars.tint_storage_buffer_sizes)[0u].x / 4u), .tint_array_length_0_1=((*tint_module_vars.tint_storage_buffer_sizes)[0u].y / 8u), .tint_array_length_0_2=((*tint_module_vars.tint_storage_buffer_sizes)[0u].z / 16u), .tint_array_length_0_3=((*tint_module_vars.tint_storage_buffer_sizes)[0u].w / 16u), .tint_array_length_0_4=((*tint_module_vars.tint_storage_buffer_sizes)[1u].x / 2u), .tint_array_length_0_5=((*tint_module_vars.tint_storage_buffer_sizes)[1u].y / 4u), .tint_array_length_0_6=((*tint_module_vars.tint_storage_buffer_sizes)[1u].z / 8u)}; simdgroup_half8x8 const m = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); - bool const v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_0 * 2u)); + bool const v_2 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_0); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out0) + (select(0u, 0u, v_2) * 4u)), ulong((select(4u, 16u, v_2) * 2u)), ulong2(0ul), false)); - bool const v_3 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_1 * 4u)); + bool const v_3 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_1); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out1) + (select(0u, 0u, v_3) * 8u)), ulong((select(2u, 16u, v_3) * 4u)), ulong2(0ul), false)); - bool const v_4 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_2 * 8u)); + bool const v_4 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_2); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out2) + (select(0u, 0u, v_4) * 16u)), ulong((select(1u, 16u, v_4) * 8u)), ulong2(0ul), false)); - bool const v_5 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_3 * 8u)); + bool const v_5 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_3); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out3) + (select(0u, 0u, v_5) * 16u)), ulong((select(1u, 16u, v_5) * 8u)), ulong2(0ul), false)); bool const v_6 = (((0u + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); (simdgroup_store(m, (&(*tint_module_vars.out4)[select(0u, 0u, v_6)]), ulong(select(8u, 16u, v_6)), ulong2(0ul), false)); - bool const v_7 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_7 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out5) + (select(0u, 0u, v_7) * 4u)), ulong((select(4u, 16u, v_7) * 2u)), ulong2(0ul), false)); - bool const v_8 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_6 * 4u)); + bool const v_8 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_6); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out6) + (select(0u, 0u, v_8) * 8u)), ulong((select(2u, 16u, v_8) * 4u)), ulong2(0ul), false)); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_row_major.wgsl.expected.spvasm index bd94038..f37c61b 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_f16_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 156 +; Bound: 144 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -110,13 +110,13 @@ %43 = OpTypeCooperativeMatrixKHR %half %uint_3 %uint_8 %uint_8 %uint_0 %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_2 = OpConstant %uint 2 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float %uint_1 = OpConstant %uint 1 @@ -133,92 +133,80 @@ %41 = OpLabel %47 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %49 = OpArrayLength %uint %1 0 - %50 = OpIMul %uint %49 %uint_2 - %52 = OpIMul %uint %uint_16 %uint_7 - %55 = OpIAdd %uint %uint_0 %52 - %56 = OpIMul %uint %55 %uint_2 - %57 = OpIAdd %uint %56 %uint_8 - %58 = OpULessThanEqual %bool %57 %50 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_4 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - OpCooperativeMatrixStoreKHR %64 %m %uint_0 %61 NonPrivatePointer - %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %69 = OpArrayLength %uint %6 0 - %70 = OpIMul %uint %69 %uint_4 - %71 = OpIMul %uint %uint_16 %uint_7 - %72 = OpIAdd %uint %uint_0 %71 - %73 = OpIMul %uint %72 %uint_4 - %74 = OpIAdd %uint %73 %uint_8 - %75 = OpULessThanEqual %bool %74 %70 - %76 = OpSelect %uint %75 %uint_0 %uint_0 - %77 = OpSelect %uint %75 %uint_16 %uint_2 - %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %79 = OpAccessChain %_ptr_StorageBuffer_v2int %78 %76 - OpCooperativeMatrixStoreKHR %79 %m %uint_0 %77 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %84 = OpArrayLength %uint %12 0 - %85 = OpIMul %uint %84 %uint_8 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %uint_0 %86 - %88 = OpIMul %uint %87 %uint_8 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %85 - %91 = OpSelect %uint %90 %uint_0 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_1 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v3float %94 %91 - OpCooperativeMatrixStoreKHR %95 %m %uint_0 %92 NonPrivatePointer - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %100 = OpArrayLength %uint %18 0 - %101 = OpIMul %uint %100 %uint_8 - %102 = OpIMul %uint %uint_16 %uint_7 - %103 = OpIAdd %uint %uint_0 %102 - %104 = OpIMul %uint %103 %uint_8 - %105 = OpIAdd %uint %104 %uint_8 - %106 = OpULessThanEqual %bool %105 %101 - %107 = OpSelect %uint %106 %uint_0 %uint_0 - %108 = OpSelect %uint %106 %uint_16 %uint_1 - %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %110 = OpAccessChain %_ptr_StorageBuffer_v4uint %109 %107 - OpCooperativeMatrixStoreKHR %110 %m %uint_0 %108 NonPrivatePointer - %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %115 = OpArrayLength %uint %23 0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %uint_0 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %115 - %120 = OpSelect %uint %119 %uint_0 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_0 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %128 = OpArrayLength %uint %28 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpIMul %uint %uint_16 %uint_7 - %131 = OpIAdd %uint %uint_0 %130 - %132 = OpIMul %uint %131 %uint_2 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %129 - %135 = OpSelect %uint %134 %uint_0 %uint_0 - %136 = OpSelect %uint %134 %uint_16 %uint_4 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_v2half %137 %135 - OpCooperativeMatrixStoreKHR %138 %m %uint_0 %136 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %143 = OpArrayLength %uint %33 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %uint_0 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %144 - %150 = OpSelect %uint %149 %uint_0 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v3half %152 %150 - OpCooperativeMatrixStoreKHR %153 %m %uint_0 %151 NonPrivatePointer + %50 = OpIMul %uint %uint_16 %uint_7 + %53 = OpIAdd %uint %uint_0 %50 + %54 = OpIAdd %uint %53 %uint_4 + %56 = OpULessThanEqual %bool %54 %49 + %58 = OpSelect %uint %56 %uint_0 %uint_0 + %59 = OpSelect %uint %56 %uint_16 %uint_4 + %60 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %61 = OpAccessChain %_ptr_StorageBuffer_uint %60 %58 + OpCooperativeMatrixStoreKHR %61 %m %uint_0 %59 NonPrivatePointer + %64 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %66 = OpArrayLength %uint %6 0 + %67 = OpIMul %uint %uint_16 %uint_7 + %68 = OpIAdd %uint %uint_0 %67 + %69 = OpIAdd %uint %68 %uint_2 + %71 = OpULessThanEqual %bool %69 %66 + %72 = OpSelect %uint %71 %uint_0 %uint_0 + %73 = OpSelect %uint %71 %uint_16 %uint_2 + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %75 = OpAccessChain %_ptr_StorageBuffer_v2int %74 %72 + OpCooperativeMatrixStoreKHR %75 %m %uint_0 %73 NonPrivatePointer + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %80 = OpArrayLength %uint %12 0 + %81 = OpIMul %uint %uint_16 %uint_7 + %82 = OpIAdd %uint %uint_0 %81 + %83 = OpIAdd %uint %82 %uint_1 + %85 = OpULessThanEqual %bool %83 %80 + %86 = OpSelect %uint %85 %uint_0 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_1 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_0 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %uint_0 %95 + %97 = OpIAdd %uint %96 %uint_1 + %98 = OpULessThanEqual %bool %97 %94 + %99 = OpSelect %uint %98 %uint_0 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_1 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_0 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpIMul %uint %uint_16 %uint_7 + %109 = OpIAdd %uint %uint_0 %108 + %110 = OpIAdd %uint %109 %uint_8 + %111 = OpULessThanEqual %bool %110 %107 + %112 = OpSelect %uint %111 %uint_0 %uint_0 + %113 = OpSelect %uint %111 %uint_16 %uint_8 + %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %115 = OpAccessChain %_ptr_StorageBuffer_half %114 %112 + OpCooperativeMatrixStoreKHR %115 %m %uint_0 %113 NonPrivatePointer + %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %120 = OpArrayLength %uint %28 0 + %121 = OpIMul %uint %uint_16 %uint_7 + %122 = OpIAdd %uint %uint_0 %121 + %123 = OpIAdd %uint %122 %uint_4 + %124 = OpULessThanEqual %bool %123 %120 + %125 = OpSelect %uint %124 %uint_0 %uint_0 + %126 = OpSelect %uint %124 %uint_16 %uint_4 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_v2half %127 %125 + OpCooperativeMatrixStoreKHR %128 %m %uint_0 %126 NonPrivatePointer + %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %133 = OpArrayLength %uint %33 0 + %134 = OpIMul %uint %uint_16 %uint_7 + %135 = OpIAdd %uint %uint_0 %134 + %136 = OpIAdd %uint %135 %uint_2 + %137 = OpULessThanEqual %bool %136 %133 + %138 = OpSelect %uint %137 %uint_0 %uint_0 + %139 = OpSelect %uint %137 %uint_16 %uint_2 + %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %141 = OpAccessChain %_ptr_StorageBuffer_v3half %140 %138 + OpCooperativeMatrixStoreKHR %141 %m %uint_0 %139 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl index 0248343..caadb4f 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -19,17 +19,17 @@ uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= ((v_3 / 8u) * 2u)); + bool v_5 = (((v_4 + (16u * 7u)) + 4u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_8 = (((v_7 + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 4u) + 8u) <= ((v_9 / 16u) * 4u)); + bool v_11 = (((v_10 + (16u * 7u)) + 2u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_12 = 0u; out5.GetDimensions(v_12); @@ -39,7 +39,7 @@ uint v_15 = 0u; out6.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 2u) + 8u) <= ((v_15 / 8u) * 2u)); + bool v_17 = (((v_16 + (16u * 7u)) + 4u) <= (v_15 / 8u)); m.Store(out6, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 4u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_col_major.wgsl.expected.msl index 94e7bd2..d6d64a1 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_col_major.wgsl.expected.msl
@@ -51,18 +51,18 @@ bool const v_3 = (((v_2 + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_0); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out0) + (select(0u, v_2, v_3) * 4u)), ulong((select(8u, 16u, v_3) * 1u)), ulong2(0ul), true)); uint const v_4 = as_type<uint>(0); - bool const v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_1 * 2u)); + bool const v_5 = (((v_4 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_1); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out1) + (select(0u, v_4, v_5) * 8u)), ulong((select(4u, 16u, v_5) * 2u)), ulong2(0ul), true)); uint const v_6 = as_type<uint>(0); - bool const v_7 = ((((v_6 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_2 * 4u)); + bool const v_7 = (((v_6 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_2); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out2) + (select(0u, v_6, v_7) * 16u)), ulong((select(2u, 16u, v_7) * 4u)), ulong2(0ul), true)); uint const v_8 = as_type<uint>(0); - bool const v_9 = ((((v_8 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_3 * 4u)); + bool const v_9 = (((v_8 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_3); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out3) + (select(0u, v_8, v_9) * 16u)), ulong((select(2u, 16u, v_9) * 4u)), ulong2(0ul), true)); uint const v_10 = as_type<uint>(0); bool const v_11 = (((v_10 + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out5) + (select(0u, v_10, v_11) * 4u)), ulong((select(8u, 16u, v_11) * 1u)), ulong2(0ul), true)); uint const v_12 = as_type<uint>(0); - bool const v_13 = ((((v_12 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_13 = (((v_12 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out6) + (select(0u, v_12, v_13) * 8u)), ulong((select(4u, 16u, v_13) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_col_major.wgsl.expected.spvasm index 8c9eda5..a568491 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 142 +; Bound: 134 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -106,10 +106,10 @@ %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -133,71 +133,63 @@ OpCooperativeMatrixStoreKHR %58 %m %uint_1 %56 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %64 = OpArrayLength %uint %6 0 - %65 = OpIMul %uint %64 %uint_2 - %67 = OpBitcast %uint %int_0 - %68 = OpIMul %uint %uint_16 %uint_7 - %69 = OpIAdd %uint %67 %68 - %70 = OpIMul %uint %69 %uint_2 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %65 - %73 = OpSelect %uint %72 %67 %uint_0 - %74 = OpSelect %uint %72 %uint_16 %uint_4 - %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %77 = OpAccessChain %_ptr_StorageBuffer_v2int %76 %73 - OpCooperativeMatrixStoreKHR %77 %m %uint_1 %74 NonPrivatePointer - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %82 = OpArrayLength %uint %12 0 - %83 = OpIMul %uint %82 %uint_4 - %84 = OpBitcast %uint %int_0 - %85 = OpIMul %uint %uint_16 %uint_7 - %86 = OpIAdd %uint %84 %85 - %87 = OpIMul %uint %86 %uint_4 - %88 = OpIAdd %uint %87 %uint_8 - %89 = OpULessThanEqual %bool %88 %83 - %90 = OpSelect %uint %89 %84 %uint_0 - %91 = OpSelect %uint %89 %uint_16 %uint_2 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 - OpCooperativeMatrixStoreKHR %93 %m %uint_1 %91 NonPrivatePointer - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %98 = OpArrayLength %uint %18 0 - %99 = OpIMul %uint %98 %uint_4 - %100 = OpBitcast %uint %int_0 - %101 = OpIMul %uint %uint_16 %uint_7 - %102 = OpIAdd %uint %100 %101 - %103 = OpIMul %uint %102 %uint_4 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %uint_16 %uint_2 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_v4uint %108 %106 - OpCooperativeMatrixStoreKHR %109 %m %uint_1 %107 NonPrivatePointer - %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %114 = OpArrayLength %uint %23 0 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %114 - %120 = OpSelect %uint %119 %115 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v2half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_1 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %128 = OpArrayLength %uint %29 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpBitcast %uint %int_0 - %131 = OpIMul %uint %uint_16 %uint_7 - %132 = OpIAdd %uint %130 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %129 - %136 = OpSelect %uint %135 %130 %uint_0 - %137 = OpSelect %uint %135 %uint_16 %uint_4 - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_v3half %138 %136 - OpCooperativeMatrixStoreKHR %139 %m %uint_1 %137 NonPrivatePointer + %65 = OpBitcast %uint %int_0 + %66 = OpIMul %uint %uint_16 %uint_7 + %67 = OpIAdd %uint %65 %66 + %68 = OpIAdd %uint %67 %uint_4 + %70 = OpULessThanEqual %bool %68 %64 + %71 = OpSelect %uint %70 %65 %uint_0 + %72 = OpSelect %uint %70 %uint_16 %uint_4 + %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %74 = OpAccessChain %_ptr_StorageBuffer_v2int %73 %71 + OpCooperativeMatrixStoreKHR %74 %m %uint_1 %72 NonPrivatePointer + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %79 = OpArrayLength %uint %12 0 + %80 = OpBitcast %uint %int_0 + %81 = OpIMul %uint %uint_16 %uint_7 + %82 = OpIAdd %uint %80 %81 + %83 = OpIAdd %uint %82 %uint_2 + %85 = OpULessThanEqual %bool %83 %79 + %86 = OpSelect %uint %85 %80 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_2 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpBitcast %uint %int_0 + %96 = OpIMul %uint %uint_16 %uint_7 + %97 = OpIAdd %uint %95 %96 + %98 = OpIAdd %uint %97 %uint_2 + %99 = OpULessThanEqual %bool %98 %94 + %100 = OpSelect %uint %99 %95 %uint_0 + %101 = OpSelect %uint %99 %uint_16 %uint_2 + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %103 = OpAccessChain %_ptr_StorageBuffer_v4uint %102 %100 + OpCooperativeMatrixStoreKHR %103 %m %uint_1 %101 NonPrivatePointer + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %108 = OpArrayLength %uint %23 0 + %109 = OpBitcast %uint %int_0 + %110 = OpIMul %uint %uint_16 %uint_7 + %111 = OpIAdd %uint %109 %110 + %112 = OpIAdd %uint %111 %uint_8 + %113 = OpULessThanEqual %bool %112 %108 + %114 = OpSelect %uint %113 %109 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_8 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v2half %116 %114 + OpCooperativeMatrixStoreKHR %117 %m %uint_1 %115 NonPrivatePointer + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %122 = OpArrayLength %uint %29 0 + %123 = OpBitcast %uint %int_0 + %124 = OpIMul %uint %uint_16 %uint_7 + %125 = OpIAdd %uint %123 %124 + %126 = OpIAdd %uint %125 %uint_4 + %127 = OpULessThanEqual %bool %126 %122 + %128 = OpSelect %uint %127 %123 %uint_0 + %129 = OpSelect %uint %127 %uint_16 %uint_4 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_v3half %130 %128 + OpCooperativeMatrixStoreKHR %131 %m %uint_1 %129 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl index 74536d6..07d68dd 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -19,17 +19,17 @@ uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= ((v_3 / 8u) * 2u)); + bool v_5 = (((v_4 + (16u * 7u)) + 4u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_8 = (((v_7 + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 4u) + 8u) <= ((v_9 / 16u) * 4u)); + bool v_11 = (((v_10 + (16u * 7u)) + 2u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_12 = 0u; out5.GetDimensions(v_12); @@ -39,7 +39,7 @@ uint v_15 = 0u; out6.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 2u) + 8u) <= ((v_15 / 8u) * 2u)); + bool v_17 = (((v_16 + (16u * 7u)) + 4u) <= (v_15 / 8u)); m.Store(out6, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 4u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_row_major.wgsl.expected.msl index 86a3647..5df217e 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_row_major.wgsl.expected.msl
@@ -51,18 +51,18 @@ bool const v_3 = (((v_2 + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_0); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out0) + (select(0u, v_2, v_3) * 4u)), ulong((select(8u, 16u, v_3) * 1u)), ulong2(0ul), false)); uint const v_4 = as_type<uint>(0); - bool const v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_1 * 2u)); + bool const v_5 = (((v_4 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_1); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out1) + (select(0u, v_4, v_5) * 8u)), ulong((select(4u, 16u, v_5) * 2u)), ulong2(0ul), false)); uint const v_6 = as_type<uint>(0); - bool const v_7 = ((((v_6 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_2 * 4u)); + bool const v_7 = (((v_6 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_2); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out2) + (select(0u, v_6, v_7) * 16u)), ulong((select(2u, 16u, v_7) * 4u)), ulong2(0ul), false)); uint const v_8 = as_type<uint>(0); - bool const v_9 = ((((v_8 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_3 * 4u)); + bool const v_9 = (((v_8 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_3); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out3) + (select(0u, v_8, v_9) * 16u)), ulong((select(2u, 16u, v_9) * 4u)), ulong2(0ul), false)); uint const v_10 = as_type<uint>(0); bool const v_11 = (((v_10 + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out5) + (select(0u, v_10, v_11) * 4u)), ulong((select(8u, 16u, v_11) * 1u)), ulong2(0ul), false)); uint const v_12 = as_type<uint>(0); - bool const v_13 = ((((v_12 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_13 = (((v_12 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out6) + (select(0u, v_12, v_13) * 8u)), ulong((select(4u, 16u, v_13) * 2u)), ulong2(0ul), false)); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_row_major.wgsl.expected.spvasm index 6e09807..c4b4017 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_f32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 141 +; Bound: 133 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -105,10 +105,10 @@ %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -132,71 +132,63 @@ OpCooperativeMatrixStoreKHR %58 %m %uint_0 %56 NonPrivatePointer %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %63 = OpArrayLength %uint %6 0 - %64 = OpIMul %uint %63 %uint_2 - %66 = OpBitcast %uint %int_0 - %67 = OpIMul %uint %uint_16 %uint_7 - %68 = OpIAdd %uint %66 %67 - %69 = OpIMul %uint %68 %uint_2 - %70 = OpIAdd %uint %69 %uint_8 - %71 = OpULessThanEqual %bool %70 %64 - %72 = OpSelect %uint %71 %66 %uint_0 - %73 = OpSelect %uint %71 %uint_16 %uint_4 - %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %72 - OpCooperativeMatrixStoreKHR %76 %m %uint_0 %73 NonPrivatePointer - %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %81 = OpArrayLength %uint %12 0 - %82 = OpIMul %uint %81 %uint_4 - %83 = OpBitcast %uint %int_0 - %84 = OpIMul %uint %uint_16 %uint_7 - %85 = OpIAdd %uint %83 %84 - %86 = OpIMul %uint %85 %uint_4 - %87 = OpIAdd %uint %86 %uint_8 - %88 = OpULessThanEqual %bool %87 %82 - %89 = OpSelect %uint %88 %83 %uint_0 - %90 = OpSelect %uint %88 %uint_16 %uint_2 - %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %92 = OpAccessChain %_ptr_StorageBuffer_v3float %91 %89 - OpCooperativeMatrixStoreKHR %92 %m %uint_0 %90 NonPrivatePointer - %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %97 = OpArrayLength %uint %18 0 - %98 = OpIMul %uint %97 %uint_4 - %99 = OpBitcast %uint %int_0 - %100 = OpIMul %uint %uint_16 %uint_7 - %101 = OpIAdd %uint %99 %100 - %102 = OpIMul %uint %101 %uint_4 - %103 = OpIAdd %uint %102 %uint_8 - %104 = OpULessThanEqual %bool %103 %98 - %105 = OpSelect %uint %104 %99 %uint_0 - %106 = OpSelect %uint %104 %uint_16 %uint_2 - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %108 = OpAccessChain %_ptr_StorageBuffer_v4uint %107 %105 - OpCooperativeMatrixStoreKHR %108 %m %uint_0 %106 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %113 = OpArrayLength %uint %23 0 - %114 = OpBitcast %uint %int_0 - %115 = OpIMul %uint %uint_16 %uint_7 - %116 = OpIAdd %uint %114 %115 - %117 = OpIAdd %uint %116 %uint_8 - %118 = OpULessThanEqual %bool %117 %113 - %119 = OpSelect %uint %118 %114 %uint_0 - %120 = OpSelect %uint %118 %uint_16 %uint_8 - %121 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %122 = OpAccessChain %_ptr_StorageBuffer_v2half %121 %119 - OpCooperativeMatrixStoreKHR %122 %m %uint_0 %120 NonPrivatePointer - %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %127 = OpArrayLength %uint %29 0 - %128 = OpIMul %uint %127 %uint_2 - %129 = OpBitcast %uint %int_0 - %130 = OpIMul %uint %uint_16 %uint_7 - %131 = OpIAdd %uint %129 %130 - %132 = OpIMul %uint %131 %uint_2 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %uint_16 %uint_4 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_v3half %137 %135 - OpCooperativeMatrixStoreKHR %138 %m %uint_0 %136 NonPrivatePointer + %64 = OpBitcast %uint %int_0 + %65 = OpIMul %uint %uint_16 %uint_7 + %66 = OpIAdd %uint %64 %65 + %67 = OpIAdd %uint %66 %uint_4 + %69 = OpULessThanEqual %bool %67 %63 + %70 = OpSelect %uint %69 %64 %uint_0 + %71 = OpSelect %uint %69 %uint_16 %uint_4 + %72 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %73 = OpAccessChain %_ptr_StorageBuffer_v2int %72 %70 + OpCooperativeMatrixStoreKHR %73 %m %uint_0 %71 NonPrivatePointer + %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %78 = OpArrayLength %uint %12 0 + %79 = OpBitcast %uint %int_0 + %80 = OpIMul %uint %uint_16 %uint_7 + %81 = OpIAdd %uint %79 %80 + %82 = OpIAdd %uint %81 %uint_2 + %84 = OpULessThanEqual %bool %82 %78 + %85 = OpSelect %uint %84 %79 %uint_0 + %86 = OpSelect %uint %84 %uint_16 %uint_2 + %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %88 = OpAccessChain %_ptr_StorageBuffer_v3float %87 %85 + OpCooperativeMatrixStoreKHR %88 %m %uint_0 %86 NonPrivatePointer + %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %93 = OpArrayLength %uint %18 0 + %94 = OpBitcast %uint %int_0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %94 %95 + %97 = OpIAdd %uint %96 %uint_2 + %98 = OpULessThanEqual %bool %97 %93 + %99 = OpSelect %uint %98 %94 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_2 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_0 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpBitcast %uint %int_0 + %109 = OpIMul %uint %uint_16 %uint_7 + %110 = OpIAdd %uint %108 %109 + %111 = OpIAdd %uint %110 %uint_8 + %112 = OpULessThanEqual %bool %111 %107 + %113 = OpSelect %uint %112 %108 %uint_0 + %114 = OpSelect %uint %112 %uint_16 %uint_8 + %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_v2half %115 %113 + OpCooperativeMatrixStoreKHR %116 %m %uint_0 %114 NonPrivatePointer + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %121 = OpArrayLength %uint %29 0 + %122 = OpBitcast %uint %int_0 + %123 = OpIMul %uint %uint_16 %uint_7 + %124 = OpIAdd %uint %122 %123 + %125 = OpIAdd %uint %124 %uint_4 + %126 = OpULessThanEqual %bool %125 %121 + %127 = OpSelect %uint %126 %122 %uint_0 + %128 = OpSelect %uint %126 %uint_16 %uint_4 + %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %130 = OpAccessChain %_ptr_StorageBuffer_v3half %129 %127 + OpCooperativeMatrixStoreKHR %130 %m %uint_0 %128 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl index 1c98411..dd50484 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -17,15 +17,15 @@ m.Store(out0, (0u + (select(v_1, 0u, 0u) * 4u)), (select(v_1, 16u, 8u) * 4u), MatrixLayout::ColMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_2 / 8u) * 2u)); + bool v_3 = (((0u + (16u * 7u)) + 4u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 4u)), (select(v_3, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_4 / 16u) * 4u)); + bool v_5 = (((0u + (16u * 7u)) + 2u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 4u)), (select(v_5, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_7 = (((0u + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 4u)), (select(v_7, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_8 = 0u; out5.GetDimensions(v_8); @@ -33,7 +33,7 @@ m.Store(out5, (0u + (select(v_9, 0u, 0u) * 4u)), (select(v_9, 16u, 8u) * 4u), MatrixLayout::ColMajor); uint v_10 = 0u; out6.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_10 / 8u) * 2u)); + bool v_11 = (((0u + (16u * 7u)) + 4u) <= (v_10 / 8u)); m.Store(out6, (0u + (select(v_11, 0u, 0u) * 4u)), (select(v_11, 16u, 4u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_col_major.wgsl.expected.spvasm index 3c6b440..6bd3aa4 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 135 +; Bound: 127 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -105,10 +105,10 @@ %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -131,66 +131,58 @@ OpCooperativeMatrixStoreKHR %56 %m %uint_1 %54 NonPrivatePointer %60 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %62 = OpArrayLength %uint %6 0 - %63 = OpIMul %uint %62 %uint_2 - %65 = OpIMul %uint %uint_16 %uint_7 - %66 = OpIAdd %uint %uint_0 %65 - %67 = OpIMul %uint %66 %uint_2 - %68 = OpIAdd %uint %67 %uint_8 - %69 = OpULessThanEqual %bool %68 %63 - %70 = OpSelect %uint %69 %uint_0 %uint_0 - %71 = OpSelect %uint %69 %uint_16 %uint_4 - %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %74 = OpAccessChain %_ptr_StorageBuffer_v2int %73 %70 - OpCooperativeMatrixStoreKHR %74 %m %uint_1 %71 NonPrivatePointer - %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %79 = OpArrayLength %uint %12 0 - %80 = OpIMul %uint %79 %uint_4 - %81 = OpIMul %uint %uint_16 %uint_7 - %82 = OpIAdd %uint %uint_0 %81 - %83 = OpIMul %uint %82 %uint_4 - %84 = OpIAdd %uint %83 %uint_8 - %85 = OpULessThanEqual %bool %84 %80 - %86 = OpSelect %uint %85 %uint_0 %uint_0 - %87 = OpSelect %uint %85 %uint_16 %uint_2 - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 - OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %94 = OpArrayLength %uint %18 0 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIMul %uint %uint_16 %uint_7 - %97 = OpIAdd %uint %uint_0 %96 - %98 = OpIMul %uint %97 %uint_4 - %99 = OpIAdd %uint %98 %uint_8 - %100 = OpULessThanEqual %bool %99 %95 - %101 = OpSelect %uint %100 %uint_0 %uint_0 - %102 = OpSelect %uint %100 %uint_16 %uint_2 - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v4uint %103 %101 - OpCooperativeMatrixStoreKHR %104 %m %uint_1 %102 NonPrivatePointer - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %109 = OpArrayLength %uint %23 0 - %110 = OpIMul %uint %uint_16 %uint_7 - %111 = OpIAdd %uint %uint_0 %110 - %112 = OpIAdd %uint %111 %uint_8 - %113 = OpULessThanEqual %bool %112 %109 - %114 = OpSelect %uint %113 %uint_0 %uint_0 - %115 = OpSelect %uint %113 %uint_16 %uint_8 - %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %117 = OpAccessChain %_ptr_StorageBuffer_v2half %116 %114 - OpCooperativeMatrixStoreKHR %117 %m %uint_1 %115 NonPrivatePointer - %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %122 = OpArrayLength %uint %29 0 - %123 = OpIMul %uint %122 %uint_2 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %uint_0 %124 - %126 = OpIMul %uint %125 %uint_2 - %127 = OpIAdd %uint %126 %uint_8 - %128 = OpULessThanEqual %bool %127 %123 - %129 = OpSelect %uint %128 %uint_0 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_4 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_v3half %131 %129 - OpCooperativeMatrixStoreKHR %132 %m %uint_1 %130 NonPrivatePointer + %63 = OpIMul %uint %uint_16 %uint_7 + %64 = OpIAdd %uint %uint_0 %63 + %65 = OpIAdd %uint %64 %uint_4 + %67 = OpULessThanEqual %bool %65 %62 + %68 = OpSelect %uint %67 %uint_0 %uint_0 + %69 = OpSelect %uint %67 %uint_16 %uint_4 + %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %71 = OpAccessChain %_ptr_StorageBuffer_v2int %70 %68 + OpCooperativeMatrixStoreKHR %71 %m %uint_1 %69 NonPrivatePointer + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %76 = OpArrayLength %uint %12 0 + %77 = OpIMul %uint %uint_16 %uint_7 + %78 = OpIAdd %uint %uint_0 %77 + %79 = OpIAdd %uint %78 %uint_2 + %81 = OpULessThanEqual %bool %79 %76 + %82 = OpSelect %uint %81 %uint_0 %uint_0 + %83 = OpSelect %uint %81 %uint_16 %uint_2 + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %85 = OpAccessChain %_ptr_StorageBuffer_v3float %84 %82 + OpCooperativeMatrixStoreKHR %85 %m %uint_1 %83 NonPrivatePointer + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %90 = OpArrayLength %uint %18 0 + %91 = OpIMul %uint %uint_16 %uint_7 + %92 = OpIAdd %uint %uint_0 %91 + %93 = OpIAdd %uint %92 %uint_2 + %94 = OpULessThanEqual %bool %93 %90 + %95 = OpSelect %uint %94 %uint_0 %uint_0 + %96 = OpSelect %uint %94 %uint_16 %uint_2 + %97 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %98 = OpAccessChain %_ptr_StorageBuffer_v4uint %97 %95 + OpCooperativeMatrixStoreKHR %98 %m %uint_1 %96 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %103 = OpArrayLength %uint %23 0 + %104 = OpIMul %uint %uint_16 %uint_7 + %105 = OpIAdd %uint %uint_0 %104 + %106 = OpIAdd %uint %105 %uint_8 + %107 = OpULessThanEqual %bool %106 %103 + %108 = OpSelect %uint %107 %uint_0 %uint_0 + %109 = OpSelect %uint %107 %uint_16 %uint_8 + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %111 = OpAccessChain %_ptr_StorageBuffer_v2half %110 %108 + OpCooperativeMatrixStoreKHR %111 %m %uint_1 %109 NonPrivatePointer + %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %116 = OpArrayLength %uint %29 0 + %117 = OpIMul %uint %uint_16 %uint_7 + %118 = OpIAdd %uint %uint_0 %117 + %119 = OpIAdd %uint %118 %uint_4 + %120 = OpULessThanEqual %bool %119 %116 + %121 = OpSelect %uint %120 %uint_0 %uint_0 + %122 = OpSelect %uint %120 %uint_16 %uint_4 + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %124 = OpAccessChain %_ptr_StorageBuffer_v3half %123 %121 + OpCooperativeMatrixStoreKHR %124 %m %uint_1 %122 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl index e85a0aa..7005809 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -17,15 +17,15 @@ m.Store(out0, (0u + (select(v_1, 0u, 0u) * 4u)), (select(v_1, 16u, 8u) * 4u), MatrixLayout::RowMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_2 / 8u) * 2u)); + bool v_3 = (((0u + (16u * 7u)) + 4u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 4u)), (select(v_3, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_4 / 16u) * 4u)); + bool v_5 = (((0u + (16u * 7u)) + 2u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 4u)), (select(v_5, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_7 = (((0u + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 4u)), (select(v_7, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_8 = 0u; out5.GetDimensions(v_8); @@ -33,7 +33,7 @@ m.Store(out5, (0u + (select(v_9, 0u, 0u) * 4u)), (select(v_9, 16u, 8u) * 4u), MatrixLayout::RowMajor); uint v_10 = 0u; out6.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_10 / 8u) * 2u)); + bool v_11 = (((0u + (16u * 7u)) + 4u) <= (v_10 / 8u)); m.Store(out6, (0u + (select(v_11, 0u, 0u) * 4u)), (select(v_11, 16u, 4u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_row_major.wgsl.expected.spvasm index 17fc468..095e6cb 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_i32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 134 +; Bound: 126 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -104,10 +104,10 @@ %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -130,66 +130,58 @@ OpCooperativeMatrixStoreKHR %56 %m %uint_0 %54 NonPrivatePointer %59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %61 = OpArrayLength %uint %6 0 - %62 = OpIMul %uint %61 %uint_2 - %64 = OpIMul %uint %uint_16 %uint_7 - %65 = OpIAdd %uint %uint_0 %64 - %66 = OpIMul %uint %65 %uint_2 - %67 = OpIAdd %uint %66 %uint_8 - %68 = OpULessThanEqual %bool %67 %62 - %69 = OpSelect %uint %68 %uint_0 %uint_0 - %70 = OpSelect %uint %68 %uint_16 %uint_4 - %72 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %73 = OpAccessChain %_ptr_StorageBuffer_v2int %72 %69 - OpCooperativeMatrixStoreKHR %73 %m %uint_0 %70 NonPrivatePointer - %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %78 = OpArrayLength %uint %12 0 - %79 = OpIMul %uint %78 %uint_4 - %80 = OpIMul %uint %uint_16 %uint_7 - %81 = OpIAdd %uint %uint_0 %80 - %82 = OpIMul %uint %81 %uint_4 - %83 = OpIAdd %uint %82 %uint_8 - %84 = OpULessThanEqual %bool %83 %79 - %85 = OpSelect %uint %84 %uint_0 %uint_0 - %86 = OpSelect %uint %84 %uint_16 %uint_2 - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %88 = OpAccessChain %_ptr_StorageBuffer_v3float %87 %85 - OpCooperativeMatrixStoreKHR %88 %m %uint_0 %86 NonPrivatePointer - %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %93 = OpArrayLength %uint %18 0 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIMul %uint %uint_16 %uint_7 - %96 = OpIAdd %uint %uint_0 %95 - %97 = OpIMul %uint %96 %uint_4 - %98 = OpIAdd %uint %97 %uint_8 - %99 = OpULessThanEqual %bool %98 %94 - %100 = OpSelect %uint %99 %uint_0 %uint_0 - %101 = OpSelect %uint %99 %uint_16 %uint_2 - %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %103 = OpAccessChain %_ptr_StorageBuffer_v4uint %102 %100 - OpCooperativeMatrixStoreKHR %103 %m %uint_0 %101 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %108 = OpArrayLength %uint %23 0 - %109 = OpIMul %uint %uint_16 %uint_7 - %110 = OpIAdd %uint %uint_0 %109 - %111 = OpIAdd %uint %110 %uint_8 - %112 = OpULessThanEqual %bool %111 %108 - %113 = OpSelect %uint %112 %uint_0 %uint_0 - %114 = OpSelect %uint %112 %uint_16 %uint_8 - %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %116 = OpAccessChain %_ptr_StorageBuffer_v2half %115 %113 - OpCooperativeMatrixStoreKHR %116 %m %uint_0 %114 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %121 = OpArrayLength %uint %29 0 - %122 = OpIMul %uint %121 %uint_2 - %123 = OpIMul %uint %uint_16 %uint_7 - %124 = OpIAdd %uint %uint_0 %123 - %125 = OpIMul %uint %124 %uint_2 - %126 = OpIAdd %uint %125 %uint_8 - %127 = OpULessThanEqual %bool %126 %122 - %128 = OpSelect %uint %127 %uint_0 %uint_0 - %129 = OpSelect %uint %127 %uint_16 %uint_4 - %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %131 = OpAccessChain %_ptr_StorageBuffer_v3half %130 %128 - OpCooperativeMatrixStoreKHR %131 %m %uint_0 %129 NonPrivatePointer + %62 = OpIMul %uint %uint_16 %uint_7 + %63 = OpIAdd %uint %uint_0 %62 + %64 = OpIAdd %uint %63 %uint_4 + %66 = OpULessThanEqual %bool %64 %61 + %67 = OpSelect %uint %66 %uint_0 %uint_0 + %68 = OpSelect %uint %66 %uint_16 %uint_4 + %69 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %70 = OpAccessChain %_ptr_StorageBuffer_v2int %69 %67 + OpCooperativeMatrixStoreKHR %70 %m %uint_0 %68 NonPrivatePointer + %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %75 = OpArrayLength %uint %12 0 + %76 = OpIMul %uint %uint_16 %uint_7 + %77 = OpIAdd %uint %uint_0 %76 + %78 = OpIAdd %uint %77 %uint_2 + %80 = OpULessThanEqual %bool %78 %75 + %81 = OpSelect %uint %80 %uint_0 %uint_0 + %82 = OpSelect %uint %80 %uint_16 %uint_2 + %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %84 = OpAccessChain %_ptr_StorageBuffer_v3float %83 %81 + OpCooperativeMatrixStoreKHR %84 %m %uint_0 %82 NonPrivatePointer + %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %89 = OpArrayLength %uint %18 0 + %90 = OpIMul %uint %uint_16 %uint_7 + %91 = OpIAdd %uint %uint_0 %90 + %92 = OpIAdd %uint %91 %uint_2 + %93 = OpULessThanEqual %bool %92 %89 + %94 = OpSelect %uint %93 %uint_0 %uint_0 + %95 = OpSelect %uint %93 %uint_16 %uint_2 + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %97 = OpAccessChain %_ptr_StorageBuffer_v4uint %96 %94 + OpCooperativeMatrixStoreKHR %97 %m %uint_0 %95 NonPrivatePointer + %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %102 = OpArrayLength %uint %23 0 + %103 = OpIMul %uint %uint_16 %uint_7 + %104 = OpIAdd %uint %uint_0 %103 + %105 = OpIAdd %uint %104 %uint_8 + %106 = OpULessThanEqual %bool %105 %102 + %107 = OpSelect %uint %106 %uint_0 %uint_0 + %108 = OpSelect %uint %106 %uint_16 %uint_8 + %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %110 = OpAccessChain %_ptr_StorageBuffer_v2half %109 %107 + OpCooperativeMatrixStoreKHR %110 %m %uint_0 %108 NonPrivatePointer + %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %115 = OpArrayLength %uint %29 0 + %116 = OpIMul %uint %uint_16 %uint_7 + %117 = OpIAdd %uint %uint_0 %116 + %118 = OpIAdd %uint %117 %uint_4 + %119 = OpULessThanEqual %bool %118 %115 + %120 = OpSelect %uint %119 %uint_0 %uint_0 + %121 = OpSelect %uint %119 %uint_16 %uint_4 + %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %123 = OpAccessChain %_ptr_StorageBuffer_v3half %122 %120 + OpCooperativeMatrixStoreKHR %123 %m %uint_0 %121 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl index 780ce2f..bd56dbe 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -15,37 +15,37 @@ uint v = 0u; out0.GetDimensions(v); uint v_1 = asuint(int(0)); - bool v_2 = ((((v_1 + (16u * 7u)) * 4u) + 8u) <= ((v / 4u) * 4u)); + bool v_2 = (((v_1 + (16u * 7u)) + 2u) <= (v / 4u)); m.Store(out0, (0u + (select(v_2, v_1, 0u) * 4u)), (select(v_2, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 8u) + 8u) <= ((v_3 / 8u) * 8u)); + bool v_5 = (((v_4 + (16u * 7u)) + 1u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 16u) + 16u) <= ((v_6 / 16u) * 16u)); + bool v_8 = (((v_7 + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 16u) + 16u) <= ((v_9 / 16u) * 16u)); + bool v_11 = (((v_10 + (16u * 7u)) + 1u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_12 = 0u; out4.GetDimensions(v_12); uint v_13 = asuint(int(0)); - bool v_14 = ((((v_13 + (16u * 7u)) * 2u) + 8u) <= ((v_12 / 2u) * 2u)); + bool v_14 = (((v_13 + (16u * 7u)) + 4u) <= (v_12 / 2u)); m.Store(out4, (0u + (select(v_14, v_13, 0u) * 4u)), (select(v_14, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; out5.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 4u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 4u)); m.Store(out5, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_18 = 0u; out6.GetDimensions(v_18); uint v_19 = asuint(int(0)); - bool v_20 = ((((v_19 + (16u * 7u)) * 8u) + 8u) <= ((v_18 / 8u) * 8u)); + bool v_20 = (((v_19 + (16u * 7u)) + 1u) <= (v_18 / 8u)); m.Store(out6, (0u + (select(v_20, v_19, 0u) * 4u)), (select(v_20, 16u, 1u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_col_major.wgsl.expected.spvasm index 04c6124..a3cfdf4 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 167 +; Bound: 153 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -112,12 +112,11 @@ %43 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_0 %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int @@ -127,6 +126,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -136,101 +136,87 @@ %41 = OpLabel %48 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %50 = OpArrayLength %uint %1 0 - %51 = OpIMul %uint %50 %uint_4 - %53 = OpBitcast %uint %int_0 - %55 = OpIMul %uint %uint_16 %uint_7 - %58 = OpIAdd %uint %53 %55 - %59 = OpIMul %uint %58 %uint_4 - %60 = OpIAdd %uint %59 %uint_8 - %61 = OpULessThanEqual %bool %60 %51 - %63 = OpSelect %uint %61 %53 %uint_0 - %64 = OpSelect %uint %61 %uint_16 %uint_2 - %66 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %67 = OpAccessChain %_ptr_StorageBuffer_uint %66 %63 - OpCooperativeMatrixStoreKHR %67 %m %uint_1 %64 NonPrivatePointer - %71 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %73 = OpArrayLength %uint %6 0 - %74 = OpIMul %uint %73 %uint_8 - %75 = OpBitcast %uint %int_0 - %76 = OpIMul %uint %uint_16 %uint_7 - %77 = OpIAdd %uint %75 %76 - %78 = OpIMul %uint %77 %uint_8 - %79 = OpIAdd %uint %78 %uint_8 - %80 = OpULessThanEqual %bool %79 %74 - %81 = OpSelect %uint %80 %75 %uint_0 - %82 = OpSelect %uint %80 %uint_16 %uint_1 - %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %83 %81 - OpCooperativeMatrixStoreKHR %84 %m %uint_1 %82 NonPrivatePointer - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %89 = OpArrayLength %uint %12 0 - %90 = OpIMul %uint %89 %uint_16 - %91 = OpBitcast %uint %int_0 - %92 = OpIMul %uint %uint_16 %uint_7 - %93 = OpIAdd %uint %91 %92 - %94 = OpIMul %uint %93 %uint_16 - %95 = OpIAdd %uint %94 %uint_16 - %96 = OpULessThanEqual %bool %95 %90 - %97 = OpSelect %uint %96 %91 %uint_0 - %98 = OpSelect %uint %96 %uint_16 %uint_1 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_v3float %99 %97 - OpCooperativeMatrixStoreKHR %100 %m %uint_1 %98 NonPrivatePointer - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %105 = OpArrayLength %uint %18 0 - %106 = OpIMul %uint %105 %uint_16 - %107 = OpBitcast %uint %int_0 - %108 = OpIMul %uint %uint_16 %uint_7 - %109 = OpIAdd %uint %107 %108 - %110 = OpIMul %uint %109 %uint_16 - %111 = OpIAdd %uint %110 %uint_16 - %112 = OpULessThanEqual %bool %111 %106 - %113 = OpSelect %uint %112 %107 %uint_0 - %114 = OpSelect %uint %112 %uint_16 %uint_1 - %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %116 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %113 - OpCooperativeMatrixStoreKHR %116 %m %uint_1 %114 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %121 = OpArrayLength %uint %23 0 - %122 = OpIMul %uint %121 %uint_2 - %123 = OpBitcast %uint %int_0 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %123 %124 - %126 = OpIMul %uint %125 %uint_2 - %127 = OpIAdd %uint %126 %uint_8 - %128 = OpULessThanEqual %bool %127 %122 - %129 = OpSelect %uint %128 %123 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_4 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_half %131 %129 - OpCooperativeMatrixStoreKHR %132 %m %uint_1 %130 NonPrivatePointer + %51 = OpBitcast %uint %int_0 + %53 = OpIMul %uint %uint_16 %uint_7 + %56 = OpIAdd %uint %51 %53 + %57 = OpIAdd %uint %56 %uint_2 + %59 = OpULessThanEqual %bool %57 %50 + %61 = OpSelect %uint %59 %51 %uint_0 + %62 = OpSelect %uint %59 %uint_16 %uint_2 + %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %61 + OpCooperativeMatrixStoreKHR %64 %m %uint_1 %62 NonPrivatePointer + %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %70 = OpArrayLength %uint %6 0 + %71 = OpBitcast %uint %int_0 + %72 = OpIMul %uint %uint_16 %uint_7 + %73 = OpIAdd %uint %71 %72 + %74 = OpIAdd %uint %73 %uint_1 + %75 = OpULessThanEqual %bool %74 %70 + %76 = OpSelect %uint %75 %71 %uint_0 + %77 = OpSelect %uint %75 %uint_16 %uint_1 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_v2int %78 %76 + OpCooperativeMatrixStoreKHR %79 %m %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %84 = OpArrayLength %uint %12 0 + %85 = OpBitcast %uint %int_0 + %86 = OpIMul %uint %uint_16 %uint_7 + %87 = OpIAdd %uint %85 %86 + %88 = OpIAdd %uint %87 %uint_1 + %89 = OpULessThanEqual %bool %88 %84 + %90 = OpSelect %uint %89 %85 %uint_0 + %91 = OpSelect %uint %89 %uint_16 %uint_1 + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 + OpCooperativeMatrixStoreKHR %93 %m %uint_1 %91 NonPrivatePointer + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %98 = OpArrayLength %uint %18 0 + %99 = OpBitcast %uint %int_0 + %100 = OpIMul %uint %uint_16 %uint_7 + %101 = OpIAdd %uint %99 %100 + %102 = OpIAdd %uint %101 %uint_1 + %103 = OpULessThanEqual %bool %102 %98 + %104 = OpSelect %uint %103 %99 %uint_0 + %105 = OpSelect %uint %103 %uint_16 %uint_1 + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %107 = OpAccessChain %_ptr_StorageBuffer_v4uint %106 %104 + OpCooperativeMatrixStoreKHR %107 %m %uint_1 %105 NonPrivatePointer + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %112 = OpArrayLength %uint %23 0 + %113 = OpBitcast %uint %int_0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %113 %114 + %116 = OpIAdd %uint %115 %uint_4 + %118 = OpULessThanEqual %bool %116 %112 + %119 = OpSelect %uint %118 %113 %uint_0 + %120 = OpSelect %uint %118 %uint_16 %uint_4 + %121 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %122 = OpAccessChain %_ptr_StorageBuffer_half %121 %119 + OpCooperativeMatrixStoreKHR %122 %m %uint_1 %120 NonPrivatePointer + %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %127 = OpArrayLength %uint %28 0 + %128 = OpBitcast %uint %int_0 + %129 = OpIMul %uint %uint_16 %uint_7 + %130 = OpIAdd %uint %128 %129 + %131 = OpIAdd %uint %130 %uint_2 + %132 = OpULessThanEqual %bool %131 %127 + %133 = OpSelect %uint %132 %128 %uint_0 + %134 = OpSelect %uint %132 %uint_16 %uint_2 %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %137 = OpArrayLength %uint %28 0 - %138 = OpIMul %uint %137 %uint_4 - %139 = OpBitcast %uint %int_0 - %140 = OpIMul %uint %uint_16 %uint_7 - %141 = OpIAdd %uint %139 %140 - %142 = OpIMul %uint %141 %uint_4 - %143 = OpIAdd %uint %142 %uint_8 - %144 = OpULessThanEqual %bool %143 %138 - %145 = OpSelect %uint %144 %139 %uint_0 - %146 = OpSelect %uint %144 %uint_16 %uint_2 - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %148 = OpAccessChain %_ptr_StorageBuffer_v2half %147 %145 - OpCooperativeMatrixStoreKHR %148 %m %uint_1 %146 NonPrivatePointer - %151 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %153 = OpArrayLength %uint %33 0 - %154 = OpIMul %uint %153 %uint_8 - %155 = OpBitcast %uint %int_0 - %156 = OpIMul %uint %uint_16 %uint_7 - %157 = OpIAdd %uint %155 %156 - %158 = OpIMul %uint %157 %uint_8 - %159 = OpIAdd %uint %158 %uint_8 - %160 = OpULessThanEqual %bool %159 %154 - %161 = OpSelect %uint %160 %155 %uint_0 - %162 = OpSelect %uint %160 %uint_16 %uint_1 - %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v3half %163 %161 - OpCooperativeMatrixStoreKHR %164 %m %uint_1 %162 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer_v2half %135 %133 + OpCooperativeMatrixStoreKHR %136 %m %uint_1 %134 NonPrivatePointer + %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %141 = OpArrayLength %uint %33 0 + %142 = OpBitcast %uint %int_0 + %143 = OpIMul %uint %uint_16 %uint_7 + %144 = OpIAdd %uint %142 %143 + %145 = OpIAdd %uint %144 %uint_1 + %146 = OpULessThanEqual %bool %145 %141 + %147 = OpSelect %uint %146 %142 %uint_0 + %148 = OpSelect %uint %146 %uint_16 %uint_1 + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %150 = OpAccessChain %_ptr_StorageBuffer_v3half %149 %147 + OpCooperativeMatrixStoreKHR %150 %m %uint_1 %148 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl index 443e2b3..e71b423 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -15,37 +15,37 @@ uint v = 0u; out0.GetDimensions(v); uint v_1 = asuint(int(0)); - bool v_2 = ((((v_1 + (16u * 7u)) * 4u) + 8u) <= ((v / 4u) * 4u)); + bool v_2 = (((v_1 + (16u * 7u)) + 2u) <= (v / 4u)); m.Store(out0, (0u + (select(v_2, v_1, 0u) * 4u)), (select(v_2, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 8u) + 8u) <= ((v_3 / 8u) * 8u)); + bool v_5 = (((v_4 + (16u * 7u)) + 1u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 16u) + 16u) <= ((v_6 / 16u) * 16u)); + bool v_8 = (((v_7 + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 16u) + 16u) <= ((v_9 / 16u) * 16u)); + bool v_11 = (((v_10 + (16u * 7u)) + 1u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_12 = 0u; out4.GetDimensions(v_12); uint v_13 = asuint(int(0)); - bool v_14 = ((((v_13 + (16u * 7u)) * 2u) + 8u) <= ((v_12 / 2u) * 2u)); + bool v_14 = (((v_13 + (16u * 7u)) + 4u) <= (v_12 / 2u)); m.Store(out4, (0u + (select(v_14, v_13, 0u) * 4u)), (select(v_14, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_15 = 0u; out5.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 4u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 4u)); m.Store(out5, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_18 = 0u; out6.GetDimensions(v_18); uint v_19 = asuint(int(0)); - bool v_20 = ((((v_19 + (16u * 7u)) * 8u) + 8u) <= ((v_18 / 8u) * 8u)); + bool v_20 = (((v_19 + (16u * 7u)) + 1u) <= (v_18 / 8u)); m.Store(out6, (0u + (select(v_20, v_19, 0u) * 4u)), (select(v_20, 16u, 1u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_row_major.wgsl.expected.spvasm index d70b0f7..c0f6a91 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_i8_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 167 +; Bound: 153 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -112,12 +112,11 @@ %43 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_0 %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int %uint_1 = OpConstant %uint 1 @@ -127,6 +126,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -136,101 +136,87 @@ %41 = OpLabel %48 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %50 = OpArrayLength %uint %1 0 - %51 = OpIMul %uint %50 %uint_4 - %53 = OpBitcast %uint %int_0 - %55 = OpIMul %uint %uint_16 %uint_7 - %58 = OpIAdd %uint %53 %55 - %59 = OpIMul %uint %58 %uint_4 - %60 = OpIAdd %uint %59 %uint_8 - %61 = OpULessThanEqual %bool %60 %51 - %63 = OpSelect %uint %61 %53 %uint_0 - %64 = OpSelect %uint %61 %uint_16 %uint_2 - %66 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %67 = OpAccessChain %_ptr_StorageBuffer_uint %66 %63 - OpCooperativeMatrixStoreKHR %67 %m %uint_0 %64 NonPrivatePointer - %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %72 = OpArrayLength %uint %6 0 - %73 = OpIMul %uint %72 %uint_8 - %74 = OpBitcast %uint %int_0 - %75 = OpIMul %uint %uint_16 %uint_7 - %76 = OpIAdd %uint %74 %75 - %77 = OpIMul %uint %76 %uint_8 - %78 = OpIAdd %uint %77 %uint_8 - %79 = OpULessThanEqual %bool %78 %73 - %80 = OpSelect %uint %79 %74 %uint_0 - %81 = OpSelect %uint %79 %uint_16 %uint_1 - %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %83 %80 - OpCooperativeMatrixStoreKHR %84 %m %uint_0 %81 NonPrivatePointer - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %89 = OpArrayLength %uint %12 0 - %90 = OpIMul %uint %89 %uint_16 - %91 = OpBitcast %uint %int_0 - %92 = OpIMul %uint %uint_16 %uint_7 - %93 = OpIAdd %uint %91 %92 - %94 = OpIMul %uint %93 %uint_16 - %95 = OpIAdd %uint %94 %uint_16 - %96 = OpULessThanEqual %bool %95 %90 - %97 = OpSelect %uint %96 %91 %uint_0 - %98 = OpSelect %uint %96 %uint_16 %uint_1 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_v3float %99 %97 - OpCooperativeMatrixStoreKHR %100 %m %uint_0 %98 NonPrivatePointer - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %105 = OpArrayLength %uint %18 0 - %106 = OpIMul %uint %105 %uint_16 - %107 = OpBitcast %uint %int_0 - %108 = OpIMul %uint %uint_16 %uint_7 - %109 = OpIAdd %uint %107 %108 - %110 = OpIMul %uint %109 %uint_16 - %111 = OpIAdd %uint %110 %uint_16 - %112 = OpULessThanEqual %bool %111 %106 - %113 = OpSelect %uint %112 %107 %uint_0 - %114 = OpSelect %uint %112 %uint_16 %uint_1 - %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %116 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %113 - OpCooperativeMatrixStoreKHR %116 %m %uint_0 %114 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %121 = OpArrayLength %uint %23 0 - %122 = OpIMul %uint %121 %uint_2 - %123 = OpBitcast %uint %int_0 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %123 %124 - %126 = OpIMul %uint %125 %uint_2 - %127 = OpIAdd %uint %126 %uint_8 - %128 = OpULessThanEqual %bool %127 %122 - %129 = OpSelect %uint %128 %123 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_4 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_half %131 %129 - OpCooperativeMatrixStoreKHR %132 %m %uint_0 %130 NonPrivatePointer + %51 = OpBitcast %uint %int_0 + %53 = OpIMul %uint %uint_16 %uint_7 + %56 = OpIAdd %uint %51 %53 + %57 = OpIAdd %uint %56 %uint_2 + %59 = OpULessThanEqual %bool %57 %50 + %61 = OpSelect %uint %59 %51 %uint_0 + %62 = OpSelect %uint %59 %uint_16 %uint_2 + %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %61 + OpCooperativeMatrixStoreKHR %64 %m %uint_0 %62 NonPrivatePointer + %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %69 = OpArrayLength %uint %6 0 + %70 = OpBitcast %uint %int_0 + %71 = OpIMul %uint %uint_16 %uint_7 + %72 = OpIAdd %uint %70 %71 + %73 = OpIAdd %uint %72 %uint_1 + %75 = OpULessThanEqual %bool %73 %69 + %76 = OpSelect %uint %75 %70 %uint_0 + %77 = OpSelect %uint %75 %uint_16 %uint_1 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_v2int %78 %76 + OpCooperativeMatrixStoreKHR %79 %m %uint_0 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %84 = OpArrayLength %uint %12 0 + %85 = OpBitcast %uint %int_0 + %86 = OpIMul %uint %uint_16 %uint_7 + %87 = OpIAdd %uint %85 %86 + %88 = OpIAdd %uint %87 %uint_1 + %89 = OpULessThanEqual %bool %88 %84 + %90 = OpSelect %uint %89 %85 %uint_0 + %91 = OpSelect %uint %89 %uint_16 %uint_1 + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 + OpCooperativeMatrixStoreKHR %93 %m %uint_0 %91 NonPrivatePointer + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %98 = OpArrayLength %uint %18 0 + %99 = OpBitcast %uint %int_0 + %100 = OpIMul %uint %uint_16 %uint_7 + %101 = OpIAdd %uint %99 %100 + %102 = OpIAdd %uint %101 %uint_1 + %103 = OpULessThanEqual %bool %102 %98 + %104 = OpSelect %uint %103 %99 %uint_0 + %105 = OpSelect %uint %103 %uint_16 %uint_1 + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %107 = OpAccessChain %_ptr_StorageBuffer_v4uint %106 %104 + OpCooperativeMatrixStoreKHR %107 %m %uint_0 %105 NonPrivatePointer + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %112 = OpArrayLength %uint %23 0 + %113 = OpBitcast %uint %int_0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %113 %114 + %116 = OpIAdd %uint %115 %uint_4 + %118 = OpULessThanEqual %bool %116 %112 + %119 = OpSelect %uint %118 %113 %uint_0 + %120 = OpSelect %uint %118 %uint_16 %uint_4 + %121 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %122 = OpAccessChain %_ptr_StorageBuffer_half %121 %119 + OpCooperativeMatrixStoreKHR %122 %m %uint_0 %120 NonPrivatePointer + %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %127 = OpArrayLength %uint %28 0 + %128 = OpBitcast %uint %int_0 + %129 = OpIMul %uint %uint_16 %uint_7 + %130 = OpIAdd %uint %128 %129 + %131 = OpIAdd %uint %130 %uint_2 + %132 = OpULessThanEqual %bool %131 %127 + %133 = OpSelect %uint %132 %128 %uint_0 + %134 = OpSelect %uint %132 %uint_16 %uint_2 %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %137 = OpArrayLength %uint %28 0 - %138 = OpIMul %uint %137 %uint_4 - %139 = OpBitcast %uint %int_0 - %140 = OpIMul %uint %uint_16 %uint_7 - %141 = OpIAdd %uint %139 %140 - %142 = OpIMul %uint %141 %uint_4 - %143 = OpIAdd %uint %142 %uint_8 - %144 = OpULessThanEqual %bool %143 %138 - %145 = OpSelect %uint %144 %139 %uint_0 - %146 = OpSelect %uint %144 %uint_16 %uint_2 - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %148 = OpAccessChain %_ptr_StorageBuffer_v2half %147 %145 - OpCooperativeMatrixStoreKHR %148 %m %uint_0 %146 NonPrivatePointer - %151 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %153 = OpArrayLength %uint %33 0 - %154 = OpIMul %uint %153 %uint_8 - %155 = OpBitcast %uint %int_0 - %156 = OpIMul %uint %uint_16 %uint_7 - %157 = OpIAdd %uint %155 %156 - %158 = OpIMul %uint %157 %uint_8 - %159 = OpIAdd %uint %158 %uint_8 - %160 = OpULessThanEqual %bool %159 %154 - %161 = OpSelect %uint %160 %155 %uint_0 - %162 = OpSelect %uint %160 %uint_16 %uint_1 - %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v3half %163 %161 - OpCooperativeMatrixStoreKHR %164 %m %uint_0 %162 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer_v2half %135 %133 + OpCooperativeMatrixStoreKHR %136 %m %uint_0 %134 NonPrivatePointer + %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %141 = OpArrayLength %uint %33 0 + %142 = OpBitcast %uint %int_0 + %143 = OpIMul %uint %uint_16 %uint_7 + %144 = OpIAdd %uint %142 %143 + %145 = OpIAdd %uint %144 %uint_1 + %146 = OpULessThanEqual %bool %145 %141 + %147 = OpSelect %uint %146 %142 %uint_0 + %148 = OpSelect %uint %146 %uint_16 %uint_1 + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %150 = OpAccessChain %_ptr_StorageBuffer_v3half %149 %147 + OpCooperativeMatrixStoreKHR %150 %m %uint_0 %148 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl index 06cf5c0..f4e7569 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -19,17 +19,17 @@ uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= ((v_3 / 8u) * 2u)); + bool v_5 = (((v_4 + (16u * 7u)) + 4u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_8 = (((v_7 + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 4u) + 8u) <= ((v_9 / 16u) * 4u)); + bool v_11 = (((v_10 + (16u * 7u)) + 2u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_12 = 0u; out5.GetDimensions(v_12); @@ -39,7 +39,7 @@ uint v_15 = 0u; out6.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 2u) + 8u) <= ((v_15 / 8u) * 2u)); + bool v_17 = (((v_16 + (16u * 7u)) + 4u) <= (v_15 / 8u)); m.Store(out6, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 4u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_col_major.wgsl.expected.spvasm index cd07d9c..2d1bbc4 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 142 +; Bound: 134 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -106,10 +106,10 @@ %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -133,71 +133,63 @@ OpCooperativeMatrixStoreKHR %58 %m %uint_1 %56 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %64 = OpArrayLength %uint %6 0 - %65 = OpIMul %uint %64 %uint_2 - %67 = OpBitcast %uint %int_0 - %68 = OpIMul %uint %uint_16 %uint_7 - %69 = OpIAdd %uint %67 %68 - %70 = OpIMul %uint %69 %uint_2 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %65 - %73 = OpSelect %uint %72 %67 %uint_0 - %74 = OpSelect %uint %72 %uint_16 %uint_4 - %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %77 = OpAccessChain %_ptr_StorageBuffer_v2int %76 %73 - OpCooperativeMatrixStoreKHR %77 %m %uint_1 %74 NonPrivatePointer - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %82 = OpArrayLength %uint %12 0 - %83 = OpIMul %uint %82 %uint_4 - %84 = OpBitcast %uint %int_0 - %85 = OpIMul %uint %uint_16 %uint_7 - %86 = OpIAdd %uint %84 %85 - %87 = OpIMul %uint %86 %uint_4 - %88 = OpIAdd %uint %87 %uint_8 - %89 = OpULessThanEqual %bool %88 %83 - %90 = OpSelect %uint %89 %84 %uint_0 - %91 = OpSelect %uint %89 %uint_16 %uint_2 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 - OpCooperativeMatrixStoreKHR %93 %m %uint_1 %91 NonPrivatePointer - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %98 = OpArrayLength %uint %18 0 - %99 = OpIMul %uint %98 %uint_4 - %100 = OpBitcast %uint %int_0 - %101 = OpIMul %uint %uint_16 %uint_7 - %102 = OpIAdd %uint %100 %101 - %103 = OpIMul %uint %102 %uint_4 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %uint_16 %uint_2 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_v4uint %108 %106 - OpCooperativeMatrixStoreKHR %109 %m %uint_1 %107 NonPrivatePointer - %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %114 = OpArrayLength %uint %23 0 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %114 - %120 = OpSelect %uint %119 %115 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v2half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_1 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %128 = OpArrayLength %uint %29 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpBitcast %uint %int_0 - %131 = OpIMul %uint %uint_16 %uint_7 - %132 = OpIAdd %uint %130 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %129 - %136 = OpSelect %uint %135 %130 %uint_0 - %137 = OpSelect %uint %135 %uint_16 %uint_4 - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_v3half %138 %136 - OpCooperativeMatrixStoreKHR %139 %m %uint_1 %137 NonPrivatePointer + %65 = OpBitcast %uint %int_0 + %66 = OpIMul %uint %uint_16 %uint_7 + %67 = OpIAdd %uint %65 %66 + %68 = OpIAdd %uint %67 %uint_4 + %70 = OpULessThanEqual %bool %68 %64 + %71 = OpSelect %uint %70 %65 %uint_0 + %72 = OpSelect %uint %70 %uint_16 %uint_4 + %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %74 = OpAccessChain %_ptr_StorageBuffer_v2int %73 %71 + OpCooperativeMatrixStoreKHR %74 %m %uint_1 %72 NonPrivatePointer + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %79 = OpArrayLength %uint %12 0 + %80 = OpBitcast %uint %int_0 + %81 = OpIMul %uint %uint_16 %uint_7 + %82 = OpIAdd %uint %80 %81 + %83 = OpIAdd %uint %82 %uint_2 + %85 = OpULessThanEqual %bool %83 %79 + %86 = OpSelect %uint %85 %80 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_2 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpBitcast %uint %int_0 + %96 = OpIMul %uint %uint_16 %uint_7 + %97 = OpIAdd %uint %95 %96 + %98 = OpIAdd %uint %97 %uint_2 + %99 = OpULessThanEqual %bool %98 %94 + %100 = OpSelect %uint %99 %95 %uint_0 + %101 = OpSelect %uint %99 %uint_16 %uint_2 + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %103 = OpAccessChain %_ptr_StorageBuffer_v4uint %102 %100 + OpCooperativeMatrixStoreKHR %103 %m %uint_1 %101 NonPrivatePointer + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %108 = OpArrayLength %uint %23 0 + %109 = OpBitcast %uint %int_0 + %110 = OpIMul %uint %uint_16 %uint_7 + %111 = OpIAdd %uint %109 %110 + %112 = OpIAdd %uint %111 %uint_8 + %113 = OpULessThanEqual %bool %112 %108 + %114 = OpSelect %uint %113 %109 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_8 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v2half %116 %114 + OpCooperativeMatrixStoreKHR %117 %m %uint_1 %115 NonPrivatePointer + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %122 = OpArrayLength %uint %29 0 + %123 = OpBitcast %uint %int_0 + %124 = OpIMul %uint %uint_16 %uint_7 + %125 = OpIAdd %uint %123 %124 + %126 = OpIAdd %uint %125 %uint_4 + %127 = OpULessThanEqual %bool %126 %122 + %128 = OpSelect %uint %127 %123 %uint_0 + %129 = OpSelect %uint %127 %uint_16 %uint_4 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_v3half %130 %128 + OpCooperativeMatrixStoreKHR %131 %m %uint_1 %129 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl index 1ad5f28..be7c39c 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -19,17 +19,17 @@ uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= ((v_3 / 8u) * 2u)); + bool v_5 = (((v_4 + (16u * 7u)) + 4u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_8 = (((v_7 + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 4u) + 8u) <= ((v_9 / 16u) * 4u)); + bool v_11 = (((v_10 + (16u * 7u)) + 2u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_12 = 0u; out5.GetDimensions(v_12); @@ -39,7 +39,7 @@ uint v_15 = 0u; out6.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 2u) + 8u) <= ((v_15 / 8u) * 2u)); + bool v_17 = (((v_16 + (16u * 7u)) + 4u) <= (v_15 / 8u)); m.Store(out6, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 4u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_row_major.wgsl.expected.spvasm index edb9c87..eff8b78 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_u32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 141 +; Bound: 133 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -105,10 +105,10 @@ %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -132,71 +132,63 @@ OpCooperativeMatrixStoreKHR %58 %m %uint_0 %56 NonPrivatePointer %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %63 = OpArrayLength %uint %6 0 - %64 = OpIMul %uint %63 %uint_2 - %66 = OpBitcast %uint %int_0 - %67 = OpIMul %uint %uint_16 %uint_7 - %68 = OpIAdd %uint %66 %67 - %69 = OpIMul %uint %68 %uint_2 - %70 = OpIAdd %uint %69 %uint_8 - %71 = OpULessThanEqual %bool %70 %64 - %72 = OpSelect %uint %71 %66 %uint_0 - %73 = OpSelect %uint %71 %uint_16 %uint_4 - %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %72 - OpCooperativeMatrixStoreKHR %76 %m %uint_0 %73 NonPrivatePointer - %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %81 = OpArrayLength %uint %12 0 - %82 = OpIMul %uint %81 %uint_4 - %83 = OpBitcast %uint %int_0 - %84 = OpIMul %uint %uint_16 %uint_7 - %85 = OpIAdd %uint %83 %84 - %86 = OpIMul %uint %85 %uint_4 - %87 = OpIAdd %uint %86 %uint_8 - %88 = OpULessThanEqual %bool %87 %82 - %89 = OpSelect %uint %88 %83 %uint_0 - %90 = OpSelect %uint %88 %uint_16 %uint_2 - %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %92 = OpAccessChain %_ptr_StorageBuffer_v3float %91 %89 - OpCooperativeMatrixStoreKHR %92 %m %uint_0 %90 NonPrivatePointer - %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %97 = OpArrayLength %uint %18 0 - %98 = OpIMul %uint %97 %uint_4 - %99 = OpBitcast %uint %int_0 - %100 = OpIMul %uint %uint_16 %uint_7 - %101 = OpIAdd %uint %99 %100 - %102 = OpIMul %uint %101 %uint_4 - %103 = OpIAdd %uint %102 %uint_8 - %104 = OpULessThanEqual %bool %103 %98 - %105 = OpSelect %uint %104 %99 %uint_0 - %106 = OpSelect %uint %104 %uint_16 %uint_2 - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %108 = OpAccessChain %_ptr_StorageBuffer_v4uint %107 %105 - OpCooperativeMatrixStoreKHR %108 %m %uint_0 %106 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %113 = OpArrayLength %uint %23 0 - %114 = OpBitcast %uint %int_0 - %115 = OpIMul %uint %uint_16 %uint_7 - %116 = OpIAdd %uint %114 %115 - %117 = OpIAdd %uint %116 %uint_8 - %118 = OpULessThanEqual %bool %117 %113 - %119 = OpSelect %uint %118 %114 %uint_0 - %120 = OpSelect %uint %118 %uint_16 %uint_8 - %121 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %122 = OpAccessChain %_ptr_StorageBuffer_v2half %121 %119 - OpCooperativeMatrixStoreKHR %122 %m %uint_0 %120 NonPrivatePointer - %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %127 = OpArrayLength %uint %29 0 - %128 = OpIMul %uint %127 %uint_2 - %129 = OpBitcast %uint %int_0 - %130 = OpIMul %uint %uint_16 %uint_7 - %131 = OpIAdd %uint %129 %130 - %132 = OpIMul %uint %131 %uint_2 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %uint_16 %uint_4 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_v3half %137 %135 - OpCooperativeMatrixStoreKHR %138 %m %uint_0 %136 NonPrivatePointer + %64 = OpBitcast %uint %int_0 + %65 = OpIMul %uint %uint_16 %uint_7 + %66 = OpIAdd %uint %64 %65 + %67 = OpIAdd %uint %66 %uint_4 + %69 = OpULessThanEqual %bool %67 %63 + %70 = OpSelect %uint %69 %64 %uint_0 + %71 = OpSelect %uint %69 %uint_16 %uint_4 + %72 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %73 = OpAccessChain %_ptr_StorageBuffer_v2int %72 %70 + OpCooperativeMatrixStoreKHR %73 %m %uint_0 %71 NonPrivatePointer + %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %78 = OpArrayLength %uint %12 0 + %79 = OpBitcast %uint %int_0 + %80 = OpIMul %uint %uint_16 %uint_7 + %81 = OpIAdd %uint %79 %80 + %82 = OpIAdd %uint %81 %uint_2 + %84 = OpULessThanEqual %bool %82 %78 + %85 = OpSelect %uint %84 %79 %uint_0 + %86 = OpSelect %uint %84 %uint_16 %uint_2 + %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %88 = OpAccessChain %_ptr_StorageBuffer_v3float %87 %85 + OpCooperativeMatrixStoreKHR %88 %m %uint_0 %86 NonPrivatePointer + %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %93 = OpArrayLength %uint %18 0 + %94 = OpBitcast %uint %int_0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %94 %95 + %97 = OpIAdd %uint %96 %uint_2 + %98 = OpULessThanEqual %bool %97 %93 + %99 = OpSelect %uint %98 %94 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_2 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_0 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpBitcast %uint %int_0 + %109 = OpIMul %uint %uint_16 %uint_7 + %110 = OpIAdd %uint %108 %109 + %111 = OpIAdd %uint %110 %uint_8 + %112 = OpULessThanEqual %bool %111 %107 + %113 = OpSelect %uint %112 %108 %uint_0 + %114 = OpSelect %uint %112 %uint_16 %uint_8 + %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_v2half %115 %113 + OpCooperativeMatrixStoreKHR %116 %m %uint_0 %114 NonPrivatePointer + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %121 = OpArrayLength %uint %29 0 + %122 = OpBitcast %uint %int_0 + %123 = OpIMul %uint %uint_16 %uint_7 + %124 = OpIAdd %uint %122 %123 + %125 = OpIAdd %uint %124 %uint_4 + %126 = OpULessThanEqual %bool %125 %121 + %127 = OpSelect %uint %126 %122 %uint_0 + %128 = OpSelect %uint %126 %uint_16 %uint_4 + %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %130 = OpAccessChain %_ptr_StorageBuffer_v3half %129 %127 + OpCooperativeMatrixStoreKHR %130 %m %uint_0 %128 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl index 1dfb4c1..593749e 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -14,31 +14,31 @@ Matrix_left_u8_8x8 m = Matrix_left_u8_8x8::Splat(0u); uint v = 0u; out0.GetDimensions(v); - bool v_1 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v / 4u) * 4u)); + bool v_1 = (((0u + (16u * 7u)) + 2u) <= (v / 4u)); m.Store(out0, (0u + (select(v_1, 0u, 0u) * 4u)), (select(v_1, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_2 / 8u) * 8u)); + bool v_3 = (((0u + (16u * 7u)) + 1u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 4u)), (select(v_3, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_4 / 16u) * 16u)); + bool v_5 = (((0u + (16u * 7u)) + 1u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 4u)), (select(v_5, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_6 / 16u) * 16u)); + bool v_7 = (((0u + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 4u)), (select(v_7, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_8 = 0u; out4.GetDimensions(v_8); - bool v_9 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 2u) * 2u)); + bool v_9 = (((0u + (16u * 7u)) + 4u) <= (v_8 / 2u)); m.Store(out4, (0u + (select(v_9, 0u, 0u) * 4u)), (select(v_9, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_10 = 0u; out5.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_10 / 4u) * 4u)); + bool v_11 = (((0u + (16u * 7u)) + 2u) <= (v_10 / 4u)); m.Store(out5, (0u + (select(v_11, 0u, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_12 = 0u; out6.GetDimensions(v_12); - bool v_13 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_12 / 8u) * 8u)); + bool v_13 = (((0u + (16u * 7u)) + 1u) <= (v_12 / 8u)); m.Store(out6, (0u + (select(v_13, 0u, 0u) * 4u)), (select(v_13, 16u, 1u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_col_major.wgsl.expected.spvasm index 893610c..0c94d67 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 159 +; Bound: 145 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -112,11 +112,10 @@ %43 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_0 %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int @@ -126,6 +125,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -135,94 +135,80 @@ %41 = OpLabel %48 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %50 = OpArrayLength %uint %1 0 - %51 = OpIMul %uint %50 %uint_4 - %53 = OpIMul %uint %uint_16 %uint_7 - %56 = OpIAdd %uint %uint_0 %53 - %57 = OpIMul %uint %56 %uint_4 - %58 = OpIAdd %uint %57 %uint_8 - %59 = OpULessThanEqual %bool %58 %51 - %61 = OpSelect %uint %59 %uint_0 %uint_0 - %62 = OpSelect %uint %59 %uint_16 %uint_2 - %64 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %65 = OpAccessChain %_ptr_StorageBuffer_uint %64 %61 - OpCooperativeMatrixStoreKHR %65 %m %uint_1 %62 NonPrivatePointer - %69 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %71 = OpArrayLength %uint %6 0 - %72 = OpIMul %uint %71 %uint_8 - %73 = OpIMul %uint %uint_16 %uint_7 - %74 = OpIAdd %uint %uint_0 %73 - %75 = OpIMul %uint %74 %uint_8 - %76 = OpIAdd %uint %75 %uint_8 - %77 = OpULessThanEqual %bool %76 %72 - %78 = OpSelect %uint %77 %uint_0 %uint_0 - %79 = OpSelect %uint %77 %uint_16 %uint_1 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_v2int %80 %78 - OpCooperativeMatrixStoreKHR %81 %m %uint_1 %79 NonPrivatePointer - %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %86 = OpArrayLength %uint %12 0 - %87 = OpIMul %uint %86 %uint_16 - %88 = OpIMul %uint %uint_16 %uint_7 - %89 = OpIAdd %uint %uint_0 %88 - %90 = OpIMul %uint %89 %uint_16 - %91 = OpIAdd %uint %90 %uint_16 - %92 = OpULessThanEqual %bool %91 %87 - %93 = OpSelect %uint %92 %uint_0 %uint_0 - %94 = OpSelect %uint %92 %uint_16 %uint_1 - %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %96 = OpAccessChain %_ptr_StorageBuffer_v3float %95 %93 - OpCooperativeMatrixStoreKHR %96 %m %uint_1 %94 NonPrivatePointer - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %101 = OpArrayLength %uint %18 0 - %102 = OpIMul %uint %101 %uint_16 - %103 = OpIMul %uint %uint_16 %uint_7 - %104 = OpIAdd %uint %uint_0 %103 - %105 = OpIMul %uint %104 %uint_16 - %106 = OpIAdd %uint %105 %uint_16 - %107 = OpULessThanEqual %bool %106 %102 - %108 = OpSelect %uint %107 %uint_0 %uint_0 - %109 = OpSelect %uint %107 %uint_16 %uint_1 - %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %111 = OpAccessChain %_ptr_StorageBuffer_v4uint %110 %108 - OpCooperativeMatrixStoreKHR %111 %m %uint_1 %109 NonPrivatePointer - %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %116 = OpArrayLength %uint %23 0 - %117 = OpIMul %uint %116 %uint_2 - %118 = OpIMul %uint %uint_16 %uint_7 - %119 = OpIAdd %uint %uint_0 %118 - %120 = OpIMul %uint %119 %uint_2 - %121 = OpIAdd %uint %120 %uint_8 - %122 = OpULessThanEqual %bool %121 %117 - %123 = OpSelect %uint %122 %uint_0 %uint_0 - %124 = OpSelect %uint %122 %uint_16 %uint_4 - %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %126 = OpAccessChain %_ptr_StorageBuffer_half %125 %123 - OpCooperativeMatrixStoreKHR %126 %m %uint_1 %124 NonPrivatePointer - %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %131 = OpArrayLength %uint %28 0 - %132 = OpIMul %uint %131 %uint_4 - %133 = OpIMul %uint %uint_16 %uint_7 - %134 = OpIAdd %uint %uint_0 %133 - %135 = OpIMul %uint %134 %uint_4 - %136 = OpIAdd %uint %135 %uint_8 - %137 = OpULessThanEqual %bool %136 %132 - %138 = OpSelect %uint %137 %uint_0 %uint_0 - %139 = OpSelect %uint %137 %uint_16 %uint_2 - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %141 = OpAccessChain %_ptr_StorageBuffer_v2half %140 %138 - OpCooperativeMatrixStoreKHR %141 %m %uint_1 %139 NonPrivatePointer - %144 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %146 = OpArrayLength %uint %33 0 - %147 = OpIMul %uint %146 %uint_8 - %148 = OpIMul %uint %uint_16 %uint_7 - %149 = OpIAdd %uint %uint_0 %148 - %150 = OpIMul %uint %149 %uint_8 - %151 = OpIAdd %uint %150 %uint_8 - %152 = OpULessThanEqual %bool %151 %147 - %153 = OpSelect %uint %152 %uint_0 %uint_0 - %154 = OpSelect %uint %152 %uint_16 %uint_1 - %155 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %156 = OpAccessChain %_ptr_StorageBuffer_v3half %155 %153 - OpCooperativeMatrixStoreKHR %156 %m %uint_1 %154 NonPrivatePointer + %51 = OpIMul %uint %uint_16 %uint_7 + %54 = OpIAdd %uint %uint_0 %51 + %55 = OpIAdd %uint %54 %uint_2 + %57 = OpULessThanEqual %bool %55 %50 + %59 = OpSelect %uint %57 %uint_0 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_2 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + OpCooperativeMatrixStoreKHR %62 %m %uint_1 %60 NonPrivatePointer + %66 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %68 = OpArrayLength %uint %6 0 + %69 = OpIMul %uint %uint_16 %uint_7 + %70 = OpIAdd %uint %uint_0 %69 + %71 = OpIAdd %uint %70 %uint_1 + %72 = OpULessThanEqual %bool %71 %68 + %73 = OpSelect %uint %72 %uint_0 %uint_0 + %74 = OpSelect %uint %72 %uint_16 %uint_1 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %73 + OpCooperativeMatrixStoreKHR %76 %m %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %81 = OpArrayLength %uint %12 0 + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_1 + %85 = OpULessThanEqual %bool %84 %81 + %86 = OpSelect %uint %85 %uint_0 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_1 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %uint_0 %95 + %97 = OpIAdd %uint %96 %uint_1 + %98 = OpULessThanEqual %bool %97 %94 + %99 = OpSelect %uint %98 %uint_0 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_1 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_1 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpIMul %uint %uint_16 %uint_7 + %109 = OpIAdd %uint %uint_0 %108 + %110 = OpIAdd %uint %109 %uint_4 + %112 = OpULessThanEqual %bool %110 %107 + %113 = OpSelect %uint %112 %uint_0 %uint_0 + %114 = OpSelect %uint %112 %uint_16 %uint_4 + %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_half %115 %113 + OpCooperativeMatrixStoreKHR %116 %m %uint_1 %114 NonPrivatePointer + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %121 = OpArrayLength %uint %28 0 + %122 = OpIMul %uint %uint_16 %uint_7 + %123 = OpIAdd %uint %uint_0 %122 + %124 = OpIAdd %uint %123 %uint_2 + %125 = OpULessThanEqual %bool %124 %121 + %126 = OpSelect %uint %125 %uint_0 %uint_0 + %127 = OpSelect %uint %125 %uint_16 %uint_2 + %128 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %129 = OpAccessChain %_ptr_StorageBuffer_v2half %128 %126 + OpCooperativeMatrixStoreKHR %129 %m %uint_1 %127 NonPrivatePointer + %132 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %134 = OpArrayLength %uint %33 0 + %135 = OpIMul %uint %uint_16 %uint_7 + %136 = OpIAdd %uint %uint_0 %135 + %137 = OpIAdd %uint %136 %uint_1 + %138 = OpULessThanEqual %bool %137 %134 + %139 = OpSelect %uint %138 %uint_0 %uint_0 + %140 = OpSelect %uint %138 %uint_16 %uint_1 + %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %142 = OpAccessChain %_ptr_StorageBuffer_v3half %141 %139 + OpCooperativeMatrixStoreKHR %142 %m %uint_1 %140 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl index f3fc7dc..86eb255 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -14,31 +14,31 @@ Matrix_left_u8_8x8 m = Matrix_left_u8_8x8::Splat(0u); uint v = 0u; out0.GetDimensions(v); - bool v_1 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v / 4u) * 4u)); + bool v_1 = (((0u + (16u * 7u)) + 2u) <= (v / 4u)); m.Store(out0, (0u + (select(v_1, 0u, 0u) * 4u)), (select(v_1, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_2 / 8u) * 8u)); + bool v_3 = (((0u + (16u * 7u)) + 1u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 4u)), (select(v_3, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_4 / 16u) * 16u)); + bool v_5 = (((0u + (16u * 7u)) + 1u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 4u)), (select(v_5, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_6 / 16u) * 16u)); + bool v_7 = (((0u + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 4u)), (select(v_7, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_8 = 0u; out4.GetDimensions(v_8); - bool v_9 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 2u) * 2u)); + bool v_9 = (((0u + (16u * 7u)) + 4u) <= (v_8 / 2u)); m.Store(out4, (0u + (select(v_9, 0u, 0u) * 4u)), (select(v_9, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_10 = 0u; out5.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_10 / 4u) * 4u)); + bool v_11 = (((0u + (16u * 7u)) + 2u) <= (v_10 / 4u)); m.Store(out5, (0u + (select(v_11, 0u, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_12 = 0u; out6.GetDimensions(v_12); - bool v_13 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_12 / 8u) * 8u)); + bool v_13 = (((0u + (16u * 7u)) + 1u) <= (v_12 / 8u)); m.Store(out6, (0u + (select(v_13, 0u, 0u) * 4u)), (select(v_13, 16u, 1u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_row_major.wgsl.expected.spvasm index 7f972a5..4065643 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_left_u8_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 159 +; Bound: 145 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -112,11 +112,10 @@ %43 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_0 %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint - %uint_4 = OpConstant %uint 4 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int %uint_1 = OpConstant %uint 1 @@ -126,6 +125,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -135,94 +135,80 @@ %41 = OpLabel %48 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %50 = OpArrayLength %uint %1 0 - %51 = OpIMul %uint %50 %uint_4 - %53 = OpIMul %uint %uint_16 %uint_7 - %56 = OpIAdd %uint %uint_0 %53 - %57 = OpIMul %uint %56 %uint_4 - %58 = OpIAdd %uint %57 %uint_8 - %59 = OpULessThanEqual %bool %58 %51 - %61 = OpSelect %uint %59 %uint_0 %uint_0 - %62 = OpSelect %uint %59 %uint_16 %uint_2 - %64 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %65 = OpAccessChain %_ptr_StorageBuffer_uint %64 %61 - OpCooperativeMatrixStoreKHR %65 %m %uint_0 %62 NonPrivatePointer - %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %70 = OpArrayLength %uint %6 0 - %71 = OpIMul %uint %70 %uint_8 - %72 = OpIMul %uint %uint_16 %uint_7 - %73 = OpIAdd %uint %uint_0 %72 - %74 = OpIMul %uint %73 %uint_8 - %75 = OpIAdd %uint %74 %uint_8 - %76 = OpULessThanEqual %bool %75 %71 - %77 = OpSelect %uint %76 %uint_0 %uint_0 - %78 = OpSelect %uint %76 %uint_16 %uint_1 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_v2int %80 %77 - OpCooperativeMatrixStoreKHR %81 %m %uint_0 %78 NonPrivatePointer - %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %86 = OpArrayLength %uint %12 0 - %87 = OpIMul %uint %86 %uint_16 - %88 = OpIMul %uint %uint_16 %uint_7 - %89 = OpIAdd %uint %uint_0 %88 - %90 = OpIMul %uint %89 %uint_16 - %91 = OpIAdd %uint %90 %uint_16 - %92 = OpULessThanEqual %bool %91 %87 - %93 = OpSelect %uint %92 %uint_0 %uint_0 - %94 = OpSelect %uint %92 %uint_16 %uint_1 - %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %96 = OpAccessChain %_ptr_StorageBuffer_v3float %95 %93 - OpCooperativeMatrixStoreKHR %96 %m %uint_0 %94 NonPrivatePointer - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %101 = OpArrayLength %uint %18 0 - %102 = OpIMul %uint %101 %uint_16 - %103 = OpIMul %uint %uint_16 %uint_7 - %104 = OpIAdd %uint %uint_0 %103 - %105 = OpIMul %uint %104 %uint_16 - %106 = OpIAdd %uint %105 %uint_16 - %107 = OpULessThanEqual %bool %106 %102 - %108 = OpSelect %uint %107 %uint_0 %uint_0 - %109 = OpSelect %uint %107 %uint_16 %uint_1 - %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %111 = OpAccessChain %_ptr_StorageBuffer_v4uint %110 %108 - OpCooperativeMatrixStoreKHR %111 %m %uint_0 %109 NonPrivatePointer - %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %116 = OpArrayLength %uint %23 0 - %117 = OpIMul %uint %116 %uint_2 - %118 = OpIMul %uint %uint_16 %uint_7 - %119 = OpIAdd %uint %uint_0 %118 - %120 = OpIMul %uint %119 %uint_2 - %121 = OpIAdd %uint %120 %uint_8 - %122 = OpULessThanEqual %bool %121 %117 - %123 = OpSelect %uint %122 %uint_0 %uint_0 - %124 = OpSelect %uint %122 %uint_16 %uint_4 - %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %126 = OpAccessChain %_ptr_StorageBuffer_half %125 %123 - OpCooperativeMatrixStoreKHR %126 %m %uint_0 %124 NonPrivatePointer - %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %131 = OpArrayLength %uint %28 0 - %132 = OpIMul %uint %131 %uint_4 - %133 = OpIMul %uint %uint_16 %uint_7 - %134 = OpIAdd %uint %uint_0 %133 - %135 = OpIMul %uint %134 %uint_4 - %136 = OpIAdd %uint %135 %uint_8 - %137 = OpULessThanEqual %bool %136 %132 - %138 = OpSelect %uint %137 %uint_0 %uint_0 - %139 = OpSelect %uint %137 %uint_16 %uint_2 - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %141 = OpAccessChain %_ptr_StorageBuffer_v2half %140 %138 - OpCooperativeMatrixStoreKHR %141 %m %uint_0 %139 NonPrivatePointer - %144 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %146 = OpArrayLength %uint %33 0 - %147 = OpIMul %uint %146 %uint_8 - %148 = OpIMul %uint %uint_16 %uint_7 - %149 = OpIAdd %uint %uint_0 %148 - %150 = OpIMul %uint %149 %uint_8 - %151 = OpIAdd %uint %150 %uint_8 - %152 = OpULessThanEqual %bool %151 %147 - %153 = OpSelect %uint %152 %uint_0 %uint_0 - %154 = OpSelect %uint %152 %uint_16 %uint_1 - %155 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %156 = OpAccessChain %_ptr_StorageBuffer_v3half %155 %153 - OpCooperativeMatrixStoreKHR %156 %m %uint_0 %154 NonPrivatePointer + %51 = OpIMul %uint %uint_16 %uint_7 + %54 = OpIAdd %uint %uint_0 %51 + %55 = OpIAdd %uint %54 %uint_2 + %57 = OpULessThanEqual %bool %55 %50 + %59 = OpSelect %uint %57 %uint_0 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_2 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + OpCooperativeMatrixStoreKHR %62 %m %uint_0 %60 NonPrivatePointer + %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %67 = OpArrayLength %uint %6 0 + %68 = OpIMul %uint %uint_16 %uint_7 + %69 = OpIAdd %uint %uint_0 %68 + %70 = OpIAdd %uint %69 %uint_1 + %72 = OpULessThanEqual %bool %70 %67 + %73 = OpSelect %uint %72 %uint_0 %uint_0 + %74 = OpSelect %uint %72 %uint_16 %uint_1 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %73 + OpCooperativeMatrixStoreKHR %76 %m %uint_0 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %81 = OpArrayLength %uint %12 0 + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_1 + %85 = OpULessThanEqual %bool %84 %81 + %86 = OpSelect %uint %85 %uint_0 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_1 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_0 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %uint_0 %95 + %97 = OpIAdd %uint %96 %uint_1 + %98 = OpULessThanEqual %bool %97 %94 + %99 = OpSelect %uint %98 %uint_0 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_1 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_0 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpIMul %uint %uint_16 %uint_7 + %109 = OpIAdd %uint %uint_0 %108 + %110 = OpIAdd %uint %109 %uint_4 + %112 = OpULessThanEqual %bool %110 %107 + %113 = OpSelect %uint %112 %uint_0 %uint_0 + %114 = OpSelect %uint %112 %uint_16 %uint_4 + %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_half %115 %113 + OpCooperativeMatrixStoreKHR %116 %m %uint_0 %114 NonPrivatePointer + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %121 = OpArrayLength %uint %28 0 + %122 = OpIMul %uint %uint_16 %uint_7 + %123 = OpIAdd %uint %uint_0 %122 + %124 = OpIAdd %uint %123 %uint_2 + %125 = OpULessThanEqual %bool %124 %121 + %126 = OpSelect %uint %125 %uint_0 %uint_0 + %127 = OpSelect %uint %125 %uint_16 %uint_2 + %128 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %129 = OpAccessChain %_ptr_StorageBuffer_v2half %128 %126 + OpCooperativeMatrixStoreKHR %129 %m %uint_0 %127 NonPrivatePointer + %132 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %134 = OpArrayLength %uint %33 0 + %135 = OpIMul %uint %uint_16 %uint_7 + %136 = OpIAdd %uint %uint_0 %135 + %137 = OpIAdd %uint %136 %uint_1 + %138 = OpULessThanEqual %bool %137 %134 + %139 = OpSelect %uint %138 %uint_0 %uint_0 + %140 = OpSelect %uint %138 %uint_16 %uint_1 + %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %142 = OpAccessChain %_ptr_StorageBuffer_v3half %141 %139 + OpCooperativeMatrixStoreKHR %142 %m %uint_0 %140 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl index 62c829b..c2db0c1 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -14,19 +14,19 @@ Matrix_result_f16_8x8 m = Matrix_result_f16_8x8::Splat(float16_t(0.0h)); uint v = 0u; out0.GetDimensions(v); - bool v_1 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v / 4u) * 2u)); + bool v_1 = (((0u + (16u * 7u)) + 4u) <= (v / 4u)); m.Store(out0, (0u + (select(v_1, 0u, 0u) * 2u)), (select(v_1, 16u, 4u) * 2u), MatrixLayout::ColMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_2 / 8u) * 4u)); + bool v_3 = (((0u + (16u * 7u)) + 2u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 2u)), (select(v_3, 16u, 2u) * 2u), MatrixLayout::ColMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_4 / 16u) * 8u)); + bool v_5 = (((0u + (16u * 7u)) + 1u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 2u)), (select(v_5, 16u, 1u) * 2u), MatrixLayout::ColMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_6 / 16u) * 8u)); + bool v_7 = (((0u + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 2u)), (select(v_7, 16u, 1u) * 2u), MatrixLayout::ColMajor); uint v_8 = 0u; out4.GetDimensions(v_8); @@ -34,11 +34,11 @@ m.Store(out4, (0u + (select(v_9, 0u, 0u) * 2u)), (select(v_9, 16u, 8u) * 2u), MatrixLayout::ColMajor); uint v_10 = 0u; out5.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_10 / 4u) * 2u)); + bool v_11 = (((0u + (16u * 7u)) + 4u) <= (v_10 / 4u)); m.Store(out5, (0u + (select(v_11, 0u, 0u) * 2u)), (select(v_11, 16u, 4u) * 2u), MatrixLayout::ColMajor); uint v_12 = 0u; out6.GetDimensions(v_12); - bool v_13 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_12 / 8u) * 4u)); + bool v_13 = (((0u + (16u * 7u)) + 2u) <= (v_12 / 8u)); m.Store(out6, (0u + (select(v_13, 0u, 0u) * 2u)), (select(v_13, 16u, 2u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_col_major.wgsl.expected.msl index b99f197..43504d9 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_col_major.wgsl.expected.msl
@@ -49,18 +49,18 @@ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.out0=out0, .out1=out1, .out2=out2, .out3=out3, .out4=out4, .out5=out5, .out6=out6, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; tint_array_lengths_struct const v_1 = tint_array_lengths_struct{.tint_array_length_0_0=((*tint_module_vars.tint_storage_buffer_sizes)[0u].x / 4u), .tint_array_length_0_1=((*tint_module_vars.tint_storage_buffer_sizes)[0u].y / 8u), .tint_array_length_0_2=((*tint_module_vars.tint_storage_buffer_sizes)[0u].z / 16u), .tint_array_length_0_3=((*tint_module_vars.tint_storage_buffer_sizes)[0u].w / 16u), .tint_array_length_0_4=((*tint_module_vars.tint_storage_buffer_sizes)[1u].x / 2u), .tint_array_length_0_5=((*tint_module_vars.tint_storage_buffer_sizes)[1u].y / 4u), .tint_array_length_0_6=((*tint_module_vars.tint_storage_buffer_sizes)[1u].z / 8u)}; simdgroup_half8x8 const m = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); - bool const v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_0 * 2u)); + bool const v_2 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_0); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out0) + (select(0u, 0u, v_2) * 4u)), ulong((select(4u, 16u, v_2) * 2u)), ulong2(0ul), true)); - bool const v_3 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_1 * 4u)); + bool const v_3 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_1); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out1) + (select(0u, 0u, v_3) * 8u)), ulong((select(2u, 16u, v_3) * 4u)), ulong2(0ul), true)); - bool const v_4 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_2 * 8u)); + bool const v_4 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_2); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out2) + (select(0u, 0u, v_4) * 16u)), ulong((select(1u, 16u, v_4) * 8u)), ulong2(0ul), true)); - bool const v_5 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_3 * 8u)); + bool const v_5 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_3); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out3) + (select(0u, 0u, v_5) * 16u)), ulong((select(1u, 16u, v_5) * 8u)), ulong2(0ul), true)); bool const v_6 = (((0u + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); (simdgroup_store(m, (&(*tint_module_vars.out4)[select(0u, 0u, v_6)]), ulong(select(8u, 16u, v_6)), ulong2(0ul), true)); - bool const v_7 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_7 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out5) + (select(0u, 0u, v_7) * 4u)), ulong((select(4u, 16u, v_7) * 2u)), ulong2(0ul), true)); - bool const v_8 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_6 * 4u)); + bool const v_8 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_6); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out6) + (select(0u, 0u, v_8) * 8u)), ulong((select(2u, 16u, v_8) * 4u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_col_major.wgsl.expected.spvasm index 8daf07f..3ff3517 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 156 +; Bound: 144 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -113,8 +113,8 @@ %uint_0 = OpConstant %uint 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %uint_1 = OpConstant %uint 1 %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int @@ -133,92 +133,80 @@ %41 = OpLabel %47 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %50 = OpArrayLength %uint %1 0 - %51 = OpIMul %uint %50 %uint_2 - %52 = OpIMul %uint %uint_16 %uint_7 - %55 = OpIAdd %uint %uint_0 %52 - %56 = OpIMul %uint %55 %uint_2 - %57 = OpIAdd %uint %56 %uint_8 - %58 = OpULessThanEqual %bool %57 %51 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_4 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - OpCooperativeMatrixStoreKHR %64 %m %uint_1 %61 NonPrivatePointer - %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %70 = OpArrayLength %uint %6 0 - %71 = OpIMul %uint %70 %uint_4 - %72 = OpIMul %uint %uint_16 %uint_7 - %73 = OpIAdd %uint %uint_0 %72 - %74 = OpIMul %uint %73 %uint_4 - %75 = OpIAdd %uint %74 %uint_8 - %76 = OpULessThanEqual %bool %75 %71 - %77 = OpSelect %uint %76 %uint_0 %uint_0 - %78 = OpSelect %uint %76 %uint_16 %uint_2 - %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %80 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %77 - OpCooperativeMatrixStoreKHR %80 %m %uint_1 %78 NonPrivatePointer - %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %85 = OpArrayLength %uint %12 0 - %86 = OpIMul %uint %85 %uint_8 - %87 = OpIMul %uint %uint_16 %uint_7 - %88 = OpIAdd %uint %uint_0 %87 - %89 = OpIMul %uint %88 %uint_8 - %90 = OpIAdd %uint %89 %uint_8 - %91 = OpULessThanEqual %bool %90 %86 - %92 = OpSelect %uint %91 %uint_0 %uint_0 - %93 = OpSelect %uint %91 %uint_16 %uint_1 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v3float %94 %92 - OpCooperativeMatrixStoreKHR %95 %m %uint_1 %93 NonPrivatePointer - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %100 = OpArrayLength %uint %18 0 - %101 = OpIMul %uint %100 %uint_8 - %102 = OpIMul %uint %uint_16 %uint_7 - %103 = OpIAdd %uint %uint_0 %102 - %104 = OpIMul %uint %103 %uint_8 - %105 = OpIAdd %uint %104 %uint_8 - %106 = OpULessThanEqual %bool %105 %101 - %107 = OpSelect %uint %106 %uint_0 %uint_0 - %108 = OpSelect %uint %106 %uint_16 %uint_1 - %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %110 = OpAccessChain %_ptr_StorageBuffer_v4uint %109 %107 - OpCooperativeMatrixStoreKHR %110 %m %uint_1 %108 NonPrivatePointer - %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %115 = OpArrayLength %uint %23 0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %uint_0 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %115 - %120 = OpSelect %uint %119 %uint_0 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_1 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %128 = OpArrayLength %uint %28 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpIMul %uint %uint_16 %uint_7 - %131 = OpIAdd %uint %uint_0 %130 - %132 = OpIMul %uint %131 %uint_2 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %129 - %135 = OpSelect %uint %134 %uint_0 %uint_0 - %136 = OpSelect %uint %134 %uint_16 %uint_4 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_v2half %137 %135 - OpCooperativeMatrixStoreKHR %138 %m %uint_1 %136 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %143 = OpArrayLength %uint %33 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %uint_0 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %144 - %150 = OpSelect %uint %149 %uint_0 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v3half %152 %150 - OpCooperativeMatrixStoreKHR %153 %m %uint_1 %151 NonPrivatePointer + %51 = OpIMul %uint %uint_16 %uint_7 + %54 = OpIAdd %uint %uint_0 %51 + %55 = OpIAdd %uint %54 %uint_4 + %57 = OpULessThanEqual %bool %55 %50 + %59 = OpSelect %uint %57 %uint_0 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_4 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + OpCooperativeMatrixStoreKHR %62 %m %uint_1 %60 NonPrivatePointer + %66 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %68 = OpArrayLength %uint %6 0 + %69 = OpIMul %uint %uint_16 %uint_7 + %70 = OpIAdd %uint %uint_0 %69 + %71 = OpIAdd %uint %70 %uint_2 + %72 = OpULessThanEqual %bool %71 %68 + %73 = OpSelect %uint %72 %uint_0 %uint_0 + %74 = OpSelect %uint %72 %uint_16 %uint_2 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %73 + OpCooperativeMatrixStoreKHR %76 %m %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %81 = OpArrayLength %uint %12 0 + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_1 + %85 = OpULessThanEqual %bool %84 %81 + %86 = OpSelect %uint %85 %uint_0 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_1 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %uint_0 %95 + %97 = OpIAdd %uint %96 %uint_1 + %98 = OpULessThanEqual %bool %97 %94 + %99 = OpSelect %uint %98 %uint_0 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_1 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_1 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpIMul %uint %uint_16 %uint_7 + %109 = OpIAdd %uint %uint_0 %108 + %110 = OpIAdd %uint %109 %uint_8 + %111 = OpULessThanEqual %bool %110 %107 + %112 = OpSelect %uint %111 %uint_0 %uint_0 + %113 = OpSelect %uint %111 %uint_16 %uint_8 + %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %115 = OpAccessChain %_ptr_StorageBuffer_half %114 %112 + OpCooperativeMatrixStoreKHR %115 %m %uint_1 %113 NonPrivatePointer + %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %120 = OpArrayLength %uint %28 0 + %121 = OpIMul %uint %uint_16 %uint_7 + %122 = OpIAdd %uint %uint_0 %121 + %123 = OpIAdd %uint %122 %uint_4 + %124 = OpULessThanEqual %bool %123 %120 + %125 = OpSelect %uint %124 %uint_0 %uint_0 + %126 = OpSelect %uint %124 %uint_16 %uint_4 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_v2half %127 %125 + OpCooperativeMatrixStoreKHR %128 %m %uint_1 %126 NonPrivatePointer + %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %133 = OpArrayLength %uint %33 0 + %134 = OpIMul %uint %uint_16 %uint_7 + %135 = OpIAdd %uint %uint_0 %134 + %136 = OpIAdd %uint %135 %uint_2 + %137 = OpULessThanEqual %bool %136 %133 + %138 = OpSelect %uint %137 %uint_0 %uint_0 + %139 = OpSelect %uint %137 %uint_16 %uint_2 + %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %141 = OpAccessChain %_ptr_StorageBuffer_v3half %140 %138 + OpCooperativeMatrixStoreKHR %141 %m %uint_1 %139 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl index 1fbe7bc..1522648 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -14,19 +14,19 @@ Matrix_result_f16_8x8 m = Matrix_result_f16_8x8::Splat(float16_t(0.0h)); uint v = 0u; out0.GetDimensions(v); - bool v_1 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v / 4u) * 2u)); + bool v_1 = (((0u + (16u * 7u)) + 4u) <= (v / 4u)); m.Store(out0, (0u + (select(v_1, 0u, 0u) * 2u)), (select(v_1, 16u, 4u) * 2u), MatrixLayout::RowMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_2 / 8u) * 4u)); + bool v_3 = (((0u + (16u * 7u)) + 2u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 2u)), (select(v_3, 16u, 2u) * 2u), MatrixLayout::RowMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_4 / 16u) * 8u)); + bool v_5 = (((0u + (16u * 7u)) + 1u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 2u)), (select(v_5, 16u, 1u) * 2u), MatrixLayout::RowMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_6 / 16u) * 8u)); + bool v_7 = (((0u + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 2u)), (select(v_7, 16u, 1u) * 2u), MatrixLayout::RowMajor); uint v_8 = 0u; out4.GetDimensions(v_8); @@ -34,11 +34,11 @@ m.Store(out4, (0u + (select(v_9, 0u, 0u) * 2u)), (select(v_9, 16u, 8u) * 2u), MatrixLayout::RowMajor); uint v_10 = 0u; out5.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_10 / 4u) * 2u)); + bool v_11 = (((0u + (16u * 7u)) + 4u) <= (v_10 / 4u)); m.Store(out5, (0u + (select(v_11, 0u, 0u) * 2u)), (select(v_11, 16u, 4u) * 2u), MatrixLayout::RowMajor); uint v_12 = 0u; out6.GetDimensions(v_12); - bool v_13 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_12 / 8u) * 4u)); + bool v_13 = (((0u + (16u * 7u)) + 2u) <= (v_12 / 8u)); m.Store(out6, (0u + (select(v_13, 0u, 0u) * 2u)), (select(v_13, 16u, 2u) * 2u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_row_major.wgsl.expected.msl index 03a2279..4ed85da 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_row_major.wgsl.expected.msl
@@ -49,18 +49,18 @@ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.out0=out0, .out1=out1, .out2=out2, .out3=out3, .out4=out4, .out5=out5, .out6=out6, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; tint_array_lengths_struct const v_1 = tint_array_lengths_struct{.tint_array_length_0_0=((*tint_module_vars.tint_storage_buffer_sizes)[0u].x / 4u), .tint_array_length_0_1=((*tint_module_vars.tint_storage_buffer_sizes)[0u].y / 8u), .tint_array_length_0_2=((*tint_module_vars.tint_storage_buffer_sizes)[0u].z / 16u), .tint_array_length_0_3=((*tint_module_vars.tint_storage_buffer_sizes)[0u].w / 16u), .tint_array_length_0_4=((*tint_module_vars.tint_storage_buffer_sizes)[1u].x / 2u), .tint_array_length_0_5=((*tint_module_vars.tint_storage_buffer_sizes)[1u].y / 4u), .tint_array_length_0_6=((*tint_module_vars.tint_storage_buffer_sizes)[1u].z / 8u)}; simdgroup_half8x8 const m = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); - bool const v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_0 * 2u)); + bool const v_2 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_0); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out0) + (select(0u, 0u, v_2) * 4u)), ulong((select(4u, 16u, v_2) * 2u)), ulong2(0ul), false)); - bool const v_3 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_1 * 4u)); + bool const v_3 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_1); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out1) + (select(0u, 0u, v_3) * 8u)), ulong((select(2u, 16u, v_3) * 4u)), ulong2(0ul), false)); - bool const v_4 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_2 * 8u)); + bool const v_4 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_2); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out2) + (select(0u, 0u, v_4) * 16u)), ulong((select(1u, 16u, v_4) * 8u)), ulong2(0ul), false)); - bool const v_5 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_3 * 8u)); + bool const v_5 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_3); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out3) + (select(0u, 0u, v_5) * 16u)), ulong((select(1u, 16u, v_5) * 8u)), ulong2(0ul), false)); bool const v_6 = (((0u + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); (simdgroup_store(m, (&(*tint_module_vars.out4)[select(0u, 0u, v_6)]), ulong(select(8u, 16u, v_6)), ulong2(0ul), false)); - bool const v_7 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_7 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out5) + (select(0u, 0u, v_7) * 4u)), ulong((select(4u, 16u, v_7) * 2u)), ulong2(0ul), false)); - bool const v_8 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_6 * 4u)); + bool const v_8 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_6); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out6) + (select(0u, 0u, v_8) * 8u)), ulong((select(2u, 16u, v_8) * 4u)), ulong2(0ul), false)); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_row_major.wgsl.expected.spvasm index fd8f769..239e7e0 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_f16_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 156 +; Bound: 144 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -113,8 +113,8 @@ %uint_0 = OpConstant %uint 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -133,92 +133,80 @@ %41 = OpLabel %47 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %50 = OpArrayLength %uint %1 0 - %51 = OpIMul %uint %50 %uint_2 - %52 = OpIMul %uint %uint_16 %uint_7 - %55 = OpIAdd %uint %uint_0 %52 - %56 = OpIMul %uint %55 %uint_2 - %57 = OpIAdd %uint %56 %uint_8 - %58 = OpULessThanEqual %bool %57 %51 - %60 = OpSelect %uint %58 %uint_0 %uint_0 - %61 = OpSelect %uint %58 %uint_16 %uint_4 - %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %60 - OpCooperativeMatrixStoreKHR %64 %m %uint_0 %61 NonPrivatePointer - %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %69 = OpArrayLength %uint %6 0 - %70 = OpIMul %uint %69 %uint_4 - %71 = OpIMul %uint %uint_16 %uint_7 - %72 = OpIAdd %uint %uint_0 %71 - %73 = OpIMul %uint %72 %uint_4 - %74 = OpIAdd %uint %73 %uint_8 - %75 = OpULessThanEqual %bool %74 %70 - %76 = OpSelect %uint %75 %uint_0 %uint_0 - %77 = OpSelect %uint %75 %uint_16 %uint_2 - %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %79 = OpAccessChain %_ptr_StorageBuffer_v2int %78 %76 - OpCooperativeMatrixStoreKHR %79 %m %uint_0 %77 NonPrivatePointer - %82 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %84 = OpArrayLength %uint %12 0 - %85 = OpIMul %uint %84 %uint_8 - %86 = OpIMul %uint %uint_16 %uint_7 - %87 = OpIAdd %uint %uint_0 %86 - %88 = OpIMul %uint %87 %uint_8 - %89 = OpIAdd %uint %88 %uint_8 - %90 = OpULessThanEqual %bool %89 %85 - %91 = OpSelect %uint %90 %uint_0 %uint_0 - %92 = OpSelect %uint %90 %uint_16 %uint_1 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v3float %94 %91 - OpCooperativeMatrixStoreKHR %95 %m %uint_0 %92 NonPrivatePointer - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %100 = OpArrayLength %uint %18 0 - %101 = OpIMul %uint %100 %uint_8 - %102 = OpIMul %uint %uint_16 %uint_7 - %103 = OpIAdd %uint %uint_0 %102 - %104 = OpIMul %uint %103 %uint_8 - %105 = OpIAdd %uint %104 %uint_8 - %106 = OpULessThanEqual %bool %105 %101 - %107 = OpSelect %uint %106 %uint_0 %uint_0 - %108 = OpSelect %uint %106 %uint_16 %uint_1 - %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %110 = OpAccessChain %_ptr_StorageBuffer_v4uint %109 %107 - OpCooperativeMatrixStoreKHR %110 %m %uint_0 %108 NonPrivatePointer - %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %115 = OpArrayLength %uint %23 0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %uint_0 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %115 - %120 = OpSelect %uint %119 %uint_0 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_0 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %128 = OpArrayLength %uint %28 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpIMul %uint %uint_16 %uint_7 - %131 = OpIAdd %uint %uint_0 %130 - %132 = OpIMul %uint %131 %uint_2 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %129 - %135 = OpSelect %uint %134 %uint_0 %uint_0 - %136 = OpSelect %uint %134 %uint_16 %uint_4 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_v2half %137 %135 - OpCooperativeMatrixStoreKHR %138 %m %uint_0 %136 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %143 = OpArrayLength %uint %33 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %uint_0 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %144 - %150 = OpSelect %uint %149 %uint_0 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v3half %152 %150 - OpCooperativeMatrixStoreKHR %153 %m %uint_0 %151 NonPrivatePointer + %51 = OpIMul %uint %uint_16 %uint_7 + %54 = OpIAdd %uint %uint_0 %51 + %55 = OpIAdd %uint %54 %uint_4 + %57 = OpULessThanEqual %bool %55 %50 + %59 = OpSelect %uint %57 %uint_0 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_4 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + OpCooperativeMatrixStoreKHR %62 %m %uint_0 %60 NonPrivatePointer + %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %67 = OpArrayLength %uint %6 0 + %68 = OpIMul %uint %uint_16 %uint_7 + %69 = OpIAdd %uint %uint_0 %68 + %70 = OpIAdd %uint %69 %uint_2 + %71 = OpULessThanEqual %bool %70 %67 + %72 = OpSelect %uint %71 %uint_0 %uint_0 + %73 = OpSelect %uint %71 %uint_16 %uint_2 + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %75 = OpAccessChain %_ptr_StorageBuffer_v2int %74 %72 + OpCooperativeMatrixStoreKHR %75 %m %uint_0 %73 NonPrivatePointer + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %80 = OpArrayLength %uint %12 0 + %81 = OpIMul %uint %uint_16 %uint_7 + %82 = OpIAdd %uint %uint_0 %81 + %83 = OpIAdd %uint %82 %uint_1 + %85 = OpULessThanEqual %bool %83 %80 + %86 = OpSelect %uint %85 %uint_0 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_1 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_0 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %uint_0 %95 + %97 = OpIAdd %uint %96 %uint_1 + %98 = OpULessThanEqual %bool %97 %94 + %99 = OpSelect %uint %98 %uint_0 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_1 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_0 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpIMul %uint %uint_16 %uint_7 + %109 = OpIAdd %uint %uint_0 %108 + %110 = OpIAdd %uint %109 %uint_8 + %111 = OpULessThanEqual %bool %110 %107 + %112 = OpSelect %uint %111 %uint_0 %uint_0 + %113 = OpSelect %uint %111 %uint_16 %uint_8 + %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %115 = OpAccessChain %_ptr_StorageBuffer_half %114 %112 + OpCooperativeMatrixStoreKHR %115 %m %uint_0 %113 NonPrivatePointer + %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %120 = OpArrayLength %uint %28 0 + %121 = OpIMul %uint %uint_16 %uint_7 + %122 = OpIAdd %uint %uint_0 %121 + %123 = OpIAdd %uint %122 %uint_4 + %124 = OpULessThanEqual %bool %123 %120 + %125 = OpSelect %uint %124 %uint_0 %uint_0 + %126 = OpSelect %uint %124 %uint_16 %uint_4 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_v2half %127 %125 + OpCooperativeMatrixStoreKHR %128 %m %uint_0 %126 NonPrivatePointer + %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %133 = OpArrayLength %uint %33 0 + %134 = OpIMul %uint %uint_16 %uint_7 + %135 = OpIAdd %uint %uint_0 %134 + %136 = OpIAdd %uint %135 %uint_2 + %137 = OpULessThanEqual %bool %136 %133 + %138 = OpSelect %uint %137 %uint_0 %uint_0 + %139 = OpSelect %uint %137 %uint_16 %uint_2 + %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %141 = OpAccessChain %_ptr_StorageBuffer_v3half %140 %138 + OpCooperativeMatrixStoreKHR %141 %m %uint_0 %139 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl index 8099349..c0ca8e6 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -19,17 +19,17 @@ uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= ((v_3 / 8u) * 2u)); + bool v_5 = (((v_4 + (16u * 7u)) + 4u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_8 = (((v_7 + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 4u) + 8u) <= ((v_9 / 16u) * 4u)); + bool v_11 = (((v_10 + (16u * 7u)) + 2u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_12 = 0u; out5.GetDimensions(v_12); @@ -39,7 +39,7 @@ uint v_15 = 0u; out6.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 2u) + 8u) <= ((v_15 / 8u) * 2u)); + bool v_17 = (((v_16 + (16u * 7u)) + 4u) <= (v_15 / 8u)); m.Store(out6, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 4u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_col_major.wgsl.expected.msl index 94e7bd2..d6d64a1 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_col_major.wgsl.expected.msl
@@ -51,18 +51,18 @@ bool const v_3 = (((v_2 + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_0); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out0) + (select(0u, v_2, v_3) * 4u)), ulong((select(8u, 16u, v_3) * 1u)), ulong2(0ul), true)); uint const v_4 = as_type<uint>(0); - bool const v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_1 * 2u)); + bool const v_5 = (((v_4 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_1); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out1) + (select(0u, v_4, v_5) * 8u)), ulong((select(4u, 16u, v_5) * 2u)), ulong2(0ul), true)); uint const v_6 = as_type<uint>(0); - bool const v_7 = ((((v_6 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_2 * 4u)); + bool const v_7 = (((v_6 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_2); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out2) + (select(0u, v_6, v_7) * 16u)), ulong((select(2u, 16u, v_7) * 4u)), ulong2(0ul), true)); uint const v_8 = as_type<uint>(0); - bool const v_9 = ((((v_8 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_3 * 4u)); + bool const v_9 = (((v_8 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_3); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out3) + (select(0u, v_8, v_9) * 16u)), ulong((select(2u, 16u, v_9) * 4u)), ulong2(0ul), true)); uint const v_10 = as_type<uint>(0); bool const v_11 = (((v_10 + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out5) + (select(0u, v_10, v_11) * 4u)), ulong((select(8u, 16u, v_11) * 1u)), ulong2(0ul), true)); uint const v_12 = as_type<uint>(0); - bool const v_13 = ((((v_12 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_13 = (((v_12 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out6) + (select(0u, v_12, v_13) * 8u)), ulong((select(4u, 16u, v_13) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_col_major.wgsl.expected.spvasm index db825fc..6e6cb55 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 142 +; Bound: 134 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -133,71 +133,63 @@ OpCooperativeMatrixStoreKHR %59 %m %uint_1 %57 NonPrivatePointer %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %65 = OpArrayLength %uint %6 0 - %66 = OpIMul %uint %65 %uint_2 - %67 = OpBitcast %uint %int_0 - %68 = OpIMul %uint %uint_16 %uint_7 - %69 = OpIAdd %uint %67 %68 - %70 = OpIMul %uint %69 %uint_2 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %66 - %73 = OpSelect %uint %72 %67 %uint_0 - %74 = OpSelect %uint %72 %uint_16 %uint_4 - %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %77 = OpAccessChain %_ptr_StorageBuffer_v2int %76 %73 - OpCooperativeMatrixStoreKHR %77 %m %uint_1 %74 NonPrivatePointer - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %82 = OpArrayLength %uint %12 0 - %83 = OpIMul %uint %82 %uint_4 - %84 = OpBitcast %uint %int_0 - %85 = OpIMul %uint %uint_16 %uint_7 - %86 = OpIAdd %uint %84 %85 - %87 = OpIMul %uint %86 %uint_4 - %88 = OpIAdd %uint %87 %uint_8 - %89 = OpULessThanEqual %bool %88 %83 - %90 = OpSelect %uint %89 %84 %uint_0 - %91 = OpSelect %uint %89 %uint_16 %uint_2 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 - OpCooperativeMatrixStoreKHR %93 %m %uint_1 %91 NonPrivatePointer - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %98 = OpArrayLength %uint %18 0 - %99 = OpIMul %uint %98 %uint_4 - %100 = OpBitcast %uint %int_0 - %101 = OpIMul %uint %uint_16 %uint_7 - %102 = OpIAdd %uint %100 %101 - %103 = OpIMul %uint %102 %uint_4 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %uint_16 %uint_2 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_v4uint %108 %106 - OpCooperativeMatrixStoreKHR %109 %m %uint_1 %107 NonPrivatePointer - %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %114 = OpArrayLength %uint %23 0 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %114 - %120 = OpSelect %uint %119 %115 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v2half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_1 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %128 = OpArrayLength %uint %29 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpBitcast %uint %int_0 - %131 = OpIMul %uint %uint_16 %uint_7 - %132 = OpIAdd %uint %130 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %129 - %136 = OpSelect %uint %135 %130 %uint_0 - %137 = OpSelect %uint %135 %uint_16 %uint_4 - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_v3half %138 %136 - OpCooperativeMatrixStoreKHR %139 %m %uint_1 %137 NonPrivatePointer + %66 = OpBitcast %uint %int_0 + %67 = OpIMul %uint %uint_16 %uint_7 + %68 = OpIAdd %uint %66 %67 + %69 = OpIAdd %uint %68 %uint_4 + %71 = OpULessThanEqual %bool %69 %65 + %72 = OpSelect %uint %71 %66 %uint_0 + %73 = OpSelect %uint %71 %uint_16 %uint_4 + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %75 = OpAccessChain %_ptr_StorageBuffer_v2int %74 %72 + OpCooperativeMatrixStoreKHR %75 %m %uint_1 %73 NonPrivatePointer + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %80 = OpArrayLength %uint %12 0 + %81 = OpBitcast %uint %int_0 + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %81 %82 + %84 = OpIAdd %uint %83 %uint_2 + %85 = OpULessThanEqual %bool %84 %80 + %86 = OpSelect %uint %85 %81 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_2 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpBitcast %uint %int_0 + %96 = OpIMul %uint %uint_16 %uint_7 + %97 = OpIAdd %uint %95 %96 + %98 = OpIAdd %uint %97 %uint_2 + %99 = OpULessThanEqual %bool %98 %94 + %100 = OpSelect %uint %99 %95 %uint_0 + %101 = OpSelect %uint %99 %uint_16 %uint_2 + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %103 = OpAccessChain %_ptr_StorageBuffer_v4uint %102 %100 + OpCooperativeMatrixStoreKHR %103 %m %uint_1 %101 NonPrivatePointer + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %108 = OpArrayLength %uint %23 0 + %109 = OpBitcast %uint %int_0 + %110 = OpIMul %uint %uint_16 %uint_7 + %111 = OpIAdd %uint %109 %110 + %112 = OpIAdd %uint %111 %uint_8 + %113 = OpULessThanEqual %bool %112 %108 + %114 = OpSelect %uint %113 %109 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_8 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v2half %116 %114 + OpCooperativeMatrixStoreKHR %117 %m %uint_1 %115 NonPrivatePointer + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %122 = OpArrayLength %uint %29 0 + %123 = OpBitcast %uint %int_0 + %124 = OpIMul %uint %uint_16 %uint_7 + %125 = OpIAdd %uint %123 %124 + %126 = OpIAdd %uint %125 %uint_4 + %127 = OpULessThanEqual %bool %126 %122 + %128 = OpSelect %uint %127 %123 %uint_0 + %129 = OpSelect %uint %127 %uint_16 %uint_4 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_v3half %130 %128 + OpCooperativeMatrixStoreKHR %131 %m %uint_1 %129 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl index 102c8ca..fa58f4f 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -19,17 +19,17 @@ uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= ((v_3 / 8u) * 2u)); + bool v_5 = (((v_4 + (16u * 7u)) + 4u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_8 = (((v_7 + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 4u) + 8u) <= ((v_9 / 16u) * 4u)); + bool v_11 = (((v_10 + (16u * 7u)) + 2u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_12 = 0u; out5.GetDimensions(v_12); @@ -39,7 +39,7 @@ uint v_15 = 0u; out6.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 2u) + 8u) <= ((v_15 / 8u) * 2u)); + bool v_17 = (((v_16 + (16u * 7u)) + 4u) <= (v_15 / 8u)); m.Store(out6, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 4u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_row_major.wgsl.expected.msl index 86a3647..5df217e 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_row_major.wgsl.expected.msl
@@ -51,18 +51,18 @@ bool const v_3 = (((v_2 + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_0); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out0) + (select(0u, v_2, v_3) * 4u)), ulong((select(8u, 16u, v_3) * 1u)), ulong2(0ul), false)); uint const v_4 = as_type<uint>(0); - bool const v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_1 * 2u)); + bool const v_5 = (((v_4 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_1); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out1) + (select(0u, v_4, v_5) * 8u)), ulong((select(4u, 16u, v_5) * 2u)), ulong2(0ul), false)); uint const v_6 = as_type<uint>(0); - bool const v_7 = ((((v_6 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_2 * 4u)); + bool const v_7 = (((v_6 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_2); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out2) + (select(0u, v_6, v_7) * 16u)), ulong((select(2u, 16u, v_7) * 4u)), ulong2(0ul), false)); uint const v_8 = as_type<uint>(0); - bool const v_9 = ((((v_8 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_3 * 4u)); + bool const v_9 = (((v_8 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_3); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out3) + (select(0u, v_8, v_9) * 16u)), ulong((select(2u, 16u, v_9) * 4u)), ulong2(0ul), false)); uint const v_10 = as_type<uint>(0); bool const v_11 = (((v_10 + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out5) + (select(0u, v_10, v_11) * 4u)), ulong((select(8u, 16u, v_11) * 1u)), ulong2(0ul), false)); uint const v_12 = as_type<uint>(0); - bool const v_13 = ((((v_12 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_13 = (((v_12 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out6) + (select(0u, v_12, v_13) * 8u)), ulong((select(4u, 16u, v_13) * 2u)), ulong2(0ul), false)); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_row_major.wgsl.expected.spvasm index 5c9e4eb..4c51e58 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_f32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 141 +; Bound: 133 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -132,71 +132,63 @@ OpCooperativeMatrixStoreKHR %59 %m %uint_0 %57 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %64 = OpArrayLength %uint %6 0 - %65 = OpIMul %uint %64 %uint_2 - %66 = OpBitcast %uint %int_0 - %67 = OpIMul %uint %uint_16 %uint_7 - %68 = OpIAdd %uint %66 %67 - %69 = OpIMul %uint %68 %uint_2 - %70 = OpIAdd %uint %69 %uint_8 - %71 = OpULessThanEqual %bool %70 %65 - %72 = OpSelect %uint %71 %66 %uint_0 - %73 = OpSelect %uint %71 %uint_16 %uint_4 - %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %72 - OpCooperativeMatrixStoreKHR %76 %m %uint_0 %73 NonPrivatePointer - %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %81 = OpArrayLength %uint %12 0 - %82 = OpIMul %uint %81 %uint_4 - %83 = OpBitcast %uint %int_0 - %84 = OpIMul %uint %uint_16 %uint_7 - %85 = OpIAdd %uint %83 %84 - %86 = OpIMul %uint %85 %uint_4 - %87 = OpIAdd %uint %86 %uint_8 - %88 = OpULessThanEqual %bool %87 %82 - %89 = OpSelect %uint %88 %83 %uint_0 - %90 = OpSelect %uint %88 %uint_16 %uint_2 - %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %92 = OpAccessChain %_ptr_StorageBuffer_v3float %91 %89 - OpCooperativeMatrixStoreKHR %92 %m %uint_0 %90 NonPrivatePointer - %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %97 = OpArrayLength %uint %18 0 - %98 = OpIMul %uint %97 %uint_4 - %99 = OpBitcast %uint %int_0 - %100 = OpIMul %uint %uint_16 %uint_7 - %101 = OpIAdd %uint %99 %100 - %102 = OpIMul %uint %101 %uint_4 - %103 = OpIAdd %uint %102 %uint_8 - %104 = OpULessThanEqual %bool %103 %98 - %105 = OpSelect %uint %104 %99 %uint_0 - %106 = OpSelect %uint %104 %uint_16 %uint_2 - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %108 = OpAccessChain %_ptr_StorageBuffer_v4uint %107 %105 - OpCooperativeMatrixStoreKHR %108 %m %uint_0 %106 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %113 = OpArrayLength %uint %23 0 - %114 = OpBitcast %uint %int_0 - %115 = OpIMul %uint %uint_16 %uint_7 - %116 = OpIAdd %uint %114 %115 - %117 = OpIAdd %uint %116 %uint_8 - %118 = OpULessThanEqual %bool %117 %113 - %119 = OpSelect %uint %118 %114 %uint_0 - %120 = OpSelect %uint %118 %uint_16 %uint_8 - %121 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %122 = OpAccessChain %_ptr_StorageBuffer_v2half %121 %119 - OpCooperativeMatrixStoreKHR %122 %m %uint_0 %120 NonPrivatePointer - %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %127 = OpArrayLength %uint %29 0 - %128 = OpIMul %uint %127 %uint_2 - %129 = OpBitcast %uint %int_0 - %130 = OpIMul %uint %uint_16 %uint_7 - %131 = OpIAdd %uint %129 %130 - %132 = OpIMul %uint %131 %uint_2 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %uint_16 %uint_4 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_v3half %137 %135 - OpCooperativeMatrixStoreKHR %138 %m %uint_0 %136 NonPrivatePointer + %65 = OpBitcast %uint %int_0 + %66 = OpIMul %uint %uint_16 %uint_7 + %67 = OpIAdd %uint %65 %66 + %68 = OpIAdd %uint %67 %uint_4 + %70 = OpULessThanEqual %bool %68 %64 + %71 = OpSelect %uint %70 %65 %uint_0 + %72 = OpSelect %uint %70 %uint_16 %uint_4 + %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %74 = OpAccessChain %_ptr_StorageBuffer_v2int %73 %71 + OpCooperativeMatrixStoreKHR %74 %m %uint_0 %72 NonPrivatePointer + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %79 = OpArrayLength %uint %12 0 + %80 = OpBitcast %uint %int_0 + %81 = OpIMul %uint %uint_16 %uint_7 + %82 = OpIAdd %uint %80 %81 + %83 = OpIAdd %uint %82 %uint_2 + %84 = OpULessThanEqual %bool %83 %79 + %85 = OpSelect %uint %84 %80 %uint_0 + %86 = OpSelect %uint %84 %uint_16 %uint_2 + %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %88 = OpAccessChain %_ptr_StorageBuffer_v3float %87 %85 + OpCooperativeMatrixStoreKHR %88 %m %uint_0 %86 NonPrivatePointer + %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %93 = OpArrayLength %uint %18 0 + %94 = OpBitcast %uint %int_0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %94 %95 + %97 = OpIAdd %uint %96 %uint_2 + %98 = OpULessThanEqual %bool %97 %93 + %99 = OpSelect %uint %98 %94 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_2 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_0 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpBitcast %uint %int_0 + %109 = OpIMul %uint %uint_16 %uint_7 + %110 = OpIAdd %uint %108 %109 + %111 = OpIAdd %uint %110 %uint_8 + %112 = OpULessThanEqual %bool %111 %107 + %113 = OpSelect %uint %112 %108 %uint_0 + %114 = OpSelect %uint %112 %uint_16 %uint_8 + %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_v2half %115 %113 + OpCooperativeMatrixStoreKHR %116 %m %uint_0 %114 NonPrivatePointer + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %121 = OpArrayLength %uint %29 0 + %122 = OpBitcast %uint %int_0 + %123 = OpIMul %uint %uint_16 %uint_7 + %124 = OpIAdd %uint %122 %123 + %125 = OpIAdd %uint %124 %uint_4 + %126 = OpULessThanEqual %bool %125 %121 + %127 = OpSelect %uint %126 %122 %uint_0 + %128 = OpSelect %uint %126 %uint_16 %uint_4 + %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %130 = OpAccessChain %_ptr_StorageBuffer_v3half %129 %127 + OpCooperativeMatrixStoreKHR %130 %m %uint_0 %128 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl index a0eaa0f..bdbea3e 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -17,15 +17,15 @@ m.Store(out0, (0u + (select(v_1, 0u, 0u) * 4u)), (select(v_1, 16u, 8u) * 4u), MatrixLayout::ColMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_2 / 8u) * 2u)); + bool v_3 = (((0u + (16u * 7u)) + 4u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 4u)), (select(v_3, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_4 / 16u) * 4u)); + bool v_5 = (((0u + (16u * 7u)) + 2u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 4u)), (select(v_5, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_7 = (((0u + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 4u)), (select(v_7, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_8 = 0u; out5.GetDimensions(v_8); @@ -33,7 +33,7 @@ m.Store(out5, (0u + (select(v_9, 0u, 0u) * 4u)), (select(v_9, 16u, 8u) * 4u), MatrixLayout::ColMajor); uint v_10 = 0u; out6.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_10 / 8u) * 2u)); + bool v_11 = (((0u + (16u * 7u)) + 4u) <= (v_10 / 8u)); m.Store(out6, (0u + (select(v_11, 0u, 0u) * 4u)), (select(v_11, 16u, 4u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_col_major.wgsl.expected.spvasm index 9d665c1..d5cd206 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 135 +; Bound: 127 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -131,66 +131,58 @@ OpCooperativeMatrixStoreKHR %57 %m %uint_1 %55 NonPrivatePointer %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %63 = OpArrayLength %uint %6 0 - %64 = OpIMul %uint %63 %uint_2 - %65 = OpIMul %uint %uint_16 %uint_7 - %66 = OpIAdd %uint %uint_0 %65 - %67 = OpIMul %uint %66 %uint_2 - %68 = OpIAdd %uint %67 %uint_8 - %69 = OpULessThanEqual %bool %68 %64 - %70 = OpSelect %uint %69 %uint_0 %uint_0 - %71 = OpSelect %uint %69 %uint_16 %uint_4 - %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %74 = OpAccessChain %_ptr_StorageBuffer_v2int %73 %70 - OpCooperativeMatrixStoreKHR %74 %m %uint_1 %71 NonPrivatePointer - %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %79 = OpArrayLength %uint %12 0 - %80 = OpIMul %uint %79 %uint_4 - %81 = OpIMul %uint %uint_16 %uint_7 - %82 = OpIAdd %uint %uint_0 %81 - %83 = OpIMul %uint %82 %uint_4 - %84 = OpIAdd %uint %83 %uint_8 - %85 = OpULessThanEqual %bool %84 %80 - %86 = OpSelect %uint %85 %uint_0 %uint_0 - %87 = OpSelect %uint %85 %uint_16 %uint_2 - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 - OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %94 = OpArrayLength %uint %18 0 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIMul %uint %uint_16 %uint_7 - %97 = OpIAdd %uint %uint_0 %96 - %98 = OpIMul %uint %97 %uint_4 - %99 = OpIAdd %uint %98 %uint_8 - %100 = OpULessThanEqual %bool %99 %95 - %101 = OpSelect %uint %100 %uint_0 %uint_0 - %102 = OpSelect %uint %100 %uint_16 %uint_2 - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v4uint %103 %101 - OpCooperativeMatrixStoreKHR %104 %m %uint_1 %102 NonPrivatePointer - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %109 = OpArrayLength %uint %23 0 - %110 = OpIMul %uint %uint_16 %uint_7 - %111 = OpIAdd %uint %uint_0 %110 - %112 = OpIAdd %uint %111 %uint_8 - %113 = OpULessThanEqual %bool %112 %109 - %114 = OpSelect %uint %113 %uint_0 %uint_0 - %115 = OpSelect %uint %113 %uint_16 %uint_8 - %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %117 = OpAccessChain %_ptr_StorageBuffer_v2half %116 %114 - OpCooperativeMatrixStoreKHR %117 %m %uint_1 %115 NonPrivatePointer - %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %122 = OpArrayLength %uint %29 0 - %123 = OpIMul %uint %122 %uint_2 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %uint_0 %124 - %126 = OpIMul %uint %125 %uint_2 - %127 = OpIAdd %uint %126 %uint_8 - %128 = OpULessThanEqual %bool %127 %123 - %129 = OpSelect %uint %128 %uint_0 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_4 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_v3half %131 %129 - OpCooperativeMatrixStoreKHR %132 %m %uint_1 %130 NonPrivatePointer + %64 = OpIMul %uint %uint_16 %uint_7 + %65 = OpIAdd %uint %uint_0 %64 + %66 = OpIAdd %uint %65 %uint_4 + %68 = OpULessThanEqual %bool %66 %63 + %69 = OpSelect %uint %68 %uint_0 %uint_0 + %70 = OpSelect %uint %68 %uint_16 %uint_4 + %71 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %72 = OpAccessChain %_ptr_StorageBuffer_v2int %71 %69 + OpCooperativeMatrixStoreKHR %72 %m %uint_1 %70 NonPrivatePointer + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %77 = OpArrayLength %uint %12 0 + %78 = OpIMul %uint %uint_16 %uint_7 + %79 = OpIAdd %uint %uint_0 %78 + %80 = OpIAdd %uint %79 %uint_2 + %81 = OpULessThanEqual %bool %80 %77 + %82 = OpSelect %uint %81 %uint_0 %uint_0 + %83 = OpSelect %uint %81 %uint_16 %uint_2 + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %85 = OpAccessChain %_ptr_StorageBuffer_v3float %84 %82 + OpCooperativeMatrixStoreKHR %85 %m %uint_1 %83 NonPrivatePointer + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %90 = OpArrayLength %uint %18 0 + %91 = OpIMul %uint %uint_16 %uint_7 + %92 = OpIAdd %uint %uint_0 %91 + %93 = OpIAdd %uint %92 %uint_2 + %94 = OpULessThanEqual %bool %93 %90 + %95 = OpSelect %uint %94 %uint_0 %uint_0 + %96 = OpSelect %uint %94 %uint_16 %uint_2 + %97 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %98 = OpAccessChain %_ptr_StorageBuffer_v4uint %97 %95 + OpCooperativeMatrixStoreKHR %98 %m %uint_1 %96 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %103 = OpArrayLength %uint %23 0 + %104 = OpIMul %uint %uint_16 %uint_7 + %105 = OpIAdd %uint %uint_0 %104 + %106 = OpIAdd %uint %105 %uint_8 + %107 = OpULessThanEqual %bool %106 %103 + %108 = OpSelect %uint %107 %uint_0 %uint_0 + %109 = OpSelect %uint %107 %uint_16 %uint_8 + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %111 = OpAccessChain %_ptr_StorageBuffer_v2half %110 %108 + OpCooperativeMatrixStoreKHR %111 %m %uint_1 %109 NonPrivatePointer + %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %116 = OpArrayLength %uint %29 0 + %117 = OpIMul %uint %uint_16 %uint_7 + %118 = OpIAdd %uint %uint_0 %117 + %119 = OpIAdd %uint %118 %uint_4 + %120 = OpULessThanEqual %bool %119 %116 + %121 = OpSelect %uint %120 %uint_0 %uint_0 + %122 = OpSelect %uint %120 %uint_16 %uint_4 + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %124 = OpAccessChain %_ptr_StorageBuffer_v3half %123 %121 + OpCooperativeMatrixStoreKHR %124 %m %uint_1 %122 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl index 7337583..191b174 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -17,15 +17,15 @@ m.Store(out0, (0u + (select(v_1, 0u, 0u) * 4u)), (select(v_1, 16u, 8u) * 4u), MatrixLayout::RowMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_2 / 8u) * 2u)); + bool v_3 = (((0u + (16u * 7u)) + 4u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 4u)), (select(v_3, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_4 / 16u) * 4u)); + bool v_5 = (((0u + (16u * 7u)) + 2u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 4u)), (select(v_5, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_7 = (((0u + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 4u)), (select(v_7, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_8 = 0u; out5.GetDimensions(v_8); @@ -33,7 +33,7 @@ m.Store(out5, (0u + (select(v_9, 0u, 0u) * 4u)), (select(v_9, 16u, 8u) * 4u), MatrixLayout::RowMajor); uint v_10 = 0u; out6.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_10 / 8u) * 2u)); + bool v_11 = (((0u + (16u * 7u)) + 4u) <= (v_10 / 8u)); m.Store(out6, (0u + (select(v_11, 0u, 0u) * 4u)), (select(v_11, 16u, 4u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_row_major.wgsl.expected.spvasm index a418b05..eed78d5 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_i32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 134 +; Bound: 126 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -130,66 +130,58 @@ OpCooperativeMatrixStoreKHR %57 %m %uint_0 %55 NonPrivatePointer %60 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %62 = OpArrayLength %uint %6 0 - %63 = OpIMul %uint %62 %uint_2 - %64 = OpIMul %uint %uint_16 %uint_7 - %65 = OpIAdd %uint %uint_0 %64 - %66 = OpIMul %uint %65 %uint_2 - %67 = OpIAdd %uint %66 %uint_8 - %68 = OpULessThanEqual %bool %67 %63 - %69 = OpSelect %uint %68 %uint_0 %uint_0 - %70 = OpSelect %uint %68 %uint_16 %uint_4 - %72 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %73 = OpAccessChain %_ptr_StorageBuffer_v2int %72 %69 - OpCooperativeMatrixStoreKHR %73 %m %uint_0 %70 NonPrivatePointer - %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %78 = OpArrayLength %uint %12 0 - %79 = OpIMul %uint %78 %uint_4 - %80 = OpIMul %uint %uint_16 %uint_7 - %81 = OpIAdd %uint %uint_0 %80 - %82 = OpIMul %uint %81 %uint_4 - %83 = OpIAdd %uint %82 %uint_8 - %84 = OpULessThanEqual %bool %83 %79 - %85 = OpSelect %uint %84 %uint_0 %uint_0 - %86 = OpSelect %uint %84 %uint_16 %uint_2 - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %88 = OpAccessChain %_ptr_StorageBuffer_v3float %87 %85 - OpCooperativeMatrixStoreKHR %88 %m %uint_0 %86 NonPrivatePointer - %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %93 = OpArrayLength %uint %18 0 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpIMul %uint %uint_16 %uint_7 - %96 = OpIAdd %uint %uint_0 %95 - %97 = OpIMul %uint %96 %uint_4 - %98 = OpIAdd %uint %97 %uint_8 - %99 = OpULessThanEqual %bool %98 %94 - %100 = OpSelect %uint %99 %uint_0 %uint_0 - %101 = OpSelect %uint %99 %uint_16 %uint_2 - %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %103 = OpAccessChain %_ptr_StorageBuffer_v4uint %102 %100 - OpCooperativeMatrixStoreKHR %103 %m %uint_0 %101 NonPrivatePointer - %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %108 = OpArrayLength %uint %23 0 - %109 = OpIMul %uint %uint_16 %uint_7 - %110 = OpIAdd %uint %uint_0 %109 - %111 = OpIAdd %uint %110 %uint_8 - %112 = OpULessThanEqual %bool %111 %108 - %113 = OpSelect %uint %112 %uint_0 %uint_0 - %114 = OpSelect %uint %112 %uint_16 %uint_8 - %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %116 = OpAccessChain %_ptr_StorageBuffer_v2half %115 %113 - OpCooperativeMatrixStoreKHR %116 %m %uint_0 %114 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %121 = OpArrayLength %uint %29 0 - %122 = OpIMul %uint %121 %uint_2 - %123 = OpIMul %uint %uint_16 %uint_7 - %124 = OpIAdd %uint %uint_0 %123 - %125 = OpIMul %uint %124 %uint_2 - %126 = OpIAdd %uint %125 %uint_8 - %127 = OpULessThanEqual %bool %126 %122 - %128 = OpSelect %uint %127 %uint_0 %uint_0 - %129 = OpSelect %uint %127 %uint_16 %uint_4 - %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %131 = OpAccessChain %_ptr_StorageBuffer_v3half %130 %128 - OpCooperativeMatrixStoreKHR %131 %m %uint_0 %129 NonPrivatePointer + %63 = OpIMul %uint %uint_16 %uint_7 + %64 = OpIAdd %uint %uint_0 %63 + %65 = OpIAdd %uint %64 %uint_4 + %67 = OpULessThanEqual %bool %65 %62 + %68 = OpSelect %uint %67 %uint_0 %uint_0 + %69 = OpSelect %uint %67 %uint_16 %uint_4 + %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %71 = OpAccessChain %_ptr_StorageBuffer_v2int %70 %68 + OpCooperativeMatrixStoreKHR %71 %m %uint_0 %69 NonPrivatePointer + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %76 = OpArrayLength %uint %12 0 + %77 = OpIMul %uint %uint_16 %uint_7 + %78 = OpIAdd %uint %uint_0 %77 + %79 = OpIAdd %uint %78 %uint_2 + %80 = OpULessThanEqual %bool %79 %76 + %81 = OpSelect %uint %80 %uint_0 %uint_0 + %82 = OpSelect %uint %80 %uint_16 %uint_2 + %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %84 = OpAccessChain %_ptr_StorageBuffer_v3float %83 %81 + OpCooperativeMatrixStoreKHR %84 %m %uint_0 %82 NonPrivatePointer + %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %89 = OpArrayLength %uint %18 0 + %90 = OpIMul %uint %uint_16 %uint_7 + %91 = OpIAdd %uint %uint_0 %90 + %92 = OpIAdd %uint %91 %uint_2 + %93 = OpULessThanEqual %bool %92 %89 + %94 = OpSelect %uint %93 %uint_0 %uint_0 + %95 = OpSelect %uint %93 %uint_16 %uint_2 + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %97 = OpAccessChain %_ptr_StorageBuffer_v4uint %96 %94 + OpCooperativeMatrixStoreKHR %97 %m %uint_0 %95 NonPrivatePointer + %100 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %102 = OpArrayLength %uint %23 0 + %103 = OpIMul %uint %uint_16 %uint_7 + %104 = OpIAdd %uint %uint_0 %103 + %105 = OpIAdd %uint %104 %uint_8 + %106 = OpULessThanEqual %bool %105 %102 + %107 = OpSelect %uint %106 %uint_0 %uint_0 + %108 = OpSelect %uint %106 %uint_16 %uint_8 + %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %110 = OpAccessChain %_ptr_StorageBuffer_v2half %109 %107 + OpCooperativeMatrixStoreKHR %110 %m %uint_0 %108 NonPrivatePointer + %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %115 = OpArrayLength %uint %29 0 + %116 = OpIMul %uint %uint_16 %uint_7 + %117 = OpIAdd %uint %uint_0 %116 + %118 = OpIAdd %uint %117 %uint_4 + %119 = OpULessThanEqual %bool %118 %115 + %120 = OpSelect %uint %119 %uint_0 %uint_0 + %121 = OpSelect %uint %119 %uint_16 %uint_4 + %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %123 = OpAccessChain %_ptr_StorageBuffer_v3half %122 %120 + OpCooperativeMatrixStoreKHR %123 %m %uint_0 %121 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl index cf2a36c..aefb236 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -15,37 +15,37 @@ uint v = 0u; out0.GetDimensions(v); uint v_1 = asuint(int(0)); - bool v_2 = ((((v_1 + (16u * 7u)) * 4u) + 8u) <= ((v / 4u) * 4u)); + bool v_2 = (((v_1 + (16u * 7u)) + 2u) <= (v / 4u)); m.Store(out0, (0u + (select(v_2, v_1, 0u) * 4u)), (select(v_2, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 8u) + 8u) <= ((v_3 / 8u) * 8u)); + bool v_5 = (((v_4 + (16u * 7u)) + 1u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 16u) + 16u) <= ((v_6 / 16u) * 16u)); + bool v_8 = (((v_7 + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 16u) + 16u) <= ((v_9 / 16u) * 16u)); + bool v_11 = (((v_10 + (16u * 7u)) + 1u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_12 = 0u; out4.GetDimensions(v_12); uint v_13 = asuint(int(0)); - bool v_14 = ((((v_13 + (16u * 7u)) * 2u) + 8u) <= ((v_12 / 2u) * 2u)); + bool v_14 = (((v_13 + (16u * 7u)) + 4u) <= (v_12 / 2u)); m.Store(out4, (0u + (select(v_14, v_13, 0u) * 4u)), (select(v_14, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; out5.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 4u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 4u)); m.Store(out5, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_18 = 0u; out6.GetDimensions(v_18); uint v_19 = asuint(int(0)); - bool v_20 = ((((v_19 + (16u * 7u)) * 8u) + 8u) <= ((v_18 / 8u) * 8u)); + bool v_20 = (((v_19 + (16u * 7u)) + 1u) <= (v_18 / 8u)); m.Store(out6, (0u + (select(v_20, v_19, 0u) * 4u)), (select(v_20, 16u, 1u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_col_major.wgsl.expected.spvasm index 553e59e..8484576 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 167 +; Bound: 153 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -113,7 +113,6 @@ %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 @@ -127,6 +126,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -136,101 +136,87 @@ %41 = OpLabel %48 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %51 = OpArrayLength %uint %1 0 - %52 = OpIMul %uint %51 %uint_4 - %54 = OpBitcast %uint %int_0 - %56 = OpIMul %uint %uint_16 %uint_7 - %59 = OpIAdd %uint %54 %56 - %60 = OpIMul %uint %59 %uint_4 - %61 = OpIAdd %uint %60 %uint_8 - %62 = OpULessThanEqual %bool %61 %52 - %64 = OpSelect %uint %62 %54 %uint_0 - %65 = OpSelect %uint %62 %uint_16 %uint_2 - %66 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %67 = OpAccessChain %_ptr_StorageBuffer_uint %66 %64 - OpCooperativeMatrixStoreKHR %67 %m %uint_1 %65 NonPrivatePointer - %71 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %73 = OpArrayLength %uint %6 0 - %74 = OpIMul %uint %73 %uint_8 - %75 = OpBitcast %uint %int_0 - %76 = OpIMul %uint %uint_16 %uint_7 - %77 = OpIAdd %uint %75 %76 - %78 = OpIMul %uint %77 %uint_8 - %79 = OpIAdd %uint %78 %uint_8 - %80 = OpULessThanEqual %bool %79 %74 - %81 = OpSelect %uint %80 %75 %uint_0 - %82 = OpSelect %uint %80 %uint_16 %uint_1 - %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %83 %81 - OpCooperativeMatrixStoreKHR %84 %m %uint_1 %82 NonPrivatePointer - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %89 = OpArrayLength %uint %12 0 - %90 = OpIMul %uint %89 %uint_16 - %91 = OpBitcast %uint %int_0 - %92 = OpIMul %uint %uint_16 %uint_7 - %93 = OpIAdd %uint %91 %92 - %94 = OpIMul %uint %93 %uint_16 - %95 = OpIAdd %uint %94 %uint_16 - %96 = OpULessThanEqual %bool %95 %90 - %97 = OpSelect %uint %96 %91 %uint_0 - %98 = OpSelect %uint %96 %uint_16 %uint_1 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_v3float %99 %97 - OpCooperativeMatrixStoreKHR %100 %m %uint_1 %98 NonPrivatePointer - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %105 = OpArrayLength %uint %18 0 - %106 = OpIMul %uint %105 %uint_16 - %107 = OpBitcast %uint %int_0 - %108 = OpIMul %uint %uint_16 %uint_7 - %109 = OpIAdd %uint %107 %108 - %110 = OpIMul %uint %109 %uint_16 - %111 = OpIAdd %uint %110 %uint_16 - %112 = OpULessThanEqual %bool %111 %106 - %113 = OpSelect %uint %112 %107 %uint_0 - %114 = OpSelect %uint %112 %uint_16 %uint_1 - %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %116 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %113 - OpCooperativeMatrixStoreKHR %116 %m %uint_1 %114 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %121 = OpArrayLength %uint %23 0 - %122 = OpIMul %uint %121 %uint_2 - %123 = OpBitcast %uint %int_0 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %123 %124 - %126 = OpIMul %uint %125 %uint_2 - %127 = OpIAdd %uint %126 %uint_8 - %128 = OpULessThanEqual %bool %127 %122 - %129 = OpSelect %uint %128 %123 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_4 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_half %131 %129 - OpCooperativeMatrixStoreKHR %132 %m %uint_1 %130 NonPrivatePointer + %52 = OpBitcast %uint %int_0 + %54 = OpIMul %uint %uint_16 %uint_7 + %57 = OpIAdd %uint %52 %54 + %58 = OpIAdd %uint %57 %uint_2 + %59 = OpULessThanEqual %bool %58 %51 + %61 = OpSelect %uint %59 %52 %uint_0 + %62 = OpSelect %uint %59 %uint_16 %uint_2 + %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %61 + OpCooperativeMatrixStoreKHR %64 %m %uint_1 %62 NonPrivatePointer + %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %70 = OpArrayLength %uint %6 0 + %71 = OpBitcast %uint %int_0 + %72 = OpIMul %uint %uint_16 %uint_7 + %73 = OpIAdd %uint %71 %72 + %74 = OpIAdd %uint %73 %uint_1 + %75 = OpULessThanEqual %bool %74 %70 + %76 = OpSelect %uint %75 %71 %uint_0 + %77 = OpSelect %uint %75 %uint_16 %uint_1 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_v2int %78 %76 + OpCooperativeMatrixStoreKHR %79 %m %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %84 = OpArrayLength %uint %12 0 + %85 = OpBitcast %uint %int_0 + %86 = OpIMul %uint %uint_16 %uint_7 + %87 = OpIAdd %uint %85 %86 + %88 = OpIAdd %uint %87 %uint_1 + %89 = OpULessThanEqual %bool %88 %84 + %90 = OpSelect %uint %89 %85 %uint_0 + %91 = OpSelect %uint %89 %uint_16 %uint_1 + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 + OpCooperativeMatrixStoreKHR %93 %m %uint_1 %91 NonPrivatePointer + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %98 = OpArrayLength %uint %18 0 + %99 = OpBitcast %uint %int_0 + %100 = OpIMul %uint %uint_16 %uint_7 + %101 = OpIAdd %uint %99 %100 + %102 = OpIAdd %uint %101 %uint_1 + %103 = OpULessThanEqual %bool %102 %98 + %104 = OpSelect %uint %103 %99 %uint_0 + %105 = OpSelect %uint %103 %uint_16 %uint_1 + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %107 = OpAccessChain %_ptr_StorageBuffer_v4uint %106 %104 + OpCooperativeMatrixStoreKHR %107 %m %uint_1 %105 NonPrivatePointer + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %112 = OpArrayLength %uint %23 0 + %113 = OpBitcast %uint %int_0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %113 %114 + %116 = OpIAdd %uint %115 %uint_4 + %118 = OpULessThanEqual %bool %116 %112 + %119 = OpSelect %uint %118 %113 %uint_0 + %120 = OpSelect %uint %118 %uint_16 %uint_4 + %121 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %122 = OpAccessChain %_ptr_StorageBuffer_half %121 %119 + OpCooperativeMatrixStoreKHR %122 %m %uint_1 %120 NonPrivatePointer + %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %127 = OpArrayLength %uint %28 0 + %128 = OpBitcast %uint %int_0 + %129 = OpIMul %uint %uint_16 %uint_7 + %130 = OpIAdd %uint %128 %129 + %131 = OpIAdd %uint %130 %uint_2 + %132 = OpULessThanEqual %bool %131 %127 + %133 = OpSelect %uint %132 %128 %uint_0 + %134 = OpSelect %uint %132 %uint_16 %uint_2 %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %137 = OpArrayLength %uint %28 0 - %138 = OpIMul %uint %137 %uint_4 - %139 = OpBitcast %uint %int_0 - %140 = OpIMul %uint %uint_16 %uint_7 - %141 = OpIAdd %uint %139 %140 - %142 = OpIMul %uint %141 %uint_4 - %143 = OpIAdd %uint %142 %uint_8 - %144 = OpULessThanEqual %bool %143 %138 - %145 = OpSelect %uint %144 %139 %uint_0 - %146 = OpSelect %uint %144 %uint_16 %uint_2 - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %148 = OpAccessChain %_ptr_StorageBuffer_v2half %147 %145 - OpCooperativeMatrixStoreKHR %148 %m %uint_1 %146 NonPrivatePointer - %151 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %153 = OpArrayLength %uint %33 0 - %154 = OpIMul %uint %153 %uint_8 - %155 = OpBitcast %uint %int_0 - %156 = OpIMul %uint %uint_16 %uint_7 - %157 = OpIAdd %uint %155 %156 - %158 = OpIMul %uint %157 %uint_8 - %159 = OpIAdd %uint %158 %uint_8 - %160 = OpULessThanEqual %bool %159 %154 - %161 = OpSelect %uint %160 %155 %uint_0 - %162 = OpSelect %uint %160 %uint_16 %uint_1 - %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v3half %163 %161 - OpCooperativeMatrixStoreKHR %164 %m %uint_1 %162 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer_v2half %135 %133 + OpCooperativeMatrixStoreKHR %136 %m %uint_1 %134 NonPrivatePointer + %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %141 = OpArrayLength %uint %33 0 + %142 = OpBitcast %uint %int_0 + %143 = OpIMul %uint %uint_16 %uint_7 + %144 = OpIAdd %uint %142 %143 + %145 = OpIAdd %uint %144 %uint_1 + %146 = OpULessThanEqual %bool %145 %141 + %147 = OpSelect %uint %146 %142 %uint_0 + %148 = OpSelect %uint %146 %uint_16 %uint_1 + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %150 = OpAccessChain %_ptr_StorageBuffer_v3half %149 %147 + OpCooperativeMatrixStoreKHR %150 %m %uint_1 %148 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl index 1a1859f..1bae14a 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -15,37 +15,37 @@ uint v = 0u; out0.GetDimensions(v); uint v_1 = asuint(int(0)); - bool v_2 = ((((v_1 + (16u * 7u)) * 4u) + 8u) <= ((v / 4u) * 4u)); + bool v_2 = (((v_1 + (16u * 7u)) + 2u) <= (v / 4u)); m.Store(out0, (0u + (select(v_2, v_1, 0u) * 4u)), (select(v_2, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 8u) + 8u) <= ((v_3 / 8u) * 8u)); + bool v_5 = (((v_4 + (16u * 7u)) + 1u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 16u) + 16u) <= ((v_6 / 16u) * 16u)); + bool v_8 = (((v_7 + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 16u) + 16u) <= ((v_9 / 16u) * 16u)); + bool v_11 = (((v_10 + (16u * 7u)) + 1u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_12 = 0u; out4.GetDimensions(v_12); uint v_13 = asuint(int(0)); - bool v_14 = ((((v_13 + (16u * 7u)) * 2u) + 8u) <= ((v_12 / 2u) * 2u)); + bool v_14 = (((v_13 + (16u * 7u)) + 4u) <= (v_12 / 2u)); m.Store(out4, (0u + (select(v_14, v_13, 0u) * 4u)), (select(v_14, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_15 = 0u; out5.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 4u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 4u)); m.Store(out5, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_18 = 0u; out6.GetDimensions(v_18); uint v_19 = asuint(int(0)); - bool v_20 = ((((v_19 + (16u * 7u)) * 8u) + 8u) <= ((v_18 / 8u) * 8u)); + bool v_20 = (((v_19 + (16u * 7u)) + 1u) <= (v_18 / 8u)); m.Store(out6, (0u + (select(v_20, v_19, 0u) * 4u)), (select(v_20, 16u, 1u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_row_major.wgsl.expected.spvasm index fa8fe77..a6a74b1 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_i8_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 167 +; Bound: 153 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -113,7 +113,6 @@ %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 @@ -127,6 +126,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -136,101 +136,87 @@ %41 = OpLabel %48 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %51 = OpArrayLength %uint %1 0 - %52 = OpIMul %uint %51 %uint_4 - %54 = OpBitcast %uint %int_0 - %56 = OpIMul %uint %uint_16 %uint_7 - %59 = OpIAdd %uint %54 %56 - %60 = OpIMul %uint %59 %uint_4 - %61 = OpIAdd %uint %60 %uint_8 - %62 = OpULessThanEqual %bool %61 %52 - %64 = OpSelect %uint %62 %54 %uint_0 - %65 = OpSelect %uint %62 %uint_16 %uint_2 - %66 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %67 = OpAccessChain %_ptr_StorageBuffer_uint %66 %64 - OpCooperativeMatrixStoreKHR %67 %m %uint_0 %65 NonPrivatePointer - %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %72 = OpArrayLength %uint %6 0 - %73 = OpIMul %uint %72 %uint_8 - %74 = OpBitcast %uint %int_0 - %75 = OpIMul %uint %uint_16 %uint_7 - %76 = OpIAdd %uint %74 %75 - %77 = OpIMul %uint %76 %uint_8 - %78 = OpIAdd %uint %77 %uint_8 - %79 = OpULessThanEqual %bool %78 %73 - %80 = OpSelect %uint %79 %74 %uint_0 - %81 = OpSelect %uint %79 %uint_16 %uint_1 - %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %83 %80 - OpCooperativeMatrixStoreKHR %84 %m %uint_0 %81 NonPrivatePointer - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %89 = OpArrayLength %uint %12 0 - %90 = OpIMul %uint %89 %uint_16 - %91 = OpBitcast %uint %int_0 - %92 = OpIMul %uint %uint_16 %uint_7 - %93 = OpIAdd %uint %91 %92 - %94 = OpIMul %uint %93 %uint_16 - %95 = OpIAdd %uint %94 %uint_16 - %96 = OpULessThanEqual %bool %95 %90 - %97 = OpSelect %uint %96 %91 %uint_0 - %98 = OpSelect %uint %96 %uint_16 %uint_1 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_v3float %99 %97 - OpCooperativeMatrixStoreKHR %100 %m %uint_0 %98 NonPrivatePointer - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %105 = OpArrayLength %uint %18 0 - %106 = OpIMul %uint %105 %uint_16 - %107 = OpBitcast %uint %int_0 - %108 = OpIMul %uint %uint_16 %uint_7 - %109 = OpIAdd %uint %107 %108 - %110 = OpIMul %uint %109 %uint_16 - %111 = OpIAdd %uint %110 %uint_16 - %112 = OpULessThanEqual %bool %111 %106 - %113 = OpSelect %uint %112 %107 %uint_0 - %114 = OpSelect %uint %112 %uint_16 %uint_1 - %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %116 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %113 - OpCooperativeMatrixStoreKHR %116 %m %uint_0 %114 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %121 = OpArrayLength %uint %23 0 - %122 = OpIMul %uint %121 %uint_2 - %123 = OpBitcast %uint %int_0 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %123 %124 - %126 = OpIMul %uint %125 %uint_2 - %127 = OpIAdd %uint %126 %uint_8 - %128 = OpULessThanEqual %bool %127 %122 - %129 = OpSelect %uint %128 %123 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_4 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_half %131 %129 - OpCooperativeMatrixStoreKHR %132 %m %uint_0 %130 NonPrivatePointer + %52 = OpBitcast %uint %int_0 + %54 = OpIMul %uint %uint_16 %uint_7 + %57 = OpIAdd %uint %52 %54 + %58 = OpIAdd %uint %57 %uint_2 + %59 = OpULessThanEqual %bool %58 %51 + %61 = OpSelect %uint %59 %52 %uint_0 + %62 = OpSelect %uint %59 %uint_16 %uint_2 + %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %64 = OpAccessChain %_ptr_StorageBuffer_uint %63 %61 + OpCooperativeMatrixStoreKHR %64 %m %uint_0 %62 NonPrivatePointer + %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %69 = OpArrayLength %uint %6 0 + %70 = OpBitcast %uint %int_0 + %71 = OpIMul %uint %uint_16 %uint_7 + %72 = OpIAdd %uint %70 %71 + %73 = OpIAdd %uint %72 %uint_1 + %75 = OpULessThanEqual %bool %73 %69 + %76 = OpSelect %uint %75 %70 %uint_0 + %77 = OpSelect %uint %75 %uint_16 %uint_1 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_v2int %78 %76 + OpCooperativeMatrixStoreKHR %79 %m %uint_0 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %84 = OpArrayLength %uint %12 0 + %85 = OpBitcast %uint %int_0 + %86 = OpIMul %uint %uint_16 %uint_7 + %87 = OpIAdd %uint %85 %86 + %88 = OpIAdd %uint %87 %uint_1 + %89 = OpULessThanEqual %bool %88 %84 + %90 = OpSelect %uint %89 %85 %uint_0 + %91 = OpSelect %uint %89 %uint_16 %uint_1 + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 + OpCooperativeMatrixStoreKHR %93 %m %uint_0 %91 NonPrivatePointer + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %98 = OpArrayLength %uint %18 0 + %99 = OpBitcast %uint %int_0 + %100 = OpIMul %uint %uint_16 %uint_7 + %101 = OpIAdd %uint %99 %100 + %102 = OpIAdd %uint %101 %uint_1 + %103 = OpULessThanEqual %bool %102 %98 + %104 = OpSelect %uint %103 %99 %uint_0 + %105 = OpSelect %uint %103 %uint_16 %uint_1 + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %107 = OpAccessChain %_ptr_StorageBuffer_v4uint %106 %104 + OpCooperativeMatrixStoreKHR %107 %m %uint_0 %105 NonPrivatePointer + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %112 = OpArrayLength %uint %23 0 + %113 = OpBitcast %uint %int_0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %113 %114 + %116 = OpIAdd %uint %115 %uint_4 + %118 = OpULessThanEqual %bool %116 %112 + %119 = OpSelect %uint %118 %113 %uint_0 + %120 = OpSelect %uint %118 %uint_16 %uint_4 + %121 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %122 = OpAccessChain %_ptr_StorageBuffer_half %121 %119 + OpCooperativeMatrixStoreKHR %122 %m %uint_0 %120 NonPrivatePointer + %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %127 = OpArrayLength %uint %28 0 + %128 = OpBitcast %uint %int_0 + %129 = OpIMul %uint %uint_16 %uint_7 + %130 = OpIAdd %uint %128 %129 + %131 = OpIAdd %uint %130 %uint_2 + %132 = OpULessThanEqual %bool %131 %127 + %133 = OpSelect %uint %132 %128 %uint_0 + %134 = OpSelect %uint %132 %uint_16 %uint_2 %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %137 = OpArrayLength %uint %28 0 - %138 = OpIMul %uint %137 %uint_4 - %139 = OpBitcast %uint %int_0 - %140 = OpIMul %uint %uint_16 %uint_7 - %141 = OpIAdd %uint %139 %140 - %142 = OpIMul %uint %141 %uint_4 - %143 = OpIAdd %uint %142 %uint_8 - %144 = OpULessThanEqual %bool %143 %138 - %145 = OpSelect %uint %144 %139 %uint_0 - %146 = OpSelect %uint %144 %uint_16 %uint_2 - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %148 = OpAccessChain %_ptr_StorageBuffer_v2half %147 %145 - OpCooperativeMatrixStoreKHR %148 %m %uint_0 %146 NonPrivatePointer - %151 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %153 = OpArrayLength %uint %33 0 - %154 = OpIMul %uint %153 %uint_8 - %155 = OpBitcast %uint %int_0 - %156 = OpIMul %uint %uint_16 %uint_7 - %157 = OpIAdd %uint %155 %156 - %158 = OpIMul %uint %157 %uint_8 - %159 = OpIAdd %uint %158 %uint_8 - %160 = OpULessThanEqual %bool %159 %154 - %161 = OpSelect %uint %160 %155 %uint_0 - %162 = OpSelect %uint %160 %uint_16 %uint_1 - %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v3half %163 %161 - OpCooperativeMatrixStoreKHR %164 %m %uint_0 %162 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer_v2half %135 %133 + OpCooperativeMatrixStoreKHR %136 %m %uint_0 %134 NonPrivatePointer + %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %141 = OpArrayLength %uint %33 0 + %142 = OpBitcast %uint %int_0 + %143 = OpIMul %uint %uint_16 %uint_7 + %144 = OpIAdd %uint %142 %143 + %145 = OpIAdd %uint %144 %uint_1 + %146 = OpULessThanEqual %bool %145 %141 + %147 = OpSelect %uint %146 %142 %uint_0 + %148 = OpSelect %uint %146 %uint_16 %uint_1 + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %150 = OpAccessChain %_ptr_StorageBuffer_v3half %149 %147 + OpCooperativeMatrixStoreKHR %150 %m %uint_0 %148 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl index accdbe8..c67e015 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -19,17 +19,17 @@ uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= ((v_3 / 8u) * 2u)); + bool v_5 = (((v_4 + (16u * 7u)) + 4u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_8 = (((v_7 + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 4u) + 8u) <= ((v_9 / 16u) * 4u)); + bool v_11 = (((v_10 + (16u * 7u)) + 2u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_12 = 0u; out5.GetDimensions(v_12); @@ -39,7 +39,7 @@ uint v_15 = 0u; out6.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 2u) + 8u) <= ((v_15 / 8u) * 2u)); + bool v_17 = (((v_16 + (16u * 7u)) + 4u) <= (v_15 / 8u)); m.Store(out6, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 4u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_col_major.wgsl.expected.spvasm index c154ea0..02fcdb9 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 142 +; Bound: 134 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -133,71 +133,63 @@ OpCooperativeMatrixStoreKHR %59 %m %uint_1 %57 NonPrivatePointer %63 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %65 = OpArrayLength %uint %6 0 - %66 = OpIMul %uint %65 %uint_2 - %67 = OpBitcast %uint %int_0 - %68 = OpIMul %uint %uint_16 %uint_7 - %69 = OpIAdd %uint %67 %68 - %70 = OpIMul %uint %69 %uint_2 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %66 - %73 = OpSelect %uint %72 %67 %uint_0 - %74 = OpSelect %uint %72 %uint_16 %uint_4 - %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %77 = OpAccessChain %_ptr_StorageBuffer_v2int %76 %73 - OpCooperativeMatrixStoreKHR %77 %m %uint_1 %74 NonPrivatePointer - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %82 = OpArrayLength %uint %12 0 - %83 = OpIMul %uint %82 %uint_4 - %84 = OpBitcast %uint %int_0 - %85 = OpIMul %uint %uint_16 %uint_7 - %86 = OpIAdd %uint %84 %85 - %87 = OpIMul %uint %86 %uint_4 - %88 = OpIAdd %uint %87 %uint_8 - %89 = OpULessThanEqual %bool %88 %83 - %90 = OpSelect %uint %89 %84 %uint_0 - %91 = OpSelect %uint %89 %uint_16 %uint_2 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 - OpCooperativeMatrixStoreKHR %93 %m %uint_1 %91 NonPrivatePointer - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %98 = OpArrayLength %uint %18 0 - %99 = OpIMul %uint %98 %uint_4 - %100 = OpBitcast %uint %int_0 - %101 = OpIMul %uint %uint_16 %uint_7 - %102 = OpIAdd %uint %100 %101 - %103 = OpIMul %uint %102 %uint_4 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %uint_16 %uint_2 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_v4uint %108 %106 - OpCooperativeMatrixStoreKHR %109 %m %uint_1 %107 NonPrivatePointer - %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %114 = OpArrayLength %uint %23 0 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %114 - %120 = OpSelect %uint %119 %115 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v2half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_1 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %128 = OpArrayLength %uint %29 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpBitcast %uint %int_0 - %131 = OpIMul %uint %uint_16 %uint_7 - %132 = OpIAdd %uint %130 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %129 - %136 = OpSelect %uint %135 %130 %uint_0 - %137 = OpSelect %uint %135 %uint_16 %uint_4 - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_v3half %138 %136 - OpCooperativeMatrixStoreKHR %139 %m %uint_1 %137 NonPrivatePointer + %66 = OpBitcast %uint %int_0 + %67 = OpIMul %uint %uint_16 %uint_7 + %68 = OpIAdd %uint %66 %67 + %69 = OpIAdd %uint %68 %uint_4 + %71 = OpULessThanEqual %bool %69 %65 + %72 = OpSelect %uint %71 %66 %uint_0 + %73 = OpSelect %uint %71 %uint_16 %uint_4 + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %75 = OpAccessChain %_ptr_StorageBuffer_v2int %74 %72 + OpCooperativeMatrixStoreKHR %75 %m %uint_1 %73 NonPrivatePointer + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %80 = OpArrayLength %uint %12 0 + %81 = OpBitcast %uint %int_0 + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %81 %82 + %84 = OpIAdd %uint %83 %uint_2 + %85 = OpULessThanEqual %bool %84 %80 + %86 = OpSelect %uint %85 %81 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_2 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpBitcast %uint %int_0 + %96 = OpIMul %uint %uint_16 %uint_7 + %97 = OpIAdd %uint %95 %96 + %98 = OpIAdd %uint %97 %uint_2 + %99 = OpULessThanEqual %bool %98 %94 + %100 = OpSelect %uint %99 %95 %uint_0 + %101 = OpSelect %uint %99 %uint_16 %uint_2 + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %103 = OpAccessChain %_ptr_StorageBuffer_v4uint %102 %100 + OpCooperativeMatrixStoreKHR %103 %m %uint_1 %101 NonPrivatePointer + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %108 = OpArrayLength %uint %23 0 + %109 = OpBitcast %uint %int_0 + %110 = OpIMul %uint %uint_16 %uint_7 + %111 = OpIAdd %uint %109 %110 + %112 = OpIAdd %uint %111 %uint_8 + %113 = OpULessThanEqual %bool %112 %108 + %114 = OpSelect %uint %113 %109 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_8 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v2half %116 %114 + OpCooperativeMatrixStoreKHR %117 %m %uint_1 %115 NonPrivatePointer + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %122 = OpArrayLength %uint %29 0 + %123 = OpBitcast %uint %int_0 + %124 = OpIMul %uint %uint_16 %uint_7 + %125 = OpIAdd %uint %123 %124 + %126 = OpIAdd %uint %125 %uint_4 + %127 = OpULessThanEqual %bool %126 %122 + %128 = OpSelect %uint %127 %123 %uint_0 + %129 = OpSelect %uint %127 %uint_16 %uint_4 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_v3half %130 %128 + OpCooperativeMatrixStoreKHR %131 %m %uint_1 %129 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl index 71dbc42..d1484b2 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -19,17 +19,17 @@ uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= ((v_3 / 8u) * 2u)); + bool v_5 = (((v_4 + (16u * 7u)) + 4u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_8 = (((v_7 + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 4u) + 8u) <= ((v_9 / 16u) * 4u)); + bool v_11 = (((v_10 + (16u * 7u)) + 2u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_12 = 0u; out5.GetDimensions(v_12); @@ -39,7 +39,7 @@ uint v_15 = 0u; out6.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 2u) + 8u) <= ((v_15 / 8u) * 2u)); + bool v_17 = (((v_16 + (16u * 7u)) + 4u) <= (v_15 / 8u)); m.Store(out6, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 4u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_row_major.wgsl.expected.spvasm index 63e29f5..2966243 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_u32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 141 +; Bound: 133 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -132,71 +132,63 @@ OpCooperativeMatrixStoreKHR %59 %m %uint_0 %57 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %64 = OpArrayLength %uint %6 0 - %65 = OpIMul %uint %64 %uint_2 - %66 = OpBitcast %uint %int_0 - %67 = OpIMul %uint %uint_16 %uint_7 - %68 = OpIAdd %uint %66 %67 - %69 = OpIMul %uint %68 %uint_2 - %70 = OpIAdd %uint %69 %uint_8 - %71 = OpULessThanEqual %bool %70 %65 - %72 = OpSelect %uint %71 %66 %uint_0 - %73 = OpSelect %uint %71 %uint_16 %uint_4 - %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %72 - OpCooperativeMatrixStoreKHR %76 %m %uint_0 %73 NonPrivatePointer - %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %81 = OpArrayLength %uint %12 0 - %82 = OpIMul %uint %81 %uint_4 - %83 = OpBitcast %uint %int_0 - %84 = OpIMul %uint %uint_16 %uint_7 - %85 = OpIAdd %uint %83 %84 - %86 = OpIMul %uint %85 %uint_4 - %87 = OpIAdd %uint %86 %uint_8 - %88 = OpULessThanEqual %bool %87 %82 - %89 = OpSelect %uint %88 %83 %uint_0 - %90 = OpSelect %uint %88 %uint_16 %uint_2 - %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %92 = OpAccessChain %_ptr_StorageBuffer_v3float %91 %89 - OpCooperativeMatrixStoreKHR %92 %m %uint_0 %90 NonPrivatePointer - %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %97 = OpArrayLength %uint %18 0 - %98 = OpIMul %uint %97 %uint_4 - %99 = OpBitcast %uint %int_0 - %100 = OpIMul %uint %uint_16 %uint_7 - %101 = OpIAdd %uint %99 %100 - %102 = OpIMul %uint %101 %uint_4 - %103 = OpIAdd %uint %102 %uint_8 - %104 = OpULessThanEqual %bool %103 %98 - %105 = OpSelect %uint %104 %99 %uint_0 - %106 = OpSelect %uint %104 %uint_16 %uint_2 - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %108 = OpAccessChain %_ptr_StorageBuffer_v4uint %107 %105 - OpCooperativeMatrixStoreKHR %108 %m %uint_0 %106 NonPrivatePointer - %111 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %113 = OpArrayLength %uint %23 0 - %114 = OpBitcast %uint %int_0 - %115 = OpIMul %uint %uint_16 %uint_7 - %116 = OpIAdd %uint %114 %115 - %117 = OpIAdd %uint %116 %uint_8 - %118 = OpULessThanEqual %bool %117 %113 - %119 = OpSelect %uint %118 %114 %uint_0 - %120 = OpSelect %uint %118 %uint_16 %uint_8 - %121 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %122 = OpAccessChain %_ptr_StorageBuffer_v2half %121 %119 - OpCooperativeMatrixStoreKHR %122 %m %uint_0 %120 NonPrivatePointer - %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %127 = OpArrayLength %uint %29 0 - %128 = OpIMul %uint %127 %uint_2 - %129 = OpBitcast %uint %int_0 - %130 = OpIMul %uint %uint_16 %uint_7 - %131 = OpIAdd %uint %129 %130 - %132 = OpIMul %uint %131 %uint_2 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %128 - %135 = OpSelect %uint %134 %129 %uint_0 - %136 = OpSelect %uint %134 %uint_16 %uint_4 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_v3half %137 %135 - OpCooperativeMatrixStoreKHR %138 %m %uint_0 %136 NonPrivatePointer + %65 = OpBitcast %uint %int_0 + %66 = OpIMul %uint %uint_16 %uint_7 + %67 = OpIAdd %uint %65 %66 + %68 = OpIAdd %uint %67 %uint_4 + %70 = OpULessThanEqual %bool %68 %64 + %71 = OpSelect %uint %70 %65 %uint_0 + %72 = OpSelect %uint %70 %uint_16 %uint_4 + %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %74 = OpAccessChain %_ptr_StorageBuffer_v2int %73 %71 + OpCooperativeMatrixStoreKHR %74 %m %uint_0 %72 NonPrivatePointer + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %79 = OpArrayLength %uint %12 0 + %80 = OpBitcast %uint %int_0 + %81 = OpIMul %uint %uint_16 %uint_7 + %82 = OpIAdd %uint %80 %81 + %83 = OpIAdd %uint %82 %uint_2 + %84 = OpULessThanEqual %bool %83 %79 + %85 = OpSelect %uint %84 %80 %uint_0 + %86 = OpSelect %uint %84 %uint_16 %uint_2 + %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %88 = OpAccessChain %_ptr_StorageBuffer_v3float %87 %85 + OpCooperativeMatrixStoreKHR %88 %m %uint_0 %86 NonPrivatePointer + %91 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %93 = OpArrayLength %uint %18 0 + %94 = OpBitcast %uint %int_0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %94 %95 + %97 = OpIAdd %uint %96 %uint_2 + %98 = OpULessThanEqual %bool %97 %93 + %99 = OpSelect %uint %98 %94 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_2 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_0 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpBitcast %uint %int_0 + %109 = OpIMul %uint %uint_16 %uint_7 + %110 = OpIAdd %uint %108 %109 + %111 = OpIAdd %uint %110 %uint_8 + %112 = OpULessThanEqual %bool %111 %107 + %113 = OpSelect %uint %112 %108 %uint_0 + %114 = OpSelect %uint %112 %uint_16 %uint_8 + %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_v2half %115 %113 + OpCooperativeMatrixStoreKHR %116 %m %uint_0 %114 NonPrivatePointer + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %121 = OpArrayLength %uint %29 0 + %122 = OpBitcast %uint %int_0 + %123 = OpIMul %uint %uint_16 %uint_7 + %124 = OpIAdd %uint %122 %123 + %125 = OpIAdd %uint %124 %uint_4 + %126 = OpULessThanEqual %bool %125 %121 + %127 = OpSelect %uint %126 %122 %uint_0 + %128 = OpSelect %uint %126 %uint_16 %uint_4 + %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %130 = OpAccessChain %_ptr_StorageBuffer_v3half %129 %127 + OpCooperativeMatrixStoreKHR %130 %m %uint_0 %128 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl index 6aa1a6d..ad7693e 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -14,31 +14,31 @@ Matrix_result_u8_8x8 m = Matrix_result_u8_8x8::Splat(0u); uint v = 0u; out0.GetDimensions(v); - bool v_1 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v / 4u) * 4u)); + bool v_1 = (((0u + (16u * 7u)) + 2u) <= (v / 4u)); m.Store(out0, (0u + (select(v_1, 0u, 0u) * 4u)), (select(v_1, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_2 / 8u) * 8u)); + bool v_3 = (((0u + (16u * 7u)) + 1u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 4u)), (select(v_3, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_4 / 16u) * 16u)); + bool v_5 = (((0u + (16u * 7u)) + 1u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 4u)), (select(v_5, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_6 / 16u) * 16u)); + bool v_7 = (((0u + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 4u)), (select(v_7, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_8 = 0u; out4.GetDimensions(v_8); - bool v_9 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 2u) * 2u)); + bool v_9 = (((0u + (16u * 7u)) + 4u) <= (v_8 / 2u)); m.Store(out4, (0u + (select(v_9, 0u, 0u) * 4u)), (select(v_9, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_10 = 0u; out5.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_10 / 4u) * 4u)); + bool v_11 = (((0u + (16u * 7u)) + 2u) <= (v_10 / 4u)); m.Store(out5, (0u + (select(v_11, 0u, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_12 = 0u; out6.GetDimensions(v_12); - bool v_13 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_12 / 8u) * 8u)); + bool v_13 = (((0u + (16u * 7u)) + 1u) <= (v_12 / 8u)); m.Store(out6, (0u + (select(v_13, 0u, 0u) * 4u)), (select(v_13, 16u, 1u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_col_major.wgsl.expected.spvasm index 3d16c0d..945b61f 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 159 +; Bound: 145 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -113,7 +113,6 @@ %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 %bool = OpTypeBool @@ -126,6 +125,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -135,94 +135,80 @@ %41 = OpLabel %48 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %51 = OpArrayLength %uint %1 0 - %52 = OpIMul %uint %51 %uint_4 - %54 = OpIMul %uint %uint_16 %uint_7 - %57 = OpIAdd %uint %uint_0 %54 - %58 = OpIMul %uint %57 %uint_4 - %59 = OpIAdd %uint %58 %uint_8 - %60 = OpULessThanEqual %bool %59 %52 - %62 = OpSelect %uint %60 %uint_0 %uint_0 - %63 = OpSelect %uint %60 %uint_16 %uint_2 - %64 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %65 = OpAccessChain %_ptr_StorageBuffer_uint %64 %62 - OpCooperativeMatrixStoreKHR %65 %m %uint_1 %63 NonPrivatePointer - %69 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %71 = OpArrayLength %uint %6 0 - %72 = OpIMul %uint %71 %uint_8 - %73 = OpIMul %uint %uint_16 %uint_7 - %74 = OpIAdd %uint %uint_0 %73 - %75 = OpIMul %uint %74 %uint_8 - %76 = OpIAdd %uint %75 %uint_8 - %77 = OpULessThanEqual %bool %76 %72 - %78 = OpSelect %uint %77 %uint_0 %uint_0 - %79 = OpSelect %uint %77 %uint_16 %uint_1 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_v2int %80 %78 - OpCooperativeMatrixStoreKHR %81 %m %uint_1 %79 NonPrivatePointer - %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %86 = OpArrayLength %uint %12 0 - %87 = OpIMul %uint %86 %uint_16 - %88 = OpIMul %uint %uint_16 %uint_7 - %89 = OpIAdd %uint %uint_0 %88 - %90 = OpIMul %uint %89 %uint_16 - %91 = OpIAdd %uint %90 %uint_16 - %92 = OpULessThanEqual %bool %91 %87 - %93 = OpSelect %uint %92 %uint_0 %uint_0 - %94 = OpSelect %uint %92 %uint_16 %uint_1 - %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %96 = OpAccessChain %_ptr_StorageBuffer_v3float %95 %93 - OpCooperativeMatrixStoreKHR %96 %m %uint_1 %94 NonPrivatePointer - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %101 = OpArrayLength %uint %18 0 - %102 = OpIMul %uint %101 %uint_16 - %103 = OpIMul %uint %uint_16 %uint_7 - %104 = OpIAdd %uint %uint_0 %103 - %105 = OpIMul %uint %104 %uint_16 - %106 = OpIAdd %uint %105 %uint_16 - %107 = OpULessThanEqual %bool %106 %102 - %108 = OpSelect %uint %107 %uint_0 %uint_0 - %109 = OpSelect %uint %107 %uint_16 %uint_1 - %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %111 = OpAccessChain %_ptr_StorageBuffer_v4uint %110 %108 - OpCooperativeMatrixStoreKHR %111 %m %uint_1 %109 NonPrivatePointer - %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %116 = OpArrayLength %uint %23 0 - %117 = OpIMul %uint %116 %uint_2 - %118 = OpIMul %uint %uint_16 %uint_7 - %119 = OpIAdd %uint %uint_0 %118 - %120 = OpIMul %uint %119 %uint_2 - %121 = OpIAdd %uint %120 %uint_8 - %122 = OpULessThanEqual %bool %121 %117 - %123 = OpSelect %uint %122 %uint_0 %uint_0 - %124 = OpSelect %uint %122 %uint_16 %uint_4 - %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %126 = OpAccessChain %_ptr_StorageBuffer_half %125 %123 - OpCooperativeMatrixStoreKHR %126 %m %uint_1 %124 NonPrivatePointer - %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %131 = OpArrayLength %uint %28 0 - %132 = OpIMul %uint %131 %uint_4 - %133 = OpIMul %uint %uint_16 %uint_7 - %134 = OpIAdd %uint %uint_0 %133 - %135 = OpIMul %uint %134 %uint_4 - %136 = OpIAdd %uint %135 %uint_8 - %137 = OpULessThanEqual %bool %136 %132 - %138 = OpSelect %uint %137 %uint_0 %uint_0 - %139 = OpSelect %uint %137 %uint_16 %uint_2 - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %141 = OpAccessChain %_ptr_StorageBuffer_v2half %140 %138 - OpCooperativeMatrixStoreKHR %141 %m %uint_1 %139 NonPrivatePointer - %144 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %146 = OpArrayLength %uint %33 0 - %147 = OpIMul %uint %146 %uint_8 - %148 = OpIMul %uint %uint_16 %uint_7 - %149 = OpIAdd %uint %uint_0 %148 - %150 = OpIMul %uint %149 %uint_8 - %151 = OpIAdd %uint %150 %uint_8 - %152 = OpULessThanEqual %bool %151 %147 - %153 = OpSelect %uint %152 %uint_0 %uint_0 - %154 = OpSelect %uint %152 %uint_16 %uint_1 - %155 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %156 = OpAccessChain %_ptr_StorageBuffer_v3half %155 %153 - OpCooperativeMatrixStoreKHR %156 %m %uint_1 %154 NonPrivatePointer + %52 = OpIMul %uint %uint_16 %uint_7 + %55 = OpIAdd %uint %uint_0 %52 + %56 = OpIAdd %uint %55 %uint_2 + %57 = OpULessThanEqual %bool %56 %51 + %59 = OpSelect %uint %57 %uint_0 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_2 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + OpCooperativeMatrixStoreKHR %62 %m %uint_1 %60 NonPrivatePointer + %66 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %68 = OpArrayLength %uint %6 0 + %69 = OpIMul %uint %uint_16 %uint_7 + %70 = OpIAdd %uint %uint_0 %69 + %71 = OpIAdd %uint %70 %uint_1 + %72 = OpULessThanEqual %bool %71 %68 + %73 = OpSelect %uint %72 %uint_0 %uint_0 + %74 = OpSelect %uint %72 %uint_16 %uint_1 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %73 + OpCooperativeMatrixStoreKHR %76 %m %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %81 = OpArrayLength %uint %12 0 + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_1 + %85 = OpULessThanEqual %bool %84 %81 + %86 = OpSelect %uint %85 %uint_0 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_1 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %uint_0 %95 + %97 = OpIAdd %uint %96 %uint_1 + %98 = OpULessThanEqual %bool %97 %94 + %99 = OpSelect %uint %98 %uint_0 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_1 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_1 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpIMul %uint %uint_16 %uint_7 + %109 = OpIAdd %uint %uint_0 %108 + %110 = OpIAdd %uint %109 %uint_4 + %112 = OpULessThanEqual %bool %110 %107 + %113 = OpSelect %uint %112 %uint_0 %uint_0 + %114 = OpSelect %uint %112 %uint_16 %uint_4 + %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_half %115 %113 + OpCooperativeMatrixStoreKHR %116 %m %uint_1 %114 NonPrivatePointer + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %121 = OpArrayLength %uint %28 0 + %122 = OpIMul %uint %uint_16 %uint_7 + %123 = OpIAdd %uint %uint_0 %122 + %124 = OpIAdd %uint %123 %uint_2 + %125 = OpULessThanEqual %bool %124 %121 + %126 = OpSelect %uint %125 %uint_0 %uint_0 + %127 = OpSelect %uint %125 %uint_16 %uint_2 + %128 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %129 = OpAccessChain %_ptr_StorageBuffer_v2half %128 %126 + OpCooperativeMatrixStoreKHR %129 %m %uint_1 %127 NonPrivatePointer + %132 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %134 = OpArrayLength %uint %33 0 + %135 = OpIMul %uint %uint_16 %uint_7 + %136 = OpIAdd %uint %uint_0 %135 + %137 = OpIAdd %uint %136 %uint_1 + %138 = OpULessThanEqual %bool %137 %134 + %139 = OpSelect %uint %138 %uint_0 %uint_0 + %140 = OpSelect %uint %138 %uint_16 %uint_1 + %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %142 = OpAccessChain %_ptr_StorageBuffer_v3half %141 %139 + OpCooperativeMatrixStoreKHR %142 %m %uint_1 %140 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl index b4b43cc..41fb0e1 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -14,31 +14,31 @@ Matrix_result_u8_8x8 m = Matrix_result_u8_8x8::Splat(0u); uint v = 0u; out0.GetDimensions(v); - bool v_1 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v / 4u) * 4u)); + bool v_1 = (((0u + (16u * 7u)) + 2u) <= (v / 4u)); m.Store(out0, (0u + (select(v_1, 0u, 0u) * 4u)), (select(v_1, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_2 / 8u) * 8u)); + bool v_3 = (((0u + (16u * 7u)) + 1u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 4u)), (select(v_3, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_4 / 16u) * 16u)); + bool v_5 = (((0u + (16u * 7u)) + 1u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 4u)), (select(v_5, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_6 / 16u) * 16u)); + bool v_7 = (((0u + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 4u)), (select(v_7, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_8 = 0u; out4.GetDimensions(v_8); - bool v_9 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 2u) * 2u)); + bool v_9 = (((0u + (16u * 7u)) + 4u) <= (v_8 / 2u)); m.Store(out4, (0u + (select(v_9, 0u, 0u) * 4u)), (select(v_9, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_10 = 0u; out5.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_10 / 4u) * 4u)); + bool v_11 = (((0u + (16u * 7u)) + 2u) <= (v_10 / 4u)); m.Store(out5, (0u + (select(v_11, 0u, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_12 = 0u; out6.GetDimensions(v_12); - bool v_13 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_12 / 8u) * 8u)); + bool v_13 = (((0u + (16u * 7u)) + 1u) <= (v_12 / 8u)); m.Store(out6, (0u + (select(v_13, 0u, 0u) * 4u)), (select(v_13, 16u, 1u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_row_major.wgsl.expected.spvasm index 15bc2da..2f6526c 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_result_u8_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 159 +; Bound: 145 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -113,7 +113,6 @@ %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 %bool = OpTypeBool @@ -126,6 +125,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -135,94 +135,80 @@ %41 = OpLabel %48 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %51 = OpArrayLength %uint %1 0 - %52 = OpIMul %uint %51 %uint_4 - %54 = OpIMul %uint %uint_16 %uint_7 - %57 = OpIAdd %uint %uint_0 %54 - %58 = OpIMul %uint %57 %uint_4 - %59 = OpIAdd %uint %58 %uint_8 - %60 = OpULessThanEqual %bool %59 %52 - %62 = OpSelect %uint %60 %uint_0 %uint_0 - %63 = OpSelect %uint %60 %uint_16 %uint_2 - %64 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %65 = OpAccessChain %_ptr_StorageBuffer_uint %64 %62 - OpCooperativeMatrixStoreKHR %65 %m %uint_0 %63 NonPrivatePointer - %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %70 = OpArrayLength %uint %6 0 - %71 = OpIMul %uint %70 %uint_8 - %72 = OpIMul %uint %uint_16 %uint_7 - %73 = OpIAdd %uint %uint_0 %72 - %74 = OpIMul %uint %73 %uint_8 - %75 = OpIAdd %uint %74 %uint_8 - %76 = OpULessThanEqual %bool %75 %71 - %77 = OpSelect %uint %76 %uint_0 %uint_0 - %78 = OpSelect %uint %76 %uint_16 %uint_1 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_v2int %80 %77 - OpCooperativeMatrixStoreKHR %81 %m %uint_0 %78 NonPrivatePointer - %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %86 = OpArrayLength %uint %12 0 - %87 = OpIMul %uint %86 %uint_16 - %88 = OpIMul %uint %uint_16 %uint_7 - %89 = OpIAdd %uint %uint_0 %88 - %90 = OpIMul %uint %89 %uint_16 - %91 = OpIAdd %uint %90 %uint_16 - %92 = OpULessThanEqual %bool %91 %87 - %93 = OpSelect %uint %92 %uint_0 %uint_0 - %94 = OpSelect %uint %92 %uint_16 %uint_1 - %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %96 = OpAccessChain %_ptr_StorageBuffer_v3float %95 %93 - OpCooperativeMatrixStoreKHR %96 %m %uint_0 %94 NonPrivatePointer - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %101 = OpArrayLength %uint %18 0 - %102 = OpIMul %uint %101 %uint_16 - %103 = OpIMul %uint %uint_16 %uint_7 - %104 = OpIAdd %uint %uint_0 %103 - %105 = OpIMul %uint %104 %uint_16 - %106 = OpIAdd %uint %105 %uint_16 - %107 = OpULessThanEqual %bool %106 %102 - %108 = OpSelect %uint %107 %uint_0 %uint_0 - %109 = OpSelect %uint %107 %uint_16 %uint_1 - %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %111 = OpAccessChain %_ptr_StorageBuffer_v4uint %110 %108 - OpCooperativeMatrixStoreKHR %111 %m %uint_0 %109 NonPrivatePointer - %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %116 = OpArrayLength %uint %23 0 - %117 = OpIMul %uint %116 %uint_2 - %118 = OpIMul %uint %uint_16 %uint_7 - %119 = OpIAdd %uint %uint_0 %118 - %120 = OpIMul %uint %119 %uint_2 - %121 = OpIAdd %uint %120 %uint_8 - %122 = OpULessThanEqual %bool %121 %117 - %123 = OpSelect %uint %122 %uint_0 %uint_0 - %124 = OpSelect %uint %122 %uint_16 %uint_4 - %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %126 = OpAccessChain %_ptr_StorageBuffer_half %125 %123 - OpCooperativeMatrixStoreKHR %126 %m %uint_0 %124 NonPrivatePointer - %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %131 = OpArrayLength %uint %28 0 - %132 = OpIMul %uint %131 %uint_4 - %133 = OpIMul %uint %uint_16 %uint_7 - %134 = OpIAdd %uint %uint_0 %133 - %135 = OpIMul %uint %134 %uint_4 - %136 = OpIAdd %uint %135 %uint_8 - %137 = OpULessThanEqual %bool %136 %132 - %138 = OpSelect %uint %137 %uint_0 %uint_0 - %139 = OpSelect %uint %137 %uint_16 %uint_2 - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %141 = OpAccessChain %_ptr_StorageBuffer_v2half %140 %138 - OpCooperativeMatrixStoreKHR %141 %m %uint_0 %139 NonPrivatePointer - %144 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %146 = OpArrayLength %uint %33 0 - %147 = OpIMul %uint %146 %uint_8 - %148 = OpIMul %uint %uint_16 %uint_7 - %149 = OpIAdd %uint %uint_0 %148 - %150 = OpIMul %uint %149 %uint_8 - %151 = OpIAdd %uint %150 %uint_8 - %152 = OpULessThanEqual %bool %151 %147 - %153 = OpSelect %uint %152 %uint_0 %uint_0 - %154 = OpSelect %uint %152 %uint_16 %uint_1 - %155 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %156 = OpAccessChain %_ptr_StorageBuffer_v3half %155 %153 - OpCooperativeMatrixStoreKHR %156 %m %uint_0 %154 NonPrivatePointer + %52 = OpIMul %uint %uint_16 %uint_7 + %55 = OpIAdd %uint %uint_0 %52 + %56 = OpIAdd %uint %55 %uint_2 + %57 = OpULessThanEqual %bool %56 %51 + %59 = OpSelect %uint %57 %uint_0 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_2 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + OpCooperativeMatrixStoreKHR %62 %m %uint_0 %60 NonPrivatePointer + %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %67 = OpArrayLength %uint %6 0 + %68 = OpIMul %uint %uint_16 %uint_7 + %69 = OpIAdd %uint %uint_0 %68 + %70 = OpIAdd %uint %69 %uint_1 + %72 = OpULessThanEqual %bool %70 %67 + %73 = OpSelect %uint %72 %uint_0 %uint_0 + %74 = OpSelect %uint %72 %uint_16 %uint_1 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %73 + OpCooperativeMatrixStoreKHR %76 %m %uint_0 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %81 = OpArrayLength %uint %12 0 + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_1 + %85 = OpULessThanEqual %bool %84 %81 + %86 = OpSelect %uint %85 %uint_0 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_1 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_0 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %uint_0 %95 + %97 = OpIAdd %uint %96 %uint_1 + %98 = OpULessThanEqual %bool %97 %94 + %99 = OpSelect %uint %98 %uint_0 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_1 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_0 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpIMul %uint %uint_16 %uint_7 + %109 = OpIAdd %uint %uint_0 %108 + %110 = OpIAdd %uint %109 %uint_4 + %112 = OpULessThanEqual %bool %110 %107 + %113 = OpSelect %uint %112 %uint_0 %uint_0 + %114 = OpSelect %uint %112 %uint_16 %uint_4 + %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_half %115 %113 + OpCooperativeMatrixStoreKHR %116 %m %uint_0 %114 NonPrivatePointer + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %121 = OpArrayLength %uint %28 0 + %122 = OpIMul %uint %uint_16 %uint_7 + %123 = OpIAdd %uint %uint_0 %122 + %124 = OpIAdd %uint %123 %uint_2 + %125 = OpULessThanEqual %bool %124 %121 + %126 = OpSelect %uint %125 %uint_0 %uint_0 + %127 = OpSelect %uint %125 %uint_16 %uint_2 + %128 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %129 = OpAccessChain %_ptr_StorageBuffer_v2half %128 %126 + OpCooperativeMatrixStoreKHR %129 %m %uint_0 %127 NonPrivatePointer + %132 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %134 = OpArrayLength %uint %33 0 + %135 = OpIMul %uint %uint_16 %uint_7 + %136 = OpIAdd %uint %uint_0 %135 + %137 = OpIAdd %uint %136 %uint_1 + %138 = OpULessThanEqual %bool %137 %134 + %139 = OpSelect %uint %138 %uint_0 %uint_0 + %140 = OpSelect %uint %138 %uint_16 %uint_1 + %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %142 = OpAccessChain %_ptr_StorageBuffer_v3half %141 %139 + OpCooperativeMatrixStoreKHR %142 %m %uint_0 %140 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl index ec506d8..5e217d4 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -14,19 +14,19 @@ Matrix_right_f16_8x8 m = Matrix_right_f16_8x8::Splat(float16_t(0.0h)); uint v = 0u; out0.GetDimensions(v); - bool v_1 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v / 4u) * 2u)); + bool v_1 = (((0u + (16u * 7u)) + 4u) <= (v / 4u)); m.Store(out0, (0u + (select(v_1, 0u, 0u) * 2u)), (select(v_1, 16u, 4u) * 2u), MatrixLayout::ColMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_2 / 8u) * 4u)); + bool v_3 = (((0u + (16u * 7u)) + 2u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 2u)), (select(v_3, 16u, 2u) * 2u), MatrixLayout::ColMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_4 / 16u) * 8u)); + bool v_5 = (((0u + (16u * 7u)) + 1u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 2u)), (select(v_5, 16u, 1u) * 2u), MatrixLayout::ColMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_6 / 16u) * 8u)); + bool v_7 = (((0u + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 2u)), (select(v_7, 16u, 1u) * 2u), MatrixLayout::ColMajor); uint v_8 = 0u; out4.GetDimensions(v_8); @@ -34,11 +34,11 @@ m.Store(out4, (0u + (select(v_9, 0u, 0u) * 2u)), (select(v_9, 16u, 8u) * 2u), MatrixLayout::ColMajor); uint v_10 = 0u; out5.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_10 / 4u) * 2u)); + bool v_11 = (((0u + (16u * 7u)) + 4u) <= (v_10 / 4u)); m.Store(out5, (0u + (select(v_11, 0u, 0u) * 2u)), (select(v_11, 16u, 4u) * 2u), MatrixLayout::ColMajor); uint v_12 = 0u; out6.GetDimensions(v_12); - bool v_13 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_12 / 8u) * 4u)); + bool v_13 = (((0u + (16u * 7u)) + 2u) <= (v_12 / 8u)); m.Store(out6, (0u + (select(v_13, 0u, 0u) * 2u)), (select(v_13, 16u, 2u) * 2u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_col_major.wgsl.expected.msl index b99f197..43504d9 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_col_major.wgsl.expected.msl
@@ -49,18 +49,18 @@ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.out0=out0, .out1=out1, .out2=out2, .out3=out3, .out4=out4, .out5=out5, .out6=out6, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; tint_array_lengths_struct const v_1 = tint_array_lengths_struct{.tint_array_length_0_0=((*tint_module_vars.tint_storage_buffer_sizes)[0u].x / 4u), .tint_array_length_0_1=((*tint_module_vars.tint_storage_buffer_sizes)[0u].y / 8u), .tint_array_length_0_2=((*tint_module_vars.tint_storage_buffer_sizes)[0u].z / 16u), .tint_array_length_0_3=((*tint_module_vars.tint_storage_buffer_sizes)[0u].w / 16u), .tint_array_length_0_4=((*tint_module_vars.tint_storage_buffer_sizes)[1u].x / 2u), .tint_array_length_0_5=((*tint_module_vars.tint_storage_buffer_sizes)[1u].y / 4u), .tint_array_length_0_6=((*tint_module_vars.tint_storage_buffer_sizes)[1u].z / 8u)}; simdgroup_half8x8 const m = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); - bool const v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_0 * 2u)); + bool const v_2 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_0); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out0) + (select(0u, 0u, v_2) * 4u)), ulong((select(4u, 16u, v_2) * 2u)), ulong2(0ul), true)); - bool const v_3 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_1 * 4u)); + bool const v_3 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_1); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out1) + (select(0u, 0u, v_3) * 8u)), ulong((select(2u, 16u, v_3) * 4u)), ulong2(0ul), true)); - bool const v_4 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_2 * 8u)); + bool const v_4 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_2); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out2) + (select(0u, 0u, v_4) * 16u)), ulong((select(1u, 16u, v_4) * 8u)), ulong2(0ul), true)); - bool const v_5 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_3 * 8u)); + bool const v_5 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_3); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out3) + (select(0u, 0u, v_5) * 16u)), ulong((select(1u, 16u, v_5) * 8u)), ulong2(0ul), true)); bool const v_6 = (((0u + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); (simdgroup_store(m, (&(*tint_module_vars.out4)[select(0u, 0u, v_6)]), ulong(select(8u, 16u, v_6)), ulong2(0ul), true)); - bool const v_7 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_7 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out5) + (select(0u, 0u, v_7) * 4u)), ulong((select(4u, 16u, v_7) * 2u)), ulong2(0ul), true)); - bool const v_8 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_6 * 4u)); + bool const v_8 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_6); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out6) + (select(0u, 0u, v_8) * 8u)), ulong((select(2u, 16u, v_8) * 4u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_col_major.wgsl.expected.spvasm index 2231781..9412d6d 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 156 +; Bound: 144 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -111,13 +111,13 @@ %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_2 = OpConstant %uint 2 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float @@ -133,92 +133,80 @@ %41 = OpLabel %47 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %50 = OpArrayLength %uint %1 0 - %51 = OpIMul %uint %50 %uint_2 - %53 = OpIMul %uint %uint_16 %uint_7 - %56 = OpIAdd %uint %uint_0 %53 - %57 = OpIMul %uint %56 %uint_2 - %58 = OpIAdd %uint %57 %uint_8 - %59 = OpULessThanEqual %bool %58 %51 - %61 = OpSelect %uint %59 %uint_0 %uint_0 - %62 = OpSelect %uint %59 %uint_16 %uint_4 - %64 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %65 = OpAccessChain %_ptr_StorageBuffer_uint %64 %61 - OpCooperativeMatrixStoreKHR %65 %m %uint_1 %62 NonPrivatePointer - %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %70 = OpArrayLength %uint %6 0 - %71 = OpIMul %uint %70 %uint_4 - %72 = OpIMul %uint %uint_16 %uint_7 - %73 = OpIAdd %uint %uint_0 %72 - %74 = OpIMul %uint %73 %uint_4 - %75 = OpIAdd %uint %74 %uint_8 - %76 = OpULessThanEqual %bool %75 %71 - %77 = OpSelect %uint %76 %uint_0 %uint_0 - %78 = OpSelect %uint %76 %uint_16 %uint_2 - %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %80 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %77 - OpCooperativeMatrixStoreKHR %80 %m %uint_1 %78 NonPrivatePointer - %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %85 = OpArrayLength %uint %12 0 - %86 = OpIMul %uint %85 %uint_8 - %87 = OpIMul %uint %uint_16 %uint_7 - %88 = OpIAdd %uint %uint_0 %87 - %89 = OpIMul %uint %88 %uint_8 - %90 = OpIAdd %uint %89 %uint_8 - %91 = OpULessThanEqual %bool %90 %86 - %92 = OpSelect %uint %91 %uint_0 %uint_0 - %93 = OpSelect %uint %91 %uint_16 %uint_1 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v3float %94 %92 - OpCooperativeMatrixStoreKHR %95 %m %uint_1 %93 NonPrivatePointer - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %100 = OpArrayLength %uint %18 0 - %101 = OpIMul %uint %100 %uint_8 - %102 = OpIMul %uint %uint_16 %uint_7 - %103 = OpIAdd %uint %uint_0 %102 - %104 = OpIMul %uint %103 %uint_8 - %105 = OpIAdd %uint %104 %uint_8 - %106 = OpULessThanEqual %bool %105 %101 - %107 = OpSelect %uint %106 %uint_0 %uint_0 - %108 = OpSelect %uint %106 %uint_16 %uint_1 - %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %110 = OpAccessChain %_ptr_StorageBuffer_v4uint %109 %107 - OpCooperativeMatrixStoreKHR %110 %m %uint_1 %108 NonPrivatePointer - %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %115 = OpArrayLength %uint %23 0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %uint_0 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %115 - %120 = OpSelect %uint %119 %uint_0 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_1 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %128 = OpArrayLength %uint %28 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpIMul %uint %uint_16 %uint_7 - %131 = OpIAdd %uint %uint_0 %130 - %132 = OpIMul %uint %131 %uint_2 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %129 - %135 = OpSelect %uint %134 %uint_0 %uint_0 - %136 = OpSelect %uint %134 %uint_16 %uint_4 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_v2half %137 %135 - OpCooperativeMatrixStoreKHR %138 %m %uint_1 %136 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %143 = OpArrayLength %uint %33 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %uint_0 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %144 - %150 = OpSelect %uint %149 %uint_0 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v3half %152 %150 - OpCooperativeMatrixStoreKHR %153 %m %uint_1 %151 NonPrivatePointer + %51 = OpIMul %uint %uint_16 %uint_7 + %54 = OpIAdd %uint %uint_0 %51 + %55 = OpIAdd %uint %54 %uint_4 + %57 = OpULessThanEqual %bool %55 %50 + %59 = OpSelect %uint %57 %uint_0 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_4 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + OpCooperativeMatrixStoreKHR %62 %m %uint_1 %60 NonPrivatePointer + %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %67 = OpArrayLength %uint %6 0 + %68 = OpIMul %uint %uint_16 %uint_7 + %69 = OpIAdd %uint %uint_0 %68 + %70 = OpIAdd %uint %69 %uint_2 + %72 = OpULessThanEqual %bool %70 %67 + %73 = OpSelect %uint %72 %uint_0 %uint_0 + %74 = OpSelect %uint %72 %uint_16 %uint_2 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %73 + OpCooperativeMatrixStoreKHR %76 %m %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %81 = OpArrayLength %uint %12 0 + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_1 + %85 = OpULessThanEqual %bool %84 %81 + %86 = OpSelect %uint %85 %uint_0 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_1 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %uint_0 %95 + %97 = OpIAdd %uint %96 %uint_1 + %98 = OpULessThanEqual %bool %97 %94 + %99 = OpSelect %uint %98 %uint_0 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_1 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_1 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpIMul %uint %uint_16 %uint_7 + %109 = OpIAdd %uint %uint_0 %108 + %110 = OpIAdd %uint %109 %uint_8 + %111 = OpULessThanEqual %bool %110 %107 + %112 = OpSelect %uint %111 %uint_0 %uint_0 + %113 = OpSelect %uint %111 %uint_16 %uint_8 + %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %115 = OpAccessChain %_ptr_StorageBuffer_half %114 %112 + OpCooperativeMatrixStoreKHR %115 %m %uint_1 %113 NonPrivatePointer + %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %120 = OpArrayLength %uint %28 0 + %121 = OpIMul %uint %uint_16 %uint_7 + %122 = OpIAdd %uint %uint_0 %121 + %123 = OpIAdd %uint %122 %uint_4 + %124 = OpULessThanEqual %bool %123 %120 + %125 = OpSelect %uint %124 %uint_0 %uint_0 + %126 = OpSelect %uint %124 %uint_16 %uint_4 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_v2half %127 %125 + OpCooperativeMatrixStoreKHR %128 %m %uint_1 %126 NonPrivatePointer + %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %133 = OpArrayLength %uint %33 0 + %134 = OpIMul %uint %uint_16 %uint_7 + %135 = OpIAdd %uint %uint_0 %134 + %136 = OpIAdd %uint %135 %uint_2 + %137 = OpULessThanEqual %bool %136 %133 + %138 = OpSelect %uint %137 %uint_0 %uint_0 + %139 = OpSelect %uint %137 %uint_16 %uint_2 + %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %141 = OpAccessChain %_ptr_StorageBuffer_v3half %140 %138 + OpCooperativeMatrixStoreKHR %141 %m %uint_1 %139 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl index 5fa4e33..977e22d 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -14,19 +14,19 @@ Matrix_right_f16_8x8 m = Matrix_right_f16_8x8::Splat(float16_t(0.0h)); uint v = 0u; out0.GetDimensions(v); - bool v_1 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v / 4u) * 2u)); + bool v_1 = (((0u + (16u * 7u)) + 4u) <= (v / 4u)); m.Store(out0, (0u + (select(v_1, 0u, 0u) * 2u)), (select(v_1, 16u, 4u) * 2u), MatrixLayout::RowMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_2 / 8u) * 4u)); + bool v_3 = (((0u + (16u * 7u)) + 2u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 2u)), (select(v_3, 16u, 2u) * 2u), MatrixLayout::RowMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_4 / 16u) * 8u)); + bool v_5 = (((0u + (16u * 7u)) + 1u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 2u)), (select(v_5, 16u, 1u) * 2u), MatrixLayout::RowMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_6 / 16u) * 8u)); + bool v_7 = (((0u + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 2u)), (select(v_7, 16u, 1u) * 2u), MatrixLayout::RowMajor); uint v_8 = 0u; out4.GetDimensions(v_8); @@ -34,11 +34,11 @@ m.Store(out4, (0u + (select(v_9, 0u, 0u) * 2u)), (select(v_9, 16u, 8u) * 2u), MatrixLayout::RowMajor); uint v_10 = 0u; out5.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_10 / 4u) * 2u)); + bool v_11 = (((0u + (16u * 7u)) + 4u) <= (v_10 / 4u)); m.Store(out5, (0u + (select(v_11, 0u, 0u) * 2u)), (select(v_11, 16u, 4u) * 2u), MatrixLayout::RowMajor); uint v_12 = 0u; out6.GetDimensions(v_12); - bool v_13 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_12 / 8u) * 4u)); + bool v_13 = (((0u + (16u * 7u)) + 2u) <= (v_12 / 8u)); m.Store(out6, (0u + (select(v_13, 0u, 0u) * 2u)), (select(v_13, 16u, 2u) * 2u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_row_major.wgsl.expected.msl index 03a2279..4ed85da 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_row_major.wgsl.expected.msl
@@ -49,18 +49,18 @@ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.out0=out0, .out1=out1, .out2=out2, .out3=out3, .out4=out4, .out5=out5, .out6=out6, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; tint_array_lengths_struct const v_1 = tint_array_lengths_struct{.tint_array_length_0_0=((*tint_module_vars.tint_storage_buffer_sizes)[0u].x / 4u), .tint_array_length_0_1=((*tint_module_vars.tint_storage_buffer_sizes)[0u].y / 8u), .tint_array_length_0_2=((*tint_module_vars.tint_storage_buffer_sizes)[0u].z / 16u), .tint_array_length_0_3=((*tint_module_vars.tint_storage_buffer_sizes)[0u].w / 16u), .tint_array_length_0_4=((*tint_module_vars.tint_storage_buffer_sizes)[1u].x / 2u), .tint_array_length_0_5=((*tint_module_vars.tint_storage_buffer_sizes)[1u].y / 4u), .tint_array_length_0_6=((*tint_module_vars.tint_storage_buffer_sizes)[1u].z / 8u)}; simdgroup_half8x8 const m = make_filled_simdgroup_matrix<half, 8, 8>(0.0h); - bool const v_2 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_0 * 2u)); + bool const v_2 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_0); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out0) + (select(0u, 0u, v_2) * 4u)), ulong((select(4u, 16u, v_2) * 2u)), ulong2(0ul), false)); - bool const v_3 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_1 * 4u)); + bool const v_3 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_1); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out1) + (select(0u, 0u, v_3) * 8u)), ulong((select(2u, 16u, v_3) * 4u)), ulong2(0ul), false)); - bool const v_4 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_2 * 8u)); + bool const v_4 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_2); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out2) + (select(0u, 0u, v_4) * 16u)), ulong((select(1u, 16u, v_4) * 8u)), ulong2(0ul), false)); - bool const v_5 = ((((0u + (16u * 7u)) * 8u) + 8u) <= (v_1.tint_array_length_0_3 * 8u)); + bool const v_5 = (((0u + (16u * 7u)) + 1u) <= v_1.tint_array_length_0_3); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out3) + (select(0u, 0u, v_5) * 16u)), ulong((select(1u, 16u, v_5) * 8u)), ulong2(0ul), false)); bool const v_6 = (((0u + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); (simdgroup_store(m, (&(*tint_module_vars.out4)[select(0u, 0u, v_6)]), ulong(select(8u, 16u, v_6)), ulong2(0ul), false)); - bool const v_7 = ((((0u + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_7 = (((0u + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out5) + (select(0u, 0u, v_7) * 4u)), ulong((select(4u, 16u, v_7) * 2u)), ulong2(0ul), false)); - bool const v_8 = ((((0u + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_6 * 4u)); + bool const v_8 = (((0u + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_6); (simdgroup_store(m, reinterpret_cast<device half*>(reinterpret_cast<device char*>(tint_module_vars.out6) + (select(0u, 0u, v_8) * 8u)), ulong((select(2u, 16u, v_8) * 4u)), ulong2(0ul), false)); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_row_major.wgsl.expected.spvasm index da1da2e..778f256 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_f16_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 156 +; Bound: 144 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -111,13 +111,13 @@ %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_2 = OpConstant %uint 2 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_4 = OpConstant %uint 4 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float @@ -133,92 +133,80 @@ %41 = OpLabel %47 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %50 = OpArrayLength %uint %1 0 - %51 = OpIMul %uint %50 %uint_2 - %53 = OpIMul %uint %uint_16 %uint_7 - %56 = OpIAdd %uint %uint_0 %53 - %57 = OpIMul %uint %56 %uint_2 - %58 = OpIAdd %uint %57 %uint_8 - %59 = OpULessThanEqual %bool %58 %51 - %61 = OpSelect %uint %59 %uint_0 %uint_0 - %62 = OpSelect %uint %59 %uint_16 %uint_4 - %64 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %65 = OpAccessChain %_ptr_StorageBuffer_uint %64 %61 - OpCooperativeMatrixStoreKHR %65 %m %uint_0 %62 NonPrivatePointer - %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %70 = OpArrayLength %uint %6 0 - %71 = OpIMul %uint %70 %uint_4 - %72 = OpIMul %uint %uint_16 %uint_7 - %73 = OpIAdd %uint %uint_0 %72 - %74 = OpIMul %uint %73 %uint_4 - %75 = OpIAdd %uint %74 %uint_8 - %76 = OpULessThanEqual %bool %75 %71 - %77 = OpSelect %uint %76 %uint_0 %uint_0 - %78 = OpSelect %uint %76 %uint_16 %uint_2 - %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %80 = OpAccessChain %_ptr_StorageBuffer_v2int %79 %77 - OpCooperativeMatrixStoreKHR %80 %m %uint_0 %78 NonPrivatePointer - %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %85 = OpArrayLength %uint %12 0 - %86 = OpIMul %uint %85 %uint_8 - %87 = OpIMul %uint %uint_16 %uint_7 - %88 = OpIAdd %uint %uint_0 %87 - %89 = OpIMul %uint %88 %uint_8 - %90 = OpIAdd %uint %89 %uint_8 - %91 = OpULessThanEqual %bool %90 %86 - %92 = OpSelect %uint %91 %uint_0 %uint_0 - %93 = OpSelect %uint %91 %uint_16 %uint_1 - %94 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %95 = OpAccessChain %_ptr_StorageBuffer_v3float %94 %92 - OpCooperativeMatrixStoreKHR %95 %m %uint_0 %93 NonPrivatePointer - %98 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %100 = OpArrayLength %uint %18 0 - %101 = OpIMul %uint %100 %uint_8 - %102 = OpIMul %uint %uint_16 %uint_7 - %103 = OpIAdd %uint %uint_0 %102 - %104 = OpIMul %uint %103 %uint_8 - %105 = OpIAdd %uint %104 %uint_8 - %106 = OpULessThanEqual %bool %105 %101 - %107 = OpSelect %uint %106 %uint_0 %uint_0 - %108 = OpSelect %uint %106 %uint_16 %uint_1 - %109 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %110 = OpAccessChain %_ptr_StorageBuffer_v4uint %109 %107 - OpCooperativeMatrixStoreKHR %110 %m %uint_0 %108 NonPrivatePointer - %113 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %115 = OpArrayLength %uint %23 0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %uint_0 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %115 - %120 = OpSelect %uint %119 %uint_0 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_0 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %128 = OpArrayLength %uint %28 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpIMul %uint %uint_16 %uint_7 - %131 = OpIAdd %uint %uint_0 %130 - %132 = OpIMul %uint %131 %uint_2 - %133 = OpIAdd %uint %132 %uint_8 - %134 = OpULessThanEqual %bool %133 %129 - %135 = OpSelect %uint %134 %uint_0 %uint_0 - %136 = OpSelect %uint %134 %uint_16 %uint_4 - %137 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %138 = OpAccessChain %_ptr_StorageBuffer_v2half %137 %135 - OpCooperativeMatrixStoreKHR %138 %m %uint_0 %136 NonPrivatePointer - %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %143 = OpArrayLength %uint %33 0 - %144 = OpIMul %uint %143 %uint_4 - %145 = OpIMul %uint %uint_16 %uint_7 - %146 = OpIAdd %uint %uint_0 %145 - %147 = OpIMul %uint %146 %uint_4 - %148 = OpIAdd %uint %147 %uint_8 - %149 = OpULessThanEqual %bool %148 %144 - %150 = OpSelect %uint %149 %uint_0 %uint_0 - %151 = OpSelect %uint %149 %uint_16 %uint_2 - %152 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %153 = OpAccessChain %_ptr_StorageBuffer_v3half %152 %150 - OpCooperativeMatrixStoreKHR %153 %m %uint_0 %151 NonPrivatePointer + %51 = OpIMul %uint %uint_16 %uint_7 + %54 = OpIAdd %uint %uint_0 %51 + %55 = OpIAdd %uint %54 %uint_4 + %57 = OpULessThanEqual %bool %55 %50 + %59 = OpSelect %uint %57 %uint_0 %uint_0 + %60 = OpSelect %uint %57 %uint_16 %uint_4 + %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 + OpCooperativeMatrixStoreKHR %62 %m %uint_0 %60 NonPrivatePointer + %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %67 = OpArrayLength %uint %6 0 + %68 = OpIMul %uint %uint_16 %uint_7 + %69 = OpIAdd %uint %uint_0 %68 + %70 = OpIAdd %uint %69 %uint_2 + %72 = OpULessThanEqual %bool %70 %67 + %73 = OpSelect %uint %72 %uint_0 %uint_0 + %74 = OpSelect %uint %72 %uint_16 %uint_2 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %73 + OpCooperativeMatrixStoreKHR %76 %m %uint_0 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %81 = OpArrayLength %uint %12 0 + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_1 + %85 = OpULessThanEqual %bool %84 %81 + %86 = OpSelect %uint %85 %uint_0 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_1 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_0 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %uint_0 %95 + %97 = OpIAdd %uint %96 %uint_1 + %98 = OpULessThanEqual %bool %97 %94 + %99 = OpSelect %uint %98 %uint_0 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_1 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_0 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpIMul %uint %uint_16 %uint_7 + %109 = OpIAdd %uint %uint_0 %108 + %110 = OpIAdd %uint %109 %uint_8 + %111 = OpULessThanEqual %bool %110 %107 + %112 = OpSelect %uint %111 %uint_0 %uint_0 + %113 = OpSelect %uint %111 %uint_16 %uint_8 + %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %115 = OpAccessChain %_ptr_StorageBuffer_half %114 %112 + OpCooperativeMatrixStoreKHR %115 %m %uint_0 %113 NonPrivatePointer + %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %120 = OpArrayLength %uint %28 0 + %121 = OpIMul %uint %uint_16 %uint_7 + %122 = OpIAdd %uint %uint_0 %121 + %123 = OpIAdd %uint %122 %uint_4 + %124 = OpULessThanEqual %bool %123 %120 + %125 = OpSelect %uint %124 %uint_0 %uint_0 + %126 = OpSelect %uint %124 %uint_16 %uint_4 + %127 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %128 = OpAccessChain %_ptr_StorageBuffer_v2half %127 %125 + OpCooperativeMatrixStoreKHR %128 %m %uint_0 %126 NonPrivatePointer + %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %133 = OpArrayLength %uint %33 0 + %134 = OpIMul %uint %uint_16 %uint_7 + %135 = OpIAdd %uint %uint_0 %134 + %136 = OpIAdd %uint %135 %uint_2 + %137 = OpULessThanEqual %bool %136 %133 + %138 = OpSelect %uint %137 %uint_0 %uint_0 + %139 = OpSelect %uint %137 %uint_16 %uint_2 + %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %141 = OpAccessChain %_ptr_StorageBuffer_v3half %140 %138 + OpCooperativeMatrixStoreKHR %141 %m %uint_0 %139 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl index 3d8a983..4a7b0ca 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -19,17 +19,17 @@ uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= ((v_3 / 8u) * 2u)); + bool v_5 = (((v_4 + (16u * 7u)) + 4u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_8 = (((v_7 + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 4u) + 8u) <= ((v_9 / 16u) * 4u)); + bool v_11 = (((v_10 + (16u * 7u)) + 2u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_12 = 0u; out5.GetDimensions(v_12); @@ -39,7 +39,7 @@ uint v_15 = 0u; out6.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 2u) + 8u) <= ((v_15 / 8u) * 2u)); + bool v_17 = (((v_16 + (16u * 7u)) + 4u) <= (v_15 / 8u)); m.Store(out6, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 4u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_col_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_col_major.wgsl.expected.msl index 94e7bd2..d6d64a1 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_col_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_col_major.wgsl.expected.msl
@@ -51,18 +51,18 @@ bool const v_3 = (((v_2 + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_0); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out0) + (select(0u, v_2, v_3) * 4u)), ulong((select(8u, 16u, v_3) * 1u)), ulong2(0ul), true)); uint const v_4 = as_type<uint>(0); - bool const v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_1 * 2u)); + bool const v_5 = (((v_4 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_1); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out1) + (select(0u, v_4, v_5) * 8u)), ulong((select(4u, 16u, v_5) * 2u)), ulong2(0ul), true)); uint const v_6 = as_type<uint>(0); - bool const v_7 = ((((v_6 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_2 * 4u)); + bool const v_7 = (((v_6 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_2); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out2) + (select(0u, v_6, v_7) * 16u)), ulong((select(2u, 16u, v_7) * 4u)), ulong2(0ul), true)); uint const v_8 = as_type<uint>(0); - bool const v_9 = ((((v_8 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_3 * 4u)); + bool const v_9 = (((v_8 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_3); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out3) + (select(0u, v_8, v_9) * 16u)), ulong((select(2u, 16u, v_9) * 4u)), ulong2(0ul), true)); uint const v_10 = as_type<uint>(0); bool const v_11 = (((v_10 + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out5) + (select(0u, v_10, v_11) * 4u)), ulong((select(8u, 16u, v_11) * 1u)), ulong2(0ul), true)); uint const v_12 = as_type<uint>(0); - bool const v_13 = ((((v_12 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_13 = (((v_12 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out6) + (select(0u, v_12, v_13) * 8u)), ulong((select(4u, 16u, v_13) * 2u)), ulong2(0ul), true)); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_col_major.wgsl.expected.spvasm index 2724400..73cb6bf 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 142 +; Bound: 134 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -106,10 +106,10 @@ %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -133,71 +133,63 @@ OpCooperativeMatrixStoreKHR %59 %m %uint_1 %57 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %64 = OpArrayLength %uint %6 0 - %65 = OpIMul %uint %64 %uint_2 - %67 = OpBitcast %uint %int_0 - %68 = OpIMul %uint %uint_16 %uint_7 - %69 = OpIAdd %uint %67 %68 - %70 = OpIMul %uint %69 %uint_2 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %65 - %73 = OpSelect %uint %72 %67 %uint_0 - %74 = OpSelect %uint %72 %uint_16 %uint_4 - %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %77 = OpAccessChain %_ptr_StorageBuffer_v2int %76 %73 - OpCooperativeMatrixStoreKHR %77 %m %uint_1 %74 NonPrivatePointer - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %82 = OpArrayLength %uint %12 0 - %83 = OpIMul %uint %82 %uint_4 - %84 = OpBitcast %uint %int_0 - %85 = OpIMul %uint %uint_16 %uint_7 - %86 = OpIAdd %uint %84 %85 - %87 = OpIMul %uint %86 %uint_4 - %88 = OpIAdd %uint %87 %uint_8 - %89 = OpULessThanEqual %bool %88 %83 - %90 = OpSelect %uint %89 %84 %uint_0 - %91 = OpSelect %uint %89 %uint_16 %uint_2 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 - OpCooperativeMatrixStoreKHR %93 %m %uint_1 %91 NonPrivatePointer - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %98 = OpArrayLength %uint %18 0 - %99 = OpIMul %uint %98 %uint_4 - %100 = OpBitcast %uint %int_0 - %101 = OpIMul %uint %uint_16 %uint_7 - %102 = OpIAdd %uint %100 %101 - %103 = OpIMul %uint %102 %uint_4 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %uint_16 %uint_2 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_v4uint %108 %106 - OpCooperativeMatrixStoreKHR %109 %m %uint_1 %107 NonPrivatePointer - %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %114 = OpArrayLength %uint %23 0 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %114 - %120 = OpSelect %uint %119 %115 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v2half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_1 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %128 = OpArrayLength %uint %29 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpBitcast %uint %int_0 - %131 = OpIMul %uint %uint_16 %uint_7 - %132 = OpIAdd %uint %130 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %129 - %136 = OpSelect %uint %135 %130 %uint_0 - %137 = OpSelect %uint %135 %uint_16 %uint_4 - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_v3half %138 %136 - OpCooperativeMatrixStoreKHR %139 %m %uint_1 %137 NonPrivatePointer + %65 = OpBitcast %uint %int_0 + %66 = OpIMul %uint %uint_16 %uint_7 + %67 = OpIAdd %uint %65 %66 + %68 = OpIAdd %uint %67 %uint_4 + %70 = OpULessThanEqual %bool %68 %64 + %71 = OpSelect %uint %70 %65 %uint_0 + %72 = OpSelect %uint %70 %uint_16 %uint_4 + %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %74 = OpAccessChain %_ptr_StorageBuffer_v2int %73 %71 + OpCooperativeMatrixStoreKHR %74 %m %uint_1 %72 NonPrivatePointer + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %79 = OpArrayLength %uint %12 0 + %80 = OpBitcast %uint %int_0 + %81 = OpIMul %uint %uint_16 %uint_7 + %82 = OpIAdd %uint %80 %81 + %83 = OpIAdd %uint %82 %uint_2 + %85 = OpULessThanEqual %bool %83 %79 + %86 = OpSelect %uint %85 %80 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_2 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpBitcast %uint %int_0 + %96 = OpIMul %uint %uint_16 %uint_7 + %97 = OpIAdd %uint %95 %96 + %98 = OpIAdd %uint %97 %uint_2 + %99 = OpULessThanEqual %bool %98 %94 + %100 = OpSelect %uint %99 %95 %uint_0 + %101 = OpSelect %uint %99 %uint_16 %uint_2 + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %103 = OpAccessChain %_ptr_StorageBuffer_v4uint %102 %100 + OpCooperativeMatrixStoreKHR %103 %m %uint_1 %101 NonPrivatePointer + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %108 = OpArrayLength %uint %23 0 + %109 = OpBitcast %uint %int_0 + %110 = OpIMul %uint %uint_16 %uint_7 + %111 = OpIAdd %uint %109 %110 + %112 = OpIAdd %uint %111 %uint_8 + %113 = OpULessThanEqual %bool %112 %108 + %114 = OpSelect %uint %113 %109 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_8 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v2half %116 %114 + OpCooperativeMatrixStoreKHR %117 %m %uint_1 %115 NonPrivatePointer + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %122 = OpArrayLength %uint %29 0 + %123 = OpBitcast %uint %int_0 + %124 = OpIMul %uint %uint_16 %uint_7 + %125 = OpIAdd %uint %123 %124 + %126 = OpIAdd %uint %125 %uint_4 + %127 = OpULessThanEqual %bool %126 %122 + %128 = OpSelect %uint %127 %123 %uint_0 + %129 = OpSelect %uint %127 %uint_16 %uint_4 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_v3half %130 %128 + OpCooperativeMatrixStoreKHR %131 %m %uint_1 %129 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl index 3320afb..7696cac 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -19,17 +19,17 @@ uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= ((v_3 / 8u) * 2u)); + bool v_5 = (((v_4 + (16u * 7u)) + 4u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_8 = (((v_7 + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 4u) + 8u) <= ((v_9 / 16u) * 4u)); + bool v_11 = (((v_10 + (16u * 7u)) + 2u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_12 = 0u; out5.GetDimensions(v_12); @@ -39,7 +39,7 @@ uint v_15 = 0u; out6.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 2u) + 8u) <= ((v_15 / 8u) * 2u)); + bool v_17 = (((v_16 + (16u * 7u)) + 4u) <= (v_15 / 8u)); m.Store(out6, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 4u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_row_major.wgsl.expected.msl b/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_row_major.wgsl.expected.msl index 86a3647..5df217e 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_row_major.wgsl.expected.msl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_row_major.wgsl.expected.msl
@@ -51,18 +51,18 @@ bool const v_3 = (((v_2 + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_0); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out0) + (select(0u, v_2, v_3) * 4u)), ulong((select(8u, 16u, v_3) * 1u)), ulong2(0ul), false)); uint const v_4 = as_type<uint>(0); - bool const v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_1 * 2u)); + bool const v_5 = (((v_4 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_1); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out1) + (select(0u, v_4, v_5) * 8u)), ulong((select(4u, 16u, v_5) * 2u)), ulong2(0ul), false)); uint const v_6 = as_type<uint>(0); - bool const v_7 = ((((v_6 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_2 * 4u)); + bool const v_7 = (((v_6 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_2); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out2) + (select(0u, v_6, v_7) * 16u)), ulong((select(2u, 16u, v_7) * 4u)), ulong2(0ul), false)); uint const v_8 = as_type<uint>(0); - bool const v_9 = ((((v_8 + (16u * 7u)) * 4u) + 8u) <= (v_1.tint_array_length_0_3 * 4u)); + bool const v_9 = (((v_8 + (16u * 7u)) + 2u) <= v_1.tint_array_length_0_3); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out3) + (select(0u, v_8, v_9) * 16u)), ulong((select(2u, 16u, v_9) * 4u)), ulong2(0ul), false)); uint const v_10 = as_type<uint>(0); bool const v_11 = (((v_10 + (16u * 7u)) + 8u) <= v_1.tint_array_length_0_4); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out5) + (select(0u, v_10, v_11) * 4u)), ulong((select(8u, 16u, v_11) * 1u)), ulong2(0ul), false)); uint const v_12 = as_type<uint>(0); - bool const v_13 = ((((v_12 + (16u * 7u)) * 2u) + 8u) <= (v_1.tint_array_length_0_5 * 2u)); + bool const v_13 = (((v_12 + (16u * 7u)) + 4u) <= v_1.tint_array_length_0_5); (simdgroup_store(m, reinterpret_cast<device float*>(reinterpret_cast<device char*>(tint_module_vars.out6) + (select(0u, v_12, v_13) * 8u)), ulong((select(4u, 16u, v_13) * 2u)), ulong2(0ul), false)); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_row_major.wgsl.expected.spvasm index 42cd27f..acf5f218 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_f32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 142 +; Bound: 134 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -106,10 +106,10 @@ %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -133,71 +133,63 @@ OpCooperativeMatrixStoreKHR %59 %m %uint_0 %57 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %64 = OpArrayLength %uint %6 0 - %65 = OpIMul %uint %64 %uint_2 - %67 = OpBitcast %uint %int_0 - %68 = OpIMul %uint %uint_16 %uint_7 - %69 = OpIAdd %uint %67 %68 - %70 = OpIMul %uint %69 %uint_2 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %65 - %73 = OpSelect %uint %72 %67 %uint_0 - %74 = OpSelect %uint %72 %uint_16 %uint_4 - %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %77 = OpAccessChain %_ptr_StorageBuffer_v2int %76 %73 - OpCooperativeMatrixStoreKHR %77 %m %uint_0 %74 NonPrivatePointer - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %82 = OpArrayLength %uint %12 0 - %83 = OpIMul %uint %82 %uint_4 - %84 = OpBitcast %uint %int_0 - %85 = OpIMul %uint %uint_16 %uint_7 - %86 = OpIAdd %uint %84 %85 - %87 = OpIMul %uint %86 %uint_4 - %88 = OpIAdd %uint %87 %uint_8 - %89 = OpULessThanEqual %bool %88 %83 - %90 = OpSelect %uint %89 %84 %uint_0 - %91 = OpSelect %uint %89 %uint_16 %uint_2 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 - OpCooperativeMatrixStoreKHR %93 %m %uint_0 %91 NonPrivatePointer - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %98 = OpArrayLength %uint %18 0 - %99 = OpIMul %uint %98 %uint_4 - %100 = OpBitcast %uint %int_0 - %101 = OpIMul %uint %uint_16 %uint_7 - %102 = OpIAdd %uint %100 %101 - %103 = OpIMul %uint %102 %uint_4 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %uint_16 %uint_2 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_v4uint %108 %106 - OpCooperativeMatrixStoreKHR %109 %m %uint_0 %107 NonPrivatePointer - %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %114 = OpArrayLength %uint %23 0 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %114 - %120 = OpSelect %uint %119 %115 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v2half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_0 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %128 = OpArrayLength %uint %29 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpBitcast %uint %int_0 - %131 = OpIMul %uint %uint_16 %uint_7 - %132 = OpIAdd %uint %130 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %129 - %136 = OpSelect %uint %135 %130 %uint_0 - %137 = OpSelect %uint %135 %uint_16 %uint_4 - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_v3half %138 %136 - OpCooperativeMatrixStoreKHR %139 %m %uint_0 %137 NonPrivatePointer + %65 = OpBitcast %uint %int_0 + %66 = OpIMul %uint %uint_16 %uint_7 + %67 = OpIAdd %uint %65 %66 + %68 = OpIAdd %uint %67 %uint_4 + %70 = OpULessThanEqual %bool %68 %64 + %71 = OpSelect %uint %70 %65 %uint_0 + %72 = OpSelect %uint %70 %uint_16 %uint_4 + %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %74 = OpAccessChain %_ptr_StorageBuffer_v2int %73 %71 + OpCooperativeMatrixStoreKHR %74 %m %uint_0 %72 NonPrivatePointer + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %79 = OpArrayLength %uint %12 0 + %80 = OpBitcast %uint %int_0 + %81 = OpIMul %uint %uint_16 %uint_7 + %82 = OpIAdd %uint %80 %81 + %83 = OpIAdd %uint %82 %uint_2 + %85 = OpULessThanEqual %bool %83 %79 + %86 = OpSelect %uint %85 %80 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_2 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_0 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpBitcast %uint %int_0 + %96 = OpIMul %uint %uint_16 %uint_7 + %97 = OpIAdd %uint %95 %96 + %98 = OpIAdd %uint %97 %uint_2 + %99 = OpULessThanEqual %bool %98 %94 + %100 = OpSelect %uint %99 %95 %uint_0 + %101 = OpSelect %uint %99 %uint_16 %uint_2 + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %103 = OpAccessChain %_ptr_StorageBuffer_v4uint %102 %100 + OpCooperativeMatrixStoreKHR %103 %m %uint_0 %101 NonPrivatePointer + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %108 = OpArrayLength %uint %23 0 + %109 = OpBitcast %uint %int_0 + %110 = OpIMul %uint %uint_16 %uint_7 + %111 = OpIAdd %uint %109 %110 + %112 = OpIAdd %uint %111 %uint_8 + %113 = OpULessThanEqual %bool %112 %108 + %114 = OpSelect %uint %113 %109 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_8 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v2half %116 %114 + OpCooperativeMatrixStoreKHR %117 %m %uint_0 %115 NonPrivatePointer + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %122 = OpArrayLength %uint %29 0 + %123 = OpBitcast %uint %int_0 + %124 = OpIMul %uint %uint_16 %uint_7 + %125 = OpIAdd %uint %123 %124 + %126 = OpIAdd %uint %125 %uint_4 + %127 = OpULessThanEqual %bool %126 %122 + %128 = OpSelect %uint %127 %123 %uint_0 + %129 = OpSelect %uint %127 %uint_16 %uint_4 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_v3half %130 %128 + OpCooperativeMatrixStoreKHR %131 %m %uint_0 %129 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl index d4f0ef95..f0a4300 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -17,15 +17,15 @@ m.Store(out0, (0u + (select(v_1, 0u, 0u) * 4u)), (select(v_1, 16u, 8u) * 4u), MatrixLayout::ColMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_2 / 8u) * 2u)); + bool v_3 = (((0u + (16u * 7u)) + 4u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 4u)), (select(v_3, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_4 / 16u) * 4u)); + bool v_5 = (((0u + (16u * 7u)) + 2u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 4u)), (select(v_5, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_7 = (((0u + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 4u)), (select(v_7, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_8 = 0u; out5.GetDimensions(v_8); @@ -33,7 +33,7 @@ m.Store(out5, (0u + (select(v_9, 0u, 0u) * 4u)), (select(v_9, 16u, 8u) * 4u), MatrixLayout::ColMajor); uint v_10 = 0u; out6.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_10 / 8u) * 2u)); + bool v_11 = (((0u + (16u * 7u)) + 4u) <= (v_10 / 8u)); m.Store(out6, (0u + (select(v_11, 0u, 0u) * 4u)), (select(v_11, 16u, 4u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_col_major.wgsl.expected.spvasm index 8d81aa2..e1e8204 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 135 +; Bound: 127 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -105,10 +105,10 @@ %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -131,66 +131,58 @@ OpCooperativeMatrixStoreKHR %57 %m %uint_1 %55 NonPrivatePointer %60 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %62 = OpArrayLength %uint %6 0 - %63 = OpIMul %uint %62 %uint_2 - %65 = OpIMul %uint %uint_16 %uint_7 - %66 = OpIAdd %uint %uint_0 %65 - %67 = OpIMul %uint %66 %uint_2 - %68 = OpIAdd %uint %67 %uint_8 - %69 = OpULessThanEqual %bool %68 %63 - %70 = OpSelect %uint %69 %uint_0 %uint_0 - %71 = OpSelect %uint %69 %uint_16 %uint_4 - %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %74 = OpAccessChain %_ptr_StorageBuffer_v2int %73 %70 - OpCooperativeMatrixStoreKHR %74 %m %uint_1 %71 NonPrivatePointer - %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %79 = OpArrayLength %uint %12 0 - %80 = OpIMul %uint %79 %uint_4 - %81 = OpIMul %uint %uint_16 %uint_7 - %82 = OpIAdd %uint %uint_0 %81 - %83 = OpIMul %uint %82 %uint_4 - %84 = OpIAdd %uint %83 %uint_8 - %85 = OpULessThanEqual %bool %84 %80 - %86 = OpSelect %uint %85 %uint_0 %uint_0 - %87 = OpSelect %uint %85 %uint_16 %uint_2 - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 - OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %94 = OpArrayLength %uint %18 0 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIMul %uint %uint_16 %uint_7 - %97 = OpIAdd %uint %uint_0 %96 - %98 = OpIMul %uint %97 %uint_4 - %99 = OpIAdd %uint %98 %uint_8 - %100 = OpULessThanEqual %bool %99 %95 - %101 = OpSelect %uint %100 %uint_0 %uint_0 - %102 = OpSelect %uint %100 %uint_16 %uint_2 - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v4uint %103 %101 - OpCooperativeMatrixStoreKHR %104 %m %uint_1 %102 NonPrivatePointer - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %109 = OpArrayLength %uint %23 0 - %110 = OpIMul %uint %uint_16 %uint_7 - %111 = OpIAdd %uint %uint_0 %110 - %112 = OpIAdd %uint %111 %uint_8 - %113 = OpULessThanEqual %bool %112 %109 - %114 = OpSelect %uint %113 %uint_0 %uint_0 - %115 = OpSelect %uint %113 %uint_16 %uint_8 - %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %117 = OpAccessChain %_ptr_StorageBuffer_v2half %116 %114 - OpCooperativeMatrixStoreKHR %117 %m %uint_1 %115 NonPrivatePointer - %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %122 = OpArrayLength %uint %29 0 - %123 = OpIMul %uint %122 %uint_2 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %uint_0 %124 - %126 = OpIMul %uint %125 %uint_2 - %127 = OpIAdd %uint %126 %uint_8 - %128 = OpULessThanEqual %bool %127 %123 - %129 = OpSelect %uint %128 %uint_0 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_4 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_v3half %131 %129 - OpCooperativeMatrixStoreKHR %132 %m %uint_1 %130 NonPrivatePointer + %63 = OpIMul %uint %uint_16 %uint_7 + %64 = OpIAdd %uint %uint_0 %63 + %65 = OpIAdd %uint %64 %uint_4 + %67 = OpULessThanEqual %bool %65 %62 + %68 = OpSelect %uint %67 %uint_0 %uint_0 + %69 = OpSelect %uint %67 %uint_16 %uint_4 + %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %71 = OpAccessChain %_ptr_StorageBuffer_v2int %70 %68 + OpCooperativeMatrixStoreKHR %71 %m %uint_1 %69 NonPrivatePointer + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %76 = OpArrayLength %uint %12 0 + %77 = OpIMul %uint %uint_16 %uint_7 + %78 = OpIAdd %uint %uint_0 %77 + %79 = OpIAdd %uint %78 %uint_2 + %81 = OpULessThanEqual %bool %79 %76 + %82 = OpSelect %uint %81 %uint_0 %uint_0 + %83 = OpSelect %uint %81 %uint_16 %uint_2 + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %85 = OpAccessChain %_ptr_StorageBuffer_v3float %84 %82 + OpCooperativeMatrixStoreKHR %85 %m %uint_1 %83 NonPrivatePointer + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %90 = OpArrayLength %uint %18 0 + %91 = OpIMul %uint %uint_16 %uint_7 + %92 = OpIAdd %uint %uint_0 %91 + %93 = OpIAdd %uint %92 %uint_2 + %94 = OpULessThanEqual %bool %93 %90 + %95 = OpSelect %uint %94 %uint_0 %uint_0 + %96 = OpSelect %uint %94 %uint_16 %uint_2 + %97 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %98 = OpAccessChain %_ptr_StorageBuffer_v4uint %97 %95 + OpCooperativeMatrixStoreKHR %98 %m %uint_1 %96 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %103 = OpArrayLength %uint %23 0 + %104 = OpIMul %uint %uint_16 %uint_7 + %105 = OpIAdd %uint %uint_0 %104 + %106 = OpIAdd %uint %105 %uint_8 + %107 = OpULessThanEqual %bool %106 %103 + %108 = OpSelect %uint %107 %uint_0 %uint_0 + %109 = OpSelect %uint %107 %uint_16 %uint_8 + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %111 = OpAccessChain %_ptr_StorageBuffer_v2half %110 %108 + OpCooperativeMatrixStoreKHR %111 %m %uint_1 %109 NonPrivatePointer + %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %116 = OpArrayLength %uint %29 0 + %117 = OpIMul %uint %uint_16 %uint_7 + %118 = OpIAdd %uint %uint_0 %117 + %119 = OpIAdd %uint %118 %uint_4 + %120 = OpULessThanEqual %bool %119 %116 + %121 = OpSelect %uint %120 %uint_0 %uint_0 + %122 = OpSelect %uint %120 %uint_16 %uint_4 + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %124 = OpAccessChain %_ptr_StorageBuffer_v3half %123 %121 + OpCooperativeMatrixStoreKHR %124 %m %uint_1 %122 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl index 16d36fd..417cf07 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -17,15 +17,15 @@ m.Store(out0, (0u + (select(v_1, 0u, 0u) * 4u)), (select(v_1, 16u, 8u) * 4u), MatrixLayout::RowMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_2 / 8u) * 2u)); + bool v_3 = (((0u + (16u * 7u)) + 4u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 4u)), (select(v_3, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_4 / 16u) * 4u)); + bool v_5 = (((0u + (16u * 7u)) + 2u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 4u)), (select(v_5, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_7 = (((0u + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 4u)), (select(v_7, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_8 = 0u; out5.GetDimensions(v_8); @@ -33,7 +33,7 @@ m.Store(out5, (0u + (select(v_9, 0u, 0u) * 4u)), (select(v_9, 16u, 8u) * 4u), MatrixLayout::RowMajor); uint v_10 = 0u; out6.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_10 / 8u) * 2u)); + bool v_11 = (((0u + (16u * 7u)) + 4u) <= (v_10 / 8u)); m.Store(out6, (0u + (select(v_11, 0u, 0u) * 4u)), (select(v_11, 16u, 4u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_row_major.wgsl.expected.spvasm index 3b4d906..54ed0bc 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_i32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 135 +; Bound: 127 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -105,10 +105,10 @@ %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -131,66 +131,58 @@ OpCooperativeMatrixStoreKHR %57 %m %uint_0 %55 NonPrivatePointer %60 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %62 = OpArrayLength %uint %6 0 - %63 = OpIMul %uint %62 %uint_2 - %65 = OpIMul %uint %uint_16 %uint_7 - %66 = OpIAdd %uint %uint_0 %65 - %67 = OpIMul %uint %66 %uint_2 - %68 = OpIAdd %uint %67 %uint_8 - %69 = OpULessThanEqual %bool %68 %63 - %70 = OpSelect %uint %69 %uint_0 %uint_0 - %71 = OpSelect %uint %69 %uint_16 %uint_4 - %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %74 = OpAccessChain %_ptr_StorageBuffer_v2int %73 %70 - OpCooperativeMatrixStoreKHR %74 %m %uint_0 %71 NonPrivatePointer - %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %79 = OpArrayLength %uint %12 0 - %80 = OpIMul %uint %79 %uint_4 - %81 = OpIMul %uint %uint_16 %uint_7 - %82 = OpIAdd %uint %uint_0 %81 - %83 = OpIMul %uint %82 %uint_4 - %84 = OpIAdd %uint %83 %uint_8 - %85 = OpULessThanEqual %bool %84 %80 - %86 = OpSelect %uint %85 %uint_0 %uint_0 - %87 = OpSelect %uint %85 %uint_16 %uint_2 - %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 - OpCooperativeMatrixStoreKHR %89 %m %uint_0 %87 NonPrivatePointer - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %94 = OpArrayLength %uint %18 0 - %95 = OpIMul %uint %94 %uint_4 - %96 = OpIMul %uint %uint_16 %uint_7 - %97 = OpIAdd %uint %uint_0 %96 - %98 = OpIMul %uint %97 %uint_4 - %99 = OpIAdd %uint %98 %uint_8 - %100 = OpULessThanEqual %bool %99 %95 - %101 = OpSelect %uint %100 %uint_0 %uint_0 - %102 = OpSelect %uint %100 %uint_16 %uint_2 - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %104 = OpAccessChain %_ptr_StorageBuffer_v4uint %103 %101 - OpCooperativeMatrixStoreKHR %104 %m %uint_0 %102 NonPrivatePointer - %107 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %109 = OpArrayLength %uint %23 0 - %110 = OpIMul %uint %uint_16 %uint_7 - %111 = OpIAdd %uint %uint_0 %110 - %112 = OpIAdd %uint %111 %uint_8 - %113 = OpULessThanEqual %bool %112 %109 - %114 = OpSelect %uint %113 %uint_0 %uint_0 - %115 = OpSelect %uint %113 %uint_16 %uint_8 - %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %117 = OpAccessChain %_ptr_StorageBuffer_v2half %116 %114 - OpCooperativeMatrixStoreKHR %117 %m %uint_0 %115 NonPrivatePointer - %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %122 = OpArrayLength %uint %29 0 - %123 = OpIMul %uint %122 %uint_2 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %uint_0 %124 - %126 = OpIMul %uint %125 %uint_2 - %127 = OpIAdd %uint %126 %uint_8 - %128 = OpULessThanEqual %bool %127 %123 - %129 = OpSelect %uint %128 %uint_0 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_4 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_v3half %131 %129 - OpCooperativeMatrixStoreKHR %132 %m %uint_0 %130 NonPrivatePointer + %63 = OpIMul %uint %uint_16 %uint_7 + %64 = OpIAdd %uint %uint_0 %63 + %65 = OpIAdd %uint %64 %uint_4 + %67 = OpULessThanEqual %bool %65 %62 + %68 = OpSelect %uint %67 %uint_0 %uint_0 + %69 = OpSelect %uint %67 %uint_16 %uint_4 + %70 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %71 = OpAccessChain %_ptr_StorageBuffer_v2int %70 %68 + OpCooperativeMatrixStoreKHR %71 %m %uint_0 %69 NonPrivatePointer + %74 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %76 = OpArrayLength %uint %12 0 + %77 = OpIMul %uint %uint_16 %uint_7 + %78 = OpIAdd %uint %uint_0 %77 + %79 = OpIAdd %uint %78 %uint_2 + %81 = OpULessThanEqual %bool %79 %76 + %82 = OpSelect %uint %81 %uint_0 %uint_0 + %83 = OpSelect %uint %81 %uint_16 %uint_2 + %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %85 = OpAccessChain %_ptr_StorageBuffer_v3float %84 %82 + OpCooperativeMatrixStoreKHR %85 %m %uint_0 %83 NonPrivatePointer + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %90 = OpArrayLength %uint %18 0 + %91 = OpIMul %uint %uint_16 %uint_7 + %92 = OpIAdd %uint %uint_0 %91 + %93 = OpIAdd %uint %92 %uint_2 + %94 = OpULessThanEqual %bool %93 %90 + %95 = OpSelect %uint %94 %uint_0 %uint_0 + %96 = OpSelect %uint %94 %uint_16 %uint_2 + %97 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %98 = OpAccessChain %_ptr_StorageBuffer_v4uint %97 %95 + OpCooperativeMatrixStoreKHR %98 %m %uint_0 %96 NonPrivatePointer + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %103 = OpArrayLength %uint %23 0 + %104 = OpIMul %uint %uint_16 %uint_7 + %105 = OpIAdd %uint %uint_0 %104 + %106 = OpIAdd %uint %105 %uint_8 + %107 = OpULessThanEqual %bool %106 %103 + %108 = OpSelect %uint %107 %uint_0 %uint_0 + %109 = OpSelect %uint %107 %uint_16 %uint_8 + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %111 = OpAccessChain %_ptr_StorageBuffer_v2half %110 %108 + OpCooperativeMatrixStoreKHR %111 %m %uint_0 %109 NonPrivatePointer + %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %116 = OpArrayLength %uint %29 0 + %117 = OpIMul %uint %uint_16 %uint_7 + %118 = OpIAdd %uint %uint_0 %117 + %119 = OpIAdd %uint %118 %uint_4 + %120 = OpULessThanEqual %bool %119 %116 + %121 = OpSelect %uint %120 %uint_0 %uint_0 + %122 = OpSelect %uint %120 %uint_16 %uint_4 + %123 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %124 = OpAccessChain %_ptr_StorageBuffer_v3half %123 %121 + OpCooperativeMatrixStoreKHR %124 %m %uint_0 %122 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl index 25b33d7..e0d58b7 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -15,37 +15,37 @@ uint v = 0u; out0.GetDimensions(v); uint v_1 = asuint(int(0)); - bool v_2 = ((((v_1 + (16u * 7u)) * 4u) + 8u) <= ((v / 4u) * 4u)); + bool v_2 = (((v_1 + (16u * 7u)) + 2u) <= (v / 4u)); m.Store(out0, (0u + (select(v_2, v_1, 0u) * 4u)), (select(v_2, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 8u) + 8u) <= ((v_3 / 8u) * 8u)); + bool v_5 = (((v_4 + (16u * 7u)) + 1u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 16u) + 16u) <= ((v_6 / 16u) * 16u)); + bool v_8 = (((v_7 + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 16u) + 16u) <= ((v_9 / 16u) * 16u)); + bool v_11 = (((v_10 + (16u * 7u)) + 1u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_12 = 0u; out4.GetDimensions(v_12); uint v_13 = asuint(int(0)); - bool v_14 = ((((v_13 + (16u * 7u)) * 2u) + 8u) <= ((v_12 / 2u) * 2u)); + bool v_14 = (((v_13 + (16u * 7u)) + 4u) <= (v_12 / 2u)); m.Store(out4, (0u + (select(v_14, v_13, 0u) * 4u)), (select(v_14, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_15 = 0u; out5.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 4u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 4u)); m.Store(out5, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_18 = 0u; out6.GetDimensions(v_18); uint v_19 = asuint(int(0)); - bool v_20 = ((((v_19 + (16u * 7u)) * 8u) + 8u) <= ((v_18 / 8u) * 8u)); + bool v_20 = (((v_19 + (16u * 7u)) + 1u) <= (v_18 / 8u)); m.Store(out6, (0u + (select(v_20, v_19, 0u) * 4u)), (select(v_20, 16u, 1u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_col_major.wgsl.expected.spvasm index 2f35f2d..165512a 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 167 +; Bound: 153 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -113,12 +113,11 @@ %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -127,6 +126,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -136,101 +136,87 @@ %41 = OpLabel %48 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %51 = OpArrayLength %uint %1 0 - %52 = OpIMul %uint %51 %uint_4 - %54 = OpBitcast %uint %int_0 - %56 = OpIMul %uint %uint_16 %uint_7 - %59 = OpIAdd %uint %54 %56 - %60 = OpIMul %uint %59 %uint_4 - %61 = OpIAdd %uint %60 %uint_8 - %62 = OpULessThanEqual %bool %61 %52 - %64 = OpSelect %uint %62 %54 %uint_0 - %65 = OpSelect %uint %62 %uint_16 %uint_2 - %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %68 = OpAccessChain %_ptr_StorageBuffer_uint %67 %64 - OpCooperativeMatrixStoreKHR %68 %m %uint_1 %65 NonPrivatePointer - %71 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %73 = OpArrayLength %uint %6 0 - %74 = OpIMul %uint %73 %uint_8 - %75 = OpBitcast %uint %int_0 - %76 = OpIMul %uint %uint_16 %uint_7 - %77 = OpIAdd %uint %75 %76 - %78 = OpIMul %uint %77 %uint_8 - %79 = OpIAdd %uint %78 %uint_8 - %80 = OpULessThanEqual %bool %79 %74 - %81 = OpSelect %uint %80 %75 %uint_0 - %82 = OpSelect %uint %80 %uint_16 %uint_1 - %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %83 %81 - OpCooperativeMatrixStoreKHR %84 %m %uint_1 %82 NonPrivatePointer - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %89 = OpArrayLength %uint %12 0 - %90 = OpIMul %uint %89 %uint_16 - %91 = OpBitcast %uint %int_0 - %92 = OpIMul %uint %uint_16 %uint_7 - %93 = OpIAdd %uint %91 %92 - %94 = OpIMul %uint %93 %uint_16 - %95 = OpIAdd %uint %94 %uint_16 - %96 = OpULessThanEqual %bool %95 %90 - %97 = OpSelect %uint %96 %91 %uint_0 - %98 = OpSelect %uint %96 %uint_16 %uint_1 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_v3float %99 %97 - OpCooperativeMatrixStoreKHR %100 %m %uint_1 %98 NonPrivatePointer - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %105 = OpArrayLength %uint %18 0 - %106 = OpIMul %uint %105 %uint_16 - %107 = OpBitcast %uint %int_0 - %108 = OpIMul %uint %uint_16 %uint_7 - %109 = OpIAdd %uint %107 %108 - %110 = OpIMul %uint %109 %uint_16 - %111 = OpIAdd %uint %110 %uint_16 - %112 = OpULessThanEqual %bool %111 %106 - %113 = OpSelect %uint %112 %107 %uint_0 - %114 = OpSelect %uint %112 %uint_16 %uint_1 - %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %116 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %113 - OpCooperativeMatrixStoreKHR %116 %m %uint_1 %114 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %121 = OpArrayLength %uint %23 0 - %122 = OpIMul %uint %121 %uint_2 - %123 = OpBitcast %uint %int_0 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %123 %124 - %126 = OpIMul %uint %125 %uint_2 - %127 = OpIAdd %uint %126 %uint_8 - %128 = OpULessThanEqual %bool %127 %122 - %129 = OpSelect %uint %128 %123 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_4 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_half %131 %129 - OpCooperativeMatrixStoreKHR %132 %m %uint_1 %130 NonPrivatePointer + %52 = OpBitcast %uint %int_0 + %54 = OpIMul %uint %uint_16 %uint_7 + %57 = OpIAdd %uint %52 %54 + %58 = OpIAdd %uint %57 %uint_2 + %60 = OpULessThanEqual %bool %58 %51 + %62 = OpSelect %uint %60 %52 %uint_0 + %63 = OpSelect %uint %60 %uint_16 %uint_2 + %64 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %65 = OpAccessChain %_ptr_StorageBuffer_uint %64 %62 + OpCooperativeMatrixStoreKHR %65 %m %uint_1 %63 NonPrivatePointer + %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %70 = OpArrayLength %uint %6 0 + %71 = OpBitcast %uint %int_0 + %72 = OpIMul %uint %uint_16 %uint_7 + %73 = OpIAdd %uint %71 %72 + %74 = OpIAdd %uint %73 %uint_1 + %75 = OpULessThanEqual %bool %74 %70 + %76 = OpSelect %uint %75 %71 %uint_0 + %77 = OpSelect %uint %75 %uint_16 %uint_1 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_v2int %78 %76 + OpCooperativeMatrixStoreKHR %79 %m %uint_1 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %84 = OpArrayLength %uint %12 0 + %85 = OpBitcast %uint %int_0 + %86 = OpIMul %uint %uint_16 %uint_7 + %87 = OpIAdd %uint %85 %86 + %88 = OpIAdd %uint %87 %uint_1 + %89 = OpULessThanEqual %bool %88 %84 + %90 = OpSelect %uint %89 %85 %uint_0 + %91 = OpSelect %uint %89 %uint_16 %uint_1 + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 + OpCooperativeMatrixStoreKHR %93 %m %uint_1 %91 NonPrivatePointer + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %98 = OpArrayLength %uint %18 0 + %99 = OpBitcast %uint %int_0 + %100 = OpIMul %uint %uint_16 %uint_7 + %101 = OpIAdd %uint %99 %100 + %102 = OpIAdd %uint %101 %uint_1 + %103 = OpULessThanEqual %bool %102 %98 + %104 = OpSelect %uint %103 %99 %uint_0 + %105 = OpSelect %uint %103 %uint_16 %uint_1 + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %107 = OpAccessChain %_ptr_StorageBuffer_v4uint %106 %104 + OpCooperativeMatrixStoreKHR %107 %m %uint_1 %105 NonPrivatePointer + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %112 = OpArrayLength %uint %23 0 + %113 = OpBitcast %uint %int_0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %113 %114 + %116 = OpIAdd %uint %115 %uint_4 + %118 = OpULessThanEqual %bool %116 %112 + %119 = OpSelect %uint %118 %113 %uint_0 + %120 = OpSelect %uint %118 %uint_16 %uint_4 + %121 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %122 = OpAccessChain %_ptr_StorageBuffer_half %121 %119 + OpCooperativeMatrixStoreKHR %122 %m %uint_1 %120 NonPrivatePointer + %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %127 = OpArrayLength %uint %28 0 + %128 = OpBitcast %uint %int_0 + %129 = OpIMul %uint %uint_16 %uint_7 + %130 = OpIAdd %uint %128 %129 + %131 = OpIAdd %uint %130 %uint_2 + %132 = OpULessThanEqual %bool %131 %127 + %133 = OpSelect %uint %132 %128 %uint_0 + %134 = OpSelect %uint %132 %uint_16 %uint_2 %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %137 = OpArrayLength %uint %28 0 - %138 = OpIMul %uint %137 %uint_4 - %139 = OpBitcast %uint %int_0 - %140 = OpIMul %uint %uint_16 %uint_7 - %141 = OpIAdd %uint %139 %140 - %142 = OpIMul %uint %141 %uint_4 - %143 = OpIAdd %uint %142 %uint_8 - %144 = OpULessThanEqual %bool %143 %138 - %145 = OpSelect %uint %144 %139 %uint_0 - %146 = OpSelect %uint %144 %uint_16 %uint_2 - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %148 = OpAccessChain %_ptr_StorageBuffer_v2half %147 %145 - OpCooperativeMatrixStoreKHR %148 %m %uint_1 %146 NonPrivatePointer - %151 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %153 = OpArrayLength %uint %33 0 - %154 = OpIMul %uint %153 %uint_8 - %155 = OpBitcast %uint %int_0 - %156 = OpIMul %uint %uint_16 %uint_7 - %157 = OpIAdd %uint %155 %156 - %158 = OpIMul %uint %157 %uint_8 - %159 = OpIAdd %uint %158 %uint_8 - %160 = OpULessThanEqual %bool %159 %154 - %161 = OpSelect %uint %160 %155 %uint_0 - %162 = OpSelect %uint %160 %uint_16 %uint_1 - %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v3half %163 %161 - OpCooperativeMatrixStoreKHR %164 %m %uint_1 %162 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer_v2half %135 %133 + OpCooperativeMatrixStoreKHR %136 %m %uint_1 %134 NonPrivatePointer + %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %141 = OpArrayLength %uint %33 0 + %142 = OpBitcast %uint %int_0 + %143 = OpIMul %uint %uint_16 %uint_7 + %144 = OpIAdd %uint %142 %143 + %145 = OpIAdd %uint %144 %uint_1 + %146 = OpULessThanEqual %bool %145 %141 + %147 = OpSelect %uint %146 %142 %uint_0 + %148 = OpSelect %uint %146 %uint_16 %uint_1 + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %150 = OpAccessChain %_ptr_StorageBuffer_v3half %149 %147 + OpCooperativeMatrixStoreKHR %150 %m %uint_1 %148 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl index 4839a42..e396dbe 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -15,37 +15,37 @@ uint v = 0u; out0.GetDimensions(v); uint v_1 = asuint(int(0)); - bool v_2 = ((((v_1 + (16u * 7u)) * 4u) + 8u) <= ((v / 4u) * 4u)); + bool v_2 = (((v_1 + (16u * 7u)) + 2u) <= (v / 4u)); m.Store(out0, (0u + (select(v_2, v_1, 0u) * 4u)), (select(v_2, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 8u) + 8u) <= ((v_3 / 8u) * 8u)); + bool v_5 = (((v_4 + (16u * 7u)) + 1u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 16u) + 16u) <= ((v_6 / 16u) * 16u)); + bool v_8 = (((v_7 + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 16u) + 16u) <= ((v_9 / 16u) * 16u)); + bool v_11 = (((v_10 + (16u * 7u)) + 1u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_12 = 0u; out4.GetDimensions(v_12); uint v_13 = asuint(int(0)); - bool v_14 = ((((v_13 + (16u * 7u)) * 2u) + 8u) <= ((v_12 / 2u) * 2u)); + bool v_14 = (((v_13 + (16u * 7u)) + 4u) <= (v_12 / 2u)); m.Store(out4, (0u + (select(v_14, v_13, 0u) * 4u)), (select(v_14, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_15 = 0u; out5.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 4u) + 8u) <= ((v_15 / 4u) * 4u)); + bool v_17 = (((v_16 + (16u * 7u)) + 2u) <= (v_15 / 4u)); m.Store(out5, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_18 = 0u; out6.GetDimensions(v_18); uint v_19 = asuint(int(0)); - bool v_20 = ((((v_19 + (16u * 7u)) * 8u) + 8u) <= ((v_18 / 8u) * 8u)); + bool v_20 = (((v_19 + (16u * 7u)) + 1u) <= (v_18 / 8u)); m.Store(out6, (0u + (select(v_20, v_19, 0u) * 4u)), (select(v_20, 16u, 1u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_row_major.wgsl.expected.spvasm index 4554a88..75c5f08 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_i8_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 167 +; Bound: 153 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -113,12 +113,11 @@ %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -127,6 +126,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -136,101 +136,87 @@ %41 = OpLabel %48 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %51 = OpArrayLength %uint %1 0 - %52 = OpIMul %uint %51 %uint_4 - %54 = OpBitcast %uint %int_0 - %56 = OpIMul %uint %uint_16 %uint_7 - %59 = OpIAdd %uint %54 %56 - %60 = OpIMul %uint %59 %uint_4 - %61 = OpIAdd %uint %60 %uint_8 - %62 = OpULessThanEqual %bool %61 %52 - %64 = OpSelect %uint %62 %54 %uint_0 - %65 = OpSelect %uint %62 %uint_16 %uint_2 - %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %68 = OpAccessChain %_ptr_StorageBuffer_uint %67 %64 - OpCooperativeMatrixStoreKHR %68 %m %uint_0 %65 NonPrivatePointer - %71 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %73 = OpArrayLength %uint %6 0 - %74 = OpIMul %uint %73 %uint_8 - %75 = OpBitcast %uint %int_0 - %76 = OpIMul %uint %uint_16 %uint_7 - %77 = OpIAdd %uint %75 %76 - %78 = OpIMul %uint %77 %uint_8 - %79 = OpIAdd %uint %78 %uint_8 - %80 = OpULessThanEqual %bool %79 %74 - %81 = OpSelect %uint %80 %75 %uint_0 - %82 = OpSelect %uint %80 %uint_16 %uint_1 - %83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %84 = OpAccessChain %_ptr_StorageBuffer_v2int %83 %81 - OpCooperativeMatrixStoreKHR %84 %m %uint_0 %82 NonPrivatePointer - %87 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %89 = OpArrayLength %uint %12 0 - %90 = OpIMul %uint %89 %uint_16 - %91 = OpBitcast %uint %int_0 - %92 = OpIMul %uint %uint_16 %uint_7 - %93 = OpIAdd %uint %91 %92 - %94 = OpIMul %uint %93 %uint_16 - %95 = OpIAdd %uint %94 %uint_16 - %96 = OpULessThanEqual %bool %95 %90 - %97 = OpSelect %uint %96 %91 %uint_0 - %98 = OpSelect %uint %96 %uint_16 %uint_1 - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %100 = OpAccessChain %_ptr_StorageBuffer_v3float %99 %97 - OpCooperativeMatrixStoreKHR %100 %m %uint_0 %98 NonPrivatePointer - %103 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %105 = OpArrayLength %uint %18 0 - %106 = OpIMul %uint %105 %uint_16 - %107 = OpBitcast %uint %int_0 - %108 = OpIMul %uint %uint_16 %uint_7 - %109 = OpIAdd %uint %107 %108 - %110 = OpIMul %uint %109 %uint_16 - %111 = OpIAdd %uint %110 %uint_16 - %112 = OpULessThanEqual %bool %111 %106 - %113 = OpSelect %uint %112 %107 %uint_0 - %114 = OpSelect %uint %112 %uint_16 %uint_1 - %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %116 = OpAccessChain %_ptr_StorageBuffer_v4uint %115 %113 - OpCooperativeMatrixStoreKHR %116 %m %uint_0 %114 NonPrivatePointer - %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %121 = OpArrayLength %uint %23 0 - %122 = OpIMul %uint %121 %uint_2 - %123 = OpBitcast %uint %int_0 - %124 = OpIMul %uint %uint_16 %uint_7 - %125 = OpIAdd %uint %123 %124 - %126 = OpIMul %uint %125 %uint_2 - %127 = OpIAdd %uint %126 %uint_8 - %128 = OpULessThanEqual %bool %127 %122 - %129 = OpSelect %uint %128 %123 %uint_0 - %130 = OpSelect %uint %128 %uint_16 %uint_4 - %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %132 = OpAccessChain %_ptr_StorageBuffer_half %131 %129 - OpCooperativeMatrixStoreKHR %132 %m %uint_0 %130 NonPrivatePointer + %52 = OpBitcast %uint %int_0 + %54 = OpIMul %uint %uint_16 %uint_7 + %57 = OpIAdd %uint %52 %54 + %58 = OpIAdd %uint %57 %uint_2 + %60 = OpULessThanEqual %bool %58 %51 + %62 = OpSelect %uint %60 %52 %uint_0 + %63 = OpSelect %uint %60 %uint_16 %uint_2 + %64 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %65 = OpAccessChain %_ptr_StorageBuffer_uint %64 %62 + OpCooperativeMatrixStoreKHR %65 %m %uint_0 %63 NonPrivatePointer + %68 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %70 = OpArrayLength %uint %6 0 + %71 = OpBitcast %uint %int_0 + %72 = OpIMul %uint %uint_16 %uint_7 + %73 = OpIAdd %uint %71 %72 + %74 = OpIAdd %uint %73 %uint_1 + %75 = OpULessThanEqual %bool %74 %70 + %76 = OpSelect %uint %75 %71 %uint_0 + %77 = OpSelect %uint %75 %uint_16 %uint_1 + %78 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %79 = OpAccessChain %_ptr_StorageBuffer_v2int %78 %76 + OpCooperativeMatrixStoreKHR %79 %m %uint_0 %77 NonPrivatePointer + %82 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %84 = OpArrayLength %uint %12 0 + %85 = OpBitcast %uint %int_0 + %86 = OpIMul %uint %uint_16 %uint_7 + %87 = OpIAdd %uint %85 %86 + %88 = OpIAdd %uint %87 %uint_1 + %89 = OpULessThanEqual %bool %88 %84 + %90 = OpSelect %uint %89 %85 %uint_0 + %91 = OpSelect %uint %89 %uint_16 %uint_1 + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 + OpCooperativeMatrixStoreKHR %93 %m %uint_0 %91 NonPrivatePointer + %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %98 = OpArrayLength %uint %18 0 + %99 = OpBitcast %uint %int_0 + %100 = OpIMul %uint %uint_16 %uint_7 + %101 = OpIAdd %uint %99 %100 + %102 = OpIAdd %uint %101 %uint_1 + %103 = OpULessThanEqual %bool %102 %98 + %104 = OpSelect %uint %103 %99 %uint_0 + %105 = OpSelect %uint %103 %uint_16 %uint_1 + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %107 = OpAccessChain %_ptr_StorageBuffer_v4uint %106 %104 + OpCooperativeMatrixStoreKHR %107 %m %uint_0 %105 NonPrivatePointer + %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %112 = OpArrayLength %uint %23 0 + %113 = OpBitcast %uint %int_0 + %114 = OpIMul %uint %uint_16 %uint_7 + %115 = OpIAdd %uint %113 %114 + %116 = OpIAdd %uint %115 %uint_4 + %118 = OpULessThanEqual %bool %116 %112 + %119 = OpSelect %uint %118 %113 %uint_0 + %120 = OpSelect %uint %118 %uint_16 %uint_4 + %121 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %122 = OpAccessChain %_ptr_StorageBuffer_half %121 %119 + OpCooperativeMatrixStoreKHR %122 %m %uint_0 %120 NonPrivatePointer + %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %127 = OpArrayLength %uint %28 0 + %128 = OpBitcast %uint %int_0 + %129 = OpIMul %uint %uint_16 %uint_7 + %130 = OpIAdd %uint %128 %129 + %131 = OpIAdd %uint %130 %uint_2 + %132 = OpULessThanEqual %bool %131 %127 + %133 = OpSelect %uint %132 %128 %uint_0 + %134 = OpSelect %uint %132 %uint_16 %uint_2 %135 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %137 = OpArrayLength %uint %28 0 - %138 = OpIMul %uint %137 %uint_4 - %139 = OpBitcast %uint %int_0 - %140 = OpIMul %uint %uint_16 %uint_7 - %141 = OpIAdd %uint %139 %140 - %142 = OpIMul %uint %141 %uint_4 - %143 = OpIAdd %uint %142 %uint_8 - %144 = OpULessThanEqual %bool %143 %138 - %145 = OpSelect %uint %144 %139 %uint_0 - %146 = OpSelect %uint %144 %uint_16 %uint_2 - %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %148 = OpAccessChain %_ptr_StorageBuffer_v2half %147 %145 - OpCooperativeMatrixStoreKHR %148 %m %uint_0 %146 NonPrivatePointer - %151 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %153 = OpArrayLength %uint %33 0 - %154 = OpIMul %uint %153 %uint_8 - %155 = OpBitcast %uint %int_0 - %156 = OpIMul %uint %uint_16 %uint_7 - %157 = OpIAdd %uint %155 %156 - %158 = OpIMul %uint %157 %uint_8 - %159 = OpIAdd %uint %158 %uint_8 - %160 = OpULessThanEqual %bool %159 %154 - %161 = OpSelect %uint %160 %155 %uint_0 - %162 = OpSelect %uint %160 %uint_16 %uint_1 - %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %164 = OpAccessChain %_ptr_StorageBuffer_v3half %163 %161 - OpCooperativeMatrixStoreKHR %164 %m %uint_0 %162 NonPrivatePointer + %136 = OpAccessChain %_ptr_StorageBuffer_v2half %135 %133 + OpCooperativeMatrixStoreKHR %136 %m %uint_0 %134 NonPrivatePointer + %139 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %141 = OpArrayLength %uint %33 0 + %142 = OpBitcast %uint %int_0 + %143 = OpIMul %uint %uint_16 %uint_7 + %144 = OpIAdd %uint %142 %143 + %145 = OpIAdd %uint %144 %uint_1 + %146 = OpULessThanEqual %bool %145 %141 + %147 = OpSelect %uint %146 %142 %uint_0 + %148 = OpSelect %uint %146 %uint_16 %uint_1 + %149 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %150 = OpAccessChain %_ptr_StorageBuffer_v3half %149 %147 + OpCooperativeMatrixStoreKHR %150 %m %uint_0 %148 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl index f8a1413..d11a8ed 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -19,17 +19,17 @@ uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= ((v_3 / 8u) * 2u)); + bool v_5 = (((v_4 + (16u * 7u)) + 4u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_8 = (((v_7 + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 4u) + 8u) <= ((v_9 / 16u) * 4u)); + bool v_11 = (((v_10 + (16u * 7u)) + 2u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_12 = 0u; out5.GetDimensions(v_12); @@ -39,7 +39,7 @@ uint v_15 = 0u; out6.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 2u) + 8u) <= ((v_15 / 8u) * 2u)); + bool v_17 = (((v_16 + (16u * 7u)) + 4u) <= (v_15 / 8u)); m.Store(out6, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 4u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_col_major.wgsl.expected.spvasm index c972223..44c1c4d 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 142 +; Bound: 134 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -106,10 +106,10 @@ %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -133,71 +133,63 @@ OpCooperativeMatrixStoreKHR %59 %m %uint_1 %57 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %64 = OpArrayLength %uint %6 0 - %65 = OpIMul %uint %64 %uint_2 - %67 = OpBitcast %uint %int_0 - %68 = OpIMul %uint %uint_16 %uint_7 - %69 = OpIAdd %uint %67 %68 - %70 = OpIMul %uint %69 %uint_2 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %65 - %73 = OpSelect %uint %72 %67 %uint_0 - %74 = OpSelect %uint %72 %uint_16 %uint_4 - %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %77 = OpAccessChain %_ptr_StorageBuffer_v2int %76 %73 - OpCooperativeMatrixStoreKHR %77 %m %uint_1 %74 NonPrivatePointer - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %82 = OpArrayLength %uint %12 0 - %83 = OpIMul %uint %82 %uint_4 - %84 = OpBitcast %uint %int_0 - %85 = OpIMul %uint %uint_16 %uint_7 - %86 = OpIAdd %uint %84 %85 - %87 = OpIMul %uint %86 %uint_4 - %88 = OpIAdd %uint %87 %uint_8 - %89 = OpULessThanEqual %bool %88 %83 - %90 = OpSelect %uint %89 %84 %uint_0 - %91 = OpSelect %uint %89 %uint_16 %uint_2 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 - OpCooperativeMatrixStoreKHR %93 %m %uint_1 %91 NonPrivatePointer - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %98 = OpArrayLength %uint %18 0 - %99 = OpIMul %uint %98 %uint_4 - %100 = OpBitcast %uint %int_0 - %101 = OpIMul %uint %uint_16 %uint_7 - %102 = OpIAdd %uint %100 %101 - %103 = OpIMul %uint %102 %uint_4 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %uint_16 %uint_2 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_v4uint %108 %106 - OpCooperativeMatrixStoreKHR %109 %m %uint_1 %107 NonPrivatePointer - %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %114 = OpArrayLength %uint %23 0 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %114 - %120 = OpSelect %uint %119 %115 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v2half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_1 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %128 = OpArrayLength %uint %29 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpBitcast %uint %int_0 - %131 = OpIMul %uint %uint_16 %uint_7 - %132 = OpIAdd %uint %130 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %129 - %136 = OpSelect %uint %135 %130 %uint_0 - %137 = OpSelect %uint %135 %uint_16 %uint_4 - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_v3half %138 %136 - OpCooperativeMatrixStoreKHR %139 %m %uint_1 %137 NonPrivatePointer + %65 = OpBitcast %uint %int_0 + %66 = OpIMul %uint %uint_16 %uint_7 + %67 = OpIAdd %uint %65 %66 + %68 = OpIAdd %uint %67 %uint_4 + %70 = OpULessThanEqual %bool %68 %64 + %71 = OpSelect %uint %70 %65 %uint_0 + %72 = OpSelect %uint %70 %uint_16 %uint_4 + %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %74 = OpAccessChain %_ptr_StorageBuffer_v2int %73 %71 + OpCooperativeMatrixStoreKHR %74 %m %uint_1 %72 NonPrivatePointer + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %79 = OpArrayLength %uint %12 0 + %80 = OpBitcast %uint %int_0 + %81 = OpIMul %uint %uint_16 %uint_7 + %82 = OpIAdd %uint %80 %81 + %83 = OpIAdd %uint %82 %uint_2 + %85 = OpULessThanEqual %bool %83 %79 + %86 = OpSelect %uint %85 %80 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_2 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpBitcast %uint %int_0 + %96 = OpIMul %uint %uint_16 %uint_7 + %97 = OpIAdd %uint %95 %96 + %98 = OpIAdd %uint %97 %uint_2 + %99 = OpULessThanEqual %bool %98 %94 + %100 = OpSelect %uint %99 %95 %uint_0 + %101 = OpSelect %uint %99 %uint_16 %uint_2 + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %103 = OpAccessChain %_ptr_StorageBuffer_v4uint %102 %100 + OpCooperativeMatrixStoreKHR %103 %m %uint_1 %101 NonPrivatePointer + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %108 = OpArrayLength %uint %23 0 + %109 = OpBitcast %uint %int_0 + %110 = OpIMul %uint %uint_16 %uint_7 + %111 = OpIAdd %uint %109 %110 + %112 = OpIAdd %uint %111 %uint_8 + %113 = OpULessThanEqual %bool %112 %108 + %114 = OpSelect %uint %113 %109 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_8 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v2half %116 %114 + OpCooperativeMatrixStoreKHR %117 %m %uint_1 %115 NonPrivatePointer + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %122 = OpArrayLength %uint %29 0 + %123 = OpBitcast %uint %int_0 + %124 = OpIMul %uint %uint_16 %uint_7 + %125 = OpIAdd %uint %123 %124 + %126 = OpIAdd %uint %125 %uint_4 + %127 = OpULessThanEqual %bool %126 %122 + %128 = OpSelect %uint %127 %123 %uint_0 + %129 = OpSelect %uint %127 %uint_16 %uint_4 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_v3half %130 %128 + OpCooperativeMatrixStoreKHR %131 %m %uint_1 %129 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl index ca41847..26e5912 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -19,17 +19,17 @@ uint v_3 = 0u; out1.GetDimensions(v_3); uint v_4 = asuint(int(0)); - bool v_5 = ((((v_4 + (16u * 7u)) * 2u) + 8u) <= ((v_3 / 8u) * 2u)); + bool v_5 = (((v_4 + (16u * 7u)) + 4u) <= (v_3 / 8u)); m.Store(out1, (0u + (select(v_5, v_4, 0u) * 4u)), (select(v_5, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out2.GetDimensions(v_6); uint v_7 = asuint(int(0)); - bool v_8 = ((((v_7 + (16u * 7u)) * 4u) + 8u) <= ((v_6 / 16u) * 4u)); + bool v_8 = (((v_7 + (16u * 7u)) + 2u) <= (v_6 / 16u)); m.Store(out2, (0u + (select(v_8, v_7, 0u) * 4u)), (select(v_8, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_9 = 0u; out3.GetDimensions(v_9); uint v_10 = asuint(int(0)); - bool v_11 = ((((v_10 + (16u * 7u)) * 4u) + 8u) <= ((v_9 / 16u) * 4u)); + bool v_11 = (((v_10 + (16u * 7u)) + 2u) <= (v_9 / 16u)); m.Store(out3, (0u + (select(v_11, v_10, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_12 = 0u; out5.GetDimensions(v_12); @@ -39,7 +39,7 @@ uint v_15 = 0u; out6.GetDimensions(v_15); uint v_16 = asuint(int(0)); - bool v_17 = ((((v_16 + (16u * 7u)) * 2u) + 8u) <= ((v_15 / 8u) * 2u)); + bool v_17 = (((v_16 + (16u * 7u)) + 4u) <= (v_15 / 8u)); m.Store(out6, (0u + (select(v_17, v_16, 0u) * 4u)), (select(v_17, 16u, 4u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_row_major.wgsl.expected.spvasm index b8a94ff..97e0985 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_u32_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 142 +; Bound: 134 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -106,10 +106,10 @@ %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int - %uint_2 = OpConstant %uint 2 %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int %_ptr_StorageBuffer__runtimearr_v3float = OpTypePointer StorageBuffer %_runtimearr_v3float + %uint_2 = OpConstant %uint 2 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint @@ -133,71 +133,63 @@ OpCooperativeMatrixStoreKHR %59 %m %uint_0 %57 NonPrivatePointer %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 %64 = OpArrayLength %uint %6 0 - %65 = OpIMul %uint %64 %uint_2 - %67 = OpBitcast %uint %int_0 - %68 = OpIMul %uint %uint_16 %uint_7 - %69 = OpIAdd %uint %67 %68 - %70 = OpIMul %uint %69 %uint_2 - %71 = OpIAdd %uint %70 %uint_8 - %72 = OpULessThanEqual %bool %71 %65 - %73 = OpSelect %uint %72 %67 %uint_0 - %74 = OpSelect %uint %72 %uint_16 %uint_4 - %76 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %77 = OpAccessChain %_ptr_StorageBuffer_v2int %76 %73 - OpCooperativeMatrixStoreKHR %77 %m %uint_0 %74 NonPrivatePointer - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %82 = OpArrayLength %uint %12 0 - %83 = OpIMul %uint %82 %uint_4 - %84 = OpBitcast %uint %int_0 - %85 = OpIMul %uint %uint_16 %uint_7 - %86 = OpIAdd %uint %84 %85 - %87 = OpIMul %uint %86 %uint_4 - %88 = OpIAdd %uint %87 %uint_8 - %89 = OpULessThanEqual %bool %88 %83 - %90 = OpSelect %uint %89 %84 %uint_0 - %91 = OpSelect %uint %89 %uint_16 %uint_2 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %93 = OpAccessChain %_ptr_StorageBuffer_v3float %92 %90 - OpCooperativeMatrixStoreKHR %93 %m %uint_0 %91 NonPrivatePointer - %96 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %98 = OpArrayLength %uint %18 0 - %99 = OpIMul %uint %98 %uint_4 - %100 = OpBitcast %uint %int_0 - %101 = OpIMul %uint %uint_16 %uint_7 - %102 = OpIAdd %uint %100 %101 - %103 = OpIMul %uint %102 %uint_4 - %104 = OpIAdd %uint %103 %uint_8 - %105 = OpULessThanEqual %bool %104 %99 - %106 = OpSelect %uint %105 %100 %uint_0 - %107 = OpSelect %uint %105 %uint_16 %uint_2 - %108 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %109 = OpAccessChain %_ptr_StorageBuffer_v4uint %108 %106 - OpCooperativeMatrixStoreKHR %109 %m %uint_0 %107 NonPrivatePointer - %112 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %114 = OpArrayLength %uint %23 0 - %115 = OpBitcast %uint %int_0 - %116 = OpIMul %uint %uint_16 %uint_7 - %117 = OpIAdd %uint %115 %116 - %118 = OpIAdd %uint %117 %uint_8 - %119 = OpULessThanEqual %bool %118 %114 - %120 = OpSelect %uint %119 %115 %uint_0 - %121 = OpSelect %uint %119 %uint_16 %uint_8 - %122 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 - %123 = OpAccessChain %_ptr_StorageBuffer_v2half %122 %120 - OpCooperativeMatrixStoreKHR %123 %m %uint_0 %121 NonPrivatePointer - %126 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %128 = OpArrayLength %uint %29 0 - %129 = OpIMul %uint %128 %uint_2 - %130 = OpBitcast %uint %int_0 - %131 = OpIMul %uint %uint_16 %uint_7 - %132 = OpIAdd %uint %130 %131 - %133 = OpIMul %uint %132 %uint_2 - %134 = OpIAdd %uint %133 %uint_8 - %135 = OpULessThanEqual %bool %134 %129 - %136 = OpSelect %uint %135 %130 %uint_0 - %137 = OpSelect %uint %135 %uint_16 %uint_4 - %138 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 - %139 = OpAccessChain %_ptr_StorageBuffer_v3half %138 %136 - OpCooperativeMatrixStoreKHR %139 %m %uint_0 %137 NonPrivatePointer + %65 = OpBitcast %uint %int_0 + %66 = OpIMul %uint %uint_16 %uint_7 + %67 = OpIAdd %uint %65 %66 + %68 = OpIAdd %uint %67 %uint_4 + %70 = OpULessThanEqual %bool %68 %64 + %71 = OpSelect %uint %70 %65 %uint_0 + %72 = OpSelect %uint %70 %uint_16 %uint_4 + %73 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %74 = OpAccessChain %_ptr_StorageBuffer_v2int %73 %71 + OpCooperativeMatrixStoreKHR %74 %m %uint_0 %72 NonPrivatePointer + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %79 = OpArrayLength %uint %12 0 + %80 = OpBitcast %uint %int_0 + %81 = OpIMul %uint %uint_16 %uint_7 + %82 = OpIAdd %uint %80 %81 + %83 = OpIAdd %uint %82 %uint_2 + %85 = OpULessThanEqual %bool %83 %79 + %86 = OpSelect %uint %85 %80 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_2 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_0 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpBitcast %uint %int_0 + %96 = OpIMul %uint %uint_16 %uint_7 + %97 = OpIAdd %uint %95 %96 + %98 = OpIAdd %uint %97 %uint_2 + %99 = OpULessThanEqual %bool %98 %94 + %100 = OpSelect %uint %99 %95 %uint_0 + %101 = OpSelect %uint %99 %uint_16 %uint_2 + %102 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %103 = OpAccessChain %_ptr_StorageBuffer_v4uint %102 %100 + OpCooperativeMatrixStoreKHR %103 %m %uint_0 %101 NonPrivatePointer + %106 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %108 = OpArrayLength %uint %23 0 + %109 = OpBitcast %uint %int_0 + %110 = OpIMul %uint %uint_16 %uint_7 + %111 = OpIAdd %uint %109 %110 + %112 = OpIAdd %uint %111 %uint_8 + %113 = OpULessThanEqual %bool %112 %108 + %114 = OpSelect %uint %113 %109 %uint_0 + %115 = OpSelect %uint %113 %uint_16 %uint_8 + %116 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %23 %uint_0 + %117 = OpAccessChain %_ptr_StorageBuffer_v2half %116 %114 + OpCooperativeMatrixStoreKHR %117 %m %uint_0 %115 NonPrivatePointer + %120 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %122 = OpArrayLength %uint %29 0 + %123 = OpBitcast %uint %int_0 + %124 = OpIMul %uint %uint_16 %uint_7 + %125 = OpIAdd %uint %123 %124 + %126 = OpIAdd %uint %125 %uint_4 + %127 = OpULessThanEqual %bool %126 %122 + %128 = OpSelect %uint %127 %123 %uint_0 + %129 = OpSelect %uint %127 %uint_16 %uint_4 + %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %29 %uint_0 + %131 = OpAccessChain %_ptr_StorageBuffer_v3half %130 %128 + OpCooperativeMatrixStoreKHR %131 %m %uint_0 %129 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl index 81bb373..14c9145 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_col_major.wgsl.expected.dxc.hlsl
@@ -14,31 +14,31 @@ Matrix_right_u8_8x8 m = Matrix_right_u8_8x8::Splat(0u); uint v = 0u; out0.GetDimensions(v); - bool v_1 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v / 4u) * 4u)); + bool v_1 = (((0u + (16u * 7u)) + 2u) <= (v / 4u)); m.Store(out0, (0u + (select(v_1, 0u, 0u) * 4u)), (select(v_1, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_2 / 8u) * 8u)); + bool v_3 = (((0u + (16u * 7u)) + 1u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 4u)), (select(v_3, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_4 / 16u) * 16u)); + bool v_5 = (((0u + (16u * 7u)) + 1u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 4u)), (select(v_5, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_6 / 16u) * 16u)); + bool v_7 = (((0u + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 4u)), (select(v_7, 16u, 1u) * 4u), MatrixLayout::ColMajor); uint v_8 = 0u; out4.GetDimensions(v_8); - bool v_9 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 2u) * 2u)); + bool v_9 = (((0u + (16u * 7u)) + 4u) <= (v_8 / 2u)); m.Store(out4, (0u + (select(v_9, 0u, 0u) * 4u)), (select(v_9, 16u, 4u) * 4u), MatrixLayout::ColMajor); uint v_10 = 0u; out5.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_10 / 4u) * 4u)); + bool v_11 = (((0u + (16u * 7u)) + 2u) <= (v_10 / 4u)); m.Store(out5, (0u + (select(v_11, 0u, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::ColMajor); uint v_12 = 0u; out6.GetDimensions(v_12); - bool v_13 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_12 / 8u) * 8u)); + bool v_13 = (((0u + (16u * 7u)) + 1u) <= (v_12 / 8u)); m.Store(out6, (0u + (select(v_13, 0u, 0u) * 4u)), (select(v_13, 16u, 1u) * 4u), MatrixLayout::ColMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_col_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_col_major.wgsl.expected.spvasm index e6a1279..f893cdb 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_col_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_col_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 159 +; Bound: 145 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -113,11 +113,10 @@ %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -126,6 +125,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -135,94 +135,80 @@ %41 = OpLabel %48 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %51 = OpArrayLength %uint %1 0 - %52 = OpIMul %uint %51 %uint_4 - %54 = OpIMul %uint %uint_16 %uint_7 - %57 = OpIAdd %uint %uint_0 %54 - %58 = OpIMul %uint %57 %uint_4 - %59 = OpIAdd %uint %58 %uint_8 - %60 = OpULessThanEqual %bool %59 %52 - %62 = OpSelect %uint %60 %uint_0 %uint_0 - %63 = OpSelect %uint %60 %uint_16 %uint_2 - %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %66 = OpAccessChain %_ptr_StorageBuffer_uint %65 %62 - OpCooperativeMatrixStoreKHR %66 %m %uint_1 %63 NonPrivatePointer - %69 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %71 = OpArrayLength %uint %6 0 - %72 = OpIMul %uint %71 %uint_8 - %73 = OpIMul %uint %uint_16 %uint_7 - %74 = OpIAdd %uint %uint_0 %73 - %75 = OpIMul %uint %74 %uint_8 - %76 = OpIAdd %uint %75 %uint_8 - %77 = OpULessThanEqual %bool %76 %72 - %78 = OpSelect %uint %77 %uint_0 %uint_0 - %79 = OpSelect %uint %77 %uint_16 %uint_1 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_v2int %80 %78 - OpCooperativeMatrixStoreKHR %81 %m %uint_1 %79 NonPrivatePointer - %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %86 = OpArrayLength %uint %12 0 - %87 = OpIMul %uint %86 %uint_16 - %88 = OpIMul %uint %uint_16 %uint_7 - %89 = OpIAdd %uint %uint_0 %88 - %90 = OpIMul %uint %89 %uint_16 - %91 = OpIAdd %uint %90 %uint_16 - %92 = OpULessThanEqual %bool %91 %87 - %93 = OpSelect %uint %92 %uint_0 %uint_0 - %94 = OpSelect %uint %92 %uint_16 %uint_1 - %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %96 = OpAccessChain %_ptr_StorageBuffer_v3float %95 %93 - OpCooperativeMatrixStoreKHR %96 %m %uint_1 %94 NonPrivatePointer - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %101 = OpArrayLength %uint %18 0 - %102 = OpIMul %uint %101 %uint_16 - %103 = OpIMul %uint %uint_16 %uint_7 - %104 = OpIAdd %uint %uint_0 %103 - %105 = OpIMul %uint %104 %uint_16 - %106 = OpIAdd %uint %105 %uint_16 - %107 = OpULessThanEqual %bool %106 %102 - %108 = OpSelect %uint %107 %uint_0 %uint_0 - %109 = OpSelect %uint %107 %uint_16 %uint_1 - %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %111 = OpAccessChain %_ptr_StorageBuffer_v4uint %110 %108 - OpCooperativeMatrixStoreKHR %111 %m %uint_1 %109 NonPrivatePointer - %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %116 = OpArrayLength %uint %23 0 - %117 = OpIMul %uint %116 %uint_2 - %118 = OpIMul %uint %uint_16 %uint_7 - %119 = OpIAdd %uint %uint_0 %118 - %120 = OpIMul %uint %119 %uint_2 - %121 = OpIAdd %uint %120 %uint_8 - %122 = OpULessThanEqual %bool %121 %117 - %123 = OpSelect %uint %122 %uint_0 %uint_0 - %124 = OpSelect %uint %122 %uint_16 %uint_4 - %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %126 = OpAccessChain %_ptr_StorageBuffer_half %125 %123 - OpCooperativeMatrixStoreKHR %126 %m %uint_1 %124 NonPrivatePointer - %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %131 = OpArrayLength %uint %28 0 - %132 = OpIMul %uint %131 %uint_4 - %133 = OpIMul %uint %uint_16 %uint_7 - %134 = OpIAdd %uint %uint_0 %133 - %135 = OpIMul %uint %134 %uint_4 - %136 = OpIAdd %uint %135 %uint_8 - %137 = OpULessThanEqual %bool %136 %132 - %138 = OpSelect %uint %137 %uint_0 %uint_0 - %139 = OpSelect %uint %137 %uint_16 %uint_2 - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %141 = OpAccessChain %_ptr_StorageBuffer_v2half %140 %138 - OpCooperativeMatrixStoreKHR %141 %m %uint_1 %139 NonPrivatePointer - %144 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %146 = OpArrayLength %uint %33 0 - %147 = OpIMul %uint %146 %uint_8 - %148 = OpIMul %uint %uint_16 %uint_7 - %149 = OpIAdd %uint %uint_0 %148 - %150 = OpIMul %uint %149 %uint_8 - %151 = OpIAdd %uint %150 %uint_8 - %152 = OpULessThanEqual %bool %151 %147 - %153 = OpSelect %uint %152 %uint_0 %uint_0 - %154 = OpSelect %uint %152 %uint_16 %uint_1 - %155 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %156 = OpAccessChain %_ptr_StorageBuffer_v3half %155 %153 - OpCooperativeMatrixStoreKHR %156 %m %uint_1 %154 NonPrivatePointer + %52 = OpIMul %uint %uint_16 %uint_7 + %55 = OpIAdd %uint %uint_0 %52 + %56 = OpIAdd %uint %55 %uint_2 + %58 = OpULessThanEqual %bool %56 %51 + %60 = OpSelect %uint %58 %uint_0 %uint_0 + %61 = OpSelect %uint %58 %uint_16 %uint_2 + %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %63 = OpAccessChain %_ptr_StorageBuffer_uint %62 %60 + OpCooperativeMatrixStoreKHR %63 %m %uint_1 %61 NonPrivatePointer + %66 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %68 = OpArrayLength %uint %6 0 + %69 = OpIMul %uint %uint_16 %uint_7 + %70 = OpIAdd %uint %uint_0 %69 + %71 = OpIAdd %uint %70 %uint_1 + %72 = OpULessThanEqual %bool %71 %68 + %73 = OpSelect %uint %72 %uint_0 %uint_0 + %74 = OpSelect %uint %72 %uint_16 %uint_1 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %73 + OpCooperativeMatrixStoreKHR %76 %m %uint_1 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %81 = OpArrayLength %uint %12 0 + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_1 + %85 = OpULessThanEqual %bool %84 %81 + %86 = OpSelect %uint %85 %uint_0 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_1 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_1 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %uint_0 %95 + %97 = OpIAdd %uint %96 %uint_1 + %98 = OpULessThanEqual %bool %97 %94 + %99 = OpSelect %uint %98 %uint_0 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_1 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_1 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpIMul %uint %uint_16 %uint_7 + %109 = OpIAdd %uint %uint_0 %108 + %110 = OpIAdd %uint %109 %uint_4 + %112 = OpULessThanEqual %bool %110 %107 + %113 = OpSelect %uint %112 %uint_0 %uint_0 + %114 = OpSelect %uint %112 %uint_16 %uint_4 + %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_half %115 %113 + OpCooperativeMatrixStoreKHR %116 %m %uint_1 %114 NonPrivatePointer + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %121 = OpArrayLength %uint %28 0 + %122 = OpIMul %uint %uint_16 %uint_7 + %123 = OpIAdd %uint %uint_0 %122 + %124 = OpIAdd %uint %123 %uint_2 + %125 = OpULessThanEqual %bool %124 %121 + %126 = OpSelect %uint %125 %uint_0 %uint_0 + %127 = OpSelect %uint %125 %uint_16 %uint_2 + %128 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %129 = OpAccessChain %_ptr_StorageBuffer_v2half %128 %126 + OpCooperativeMatrixStoreKHR %129 %m %uint_1 %127 NonPrivatePointer + %132 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %134 = OpArrayLength %uint %33 0 + %135 = OpIMul %uint %uint_16 %uint_7 + %136 = OpIAdd %uint %uint_0 %135 + %137 = OpIAdd %uint %136 %uint_1 + %138 = OpULessThanEqual %bool %137 %134 + %139 = OpSelect %uint %138 %uint_0 %uint_0 + %140 = OpSelect %uint %138 %uint_16 %uint_1 + %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %142 = OpAccessChain %_ptr_StorageBuffer_v3half %141 %139 + OpCooperativeMatrixStoreKHR %142 %m %uint_1 %140 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl b/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl index a1de6f6..4031953 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_row_major.wgsl.expected.dxc.hlsl
@@ -14,31 +14,31 @@ Matrix_right_u8_8x8 m = Matrix_right_u8_8x8::Splat(0u); uint v = 0u; out0.GetDimensions(v); - bool v_1 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v / 4u) * 4u)); + bool v_1 = (((0u + (16u * 7u)) + 2u) <= (v / 4u)); m.Store(out0, (0u + (select(v_1, 0u, 0u) * 4u)), (select(v_1, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_2 = 0u; out1.GetDimensions(v_2); - bool v_3 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_2 / 8u) * 8u)); + bool v_3 = (((0u + (16u * 7u)) + 1u) <= (v_2 / 8u)); m.Store(out1, (0u + (select(v_3, 0u, 0u) * 4u)), (select(v_3, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_4 = 0u; out2.GetDimensions(v_4); - bool v_5 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_4 / 16u) * 16u)); + bool v_5 = (((0u + (16u * 7u)) + 1u) <= (v_4 / 16u)); m.Store(out2, (0u + (select(v_5, 0u, 0u) * 4u)), (select(v_5, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_6 = 0u; out3.GetDimensions(v_6); - bool v_7 = ((((0u + (16u * 7u)) * 16u) + 16u) <= ((v_6 / 16u) * 16u)); + bool v_7 = (((0u + (16u * 7u)) + 1u) <= (v_6 / 16u)); m.Store(out3, (0u + (select(v_7, 0u, 0u) * 4u)), (select(v_7, 16u, 1u) * 4u), MatrixLayout::RowMajor); uint v_8 = 0u; out4.GetDimensions(v_8); - bool v_9 = ((((0u + (16u * 7u)) * 2u) + 8u) <= ((v_8 / 2u) * 2u)); + bool v_9 = (((0u + (16u * 7u)) + 4u) <= (v_8 / 2u)); m.Store(out4, (0u + (select(v_9, 0u, 0u) * 4u)), (select(v_9, 16u, 4u) * 4u), MatrixLayout::RowMajor); uint v_10 = 0u; out5.GetDimensions(v_10); - bool v_11 = ((((0u + (16u * 7u)) * 4u) + 8u) <= ((v_10 / 4u) * 4u)); + bool v_11 = (((0u + (16u * 7u)) + 2u) <= (v_10 / 4u)); m.Store(out5, (0u + (select(v_11, 0u, 0u) * 4u)), (select(v_11, 16u, 2u) * 4u), MatrixLayout::RowMajor); uint v_12 = 0u; out6.GetDimensions(v_12); - bool v_13 = ((((0u + (16u * 7u)) * 8u) + 8u) <= ((v_12 / 8u) * 8u)); + bool v_13 = (((0u + (16u * 7u)) + 1u) <= (v_12 / 8u)); m.Store(out6, (0u + (select(v_13, 0u, 0u) * 4u)), (select(v_13, 16u, 1u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_row_major.wgsl.expected.spvasm b/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_row_major.wgsl.expected.spvasm index 0362231..9d8abce 100644 --- a/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_row_major.wgsl.expected.spvasm +++ b/test/tint/builtins/subgroupMatrixStore/storage_right_u8_runtime_array_row_major.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 159 +; Bound: 145 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -113,11 +113,10 @@ %m = OpConstantNull %43 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %uint_0 = OpConstant %uint 0 - %uint_4 = OpConstant %uint 4 %uint_16 = OpConstant %uint 16 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %_ptr_StorageBuffer__runtimearr_v2int = OpTypePointer StorageBuffer %_runtimearr_v2int %_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int @@ -126,6 +125,7 @@ %_ptr_StorageBuffer__runtimearr_v4uint = OpTypePointer StorageBuffer %_runtimearr_v4uint %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint %_ptr_StorageBuffer__runtimearr_half = OpTypePointer StorageBuffer %_runtimearr_half + %uint_4 = OpConstant %uint 4 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half %_ptr_StorageBuffer__runtimearr_v2half = OpTypePointer StorageBuffer %_runtimearr_v2half %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half @@ -135,94 +135,80 @@ %41 = OpLabel %48 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 %51 = OpArrayLength %uint %1 0 - %52 = OpIMul %uint %51 %uint_4 - %54 = OpIMul %uint %uint_16 %uint_7 - %57 = OpIAdd %uint %uint_0 %54 - %58 = OpIMul %uint %57 %uint_4 - %59 = OpIAdd %uint %58 %uint_8 - %60 = OpULessThanEqual %bool %59 %52 - %62 = OpSelect %uint %60 %uint_0 %uint_0 - %63 = OpSelect %uint %60 %uint_16 %uint_2 - %65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 - %66 = OpAccessChain %_ptr_StorageBuffer_uint %65 %62 - OpCooperativeMatrixStoreKHR %66 %m %uint_0 %63 NonPrivatePointer - %69 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %71 = OpArrayLength %uint %6 0 - %72 = OpIMul %uint %71 %uint_8 - %73 = OpIMul %uint %uint_16 %uint_7 - %74 = OpIAdd %uint %uint_0 %73 - %75 = OpIMul %uint %74 %uint_8 - %76 = OpIAdd %uint %75 %uint_8 - %77 = OpULessThanEqual %bool %76 %72 - %78 = OpSelect %uint %77 %uint_0 %uint_0 - %79 = OpSelect %uint %77 %uint_16 %uint_1 - %80 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 - %81 = OpAccessChain %_ptr_StorageBuffer_v2int %80 %78 - OpCooperativeMatrixStoreKHR %81 %m %uint_0 %79 NonPrivatePointer - %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %86 = OpArrayLength %uint %12 0 - %87 = OpIMul %uint %86 %uint_16 - %88 = OpIMul %uint %uint_16 %uint_7 - %89 = OpIAdd %uint %uint_0 %88 - %90 = OpIMul %uint %89 %uint_16 - %91 = OpIAdd %uint %90 %uint_16 - %92 = OpULessThanEqual %bool %91 %87 - %93 = OpSelect %uint %92 %uint_0 %uint_0 - %94 = OpSelect %uint %92 %uint_16 %uint_1 - %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 - %96 = OpAccessChain %_ptr_StorageBuffer_v3float %95 %93 - OpCooperativeMatrixStoreKHR %96 %m %uint_0 %94 NonPrivatePointer - %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %101 = OpArrayLength %uint %18 0 - %102 = OpIMul %uint %101 %uint_16 - %103 = OpIMul %uint %uint_16 %uint_7 - %104 = OpIAdd %uint %uint_0 %103 - %105 = OpIMul %uint %104 %uint_16 - %106 = OpIAdd %uint %105 %uint_16 - %107 = OpULessThanEqual %bool %106 %102 - %108 = OpSelect %uint %107 %uint_0 %uint_0 - %109 = OpSelect %uint %107 %uint_16 %uint_1 - %110 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 - %111 = OpAccessChain %_ptr_StorageBuffer_v4uint %110 %108 - OpCooperativeMatrixStoreKHR %111 %m %uint_0 %109 NonPrivatePointer - %114 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %116 = OpArrayLength %uint %23 0 - %117 = OpIMul %uint %116 %uint_2 - %118 = OpIMul %uint %uint_16 %uint_7 - %119 = OpIAdd %uint %uint_0 %118 - %120 = OpIMul %uint %119 %uint_2 - %121 = OpIAdd %uint %120 %uint_8 - %122 = OpULessThanEqual %bool %121 %117 - %123 = OpSelect %uint %122 %uint_0 %uint_0 - %124 = OpSelect %uint %122 %uint_16 %uint_4 - %125 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 - %126 = OpAccessChain %_ptr_StorageBuffer_half %125 %123 - OpCooperativeMatrixStoreKHR %126 %m %uint_0 %124 NonPrivatePointer - %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %131 = OpArrayLength %uint %28 0 - %132 = OpIMul %uint %131 %uint_4 - %133 = OpIMul %uint %uint_16 %uint_7 - %134 = OpIAdd %uint %uint_0 %133 - %135 = OpIMul %uint %134 %uint_4 - %136 = OpIAdd %uint %135 %uint_8 - %137 = OpULessThanEqual %bool %136 %132 - %138 = OpSelect %uint %137 %uint_0 %uint_0 - %139 = OpSelect %uint %137 %uint_16 %uint_2 - %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 - %141 = OpAccessChain %_ptr_StorageBuffer_v2half %140 %138 - OpCooperativeMatrixStoreKHR %141 %m %uint_0 %139 NonPrivatePointer - %144 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %146 = OpArrayLength %uint %33 0 - %147 = OpIMul %uint %146 %uint_8 - %148 = OpIMul %uint %uint_16 %uint_7 - %149 = OpIAdd %uint %uint_0 %148 - %150 = OpIMul %uint %149 %uint_8 - %151 = OpIAdd %uint %150 %uint_8 - %152 = OpULessThanEqual %bool %151 %147 - %153 = OpSelect %uint %152 %uint_0 %uint_0 - %154 = OpSelect %uint %152 %uint_16 %uint_1 - %155 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 - %156 = OpAccessChain %_ptr_StorageBuffer_v3half %155 %153 - OpCooperativeMatrixStoreKHR %156 %m %uint_0 %154 NonPrivatePointer + %52 = OpIMul %uint %uint_16 %uint_7 + %55 = OpIAdd %uint %uint_0 %52 + %56 = OpIAdd %uint %55 %uint_2 + %58 = OpULessThanEqual %bool %56 %51 + %60 = OpSelect %uint %58 %uint_0 %uint_0 + %61 = OpSelect %uint %58 %uint_16 %uint_2 + %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 + %63 = OpAccessChain %_ptr_StorageBuffer_uint %62 %60 + OpCooperativeMatrixStoreKHR %63 %m %uint_0 %61 NonPrivatePointer + %66 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %68 = OpArrayLength %uint %6 0 + %69 = OpIMul %uint %uint_16 %uint_7 + %70 = OpIAdd %uint %uint_0 %69 + %71 = OpIAdd %uint %70 %uint_1 + %72 = OpULessThanEqual %bool %71 %68 + %73 = OpSelect %uint %72 %uint_0 %uint_0 + %74 = OpSelect %uint %72 %uint_16 %uint_1 + %75 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2int %6 %uint_0 + %76 = OpAccessChain %_ptr_StorageBuffer_v2int %75 %73 + OpCooperativeMatrixStoreKHR %76 %m %uint_0 %74 NonPrivatePointer + %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %81 = OpArrayLength %uint %12 0 + %82 = OpIMul %uint %uint_16 %uint_7 + %83 = OpIAdd %uint %uint_0 %82 + %84 = OpIAdd %uint %83 %uint_1 + %85 = OpULessThanEqual %bool %84 %81 + %86 = OpSelect %uint %85 %uint_0 %uint_0 + %87 = OpSelect %uint %85 %uint_16 %uint_1 + %88 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3float %12 %uint_0 + %89 = OpAccessChain %_ptr_StorageBuffer_v3float %88 %86 + OpCooperativeMatrixStoreKHR %89 %m %uint_0 %87 NonPrivatePointer + %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %94 = OpArrayLength %uint %18 0 + %95 = OpIMul %uint %uint_16 %uint_7 + %96 = OpIAdd %uint %uint_0 %95 + %97 = OpIAdd %uint %96 %uint_1 + %98 = OpULessThanEqual %bool %97 %94 + %99 = OpSelect %uint %98 %uint_0 %uint_0 + %100 = OpSelect %uint %98 %uint_16 %uint_1 + %101 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v4uint %18 %uint_0 + %102 = OpAccessChain %_ptr_StorageBuffer_v4uint %101 %99 + OpCooperativeMatrixStoreKHR %102 %m %uint_0 %100 NonPrivatePointer + %105 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %107 = OpArrayLength %uint %23 0 + %108 = OpIMul %uint %uint_16 %uint_7 + %109 = OpIAdd %uint %uint_0 %108 + %110 = OpIAdd %uint %109 %uint_4 + %112 = OpULessThanEqual %bool %110 %107 + %113 = OpSelect %uint %112 %uint_0 %uint_0 + %114 = OpSelect %uint %112 %uint_16 %uint_4 + %115 = OpAccessChain %_ptr_StorageBuffer__runtimearr_half %23 %uint_0 + %116 = OpAccessChain %_ptr_StorageBuffer_half %115 %113 + OpCooperativeMatrixStoreKHR %116 %m %uint_0 %114 NonPrivatePointer + %119 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %121 = OpArrayLength %uint %28 0 + %122 = OpIMul %uint %uint_16 %uint_7 + %123 = OpIAdd %uint %uint_0 %122 + %124 = OpIAdd %uint %123 %uint_2 + %125 = OpULessThanEqual %bool %124 %121 + %126 = OpSelect %uint %125 %uint_0 %uint_0 + %127 = OpSelect %uint %125 %uint_16 %uint_2 + %128 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v2half %28 %uint_0 + %129 = OpAccessChain %_ptr_StorageBuffer_v2half %128 %126 + OpCooperativeMatrixStoreKHR %129 %m %uint_0 %127 NonPrivatePointer + %132 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %134 = OpArrayLength %uint %33 0 + %135 = OpIMul %uint %uint_16 %uint_7 + %136 = OpIAdd %uint %uint_0 %135 + %137 = OpIAdd %uint %136 %uint_1 + %138 = OpULessThanEqual %bool %137 %134 + %139 = OpSelect %uint %138 %uint_0 %uint_0 + %140 = OpSelect %uint %138 %uint_16 %uint_1 + %141 = OpAccessChain %_ptr_StorageBuffer__runtimearr_v3half %33 %uint_0 + %142 = OpAccessChain %_ptr_StorageBuffer_v3half %141 %139 + OpCooperativeMatrixStoreKHR %142 %m %uint_0 %140 NonPrivatePointer OpReturn OpFunctionEnd
diff --git a/test/tint/extensions/subgroup_matrix/construct_8bit.wgsl.expected.dxc.hlsl b/test/tint/extensions/subgroup_matrix/construct_8bit.wgsl.expected.dxc.hlsl index 2f95453..41496a4 100644 --- a/test/tint/extensions/subgroup_matrix/construct_8bit.wgsl.expected.dxc.hlsl +++ b/test/tint/extensions/subgroup_matrix/construct_8bit.wgsl.expected.dxc.hlsl
@@ -11,25 +11,25 @@ ibuffer.GetDimensions(v); uint v_1 = asuint(int(0)); uint v_2 = asuint(int(64)); - bool v_3 = ((((v_1 + (v_2 * 7u)) * 4u) + 8u) <= ((v / 4u) * 4u)); + bool v_3 = (((v_1 + (v_2 * 7u)) + 2u) <= (v / 4u)); Matrix_left_i8_8x8::Splat(int(0)).Store(ibuffer, (0u + (select(v_3, v_1, 0u) * 4u)), (select(v_3, v_2, 2u) * 4u), MatrixLayout::RowMajor); uint v_4 = 0u; ubuffer.GetDimensions(v_4); uint v_5 = asuint(int(0)); uint v_6 = asuint(int(64)); - bool v_7 = ((((v_5 + (v_6 * 7u)) * 4u) + 8u) <= ((v_4 / 4u) * 4u)); + bool v_7 = (((v_5 + (v_6 * 7u)) + 2u) <= (v_4 / 4u)); Matrix_right_u8_8x8::Splat(0u).Store(ubuffer, (0u + (select(v_7, v_5, 0u) * 4u)), (select(v_7, v_6, 2u) * 4u), MatrixLayout::RowMajor); uint v_8 = 0u; ibuffer.GetDimensions(v_8); uint v_9 = asuint(int(0)); uint v_10 = asuint(int(64)); - bool v_11 = ((((v_9 + (v_10 * 7u)) * 4u) + 8u) <= ((v_8 / 4u) * 4u)); + bool v_11 = (((v_9 + (v_10 * 7u)) + 2u) <= (v_8 / 4u)); Matrix_left_i8_8x8::Splat(int(-42)).Store(ibuffer, (0u + (select(v_11, v_9, 0u) * 4u)), (select(v_11, v_10, 2u) * 4u), MatrixLayout::RowMajor); uint v_12 = 0u; ubuffer.GetDimensions(v_12); uint v_13 = asuint(int(0)); uint v_14 = asuint(int(64)); - bool v_15 = ((((v_13 + (v_14 * 7u)) * 4u) + 8u) <= ((v_12 / 4u) * 4u)); + bool v_15 = (((v_13 + (v_14 * 7u)) + 2u) <= (v_12 / 4u)); Matrix_right_u8_8x8::Splat(42u).Store(ubuffer, (0u + (select(v_15, v_13, 0u) * 4u)), (select(v_15, v_14, 2u) * 4u), MatrixLayout::RowMajor); }
diff --git a/test/tint/extensions/subgroup_matrix/construct_8bit.wgsl.expected.spvasm b/test/tint/extensions/subgroup_matrix/construct_8bit.wgsl.expected.spvasm index a66e0d1..003ee3c 100644 --- a/test/tint/extensions/subgroup_matrix/construct_8bit.wgsl.expected.spvasm +++ b/test/tint/extensions/subgroup_matrix/construct_8bit.wgsl.expected.spvasm
@@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 1 -; Bound: 107 +; Bound: 98 ; Schema: 0 OpCapability Shader OpCapability VulkanMemoryModel @@ -10,7 +10,7 @@ OpCapability Int8 OpExtension "SPV_KHR_vulkan_memory_model" OpExtension "SPV_KHR_cooperative_matrix" - %66 = OpExtInstImport "GLSL.std.450" + %61 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical Vulkan OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 64 1 1 @@ -48,17 +48,16 @@ %16 = OpTypeCooperativeMatrixKHR %char %uint_3 %uint_8 %uint_8 %uint_0 %15 = OpConstantNull %16 %_ptr_StorageBuffer__runtimearr_int = OpTypePointer StorageBuffer %_runtimearr_int - %uint_4 = OpConstant %uint 4 %int_0 = OpConstant %int 0 %int_64 = OpConstant %int 64 %uint_7 = OpConstant %uint 7 - %bool = OpTypeBool %uint_2 = OpConstant %uint 2 + %bool = OpTypeBool %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int %uchar = OpTypeInt 8 0 %uint_1 = OpConstant %uint 1 - %45 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_1 - %44 = OpConstantNull %45 + %42 = OpTypeCooperativeMatrixKHR %uchar %uint_3 %uint_8 %uint_8 %uint_1 + %41 = OpConstantNull %42 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint %int_n42 = OpConstant %int -42 @@ -70,69 +69,61 @@ %14 = OpLabel %21 = OpAccessChain %_ptr_StorageBuffer__runtimearr_int %1 %uint_0 %23 = OpArrayLength %uint %1 0 - %24 = OpIMul %uint %23 %uint_4 - %26 = OpBitcast %uint %int_0 - %28 = OpBitcast %uint %int_64 - %30 = OpIMul %uint %28 %uint_7 - %32 = OpIAdd %uint %26 %30 - %33 = OpIMul %uint %32 %uint_4 - %34 = OpIAdd %uint %33 %uint_8 - %35 = OpULessThanEqual %bool %34 %24 - %37 = OpSelect %uint %35 %26 %uint_0 - %38 = OpSelect %uint %35 %28 %uint_2 - %40 = OpAccessChain %_ptr_StorageBuffer__runtimearr_int %1 %uint_0 - %41 = OpAccessChain %_ptr_StorageBuffer_int %40 %37 - OpCooperativeMatrixStoreKHR %41 %15 %uint_0 %38 NonPrivatePointer - %48 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %6 %uint_0 - %50 = OpArrayLength %uint %6 0 - %51 = OpIMul %uint %50 %uint_4 - %52 = OpBitcast %uint %int_0 - %53 = OpBitcast %uint %int_64 - %54 = OpIMul %uint %53 %uint_7 - %55 = OpIAdd %uint %52 %54 - %56 = OpIMul %uint %55 %uint_4 - %57 = OpIAdd %uint %56 %uint_8 - %58 = OpULessThanEqual %bool %57 %51 - %59 = OpSelect %uint %58 %52 %uint_0 - %60 = OpSelect %uint %58 %53 %uint_2 - %61 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %6 %uint_0 - %62 = OpAccessChain %_ptr_StorageBuffer_uint %61 %59 - OpCooperativeMatrixStoreKHR %62 %44 %uint_0 %60 NonPrivatePointer - %65 = OpExtInst %int %66 SClamp %int_n42 %int_n128 %int_127 - %70 = OpSConvert %char %65 - %71 = OpCompositeConstruct %16 %70 - %72 = OpAccessChain %_ptr_StorageBuffer__runtimearr_int %1 %uint_0 - %73 = OpArrayLength %uint %1 0 - %74 = OpIMul %uint %73 %uint_4 - %75 = OpBitcast %uint %int_0 - %76 = OpBitcast %uint %int_64 - %77 = OpIMul %uint %76 %uint_7 - %78 = OpIAdd %uint %75 %77 - %79 = OpIMul %uint %78 %uint_4 - %80 = OpIAdd %uint %79 %uint_8 - %81 = OpULessThanEqual %bool %80 %74 - %82 = OpSelect %uint %81 %75 %uint_0 - %83 = OpSelect %uint %81 %76 %uint_2 - %84 = OpAccessChain %_ptr_StorageBuffer__runtimearr_int %1 %uint_0 - %85 = OpAccessChain %_ptr_StorageBuffer_int %84 %82 - OpCooperativeMatrixStoreKHR %85 %71 %uint_0 %83 NonPrivatePointer - %87 = OpExtInst %uint %66 UClamp %uint_42 %uint_0 %uint_255 - %90 = OpUConvert %uchar %87 - %91 = OpCompositeConstruct %45 %90 - %92 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %6 %uint_0 - %93 = OpArrayLength %uint %6 0 - %94 = OpIMul %uint %93 %uint_4 - %95 = OpBitcast %uint %int_0 - %96 = OpBitcast %uint %int_64 - %97 = OpIMul %uint %96 %uint_7 - %98 = OpIAdd %uint %95 %97 - %99 = OpIMul %uint %98 %uint_4 - %100 = OpIAdd %uint %99 %uint_8 - %101 = OpULessThanEqual %bool %100 %94 - %102 = OpSelect %uint %101 %95 %uint_0 - %103 = OpSelect %uint %101 %96 %uint_2 - %104 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %6 %uint_0 - %105 = OpAccessChain %_ptr_StorageBuffer_uint %104 %102 - OpCooperativeMatrixStoreKHR %105 %91 %uint_0 %103 NonPrivatePointer + %24 = OpBitcast %uint %int_0 + %26 = OpBitcast %uint %int_64 + %28 = OpIMul %uint %26 %uint_7 + %30 = OpIAdd %uint %24 %28 + %31 = OpIAdd %uint %30 %uint_2 + %33 = OpULessThanEqual %bool %31 %23 + %35 = OpSelect %uint %33 %24 %uint_0 + %36 = OpSelect %uint %33 %26 %uint_2 + %37 = OpAccessChain %_ptr_StorageBuffer__runtimearr_int %1 %uint_0 + %38 = OpAccessChain %_ptr_StorageBuffer_int %37 %35 + OpCooperativeMatrixStoreKHR %38 %15 %uint_0 %36 NonPrivatePointer + %45 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %6 %uint_0 + %47 = OpArrayLength %uint %6 0 + %48 = OpBitcast %uint %int_0 + %49 = OpBitcast %uint %int_64 + %50 = OpIMul %uint %49 %uint_7 + %51 = OpIAdd %uint %48 %50 + %52 = OpIAdd %uint %51 %uint_2 + %53 = OpULessThanEqual %bool %52 %47 + %54 = OpSelect %uint %53 %48 %uint_0 + %55 = OpSelect %uint %53 %49 %uint_2 + %56 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %6 %uint_0 + %57 = OpAccessChain %_ptr_StorageBuffer_uint %56 %54 + OpCooperativeMatrixStoreKHR %57 %41 %uint_0 %55 NonPrivatePointer + %60 = OpExtInst %int %61 SClamp %int_n42 %int_n128 %int_127 + %65 = OpSConvert %char %60 + %66 = OpCompositeConstruct %16 %65 + %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_int %1 %uint_0 + %68 = OpArrayLength %uint %1 0 + %69 = OpBitcast %uint %int_0 + %70 = OpBitcast %uint %int_64 + %71 = OpIMul %uint %70 %uint_7 + %72 = OpIAdd %uint %69 %71 + %73 = OpIAdd %uint %72 %uint_2 + %74 = OpULessThanEqual %bool %73 %68 + %75 = OpSelect %uint %74 %69 %uint_0 + %76 = OpSelect %uint %74 %70 %uint_2 + %77 = OpAccessChain %_ptr_StorageBuffer__runtimearr_int %1 %uint_0 + %78 = OpAccessChain %_ptr_StorageBuffer_int %77 %75 + OpCooperativeMatrixStoreKHR %78 %66 %uint_0 %76 NonPrivatePointer + %80 = OpExtInst %uint %61 UClamp %uint_42 %uint_0 %uint_255 + %83 = OpUConvert %uchar %80 + %84 = OpCompositeConstruct %42 %83 + %85 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %6 %uint_0 + %86 = OpArrayLength %uint %6 0 + %87 = OpBitcast %uint %int_0 + %88 = OpBitcast %uint %int_64 + %89 = OpIMul %uint %88 %uint_7 + %90 = OpIAdd %uint %87 %89 + %91 = OpIAdd %uint %90 %uint_2 + %92 = OpULessThanEqual %bool %91 %86 + %93 = OpSelect %uint %92 %87 %uint_0 + %94 = OpSelect %uint %92 %88 %uint_2 + %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %6 %uint_0 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %95 %93 + OpCooperativeMatrixStoreKHR %96 %84 %uint_0 %94 NonPrivatePointer OpReturn OpFunctionEnd