This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC patch, i386]: Use STV pass to load/store any TImode constant using SSE insns
- From: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Uros Bizjak <ubizjak at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Thu, 28 Apr 2016 13:45:36 +0300
- Subject: Re: [RFC patch, i386]: Use STV pass to load/store any TImode constant using SSE insns
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4afCkFamkaWA3F_30AaW9ZerBWKj90F2AR_z4wTjNGcNA at mail dot gmail dot com> <CAMbmDYbetEjt7iWKsxhnrwO3oZFYvKao8bJjJpo5rEGyyZ6JzQ at mail dot gmail dot com> <20160428104134 dot GN26501 at tucnak dot zalov dot cz>
2016-04-28 13:41 GMT+03:00 Jakub Jelinek <jakub@redhat.com>:
> On Thu, Apr 28, 2016 at 01:36:30PM +0300, Ilya Enkovich wrote:
>> @@ -3145,11 +3168,25 @@ scalar_chain::compute_convert_gain ()
>> || GET_CODE (src) == IOR
>> || GET_CODE (src) == XOR
>> || GET_CODE (src) == AND)
>> - gain += ix86_cost->add;
>> + {
>> + gain += ix86_cost->add;
>> + if (CONST_INT_P (XEXP (src, 0)))
>> + gain -= scalar_chain::vector_const_cost (XEXP (src, 0));
>> + if (CONST_INT_P (XEXP (src, 1)))
>> + gain -= scalar_chain::vector_const_cost (XEXP (src, 1));
>> + }
>> else if (GET_CODE (src) == COMPARE)
>> {
>> /* Assume comparison cost is the same. */
>> }
>> + else if (GET_CODE (src) == CONST_INT)
>> + {
>> + if (REG_P (dst))
>> + gain += COSTS_N_INSNS (2);
>> + else if (MEM_P (dst))
>> + gain += 2 * ix86_cost->int_store[2] - ix86_cost->sse_store[1];
>> + gain -= scalar_chain::vector_const_cost (src);
>> + }
>> else
>> gcc_unreachable ();
>
> Where does the 2 come from? Is it that the STV pass right now supports only
> 2 * wordsize modes? Also, I don't think we should treat equally constants
> that fit into the 32-bit immediates and constants that don't, the latter,
> when movabsq needs to be used, are more costly.
This variant is for DImode going to split into two SImode. TImode chains
have own cost model.
Thanks,
Ilya
>
> Jakub