Files
aho_corasick
ansi_term
atty
backtrace
backtrace_sys
bitflags
blindbid
block_buffer
block_padding
bulletproofs
byte_tools
byteorder
cfg_if
chrono
clap
clear_on_drop
curve25519_dalek
digest
dusk_blindbidproof
dusk_tlv
dusk_uds
env_logger
failure
failure_derive
fake_simd
futures
futures_channel
futures_core
futures_executor
futures_io
futures_macro
futures_sink
futures_task
futures_util
async_await
future
io
lock
sink
stream
task
generic_array
humantime
keccak
lazy_static
libc
log
memchr
merlin
num_cpus
num_integer
num_traits
opaque_debug
packed_simd
pin_utils
proc_macro2
proc_macro_hack
proc_macro_nested
quick_error
quote
rand
rand_chacha
rand_core
rand_hc
rand_isaac
rand_jitter
rand_os
rand_pcg
rand_xorshift
regex
regex_syntax
rustc_demangle
serde
serde_derive
sha2
sha3
slab
strsim
subtle
syn
synstructure
termcolor
textwrap
thread_local
time
typenum
unicode_width
unicode_xid
vec_map
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! Approximation for floating-point `mul_add`
use crate::*;

// FIXME: 64-bit 1 element mul_adde

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

#[cfg(not(target_arch = "s390x"))]
#[allow(improper_ctypes)]
extern "C" {
    #[link_name = "llvm.fmuladd.v2f32"]
    fn fmuladd_v2f32(x: f32x2, y: f32x2, z: f32x2) -> f32x2;
    #[link_name = "llvm.fmuladd.v4f32"]
    fn fmuladd_v4f32(x: f32x4, y: f32x4, z: f32x4) -> f32x4;
    #[link_name = "llvm.fmuladd.v8f32"]
    fn fmuladd_v8f32(x: f32x8, y: f32x8, z: f32x8) -> f32x8;
    #[link_name = "llvm.fmuladd.v16f32"]
    fn fmuladd_v16f32(x: f32x16, y: f32x16, z: f32x16) -> f32x16;
    /* FIXME 64-bit single elem vectors
    #[link_name = "llvm.fmuladd.v1f64"]
    fn fmuladd_v1f64(x: f64x1, y: f64x1, z: f64x1) -> f64x1;
    */
    #[link_name = "llvm.fmuladd.v2f64"]
    fn fmuladd_v2f64(x: f64x2, y: f64x2, z: f64x2) -> f64x2;
    #[link_name = "llvm.fmuladd.v4f64"]
    fn fmuladd_v4f64(x: f64x4, y: f64x4, z: f64x4) -> f64x4;
    #[link_name = "llvm.fmuladd.v8f64"]
    fn fmuladd_v8f64(x: f64x8, y: f64x8, z: f64x8) -> f64x8;
}

macro_rules! impl_mul_adde {
    ($id:ident : $fn:ident) => {
        impl MulAddE for $id {
            #[inline]
            fn mul_adde(self, y: Self, z: Self) -> Self {
                #[cfg(not(target_arch = "s390x"))]
                {
                    use crate::mem::transmute;
                    unsafe {
                        transmute($fn(
                            transmute(self),
                            transmute(y),
                            transmute(z),
                        ))
                    }
                }
                #[cfg(target_arch = "s390x")]
                {
                    // FIXME: https://github.com/rust-lang-nursery/packed_simd/issues/14
                    self * y + z
                }
            }
        }
    };
}

impl_mul_adde!(f32x2: fmuladd_v2f32);
impl_mul_adde!(f32x4: fmuladd_v4f32);
impl_mul_adde!(f32x8: fmuladd_v8f32);
impl_mul_adde!(f32x16: fmuladd_v16f32);
// impl_mul_adde!(f64x1: fma_v1f64); // FIXME 64-bit fmagle elem vectors
impl_mul_adde!(f64x2: fmuladd_v2f64);
impl_mul_adde!(f64x4: fmuladd_v4f64);
impl_mul_adde!(f64x8: fmuladd_v8f64);