1// This file is generated by tools/gen_operators.pl. CHANGES WILL BE OVERWRITTEN
2/* Copyright (C) 2013-2014 Povilas Kanapickas <povilas@radix.lt>
3
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt)
7*/
8
9#ifndef LIBSIMDPP_SIMDPP_CORE_BIT_OR_OPERATOR_H
10#define LIBSIMDPP_SIMDPP_CORE_BIT_OR_OPERATOR_H
11
12#ifndef LIBSIMDPP_SIMD_H
13 #error "This file must be included through simd.h"
14#endif
15
16#include <simdpp/types.h>
17#include <simdpp/detail/insn/bit_or.h>
18#include <simdpp/detail/expr/bit_or.h>
19#include <simdpp/core/detail/get_expr_bitwise.h>
20#include <simdpp/core/detail/scalar_arg_impl.h>
21
22namespace simdpp {
23namespace SIMDPP_ARCH_NAMESPACE {
24
25/** Computes bitwise OR of integer vectors.
26
27 @code
28 r0 = a0 | b0
29 ...
30 rN = aN | bN
31 @endcode
32
33 @todo icost
34*/
35template<unsigned N, class V1, class V2> SIMDPP_INL
36typename detail::get_expr_bit_or<V1, V2>::type
37 operator|(const any_vec<N,V1>& a, const any_vec<N,V2>& b)
38{
39 return { { a.wrapped(), b.wrapped() } };
40}
41
42// support scalar arguments
43template<unsigned N, class V> SIMDPP_INL
44typename detail::get_expr_bitwise2_and<expr_bit_or, unsigned, V>::type
45 operator|(const unsigned& a, const any_vec<N,V>& b)
46{
47 return { { a, b.wrapped() } };
48}
49template<unsigned N, class V> SIMDPP_INL
50typename detail::get_expr_bitwise2_and<expr_bit_or, unsigned long, V>::type
51 operator|(const unsigned long& a, const any_vec<N,V>& b)
52{
53 return { { a, b.wrapped() } };
54}
55template<unsigned N, class V> SIMDPP_INL
56typename detail::get_expr_bitwise2_and<expr_bit_or, unsigned long long, V>::type
57 operator|(const unsigned long long& a, const any_vec<N,V>& b)
58{
59 return { { a, b.wrapped() } };
60}
61template<unsigned N, class V> SIMDPP_INL
62typename detail::get_expr_bitwise2_and<expr_bit_or, int, V>::type
63 operator|(const int& a, const any_vec<N,V>& b)
64{
65 return { { a, b.wrapped() } };
66}
67template<unsigned N, class V> SIMDPP_INL
68typename detail::get_expr_bitwise2_and<expr_bit_or, long, V>::type
69 operator|(const long& a, const any_vec<N,V>& b)
70{
71 return { { a, b.wrapped() } };
72}
73template<unsigned N, class V> SIMDPP_INL
74typename detail::get_expr_bitwise2_and<expr_bit_or, long long, V>::type
75 operator|(const long long& a, const any_vec<N,V>& b)
76{
77 return { { a, b.wrapped() } };
78}
79
80template<unsigned N, class V> SIMDPP_INL
81typename detail::get_expr_bitwise2_and<expr_bit_or, V, unsigned>::type
82 operator|(const any_vec<N,V>& a, const unsigned& b)
83{
84 return { { a.wrapped(), b } };
85}
86template<unsigned N, class V> SIMDPP_INL
87typename detail::get_expr_bitwise2_and<expr_bit_or, V, unsigned long>::type
88 operator|(const any_vec<N,V>& a, const unsigned long& b)
89{
90 return { { a.wrapped(), b } };
91}
92template<unsigned N, class V> SIMDPP_INL
93typename detail::get_expr_bitwise2_and<expr_bit_or, V, unsigned long long>::type
94 operator|(const any_vec<N,V>& a, const unsigned long long& b)
95{
96 return { { a.wrapped(), b } };
97}
98template<unsigned N, class V> SIMDPP_INL
99typename detail::get_expr_bitwise2_and<expr_bit_or, V, int>::type
100 operator|(const any_vec<N,V>& a, const int& b)
101{
102 return { { a.wrapped(), b } };
103}
104template<unsigned N, class V> SIMDPP_INL
105typename detail::get_expr_bitwise2_and<expr_bit_or, V, long>::type
106 operator|(const any_vec<N,V>& a, const long& b)
107{
108 return { { a.wrapped(), b } };
109}
110template<unsigned N, class V> SIMDPP_INL
111typename detail::get_expr_bitwise2_and<expr_bit_or, V, long long>::type
112 operator|(const any_vec<N,V>& a, const long long& b)
113{
114 return { { a.wrapped(), b } };
115}
116
117
118} // namespace SIMDPP_ARCH_NAMESPACE
119} // namespace simdpp
120
121#endif
122
123
124