<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex; color: rgb(102, 102, 102);" itemscope="" itemtype="https://schemas.microsoft.com/QuotedText">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>In fact there is kind of awkward story behind this, we chose __fp16 rather than _Float16, major reason is GCC supporting, and also we saw ARM/AArch64 deprecated that for a while, but _Float16 problem still there in GCC, so we decide to using __fp16 rather
 than _Float16.</span></div>
</blockquote>
<div><span style="font-family: calibri, arial, helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">I am not really following this.</span><br>
</div>
<blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex; color: rgb(102, 102, 102);" itemscope="" itemtype="https://schemas.microsoft.com/QuotedText">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>And we also considering the compatible issue there, I mean the compatibility of ACLE's __fp16, __fp16 isn't a language extension for GCC, it's a target specific type for ARM/AArch64, so if we don't define that as a formal extension types, then we have
 broken support/compiler compatibility issue on this due to GCC didn't support __fp16 as language extension.</span></div>
</blockquote>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
And am not entirely sure about this.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I don't think I have changed my mind on this topic, and I don't know what else/more I can add to what I have already mentioned.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I won't repeat my arguments, but the bottom line is that we want to deprecate __fp16, while you like to rebrand it to a native half-precision type, and I don't see how this goes together very well. I also remain unconvinced about the arguments against _Float16,
 which I think is the solution.<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I don't know what your options are now. Maybe someone else can weigh in and shine a light on this, perhaps I am missing something. I don't know if you can go ahead and make these changes if you get an LGTM from someone else, but I hope the community sees the
 problem of the same type behaving different on different targets.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Cheers,<br>
Sjoerd.<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span></span><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Kito Cheng <kito.cheng@sifive.com><br>
<b>Sent:</b> 09 March 2021 15:56<br>
<b>To:</b> Sjoerd Meijer <Sjoerd.Meijer@arm.com><br>
<b>Cc:</b> Evandro Menezes <evandro.menezes@sifive.com>; Craig Topper <craig.topper@sifive.com>; Yi-Hsiu Hsu <yihsiu.hsu@sifive.com>; Kai Wang <kai.wang@sifive.com>; Zakk Chen <zakk.chen@sifive.com>; cfe-dev@lists.llvm.org <cfe-dev@lists.llvm.org><br>
<b>Subject:</b> Re: [cfe-dev] [RFC] Having different behavior for __fp16 on RISC-V</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div class="x_gmail_quote">
<div>Hi Sjoerd:</div>
<div><br>
</div>
<div>Thanks for your reply again :)</div>
<div>  </div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<blockquote style="font-size:14px; background-color:rgb(255,255,255); border-left:3px solid rgb(200,200,200); border-top-color:rgb(200,200,200); border-right-color:rgb(200,200,200); border-bottom-color:rgb(200,200,200); padding-left:1ex; margin-left:0.8ex; color:rgb(102,102,102)">
<div style="margin:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="margin:0px; font-size:15px; background-color:rgb(255,255,255); display:inline">So what about if add a new command-line option, I saw Richard Sandiford has mentioned this but seems no follow up discussion for this point.</span><br>
</div>
</blockquote>
<div style="margin:0px; font-size:12pt; background-color:rgb(255,255,255)"><span style="margin:0px; font-size:15px; background-color:rgb(255,255,255); display:inline">Perhaps I shouldn't have mentioned this, but I believe this options is already there.<span> </span><span style="margin:0px">🙂</span></span><span style="margin:0px; font-size:15px">I
 think with cc1 option -fnative-half-type you'll get the behaviour that you want. </span><span style="font-size:15px">But having said this, my vote is against documenting and defining that this is how __fp16 works. This results in non-portable and ACLE breaking
 code.</span></div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Yeah, I know the cc1 option, it can be passed by -Xclang -fnative-half-type, and we can hide this into the clang driver, but it kind of semantic change of __fp16 for RISC-V target, we would like to add a non-cc1 option -m or -f option there rather than
 a cc1 option here.</div>
<div><br>
</div>
<div>And I can fully understand breaking ACLE is not reasonable, I think if some guy wants to break that, the guys must come from ARM not a RISC-V guys :P</div>
<div> </div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div style="margin:0px; font-size:12pt; background-color:rgb(255,255,255)"><span style="margin:0px; font-size:15px; background-color:rgb(255,255,255); display:inline">And quoting from the original RFC, I want to reiterate that this looks to me like a very bad
 motivation to change __fp16 over here in Clang:</span></div>
<blockquote style="font-size:14px; background-color:rgb(255,255,255); border-left:3px solid rgb(200,200,200); border-top-color:rgb(200,200,200); border-right-color:rgb(200,200,200); border-bottom-color:rgb(200,200,200); padding-left:1ex; margin-left:0.8ex; color:rgb(102,102,102)">
<div style="margin:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="margin:0px; font-size:15px; background-color:rgb(255,255,255); display:inline"><span style="margin:0px; font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px; background-color:rgb(255,255,255); display:inline">but</span><tt style="font-size:13px; background-color:rgba(71,87,120,0.14); border-radius:3px; padding:1px 4px; line-break:anywhere">_Float16</tt><span style="margin:0px; font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px; background-color:rgb(255,255,255); display:inline">has
 C++ supporting issues on GCC site</span></span></div>
</blockquote>
<div style="margin:0px; font-size:12pt; background-color:rgb(255,255,255)"><span style="margin:0px; font-size:15px; background-color:rgb(255,255,255); display:inline"><span style="margin:0px; font-size:11.25pt; background-color:rgb(255,255,255); display:inline">My
 alternative proposal is to fix this in GCC. This is something we want or need to fix anyway at some point, so I am guessing my Arm colleagues working on GCC would be happy to help here.</span></span></div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>In fact there is kind of awkward story behind this, we chose __fp16 rather than _Float16, major reason is GCC supporting, and also we saw ARM/AArch64 deprecated that for a while, but _Float16 problem still there in GCC, so we decide to using __fp16 rather
 than _Float16.</div>
<div><br>
</div>
<div>And we also considering the compatible issue there, I mean the compatibility of ACLE's __fp16, __fp16 isn't a language extension for GCC, it's a target specific type for ARM/AArch64, so if we don't define that as a formal extension types, then we have
 broken support/compiler compatibility issue on this due to GCC didn't support __fp16 as language extension.</div>
<div><br>
</div>
<div>RISC-V has no backward compatibility issue there so we are trying to take both compatibility and hw supporting utilization from __fp16.</div>
<div><br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
</div>
</div>
</blockquote>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div>
<div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>