-
Notifications
You must be signed in to change notification settings - Fork 789
[SYCL] Restore missing 'signed char' SPIR-V builtins #18807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
A previous change 23584c1 inadvertently removed SPIR-V builtins for signed char types. Fixing this uncovered several missing builtins for regular 'char' types, too. This commit re-introduces SPIR-V builtins for all three char types where appropriate. It also fixes the codegen for several cases, as seen in the clang tests where 'char' types were previously being unnecessarily promoted to int.
I tested NativeCPU with this PR (on commit 19b4465 to be precise) and it still fails to build SYCL-CTS. A complete list of the missing functions reported
|
Sorry about that. I believe I've fixed subsequently fixed the missing conversions. As for |
I do see the commits that you added after your first one, but I did not think they would affect |
Ah yep I'm also seeing I wonder if it's the |
That does seem to be the problem, yes: I see locally that the functions that are defined are
They all have |
They are defined using |
Ah, I was checking the wrong commit, whoops. Checking on 73ff319 (just before 23584c1), I see that we were previously getting
|
As the original was reverted, I will close this and open a new combined PR. |
This reapplies commit 23584c1. It also includes changes from #18807 which attempt to address the issues that led to the original revert. We were previously achieving the signed char builtin definitions in libspirv via one of two ways. The first was explicitly definining schar overloads of builtins in the source. The second was by remangling 'char' builtins to one of schar or uchar, depending on the host platform. Since we are defining our builtins in OpenCL C, the plain 'char' type is already a signed type. This presents us with the opportunity to achieve our desired schar builtins solely through remangling. The primary idea is to reduce our libclc/libspirv diff with upstream. We also have the option to introduce signed char builtins upstream. As it stands the schar problem isn't far from the 'half' mangling problem that we also now deal with purely in the remangler.
A previous change 23584c1 inadvertently removed SPIR-V builtins for signed char types. Fixing this uncovered several missing builtins for regular 'char' types, too.
This commit re-introduces SPIR-V builtins for all three char types where appropriate. It also fixes the codegen for several cases, as seen in the clang tests where 'char' types were previously being unnecessarily promoted to int.