1/* Copyright (C) 2016 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_F_REDUCE_MIN_H
9#define LIBSIMDPP_SIMDPP_CORE_F_REDUCE_MIN_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/f_reduce_min.h>
17
18namespace simdpp {
19namespace SIMDPP_ARCH_NAMESPACE {
20
21
22/** Computes the minimum of the elements in the vector.
23
24 @code
25 r0 = min(a0, a1, a2, ...)
26 @endcode
27*/
28template<unsigned N, class E> SIMDPP_INL
29float reduce_min(const float32<N,E>& a)
30{
31 return detail::insn::i_reduce_min(a.eval());
32}
33
34template<unsigned N, class E> SIMDPP_INL
35double reduce_min(const float64<N,E>& a)
36{
37 return detail::insn::i_reduce_min(a.eval());
38}
39
40} // namespace SIMDPP_ARCH_NAMESPACE
41} // namespace simdpp
42
43#endif
44
45