<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
And to add one more thought to this, I am actually working on deprecating __fp16 because there should be no good use case for it anymore with _Float16. This means that we will deprecate the type in the ACLE, it should give a warning when it is used, and eventually
we would like to remove it in favour of _Float16. It also means that GCC would have to support _Float16. Deprecating __fp16 is work in progress but just wanted to illustrate the direction of travel.</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,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Sjoerd.<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> cfe-dev <cfe-dev-bounces@lists.llvm.org> on behalf of Sjoerd Meijer via cfe-dev <cfe-dev@lists.llvm.org><br>
<b>Sent:</b> 05 March 2021 11:53<br>
<b>To:</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>; Kito Cheng
<kito.cheng@sifive.com><br>
<b>Subject:</b> Re: [cfe-dev] [RFC] Having different behavior for __fp16 on RISC-V</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Sorry, I noticed the patch first and left a comment there.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
But repeating what I wrote there: you're redefining an existing type to behave as another type, but only for some targets. I think this is problematic and not going to help anyone. Your motivation is that the type you would like to use is not supported by GCC,
but that seems like the proper fix to me. <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)">
Cheers,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Sjoerd.<br>
</div>
<div id="x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> cfe-dev <cfe-dev-bounces@lists.llvm.org> on behalf of Kito Cheng via cfe-dev <cfe-dev@lists.llvm.org><br>
<b>Sent:</b> 05 March 2021 08:31<br>
<b>To:</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> [cfe-dev] [RFC] Having different behavior for __fp16 on RISC-V</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div class="x_x_gmail_quote">
<div dir="ltr">
<div><span style="color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px">RISC-V has a draft extension for half-precision proposed last year[1],</span><br>
</div>
<div>
<p style="margin:0px 0px 12px; padding:0px; border:0px; color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px">
so we think adding a new type for that would be great to make this<br>
easier to use that extension.</p>
<p style="margin:0px 0px 12px; padding:0px; border:0px; color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px">
We found there is <tt style="background:rgba(71,87,120,0.1); padding:1px 4px; border-radius:3px; white-space:pre-wrap; line-break:anywhere; margin-top:0px">_Float16</tt> and <tt style="background:rgba(71,87,120,0.1); padding:1px 4px; border-radius:3px; white-space:pre-wrap; line-break:anywhere">__fp16</tt> types
are supported on GCC and<br>
Clang, but <tt style="background:rgba(71,87,120,0.1); padding:1px 4px; border-radius:3px; white-space:pre-wrap; line-break:anywhere">_Float16</tt> has C++ supporting issues on GCC site, so we think<br>
support both types is a reasonable choice to us.</p>
<p style="margin:0px 0px 12px; padding:0px; border:0px; color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px">
However we would like have slight different behavior for <tt style="background:rgba(71,87,120,0.1); padding:1px 4px; border-radius:3px; white-space:pre-wrap; line-break:anywhere; margin-top:0px">__fp16</tt> other<br>
than ACLE: The evaluation format of <tt style="background:rgba(71,87,120,0.1); padding:1px 4px; border-radius:3px; white-space:pre-wrap; line-break:anywhere">__fp16</tt> set same as <tt style="background:rgba(71,87,120,0.1); padding:1px 4px; border-radius:3px; white-space:pre-wrap; line-break:anywhere">_Float16</tt>,<br>
which means no promotion are performed if there is no hardware half-precision<br>
supported.</p>
<p style="margin:0px 0px 12px; padding:0px; border:0px; color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px">
The only concern to us is it's defined differnt with clang's document,<br style="margin-top:0px">
so we would put this RFC patch here, to make sure it's OK for make<br>
<tt style="background:rgba(71,87,120,0.1); padding:1px 4px; border-radius:3px; white-space:pre-wrap; line-break:anywhere">__fp16</tt> has differnt behavior between differnt targets.</p>
<p style="margin:0px 0px 12px; padding:0px; border:0px; color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px">
This patch contains document change only, implementation would be in<br style="margin-top:0px">
other patches.</p>
<p style="margin:0px 0px 12px; padding:0px; border:0px; color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px">
[1] <a href="https://github.com/riscv/riscv-isa-manual/pull/496" rel="noreferrer" target="_blank" style="text-decoration-line:none; color:rgb(19,108,178); margin-top:0px">https://github.com/riscv/riscv-isa-manual/pull/496</a><br>
[2] <a href="https://github.com/riscv/riscv-elf-psabi-doc/pull/172" rel="noreferrer" target="_blank" style="text-decoration-line:none; color:rgb(19,108,178)">https://github.com/riscv/riscv-elf-psabi-doc/pull/172</a></p>
<p style="margin:0px 0px 12px; padding:0px; border:0px; color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px">
<br>
</p>
<div>Corresponding phabricator entry for this RFC:</div>
<p style="margin:0px 0px 12px; padding:0px; border:0px; color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px">
<a href="https://reviews.llvm.org/D98012" target="_blank">https://reviews.llvm.org/D98012</a><br>
</p>
<div></div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>