----- Original Message -----> From: dag at cray.com > To: "Justin Holewinski" <justin.holewinski at gmail.com> > Cc: "Hal Finkel" <hfinkel at anl.gov>, "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu> > Sent: Friday, January 11, 2013 2:13:50 PM > Subject: Re: [LLVMdev] Documentation of fmuladd intrinsic > > Justin Holewinski <justin.holewinski at gmail.com> writes: > > > Out of curiosity, what is the use-case for > > isFMAFasterThanMulAndAdd? > > If a target declares that FMA is actually slower for a given type, > > why not just declare it as illegal for that type? Wouldn't that > > accomplish the same thing without another target hook? I feel like > > I'm > > missing something here. > > It's not expressed in the code Hal posted but I suppose a target > could > have a slow fma that the user nonetheless wants to use for precision > reasons.Yes, I believe that's right. This way you can still always get an fma with the intrinsic. -Hal> > -David >-- Hal Finkel Postdoctoral Appointee Leadership Computing Facility Argonne National Laboratory
On Fri, Jan 11, 2013 at 3:16 PM, Hal Finkel <hfinkel at anl.gov> wrote:> ----- Original Message ----- > > From: dag at cray.com > > To: "Justin Holewinski" <justin.holewinski at gmail.com> > > Cc: "Hal Finkel" <hfinkel at anl.gov>, "LLVM Developers Mailing List" < > llvmdev at cs.uiuc.edu> > > Sent: Friday, January 11, 2013 2:13:50 PM > > Subject: Re: [LLVMdev] Documentation of fmuladd intrinsic > > > > Justin Holewinski <justin.holewinski at gmail.com> writes: > > > > > Out of curiosity, what is the use-case for > > > isFMAFasterThanMulAndAdd? > > > If a target declares that FMA is actually slower for a given type, > > > why not just declare it as illegal for that type? Wouldn't that > > > accomplish the same thing without another target hook? I feel like > > > I'm > > > missing something here. > > > > It's not expressed in the code Hal posted but I suppose a target > > could > > have a slow fma that the user nonetheless wants to use for precision > > reasons. > > Yes, I believe that's right. This way you can still always get an fma with > the intrinsic. >Now I'm confused. If a target declares that fmuladd is "slow" for a given type, it will be lowered to mul + add in SDAG anyway (according to this code snippet). So how could a user override this?> > -Hal > > > > > -David > > > > -- > Hal Finkel > Postdoctoral Appointee > Leadership Computing Facility > Argonne National Laboratory >-- Thanks, Justin Holewinski -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130111/4a028a31/attachment.html>
----- Original Message -----> From: "Justin Holewinski" <justin.holewinski at gmail.com> > To: "Hal Finkel" <hfinkel at anl.gov> > Cc: "David A. Greene" <dag at cray.com>, "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu> > Sent: Friday, January 11, 2013 2:19:01 PM > Subject: Re: [LLVMdev] Documentation of fmuladd intrinsic > > > On Fri, Jan 11, 2013 at 3:16 PM, Hal Finkel < hfinkel at anl.gov > > wrote: > > > > > > ----- Original Message ----- > > From: dag at cray.com > > To: "Justin Holewinski" < justin.holewinski at gmail.com > > > Cc: "Hal Finkel" < hfinkel at anl.gov >, "LLVM Developers Mailing > > List" < llvmdev at cs.uiuc.edu > > > Sent: Friday, January 11, 2013 2:13:50 PM > > Subject: Re: [LLVMdev] Documentation of fmuladd intrinsic > > > > > > Justin Holewinski < justin.holewinski at gmail.com > writes: > > > > > Out of curiosity, what is the use-case for > > > isFMAFasterThanMulAndAdd? > > > If a target declares that FMA is actually slower for a given > > > type, > > > why not just declare it as illegal for that type? Wouldn't that > > > accomplish the same thing without another target hook? I feel > > > like > > > I'm > > > missing something here. > > > > It's not expressed in the code Hal posted but I suppose a target > > could > > have a slow fma that the user nonetheless wants to use for > > precision > > reasons. > > Yes, I believe that's right. This way you can still always get an fma > with the intrinsic. > > > > Now I'm confused. If a target declares that fmuladd is "slow" for a > given type, it will be lowered to mul + add in SDAG anyway > (according to this code snippet). So how could a user override this?The user should use the fma intrinsic directly. There are now two intrinsics, fma and fmuladd. -Hal> > > > -Hal > > > > > -David > > > > > > -- > Hal Finkel > Postdoctoral Appointee > Leadership Computing Facility > Argonne National Laboratory > > > > > -- > > > Thanks, > > > Justin Holewinski-- Hal Finkel Postdoctoral Appointee Leadership Computing Facility Argonne National Laboratory