Skip to content

Commit

Permalink
Merge pull request #8321 from tautschnig/update-compiler-headers
Browse files Browse the repository at this point in the history
Expand list of known compiler built-ins
  • Loading branch information
tautschnig authored Jun 14, 2024
2 parents 780b687 + 8f85cb3 commit 77b4d4d
Show file tree
Hide file tree
Showing 10 changed files with 2,136 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-3.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-4.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-5.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-6.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-7.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-8.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-9.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_math.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_mem_string.inc
Expand Down
6 changes: 6 additions & 0 deletions src/ansi-c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ make_inc(compiler_headers/gcc_builtin_headers_ia32-3)
make_inc(compiler_headers/gcc_builtin_headers_ia32-4)
make_inc(compiler_headers/gcc_builtin_headers_ia32-5)
make_inc(compiler_headers/gcc_builtin_headers_ia32-6)
make_inc(compiler_headers/gcc_builtin_headers_ia32-7)
make_inc(compiler_headers/gcc_builtin_headers_ia32-8)
make_inc(compiler_headers/gcc_builtin_headers_ia32-9)
make_inc(compiler_headers/gcc_builtin_headers_math)
make_inc(compiler_headers/gcc_builtin_headers_mem_string)
make_inc(compiler_headers/gcc_builtin_headers_mips)
Expand All @@ -95,6 +98,9 @@ set(extra_dependencies
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32-4.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32-5.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32-6.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32-7.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32-8.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32-9.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_math.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_mem_string.inc
Expand Down
3 changes: 3 additions & 0 deletions src/ansi-c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ BUILTIN_FILES = \
compiler_headers/gcc_builtin_headers_ia32-4.inc \
compiler_headers/gcc_builtin_headers_ia32-5.inc \
compiler_headers/gcc_builtin_headers_ia32-6.inc \
compiler_headers/gcc_builtin_headers_ia32-7.inc \
compiler_headers/gcc_builtin_headers_ia32-8.inc \
compiler_headers/gcc_builtin_headers_ia32-9.inc \
compiler_headers/gcc_builtin_headers_ia32.inc \
compiler_headers/gcc_builtin_headers_math.inc \
compiler_headers/gcc_builtin_headers_mem_string.inc \
Expand Down
9 changes: 9 additions & 0 deletions src/ansi-c/ansi_c_internal_additions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ const char gcc_builtin_headers_ia32_5[] =
const char gcc_builtin_headers_ia32_6[] =
#include "compiler_headers/gcc_builtin_headers_ia32-6.inc" // IWYU pragma: keep
; // NOLINT(whitespace/semicolon)
const char gcc_builtin_headers_ia32_7[] =
#include "compiler_headers/gcc_builtin_headers_ia32-7.inc" // IWYU pragma: keep
; // NOLINT(whitespace/semicolon)
const char gcc_builtin_headers_ia32_8[] =
#include "compiler_headers/gcc_builtin_headers_ia32-8.inc" // IWYU pragma: keep
; // NOLINT(whitespace/semicolon)
const char gcc_builtin_headers_ia32_9[] =
#include "compiler_headers/gcc_builtin_headers_ia32-9.inc" // IWYU pragma: keep
; // NOLINT(whitespace/semicolon)

const char gcc_builtin_headers_alpha[] =
"#line 1 \"gcc_builtin_headers_alpha.h\"\n"
Expand Down
3 changes: 3 additions & 0 deletions src/ansi-c/ansi_c_internal_additions.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ extern const char gcc_builtin_headers_ia32_3[];
extern const char gcc_builtin_headers_ia32_4[];
extern const char gcc_builtin_headers_ia32_5[];
extern const char gcc_builtin_headers_ia32_6[];
extern const char gcc_builtin_headers_ia32_7[];
extern const char gcc_builtin_headers_ia32_8[];
extern const char gcc_builtin_headers_ia32_9[];
extern const char gcc_builtin_headers_alpha[];
extern const char gcc_builtin_headers_arm[];
extern const char gcc_builtin_headers_mips[];
Expand Down
9 changes: 9 additions & 0 deletions src/ansi-c/builtin_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,15 @@ bool builtin_factory(

if(find_pattern(pattern, gcc_builtin_headers_ia32_6, s))
return convert(identifier, s, symbol_table, mh);

if(find_pattern(pattern, gcc_builtin_headers_ia32_7, s))
return convert(identifier, s, symbol_table, mh);

if(find_pattern(pattern, gcc_builtin_headers_ia32_8, s))
return convert(identifier, s, symbol_table, mh);

if(find_pattern(pattern, gcc_builtin_headers_ia32_9, s))
return convert(identifier, s, symbol_table, mh);
}
else if(config.ansi_c.arch=="arm64" ||
config.ansi_c.arch=="armel" ||
Expand Down
5 changes: 5 additions & 0 deletions src/ansi-c/compiler_headers/clang_builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@
2: '__gcc_v2df',
4: '__gcc_v4df',
8: '__gcc_v8df'
},
'__bf16': {
8: '__gcc_v8hf',
16: '__gcc_v16hf',
32: '__gcc_v32hf'
}
}

Expand Down
Loading

0 comments on commit 77b4d4d

Please sign in to comment.