<commit_before>//! Functionality for working with SIMD registers and instructions.
//!
//! [Source](https://github.com/huonw/simd), [crates.io](https://crates.io/crates/simd)

#![feature(trace_macros)]

extern crate simdty;
extern crate llvmint;

use std::mem;

pub use convert::bitcast::Bitcast;
pub use convert::semantic::Convert;

mod convert;

mod generated;

/// A SIMD vector, storing precisely `count()` elements of (primitive)
/// type `Item` sequentially in memory.
///
/// This trait is `unsafe` because it is used inside `unsafe` code
/// relying on the correctness of `Item` and `count()`.
pub unsafe trait Vector: Sized + Copy {
    /// The type that this vector contains.
    type Item;

    /// Return the number of items in `self`.
    #[inline(always)]
    fn count(_: Option<Self>) -> usize {
        let vsize = mem::size_of::<Self>();
        let esize = mem::size_of::<Self::Item>();
        assert!(vsize % esize == 0);

        vsize / esize
    }
}

/// SIMD vectors which can be separated into two SIMD vectors of half
/// the size with the same elements.
pub unsafe trait HalfVector: Vector {
    type Half /*: Vector<Item = Self::Item>*/;<commit_msg>fixup! Add the `Tails` and `TailsMut` structs.<commit_after>//! Functionality for working with SIMD registers and instructions.
//!
//! [Source](https://github.com/huonw/simd), [crates.io](https://crates.io/crates/simd)

#![feature(trace_macros)]

extern crate simdty;
extern crate llvmint;

use std::mem;

pub use convert::bitcast::Bitcast;
pub use convert::semantic::{Convert, Tails, TailsMut};

mod convert;

mod generated;

/// A SIMD vector, storing precisely `count()` elements of (primitive)
/// type `Item` sequentially in memory.
///
/// This trait is `unsafe` because it is used inside `unsafe` code
/// relying on the correctness of `Item` and `count()`.
pub unsafe trait Vector: Sized + Copy {
    /// The type that this vector contains.
    type Item;

    /// Return the number of items in `self`.
    #[inline(always)]
    fn count(_: Option<Self>) -> usize {
        let vsize = mem::size_of::<Self>();
        let esize = mem::size_of::<Self::Item>();
        assert!(vsize % esize == 0);

        vsize / esize
    }
}

/// SIMD vectors which can be separated into two SIMD vectors of half
/// the size with the same elements.
pub unsafe trait HalfVector: Vector {
    type Half /*: Vector<Item = Self::Item>*/;
{'fraction_non_alphanumeric': 0.1479634247714048, 'fraction_numerical': 0.0008312551953449709, 'mean_word_length': 3.2982142857142858, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '6012750', 'n_tokens_mistral': 760, 'n_tokens_neox': 731, 'n_words': 261}