0
0
Fork 0
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:
Jason Volk 2020-10-09 23:43:27 -07:00
parent b63d88d195
commit de0650d3f7
7 changed files with 14 additions and 37 deletions

View file

@ -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"

View file

@ -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"

View file

@ -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

View file

@ -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;
}

View file

@ -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

View file

@ -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;

View file

@ -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