mirror of
https://github.com/matrix-construct/construct
synced 2024-06-02 18:18:56 +02:00
ircd: Reorg simd.h / buffer.h interface dependency relationship.
This commit is contained in:
parent
b63d88d195
commit
de0650d3f7
|
@ -119,7 +119,6 @@ namespace ircd::buffer::buffers
|
|||
#include "const_buffer.h"
|
||||
#include "copy.h"
|
||||
#include "move.h"
|
||||
#include "stream.h"
|
||||
#include "fixed_buffer.h"
|
||||
#include "window_buffer.h"
|
||||
#include "parse_buffer.h"
|
||||
|
|
|
@ -40,11 +40,12 @@
|
|||
// Project library interfaces
|
||||
//
|
||||
|
||||
#include "simd/simd.h"
|
||||
#include "util/mask.h"
|
||||
#include "string_view.h"
|
||||
#include "vector_view.h"
|
||||
#include "byte_view.h"
|
||||
#include "buffer/buffer.h"
|
||||
#include "simd/simd.h"
|
||||
#include "leb128.h"
|
||||
#include "allocator.h"
|
||||
#include "util/util.h"
|
||||
|
|
|
@ -11,24 +11,8 @@
|
|||
#pragma once
|
||||
#define HAVE_IRCD_SIMD_PRINT_H
|
||||
|
||||
// Forward declaration as simd.h precedes string_view.h such that the former
|
||||
// is usable by the latter inline.
|
||||
namespace ircd
|
||||
{
|
||||
struct string_view;
|
||||
}
|
||||
|
||||
// Forward declaration as simd.h precedes the buffer/buffer.h suite such that
|
||||
// the former is usable by the latter inline.
|
||||
namespace ircd::buffer
|
||||
{
|
||||
struct mutable_buffer;
|
||||
};
|
||||
|
||||
namespace ircd::simd
|
||||
{
|
||||
using buffer::mutable_buffer;
|
||||
|
||||
/// Print the contents of the vector in "register layout" which are
|
||||
/// little-endian hex integer preceded by '0x' with each lane being
|
||||
/// space-separated. The fmt argument is reserved to offer some additional
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "split.h"
|
||||
#include "lower.h"
|
||||
#include "upper.h"
|
||||
#include "mask.h"
|
||||
#include "gather.h"
|
||||
#include "scatter.h"
|
||||
#include "shl.h"
|
||||
|
@ -42,19 +41,12 @@
|
|||
namespace ircd
|
||||
{
|
||||
using simd::lane_cast;
|
||||
|
||||
using simd::shl;
|
||||
using simd::shr;
|
||||
|
||||
using simd::rol;
|
||||
using simd::ror;
|
||||
|
||||
using simd::lzcnt;
|
||||
using simd::tzcnt;
|
||||
|
||||
using simd::popcnt;
|
||||
using simd::popmask;
|
||||
using simd::boolmask;
|
||||
|
||||
using simd::lateral;
|
||||
}
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
#define HAVE_IRCD_BUFFER_STREAM_H
|
||||
#define HAVE_IRCD_SIMD_STREAM_H
|
||||
|
||||
namespace ircd::buffer
|
||||
namespace ircd::simd
|
||||
{
|
||||
size_t stream_aligned(const mutable_buffer &dst, const const_buffer &src);
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ namespace ircd::buffer
|
|||
/// buffer must be padded out to alignment.
|
||||
///
|
||||
inline size_t
|
||||
ircd::buffer::stream_aligned(const mutable_buffer &dst,
|
||||
const const_buffer &src)
|
||||
ircd::simd::stream_aligned(const mutable_buffer &dst,
|
||||
const const_buffer &src)
|
||||
{
|
||||
// Platforms that have non-temporal store support; this is all of x86_64
|
||||
constexpr bool has_store
|
|
@ -9,19 +9,20 @@
|
|||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
#define HAVE_IRCD_SIMD_MASK_H
|
||||
#define HAVE_IRCD_UTIL_MASK_H
|
||||
|
||||
namespace ircd::simd
|
||||
namespace ircd {
|
||||
inline namespace util
|
||||
{
|
||||
template<class T> T popmask(const T) noexcept;
|
||||
template<class T> T boolmask(const T) noexcept;
|
||||
}
|
||||
}}
|
||||
|
||||
/// Convenience template. Extends a bool value where the lsb is 1 or 0 into a
|
||||
/// mask value like the result of vector comparisons.
|
||||
template<class T>
|
||||
inline T
|
||||
ircd::simd::boolmask(const T a)
|
||||
ircd::util::boolmask(const T a)
|
||||
noexcept
|
||||
{
|
||||
return ~(popmask(a) - 1);
|
||||
|
@ -32,7 +33,7 @@ noexcept
|
|||
/// some bool-type reason...
|
||||
template<class T>
|
||||
inline T
|
||||
ircd::simd::popmask(const T a)
|
||||
ircd::util::popmask(const T a)
|
||||
noexcept
|
||||
{
|
||||
return a & 1;
|
|
@ -3674,7 +3674,7 @@ ircd::json::string_stringify_utf16(u8x16 &block,
|
|||
|
||||
const auto surrogates
|
||||
{
|
||||
simd::popcnt(u64x2(simd::popmask(u8x16(is_surrogate))))
|
||||
simd::popcnt(u64x2(popmask(u8x16(is_surrogate))))
|
||||
};
|
||||
|
||||
assert(di == length[0] + length[1]);
|
||||
|
@ -3874,7 +3874,7 @@ ircd::json::string_serialized_utf16(const u8x16 block,
|
|||
|
||||
const auto surrogates
|
||||
{
|
||||
simd::popcnt(u64x2(simd::popmask(u8x16(is_surrogate))))
|
||||
popcnt(u64x2(popmask(u8x16(is_surrogate))))
|
||||
};
|
||||
|
||||
return u64x2
|
||||
|
|
Loading…
Reference in a new issue