https://github.com/vmustya created https://github.com/llvm/llvm-project/pull/120662
The Clang tablegen built-in function prototype parser has the `__bf16` type missing. This patch adds the missing type to the parser. >From df1fe8e7e6cb978ff52d71c36cea9af207b11224 Mon Sep 17 00:00:00 2001 From: Victor Mustya <victor.mus...@intel.com> Date: Thu, 19 Dec 2024 16:56:04 -0800 Subject: [PATCH] [Clang][TableGen] Add missing __bf16 type to the builtins parser The Clang tablegen built-in function prototype parser has the `__bf16` type missing. This patch adds the missing type to the parser. --- clang/test/TableGen/target-builtins-prototype-parser.td | 7 ++++++- clang/utils/TableGen/ClangBuiltinsEmitter.cpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) 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") _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits