rust-lang / packed_simd

Portable Packed SIMD Vectors for Rust standard library
https://rust-lang.github.io/packed_simd/packed_simd_2/
Apache License 2.0
600 stars 74 forks source link

core_arch feature breaks into_bits #230

Open TheIronBorn opened 5 years ago

TheIronBorn commented 5 years ago

with features = ["into_bits", "core_arch"] and code like this:

use packed_simd::*;
use std::arch::x86_64::*;

pub fn foo(x: __m128d) -> f64x2 {
    f64x2::from_bits(x)
}

rust gives:

error[E0277]: the trait bound `packed_simd::Simd<[f64; 2]>: packed_simd::api::into_bits::FromBits<std::arch::x86_64::__m128d>` is not satisfied
 --> src\lib.rs:5:5
  |
5 |     f64x2::from_bits(x)
  |     ^^^^^^^^^^^^^^^^ the trait `packed_simd::api::into_bits::FromBits<std::arch::x86_64::__m128d>` is not implemented for `packed_simd::Simd<[f64; 2]>`
  |
  = help: the following implementations were found:
            <packed_simd::Simd<[f32; 16]> as packed_simd::api::into_bits::FromBits<packed_simd::Simd<[f64; 8]>>>
            <packed_simd::Simd<[f32; 16]> as packed_simd::api::into_bits::FromBits<packed_simd::Simd<[i128; 4]>>>
            <packed_simd::Simd<[f32; 16]> as packed_simd::api::into_bits::FromBits<packed_simd::Simd<[i16; 32]>>>
            <packed_simd::Simd<[f32; 16]> as packed_simd::api::into_bits::FromBits<packed_simd::Simd<[i32; 16]>>>
          and 772 others
  = note: required by `packed_simd::api::into_bits::FromBits::from_bits`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.

features = ["into_bits"] compiles fine.

gnzlbg commented 5 years ago

Now that's weird. I'm going to ask the infra team for more CI time (cc @pietroalbini ) - we stopped testing these configurations because we are constantly hitting the 50 min limit but now that we are completing support for floating-point math we are hitting the 50 min limit again on tier 1 targets (macosx) so we need to find another solution.

pietroalbini commented 5 years ago

The macOS slowdown is almost surely because you got moved out of the dedicated macs onto the public pool, which probably has noisy neighbors. I don't see that much of a problem to ask for a timeout increase, @rust-lang-nursery/infra?

gnzlbg commented 5 years ago

@TheIronBorn so CI has been bumped to 90 minutes now, i think that should allow us to test for that combination.

gnzlbg commented 5 years ago

I think the problem is that when you pick core_arch, the into_bits traits are only implemented from the types in core_arch::.. and not for the types in core::arch::*. I'd guess the fix here is for these traits to only be implemented for the core::arch::* types, but I don't know how straight forward that will be.