OpenCL C "long" should always have 64 bits

Erik Schnetter schnetter at gmail.com
Tue Sep 3 10:43:22 PDT 2013


On 2013-09-03, at 13:31 , Michele Scandale <michele.scandale at gmail.com> wrote:

> On 09/03/2013 07:08 PM, Tom Stellard wrote:
>> On Tue, Sep 03, 2013 at 12:45:21PM -0400, Erik Schnetter wrote:
>>> Unfortunately, removing the address space definitions means that overloaded functions do not use address spaces for name mangling. This is bad, because OpenCL C's run-time library defines many functions with signatures that differ only in their address spaces. Clang also contains test cases that explicitly assume that e.g. the "global" address space is number 1, and the "constant" address space is number 2.
>>> 
>> 
>> The name mangling works fine when compiling libclc
>> (http://libclc.llvm.org/) for the R600 target.  I'm guessing that this
>> is because R600 defines its own address space map.  Would it work to add
>> an address space map to whatever target you are using?  Or maybe a
>> default address space map that targets like R600 can override.
> 
> I'm in a quite long discussion about this topic:
> - beginning of the discussion
> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130715/084011.html
> - last part of the discussion where a small brief is reported
> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130819/086907.html
> - my last patch that introduces target independent mangling with the option for
> targets to require mangling based on the address space map
> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130826/087185.html
> 
> I'd appreciate any feedback about what has been discussed.


Michele

I agree with the reasoning in these threads, and with the proposed solutions. I like the patch. OpenCL would the override this setting (UseAddrSpaceMapMangling) for all targets, in the same way it already overrides e.g. sizeof(long).

-erik

-- 
Erik Schnetter <schnetter at gmail.com>
http://www.perimeterinstitute.ca/personal/eschnetter/

My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from http://pgp.mit.edu/.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130903/a8ec6455/attachment.sig>


More information about the cfe-commits mailing list