[llvm-commits] [llvm] r50985 - in /llvm/trunk: docs/ include/llvm/ include/llvm/Support/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/VMCore/

Dan Gohman gohman at apple.com
Mon May 12 13:01:55 PDT 2008


On May 12, 2008, at 12:01 PM, Nate Begeman wrote:

> Author: sampo
> Date: Mon May 12 14:01:56 2008
> New Revision: 50985
>
> URL: http://llvm.org/viewvc/llvm-project?rev=50985&view=rev
> Log:
> Add two new instructions to the llvm IR, vicmp and vfcmp.  see  
> updated LangRef
> for details.  CodeGen support coming in a follow up patch

Awesome!

> +<h5>Semantics:</h5>
> +<p>The '<tt>vicmp</tt>' instruction compares <tt>var1</tt> and  
> <tt>var2</tt>
> +according to the condition code given as <tt>cond</tt>. The  
> comparison yields a
> +<a href="#t_vector">vector</a> of <a href="#t_integer">integer</a>  
> result, of
> +identical type as the values being compared.  The most significant  
> bit in each
> +element is 1 if the element-wise comparison evaluates to true, and  
> is 0
> +otherwise.  All other bits of the result are undefined.  The  
> condition codes
> +are evaluated identically to the <a href="#i_icmp">'<tt>icmp</tt>'
> +instruction</a>.

It would be neat to overload the existing fcmp and icmp instead of
introducing new instructions. But vicmp and vfcmp address a real
need today without requiring the codegen to perform a bunch of magic
on vectors of i1 to make this approach work well on current targets.

Fortunately, nothing here rules out extending fcmp and icmp in the
future :-).

Dan




More information about the llvm-commits mailing list