[llvm-commits] [llvm] r62615 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

Bill Wendling isanbard at gmail.com
Tue Jan 20 13:28:53 PST 2009


On Tue, Jan 20, 2009 at 1:17 PM, Bill Wendling <isanbard at gmail.com> wrote:
> Author: void
> Date: Tue Jan 20 15:17:57 2009
> New Revision: 62615
>
> URL: http://llvm.org/viewvc/llvm-project?rev=62615&view=rev
> Log:
> Use "SINT_TO_FP" instead of "UINT_TO_FP" when getting the exponent. This was
> causing the limited precision stuff to produce the wrong result for values in
> the range [0, 1).
>
> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Tue Jan 20 15:17:57 2009
>  /// GetExponent - Get the exponent:
>  ///
> -///   (float)((Op1 >> 23) - 127);
> +///   (float)(int)(((Op & 0x7f800000) >> 23) - 127);
>  ///
>  /// where Op is the hexidecimal representation of floating point value.
>  static SDValue
>  GetExponent(SelectionDAG &DAG, SDValue Op, const TargetLowering &TLI) {
...
> -  return DAG.getNode(ISD::UINT_TO_FP, MVT::f32, t2);
> +  return DAG.getNode(ISD::SINT_TO_FP, MVT::f32, t2);

There were formatting changes, but this is the only "real" change to the code.

-bw

>  }
>
>  /// getF32Constant - Get 32-bit floating point constant.
>
>
> _______________________________________________
> 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