Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Mar 2012 19:58:41 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Tijl Coosemans <tijl@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin <jhb@FreeBSD.org>
Subject:   Re: svn commit: r232721 - head/sys/x86/include
Message-ID:  <20120321194833.W1116@besplex.bde.org>
In-Reply-To: <201203210930.58389.tijl@freebsd.org>
References:  <201203091148.q29BmuIp005151@svn.freebsd.org> <201203201519.12926.tijl@freebsd.org> <201203201456.14375.jhb@freebsd.org> <201203210930.58389.tijl@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 21 Mar 2012, Tijl Coosemans wrote:

> On Tuesday 20 March 2012 19:56:14 John Baldwin wrote:
>> On Tuesday, March 20, 2012 10:19:07 am Tijl Coosemans wrote:
>...
>>> No, on i386 bswap64 with a variable argument currently expands to two
>>> bswap instructions. With your change it would be many shifts and logical
>>> operations. The _gen variants are more like fallback implementations.
>>> If bswapNN cannot be implemented directly it is split up. If those
>>> smaller problems can be implemented directly, good, if not split it up
>>> again and so on.
>>
>> Oh, I now parse the comment in __bswap64_var() correctly.  That's fugly.
>>
>> Still, it seems that if I keep the patch to port this to ia64 (so it
>> can do constants as constants), then it will need to use this approach
>> since it won't have the i386 problem (in its case the _gen variants
>> are only used for constants).
>
> Maybe name them _const then as on other architectures.

But we hoped to to use the "generic" version on all arches, with only
1 definition for it, and nothing MD except possibly the "var" version.

The "constant" version was renamed because it isn't limited to
constants.  I think it was changed to call the general version (above
the "generic" version) after that, since it would have made no sense for
the "constant" version to call a non-"constant" version.  The "generic"
version isn't really generic, since it only works for parameters without
side effects.  This is arranged by the "var" versions copying the parameters
to non-volatile variables and then applying either the "generic" version or
asm.

Bruce



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