Hi gcc-patches mailing list,
Antoni Boucher via Sourceware Forge 
<[email protected]> has requested that the following 
forgejo pull request
be published on the mailing list.

Created on: 2025-09-05 15:05:17+00:00
Latest update: 2026-05-22 14:26:12+00:00
Changes: 6 changed files, 108 additions, 3 deletions
Head revision: antoyo/gcc ref gccjit-is-floating-point commit 
5702d95898f2aee93e7f5b76af877f5c34117701
Base revision: gcc/gcc-TEST ref trunk commit 
6c01778628d93c5135536e051dc39f8d85198d06 r16-4563-g6c01778628d93c
Merge base: 6c01778628d93c5135536e051dc39f8d85198d06
Full diff url: https://forge.sourceware.org/gcc/gcc-TEST/pulls/74.diff
Discussion:  https://forge.sourceware.org/gcc/gcc-TEST/pulls/74
Requested Reviewers: dmalcolm

```
gcc/jit/ChangeLog:

        * docs/topics/compatibility.rst (LIBGCCJIT_ABI_35): New ABI tag.
        * docs/topics/types.rst: Document gcc_jit_type_is_floating_point.
        * libgccjit.cc (gcc_jit_type_is_floating_point): New function.
        * libgccjit.h (gcc_jit_type_is_floating_point): New function.
        * libgccjit.map: New function.

gcc/testsuite/ChangeLog:

        * jit.dg/test-reflection.c: Add test for
        gcc_jit_type_is_floating_point.
```


Changed files:
- M: gcc/jit/docs/topics/compatibility.rst
- M: gcc/jit/docs/topics/types.rst
- M: gcc/jit/libgccjit.cc
- M: gcc/jit/libgccjit.h
- M: gcc/jit/libgccjit.map
- M: gcc/testsuite/jit.dg/test-reflection.c


Antoni Boucher (1):
  libgccjit: Add gcc_jit_type_is_floating_point

 gcc/jit/docs/topics/compatibility.rst  |  8 ++++
 gcc/jit/docs/topics/types.rst          | 12 +++++
 gcc/jit/libgccjit.cc                   | 17 +++++++
 gcc/jit/libgccjit.h                    |  6 +++
 gcc/jit/libgccjit.map                  |  5 ++
 gcc/testsuite/jit.dg/test-reflection.c | 63 ++++++++++++++++++++++++--
 6 files changed, 108 insertions(+), 3 deletions(-)

Range-diff against v1:
1:  90ab6e135e23 ! 1:  5702d95898f2 libgccjit: Add 
gcc_jit_type_is_floating_point
    @@ Commit message
         Co-authored-by: Robert Zakrzewski <[email protected]>
     
      ## gcc/jit/docs/topics/compatibility.rst ##
    -@@ gcc/jit/docs/topics/compatibility.rst: temporary variable:
    - ``LIBGCCJIT_ABI_34`` covers the addition of
    - 
    -  * :func:`gcc_jit_context_set_output_ident`
    +@@ gcc/jit/docs/topics/compatibility.rst: information:
    + --------------------
    + ``LIBGCCJIT_ABI_37`` covers the addition of
    + :func:`gcc_jit_context_new_array_type_u64`
     +
    -+.. _LIBGCCJIT_ABI_35:
    ++.. _LIBGCCJIT_ABI_38:
     +
    -+``LIBGCCJIT_ABI_35``
    ++``LIBGCCJIT_ABI_38``
     +--------------------
    -+``LIBGCCJIT_ABI_35`` covers the addition of
    ++``LIBGCCJIT_ABI_38`` covers the addition of
     +
     + * :func:`gcc_jit_type_is_floating_point`
     
    @@ gcc/jit/docs/topics/types.rst: Reflection API
     +
     +   .. code-block:: c
     +
    -+      #ifdef LIBGCCJIT_HAVE_gcc_jit_context_set_output_ident
    ++      #ifdef LIBGCCJIT_HAVE_gcc_jit_type_is_floating_point
     +
      .. function::  gcc_jit_type *\
                     gcc_jit_type_is_pointer (gcc_jit_type *type)
    @@ gcc/jit/libgccjit.h: gcc_jit_function_type_get_param_type 
(gcc_jit_function_type
      extern gcc_jit_type *
     
      ## gcc/jit/libgccjit.map ##
    -@@ gcc/jit/libgccjit.map: LIBGCCJIT_ABI_34 {
    +@@ gcc/jit/libgccjit.map: LIBGCCJIT_ABI_37 {
        global:
    -     gcc_jit_context_set_output_ident;
    - } LIBGCCJIT_ABI_33;
    +     gcc_jit_context_new_array_type_u64;
    + } LIBGCCJIT_ABI_36;
     +
    -+LIBGCCJIT_ABI_35 {
    ++LIBGCCJIT_ABI_38 {
     +  global:
     +    gcc_jit_type_is_floating_point;
    -+} LIBGCCJIT_ABI_34;
    ++} LIBGCCJIT_ABI_37;
     
      ## gcc/testsuite/jit.dg/test-reflection.c ##
     @@ gcc/testsuite/jit.dg/test-reflection.c: verify_code (gcc_jit_context 
*ctxt, gcc_jit_result *result)
          gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_DOUBLE);
        CHECK_VALUE (gcc_jit_function_get_return_type(builtin_sin), 
double_type);
        CHECK (!gcc_jit_type_is_integral(double_type));
    -+  CHECK (gcc_jit_type_is_floating_point(double_type));
    ++  CHECK (gcc_jit_type_is_floating_point (double_type));
     +
     +  gcc_jit_type *float_type =
     +    gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_FLOAT);
    -+  CHECK (!gcc_jit_type_is_bool(float_type));
    -+  CHECK (!gcc_jit_type_is_integral(float_type));
    -+  CHECK (gcc_jit_type_is_floating_point(float_type));
    -+
    -+  gcc_jit_target_info *target_info = 
gcc_jit_context_get_target_info(ctxt);
    -+  if (target_info != NULL && 
gcc_jit_target_info_supports_target_dependent_type(target_info, 
GCC_JIT_TYPE_FLOAT16))
    ++  CHECK (!gcc_jit_type_is_bool (float_type));
    ++  CHECK (!gcc_jit_type_is_integral (float_type));
    ++  CHECK (gcc_jit_type_is_floating_point (float_type));
    ++
    ++  gcc_jit_target_info *target_info = gcc_jit_context_get_target_info 
(ctxt);
    ++  if (target_info != NULL &&
    ++    gcc_jit_target_info_supports_target_dependent_type (target_info,
    ++      GCC_JIT_TYPE_FLOAT16))
     +  {
    -+    gcc_jit_type *float16_type = gcc_jit_context_get_type (ctxt, 
GCC_JIT_TYPE_FLOAT16);
    -+    CHECK (!gcc_jit_type_is_bool(float16_type));
    -+    CHECK (!gcc_jit_type_is_integral(float16_type));
    -+    CHECK (gcc_jit_type_is_floating_point(float16_type));
    ++    gcc_jit_type *float16_type
    ++      = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_FLOAT16);
    ++    CHECK (!gcc_jit_type_is_bool (float16_type));
    ++    CHECK (!gcc_jit_type_is_integral (float16_type));
    ++    CHECK (gcc_jit_type_is_floating_point (float16_type));
     +  }
     +
    -+  if (target_info != NULL && 
gcc_jit_target_info_supports_target_dependent_type(target_info, 
GCC_JIT_TYPE_FLOAT32))
    ++  if (target_info != NULL &&
    ++    gcc_jit_target_info_supports_target_dependent_type (target_info,
    ++      GCC_JIT_TYPE_FLOAT32))
     +  {
    -+    gcc_jit_type *float32_type = gcc_jit_context_get_type (ctxt, 
GCC_JIT_TYPE_FLOAT32);
    -+    CHECK (!gcc_jit_type_is_bool(float32_type));
    -+    CHECK (!gcc_jit_type_is_integral(float32_type));
    -+    CHECK (gcc_jit_type_is_floating_point(float32_type));
    ++    gcc_jit_type *float32_type
    ++      = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_FLOAT32);
    ++    CHECK (!gcc_jit_type_is_bool (float32_type));
    ++    CHECK (!gcc_jit_type_is_integral (float32_type));
    ++    CHECK (gcc_jit_type_is_floating_point (float32_type));
     +  }
     +
    -+  if (target_info != NULL && 
gcc_jit_target_info_supports_target_dependent_type(target_info, 
GCC_JIT_TYPE_FLOAT64))
    ++  if (target_info != NULL &&
    ++    gcc_jit_target_info_supports_target_dependent_type (target_info,
    ++      GCC_JIT_TYPE_FLOAT64))
     +  {
    -+    gcc_jit_type *float64_type = gcc_jit_context_get_type (ctxt, 
GCC_JIT_TYPE_FLOAT64);
    -+    CHECK (!gcc_jit_type_is_bool(float64_type));
    -+    CHECK (!gcc_jit_type_is_integral(float64_type));
    -+    CHECK (gcc_jit_type_is_floating_point(float64_type));
    ++    gcc_jit_type *float64_type
    ++      = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_FLOAT64);
    ++    CHECK (!gcc_jit_type_is_bool (float64_type));
    ++    CHECK (!gcc_jit_type_is_integral (float64_type));
    ++    CHECK (gcc_jit_type_is_floating_point (float64_type));
     +  }
     +
    -+  if (target_info != NULL && 
gcc_jit_target_info_supports_target_dependent_type(target_info, 
GCC_JIT_TYPE_FLOAT128))
    ++  if (target_info != NULL &&
    ++    gcc_jit_target_info_supports_target_dependent_type (target_info,
    ++      GCC_JIT_TYPE_FLOAT128))
     +  {
    -+    gcc_jit_type *float128_type = gcc_jit_context_get_type (ctxt, 
GCC_JIT_TYPE_FLOAT128);
    -+    CHECK (!gcc_jit_type_is_bool(float128_type));
    -+    CHECK (!gcc_jit_type_is_integral(float128_type));
    -+    CHECK (gcc_jit_type_is_floating_point(float128_type));
    ++    gcc_jit_type *float128_type
    ++      = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_FLOAT128);
    ++    CHECK (!gcc_jit_type_is_bool (float128_type));
    ++    CHECK (!gcc_jit_type_is_integral (float128_type));
    ++    CHECK (gcc_jit_type_is_floating_point (float128_type));
     +  }
      
        gcc_jit_type *bool_type =
          gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_BOOL);
    -   CHECK (gcc_jit_type_is_bool(bool_type));
    -   CHECK (!gcc_jit_type_is_integral(bool_type));
    -+  CHECK (!gcc_jit_type_is_floating_point(bool_type));
    +-  CHECK (gcc_jit_type_is_bool(bool_type));
    +-  CHECK (!gcc_jit_type_is_integral(bool_type));
    ++  CHECK (gcc_jit_type_is_bool (bool_type));
    ++  CHECK (!gcc_jit_type_is_integral (bool_type));
    ++  CHECK (!gcc_jit_type_is_floating_point (bool_type));
      
        gcc_jit_type *aligned_bool_type =
          gcc_jit_type_get_aligned(gcc_jit_context_get_type (ctxt, 
GCC_JIT_TYPE_BOOL), 8);
    +-  CHECK (gcc_jit_type_is_bool(aligned_bool_type));
    ++  CHECK (gcc_jit_type_is_bool (aligned_bool_type));
    +   CHECK (bool_type != aligned_bool_type);
    +   CHECK_VALUE (gcc_jit_type_unqualified(aligned_bool_type), bool_type);
    + 
     @@ gcc/testsuite/jit.dg/test-reflection.c: verify_code (gcc_jit_context 
*ctxt, gcc_jit_result *result)
        gcc_jit_type *int64 =
          gcc_jit_context_get_int_type(ctxt, 8, 1);
-- 
2.54.0

Reply via email to