Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-28 09:11:36

0001 /***************************************************************************
0002  * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and         *
0003  * Martin Renou                                                             *
0004  * Copyright (c) QuantStack                                                 *
0005  * Copyright (c) Serge Guelton                                              *
0006  *                                                                          *
0007  * Distributed under the terms of the BSD 3-Clause License.                 *
0008  *                                                                          *
0009  * The full license is in the file LICENSE, distributed with this software. *
0010  ****************************************************************************/
0011 
0012 #ifndef XSIMD_SSE4_2_HPP
0013 #define XSIMD_SSE4_2_HPP
0014 
0015 #include <limits>
0016 
0017 #include "../types/xsimd_sse4_2_register.hpp"
0018 
0019 namespace xsimd
0020 {
0021 
0022     namespace kernel
0023     {
0024         using namespace types;
0025 
0026         // lt
0027         template <class A>
0028         XSIMD_INLINE batch_bool<int64_t, A> lt(batch<int64_t, A> const& self, batch<int64_t, A> const& other, requires_arch<sse4_2>) noexcept
0029         {
0030             return _mm_cmpgt_epi64(other, self);
0031         }
0032         template <class A>
0033         XSIMD_INLINE batch_bool<uint64_t, A> lt(batch<uint64_t, A> const& self, batch<uint64_t, A> const& other, requires_arch<sse4_2>) noexcept
0034         {
0035             auto xself = _mm_xor_si128(self, _mm_set1_epi64x(std::numeric_limits<int64_t>::lowest()));
0036             auto xother = _mm_xor_si128(other, _mm_set1_epi64x(std::numeric_limits<int64_t>::lowest()));
0037             return _mm_cmpgt_epi64(xother, xself);
0038         }
0039 
0040     }
0041 
0042 }
0043 
0044 #endif