diff options
author | Antoni Boucher <bouanto@zoho.com> | 2022-06-24 21:05:29 -0400 |
---|---|---|
committer | Antoni Boucher <bouanto@zoho.com> | 2022-12-13 23:55:12 -0500 |
commit | 512098a3316f07d4b8bf0e035ab128ed2a50cb5e (patch) | |
tree | 21a109cbe27104ea70338f5e4b604ebe726e7e90 /gcc/testsuite/jit.dg | |
parent | f17ddf2c484427e6ddfd994b62fefcdac27ac02f (diff) | |
download | gcc-512098a3316f07d4b8bf0e035ab128ed2a50cb5e.zip gcc-512098a3316f07d4b8bf0e035ab128ed2a50cb5e.tar.gz gcc-512098a3316f07d4b8bf0e035ab128ed2a50cb5e.tar.bz2 |
libgccjit: Allow comparing vector types
gcc/jit/ChangeLog:
PR jit/108078
* jit-recording.h: Add vector_type::is_same_type_as method
gcc/testsuite/ChangeLog:
PR jit/108078
* jit.dg/test-vector-types.cc: Add tests for vector type comparison
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
Signed-off-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
Diffstat (limited to 'gcc/testsuite/jit.dg')
-rw-r--r-- | gcc/testsuite/jit.dg/test-vector-types.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/jit.dg/test-vector-types.cc b/gcc/testsuite/jit.dg/test-vector-types.cc index 1f49be6..5661d1b 100644 --- a/gcc/testsuite/jit.dg/test-vector-types.cc +++ b/gcc/testsuite/jit.dg/test-vector-types.cc @@ -105,6 +105,19 @@ create_code (gcc_jit_context *ctxt, void *user_data) v4f_type, GCC_JIT_BINARY_OP_MULT); create_vec_fn (ctxt, "jit_v4f_div", v4f_type, GCC_JIT_BINARY_OP_DIVIDE); + + // Checking compatibility between types. + CHECK_VALUE(gcc_jit_compatible_types(v4si_type, v4ui_type), 0); + CHECK_VALUE(gcc_jit_compatible_types(v4si_type, v4f_type), 0); + CHECK_VALUE(gcc_jit_compatible_types(v4ui_type, v4f_type), 0); + + gcc_jit_type *v4si_type2 = gcc_jit_type_get_vector (int_type, 4); + gcc_jit_type *v4ui_type2 = gcc_jit_type_get_vector (unsigned_type, 4); + gcc_jit_type *v4f_type2 = gcc_jit_type_get_vector (float_type, 4); + + CHECK_VALUE(gcc_jit_compatible_types(v4si_type, v4si_type2), 1); + CHECK_VALUE(gcc_jit_compatible_types(v4ui_type, v4ui_type2), 1); + CHECK_VALUE(gcc_jit_compatible_types(v4f_type, v4f_type2), 1); } template <typename T> |