[llvm-commits] [llvm] r101075 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp test/CodeGen/X86/brcond.ll

Bill Wendling isanbard at gmail.com
Tue Apr 13 11:57:16 PDT 2010


On Apr 13, 2010, at 11:15 AM, Dan Gohman wrote:

>> Then we generate this for the "fcmp une ..."
>> 
>> 	%AL<def> = SETNPr %EFLAGS<imp-use>
>> 	%CL<def> = SETEr %EFLAGS<imp-use,kill>
>> 	TEST8rr %CL<kill>, %AL<kill>, %EFLAGS<imp-def>
>> 	JE_4 <BB#2>, %EFLAGS<imp-use>
>> 
>> Ick. I suppose we should instead be generating?
>> 
>> 	JNP_4 <BB#2>, %EFLAGS<imp-use>
>> 	JE_4 <BB#2>, %EFLAGS<imp-use>
> 
> This isn't equivalent. The first version jumps only if both conditions are
> true, the second if either one is true.
> 
Yeah, I thought about that right after I sent it. However, it seems that going from:

  JNE  L1  // Jump if not equal or
  JP   L1  // NaN
  JMP  L2
L1:

to 

  JNP  L2  // Jump if not NaN or
  JE   L2  // is equal
L1:

is okay.

-bw





More information about the llvm-commits mailing list