aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit/libgccjit.h
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2022-04-12 17:16:45 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2022-04-12 17:16:45 -0400
commitaf80ea97b61847d91da0d303e85faed437059092 (patch)
tree88bd7c9a068ead6db362db4dc97907fe76d68669 /gcc/jit/libgccjit.h
parent791a968630b3846b614a435b9a75a52f29147a08 (diff)
downloadgcc-af80ea97b61847d91da0d303e85faed437059092.zip
gcc-af80ea97b61847d91da0d303e85faed437059092.tar.gz
gcc-af80ea97b61847d91da0d303e85faed437059092.tar.bz2
libgccjit: Add support for sized integer types, including 128-bit integers [PR95325]
gcc/jit/ PR target/95325 * docs/_build/texinfo/libgccjit.texi: Regenerate * docs/topics/compatibility.rst (LIBGCCJIT_ABI_20): New ABI tag. * docs/topics/types.rst: Add documentation for the new types GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T, GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T, GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T, GCC_JIT_TYPE_INT16_T, GCC_JIT_TYPE_INT32_T, GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T and new functions (gcc_jit_compatible_types, gcc_jit_type_get_size). * jit-builtins.cc: Add support for BT_UINT128. * jit-common.h: Update the value of NUM_GCC_JIT_TYPES. * jit-playback.cc: Add support for the sized integer types. * jit-recording.cc: Add support for the sized integer types. * jit-recording.h: Add support for comparing integer types and new function (is_signed). * libgccjit.cc (gcc_jit_compatible_types): New. (gcc_jit_type_get_size) New. * libgccjit.h: New enum variants for gcc_jit_types (GCC_JIT_TYPE_UINT8_T, GCC_JIT_TYPE_UINT16_T, GCC_JIT_TYPE_UINT32_T, GCC_JIT_TYPE_UINT64_T, GCC_JIT_TYPE_UINT128_T, GCC_JIT_TYPE_INT8_T, GCC_JIT_TYPE_INT16_T, GCC_JIT_TYPE_INT32_T, GCC_JIT_TYPE_INT64_T, GCC_JIT_TYPE_INT128_T) and new functions (gcc_jit_compatible_types, gcc_jit_type_get_size). * libgccjit.map (LIBGCCJIT_ABI_20): New ABI tag. gcc/testsuite/ PR target/95325 * jit.dg/test-types.c: Add tests for sized integer types.
Diffstat (limited to 'gcc/jit/libgccjit.h')
-rw-r--r--gcc/jit/libgccjit.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/gcc/jit/libgccjit.h b/gcc/jit/libgccjit.h
index 95d60f8..5d3f5d5 100644
--- a/gcc/jit/libgccjit.h
+++ b/gcc/jit/libgccjit.h
@@ -574,8 +574,19 @@ enum gcc_jit_types
/* Complex numbers. */
GCC_JIT_TYPE_COMPLEX_FLOAT,
GCC_JIT_TYPE_COMPLEX_DOUBLE,
- GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE
-
+ GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE,
+
+ /* Sized integer types. */
+ GCC_JIT_TYPE_UINT8_T,
+ GCC_JIT_TYPE_UINT16_T,
+ GCC_JIT_TYPE_UINT32_T,
+ GCC_JIT_TYPE_UINT64_T,
+ GCC_JIT_TYPE_UINT128_T,
+ GCC_JIT_TYPE_INT8_T,
+ GCC_JIT_TYPE_INT16_T,
+ GCC_JIT_TYPE_INT32_T,
+ GCC_JIT_TYPE_INT64_T,
+ GCC_JIT_TYPE_INT128_T
};
extern gcc_jit_type *
@@ -601,6 +612,23 @@ gcc_jit_type_get_const (gcc_jit_type *type);
extern gcc_jit_type *
gcc_jit_type_get_volatile (gcc_jit_type *type);
+#define LIBGCCJIT_HAVE_SIZED_INTEGERS
+
+/* Given types LTYPE and RTYPE, return non-zero if they are compatible.
+ This API entrypoint was added in LIBGCCJIT_ABI_20; you can test for its
+ presence using
+ #ifdef LIBGCCJIT_HAVE_SIZED_INTEGERS */
+extern int
+gcc_jit_compatible_types (gcc_jit_type *ltype,
+ gcc_jit_type *rtype);
+
+/* Given type "T", get its size.
+ This API entrypoint was added in LIBGCCJIT_ABI_20; you can test for its
+ presence using
+ #ifdef LIBGCCJIT_HAVE_SIZED_INTEGERS */
+extern ssize_t
+gcc_jit_type_get_size (gcc_jit_type *type);
+
/* Given type "T", get type "T[N]" (for a constant N). */
extern gcc_jit_type *
gcc_jit_context_new_array_type (gcc_jit_context *ctxt,