* [PATCH] Use GET_MODE_BITSIZE to get vector natural alignment
@ 2015-10-16 17:49 H.J. Lu
2015-10-19 11:07 ` Uros Bizjak
0 siblings, 1 reply; 5+ messages in thread
From: H.J. Lu @ 2015-10-16 17:49 UTC (permalink / raw)
To: gcc-patches; +Cc: Uros Bizjak
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);
if (push_operand (op0, VOIDmode))
op0 = emit_move_resolve_push (mode, op0);
--
2.4.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Use GET_MODE_BITSIZE to get vector natural alignment
2015-10-16 17:49 [PATCH] Use GET_MODE_BITSIZE to get vector natural alignment H.J. Lu
@ 2015-10-19 11:07 ` Uros Bizjak
2015-10-19 11:12 ` H.J. Lu
0 siblings, 1 reply; 5+ messages in thread
From: Uros Bizjak @ 2015-10-19 11:07 UTC (permalink / raw)
To: H.J. Lu; +Cc: gcc-patches
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?
Uros.
> if (push_operand (op0, VOIDmode))
> op0 = emit_move_resolve_push (mode, op0);
> --
> 2.4.3
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Use GET_MODE_BITSIZE to get vector natural alignment
2015-10-19 11:07 ` Uros Bizjak
@ 2015-10-19 11:12 ` H.J. Lu
2015-10-19 11:13 ` Uros Bizjak
0 siblings, 1 reply; 5+ messages in thread
From: H.J. Lu @ 2015-10-19 11:12 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches
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?
--
H.J.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Use GET_MODE_BITSIZE to get vector natural alignment
2015-10-19 11:12 ` H.J. Lu
@ 2015-10-19 11:13 ` Uros Bizjak
2015-10-19 11:43 ` H.J. Lu
0 siblings, 1 reply; 5+ messages in thread
From: Uros Bizjak @ 2015-10-19 11:13 UTC (permalink / raw)
To: H.J. Lu; +Cc: gcc-patches
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Use GET_MODE_BITSIZE to get vector natural alignment
2015-10-19 11:13 ` Uros Bizjak
@ 2015-10-19 11:43 ` H.J. Lu
0 siblings, 0 replies; 5+ messages in thread
From: H.J. Lu @ 2015-10-19 11:43 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches
On Mon, Oct 19, 2015 at 4:12 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> 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.
>
This is what I checked in.
Thanks.
--
H.J.
---
[PATCH] Use GET_MODE_BITSIZE to get vector natural alignment
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 for IA MCU
psABI to get vector natural alignment to check misaligned vector move.
* config/i386/i386.c (ix86_expand_vector_move): Use
GET_MODE_BITSIZE for IA MCU psABI to get vector natural
alignment.
---
gcc/config/i386/i386.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 1049455..a4f4b6f 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -18645,7 +18645,11 @@ 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 for IA MCU
+ psABI since the biggest alignment is 4 byte for IA MCU psABI. */
+ unsigned int align = (TARGET_IAMCU
+ ? GET_MODE_BITSIZE (mode)
+ : GET_MODE_ALIGNMENT (mode));
if (push_operand (op0, VOIDmode))
op0 = emit_move_resolve_push (mode, op0);
--
2.4.3
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-10-19 11:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-16 17:49 [PATCH] Use GET_MODE_BITSIZE to get vector natural alignment H.J. Lu
2015-10-19 11:07 ` Uros Bizjak
2015-10-19 11:12 ` H.J. Lu
2015-10-19 11:13 ` Uros Bizjak
2015-10-19 11:43 ` H.J. Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).