[llvm-commits] [llvm] r44204 - in /llvm/trunk: docs/LangRef.html lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/Target/X86/X86InstrSSE.td lib/VMCore/ConstantFold.cpp lib/VMCore/Constants.cpp lib/VMCore/Instructions.cpp lib/VMCore/Verifier.cpp test/Feature/newcasts.ll

Chris Lattner clattner at apple.com
Sat Nov 17 16:09:20 PST 2007


On Nov 16, 2007, at 7:58 PM, Nate Begeman wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=44204&view=rev
> Log:
> Add support for vectors to int <-> float casts.

Hey Nate,

Very nice!  Two further requests :)

> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/Feature/newcasts.ll (original)
> +++ llvm/trunk/test/Feature/newcasts.ll Fri Nov 16 21:58:34 2007
> @@ -15,6 +15,11 @@
>   %k = bitcast i32 %a to float
>   %l = inttoptr i16 %x to i32*
>   %m = ptrtoint i32* %l to i64
> +  %n = insertelement <4 x i32> undef, i32 %a, i32 0
> +  %o = sitofp <4 x i32> %n to <4 x float>
> +  %p = uitofp <4 x i32> %n to <4 x float>
> +  %q = fptosi <4 x float> %p to <4 x i32>
> +  %r = fptoui <4 x float> %p to <4 x i32>
>   ret void
> }

Please also add an X86 codegen test for the new instructions you  
added.  Also, do we need legalizer support to turn vector uint_to_fp  
into sint_to_fp on targets that don't support it?  What happens now if  
you use uint_to_fp on x86 for example?

-Chris



More information about the llvm-commits mailing list