Joseph S. Myers schrieb: > On Fri, 17 Jun 2011, Georg-Johann Lay wrote: > >> So here is my question: Would it be big deal to teach optabs to >> expand plus:di, minus:di as libcall? Maybe even compare is >> feasible? Like so: > > I don't know what the best approach would be, but for just about > any operation supported by GCC it makes sense to support expanding > it as a libcall if that's the most efficient approach for a given > target.
Using a libcall for + resp. + would we way more efficient than expanding all the carry computations inline. > Some of the generic optabs code could probably do with having > target hooks added to make it work better for the less common > targets. A libcall could be added in TARGET_INIT_LIBCALLS, so a new hook is not needed. All that's needed is that optabs tests for presence of such an entry and prefers it over inline expansion (and prefers insn over libcall). It appears that + and - are assumed to be cheaps or inline expansion is always cheap. It might already help if optabs expanded to SImode and the target could chose if expansion of some op uses word_mode or some other, more efficient mode. The big targets do not need that complexity, and who cares for tiny targets...? Johann