27 #error "HTM instruction set not enabled"
34 typedef uint64_t texasr_t;
35 typedef uint32_t texasru_t;
36 typedef uint32_t texasrl_t;
37 typedef uintptr_t tfiar_t;
38 typedef uintptr_t tfhar_t;
40 #define _HTM_STATE(CR0) ((CR0 >> 1) & 0x3)
41 #define _HTM_NONTRANSACTIONAL 0x0
42 #define _HTM_SUSPENDED 0x1
43 #define _HTM_TRANSACTIONAL 0x2
45 #define _TEXASR_EXTRACT_BITS(TEXASR,BITNUM,SIZE) \
46 (((TEXASR) >> (63-(BITNUM))) & ((1<<(SIZE))-1))
47 #define _TEXASRU_EXTRACT_BITS(TEXASR,BITNUM,SIZE) \
48 (((TEXASR) >> (31-(BITNUM))) & ((1<<(SIZE))-1))
50 #define _TEXASR_FAILURE_CODE(TEXASR) \
51 _TEXASR_EXTRACT_BITS(TEXASR, 7, 8)
52 #define _TEXASRU_FAILURE_CODE(TEXASRU) \
53 _TEXASRU_EXTRACT_BITS(TEXASRU, 7, 8)
55 #define _TEXASR_FAILURE_PERSISTENT(TEXASR) \
56 _TEXASR_EXTRACT_BITS(TEXASR, 7, 1)
57 #define _TEXASRU_FAILURE_PERSISTENT(TEXASRU) \
58 _TEXASRU_EXTRACT_BITS(TEXASRU, 7, 1)
60 #define _TEXASR_DISALLOWED(TEXASR) \
61 _TEXASR_EXTRACT_BITS(TEXASR, 8, 1)
62 #define _TEXASRU_DISALLOWED(TEXASRU) \
63 _TEXASRU_EXTRACT_BITS(TEXASRU, 8, 1)
65 #define _TEXASR_NESTING_OVERFLOW(TEXASR) \
66 _TEXASR_EXTRACT_BITS(TEXASR, 9, 1)
67 #define _TEXASRU_NESTING_OVERFLOW(TEXASRU) \
68 _TEXASRU_EXTRACT_BITS(TEXASRU, 9, 1)
70 #define _TEXASR_FOOTPRINT_OVERFLOW(TEXASR) \
71 _TEXASR_EXTRACT_BITS(TEXASR, 10, 1)
72 #define _TEXASRU_FOOTPRINT_OVERFLOW(TEXASRU) \
73 _TEXASRU_EXTRACT_BITS(TEXASRU, 10, 1)
75 #define _TEXASR_SELF_INDUCED_CONFLICT(TEXASR) \
76 _TEXASR_EXTRACT_BITS(TEXASR, 11, 1)
77 #define _TEXASRU_SELF_INDUCED_CONFLICT(TEXASRU) \
78 _TEXASRU_EXTRACT_BITS(TEXASRU, 11, 1)
80 #define _TEXASR_NON_TRANSACTIONAL_CONFLICT(TEXASR) \
81 _TEXASR_EXTRACT_BITS(TEXASR, 12, 1)
82 #define _TEXASRU_NON_TRANSACTIONAL_CONFLICT(TEXASRU) \
83 _TEXASRU_EXTRACT_BITS(TEXASRU, 12, 1)
85 #define _TEXASR_TRANSACTION_CONFLICT(TEXASR) \
86 _TEXASR_EXTRACT_BITS(TEXASR, 13, 1)
87 #define _TEXASRU_TRANSACTION_CONFLICT(TEXASRU) \
88 _TEXASRU_EXTRACT_BITS(TEXASRU, 13, 1)
90 #define _TEXASR_TRANSLATION_INVALIDATION_CONFLICT(TEXASR) \
91 _TEXASR_EXTRACT_BITS(TEXASR, 14, 1)
92 #define _TEXASRU_TRANSLATION_INVALIDATION_CONFLICT(TEXASRU) \
93 _TEXASRU_EXTRACT_BITS(TEXASRU, 14, 1)
95 #define _TEXASR_IMPLEMENTAION_SPECIFIC(TEXASR) \
96 _TEXASR_EXTRACT_BITS(TEXASR, 15, 1)
97 #define _TEXASRU_IMPLEMENTAION_SPECIFIC(TEXASRU) \
98 _TEXASRU_EXTRACT_BITS(TEXASRU, 15, 1)
100 #define _TEXASR_INSTRUCTION_FETCH_CONFLICT(TEXASR) \
101 _TEXASR_EXTRACT_BITS(TEXASR, 16, 1)
102 #define _TEXASRU_INSTRUCTION_FETCH_CONFLICT(TEXASRU) \
103 _TEXASRU_EXTRACT_BITS(TEXASRU, 16, 1)
105 #define _TEXASR_ABORT(TEXASR) \
106 _TEXASR_EXTRACT_BITS(TEXASR, 31, 1)
107 #define _TEXASRU_ABORT(TEXASRU) \
108 _TEXASRU_EXTRACT_BITS(TEXASRU, 31, 1)
111 #define _TEXASR_SUSPENDED(TEXASR) \
112 _TEXASR_EXTRACT_BITS(TEXASR, 32, 1)
114 #define _TEXASR_PRIVILEGE(TEXASR) \
115 _TEXASR_EXTRACT_BITS(TEXASR, 35, 2)
117 #define _TEXASR_FAILURE_SUMMARY(TEXASR) \
118 _TEXASR_EXTRACT_BITS(TEXASR, 36, 1)
120 #define _TEXASR_TFIAR_EXACT(TEXASR) \
121 _TEXASR_EXTRACT_BITS(TEXASR, 37, 1)
123 #define _TEXASR_ROT(TEXASR) \
124 _TEXASR_EXTRACT_BITS(TEXASR, 38, 1)
126 #define _TEXASR_TRANSACTION_LEVEL(TEXASR) \
127 _TEXASR_EXTRACT_BITS(TEXASR, 63, 12)
134 #define _HTM_TBEGIN_STARTED 0
135 #define _HTM_TBEGIN_INDETERMINATE 1
136 #define _HTM_TBEGIN_TRANSIENT 2
137 #define _HTM_TBEGIN_PERSISTENT 3
140 #define _HTM_FIRST_USER_ABORT_CODE 256
146 unsigned char format;
148 unsigned char reserved1[4];
149 unsigned short nesting_depth;
150 unsigned long long abort_code;
151 unsigned long long conflict_token;
152 unsigned long long atia;
155 unsigned char reserved2[2];
156 unsigned int program_int_id;
157 unsigned long long exception_id;
158 unsigned long long bea;
159 unsigned char reserved3[72];
160 unsigned long long gprs[16];
166 static __inline
int __attribute__((__always_inline__, __nodebug__))
167 __builtin_tbegin_retry_null (
int retry)
171 while ((cc = __builtin_tbegin(0)) == _HTM_TBEGIN_TRANSIENT
173 __builtin_tx_assist(i);
178 static __inline
int __attribute__((__always_inline__, __nodebug__))
179 __builtin_tbegin_retry_tdb (
void *tdb,
int retry)
183 while ((cc = __builtin_tbegin(tdb)) == _HTM_TBEGIN_TRANSIENT
185 __builtin_tx_assist(i);
190 #define __builtin_tbegin_retry(tdb, retry) \
191 (__builtin_constant_p(tdb == 0) && tdb == 0 ? \
192 __builtin_tbegin_retry_null(retry) : \
193 __builtin_tbegin_retry_tdb(tdb, retry))
195 static __inline
int __attribute__((__always_inline__, __nodebug__))
196 __builtin_tbegin_retry_nofloat_null (
int retry)
200 while ((cc = __builtin_tbegin_nofloat(0)) == _HTM_TBEGIN_TRANSIENT
202 __builtin_tx_assist(i);
207 static __inline
int __attribute__((__always_inline__, __nodebug__))
208 __builtin_tbegin_retry_nofloat_tdb (
void *tdb,
int retry)
212 while ((cc = __builtin_tbegin_nofloat(tdb)) == _HTM_TBEGIN_TRANSIENT
214 __builtin_tx_assist(i);
219 #define __builtin_tbegin_retry_nofloat(tdb, retry) \
220 (__builtin_constant_p(tdb == 0) && tdb == 0 ? \
221 __builtin_tbegin_retry_nofloat_null(retry) : \
222 __builtin_tbegin_retry_nofloat_tdb(tdb, retry))
char __v64qi __attribute__((__vector_size__(64)))
Definition: avx512bwintrin.h:33
int i
Definition: ser-log.py:25