Bug 177874 - SPIR-V doesn't have any 8-bit types, so WSL can't either
Summary: SPIR-V doesn't have any 8-bit types, so WSL can't either
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords:
Depends on:
Blocks: 176199
  Show dependency treegraph
 
Reported: 2017-10-04 09:16 PDT by Myles C. Maxfield
Modified: 2020-06-01 14:58 PDT (History)
4 users (show)

See Also:


Attachments
Patch (19.26 KB, patch)
2017-10-04 09:16 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2017-10-04 09:16:31 PDT
SPIR-V doesn't have any 8-bit types, so WSL can't either
Comment 1 Myles C. Maxfield 2017-10-04 09:16:59 PDT
Created attachment 322680 [details]
Patch
Comment 2 Myles C. Maxfield 2017-10-04 09:31:21 PDT
According to https://msdn.microsoft.com/en-us/library/bb509646(v=vs.85).aspx and https://www.khronos.org/registry/spir-v/specs/1.2/SPIRV.html#_a_id_capability_a_capability

- HLSL doesn't have 64-bit int types, and they're optional in SPIR-V
- HLSL requires half-precision floating point numbers, and they're optional in SPIR-V
- HLSL requires double-precision floating point numbers, and they're optional in SPIR-V (and already implemented in WSL)
Comment 3 Filip Pizlo 2017-10-04 10:54:07 PDT
(In reply to Myles C. Maxfield from comment #0)
> SPIR-V doesn't have any 8-bit types, so WSL can't either

I think you should be a bit more precise about this.

If it was merely that SPIR-V didn't support 8-bit types, then we should just say that we lower 8-bit types to 32-bit types on the fly.  This is trivial:

- Any 8-bit math operation is expressible in terms of 32-bit math operations.  Most 8-bit math operations lower to exactly one 32-bit math operation and then you ignore the high bits.  The only exceptions are right shifts, division, and modulo.

- 8-bit fields in memory can be packed into 32-bit fields, and then extracted using shifts and masking.

So, it's not correct to say that WSL "can't" have 8-bit types.  It totally can.

Maybe we don't want it to have 8-bit types, but then that's a different issue.
Comment 4 Myles C. Maxfield 2018-10-13 19:19:47 PDT
Migrated to https://github.com/gpuweb/WHLSL/issues/165
Comment 5 Maciej Stachowiak 2020-06-01 14:58:38 PDT
Comment on attachment 322680 [details]
Patch

Unflagging and obsoleting, since this has been WONTFIXEd.