Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
linux_ia64.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2005-2020 Intel Corporation
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
17 #if !defined(__TBB_machine_H) || defined(__TBB_machine_linux_ia64_H)
18 #error Do not #include this internal file directly; use public TBB headers instead.
19 #endif
20 
21 #define __TBB_machine_linux_ia64_H
22 
23 #include <stdint.h>
24 #include <ia64intrin.h>
25 
26 #define __TBB_WORDSIZE 8
27 #define __TBB_ENDIANNESS __TBB_ENDIAN_LITTLE
28 
29 #if __INTEL_COMPILER
30  #define __TBB_compiler_fence()
31  #define __TBB_control_consistency_helper() __TBB_compiler_fence()
32  #define __TBB_acquire_consistency_helper()
33  #define __TBB_release_consistency_helper()
34  #define __TBB_full_memory_fence() __mf()
35 #else
36  #define __TBB_compiler_fence() __asm__ __volatile__("": : :"memory")
37  #define __TBB_control_consistency_helper() __TBB_compiler_fence()
38  // Even though GCC imbues volatile loads with acquire semantics, it sometimes moves
39  // loads over the acquire fence. The following helpers stop such incorrect code motion.
40  #define __TBB_acquire_consistency_helper() __TBB_compiler_fence()
41  #define __TBB_release_consistency_helper() __TBB_compiler_fence()
42  #define __TBB_full_memory_fence() __asm__ __volatile__("mf": : :"memory")
43 #endif /* !__INTEL_COMPILER */
44 
45 // Most of the functions will be in a .s file
46 // TODO: revise dynamic_link, memory pools and etc. if the library dependency is removed.
47 
48 extern "C" {
49  int8_t __TBB_machine_fetchadd1__TBB_full_fence (volatile void *ptr, int8_t addend);
50  int8_t __TBB_machine_fetchadd1acquire(volatile void *ptr, int8_t addend);
51  int8_t __TBB_machine_fetchadd1release(volatile void *ptr, int8_t addend);
52 
53  int16_t __TBB_machine_fetchadd2__TBB_full_fence (volatile void *ptr, int16_t addend);
54  int16_t __TBB_machine_fetchadd2acquire(volatile void *ptr, int16_t addend);
55  int16_t __TBB_machine_fetchadd2release(volatile void *ptr, int16_t addend);
56 
57  int32_t __TBB_machine_fetchadd4__TBB_full_fence (volatile void *ptr, int32_t value);
58  int32_t __TBB_machine_fetchadd4acquire(volatile void *ptr, int32_t addend);
59  int32_t __TBB_machine_fetchadd4release(volatile void *ptr, int32_t addend);
60 
61  int64_t __TBB_machine_fetchadd8__TBB_full_fence (volatile void *ptr, int64_t value);
62  int64_t __TBB_machine_fetchadd8acquire(volatile void *ptr, int64_t addend);
63  int64_t __TBB_machine_fetchadd8release(volatile void *ptr, int64_t addend);
64 
65  int8_t __TBB_machine_fetchstore1__TBB_full_fence (volatile void *ptr, int8_t value);
66  int8_t __TBB_machine_fetchstore1acquire(volatile void *ptr, int8_t value);
67  int8_t __TBB_machine_fetchstore1release(volatile void *ptr, int8_t value);
68 
69  int16_t __TBB_machine_fetchstore2__TBB_full_fence (volatile void *ptr, int16_t value);
70  int16_t __TBB_machine_fetchstore2acquire(volatile void *ptr, int16_t value);
71  int16_t __TBB_machine_fetchstore2release(volatile void *ptr, int16_t value);
72 
73  int32_t __TBB_machine_fetchstore4__TBB_full_fence (volatile void *ptr, int32_t value);
74  int32_t __TBB_machine_fetchstore4acquire(volatile void *ptr, int32_t value);
75  int32_t __TBB_machine_fetchstore4release(volatile void *ptr, int32_t value);
76 
77  int64_t __TBB_machine_fetchstore8__TBB_full_fence (volatile void *ptr, int64_t value);
78  int64_t __TBB_machine_fetchstore8acquire(volatile void *ptr, int64_t value);
79  int64_t __TBB_machine_fetchstore8release(volatile void *ptr, int64_t value);
80 
81  int8_t __TBB_machine_cmpswp1__TBB_full_fence (volatile void *ptr, int8_t value, int8_t comparand);
82  int8_t __TBB_machine_cmpswp1acquire(volatile void *ptr, int8_t value, int8_t comparand);
83  int8_t __TBB_machine_cmpswp1release(volatile void *ptr, int8_t value, int8_t comparand);
84 
85  int16_t __TBB_machine_cmpswp2__TBB_full_fence (volatile void *ptr, int16_t value, int16_t comparand);
86  int16_t __TBB_machine_cmpswp2acquire(volatile void *ptr, int16_t value, int16_t comparand);
87  int16_t __TBB_machine_cmpswp2release(volatile void *ptr, int16_t value, int16_t comparand);
88 
89  int32_t __TBB_machine_cmpswp4__TBB_full_fence (volatile void *ptr, int32_t value, int32_t comparand);
90  int32_t __TBB_machine_cmpswp4acquire(volatile void *ptr, int32_t value, int32_t comparand);
91  int32_t __TBB_machine_cmpswp4release(volatile void *ptr, int32_t value, int32_t comparand);
92 
93  int64_t __TBB_machine_cmpswp8__TBB_full_fence (volatile void *ptr, int64_t value, int64_t comparand);
94  int64_t __TBB_machine_cmpswp8acquire(volatile void *ptr, int64_t value, int64_t comparand);
95  int64_t __TBB_machine_cmpswp8release(volatile void *ptr, int64_t value, int64_t comparand);
96 
97  int64_t __TBB_machine_lg(uint64_t value);
98  void __TBB_machine_pause(int32_t delay);
99  bool __TBB_machine_trylockbyte( volatile unsigned char &ptr );
100  int64_t __TBB_machine_lockbyte( volatile unsigned char &ptr );
101 
103  void* __TBB_get_bsp();
104 
105  int32_t __TBB_machine_load1_relaxed(const void *ptr);
106  int32_t __TBB_machine_load2_relaxed(const void *ptr);
107  int32_t __TBB_machine_load4_relaxed(const void *ptr);
108  int64_t __TBB_machine_load8_relaxed(const void *ptr);
109 
110  void __TBB_machine_store1_relaxed(void *ptr, int32_t value);
111  void __TBB_machine_store2_relaxed(void *ptr, int32_t value);
112  void __TBB_machine_store4_relaxed(void *ptr, int32_t value);
113  void __TBB_machine_store8_relaxed(void *ptr, int64_t value);
114 } // extern "C"
115 
116 // Mapping old entry points to the names corresponding to the new full_fence identifier.
117 #define __TBB_machine_fetchadd1full_fence __TBB_machine_fetchadd1__TBB_full_fence
118 #define __TBB_machine_fetchadd2full_fence __TBB_machine_fetchadd2__TBB_full_fence
119 #define __TBB_machine_fetchadd4full_fence __TBB_machine_fetchadd4__TBB_full_fence
120 #define __TBB_machine_fetchadd8full_fence __TBB_machine_fetchadd8__TBB_full_fence
121 #define __TBB_machine_fetchstore1full_fence __TBB_machine_fetchstore1__TBB_full_fence
122 #define __TBB_machine_fetchstore2full_fence __TBB_machine_fetchstore2__TBB_full_fence
123 #define __TBB_machine_fetchstore4full_fence __TBB_machine_fetchstore4__TBB_full_fence
124 #define __TBB_machine_fetchstore8full_fence __TBB_machine_fetchstore8__TBB_full_fence
125 #define __TBB_machine_cmpswp1full_fence __TBB_machine_cmpswp1__TBB_full_fence
126 #define __TBB_machine_cmpswp2full_fence __TBB_machine_cmpswp2__TBB_full_fence
127 #define __TBB_machine_cmpswp4full_fence __TBB_machine_cmpswp4__TBB_full_fence
128 #define __TBB_machine_cmpswp8full_fence __TBB_machine_cmpswp8__TBB_full_fence
129 
130 // Mapping relaxed operations to the entry points implementing them.
133 #define __TBB_machine_fetchadd1relaxed __TBB_machine_fetchadd1acquire
134 #define __TBB_machine_fetchadd2relaxed __TBB_machine_fetchadd2acquire
135 #define __TBB_machine_fetchadd4relaxed __TBB_machine_fetchadd4acquire
136 #define __TBB_machine_fetchadd8relaxed __TBB_machine_fetchadd8acquire
137 #define __TBB_machine_fetchstore1relaxed __TBB_machine_fetchstore1acquire
138 #define __TBB_machine_fetchstore2relaxed __TBB_machine_fetchstore2acquire
139 #define __TBB_machine_fetchstore4relaxed __TBB_machine_fetchstore4acquire
140 #define __TBB_machine_fetchstore8relaxed __TBB_machine_fetchstore8acquire
141 #define __TBB_machine_cmpswp1relaxed __TBB_machine_cmpswp1acquire
142 #define __TBB_machine_cmpswp2relaxed __TBB_machine_cmpswp2acquire
143 #define __TBB_machine_cmpswp4relaxed __TBB_machine_cmpswp4acquire
144 #define __TBB_machine_cmpswp8relaxed __TBB_machine_cmpswp8acquire
145 
146 #define __TBB_MACHINE_DEFINE_ATOMICS(S,V) \
147  template <typename T> \
148  struct machine_load_store_relaxed<T,S> { \
149  static inline T load ( const T& location ) { \
150  return (T)__TBB_machine_load##S##_relaxed(&location); \
151  } \
152  static inline void store ( T& location, T value ) { \
153  __TBB_machine_store##S##_relaxed(&location, (V)value); \
154  } \
155  }
156 
157 namespace tbb {
158 namespace internal {
160  __TBB_MACHINE_DEFINE_ATOMICS(2,int16_t);
161  __TBB_MACHINE_DEFINE_ATOMICS(4,int32_t);
162  __TBB_MACHINE_DEFINE_ATOMICS(8,int64_t);
163 }} // namespaces internal, tbb
164 
165 #undef __TBB_MACHINE_DEFINE_ATOMICS
166 
167 #define __TBB_USE_FENCED_ATOMICS 1
168 #define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1
169 #define __TBB_USE_GENERIC_SEQUENTIAL_CONSISTENCY_LOAD_STORE 1
170 
171 // Definition of Lock functions
172 #define __TBB_TryLockByte(P) __TBB_machine_trylockbyte(P)
173 #define __TBB_LockByte(P) __TBB_machine_lockbyte(P)
174 
175 // Definition of other utility functions
176 #define __TBB_Pause(V) __TBB_machine_pause(V)
177 #define __TBB_Log2(V) __TBB_machine_lg(V)
void * __TBB_get_bsp()
Retrieves the current RSE backing store pointer. IA64 specific.
int16_t __TBB_machine_cmpswp2__TBB_full_fence(volatile void *ptr, int16_t value, int16_t comparand)
__TBB_MACHINE_DEFINE_ATOMICS(1, int8_t)
int8_t __TBB_machine_fetchadd1__TBB_full_fence(volatile void *ptr, int8_t addend)
int64_t __TBB_machine_cmpswp8__TBB_full_fence(volatile void *ptr, int64_t value, int64_t comparand)
int8_t __TBB_machine_fetchstore1acquire(volatile void *ptr, int8_t value)
int32_t __TBB_machine_fetchadd4release(volatile void *ptr, int32_t addend)
int32_t __TBB_machine_load4_relaxed(const void *ptr)
int16_t __TBB_machine_fetchadd2__TBB_full_fence(volatile void *ptr, int16_t addend)
int64_t __TBB_machine_load8_relaxed(const void *ptr)
int64_t __TBB_machine_cmpswp8acquire(volatile void *ptr, int64_t value, int64_t comparand)
int32_t __TBB_machine_load1_relaxed(const void *ptr)
int64_t __TBB_machine_lg(uint64_t value)
int64_t __TBB_machine_fetchadd8__TBB_full_fence(volatile void *ptr, int64_t value)
void __TBB_machine_store2_relaxed(void *ptr, int32_t value)
int8_t __TBB_machine_fetchadd1acquire(volatile void *ptr, int8_t addend)
int16_t __TBB_machine_fetchadd2acquire(volatile void *ptr, int16_t addend)
int8_t __TBB_machine_fetchstore1__TBB_full_fence(volatile void *ptr, int8_t value)
int32_t __TBB_machine_fetchstore4__TBB_full_fence(volatile void *ptr, int32_t value)
int32_t __TBB_machine_fetchstore4release(volatile void *ptr, int32_t value)
int64_t __TBB_machine_fetchadd8acquire(volatile void *ptr, int64_t addend)
int32_t __TBB_machine_cmpswp4release(volatile void *ptr, int32_t value, int32_t comparand)
int32_t __TBB_machine_cmpswp4acquire(volatile void *ptr, int32_t value, int32_t comparand)
int32_t __TBB_machine_load2_relaxed(const void *ptr)
int8_t __TBB_machine_cmpswp1__TBB_full_fence(volatile void *ptr, int8_t value, int8_t comparand)
int64_t __TBB_machine_fetchstore8__TBB_full_fence(volatile void *ptr, int64_t value)
int8_t __TBB_machine_cmpswp1acquire(volatile void *ptr, int8_t value, int8_t comparand)
int32_t __TBB_machine_fetchadd4acquire(volatile void *ptr, int32_t addend)
int64_t __TBB_machine_fetchstore8release(volatile void *ptr, int64_t value)
void __TBB_machine_pause(int32_t delay)
Definition: gcc_arm.h:208
int8_t __TBB_machine_cmpswp1release(volatile void *ptr, int8_t value, int8_t comparand)
int16_t __TBB_machine_cmpswp2acquire(volatile void *ptr, int16_t value, int16_t comparand)
int32_t __TBB_machine_fetchadd4__TBB_full_fence(volatile void *ptr, int32_t value)
void __TBB_machine_store8_relaxed(void *ptr, int64_t value)
int32_t __TBB_machine_fetchstore4acquire(volatile void *ptr, int32_t value)
int16_t __TBB_machine_fetchstore2acquire(volatile void *ptr, int16_t value)
int64_t __TBB_machine_fetchstore8acquire(volatile void *ptr, int64_t value)
int8_t __TBB_machine_fetchadd1release(volatile void *ptr, int8_t addend)
void __TBB_machine_store1_relaxed(void *ptr, int32_t value)
bool __TBB_machine_trylockbyte(volatile unsigned char &ptr)
int8_t __TBB_machine_fetchstore1release(volatile void *ptr, int8_t value)
int16_t __TBB_machine_fetchstore2release(volatile void *ptr, int16_t 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
int16_t __TBB_machine_cmpswp2release(volatile void *ptr, int16_t value, int16_t comparand)
int16_t __TBB_machine_fetchstore2__TBB_full_fence(volatile void *ptr, int16_t value)
The graph class.
void __TBB_machine_store4_relaxed(void *ptr, int32_t value)
int16_t __TBB_machine_fetchadd2release(volatile void *ptr, int16_t addend)
int64_t __TBB_machine_fetchadd8release(volatile void *ptr, int64_t addend)
int32_t __TBB_machine_cmpswp4__TBB_full_fence(volatile void *ptr, int32_t value, int32_t comparand)
int64_t __TBB_machine_lockbyte(volatile unsigned char &ptr)
int64_t __TBB_machine_cmpswp8release(volatile void *ptr, int64_t value, int64_t comparand)

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.