10
10
#include < cstdint>
11
11
#include < iostream>
12
12
13
- #if (defined(_WIN32) || defined(__CYGWIN__))
14
- #ifndef MLIR_ARMSMEABISTUBS_EXPORTED
15
- #ifdef mlir_arm_sme_abi_stubs_EXPORTS
16
- // We are building this library
17
- #define MLIR_ARMSMEABISTUBS_EXPORTED __declspec (dllexport)
18
- #else
19
- // We are using this library
20
- #define MLIR_ARMSMEABISTUBS_EXPORTED __declspec (dllimport)
21
- #endif // mlir_arm_sme_abi_stubs_EXPORTS
22
- #endif // MLIR_ARMSMEABISTUBS_EXPORTED
23
- #else
24
- #define MLIR_ARMSMEABISTUBS_EXPORTED __attribute__ ((visibility(" default" )) LLVM_ATTRIBUTE_WEAK
25
- #endif // (defined(_WIN32) || defined(__CYGWIN__))
26
-
27
13
// The actual implementation of these routines is in:
28
14
// compiler-rt/lib/builtins/aarch64/sme-abi.S. These stubs allow the current
29
15
// ArmSME tests to run without depending on compiler-rt. This works as we don't
33
19
34
20
extern " C" {
35
21
36
- bool MLIR_ARMSMEABISTUBS_EXPORTED __aarch64_sme_accessible () {
22
+ bool LLVM_ATTRIBUTE_WEAK __aarch64_sme_accessible () {
37
23
// The ArmSME tests are run within an emulator so we assume SME is available.
38
24
return true ;
39
25
}
@@ -43,20 +29,20 @@ struct sme_state {
43
29
int64_t x1;
44
30
};
45
31
46
- sme_state MLIR_ARMSMEABISTUBS_EXPORTED __arm_sme_state () {
32
+ sme_state LLVM_ATTRIBUTE_WEAK __arm_sme_state () {
47
33
std::cerr << " [warning] __arm_sme_state() stubbed!\n " ;
48
34
return sme_state{};
49
35
}
50
36
51
- void MLIR_ARMSMEABISTUBS_EXPORTED __arm_tpidr2_restore () {
37
+ void LLVM_ATTRIBUTE_WEAK __arm_tpidr2_restore () {
52
38
std::cerr << " [warning] __arm_tpidr2_restore() stubbed!\n " ;
53
39
}
54
40
55
- void MLIR_ARMSMEABISTUBS_EXPORTED __arm_tpidr2_save () {
41
+ void LLVM_ATTRIBUTE_WEAK __arm_tpidr2_save () {
56
42
std::cerr << " [warning] __arm_tpidr2_save() stubbed!\n " ;
57
43
}
58
44
59
- void MLIR_ARMSMEABISTUBS_EXPORTED __arm_za_disable () {
45
+ void LLVM_ATTRIBUTE_WEAK __arm_za_disable () {
60
46
std::cerr << " [warning] __arm_za_disable() stubbed!\n " ;
61
47
}
62
48
}
0 commit comments