[PATCH] Prefer mempcpy to memcpy on x86_64 target (PR middle-end/81657).
Martin Liška
mliska@suse.cz
Tue Mar 13 08:25:00 GMT 2018
On 03/12/2018 10:39 AM, Marc Glisse wrote:
> On Mon, 12 Mar 2018, Martin Liška wrote:
>
>> This is fix for the PR that introduces a new target macro. Using the macro
>> one can say that a target has a fast mempcpy and thus it's preferred to be used
>> if possible.
>>
>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>> I also tested on x86_64-linux-gnu.
>>
>> Ready to be installed?
>> Martin
>>
>> gcc/ChangeLog:
>>
>> 2018-03-08 Martin Liska <mliska@suse.cz>
>>
>> Â Â Â Â PR middle-end/81657
>> Â Â Â Â * builtins.c (expand_builtin_memory_copy_args): Add new
>> Â Â Â Â arguments.
>> Â Â Â Â * config/i386/i386.h (TARGET_HAS_FAST_MEMPCPY_ROUTINE):
>> Â Â Â Â New macro.
>
> Shouldn't the macro be defined in a more specific case, for instance glibc on x86? Or do all known libc on x86 happen to provide a fast mempcpy?
That's Marc a very good question. Do we already have a glibc-related target macros/hooks?
If so, I would add this as one of these.
Thanks,
Martin
>
>> Â Â Â Â * defaults.h (TARGET_HAS_FAST_MEMPCPY_ROUTINE): Likewise.
>> Â Â Â Â * doc/tm.texi: Likewise.
>> Â Â Â Â * doc/tm.texi.in: Likewise.
>> Â Â Â Â * expr.c (compare_by_pieces): Add support for bail out.
>> Â Â Â Â (emit_block_move_hints): Likewise.
>> Â Â Â Â * expr.h (emit_block_move_hints): Add new arguments.
>
More information about the Gcc-patches
mailing list