Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 May 2007 20:16:15 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        Daniel Eischen <deischen@freebsd.org>, arch@freebsd.org, "Sean C. Farley" <sean-freebsd@farley.org>
Subject:   Re: HEADS DOWN
Message-ID:  <20070506195805.S45282@besplex.bde.org>
In-Reply-To: <20070506045025.GB83173@deviant.kiev.zoral.com.ua>
References:  <Pine.GSO.4.64.0705022034180.8590@sea.ntplx.net> <20070502230413.Y30614@thor.farley.org> <20070503160351.GA15008@nagual.pp.ru> <20070504085905.J39482@thor.farley.org> <20070504213312.GA33163@nagual.pp.ru> <20070504174657.D1343@thor.farley.org> <20070505213202.GA49925@nagual.pp.ru> <20070505163707.J6670@thor.farley.org> <20070505221125.GA50439@nagual.pp.ru> <20070506091835.A43775@besplex.bde.org> <20070506045025.GB83173@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 6 May 2007, Kostik Belousov wrote:

> On Sun, May 06, 2007 at 10:59:23AM +1000, Bruce Evans wrote:
>> The setup overhead for using string instructions may be much larger than
>> the 14-16 in the above table.  It is also necessary to set the direction
>> flag and maybe to shuffle registers so as to use the registers required
>> by the string instructions.  cld/std is fast enough on Athlons (1/2
>> cycles) but is slow on Pentium4 and later (IIRC, 43 cycles for std on
>> one Pentium model).
> gcc 4.3 claims to not issue cld instruction anymore (ABI requires direction
> flag to be clear since eon).

Ha, the library for my compiler required this in 1988 (its ABI is
supposed to be compatible with other compilers, and seemed to be
compatible with several including gcc and 2 unusual ones).

However, FreeBSD has never really supported this -- it doesn't touch
the direction flag for signal handling.  String functions don't seem
to be required to be async signal-safe in draft POSIX.1-2001, but they
should be in practice (when called on an string in local storage), and
things like struct copies (to and from local variables) are required
to work even for C90 signal handlers.

Bruce



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