[LLVMdev] ADDE on HW that doesn't have flags?

Daniel M Gessel gessel at apple.com
Mon Oct 27 09:15:53 PDT 2008


Thanks - that solves both problems.

In the future, HW may have built in ADDE support, but will likely  
still not have flags - it'll just read 3 registers and write two.

Any thoughts there?

Thanks,

Dan

On Oct 27, 2008, at 12:07 PM, Andrew Lenharth wrote:

> On Mon, Oct 27, 2008 at 10:11 AM, Daniel M Gessel <gessel at apple.com>  
> wrote:
>> The language I'm targeting doesn't have flags; I'd like to implement
>> ADDE as a macro or psuedo-instruction that takes 3 parameters and
>> returns 2.
>>
>> In my InstrInfo.td file, tablegen complains if I try to define
>> multiple return values; adde is defined in TargetSelectionDAG.td to  
>> be
>> a binary op that takes an extra flag in and sends an extra flag out.
>>
>> I tried to custom lower ADDE (by calling setOperationAction with
>> ISD::ADDE) but it didn't seem to register and still bailed when  
>> trying
>> to expand adde, instead of calling my LowerOperation.
>
> ADDE should only be generated if you specify ADDC as legal.  If ADDC
> is illegal, larger integer arith will be lowered to add and cmp
> sequences rather than addc adde sequences.
>
> Andrew
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list