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