freebsd-dev/sys/amd64
Bruce Evans 26ab2d1d23 Avoid an instruction in atomic_cmpset_{int_long)() in most cases.
These functions are used a lot for mutexes, so this reduces the text
size of an average kernel by about 0.75%.  This wasn't intended to
be a significant optimization, but it somehow increased the maximum
number of packets per second that can be transmitted by my bge hardware
from 320000 to 460000 (this benchmark is CPU-bound and remarkably
sensitive to changes in the text section).

Details: we would prefer to leave the result of the cmpxchg in %al,
but cannot tell gcc that it is there, so we have to convert it to an
integer register.  We converted  to %al, then to %[re]ax, but the
latter step is usually wasted since gcc usually only wants the condition
code and can recover it from %al just as easily as from %[re]ax.  Let
gcc promote %al in the few cases where this is needed.

Nearby style fixes;
- let gcc manage the load of `res', and don't abuse `res' for a copy of `exp'
- don't echo `res's name in comments
- consistently spell the condition code as 'e' after comparison for equality
- don't hard-code %al anywhere except in constraints
- for the version that doesn't use cmpxchg, there is no requirement to use
  %al anywhere, so don't hard-code it in the constraints either.

Style non-fix:
- for the versions that use cmpxchg, keep using "a" (was %[re]ax, now %al)
  for the main output operand, although this is not required.  The input
  and output operands that use the "a" constraint are now decoupled, and
  this makes things clearer except for the reason that the output register
  is hard-coded.  It is now just a hack to tell gcc that the input "a" has
  been clobbered without increasing the number of operands.
2006-12-27 20:26:00 +00:00
..
acpica First pass at allowing memory to be mapped using cache modes other than 2006-08-11 19:22:57 +00:00
amd64 Fix a panic when rebooting a SMP machine, when option STOP_NMI is used, 2006-12-23 03:30:50 +00:00
compile
conf Add msk(4) to the list of drivers supported by GENERIC kernel. 2006-12-13 03:41:47 +00:00
ia32 Newer versions of gcc don't support treating structures passed by value 2006-12-17 06:48:40 +00:00
include Avoid an instruction in atomic_cmpset_{int_long)() in most cases. 2006-12-27 20:26:00 +00:00
isa Evidently neither GENERIC nor kan's config had isa in it :-0. As 2006-12-17 21:51:44 +00:00
linux32 MFP4: 109655 2006-12-20 20:17:35 +00:00
pci Give Host-PCI bridge drivers their own pcib_alloc_msi() and 2006-12-12 19:27:01 +00:00
Makefile