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

Dale Johannesen dalej at apple.com
Tue Apr 13 12:10:17 PDT 2010


On Apr 13, 2010, at 11:57 AMPDT, Bill Wendling wrote:

> 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.

No, if E==0 & P==0 you wind up in different places.  (I think the case E==1, P==1 should not happen; you may be able to take advantage of that.)






More information about the llvm-commits mailing list