0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-30 02:18:58 +01:00
construct/include/ircd/simd/broad_cast.h
2020-07-15 17:43:17 -07:00

33 lines
834 B
C++

// The Construct
//
// Copyright (C) The Construct Developers, Authors & Contributors
// Copyright (C) 2016-2020 Jason Volk <jason@zemos.net>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
#pragma once
#define HAVE_IRCD_SIMD_BROAD_CAST_H
namespace ircd::simd
{
template<class T,
class V>
T broad_cast(T, const V) noexcept;
}
template<class T,
class V>
[[using gnu: always_inline, gnu_inline, artificial]]
extern inline T
ircd::simd::broad_cast(T a,
const V v)
noexcept
{
for(size_t i(0); i < lanes<T>(); ++i)
a[i] = v;
return a;
}