1/* Copyright (C) 2017 Povilas Kanapickas <povilas@radix.lt>
2
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at
5 http://www.boost.org/LICENSE_1_0.txt)
6*/
7
8#ifndef LIBSIMDPP_SIMDPP_DETAIL_INSN_CONV_TO_MASK_H
9#define LIBSIMDPP_SIMDPP_DETAIL_INSN_CONV_TO_MASK_H
10
11#ifndef LIBSIMDPP_SIMD_H
12 #error "This file must be included through simd.h"
13#endif
14
15#include <simdpp/types.h>
16
17namespace simdpp {
18namespace SIMDPP_ARCH_NAMESPACE {
19namespace detail {
20namespace insn {
21
22static SIMDPP_INL
23mask_int8<16> i_to_mask(const uint8<16>& a);
24
25#if SIMDPP_USE_AVX2
26static SIMDPP_INL
27mask_int8<32> i_to_mask(const uint8<32>& a);
28#endif
29
30#if SIMDPP_USE_AVX512BW
31static SIMDPP_INL
32mask_int8<64> i_to_mask(const uint8<64>& a);
33#endif
34
35// -----------------------------------------------------------------------------
36
37static SIMDPP_INL
38mask_int16<8> i_to_mask(const uint16<8>& a);
39
40#if SIMDPP_USE_AVX2
41static SIMDPP_INL
42mask_int16<16> i_to_mask(const uint16<16>& a);
43#endif
44
45#if SIMDPP_USE_AVX512BW
46static SIMDPP_INL
47mask_int16<32> i_to_mask(const uint16<32>& a);
48#endif
49
50// -----------------------------------------------------------------------------
51
52static SIMDPP_INL
53mask_int32<4> i_to_mask(const uint32<4>& a);
54
55#if SIMDPP_USE_AVX2
56static SIMDPP_INL
57mask_int32<8> i_to_mask(const uint32<8>& a);
58#endif
59
60#if SIMDPP_USE_AVX512F
61static SIMDPP_INL
62mask_int32<16> i_to_mask(const uint32<16>& a);
63#endif
64
65// -----------------------------------------------------------------------------
66
67static SIMDPP_INL
68mask_int64<2> i_to_mask(const uint64<2>& a);
69
70#if SIMDPP_USE_AVX2
71static SIMDPP_INL
72mask_int64<4> i_to_mask(const uint64<4>& a);
73#endif
74
75#if SIMDPP_USE_AVX512F
76static SIMDPP_INL
77mask_int64<8> i_to_mask(const uint64<8>& a);
78#endif
79
80// -----------------------------------------------------------------------------
81
82static SIMDPP_INL
83mask_float32<4> i_to_mask(const float32<4>& a);
84
85#if SIMDPP_USE_AVX2
86static SIMDPP_INL
87mask_float32<8> i_to_mask(const float32<8>& a);
88#endif
89
90#if SIMDPP_USE_AVX512F
91static SIMDPP_INL
92mask_float32<16> i_to_mask(const float32<16>& a);
93#endif
94
95// -----------------------------------------------------------------------------
96
97static SIMDPP_INL
98mask_float64<2> i_to_mask(const float64<2>& a);
99
100#if SIMDPP_USE_AVX2
101static SIMDPP_INL
102mask_float64<4> i_to_mask(const float64<4>& a);
103#endif
104
105#if SIMDPP_USE_AVX512F
106static SIMDPP_INL
107mask_float64<8> i_to_mask(const float64<8>& a);
108#endif
109
110// -----------------------------------------------------------------------------
111
112template<class V> SIMDPP_INL
113typename V::mask_vector_type i_to_mask(const V& a);
114
115} // namespace insn
116} // namespace detail
117} // namespace SIMDPP_ARCH_NAMESPACE
118} // namespace simdpp
119
120#endif
121
122
123