Consolidated NBNxN SIMD kernel utility routines
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 27 Jun 2013 17:11:00 +0000 (19:11 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sun, 25 Aug 2013 11:47:05 +0000 (13:47 +0200)
commitace006a86aad60abf81bc6f074b67029548c8ad2
tree94aef514cf74845b05cd119fe21c62d92040286c
parentead5f8dd40c68eabe2c2922744ea63b1ca5472a7
Consolidated NBNxN SIMD kernel utility routines

Hardware-, precision-, and j-width-specific routines used only by the
NBNxN kernels are now all defined in
nbnxn_kernel_simd_utils*.h. Hardware-specific details are contained in
files specific to that hardware.

A major feature contained in this patch is a refactored treatment of
NBNxN particle-particle exclusions. This hides the
x86-implementation-specific details of using integer- or real-valued
SIMD registers and operations. Both inner and outer NBNXN loops are
now more independent of hardware.

* Moved SIMD types, constants and functions for exclusions to the
  NBNxN kernel module, because that is the only place where they are
  used.
* Introduced gmx_exclfilter type to hide the implementation detail of
  whether the masking is handled in integer- or real-valued SIMD
  registers
* Consolidated gmx_checkbitmask* likewise, and renamed to reflect that
  it returns a gmx_mm_pb
* Eliminated the need for gmx_castsi_pr, gmx_set1_epi32, gmx_load_si
  by recasting the code as the composite operation of
  gmx_load1?_exclfilter
* Through the above, eliminated the need for CHECKBITMASK preprocessor
  defines and checks
* Converted code macros to static inline functions
* Converted FILTER_STRIDE and NBFP_STRIDE to a static const instead of
  macro, since neither are ever used as an array dimension in C. This
  works towards using the compiler where possible and the preprocessor
  only where necessary.
* Introduced functions for exclusion mask loading so that there will
  be a link seam for testing with in master branch

TODO: Respond to two questions addressed to Berk embedded in new
comments.

Change-Id: I2a74638b982bdbf5a88442b93736df0a2f0c14b0
14 files changed:
include/gmx_simd_macros.h
include/gmx_simd_ref.h
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_2xnn.c
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_2xnn_inner.h
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_2xnn_outer.h
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_4xn.c
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_4xn_inner.h
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_4xn_outer.h
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils.h
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_ref.h
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_128d.h
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_128s.h
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_256d.h
src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_256s.h