Skip to content

Commit f5f2d28

Browse files
committed
[clang][ARM][AArch64] Don't require arm_acle header for universally defined intrinsics
Signed-off-by: Sarnie, Nick <[email protected]>
1 parent e87aa0c commit f5f2d28

File tree

11 files changed

+21
-142
lines changed

11 files changed

+21
-142
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+
BUILTIN(__yield, "v", "")
54+
BUILTIN(__wfe, "v", "")
55+
BUILTIN(__wfi, "v", "")
56+
BUILTIN(__sev, "v", "")
57+
BUILTIN(__sevl, "v", "")
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+
BUILTIN(__dmb, "vUi", "nc")
91+
BUILTIN(__dsb, "vUi", "nc")
92+
BUILTIN(__isb, "vUi", "nc")
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+
BUILTIN(__yield, "v", "")
190+
BUILTIN(__wfe, "v", "")
191+
BUILTIN(__wfi, "v", "")
192+
BUILTIN(__sev, "v", "")
193+
BUILTIN(__sevl, "v", "")
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+
BUILTIN(__dmb, "vUi", "nc")
200+
BUILTIN(__dsb, "vUi", "nc")
201+
BUILTIN(__isb, "vUi", "nc")
202202

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

clang/lib/Headers/arm_acle.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,20 @@ extern "C" {
2929

3030
/* 7 SYNCHRONIZATION, BARRIER AND HINT INTRINSICS */
3131
/* 7.3 Memory barriers */
32+
/*
3233
void __dmb(unsigned int);
3334
void __dsb(unsigned int);
3435
void __isb(unsigned int);
35-
36+
*/
37+
3638
/* 7.4 Hints */
39+
/*
3740
void __wfi(void);
3841
void __wfe(void);
3942
void __sev(void);
4043
void __sevl(void);
4144
void __yield(void);
45+
*/
4246

4347
#if defined(__ARM_32BIT_STATE) && __ARM_32BIT_STATE
4448
#define __dbg(t) __builtin_arm_dbg(t)

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

Lines changed: 0 additions & 50 deletions
This file was deleted.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
// RUN: %clang_cc1 -triple armv7-eabi -Werror -emit-llvm -o - %s \
55
// RUN: | FileCheck %s
6-
#include <arm_acle.h>
76
void check__dmb(void) {
87
__dmb(0);
98
}

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

Lines changed: 0 additions & 53 deletions
This file was deleted.

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// RUN: %clang_cc1 -triple arm64-darwin -Wno-implicit-function-declaration -fms-compatibility -emit-llvm -o - %s \
88
// RUN: | FileCheck %s
99

10-
#include <arm_acle.h>
11-
1210
void check__dmb(void) {
1311
__dmb(0);
1412
}

clang/test/CodeGen/builtins-arm-microsoft.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
// RUN: | FileCheck %s -check-prefix CHECK-EABI
55
// REQUIRES: arm-registered-target
66

7-
#include <arm_acle.h>
8-
97
void test_yield_intrinsic() {
108
__yield();
119
}

clang/test/Headers/Inputs/include/stdint.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
11
#ifndef STDINT_H
22
#define STDINT_H
33

4-
#ifdef __INT8_TYPE__
5-
typedef __INT8_TYPE__ int8_t;
6-
#endif
7-
typedef unsigned char uint8_t;
8-
9-
#ifdef __INT16_TYPE__
10-
typedef __INT16_TYPE__ int16_t;
11-
typedef unsigned __INT16_TYPE__ uint16_t;
12-
#endif
13-
144
#ifdef __INT32_TYPE__
15-
typedef __INT32_TYPE__ int32_t;
165
typedef unsigned __INT32_TYPE__ uint32_t;
176
#endif
187

198
#ifdef __INT64_TYPE__
20-
typedef __INT64_TYPE__ int64_t;
219
typedef unsigned __INT64_TYPE__ uint64_t;
2210
#endif
2311

0 commit comments

Comments
 (0)