<commit_before>/***************************************************************************
* Copyright (c) 2016, <NAME>, <NAME> and <NAME>    *
*                                                                          *
* Distributed under the terms of the BSD 3-Clause License.                 *
*                                                                          *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/

#ifndef XSIMD_NEON_UINT8_HPP
#define XSIMD_NEON_UINT8_HPP

#include <utility>

#include "xsimd_base.hpp"
#include "xsimd_neon_bool.hpp"

namespace xsimd
{
    /*********************
     * batch<uint8_t, 16> *
     *********************/

    template <>
    struct simd_batch_traits<batch<uint8_t, 16>>
    {
        using value_type = uint8_t;
        static constexpr std::size_t size = 16;
        using batch_bool_type = batch_bool<uint8_t, 16>;
        static constexpr std::size_t align = XSIMD_DEFAULT_ALIGNMENT;
    };

    template <>
    class batch<uint8_t, 16> : public simd_batch<batch<uint8_t, 16>>
    {
        using simd_type = uint8x16_t;

    public:

        batch();
        explicit batch(uint8_t d);

        template <class... Args, class Enable = detail::is_array_initializer_t<uint8_t, 16, Args...>>
        batch(Args... args);
        explicit batch(const uint8_t* src);

        batch(const uint8_t* src, aligned_mode);
        batch(const uint8_t* src, unaligned_mode);

        batch(const simd_type& rhs);
        batch& operator=(const simd_type& rhs);

        operator simd_type() const;

        batch& load_aligned(const uint8_t* src);
        batch& load_unaligned(const uint8_t* src);

        void store_aligned(uint8_t* dst) const;
        void store_unaligned(uint8_t* dst) const;

        uint8_t operator[](std::size_t index) const;

    private:

        simd_type m_value;
    };

    batch<uint8_t, 16> operator<<(const batch<uint8_t, 16>& lhs, uint8_t rhs);
    batch<uint8_t, 16> operator>>(const batch<uint8_t, 16>& lhs, uint8_t rhs);

    /************************************
     * batch<int8_t, 16> implementation *
     ************************************/

    inline batch<uint8_t, 16>::batch()
    {
    }

    inline batch<uint8_t, 16>::batch(uint8_t d)
        : m_value(vdupq_n_u8(d))
    {
    }

    template <class... Args, class>
    inline batch<uint8_t, 16>::batch(Args... args)
        : m_value{args...}
    {
    }

    inline batch<uint8_t, 16>::batch(const uint8_t* d)
        : m_value(vld1q_u8(d))
    {
    }

    inline batch<uint8_t, 16>::batch(const uint8_t* d, aligned_mode)
        : batch(d)
    {
    }

    inline batch<uint8_t, 16>::batch(const uint8_t* d, unaligned_mode)
        : batch(d)
    {
    }

    inline batch<uint8_t, 16>::batch(const simd_type& rhs)
        : m_value(rhs)
    {
    }

    inline batch<uint8_t, 16>& batch<uint8_t, 16>::operator=(const simd_type& rhs)
    {
        m_value = rhs;
        return *this;
    }

    inline batch<uint8_t, 16>& batch<uint8_t, 16>::load_aligned(const uint8_t* src)
    {
        m_value = vld1q_u8(src);
        return *this;
    }

    inline batch<uint8_t, 16>& batch<uint8_t, 16>::load_unaligned(const uint8_t* src)
    {
        return load_aligned(src);
    }

    inline void batch<uint8_t, 16>::store_aligned(uint8_t* dst) const
    {
        vst1q_u8(dst, m_value);
    }

    inline void batch<uint8_t, 16>::store_unaligned(uint8_t* dst) const
    {
        store_aligned(dst);
    }

    inline batch<uint8_t, 16>::operator int8x16_t() const
    {
        return m_value;
    }<commit_msg>Fix for uint_8 on ARM<commit_after>/***************************************************************************
* Copyright (c) 2016, <NAME>, <NAME> and <NAME>    *
*                                                                          *
* Distributed under the terms of the BSD 3-Clause License.                 *
*                                                                          *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/

#ifndef XSIMD_NEON_UINT8_HPP
#define XSIMD_NEON_UINT8_HPP

#include <utility>

#include "xsimd_base.hpp"
#include "xsimd_neon_bool.hpp"

namespace xsimd
{
    /*********************
     * batch<uint8_t, 16> *
     *********************/

    template <>
    struct simd_batch_traits<batch<uint8_t, 16>>
    {
        using value_type = uint8_t;
        static constexpr std::size_t size = 16;
        using batch_bool_type = batch_bool<uint8_t, 16>;
        static constexpr std::size_t align = XSIMD_DEFAULT_ALIGNMENT;
    };

    template <>
    class batch<uint8_t, 16> : public simd_batch<batch<uint8_t, 16>>
    {
        using simd_type = uint8x16_t;

    public:

        batch();
        explicit batch(uint8_t d);

        template <class... Args, class Enable = detail::is_array_initializer_t<uint8_t, 16, Args...>>
        batch(Args... args);
        explicit batch(const uint8_t* src);

        batch(const uint8_t* src, aligned_mode);
        batch(const uint8_t* src, unaligned_mode);

        batch(const simd_type& rhs);
        batch& operator=(const simd_type& rhs);

        operator simd_type() const;

        batch& load_aligned(const uint8_t* src);
        batch& load_unaligned(const uint8_t* src);

        void store_aligned(uint8_t* dst) const;
        void store_unaligned(uint8_t* dst) const;

        uint8_t operator[](std::size_t index) const;

    private:

        simd_type m_value;
    };

    batch<uint8_t, 16> operator<<(const batch<uint8_t, 16>& lhs, uint8_t rhs);
    batch<uint8_t, 16> operator>>(const batch<uint8_t, 16>& lhs, uint8_t rhs);

    /************************************
     * batch<int8_t, 16> implementation *
     ************************************/

    inline batch<uint8_t, 16>::batch()
    {
    }

    inline batch<uint8_t, 16>::batch(uint8_t d)
        : m_value(vdupq_n_u8(d))
    {
    }

    template <class... Args, class>
    inline batch<uint8_t, 16>::batch(Args... args)
        : m_value{args...}
    {
    }

    inline batch<uint8_t, 16>::batch(const uint8_t* d)
        : m_value(vld1q_u8(d))
    {
    }

    inline batch<uint8_t, 16>::batch(const uint8_t* d, aligned_mode)
        : batch(d)
    {
    }

    inline batch<uint8_t, 16>::batch(const uint8_t* d, unaligned_mode)
        : batch(d)
    {
    }

    inline batch<uint8_t, 16>::batch(const simd_type& rhs)
        : m_value(rhs)
    {
    }

    inline batch<uint8_t, 16>& batch<uint8_t, 16>::operator=(const simd_type& rhs)
    {
        m_value = rhs;
        return *this;
    }

    inline batch<uint8_t, 16>& batch<uint8_t, 16>::load_aligned(const uint8_t* src)
    {
        m_value = vld1q_u8(src);
        return *this;
    }

    inline batch<uint8_t, 16>& batch<uint8_t, 16>::load_unaligned(const uint8_t* src)
    {
        return load_aligned(src);
    }

    inline void batch<uint8_t, 16>::store_aligned(uint8_t* dst) const
    {
        vst1q_u8(dst, m_value);
    }

    inline void batch<uint8_t, 16>::store_unaligned(uint8_t* dst) const
    {
        store_aligned(dst);
    }

    inline batch<uint8_t, 16>::operator uint8x16_t() const
    {
        return m_value;
    }
{'fraction_non_alphanumeric': 0.1814477794377292, 'fraction_numerical': 0.033546108922993347, 'mean_word_length': 2.475224162340727, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4643073', 'n_tokens_mistral': 2617, 'n_tokens_neox': 2411, 'n_words': 502}