[llvm-commits] [llvm] r42661 - in /llvm/trunk/lib/Target/X86: X86InstrInfo.cpp X86InstrInfo.td X86InstrX86-64.td

Evan Cheng evan.cheng at apple.com
Sat Oct 6 15:07:19 PDT 2007


Not crazy at all. If I had any sense at all I would have done that  
back then. :) I'll make that clean up one of these days.

Evan

On Oct 5, 2007, at 4:45 PM, Chris Lattner <clattner at apple.com> wrote:

>> URL: http://llvm.org/viewvc/llvm-project?rev=42661&view=rev
>> Log:
>> Commute x86 cmove instructions by swapping the operands and change
>> the condition
>> to its inverse.
>> Testing this as llcbeta
>
> Random crazy idea:
>
>> +def CMOVB16rm : I<0x42, MRMSrcMem,       // if <u, GR16 = [mem16]
>> +                  (outs GR16:$dst), (ins GR16:$src1, i16mem:$src2),
>> +                  "cmovb\t{$src2, $dst|$dst, $src2}",
>> +                  [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16
>> addr:$src2),
>> +                                   X86_COND_B, EFLAGS))]>,
>> +                  TB, OpSize;
>
> Instead of having one instruction for each comparison code, would it
> make sense to have one "CMOV16rm" that took the condcode as an
> immediate argument?  If you had that, you could change the comparison
> just by twiddling the immediate operand and wouldn't have a bazillion
> CMOV instructions.
>
> -Chris
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list