This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Allow all 1s of integer as standard SSE constants
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 22 Apr 2016 11:20:47 -0700
- Subject: Re: [PATCH] Allow all 1s of integer as standard SSE constants
- Authentication-results: sourceware.org; auth=none
- References: <20160420195359 dot GA3113 at intel dot com> <CAFULd4ZJrw9hWtkxCZmRHinz+aACOvnkRU4FUXVYcFD4_qjeVA at mail dot gmail dot com> <CAFULd4Y8HGC=+iFtp9PmqW2XcVwnhNygH6si0J1OCNWipGjBLg at mail dot gmail dot com> <CAFULd4b3WPYGr=uL=1D7RmnrYBeviVt0=-ckgT-8zJJcae+m3A at mail dot gmail dot com> <CAMe9rOr9B+X-H0PmBt=fsO3BmQR_MrF3nAg2pdsOoa3NpNV3PA at mail dot gmail dot com> <CAFULd4auhHb54j3GwZRCUiuAxdPcbKk+oA4+paWU=tWsQ+7Whw at mail dot gmail dot com> <CAMe9rOovKPRPNZyaq+-uWz3kwFXJRrTuh4-cFrxYMaWaUZJoYg at mail dot gmail dot com> <CAFULd4bu+r+AFgWg+W+xtKUP=diOdsfh-dxCScFZTyEf+Uu+xg at mail dot gmail dot com> <CAMe9rOrx2R+bDOHZxcp_tcMBpgD0zVsxM7L0FMOAzHKXLQPuGg at mail dot gmail dot com> <CAFULd4ab3zoOWqe3KnMHgjnRusPFoBdvFxWpb5hAMoZG24OgZw at mail dot gmail dot com> <CAMe9rOo3HzitjaH2sF7vio+OVekQVjn0WrL4D5pLkXVbtxmXNA at mail dot gmail dot com> <CAFULd4bZeZdVrTetdiS5Dp9s+BZLTiDYx7YAiy4WEfDOwtB0yQ at mail dot gmail dot com> <CAMe9rOrnJhtFN+AuPznhHh6K7Bs0hdGvcNiv-dcSz2smd37Dcg at mail dot gmail dot com> <CAFULd4a56mPORpFoiKd5XHXgRe8gPoJU+aNK_VYsU+7wc3WB0Q at mail dot gmail dot com> <CAMe9rOofVGmbb_jQ2+QwHTRs54Tbf+--kHYYPmZeV0sg_GMstw at mail dot gmail dot com> <CAMe9rOp0A1Y9kC3SA6R_Z-Az-t7Oc8VwEqaKxD8FAzv_e6j6qQ at mail dot gmail dot com> <CAFULd4YO4+aZjSnBW-KS3i2i4HqyNYn0Jsq0q7T8mC0uLw9vrA at mail dot gmail dot com> <CAMe9rOr3hrRo6HBQ8N3fu6bE-shTJ2H25zBPt=wn6rJ+Tbpg=A at mail dot gmail dot com> <CAFULd4Z_dE+kE+3CjKgWX2sSYx3dAE2pWtHynVFNP76Myjx7Ng at mail dot gmail dot com> <CAFULd4adPBsDUOKetJJygxs5Ey0F=xy14AcrZF=zEnU83o4uAg at mail dot gmail dot com>
On Fri, Apr 22, 2016 at 10:29 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Fri, Apr 22, 2016 at 7:10 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
>> On Fri, Apr 22, 2016 at 4:19 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> On Fri, Apr 22, 2016 at 5:11 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>>> On Thu, Apr 21, 2016 at 10:58 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>>
>>>>> Here is the updated patch with my standard_sse_constant_p change and
>>>>> your SSE/AVX pattern change. I didn't include your
>>>>> standard_sse_constant_opcode since it didn't compile nor is needed
>>>>> for this purpose.
>>>>
>>>> H.J.,
>>>>
>>>> please test the attached patch that finally rewrites and improves SSE
>>>> constants handling.
>>>>
>>>> This is what I want to commit, a follow-up patch will further clean
>>>> standard_sse_constant_opcode wrt TARGET_AVX512VL.
>>>>
>>>
>>> It doesn't address my problem which is "Allow all 1s of integer as
>>> standard SSE constants". The key here is "integer". I'd like to use
>>> SSE/AVX store TI/OI/XI integers with -1.
>>
>> Yes, my patch *should* work for this. Please note that
>> all_ones_operand should catch all cases your additional patch adds.
>>
>> ;; Return true if operand is a (vector) constant with all bits set.
>> (define_predicate "all_ones_operand"
>> (match_code "const_int,const_wide_int,const_vector")
>> {
>> if (op == constm1_rtx)
>> return true;
>>
>> if (mode == VOIDmode)
>> mode = GET_MODE (op);
>> return op == CONSTM1_RTX (mode);
>> })
>>
>>
>> Can you please investigate, what is wrong with all_ones_operand so it
>> doesn't accept all (-1) operands?
>
> Does following work:
>
> ;; Return true if operand is a (vector) constant with all bits set.
> (define_predicate "all_ones_operand"
> (match_code "const_int,const_wide_int,const_vector")
> {
> if (op == constm1_rtx)
> return true;
>
> if (CONST_INT_P (op))
> return INTVAL (op) == HOST_WIDE_INT_M1;
>
> if (mode == VOIDmode)
> mode = GET_MODE (op);
> return op == CONSTM1_RTX (mode);
> })
>
No. I need a predicate, all_ones_operand or all_zeros_operand,
i.e., standard_sse_constant_p (op, mode) != 0.
--
H.J.