[PATCH] D86438: [SDAG] Convert FSHL <--> FSHR if the target only supports one of them
    Bjorn Pettersson via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Aug 24 08:56:36 PDT 2020
    
    
  
bjope added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:6181
+      // First do a full double-word shift of { X : Y } by 1 and then:
+      // fshl X, Y, Z -> fshr X, Y, ~Z
+      // fshr X, Y, Z -> fshl X, Y, ~Z
----------------
I find these comments a bit confusing, as the full transform is
```
// fshl X, Y, Z -> fshr (srl X, 1), (fshr (X, Y, 1), ~Z
// fshr X, Y, Z -> fshl (fshl X, Y, 1), (shl (Y, 1), ~Z
```
I suggest that we either show the full transform like above, or for example add some primes to X and Y on the right hand side to show that it isn't the same X and Y as on the left hand side:
``` 
// fshl X, Y, Z -> fshr X', Y', ~Z
// fshr X, Y, Z -> fshl X', Y', ~Z
```
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86438/new/
https://reviews.llvm.org/D86438
    
    
More information about the llvm-commits
mailing list