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: Uros Bizjak <ubizjak at gmail dot com>
- Cc: "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>, Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 29 Apr 2016 14:26:59 +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> <CAFULd4bSJ3=JCvhX3RB1Fu5Pk+3MiUJXipx7pbqkPu=8Z2CiEw at mail dot gmail dot com>
2016-04-29 12:48 GMT+03:00 Uros Bizjak <ubizjak@gmail.com>:
> On Thu, Apr 28, 2016 at 12:36 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>
>> That's what I have in my draft for DImode immediates:
>>
>> @@ -3114,6 +3123,20 @@ scalar_chain::build (bitmap candidates,
>> unsigned insn_uid)
>> BITMAP_FREE (queue);
>> }
>>
>> +/* Return a cost of building a vector costant
>> + instead of using a scalar one. */
>> +
>> +int
>> +scalar_chain::vector_const_cost (rtx exp)
>> +{
>> + gcc_assert (CONST_INT_P (exp));
>> +
>> + if (const0_operand (exp, GET_MODE (exp))
>> + || constm1_operand (exp, GET_MODE (exp)))
>
> The above should just use
>
> standard_sse_constant_p (exp, V2DImode).
Thanks for the tip! Surprisingly this replacement caused a different
cost for non-standard constants. Looking at it in GDB I found:
(gdb) p exp
$3 = (rtx) 0x7ffff7f0b560
(gdb) pr
warning: Expression is not an assignment (and might have no effect)
(const_int -1085102592571150096 [0xf0f0f0f0f0f0f0f0])
(gdb) p constm1_operand (exp,GET_MODE (exp))
$4 = 1
Do I misuse constm1_operand?
Thanks,
Ilya
>
> Uros.