<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">I’m not sure what the ulp is for the full fdiv expansions, so I’m not sure<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-Matt<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">"Fang, Changpeng" <Changpeng.Fang@amd.com><br>
<b>Date: </b>Thursday, January 30, 2020 at 18:22<br>
<b>To: </b>Changpeng Fang via Phabricator <reviews@reviews.llvm.org>, "Arsenault, Matthew" <Matthew.Arsenault@amd.com>, Brian Sumner <Brian.Sumner@amd.com><br>
<b>Cc: </b>Konstantin Zhuravlyov <Konstantin.Zhuravlyov@amd.com>, "jv356@scarletmail.rutgers.edu" <jv356@scarletmail.rutgers.edu>, Wei Ding <wei.ding2@amd.com>, "nhaehnle@gmail.com" <nhaehnle@gmail.com>, "Liu, Yaxun (Sam)" <Yaxun.Liu@amd.com>, "Stuttard, David"
 <David.Stuttard@amd.com>, "tpr.ll@botech.co.uk" <tpr.ll@botech.co.uk>, Tony Tye <Tony.Tye@amd.com>, "hiraditya@msn.com" <hiraditya@msn.com>, "Kerbow, Austin" <Austin.Kerbow@amd.com>, "llvm-commits@lists.llvm.org" <llvm-commits@lists.llvm.org>, "jun.l@samsung.com"
 <jun.l@samsung.com><br>
<b>Subject: </b>Re: [PATCH] D73588: AMDGPU: Enhancement on FDIV lowering in AMDGPUCodeGenPrepare<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p style="margin:15.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">>// Faster 2.5 ULP division that does not support denormals.<br>
>SDValue SITargetLowering::lowerFDIV_FAST(SDValue Op, SelectionDAG &DAG) const {<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Also, it is the case that fdiv.fast generates "Faster 2.5 ULP division that does not support denormals"?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">So we should still use 2.5ULP for fdiv.fast, and 1.0ULP for rcp?
<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="0" width="100%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Changpeng Fang via Phabricator <reviews@reviews.llvm.org><br>
<b>Sent:</b> Thursday, January 30, 2020 3:16 PM<br>
<b>To:</b> Fang, Changpeng <Changpeng.Fang@amd.com>; Arsenault, Matthew <Matthew.Arsenault@amd.com>; Sumner, Brian <Brian.Sumner@amd.com><br>
<b>Cc:</b> Zhuravlyov, Konstantin <Konstantin.Zhuravlyov@amd.com>; jv356@scarletmail.rutgers.edu <jv356@scarletmail.rutgers.edu>; wei.ding2@amd.com <wei.ding2@amd.com>; nhaehnle@gmail.com <nhaehnle@gmail.com>; Liu, Yaxun (Sam) <Yaxun.Liu@amd.com>; Stuttard,
 David <David.Stuttard@amd.com>; tpr.ll@botech.co.uk <tpr.ll@botech.co.uk>; Tye, Tony <Tony.Tye@amd.com>; hiraditya@msn.com <hiraditya@msn.com>; Kerbow, Austin <Austin.Kerbow@amd.com>; llvm-commits@lists.llvm.org <llvm-commits@lists.llvm.org>; jun.l@samsung.com
 <jun.l@samsung.com><br>
<b>Subject:</b> [PATCH] D73588: AMDGPU: Enhancement on FDIV lowering in AMDGPUCodeGenPrepare</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">[CAUTION: External Email]<br>
<br>
cfang marked 2 inline comments as done.<br>
cfang added inline comments.<br>
<br>
<br>
================<br>
Comment at: llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp:714<br>
   const bool UseFDivFast = Ty->isFloatTy() && !NeedHighAccuracy &&<br>
-                           !FastUnsafeRcpLegal;<br>
+                           !CanReassociateFDiv;<br>
<br>
----------------<br>
arsenm wrote:<br>
> cfang wrote:<br>
> > arsenm wrote:<br>
> > > fdiv.fast doesn't' care about the reassociation<br>
> > You are right. This is just the optimization priority issue.<br>
> ><br>
> > If we can reassociate fdiv, x/y -> x * rcp(y) is faster than fdiv.fast so we don't do fdiv.fast.<br>
> The comment and variable name are misleading, as no reassociate is going on here. This needs an explanation here<br>
I am going to write an explanation here.<br>
But I am confused about fdiv.fast intrinsic:<br>
1.0/x -> fdiv.fast (1.0,  x) when denormals are supported. Because I think  does not support fdiv.fast.<br>
<br>
<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD73588%2Fnew%2F&amp;data=02%7C01%7Cchangpeng.fang%40amd.com%7C660361b4057148f8121408d7a5da795d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637160230080757711&amp;sdata=GK5h%2FmYTfaCd3pS79GxznvSwoc99KN8Q61MYwnObyrI%3D&amp;reserved=0">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD73588%2Fnew%2F&amp;data=02%7C01%7Cchangpeng.fang%40amd.com%7C660361b4057148f8121408d7a5da795d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637160230080757711&amp;sdata=GK5h%2FmYTfaCd3pS79GxznvSwoc99KN8Q61MYwnObyrI%3D&amp;reserved=0</a><br>
<br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD73588&amp;data=02%7C01%7Cchangpeng.fang%40amd.com%7C660361b4057148f8121408d7a5da795d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637160230080767705&amp;sdata=ZOnn6PlbKVDMovSzNXJ316mvyOa7fyqpr%2BUhRGl7bMc%3D&amp;reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD73588&amp;data=02%7C01%7Cchangpeng.fang%40amd.com%7C660361b4057148f8121408d7a5da795d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637160230080767705&amp;sdata=ZOnn6PlbKVDMovSzNXJ316mvyOa7fyqpr%2BUhRGl7bMc%3D&amp;reserved=0</a><br>
<br>
<br>
<o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>