[PATCH] D109295: [X86] Handle inverted inputs when matching VPTERNLOG from 2 binary ops.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 6 11:34:11 PDT 2021


craig.topper added a comment.

In D109295#2985534 <https://reviews.llvm.org/D109295#2985534>, @xbolva00 wrote:

> Also some more cases for ternlog
>
>   __m512i notBorC(__m512i B, __m512i C) {
>       return ~(B|C); // 0x11 
>   }
>   
>   __m512i notBandC(__m512i B, __m512i C) {
>       return ~(B&C); // 0x77
>   }
>   
>   __m512i notBxorC(__m512i B, __m512i C) {
>       return ~(B^C); // 0x99
>   }

We should be a little careful there. As far as I know, vpternlog doesn't break dependencies on inputs that aren't used by the immediate. So we should try to use one of the other registers twice to prevent false dependencies. If we can fold a load, we need to make sure we don't duplicate that register and prevent the folding.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109295/new/

https://reviews.llvm.org/D109295



More information about the llvm-commits mailing list