[LLVMdev] [PATCH] OpenCL half support

Anton Lokhmotov Anton.Lokhmotov at arm.com
Thu Mar 17 10:17:27 PDT 2011


Hi Chris,

So what do you think about this proposal?  If you agree, it would be good to
include the patch into the 2.9 release (to avoid breaking compatibility
later).

Best regards,
Anton.


> -----Original Message-----
> From: Anton Lokhmotov [mailto:Anton.Lokhmotov at arm.com]
> Sent: 24 February 2011 10:19
> To: 'Chris Lattner'
> Cc: llvmdev at cs.uiuc.edu; cfe-dev at cs.uiuc.edu
> Subject: RE: [LLVMdev] [PATCH] OpenCL half support
> 
> Hi Chris,
> 
> > Does the spec force evaluation to happen in half mode, or does it
> > specify that there is a promotion to float (or some other type), an
> > operation, then truncation back to half?
> 
> The last paragraph in section 9.6 says: "NOTE: Implementations may
> perform floating-point operations on half scalar or vector data types
> by converting the half values to single precision floating-point values
> and performing the operation in single precision floating-point. In
> this case, the implementation will use the half scalar or vector data
> type as a storage only format."
> 
> That is, an implementation may perform operations on half scalar and
> vector values either using half-precision operations (if supported
> natively) or using single-precision operations (always supported
> natively).  In either case, it's desirable to represent half operations
> in the IR, and let the backend make the decision.
> 
> Cheers,
> Anton. 







More information about the llvm-dev mailing list