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] Add a TARGET_GEN_MEMSET_VALUE hook


On Thu, Aug 18, 2016 at 5:16 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Aug 18, 2016 at 1:18 AM, Richard Biener
> <richard.guenther@gmail.com> wrote:
>> On Wed, Aug 17, 2016 at 10:11 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>>> builtin_memset_gen_str returns a register used for memset, which only
>>> supports integer registers.  But a target may use vector registers in
>>> memmset.  This patch adds a TARGET_GEN_MEMSET_VALUE hook to duplicate
>>> QImode value to mode derived from STORE_MAX_PIECES, which can be used
>>> with vector instructions.  The default hook is the same as the original
>>> builtin_memset_gen_str.  A target can override it to support vector
>>> instructions for STORE_MAX_PIECES.
>>>
>>> Tested on x86-64 and i686.  Any comments?
>>>
>>> H.J.
>>> ---
>>> gcc/
>>>
>>>         * builtins.c (builtin_memset_gen_str): Call targetm.gen_memset_value.
>>>         (default_gen_memset_value): New function.
>>>         * target.def (gen_memset_value): New hook.
>>>         * targhooks.c: Inclue "expmed.h" and "builtins.h".
>>>         (default_gen_memset_value): New function.
>>
>> I see default_gen_memset_value in builtins.c but it belongs here.
>>
>>>         * targhooks.h (default_gen_memset_value): New prototype.
>>>         * config/i386/i386.c (ix86_gen_memset_value): New function.
>>>         (TARGET_GEN_MEMSET_VALUE): New.
>>>         * config/i386/i386.h (STORE_MAX_PIECES): Likewise.
>>>         * doc/tm.texi.in: Add TARGET_GEN_MEMSET_VALUE hook.
>>>         * doc/tm.texi: Updated.
>>>
>
> Like this?

Aww, ok - I see builtins.c is a better place - sorry for the extra work.

Richard.

> H.J.


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