virtual bool is_int () const = 0;
virtual bool is_float () const = 0;
virtual bool is_bool () const = 0;
+ virtual bool is_numeric_vector () const { return false; }
virtual type *is_pointer () = 0;
virtual type *is_volatile () { return NULL; }
virtual type *is_restrict () { return NULL; }
size_t get_size () final override { return m_other_type->get_size (); };
- bool is_int () const final override { return m_other_type->is_int (); }
+ bool is_int () const override { return m_other_type->is_int (); }
bool is_float () const final override { return m_other_type->is_float (); }
bool is_bool () const final override { return m_other_type->is_bool (); }
+ bool is_numeric_vector () const override {
+ return m_other_type->is_numeric_vector ();
+ }
type *is_pointer () final override { return m_other_type->is_pointer (); }
type *is_array () final override { return m_other_type->is_array (); }
struct_ *is_struct () final override { return m_other_type->is_struct (); }
: decorated_type (other_type),
m_num_units (num_units) {}
+ bool is_int () const final override {
+ return false;
+ }
+
+ bool is_numeric_vector () const final override {
+ return true;
+ }
+
size_t get_num_units () const { return m_num_units; }
vector_type *dyn_cast_vector_type () final override { return this; }
op);
RETURN_NULL_IF_FAIL (result_type, ctxt, loc, "NULL result_type");
RETURN_NULL_IF_FAIL_PRINTF3 (
- result_type->is_numeric (), ctxt, loc,
+ result_type->is_numeric () || result_type->is_numeric_vector (), ctxt, loc,
"gcc_jit_unary_op %s with operand %s "
"has non-numeric result_type: %s",
gcc::jit::unary_op_reproducer_strings[op],
b->get_debug_string (),
b->get_type ()->get_debug_string ());
RETURN_NULL_IF_FAIL_PRINTF4 (
- result_type->is_numeric (), ctxt, loc,
+ result_type->is_numeric () || result_type->is_numeric_vector (), ctxt, loc,
"gcc_jit_binary_op %s with operands a: %s b: %s "
"has non-numeric result_type: %s",
gcc::jit::binary_op_reproducer_strings[op],
CHECK (vec_type != double_type);
CHECK_VALUE (gcc_jit_vector_type_get_element_type(vector_type), double_type);
CHECK_VALUE (gcc_jit_vector_type_get_num_units(vector_type), 4);
+ CHECK (!gcc_jit_type_is_integral(vec_type));
CHECK (!gcc_jit_type_is_pointer(double_type));
CHECK_VALUE (gcc_jit_type_is_pointer(gcc_jit_type_get_pointer(double_type)), double_type);