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] Replace const_vector with match_operand in sse.md


I changed the patch according Uros' remarks. Please, have a look.

Changelog:

2012-10-30  Andrey Turetskiy  <andrey.turetskiy@gmail.com>

       * config/i386/i386.c (bdesc_args): Rename CODE_FOR_avx2_umulhrswv16hi3 to
       CODE_FOR_avx2_pmulhrswv16hi3.
       * config/i386/predicates.md (const1_operand): Extend for vectors.
       * config/i386/sse.md (ssse3_avx2): Extend.
       (ssedoublemode): Ditto.
       (<sse2_avx2>_uavg<mode>3): Merge avx2_uavgv32qi3, sse2_uavgv16qi3,
       avx2_uavgv16hi3 and sse2_uavgv8hi3 into one.
       (*<sse2_avx2>_uavg<mode>3): Merge *avx2_uavgv32qi3, *sse2_uavgv16qi3,
       *avx2_uavgv16hi3 and *sse2_uavgv8hi3 into one.
       (PMULHRSW): New.
       (<ssse3_avx2>_pmulhrsw<mode>3): Merge avx2_umulhrswv16hi3,
       ssse3_pmulhrswv8hi3 and ssse3_pmulhrswv4hi3 into one.
       (*avx2_pmulhrswv16hi3): Replace const_vector with match_operand.
       (*ssse3_pmulhrswv8hi3): Ditto.
       (*ssse3_pmulhrswv4hi3): Ditto.

---
Best regards,
Andrey Turetskiy

On Wed, Oct 24, 2012 at 5:36 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Wed, Oct 24, 2012 at 3:01 PM, Andrey Turetskiy
> <andrey.turetskiy@gmail.com> wrote:
>
>> On Tue, Oct 23, 2012 at 2:45 PM, Andrey Turetskiy
>> <andrey.turetskiy@gmail.com> wrote:
>>> Hi,
>>>
>>> This patch replaces large const_vector constructions with
>>> match_operand in sse.md to decrease its size.
>>> Is it ok?
>
> No, you don't have to touch generic expand machinery.
>
> In the expander, use (match_dup X), and declare "operands[X] =
> CONST1_RTX (..some_mode..)" in preparation statement. In unnamed
> patterns, use const1_operand operand predicate. You should extend
> existing const1_operand in the same way as const0_operand.
>
> This approach is not compatible with named insn patterns, which
> duplicate its functionality as pattern matcher and as an expander.
>
> Uros.

Attachment: const_vector_replace.patch
Description: Binary data


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