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/jit | |
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/jit')
-rw-r--r-- | gcc/jit/jit-recording.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/jit/jit-recording.h b/gcc/jit/jit-recording.h index 5d7c717..e1236de 100644 --- a/gcc/jit/jit-recording.h +++ b/gcc/jit/jit-recording.h @@ -806,6 +806,15 @@ public: void replay_into (replayer *) final override; + bool is_same_type_as (type *other) final override + { + vector_type *other_vec_type = other->dyn_cast_vector_type (); + if (other_vec_type == NULL) + return false; + return get_num_units () == other_vec_type->get_num_units () + && get_element_type () == other_vec_type->get_element_type (); + } + vector_type *is_vector () final override { return this; } private: |