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

Andrew Lenharth andrewl at lenharth.org
Mon Oct 27 09:30:03 PDT 2008


On Mon, Oct 27, 2008 at 11:15 AM, Daniel M Gessel <gessel at apple.com> wrote:
> 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?

Yes.  What I think should happen is flags need to be less of a hack.
There are two cases, instruction ordering/binding uses, and hidden
dataflow uses.  Modeling flags as registers on processors that have
flags is not something I am qualified to speak on (though I suspect it
would put an unnecessary compuational burdon on the scheduler and RA,
esp on x86), but seperating control and dataflow flags so that an arch
can say dataflow flags are always registers would let legalize know
that addc was <int, dataflowflag> and that on the arch dataflowflag ==
register, so it could handle fixing up the types to <int, bool>.
Right now, addc can't be legalized locally to add and cmp because the
result of legalization needs to be the same type as before.

Andrew



More information about the llvm-dev mailing list