This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Adding a libgcc file


On Tue, 29 May 2018, Paul Koning wrote:

> Question about proper target maintainer procedures...
> 
> The pdp11 target needs udivhi3 in libgcc.  There's udivsi3, and it's 
> really easy to tweak those files for HImode.  And that works.
> 
> Should I add the HI files to the libgcc directory, or under 
> config/pdp11?  There's nothing target specific about them, though I 
> don't know of other targets that might want this.

The existing mechanism for building libgcc functions for different types 
is LIBGCC2_UNITS_PER_WORD.  That may be defined in target .h files 
(currently those in gcc/), and also via siditi-object.mk which is used to 
build certain conversion functions for multiple types.

As I understand it, you want to build certain non-conversion functions for 
multiple type as well.  There are a few libgcc/config files that do define 
LIBGCC2_UNITS_PER_WORD to 2 before defining some L_* macros and including 
libgcc2.c, in order to define HImode functions (libgcc2.h then deals with 
getting the functions appropriately named via the definitions of __NW and 
__NDW, and getting them to use the right types via definitions of Wtype 
etc.).

So you could just add such a file to config/pdp11, or you could try to 
develop a more general mechanism for targets to select HImode functions 
they want built in libgcc and for the common build machinery then to build 
those functions (and then refactor how existing targets build such 
functions accordingly).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]