pub enum MathLib {
ISPCDefault,
Fast,
SVML,
System,
}
impl ToString for MathLib {
fn to_string(&self) -> String {
match *self {
MathLib::ISPCDefault => String::from("--math-lib=default"),
MathLib::Fast => String::from("--math-lib=fast"),
MathLib::SVML => String::from("--math-lib=svml"),
MathLib::System => String::from("--math-lib=system"),
}
}
}
pub enum Addressing {
A32,
A64,
}
impl ToString for Addressing {
fn to_string(&self) -> String {
match *self {
Addressing::A32 => String::from("--addressing=32"),
Addressing::A64 => String::from("--addressing=64"),
}
}
}
#[derive(Eq, PartialEq)]
pub enum CPU {
Generic,
Bonnell,
Core2,
Penryn,
Nehalem,
SandyBridge,
IvyBridge,
Haswell,
Broadwell,
Knl,
Skx,
Silvermont,
}
impl ToString for CPU {
fn to_string(&self) -> String {
match *self {
CPU::Generic => String::from("--cpu=generic"),
CPU::Bonnell => String::from("--cpu=bonnell"),
CPU::Core2 => String::from("--cpu=core2"),
CPU::Penryn => String::from("--cpu=penryn"),
CPU::Nehalem => String::from("--cpu=nehalem"),
CPU::SandyBridge => String::from("--cpu=sandybridge"),
CPU::IvyBridge => String::from("--cpu=ivybridge"),
CPU::Haswell => String::from("--cpu=haswell"),
CPU::Broadwell => String::from("--cpu=broadwell"),
CPU::Knl => String::from("--cpu=knl"),
CPU::Skx => String::from("--cpu=skx"),
CPU::Silvermont => String::from("--cpu=silvermont"),
}
}
}
#[derive(Ord, PartialOrd, Eq, PartialEq)]
pub enum OptimizationOpt {
DisableAssertions,
DisableFMA,
DisableLoopUnroll,
FastMaskedVload,
FastMath,
ForceAlignedMemory,
}
impl ToString for OptimizationOpt {
fn to_string(&self) -> String {
match *self {
OptimizationOpt::DisableAssertions => String::from("--opt=disable-assertions"),
OptimizationOpt::DisableFMA => String::from("--opt=disable-fma"),
OptimizationOpt::DisableLoopUnroll => String::from("--opt=disable-loop-unroll"),
OptimizationOpt::FastMaskedVload => String::from("--opt=fast-masked-vload"),
OptimizationOpt::FastMath => String::from("--opt=fast-math"),
OptimizationOpt::ForceAlignedMemory => String::from("--opt=force-aligned-memory"),
}
}
}
pub enum TargetISA {
Host,
SSE2i32x4,
SSE2i32x8,
SSE4i32x4,
SSE4i32x8,
SSE4i16x8,
SSE4i8x16,
AVX1i32x4,
AVX1i32x8,
AVX1i32x16,
AVX1i64x4,
AVX11i32x8,
AVX11i32x16,
AVX11i64x4,
AVX2i32x8,
AVX2i32x16,
AVX2i64x4,
AVX512KNLi32x16,
AVX512SKXi32x16,
AVX512SKXi32x8
}
impl TargetISA {
pub fn lib_suffix(&self) -> String {
match *self {
TargetISA::Host => String::from("host"),
TargetISA::SSE2i32x4 => String::from("sse2"),
TargetISA::SSE2i32x8 => String::from("sse2"),
TargetISA::SSE4i32x4 => String::from("sse4"),
TargetISA::SSE4i32x8 => String::from("sse4"),
TargetISA::SSE4i16x8 => String::from("sse4"),
TargetISA::SSE4i8x16 => String::from("sse4"),
TargetISA::AVX1i32x4 => String::from("avx"),
TargetISA::AVX1i32x8 => String::from("avx"),
TargetISA::AVX1i32x16 => String::from("avx"),
TargetISA::AVX1i64x4 => String::from("avx"),
TargetISA::AVX11i32x8 => String::from("avx11"),
TargetISA::AVX11i32x16 => String::from("avx11"),
TargetISA::AVX11i64x4 => String::from("avx11"),
TargetISA::AVX2i32x8 => String::from("avx2"),
TargetISA::AVX2i32x16 => String::from("avx2"),
TargetISA::AVX2i64x4 => String::from("avx2"),
TargetISA::AVX512KNLi32x16 => String::from("avx512knl"),
TargetISA::AVX512SKXi32x16 => String::from("avx512skx"),
TargetISA::AVX512SKXi32x8 => String::from("avx512skx"),
}
}
}
impl ToString for TargetISA {
fn to_string(&self) -> String {
match *self {
TargetISA::Host => String::from("host"),
TargetISA::SSE2i32x4 => String::from("sse2-i32x4"),
TargetISA::SSE2i32x8 => String::from("sse2-i32x8"),
TargetISA::SSE4i32x4 => String::from("sse4-i32x4"),
TargetISA::SSE4i32x8 => String::from("sse4-i32x8"),
TargetISA::SSE4i16x8 => String::from("sse4-i16x8"),
TargetISA::SSE4i8x16 => String::from("sse4-i8x16"),
TargetISA::AVX1i32x4 => String::from("avx1-i32x4"),
TargetISA::AVX1i32x8 => String::from("avx1-i32x8"),
TargetISA::AVX1i32x16 => String::from("avx1-i32x16"),
TargetISA::AVX1i64x4 => String::from("avx1-i64x4"),
TargetISA::AVX11i32x8 => String::from("avx1.1-i32x8"),
TargetISA::AVX11i32x16 => String::from("avx1.1-i32x16"),
TargetISA::AVX11i64x4 => String::from("avx1.1-i64x4"),
TargetISA::AVX2i32x8 => String::from("avx2-i32x8"),
TargetISA::AVX2i32x16 => String::from("avx2-i32x16"),
TargetISA::AVX2i64x4 => String::from("avx2-i64x4"),
TargetISA::AVX512KNLi32x16 => String::from("avx512knl-i32x16"),
TargetISA::AVX512SKXi32x16 => String::from("avx512skx-i32x16"),
TargetISA::AVX512SKXi32x8 => String::from("avx512skx-i32x8"),
}
}
}