Developer Guide and Reference

Contents

_addcarry_u32(), _addcarry_u64()

Computes sum of two 32/64 bit wide unsigned integer values and a carry-in and returns the value of carry-out produced by the sum. The corresponding 4th Generation Intel® Core™ Processor extension instructions are
ADCX
and
ADOX
.

Syntax

extern unsigned char _addcarry_u32(unsigned char c_in, unsigned int src1, unsigned int src2, unsigned int *sum_out);
extern unsigned char _addcarry_u64(unsigned char c_in, unsigned __int64 src1, unsigned __int64 src2, unsigned __int64 *sum_out);
Parameters
c_in
Value used for determining carry-in value
src1
32/64 bit source integer
src2
32/64 bit source integer
*sum_out
Pointer to memory location where result is stored
Description
The intrinsic computes sum of two 32/64 bit wide integer values,
src1
and
src2
, and a carry-in value. The carry-in value is considered '
1
' for any non-zero
c_in
input value or '
0
' otherwise. The sum is stored to a memory location referenced by
sum_out
argument:
*sum_out = src1 + src2 + (c_in !=0 ? 1 : 0)
This intrinsic does not perform validity checking of the memory address pointed to by
sum_out
, thus it cannot be used to find out if the sum produces carry-out without storing result of the sum.
Returns
Returns the value of the intrinsic is a carry-out value generated by sum. The sum result is stored into memory location pointed by
sum_out
argument.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804