[llvm-commits] [llvm] r46681 - in /llvm/trunk: include/llvm/IntrinsicsX86.td lib/Target/X86/X86.td lib/Target/X86/X86Instr64bit.td lib/Target/X86/X86InstrInfo.td lib/Target/X86/X86InstrSSE.td lib/Target/X86/X86Subtarget.cpp lib/Target/X86/X86Subtarget.h

Chris Lattner clattner at apple.com
Mon Feb 4 10:00:48 PST 2008


On Feb 2, 2008, at 11:18 PM, Nate Begeman wrote:

> +// Vector insert
> +let TargetPrefix = "x86" in {  // All intrinsics start with  
> "llvm.x86.".
> +  def int_x86_sse41_pinsrb         :  
> GCCBuiltin<"__builtin_ia32_vec_set_v16qi">,
> +          Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty,  
> llvm_i32_ty]>;
> +  def int_x86_sse41_pinsrd         :  
> GCCBuiltin<"__builtin_ia32_vec_set_v4si">,
> +          Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty,  
> llvm_i32_ty]>;
> +  def int_x86_sse41_pinsrq         :  
> GCCBuiltin<"__builtin_ia32_vec_set_v2di">,
> +          Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty, llvm_i64_ty,  
> llvm_i32_ty]>;
> +  def int_x86_sse41_insertps       :  
> GCCBuiltin<"__builtin_ia32_insertps128">,
> +          Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  
> llvm_i32_ty]>;
> +}

Hey Nate,

I think that some of these should be lowered in the front-end into the  
corresponding llvm instruction.  For example, I think these should  
turn into insertelement instructions, and some of the other shuffles  
should turn into vector_shuffle instructions.  This relies on the code  
generator to match the operations and turn them back into the "right  
thing" which ensures that the code generator aggressively matches the  
'non intrinsic' forms of these operations when possible.

-Chris



More information about the llvm-commits mailing list