[LLVMdev] Custom lowering ADDE?
duncan.sands at math.u-psud.fr
Fri Nov 7 06:16:39 PST 2008
> Why can't I custom lower ADDE operation for legal types?
probably because no-one needed it. Feel free to add it!
> Our target does not have an add with carry instruction. We check the
> carry bit in status register and add 1 to the result if it is set.
It would also be nice (if less efficient) to have a generic code
expansion of ADDE that uses booleans (i1) rather than a flag. A
variation is to eliminate flags at this level, using only booleans,
and have them be synthesized out of boolean later, eg: automatically
understanding that the carry bit can be used for the boolean. Maybe
this is crazy, I don't know! If it worked it means that your custom
expansion would no longer be useful, since it would happen
automatically if you set the operation for ADDE to expand.
More information about the llvm-dev