]> git.ipfire.org Git - thirdparty/gcc.git/commit
libgccjit: Add ability to get CPU features
authorAntoni Boucher <bouanto@zoho.com>
Fri, 21 Mar 2025 17:13:41 +0000 (13:13 -0400)
committerAntoni Boucher <bouanto@zoho.com>
Wed, 8 Oct 2025 00:28:30 +0000 (20:28 -0400)
commit2a54db2d8baa1de9d552dfd561849f59737c062f
tree7f7fdfeebc0ce1c0bca22af12312008c3e3816e5
parent491cae7d301c6e798b2cd90fffe090e1c895f0e4
libgccjit: Add ability to get CPU features

gcc/ChangeLog:
PR jit/112466
* Makefile.in (tm_jit_file_list, tm_jit_include_list, TM_JIT_H,
JIT_TARGET_DEF, JIT_TARGET_H, JIT_TARGET_OBJS): New variables.
(tm_jit.h, cs-tm_jit.h, jit/jit-target-hooks-def.h,
s-jit-target-hooks-def-h, default-jit.o): New rules.
(s-tm-texi): Also check timestamp on jit-target.def.
(generated_files): Add TM_JIT_H and jit/jit-target-hooks-def.h.
(build/genhooks.o): Also depend on JIT_TARGET_DEF.
* config.gcc (tm_jit_file, jit_target_objs, target_has_targetjitm):
New variables.
* config/i386/t-i386 (i386-jit.o): New rule.
* configure: Regenerate.
* configure.ac (tm_jit_file_list, tm_jit_include_list,
jit_target_objs): Add substitutes.
* doc/tm.texi: Regenerate.
* doc/tm.texi.in (targetjitm): Document.
(target_has_targetjitm): Document.
* genhooks.cc: Include jit/jit-target.def.
* config/default-jit.cc: New file.
* config/i386/i386-jit.cc: New file.
* config/i386/i386-jit.h: New file.

gcc/jit/ChangeLog:
PR jit/112466
* Make-lang.in (JIT_OBJS): New variable.
* jit-playback.cc (replay): Include jit-target.h and initialize
target.
* jit-playback.h (class populate_target_info): New class.
* jit-recording.cc (recording::context::populate_target_info): New
method.
* jit-recording.h (recording::context::populate_target_info): New
method.
(recording::context::m_populated_target_info): New field.
* libgccjit.cc: Include jit-target.h.
(struct gcc_jit_target_info): New struct.
(gcc_jit_context_get_target_info, gcc_jit_target_info_release,
gcc_jit_target_info_cpu_supports, gcc_jit_target_info_arch,
gcc_jit_target_info_supports_target_dependent_type): New functions.
* libgccjit.h (gcc_jit_context_get_target_info,
gcc_jit_target_info_release, gcc_jit_target_info_cpu_supports,
gcc_jit_target_info_arch,
gcc_jit_target_info_supports_target_dependent_type):
New functions.
* libgccjit.map (LIBGCCJIT_ABI_35): New ABI tag.
* docs/topics/compilation.rst: Add documentation for the
functions gcc_jit_context_get_target_info, gcc_jit_target_info_release,
gcc_jit_target_info_cpu_supports, gcc_jit_target_info_arch,
gcc_jit_target_info_supports_target_dependent_type.
* docs/topics/compatibility.rst (LIBGCCJIT_ABI_35): New ABI tag.
* jit-target-def.h: New file.
* jit-target.cc: New file.
* jit-target.def: New file.
* jit-target.h: New file.

gcc/testsuite/ChangeLog:
PR jit/112466
* jit.dg/all-non-failing-tests.h: Mention
test-target-info.c.
* jit.dg/test-target-info.c: New test.
* jit.dg/test-error-target-info.c: New test.
28 files changed:
gcc/Makefile.in
gcc/config.gcc
gcc/config/default-jit.cc [new file with mode: 0644]
gcc/config/i386/i386-jit.cc [new file with mode: 0644]
gcc/config/i386/i386-jit.h [new file with mode: 0644]
gcc/config/i386/t-i386
gcc/configure
gcc/configure.ac
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/genhooks.cc
gcc/jit/Make-lang.in
gcc/jit/docs/topics/compatibility.rst
gcc/jit/docs/topics/compilation.rst
gcc/jit/jit-playback.cc
gcc/jit/jit-playback.h
gcc/jit/jit-recording.cc
gcc/jit/jit-recording.h
gcc/jit/jit-target-def.h [new file with mode: 0644]
gcc/jit/jit-target.cc [new file with mode: 0644]
gcc/jit/jit-target.def [new file with mode: 0644]
gcc/jit/jit-target.h [new file with mode: 0644]
gcc/jit/libgccjit.cc
gcc/jit/libgccjit.h
gcc/jit/libgccjit.map
gcc/testsuite/jit.dg/all-non-failing-tests.h
gcc/testsuite/jit.dg/test-error-target-info.c [new file with mode: 0644]
gcc/testsuite/jit.dg/test-target-info.c [new file with mode: 0644]