-
Notifications
You must be signed in to change notification settings - Fork 773
[libspirv] Define schar overloads via remangling; not source #18626
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
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.
CC @wenju-he |
Does that include ARM? |
To be honest I'm not sure. It should be given the OpenCL C specification (here). I'd say that if ARM is treating |
Agreed. However, clang OpenCL has historically been maintained primarily by ARM, and I think we encountered this before in ComputeAorta. I'm not saying it's a blocker, but it may be worth checking |
Resolved via offline demonstration. LGTM |
(As discussed offline) Compiling a simple C and OpenCL C file which casts a |
thanks @frasercrmck. This is very nice. |
ping, thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, glad you addressed this legacy code
ping @intel/dpcpp-cfe-reviewers, thanks |
Whether But something seems to be resulting in a mismatch between what Clang emits and what libclc defines, at least for NativeCPU: we are now getting errors such as
when building SYCL-CTS for NativeCPU. Am I understanding correctly that the idea is what |
Yes, that's the idea, thanks for reporting the issue. I'll take a look. It might be that the |
Hmm yes, looking at I didn't change this list. It was always using I hope that adding back |
Thanks! I'm running this on our internal CI and will comment on the PR based on what results I get. |
…ntel#18626)" This reverts commit 23584c1.
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.