#include "matrix.h"
#include "DynProgr_altivec.h"
#include <cstdlib>
#include <malloc.h>
#include <float.h>
#include <cstdio>
#include <string.h>
#include <altivec.h>
#include <sys/types.h>
Go to the source code of this file.
Classes | |
struct | IsInteger< T > |
struct | IsInteger< int16_t > |
struct | IsInteger< int32_t > |
struct | IsInteger< int8_t > |
struct | IsInteger< u_int16_t > |
struct | IsInteger< u_int32_t > |
struct | IsInteger< u_int8_t > |
struct | IsSigned< T > |
struct | MaxValue< T > |
struct | MaxValue< double > |
struct | MaxValue< float > |
struct | MinValue< T > |
struct | MinValue< double > |
struct | MinValue< float > |
struct | Profile< T, V > |
Defines | |
#define | ALIGN16(x) (((x)+15)&(-16)) |
Typedefs | |
typedef vector float | v_float_t |
Saturated addition for floating point data types. | |
Functions | |
template<typename T, typename V> | |
static Profile< T, V > * | allocateProfile (int len) |
Allocates a profile data structure. | |
template<typename T, typename V> | |
static T | dynProgrLocal (const char *db, int dbLen, Profile< T, V > *profile, Options *options) |
Performs an local alignment using the given profile and database sequence. | |
template<typename T, typename V> | |
static T | dynProgrLocal2 (const char *db, int dbLen, Profile< T, V > *profile, Options *options) |
Unrolled version of dynProgrLocal . | |
template<typename T, typename V> | |
void | freeProfile (Profile< T, V > *profile) |
Releases memory occupied by a profile data structure. | |
template<typename T> | |
static T | max (T a, T b) |
template<typename T> | |
static T | min (T a, T b) |
template<typename T, typename V, typename X> | |
EXPORT Profile< T, V > * | swps3_createProfileAltivec (const char *query, int queryLen, X *simi) |
Template version for allocation and computation of a profile for the given data type and similarity matrix. | |
EXPORT void * | swps3_createProfileByteAltivec (const char *query, int queryLen, SBMatrix matrix) |
C version for allocation and computation of a 8-bit integer profile for the given data type and similarity matrix. | |
EXPORT void * | swps3_createProfileFloatAltivec (const char *query, int queryLen, SBMatrix matrix) |
C version for allocation and computation of a 32-bit floating point profile for the given data type and similarity matrix. | |
EXPORT void * | swps3_createProfileShortAltivec (const char *query, int queryLen, SBMatrix matrix) |
C version for allocation and computation of a 16-bit integer profile for the given data type and similarity matrix. | |
template<typename T, typename V> | |
EXPORT double | swps3_dynProgrAltivec (const char *db, int dbLen, Profile< T, V > *profile, Options *options) |
Template version of alignment routine for Altivec. | |
EXPORT double | swps3_dynProgrByteAltivec (const char *db, int dbLen, void *profile, Options *options) |
C version of alignment routine for Altivec for signed 8-bit integers. | |
EXPORT double | swps3_dynProgrFloatAltivec (const char *db, int dbLen, void *profile, Options *options) |
C version of alignment routine for Altivec for signed 32-bit floating point values. | |
EXPORT double | swps3_dynProgrShortAltivec (const char *db, int dbLen, void *profile, Options *options) |
C version of alignment routine for Altivec for signed 16-bit integers. | |
template<typename V> | |
static V | vec_addx (V a, V b) |
Saturated addition for integer data types. | |
template<> | |
static v_float_t | vec_addx< v_float_t > (v_float_t a, v_float_t b) |
template<typename V> | |
static V | vec_subx (V a, V b) |
Saturated subtraction for integer data types. | |
template<> | |
static v_float_t | vec_subx< v_float_t > (v_float_t a, v_float_t b) |
Definition in file DynProgr_altivec.cc.
#define ALIGN16 | ( | x | ) | (((x)+15)&(-16)) |
Definition at line 40 of file DynProgr_altivec.cc.
Referenced by alloc(), allocateProfile(), dynProgrLocal(), dynProgrLocal2(), handleCommand(), swps3_createProfileAltivec(), TcreateProfile(), and TdynProgLocal().
typedef vector float v_float_t |
Saturated addition for floating point data types.
Saturated substraction for floating point data types.
Definition at line 118 of file DynProgr_altivec.cc.
static Profile<T,V>* allocateProfile | ( | int | len | ) | [inline, static] |
Allocates a profile data structure.
T | The datatype for the profile. | |
V | The datatype of the corresponding packed vectors. | |
len | The query length. |
Definition at line 81 of file DynProgr_altivec.cc.
References ALIGN16, Profile< T, V >::len, Profile< T, V >::loadOpt, MATRIX_DIM, Profile< T, V >::profile, profile, Profile< T, V >::rD, Profile< T, V >::storeOpt, and T.
static T dynProgrLocal | ( | const char * | db, | |
int | dbLen, | |||
Profile< T, V > * | profile, | |||
Options * | options | |||
) | [inline, static] |
Performs an local alignment using the given profile and database sequence.
db | The database sequence. | |
dbLen | The length of the database sequence. | |
profile | The profile created previously from the query sequence. | |
options | Some global options. |
Definition at line 152 of file DynProgr_altivec.cc.
References ALIGN16, Profile< T, V >::bias, Options::gapExt, Options::gapOpen, Profile< T, V >::len, LIKELY, Profile< T, V >::loadOpt, Profile< T, V >::profile, Profile< T, V >::rD, Profile< T, V >::storeOpt, T, UNLIKELY, vec_addx(), and vec_subx().
static T dynProgrLocal2 | ( | const char * | db, | |
int | dbLen, | |||
Profile< T, V > * | profile, | |||
Options * | options | |||
) | [inline, static] |
Unrolled version of dynProgrLocal
.
db | The database sequence. | |
dbLen | The length of the database sequence. | |
profile | The profile created previously from the query sequence. | |
options | Some global options. |
Definition at line 365 of file DynProgr_altivec.cc.
References ALIGN16, Profile< T, V >::bias, Options::gapExt, Options::gapOpen, Profile< T, V >::len, LIKELY, Profile< T, V >::loadOpt, Profile< T, V >::profile, Profile< T, V >::rD, Profile< T, V >::storeOpt, T, UNLIKELY, vec_addx(), and vec_subx().
void freeProfile | ( | Profile< T, V > * | profile | ) | [inline] |
Releases memory occupied by a profile data structure.
Definition at line 98 of file DynProgr_altivec.cc.
References Profile< T, V >::loadOpt, Profile< T, V >::profile, Profile< T, V >::rD, and Profile< T, V >::storeOpt.
static T max | ( | T | a, | |
T | b | |||
) | [inline, static] |
Definition at line 44 of file DynProgr_altivec.cc.
static T min | ( | T | a, | |
T | b | |||
) | [inline, static] |
Definition at line 43 of file DynProgr_altivec.cc.
EXPORT Profile<T,V>* swps3_createProfileAltivec | ( | const char * | query, | |
int | queryLen, | |||
X * | simi | |||
) | [inline] |
Template version for allocation and computation of a profile for the given data type and similarity matrix.
T | The data type for the alignment scores. | |
V | The corresponding packed vector data type. | |
X | The data type of the similarity matrix. | |
query | The query sequence. | |
queryLen | The length of the query sequence. | |
simi | The similarity matrix. |
Definition at line 629 of file DynProgr_altivec.cc.
References ALIGN16, MATRIX_DIM, Profile< T, V >::profile, profile, and T.
EXPORT void* swps3_createProfileByteAltivec | ( | const char * | query, | |
int | queryLen, | |||
SBMatrix | matrix | |||
) |
C version for allocation and computation of a 8-bit integer profile for the given data type and similarity matrix.
query | The query sequence. | |
queryLen | The length of the query sequence. | |
matrix | The similarity matrix. |
Definition at line 774 of file DynProgr_altivec.cc.
Referenced by main().
EXPORT void* swps3_createProfileFloatAltivec | ( | const char * | query, | |
int | queryLen, | |||
SBMatrix | matrix | |||
) |
C version for allocation and computation of a 32-bit floating point profile for the given data type and similarity matrix.
query | The query sequence. | |
queryLen | The length of the query sequence. | |
matrix | The similarity matrix. |
Definition at line 804 of file DynProgr_altivec.cc.
Referenced by main().
EXPORT void* swps3_createProfileShortAltivec | ( | const char * | query, | |
int | queryLen, | |||
SBMatrix | matrix | |||
) |
C version for allocation and computation of a 16-bit integer profile for the given data type and similarity matrix.
query | The query sequence. | |
queryLen | The length of the query sequence. | |
matrix | The similarity matrix. |
Definition at line 789 of file DynProgr_altivec.cc.
Referenced by main().
EXPORT double swps3_dynProgrAltivec | ( | const char * | db, | |
int | dbLen, | |||
Profile< T, V > * | profile, | |||
Options * | options | |||
) | [inline] |
Template version of alignment routine for Altivec.
To be called from C++ code.
T | The data type for the alignment scores. | |
V | The corresponding packed vector data type. | |
db | The database sequence. | |
dbLen | The length of the database sequence. | |
profile | A profile data structure previously computed from the query sequence. | |
options | Some global options. |
DBL_MAX
if score exceeds threshold.Definition at line 669 of file DynProgr_altivec.cc.
References T.
EXPORT double swps3_dynProgrByteAltivec | ( | const char * | db, | |
int | dbLen, | |||
void * | profile, | |||
Options * | options | |||
) |
C version of alignment routine for Altivec for signed 8-bit integers.
db | The database sequence. | |
dbLen | The length of the database sequence. | |
profile | A profile data structure previously computed from the query sequence. | |
options | Some global options. |
DBL_MAX
if score exceeds threshold.Definition at line 718 of file DynProgr_altivec.cc.
Referenced by main().
EXPORT double swps3_dynProgrFloatAltivec | ( | const char * | db, | |
int | dbLen, | |||
void * | profile, | |||
Options * | options | |||
) |
C version of alignment routine for Altivec for signed 32-bit floating point values.
db | The database sequence. | |
dbLen | The length of the database sequence. | |
profile | A profile data structure previously computed from the query sequence. | |
options | Some global options. |
DBL_MAX
if score exceeds threshold.Definition at line 759 of file DynProgr_altivec.cc.
Referenced by main().
EXPORT double swps3_dynProgrShortAltivec | ( | const char * | db, | |
int | dbLen, | |||
void * | profile, | |||
Options * | options | |||
) |
C version of alignment routine for Altivec for signed 16-bit integers.
db | The database sequence. | |
dbLen | The length of the database sequence. | |
profile | A profile data structure previously computed from the query sequence. | |
options | Some global options. |
DBL_MAX
if score exceeds threshold.Definition at line 738 of file DynProgr_altivec.cc.
Referenced by main().
static V vec_addx | ( | V | a, | |
V | b | |||
) | [inline, static] |
Saturated addition for integer data types.
Definition at line 110 of file DynProgr_altivec.cc.
Referenced by dynProgrLocal(), and dynProgrLocal2().
static V vec_subx | ( | V | a, | |
V | b | |||
) | [inline, static] |
Saturated subtraction for integer data types.
Definition at line 127 of file DynProgr_altivec.cc.
Referenced by dynProgrLocal(), and dynProgrLocal2().