[PATCH] D57641: [X86] Connect the default fpsr and dirflag clobbers in inline assembly to the registers we have defined for them.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 4 17:25:56 PST 2019
craig.topper updated this revision to Diff 185200.
craig.topper added a comment.
Fix stale comment
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57641/new/
https://reviews.llvm.org/D57641
Files:
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86RegisterInfo.td
test/CodeGen/X86/inline-asm-default-clobbers.ll
Index: test/CodeGen/X86/inline-asm-default-clobbers.ll
===================================================================
--- /dev/null
+++ test/CodeGen/X86/inline-asm-default-clobbers.ll
@@ -0,0 +1,8 @@
+; RUN: llc < %s -mtriple=i686 -stop-after=expand-isel-pseudos | FileCheck %s
+
+; CHECK: INLINEASM &"", 1, 12, implicit-def early-clobber $df, 12, implicit-def early-clobber $fpsw, 12, implicit-def early-clobber $eflags
+define void @foo() {
+entry:
+ call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
+ ret void
+}
Index: lib/Target/X86/X86RegisterInfo.td
===================================================================
--- lib/Target/X86/X86RegisterInfo.td
+++ lib/Target/X86/X86RegisterInfo.td
@@ -287,7 +287,7 @@
def ST7 : X86Reg<"st(7)", 7>, DwarfRegNum<[40, 19, 18]>;
// Floating-point status word
-def FPSW : X86Reg<"fpsw", 0>;
+def FPSW : X86Reg<"fpsr", 0>;
// Status flags register.
//
Index: lib/Target/X86/X86ISelLowering.cpp
===================================================================
--- lib/Target/X86/X86ISelLowering.cpp
+++ lib/Target/X86/X86ISelLowering.cpp
@@ -43006,6 +43006,14 @@
if (StringRef("{flags}").equals_lower(Constraint))
return std::make_pair(X86::EFLAGS, &X86::CCRRegClass);
+ // dirflag -> DF
+ if (StringRef("{dirflag}").equals_lower(Constraint))
+ return std::make_pair(X86::DF, &X86::DFCCRRegClass);
+
+ // fpsr -> FPSW
+ if (StringRef("{fpsr}").equals_lower(Constraint))
+ return std::make_pair(X86::FPSW, &X86::FPCCRRegClass);
+
// 'A' means [ER]AX + [ER]DX.
if (Constraint == "A") {
if (Subtarget.is64Bit())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57641.185200.patch
Type: text/x-patch
Size: 1638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190205/c3f25433/attachment.bin>
More information about the llvm-commits
mailing list