Hi Michael,

On 08/03/2012 09:07 PM, Michael Schnell wrote:
On 08/03/2012 11:48 AM, Luis Alves wrote:
At the moment I'm still using gcc 4.2.x

I would be thankful If you could check whether in your projects, gcc
creates code that sets ad checks bits in memory and does memory/memory
operations when appropriate.

I feel
volatile int xx, xy; xx |= 0x80; yx |= 0x0x80000000;

should create
BSET 7, xx+3   and   BSET 7, xy

and
if (xy & 0x4000)

should create BTST 6, xy+2

and xy=xx

should create MOVE.L xx, xy

Heres one result. I am using a gcc-4.5.1 based toolchain. This code:

   foo(void)
   {
        volatile int xx, xy;
        xx |= 0x80;
        xy |= 0x80000000;
        if (xy & 0x4000)
                xx = xy;
   }

Compiled with this command line:

  m68k-linux-gcc -mcpu32 -O2 -c foo.c

Produced this code:

00000000 <foo>:
   0:   4e56 fff8       linkw %fp,#-8
   4:   202e fffc       movel %fp@(-4),%d0
   8:   727f            moveq #127,%d1
   a:   4601            notb %d1
   c:   8081            orl %d1,%d0
   e:   2d40 fffc       movel %d0,%fp@(-4)
  12:   202e fff8       movel %fp@(-8),%d0
  16:   08c0 001f       bset #31,%d0
  1a:   2d40 fff8       movel %d0,%fp@(-8)
  1e:   202e fff8       movel %fp@(-8),%d0
  22:   0800 000e       btst #14,%d0
  26:   6708            beqs 30 <foo+0x30>
  28:   202e fff8       movel %fp@(-8),%d0
  2c:   2d40 fffc       movel %d0,%fp@(-4)
  30:   4e5e            unlk %fp
  32:   4e75            rts

Regards
Greg



------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     g...@snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close,                            FAX:         +61 7 3891 3630
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to