[LLVMdev] branch on vector compare?

Stephen suasol at gmail.com
Sun Sep 2 15:40:52 PDT 2012


Hi all, llvm newbie here.

I'm trying to branch based on a vector compare. I've found a slow way (below) 
which goes through memory. Is there some idiom I'm missing so that it would use 
for instance movmsk for SSE or vcmpgt & cr6 for altivec?

Or do I need to resort to calling the intrinsic directly? 

Thanks,
Stephen.

  %16 = fcmp ogt <4 x float> %15, %cr
  %17 = extractelement <4 x i1> %16, i32 0
  %18 = extractelement <4 x i1> %16, i32 1
  %19 = extractelement <4 x i1> %16, i32 2
  %20 = extractelement <4 x i1> %16, i32 3
  %21 = or i1 %17, %18
  %22 = or i1 %19, %20
  %23 = or i1 %21, %22
  br i1 %23, label %true1, label %false2




More information about the llvm-dev mailing list