[llvm-commits] [llvm] r44954 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/vec_ctbits.ll

Evan Cheng evan.cheng at apple.com
Wed Dec 12 14:32:00 PST 2007


On Dec 12, 2007, at 2:21 PM, Dan Gohman wrote:

>
> Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/ 
> X86ISelLowering.cpp?rev=44954&r1=44953&r2=44954&view=diff
>
> ====================================================================== 
> ========
> --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Dec 12  
> 16:21:26 2007
> @@ -483,6 +483,12 @@
>      setOperationAction(ISD::CTPOP, (MVT::ValueType)VT, Expand);
>      setOperationAction(ISD::CTTZ, (MVT::ValueType)VT, Expand);
>      setOperationAction(ISD::CTLZ, (MVT::ValueType)VT, Expand);
> +    setOperationAction(ISD::SHL, (MVT::ValueType)VT, Expand);
> +    setOperationAction(ISD::SRA, (MVT::ValueType)VT, Expand);
> +    setOperationAction(ISD::SRL, (MVT::ValueType)VT, Expand);
> +    setOperationAction(ISD::ROTL, (MVT::ValueType)VT, Expand);
> +    setOperationAction(ISD::ROTR, (MVT::ValueType)VT, Expand);
> +    setOperationAction(ISD::BSWAP, (MVT::ValueType)VT, Expand);
>    }

Hi Dan,

How do you create these nodes with vector types (in C)? I don't think  
the legalizer is capable of expanding these ops with vector types?

Evan

>
>    if (Subtarget->hasMMX()) {
>
> Added: llvm/trunk/test/CodeGen/X86/vec_ctbits.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ 
> X86/vec_ctbits.ll?rev=44954&view=auto
>
> ====================================================================== 
> ========
> --- llvm/trunk/test/CodeGen/X86/vec_ctbits.ll (added)
> +++ llvm/trunk/test/CodeGen/X86/vec_ctbits.ll Wed Dec 12 16:21:26 2007
> @@ -0,0 +1,18 @@
> +; RUN: llvm-as < %s | llc -march=x86-64
> +
> +declare <2 x i64> @llvm.cttz.v2i64(<2 x i64>)
> +declare <2 x i64> @llvm.ctlz.v2i64(<2 x i64>)
> +declare <2 x i64> @llvm.ctpop.v2i64(<2 x i64>)
> +
> +define <2 x i64> @footz(<2 x i64> %a) {
> +  %c = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a)
> +  ret <2 x i64> %c
> +}
> +define <2 x i64> @foolz(<2 x i64> %a) {
> +  %c = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a)
> +  ret <2 x i64> %c
> +}
> +define <2 x i64> @foopop(<2 x i64> %a) {
> +  %c = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
> +  ret <2 x i64> %c
> +}
>
>
> _______________________________________________
> 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