Bug 265343

Summary: [WGSL] dot4U8Packed, dot4I8Packed do not appear to be implemented
Product: WebKit Reporter: Mike Wyrzykowski <mwyrzykowski>
Component: WebGPUAssignee: Tadeu Zagallo <tzagallo>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Mike Wyrzykowski 2023-11-25 19:41:36 PST
[WGSL] dot4U8Packed, dot4I8Packed do not appear to be implemented
https://www.w3.org/TR/WGSL/#dot4U8Packed-builtin
https://www.w3.org/TR/WGSL/#dot4I8Packed-builtin

I think something like (pseudo-code):

fn dot4U8Packed(e1: u32, e2: u32) -> u32

    auto v1 = as_type<uint4>(e1);
    auto v2 = as_type<uint4>(e2);
    return dot(v1, v2);

would work
Comment 1 Radar WebKit Bug Importer 2023-11-25 19:41:51 PST
<rdar://problem/118796882>
Comment 2 Mike Wyrzykowski 2023-11-25 19:56:59 PST
No dot products for integer vector types in metal, so it would be something like:
    return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2] + v1[3] * v2[3];
Comment 3 Tadeu Zagallo 2024-01-09 05:08:21 PST
Pull request: https://github.com/WebKit/WebKit/pull/22508
Comment 4 EWS 2024-01-09 06:34:18 PST
Committed 272814@main (2d83031a0ec4): <https://commits.webkit.org/272814@main>

Reviewed commits have been landed. Closing PR #22508 and removing active labels.