This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: GCC-How does the coding style affect the insv pattern recognization?
- From: "Bingfeng Mei" <bmei at broadcom dot com>
- To: "fanqifei at gmail dot com" <fanqifei at gmail dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 13 Jan 2010 01:53:52 -0800
- Subject: RE: GCC-How does the coding style affect the insv pattern recognization?
- References: <f94afa701001120450r7d742609vb45562f02863c6cf@mail.gmail.com>
Your instruction is likely too specific to be picked up by GCC.
You may use an intrinisc for it.
Bingfeng
> -----Original Message-----
> From: gcc-owner@gcc.gnu.org [mailto:gcc-owner@gcc.gnu.org] On
> Behalf Of fanqifei
> Sent: 12 January 2010 12:50
> To: gcc@gcc.gnu.org
> Subject: GCC-How does the coding style affect the insv
> pattern recognization?
>
> Hi,
> I am working on a micro controller and trying to port
> gcc(4.3.2) for it.
> There is insv instruction in our micro controller and I have add
> define_insn to machine description file.
> However, the insv instruction can only be generated when the code
> is written like below. If the code is written using logical shift and
> or operators, the insv instruction will not be generated.
> For the statement: x= (x&0xFF00FFFF) | ((i<<16)&0x00FF0000);
> 6 RTL instructions are generated after combine pass and 8
> instructions are generated in the assembly file.
> Paolo Bonzini said that insv instruction might be synthesized
> later by combine. But combine only works on at most 3 instructions and
> insv is not generated in such case.
> So exactly when will the insv pattern be recognized and how does
> the coding style affect it?
> Is there any open bug report about this?
>
> struct test_foo {
> unsigned int a:18;
> unsigned int b:2;
> unsigned int c:12;
> };
>
> struct test_foo x;
>
> unsigned int foo()
> {
> unsigned int a=x.b;
> x.b=2;
> return a;
> }
>
> Thanks!
> fanqifei
>
>