m68k problem and libstdc++

Aaron J. Grier aaron@frye.com
Tue Jan 15 10:06:00 GMT 2002


On Sat, Jan 12, 2002 at 03:27:49PM +0100, Roman Zippel wrote:
> Hi,
> 
> Craig Rodrigues wrote:
> 
> > +// * variants with the "tas" instruction
> > +//   cpu32, 5400
> > +// * variants with no atomic read/modify/write instruction at all
> > +//   68000/10, 5200/300
> 
> The 68000 already has the tas instruction.

:)  I realized that about an hour after submitting the original patch.

> > -static inline void
> > +static void
> >  __attribute__ ((__unused__))
> >  __atomic_add (volatile _Atomic_word* __mem, int __val)
> >  {
> > -  __asm__ __volatile__ ("add%.l %0,%1"
> > -                       : : "id" (__val), "m" (*__mem) : "memory");
> > +  static unsigned char __lock;
> > +  _Atomic_word __tmp;
> > +
> > +  __asm__ __volatile__( "add%.l        %1,(%0)"
> > +                       :
> > +                       : "a" (__mem), "d" (__val)
> > +                       : "memory" );
> >  }
> 
> Why was that changed? The "inline" is removed and the constraints are
> more restrictive.

no specific reason...  one of the patches I had received had it this
way.

> Hmm, I think the '"m" (*__mem)' should rather be a '"+m" (*__mem)' in
> the output arguments, then '"memory"' wouldn't be required anymore.

I'll try that and see what it produces.

thanks.

-- 
  Aaron J. Grier  |   Frye Electronics, Tigard, OR   |  aaron@frye.com
     "In a few thousand years people will be scratching their heads
       wondering how on earth the first computer was invented and
          bootstrapped without a prior computer to do it with."
                    --  Chris Malcolm, on comp.arch



More information about the Libstdc++ mailing list