[compiler-rt] [compiler-rt][nsan] Add support for nan detection (PR #101531)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 03:53:17 PDT 2024


cseslowpoke wrote:

I tried a simple example, but when I use -mavx and Clang vector extension to generate SIMD instructions along with nsan, a segmentation fault occurs.
```cpp
#include <iostream>
#include <cmath>

typedef float v8sf __attribute__ ((vector_size(32)));


v8sf simd_sqrt(v8sf a) {
  return __builtin_elementwise_sqrt(a);
}

int main() {
  v8sf a = {1.0, -2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  a = simd_sqrt(a);
  return 0;
}
```

https://github.com/llvm/llvm-project/pull/101531


More information about the llvm-commits mailing list