Skip to content

fail to build _mm_cvtsd_si64 #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pythoneer opened this issue Sep 30, 2017 · 4 comments · Fixed by #116
Closed

fail to build _mm_cvtsd_si64 #83

pythoneer opened this issue Sep 30, 2017 · 4 comments · Fixed by #116

Comments

@pythoneer
Copy link
Contributor

pythoneer commented Sep 30, 2017

/// Convert the lower double-precision (64-bit) floating-point element in a to a 64-bit integer.
#[inline(always)]
#[target_feature = "+sse2"]
#[cfg_attr(test, assert_instr(cvtsd2si))]
pub unsafe fn _mm_cvtsd_si64(a: f64x2) -> i64 {
    cvtsd2si64(a)
}

....

    #[link_name = "llvm.x86.sse2.cvtsd2si64"]
    fn cvtsd2si64(a: f64x2) -> i64;

fails to build with

ExpandIntegerResult #0: t12: i64 = llvm.x86.sse2.cvtsd2si64 TargetConstant:i32<5716>, t10

Do not know how to expand the result of this operator!

UNREACHABLE executed at /checkout/src/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:1279!

error: Could not compile `stdsimd`.

https://travis-ci.org/rust-lang-nursery/stdsimd/jobs/281644652

EDIT:

looks like _mm_cvttsd_si64 is also failing

/// Convert the lower double-precision (64-bit) floating-point element in `a` to a 64-bit integer
/// with truncation.
#[inline(always)]
#[target_feature = "+sse2"]
#[cfg_attr(test, assert_instr(cvttsd2si))]
pub unsafe fn _mm_cvttsd_si64(a: f64x2) -> i64 {
    cvttsd2si64(a)
}
ExpandIntegerResult #0: t12: i64 = llvm.x86.sse2.cvttsd2si64 TargetConstant:i32<5724>, t10

Do not know how to expand the result of this operator!

UNREACHABLE executed at /checkout/src/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:1279!

error: Could not compile `stdsimd`.

https://travis-ci.org/rust-lang-nursery/stdsimd/jobs/281653879

@gwenn
Copy link
Contributor

gwenn commented Oct 1, 2017

In clang builtins-x86.c file, they are wrapped into a condition:

#ifdef USE_64
  tmp_LLi = __builtin_ia32_cvtsd2si64(tmp_V2d);
  tmp_LLi = __builtin_ia32_cvttsd2si64(tmp_V2d);
#endif

That would explain why only the i686 build fails...

@alexcrichton
Copy link
Member

I think these may just need to be excluded on i686? We had to do that for some other bit-related intrinsics as well

@pythoneer
Copy link
Contributor Author

thx @gwenn ... ok, is there something specific i should do for documenting this?

@alexcrichton
Copy link
Member

@pythoneer nah I think it's fine to just exclude it on i686

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants