<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV style="">Are the ICMP and FCMP instructions meant to accept vectors operands or no? Verifier excludes vectors, as does the AsmParser[1]. But the CmpInst constructor accepts vectors[2], and they are documented as allowed:</DIV><DIV style=""><BR class="khtml-block-placeholder"></DIV><DIV style=""><BLOCKQUOTE type="cite">If the operands [of icmp or fcmp] are packed typed, the elements of the vector are compared in turn and the predicate must hold for all elements.</BLOCKQUOTE></DIV><DIV style=""><BR>— Gordon<BR class="Apple-interchange-newline"> </DIV><DIV style=""><BR class="khtml-block-placeholder"></DIV><DIV style=""><BR class="khtml-block-placeholder"></DIV><DIV style="">[1]</DIV><DIV><DIV style="">% llvm-as <<'EOT' >/dev/null</DIV><DIV style="">define i1 %cmpvint(<4 x i32> %x, <4 x i32> %y) {</DIV><DIV style="">  %res = icmp eq <4 x i32> %y, %y</DIV><DIV style="">  ret %res</DIV><DIV style="">}</DIV><DIV style="">EOT</DIV><DIV style=""><B>llvm-as: <stdin>:2,0: Packed types not supported by icmp instruction</B></DIV><DIV style="">% llvm-as <<'EOT' >/dev/null</DIV><DIV style="">define i1 %cmpfint(<4 x float> %x, <4 x float> %y) {</DIV><DIV style="">  %res = fcmp oeq <4 x float> %y, %y</DIV><DIV style="">  ret %res</DIV><DIV style="">}</DIV><DIV style="">EOT</DIV><DIV style=""><B>llvm-as: <stdin>:2,0: Packed types not supported by fcmp instruction</B></DIV><DIV style=""><BR class="khtml-block-placeholder"></DIV><DIV style=""><BR class="khtml-block-placeholder"></DIV><DIV style="">[2] From CmpInst::CmpInst:</DIV><DIV style=""><BR class="khtml-block-placeholder"></DIV><DIV style="">    // Check that the operands are the right type</DIV><DIV style="">    assert(Op0Ty->isInteger() || isa<PointerType>(Op0Ty) ||</DIV><DIV style="">           (<B>isa<PackedType>(Op0Ty) && </B></DIV><DIV style=""><B>            cast<PackedType>(Op0Ty)->getElementType()->isInteger()</B>) &&</DIV><DIV style="">           "Invalid operand types for ICmp instruction");</DIV><DIV style="">...</DIV><DIV style="">  // Check that the operands are the right type</DIV><DIV style="">  assert(Op0Ty->isFloatingPoint() || (<B>isa<PackedType>(Op0Ty) &&</B></DIV><DIV style=""><B>         cast<PackedType>(Op0Ty)->getElementType()->isFloatingPoint()</B>) &&</DIV><DIV style="">         "Invalid operand types for FCmp instruction");</DIV><DIV><BR class="khtml-block-placeholder"></DIV></DIV></BODY></HTML>