tint: const eval of dot builtin
Bug: tint:1581
Change-Id: Ie7768f8bf254509c1795207de0a1d8b07a317555
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110984
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/tint/intrinsics.def b/src/tint/intrinsics.def
index 7a18e17..f2b4d7e 100644
--- a/src/tint/intrinsics.def
+++ b/src/tint/intrinsics.def
@@ -445,7 +445,7 @@
fn determinant<N: num, T: f32_f16>(mat<N, N, T>) -> T
fn distance<T: f32_f16>(T, T) -> T
fn distance<N: num, T: f32_f16>(vec<N, T>, vec<N, T>) -> T
-fn dot<N: num, T: fiu32_f16>(vec<N, T>, vec<N, T>) -> T
+@const fn dot<N: num, T: fia_fiu32_f16>(vec<N, T>, vec<N, T>) -> T
fn dot4I8Packed(u32, u32) -> i32
fn dot4U8Packed(u32, u32) -> u32
@stage("fragment") fn dpdx(f32) -> f32
diff --git a/src/tint/resolver/builtin_test.cc b/src/tint/resolver/builtin_test.cc
index 0de2411..9fc6090 100644
--- a/src/tint/resolver/builtin_test.cc
+++ b/src/tint/resolver/builtin_test.cc
@@ -2062,7 +2062,7 @@
R"(error: no matching call to dot(f32, f32)
1 candidate function:
- dot(vecN<T>, vecN<T>) -> T where: T is f32, i32, u32 or f16
+ dot(vecN<T>, vecN<T>) -> T where: T is abstract-float, abstract-int, f32, i32, u32 or f16
)");
}
diff --git a/src/tint/resolver/const_eval.cc b/src/tint/resolver/const_eval.cc
index 9275ef3..28e100e 100644
--- a/src/tint/resolver/const_eval.cc
+++ b/src/tint/resolver/const_eval.cc
@@ -1969,6 +1969,36 @@
return TransformElements(builder, ty, transform, args[0]);
}
+ConstEval::Result ConstEval::dot(const sem::Type* ty,
+ utils::VectorRef<const sem::Constant*> args,
+ const Source& source) {
+ auto calculate = [&]() -> ImplResult {
+ auto* v1 = args[0];
+ auto* v2 = args[1];
+ auto* vec_ty = v1->Type()->As<sem::Vector>();
+ switch (vec_ty->Width()) {
+ case 2:
+ return Dispatch_fia_fiu32_f16(Dot2Func(source, ty), v1->Index(0), v1->Index(1),
+ v2->Index(0), v2->Index(1));
+ case 3:
+ return Dispatch_fia_fiu32_f16(Dot3Func(source, ty), v1->Index(0), v1->Index(1),
+ v1->Index(2), v2->Index(0), v2->Index(1),
+ v2->Index(2));
+ case 4:
+ return Dispatch_fia_fiu32_f16(Dot4Func(source, ty), v1->Index(0), v1->Index(1),
+ v1->Index(2), v1->Index(3), v2->Index(0),
+ v2->Index(1), v2->Index(2), v2->Index(3));
+ }
+ TINT_ICE(Resolver, builder.Diagnostics()) << "Expected scalar or vector";
+ return utils::Failure;
+ };
+ auto r = calculate();
+ if (!r) {
+ AddNote("when calculating dot", source);
+ }
+ return r;
+}
+
ConstEval::Result ConstEval::extractBits(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source) {
diff --git a/src/tint/resolver/const_eval.h b/src/tint/resolver/const_eval.h
index 5e2a97f..cb1babd 100644
--- a/src/tint/resolver/const_eval.h
+++ b/src/tint/resolver/const_eval.h
@@ -539,7 +539,6 @@
utils::VectorRef<const sem::Constant*> args,
const Source& source);
- /// degrees builtin
/// @param ty the expression type
/// @param args the input arguments
/// @param source the source location of the conversion
@@ -548,6 +547,15 @@
utils::VectorRef<const sem::Constant*> args,
const Source& source);
+ /// dot builtin
+ /// @param ty the expression type
+ /// @param args the input arguments
+ /// @param source the source location
+ /// @return the result value, or null if the value cannot be calculated
+ Result dot(const sem::Type* ty,
+ utils::VectorRef<const sem::Constant*> args,
+ const Source& source);
+
/// extractBits builtin
/// @param ty the expression type
/// @param args the input arguments
diff --git a/src/tint/resolver/const_eval_builtin_test.cc b/src/tint/resolver/const_eval_builtin_test.cc
index 1bf0bd0..7fbdf30 100644
--- a/src/tint/resolver/const_eval_builtin_test.cc
+++ b/src/tint/resolver/const_eval_builtin_test.cc
@@ -792,11 +792,61 @@
ResolverConstEvalBuiltinTest,
testing::Combine(testing::Values(sem::BuiltinType::kCross),
testing::ValuesIn(Concat(CrossCases<AFloat>(), //
- CrossCases<f32>(),
- CrossCases<f32>(), //
+ CrossCases<f32>(), //
CrossCases<f16>()))));
template <typename T>
+std::vector<Case> DotCases() {
+ auto r = std::vector<Case>{
+ C({Vec(T(0), T(0)), Vec(T(0), T(0))}, Val(T(0))),
+ C({Vec(T(0), T(0), T(0)), Vec(T(0), T(0), T(0))}, Val(T(0))),
+ C({Vec(T(0), T(0), T(0), T(0)), Vec(T(0), T(0), T(0), T(0))}, Val(T(0))),
+ C({Vec(T(1), T(2), T(3), T(4)), Vec(T(5), T(6), T(7), T(8))}, Val(T(70))),
+
+ C({Vec(T(1), T(1)), Vec(T(1), T(1))}, Val(T(2))),
+ C({Vec(T(1), T(2)), Vec(T(2), T(1))}, Val(T(4))),
+ C({Vec(T(2), T(2)), Vec(T(2), T(2))}, Val(T(8))),
+
+ C({Vec(T::Highest(), T::Highest()), Vec(T(1), T(0))}, Val(T::Highest())),
+ C({Vec(T::Lowest(), T::Lowest()), Vec(T(1), T(0))}, Val(T::Lowest())),
+ };
+
+ if constexpr (IsAbstract<T> || IsFloatingPoint<T>) {
+ auto error_msg = [](auto a, const char* op, auto b) {
+ return "12:34 error: " + OverflowErrorMessage(a, op, b) + R"(
+12:34 note: when calculating dot)";
+ };
+ ConcatInto( //
+ r, std::vector<Case>{
+ E({Vec(T::Highest(), T::Highest()), Vec(T(1), T(1))},
+ error_msg(T::Highest(), "+", T::Highest())),
+ E({Vec(T::Lowest(), T::Lowest()), Vec(T(1), T(1))},
+ error_msg(T::Lowest(), "+", T::Lowest())),
+ });
+ } else {
+ // Overflow is not an error for concrete integrals
+ ConcatInto( //
+ r, std::vector<Case>{
+ C({Vec(T::Highest(), T::Highest()), Vec(T(1), T(1))},
+ Val(Add(T::Highest(), T::Highest()))),
+ C({Vec(T::Lowest(), T::Lowest()), Vec(T(1), T(1))},
+ Val(Add(T::Lowest(), T::Lowest()))),
+ });
+ }
+ return r;
+}
+INSTANTIATE_TEST_SUITE_P( //
+ Dot,
+ ResolverConstEvalBuiltinTest,
+ testing::Combine(testing::Values(sem::BuiltinType::kDot),
+ testing::ValuesIn(Concat(DotCases<AInt>(), //
+ DotCases<i32>(), //
+ DotCases<u32>(), //
+ DotCases<AFloat>(), //
+ DotCases<f32>(), //
+ DotCases<f16>()))));
+
+template <typename T>
std::vector<Case> FirstLeadingBitCases() {
using B = BitValues<T>;
auto r = std::vector<Case>{
diff --git a/src/tint/resolver/const_eval_test.h b/src/tint/resolver/const_eval_test.h
index c2e12bc..cccbf76 100644
--- a/src/tint/resolver/const_eval_test.h
+++ b/src/tint/resolver/const_eval_test.h
@@ -107,6 +107,19 @@
}
TINT_END_DISABLE_WARNING(CONSTANT_OVERFLOW);
+TINT_BEGIN_DISABLE_WARNING(CONSTANT_OVERFLOW);
+template <typename T>
+inline constexpr Number<T> Add(Number<T> v1, Number<T> v2) {
+ if constexpr (std::is_integral_v<T> && std::is_signed_v<T>) {
+ // For signed integrals, avoid C++ UB by adding as unsigned
+ using UT = std::make_unsigned_t<T>;
+ return static_cast<Number<T>>(static_cast<UT>(v1) + static_cast<UT>(v2));
+ } else {
+ return static_cast<Number<T>>(v1 + v2);
+ }
+}
+TINT_END_DISABLE_WARNING(CONSTANT_OVERFLOW);
+
// Concats any number of std::vectors
template <typename Vec, typename... Vecs>
[[nodiscard]] inline auto Concat(Vec&& v1, Vecs&&... vs) {
diff --git a/src/tint/resolver/intrinsic_table.inl b/src/tint/resolver/intrinsic_table.inl
index 9e76862..91ff68c 100644
--- a/src/tint/resolver/intrinsic_table.inl
+++ b/src/tint/resolver/intrinsic_table.inl
@@ -8209,22 +8209,22 @@
{
/* [27] */
/* name */ "T",
- /* matcher index */ 65,
+ /* matcher index */ 52,
},
{
/* [28] */
/* name */ "T",
- /* matcher index */ 52,
+ /* matcher index */ 64,
},
{
/* [29] */
/* name */ "T",
- /* matcher index */ 64,
+ /* matcher index */ 60,
},
{
/* [30] */
/* name */ "T",
- /* matcher index */ 60,
+ /* matcher index */ 65,
},
{
/* [31] */
@@ -8838,7 +8838,7 @@
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[982],
/* return matcher indices */ &kMatcherIndices[130],
@@ -8850,7 +8850,7 @@
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[983],
/* return matcher indices */ &kMatcherIndices[130],
@@ -8862,7 +8862,7 @@
/* num parameters */ 4,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[427],
/* return matcher indices */ &kMatcherIndices[130],
@@ -8874,7 +8874,7 @@
/* num parameters */ 3,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[576],
/* return matcher indices */ &kMatcherIndices[130],
@@ -8886,7 +8886,7 @@
/* num parameters */ 3,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[579],
/* return matcher indices */ &kMatcherIndices[130],
@@ -8898,7 +8898,7 @@
/* num parameters */ 3,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[582],
/* return matcher indices */ &kMatcherIndices[130],
@@ -8910,7 +8910,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[792],
/* return matcher indices */ &kMatcherIndices[130],
@@ -8922,7 +8922,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[794],
/* return matcher indices */ &kMatcherIndices[130],
@@ -8934,7 +8934,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[796],
/* return matcher indices */ &kMatcherIndices[130],
@@ -9474,7 +9474,7 @@
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[975],
/* return matcher indices */ &kMatcherIndices[102],
@@ -9486,7 +9486,7 @@
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[976],
/* return matcher indices */ &kMatcherIndices[102],
@@ -9498,7 +9498,7 @@
/* num parameters */ 3,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[573],
/* return matcher indices */ &kMatcherIndices[102],
@@ -9510,7 +9510,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[788],
/* return matcher indices */ &kMatcherIndices[102],
@@ -9522,7 +9522,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[790],
/* return matcher indices */ &kMatcherIndices[102],
@@ -9942,7 +9942,7 @@
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[968],
/* return matcher indices */ &kMatcherIndices[150],
@@ -9954,7 +9954,7 @@
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[969],
/* return matcher indices */ &kMatcherIndices[150],
@@ -9966,7 +9966,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[786],
/* return matcher indices */ &kMatcherIndices[150],
@@ -11322,7 +11322,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[27],
+ /* template types */ &kTemplateTypes[30],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[718],
/* return matcher indices */ &kMatcherIndices[3],
@@ -11334,7 +11334,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[27],
+ /* template types */ &kTemplateTypes[30],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[720],
/* return matcher indices */ &kMatcherIndices[30],
@@ -11346,7 +11346,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[27],
+ /* template types */ &kTemplateTypes[30],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[722],
/* return matcher indices */ &kMatcherIndices[30],
@@ -11358,7 +11358,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[27],
+ /* template types */ &kTemplateTypes[30],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[724],
/* return matcher indices */ &kMatcherIndices[30],
@@ -11394,7 +11394,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[29],
+ /* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[734],
/* return matcher indices */ &kMatcherIndices[3],
@@ -11406,7 +11406,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[29],
+ /* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[736],
/* return matcher indices */ &kMatcherIndices[30],
@@ -11442,7 +11442,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[29],
+ /* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[742],
/* return matcher indices */ &kMatcherIndices[3],
@@ -11454,7 +11454,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[29],
+ /* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[744],
/* return matcher indices */ &kMatcherIndices[30],
@@ -11550,7 +11550,7 @@
/* num parameters */ 3,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[480],
/* return matcher indices */ &kMatcherIndices[3],
@@ -11562,7 +11562,7 @@
/* num parameters */ 3,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[483],
/* return matcher indices */ &kMatcherIndices[30],
@@ -11574,7 +11574,7 @@
/* num parameters */ 3,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[486],
/* return matcher indices */ &kMatcherIndices[30],
@@ -13302,7 +13302,7 @@
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[29],
+ /* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[954],
/* return matcher indices */ &kMatcherIndices[3],
@@ -13314,7 +13314,7 @@
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[29],
+ /* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[955],
/* return matcher indices */ &kMatcherIndices[30],
@@ -13326,7 +13326,7 @@
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[30],
+ /* template types */ &kTemplateTypes[29],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[956],
/* return matcher indices */ &kMatcherIndices[3],
@@ -13338,7 +13338,7 @@
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[30],
+ /* template types */ &kTemplateTypes[29],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[957],
/* return matcher indices */ &kMatcherIndices[30],
@@ -13350,7 +13350,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[29],
+ /* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[726],
/* return matcher indices */ &kMatcherIndices[3],
@@ -13362,7 +13362,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[29],
+ /* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[728],
/* return matcher indices */ &kMatcherIndices[30],
@@ -13374,7 +13374,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[750],
/* return matcher indices */ &kMatcherIndices[35],
@@ -13386,7 +13386,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[752],
/* return matcher indices */ &kMatcherIndices[33],
@@ -13398,7 +13398,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[754],
/* return matcher indices */ &kMatcherIndices[35],
@@ -13410,7 +13410,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[28],
+ /* template types */ &kTemplateTypes[27],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[756],
/* return matcher indices */ &kMatcherIndices[33],
@@ -13506,7 +13506,7 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[27],
+ /* template types */ &kTemplateTypes[30],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[772],
/* return matcher indices */ &kMatcherIndices[33],
@@ -13578,12 +13578,12 @@
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[27],
+ /* template types */ &kTemplateTypes[22],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[604],
/* return matcher indices */ &kMatcherIndices[3],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* const eval */ nullptr,
+ /* const eval */ &ConstEval::dot,
},
{
/* [439] */
@@ -14137,7 +14137,7 @@
},
{
/* [22] */
- /* fn dot<N : num, T : fiu32_f16>(vec<N, T>, vec<N, T>) -> T */
+ /* fn dot<N : num, T : fia_fiu32_f16>(vec<N, T>, vec<N, T>) -> T */
/* num overloads */ 1,
/* overloads */ &kOverloads[438],
},
diff --git a/test/tint/builtins/gen/literal/dot/08eb56.wgsl b/test/tint/builtins/gen/literal/dot/08eb56.wgsl
new file mode 100644
index 0000000..1be3d72
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/08eb56.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn dot(vec<4, fa>, vec<4, fa>) -> fa
+fn dot_08eb56() {
+ var res = dot(vec4(1.), vec4(1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_08eb56();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_08eb56();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_08eb56();
+}
diff --git a/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c4e18de
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void dot_08eb56() {
+ float res = 4.0f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ dot_08eb56();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ dot_08eb56();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_08eb56();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c4e18de
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void dot_08eb56() {
+ float res = 4.0f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ dot_08eb56();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ dot_08eb56();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_08eb56();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.glsl
new file mode 100644
index 0000000..fde4529
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void dot_08eb56() {
+ float res = 4.0f;
+}
+
+vec4 vertex_main() {
+ dot_08eb56();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void dot_08eb56() {
+ float res = 4.0f;
+}
+
+void fragment_main() {
+ dot_08eb56();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void dot_08eb56() {
+ float res = 4.0f;
+}
+
+void compute_main() {
+ dot_08eb56();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.msl
new file mode 100644
index 0000000..a442896
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dot_08eb56() {
+ float res = 4.0f;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ dot_08eb56();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ dot_08eb56();
+ return;
+}
+
+kernel void compute_main() {
+ dot_08eb56();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.spvasm
new file mode 100644
index 0000000..e5558a9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %dot_08eb56 "dot_08eb56"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %float_4 = OpConstant %float 4
+%_ptr_Function_float = OpTypePointer Function %float
+ %16 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %dot_08eb56 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ OpStore %res %float_4
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %16
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %dot_08eb56
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ %22 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %22
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %dot_08eb56
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %dot_08eb56
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.wgsl
new file mode 100644
index 0000000..1d86506
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/08eb56.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn dot_08eb56() {
+ var res = dot(vec4(1.0), vec4(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_08eb56();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_08eb56();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_08eb56();
+}
diff --git a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.dxc.hlsl
index ddbdbd4..f8d8fff 100644
--- a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void dot_0c577b() {
- float res = dot((1.0f).xxxx, (1.0f).xxxx);
+ float res = 4.0f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.fxc.hlsl
index ddbdbd4..f8d8fff 100644
--- a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void dot_0c577b() {
- float res = dot((1.0f).xxxx, (1.0f).xxxx);
+ float res = 4.0f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.glsl
index bc4518f..df20f28 100644
--- a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.glsl
@@ -1,7 +1,7 @@
#version 310 es
void dot_0c577b() {
- float res = dot(vec4(1.0f), vec4(1.0f));
+ float res = 4.0f;
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@
precision mediump float;
void dot_0c577b() {
- float res = dot(vec4(1.0f), vec4(1.0f));
+ float res = 4.0f;
}
void fragment_main() {
@@ -35,7 +35,7 @@
#version 310 es
void dot_0c577b() {
- float res = dot(vec4(1.0f), vec4(1.0f));
+ float res = 4.0f;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.msl
index f4501c0..041a650 100644
--- a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void dot_0c577b() {
- float res = dot(float4(1.0f), float4(1.0f));
+ float res = 4.0f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.spvasm
index b64095e..b814ca8 100644
--- a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -30,36 +30,35 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
- %float_1 = OpConstant %float 1
- %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %float_4 = OpConstant %float 4
%_ptr_Function_float = OpTypePointer Function %float
- %18 = OpTypeFunction %v4float
+ %16 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
%dot_0c577b = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
- %13 = OpDot %float %15 %15
- OpStore %res %13
+ OpStore %res %float_4
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
- %20 = OpLabel
- %21 = OpFunctionCall %void %dot_0c577b
+%vertex_main_inner = OpFunction %v4float None %16
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %dot_0c577b
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %24
+ %21 = OpLabel
+ %22 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %dot_0c577b
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %dot_0c577b
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %dot_0c577b
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %dot_0c577b
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl
new file mode 100644
index 0000000..2673e84
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn dot(vec<2, fa>, vec<2, fa>) -> fa
+fn dot_0d2c2e() {
+ var res = dot(vec2(1.), vec2(1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_0d2c2e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_0d2c2e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_0d2c2e();
+}
diff --git a/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..46e88b5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void dot_0d2c2e() {
+ float res = 2.0f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ dot_0d2c2e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ dot_0d2c2e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_0d2c2e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..46e88b5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void dot_0d2c2e() {
+ float res = 2.0f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ dot_0d2c2e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ dot_0d2c2e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_0d2c2e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.glsl
new file mode 100644
index 0000000..56f8ba0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void dot_0d2c2e() {
+ float res = 2.0f;
+}
+
+vec4 vertex_main() {
+ dot_0d2c2e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void dot_0d2c2e() {
+ float res = 2.0f;
+}
+
+void fragment_main() {
+ dot_0d2c2e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void dot_0d2c2e() {
+ float res = 2.0f;
+}
+
+void compute_main() {
+ dot_0d2c2e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.msl
new file mode 100644
index 0000000..9e750d4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dot_0d2c2e() {
+ float res = 2.0f;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ dot_0d2c2e();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ dot_0d2c2e();
+ return;
+}
+
+kernel void compute_main() {
+ dot_0d2c2e();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.spvasm
new file mode 100644
index 0000000..bb94b74
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %dot_0d2c2e "dot_0d2c2e"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %float_2 = OpConstant %float 2
+%_ptr_Function_float = OpTypePointer Function %float
+ %16 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %dot_0d2c2e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ OpStore %res %float_2
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %16
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %dot_0d2c2e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ %22 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %22
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %dot_0d2c2e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %dot_0d2c2e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.wgsl
new file mode 100644
index 0000000..fbae591
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn dot_0d2c2e() {
+ var res = dot(vec2(1.0), vec2(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_0d2c2e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_0d2c2e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_0d2c2e();
+}
diff --git a/test/tint/builtins/gen/literal/dot/14bc63.wgsl b/test/tint/builtins/gen/literal/dot/14bc63.wgsl
new file mode 100644
index 0000000..b59b695
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/14bc63.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn dot(vec<2, ia>, vec<2, ia>) -> ia
+fn dot_14bc63() {
+ var res = dot(vec2(1), vec2(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_14bc63();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_14bc63();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_14bc63();
+}
diff --git a/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..77562dc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void dot_14bc63() {
+ int res = 2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ dot_14bc63();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ dot_14bc63();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_14bc63();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..77562dc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void dot_14bc63() {
+ int res = 2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ dot_14bc63();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ dot_14bc63();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_14bc63();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.glsl
new file mode 100644
index 0000000..ee01341
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void dot_14bc63() {
+ int res = 2;
+}
+
+vec4 vertex_main() {
+ dot_14bc63();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void dot_14bc63() {
+ int res = 2;
+}
+
+void fragment_main() {
+ dot_14bc63();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void dot_14bc63() {
+ int res = 2;
+}
+
+void compute_main() {
+ dot_14bc63();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.msl
new file mode 100644
index 0000000..6f2f467
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dot_14bc63() {
+ int res = 2;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ dot_14bc63();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ dot_14bc63();
+ return;
+}
+
+kernel void compute_main() {
+ dot_14bc63();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.spvasm
new file mode 100644
index 0000000..f454100
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %dot_14bc63 "dot_14bc63"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_2 = OpConstant %int 2
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %18 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %dot_14bc63 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ OpStore %res %int_2
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %dot_14bc63
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %dot_14bc63
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %dot_14bc63
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.wgsl
new file mode 100644
index 0000000..c124ead
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/14bc63.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn dot_14bc63() {
+ var res = dot(vec2(1), vec2(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_14bc63();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_14bc63();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_14bc63();
+}
diff --git a/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl
new file mode 100644
index 0000000..8720932
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn dot(vec<3, fa>, vec<3, fa>) -> fa
+fn dot_5a4c8f() {
+ var res = dot(vec3(1.), vec3(1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_5a4c8f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_5a4c8f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_5a4c8f();
+}
diff --git a/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b6e6077
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void dot_5a4c8f() {
+ float res = 3.0f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ dot_5a4c8f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ dot_5a4c8f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_5a4c8f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b6e6077
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void dot_5a4c8f() {
+ float res = 3.0f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ dot_5a4c8f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ dot_5a4c8f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_5a4c8f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.glsl
new file mode 100644
index 0000000..bf3a69a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void dot_5a4c8f() {
+ float res = 3.0f;
+}
+
+vec4 vertex_main() {
+ dot_5a4c8f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void dot_5a4c8f() {
+ float res = 3.0f;
+}
+
+void fragment_main() {
+ dot_5a4c8f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void dot_5a4c8f() {
+ float res = 3.0f;
+}
+
+void compute_main() {
+ dot_5a4c8f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.msl
new file mode 100644
index 0000000..e3ba3f5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dot_5a4c8f() {
+ float res = 3.0f;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ dot_5a4c8f();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ dot_5a4c8f();
+ return;
+}
+
+kernel void compute_main() {
+ dot_5a4c8f();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.spvasm
new file mode 100644
index 0000000..e212ecb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %dot_5a4c8f "dot_5a4c8f"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %float_3 = OpConstant %float 3
+%_ptr_Function_float = OpTypePointer Function %float
+ %16 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %dot_5a4c8f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ OpStore %res %float_3
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %16
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %dot_5a4c8f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ %22 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %22
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %dot_5a4c8f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %dot_5a4c8f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.wgsl
new file mode 100644
index 0000000..022f0e2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn dot_5a4c8f() {
+ var res = dot(vec3(1.0), vec3(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_5a4c8f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_5a4c8f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_5a4c8f();
+}
diff --git a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.dxc.hlsl
index cd0f853..734a719 100644
--- a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void dot_7548a0() {
- uint res = dot((1u).xxx, (1u).xxx);
+ uint res = 3u;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.fxc.hlsl
index cd0f853..734a719 100644
--- a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void dot_7548a0() {
- uint res = dot((1u).xxx, (1u).xxx);
+ uint res = 3u;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.glsl
index 6b184f8..7011d7e 100644
--- a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.glsl
@@ -1,11 +1,7 @@
#version 310 es
-uint tint_int_dot(uvec3 a, uvec3 b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
-}
-
void dot_7548a0() {
- uint res = tint_int_dot(uvec3(1u), uvec3(1u));
+ uint res = 3u;
}
vec4 vertex_main() {
@@ -24,12 +20,8 @@
#version 310 es
precision mediump float;
-uint tint_int_dot(uvec3 a, uvec3 b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
-}
-
void dot_7548a0() {
- uint res = tint_int_dot(uvec3(1u), uvec3(1u));
+ uint res = 3u;
}
void fragment_main() {
@@ -42,12 +34,8 @@
}
#version 310 es
-uint tint_int_dot(uvec3 a, uvec3 b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
-}
-
void dot_7548a0() {
- uint res = tint_int_dot(uvec3(1u), uvec3(1u));
+ uint res = 3u;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.msl
index 47aee0f..3261b2e 100644
--- a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.msl
@@ -1,13 +1,8 @@
#include <metal_stdlib>
using namespace metal;
-
-template<typename T>
-T tint_dot3(vec<T,3> a, vec<T,3> b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
-}
void dot_7548a0() {
- uint res = tint_dot3(uint3(1u), uint3(1u));
+ uint res = 3u;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.spvasm
index 2043848..27b387a 100644
--- a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -31,49 +31,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
- %v3uint = OpTypeVector %uint 3
- %uint_1 = OpConstant %uint 1
- %17 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+ %uint_3 = OpConstant %uint 3
%_ptr_Function_uint = OpTypePointer Function %uint
- %30 = OpConstantNull %uint
- %31 = OpTypeFunction %v4float
+ %17 = OpConstantNull %uint
+ %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_7548a0 = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %30
- %18 = OpCompositeExtract %uint %17 0
- %19 = OpCompositeExtract %uint %17 0
- %20 = OpIMul %uint %18 %19
- %21 = OpCompositeExtract %uint %17 1
- %22 = OpCompositeExtract %uint %17 1
- %23 = OpIMul %uint %21 %22
- %24 = OpIAdd %uint %20 %23
- %25 = OpCompositeExtract %uint %17 2
- %26 = OpCompositeExtract %uint %17 2
- %27 = OpIMul %uint %25 %26
- %13 = OpIAdd %uint %24 %27
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_uint Function %17
+ OpStore %res %uint_3
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
- %33 = OpLabel
- %34 = OpFunctionCall %void %dot_7548a0
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %dot_7548a0
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %36 = OpLabel
- %37 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %37
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %40 = OpLabel
- %41 = OpFunctionCall %void %dot_7548a0
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %dot_7548a0
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %43 = OpLabel
- %44 = OpFunctionCall %void %dot_7548a0
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %dot_7548a0
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.dxc.hlsl
index 4e4cbb5..47e8b07 100644
--- a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void dot_883f0e() {
- float res = dot((1.0f).xx, (1.0f).xx);
+ float res = 2.0f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.fxc.hlsl
index 4e4cbb5..47e8b07 100644
--- a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void dot_883f0e() {
- float res = dot((1.0f).xx, (1.0f).xx);
+ float res = 2.0f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.glsl
index 6ab33ae..226cf9a 100644
--- a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.glsl
@@ -1,7 +1,7 @@
#version 310 es
void dot_883f0e() {
- float res = dot(vec2(1.0f), vec2(1.0f));
+ float res = 2.0f;
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@
precision mediump float;
void dot_883f0e() {
- float res = dot(vec2(1.0f), vec2(1.0f));
+ float res = 2.0f;
}
void fragment_main() {
@@ -35,7 +35,7 @@
#version 310 es
void dot_883f0e() {
- float res = dot(vec2(1.0f), vec2(1.0f));
+ float res = 2.0f;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.msl
index 44510c4..0f63f30 100644
--- a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void dot_883f0e() {
- float res = dot(float2(1.0f), float2(1.0f));
+ float res = 2.0f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.spvasm
index e1cf73c..e178ced 100644
--- a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -30,37 +30,35 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
- %v2float = OpTypeVector %float 2
- %float_1 = OpConstant %float 1
- %16 = OpConstantComposite %v2float %float_1 %float_1
+ %float_2 = OpConstant %float 2
%_ptr_Function_float = OpTypePointer Function %float
- %19 = OpTypeFunction %v4float
+ %16 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
%dot_883f0e = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
- %13 = OpDot %float %16 %16
- OpStore %res %13
+ OpStore %res %float_2
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
- %21 = OpLabel
- %22 = OpFunctionCall %void %dot_883f0e
+%vertex_main_inner = OpFunction %v4float None %16
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %dot_883f0e
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %25
+ %21 = OpLabel
+ %22 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %dot_883f0e
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %dot_883f0e
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %dot_883f0e
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %dot_883f0e
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.dxc.hlsl
index 45e55de..ae4d815 100644
--- a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void dot_8e40f1() {
- float16_t res = dot((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
+ float16_t res = float16_t(3.0h);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.glsl
index 069a38d..8f5eca6 100644
--- a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.glsl
@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void dot_8e40f1() {
- float16_t res = dot(f16vec3(1.0hf), f16vec3(1.0hf));
+ float16_t res = 3.0hf;
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@
precision mediump float;
void dot_8e40f1() {
- float16_t res = dot(f16vec3(1.0hf), f16vec3(1.0hf));
+ float16_t res = 3.0hf;
}
void fragment_main() {
@@ -38,7 +38,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void dot_8e40f1() {
- float16_t res = dot(f16vec3(1.0hf), f16vec3(1.0hf));
+ float16_t res = 3.0hf;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.msl
index 9299636..4828851 100644
--- a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void dot_8e40f1() {
- half res = dot(half3(1.0h), half3(1.0h));
+ half res = 3.0h;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.spvasm
index 005fa5a..f1e3db8 100644
--- a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 32
; Schema: 0
OpCapability Shader
OpCapability Float16
@@ -35,39 +35,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
- %v3half = OpTypeVector %half 3
-%half_0x1p_0 = OpConstant %half 0x1p+0
- %17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+%half_0x1_8p_1 = OpConstant %half 0x1.8p+1
%_ptr_Function_half = OpTypePointer Function %half
- %20 = OpConstantNull %half
- %21 = OpTypeFunction %v4float
+ %17 = OpConstantNull %half
+ %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_8e40f1 = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_half Function %20
- %13 = OpDot %half %17 %17
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_half Function %17
+ OpStore %res %half_0x1_8p_1
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
- %23 = OpLabel
- %24 = OpFunctionCall %void %dot_8e40f1
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %dot_8e40f1
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %27
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %dot_8e40f1
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %dot_8e40f1
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %33 = OpLabel
- %34 = OpFunctionCall %void %dot_8e40f1
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %dot_8e40f1
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.dxc.hlsl
index 9237756..598ea1a 100644
--- a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void dot_97c7ee() {
- uint res = dot((1u).xx, (1u).xx);
+ uint res = 2u;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.fxc.hlsl
index 9237756..598ea1a 100644
--- a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void dot_97c7ee() {
- uint res = dot((1u).xx, (1u).xx);
+ uint res = 2u;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.glsl
index c61da39..eca1297 100644
--- a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.glsl
@@ -1,11 +1,7 @@
#version 310 es
-uint tint_int_dot(uvec2 a, uvec2 b) {
- return a[0]*b[0] + a[1]*b[1];
-}
-
void dot_97c7ee() {
- uint res = tint_int_dot(uvec2(1u), uvec2(1u));
+ uint res = 2u;
}
vec4 vertex_main() {
@@ -24,12 +20,8 @@
#version 310 es
precision mediump float;
-uint tint_int_dot(uvec2 a, uvec2 b) {
- return a[0]*b[0] + a[1]*b[1];
-}
-
void dot_97c7ee() {
- uint res = tint_int_dot(uvec2(1u), uvec2(1u));
+ uint res = 2u;
}
void fragment_main() {
@@ -42,12 +34,8 @@
}
#version 310 es
-uint tint_int_dot(uvec2 a, uvec2 b) {
- return a[0]*b[0] + a[1]*b[1];
-}
-
void dot_97c7ee() {
- uint res = tint_int_dot(uvec2(1u), uvec2(1u));
+ uint res = 2u;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.msl
index 6565bb8..e329edd 100644
--- a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.msl
@@ -1,13 +1,8 @@
#include <metal_stdlib>
using namespace metal;
-
-template<typename T>
-T tint_dot2(vec<T,2> a, vec<T,2> b) {
- return a[0]*b[0] + a[1]*b[1];
-}
void dot_97c7ee() {
- uint res = tint_dot2(uint2(1u), uint2(1u));
+ uint res = 2u;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.spvasm
index 079b868..384a3d7 100644
--- a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -31,45 +31,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
- %v2uint = OpTypeVector %uint 2
- %uint_1 = OpConstant %uint 1
- %17 = OpConstantComposite %v2uint %uint_1 %uint_1
+ %uint_2 = OpConstant %uint 2
%_ptr_Function_uint = OpTypePointer Function %uint
- %26 = OpConstantNull %uint
- %27 = OpTypeFunction %v4float
+ %17 = OpConstantNull %uint
+ %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_97c7ee = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %26
- %18 = OpCompositeExtract %uint %17 0
- %19 = OpCompositeExtract %uint %17 0
- %20 = OpIMul %uint %18 %19
- %21 = OpCompositeExtract %uint %17 1
- %22 = OpCompositeExtract %uint %17 1
- %23 = OpIMul %uint %21 %22
- %13 = OpIAdd %uint %20 %23
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_uint Function %17
+ OpStore %res %uint_2
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %dot_97c7ee
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %dot_97c7ee
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %36 = OpLabel
- %37 = OpFunctionCall %void %dot_97c7ee
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %dot_97c7ee
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %39 = OpLabel
- %40 = OpFunctionCall %void %dot_97c7ee
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %dot_97c7ee
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.dxc.hlsl
index 6a9325c..08f1cdd 100644
--- a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void dot_ba4246() {
- float res = dot((1.0f).xxx, (1.0f).xxx);
+ float res = 3.0f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.fxc.hlsl
index 6a9325c..08f1cdd 100644
--- a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void dot_ba4246() {
- float res = dot((1.0f).xxx, (1.0f).xxx);
+ float res = 3.0f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.glsl
index 101b193..95e9397 100644
--- a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.glsl
@@ -1,7 +1,7 @@
#version 310 es
void dot_ba4246() {
- float res = dot(vec3(1.0f), vec3(1.0f));
+ float res = 3.0f;
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@
precision mediump float;
void dot_ba4246() {
- float res = dot(vec3(1.0f), vec3(1.0f));
+ float res = 3.0f;
}
void fragment_main() {
@@ -35,7 +35,7 @@
#version 310 es
void dot_ba4246() {
- float res = dot(vec3(1.0f), vec3(1.0f));
+ float res = 3.0f;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.msl
index be8c5ad..e127cec 100644
--- a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void dot_ba4246() {
- float res = dot(float3(1.0f), float3(1.0f));
+ float res = 3.0f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.spvasm
index 3ab1480..948070e 100644
--- a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -30,37 +30,35 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
- %v3float = OpTypeVector %float 3
- %float_1 = OpConstant %float 1
- %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+ %float_3 = OpConstant %float 3
%_ptr_Function_float = OpTypePointer Function %float
- %19 = OpTypeFunction %v4float
+ %16 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
%dot_ba4246 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
- %13 = OpDot %float %16 %16
- OpStore %res %13
+ OpStore %res %float_3
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
- %21 = OpLabel
- %22 = OpFunctionCall %void %dot_ba4246
+%vertex_main_inner = OpFunction %v4float None %16
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %dot_ba4246
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %25
+ %21 = OpLabel
+ %22 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %dot_ba4246
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %dot_ba4246
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %dot_ba4246
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %dot_ba4246
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/c11efe.wgsl b/test/tint/builtins/gen/literal/dot/c11efe.wgsl
new file mode 100644
index 0000000..b2409c4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/c11efe.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn dot(vec<3, ia>, vec<3, ia>) -> ia
+fn dot_c11efe() {
+ var res = dot(vec3(1), vec3(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_c11efe();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_c11efe();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_c11efe();
+}
diff --git a/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c35aa55
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void dot_c11efe() {
+ int res = 3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ dot_c11efe();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ dot_c11efe();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_c11efe();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c35aa55
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void dot_c11efe() {
+ int res = 3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ dot_c11efe();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ dot_c11efe();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_c11efe();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.glsl
new file mode 100644
index 0000000..0a21a3d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void dot_c11efe() {
+ int res = 3;
+}
+
+vec4 vertex_main() {
+ dot_c11efe();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void dot_c11efe() {
+ int res = 3;
+}
+
+void fragment_main() {
+ dot_c11efe();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void dot_c11efe() {
+ int res = 3;
+}
+
+void compute_main() {
+ dot_c11efe();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.msl
new file mode 100644
index 0000000..a177d81
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dot_c11efe() {
+ int res = 3;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ dot_c11efe();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ dot_c11efe();
+ return;
+}
+
+kernel void compute_main() {
+ dot_c11efe();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.spvasm
new file mode 100644
index 0000000..d2fdf7d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %dot_c11efe "dot_c11efe"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_3 = OpConstant %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %18 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %dot_c11efe = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ OpStore %res %int_3
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %dot_c11efe
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %dot_c11efe
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %dot_c11efe
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.wgsl
new file mode 100644
index 0000000..c9ace21
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/c11efe.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn dot_c11efe() {
+ var res = dot(vec3(1), vec3(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_c11efe();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_c11efe();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_c11efe();
+}
diff --git a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.dxc.hlsl
index 75f9749..546135b 100644
--- a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void dot_cd5a04() {
- float16_t res = dot((float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
+ float16_t res = float16_t(2.0h);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.glsl
index e49873a..a9e34ca 100644
--- a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.glsl
@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void dot_cd5a04() {
- float16_t res = dot(f16vec2(1.0hf), f16vec2(1.0hf));
+ float16_t res = 2.0hf;
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@
precision mediump float;
void dot_cd5a04() {
- float16_t res = dot(f16vec2(1.0hf), f16vec2(1.0hf));
+ float16_t res = 2.0hf;
}
void fragment_main() {
@@ -38,7 +38,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void dot_cd5a04() {
- float16_t res = dot(f16vec2(1.0hf), f16vec2(1.0hf));
+ float16_t res = 2.0hf;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.msl
index 01e7562..e213927 100644
--- a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void dot_cd5a04() {
- half res = dot(half2(1.0h), half2(1.0h));
+ half res = 2.0h;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.spvasm
index 0d140a4..5baab99 100644
--- a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 32
; Schema: 0
OpCapability Shader
OpCapability Float16
@@ -35,39 +35,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
- %v2half = OpTypeVector %half 2
-%half_0x1p_0 = OpConstant %half 0x1p+0
- %17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+%half_0x1p_1 = OpConstant %half 0x1p+1
%_ptr_Function_half = OpTypePointer Function %half
- %20 = OpConstantNull %half
- %21 = OpTypeFunction %v4float
+ %17 = OpConstantNull %half
+ %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_cd5a04 = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_half Function %20
- %13 = OpDot %half %17 %17
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_half Function %17
+ OpStore %res %half_0x1p_1
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
- %23 = OpLabel
- %24 = OpFunctionCall %void %dot_cd5a04
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %dot_cd5a04
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %27
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %dot_cd5a04
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %dot_cd5a04
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %33 = OpLabel
- %34 = OpFunctionCall %void %dot_cd5a04
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %dot_cd5a04
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.dxc.hlsl
index fd31033..9ab6fe7 100644
--- a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void dot_d0d179() {
- float16_t res = dot((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
+ float16_t res = float16_t(4.0h);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.glsl
index c48a12d..7654968 100644
--- a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.glsl
@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void dot_d0d179() {
- float16_t res = dot(f16vec4(1.0hf), f16vec4(1.0hf));
+ float16_t res = 4.0hf;
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@
precision mediump float;
void dot_d0d179() {
- float16_t res = dot(f16vec4(1.0hf), f16vec4(1.0hf));
+ float16_t res = 4.0hf;
}
void fragment_main() {
@@ -38,7 +38,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void dot_d0d179() {
- float16_t res = dot(f16vec4(1.0hf), f16vec4(1.0hf));
+ float16_t res = 4.0hf;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.msl
index 1110c66..82091e5 100644
--- a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void dot_d0d179() {
- half res = dot(half4(1.0h), half4(1.0h));
+ half res = 4.0h;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.spvasm
index b465609..b6182eb 100644
--- a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 32
; Schema: 0
OpCapability Shader
OpCapability Float16
@@ -35,39 +35,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
- %v4half = OpTypeVector %half 4
-%half_0x1p_0 = OpConstant %half 0x1p+0
- %17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+%half_0x1p_2 = OpConstant %half 0x1p+2
%_ptr_Function_half = OpTypePointer Function %half
- %20 = OpConstantNull %half
- %21 = OpTypeFunction %v4float
+ %17 = OpConstantNull %half
+ %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_d0d179 = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_half Function %20
- %13 = OpDot %half %17 %17
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_half Function %17
+ OpStore %res %half_0x1p_2
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
- %23 = OpLabel
- %24 = OpFunctionCall %void %dot_d0d179
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %dot_d0d179
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %27
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %dot_d0d179
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %dot_d0d179
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %33 = OpLabel
- %34 = OpFunctionCall %void %dot_d0d179
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %dot_d0d179
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.dxc.hlsl
index 65c2053..d6f5c4b 100644
--- a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void dot_e994c7() {
- uint res = dot((1u).xxxx, (1u).xxxx);
+ uint res = 4u;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.fxc.hlsl
index 65c2053..d6f5c4b 100644
--- a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void dot_e994c7() {
- uint res = dot((1u).xxxx, (1u).xxxx);
+ uint res = 4u;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.glsl
index c430e32..7254b26 100644
--- a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.glsl
@@ -1,11 +1,7 @@
#version 310 es
-uint tint_int_dot(uvec4 a, uvec4 b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
-}
-
void dot_e994c7() {
- uint res = tint_int_dot(uvec4(1u), uvec4(1u));
+ uint res = 4u;
}
vec4 vertex_main() {
@@ -24,12 +20,8 @@
#version 310 es
precision mediump float;
-uint tint_int_dot(uvec4 a, uvec4 b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
-}
-
void dot_e994c7() {
- uint res = tint_int_dot(uvec4(1u), uvec4(1u));
+ uint res = 4u;
}
void fragment_main() {
@@ -42,12 +34,8 @@
}
#version 310 es
-uint tint_int_dot(uvec4 a, uvec4 b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
-}
-
void dot_e994c7() {
- uint res = tint_int_dot(uvec4(1u), uvec4(1u));
+ uint res = 4u;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.msl
index 1939acd..f748a3c 100644
--- a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.msl
@@ -1,13 +1,8 @@
#include <metal_stdlib>
using namespace metal;
-
-template<typename T>
-T tint_dot4(vec<T,4> a, vec<T,4> b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
-}
void dot_e994c7() {
- uint res = tint_dot4(uint4(1u), uint4(1u));
+ uint res = 4u;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.spvasm
index 8a993d8..1c5c497 100644
--- a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -31,53 +31,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
- %v4uint = OpTypeVector %uint 4
- %uint_1 = OpConstant %uint 1
- %17 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+ %uint_4 = OpConstant %uint 4
%_ptr_Function_uint = OpTypePointer Function %uint
- %34 = OpConstantNull %uint
- %35 = OpTypeFunction %v4float
+ %17 = OpConstantNull %uint
+ %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_e994c7 = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %34
- %18 = OpCompositeExtract %uint %17 0
- %19 = OpCompositeExtract %uint %17 0
- %20 = OpIMul %uint %18 %19
- %21 = OpCompositeExtract %uint %17 1
- %22 = OpCompositeExtract %uint %17 1
- %23 = OpIMul %uint %21 %22
- %24 = OpIAdd %uint %20 %23
- %25 = OpCompositeExtract %uint %17 2
- %26 = OpCompositeExtract %uint %17 2
- %27 = OpIMul %uint %25 %26
- %28 = OpIAdd %uint %24 %27
- %29 = OpCompositeExtract %uint %17 3
- %30 = OpCompositeExtract %uint %17 3
- %31 = OpIMul %uint %29 %30
- %13 = OpIAdd %uint %28 %31
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_uint Function %17
+ OpStore %res %uint_4
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
- %37 = OpLabel
- %38 = OpFunctionCall %void %dot_e994c7
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %dot_e994c7
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %40 = OpLabel
- %41 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %41
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %44 = OpLabel
- %45 = OpFunctionCall %void %dot_e994c7
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %dot_e994c7
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %47 = OpLabel
- %48 = OpFunctionCall %void %dot_e994c7
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %dot_e994c7
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl
new file mode 100644
index 0000000..527f7fc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn dot(vec<4, ia>, vec<4, ia>) -> ia
+fn dot_eb9fbf() {
+ var res = dot(vec4(1), vec4(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_eb9fbf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_eb9fbf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_eb9fbf();
+}
diff --git a/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..348af30
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void dot_eb9fbf() {
+ int res = 4;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ dot_eb9fbf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ dot_eb9fbf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_eb9fbf();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..348af30
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void dot_eb9fbf() {
+ int res = 4;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ dot_eb9fbf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ dot_eb9fbf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_eb9fbf();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.glsl
new file mode 100644
index 0000000..a10a639
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void dot_eb9fbf() {
+ int res = 4;
+}
+
+vec4 vertex_main() {
+ dot_eb9fbf();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void dot_eb9fbf() {
+ int res = 4;
+}
+
+void fragment_main() {
+ dot_eb9fbf();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void dot_eb9fbf() {
+ int res = 4;
+}
+
+void compute_main() {
+ dot_eb9fbf();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.msl
new file mode 100644
index 0000000..3296741
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dot_eb9fbf() {
+ int res = 4;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ dot_eb9fbf();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ dot_eb9fbf();
+ return;
+}
+
+kernel void compute_main() {
+ dot_eb9fbf();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.spvasm
new file mode 100644
index 0000000..de51f60
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %dot_eb9fbf "dot_eb9fbf"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_4 = OpConstant %int 4
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %18 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %dot_eb9fbf = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ OpStore %res %int_4
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %dot_eb9fbf
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %dot_eb9fbf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %dot_eb9fbf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.wgsl
new file mode 100644
index 0000000..85209cec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn dot_eb9fbf() {
+ var res = dot(vec4(1), vec4(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_eb9fbf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_eb9fbf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_eb9fbf();
+}
diff --git a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.dxc.hlsl
index 570b419..dfaf584 100644
--- a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void dot_ef6b1d() {
- int res = dot((1).xxxx, (1).xxxx);
+ int res = 4;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.fxc.hlsl
index 570b419..dfaf584 100644
--- a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void dot_ef6b1d() {
- int res = dot((1).xxxx, (1).xxxx);
+ int res = 4;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.glsl
index a6ec4b0..c3359d5 100644
--- a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.glsl
@@ -1,11 +1,7 @@
#version 310 es
-int tint_int_dot(ivec4 a, ivec4 b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
-}
-
void dot_ef6b1d() {
- int res = tint_int_dot(ivec4(1), ivec4(1));
+ int res = 4;
}
vec4 vertex_main() {
@@ -24,12 +20,8 @@
#version 310 es
precision mediump float;
-int tint_int_dot(ivec4 a, ivec4 b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
-}
-
void dot_ef6b1d() {
- int res = tint_int_dot(ivec4(1), ivec4(1));
+ int res = 4;
}
void fragment_main() {
@@ -42,12 +34,8 @@
}
#version 310 es
-int tint_int_dot(ivec4 a, ivec4 b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
-}
-
void dot_ef6b1d() {
- int res = tint_int_dot(ivec4(1), ivec4(1));
+ int res = 4;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.msl
index e5e2f07..ee2bc3c 100644
--- a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.msl
@@ -1,13 +1,8 @@
#include <metal_stdlib>
using namespace metal;
-
-template<typename T>
-T tint_dot4(vec<T,4> a, vec<T,4> b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
-}
void dot_ef6b1d() {
- int res = tint_dot4(int4(1), int4(1));
+ int res = 4;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.spvasm
index 3d8c3fb..afe822c 100644
--- a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -31,53 +31,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%int = OpTypeInt 32 1
- %v4int = OpTypeVector %int 4
- %int_1 = OpConstant %int 1
- %17 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+ %int_4 = OpConstant %int 4
%_ptr_Function_int = OpTypePointer Function %int
- %34 = OpConstantNull %int
- %35 = OpTypeFunction %v4float
+ %17 = OpConstantNull %int
+ %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_ef6b1d = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %34
- %18 = OpCompositeExtract %int %17 0
- %19 = OpCompositeExtract %int %17 0
- %20 = OpIMul %int %18 %19
- %21 = OpCompositeExtract %int %17 1
- %22 = OpCompositeExtract %int %17 1
- %23 = OpIMul %int %21 %22
- %24 = OpIAdd %int %20 %23
- %25 = OpCompositeExtract %int %17 2
- %26 = OpCompositeExtract %int %17 2
- %27 = OpIMul %int %25 %26
- %28 = OpIAdd %int %24 %27
- %29 = OpCompositeExtract %int %17 3
- %30 = OpCompositeExtract %int %17 3
- %31 = OpIMul %int %29 %30
- %13 = OpIAdd %int %28 %31
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_int Function %17
+ OpStore %res %int_4
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
- %37 = OpLabel
- %38 = OpFunctionCall %void %dot_ef6b1d
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %dot_ef6b1d
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %40 = OpLabel
- %41 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %41
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %44 = OpLabel
- %45 = OpFunctionCall %void %dot_ef6b1d
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %dot_ef6b1d
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %47 = OpLabel
- %48 = OpFunctionCall %void %dot_ef6b1d
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %dot_ef6b1d
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.dxc.hlsl
index b3fde13..7454ee2 100644
--- a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void dot_f1312c() {
- int res = dot((1).xxx, (1).xxx);
+ int res = 3;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.fxc.hlsl
index b3fde13..7454ee2 100644
--- a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void dot_f1312c() {
- int res = dot((1).xxx, (1).xxx);
+ int res = 3;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.glsl
index 907adba..e076417 100644
--- a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.glsl
@@ -1,11 +1,7 @@
#version 310 es
-int tint_int_dot(ivec3 a, ivec3 b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
-}
-
void dot_f1312c() {
- int res = tint_int_dot(ivec3(1), ivec3(1));
+ int res = 3;
}
vec4 vertex_main() {
@@ -24,12 +20,8 @@
#version 310 es
precision mediump float;
-int tint_int_dot(ivec3 a, ivec3 b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
-}
-
void dot_f1312c() {
- int res = tint_int_dot(ivec3(1), ivec3(1));
+ int res = 3;
}
void fragment_main() {
@@ -42,12 +34,8 @@
}
#version 310 es
-int tint_int_dot(ivec3 a, ivec3 b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
-}
-
void dot_f1312c() {
- int res = tint_int_dot(ivec3(1), ivec3(1));
+ int res = 3;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.msl
index 5de6c94..b5181d5 100644
--- a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.msl
@@ -1,13 +1,8 @@
#include <metal_stdlib>
using namespace metal;
-
-template<typename T>
-T tint_dot3(vec<T,3> a, vec<T,3> b) {
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
-}
void dot_f1312c() {
- int res = tint_dot3(int3(1), int3(1));
+ int res = 3;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.spvasm
index 121718d..1cd4a1c 100644
--- a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -31,49 +31,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_1 = OpConstant %int 1
- %17 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %int_3 = OpConstant %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %30 = OpConstantNull %int
- %31 = OpTypeFunction %v4float
+ %17 = OpConstantNull %int
+ %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_f1312c = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %30
- %18 = OpCompositeExtract %int %17 0
- %19 = OpCompositeExtract %int %17 0
- %20 = OpIMul %int %18 %19
- %21 = OpCompositeExtract %int %17 1
- %22 = OpCompositeExtract %int %17 1
- %23 = OpIMul %int %21 %22
- %24 = OpIAdd %int %20 %23
- %25 = OpCompositeExtract %int %17 2
- %26 = OpCompositeExtract %int %17 2
- %27 = OpIMul %int %25 %26
- %13 = OpIAdd %int %24 %27
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_int Function %17
+ OpStore %res %int_3
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
- %33 = OpLabel
- %34 = OpFunctionCall %void %dot_f1312c
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %dot_f1312c
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %36 = OpLabel
- %37 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %37
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %40 = OpLabel
- %41 = OpFunctionCall %void %dot_f1312c
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %dot_f1312c
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %43 = OpLabel
- %44 = OpFunctionCall %void %dot_f1312c
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %dot_f1312c
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.dxc.hlsl
index 8df1600..ab81427 100644
--- a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void dot_fc5f7c() {
- int res = dot((1).xx, (1).xx);
+ int res = 2;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.fxc.hlsl
index 8df1600..ab81427 100644
--- a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void dot_fc5f7c() {
- int res = dot((1).xx, (1).xx);
+ int res = 2;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.glsl
index 9801dc5..d570992 100644
--- a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.glsl
@@ -1,11 +1,7 @@
#version 310 es
-int tint_int_dot(ivec2 a, ivec2 b) {
- return a[0]*b[0] + a[1]*b[1];
-}
-
void dot_fc5f7c() {
- int res = tint_int_dot(ivec2(1), ivec2(1));
+ int res = 2;
}
vec4 vertex_main() {
@@ -24,12 +20,8 @@
#version 310 es
precision mediump float;
-int tint_int_dot(ivec2 a, ivec2 b) {
- return a[0]*b[0] + a[1]*b[1];
-}
-
void dot_fc5f7c() {
- int res = tint_int_dot(ivec2(1), ivec2(1));
+ int res = 2;
}
void fragment_main() {
@@ -42,12 +34,8 @@
}
#version 310 es
-int tint_int_dot(ivec2 a, ivec2 b) {
- return a[0]*b[0] + a[1]*b[1];
-}
-
void dot_fc5f7c() {
- int res = tint_int_dot(ivec2(1), ivec2(1));
+ int res = 2;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.msl
index 6fbcb2b..4531473 100644
--- a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.msl
@@ -1,13 +1,8 @@
#include <metal_stdlib>
using namespace metal;
-
-template<typename T>
-T tint_dot2(vec<T,2> a, vec<T,2> b) {
- return a[0]*b[0] + a[1]*b[1];
-}
void dot_fc5f7c() {
- int res = tint_dot2(int2(1), int2(1));
+ int res = 2;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.spvasm
index ea9acb4..f62845f 100644
--- a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -31,45 +31,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_1 = OpConstant %int 1
- %17 = OpConstantComposite %v2int %int_1 %int_1
+ %int_2 = OpConstant %int 2
%_ptr_Function_int = OpTypePointer Function %int
- %26 = OpConstantNull %int
- %27 = OpTypeFunction %v4float
+ %17 = OpConstantNull %int
+ %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_fc5f7c = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %26
- %18 = OpCompositeExtract %int %17 0
- %19 = OpCompositeExtract %int %17 0
- %20 = OpIMul %int %18 %19
- %21 = OpCompositeExtract %int %17 1
- %22 = OpCompositeExtract %int %17 1
- %23 = OpIMul %int %21 %22
- %13 = OpIAdd %int %20 %23
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_int Function %17
+ OpStore %res %int_2
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %dot_fc5f7c
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %dot_fc5f7c
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %36 = OpLabel
- %37 = OpFunctionCall %void %dot_fc5f7c
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %dot_fc5f7c
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %39 = OpLabel
- %40 = OpFunctionCall %void %dot_fc5f7c
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %dot_fc5f7c
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot/08eb56.wgsl b/test/tint/builtins/gen/var/dot/08eb56.wgsl
new file mode 100644
index 0000000..950d853
--- /dev/null
+++ b/test/tint/builtins/gen/var/dot/08eb56.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn dot(vec<4, fa>, vec<4, fa>) -> fa
+fn dot_08eb56() {
+ const arg_0 = vec4(1.);
+ const arg_1 = vec4(1.);
+ var res = dot(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_08eb56();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_08eb56();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_08eb56();
+}
diff --git a/test/tint/builtins/gen/var/dot/0d2c2e.wgsl b/test/tint/builtins/gen/var/dot/0d2c2e.wgsl
new file mode 100644
index 0000000..5c444c5
--- /dev/null
+++ b/test/tint/builtins/gen/var/dot/0d2c2e.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn dot(vec<2, fa>, vec<2, fa>) -> fa
+fn dot_0d2c2e() {
+ const arg_0 = vec2(1.);
+ const arg_1 = vec2(1.);
+ var res = dot(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_0d2c2e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_0d2c2e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_0d2c2e();
+}
diff --git a/test/tint/builtins/gen/var/dot/14bc63.wgsl b/test/tint/builtins/gen/var/dot/14bc63.wgsl
new file mode 100644
index 0000000..c90dd8e
--- /dev/null
+++ b/test/tint/builtins/gen/var/dot/14bc63.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn dot(vec<2, ia>, vec<2, ia>) -> ia
+fn dot_14bc63() {
+ const arg_0 = vec2(1);
+ const arg_1 = vec2(1);
+ var res = dot(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_14bc63();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_14bc63();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_14bc63();
+}
diff --git a/test/tint/builtins/gen/var/dot/5a4c8f.wgsl b/test/tint/builtins/gen/var/dot/5a4c8f.wgsl
new file mode 100644
index 0000000..c20c848
--- /dev/null
+++ b/test/tint/builtins/gen/var/dot/5a4c8f.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn dot(vec<3, fa>, vec<3, fa>) -> fa
+fn dot_5a4c8f() {
+ const arg_0 = vec3(1.);
+ const arg_1 = vec3(1.);
+ var res = dot(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_5a4c8f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_5a4c8f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_5a4c8f();
+}
diff --git a/test/tint/builtins/gen/var/dot/c11efe.wgsl b/test/tint/builtins/gen/var/dot/c11efe.wgsl
new file mode 100644
index 0000000..3b6ba52
--- /dev/null
+++ b/test/tint/builtins/gen/var/dot/c11efe.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn dot(vec<3, ia>, vec<3, ia>) -> ia
+fn dot_c11efe() {
+ const arg_0 = vec3(1);
+ const arg_1 = vec3(1);
+ var res = dot(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_c11efe();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_c11efe();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_c11efe();
+}
diff --git a/test/tint/builtins/gen/var/dot/eb9fbf.wgsl b/test/tint/builtins/gen/var/dot/eb9fbf.wgsl
new file mode 100644
index 0000000..27e1ae9
--- /dev/null
+++ b/test/tint/builtins/gen/var/dot/eb9fbf.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn dot(vec<4, ia>, vec<4, ia>) -> ia
+fn dot_eb9fbf() {
+ const arg_0 = vec4(1);
+ const arg_1 = vec4(1);
+ var res = dot(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ dot_eb9fbf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ dot_eb9fbf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ dot_eb9fbf();
+}