This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use GET_MODE_BITSIZE to get vector natural alignment
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 19 Oct 2015 13:12:55 +0200
- Subject: Re: [PATCH] Use GET_MODE_BITSIZE to get vector natural alignment
- Authentication-results: sourceware.org; auth=none
- References: <20151016174255 dot GA24528 at intel dot com> <CAFULd4Zm7gf=tETXrYDRGG=n76VZCobguwrRTo1NGDnTpjfVMw at mail dot gmail dot com> <CAMe9rOpoOS5VsBnJ44oemKsFbPF7xbK+_tUxNVofq3RVx3UKoA at mail dot gmail dot com>
On Mon, Oct 19, 2015 at 1:12 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Oct 19, 2015 at 4:05 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>> On Fri, Oct 16, 2015 at 7:42 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>>> Since GET_MODE_ALIGNMENT is defined by psABI and the biggest alignment
>>> is 4 byte for IA MCU psABI, we should use GET_MODE_BITSIZE to get
>>> vector natural alignment to check misaligned vector move.
>>>
>>> OK for trunk?
>>>
>>> Thanks.
>>>
>>> H.J.
>>> ---
>>> * config/i386/i386.c (ix86_expand_vector_move): Use
>>> GET_MODE_BITSIZE to get vector natural alignment.
>>> ---
>>> gcc/config/i386/i386.c | 4 +++-
>>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
>>> index ebe2b0a..d0e1f4c 100644
>>> --- a/gcc/config/i386/i386.c
>>> +++ b/gcc/config/i386/i386.c
>>> @@ -18650,7 +18650,9 @@ void
>>> ix86_expand_vector_move (machine_mode mode, rtx operands[])
>>> {
>>> rtx op0 = operands[0], op1 = operands[1];
>>> - unsigned int align = GET_MODE_ALIGNMENT (mode);
>>> + /* Use GET_MODE_BITSIZE instead of GET_MODE_ALIGNMENT since the
>>> + biggest alignment is 4 byte for IA MCU psABI. */
>>> + unsigned int align = GET_MODE_BITSIZE (mode);
>>
>> How about using TARGET_IAMCU condition here and using bitsize only for
>> TARGET_IAMCU?
>>
>
> Works for me. Is it OK with that change?
Yes.
Thanks,
Uros.