-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[Clang][TableGen] Add missing __bf16 type to the builtins parser #120662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Clang][TableGen] Add missing __bf16 type to the builtins parser #120662
Conversation
The Clang tablegen built-in function prototype parser has the `__bf16` type missing. This patch adds the missing type to the parser.
@llvm/pr-subscribers-clang Author: Victor Mustya (vmustya) ChangesThe Clang tablegen built-in function prototype parser has the Full diff: https://github.com/llvm/llvm-project/pull/120662.diff 2 Files Affected:
diff --git a/clang/test/TableGen/target-builtins-prototype-parser.td b/clang/test/TableGen/target-builtins-prototype-parser.td
index 555aebb3ccfb1f..a753f906a674fe 100644
--- a/clang/test/TableGen/target-builtins-prototype-parser.td
+++ b/clang/test/TableGen/target-builtins-prototype-parser.td
@@ -57,6 +57,12 @@ def : Builtin {
let Spellings = ["__builtin_08"];
}
+def : Builtin {
+// CHECK: BUILTIN(__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<'
@@ -112,4 +118,3 @@ def : Builtin {
let Spellings = ["__builtin_test_use_clang_extended_vectors"];
}
#endif
-
diff --git a/clang/utils/TableGen/ClangBuiltinsEmitter.cpp b/clang/utils/TableGen/ClangBuiltinsEmitter.cpp
index 6c3604adc92b99..f8dec02ea12197 100644
--- a/clang/utils/TableGen/ClangBuiltinsEmitter.cpp
+++ b/clang/utils/TableGen/ClangBuiltinsEmitter.cpp
@@ -155,6 +155,7 @@ class PrototypeParser {
.Case("__fp16", "h")
.Case("__int128_t", "LLLi")
.Case("_Float16", "x")
+ .Case("__bf16", "y")
.Case("bool", "b")
.Case("char", "c")
.Case("constant_CFString", "F")
|
Do you plan to use it somewhere? |
@philnik777, currently I plan to use it for some downstream projects, but I believe it might be useful for in-tree targets as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…m#120662) The Clang tablegen built-in function prototype parser has the `__bf16` type missing. This patch adds the missing type to the parser.
The Clang tablegen built-in function prototype parser has the
__bf16
type missing. This patch adds the missing type to the parser.