[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-bugs
Subject:    [llvm-bugs] [Bug 56304] CodeGen X86: f16c implies all of AVX instead of just XSAVE
From:       LLVM Bugs via llvm-bugs <llvm-bugs () lists ! llvm ! org>
Date:       2022-06-30 12:32:38
Message-ID: 20220630123238.7d8369494da24b4f () email ! llvm ! org
[Download RAW message or body]

[Attachment #2 (text/html)]

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

    <tr>
        <th>Summary</th>
        <td>
            CodeGen X86: f16c implies all of AVX instead of just XSAVE
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:X86,
            llvm:codegen
      </td>
    </tr>

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

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

<pre>
    Alright - up top I am just going to say that when it comes to the codegen \
underbelly I am not sure I know exactly what I am doing, but we noticed something \
when porting a project from MSVC to Clang.

This project uses some F16C intrinsics, specifically `_mm_cvtph_ps`.

If we enable `-mf16c` in Clang that implies that all of AVX gets enabled as well. \
This can be seen in the code here: \
https://github.com/llvm/llvm-project/blob/main/llvm/lib/Support/X86TargetParser.cpp#L541 \
- which in our case is undesirable.

But reading around on internet it seems like it only requires `XSAVE` - which has \
it&apos;s own `FeatureXSAVE` flag. So I wonder if there is a reason to enable all of \
AVX in order to use F16C or if we could change it to `constexpr FeatureBitset \
ImpliedFeaturesF16C = FeatureXSAVE;`

I tried this change locally and the test-suite passes, and I could compile a small \
test program using `mm_cvtph_ps()` and see that AVX is not enabled, but since this is \
pretty far outside my expertise I want to make sure I understand that I understood it \
correctly. </pre>
<img width="1px" height="1px" alt="" \
src="http://email.email.llvm.org/o/eJyVVE1v4zgM_TXOhWiQyIknOfiQpttFgV1ggQ6K3grZpm1NZck \
rypPJv19SdjvNcYGiDvVBPj6-p8o31_J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________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic