組み込み関数のプロトタイプは、ヘッダーファイル ia64intrin.h 内にあります。
組み込み関数 | 説明 |
---|---|
unsigned __int64 _InterlockedExchange8(volatile unsigned char *Target, unsigned __int64 value) | xchg1 命令に対応付けます。第 1 引数で指定されたアドレスに第 2 引数の最下位のバイトをアトミックに書きます。 |
unsigned __int64 _InterlockedCompareExchange8_rel(volatile unsigned char *Destination, unsigned __int64 Exchange, unsigned __int64 Comparand) | 第 1 引数で指定されたアドレスの最下位のバイトをアトミックに比較/交換します。適切な設定の cmpxchg1.rel 命令に対応付けます。 |
unsigned __int64 _InterlockedCompareExchange8_acq(volatile unsigned char *Destination, unsigned __int64 Exchange, unsigned __int64 Comparand) | 以前の組み込み関数と同じですが、acquire セマンティックを使用します。 |
unsigned __int64 _InterlockedExchange16(volatile unsigned short *Target, unsigned __int64 value) | xchg2 命令に対応付けます。第 1 引数で指定されたアドレスに第 2 引数の最下位のワードをアトミックに書きます。 |
unsigned __int64 _InterlockedCompareExchange16_rel(volatile unsigned short *Destination, unsigned __int64 Exchange, unsigned __int64 Comparand) | 第 1 引数で指定されたアドレスの最下位のワードをアトミックに比較/交換します。適切な設定の cmpxchg2.rel 命令に対応付けます。 |
unsigned __int64 _InterlockedCompareExchange16_acq(volatile unsigned short *Destination, unsigned __int64 Exchange, unsigned __int64 Comparand) | 以前の組み込み関数と同じですが、acquire セマンティックを使用します。 |
long _InterlockedIncrement(volatile long *addend | 引数で指定された値を 1 ずつアトミックに増分します。fetchadd4 命令に対応付けます。 |
long _InterlockedDecrement(volatile long *addend | 引数で指定された値を 1 ずつアトミックに減分します。fetchadd4 命令に対応付けます。 |
long _InterlockedExchange(volatile long *Target, long value | 交換操作をアトミックに実行します。xchg4 命令に対応付けます。 |
long _InterlockedCompareExchange(volatile long *Destination, long Exchange, long Comparand | 比較/交換操作をアトミックに実行します。適切な設定の cmpxchg4 命令に対応付けます。 |
long _InterlockedExchangeAdd(volatile long *addend, long increment | 比較/交換操作を使用して、加数に対して増分値をアトミックに加算します。cmpxchg4 命令を使用するループに対応付けられ、アトミックな性質が保証されます。 |
long _InterlockedAdd(volatile long *addend, long increment) | 以前の組み込み関数と同じですが、元の値ではなく、新しい値を返します。 |
void * _InterlockedCompareExchangePointer(void * volatile *Destination, void *Exchange, void *Comparand) | cmpxchg8.acq 命令を対応付けます。第 1 引数 (すべての引数はポインター) で指定されたポインター値をアトミックに比較/交換します。 |
unsigned __int64 _InterlockedExchangeU(volatile unsigned int *Target, unsigned __int64 value) | 第 1 引数で指定された 32 ビット・データをアトミックに交換します。xchg4 命令に対応付けます。 |
unsigned __int64 _InterlockedCompareExchange_rel(volatile unsigned int *Destination, unsigned __int64 Exchange, unsigned __int64 Comparand) | 適切な設定の cmpxchg4.rel 命令に対応付けます。第 1 引数 (64 ビット・ポインター) で指定された値をアトミックに比較/交換します。 |
unsigned __int64 _InterlockedCompareExchange_acq(volatile unsigned int *Destination, unsigned __int64 Exchange, unsigned __int64 Comparand) | 以前の組み込み関数と同じですが、cmpxchg4.acq 命令を対応付けます。 |
void _ReleaseSpinLock(volatile int *x) | スピンロックを解放します。 |
__int64 _InterlockedIncrement64(volatile __int64 *addend) | 引数で指定された値を 1 ずつ増分します。fetchadd 命令に対応付けます。 |
__int64 _InterlockedDecrement64(volatile __int64 *addend) | 引数で指定された値を 1 ずつ減分します。fetchadd 命令に対応付けます。 |
__int64 _InterlockedExchange64(volatile __int64 *Target, __int64 value) | 交換操作をアトミックに実行します。xchg 命令に対応付けます。 |
unsigned __int64 _InterlockedExchangeU64(volatile unsigned __int64 *Target, unsigned __int64 value) | InterlockedExchange64 (符号なしのデータ) と同じです。 |
unsigned __int64 _InterlockedCompareExchange64_rel(volatile unsigned __int64 *Destination, unsigned __int64 Exchange, unsigned __int64 Comparand) | 適切な設定の cmpxchg.rel 命令に対応付けます。第 1 引数 (64 ビット・ポインター) で指定された値をアトミックに比較/交換します。 |
unsigned __int64 _InterlockedCompareExchange64_acq(volatile unsigned __int64 *Destination, unsigned __int64 Exchange, unsigned __int64 Comparand) | 適切な設定の cmpxchg.acq 命令に対応付けます。第 1 引数 (64 ビット・ポインター) で指定された値をアトミックに比較/交換します。 |
__int64 _InterlockedCompareExchange64(volatile __int64 *Destination, __int64 Exchange, __int64 Comparand) | 符号付きデータについては以前の組み込み関数と同じです。 |
__int64 _InterlockedExchangeAdd64(volatile __int64 *addend, __int64 increment) | 比較/交換操作を使用して、加数に対して増分値をアトミックに加算します。cmpxchg 命令を使用するループに対応付けられ、アトミックな性質を保証します。 |
__int64 _InterlockedAdd64(volatile __int64 *addend, __int64 increment); | 以前の組み込み関数と同じですが、元の値ではなく、新しい値を返します。注を参照してください。 |
_InterlockedSub64 は _InterlockedAdd64 に基づいたマクロ定義として提供されています。
#define _InterlockedSub64(target, incr) _InterlockedAdd64((target),(-(incr)))
cmpxchg を使用して、target に対して incr 値をアトミックに減算します。cmpxchg 命令を使用するループに対応付けられ、アトミックな性質を保証します。