[llvm-commits] [llvm] r93372 - /llvm/trunk/lib/Target/X86/README.txt

Chris Lattner clattner at apple.com
Wed Jan 13 22:53:10 PST 2010


On Jan 13, 2010, at 3:45 PM, Dan Gohman wrote:

>> 
>> //===---------------------------------------------------------------------===//
>> +
>> +The X86 backend should be able to if-convert SSE comparisons like "ucomisd" to
>> +"cmpsd".  For example, this code:
>> +
>> +double d1(double x) { return x == x ? x : x + x; }
>> +
>> +Compiles into:
>> +
>> +_d1:
>> +	ucomisd	%xmm0, %xmm0
>> +	jnp	LBB1_2
>> +	addsd	%xmm0, %xmm0
> 
> Is cmpsd actually faster? With the cmpsd approach, the
> addsd must be executed unconditionally.

Right, no idea!  I suppose it would depend on how predictable the branch is, and the cost of moving the condition bits from the sse unit.

-Chris



More information about the llvm-commits mailing list