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

Eli Friedman eli.friedman at gmail.com
Mon Jun 29 22:03:00 PDT 2009


On Mon, Jun 29, 2009 at 9:20 PM, Chris Lattner<sabre at nondot.org> wrote:
>  //===---------------------------------------------------------------------===//
> +
> +It looks like we don't have patterns (or they aren't matching) for adc with
> +immediate:
> +
> +define i64 @f1(i64 %a) nounwind {
> +   %tmp = sub i64 %a, 734439407618
> +   ret i64 %tmp
> +}
> +$ llvm-as < t.ll | llc -march=x86
> +
> +_f1:
> +       movl    4(%esp), %eax
> +       addl    $4294967294, %eax
> +       movl    $4294967124, %edx
> +       adcl    8(%esp), %edx
> +       ret

The alternative is something like the following:

_f1:
       movl    4(%esp), %eax
       addl    $4294967294, %eax
       movl    8(%esp), %edx
       adcl    $4294967124, %edx
       ret

This form is slightly better because it's three bytes shorter, but
it's not a huge defect.

> +There is no need to clobber %edx there.

Huh?  We *are* returning a 64-bit value, whose top half is in %edx.

-Eli




More information about the llvm-commits mailing list