$OpenBSD: patch-lib_Target_X86_X86ISelLowering_cpp,v 1.6 2019/02/20 00:24:11 jca Exp $

Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
to fix a regression in floating point operations.

Index: lib/Target/X86/X86ISelLowering.cpp
--- lib/Target/X86/X86ISelLowering.cpp.orig
+++ lib/Target/X86/X86ISelLowering.cpp
@@ -40619,6 +40619,20 @@ X86TargetLowering::getRegForInlineAsmConstraint(const 
       return Res;
     }
 
+    // dirflag -> DF
+    if (StringRef("{dirflag}").equals_lower(Constraint)) {
+      Res.first = X86::DF;
+      Res.second = &X86::DFCCRRegClass;
+      return Res;
+    }
+
+    // fpsr -> FPSW
+    if (StringRef("{fpsr}").equals_lower(Constraint)) {
+      Res.first = X86::FPSW;
+      Res.second = &X86::FPCCRRegClass;
+      return Res;
+    }
+
     // 'A' means [ER]AX + [ER]DX.
     if (Constraint == "A") {
       if (Subtarget.is64Bit()) {
