[PATCH] D42042: [X86][SSE] Add custom execution domain fixing for BLENDPD/BLENDPS/PBLENDD/PBLENDW (PR34873)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 14 11:13:59 PST 2018


craig.topper added inline comments.


================
Comment at: lib/Target/X86/X86InstrInfo.cpp:10083
+    if (MI.getOperand(NumOperands - 1).isImm()) {
+      assert((!Repeat || ImmWidth == 16) && "Illegal VPBLENDWY mask");
+      unsigned Imm = MI.getOperand(NumOperands - 1).getImm();
----------------
Could we just detect ImmWidth == 16 instead of having a Repeat flag?


================
Comment at: lib/Target/X86/X86InstrInfo.cpp:10085
+      unsigned Imm = MI.getOperand(NumOperands - 1).getImm();
+      Imm = (Repeat ? ((Imm & 255) << 8) | (Imm & 255) : Imm);
+      unsigned NewImm = Imm;
----------------
Can we mask the immediate to 8-bits on the previous line so we don't need two ands on this line?


================
Comment at: lib/Target/X86/X86InstrInfo.cpp:10101
+          else {
+            AdjustBlendMask(Imm, ImmWidth, Is256 ? 16 : 8, &NewImm);
+            assert((!Is256 || ((NewImm >> 8) & 255) == (NewImm & 255)) &&
----------------
Does this branch only happen when the starting instruction was a BLENDW? And that means that the table is pointing at ReplaceableCustomInstrs not ReplaceableCustomAVX2Instrs?


Repository:
  rL LLVM

https://reviews.llvm.org/D42042





More information about the llvm-commits mailing list