_cmpccxadd_epi64
Classification
Other, Arithmetic, CPUID Test: CMPCCXADD
Header File
immintrin.h
Instruction
CMPOXADD m64, r64, r64
Synopsis
 _cmpccxadd_epi64(void* __A, __int64 __B, __int64 __C, const int __D);
Description
Compares the value from the memory "__A" with the value of "__B". If the specified condition "__D" is met, then add the third operand "__C" to the "__A" and write it into "__A", else the value of "__A" is unchanged. The return value is the original value of "__A".
Operation
CASE (__D[3:0]) OF
0: OP := _CMPCCX_O
1: OP := _CMPCCX_NO
2: OP := _CMPCCX_B
3: OP := _CMPCCX_NB
4: OP := _CMPCCX_Z
5: OP := _CMPCCX_NZ
6: OP := _CMPCCX_BE
7: OP := _CMPCCX_NBE
8: OP := _CMPCCX_S
9: OP := _CMPCCX_NS
10: OP := _CMPCCX_P
11: OP := _CMPCCX_NP
12: OP := _CMPCCX_L
13: OP := _CMPCCX_NL
14: OP := _CMPCCX_LE
15: OP := _CMPCCX_NLE
ESAC
tmp1 := LOAD_LOCK(__A)
tmp2 := tmp1 + __C
IF (tmp1[63:0] OP __B[63:0])
	STORE_UNLOCK(__A, tmp2)
ELSE
	STORE_UNLOCK(__A, tmp1)
FI
dst[63:0] := tmp1[63:0]