[Webkit-unassigned] [Bug 245755] New: [WGSL] Implement hex float parsing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 27 15:38:36 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=245755

            Bug ID: 245755
           Summary: [WGSL] Implement hex float parsing
           Product: WebKit
           Version: Other
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebGPU
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: djg at apple.com

WGSL doesn't support hex float parsing.

With a test, such as:

```
TEST(WGSLConstLiteralTests, AbstractFloatLiteralHex)
{
    const ConstLiteralTestCase<double> testCases[] = {
        { "0xa.fp+2"_s, 0xa.fp+2 },
        { "0X.3"_s, 0X.3p+0 },
        { "0X1.fp-4"_s, 0X1.fp-4 }
    };

    for (const auto& testCase : testCases) {
         auto parseResult = parseLCharPrimaryExpression(testCase.input);
         EXPECT_TRUE(parseResult);

         auto expr = WTFMove(*parseResult);
         EXPECT_TRUE(expr->isAbstractFloatLiteral());

         const auto& floatLiteral = downcast<WGSL::AST::AbstractFloatLiteral>(expr.get());
         EXPECT_EQ(floatLiteral.value(), testCase.expectedValue);
         auto inputLength = testCase.input.length();
         EXPECT_EQ(floatLiteral.span(), WGSL::SourceSpan(0, inputLength, inputLength, 0));
     }
}
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220927/3e11ea9d/attachment-0001.htm>


More information about the webkit-unassigned mailing list