\This directory contains AMD 3DNow! assembly implementations for some
of the most important Gromacs nonbonded functions.

I no longer write new 3DNow loops for two reasons:

1. All recent AMD CPUs support SSE/SSE2 which are rougly 10% faster.
2. In contrast to SSE, the 3DNow instructions are NOT IEEE-compliant.

Since we want it to work with any compiler we cannot use gcc inline
assembly (Portland and Microsoft don't support it), so they are 
coded entirely in assembly. This is slightly (10-15%) faster too.

It is not as bad as it looks to edit them - search the net for a 
tutorial on x86 assembly. 

Unfortunately we need to support BOTH AT&T as well as Intel syntax
versions, because of braindead compilers and OS vendors. 
For historical reasons (and sanity) I have done the editing in Intel
syntax, which is stored in the *.intel_syntax.s files. These are
then translated to AT&T syntax by the program intel2gas, and stored
in the standard *.s files, which are used by default. 

Currently, the only platform that absolutely NEEDS intel format is
Windows using the NASM assembler.

I've made pretty good use of registers, and frequently use them to
save information needed several lines further down.
Thus, if you need to add something in the code you might have to 
save a couple of registers on the stack and reload them when you 
are done. 

3DNow always works on 2 floats in parallel.
This means I've had to write special sections to take care of the
remaining odd element when neighborlist lengths are not even.
When changing this code you might have to be careful and zero the
unused elements; if the first position is valid but the second
NaN (not a number), the energy would be NaN if we add them!

The following loops have been implemented in 3DNow:
(There are also non-force versions in each file)

nb010_sse2 (No Coul, VdW=Lennard-Jones, no water optimization)
nb030_sse2 (No Coul, VdW=Table, no water optimization)
nb100_sse2 (Coul=Normal, No VdW, no water optimization)
nb101_sse2 (Coul=Normal, No VdW, water=SPC/TIP3P-other atom)
nb102_sse2 (Coul=Normal, No VdW, water=SPC/TIP3P-SPC/TIP3P)
nb111_sse2 (Coul=Normal, VdW=L-J, water=SPC/TIP3P-other atom)
nb112_sse2 (Coul=Normal, VdW=L-J, water=SPC/TIP3P-SPC/TIP3P)
nb201_sse2 (Coul=RF, No VdW, water=SPC/TIP3P-other atom)
nb202_sse2 (Coul=RF, No VdW, water=SPC/TIP3P-SPC/TIP3P)
nb211_sse2 (Coul=RF, VdW=L-J, water=SPC/TIP3P-other atom)
nb212_sse2 (Coul=RF, VdW=L-J, water=SPC/TIP3P-SPC/TIP3P)
nb301_sse2 (Coul=Table, No VdW, water=SPC/TIP3P-other atom)
nb302_sse2 (Coul=Table, No VdW, water=SPC/TIP3P-SPC/TIP3P)
nb311_sse2 (Coul=Table, VdW=L-J, water=SPC/TIP3P-other atom)
nb312_sse2 (Coul=Table, VdW=L-J, water=SPC/TIP3P-SPC/TIP3P)
nb331_sse2 (Coul=Table, VdW=Table, water=SPC/TIP3P-other atom)
nb332_sse2 (Coul=Table, VdW=Table, water=SPC/TIP3P-SPC/TIP3P)

Compared to SSE, there are no TIP4P or reaction-field loops for 3DNow.



