This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Adding a libgcc file
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Paul Koning <paulkoning at comcast dot net>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Thu, 31 May 2018 16:35:28 +0000
- Subject: Re: Adding a libgcc file
- References: <3C557486-765A-4A37-89CD-34F01984B2FA@comcast.net>
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