Issue 184651
Summary Miscompilation of `cvthf8_ps` intrinsics
Labels new issue
Assignees
Reporter sayantn
    AVX10.2 intrinsics such as `llvm.x86.avx10.vcvthf82ph128` miscompile with optimizations on. Their intended purpose is lanewise conversion from HF8 (E4M3) floats to half-precision IEEE floats.

`experiment.c`
```C
#include<immintrin.h>
#include<stdio.h>

void main() {
    __m128i a = _mm_set1_epi8(0x38); // 1.0 in HF8

    __m128h r = _mm_cvthf8_ph(a);

    _Float16 array[8];
    _mm_storeu_ph(array, r);

    for (int i = 0; i < 8; ++i) {
        printf("%f\n", (float) array[i]);
    }
}
```

<img width="791" height="613" alt="Image" src="" />

`clang --version`
```
ClangBuiltLinux clang version 22.1.0 (https://github.com/llvm/llvm-project.git 4434dabb69916856b824f68a64b029c67175e532)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/schak/Documents/llvm-22.1.0-x86_64/bin
```
`gcc --version`
```
gcc (GCC) 15.2.1 20260209
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
`sde64 --version`
```
Intel(R) Software Development Emulator.  Version:  10.5.0 external (0)
Copyright (C) 2008-2026, Intel Corporation. All rights reserved.
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to