[PATCH] Handle sqrt() shrinking in SimplifyLibCalls like any other call

Stephen Canon scanon at apple.com
Thu Oct 23 13:26:47 PDT 2014


> On Oct 23, 2014, at 3:57 PM, Hal Finkel <hfinkel at anl.gov> wrote:
> 
> ----- Original Message -----
>> From: "Hal Finkel" <hfinkel at anl.gov <mailto:hfinkel at anl.gov>>
>> To: "Stephen Canon" <scanon at apple.com <mailto:scanon at apple.com>>
>> Cc: llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>, spatel at rotateright.com <mailto:spatel at rotateright.com>, beanz at apple.com <mailto:beanz at apple.com>,
>> reviews+D5919+public+763adead774985f1 at reviews.llvm.org <mailto:reviews+D5919+public+763adead774985f1 at reviews.llvm.org>
>> Sent: Thursday, October 23, 2014 2:51:34 PM
>> Subject: Re: [PATCH] Handle sqrt() shrinking in SimplifyLibCalls like any other call
>> 
>> ----- Original Message -----
>>> From: "Stephen Canon" <scanon at apple.com>
>>> To: "Hal Finkel" <hfinkel at anl.gov>
>>> Cc: llvm-commits at cs.uiuc.edu, spatel at rotateright.com,
>>> beanz at apple.com,
>>> reviews+D5919+public+763adead774985f1 at reviews.llvm.org
>>> Sent: Thursday, October 23, 2014 2:46:17 PM
>>> Subject: Re: [PATCH] Handle sqrt() shrinking in SimplifyLibCalls
>>> like any other call
>>> 
>>> (float)sqrt((double)x) —> sqrtf(x) is a valid transformation [See
>>> Sam
>>> Figueroa’s thesis for details].
>> 
>> Does this assume that the sqrtf is correct to <= 0.5ulps?
> 
> I suppose that C99 F.3 does say that, "The sqrt functions in <math.h> provide the IEC 60559 square root operation.", so perhaps this is a safe assumption on a compliant system.
> 
> Alright, Sanjay, go ahead. You're not actually changing anything. ;)

Yeah, I would say that a system without a correctly rounded sqrtf is broken.  (But: Annex F is not required).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141023/9592d88f/attachment.html>


More information about the llvm-commits mailing list