linux_ia32.h File Reference
`#include <stdint.h>`
`#include "gcc_ia32_common.h"`
Include dependency graph for linux_ia32.h:

Go to the source code of this file.

## Macros

#define | __TBB_WORDSIZE 4
#define | __TBB_ENDIANNESS __TBB_ENDIAN_LITTLE
#define | __TBB_compiler_fence() __asm__ __volatile__("": : :"memory")
#define | __TBB_control_consistency_helper() __TBB_compiler_fence()
#define | __TBB_acquire_consistency_helper() __TBB_compiler_fence()
#define | __TBB_release_consistency_helper() __TBB_compiler_fence()
#define | __TBB_full_memory_fence() __asm__ __volatile__("mfence": : :"memory")
#define | __TBB_VOLATILE volatile
#define | __TBB_MACHINE_DEFINE_ATOMICS(S, T, X, R)
#define | __TBB_IA32_CAS8_NOINLINE
#define | __TBB_fildq "fildq"
#define | __TBB_fistpq "fistpq"
#define | __TBB_AtomicOR(P, V) __TBB_machine_or(P,V)
#define | __TBB_AtomicAND(P, V) __TBB_machine_and(P,V)
#define | __TBB_USE_GENERIC_DWORD_FETCH_ADD 1
#define | __TBB_USE_GENERIC_DWORD_FETCH_STORE 1
#define | __TBB_USE_FETCHSTORE_AS_FULL_FENCED_STORE 1
#define | __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1
#define | __TBB_USE_GENERIC_RELAXED_LOAD_STORE 1
#define | __TBB_USE_GENERIC_SEQUENTIAL_CONSISTENCY_LOAD_STORE 1

## Functions

static __TBB_IA32_CAS8_NOINLINE int64_t | __TBB_machine_cmpswp8 (volatile void *ptr, int64_t value, int64_t comparand)
static void | __TBB_machine_or (volatile void *ptr, uint32_t addend)
static void | __TBB_machine_and (volatile void *ptr, uint32_t addend)
static int64_t | __TBB_machine_aligned_load8 (const volatile void *ptr)
static void | __TBB_machine_aligned_store8 (volatile void *ptr, int64_t value)
static int64_t | __TBB_machine_load8 (const volatile void *ptr)
void | __TBB_machine_store8_slow (volatile void *ptr, int64_t value)
| Handles misaligned 8-byte store. More...
void | __TBB_machine_store8_slow_perf_warning (volatile void *ptr)
static void | __TBB_machine_store8 (volatile void *ptr, int64_t value)

## Macro Definition Documentation

## __TBB_acquire_consistency_helper

#define __TBB_acquire_consistency_helper | ( |  | ) | __TBB_compiler_fence()

Definition at line 31 of file linux_ia32.h.

## __TBB_AtomicAND

#define __TBB_AtomicAND | ( |  | P,
|  |  | V
| ) |  | __TBB_machine_and(P,V)

Definition at line 220 of file linux_ia32.h.

## __TBB_AtomicOR

#define __TBB_AtomicOR | ( |  | P,
|  |  | V
| ) |  | __TBB_machine_or(P,V)

Definition at line 219 of file linux_ia32.h.

## __TBB_compiler_fence

#define __TBB_compiler_fence | ( |  | ) | __asm__ __volatile__("": : :"memory")

Definition at line 29 of file linux_ia32.h.

## __TBB_control_consistency_helper

#define __TBB_control_consistency_helper | ( |  | ) | __TBB_compiler_fence()

Definition at line 30 of file linux_ia32.h.

## __TBB_ENDIANNESS

#define __TBB_ENDIANNESS __TBB_ENDIAN_LITTLE

Definition at line 27 of file linux_ia32.h.

## __TBB_fildq

#define __TBB_fildq "fildq"

Definition at line 165 of file linux_ia32.h.

## __TBB_fistpq

#define __TBB_fistpq "fistpq"

Definition at line 166 of file linux_ia32.h.

## __TBB_full_memory_fence

#define __TBB_full_memory_fence | ( |  | ) | __asm__ __volatile__("mfence": : :"memory")

Definition at line 33 of file linux_ia32.h.

## __TBB_IA32_CAS8_NOINLINE

#define __TBB_IA32_CAS8_NOINLINE

Definition at line 86 of file linux_ia32.h.

## __TBB_MACHINE_DEFINE_ATOMICS

#define __TBB_MACHINE_DEFINE_ATOMICS | ( |  | S,
|  |  | T,
|  |  | X,
|  |  | R
| ) |  |

Value:
static inline T __TBB_machine_cmpswp##S (volatile void *ptr, T value, T comparand ) \
{ \
T result; \
\
__asm__ __volatile__("lock\ncmpxchg" X " %2,%1" \
: "=a"(result), "=m"(*(__TBB_VOLATILE T*)ptr) \
: "q"(value), "0"(comparand), "m"(*(__TBB_VOLATILE T*)ptr) \
: "memory"); \
return result; \
} \
\
static inline T __TBB_machine_fetchadd##S(volatile void *ptr, T addend) \
{ \
T result; \
__asm__ __volatile__("lock\nxadd" X " %0,%1" \
: R (result), "=m"(*(__TBB_VOLATILE T*)ptr) \
: "0"(addend), "m"(*(__TBB_VOLATILE T*)ptr) \
: "memory"); \
return result; \
} \
\
static inline T __TBB_machine_fetchstore##S(volatile void *ptr, T value) \
{ \
T result; \
__asm__ __volatile__("lock\nxchg" X " %0,%1" \
: R (result), "=m"(*(__TBB_VOLATILE T*)ptr) \
: "0"(value), "m"(*(__TBB_VOLATILE T*)ptr) \
: "memory"); \
return result; \
} \

Definition at line 41 of file linux_ia32.h.

## __TBB_release_consistency_helper

#define __TBB_release_consistency_helper | ( |  | ) | __TBB_compiler_fence()

Definition at line 32 of file linux_ia32.h.

## __TBB_USE_FETCHSTORE_AS_FULL_FENCED_STORE

#define __TBB_USE_FETCHSTORE_AS_FULL_FENCED_STORE 1

Definition at line 224 of file linux_ia32.h.

## __TBB_USE_GENERIC_DWORD_FETCH_ADD

#define __TBB_USE_GENERIC_DWORD_FETCH_ADD 1

Definition at line 222 of file linux_ia32.h.

## __TBB_USE_GENERIC_DWORD_FETCH_STORE

#define __TBB_USE_GENERIC_DWORD_FETCH_STORE 1

Definition at line 223 of file linux_ia32.h.

## __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE

#define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1

Definition at line 225 of file linux_ia32.h.

## __TBB_USE_GENERIC_RELAXED_LOAD_STORE

#define __TBB_USE_GENERIC_RELAXED_LOAD_STORE 1

Definition at line 226 of file linux_ia32.h.

## __TBB_USE_GENERIC_SEQUENTIAL_CONSISTENCY_LOAD_STORE

#define __TBB_USE_GENERIC_SEQUENTIAL_CONSISTENCY_LOAD_STORE 1

Definition at line 227 of file linux_ia32.h.

## __TBB_VOLATILE

#define __TBB_VOLATILE volatile

Definition at line 38 of file linux_ia32.h.

## __TBB_WORDSIZE

#define __TBB_WORDSIZE 4

Definition at line 26 of file linux_ia32.h.

## Function Documentation

## __TBB_machine_aligned_load8()

static int64_t __TBB_machine_aligned_load8 | ( | const volatile void * | ptr | ) |

inline static

Definition at line 169 of file linux_ia32.h.

{
__TBB_ASSERT(tbb::internal::is_aligned(ptr,8),"__TBB_machine_aligned_load8 should be used with 8 byte aligned locations only \n");
int64_t result;
__asm__ __volatile__ ( __TBB_fildq " %1\n\t"
__TBB_fistpq " %0" : "=m"(result) : "m"(*(const __TBB_VOLATILE uint64_t*)ptr) : "memory" );
return result;
}

References __TBB_ASSERT, __TBB_fildq, __TBB_fistpq, __TBB_VOLATILE, and tbb::internal::is_aligned().

Referenced by __TBB_machine_load8().

Here is the call graph for this function:
Here is the caller graph for this function:

## __TBB_machine_aligned_store8()

static void __TBB_machine_aligned_store8 | ( | volatile void * | ptr,
|  | int64_t | value
| ) |  |

inline static

Definition at line 177 of file linux_ia32.h.

{
__TBB_ASSERT(tbb::internal::is_aligned(ptr,8),"__TBB_machine_aligned_store8 should be used with 8 byte aligned locations only \n");
// Aligned store
__asm__ __volatile__ ( __TBB_fildq " %1\n\t"
__TBB_fistpq " %0" : "=m"(*(__TBB_VOLATILE int64_t*)ptr) : "m"(value) : "memory" );
}

References __TBB_ASSERT, __TBB_fildq, __TBB_fistpq, __TBB_VOLATILE, tbb::internal::is_aligned(), and value.

Referenced by __TBB_machine_store8().

Here is the call graph for this function:
Here is the caller graph for this function:

## __TBB_machine_and()

static void __TBB_machine_and | ( | volatile void * | ptr,
|  | uint32_t | addend
| ) |  |

inline static

Definition at line 153 of file linux_ia32.h.

{
__asm__ __volatile__("lock\nandl %1,%0" : "=m"(*(__TBB_VOLATILE uint32_t *)ptr) : "r"(addend), "m"(*(__TBB_VOLATILE uint32_t *)ptr) : "memory");
}

References __TBB_VOLATILE.

## __TBB_machine_cmpswp8()

static __TBB_IA32_CAS8_NOINLINE int64_t __TBB_machine_cmpswp8 | ( | volatile void * | ptr,
|  | int64_t | value,
|  | int64_t | comparand
| ) |  |

inline static

Definition at line 89 of file linux_ia32.h.

{
//TODO: remove the extra part of condition once __TBB_GCC_BUILTIN_ATOMICS_PRESENT is lowered to gcc version 4.1.2
#if (__TBB_GCC_BUILTIN_ATOMICS_PRESENT || (__TBB_GCC_VERSION >= 40102)) && !__TBB_GCC_64BIT_ATOMIC_BUILTINS_BROKEN
return __sync_val_compare_and_swap( reinterpret_cast<volatile int64_t*>(ptr), comparand, value );
#else /* !__TBB_GCC_BUILTIN_ATOMICS_PRESENT */
//TODO: look like ICC 13.0 has some issues with this code, investigate it more deeply
int64_t result;
union {
int64_t i64;
int32_t i32[2];
};
i64 = value;
#if __PIC__
/* compiling position-independent code */
// EBX register preserved for compliance with position-independent code rules on IA32
int32_t tmp;
__asm__ __volatile__ (
"movl %%ebx,%2\n\t"
"movl %5,%%ebx\n\t"
#if __GNUC__==3
"lock\n\t cmpxchg8b %1\n\t"
#else
"lock\n\t cmpxchg8b (%3)\n\t"
#endif
"movl %2,%%ebx"
: "=A"(result)
, "=m"(*(__TBB_VOLATILE int64_t *)ptr)
, "=m"(tmp)
#if __GNUC__==3
: "m"(*(__TBB_VOLATILE int64_t *)ptr)
#else
: "SD"(ptr)
#endif
, "0"(comparand)
, "m"(i32[0]), "c"(i32[1])
: "memory"
#if __INTEL_COMPILER
,"ebx"
#endif
);
#else /* !__PIC__ */
__asm__ __volatile__ (
"lock\n\t cmpxchg8b %1\n\t"
: "=A"(result), "=m"(*(__TBB_VOLATILE int64_t *)ptr)
: "m"(*(__TBB_VOLATILE int64_t *)ptr)
, "0"(comparand)
, "b"(i32[0]), "c"(i32[1])
: "memory"
);
#endif /* __PIC__ */
return result;
#endif /* !__TBB_GCC_BUILTIN_ATOMICS_PRESENT */
}

References __TBB_VOLATILE, and value.

Referenced by __TBB_machine_load8().

Here is the caller graph for this function:

## __TBB_machine_load8()

static int64_t __TBB_machine_load8 | ( | const volatile void * | ptr | ) |

inline static

Definition at line 184 of file linux_ia32.h.

{
#if __TBB_FORCE_64BIT_ALIGNMENT_BROKEN
if( tbb::internal::is_aligned(ptr,8)) {
#endif
return __TBB_machine_aligned_load8(ptr);
#if __TBB_FORCE_64BIT_ALIGNMENT_BROKEN
} else {
// Unaligned load
return __TBB_machine_cmpswp8(const_cast<void*>(ptr),0,0);
}
#endif
}

References __TBB_machine_aligned_load8(), __TBB_machine_cmpswp8(), and tbb::internal::is_aligned().

Here is the call graph for this function:

## __TBB_machine_or()

static void __TBB_machine_or | ( | volatile void * | ptr,
|  | uint32_t | addend
| ) |  |

inline static

Definition at line 149 of file linux_ia32.h.

{
__asm__ __volatile__("lock\norl %1,%0" : "=m"(*(__TBB_VOLATILE uint32_t *)ptr) : "r"(addend), "m"(*(__TBB_VOLATILE uint32_t *)ptr) : "memory");
}

References __TBB_VOLATILE.

## __TBB_machine_store8()

static void __TBB_machine_store8 | ( | volatile void * | ptr,
|  | int64_t | value
| ) |  |

inline static

Definition at line 202 of file linux_ia32.h.

{
#if __TBB_FORCE_64BIT_ALIGNMENT_BROKEN
if( tbb::internal::is_aligned(ptr,8)) {
#endif
__TBB_machine_aligned_store8(ptr,value);
#if __TBB_FORCE_64BIT_ALIGNMENT_BROKEN
} else {
// Unaligned store
#if TBB_USE_PERFORMANCE_WARNINGS
__TBB_machine_store8_slow_perf_warning(ptr);
#endif /* TBB_USE_PERFORMANCE_WARNINGS */
__TBB_machine_store8_slow(ptr,value);
}
#endif
}

References __TBB_machine_aligned_store8(), __TBB_machine_store8_slow(), __TBB_machine_store8_slow_perf_warning(), tbb::internal::is_aligned(), and value.

Here is the call graph for this function:

## __TBB_machine_store8_slow()

void __TBB_machine_store8_slow | ( | volatile void * | ptr,
|  | int64_t | value
| ) |  |

Handles misaligned 8-byte store.

Defined in tbb_misc.cpp

Referenced by __TBB_machine_store8().

Here is the caller graph for this function:

## __TBB_machine_store8_slow_perf_warning()

void __TBB_machine_store8_slow_perf_warning | ( | volatile void * | ptr | ) |

Referenced by __TBB_machine_store8().

Here is the caller graph for this function:
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
__TBB_fistpq
#define __TBB_fistpq
Definition: linux_ia32.h:166
__TBB_VOLATILE
#define __TBB_VOLATILE
Definition: linux_ia32.h:38
__TBB_fildq
#define __TBB_fildq
Definition: linux_ia32.h:165
__TBB_machine_aligned_load8
static int64_t __TBB_machine_aligned_load8(const volatile void *ptr)
Definition: linux_ia32.h:169
tbb::internal::is_aligned
bool is_aligned(T *pointer, uintptr_t alignment)
A function to check if passed in pointer is aligned on a specific border.
Definition: tbb_stddef.h:370
__TBB_machine_cmpswp8
static __TBB_IA32_CAS8_NOINLINE int64_t __TBB_machine_cmpswp8(volatile void *ptr, int64_t value, int64_t comparand)
Definition: linux_ia32.h:89
__TBB_machine_store8_slow
void __TBB_machine_store8_slow(volatile void *ptr, int64_t value)
Handles misaligned 8-byte store.
__TBB_machine_store8_slow_perf_warning
void __TBB_machine_store8_slow_perf_warning(volatile void *ptr)
value
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
Definition: ittnotify_static.h:192
__TBB_machine_aligned_store8
static void __TBB_machine_aligned_store8(volatile void *ptr, int64_t value)
Definition: linux_ia32.h:177
S
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type size_t void ITT_FORMAT p const __itt_domain __itt_id __itt_string_handle const wchar_t size_t ITT_FORMAT lu const __itt_domain __itt_id __itt_relation __itt_id ITT_FORMAT p const wchar_t int ITT_FORMAT __itt_group_mark S
Definition: ittnotify_static.h:212

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.