[cfe-dev] sizeof(long) in OpenCL C

Erik Schnetter schnetter at gmail.com
Thu Aug 29 11:06:09 PDT 2013


Found it: <http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20121119/068491.html>.

-erik

On 2013-08-29, at 13:04 , Erik Schnetter <schnetter at gmail.com> wrote:

> Dave
> 
> Can you point me to your patch?
> 
> -erik
> 
> On 2013-08-29, at 12:44 , David Tweed <david.tweed at arm.com> wrote:
> 
>> Hi,
>> 
>> That approach would work: I did post a patch that included that, amongst
>> other OpenCL things, last year. However, it was felt that this wasn't an
>> area where the community wanted to put this in to the open source clang but
>> let different implementers do it according to their own designs in their own
>> code. If you do try this, you can use
>> 
>> if(Opts.OpenCL)....
>> 
>> to detect OpenCL. (If you look in clang there are certain uses of this to
>> deal with constant-folding/generating good error messages in cases where
>> OpenCL differs from C (mostly by being defined in more circumstances)).
>> 
>> Cheers,
>> Dave
>> 
>> -----Original Message-----
>> From: cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu] On
>> Behalf Of Erik Schnetter
>> Sent: 29 August 2013 16:42
>> To: cfe-dev at cs.uiuc.edu
>> Subject: [cfe-dev] sizeof(long) in OpenCL C
>> 
>> The OpenCL C language requires that sizeof(long)=8, independent of the
>> architecture. This is not what Clang currently implements.
>> 
>> How would I change this in clang? This issue is currently preventing
>> supporting the "long" and (as a consequence) "double" type for 32-bit
>> architectures in pocl <http://pocl.sourceforge.net/>.
>> 
>> I see that the file lib/Basic/TargetInfo.cpp defines e.g. "LongWidth =
>> LongAlign = 32;". It seems that this definition should depend on the
>> language chosen (-x cl) -- would this be the correct approach? What about
>> all the targets that inherit from TargetInfo -- should they also receive the
>> corresponding modification? How do I determine the current language in
>> Clang?
>> 
>> Or would it be better to override these values after the TargetInfo object
>> has been created? Is there already a language hook for this?
>> 
>> Any pointers, suggestions, or ideas for this would be appreciated.
>> 
>> -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/.
>> 
>> 
> 
> -- 
> 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/.
> 

-- 
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-dev/attachments/20130829/c4cfceb2/attachment.sig>


More information about the cfe-dev mailing list