Title: [248814] trunk
Revision
248814
Author
sbar...@apple.com
Date
2019-08-16 21:13:06 -0700 (Fri, 16 Aug 2019)

Log Message

[WHLSL] Make "operator cast" constructors native
https://bugs.webkit.org/show_bug.cgi?id=200748

Reviewed by Myles C. Maxfield.

Source/WebCore:

Tests: webgpu/whlsl/matrix-constructors.html
       webgpu/whlsl/vector-constructors.html

* Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::inlineNativeFunction):
* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:

LayoutTests:

* webgpu/whlsl/matrix-constructors-expected.txt: Added.
* webgpu/whlsl/matrix-constructors.html: Added.
* webgpu/whlsl/vector-constructors-expected.txt: Added.
* webgpu/whlsl/vector-constructors.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (248813 => 248814)


--- trunk/LayoutTests/ChangeLog	2019-08-17 03:45:45 UTC (rev 248813)
+++ trunk/LayoutTests/ChangeLog	2019-08-17 04:13:06 UTC (rev 248814)
@@ -1,3 +1,15 @@
+2019-08-16  Saam Barati  <sbar...@apple.com>
+
+        [WHLSL] Make "operator cast" constructors native
+        https://bugs.webkit.org/show_bug.cgi?id=200748
+
+        Reviewed by Myles C. Maxfield.
+
+        * webgpu/whlsl/matrix-constructors-expected.txt: Added.
+        * webgpu/whlsl/matrix-constructors.html: Added.
+        * webgpu/whlsl/vector-constructors-expected.txt: Added.
+        * webgpu/whlsl/vector-constructors.html: Added.
+
 2019-08-16  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         [WHLSL] Enums should be shadowed by local variables

Added: trunk/LayoutTests/webgpu/whlsl/matrix-constructors-expected.txt (0 => 248814)


--- trunk/LayoutTests/webgpu/whlsl/matrix-constructors-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl/matrix-constructors-expected.txt	2019-08-17 04:13:06 UTC (rev 248814)
@@ -0,0 +1,4 @@
+
+PASS matrixConstructor 
+PASS matrixConstructor2 
+

Added: trunk/LayoutTests/webgpu/whlsl/matrix-constructors.html (0 => 248814)


--- trunk/LayoutTests/webgpu/whlsl/matrix-constructors.html	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl/matrix-constructors.html	2019-08-17 04:13:06 UTC (rev 248814)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<meta name="timeout" content="long">
+<title>matrix ctor.</title>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+const whlslTests = {};
+
+whlslTests.matrixConstructor = async () => {
+    const program = `
+        bool foo() {
+            float3x2 v = float3x2(float2(1.0, 2.0), float2(3.0, 4.0), float2(5.0, 6.0));
+            return v[0][0] == 1.0 && v[0][1] == 2.0 
+                && v[1][0] == 3.0 && v[1][1] == 4.0 
+                && v[2][0] == 5.0 && v[2][1] == 6.0;
+        }
+    `;
+
+    assert_equals(await callBoolFunction(program,  "foo", []), true);
+};
+
+whlslTests.matrixConstructor2 = async () => {
+    const program = `
+        bool foo() {
+            float3x2 v = float3x2(1.0, 2.0, 3.0, 4.0, 5.0, 6.0);
+            return v[0][0] == 1.0 && v[0][1] == 2.0 
+                && v[1][0] == 3.0 && v[1][1] == 4.0 
+                && v[2][0] == 5.0 && v[2][1] == 6.0;
+        }
+    `;
+
+    assert_equals(await callBoolFunction(program,  "foo", []), true);
+};
+
+runTests(whlslTests);
+</script>
+</html>

Added: trunk/LayoutTests/webgpu/whlsl/vector-constructors-expected.txt (0 => 248814)


--- trunk/LayoutTests/webgpu/whlsl/vector-constructors-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl/vector-constructors-expected.txt	2019-08-17 04:13:06 UTC (rev 248814)
@@ -0,0 +1,5 @@
+
+PASS vectorConstructor 
+PASS vectorConstructor2 
+PASS vectorConstructor3 
+

Added: trunk/LayoutTests/webgpu/whlsl/vector-constructors.html (0 => 248814)


--- trunk/LayoutTests/webgpu/whlsl/vector-constructors.html	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl/vector-constructors.html	2019-08-17 04:13:06 UTC (rev 248814)
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<meta name="timeout" content="long">
+<title>vector ctor.</title>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+const whlslTests = {};
+
+whlslTests.vectorConstructor = async () => {
+    const program = `
+        bool foo() {
+            float3 v = float3(float2(10.0, 11.0), 12.0);
+            return v.x == 10.0 && v.y == 11.0 && v.z == 12.0;
+        }
+    `;
+
+    assert_equals(await callBoolFunction(program,  "foo", []), true);
+};
+
+whlslTests.vectorConstructor2 = async () => {
+    const program = `
+        bool foo() {
+            float3 v = float3(10.0, float2(11.0, 12.0));
+            return v.x == 10.0 && v.y == 11.0 && v.z == 12.0;
+        }
+    `;
+
+    assert_equals(await callBoolFunction(program,  "foo", []), true);
+};
+
+whlslTests.vectorConstructor3 = async () => {
+    const program = `
+        bool foo() {
+            bool3 v = bool3(true, bool2(false, true));
+            return v.x && !v.y && v.z;
+        }
+    `;
+
+    assert_equals(await callBoolFunction(program,  "foo", []), true);
+};
+
+runTests(whlslTests);
+</script>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (248813 => 248814)


--- trunk/Source/WebCore/ChangeLog	2019-08-17 03:45:45 UTC (rev 248813)
+++ trunk/Source/WebCore/ChangeLog	2019-08-17 04:13:06 UTC (rev 248814)
@@ -1,3 +1,18 @@
+2019-08-16  Saam Barati  <sbar...@apple.com>
+
+        [WHLSL] Make "operator cast" constructors native
+        https://bugs.webkit.org/show_bug.cgi?id=200748
+
+        Reviewed by Myles C. Maxfield.
+
+        Tests: webgpu/whlsl/matrix-constructors.html
+               webgpu/whlsl/vector-constructors.html
+
+        * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
+        * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
+        (WebCore::WHLSL::Metal::inlineNativeFunction):
+        * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
+
 2019-08-16  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         [WHLSL] Enums should be shadowed by local variables

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h (248813 => 248814)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h	2019-08-17 03:45:45 UTC (rev 248813)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h	2019-08-17 04:13:06 UTC (rev 248814)
@@ -76,6 +76,22 @@
     const std::function<int64_t(int)>& formatValueFromInteger() const { return m_formatValueFromInteger; }
     const std::function<int64_t(unsigned)>& formatValueFromUnsignedInteger() const { return m_formatValueFromUnsignedInteger; }
     void iterateAllValues(const std::function<bool(int64_t)>& callback) { m_iterateAllValues(callback); }
+private:
+    unsigned matrixDimension(unsigned typeArgumentIndex)
+    {
+        ASSERT(isMatrix());
+        ASSERT(typeArguments().size() == 3);
+        return WTF::get<AST::ConstantExpression>(typeArguments()[typeArgumentIndex]).integerLiteral().value();
+    }
+public:
+    unsigned numberOfMatrixRows()
+    {
+        return matrixDimension(1);
+    }
+    unsigned numberOfMatrixColumns()
+    {
+        return matrixDimension(2);
+    }
 
     void setIsInt() { m_isInt = true; }
     void setIsNumber() { m_isNumber = true; }

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp (248813 => 248814)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp	2019-08-17 03:45:45 UTC (rev 248813)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp	2019-08-17 04:13:06 UTC (rev 248814)
@@ -122,40 +122,94 @@
 
 void inlineNativeFunction(StringBuilder& stringBuilder, AST::NativeFunctionDeclaration& nativeFunctionDeclaration, MangledVariableName returnName, const Vector<MangledVariableName>& args, Intrinsics& intrinsics, TypeNamer& typeNamer)
 {
+    auto asMatrixType = [&] (AST::UnnamedType& unnamedType) -> AST::NativeTypeDeclaration* {
+        auto& realType = unnamedType.unifyNode();
+        if (!realType.isNativeTypeDeclaration())
+            return nullptr;
+
+        auto& maybeMatrixType = downcast<AST::NativeTypeDeclaration>(realType);
+        if (maybeMatrixType.isMatrix())
+            return &maybeMatrixType;
+
+        return nullptr;
+    };
+
     if (nativeFunctionDeclaration.isCast()) {
         auto& returnType = nativeFunctionDeclaration.type();
-        auto metalReturnName = typeNamer.mangledNameForType(returnType);
+        auto metalReturnTypeName = typeNamer.mangledNameForType(returnType);
+
         if (!nativeFunctionDeclaration.parameters().size()) {
             stringBuilder.flexibleAppend(returnName, " = { };\n");
             return;
         }
 
-        ASSERT(nativeFunctionDeclaration.parameters().size() == 1);
-        auto& parameterType = *nativeFunctionDeclaration.parameters()[0]->type();
-        auto metalParameterName = typeNamer.mangledNameForType(parameterType);
-        stringBuilder.flexibleAppend("{\n", metalParameterName, " x = ", args[0], ";\n");
 
-        {
-            auto isEnumerationDefinition = [] (auto& type) {
-                return is<AST::NamedType>(type) && is<AST::EnumerationDefinition>(downcast<AST::NamedType>(type));
-            };
-            auto& unifiedReturnType = returnType.unifyNode();
-            if (isEnumerationDefinition(unifiedReturnType) && !isEnumerationDefinition(parameterType.unifyNode())) { 
-                auto& enumerationDefinition = downcast<AST::EnumerationDefinition>(downcast<AST::NamedType>(unifiedReturnType));
-                stringBuilder.append("    switch (x) {\n");
-                bool hasZeroCase = false;
-                for (auto& member : enumerationDefinition.enumerationMembers()) {
-                    hasZeroCase |= !member.get().value();
-                    stringBuilder.flexibleAppend("        case ", member.get().value(), ": break;\n");
+        if (nativeFunctionDeclaration.parameters().size() == 1) {
+            auto& parameterType = *nativeFunctionDeclaration.parameters()[0]->type();
+            auto metalParameterTypeName = typeNamer.mangledNameForType(parameterType);
+            stringBuilder.flexibleAppend("{\n", metalParameterTypeName, " x = ", args[0], ";\n");
+
+            {
+                auto isEnumerationDefinition = [] (auto& type) {
+                    return is<AST::NamedType>(type) && is<AST::EnumerationDefinition>(downcast<AST::NamedType>(type));
+                };
+                auto& unifiedReturnType = returnType.unifyNode();
+                if (isEnumerationDefinition(unifiedReturnType) && !isEnumerationDefinition(parameterType.unifyNode())) { 
+                    auto& enumerationDefinition = downcast<AST::EnumerationDefinition>(downcast<AST::NamedType>(unifiedReturnType));
+                    stringBuilder.append("    switch (x) {\n");
+                    bool hasZeroCase = false;
+                    for (auto& member : enumerationDefinition.enumerationMembers()) {
+                        hasZeroCase |= !member.get().value();
+                        stringBuilder.flexibleAppend("        case ", member.get().value(), ": break;\n");
+                    }
+                    ASSERT_UNUSED(hasZeroCase, hasZeroCase);
+                    stringBuilder.append("        default: x = 0; break; }\n");
                 }
-                ASSERT_UNUSED(hasZeroCase, hasZeroCase);
-                stringBuilder.append("        default: x = 0; break; }\n");
             }
+
+            stringBuilder.flexibleAppend(
+                returnName, " = static_cast<", metalReturnTypeName, ">(x);\n}\n");
+
+            return;
         }
 
-        stringBuilder.flexibleAppend(
-            returnName, " = static_cast<", metalReturnName, ">(x);\n}\n");
+        if (auto* matrixType = asMatrixType(returnType)) {
+            unsigned numRows = matrixType->numberOfMatrixRows();
+            unsigned numColumns = matrixType->numberOfMatrixColumns();
+            RELEASE_ASSERT(nativeFunctionDeclaration.parameters().size() == numRows || nativeFunctionDeclaration.parameters().size() == numRows * numColumns);
 
+            stringBuilder.flexibleAppend("{\n", metalReturnTypeName, " x;\n");
+
+            // We need to abide by the memory layout we use for matrices here.
+            if (nativeFunctionDeclaration.parameters().size() == numRows) {
+                // operator matrixMxN (vectorN, ..., vectorN)
+                for (unsigned i = 0; i < numRows; ++i) {
+                    for (unsigned j = 0; j < numColumns; ++j)
+                        stringBuilder.flexibleAppend("x[", j * numRows + i, "] = ", args[i], "[", j, "];\n");
+                }
+
+            } else {
+                // operator matrixMxN (scalar, ..., scalar)
+                unsigned index = 0;
+                for (unsigned i = 0; i < numRows; ++i) {
+                    for (unsigned j = 0; j < numColumns; ++j) {
+                        stringBuilder.flexibleAppend("x[", j * numRows + i, "] = ", args[index], ";\n");
+                        ++index;
+                    }
+                }
+            }
+
+            stringBuilder.flexibleAppend(returnName, " = x;\n}\n");
+            return;
+        }
+
+        stringBuilder.flexibleAppend(returnName, " = ", metalReturnTypeName, "(");
+        for (unsigned i = 0; i < nativeFunctionDeclaration.parameters().size(); ++i) {
+            if (i > 0)
+                stringBuilder.append(", ");
+            stringBuilder.flexibleAppend(args[i]);
+        }
+        stringBuilder.append(");\n");
         return;
     }
 
@@ -256,19 +310,13 @@
         ASSERT(vectorType.typeArguments().size() == 2);
         return WTF::get<AST::ConstantExpression>(vectorType.typeArguments()[1]).integerLiteral().value();
     };
-    auto matrixDimension = [&] (unsigned typeArgumentIndex) -> unsigned {
+
+    auto getMatrixType = [&] () -> AST::NativeTypeDeclaration& {
         auto& typeReference = downcast<AST::TypeReference>(*nativeFunctionDeclaration.parameters()[0]->type());
-        auto& matrixType = downcast<AST::NativeTypeDeclaration>(downcast<AST::TypeReference>(downcast<AST::TypeDefinition>(typeReference.resolvedType()).type()).resolvedType());
-        ASSERT(matrixType.name() == "matrix");
-        ASSERT(matrixType.typeArguments().size() == 3);
-        return WTF::get<AST::ConstantExpression>(matrixType.typeArguments()[typeArgumentIndex]).integerLiteral().value();
+        auto& result = downcast<AST::NativeTypeDeclaration>(downcast<AST::TypeReference>(downcast<AST::TypeDefinition>(typeReference.resolvedType()).type()).resolvedType());
+        ASSERT(result.isMatrix());
+        return result;
     };
-    auto numberOfMatrixRows = [&] {
-        return matrixDimension(1);
-    };
-    auto numberOfMatrixColumns = [&] {
-        return matrixDimension(2);
-    };
 
     if (nativeFunctionDeclaration.name() == "operator[]") {
         ASSERT(nativeFunctionDeclaration.parameters().size() == 2);
@@ -277,8 +325,8 @@
         if (numTypeArguments == 3) {
             auto metalReturnName = typeNamer.mangledNameForType(nativeFunctionDeclaration.type());
 
-            unsigned numberOfRows = numberOfMatrixRows();
-            unsigned numberOfColumns = numberOfMatrixColumns();
+            unsigned numberOfRows = getMatrixType().numberOfMatrixRows();
+            unsigned numberOfColumns = getMatrixType().numberOfMatrixColumns();
             stringBuilder.flexibleAppend("do {\n", metalReturnName, " result;\n");
 
             stringBuilder.flexibleAppend(
@@ -321,8 +369,8 @@
             auto metalParameter2Name = typeNamer.mangledNameForType(*nativeFunctionDeclaration.parameters()[1]->type());
             auto metalReturnName = typeNamer.mangledNameForType(nativeFunctionDeclaration.type());
 
-            unsigned numberOfRows = numberOfMatrixRows();
-            unsigned numberOfColumns = numberOfMatrixColumns();
+            unsigned numberOfRows = getMatrixType().numberOfMatrixRows();
+            unsigned numberOfColumns = getMatrixType().numberOfMatrixColumns();
 
             stringBuilder.flexibleAppend("do {\n", metalReturnName, " m = ", args[0], ";\n",
                 metalParameter2Name, " i = ", args[1], ";\n");
@@ -361,18 +409,6 @@
         return;
     }
 
-    auto asMatrixType = [&] (AST::UnnamedType& unnamedType) -> AST::NativeTypeDeclaration* {
-        auto& realType = unnamedType.unifyNode();
-        if (!realType.isNativeTypeDeclaration())
-            return nullptr;
-
-        auto& maybeMatrixType = downcast<AST::NativeTypeDeclaration>(realType);
-        if (maybeMatrixType.isMatrix())
-            return &maybeMatrixType;
-
-        return nullptr;
-    };
-
     if (nativeFunctionDeclaration.isOperator()) {
         auto operatorName = nativeFunctionDeclaration.name().substring("operator"_str.length());
         auto metalReturnType = typeNamer.mangledNameForType(nativeFunctionDeclaration.type());

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt (248813 => 248814)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt	2019-08-17 03:45:45 UTC (rev 248813)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt	2019-08-17 04:13:06 UTC (rev 248814)
@@ -12959,533 +12959,91 @@
 native operator int(float);
 native operator float(uint);
 native operator float(int);
+native operator int(bool);
+native operator bool(uint);
+native operator bool(int);
+native operator bool(float);
+native operator bool2(bool, bool);
+native operator bool3(bool, bool, bool);
+native operator bool3(bool2, bool);
+native operator bool3(bool, bool2);
+native operator bool4(bool, bool, bool, bool);
+native operator bool4(bool2, bool, bool);
+native operator bool4(bool, bool2, bool);
+native operator bool4(bool, bool, bool2);
+native operator bool4(bool2, bool2);
+native operator bool4(bool3, bool);
+native operator bool4(bool, bool3);
+native operator uint2(uint, uint);
+native operator uint3(uint, uint, uint);
+native operator uint3(uint2, uint);
+native operator uint3(uint, uint2);
+native operator uint4(uint, uint, uint, uint);
+native operator uint4(uint2, uint, uint);
+native operator uint4(uint, uint2, uint);
+native operator uint4(uint, uint, uint2);
+native operator uint4(uint2, uint2);
+native operator uint4(uint3, uint);
+native operator uint4(uint, uint3);
+native operator int2(int, int);
+native operator int3(int, int, int);
+native operator int3(int2, int);
+native operator int3(int, int2);
+native operator int4(int, int, int, int);
+native operator int4(int2, int, int);
+native operator int4(int, int2, int);
+native operator int4(int, int, int2);
+native operator int4(int2, int2);
+native operator int4(int3, int);
+native operator int4(int, int3);
+native operator float2(float, float);
+native operator float3(float, float, float);
+native operator float3(float2, float);
+native operator float3(float, float2);
+native operator float4(float, float, float, float);
+native operator float4(float2, float, float);
+native operator float4(float, float2, float);
+native operator float4(float, float, float2);
+native operator float4(float2, float2);
+native operator float4(float3, float);
+native operator float4(float, float3);
+native operator float2x2(float2, float2);
+native operator float2x3(float3, float3);
+native operator float2x4(float4, float4);
+native operator float3x2(float2, float2, float2);
+native operator float3x3(float3, float3, float3);
+native operator float3x4(float4, float4, float4);
+native operator float4x2(float2, float2, float2, float2);
+native operator float4x3(float3, float3, float3, float3);
+native operator float4x4(float4, float4, float4, float4);
+native operator float2x2(float, float, float, float);
+native operator float2x3(float, float, float, float, float, float);
+native operator float2x4(float, float, float, float, float, float, float, float);
+native operator float3x2(float, float, float, float, float, float);
+native operator float3x3(float, float, float, float, float, float, float, float, float);
+native operator float3x4(float, float, float, float, float, float, float, float, float, float, float, float);
+native operator float4x2(float, float, float, float, float, float, float, float);
+native operator float4x3(float, float, float, float, float, float, float, float, float, float, float, float);
+native operator float4x4(float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float);
+native operator bool2x2(bool2, bool2);
+native operator bool2x3(bool3, bool3);
+native operator bool2x4(bool4, bool4);
+native operator bool3x2(bool2, bool2, bool2);
+native operator bool3x3(bool3, bool3, bool3);
+native operator bool3x4(bool4, bool4, bool4);
+native operator bool4x2(bool2, bool2, bool2, bool2);
+native operator bool4x3(bool3, bool3, bool3, bool3);
+native operator bool4x4(bool4, bool4, bool4, bool4);
+native operator bool2x2(bool, bool, bool, bool);
+native operator bool2x3(bool, bool, bool, bool, bool, bool);
+native operator bool2x4(bool, bool, bool, bool, bool, bool, bool, bool);
+native operator bool3x2(bool, bool, bool, bool, bool, bool);
+native operator bool3x3(bool, bool, bool, bool, bool, bool, bool, bool, bool);
+native operator bool3x4(bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool);
+native operator bool4x2(bool, bool, bool, bool, bool, bool, bool, bool);
+native operator bool4x3(bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool);
+native operator bool4x4(bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool);
 
-operator int(bool x) {
-    return x ? 1 : 0;
-}
-operator bool(uint x) {
-    return x != 0;
-}
-operator bool(int x) {
-    return x != 0;
-}
-operator bool(float x) {
-    return x != 0;
-}
-
-operator bool2(bool x, bool y) {
-    bool2 result;
-    result.x = x;
-    result.y = y;
-    return result;
-}
-operator bool3(bool x, bool y, bool z) {
-    bool3 result;
-    result.x = x;
-    result.y = y;
-    result.z = z;
-    return result;
-}
-operator bool3(bool2 x, bool y) {
-    bool3 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = y;
-    return result;
-}
-operator bool3(bool x, bool2 y) {
-    bool3 result;
-    result.x = x;
-    result.y = y.x;
-    result.z = y.y;
-    return result;
-}
-operator bool4(bool x, bool y, bool z, bool w) {
-    bool4 result;
-    result.x = x;
-    result.y = y;
-    result.z = z;
-    result.w = w;
-    return result;
-}
-operator bool4(bool2 x, bool y, bool z) {
-    bool4 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = y;
-    result.w = z;
-    return result;
-}
-operator bool4(bool x, bool2 y, bool z) {
-    bool4 result;
-    result.x = x;
-    result.y = y.x;
-    result.z = y.y;
-    result.w = z;
-    return result;
-}
-operator bool4(bool x, bool y, bool2 z) {
-    bool4 result;
-    result.x = x;
-    result.y = y;
-    result.z = z.x;
-    result.w = z.y;
-    return result;
-}
-operator bool4(bool2 x, bool2 y) {
-    bool4 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = y.x;
-    result.w = y.y;
-    return result;
-}
-operator bool4(bool3 x, bool y) {
-    bool4 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = x.z;
-    result.w = y;
-    return result;
-}
-operator bool4(bool x, bool3 y) {
-    bool4 result;
-    result.x = x;
-    result.y = y.x;
-    result.z = y.y;
-    result.w = y.z;
-    return result;
-}
-operator uint2(uint x, uint y) {
-    uint2 result;
-    result.x = x;
-    result.y = y;
-    return result;
-}
-operator uint3(uint x, uint y, uint z) {
-    uint3 result;
-    result.x = x;
-    result.y = y;
-    result.z = z;
-    return result;
-}
-operator uint3(uint2 x, uint y) {
-    uint3 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = y;
-    return result;
-}
-operator uint3(uint x, uint2 y) {
-    uint3 result;
-    result.x = x;
-    result.y = y.x;
-    result.z = y.y;
-    return result;
-}
-operator uint4(uint x, uint y, uint z, uint w) {
-    uint4 result;
-    result.x = x;
-    result.y = y;
-    result.z = z;
-    result.w = w;
-    return result;
-}
-operator uint4(uint2 x, uint y, uint z) {
-    uint4 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = y;
-    result.w = z;
-    return result;
-}
-operator uint4(uint x, uint2 y, uint z) {
-    uint4 result;
-    result.x = x;
-    result.y = y.x;
-    result.z = y.y;
-    result.w = z;
-    return result;
-}
-operator uint4(uint x, uint y, uint2 z) {
-    uint4 result;
-    result.x = x;
-    result.y = y;
-    result.z = z.x;
-    result.w = z.y;
-    return result;
-}
-operator uint4(uint2 x, uint2 y) {
-    uint4 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = y.x;
-    result.w = y.y;
-    return result;
-}
-operator uint4(uint3 x, uint y) {
-    uint4 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = x.z;
-    result.w = y;
-    return result;
-}
-operator uint4(uint x, uint3 y) {
-    uint4 result;
-    result.x = x;
-    result.y = y.x;
-    result.z = y.y;
-    result.w = y.z;
-    return result;
-}
-operator int2(int x, int y) {
-    int2 result;
-    result.x = x;
-    result.y = y;
-    return result;
-}
-operator int3(int x, int y, int z) {
-    int3 result;
-    result.x = x;
-    result.y = y;
-    result.z = z;
-    return result;
-}
-operator int3(int2 x, int y) {
-    int3 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = y;
-    return result;
-}
-operator int3(int x, int2 y) {
-    int3 result;
-    result.x = x;
-    result.y = y.x;
-    result.z = y.y;
-    return result;
-}
-operator int4(int x, int y, int z, int w) {
-    int4 result;
-    result.x = x;
-    result.y = y;
-    result.z = z;
-    result.w = w;
-    return result;
-}
-operator int4(int2 x, int y, int z) {
-    int4 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = y;
-    result.w = z;
-    return result;
-}
-operator int4(int x, int2 y, int z) {
-    int4 result;
-    result.x = x;
-    result.y = y.x;
-    result.z = y.y;
-    result.w = z;
-    return result;
-}
-operator int4(int x, int y, int2 z) {
-    int4 result;
-    result.x = x;
-    result.y = y;
-    result.z = z.x;
-    result.w = z.y;
-    return result;
-}
-operator int4(int2 x, int2 y) {
-    int4 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = y.x;
-    result.w = y.y;
-    return result;
-}
-operator int4(int3 x, int y) {
-    int4 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = x.z;
-    result.w = y;
-    return result;
-}
-operator int4(int x, int3 y) {
-    int4 result;
-    result.x = x;
-    result.y = y.x;
-    result.z = y.y;
-    result.w = y.z;
-    return result;
-}
-operator float2(float x, float y) {
-    float2 result;
-    result.x = x;
-    result.y = y;
-    return result;
-}
-operator float3(float x, float y, float z) {
-    float3 result;
-    result.x = x;
-    result.y = y;
-    result.z = z;
-    return result;
-}
-operator float3(float2 x, float y) {
-    float3 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = y;
-    return result;
-}
-operator float3(float x, float2 y) {
-    float3 result;
-    result.x = x;
-    result.y = y.x;
-    result.z = y.y;
-    return result;
-}
-operator float4(float x, float y, float z, float w) {
-    float4 result;
-    result.x = x;
-    result.y = y;
-    result.z = z;
-    result.w = w;
-    return result;
-}
-operator float4(float2 x, float y, float z) {
-    float4 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = y;
-    result.w = z;
-    return result;
-}
-operator float4(float x, float2 y, float z) {
-    float4 result;
-    result.x = x;
-    result.y = y.x;
-    result.z = y.y;
-    result.w = z;
-    return result;
-}
-operator float4(float x, float y, float2 z) {
-    float4 result;
-    result.x = x;
-    result.y = y;
-    result.z = z.x;
-    result.w = z.y;
-    return result;
-}
-operator float4(float2 x, float2 y) {
-    float4 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = y.x;
-    result.w = y.y;
-    return result;
-}
-operator float4(float3 x, float y) {
-    float4 result;
-    result.x = x.x;
-    result.y = x.y;
-    result.z = x.z;
-    result.w = y;
-    return result;
-}
-operator float4(float x, float3 y) {
-    float4 result;
-    result.x = x;
-    result.y = y.x;
-    result.z = y.y;
-    result.w = y.z;
-    return result;
-}
-operator float2x2(float2 a, float2 b) {
-    float2x2 result;
-    result[0] = a;
-    result[1] = b;
-    return result;
-}
-operator float2x3(float3 a, float3 b) {
-    float2x3 result;
-    result[0] = a;
-    result[1] = b;
-    return result;
-}
-operator float2x4(float4 a, float4 b) {
-    float2x4 result;
-    result[0] = a;
-    result[1] = b;
-    return result;
-}
-operator float3x2(float2 a, float2 b, float2 c) {
-    float3x2 result;
-    result[0] = a;
-    result[1] = b;
-    result[2] = c;
-    return result;
-}
-operator float3x3(float3 a, float3 b, float3 c) {
-    float3x3 result;
-    result[0] = a;
-    result[1] = b;
-    result[2] = c;
-    return result;
-}
-operator float3x4(float4 a, float4 b, float4 c) {
-    float3x4 result;
-    result[0] = a;
-    result[1] = b;
-    result[2] = c;
-    return result;
-}
-operator float4x2(float2 a, float2 b, float2 c, float2 d) {
-    float4x2 result;
-    result[0] = a;
-    result[1] = b;
-    result[2] = c;
-    result[3] = d;
-    return result;
-}
-operator float4x3(float3 a, float3 b, float3 c, float3 d) {
-    float4x3 result;
-    result[0] = a;
-    result[1] = b;
-    result[2] = c;
-    result[3] = d;
-    return result;
-}
-operator float4x4(float4 a, float4 b, float4 c, float4 d) {
-    float4x4 result;
-    result[0] = a;
-    result[1] = b;
-    result[2] = c;
-    result[3] = d;
-    return result;
-}
-operator float2x2(float a, float b, float e, float f) {
-    return float2x2(float2(a, b), float2(e, f));
-}
-operator float2x3(float a, float b, float c, float e, float f, float g) {
-    return float2x3(float3(a, b, c), float3(e, f, g));
-}
-operator float2x4(float a, float b, float c, float d, float e, float f, float g, float h) {
-    return float2x4(float4(a, b, c, d), float4(e, f, g, h));
-}
-operator float3x2(float a, float b, float e, float f, float i, float j) {
-    return float3x2(float2(a, b), float2(e, f), float2(i, j));
-}
-operator float3x3(float a, float b, float c, float e, float f, float g, float i, float j, float k) {
-    return float3x3(float3(a, b, c), float3(e, f, g), float3(i, j, k));
-}
-operator float3x4(float a, float b, float c, float d, float e, float f, float g, float h, float i, float j, float k, float l) {
-    return float3x4(float4(a, b, c, d), float4(e, f, g, h), float4(i, j, k, l));
-}
-operator float4x2(float a, float b, float e, float f, float i, float j, float m, float n) {
-    return float4x2(float2(a, b), float2(e, f), float2(i, j), float2(m, n));
-}
-operator float4x3(float a, float b, float c, float e, float f, float g, float i, float j, float k, float m, float n, float o) {
-    return float4x3(float3(a, b, c), float3(e, f, g), float3(i, j, k), float3(m, n, o));
-}
-operator float4x4(float a, float b, float c, float d, float e, float f, float g, float h, float i, float j, float k, float l, float m, float n, float o, float p) {
-    return float4x4(float4(a, b, c, d), float4(e, f, g, h), float4(i, j, k, l), float4(m, n, o, p));
-}
-operator bool2x2(bool2 a, bool2 b) {
-    bool2x2 result;
-    result[0] = a;
-    result[1] = b;
-    return result;
-}
-operator bool2x3(bool3 a, bool3 b) {
-    bool2x3 result;
-    result[0] = a;
-    result[1] = b;
-    return result;
-}
-operator bool2x4(bool4 a, bool4 b) {
-    bool2x4 result;
-    result[0] = a;
-    result[1] = b;
-    return result;
-}
-operator bool3x2(bool2 a, bool2 b, bool2 c) {
-    bool3x2 result;
-    result[0] = a;
-    result[1] = b;
-    result[2] = c;
-    return result;
-}
-operator bool3x3(bool3 a, bool3 b, bool3 c) {
-    bool3x3 result;
-    result[0] = a;
-    result[1] = b;
-    result[2] = c;
-    return result;
-}
-operator bool3x4(bool4 a, bool4 b, bool4 c) {
-    bool3x4 result;
-    result[0] = a;
-    result[1] = b;
-    result[2] = c;
-    return result;
-}
-operator bool4x2(bool2 a, bool2 b, bool2 c, bool2 d) {
-    bool4x2 result;
-    result[0] = a;
-    result[1] = b;
-    result[2] = c;
-    result[3] = d;
-    return result;
-}
-operator bool4x3(bool3 a, bool3 b, bool3 c, bool3 d) {
-    bool4x3 result;
-    result[0] = a;
-    result[1] = b;
-    result[2] = c;
-    result[3] = d;
-    return result;
-}
-operator bool4x4(bool4 a, bool4 b, bool4 c, bool4 d) {
-    bool4x4 result;
-    result[0] = a;
-    result[1] = b;
-    result[2] = c;
-    result[3] = d;
-    return result;
-}
-operator bool2x2(bool a, bool b, bool e, bool f) {
-    return bool2x2(bool2(a, b), bool2(e, f));
-}
-operator bool2x3(bool a, bool b, bool c, bool e, bool f, bool g) {
-    return bool2x3(bool3(a, b, c), bool3(e, f, g));
-}
-operator bool2x4(bool a, bool b, bool c, bool d, bool e, bool f, bool g, bool h) {
-    return bool2x4(bool4(a, b, c, d), bool4(e, f, g, h));
-}
-operator bool3x2(bool a, bool b, bool e, bool f, bool i, bool j) {
-    return bool3x2(bool2(a, b), bool2(e, f), bool2(i, j));
-}
-operator bool3x3(bool a, bool b, bool c, bool e, bool f, bool g, bool i, bool j, bool k) {
-    return bool3x3(bool3(a, b, c), bool3(e, f, g), bool3(i, j, k));
-}
-operator bool3x4(bool a, bool b, bool c, bool d, bool e, bool f, bool g, bool h, bool i, bool j, bool k, bool l) {
-    return bool3x4(bool4(a, b, c, d), bool4(e, f, g, h), bool4(i, j, k, l));
-}
-operator bool4x2(bool a, bool b, bool e, bool f, bool i, bool j, bool m, bool n) {
-    return bool4x2(bool2(a, b), bool2(e, f), bool2(i, j), bool2(m, n));
-}
-operator bool4x3(bool a, bool b, bool c, bool e, bool f, bool g, bool i, bool j, bool k, bool m, bool n, bool o) {
-    return bool4x3(bool3(a, b, c), bool3(e, f, g), bool3(i, j, k), bool3(m, n, o));
-}
-operator bool4x4(bool a, bool b, bool c, bool d, bool e, bool f, bool g, bool h, bool i, bool j, bool k, bool l, bool m, bool n, bool o, bool p) {
-    return bool4x4(bool4(a, b, c, d), bool4(e, f, g, h), bool4(i, j, k, l), bool4(m, n, o, p));
-}
-
 /* Functions named operator.wyx */
 bool3 operator.wyx(bool4 v) {
     bool3 result;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to