[llvm] [X86] Support APX CMOV/CFCMOV instructions (PR #82592)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 21 22:44:13 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff ead0a9777f8ccb5c26d50d96bade6cd5b47f496b 07a230cc14aec1da0487b47027e80545a798b38e -- llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp llvm/lib/Target/X86/X86FastISel.cpp llvm/lib/Target/X86/X86InstrInfo.cpp llvm/lib/Target/X86/X86InstrInfo.h llvm/test/TableGen/x86-fold-tables.inc llvm/utils/TableGen/X86RecognizableInstr.cpp llvm/utils/TableGen/X86RecognizableInstr.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 9be1a1ac4b..48f00320bb 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -4001,7 +4001,8 @@ unsigned X86AsmParser::checkTargetMatchPredicate(MCInst &Inst) {
if (UseApxExtendedReg && !X86II::canUseApxExtendedReg(MCID))
return Match_Unsupported;
- if (ForcedNoFlag != !!(MCID.TSFlags & X86II::EVEX_NF) && !X86::isCFCMOVCC(Opc))
+ if (ForcedNoFlag != !!(MCID.TSFlags & X86II::EVEX_NF) &&
+ !X86::isCFCMOVCC(Opc))
return Match_Unsupported;
if (ForcedVEXEncoding == VEXEncoding_EVEX &&
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
index 394a902681..ed5509e128 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
@@ -1659,8 +1659,8 @@ void X86MCCodeEmitter::encodeInstruction(const MCInst &MI,
unsigned RegOp = CurOp++;
unsigned CC = MI.getOperand(CurOp++).getImm();
emitByte(BaseOpcode + CC, CB);
- emitMemModRMByte(MI, MemOp, getX86RegNum(MI.getOperand(RegOp)),
- TSFlags, Kind, StartByte, CB, Fixups, STI);
+ emitMemModRMByte(MI, MemOp, getX86RegNum(MI.getOperand(RegOp)), TSFlags,
+ Kind, StartByte, CB, Fixups, STI);
break;
}
case X86II::MRMSrcReg: {
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp
index 976ae3f227..3ac8821701 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -4051,8 +4051,9 @@ void X86InstrInfo::insertSelect(MachineBasicBlock &MBB,
const TargetRegisterInfo &TRI = *MRI.getTargetRegisterInfo();
const TargetRegisterClass &RC = *MRI.getRegClass(DstReg);
assert(Cond.size() == 1 && "Invalid Cond array");
- unsigned Opc = X86::getCMovOpcode(TRI.getRegSizeInBits(RC) / 8,
- false /*HasMemoryOperand*/, Subtarget.hasNDD());
+ unsigned Opc =
+ X86::getCMovOpcode(TRI.getRegSizeInBits(RC) / 8,
+ false /*HasMemoryOperand*/, Subtarget.hasNDD());
BuildMI(MBB, I, DL, get(Opc), DstReg)
.addReg(FalseReg)
.addReg(TrueReg)
``````````
</details>
https://github.com/llvm/llvm-project/pull/82592
More information about the llvm-commits
mailing list