Skip to content

Commit

Permalink
Replace crate with pub(crate)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomcc committed May 24, 2022
1 parent 6ff2d7d commit 0d5887b
Show file tree
Hide file tree
Showing 27 changed files with 128 additions and 129 deletions.
4 changes: 2 additions & 2 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#[macro_use]
mod bitmask;
crate mod cast;
pub(crate) mod cast;
#[macro_use]
mod cmp;
#[macro_use]
Expand Down Expand Up @@ -37,7 +37,7 @@ mod swap_bytes;
mod bit_manip;

#[cfg(feature = "into_bits")]
crate mod into_bits;
pub(crate) mod into_bits;

macro_rules! impl_i {
([$elem_ty:ident; $elem_n:expr]: $tuple_id:ident, $mask_ty:ident
Expand Down
50 changes: 25 additions & 25 deletions src/codegen.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
//! Code-generation utilities

crate mod bit_manip;
crate mod llvm;
crate mod math;
crate mod reductions;
crate mod shuffle;
crate mod shuffle1_dyn;
crate mod swap_bytes;
pub(crate) mod bit_manip;
pub(crate) mod llvm;
pub(crate) mod math;
pub(crate) mod reductions;
pub(crate) mod shuffle;
pub(crate) mod shuffle1_dyn;
pub(crate) mod swap_bytes;

macro_rules! impl_simd_array {
([$elem_ty:ident; $elem_count:expr]:
$tuple_id:ident | $($elem_tys:ident),*) => {
#[derive(Copy, Clone)]
#[repr(simd)]
pub struct $tuple_id($(crate $elem_tys),*);
pub struct $tuple_id($(pub(crate) $elem_tys),*);
//^^^^^^^ leaked through SimdArray

impl crate::sealed::Seal for [$elem_ty; $elem_count] {}
Expand All @@ -35,28 +35,28 @@ macro_rules! impl_simd_array {
}
}

crate mod pointer_sized_int;
pub(crate) mod pointer_sized_int;

crate mod v16;
crate use self::v16::*;
pub(crate) mod v16;
pub(crate) use self::v16::*;

crate mod v32;
crate use self::v32::*;
pub(crate) mod v32;
pub(crate) use self::v32::*;

crate mod v64;
crate use self::v64::*;
pub(crate) mod v64;
pub(crate) use self::v64::*;

crate mod v128;
crate use self::v128::*;
pub(crate) mod v128;
pub(crate) use self::v128::*;

crate mod v256;
crate use self::v256::*;
pub(crate) mod v256;
pub(crate) use self::v256::*;

crate mod v512;
crate use self::v512::*;
pub(crate) mod v512;
pub(crate) use self::v512::*;

crate mod vSize;
crate use self::vSize::*;
pub(crate) mod vSize;
pub(crate) use self::vSize::*;

crate mod vPtr;
crate use self::vPtr::*;
pub(crate) mod vPtr;
pub(crate) use self::vPtr::*;
4 changes: 2 additions & 2 deletions src/codegen/bit_manip.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! LLVM bit manipulation intrinsics.
#[rustfmt::skip]

use crate::*;
pub(crate) use crate::*;

#[allow(improper_ctypes, dead_code)]
extern "C" {
Expand Down Expand Up @@ -147,7 +147,7 @@ extern "C" {
fn ctpop_u128x4(x: u128x4) -> u128x4;
}

crate trait BitManip {
pub(crate) trait BitManip {
fn ctpop(self) -> Self;
fn ctlz(self) -> Self;
fn cttz(self) -> Self;
Expand Down
98 changes: 49 additions & 49 deletions src/codegen/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,53 +76,53 @@ where
}

extern "platform-intrinsic" {
crate fn simd_eq<T, U>(x: T, y: T) -> U;
crate fn simd_ne<T, U>(x: T, y: T) -> U;
crate fn simd_lt<T, U>(x: T, y: T) -> U;
crate fn simd_le<T, U>(x: T, y: T) -> U;
crate fn simd_gt<T, U>(x: T, y: T) -> U;
crate fn simd_ge<T, U>(x: T, y: T) -> U;

crate fn simd_insert<T, U>(x: T, idx: u32, val: U) -> T;
crate fn simd_extract<T, U>(x: T, idx: u32) -> U;

crate fn simd_cast<T, U>(x: T) -> U;

crate fn simd_add<T>(x: T, y: T) -> T;
crate fn simd_sub<T>(x: T, y: T) -> T;
crate fn simd_mul<T>(x: T, y: T) -> T;
crate fn simd_div<T>(x: T, y: T) -> T;
crate fn simd_rem<T>(x: T, y: T) -> T;
crate fn simd_shl<T>(x: T, y: T) -> T;
crate fn simd_shr<T>(x: T, y: T) -> T;
crate fn simd_and<T>(x: T, y: T) -> T;
crate fn simd_or<T>(x: T, y: T) -> T;
crate fn simd_xor<T>(x: T, y: T) -> T;

crate fn simd_reduce_add_unordered<T, U>(x: T) -> U;
crate fn simd_reduce_mul_unordered<T, U>(x: T) -> U;
crate fn simd_reduce_add_ordered<T, U>(x: T, acc: U) -> U;
crate fn simd_reduce_mul_ordered<T, U>(x: T, acc: U) -> U;
crate fn simd_reduce_min<T, U>(x: T) -> U;
crate fn simd_reduce_max<T, U>(x: T) -> U;
crate fn simd_reduce_min_nanless<T, U>(x: T) -> U;
crate fn simd_reduce_max_nanless<T, U>(x: T) -> U;
crate fn simd_reduce_and<T, U>(x: T) -> U;
crate fn simd_reduce_or<T, U>(x: T) -> U;
crate fn simd_reduce_xor<T, U>(x: T) -> U;
crate fn simd_reduce_all<T>(x: T) -> bool;
crate fn simd_reduce_any<T>(x: T) -> bool;

crate fn simd_select<M, T>(m: M, a: T, b: T) -> T;

crate fn simd_fmin<T>(a: T, b: T) -> T;
crate fn simd_fmax<T>(a: T, b: T) -> T;

crate fn simd_fsqrt<T>(a: T) -> T;
crate fn simd_fma<T>(a: T, b: T, c: T) -> T;

crate fn simd_gather<T, P, M>(value: T, pointers: P, mask: M) -> T;
crate fn simd_scatter<T, P, M>(value: T, pointers: P, mask: M);

crate fn simd_bitmask<T, U>(value: T) -> U;
pub(crate) fn simd_eq<T, U>(x: T, y: T) -> U;
pub(crate) fn simd_ne<T, U>(x: T, y: T) -> U;
pub(crate) fn simd_lt<T, U>(x: T, y: T) -> U;
pub(crate) fn simd_le<T, U>(x: T, y: T) -> U;
pub(crate) fn simd_gt<T, U>(x: T, y: T) -> U;
pub(crate) fn simd_ge<T, U>(x: T, y: T) -> U;

pub(crate) fn simd_insert<T, U>(x: T, idx: u32, val: U) -> T;
pub(crate) fn simd_extract<T, U>(x: T, idx: u32) -> U;

pub(crate) fn simd_cast<T, U>(x: T) -> U;

pub(crate) fn simd_add<T>(x: T, y: T) -> T;
pub(crate) fn simd_sub<T>(x: T, y: T) -> T;
pub(crate) fn simd_mul<T>(x: T, y: T) -> T;
pub(crate) fn simd_div<T>(x: T, y: T) -> T;
pub(crate) fn simd_rem<T>(x: T, y: T) -> T;
pub(crate) fn simd_shl<T>(x: T, y: T) -> T;
pub(crate) fn simd_shr<T>(x: T, y: T) -> T;
pub(crate) fn simd_and<T>(x: T, y: T) -> T;
pub(crate) fn simd_or<T>(x: T, y: T) -> T;
pub(crate) fn simd_xor<T>(x: T, y: T) -> T;

pub(crate) fn simd_reduce_add_unordered<T, U>(x: T) -> U;
pub(crate) fn simd_reduce_mul_unordered<T, U>(x: T) -> U;
pub(crate) fn simd_reduce_add_ordered<T, U>(x: T, acc: U) -> U;
pub(crate) fn simd_reduce_mul_ordered<T, U>(x: T, acc: U) -> U;
pub(crate) fn simd_reduce_min<T, U>(x: T) -> U;
pub(crate) fn simd_reduce_max<T, U>(x: T) -> U;
pub(crate) fn simd_reduce_min_nanless<T, U>(x: T) -> U;
pub(crate) fn simd_reduce_max_nanless<T, U>(x: T) -> U;
pub(crate) fn simd_reduce_and<T, U>(x: T) -> U;
pub(crate) fn simd_reduce_or<T, U>(x: T) -> U;
pub(crate) fn simd_reduce_xor<T, U>(x: T) -> U;
pub(crate) fn simd_reduce_all<T>(x: T) -> bool;
pub(crate) fn simd_reduce_any<T>(x: T) -> bool;

pub(crate) fn simd_select<M, T>(m: M, a: T, b: T) -> T;

pub(crate) fn simd_fmin<T>(a: T, b: T) -> T;
pub(crate) fn simd_fmax<T>(a: T, b: T) -> T;

pub(crate) fn simd_fsqrt<T>(a: T) -> T;
pub(crate) fn simd_fma<T>(a: T, b: T, c: T) -> T;

pub(crate) fn simd_gather<T, P, M>(value: T, pointers: P, mask: M) -> T;
pub(crate) fn simd_scatter<T, P, M>(value: T, pointers: P, mask: M);

pub(crate) fn simd_bitmask<T, U>(value: T) -> U;
}
2 changes: 1 addition & 1 deletion src/codegen/math.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//! Vertical math operations

crate mod float;
pub(crate) mod float;
30 changes: 15 additions & 15 deletions src/codegen/math/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
#![allow(clippy::useless_transmute)]

#[macro_use]
crate mod macros;
crate mod abs;
crate mod cos;
crate mod cos_pi;
crate mod exp;
crate mod ln;
crate mod mul_add;
crate mod mul_adde;
crate mod powf;
crate mod sin;
crate mod sin_cos_pi;
crate mod sin_pi;
crate mod sqrt;
crate mod sqrte;
crate mod tanh;
pub(crate) mod macros;
pub(crate) mod abs;
pub(crate) mod cos;
pub(crate) mod cos_pi;
pub(crate) mod exp;
pub(crate) mod ln;
pub(crate) mod mul_add;
pub(crate) mod mul_adde;
pub(crate) mod powf;
pub(crate) mod sin;
pub(crate) mod sin_cos_pi;
pub(crate) mod sin_pi;
pub(crate) mod sqrt;
pub(crate) mod sqrte;
pub(crate) mod tanh;
2 changes: 1 addition & 1 deletion src/codegen/math/float/abs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::*;

crate trait Abs {
pub(crate) trait Abs {
fn abs(self) -> Self;
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/math/float/cos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::*;

crate trait Cos {
pub(crate) trait Cos {
fn cos(self) -> Self;
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/math/float/cos_pi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::*;

crate trait CosPi {
pub(crate) trait CosPi {
fn cos_pi(self) -> Self;
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/math/float/exp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::*;

crate trait Exp {
pub(crate) trait Exp {
fn exp(self) -> Self;
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/math/float/ln.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::*;

crate trait Ln {
pub(crate) trait Ln {
fn ln(self) -> Self;
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/math/float/mul_add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::*;

// FIXME: 64-bit 1 element mul_add

crate trait MulAdd {
pub(crate) trait MulAdd {
fn mul_add(self, y: Self, z: Self) -> Self;
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/math/float/mul_adde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::*;

// FIXME: 64-bit 1 element mul_adde

crate trait MulAddE {
pub(crate) trait MulAddE {
fn mul_adde(self, y: Self, z: Self) -> Self;
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/math/float/powf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::*;

crate trait Powf {
pub(crate) trait Powf {
fn powf(self, x: Self) -> Self;
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/math/float/sin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::*;

crate trait Sin {
pub(crate) trait Sin {
fn sin(self) -> Self;
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/math/float/sin_cos_pi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::*;

crate trait SinCosPi: Sized {
pub(crate) trait SinCosPi: Sized {
type Output;
fn sin_cos_pi(self) -> Self::Output;
}
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/math/float/sin_pi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::*;

crate trait SinPi {
pub(crate) trait SinPi {
fn sin_pi(self) -> Self;
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/math/float/sqrt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::*;

crate trait Sqrt {
pub(crate) trait Sqrt {
fn sqrt(self) -> Self;
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/math/float/sqrte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use crate::llvm::simd_fsqrt;
use crate::*;

crate trait Sqrte {
pub(crate) trait Sqrte {
fn sqrte(self) -> Self;
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/math/float/tanh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::*;

crate trait Tanh {
pub(crate) trait Tanh {
fn tanh(self) -> Self;
}

Expand Down
Loading

0 comments on commit 0d5887b

Please sign in to comment.