<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58087>58087</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Compile error with FP16 literal suffix and immintrin.h when OpenMP offload is enabled
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          markdewing
      </td>
    </tr>
</table>

<pre>
    There are two issues here
1. When OpenMP offload is enabled, the f16 literal suffix is disabled, even in host code.
2. The "immintrin.h" include file contains code with the `f16` suffix, which is now exposed when compiling with openmp offload flags, causing compile failures.  This error occurs in main, but not LLVM 15.

I'm not actually trying to use f16 types, but the second issue blocks code from compiling that uses immintrin.h.

Reproducer for 1:

The use of the `f16` suffix will cause a compile error when GPU offload targets are given.

```
int main()
{
    __fp16 a = -1.0f16;
    return 0;
}
```
will generate a compile error when a GPU offload target is specified.
Compile line: `clang++ -fopenmp -fopenmp-targets=nvptx64 test_f16.cpp`

```
test_f16.cpp:4:20: error: invalid suffix 'f16' on floating constant
    __fp16 a = -1.0f16;
```

It will compile without error if the -fopenmp-targets flag is removed.

Reproducer for 2:

The file
```
#include <immintrin.h>
```
when compiled with `-fopenmp -fopenmp-targets=nvptx64` flags, the following errors will be produced:
```
In file included from other.cpp:2:
In file included from /mnt/nvme/software/llvm/git/usr/lib/clang/16.0.0/include/immintrin.h:219:
/mnt/nvme/software/llvm/git/usr/lib/clang/16.0.0/include/avx512fp16intrin.h:3276:47: error: invalid suffix 'f16' on floating constant
  return __builtin_ia32_reduce_fadd_ph512(-0.0f16, __W);
                                              ^
/mnt/nvme/software/llvm/git/usr/lib/clang/16.0.0/include/avx512fp16intrin.h:3281:46: error: invalid suffix 'f16' on floating constant
  return __builtin_ia32_reduce_fmul_ph512(1.0f16, __W);
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org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