Go to main content

man pages section 3: DAX Library Functions

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

dax_and (3DAX)

Name

dax_and - compute logical AND of two vectors

Synopsis

cc [ flag... ] file... -ldax [ library...]
  
#include <dax.h>

dax_result_t
dax_and(dax_context_t *ctx, uint64_t flags,
    dax_vec_t *src1, dax_vec_t *src2, dax_vec_t *dst);

Description

This function computes the logical AND of src1 with src2 and stores the result in dst.

The parameters of this function must meet the following conditions:

  • In dst offset must be 0.

  • In src1, src2, and dst, elem_width must be 1 bit.

  • In src1, src2, and dst, format must be DAX_BITS.

  • In src1 and src2, the count of elements must match.

  • The number of elements in dst must at least be equal to the number of elements in src1.

  • The dst->data field must start on a 64 byte boundary.

  • Round up the size of the dst->data field in bytes as described in the dax_vec_t(3DAX) man page.

The following address ranges must not overlap:

  • Address range of the src1->data vector and the dst->data vector.

  • Address range of the src2->data vector and the dst->data vector.

The libdax library checks the overlap in the address ranges only if the DAX_DEBUG_EXTRA debug option is set. If violation of the conditions occur and are not checked, you will get undefined results.

Supported Flags

DAX_INVERT

Inverts the result

DAX_INVERT_SRC

Inverts src2 before performing the operation

DAX_CACHE_DST

Writes results to cache. If not specified, invalidates the address range for dst in the cache, and writes the result to the main memory. For more information, see the dax_scan_value(3DAX) man page.

DAX_NOWAIT

If the DAX command queue is full, returns without submitting the command, instead of waiting to submit.

Return Values

Returns the number of one bits in dst in the dax_result_t count field and sets the dax_result_t status field to one of the following values:

DAX_SUCCESS

Operation completed successfully

DAX_EINVAL

Invalid argument, detected by libdax

DAX_EPARSE

Invalid argument, detected by DAX

DAX_EDATAFMT

The true value of an aux_data element is 0, or the width of a zip symbol is less than 1 or greater than 8, detected by DAX.

DAX_EOVERFLOW

Output buffer overflow

DAX_EADI

ADI mismatch error for an input or output buffer

DAX_ETHREAD

The calling thread did not create ctx

DAX_EBUSY

DAX is busy and nowait was requested

DAX_EINTERNAL

Unknown internal error. Caller must stop using ctx.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/library
Interface Stability
Committed

See Also

libdax(3LIB), dax_vec_t(3DAX), dax_adi(3DAX), dax_scan_value(3DAX), dax_dtrace(3DAX)

Notes

In libdax versions 1 and 2, this function is available in software, but in a future version, the DAX hardware could implement this function.

In libdax versions 1 and 2, the DAX_CACHE_DST flag is silently ignored in this function.