> 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
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to