File: target-builtins-prototype-parser.td

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,235,796 kB
  • sloc: cpp: 7,617,614; ansic: 1,433,901; asm: 1,058,726; python: 252,096; f90: 94,671; objc: 70,753; lisp: 42,813; pascal: 18,401; sh: 10,032; ml: 5,111; perl: 4,720; awk: 3,523; makefile: 3,401; javascript: 2,272; xml: 892; fortran: 770
file content (120 lines) | stat: -rw-r--r-- 4,467 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// RUN: clang-tblgen -I %p/../../include/ %s --gen-clang-builtins | FileCheck %s
// RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_LANES 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_LANES
// RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_COMMA 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_COMMA
// RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_TYPE 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_TYPE
// RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_A 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_A
// RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_B 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_B
// RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_C 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_C
// RUN: not clang-tblgen -I %p/../../include/ %s --gen-clang-builtins -DERROR_EXPECTED_D 2>&1 | FileCheck %s --check-prefix=ERROR_EXPECTED_D

include "clang/Basic/BuiltinsBase.td"

def : Builtin {
// CHECK: Builtin::Info{{.*}} __builtin_01 {{.*}} /* E8idE4b */
  let Prototype = "_ExtVector<8,int>(double, _ExtVector<4,        bool>)";
  let Spellings = ["__builtin_01"];
}

def : Builtin {
// CHECK: Builtin::Info{{.*}} __builtin_02 {{.*}} /* E8UiE4s */
  let Prototype = "_ExtVector<8,unsigned int>(_ExtVector<4, short>)";
  let Spellings = ["__builtin_02"];
}

def : Builtin {
// CHECK: Builtin::Info{{.*}} __builtin_03 {{.*}} /* di */
  let Prototype = "double(int)";
  let Spellings = ["__builtin_03"];
}

def : Builtin {
// CHECK: Builtin::Info{{.*}} __builtin_04 {{.*}} /* diIUi */
 let Prototype = "double(int, _Constant unsigned int)";
  let Spellings = ["__builtin_04"];
}

def : Builtin {
// CHECK: Builtin::Info{{.*}} __builtin_05 {{.*}} /* v&v& */
 let Prototype = "void&(void&)";
  let Spellings = ["__builtin_05"];
}

def : Builtin {
// CHECK: Builtin::Info{{.*}} __builtin_06 {{.*}} /* v*v*cC*. */
 let Prototype = "void*(void*, char const*, ...)";
  let Spellings = ["__builtin_06"];
}

def : Builtin {
// CHECK: Builtin::Info{{.*}} __builtin_07 {{.*}} /* E8iE4dE4b. */
  let Prototype = "_ExtVector<8, int>(_ExtVector<4,double>, _ExtVector<4, bool>, ...)";
  let Spellings = ["__builtin_07"];
}

def : Builtin {
// CHECK: Builtin::Info{{.*}} __builtin_08 {{.*}} /* di*R */
  let Prototype = "double(int * restrict)";
  let Spellings = ["__builtin_08"];
}

def : Builtin {
// CHECK: Builtin::Info{{.*}} __builtin_09 {{.*}} /* V2yy */
  let Prototype = "_Vector<2, __bf16>(__bf16)";
  let Spellings = ["__builtin_09"];
}

#ifdef ERROR_EXPECTED_LANES
def : Builtin {
// ERROR_EXPECTED_LANES: :[[# @LINE + 1]]:7: error: Expected number of lanes after '_ExtVector<'
  let Prototype = "_ExtVector<int>(double)";
  let Spellings = ["__builtin_test_use_clang_extended_vectors"];
}
#endif

#ifdef ERROR_EXPECTED_COMMA
def : Builtin {
// ERROR_EXPECTED_COMMA: :[[# @LINE + 1]]:7: error: Expected ',' after number of lanes in '_ExtVector<'
  let Prototype = "_ExtVector<8 int>(double)";
  let Spellings = ["__builtin_test_use_clang_extended_vectors"];
}
#endif

#ifdef ERROR_EXPECTED_TYPE
def : Builtin {
// ERROR_EXPECTED_TYPE: :[[# @LINE + 1]]:7: error: Expected '>' after scalar type in '_ExtVector<N, type>'
  let Prototype = "_ExtVector<8, int (double)";
  let Spellings = ["__builtin_test_use_clang_extended_vectors"];
}
#endif

#ifdef ERROR_EXPECTED_A
def : Builtin {
// ERROR_EXPECTED_A: :[[# @LINE + 1]]:7: error: Expected '<' after '_ExtVector'
  let Prototype = "_ExtVector(8, int) (double)";
  let Spellings = ["__builtin_test_use_clang_extended_vectors"];
}
#endif

#ifdef ERROR_EXPECTED_B
def : Builtin {
// ERROR_EXPECTED_B: :[[# @LINE + 1]]:7: error: Expected '<' after '_ExtVector'
  let Prototype = "double(_ExtVector(8, int))";
  let Spellings = ["__builtin_test_use_clang_extended_vectors"];
}
#endif

#ifdef ERROR_EXPECTED_C
def : Builtin {
// ERROR_EXPECTED_C: :[[# @LINE + 1]]:7: error: Unknown Type: _EtxVector<8, int>
  let Prototype = "_EtxVector<8, int>(void)";
  let Spellings = ["__builtin_test_use_clang_extended_vectors"];
}
#endif

#ifdef ERROR_EXPECTED_D
def : Builtin {
// ERROR_EXPECTED_D: :[[# @LINE + 1]]:7: error: Expected number of lanes after '_ExtVector<'
  let Prototype = "_ExtVector<>(void)";
  let Spellings = ["__builtin_test_use_clang_extended_vectors"];
}
#endif