[llvm-commits] [llvm] r98524 - /llvm/trunk/docs/LangRef.html

Daniel Dunbar daniel at zuster.org
Sun Mar 14 20:44:52 PDT 2010


On Sun, Mar 14, 2010 at 4:03 PM, Chris Lattner <sabre at nondot.org> wrote:
> Author: lattner
> Date: Sun Mar 14 18:03:31 2010
> New Revision: 98524
>
> URL: http://llvm.org/viewvc/llvm-project?rev=98524&view=rev
> Log:
> tidy up and expound more on how half-float works.
>
> Modified:
>    llvm/trunk/docs/LangRef.html
>
> Modified: llvm/trunk/docs/LangRef.html
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=98524&r1=98523&r2=98524&view=diff
> ==============================================================================
> --- llvm/trunk/docs/LangRef.html (original)
> +++ llvm/trunk/docs/LangRef.html Sun Mar 14 18:03:31 2010
> @@ -257,8 +257,8 @@
>       </li>
>       <li><a href="#int_fp16">Half Precision Floating Point Intrinsics</a>
>         <ol>
> -          <li><a href="#int_to_fp16">'<tt>llvm.convert.to.fp16</tt>' Intrinsic</a></li>
> -          <li><a href="#int_from_fp16">'<tt>llvm.conver.from.fp16</tt>' Intrinsic</a></li>
> +          <li><a href="#int_convert_to_fp16">'<tt>llvm.convert.to.fp16</tt>' Intrinsic</a></li>
> +          <li><a href="#int_convert_from_fp16">'<tt>llvm.convert.from.fp16</tt>' Intrinsic</a></li>
>         </ol>
>       </li>
>       <li><a href="#int_debugger">Debugger intrinsics</a></li>
> @@ -6619,16 +6619,23 @@
>
>  <div class="doc_text">
>
> -<p>Half precision floating point is storage-only format. That is why the values
> -  in such format should be promoted to single precision format before any
> -  operations. LLVM provides intrinsics for conversions to single precision and
> -  back.</p>
> -
> +<p>Half precision floating point is storage-only format. This means that it is

... is a ...

> +   an encoding (typically for density in memory) but typically does not support

... dense encoding but does ... is clearer.

> +   computation in the format.</p>
> +
> +<p>This means that you code must first load the half-precision floating point
> +   value as an i16, then convert it to float with <a
> +   href="#int_convert_from_fp16"><tt>llvm.convert.from.fp16</tt></a>.
> +   Computation can then be performed on the float value (including extending to
> +   double etc).  When the value is ready to be stored back to memory, this is
> +   done by converting to float if needed, then converting to i16 with
> +   <a href="#int_convert_to_fp16"><tt>llvm.convert.to.fp16</tt></a>, then
> +   storing as an i16 value.</p>

Awkward wording...

s/This means that you code/Code/?
s/When the value is ready to be stored back to memory, this/To store
back to memory.../?

>  </div>
>
>  <!-- _______________________________________________________________________ -->
>  <div class="doc_subsubsection">
> -  <a name="int_to_fp16">'<tt>llvm.convert.to.fp16</tt>' Intrinsic</a>
> +  <a name="int_convert_to_fp16">'<tt>llvm.convert.to.fp16</tt>' Intrinsic</a>
>  </div>
>
>  <div class="doc_text">
> @@ -6650,8 +6657,8 @@
>  <h5>Semantics:</h5>
>  <p>The '<tt>llvm.convert.to.fp16</tt>' intrinsic function performs
>    a conversion from single precision floating point format to half precision
> -   floating point format. Since the format is storage only the return value is
> -   just an <tt>i16</tt> which contains the converted number.</p>
> +   floating point format. The return value is just an <tt>i16</tt> which

s/just//

> +   contains the converted number.</p>
>
>  <h5>Examples:</h5>
>  <pre>
> @@ -6663,7 +6670,7 @@
>
>  <!-- _______________________________________________________________________ -->
>  <div class="doc_subsubsection">
> -  <a name="int_from_fp16">'<tt>llvm.convert.from.fp16</tt>' Intrinsic</a>
> + <a name="int_convert_from_fp16">'<tt>llvm.convert.from.fp16</tt>' Intrinsic</a>
>  </div>
>
>  <div class="doc_text">
> @@ -6684,9 +6691,9 @@
>
>  <h5>Semantics:</h5>
>  <p>The '<tt>llvm.convert.from.fp16</tt>' intrinsic function performs a
> -   conversion from half single precision floating point format to signle
> -   precision floating point format. Since the format is storage only the
> -   argument is represented by an <tt>i16</tt> value.</p>
> +   conversion from half single precision floating point format to signgle

s/signgle/single/

 - Daniel

> +   precision floating point format. The input half-float value is represented by
> +   an <tt>i16</tt> value.</p>
>
>  <h5>Examples:</h5>
>  <pre>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list