Eli Friedman wrote:> I haven't looked at the rest of the email carefully, but why aren't > you just implementing MULHU and MULHS? There's no point to > implementing the *MUL_LOHI variants if the processor doesn't have > them.I have implemented MULHU and MULHS. But if I take out my *MUL_LOHI stuff, the error I get is [~/ellcc/ellcc] main% ./nios2-elf-ecc -S test.c Cannot yet select: 0xaf93a34: i32,i32 = umul_lohi 0xaf9345c, 0xaf93924 What could I be doing to make the code generator think that umul_lohi is legal? -Rich
Richard Pennington wrote:> Eli Friedman wrote: > >> I haven't looked at the rest of the email carefully, but why aren't >> you just implementing MULHU and MULHS? There's no point to >> implementing the *MUL_LOHI variants if the processor doesn't have >> them. >> > > I have implemented MULHU and MULHS. But if I take out my *MUL_LOHI > stuff, the error I get is > > [~/ellcc/ellcc] main% ./nios2-elf-ecc -S test.c > Cannot yet select: 0xaf93a34: i32,i32 = umul_lohi 0xaf9345c, 0xaf93924 > > What could I be doing to make the code generator think that umul_lohi is > legal? > > -Rich >In your target lowering you need to set the operation action for ISD::*MUL_LOHI to expand otherwise it will be assumed to be legal. Richard
Richard Osborne wrote:> Richard Pennington wrote:> In your target lowering you need to set the operation action for > ISD::*MUL_LOHI to expand otherwise it will be assumed to be legal. > > RichardAh! Thanks! That's the bit I was missing. -Rich