Vector Optimized Library of Kernels  3.0.0
Architecture-tuned implementations of math kernels

Overview

Computes the Boolean AND operation between two input 32-bit integer vectors.

Dispatcher Prototype

void volk_32i_x2_and_32i(int32_t* cVector, const int32_t* aVector, const int32_t*
bVector, unsigned int num_points)

Inputs

  • aVector: Input vector of samples.
  • bVector: Input vector of samples.
  • num_points: The number of values.

Outputs

  • cVector: The output vector.

Example This example generates a Karnaugh map for the lower two bits of x AND y.

int N = 1<<4;
unsigned int alignment = volk_get_alignment();
int32_t* x = (int32_t*)volk_malloc(N*sizeof(int32_t), alignment);
int32_t* y = (int32_t*)volk_malloc(N*sizeof(int32_t), alignment);
int32_t* z = (int32_t*)volk_malloc(N*sizeof(int32_t), alignment);
int32_t in_seq[] = {0,1,3,2};
unsigned int jj=0;
for(unsigned int ii=0; ii<N; ++ii){
x[ii] = in_seq[ii%4];
y[ii] = in_seq[jj];
if(((ii+1) % 4) == 0) jj++;
}
volk_32i_x2_and_32i(z, x, y, N);
printf("Karnaugh map for x AND y\n");
printf("y\\x|");
for(unsigned int ii=0; ii<4; ++ii){
printf(" %.2x ", in_seq[ii]);
}
printf("\n---|---------------\n");
jj = 0;
for(unsigned int ii=0; ii<N; ++ii){
if(((ii+1) % 4) == 1){
printf("%.2x | ", in_seq[jj++]);
}
printf("%.2x ", z[ii]);
if(!((ii+1) % 4)){
printf("\n");
}
}
size_t volk_get_alignment(void)
Get the machine alignment in bytes.
Definition: volk.tmpl.c:90
__VOLK_DECL_BEGIN VOLK_API void * volk_malloc(size_t size, size_t alignment)
Allocate size bytes of data aligned to alignment.
Definition: volk_malloc.c:38