<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="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (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:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"\@MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=blue style='word-wrap: break-word;-webkit-nbsp-mode: space;
-webkit-line-break: after-white-space'>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>BGB/Chris,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> I need to do a similar where I
convert the 16bit floats to 32bit floats on memory operations for both scalar
and vector formats. So can these operations be implemented without adding
16 bit float support natively to LLVM? If so, how?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Chris Lattner<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, February 05, 2009
12:53 PM<br>
<b><span style='font-weight:bold'>To:</span></b> LLVM Developers Mailing List<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [LLVMdev] 16 bit
floats</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Feb 5, 2009, at 12:51 PM, BGB wrote:<o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
<o:p></o:p></span></font></p>
<span style='orphans: 2;text-align:auto;widows: 2;-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0;word-spacing:0px'><u1:smarttagtype name="City" namespaceuri="urn:schemas-microsoft-com:office:smarttags"></u1:smarttagtype><u1:smarttagtype name="place" namespaceuri="urn:schemas-microsoft-com:office:smarttags"></u1:smarttagtype><u1:smarttagtype name="address" namespaceuri="urn:schemas-microsoft-com:office:smarttags"></u1:smarttagtype>
<div vlink=purple link=blue bgcolor="#ffffff">
<div>
<p class=MsoNormal><font size=1 color=black face=Helvetica><span
style='font-size:9.0pt;font-family:Helvetica;color:black'> <o:p></o:p></span></font></p>
</div>
<blockquote style='border:none;border-left:solid black 1.5pt;padding:0in 0in 0in 4.0pt;
margin-left:3.75pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>----- Original Message -----<o:p></o:p></span></font></p>
</div>
<div style='background-image:initial;background-repeat:initial;background-attachment:
initial;-webkit-background-clip: initial;-webkit-background-origin: initial;
background-position:initial initial'>
<p class=MsoNormal style='background:#E4E4E4'><b><font size=2 color=black
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black;
font-weight:bold'>From:</span></font></b><span class=apple-converted-space><font
size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:black'> </span></font></span><font size=2 color=black face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:black'><a
href="mailto:Micah.Villmow@amd.com" title="Micah.Villmow@amd.com">Villmow,
Micah</a><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><b><font size=2 color=black face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:black;font-weight:bold'>To:</span></font></b><span
class=apple-converted-space><font size=2 color=black face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:black'> </span></font></span><font
size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:black'><a href="mailto:llvmdev@cs.uiuc.edu" title="llvmdev@cs.uiuc.edu">LLVM
Developers Mailing List</a><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><b><font size=2 color=black face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:black;font-weight:bold'>Sent:</span></font></b><span
class=apple-converted-space><font size=2 color=black face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:black'> </span></font></span><font
size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:black'>Friday, February 06, 2009 5:47 AM<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><b><font size=2 color=black face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:black;font-weight:bold'>Subject:</span></font></b><span
class=apple-converted-space><font size=2 color=black face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:black'> </span></font></span><font
size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:black'>[LLVMdev] 16 bit floats<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=1 color=black face=Helvetica><span
style='font-size:9.0pt;font-family:Helvetica;color:black'><o:p> </o:p></span></font></p>
</div>
<div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>I need to support 16 bit floats for some
operations, outside of datatypes.td and the constants class, is there anything
else I will need to modify to add f16 support?<u1:p></u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'><u1:p></u1:p> <o:p></o:p></span></font></p>
</div>
</div>
</blockquote>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'><u1:p>probably also code generation
(can't give specifics, no real expert on the LLVM codebase).</u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'><u1:p>this would be because, even if the
core typesystem knows of the type, the codegen might not know how to emit
operations on that type.</u1:p></span></font><font color=black><span
style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'><u1:p></u1:p> <o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'><u1:p>now, of note:</u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'><u1:p>in my project (not LLVM based),
float16 had not been supported directly (since it is not known to the CPU),
rather, some loader and saver thunks were used which converted to/from float32
(this used as the 'internal' representation of the type). in most cases, I
would think this would be faster than directly operating on the float16, since
the CPU supports float32, but float16 would have to be emulated.</u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'><u1:p></u1:p> <o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'><u1:p>(unless of course newer CPUs are adding
native float16 support or similar?...).</u1:p></span></font><font color=black><span
style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'><o:p> </o:p></span></font></p>
</div>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'></span><br>
Right. Micah, does your CPU support float16 operations like add/sub etc
natively?<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>-Chirs<o:p></o:p></span></font></p>
</div>
</div>
</body>
</html>