This is the mail archive of the gcc-patches@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: [PATCH 2/2, i386]: Implement TARGET_EXPAND_DIVMOD_LIBFUNC


On Thu, Nov 3, 2016 at 12:29 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> The same approach can also be used on other targets without hardware
>> divmod insn.
>
> This should be made generic instead: can't we automatically create a divmod
> libfunc for double-word mode & define a default TARGET_EXPAND_DIVMOD_LIBFUNC?
> This would save the code duplication in the ~50 back-ends...

libfunc is already implemented for all targets to use, there is also:

OPTAB_NC(sdivmod_optab, "divmod$a4", UNKNOWN)
OPTAB_NC(udivmod_optab, "udivmod$a4", UNKNOWN)

in optabs.def that can probably be changed  for generic expansion.

Uros.


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