3

x86 Clang has a bug that I reported back in 2013. It is confirmed, but they have never fixed it. What can I do to make them fix it?

The bug report is here: https://bugs.llvm.org/show_bug.cgi?id=17164

Description:

__m128  x;  // vector of four float
__m128i y;  // vector of four int
x = y;      // does not convert int to float but preserves the bits

The intrinsic vector types such as __m128, __m128i, __m128d are silently bit-cast to each other which gives weird results. All other compilers treat these vector types as different types. There is no option that makes Clang compatible with other compilers for intrinsic vector types.

This is a big problem for the Vector class library ( https://www.agner.org/optimize/#vectorclass ). I don't know what to do to make them fix this bug. Please help.

17
  • 1
    I see how that's problematic for overload resolution, but I don't see why it's surprising that x = y copies the bits unchanged if it's going to not error. That's less surprising than an implicit _mm_cvtepi32_ps. That would be super-weird, and be ambiguous for __m128d (should it convert 2x double to 2x int64? Or should it cvtpd2dq and leave 2 int32_t at the bottom of a vector?) Normally when I wish I could do x=y without cluttering my code with _mm_castsi128_ps, it's for using shufps or movhps on integer data, or pand on FP data, or similar. Commented Mar 28, 2019 at 7:52
  • 14
    "What can I do to make them fix it?" Submit a pull request? Post on their mailing list and/or contact developers you might know directly? While I see the problem, I'm not sure that this type of question is a good fit for StackOverflow, since we really can't answer it, only make suggestions. Commented Mar 28, 2019 at 7:56
  • 3
    We can only answer "how can I work around it". Commented Mar 28, 2019 at 8:08
  • 5
    If you want to fix the bug you either go ahead and do it (Clang is opensource) or pay someone to do it. That's a business matter, not suitable for SO. If you want to find a workaround, please state it explicitly. You can then use the configure/make machinery (e.g. autoconf, automake) to test for the bug and set/unset a preprocessor symbol accordingly (to select the right implementation). Commented Mar 28, 2019 at 9:52
  • 2
    Thanks for your answers. I am not asking for a workaround, I already have one though it is not very good. I am asking who to contact to make them fix the bug. I think it is a problem that Clang is different from all other compilers and different from the official Intel specifications. It is also a problem that they are not fixing a confirmed bug. Commented Mar 29, 2019 at 14:21

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.