Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Dec 2000 12:31:19 +0100 (CET)
From:      Espen Skoglund <esk@ira.uka.de>
To:        Julian Elischer <julian@elischer.org>
Cc:        smp@FreeBSD.ORG
Subject:   Re: atomic increment?
Message-ID:  <14906.263.346807.179980@i30nb2.ira.uka.de>
In-Reply-To: <3A39F8DA.FD4CA0A5@elischer.org>
References:  <3A39F8DA.FD4CA0A5@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
[Julian Elischer]
> CAn we have an atomic increment and decrement primative?
> presently we get:

> .L565:
>         movl $1,%eax
> #APP
>         lock
>         addl %eax,4(%ebx)


> the movl is totally useless and it would be an absolutly trivial
> addition..  the question is; is there a religious reason we don't
> already have it?

Couldn't one make use of the __builtin_constant_p() stuff in gcc to
optimize this away?  (Or maybe that is only applicable to macros --
not to inline functions.)

	 eSk


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14906.263.346807.179980>