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.

Some of the generic optabs code could probably do with having target hooks 
added to make it work better for the less common targets.  In particular, 
there are hardcoded references to SImode on the basis that some libcalls 
only exist for SImode and wider.  Those may not be optimal for 8-bit and 
16-bit targets, and certainly would be bad if any targets with bytes 
wider than 8 bits (so SImode, which is always four bytes, wider than 32 
bits) get added in future.  Changing that might require changes to how 
libgcc is built, to build extra functions, as well as to the optabs code.

(In general *any* hardcoded reference to a machine mode other than QImode 
is suspect and likely to need fixing for non-8-bit-byte targets as well as 
potentially being suboptimal for 8-bit and 16-bit targets.  I don't know 
how many different target hooks would be needed to replace such 
hardcoding; that needs careful thought and a clear conceptual 
understanding of the purpose of each such hardcoded mode reference.)

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to