[PATCH] D130638: [X86][MC] Avoid emitting incorrect warning for complex FMUL
Phoebe Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 27 20:21:25 PDT 2022
pengfei updated this revision to Diff 448228.
pengfei marked an inline comment as done.
pengfei added a comment.
Address Shengchen's comments. Thanks!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130638/new/
https://reviews.llvm.org/D130638
Files:
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/test/MC/X86/avx512fp16.s
Index: llvm/test/MC/X86/avx512fp16.s
===================================================================
--- llvm/test/MC/X86/avx512fp16.s
+++ llvm/test/MC/X86/avx512fp16.s
@@ -1,4 +1,7 @@
// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding < %s | FileCheck %s
+// RUN: llvm-mc -triple x86_64-unknown-unknown < %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-WARN
+
+// CHECK-NO-WARN-NOT: warning
// CHECK: vmovsh %xmm28, %xmm29, %xmm30
// CHECK: encoding: [0x62,0x05,0x16,0x00,0x10,0xf4]
Index: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
===================================================================
--- llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -3847,7 +3847,13 @@
} else if (isVFCMULCPH(Opcode) || isVFCMULCSH(Opcode) || isVFMULCPH(Opcode) ||
isVFMULCSH(Opcode)) {
unsigned Dest = Inst.getOperand(0).getReg();
- for (unsigned i = 1; i < Inst.getNumOperands(); i++)
+ // The mask variants have different operand list. Scan from the third
+ // operand to avoid emitting incorrect warning.
+ // VFMULCPHZrr Dest, Src1, Src2
+ // VFMULCPHZrrk Dest, Dest, Mask, Src1, Src2
+ // VFMULCPHZrrkz Dest, Mask, Src1, Src2
+ for (unsigned i = TSFlags & X86II::EVEX_K ? 2 : 1;
+ i < Inst.getNumOperands(); i++)
if (Inst.getOperand(i).isReg() && Dest == Inst.getOperand(i).getReg())
return Warning(Ops[0]->getStartLoc(), "Destination register should be "
"distinct from source registers");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130638.448228.patch
Type: text/x-patch
Size: 1589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220728/016627c1/attachment.bin>
More information about the llvm-commits
mailing list