1/* Copyright (C) 2013-2014 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_CORE_BIT_NOT_H
9#define LIBSIMDPP_SIMDPP_CORE_BIT_NOT_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#include <simdpp/detail/insn/bit_not.h>
17#include <simdpp/detail/expr/bit_not.h>
18#include <simdpp/detail/get_expr.h>
19
20namespace simdpp {
21namespace SIMDPP_ARCH_NAMESPACE {
22
23/** Computes bitwise NOT of an integer or floating-point vector
24
25 @code
26 r = ~a
27 @endcode
28
29 @todo icost
30*/
31template<unsigned N, class V> SIMDPP_INL
32typename detail::get_expr<V, expr_bit_not<V>>::empty
33 bit_not(const any_vec<N,V>& a)
34{
35 typename detail::get_expr_nosign<V>::type ra;
36 ra = a.wrapped().eval();
37 return detail::insn::i_bit_not(ra);
38}
39
40/* FIXME
41template<unsigned N, class E> SIMDPP_INL
42mask_int32<N, expr_bit_not<mask_int32<N,E>>> bit_not(mask_int32<N,E> a)
43{
44 return { { a } };
45}
46template<unsigned N, class E> SIMDPP_INL
47mask_int64<N, expr_bit_not<mask_int64<N,E>>> bit_not(mask_int64<N,E> a)
48{
49 return { { a } };
50}
51
52template<unsigned N, class E> SIMDPP_INL
53mask_float32<N, expr_bit_not<mask_float32<N,E>>> bit_not(mask_float32<N,E> a)
54{
55 return { { a } };
56}
57template<unsigned N, class E> SIMDPP_INL
58mask_float64<N, expr_bit_not<mask_float64<N,E>>> bit_not(mask_float64<N,E> a)
59{
60 return { { a } };
61}
62*/
63
64} // namespace SIMDPP_ARCH_NAMESPACE
65} // namespace simdpp
66
67#endif
68
69