[PATCH][RFC] Come up with TARGET_HAS_FAST_MEMPCPY_ROUTINE (PR middle-end/90263).

Martin Liška mliska@suse.cz
Tue May 14 14:55:00 GMT 2019


On 5/13/19 3:07 PM, Jakub Jelinek wrote:
> On Mon, May 13, 2019 at 12:14:37PM +0200, Martin Liška wrote:
>> On 5/10/19 11:21 AM, Jakub Jelinek wrote:
>>> On Fri, May 10, 2019 at 11:04:12AM +0200, Martin Liška wrote:
>>>> --- a/gcc/config/i386/i386.h
>>>> +++ b/gcc/config/i386/i386.h
>>>> @@ -1906,6 +1906,9 @@ typedef struct ix86_args {
>>>>  
>>>>  #define CLEAR_RATIO(speed) ((speed) ? MIN (6, ix86_cost->move_ratio) : 2)
>>>>  
>>>> +/* C library provides fast implementation of mempcpy function.  */
>>>> +#define TARGET_HAS_FAST_MEMPCPY_ROUTINE 1
>>>> +
>>>
>>> 1) we shouldn't be adding further target macros, but target hooks
>>
>> Done.
>>
>>> 2) I don't think this is a property of the x86 target, but of x86 glibc,
>>>    so you should set it on x86 glibc only (i.e. i?86/x86_64 linux and hurd
>>>    when using glibc, not newlib, nor bionic/android, nor uclibc, nor musl)
>>
>> I've implemented the in i386.c with DEFAULT_LIBC == LIBC_GLIBC. Hope it's correct?
> 
> No, that would be correct only in the rare SINGLE_LIBC configurations.
> Either you can do
> #ifdef OPTION_GLIBC
>   return OPTION_GLIBC;
> #else
>   return false;
> #endif
> or define something in config/linux.h (or .[ch]) that you can then use in
> i386.c.
> 
> 	Jakub
> 

Hi.

You always have nice ideas. I'm sending updated patch which addresses both Jakub's
and Wilco's comments.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Come-up-with-has_fast_mempcpy_routine-hook-PR-middle.patch
Type: text/x-patch
Size: 7978 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190514/fdf542fd/attachment.bin>


More information about the Gcc-patches mailing list