public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Yangfei (Felix)" <felix.yang@huawei.com>
To: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>,
	       "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Chenshanyao <chenshanyao@huawei.com>,
	       Kugan	<kugan.vivekanandarajah@linaro.org>
Subject: Re: [PATCH, PR63742][ARM] Fix arm *movhi_insn_arch4 pattern for big-endian
Date: Thu, 20 Nov 2014 09:48:00 -0000	[thread overview]
Message-ID: <DA41BE1DDCA941489001C7FBD7A8820E55559733@szxema507-mbx.china.huawei.com> (raw)
In-Reply-To: <546DAAB3.1040307@arm.com>

> > On 19/11/14 09:29, Yangfei (Felix) wrote:
> > >>> Sorry for missing the point.  It seems to me that 't2' here will
> > >>> conflict with
> > >> condition of the pattern *movhi_insn_arch4:
> > >>>     "TARGET_ARM
> > >>>      && arm_arch4
> > >>>      && (register_operand (operands[0], HImode)
> > >>>          || register_operand (operands[1], HImode))"
> > >>>
> > >>> #define TARGET_ARM                      (! TARGET_THUMB)
> > >>> /* 32-bit Thumb-2 code.  */
> > >>> #define TARGET_THUMB2                   (TARGET_THUMB &&
> > >> arm_arch_thumb2)
> > >>>
> > >>
> > >> Bah, Indeed ! - I misremembered the t2 there, my mistake.
> > >>
> > >> Yes you are right there, but what I'd like you to do is to use that
> > >> mechanism rather than putting all this logic in the predicate.
> > >>
> > >> So, I'd prefer you to add a v6t2 to the values for the "arch"
> > >> attribute, don't forget to update the comments above.
> > >>
> > >> and in arch_enabled you need to enforce this with
> > >>
> > >>    (and (eq_attr "arch" "v6t2")
> > >>         (match_test "TARGET_32BIT && arm_arch6 &&
> > arm_arch_thumb2"))
> > >> 	 (const_string "yes")
> > >>
> > >> And in the pattern use v6t2 ...
> > >>
> > >> arm_arch_thumb2 implies that this is at the architecture level of v6t2.
> > >> Therefore TARGET_ARM && arm_arch_thumb2 implies ARM state.
> > >
> > >
> > > Hi Ramana,
> > >      Thank you for your suggestions.  I rebased the patch on the
> > > latest trunk
> > and updated it accordingly.
> > >      As this patch will not work for architectures older than
> > > armv6t2,  I also
> > prefer Thomas's patch to fix for them.
> > >      I am currently performing test for this patch.  Assuming no
> > > issues pops
> > up, OK for the trunk?
> > >      And is it necessary to backport this patch to the 4.8 & 4.9 branches?
> > >
> >
> > I've applied the following as obvious after Kugan mentioned on IRC
> > this morning noticing a movwne r0, #-32768. Obviously this won't be
> > accepted as is by the assembler and we should be using the %L character.
> Applied to trunk as obvious.
> >
> > Felix, How did you test this patch ?
> >
> > regards
> > Ramana
> 
> 
> I regtested the patch for arm-eabi-gcc/g++ & big-endian with qemu.  The test
> result is OK.  That's strange ...
> 
> This issue can be reproduced by the following testcase.  Thanks for fixing it.
> 
> #include <stdio.h>
> unsigned short v = 0x5678;
> int i;
> int j = 0;
> int *ptr = &j;
> int func()
> {
>         for (i = 0; i < 1; ++i)
>         {
>                 *ptr = -1;
>                 v = 0xF234;
>         }
>         return v;
> }
>

And the architecture level is set to armv7-a by default when testing. 

  parent reply	other threads:[~2014-11-20  9:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05  7:12 Yangfei (Felix)
2014-11-05 11:01 ` Ramana Radhakrishnan
2014-11-06  8:36   ` Yangfei (Felix)
2014-11-18  8:54     ` Ramana Radhakrishnan
2014-11-18 11:36       ` Yangfei (Felix)
2014-11-18 12:04         ` Ramana Radhakrishnan
2014-11-18 12:47           ` Yangfei (Felix)
2014-11-18 12:56             ` Ramana Radhakrishnan
2014-11-19  9:42               ` Yangfei (Felix)
2014-11-19 10:26                 ` Ramana Radhakrishnan
2014-11-20  9:24                 ` Ramana Radhakrishnan
2014-11-20  9:25                   ` Yangfei (Felix)
2014-11-20  9:48                   ` Yangfei (Felix) [this message]
2014-11-29 10:58                     ` [PATCH PR59593] [arm] Backport r217772 & r217826 to 4.8 & 4.9 Chen Shanyao
2014-11-29 12:11                       ` Yangfei (Felix)
2014-12-02 12:22                       ` Ramana Radhakrishnan
2014-11-12 10:28   ` [PING][PATCH, PR63742][ARM] Fix arm *movhi_insn_arch4 pattern for big-endian Yangfei (Felix)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DA41BE1DDCA941489001C7FBD7A8820E55559733@szxema507-mbx.china.huawei.com \
    --to=felix.yang@huawei.com \
    --cc=chenshanyao@huawei.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kugan.vivekanandarajah@linaro.org \
    --cc=ramana.radhakrishnan@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).