[AArch64] Generate zeroing forms of certain SVE2.2 instructions (2/11) (#116828)
[llvm-project.git] / compiler-rt / lib / builtins / unwind-ehabi-helpers.h
blob1b48cdb75e1b8ccccb10cd1045046ae10cb9b3cb
1 //===-- arm-ehabi-helpers.h - Supplementary ARM EHABI declarations --------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===--------------------------------------------------------------------===//
9 #ifndef UNWIND_EHABI_HELPERS_H
10 #define UNWIND_EHABI_HELPERS_H
12 #include <stdint.h>
13 // NOTE: see reasoning for this inclusion below
14 #include <unwind.h>
16 #if !defined(__ARM_EABI_UNWINDER__)
18 // NOTE: _URC_OK, _URC_FAILURE must be present as preprocessor tokens. This
19 // allows for a substitution of a constant which can be cast into the
20 // appropriate enumerated type. This header is expected to always be included
21 // AFTER unwind.h (which is why it is forcefully included above). This ensures
22 // that we do not overwrite the token for the enumeration. Subsequent uses of
23 // the token would be clean to rewrite with constant values.
25 // The typedef redeclaration should be safe. Due to the protection granted to
26 // us by the `__ARM_EABI_UNWINDER__` above, we are guaranteed that we are in a
27 // header not vended by gcc. The HP unwinder (being an itanium unwinder) does
28 // not support EHABI, and the GNU unwinder, derived from the HP unwinder, also
29 // does not support EHABI as of the introduction of this header. As such, we
30 // are fairly certain that we are in the LLVM case. Here, _Unwind_State is a
31 // typedef, and so we can get away with a redeclaration.
33 // Guarded redefinitions of the needed unwind state prevent the redefinition of
34 // those states.
36 #define _URC_OK 0
37 #define _URC_FAILURE 9
39 typedef uint32_t _Unwind_State;
41 #if !defined(_US_UNWIND_FRAME_STARTING)
42 #define _US_UNWIND_FRAME_STARTING ((_Unwind_State)1)
43 #endif
45 #if !defined(_US_ACTION_MASK)
46 #define _US_ACTION_MASK ((_Unwind_State)3)
47 #endif
49 #endif
51 #endif