Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Peter Rival <frival@zk3.dec.com>
To: axp-list@redhat.com
Subject: Re: Assembly errors with lockmeter
Date: Mon, 08 Nov 1999 09:03:46 -0500	[thread overview]
Message-ID: <3826D83F.7B73A97@zk3.dec.com> (raw)
In-Reply-To: 19991107164713.A7248@twiddle.net

[-- Attachment #1: Type: text/plain, Size: 2921 bytes --]

Richard Henderson wrote:

> On Tue, Nov 02, 1999 at 08:41:15PM +0000, Peter Rival wrote:
> >         mb
> > .section .text2,"ax"
> > 6:
> > .previous
> >         addl $1,$31,$1    <-- Line 655
>
> This fixes it.  I do wonder what exactly you're doing with
> labels in sections with no code attached to them...
>

I wonder myself sometimes...;)  Basically I was trying to do something like "try
to grab the read lock once, and if you fail, bail out".  I was just trying to
modify read_lock to do something like that.  I suppose it would have been better
to write it more like this:

static __inline__ int _read_try_lock_(void *lock)
{
        long temp,result=0;
        __asm__ __volatile__(
        "1:     ldl_l %1,%0\n"
        "       blbs %1,6f\n"
        "       subl %1,2,%1\n"
        "       stl_c %1,%0\n"
        "       beq %1,6f\n"
        "       mb\n"
        ".section .text2,\"ax\"\n"
        "6:     mov %1,%2\n"
        ".previous"
        : "=m" (__dummy_lock(lock)), "=&r" (temp), "=&r" (result)
        : "m" (__dummy_lock(lock))
        );
        return (result != 1);  /* Was the lock grabbed? */
}

But that looks kinda ugly.  I really don't want to unconditionally copy lock into
the result, as I've already set the result to zero.  Hmmm...any assembly experts
have a better take on it?  BTW, which tree is this against - 2.95.2 or egcs
1.1.2?  Thanks for looking into it!

 - Pete

>
>         * config/tc-alpha.c (alpha_align): Check, don't assert, that
>         the previous label was in the current section before playing
>         with auto-alignment.
>
> Index: gas/config/tc-alpha.c
> ===================================================================
> RCS file: /cvs/binutils/binutils/gas/config/tc-alpha.c,v
> retrieving revision 1.6
> diff -c -p -d -r1.6 tc-alpha.c
> *** tc-alpha.c  1999/10/18 22:29:14     1.6
> --- tc-alpha.c  1999/11/08 00:42:40
> *************** alpha_align (n, pfill, label, force)
> *** 4756,4769 ****
>
>     alpha_current_align = n;
>
> !   if (label != NULL)
>       {
> -       assert (S_GET_SEGMENT (label) == now_seg);
>         symbol_set_frag (label, frag_now);
>         S_SET_VALUE (label, (valueT) frag_now_fix ());
>       }
>
> !   record_alignment(now_seg, n);
>
>     /* ??? if alpha_flag_relax && force && elf, record the requested alignment
>        in a reloc for the linker to see.  */
> --- 4756,4768 ----
>
>     alpha_current_align = n;
>
> !   if (label != NULL && S_GET_SEGMENT (label) == now_seg)
>       {
>         symbol_set_frag (label, frag_now);
>         S_SET_VALUE (label, (valueT) frag_now_fix ());
>       }
>
> !   record_alignment (now_seg, n);
>
>     /* ??? if alpha_flag_relax && force && elf, record the requested alignment
>        in a reloc for the linker to see.  */
>
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

[-- Attachment #2: Type: text/html, Size: 4847 bytes --]

  reply	other threads:[~1999-11-08 13:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-02 19:24 Assembly errors with lockmeter Peter Rival
1999-11-02 20:19 ` Richard Henderson
1999-11-02 20:41   ` Peter Rival
1999-11-02 20:57     ` Richard Henderson
1999-11-02 21:49       ` Cross Platform IDE Jonas Gustavsson
1999-11-03 21:32         ` Adam C Powell IV
1999-11-04  0:00           ` SV: " Jonas Gustavsson
1999-11-08  0:47     ` Assembly errors with lockmeter Richard Henderson
1999-11-08 14:03       ` Peter Rival [this message]
1999-11-24  5:27         ` Richard Henderson
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox