<commit_before>/*  This file is part of the Vc library.

    Copyright (C) 2011 <NAME> <<EMAIL>>

    Vc is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as
    published by the Free Software Foundation, either version 3 of
    the License, or (at your option) any later version.

    Vc is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with Vc.  If not, see <http://www.gnu.org/licenses/>.

*/

namespace Vc
{
namespace Scalar
{

// stuff //////////////////////////////////////////////////////////////////////////// {{{1
template<> inline Vector<float> INTRINSIC Vector<float>::copySign(Vector<float> reference) const
{
    union {
        float f;
        unsigned int i;
    } value, sign;
    value.f = data();
    sign.f = reference.data();
    value.i = (sign.i & 0x80000000u) | (value.i & 0x7fffffffu);
    return value.f;
}
template<> inline Vector<double> INTRINSIC Vector<double>::copySign(Vector<double> reference) const
{
    union {
        double f;
        unsigned long long i;
    } value, sign;
    value.f = data();
    sign.f = reference.data();
    value.i = (sign.i & 0x8000000000000000u) | (value.i & 0x7fffffffffffffffu);
    return value.f;
} // }}}1
// exponent {{{1
template<> inline Vector<float> INTRINSIC Vector<float>::exponent() const
{
    VC_ASSERT(m_data > 0.f);
    union { float f; int i; } value;
    value.f = m_data;
    return static_cast<float>((value.i >> 23) - 0x7f);
}
template<> inline Vector<double> INTRINSIC Vector<double>::exponent() const
{
    VC_ASSERT(m_data > 0.);
    union { double f; long long i; } value;
    value.f = m_data;
    return static_cast<double>((value.i >> 52) - 0x3ff);
}<commit_msg>scalar implementation of float bitwise operators<commit_after>/*  This file is part of the Vc library.

    Copyright (C) 2011 <NAME> <<EMAIL>>

    Vc is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as
    published by the Free Software Foundation, either version 3 of
    the License, or (at your option) any later version.

    Vc is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with Vc.  If not, see <http://www.gnu.org/licenses/>.

*/

namespace Vc
{
namespace Scalar
{

// stuff //////////////////////////////////////////////////////////////////////////// {{{1
template<> inline Vector<float> INTRINSIC Vector<float>::copySign(Vector<float> reference) const
{
    union {
        float f;
        unsigned int i;
    } value, sign;
    value.f = data();
    sign.f = reference.data();
    value.i = (sign.i & 0x80000000u) | (value.i & 0x7fffffffu);
    return value.f;
}
template<> inline Vector<double> INTRINSIC Vector<double>::copySign(Vector<double> reference) const
{
    union {
        double f;
        unsigned long long i;
    } value, sign;
    value.f = data();
    sign.f = reference.data();
    value.i = (sign.i & 0x8000000000000000u) | (value.i & 0x7fffffffffffffffu);
    return value.f;
} // }}}1
// bitwise operators {{{1
template<> inline Vector<float> &Vector<float>::operator|=(const Vector<float> &x) {
    typedef unsigned int uinta MAY_ALIAS;
    uinta *left = reinterpret_cast<uinta *>(&m_data);
    const uinta *right = reinterpret_cast<const uinta *>(&x.m_data);
    *left |= *right;
    return *this;
}
template<> inline Vector<float> Vector<float>::operator|(const Vector<float> &x) const {
    Vector<float> ret = *this;
    return ret |= x;
}
template<> inline Vector<float> &Vector<float>::operator&=(const Vector<float> &x) {
    typedef unsigned int uinta MAY_ALIAS;
    uinta *left = reinterpret_cast<uinta *>(&m_data);
    const uinta *right = reinterpret_cast<const uinta *>(&x.m_data);
    *left &= *right;
    return *this;
}
template<> inline Vector<float> Vector<float>::operator&(const Vector<float> &x) const {
    Vector<float> ret = *this;
    return ret &= x;
}
template<> inline Vector<float> &Vector<float>::operator^=(const Vector<float> &x) {
    typedef unsigned int uinta MAY_ALIAS;
    uinta *left = reinterpret_cast<uinta *>(&m_data);
    const uinta *right = reinterpret_cast<const uinta *>(&x.m_data);
    *left ^= *right;
    return *this;
}
template<> inline Vector<float> Vector<float>::operator^(const Vector<float> &x) const {
    Vector<float> ret = *this;
    return ret ^= x;
}

template<> inline Vector<double> &Vector<double>::operator|=(const Vector<double> &x) {
    typedef unsigned long long uinta MAY_ALIAS;
    uinta *left = reinterpret_cast<uinta *>(&m_data);
    const uinta *right = reinterpret_cast<const uinta *>(&x.m_data);
    *left |= *right;
    return *this;
}
template<> inline Vector<double> Vector<double>::operator|(const Vector<double> &x) const {
    Vector<double> ret = *this;
    return ret |= x;
}
template<> inline Vector<double> &Vector<double>::operator&=(const Vector<double> &x) {
    typedef unsigned long long uinta MAY_ALIAS;
    uinta *left = reinterpret_cast<uinta *>(&m_data);
    const uinta *right = reinterpret_cast<const uinta *>(&x.m_data);
    *left &= *right;
    return *this;
}
template<> inline Vector<double> Vector<double>::operator&(const Vector<double> &x) const {
    Vector<double> ret = *this;
    return ret &= x;
}
template<> inline Vector<double> &Vector<double>::operator^=(const Vector<double> &x) {
    typedef unsigned long long uinta MAY_ALIAS;
    uinta *left = reinterpret_cast<uinta *>(&m_data);
    const uinta *right = reinterpret_cast<const uinta *>(&x.m_data);
    *left ^= *right;
    return *this;
}
template<> inline Vector<double> Vector<double>::operator^(const Vector<double> &x) const {
    Vector<double> ret = *this;
    return ret ^= x;
}
// }}}1
// exponent {{{1
template<> inline Vector<float> INTRINSIC Vector<float>::exponent() const
{
    VC_ASSERT(m_data > 0.f);
    union { float f; int i; } value;
    value.f = m_data;
    return static_cast<float>((value.i >> 23) - 0x7f);
}
template<> inline Vector<double> INTRINSIC Vector<double>::exponent() const
{
    VC_ASSERT(m_data > 0.);
    union { double f; long long i; } value;
    value.f = m_data;
    return static_cast<double>((value.i >> 52) - 0x3ff);
}
{'fraction_non_alphanumeric': 0.1504832713754647, 'fraction_numerical': 0.014572490706319703, 'mean_word_length': 3.3060179257362354, 'pattern_counts': {'":': 0, '<': 109, '<?xml version=': 0, '>': 121, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 8, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1256863', 'n_tokens_mistral': 2190, 'n_tokens_neox': 2090, 'n_words': 672}