[PATCH] [OpenCL] fix the various -cl-* flags to relax FP arith

Pekka Jääskeläinen pekka.jaaskelainen at tut.fi
Mon Dec 8 09:10:17 PST 2014


Any further comments, or shall I commit this?

On 12/01/2014 11:33 PM, Hal Finkel wrote:
> ----- Original Message -----
>> From: "Pekka Jääskeläinen" <pekka.jaaskelainen at tut.fi>
>> To: "Matt Arsenault" <Matthew.Arsenault at amd.com>, cfe-commits at cs.uiuc.edu
>> Sent: Monday, December 1, 2014 3:19:40 PM
>> Subject: Re: [PATCH] [OpenCL] fix the various -cl-* flags to relax FP arith
>>
>> On 12/01/2014 06:13 PM, Matt Arsenault wrote:
>>> I think the test should also check for the function target
>>> attribute.
>>
>> Not sure of this as Hal said that those are being phased out.
>> I added a test for the attributes that were there already anyways,
>> but didn't add a new attribute for the no-signed-zeros.
>
> Sounds reasonable to me.
>
>   -Hal
>
>>
>>> What about the other flags? I think this patch should handle (maybe
>>> just
>>> test?) all of the CL fast math flags instead of just this one (
>>> -cl-no-signed-zeros, -cl-unsafe-math-optimizations,
>>> -cl-finite-math-only, and -cl-fast-relaxed-math)
>>
>> Done. The OpenCL flags seem to be supersets of the
>> flags of LLVM, so there might be more optimization
>> opportunities to extract from those than these flags
>> enable.
>>>
>> For example:
>>
>> "Allow optimizations for floating-point arithmetic that (a) assume
>> that
>> arguments and results are valid, (b) may violate IEEE 754 standard
>> and
>> (c) may violate the OpenCL numerical compliance requirements as
>> defined
>> in section 7.4 for single-precision floating-point, section 9.3.9 for
>> double-precision floating-point, and edge case behavior in section
>> 7.5.
>> This option includes the -cl-no-signed-zeros and -cl-mad-enable
>> options."
>> https://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clBuildProgram.html
>>
>> Now it just sets the nnans flag even though (b) and (c) allow
>> pretty much anything (if read with "lawyer's eyes").
>>
>> --
>> --Pekka
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>


-- 
--Pekka




More information about the cfe-commits mailing list