xcodebuild-helper 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +20 -0
- data/.gitignore +1 -0
- data/.rspec +2 -0
- data/.travis.yml +7 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +110 -0
- data/Guardfile +18 -0
- data/README.md +7 -0
- data/Rakefile +7 -0
- data/TODO.md +3 -0
- data/bin/oclint +5 -0
- data/bin/oclint-0.8 +5 -0
- data/bin/oclint-json-compilation-database +5 -0
- data/bin/oclint-xcodebuild +5 -0
- data/externals/oclint/LICENSE +69 -0
- data/externals/oclint/bin/oclint +0 -0
- data/externals/oclint/bin/oclint-0.10.2 +0 -0
- data/externals/oclint/bin/oclint-json-compilation-database +88 -0
- data/externals/oclint/bin/oclint-xcodebuild +218 -0
- data/externals/oclint/lib/clang/3.7.0/asan_blacklist.txt +13 -0
- data/externals/oclint/lib/clang/3.7.0/include/Intrin.h +958 -0
- data/externals/oclint/lib/clang/3.7.0/include/__stddef_max_align_t.h +43 -0
- data/externals/oclint/lib/clang/3.7.0/include/__wmmintrin_aes.h +72 -0
- data/externals/oclint/lib/clang/3.7.0/include/__wmmintrin_pclmul.h +34 -0
- data/externals/oclint/lib/clang/3.7.0/include/adxintrin.h +88 -0
- data/externals/oclint/lib/clang/3.7.0/include/altivec.h +13528 -0
- data/externals/oclint/lib/clang/3.7.0/include/ammintrin.h +215 -0
- data/externals/oclint/lib/clang/3.7.0/include/arm_acle.h +304 -0
- data/externals/oclint/lib/clang/3.7.0/include/arm_neon.h +68419 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx2intrin.h +1256 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512bwintrin.h +1250 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512cdintrin.h +131 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512dqintrin.h +242 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512erintrin.h +285 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512fintrin.h +2457 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512vlbwintrin.h +1907 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512vldqintrin.h +353 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512vlintrin.h +1982 -0
- data/externals/oclint/lib/clang/3.7.0/include/avxintrin.h +1308 -0
- data/externals/oclint/lib/clang/3.7.0/include/bmi2intrin.h +99 -0
- data/externals/oclint/lib/clang/3.7.0/include/bmiintrin.h +153 -0
- data/externals/oclint/lib/clang/3.7.0/include/cpuid.h +209 -0
- data/externals/oclint/lib/clang/3.7.0/include/cuda_builtin_vars.h +110 -0
- data/externals/oclint/lib/clang/3.7.0/include/emmintrin.h +1480 -0
- data/externals/oclint/lib/clang/3.7.0/include/f16cintrin.h +63 -0
- data/externals/oclint/lib/clang/3.7.0/include/float.h +124 -0
- data/externals/oclint/lib/clang/3.7.0/include/fma4intrin.h +236 -0
- data/externals/oclint/lib/clang/3.7.0/include/fmaintrin.h +234 -0
- data/externals/oclint/lib/clang/3.7.0/include/fxsrintrin.h +55 -0
- data/externals/oclint/lib/clang/3.7.0/include/htmintrin.h +226 -0
- data/externals/oclint/lib/clang/3.7.0/include/htmxlintrin.h +363 -0
- data/externals/oclint/lib/clang/3.7.0/include/ia32intrin.h +101 -0
- data/externals/oclint/lib/clang/3.7.0/include/immintrin.h +203 -0
- data/externals/oclint/lib/clang/3.7.0/include/inttypes.h +102 -0
- data/externals/oclint/lib/clang/3.7.0/include/iso646.h +43 -0
- data/externals/oclint/lib/clang/3.7.0/include/limits.h +118 -0
- data/externals/oclint/lib/clang/3.7.0/include/lzcntintrin.h +72 -0
- data/externals/oclint/lib/clang/3.7.0/include/mm3dnow.h +167 -0
- data/externals/oclint/lib/clang/3.7.0/include/mm_malloc.h +75 -0
- data/externals/oclint/lib/clang/3.7.0/include/mmintrin.h +507 -0
- data/externals/oclint/lib/clang/3.7.0/include/module.modulemap +196 -0
- data/externals/oclint/lib/clang/3.7.0/include/nmmintrin.h +35 -0
- data/externals/oclint/lib/clang/3.7.0/include/pmmintrin.h +122 -0
- data/externals/oclint/lib/clang/3.7.0/include/popcntintrin.h +50 -0
- data/externals/oclint/lib/clang/3.7.0/include/prfchwintrin.h +39 -0
- data/externals/oclint/lib/clang/3.7.0/include/rdseedintrin.h +59 -0
- data/externals/oclint/lib/clang/3.7.0/include/rtmintrin.h +59 -0
- data/externals/oclint/lib/clang/3.7.0/include/s390intrin.h +39 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/allocator_interface.h +66 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/asan_interface.h +155 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/common_interface_defs.h +118 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/coverage_interface.h +63 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/dfsan_interface.h +114 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/linux_syscall_hooks.h +3070 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/lsan_interface.h +84 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/msan_interface.h +107 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/tsan_interface_atomic.h +222 -0
- data/externals/oclint/lib/clang/3.7.0/include/shaintrin.h +79 -0
- data/externals/oclint/lib/clang/3.7.0/include/smmintrin.h +487 -0
- data/externals/oclint/lib/clang/3.7.0/include/stdalign.h +35 -0
- data/externals/oclint/lib/clang/3.7.0/include/stdarg.h +52 -0
- data/externals/oclint/lib/clang/3.7.0/include/stdatomic.h +190 -0
- data/externals/oclint/lib/clang/3.7.0/include/stdbool.h +44 -0
- data/externals/oclint/lib/clang/3.7.0/include/stddef.h +137 -0
- data/externals/oclint/lib/clang/3.7.0/include/stdint.h +707 -0
- data/externals/oclint/lib/clang/3.7.0/include/stdnoreturn.h +30 -0
- data/externals/oclint/lib/clang/3.7.0/include/tbmintrin.h +154 -0
- data/externals/oclint/lib/clang/3.7.0/include/tgmath.h +1374 -0
- data/externals/oclint/lib/clang/3.7.0/include/tmmintrin.h +230 -0
- data/externals/oclint/lib/clang/3.7.0/include/unwind.h +282 -0
- data/externals/oclint/lib/clang/3.7.0/include/vadefs.h +65 -0
- data/externals/oclint/lib/clang/3.7.0/include/varargs.h +26 -0
- data/externals/oclint/lib/clang/3.7.0/include/vecintrin.h +8946 -0
- data/externals/oclint/lib/clang/3.7.0/include/wmmintrin.h +42 -0
- data/externals/oclint/lib/clang/3.7.0/include/x86intrin.h +81 -0
- data/externals/oclint/lib/clang/3.7.0/include/xmmintrin.h +1008 -0
- data/externals/oclint/lib/clang/3.7.0/include/xopintrin.h +809 -0
- data/externals/oclint/lib/clang/3.7.0/include/xtestintrin.h +41 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.builtins-i386.a +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.builtins-x86_64.a +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.profile_osx.a +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.safestack_osx.a +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libHTMLReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libJSONReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libPMDReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libTextReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libXMLReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libXcodeReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libAvoidBranchingStatementAsLastInLoopRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libAvoidDefaultArgumentsOnVirtualMethodsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libAvoidPrivateStaticMembersRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libBaseClassDestructorShouldBeVirtualOrProtectedRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libBitwiseOperatorInConditionalRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libBrokenNullCheckRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libBrokenOddnessCheckRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libCollapsibleIfStatementsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libConstantConditionalOperatorRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libConstantIfExpressionRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libCoveredSwitchStatementsDontNeedDefaultRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libCyclomaticComplexityRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libDeadCodeRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libDefaultLabelNotLastInSwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libDestructorOfVirtualClassRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libDoubleNegativeRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyCatchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyDoWhileStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyElseBlockRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyFinallyStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyForStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyIfStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptySwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyTryStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyWhileStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libForLoopShouldBeWhileLoopRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libGotoStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libInvertedLogicRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libJumbledIncrementerRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libLongClassRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libLongLineRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libLongMethodRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libLongVariableNameRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libMisplacedNullCheckRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libMissingBreakInSwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libMultipleUnaryOperatorRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libNPathComplexityRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libNcssMethodCountRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libNestedBlockDepthRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libNonCaseLabelInSwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCAssignIvarOutsideAccessorsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCBoxedExpressionsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCContainerLiteralsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCNSNumberLiteralsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCObjectSubscriptingRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifyIsEqualHashRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifyMustCallSuperRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifyProhibitedCallRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifyProtectedMethodRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifySubclassMustImplementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libParameterReassignmentRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libPreferEarlyExitRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libRedundantConditionalOperatorRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libRedundantIfStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libRedundantLocalVariableRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libRedundantNilCheckRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libReturnFromFinallyBlockRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libShortVariableNameRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libSwitchStatementsShouldHaveDefaultRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libThrowExceptionFromFinallyBlockRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libTooFewBranchesInSwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libTooManyFieldsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libTooManyMethodsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libTooManyParametersRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUnnecessaryElseStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUnnecessaryNullCheckForCXXDeallocRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUnusedLocalVariableRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUnusedMethodParameterRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUselessParenthesesRule.dylib +0 -0
- data/lib/coverage_plan.rb +19 -0
- data/lib/device.rb +27 -0
- data/lib/execute.rb +7 -0
- data/lib/lint_plan.rb +41 -0
- data/lib/rules.rb +23 -0
- data/lib/test_plan.rb +11 -0
- data/lib/version.rb +3 -0
- data/lib/xcode.rb +128 -0
- data/lib/xcodebuild-helper.rb +110 -0
- data/spec/coverage_plan_spec.rb +18 -0
- data/spec/device_spec.rb +24 -0
- data/spec/lint_plan_spec.rb +35 -0
- data/spec/rule_spec.rb +37 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/test_plan_spec.rb +11 -0
- data/spec/xcode_dsl_actions_spec.rb +136 -0
- data/spec/xcode_dsl_spec.rb +176 -0
- data/spec/xcode_spec.rb +79 -0
- data/xcodebuild-helper.gemspec +26 -0
- metadata +327 -0
@@ -0,0 +1,55 @@
|
|
1
|
+
/*===---- fxsrintrin.h - FXSR intrinsic ------------------------------------===
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to deal
|
5
|
+
* in the Software without restriction, including without limitation the rights
|
6
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
* copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
* THE SOFTWARE.
|
20
|
+
*
|
21
|
+
*===-----------------------------------------------------------------------===
|
22
|
+
*/
|
23
|
+
|
24
|
+
#ifndef __IMMINTRIN_H
|
25
|
+
#error "Never use <fxsrintrin.h> directly; include <immintrin.h> instead."
|
26
|
+
#endif
|
27
|
+
|
28
|
+
#ifndef __FXSRINTRIN_H
|
29
|
+
#define __FXSRINTRIN_H
|
30
|
+
|
31
|
+
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
|
32
|
+
|
33
|
+
static __inline__ void __DEFAULT_FN_ATTRS
|
34
|
+
_fxsave(void *__p) {
|
35
|
+
return __builtin_ia32_fxsave(__p);
|
36
|
+
}
|
37
|
+
|
38
|
+
static __inline__ void __DEFAULT_FN_ATTRS
|
39
|
+
_fxsave64(void *__p) {
|
40
|
+
return __builtin_ia32_fxsave64(__p);
|
41
|
+
}
|
42
|
+
|
43
|
+
static __inline__ void __DEFAULT_FN_ATTRS
|
44
|
+
_fxrstor(void *__p) {
|
45
|
+
return __builtin_ia32_fxrstor(__p);
|
46
|
+
}
|
47
|
+
|
48
|
+
static __inline__ void __DEFAULT_FN_ATTRS
|
49
|
+
_fxrstor64(void *__p) {
|
50
|
+
return __builtin_ia32_fxrstor64(__p);
|
51
|
+
}
|
52
|
+
|
53
|
+
#undef __DEFAULT_FN_ATTRS
|
54
|
+
|
55
|
+
#endif
|
@@ -0,0 +1,226 @@
|
|
1
|
+
/*===---- htmintrin.h - Standard header for PowerPC HTM ---------------===*\
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to deal
|
5
|
+
* in the Software without restriction, including without limitation the rights
|
6
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
* copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
* THE SOFTWARE.
|
20
|
+
*
|
21
|
+
\*===----------------------------------------------------------------------===*/
|
22
|
+
|
23
|
+
#ifndef __HTMINTRIN_H
|
24
|
+
#define __HTMINTRIN_H
|
25
|
+
|
26
|
+
#ifndef __HTM__
|
27
|
+
#error "HTM instruction set not enabled"
|
28
|
+
#endif
|
29
|
+
|
30
|
+
#ifdef __powerpc__
|
31
|
+
|
32
|
+
#include <stdint.h>
|
33
|
+
|
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;
|
39
|
+
|
40
|
+
#define _HTM_STATE(CR0) ((CR0 >> 1) & 0x3)
|
41
|
+
#define _HTM_NONTRANSACTIONAL 0x0
|
42
|
+
#define _HTM_SUSPENDED 0x1
|
43
|
+
#define _HTM_TRANSACTIONAL 0x2
|
44
|
+
|
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))
|
49
|
+
|
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)
|
54
|
+
|
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)
|
59
|
+
|
60
|
+
#define _TEXASR_DISALLOWED(TEXASR) \
|
61
|
+
_TEXASR_EXTRACT_BITS(TEXASR, 8, 1)
|
62
|
+
#define _TEXASRU_DISALLOWED(TEXASRU) \
|
63
|
+
_TEXASRU_EXTRACT_BITS(TEXASRU, 8, 1)
|
64
|
+
|
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)
|
69
|
+
|
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)
|
74
|
+
|
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)
|
79
|
+
|
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)
|
84
|
+
|
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)
|
89
|
+
|
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)
|
94
|
+
|
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)
|
99
|
+
|
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)
|
104
|
+
|
105
|
+
#define _TEXASR_ABORT(TEXASR) \
|
106
|
+
_TEXASR_EXTRACT_BITS(TEXASR, 31, 1)
|
107
|
+
#define _TEXASRU_ABORT(TEXASRU) \
|
108
|
+
_TEXASRU_EXTRACT_BITS(TEXASRU, 31, 1)
|
109
|
+
|
110
|
+
|
111
|
+
#define _TEXASR_SUSPENDED(TEXASR) \
|
112
|
+
_TEXASR_EXTRACT_BITS(TEXASR, 32, 1)
|
113
|
+
|
114
|
+
#define _TEXASR_PRIVILEGE(TEXASR) \
|
115
|
+
_TEXASR_EXTRACT_BITS(TEXASR, 35, 2)
|
116
|
+
|
117
|
+
#define _TEXASR_FAILURE_SUMMARY(TEXASR) \
|
118
|
+
_TEXASR_EXTRACT_BITS(TEXASR, 36, 1)
|
119
|
+
|
120
|
+
#define _TEXASR_TFIAR_EXACT(TEXASR) \
|
121
|
+
_TEXASR_EXTRACT_BITS(TEXASR, 37, 1)
|
122
|
+
|
123
|
+
#define _TEXASR_ROT(TEXASR) \
|
124
|
+
_TEXASR_EXTRACT_BITS(TEXASR, 38, 1)
|
125
|
+
|
126
|
+
#define _TEXASR_TRANSACTION_LEVEL(TEXASR) \
|
127
|
+
_TEXASR_EXTRACT_BITS(TEXASR, 63, 12)
|
128
|
+
|
129
|
+
#endif /* __powerpc */
|
130
|
+
|
131
|
+
#ifdef __s390__
|
132
|
+
|
133
|
+
/* Condition codes generated by tbegin */
|
134
|
+
#define _HTM_TBEGIN_STARTED 0
|
135
|
+
#define _HTM_TBEGIN_INDETERMINATE 1
|
136
|
+
#define _HTM_TBEGIN_TRANSIENT 2
|
137
|
+
#define _HTM_TBEGIN_PERSISTENT 3
|
138
|
+
|
139
|
+
/* The abort codes below this threshold are reserved for machine use. */
|
140
|
+
#define _HTM_FIRST_USER_ABORT_CODE 256
|
141
|
+
|
142
|
+
/* The transaction diagnostic block is it is defined in the Principles
|
143
|
+
of Operation chapter 5-91. */
|
144
|
+
|
145
|
+
struct __htm_tdb {
|
146
|
+
unsigned char format; /* 0 */
|
147
|
+
unsigned char flags;
|
148
|
+
unsigned char reserved1[4];
|
149
|
+
unsigned short nesting_depth;
|
150
|
+
unsigned long long abort_code; /* 8 */
|
151
|
+
unsigned long long conflict_token; /* 16 */
|
152
|
+
unsigned long long atia; /* 24 */
|
153
|
+
unsigned char eaid; /* 32 */
|
154
|
+
unsigned char dxc;
|
155
|
+
unsigned char reserved2[2];
|
156
|
+
unsigned int program_int_id;
|
157
|
+
unsigned long long exception_id; /* 40 */
|
158
|
+
unsigned long long bea; /* 48 */
|
159
|
+
unsigned char reserved3[72]; /* 56 */
|
160
|
+
unsigned long long gprs[16]; /* 128 */
|
161
|
+
} __attribute__((__packed__, __aligned__ (8)));
|
162
|
+
|
163
|
+
|
164
|
+
/* Helper intrinsics to retry tbegin in case of transient failure. */
|
165
|
+
|
166
|
+
static __inline int __attribute__((__always_inline__, __nodebug__))
|
167
|
+
__builtin_tbegin_retry_null (int retry)
|
168
|
+
{
|
169
|
+
int cc, i = 0;
|
170
|
+
|
171
|
+
while ((cc = __builtin_tbegin(0)) == _HTM_TBEGIN_TRANSIENT
|
172
|
+
&& i++ < retry)
|
173
|
+
__builtin_tx_assist(i);
|
174
|
+
|
175
|
+
return cc;
|
176
|
+
}
|
177
|
+
|
178
|
+
static __inline int __attribute__((__always_inline__, __nodebug__))
|
179
|
+
__builtin_tbegin_retry_tdb (void *tdb, int retry)
|
180
|
+
{
|
181
|
+
int cc, i = 0;
|
182
|
+
|
183
|
+
while ((cc = __builtin_tbegin(tdb)) == _HTM_TBEGIN_TRANSIENT
|
184
|
+
&& i++ < retry)
|
185
|
+
__builtin_tx_assist(i);
|
186
|
+
|
187
|
+
return cc;
|
188
|
+
}
|
189
|
+
|
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))
|
194
|
+
|
195
|
+
static __inline int __attribute__((__always_inline__, __nodebug__))
|
196
|
+
__builtin_tbegin_retry_nofloat_null (int retry)
|
197
|
+
{
|
198
|
+
int cc, i = 0;
|
199
|
+
|
200
|
+
while ((cc = __builtin_tbegin_nofloat(0)) == _HTM_TBEGIN_TRANSIENT
|
201
|
+
&& i++ < retry)
|
202
|
+
__builtin_tx_assist(i);
|
203
|
+
|
204
|
+
return cc;
|
205
|
+
}
|
206
|
+
|
207
|
+
static __inline int __attribute__((__always_inline__, __nodebug__))
|
208
|
+
__builtin_tbegin_retry_nofloat_tdb (void *tdb, int retry)
|
209
|
+
{
|
210
|
+
int cc, i = 0;
|
211
|
+
|
212
|
+
while ((cc = __builtin_tbegin_nofloat(tdb)) == _HTM_TBEGIN_TRANSIENT
|
213
|
+
&& i++ < retry)
|
214
|
+
__builtin_tx_assist(i);
|
215
|
+
|
216
|
+
return cc;
|
217
|
+
}
|
218
|
+
|
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))
|
223
|
+
|
224
|
+
#endif /* __s390__ */
|
225
|
+
|
226
|
+
#endif /* __HTMINTRIN_H */
|
@@ -0,0 +1,363 @@
|
|
1
|
+
/*===---- htmxlintrin.h - XL compiler HTM execution intrinsics-------------===*\
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to deal
|
5
|
+
* in the Software without restriction, including without limitation the rights
|
6
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
* copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
* THE SOFTWARE.
|
20
|
+
*
|
21
|
+
\*===----------------------------------------------------------------------===*/
|
22
|
+
|
23
|
+
#ifndef __HTMXLINTRIN_H
|
24
|
+
#define __HTMXLINTRIN_H
|
25
|
+
|
26
|
+
#ifndef __HTM__
|
27
|
+
#error "HTM instruction set not enabled"
|
28
|
+
#endif
|
29
|
+
|
30
|
+
#include <htmintrin.h>
|
31
|
+
|
32
|
+
#ifdef __powerpc__
|
33
|
+
|
34
|
+
#ifdef __cplusplus
|
35
|
+
extern "C" {
|
36
|
+
#endif
|
37
|
+
|
38
|
+
#define _TEXASR_PTR(TM_BUF) \
|
39
|
+
((texasr_t *)((TM_BUF)+0))
|
40
|
+
#define _TEXASRU_PTR(TM_BUF) \
|
41
|
+
((texasru_t *)((TM_BUF)+0))
|
42
|
+
#define _TEXASRL_PTR(TM_BUF) \
|
43
|
+
((texasrl_t *)((TM_BUF)+4))
|
44
|
+
#define _TFIAR_PTR(TM_BUF) \
|
45
|
+
((tfiar_t *)((TM_BUF)+8))
|
46
|
+
|
47
|
+
typedef char TM_buff_type[16];
|
48
|
+
|
49
|
+
/* This macro can be used to determine whether a transaction was successfully
|
50
|
+
started from the __TM_begin() and __TM_simple_begin() intrinsic functions
|
51
|
+
below. */
|
52
|
+
#define _HTM_TBEGIN_STARTED 1
|
53
|
+
|
54
|
+
extern __inline long
|
55
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
56
|
+
__TM_simple_begin (void)
|
57
|
+
{
|
58
|
+
if (__builtin_expect (__builtin_tbegin (0), 1))
|
59
|
+
return _HTM_TBEGIN_STARTED;
|
60
|
+
return 0;
|
61
|
+
}
|
62
|
+
|
63
|
+
extern __inline long
|
64
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
65
|
+
__TM_begin (void* const TM_buff)
|
66
|
+
{
|
67
|
+
*_TEXASRL_PTR (TM_buff) = 0;
|
68
|
+
if (__builtin_expect (__builtin_tbegin (0), 1))
|
69
|
+
return _HTM_TBEGIN_STARTED;
|
70
|
+
#ifdef __powerpc64__
|
71
|
+
*_TEXASR_PTR (TM_buff) = __builtin_get_texasr ();
|
72
|
+
#else
|
73
|
+
*_TEXASRU_PTR (TM_buff) = __builtin_get_texasru ();
|
74
|
+
*_TEXASRL_PTR (TM_buff) = __builtin_get_texasr ();
|
75
|
+
#endif
|
76
|
+
*_TFIAR_PTR (TM_buff) = __builtin_get_tfiar ();
|
77
|
+
return 0;
|
78
|
+
}
|
79
|
+
|
80
|
+
extern __inline long
|
81
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
82
|
+
__TM_end (void)
|
83
|
+
{
|
84
|
+
if (__builtin_expect (__builtin_tend (0), 1))
|
85
|
+
return 1;
|
86
|
+
return 0;
|
87
|
+
}
|
88
|
+
|
89
|
+
extern __inline void
|
90
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
91
|
+
__TM_abort (void)
|
92
|
+
{
|
93
|
+
__builtin_tabort (0);
|
94
|
+
}
|
95
|
+
|
96
|
+
extern __inline void
|
97
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
98
|
+
__TM_named_abort (unsigned char const code)
|
99
|
+
{
|
100
|
+
__builtin_tabort (code);
|
101
|
+
}
|
102
|
+
|
103
|
+
extern __inline void
|
104
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
105
|
+
__TM_resume (void)
|
106
|
+
{
|
107
|
+
__builtin_tresume ();
|
108
|
+
}
|
109
|
+
|
110
|
+
extern __inline void
|
111
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
112
|
+
__TM_suspend (void)
|
113
|
+
{
|
114
|
+
__builtin_tsuspend ();
|
115
|
+
}
|
116
|
+
|
117
|
+
extern __inline long
|
118
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
119
|
+
__TM_is_user_abort (void* const TM_buff)
|
120
|
+
{
|
121
|
+
texasru_t texasru = *_TEXASRU_PTR (TM_buff);
|
122
|
+
return _TEXASRU_ABORT (texasru);
|
123
|
+
}
|
124
|
+
|
125
|
+
extern __inline long
|
126
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
127
|
+
__TM_is_named_user_abort (void* const TM_buff, unsigned char *code)
|
128
|
+
{
|
129
|
+
texasru_t texasru = *_TEXASRU_PTR (TM_buff);
|
130
|
+
|
131
|
+
*code = _TEXASRU_FAILURE_CODE (texasru);
|
132
|
+
return _TEXASRU_ABORT (texasru);
|
133
|
+
}
|
134
|
+
|
135
|
+
extern __inline long
|
136
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
137
|
+
__TM_is_illegal (void* const TM_buff)
|
138
|
+
{
|
139
|
+
texasru_t texasru = *_TEXASRU_PTR (TM_buff);
|
140
|
+
return _TEXASRU_DISALLOWED (texasru);
|
141
|
+
}
|
142
|
+
|
143
|
+
extern __inline long
|
144
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
145
|
+
__TM_is_footprint_exceeded (void* const TM_buff)
|
146
|
+
{
|
147
|
+
texasru_t texasru = *_TEXASRU_PTR (TM_buff);
|
148
|
+
return _TEXASRU_FOOTPRINT_OVERFLOW (texasru);
|
149
|
+
}
|
150
|
+
|
151
|
+
extern __inline long
|
152
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
153
|
+
__TM_nesting_depth (void* const TM_buff)
|
154
|
+
{
|
155
|
+
texasrl_t texasrl;
|
156
|
+
|
157
|
+
if (_HTM_STATE (__builtin_ttest ()) == _HTM_NONTRANSACTIONAL)
|
158
|
+
{
|
159
|
+
texasrl = *_TEXASRL_PTR (TM_buff);
|
160
|
+
if (!_TEXASR_FAILURE_SUMMARY (texasrl))
|
161
|
+
texasrl = 0;
|
162
|
+
}
|
163
|
+
else
|
164
|
+
texasrl = (texasrl_t) __builtin_get_texasr ();
|
165
|
+
|
166
|
+
return _TEXASR_TRANSACTION_LEVEL (texasrl);
|
167
|
+
}
|
168
|
+
|
169
|
+
extern __inline long
|
170
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
171
|
+
__TM_is_nested_too_deep(void* const TM_buff)
|
172
|
+
{
|
173
|
+
texasru_t texasru = *_TEXASRU_PTR (TM_buff);
|
174
|
+
return _TEXASRU_NESTING_OVERFLOW (texasru);
|
175
|
+
}
|
176
|
+
|
177
|
+
extern __inline long
|
178
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
179
|
+
__TM_is_conflict(void* const TM_buff)
|
180
|
+
{
|
181
|
+
texasru_t texasru = *_TEXASRU_PTR (TM_buff);
|
182
|
+
/* Return TEXASR bits 11 (Self-Induced Conflict) through
|
183
|
+
14 (Translation Invalidation Conflict). */
|
184
|
+
return (_TEXASRU_EXTRACT_BITS (texasru, 14, 4)) ? 1 : 0;
|
185
|
+
}
|
186
|
+
|
187
|
+
extern __inline long
|
188
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
189
|
+
__TM_is_failure_persistent(void* const TM_buff)
|
190
|
+
{
|
191
|
+
texasru_t texasru = *_TEXASRU_PTR (TM_buff);
|
192
|
+
return _TEXASRU_FAILURE_PERSISTENT (texasru);
|
193
|
+
}
|
194
|
+
|
195
|
+
extern __inline long
|
196
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
197
|
+
__TM_failure_address(void* const TM_buff)
|
198
|
+
{
|
199
|
+
return *_TFIAR_PTR (TM_buff);
|
200
|
+
}
|
201
|
+
|
202
|
+
extern __inline long long
|
203
|
+
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
204
|
+
__TM_failure_code(void* const TM_buff)
|
205
|
+
{
|
206
|
+
return *_TEXASR_PTR (TM_buff);
|
207
|
+
}
|
208
|
+
|
209
|
+
#ifdef __cplusplus
|
210
|
+
}
|
211
|
+
#endif
|
212
|
+
|
213
|
+
#endif /* __powerpc__ */
|
214
|
+
|
215
|
+
#ifdef __s390__
|
216
|
+
|
217
|
+
#include <stdint.h>
|
218
|
+
|
219
|
+
/* These intrinsics are being made available for compatibility with
|
220
|
+
the IBM XL compiler. For documentation please see the "z/OS XL
|
221
|
+
C/C++ Programming Guide" publically available on the web. */
|
222
|
+
|
223
|
+
static __inline long __attribute__((__always_inline__, __nodebug__))
|
224
|
+
__TM_simple_begin ()
|
225
|
+
{
|
226
|
+
return __builtin_tbegin_nofloat (0);
|
227
|
+
}
|
228
|
+
|
229
|
+
static __inline long __attribute__((__always_inline__, __nodebug__))
|
230
|
+
__TM_begin (void* const tdb)
|
231
|
+
{
|
232
|
+
return __builtin_tbegin_nofloat (tdb);
|
233
|
+
}
|
234
|
+
|
235
|
+
static __inline long __attribute__((__always_inline__, __nodebug__))
|
236
|
+
__TM_end ()
|
237
|
+
{
|
238
|
+
return __builtin_tend ();
|
239
|
+
}
|
240
|
+
|
241
|
+
static __inline void __attribute__((__always_inline__))
|
242
|
+
__TM_abort ()
|
243
|
+
{
|
244
|
+
return __builtin_tabort (_HTM_FIRST_USER_ABORT_CODE);
|
245
|
+
}
|
246
|
+
|
247
|
+
static __inline void __attribute__((__always_inline__, __nodebug__))
|
248
|
+
__TM_named_abort (unsigned char const code)
|
249
|
+
{
|
250
|
+
return __builtin_tabort ((int)_HTM_FIRST_USER_ABORT_CODE + code);
|
251
|
+
}
|
252
|
+
|
253
|
+
static __inline void __attribute__((__always_inline__, __nodebug__))
|
254
|
+
__TM_non_transactional_store (void* const addr, long long const value)
|
255
|
+
{
|
256
|
+
__builtin_non_tx_store ((uint64_t*)addr, (uint64_t)value);
|
257
|
+
}
|
258
|
+
|
259
|
+
static __inline long __attribute__((__always_inline__, __nodebug__))
|
260
|
+
__TM_nesting_depth (void* const tdb_ptr)
|
261
|
+
{
|
262
|
+
int depth = __builtin_tx_nesting_depth ();
|
263
|
+
struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
|
264
|
+
|
265
|
+
if (depth != 0)
|
266
|
+
return depth;
|
267
|
+
|
268
|
+
if (tdb->format != 1)
|
269
|
+
return 0;
|
270
|
+
return tdb->nesting_depth;
|
271
|
+
}
|
272
|
+
|
273
|
+
/* Transaction failure diagnostics */
|
274
|
+
|
275
|
+
static __inline long __attribute__((__always_inline__, __nodebug__))
|
276
|
+
__TM_is_user_abort (void* const tdb_ptr)
|
277
|
+
{
|
278
|
+
struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
|
279
|
+
|
280
|
+
if (tdb->format != 1)
|
281
|
+
return 0;
|
282
|
+
|
283
|
+
return !!(tdb->abort_code >= _HTM_FIRST_USER_ABORT_CODE);
|
284
|
+
}
|
285
|
+
|
286
|
+
static __inline long __attribute__((__always_inline__, __nodebug__))
|
287
|
+
__TM_is_named_user_abort (void* const tdb_ptr, unsigned char* code)
|
288
|
+
{
|
289
|
+
struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
|
290
|
+
|
291
|
+
if (tdb->format != 1)
|
292
|
+
return 0;
|
293
|
+
|
294
|
+
if (tdb->abort_code >= _HTM_FIRST_USER_ABORT_CODE)
|
295
|
+
{
|
296
|
+
*code = tdb->abort_code - _HTM_FIRST_USER_ABORT_CODE;
|
297
|
+
return 1;
|
298
|
+
}
|
299
|
+
return 0;
|
300
|
+
}
|
301
|
+
|
302
|
+
static __inline long __attribute__((__always_inline__, __nodebug__))
|
303
|
+
__TM_is_illegal (void* const tdb_ptr)
|
304
|
+
{
|
305
|
+
struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
|
306
|
+
|
307
|
+
return (tdb->format == 1
|
308
|
+
&& (tdb->abort_code == 4 /* unfiltered program interruption */
|
309
|
+
|| tdb->abort_code == 11 /* restricted instruction */));
|
310
|
+
}
|
311
|
+
|
312
|
+
static __inline long __attribute__((__always_inline__, __nodebug__))
|
313
|
+
__TM_is_footprint_exceeded (void* const tdb_ptr)
|
314
|
+
{
|
315
|
+
struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
|
316
|
+
|
317
|
+
return (tdb->format == 1
|
318
|
+
&& (tdb->abort_code == 7 /* fetch overflow */
|
319
|
+
|| tdb->abort_code == 8 /* store overflow */));
|
320
|
+
}
|
321
|
+
|
322
|
+
static __inline long __attribute__((__always_inline__, __nodebug__))
|
323
|
+
__TM_is_nested_too_deep (void* const tdb_ptr)
|
324
|
+
{
|
325
|
+
struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
|
326
|
+
|
327
|
+
return tdb->format == 1 && tdb->abort_code == 13; /* depth exceeded */
|
328
|
+
}
|
329
|
+
|
330
|
+
static __inline long __attribute__((__always_inline__, __nodebug__))
|
331
|
+
__TM_is_conflict (void* const tdb_ptr)
|
332
|
+
{
|
333
|
+
struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
|
334
|
+
|
335
|
+
return (tdb->format == 1
|
336
|
+
&& (tdb->abort_code == 9 /* fetch conflict */
|
337
|
+
|| tdb->abort_code == 10 /* store conflict */));
|
338
|
+
}
|
339
|
+
|
340
|
+
static __inline long __attribute__((__always_inline__, __nodebug__))
|
341
|
+
__TM_is_failure_persistent (long const result)
|
342
|
+
{
|
343
|
+
return result == _HTM_TBEGIN_PERSISTENT;
|
344
|
+
}
|
345
|
+
|
346
|
+
static __inline long __attribute__((__always_inline__, __nodebug__))
|
347
|
+
__TM_failure_address (void* const tdb_ptr)
|
348
|
+
{
|
349
|
+
struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
|
350
|
+
return tdb->atia;
|
351
|
+
}
|
352
|
+
|
353
|
+
static __inline long __attribute__((__always_inline__, __nodebug__))
|
354
|
+
__TM_failure_code (void* const tdb_ptr)
|
355
|
+
{
|
356
|
+
struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
|
357
|
+
|
358
|
+
return tdb->abort_code;
|
359
|
+
}
|
360
|
+
|
361
|
+
#endif /* __s390__ */
|
362
|
+
|
363
|
+
#endif /* __HTMXLINTRIN_H */
|