Skip to content

Commit f2800e4

Browse files
committed
[clang][ARM] Include arm_acle.h in intrin.h on supported platforms
Signed-off-by: Sarnie, Nick <[email protected]>
1 parent d7e64d9 commit f2800e4

File tree

7 files changed

+43
-33
lines changed

7 files changed

+43
-33
lines changed

clang/include/clang/Basic/BuiltinHeaders.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
//===----------------------------------------------------------------------===//
1313

1414
HEADER(NO_HEADER, nullptr)
15-
HEADER(ARMACLE_H, "arm_acle.h")
1615
HEADER(BLOCKS_H, "Blocks.h")
1716
HEADER(COMPLEX_H, "complex.h")
1817
HEADER(CTYPE_H, "ctype.h")

clang/include/clang/Basic/BuiltinsAArch64.def

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ BUILTIN(__builtin_arm_wfi, "v", "")
5050
BUILTIN(__builtin_arm_sev, "v", "")
5151
BUILTIN(__builtin_arm_sevl, "v", "")
5252
BUILTIN(__builtin_arm_chkfeat, "WUiWUi", "")
53-
TARGET_HEADER_BUILTIN(__yield, "v", "h", ARMACLE_H, ALL_LANGUAGES, "")
54-
TARGET_HEADER_BUILTIN(__wfe, "v", "h", ARMACLE_H, ALL_LANGUAGES, "")
55-
TARGET_HEADER_BUILTIN(__wfi, "v", "h", ARMACLE_H, ALL_LANGUAGES, "")
56-
TARGET_HEADER_BUILTIN(__sev, "v", "h", ARMACLE_H, ALL_LANGUAGES, "")
57-
TARGET_HEADER_BUILTIN(__sevl, "v", "h", ARMACLE_H, ALL_LANGUAGES, "")
53+
TARGET_HEADER_BUILTIN(__yield, "v", "h", INTRIN_H, ALL_LANGUAGES, "")
54+
TARGET_HEADER_BUILTIN(__wfe, "v", "h", INTRIN_H, ALL_LANGUAGES, "")
55+
TARGET_HEADER_BUILTIN(__wfi, "v", "h", INTRIN_H, ALL_LANGUAGES, "")
56+
TARGET_HEADER_BUILTIN(__sev, "v", "h", INTRIN_H, ALL_LANGUAGES, "")
57+
TARGET_HEADER_BUILTIN(__sevl, "v", "h", INTRIN_H, ALL_LANGUAGES, "")
5858

5959
// Like __builtin_trap but provide an 16-bit immediate reason code (which goes into `brk #N`).
6060
BUILTIN(__builtin_arm_trap, "vUIs", "nr")
@@ -87,9 +87,9 @@ TARGET_BUILTIN(__builtin_arm_mops_memset_tag, "v*v*iz", "", "mte,mops")
8787
BUILTIN(__builtin_arm_dmb, "vUi", "nc")
8888
BUILTIN(__builtin_arm_dsb, "vUi", "nc")
8989
BUILTIN(__builtin_arm_isb, "vUi", "nc")
90-
TARGET_HEADER_BUILTIN(__dmb, "vUi", "nch", ARMACLE_H, ALL_LANGUAGES, "")
91-
TARGET_HEADER_BUILTIN(__dsb, "vUi", "nch", ARMACLE_H, ALL_LANGUAGES, "")
92-
TARGET_HEADER_BUILTIN(__isb, "vUi", "nch", ARMACLE_H, ALL_LANGUAGES, "")
90+
TARGET_HEADER_BUILTIN(__dmb, "vUi", "nch", INTRIN_H, ALL_LANGUAGES, "")
91+
TARGET_HEADER_BUILTIN(__dsb, "vUi", "nch", INTRIN_H, ALL_LANGUAGES, "")
92+
TARGET_HEADER_BUILTIN(__isb, "vUi", "nch", INTRIN_H, ALL_LANGUAGES, "")
9393

9494
TARGET_BUILTIN(__builtin_arm_jcvt, "Zid", "nc", "v8.3a")
9595

clang/include/clang/Basic/BuiltinsARM.def

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,19 +186,19 @@ BUILTIN(__builtin_arm_wfi, "v", "")
186186
BUILTIN(__builtin_arm_sev, "v", "")
187187
BUILTIN(__builtin_arm_sevl, "v", "")
188188
BUILTIN(__builtin_arm_dbg, "vUi", "")
189-
TARGET_HEADER_BUILTIN(__yield, "v", "h", ARMACLE_H, ALL_LANGUAGES, "")
190-
TARGET_HEADER_BUILTIN(__wfe, "v", "h", ARMACLE_H, ALL_LANGUAGES, "")
191-
TARGET_HEADER_BUILTIN(__wfi, "v", "h", ARMACLE_H, ALL_LANGUAGES, "")
192-
TARGET_HEADER_BUILTIN(__sev, "v", "h", ARMACLE_H, ALL_LANGUAGES, "")
193-
TARGET_HEADER_BUILTIN(__sevl, "v", "h", ARMACLE_H, ALL_LANGUAGES, "")
189+
TARGET_HEADER_BUILTIN(__yield, "v", "h", INTRIN_H, ALL_LANGUAGES, "")
190+
TARGET_HEADER_BUILTIN(__wfe, "v", "h", INTRIN_H, ALL_LANGUAGES, "")
191+
TARGET_HEADER_BUILTIN(__wfi, "v", "h", INTRIN_H, ALL_LANGUAGES, "")
192+
TARGET_HEADER_BUILTIN(__sev, "v", "h", INTRIN_H, ALL_LANGUAGES, "")
193+
TARGET_HEADER_BUILTIN(__sevl, "v", "h", INTRIN_H, ALL_LANGUAGES, "")
194194

195195
// Data barrier
196196
BUILTIN(__builtin_arm_dmb, "vUi", "nc")
197197
BUILTIN(__builtin_arm_dsb, "vUi", "nc")
198198
BUILTIN(__builtin_arm_isb, "vUi", "nc")
199-
TARGET_HEADER_BUILTIN(__dmb, "vUi", "nch", ARMACLE_H, ALL_LANGUAGES, "")
200-
TARGET_HEADER_BUILTIN(__dsb, "vUi", "nch", ARMACLE_H, ALL_LANGUAGES, "")
201-
TARGET_HEADER_BUILTIN(__isb, "vUi", "nch", ARMACLE_H, ALL_LANGUAGES, "")
199+
TARGET_HEADER_BUILTIN(__dmb, "vUi", "nch", INTRIN_H, ALL_LANGUAGES, "")
200+
TARGET_HEADER_BUILTIN(__dsb, "vUi", "nch", INTRIN_H, ALL_LANGUAGES, "")
201+
TARGET_HEADER_BUILTIN(__isb, "vUi", "nch", INTRIN_H, ALL_LANGUAGES, "")
202202

203203
// Prefetch
204204
BUILTIN(__builtin_arm_prefetch, "vvC*UiUi", "nc")

clang/lib/Headers/intrin.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
#include <arm64intr.h>
3131
#endif
3232

33+
#if defined(__ARM_ACLE)
34+
#include <arm_acle.h>
35+
#endif
36+
3337
/* For the definition of jmp_buf. */
3438
#if __STDC_HOSTED__
3539
#include <setjmp.h>

clang/test/CodeGen/arm-former-microsoft-intrinsics-header-warning.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,48 @@
33

44
void check__dmb(void) {
55
// expected-warning@+2{{call to undeclared library function}}
6-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
6+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
77
__dmb(0);
88
}
99

1010
void check__dsb(void) {
1111
// expected-warning@+2{{call to undeclared library function}}
12-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
12+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
1313
__dsb(0);
1414
}
1515

1616
void check__isb(void) {
1717
// expected-warning@+2{{call to undeclared library function}}
18-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
18+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
1919
__isb(0);
2020
}
2121

2222
void check__yield(void) {
2323
// expected-warning@+2{{call to undeclared library function}}
24-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
24+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
2525
__yield();
2626
}
2727

2828
void check__wfe(void) {
2929
// expected-warning@+2{{call to undeclared library function}}
30-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
30+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
3131
__wfe();
3232
}
3333

3434
void check__wfi(void) {
3535
// expected-warning@+2{{call to undeclared library function}}
36-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
36+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
3737
__wfi();
3838
}
3939

4040
void check__sev(void) {
4141
// expected-warning@+2{{call to undeclared library function}}
42-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
42+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
4343
__sev();
4444
}
4545

4646
void check__sevl(void) {
4747
// expected-warning@+2{{call to undeclared library function}}
48-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
48+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
4949
__sevl();
5050
}

clang/test/CodeGen/arm64-former-microsoft-intrinsics-header-warning.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,48 @@
66

77
void check__dmb(void) {
88
// expected-warning@+2{{call to undeclared library function}}
9-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
9+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
1010
__dmb(0);
1111
}
1212

1313
void check__dsb(void) {
1414
// expected-warning@+2{{call to undeclared library function}}
15-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
15+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
1616
__dsb(0);
1717
}
1818

1919
void check__isb(void) {
2020
// expected-warning@+2{{call to undeclared library function}}
21-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
21+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
2222
__isb(0);
2323
}
2424

2525
void check__yield(void) {
2626
// expected-warning@+2{{call to undeclared library function}}
27-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
27+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
2828
__yield();
2929
}
3030

3131
void check__wfe(void) {
3232
// expected-warning@+2{{call to undeclared library function}}
33-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
33+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
3434
__wfe();
3535
}
3636

3737
void check__wfi(void) {
3838
// expected-warning@+2{{call to undeclared library function}}
39-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
39+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
4040
__wfi();
4141
}
4242

4343
void check__sev(void) {
4444
// expected-warning@+2{{call to undeclared library function}}
45-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
45+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
4646
__sev();
4747
}
4848

4949
void check__sevl(void) {
5050
// expected-warning@+2{{call to undeclared library function}}
51-
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
51+
// expected-note@+1{{include the header <intrin.h> or explicitly provide a declaration for}}
5252
__sevl();
5353
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: %clang_cl --target=aarch64-windows-msvc -Xclang -verify /E -U__STDC_HOSTED__ -Wno-builtin-macro-redefined %s 2>&1 | FileCheck %s
2+
3+
// expected-no-diagnostics
4+
5+
// CHECK: void __yield(void);
6+
#include <intrin.h>
7+
void f() { __yield(); }

0 commit comments

Comments
 (0)