#ifndef BOOST_QVM_VEC_TRAITS_GNUC_HPP_INCLUDED #define BOOST_QVM_VEC_TRAITS_GNUC_HPP_INCLUDED // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc. // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if defined(__GNUC__) && defined(__SSE2__) #include #include #include namespace boost { namespace qvm { namespace qvm_detail { template struct vec_traits_gnuc_impl { typedef T scalar_type; static int const dim=D; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( V const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( V & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I=0); BOOST_QVM_ASSERT(i=0); BOOST_QVM_ASSERT(i struct vec_traits; template struct is_vec; #define BOOST_QVM_GNUC_VEC_TYPE(T,D)\ template <>\ struct\ vec_traits:\ qvm_detail::vec_traits_gnuc_impl\ {\ };\ template <>\ struct\ is_vec\ {\ enum { value = true };\ }; BOOST_QVM_GNUC_VEC_TYPE(float,2); BOOST_QVM_GNUC_VEC_TYPE(float,4); BOOST_QVM_GNUC_VEC_TYPE(double,2); BOOST_QVM_GNUC_VEC_TYPE(double,4); #undef BOOST_QVM_GNUC_VEC_TYPE } } #endif #endif