[clang] [llvm] [X86][APX] Emit SetZUCC instead of legacy setcc when ZU is enabled (PR #173965)

Feng Zou via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 30 00:13:48 PST 2025


https://github.com/fzou1 created https://github.com/llvm/llvm-project/pull/173965

To avoid false dependency.

>From b69f0f649e70ea7199842eb9ed994f9bd6d73f4d Mon Sep 17 00:00:00 2001
From: Feng Zou <feng.zou at intel.com>
Date: Tue, 30 Dec 2025 10:49:33 +0800
Subject: [PATCH] [X86][APX] Emit SetZUCC instead of legacy setcc when ZU is
 enabled

To avoid false dependency.
---
 clang/lib/Driver/ToolChains/Arch/X86.cpp      |    8 +
 clang/test/Driver/cl-x86-flags.c              |    7 +-
 clang/test/Driver/x86-target-features.c       |    8 +-
 llvm/lib/Target/X86/X86.td                    |    3 +
 llvm/lib/Target/X86/X86FastISel.cpp           |   31 +-
 llvm/lib/Target/X86/X86FixupSetCC.cpp         |   10 +-
 llvm/lib/Target/X86/X86FlagsCopyLowering.cpp  |   28 +-
 llvm/lib/Target/X86/X86InstrCMovSetCC.td      |   12 +-
 llvm/lib/Target/X86/X86InstrPredicates.td     |    2 +
 llvm/test/CodeGen/X86/apx/ccmp.ll             |  516 +++++++
 llvm/test/CodeGen/X86/apx/ctest.ll            |  443 ++++++
 llvm/test/CodeGen/X86/apx/setzucc.ll          |   70 +-
 llvm/test/CodeGen/X86/fast-isel-fcmp.ll       |  764 +++++++++++
 .../CodeGen/X86/fast-isel-select-cmov2.ll     |  370 +++++
 llvm/test/CodeGen/X86/pr27591.ll              |   49 +
 llvm/test/CodeGen/X86/pr32284.ll              |  369 +++++
 llvm/test/CodeGen/X86/pr54369.ll              |   46 +
 llvm/test/CodeGen/X86/scmp.ll                 | 1214 +++++++++++++++++
 18 files changed, 3879 insertions(+), 71 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Arch/X86.cpp b/clang/lib/Driver/ToolChains/Arch/X86.cpp
index d6e6657c521f0..b144f4b040b4b 100644
--- a/clang/lib/Driver/ToolChains/Arch/X86.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/X86.cpp
@@ -269,6 +269,14 @@ void x86::getX86TargetFeatures(const Driver &D, const llvm::Triple &Triple,
 
         Features.push_back(
             Args.MakeArgString((IsNegative ? "-" : "+") + Value));
+
+        // Implicitly add prefer-setzucc feature when ZU feature is enabled. The
+        // prefer-setzucc feature enables exclusively emitting SetZUCC
+        // instruction and never emitting the legacy SETCC instruction.
+        // The latter is susceptible to false dependences.
+        if (Value == "zu")
+          Features.push_back(Args.MakeArgString((IsNegative ? "-" : "+") +
+                                                Twine("prefer-setzucc")));
       }
       continue;
     }
diff --git a/clang/test/Driver/cl-x86-flags.c b/clang/test/Driver/cl-x86-flags.c
index 84270aae35f7a..6ce9133d6f9f5 100644
--- a/clang/test/Driver/cl-x86-flags.c
+++ b/clang/test/Driver/cl-x86-flags.c
@@ -222,6 +222,7 @@ void f(void) {
 // RUN: %clang_cl --target=x86_64-pc-windows -mapxf -### -- 2>&1 %s | FileCheck -check-prefix=APXF %s
 // RUN: %clang_cl --target=x86_64-pc-windows -mapxf -mno-apxf -### -- 2>&1 %s | FileCheck -check-prefix=NO-APXF %s
 // RUN: %clang_cl --target=x86_64-pc-windows -mapx-features=egpr,push2pop2,ppx,ndd,ccmp,nf,cf,zu -### -- 2>&1 %s | FileCheck -check-prefix=APXALL %s
-// APXF: "-target-feature" "+egpr" "-target-feature" "+push2pop2" "-target-feature" "+ppx" "-target-feature" "+ndd" "-target-feature" "+ccmp" "-target-feature" "+nf" "-target-feature" "+zu"
-// NO-APXF: "-target-feature" "-egpr" "-target-feature" "-push2pop2" "-target-feature" "-ppx" "-target-feature" "-ndd" "-target-feature" "-ccmp" "-target-feature" "-nf" "-target-feature" "-zu"
-// APXALL: "-target-feature" "+egpr" "-target-feature" "+push2pop2" "-target-feature" "+ppx" "-target-feature" "+ndd" "-target-feature" "+ccmp" "-target-feature" "+nf" "-target-feature" "+cf" "-target-feature" "+zu"
+// The prefer-setzucc feature is added/disabled implicitly when ZU feature is enabled/disabled by -mapxf/-mno-apxf option.
+// APXF: "-target-feature" "+egpr" "-target-feature" "+push2pop2" "-target-feature" "+ppx" "-target-feature" "+ndd" "-target-feature" "+ccmp" "-target-feature" "+nf" "-target-feature" "+zu" "-target-feature" "+prefer-setzucc"
+// NO-APXF: "-target-feature" "-egpr" "-target-feature" "-push2pop2" "-target-feature" "-ppx" "-target-feature" "-ndd" "-target-feature" "-ccmp" "-target-feature" "-nf" "-target-feature" "-zu" "-target-feature" "-prefer-setzucc"
+// APXALL: "-target-feature" "+egpr" "-target-feature" "+push2pop2" "-target-feature" "+ppx" "-target-feature" "+ndd" "-target-feature" "+ccmp" "-target-feature" "+nf" "-target-feature" "+cf" "-target-feature" "+zu" "-target-feature" "+prefer-setzucc"
diff --git a/clang/test/Driver/x86-target-features.c b/clang/test/Driver/x86-target-features.c
index f1660b1afb518..cfc848ce72b1e 100644
--- a/clang/test/Driver/x86-target-features.c
+++ b/clang/test/Driver/x86-target-features.c
@@ -443,8 +443,9 @@
 // RUN: %clang --target=x86_64-unknown-linux-gnu -mno-apxf -mapxf %s -### -o %t.o 2>&1 | FileCheck -check-prefix=APXF %s
 // RUN: %clang --target=x86_64-unknown-linux-gnu -mapxf -mno-apxf %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-APXF %s
 //
-// APXF: "-target-feature" "+egpr" "-target-feature" "+push2pop2" "-target-feature" "+ppx" "-target-feature" "+ndd" "-target-feature" "+ccmp" "-target-feature" "+nf" "-target-feature" "+zu"
-// NO-APXF: "-target-feature" "-egpr" "-target-feature" "-push2pop2" "-target-feature" "-ppx" "-target-feature" "-ndd" "-target-feature" "-ccmp" "-target-feature" "-nf" "-target-feature" "-zu"
+// The prefer-setzucc feature is added/disabled implicitly when ZU feature is enabled/disabled by -mapxf/-mno-apxf option.
+// APXF: "-target-feature" "+egpr" "-target-feature" "+push2pop2" "-target-feature" "+ppx" "-target-feature" "+ndd" "-target-feature" "+ccmp" "-target-feature" "+nf" "-target-feature" "+zu" "-target-feature" "+prefer-setzucc"
+// NO-APXF: "-target-feature" "-egpr" "-target-feature" "-push2pop2" "-target-feature" "-ppx" "-target-feature" "-ndd" "-target-feature" "-ccmp" "-target-feature" "-nf" "-target-feature" "-zu" "-target-feature" "-prefer-setzucc"
 
 // RUN: %clang --target=x86_64-unknown-linux-gnu -mapx-features=egpr %s -### -o %t.o 2>&1 | FileCheck -check-prefix=EGPR %s
 // RUN: %clang --target=x86_64-unknown-linux-gnu -mapx-features=push2pop2 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=PUSH2POP2 %s
@@ -461,7 +462,8 @@
 // CCMP: "-target-feature" "+ccmp"
 // NF: "-target-feature" "+nf"
 // CF: "-target-feature" "+cf"
-// ZU: "-target-feature" "+zu"
+// The prefer-setzucc feature is added implicitly when ZU feature is enabled.
+// ZU: "-target-feature" "+zu" "-target-feature" "+prefer-setzucc"
 
 // RUN: %clang --target=x86_64-unknown-linux-gnu -mapx-features=egpr,ndd %s -### -o %t.o 2>&1 | FileCheck -check-prefix=EGPR-NDD %s
 // RUN: %clang --target=x86_64-unknown-linux-gnu -mapx-features=egpr -mapx-features=ndd %s -### -o %t.o 2>&1 | FileCheck -check-prefix=EGPR-NDD %s
diff --git a/llvm/lib/Target/X86/X86.td b/llvm/lib/Target/X86/X86.td
index 3e357c9000bea..d41a91f4d94d4 100644
--- a/llvm/lib/Target/X86/X86.td
+++ b/llvm/lib/Target/X86/X86.td
@@ -364,6 +364,9 @@ def FeatureCF : SubtargetFeature<"cf", "HasCF", "true",
                                  "Support conditional faulting">;
 def FeatureZU : SubtargetFeature<"zu", "HasZU", "true",
                                  "Support zero-upper SETcc/IMUL">;
+def FeaturePreferSetZUCC
+    : SubtargetFeature<"prefer-setzucc", "PreferSetZUCC", "true",
+                       "Prefer to emit SetZUCC instead of legacy SetCC.">;
 def FeatureUseGPR32InInlineAsm
     : SubtargetFeature<"inline-asm-use-gpr32", "UseInlineAsmGPR32", "true",
                        "Enable use of GPR32 in inline assembly for APX">;
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp
index f007886115d35..d2ed027bd215e 100644
--- a/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/llvm/lib/Target/X86/X86FastISel.cpp
@@ -1434,6 +1434,8 @@ bool X86FastISel::X86FastEmitCompare(const Value *Op0, const Value *Op1, EVT VT,
   return true;
 }
 
+#define GET_SETCC (Subtarget->preferSetZUCC() ? X86::SETZUCCr : X86::SETCCr)
+
 bool X86FastISel::X86SelectCmp(const Instruction *I) {
   const CmpInst *CI = cast<CmpInst>(I);
 
@@ -1503,10 +1505,12 @@ bool X86FastISel::X86SelectCmp(const Instruction *I) {
 
     Register FlagReg1 = createResultReg(&X86::GR8RegClass);
     Register FlagReg2 = createResultReg(&X86::GR8RegClass);
-    BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(X86::SETCCr),
-            FlagReg1).addImm(SETFOpc[0]);
-    BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(X86::SETCCr),
-            FlagReg2).addImm(SETFOpc[1]);
+    BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(GET_SETCC),
+            FlagReg1)
+        .addImm(SETFOpc[0]);
+    BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(GET_SETCC),
+            FlagReg2)
+        .addImm(SETFOpc[1]);
     BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(SETFOpc[2]),
             ResultReg).addReg(FlagReg1).addReg(FlagReg2);
     updateValueMap(I, ResultReg);
@@ -1525,8 +1529,8 @@ bool X86FastISel::X86SelectCmp(const Instruction *I) {
   if (!X86FastEmitCompare(LHS, RHS, VT, I->getDebugLoc()))
     return false;
 
-  BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(X86::SETCCr),
-          ResultReg).addImm(CC);
+  BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(GET_SETCC), ResultReg)
+      .addImm(CC);
   updateValueMap(I, ResultReg);
   return true;
 }
@@ -2083,10 +2087,12 @@ bool X86FastISel::X86FastEmitCMoveSelect(MVT RetVT, const Instruction *I) {
     if (SETFOpc) {
       Register FlagReg1 = createResultReg(&X86::GR8RegClass);
       Register FlagReg2 = createResultReg(&X86::GR8RegClass);
-      BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(X86::SETCCr),
-              FlagReg1).addImm(SETFOpc[0]);
-      BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(X86::SETCCr),
-              FlagReg2).addImm(SETFOpc[1]);
+      BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(GET_SETCC),
+              FlagReg1)
+          .addImm(SETFOpc[0]);
+      BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(GET_SETCC),
+              FlagReg2)
+          .addImm(SETFOpc[1]);
       auto const &II = TII.get(SETFOpc[2]);
       if (II.getNumDefs()) {
         Register TmpReg = createResultReg(&X86::GR8RegClass);
@@ -2989,8 +2995,9 @@ bool X86FastISel::fastLowerIntrinsicCall(const IntrinsicInst *II) {
     // Assign to a GPR since the overflow return value is lowered to a SETcc.
     Register ResultReg2 = createResultReg(&X86::GR8RegClass);
     assert((ResultReg+1) == ResultReg2 && "Nonconsecutive result registers.");
-    BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(X86::SETCCr),
-            ResultReg2).addImm(CondCode);
+    BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(GET_SETCC),
+            ResultReg2)
+        .addImm(CondCode);
 
     updateValueMap(II, ResultReg, 2);
     return true;
diff --git a/llvm/lib/Target/X86/X86FixupSetCC.cpp b/llvm/lib/Target/X86/X86FixupSetCC.cpp
index ea93a575ec530..157d82bfd3ced 100644
--- a/llvm/lib/Target/X86/X86FixupSetCC.cpp
+++ b/llvm/lib/Target/X86/X86FixupSetCC.cpp
@@ -79,10 +79,10 @@ bool X86FixupSetCCPass::runOnMachineFunction(MachineFunction &MF) {
       if (MI.definesRegister(X86::EFLAGS, /*TRI=*/nullptr))
         FlagsDefMI = &MI;
 
-      // Find a setcc that is used by a zext.
+      // Find a setcc/setzucc (if ZU is enabled) that is used by a zext.
       // This doesn't have to be the only use, the transformation is safe
       // regardless.
-      if (MI.getOpcode() != X86::SETCCr)
+      if (MI.getOpcode() != X86::SETCCr && MI.getOpcode() != X86::SETZUCCr)
         continue;
 
       MachineInstr *ZExt = nullptr;
@@ -122,7 +122,11 @@ bool X86FixupSetCCPass::runOnMachineFunction(MachineFunction &MF) {
       // register.
       Register ZeroReg = MRI->createVirtualRegister(RC);
       if (ST->hasZU()) {
-        MI.setDesc(TII->get(X86::SETZUCCr));
+        if (ST->preferSetZUCC())
+          assert((MI.getOpcode() == X86::SETZUCCr) &&
+                 "Expect setzucc instruction!");
+        else
+          MI.setDesc(TII->get(X86::SETZUCCr));
         BuildMI(*ZExt->getParent(), ZExt, ZExt->getDebugLoc(),
                 TII->get(TargetOpcode::IMPLICIT_DEF), ZeroReg);
       } else {
diff --git a/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp b/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp
index b3bf37a9a462c..17228eb231f61 100644
--- a/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp
+++ b/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp
@@ -745,7 +745,10 @@ Register X86FlagsCopyLoweringPass::promoteCondToReg(
     MachineBasicBlock &TestMBB, MachineBasicBlock::iterator TestPos,
     const DebugLoc &TestLoc, X86::CondCode Cond) {
   Register Reg = MRI->createVirtualRegister(PromoteRC);
-  auto SetI = BuildMI(TestMBB, TestPos, TestLoc, TII->get(X86::SETCCr), Reg)
+  auto SetI = BuildMI(TestMBB, TestPos, TestLoc,
+                      TII->get(Subtarget->preferSetZUCC() ? X86::SETZUCCr
+                                                          : X86::SETCCr),
+                      Reg)
                   .addImm(Cond);
   (void)SetI;
   LLVM_DEBUG(dbgs() << "    save cond: "; SetI->dump());
@@ -790,29 +793,6 @@ void X86FlagsCopyLoweringPass::rewriteSetCC(MachineBasicBlock &MBB,
   if (!CondReg)
     CondReg = promoteCondToReg(MBB, Pos, Loc, Cond);
 
-  if (X86::isSETZUCC(MI.getOpcode())) {
-    // SETZUCC is generated for register only for now.
-    assert(!MI.mayStore() && "Cannot handle memory variants");
-    assert(MI.getOperand(0).isReg() &&
-           "Cannot have a non-register defined operand to SETZUcc!");
-    Register OldReg = MI.getOperand(0).getReg();
-    // Drop Kill flags on the old register before replacing. CondReg may have
-    // a longer live range.
-    MRI->clearKillFlags(OldReg);
-    for (auto &Use : MRI->use_instructions(OldReg)) {
-      assert(Use.getOpcode() == X86::INSERT_SUBREG &&
-             "SETZUCC should be only used by INSERT_SUBREG");
-      Use.getOperand(2).setReg(CondReg);
-      // Recover MOV32r0 before INSERT_SUBREG, which removed by SETZUCC.
-      Register ZeroReg = MRI->createVirtualRegister(&X86::GR32RegClass);
-      BuildMI(*Use.getParent(), &Use, Use.getDebugLoc(), TII->get(X86::MOV32r0),
-              ZeroReg);
-      Use.getOperand(1).setReg(ZeroReg);
-    }
-    MI.eraseFromParent();
-    return;
-  }
-
   // Rewriting a register def is trivial: we just replace the register and
   // remove the setcc.
   if (!MI.mayStore()) {
diff --git a/llvm/lib/Target/X86/X86InstrCMovSetCC.td b/llvm/lib/Target/X86/X86InstrCMovSetCC.td
index 0b9172c1f2b6e..52cd7c4fe3a76 100644
--- a/llvm/lib/Target/X86/X86InstrCMovSetCC.td
+++ b/llvm/lib/Target/X86/X86InstrCMovSetCC.td
@@ -137,11 +137,13 @@ let Predicates = [HasCMOV, HasCF] in {
 }
 
 // SetCC instructions.
-let Uses = [EFLAGS], isCodeGenOnly = 1, ForceDisassemble = 1 in {
+let Uses = [EFLAGS], isCodeGenOnly = 1, ForceDisassemble = 1, Predicates = [PreferNoSetZUCC] in {
   def SETCCr : I<0x90, MRMXrCC, (outs GR8:$dst), (ins ccode:$cond),
                 "set${cond}\t$dst",
                 [(set GR8:$dst, (X86setcc timm:$cond, EFLAGS))]>,
                 TB, Sched<[WriteSETCC]>;
+}
+let Uses = [EFLAGS], isCodeGenOnly = 1, ForceDisassemble = 1 in {
   def SETCCm : I<0x90, MRMXmCC, (outs), (ins i8mem:$dst, ccode:$cond),
                 "set${cond}\t$dst",
                 [(store (X86setcc timm:$cond, EFLAGS), addr:$dst)]>,
@@ -150,10 +152,14 @@ let Uses = [EFLAGS], isCodeGenOnly = 1, ForceDisassemble = 1 in {
 
 // SetZUCC and promoted SetCC instructions.
 let Uses = [EFLAGS], isCodeGenOnly = 1, ForceDisassemble = 1,
-  hasSideEffects = 0, Predicates = [In64BitMode] in {
+  hasSideEffects = 0, Predicates = [In64BitMode], Predicates = [PreferSetZUCC] in {
   def SETZUCCr : I<0x40, MRMXrCC, (outs GR8:$dst), (ins ccode:$cond),
-                "setzu${cond}\t$dst", []>,
+                "setzu${cond}\t$dst",
+                [(set GR8:$dst, (X86setcc timm:$cond, EFLAGS))]>,
                 XD, ZU, NoCD8, Sched<[WriteSETCC]>;
+}
+let Uses = [EFLAGS], isCodeGenOnly = 1, ForceDisassemble = 1,
+  hasSideEffects = 0, Predicates = [In64BitMode] in {
   def SETCCr_EVEX : I<0x40, MRMXrCC, (outs GR8:$dst), (ins ccode:$cond),
                 "set${cond}\t$dst", []>,
                 XD, PL, Sched<[WriteSETCC]>;
diff --git a/llvm/lib/Target/X86/X86InstrPredicates.td b/llvm/lib/Target/X86/X86InstrPredicates.td
index 98104a6fad1a9..56a0811e1ce10 100644
--- a/llvm/lib/Target/X86/X86InstrPredicates.td
+++ b/llvm/lib/Target/X86/X86InstrPredicates.td
@@ -46,6 +46,8 @@ def NoEGPR       : Predicate<"!Subtarget->hasEGPR()">;
 def HasNDD       : Predicate<"Subtarget->hasNDD()">;
 def NoNDD        : Predicate<"!Subtarget->hasNDD()">;
 def HasZU        : Predicate<"Subtarget->hasZU()">;
+def PreferSetZUCC : Predicate<"Subtarget->preferSetZUCC()">;
+def PreferNoSetZUCC : Predicate<"!Subtarget->preferSetZUCC()">;
 def HasCF        : Predicate<"Subtarget->hasCF()">;
 def HasCMOV      : Predicate<"Subtarget->canUseCMOV()">;
 def NoCMOV       : Predicate<"!Subtarget->canUseCMOV()">;
diff --git a/llvm/test/CodeGen/X86/apx/ccmp.ll b/llvm/test/CodeGen/X86/apx/ccmp.ll
index 4c58c8a980314..eb7090597b099 100644
--- a/llvm/test/CodeGen/X86/apx/ccmp.ll
+++ b/llvm/test/CodeGen/X86/apx/ccmp.ll
@@ -1,6 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ccmp -show-mc-encoding -verify-machineinstrs | FileCheck %s
 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ccmp,+ndd -show-mc-encoding -verify-machineinstrs | FileCheck %s --check-prefix=NDD
+; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+zu,+prefer-setzucc -show-mc-encoding -verify-machineinstrs | FileCheck %s --check-prefix=SETZUCC
 
 define void @ccmp8rr_zf(i8 noundef %a, i8 noundef %b, i8 noundef %c) {
 ; CHECK-LABEL: ccmp8rr_zf:
@@ -30,6 +31,23 @@ define void @ccmp8rr_zf(i8 noundef %a, i8 noundef %b, i8 noundef %c) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB0_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp8rr_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpb %dl, %dil # encoding: [0x40,0x38,0xd7]
+; SETZUCC-NEXT:    je .LBB0_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB0_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpb %dl, %sil # encoding: [0x40,0x38,0xd6]
+; SETZUCC-NEXT:    je .LBB0_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB0_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB0_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %cmp = icmp eq i8 %a, %c
   %cmp1 = icmp eq i8 %b, %c
@@ -72,6 +90,23 @@ define void @ccmp8rr_cf(i8 noundef %a, i8 noundef %b) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB1_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp8rr_cf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpb $2, %dil # encoding: [0x40,0x80,0xff,0x02]
+; SETZUCC-NEXT:    setzul %al # encoding: [0x62,0xf4,0x7f,0x18,0x4c,0xc0]
+; SETZUCC-NEXT:    cmpb $2, %sil # encoding: [0x40,0x80,0xfe,0x02]
+; SETZUCC-NEXT:    setzub %cl # encoding: [0x62,0xf4,0x7f,0x18,0x42,0xc1]
+; SETZUCC-NEXT:    orb %al, %cl # encoding: [0x08,0xc1]
+; SETZUCC-NEXT:    jne .LBB1_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB1_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB1_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp sgt i8 %a, 1
   %tobool = icmp ugt i8 %b, 1
@@ -110,6 +145,22 @@ define i8 @ccmp8rr_sf(i8 %a, i8 %b, i8* nocapture %c)  {
 ; NDD-NEXT:  .LBB2_2: # %if.end
 ; NDD-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp8rr_sf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testb %dil, %dil # encoding: [0x40,0x84,0xff]
+; SETZUCC-NEXT:    setzune %al # encoding: [0x62,0xf4,0x7f,0x18,0x45,0xc0]
+; SETZUCC-NEXT:    cmpb $2, %sil # encoding: [0x40,0x80,0xfe,0x02]
+; SETZUCC-NEXT:    setzuge %cl # encoding: [0x62,0xf4,0x7f,0x18,0x4d,0xc1]
+; SETZUCC-NEXT:    andb %al, %cl # encoding: [0x20,0xc1]
+; SETZUCC-NEXT:    cmpb $1, %cl # encoding: [0x80,0xf9,0x01]
+; SETZUCC-NEXT:    jne .LBB2_2 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB2_2, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %if.then
+; SETZUCC-NEXT:    movb %dil, (%rdx) # encoding: [0x40,0x88,0x3a]
+; SETZUCC-NEXT:  .LBB2_2: # %if.end
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %tobool = icmp ne i8 %a, 0
   %cmp = icmp sgt i8 %b, 1
@@ -148,6 +199,22 @@ define i8 @ccmp8rr_none(i8 %a, i8 %b, i8* nocapture %c)  {
 ; NDD-NEXT:  .LBB3_2: # %if.end
 ; NDD-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp8rr_none:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testb %dil, %dil # encoding: [0x40,0x84,0xff]
+; SETZUCC-NEXT:    setzune %al # encoding: [0x62,0xf4,0x7f,0x18,0x45,0xc0]
+; SETZUCC-NEXT:    cmpb $2, %sil # encoding: [0x40,0x80,0xfe,0x02]
+; SETZUCC-NEXT:    setzuge %cl # encoding: [0x62,0xf4,0x7f,0x18,0x4d,0xc1]
+; SETZUCC-NEXT:    orb %al, %cl # encoding: [0x08,0xc1]
+; SETZUCC-NEXT:    cmpb $1, %cl # encoding: [0x80,0xf9,0x01]
+; SETZUCC-NEXT:    jne .LBB3_2 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB3_2, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %if.then
+; SETZUCC-NEXT:    movb %dil, (%rdx) # encoding: [0x40,0x88,0x3a]
+; SETZUCC-NEXT:  .LBB3_2: # %if.end
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %tobool = icmp ne i8 %a, 0
   %cmp = icmp sgt i8 %b, 1
@@ -190,6 +257,23 @@ define void @ccmp16rr_sf(i16 noundef %a, i16 noundef %b, i16 noundef %c) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB4_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp16rr_sf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpw %dx, %di # encoding: [0x66,0x39,0xd7]
+; SETZUCC-NEXT:    setzule %al # encoding: [0x62,0xf4,0x7f,0x18,0x4e,0xc0]
+; SETZUCC-NEXT:    cmpw %dx, %si # encoding: [0x66,0x39,0xd6]
+; SETZUCC-NEXT:    setzuge %cl # encoding: [0x62,0xf4,0x7f,0x18,0x4d,0xc1]
+; SETZUCC-NEXT:    testb %cl, %al # encoding: [0x84,0xc8]
+; SETZUCC-NEXT:    jne .LBB4_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB4_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB4_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp sgt i16 %a, %c
   %cmp1 = icmp slt i16 %b, %c
@@ -232,6 +316,23 @@ define void @ccmp32rr_cf(i32 noundef %a, i32 noundef %b, i32 noundef %c) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB5_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp32rr_cf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpl %edx, %edi # encoding: [0x39,0xd7]
+; SETZUCC-NEXT:    setzub %al # encoding: [0x62,0xf4,0x7f,0x18,0x42,0xc0]
+; SETZUCC-NEXT:    cmpl %edx, %esi # encoding: [0x39,0xd6]
+; SETZUCC-NEXT:    setzua %cl # encoding: [0x62,0xf4,0x7f,0x18,0x47,0xc1]
+; SETZUCC-NEXT:    testb %cl, %al # encoding: [0x84,0xc8]
+; SETZUCC-NEXT:    jne .LBB5_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB5_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB5_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp uge i32 %a, %c
   %cmp1 = icmp ule i32 %b, %c
@@ -274,6 +375,23 @@ define void @ccmp64rr_of(i64 %a, i64 %b, i64 %c) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB6_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp64rr_of:
+; SETZUCC:       # %bb.0: # %bb
+; SETZUCC-NEXT:    cmpq %rdx, %rdi # encoding: [0x48,0x39,0xd7]
+; SETZUCC-NEXT:    setzub %al # encoding: [0x62,0xf4,0x7f,0x18,0x42,0xc0]
+; SETZUCC-NEXT:    cmpq %rsi, %rdi # encoding: [0x48,0x39,0xf7]
+; SETZUCC-NEXT:    setzuno %cl # encoding: [0x62,0xf4,0x7f,0x18,0x41,0xc1]
+; SETZUCC-NEXT:    testb %cl, %al # encoding: [0x84,0xc8]
+; SETZUCC-NEXT:    jne .LBB6_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB6_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB6_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 bb:
   %cmp = icmp uge i64 %a, %c
   %smul = call {i64, i1} @llvm.ssub.with.overflow.i64(i64 %a, i64 %b)
@@ -309,6 +427,16 @@ define void @ccmp64rr_of_crossbb(i64 %a, i64 %b) {
 ; NDD-NEXT:    cmpq %rsi, %rdi # encoding: [0x48,0x39,0xf7]
 ; NDD-NEXT:  .LBB7_2: # %bb3
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp64rr_of_crossbb:
+; SETZUCC:       # %bb.0: # %bb
+; SETZUCC-NEXT:    testq %rdi, %rdi # encoding: [0x48,0x85,0xff]
+; SETZUCC-NEXT:    je .LBB7_2 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB7_2, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %bb1
+; SETZUCC-NEXT:    cmpq %rsi, %rdi # encoding: [0x48,0x39,0xf7]
+; SETZUCC-NEXT:  .LBB7_2: # %bb3
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 bb:
   %cond1 = icmp eq i64 %a, 0
   br i1 %cond1, label %bb3, label %bb1
@@ -354,6 +482,23 @@ define void @ccmp8ri_zf(i8 noundef %a, i8 noundef %b, i8 noundef %c) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB8_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp8ri_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpb %dl, %dil # encoding: [0x40,0x38,0xd7]
+; SETZUCC-NEXT:    setzule %al # encoding: [0x62,0xf4,0x7f,0x18,0x4e,0xc0]
+; SETZUCC-NEXT:    cmpb $123, %sil # encoding: [0x40,0x80,0xfe,0x7b]
+; SETZUCC-NEXT:    setzune %cl # encoding: [0x62,0xf4,0x7f,0x18,0x45,0xc1]
+; SETZUCC-NEXT:    testb %cl, %al # encoding: [0x84,0xc8]
+; SETZUCC-NEXT:    jne .LBB8_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB8_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB8_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp sgt i8 %a, %c
   %cmp1 = icmp eq i8 %b, 123
@@ -394,6 +539,22 @@ define i8 @ccmp8ri_zf_double(i8 %a, double %b, i8* nocapture %c)  {
 ; NDD-NEXT:  .LBB9_2: # %if.end
 ; NDD-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp8ri_zf_double:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpb $123, %dil # encoding: [0x40,0x80,0xff,0x7b]
+; SETZUCC-NEXT:    je .LBB9_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB9_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    xorpd %xmm1, %xmm1 # encoding: [0x66,0x0f,0x57,0xc9]
+; SETZUCC-NEXT:    ucomisd %xmm1, %xmm0 # encoding: [0x66,0x0f,0x2e,0xc1]
+; SETZUCC-NEXT:    jne .LBB9_3 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB9_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    movb %dil, (%rsi) # encoding: [0x40,0x88,0x3e]
+; SETZUCC-NEXT:  .LBB9_3: # %if.end
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %tobool = icmp ne i8 %a, 123
   %cmp = fcmp ueq double %b, 0.0
@@ -440,6 +601,21 @@ define i8 @ccmp8ri_zf_double_p(i8 %a, double %b, i8* nocapture %c)  {
 ; NDD-NEXT:  .LBB10_2: # %if.end
 ; NDD-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp8ri_zf_double_p:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpb $123, %dil # encoding: [0x40,0x80,0xff,0x7b]
+; SETZUCC-NEXT:    je .LBB10_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB10_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    ucomisd %xmm0, %xmm0 # encoding: [0x66,0x0f,0x2e,0xc0]
+; SETZUCC-NEXT:    jnp .LBB10_3 # encoding: [0x7b,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB10_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    movb %dil, (%rsi) # encoding: [0x40,0x88,0x3e]
+; SETZUCC-NEXT:  .LBB10_3: # %if.end
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %tobool = icmp ne i8 %a, 123
   %cmp = fcmp uno double %b, 0.0
@@ -486,6 +662,21 @@ define i8 @ccmp8ri_zf_double_np(i8 %a, double %b, i8* nocapture %c)  {
 ; NDD-NEXT:  .LBB11_2: # %if.end
 ; NDD-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp8ri_zf_double_np:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpb $123, %dil # encoding: [0x40,0x80,0xff,0x7b]
+; SETZUCC-NEXT:    je .LBB11_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB11_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    ucomisd %xmm0, %xmm0 # encoding: [0x66,0x0f,0x2e,0xc0]
+; SETZUCC-NEXT:    jp .LBB11_3 # encoding: [0x7a,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB11_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    movb %dil, (%rsi) # encoding: [0x40,0x88,0x3e]
+; SETZUCC-NEXT:  .LBB11_3: # %if.end
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %tobool = icmp ne i8 %a, 123
   %cmp = fcmp ord double %b, 0.0
@@ -532,6 +723,25 @@ define void @ccmp16ri_zf(i16 noundef %a, i16 noundef %b, i16 noundef %c) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB12_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp16ri_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpw %dx, %di # encoding: [0x66,0x39,0xd7]
+; SETZUCC-NEXT:    setzuae %al # encoding: [0x62,0xf4,0x7f,0x18,0x43,0xc0]
+; SETZUCC-NEXT:    movswl %si, %ecx # encoding: [0x0f,0xbf,0xce]
+; SETZUCC-NEXT:    cmpl $1234, %ecx # encoding: [0x81,0xf9,0xd2,0x04,0x00,0x00]
+; SETZUCC-NEXT:    # imm = 0x4D2
+; SETZUCC-NEXT:    setzuge %cl # encoding: [0x62,0xf4,0x7f,0x18,0x4d,0xc1]
+; SETZUCC-NEXT:    testb %cl, %al # encoding: [0x84,0xc8]
+; SETZUCC-NEXT:    jne .LBB12_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB12_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB12_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp ult i16 %a, %c
   %cmp1 = icmp slt i16 %b, 1234
@@ -576,6 +786,24 @@ define void @ccmp32ri_cf(i32 noundef %a, i32 noundef %b, i32 noundef %c) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB13_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp32ri_cf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpl %edx, %edi # encoding: [0x39,0xd7]
+; SETZUCC-NEXT:    setzub %al # encoding: [0x62,0xf4,0x7f,0x18,0x42,0xc0]
+; SETZUCC-NEXT:    cmpl $1048577, %esi # encoding: [0x81,0xfe,0x01,0x00,0x10,0x00]
+; SETZUCC-NEXT:    # imm = 0x100001
+; SETZUCC-NEXT:    setzuae %cl # encoding: [0x62,0xf4,0x7f,0x18,0x43,0xc1]
+; SETZUCC-NEXT:    testb %cl, %al # encoding: [0x84,0xc8]
+; SETZUCC-NEXT:    jne .LBB13_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB13_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB13_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp uge i32 %a, %c
   %cmp1 = icmp ule i32 %b, 1048576
@@ -620,6 +848,24 @@ define void @ccmp64ri32_zf(i64 noundef %a, i64 noundef %b, i64 noundef %c) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB14_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp64ri32_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpq %rdx, %rdi # encoding: [0x48,0x39,0xd7]
+; SETZUCC-NEXT:    setzube %al # encoding: [0x62,0xf4,0x7f,0x18,0x46,0xc0]
+; SETZUCC-NEXT:    cmpq $123456, %rsi # encoding: [0x48,0x81,0xfe,0x40,0xe2,0x01,0x00]
+; SETZUCC-NEXT:    # imm = 0x1E240
+; SETZUCC-NEXT:    setzuge %cl # encoding: [0x62,0xf4,0x7f,0x18,0x4d,0xc1]
+; SETZUCC-NEXT:    testb %cl, %al # encoding: [0x84,0xc8]
+; SETZUCC-NEXT:    jne .LBB14_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB14_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB14_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp ugt i64 %a, %c
   %cmp1 = icmp slt i64 %b, 123456
@@ -662,6 +908,23 @@ define void @ccmp8rm_zf(i8 noundef %a, i8 noundef %b, i8 noundef %c, ptr %ptr) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB15_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp8rm_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpb %dl, %dil # encoding: [0x40,0x38,0xd7]
+; SETZUCC-NEXT:    je .LBB15_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB15_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpb (%rcx), %sil # encoding: [0x40,0x3a,0x31]
+; SETZUCC-NEXT:    je .LBB15_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB15_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB15_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %d = load i8, ptr %ptr
   %cmp = icmp eq i8 %a, %c
@@ -705,6 +968,23 @@ define void @ccmp16rm_sf(i16 noundef %a, i16 noundef %b, i16 noundef %c, ptr %pt
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB16_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp16rm_sf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpw %dx, %di # encoding: [0x66,0x39,0xd7]
+; SETZUCC-NEXT:    jg .LBB16_3 # encoding: [0x7f,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB16_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpw (%rcx), %si # encoding: [0x66,0x3b,0x31]
+; SETZUCC-NEXT:    jl .LBB16_3 # encoding: [0x7c,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB16_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB16_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %d = load i16, ptr %ptr
   %cmp = icmp sgt i16 %a, %c
@@ -748,6 +1028,23 @@ define void @ccmp32rm_cf(i32 noundef %a, i32 noundef %b, i32 noundef %c, ptr %pt
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB17_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp32rm_cf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpl %edx, %edi # encoding: [0x39,0xd7]
+; SETZUCC-NEXT:    jle .LBB17_3 # encoding: [0x7e,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB17_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpl (%rcx), %esi # encoding: [0x3b,0x31]
+; SETZUCC-NEXT:    jbe .LBB17_3 # encoding: [0x76,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB17_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB17_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %d = load i32, ptr %ptr
   %cmp = icmp sle i32 %a, %c
@@ -791,6 +1088,23 @@ define void @ccmp64rm_sf(i64 noundef %a, i64 noundef %b, i64 noundef %c, ptr %pt
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB18_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp64rm_sf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpq %rdx, %rdi # encoding: [0x48,0x39,0xd7]
+; SETZUCC-NEXT:    jg .LBB18_3 # encoding: [0x7f,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB18_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpq (%rcx), %rsi # encoding: [0x48,0x3b,0x31]
+; SETZUCC-NEXT:    jl .LBB18_3 # encoding: [0x7c,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB18_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB18_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %d = load i64, ptr %ptr
   %cmp = icmp sgt i64 %a, %c
@@ -834,6 +1148,23 @@ define void @ccmp8mr_zf(i8 noundef %a, i8 noundef %c, ptr %ptr) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB19_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp8mr_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpb %sil, %dil # encoding: [0x40,0x38,0xf7]
+; SETZUCC-NEXT:    jl .LBB19_3 # encoding: [0x7c,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB19_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpb %sil, (%rdx) # encoding: [0x40,0x38,0x32]
+; SETZUCC-NEXT:    je .LBB19_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB19_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB19_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i8, ptr %ptr
   %cmp = icmp slt i8 %a, %c
@@ -877,6 +1208,23 @@ define void @ccmp16mr_sf(i16 noundef %a, i16 noundef %c, ptr %ptr) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB20_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp16mr_sf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpw %si, %di # encoding: [0x66,0x39,0xf7]
+; SETZUCC-NEXT:    jg .LBB20_3 # encoding: [0x7f,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB20_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpw %si, (%rdx) # encoding: [0x66,0x39,0x32]
+; SETZUCC-NEXT:    jl .LBB20_3 # encoding: [0x7c,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB20_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB20_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i16, ptr %ptr
   %cmp = icmp sgt i16 %a, %c
@@ -920,6 +1268,23 @@ define void @ccmp32mr_cf(i32 noundef %a, i32 noundef %c, ptr %ptr) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB21_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp32mr_cf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpl %esi, %edi # encoding: [0x39,0xf7]
+; SETZUCC-NEXT:    jge .LBB21_3 # encoding: [0x7d,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB21_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpl %esi, (%rdx) # encoding: [0x39,0x32]
+; SETZUCC-NEXT:    jbe .LBB21_3 # encoding: [0x76,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB21_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB21_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i32, ptr %ptr
   %cmp = icmp sge i32 %a, %c
@@ -963,6 +1328,23 @@ define void @ccmp64mr_sf(i64 noundef %a, i64 noundef %c, ptr %ptr) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB22_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp64mr_sf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpq %rsi, %rdi # encoding: [0x48,0x39,0xf7]
+; SETZUCC-NEXT:    jg .LBB22_3 # encoding: [0x7f,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB22_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpq %rsi, (%rdx) # encoding: [0x48,0x39,0x32]
+; SETZUCC-NEXT:    jl .LBB22_3 # encoding: [0x7c,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB22_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB22_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i64, ptr %ptr
   %cmp = icmp sgt i64 %a, %c
@@ -1006,6 +1388,23 @@ define void @ccmp8mi_zf(i8 noundef %a, i8 noundef %c, ptr %ptr) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB23_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp8mi_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpb %sil, %dil # encoding: [0x40,0x38,0xf7]
+; SETZUCC-NEXT:    je .LBB23_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB23_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpb $123, (%rdx) # encoding: [0x80,0x3a,0x7b]
+; SETZUCC-NEXT:    je .LBB23_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB23_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB23_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i8, ptr %ptr
   %cmp = icmp eq i8 %a, %c
@@ -1051,6 +1450,25 @@ define void @ccmp16mi_zf(i16 noundef %a, i16 noundef %c, ptr %ptr) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB24_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp16mi_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpw %si, %di # encoding: [0x66,0x39,0xf7]
+; SETZUCC-NEXT:    jg .LBB24_3 # encoding: [0x7f,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB24_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    movswl (%rdx), %eax # encoding: [0x0f,0xbf,0x02]
+; SETZUCC-NEXT:    cmpl $1233, %eax # encoding: [0x3d,0xd1,0x04,0x00,0x00]
+; SETZUCC-NEXT:    # imm = 0x4D1
+; SETZUCC-NEXT:    jle .LBB24_3 # encoding: [0x7e,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB24_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB24_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i16, ptr %ptr
   %cmp = icmp sgt i16 %a, %c
@@ -1096,6 +1514,24 @@ define void @ccmp32mi_cf(i32 noundef %a, i32 noundef %c, ptr %ptr) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB25_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp32mi_cf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpl %esi, %edi # encoding: [0x39,0xf7]
+; SETZUCC-NEXT:    je .LBB25_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB25_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpl $123456, (%rdx) # encoding: [0x81,0x3a,0x40,0xe2,0x01,0x00]
+; SETZUCC-NEXT:    # imm = 0x1E240
+; SETZUCC-NEXT:    jbe .LBB25_3 # encoding: [0x76,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB25_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB25_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i32, ptr %ptr
   %cmp = icmp eq i32 %a, %c
@@ -1141,6 +1577,24 @@ define void @ccmp64mi32_zf(i64 noundef %a, i64 noundef %c, ptr %ptr) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB26_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp64mi32_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpq %rsi, %rdi # encoding: [0x48,0x39,0xf7]
+; SETZUCC-NEXT:    jg .LBB26_3 # encoding: [0x7f,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB26_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpq $123455, (%rdx) # encoding: [0x48,0x81,0x3a,0x3f,0xe2,0x01,0x00]
+; SETZUCC-NEXT:    # imm = 0x1E23F
+; SETZUCC-NEXT:    jle .LBB26_3 # encoding: [0x7e,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB26_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB26_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i64, ptr %ptr
   %cmp = icmp sgt i64 %a, %c
@@ -1186,6 +1640,26 @@ define void @ccmp_continous(i32 noundef %a, i32 noundef %b, i32 noundef %c) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB27_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp_continous:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testl %edi, %edi # encoding: [0x85,0xff]
+; SETZUCC-NEXT:    setzug %al # encoding: [0x62,0xf4,0x7f,0x18,0x4f,0xc0]
+; SETZUCC-NEXT:    cmpl $2, %esi # encoding: [0x83,0xfe,0x02]
+; SETZUCC-NEXT:    setzuge %cl # encoding: [0x62,0xf4,0x7f,0x18,0x4d,0xc1]
+; SETZUCC-NEXT:    orb %al, %cl # encoding: [0x08,0xc1]
+; SETZUCC-NEXT:    cmpl $3, %edx # encoding: [0x83,0xfa,0x03]
+; SETZUCC-NEXT:    setzuge %al # encoding: [0x62,0xf4,0x7f,0x18,0x4d,0xc0]
+; SETZUCC-NEXT:    orb %cl, %al # encoding: [0x08,0xc8]
+; SETZUCC-NEXT:    jne .LBB27_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB27_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB27_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp slt i32 %a, 1
   %cmp1 = icmp slt i32 %b, 2
@@ -1218,6 +1692,16 @@ define i32 @ccmp_nobranch(i32 noundef %a, i32 noundef %b) {
 ; NDD-NEXT:    setge %al # encoding: [0x0f,0x9d,0xc0]
 ; NDD-NEXT:    movzbl %al, %eax # encoding: [0x0f,0xb6,0xc0]
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp_nobranch:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testl %edi, %edi # encoding: [0x85,0xff]
+; SETZUCC-NEXT:    setzug %al # encoding: [0x62,0xf4,0x7f,0x18,0x4f,0xc0]
+; SETZUCC-NEXT:    cmpl $2, %esi # encoding: [0x83,0xfe,0x02]
+; SETZUCC-NEXT:    setzuge %cl # encoding: [0x62,0xf4,0x7f,0x18,0x4d,0xc1]
+; SETZUCC-NEXT:    orb %al, %cl # encoding: [0x08,0xc1]
+; SETZUCC-NEXT:    movzbl %cl, %eax # encoding: [0x0f,0xb6,0xc1]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp sgt i32 %a, 0
   %cmp1 = icmp sgt i32 %b, 1
@@ -1244,6 +1728,19 @@ define i32 @ccmp_continous_nobranch(i32 noundef %a, i32 noundef %b, i32 noundef
 ; NDD-NEXT:    setge %al # encoding: [0x0f,0x9d,0xc0]
 ; NDD-NEXT:    movzbl %al, %eax # encoding: [0x0f,0xb6,0xc0]
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp_continous_nobranch:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpl $2, %edi # encoding: [0x83,0xff,0x02]
+; SETZUCC-NEXT:    setzuge %al # encoding: [0x62,0xf4,0x7f,0x18,0x4d,0xc0]
+; SETZUCC-NEXT:    cmpl $2, %esi # encoding: [0x83,0xfe,0x02]
+; SETZUCC-NEXT:    setzul %cl # encoding: [0x62,0xf4,0x7f,0x18,0x4c,0xc1]
+; SETZUCC-NEXT:    cmpl $4, %edx # encoding: [0x83,0xfa,0x04]
+; SETZUCC-NEXT:    setzuge %dl # encoding: [0x62,0xf4,0x7f,0x18,0x4d,0xc2]
+; SETZUCC-NEXT:    orb %al, %cl # encoding: [0x08,0xc1]
+; SETZUCC-NEXT:    andb %dl, %cl # encoding: [0x20,0xd1]
+; SETZUCC-NEXT:    movzbl %cl, %eax # encoding: [0x0f,0xb6,0xc1]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp sgt i32 %a, 1
   %cmp1 = icmp slt i32 %b, 2
@@ -1286,6 +1783,25 @@ define void @ccmp64ri64(i64 noundef %a, i64 noundef %b, i64 noundef %c) {
 ; NDD-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 ; NDD-NEXT:  .LBB30_1: # %if.end
 ; NDD-NEXT:    retq # encoding: [0xc3]
+;
+; SETZUCC-LABEL: ccmp64ri64:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpq %rdx, %rdi # encoding: [0x48,0x39,0xd7]
+; SETZUCC-NEXT:    setzube %al # encoding: [0x62,0xf4,0x7f,0x18,0x46,0xc0]
+; SETZUCC-NEXT:    movabsq $9992147483646, %rcx # encoding: [0x48,0xb9,0xfe,0xbb,0x66,0x7a,0x16,0x09,0x00,0x00]
+; SETZUCC-NEXT:    # imm = 0x9167A66BBFE
+; SETZUCC-NEXT:    cmpq %rcx, %rsi # encoding: [0x48,0x39,0xce]
+; SETZUCC-NEXT:    setzug %cl # encoding: [0x62,0xf4,0x7f,0x18,0x4f,0xc1]
+; SETZUCC-NEXT:    testb %cl, %al # encoding: [0x84,0xc8]
+; SETZUCC-NEXT:    jne .LBB30_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB30_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB30_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp ugt i64 %a, %c
   %cmp1 = icmp slt i64 %b, 9992147483647
diff --git a/llvm/test/CodeGen/X86/apx/ctest.ll b/llvm/test/CodeGen/X86/apx/ctest.ll
index 5f3ec8a19d0a4..70a1382a80e6d 100644
--- a/llvm/test/CodeGen/X86/apx/ctest.ll
+++ b/llvm/test/CodeGen/X86/apx/ctest.ll
@@ -1,6 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ccmp,+nf -verify-machineinstrs | FileCheck %s
 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ccmp,+ndd,+nf -verify-machineinstrs | FileCheck %s --check-prefix=NDD
+; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+zu,+prefer-setzucc -verify-machineinstrs --show-mc-encoding | FileCheck %s --check-prefix=SETZUCC
 
 define void @ctest8rr_zf(i8 noundef %a, i8 noundef %b) {
 ; CHECK-LABEL: ctest8rr_zf:
@@ -24,6 +25,23 @@ define void @ctest8rr_zf(i8 noundef %a, i8 noundef %b) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB0_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest8rr_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testb %dil, %dil # encoding: [0x40,0x84,0xff]
+; SETZUCC-NEXT:    je .LBB0_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB0_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    testb %sil, %sil # encoding: [0x40,0x84,0xf6]
+; SETZUCC-NEXT:    je .LBB0_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB0_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB0_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %cmp = icmp eq i8 %a, 0
   %cmp1 = icmp eq i8 %b, 0
@@ -62,6 +80,22 @@ define i8 @ctest8rr_zf_double(i8 %a, double %b, i8* nocapture %c)  {
 ; NDD-NEXT:  .LBB1_2: # %if.end
 ; NDD-NEXT:    xorl %eax, %eax
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest8rr_zf_double:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testb %dil, %dil # encoding: [0x40,0x84,0xff]
+; SETZUCC-NEXT:    je .LBB1_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB1_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    xorpd %xmm1, %xmm1 # encoding: [0x66,0x0f,0x57,0xc9]
+; SETZUCC-NEXT:    ucomisd %xmm1, %xmm0 # encoding: [0x66,0x0f,0x2e,0xc1]
+; SETZUCC-NEXT:    jne .LBB1_3 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB1_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    movb %dil, (%rsi) # encoding: [0x40,0x88,0x3e]
+; SETZUCC-NEXT:  .LBB1_3: # %if.end
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %tobool = icmp ne i8 %a, 0
   %cmp = fcmp ueq double %b, 0.0
@@ -106,6 +140,21 @@ define i8 @ctest8rr_zf_double_p(i8 %a, double %b, i8* nocapture %c)  {
 ; NDD-NEXT:  .LBB2_2: # %if.end
 ; NDD-NEXT:    xorl %eax, %eax
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest8rr_zf_double_p:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testb %dil, %dil # encoding: [0x40,0x84,0xff]
+; SETZUCC-NEXT:    je .LBB2_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB2_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    ucomisd %xmm0, %xmm0 # encoding: [0x66,0x0f,0x2e,0xc0]
+; SETZUCC-NEXT:    jnp .LBB2_3 # encoding: [0x7b,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB2_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    movb %dil, (%rsi) # encoding: [0x40,0x88,0x3e]
+; SETZUCC-NEXT:  .LBB2_3: # %if.end
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %tobool = icmp ne i8 %a, 0
   %cmp = fcmp uno double %b, 0.0
@@ -150,6 +199,21 @@ define i8 @ctest8rr_zf_double_np(i8 %a, double %b, i8* nocapture %c)  {
 ; NDD-NEXT:  .LBB3_2: # %if.end
 ; NDD-NEXT:    xorl %eax, %eax
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest8rr_zf_double_np:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testb %dil, %dil # encoding: [0x40,0x84,0xff]
+; SETZUCC-NEXT:    je .LBB3_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB3_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    ucomisd %xmm0, %xmm0 # encoding: [0x66,0x0f,0x2e,0xc0]
+; SETZUCC-NEXT:    jp .LBB3_3 # encoding: [0x7a,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB3_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    movb %dil, (%rsi) # encoding: [0x40,0x88,0x3e]
+; SETZUCC-NEXT:  .LBB3_3: # %if.end
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %tobool = icmp ne i8 %a, 0
   %cmp = fcmp ord double %b, 0.0
@@ -186,6 +250,23 @@ define void @ctest8rr_sf(i8 noundef %a, i8 noundef %b) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB4_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest8rr_sf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testb %dil, %dil # encoding: [0x40,0x84,0xff]
+; SETZUCC-NEXT:    setzune %al # encoding: [0x62,0xf4,0x7f,0x18,0x45,0xc0]
+; SETZUCC-NEXT:    testb %sil, %sil # encoding: [0x40,0x84,0xf6]
+; SETZUCC-NEXT:    setzus %cl # encoding: [0x62,0xf4,0x7f,0x18,0x48,0xc1]
+; SETZUCC-NEXT:    orb %al, %cl # encoding: [0x08,0xc1]
+; SETZUCC-NEXT:    jne .LBB4_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB4_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB4_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp ule i8 %a, 0
   %tobool = icmp sge i8 %b, 0
@@ -222,6 +303,22 @@ define i8 @ctest8rr_sf_2(i8 %a, i8 %b, i8* nocapture %c)  {
 ; NDD-NEXT:  .LBB5_2: # %if.end
 ; NDD-NEXT:    xorl %eax, %eax
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest8rr_sf_2:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testb %dil, %dil # encoding: [0x40,0x84,0xff]
+; SETZUCC-NEXT:    setzug %al # encoding: [0x62,0xf4,0x7f,0x18,0x4f,0xc0]
+; SETZUCC-NEXT:    testb %sil, %sil # encoding: [0x40,0x84,0xf6]
+; SETZUCC-NEXT:    setzus %cl # encoding: [0x62,0xf4,0x7f,0x18,0x48,0xc1]
+; SETZUCC-NEXT:    orb %al, %cl # encoding: [0x08,0xc1]
+; SETZUCC-NEXT:    cmpb $1, %cl # encoding: [0x80,0xf9,0x01]
+; SETZUCC-NEXT:    jne .LBB5_2 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB5_2, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %if.then
+; SETZUCC-NEXT:    movb %dil, (%rdx) # encoding: [0x40,0x88,0x3a]
+; SETZUCC-NEXT:  .LBB5_2: # %if.end
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %tobool = icmp sgt i8 %a, 0
   %cmp = icmp slt i8 %b, 0
@@ -258,6 +355,22 @@ define i8 @ctest8rr_none(i8 %a, i8 %b, i8* nocapture %c)  {
 ; NDD-NEXT:  .LBB6_2: # %if.end
 ; NDD-NEXT:    xorl %eax, %eax
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest8rr_none:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testb %dil, %dil # encoding: [0x40,0x84,0xff]
+; SETZUCC-NEXT:    setzune %al # encoding: [0x62,0xf4,0x7f,0x18,0x45,0xc0]
+; SETZUCC-NEXT:    testb %sil, %sil # encoding: [0x40,0x84,0xf6]
+; SETZUCC-NEXT:    setzue %cl # encoding: [0x62,0xf4,0x7f,0x18,0x44,0xc1]
+; SETZUCC-NEXT:    andb %al, %cl # encoding: [0x20,0xc1]
+; SETZUCC-NEXT:    cmpb $1, %cl # encoding: [0x80,0xf9,0x01]
+; SETZUCC-NEXT:    jne .LBB6_2 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB6_2, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %if.then
+; SETZUCC-NEXT:    movb %dil, (%rdx) # encoding: [0x40,0x88,0x3a]
+; SETZUCC-NEXT:  .LBB6_2: # %if.end
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %tobool = icmp ne i8 %a, 0
   %cmp = icmp eq i8 %b, 0
@@ -294,6 +407,23 @@ define void @ctest16rr_sf(i16 noundef %a, i16 noundef %b) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB7_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest16rr_sf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testw %di, %di # encoding: [0x66,0x85,0xff]
+; SETZUCC-NEXT:    setzule %al # encoding: [0x62,0xf4,0x7f,0x18,0x4e,0xc0]
+; SETZUCC-NEXT:    testw %si, %si # encoding: [0x66,0x85,0xf6]
+; SETZUCC-NEXT:    setzuns %cl # encoding: [0x62,0xf4,0x7f,0x18,0x49,0xc1]
+; SETZUCC-NEXT:    testb %cl, %al # encoding: [0x84,0xc8]
+; SETZUCC-NEXT:    jne .LBB7_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB7_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB7_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp sgt i16 %a, 0
   %cmp1 = icmp slt i16 %b, 0
@@ -330,6 +460,23 @@ define void @ctest32rr_zf(i32 noundef %a, i32 noundef %b) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB8_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest32rr_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testl %edi, %edi # encoding: [0x85,0xff]
+; SETZUCC-NEXT:    setzus %al # encoding: [0x62,0xf4,0x7f,0x18,0x48,0xc0]
+; SETZUCC-NEXT:    testl %esi, %esi # encoding: [0x85,0xf6]
+; SETZUCC-NEXT:    setzune %cl # encoding: [0x62,0xf4,0x7f,0x18,0x45,0xc1]
+; SETZUCC-NEXT:    testb %cl, %al # encoding: [0x84,0xc8]
+; SETZUCC-NEXT:    jne .LBB8_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB8_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB8_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp sge i32 %a, 0
   %cmp1 = icmp eq i32 %b, 0
@@ -366,6 +513,23 @@ define void @ctest8ri_zf(i8 noundef %a, i8 noundef %b) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB9_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest8ri_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testb %dil, %dil # encoding: [0x40,0x84,0xff]
+; SETZUCC-NEXT:    je .LBB9_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB9_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    andb $123, %sil # encoding: [0x40,0x80,0xe6,0x7b]
+; SETZUCC-NEXT:    je .LBB9_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB9_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB9_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %cmp = icmp eq i8 %a, 0
   %and = and i8 %b, 123
@@ -404,6 +568,24 @@ define void @ctest16ri_zf(i16 noundef %a, i16 noundef %b) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB10_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest16ri_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testw %di, %di # encoding: [0x66,0x85,0xff]
+; SETZUCC-NEXT:    je .LBB10_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB10_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    andl $1234, %esi # encoding: [0x81,0xe6,0xd2,0x04,0x00,0x00]
+; SETZUCC-NEXT:    # imm = 0x4D2
+; SETZUCC-NEXT:    je .LBB10_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB10_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB10_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %cmp = icmp eq i16 %a, 0
   %and = and i16 %b, 1234
@@ -441,6 +623,24 @@ define void @ctest32ri_zf(i32 noundef %a, i32 noundef %b) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB11_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest32ri_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testl %edi, %edi # encoding: [0x85,0xff]
+; SETZUCC-NEXT:    je .LBB11_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB11_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    andl $12345, %esi # encoding: [0x81,0xe6,0x39,0x30,0x00,0x00]
+; SETZUCC-NEXT:    # imm = 0x3039
+; SETZUCC-NEXT:    je .LBB11_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB11_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB11_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %cmp = icmp eq i32 %a, 0
   %and = and i32 %b, 12345
@@ -478,6 +678,24 @@ define void @ctest64ri32_zf(i64 noundef %a, i64 noundef %b) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB12_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest64ri32_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testq %rdi, %rdi # encoding: [0x48,0x85,0xff]
+; SETZUCC-NEXT:    je .LBB12_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB12_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    andl $123456, %esi # encoding: [0x81,0xe6,0x40,0xe2,0x01,0x00]
+; SETZUCC-NEXT:    # imm = 0x1E240
+; SETZUCC-NEXT:    je .LBB12_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB12_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB12_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %cmp = icmp eq i64 %a, 0
   %and = and i64 %b, 123456
@@ -517,6 +735,23 @@ define void @ctest8mr_zf(i8 noundef %a, ptr %ptr) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB13_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest8mr_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testb %dil, %dil # encoding: [0x40,0x84,0xff]
+; SETZUCC-NEXT:    je .LBB13_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB13_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpb $0, (%rsi) # encoding: [0x80,0x3e,0x00]
+; SETZUCC-NEXT:    je .LBB13_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB13_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB13_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i8, ptr %ptr
   %cmp = icmp eq i8 %a, 0
@@ -556,6 +791,23 @@ define void @ctest16mr_zf(i16 noundef %a, ptr %ptr) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB14_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest16mr_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testw %di, %di # encoding: [0x66,0x85,0xff]
+; SETZUCC-NEXT:    je .LBB14_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB14_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpw $0, (%rsi) # encoding: [0x66,0x83,0x3e,0x00]
+; SETZUCC-NEXT:    je .LBB14_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB14_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB14_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i16, ptr %ptr
   %cmp = icmp eq i16 %a, 0
@@ -595,6 +847,23 @@ define void @ctest32mr_cf(i32 noundef %a, ptr %ptr) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB15_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest32mr_cf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testl %edi, %edi # encoding: [0x85,0xff]
+; SETZUCC-NEXT:    je .LBB15_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB15_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpl $0, (%rsi) # encoding: [0x83,0x3e,0x00]
+; SETZUCC-NEXT:    je .LBB15_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB15_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB15_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i32, ptr %ptr
   %cmp = icmp eq i32 %a, 0
@@ -634,6 +903,23 @@ define void @ctest64mr_zf(i64 noundef %a, ptr %ptr) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB16_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest64mr_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testq %rdi, %rdi # encoding: [0x48,0x85,0xff]
+; SETZUCC-NEXT:    je .LBB16_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB16_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    cmpq $0, (%rsi) # encoding: [0x48,0x83,0x3e,0x00]
+; SETZUCC-NEXT:    je .LBB16_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB16_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB16_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i64, ptr %ptr
   %cmp = icmp eq i64 %a, 0
@@ -671,6 +957,24 @@ define void @ctest8mi_zf(i8 noundef %a, ptr %ptr) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB17_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest8mi_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testb %dil, %dil # encoding: [0x40,0x84,0xff]
+; SETZUCC-NEXT:    je .LBB17_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB17_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    movzbl (%rsi), %eax # encoding: [0x0f,0xb6,0x06]
+; SETZUCC-NEXT:    andb $123, %al # encoding: [0x24,0x7b]
+; SETZUCC-NEXT:    je .LBB17_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB17_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB17_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i8, ptr %ptr
   %cmp = icmp eq i8 %a, 0
@@ -711,6 +1015,25 @@ define void @ctest16mi_zf(i16 noundef %a, ptr %ptr) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB18_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest16mi_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testw %di, %di # encoding: [0x66,0x85,0xff]
+; SETZUCC-NEXT:    je .LBB18_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB18_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    movzwl (%rsi), %eax # encoding: [0x0f,0xb7,0x06]
+; SETZUCC-NEXT:    andl $1234, %eax # encoding: [0x25,0xd2,0x04,0x00,0x00]
+; SETZUCC-NEXT:    # imm = 0x4D2
+; SETZUCC-NEXT:    je .LBB18_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB18_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB18_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i16, ptr %ptr
   %cmp = icmp eq i16 %a, 0
@@ -751,6 +1074,25 @@ define void @ctest32mi_zf(i32 noundef %a, ptr %ptr) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB19_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest32mi_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testl %edi, %edi # encoding: [0x85,0xff]
+; SETZUCC-NEXT:    je .LBB19_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB19_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    movl $12345, %eax # encoding: [0xb8,0x39,0x30,0x00,0x00]
+; SETZUCC-NEXT:    # imm = 0x3039
+; SETZUCC-NEXT:    andl (%rsi), %eax # encoding: [0x23,0x06]
+; SETZUCC-NEXT:    je .LBB19_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB19_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB19_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i32, ptr %ptr
   %cmp = icmp eq i32 %a, 0
@@ -789,6 +1131,25 @@ define void @ctest64mi32_zf(i64 noundef %a, ptr %ptr) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB20_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest64mi32_zf:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testq %rdi, %rdi # encoding: [0x48,0x85,0xff]
+; SETZUCC-NEXT:    je .LBB20_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB20_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    movq (%rsi), %rax # encoding: [0x48,0x8b,0x06]
+; SETZUCC-NEXT:    andl $123456, %eax # encoding: [0x25,0x40,0xe2,0x01,0x00]
+; SETZUCC-NEXT:    # imm = 0x1E240
+; SETZUCC-NEXT:    je .LBB20_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB20_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB20_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %b = load i64, ptr %ptr
   %cmp = icmp eq i64 %a, 0
@@ -829,6 +1190,26 @@ define void @ctest_continous(i32 noundef %a, i32 noundef %b, i32 noundef %c) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB21_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest_continous:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    cmpl %esi, %edi # encoding: [0x39,0xf7]
+; SETZUCC-NEXT:    setzuge %al # encoding: [0x62,0xf4,0x7f,0x18,0x4d,0xc0]
+; SETZUCC-NEXT:    testl %esi, %esi # encoding: [0x85,0xf6]
+; SETZUCC-NEXT:    setzuns %cl # encoding: [0x62,0xf4,0x7f,0x18,0x49,0xc1]
+; SETZUCC-NEXT:    orb %al, %cl # encoding: [0x08,0xc1]
+; SETZUCC-NEXT:    testl %edx, %edx # encoding: [0x85,0xd2]
+; SETZUCC-NEXT:    setzuns %al # encoding: [0x62,0xf4,0x7f,0x18,0x49,0xc0]
+; SETZUCC-NEXT:    testb %al, %cl # encoding: [0x84,0xc1]
+; SETZUCC-NEXT:    jne .LBB21_1 # encoding: [0x75,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB21_1, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
+; SETZUCC-NEXT:  .LBB21_1: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp slt i32 %a, %b
   %cmp1 = icmp slt i32 %b, 0
@@ -861,6 +1242,16 @@ define i32 @ctest_nobranch(i32 noundef %a, i32 noundef %b) {
 ; NDD-NEXT:    setg %al
 ; NDD-NEXT:    movzbl %al, %eax
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest_nobranch:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testl %edi, %edi # encoding: [0x85,0xff]
+; SETZUCC-NEXT:    setzug %al # encoding: [0x62,0xf4,0x7f,0x18,0x4f,0xc0]
+; SETZUCC-NEXT:    testl %esi, %esi # encoding: [0x85,0xf6]
+; SETZUCC-NEXT:    setzug %cl # encoding: [0x62,0xf4,0x7f,0x18,0x4f,0xc1]
+; SETZUCC-NEXT:    orb %al, %cl # encoding: [0x08,0xc1]
+; SETZUCC-NEXT:    movzbl %cl, %eax # encoding: [0x0f,0xb6,0xc1]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp sgt i32 %a, 0
   %cmp1 = icmp sgt i32 %b, 0
@@ -887,6 +1278,19 @@ define i32 @ctest_continous_nobranch(i32 noundef %a, i32 noundef %b, i32 noundef
 ; NDD-NEXT:    setg %al
 ; NDD-NEXT:    movzbl %al, %eax
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest_continous_nobranch:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testl %edi, %edi # encoding: [0x85,0xff]
+; SETZUCC-NEXT:    setzug %al # encoding: [0x62,0xf4,0x7f,0x18,0x4f,0xc0]
+; SETZUCC-NEXT:    testl %esi, %esi # encoding: [0x85,0xf6]
+; SETZUCC-NEXT:    setzus %cl # encoding: [0x62,0xf4,0x7f,0x18,0x48,0xc1]
+; SETZUCC-NEXT:    testl %edx, %edx # encoding: [0x85,0xd2]
+; SETZUCC-NEXT:    setzug %dl # encoding: [0x62,0xf4,0x7f,0x18,0x4f,0xc2]
+; SETZUCC-NEXT:    orb %al, %cl # encoding: [0x08,0xc1]
+; SETZUCC-NEXT:    andb %dl, %cl # encoding: [0x20,0xd1]
+; SETZUCC-NEXT:    movzbl %cl, %eax # encoding: [0x0f,0xb6,0xc1]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 entry:
   %cmp = icmp sgt i32 %a, 0
   %cmp1 = icmp slt i32 %b, 0
@@ -921,6 +1325,25 @@ define void @ctest64ri64(i64 noundef %a, i64 noundef %b) {
 ; NDD-NEXT:    jmp foo # TAILCALL
 ; NDD-NEXT:  .LBB24_1: # %if.end
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: ctest64ri64:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    testq %rdi, %rdi # encoding: [0x48,0x85,0xff]
+; SETZUCC-NEXT:    je .LBB24_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB24_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.1: # %entry
+; SETZUCC-NEXT:    movabsq $9992147483647, %rax # encoding: [0x48,0xb8,0xff,0xbb,0x66,0x7a,0x16,0x09,0x00,0x00]
+; SETZUCC-NEXT:    # imm = 0x9167A66BBFF
+; SETZUCC-NEXT:    andq %rax, %rsi # encoding: [0x48,0x21,0xc6]
+; SETZUCC-NEXT:    je .LBB24_3 # encoding: [0x74,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: .LBB24_3, kind: FK_PCRel_1
+; SETZUCC-NEXT:  # %bb.2: # %if.end
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
+; SETZUCC-NEXT:  .LBB24_3: # %if.then
+; SETZUCC-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; SETZUCC-NEXT:    jmp foo # TAILCALL
+; SETZUCC-NEXT:    # encoding: [0xeb,A]
+; SETZUCC-NEXT:    # fixup A - offset: 1, value: foo, kind: FK_PCRel_1
 entry:
   %cmp = icmp eq i64 %a, 0
   %and = and i64 %b, 9992147483647
@@ -969,6 +1392,26 @@ define void @cmp_srem(ptr %p, i32 %a, ptr %b) {
 ; NDD-NEXT:    orb %dl, %al
 ; NDD-NEXT:    movb %al, (%rcx)
 ; NDD-NEXT:    retq
+;
+; SETZUCC-LABEL: cmp_srem:
+; SETZUCC:       # %bb.0: # %bb
+; SETZUCC-NEXT:    movq %rdx, %rcx # encoding: [0x48,0x89,0xd1]
+; SETZUCC-NEXT:    movl %esi, %eax # encoding: [0x89,0xf0]
+; SETZUCC-NEXT:    movl (%rdi), %esi # encoding: [0x8b,0x37]
+; SETZUCC-NEXT:    cmpl $1, %esi # encoding: [0x83,0xfe,0x01]
+; SETZUCC-NEXT:    setzue %dl # encoding: [0x62,0xf4,0x7f,0x18,0x44,0xc2]
+; SETZUCC-NEXT:    subl $1, %eax # encoding: [0x83,0xe8,0x01]
+; SETZUCC-NEXT:    setzub %dil # encoding: [0x62,0xf4,0x7f,0x18,0x42,0xc7]
+; SETZUCC-NEXT:    setzune %r8b # encoding: [0x62,0xd4,0x7f,0x18,0x45,0xc0]
+; SETZUCC-NEXT:    orb %dl, %dil # encoding: [0x40,0x08,0xd7]
+; SETZUCC-NEXT:    cltd # encoding: [0x99]
+; SETZUCC-NEXT:    idivl %esi # encoding: [0xf7,0xfe]
+; SETZUCC-NEXT:    testl %edx, %edx # encoding: [0x85,0xd2]
+; SETZUCC-NEXT:    setzue %al # encoding: [0x62,0xf4,0x7f,0x18,0x44,0xc0]
+; SETZUCC-NEXT:    andb %r8b, %al # encoding: [0x44,0x20,0xc0]
+; SETZUCC-NEXT:    orb %dil, %al # encoding: [0x40,0x08,0xf8]
+; SETZUCC-NEXT:    movb %al, (%rcx) # encoding: [0x88,0x01]
+; SETZUCC-NEXT:    retq # encoding: [0xc3]
 bb:
   %i = icmp eq i32 %a, 0
   %i2 = load i32, ptr %p, align 4
diff --git a/llvm/test/CodeGen/X86/apx/setzucc.ll b/llvm/test/CodeGen/X86/apx/setzucc.ll
index 6eb2d6966ecd8..7d95ae84ba018 100644
--- a/llvm/test/CodeGen/X86/apx/setzucc.ll
+++ b/llvm/test/CodeGen/X86/apx/setzucc.ll
@@ -1,5 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=x86_64 -mattr=+zu | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64 -mattr=+zu,-prefer-setzucc | FileCheck %s --check-prefixes=CHECK,PREFER_NO_SETZUCC
+; RUN: llc < %s -mtriple=x86_64 -mattr=+zu,+prefer-setzucc | FileCheck %s --check-prefixes=CHECK,PREFER_SETZUCC
 
 define i16 @i8(i8 %x) nounwind {
 ; CHECK-LABEL: i8:
@@ -48,28 +49,51 @@ define i64 @i64(i64 %x) nounwind {
 }
 
 define i32 @flags_copy_lowering() nounwind {
-; CHECK-LABEL: flags_copy_lowering:
-; CHECK:       # %bb.0: # %bb
-; CHECK-NEXT:    xorl %eax, %eax
-; CHECK-NEXT:    xorl %edx, %edx
-; CHECK-NEXT:    xorl %ecx, %ecx
-; CHECK-NEXT:    .p2align 4
-; CHECK-NEXT:  .LBB4_1: # %bb1
-; CHECK-NEXT:    # =>This Inner Loop Header: Depth=1
-; CHECK-NEXT:    addl %edx, 0
-; CHECK-NEXT:    setb %sil
-; CHECK-NEXT:    adcl $0, %ecx
-; CHECK-NEXT:    testb %sil, %sil
-; CHECK-NEXT:    je .LBB4_3
-; CHECK-NEXT:  # %bb.2: # %bb1
-; CHECK-NEXT:    # in Loop: Header=BB4_1 Depth=1
-; CHECK-NEXT:    xorl %edx, %edx
-; CHECK-NEXT:    movb %sil, %dl
-; CHECK-NEXT:    testb %al, %al
-; CHECK-NEXT:    jne .LBB4_1
-; CHECK-NEXT:  .LBB4_3: # %bb2
-; CHECK-NEXT:    xorl %eax, %eax
-; CHECK-NEXT:    retq
+; PREFER_NO_SETZUCC-LABEL: flags_copy_lowering:
+; PREFER_NO_SETZUCC:       # %bb.0: # %bb
+; PREFER_NO_SETZUCC-NEXT:    xorl %eax, %eax
+; PREFER_NO_SETZUCC-NEXT:    xorl %edx, %edx
+; PREFER_NO_SETZUCC-NEXT:    xorl %ecx, %ecx
+; PREFER_NO_SETZUCC-NEXT:    .p2align 4
+; PREFER_NO_SETZUCC-NEXT:  .LBB4_1: # %bb1
+; PREFER_NO_SETZUCC-NEXT:    # =>This Inner Loop Header: Depth=1
+; PREFER_NO_SETZUCC-NEXT:    addl %edx, 0
+; PREFER_NO_SETZUCC-NEXT:    setb %sil
+; PREFER_NO_SETZUCC-NEXT:    adcl $0, %ecx
+; PREFER_NO_SETZUCC-NEXT:    testb %sil, %sil
+; PREFER_NO_SETZUCC-NEXT:    je .LBB4_3
+; PREFER_NO_SETZUCC-NEXT:  # %bb.2: # %bb1
+; PREFER_NO_SETZUCC-NEXT:    # in Loop: Header=BB4_1 Depth=1
+; PREFER_NO_SETZUCC-NEXT:    xorl %edx, %edx
+; PREFER_NO_SETZUCC-NEXT:    movb %sil, %dl
+; PREFER_NO_SETZUCC-NEXT:    testb %al, %al
+; PREFER_NO_SETZUCC-NEXT:    jne .LBB4_1
+; PREFER_NO_SETZUCC-NEXT:  .LBB4_3: # %bb2
+; PREFER_NO_SETZUCC-NEXT:    xorl %eax, %eax
+; PREFER_NO_SETZUCC-NEXT:    retq
+;
+; PREFER_SETZUCC-LABEL: flags_copy_lowering:
+; PREFER_SETZUCC:       # %bb.0: # %bb
+; PREFER_SETZUCC-NEXT:    xorl %eax, %eax
+; PREFER_SETZUCC-NEXT:    xorl %edx, %edx
+; PREFER_SETZUCC-NEXT:    xorl %ecx, %ecx
+; PREFER_SETZUCC-NEXT:    .p2align 4
+; PREFER_SETZUCC-NEXT:  .LBB4_1: # %bb1
+; PREFER_SETZUCC-NEXT:    # =>This Inner Loop Header: Depth=1
+; PREFER_SETZUCC-NEXT:    addl %edx, 0
+; PREFER_SETZUCC-NEXT:    setzub %sil
+; PREFER_SETZUCC-NEXT:    adcl $0, %ecx
+; PREFER_SETZUCC-NEXT:    testb %sil, %sil
+; PREFER_SETZUCC-NEXT:    je .LBB4_3
+; PREFER_SETZUCC-NEXT:  # %bb.2: # %bb1
+; PREFER_SETZUCC-NEXT:    # in Loop: Header=BB4_1 Depth=1
+; PREFER_SETZUCC-NEXT:    xorl %edx, %edx
+; PREFER_SETZUCC-NEXT:    movb %sil, %dl
+; PREFER_SETZUCC-NEXT:    testb %al, %al
+; PREFER_SETZUCC-NEXT:    jne .LBB4_1
+; PREFER_SETZUCC-NEXT:  .LBB4_3: # %bb2
+; PREFER_SETZUCC-NEXT:    xorl %eax, %eax
+; PREFER_SETZUCC-NEXT:    retq
 bb:
   br label %bb1
 
diff --git a/llvm/test/CodeGen/X86/fast-isel-fcmp.ll b/llvm/test/CodeGen/X86/fast-isel-fcmp.ll
index b9ef3154cd1c3..b31c54ed78036 100644
--- a/llvm/test/CodeGen/X86/fast-isel-fcmp.ll
+++ b/llvm/test/CodeGen/X86/fast-isel-fcmp.ll
@@ -3,6 +3,8 @@
 ; RUN: llc < %s -fast-isel -fast-isel-abort=1 -mtriple=x86_64-apple-darwin10 | FileCheck %s --check-prefixes=FAST,FAST_NOAVX
 ; RUN: llc < %s -fast-isel -fast-isel-abort=1 -mtriple=x86_64-apple-darwin10 -mattr=avx | FileCheck %s --check-prefixes=FAST,FAST_AVX
 ; RUN: llc < %s -fast-isel -fast-isel-abort=1 -mtriple=x86_64-apple-darwin10 -mattr=avx512f | FileCheck %s --check-prefixes=FAST,FAST_AVX
+; RUN: llc < %s -fast-isel -fast-isel-abort=1 -mtriple=x86_64-apple-darwin10 -mattr=+zu,+prefer-setzucc | FileCheck %s --check-prefix=FAST_SETZUCC
+; RUN: llc < %s -fast-isel -fast-isel-abort=1 -mtriple=x86_64-apple-darwin10 -mattr=+zu,-prefer-setzucc | FileCheck %s --check-prefix=FAST_NO-SETZUCC
 
 define zeroext i1 @fcmp_oeq(float %x, float %y) {
 ; SDAG-LABEL: fcmp_oeq:
@@ -30,6 +32,24 @@ define zeroext i1 @fcmp_oeq(float %x, float %y) {
 ; FAST_AVX-NEXT:    andb %cl, %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_oeq:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzue %cl
+; FAST_SETZUCC-NEXT:    setzunp %al
+; FAST_SETZUCC-NEXT:    andb %cl, %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_oeq:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    sete %cl
+; FAST_NO-SETZUCC-NEXT:    setnp %al
+; FAST_NO-SETZUCC-NEXT:    andb %cl, %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp oeq float %x, %y
   ret i1 %1
 }
@@ -54,6 +74,20 @@ define zeroext i1 @fcmp_ogt(float %x, float %y) {
 ; FAST_AVX-NEXT:    seta %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ogt:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzua %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ogt:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    seta %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ogt float %x, %y
   ret i1 %1
 }
@@ -78,6 +112,20 @@ define zeroext i1 @fcmp_oge(float %x, float %y) {
 ; FAST_AVX-NEXT:    setae %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_oge:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzuae %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_oge:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setae %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp oge float %x, %y
   ret i1 %1
 }
@@ -102,6 +150,20 @@ define zeroext i1 @fcmp_olt(float %x, float %y) {
 ; FAST_AVX-NEXT:    seta %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_olt:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_SETZUCC-NEXT:    setzua %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_olt:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_NO-SETZUCC-NEXT:    seta %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp olt float %x, %y
   ret i1 %1
 }
@@ -126,6 +188,20 @@ define zeroext i1 @fcmp_ole(float %x, float %y) {
 ; FAST_AVX-NEXT:    setae %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ole:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_SETZUCC-NEXT:    setzuae %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ole:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_NO-SETZUCC-NEXT:    setae %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ole float %x, %y
   ret i1 %1
 }
@@ -150,6 +226,20 @@ define zeroext i1 @fcmp_one(float %x, float %y) {
 ; FAST_AVX-NEXT:    setne %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_one:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzune %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_one:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setne %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp one float %x, %y
   ret i1 %1
 }
@@ -174,6 +264,20 @@ define zeroext i1 @fcmp_ord(float %x, float %y) {
 ; FAST_AVX-NEXT:    setnp %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ord:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzunp %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ord:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setnp %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ord float %x, %y
   ret i1 %1
 }
@@ -198,6 +302,20 @@ define zeroext i1 @fcmp_uno(float %x, float %y) {
 ; FAST_AVX-NEXT:    setp %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_uno:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzup %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_uno:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setp %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp uno float %x, %y
   ret i1 %1
 }
@@ -222,6 +340,20 @@ define zeroext i1 @fcmp_ueq(float %x, float %y) {
 ; FAST_AVX-NEXT:    sete %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ueq:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzue %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ueq:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    sete %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ueq float %x, %y
   ret i1 %1
 }
@@ -246,6 +378,20 @@ define zeroext i1 @fcmp_ugt(float %x, float %y) {
 ; FAST_AVX-NEXT:    setb %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ugt:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_SETZUCC-NEXT:    setzub %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ugt:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_NO-SETZUCC-NEXT:    setb %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ugt float %x, %y
   ret i1 %1
 }
@@ -270,6 +416,20 @@ define zeroext i1 @fcmp_uge(float %x, float %y) {
 ; FAST_AVX-NEXT:    setbe %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_uge:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_SETZUCC-NEXT:    setzube %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_uge:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_NO-SETZUCC-NEXT:    setbe %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp uge float %x, %y
   ret i1 %1
 }
@@ -294,6 +454,20 @@ define zeroext i1 @fcmp_ult(float %x, float %y) {
 ; FAST_AVX-NEXT:    setb %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ult:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzub %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ult:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setb %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ult float %x, %y
   ret i1 %1
 }
@@ -318,6 +492,20 @@ define zeroext i1 @fcmp_ule(float %x, float %y) {
 ; FAST_AVX-NEXT:    setbe %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ule:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzube %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ule:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setbe %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ule float %x, %y
   ret i1 %1
 }
@@ -348,6 +536,24 @@ define zeroext i1 @fcmp_une(float %x, float %y) {
 ; FAST_AVX-NEXT:    orb %cl, %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_une:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzune %cl
+; FAST_SETZUCC-NEXT:    setzup %al
+; FAST_SETZUCC-NEXT:    orb %cl, %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_une:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setne %cl
+; FAST_NO-SETZUCC-NEXT:    setp %al
+; FAST_NO-SETZUCC-NEXT:    orb %cl, %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp une float %x, %y
   ret i1 %1
 }
@@ -365,6 +571,20 @@ define zeroext i1 @icmp_eq(i32 %x, i32 %y) {
 ; FAST-NEXT:    sete %al
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: icmp_eq:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_SETZUCC-NEXT:    setzue %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: icmp_eq:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_NO-SETZUCC-NEXT:    sete %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp eq i32 %x, %y
   ret i1 %1
 }
@@ -382,6 +602,20 @@ define zeroext i1 @icmp_ne(i32 %x, i32 %y) {
 ; FAST-NEXT:    setne %al
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: icmp_ne:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_SETZUCC-NEXT:    setzune %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: icmp_ne:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_NO-SETZUCC-NEXT:    setne %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp ne i32 %x, %y
   ret i1 %1
 }
@@ -399,6 +633,20 @@ define zeroext i1 @icmp_ugt(i32 %x, i32 %y) {
 ; FAST-NEXT:    seta %al
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: icmp_ugt:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_SETZUCC-NEXT:    setzua %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: icmp_ugt:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_NO-SETZUCC-NEXT:    seta %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp ugt i32 %x, %y
   ret i1 %1
 }
@@ -416,6 +664,20 @@ define zeroext i1 @icmp_uge(i32 %x, i32 %y) {
 ; FAST-NEXT:    setae %al
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: icmp_uge:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_SETZUCC-NEXT:    setzuae %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: icmp_uge:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_NO-SETZUCC-NEXT:    setae %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp uge i32 %x, %y
   ret i1 %1
 }
@@ -433,6 +695,20 @@ define zeroext i1 @icmp_ult(i32 %x, i32 %y) {
 ; FAST-NEXT:    setb %al
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: icmp_ult:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_SETZUCC-NEXT:    setzub %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: icmp_ult:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_NO-SETZUCC-NEXT:    setb %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp ult i32 %x, %y
   ret i1 %1
 }
@@ -450,6 +726,20 @@ define zeroext i1 @icmp_ule(i32 %x, i32 %y) {
 ; FAST-NEXT:    setbe %al
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: icmp_ule:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_SETZUCC-NEXT:    setzube %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: icmp_ule:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_NO-SETZUCC-NEXT:    setbe %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp ule i32 %x, %y
   ret i1 %1
 }
@@ -467,6 +757,20 @@ define zeroext i1 @icmp_sgt(i32 %x, i32 %y) {
 ; FAST-NEXT:    setg %al
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: icmp_sgt:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_SETZUCC-NEXT:    setzug %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: icmp_sgt:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_NO-SETZUCC-NEXT:    setg %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp sgt i32 %x, %y
   ret i1 %1
 }
@@ -484,6 +788,20 @@ define zeroext i1 @icmp_sge(i32 %x, i32 %y) {
 ; FAST-NEXT:    setge %al
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: icmp_sge:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_SETZUCC-NEXT:    setzuge %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: icmp_sge:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_NO-SETZUCC-NEXT:    setge %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp sge i32 %x, %y
   ret i1 %1
 }
@@ -501,6 +819,20 @@ define zeroext i1 @icmp_slt(i32 %x, i32 %y) {
 ; FAST-NEXT:    setl %al
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: icmp_slt:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_SETZUCC-NEXT:    setzul %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: icmp_slt:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_NO-SETZUCC-NEXT:    setl %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp slt i32 %x, %y
   ret i1 %1
 }
@@ -518,6 +850,20 @@ define zeroext i1 @icmp_sle(i32 %x, i32 %y) {
 ; FAST-NEXT:    setle %al
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: icmp_sle:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_SETZUCC-NEXT:    setzule %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: icmp_sle:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; FAST_NO-SETZUCC-NEXT:    setle %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp sle i32 %x, %y
   ret i1 %1
 }
@@ -543,6 +889,20 @@ define zeroext i1 @fcmp_oeq2(float %x) {
 ; FAST_AVX-NEXT:    setnp %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_oeq2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_SETZUCC-NEXT:    setzunp %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_oeq2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setnp %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp oeq float %x, %x
   ret i1 %1
 }
@@ -576,6 +936,26 @@ define zeroext i1 @fcmp_oeq3(float %x) {
 ; FAST_AVX-NEXT:    andb %cl, %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_oeq3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzue %cl
+; FAST_SETZUCC-NEXT:    setzunp %al
+; FAST_SETZUCC-NEXT:    andb %cl, %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_oeq3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    sete %cl
+; FAST_NO-SETZUCC-NEXT:    setnp %al
+; FAST_NO-SETZUCC-NEXT:    andb %cl, %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp oeq float %x, 0.000000e+00
   ret i1 %1
 }
@@ -592,6 +972,20 @@ define zeroext i1 @fcmp_ogt2(float %x) {
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    ## kill: def $al killed $al killed $eax
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ogt2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorl %eax, %eax
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    ## kill: def $al killed $al killed $eax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ogt2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorl %eax, %eax
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    ## kill: def $al killed $al killed $eax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ogt float %x, %x
   ret i1 %1
 }
@@ -619,6 +1013,22 @@ define zeroext i1 @fcmp_ogt3(float %x) {
 ; FAST_AVX-NEXT:    seta %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ogt3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzua %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ogt3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    seta %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ogt float %x, 0.000000e+00
   ret i1 %1
 }
@@ -643,6 +1053,20 @@ define zeroext i1 @fcmp_oge2(float %x) {
 ; FAST_AVX-NEXT:    setnp %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_oge2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_SETZUCC-NEXT:    setzunp %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_oge2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setnp %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp oge float %x, %x
   ret i1 %1
 }
@@ -670,6 +1094,22 @@ define zeroext i1 @fcmp_oge3(float %x) {
 ; FAST_AVX-NEXT:    setae %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_oge3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzuae %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_oge3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setae %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp oge float %x, 0.000000e+00
   ret i1 %1
 }
@@ -686,6 +1126,20 @@ define zeroext i1 @fcmp_olt2(float %x) {
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    ## kill: def $al killed $al killed $eax
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_olt2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorl %eax, %eax
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    ## kill: def $al killed $al killed $eax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_olt2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorl %eax, %eax
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    ## kill: def $al killed $al killed $eax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp olt float %x, %x
   ret i1 %1
 }
@@ -713,6 +1167,22 @@ define zeroext i1 @fcmp_olt3(float %x) {
 ; FAST_AVX-NEXT:    seta %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_olt3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_SETZUCC-NEXT:    setzua %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_olt3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_NO-SETZUCC-NEXT:    seta %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp olt float %x, 0.000000e+00
   ret i1 %1
 }
@@ -737,6 +1207,20 @@ define zeroext i1 @fcmp_ole2(float %x) {
 ; FAST_AVX-NEXT:    setnp %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ole2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_SETZUCC-NEXT:    setzunp %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ole2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setnp %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ole float %x, %x
   ret i1 %1
 }
@@ -764,6 +1248,22 @@ define zeroext i1 @fcmp_ole3(float %x) {
 ; FAST_AVX-NEXT:    setae %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ole3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_SETZUCC-NEXT:    setzuae %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ole3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_NO-SETZUCC-NEXT:    setae %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ole float %x, 0.000000e+00
   ret i1 %1
 }
@@ -780,6 +1280,20 @@ define zeroext i1 @fcmp_one2(float %x) {
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    ## kill: def $al killed $al killed $eax
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_one2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorl %eax, %eax
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    ## kill: def $al killed $al killed $eax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_one2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorl %eax, %eax
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    ## kill: def $al killed $al killed $eax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp one float %x, %x
   ret i1 %1
 }
@@ -807,6 +1321,22 @@ define zeroext i1 @fcmp_one3(float %x) {
 ; FAST_AVX-NEXT:    setne %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_one3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzune %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_one3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setne %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp one float %x, 0.000000e+00
   ret i1 %1
 }
@@ -831,6 +1361,20 @@ define zeroext i1 @fcmp_ord2(float %x) {
 ; FAST_AVX-NEXT:    setnp %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ord2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_SETZUCC-NEXT:    setzunp %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ord2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setnp %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ord float %x, %x
   ret i1 %1
 }
@@ -855,6 +1399,20 @@ define zeroext i1 @fcmp_ord3(float %x) {
 ; FAST_AVX-NEXT:    setnp %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ord3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_SETZUCC-NEXT:    setzunp %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ord3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setnp %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ord float %x, 0.000000e+00
   ret i1 %1
 }
@@ -879,6 +1437,20 @@ define zeroext i1 @fcmp_uno2(float %x) {
 ; FAST_AVX-NEXT:    setp %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_uno2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_SETZUCC-NEXT:    setzup %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_uno2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setp %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp uno float %x, %x
   ret i1 %1
 }
@@ -903,6 +1475,20 @@ define zeroext i1 @fcmp_uno3(float %x) {
 ; FAST_AVX-NEXT:    setp %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_uno3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_SETZUCC-NEXT:    setzup %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_uno3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setp %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp uno float %x, 0.000000e+00
   ret i1 %1
 }
@@ -918,6 +1504,18 @@ define zeroext i1 @fcmp_ueq2(float %x) {
 ; FAST-NEXT:    movb $1, %al
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ueq2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movb $1, %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ueq2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movb $1, %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ueq float %x, %x
   ret i1 %1
 }
@@ -945,6 +1543,22 @@ define zeroext i1 @fcmp_ueq3(float %x) {
 ; FAST_AVX-NEXT:    sete %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ueq3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzue %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ueq3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    sete %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ueq float %x, 0.000000e+00
   ret i1 %1
 }
@@ -969,6 +1583,20 @@ define zeroext i1 @fcmp_ugt2(float %x) {
 ; FAST_AVX-NEXT:    setp %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ugt2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_SETZUCC-NEXT:    setzup %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ugt2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setp %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ugt float %x, %x
   ret i1 %1
 }
@@ -996,6 +1624,22 @@ define zeroext i1 @fcmp_ugt3(float %x) {
 ; FAST_AVX-NEXT:    setb %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ugt3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_SETZUCC-NEXT:    setzub %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ugt3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_NO-SETZUCC-NEXT:    setb %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ugt float %x, 0.000000e+00
   ret i1 %1
 }
@@ -1011,6 +1655,18 @@ define zeroext i1 @fcmp_uge2(float %x) {
 ; FAST-NEXT:    movb $1, %al
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_uge2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movb $1, %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_uge2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movb $1, %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp uge float %x, %x
   ret i1 %1
 }
@@ -1038,6 +1694,22 @@ define zeroext i1 @fcmp_uge3(float %x) {
 ; FAST_AVX-NEXT:    setbe %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_uge3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_SETZUCC-NEXT:    setzube %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_uge3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm1
+; FAST_NO-SETZUCC-NEXT:    setbe %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp uge float %x, 0.000000e+00
   ret i1 %1
 }
@@ -1062,6 +1734,20 @@ define zeroext i1 @fcmp_ult2(float %x) {
 ; FAST_AVX-NEXT:    setp %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ult2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_SETZUCC-NEXT:    setzup %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ult2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setp %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ult float %x, %x
   ret i1 %1
 }
@@ -1089,6 +1775,22 @@ define zeroext i1 @fcmp_ult3(float %x) {
 ; FAST_AVX-NEXT:    setb %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ult3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzub %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ult3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setb %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ult float %x, 0.000000e+00
   ret i1 %1
 }
@@ -1104,6 +1806,18 @@ define zeroext i1 @fcmp_ule2(float %x) {
 ; FAST-NEXT:    movb $1, %al
 ; FAST-NEXT:    andb $1, %al
 ; FAST-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ule2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movb $1, %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ule2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movb $1, %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ule float %x, %x
   ret i1 %1
 }
@@ -1131,6 +1845,22 @@ define zeroext i1 @fcmp_ule3(float %x) {
 ; FAST_AVX-NEXT:    setbe %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_ule3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzube %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_ule3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setbe %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ule float %x, 0.000000e+00
   ret i1 %1
 }
@@ -1155,6 +1885,20 @@ define zeroext i1 @fcmp_une2(float %x) {
 ; FAST_AVX-NEXT:    setp %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_une2:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_SETZUCC-NEXT:    setzup %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_une2:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm0, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setp %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp une float %x, %x
   ret i1 %1
 }
@@ -1188,6 +1932,26 @@ define zeroext i1 @fcmp_une3(float %x) {
 ; FAST_AVX-NEXT:    orb %cl, %al
 ; FAST_AVX-NEXT:    andb $1, %al
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: fcmp_une3:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzune %cl
+; FAST_SETZUCC-NEXT:    setzup %al
+; FAST_SETZUCC-NEXT:    orb %cl, %al
+; FAST_SETZUCC-NEXT:    andb $1, %al
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: fcmp_une3:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    xorps %xmm1, %xmm1
+; FAST_NO-SETZUCC-NEXT:    ucomiss %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setne %cl
+; FAST_NO-SETZUCC-NEXT:    setp %al
+; FAST_NO-SETZUCC-NEXT:    orb %cl, %al
+; FAST_NO-SETZUCC-NEXT:    andb $1, %al
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp une float %x, 0.000000e+00
   ret i1 %1
 }
diff --git a/llvm/test/CodeGen/X86/fast-isel-select-cmov2.ll b/llvm/test/CodeGen/X86/fast-isel-select-cmov2.ll
index eb2bd08a2b14c..74feb3971ab6c 100644
--- a/llvm/test/CodeGen/X86/fast-isel-select-cmov2.ll
+++ b/llvm/test/CodeGen/X86/fast-isel-select-cmov2.ll
@@ -3,6 +3,8 @@
 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=CHECK --check-prefix=NOAVX --check-prefix=FAST
 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -fast-isel -fast-isel-abort=1 -mattr=avx | FileCheck %s --check-prefix=CHECK --check-prefix=FAST_AVX
 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -fast-isel -fast-isel-abort=1 -mattr=avx512f | FileCheck %s --check-prefix=CHECK --check-prefix=FAST_AVX
+; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -fast-isel -fast-isel-abort=1 -mattr=+zu,+prefer-setzucc | FileCheck %s --check-prefix=FAST_SETZUCC
+; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -fast-isel -fast-isel-abort=1 -mattr=+zu,-prefer-setzucc | FileCheck %s --check-prefix=FAST_NO-SETZUCC
 
 ; Test all the cmp predicates that can feed an integer conditional move.
 
@@ -11,6 +13,16 @@ define i64 @select_fcmp_false_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; CHECK:       ## %bb.0:
 ; CHECK-NEXT:    movq %rsi, %rax
 ; CHECK-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_false_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_false_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp false double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -44,6 +56,26 @@ define i64 @select_fcmp_oeq_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    testb %cl, %dl
 ; FAST_AVX-NEXT:    cmoveq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_oeq_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzunp %cl
+; FAST_SETZUCC-NEXT:    setzue %dl
+; FAST_SETZUCC-NEXT:    testb %cl, %dl
+; FAST_SETZUCC-NEXT:    cmoveq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_oeq_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setnp %cl
+; FAST_NO-SETZUCC-NEXT:    sete %dl
+; FAST_NO-SETZUCC-NEXT:    testb %cl, %dl
+; FAST_NO-SETZUCC-NEXT:    cmoveq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp oeq double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -63,6 +95,20 @@ define i64 @select_fcmp_ogt_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    vucomisd %xmm1, %xmm0
 ; FAST_AVX-NEXT:    cmovbeq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_ogt_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    cmovbeq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_ogt_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    cmovbeq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ogt double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -82,6 +128,20 @@ define i64 @select_fcmp_oge_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    vucomisd %xmm1, %xmm0
 ; FAST_AVX-NEXT:    cmovbq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_oge_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    cmovbq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_oge_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    cmovbq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp oge double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -101,6 +161,20 @@ define i64 @select_fcmp_olt_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    vucomisd %xmm0, %xmm1
 ; FAST_AVX-NEXT:    cmovbeq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_olt_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm0, %xmm1
+; FAST_SETZUCC-NEXT:    cmovbeq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_olt_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm0, %xmm1
+; FAST_NO-SETZUCC-NEXT:    cmovbeq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp olt double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -120,6 +194,20 @@ define i64 @select_fcmp_ole_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    vucomisd %xmm0, %xmm1
 ; FAST_AVX-NEXT:    cmovbq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_ole_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm0, %xmm1
+; FAST_SETZUCC-NEXT:    cmovbq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_ole_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm0, %xmm1
+; FAST_NO-SETZUCC-NEXT:    cmovbq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ole double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -139,6 +227,20 @@ define i64 @select_fcmp_one_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    vucomisd %xmm1, %xmm0
 ; FAST_AVX-NEXT:    cmoveq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_one_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    cmoveq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_one_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    cmoveq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp one double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -158,6 +260,20 @@ define i64 @select_fcmp_ord_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    vucomisd %xmm1, %xmm0
 ; FAST_AVX-NEXT:    cmovpq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_ord_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    cmovpq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_ord_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    cmovpq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ord double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -177,6 +293,20 @@ define i64 @select_fcmp_uno_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    vucomisd %xmm1, %xmm0
 ; FAST_AVX-NEXT:    cmovnpq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_uno_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    cmovnpq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_uno_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    cmovnpq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp uno double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -196,6 +326,20 @@ define i64 @select_fcmp_ueq_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    vucomisd %xmm1, %xmm0
 ; FAST_AVX-NEXT:    cmovneq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_ueq_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    cmovneq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_ueq_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    cmovneq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ueq double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -215,6 +359,20 @@ define i64 @select_fcmp_ugt_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    vucomisd %xmm0, %xmm1
 ; FAST_AVX-NEXT:    cmovaeq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_ugt_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm0, %xmm1
+; FAST_SETZUCC-NEXT:    cmovaeq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_ugt_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm0, %xmm1
+; FAST_NO-SETZUCC-NEXT:    cmovaeq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ugt double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -234,6 +392,20 @@ define i64 @select_fcmp_uge_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    vucomisd %xmm0, %xmm1
 ; FAST_AVX-NEXT:    cmovaq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_uge_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm0, %xmm1
+; FAST_SETZUCC-NEXT:    cmovaq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_uge_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm0, %xmm1
+; FAST_NO-SETZUCC-NEXT:    cmovaq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp uge double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -253,6 +425,20 @@ define i64 @select_fcmp_ult_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    vucomisd %xmm1, %xmm0
 ; FAST_AVX-NEXT:    cmovaeq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_ult_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    cmovaeq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_ult_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    cmovaeq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ult double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -272,6 +458,20 @@ define i64 @select_fcmp_ule_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    vucomisd %xmm1, %xmm0
 ; FAST_AVX-NEXT:    cmovaq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_ule_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    cmovaq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_ule_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    cmovaq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp ule double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -305,6 +505,26 @@ define i64 @select_fcmp_une_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; FAST_AVX-NEXT:    orb %cl, %dl
 ; FAST_AVX-NEXT:    cmoveq %rsi, %rax
 ; FAST_AVX-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_une_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_SETZUCC-NEXT:    setzup %cl
+; FAST_SETZUCC-NEXT:    setzune %dl
+; FAST_SETZUCC-NEXT:    orb %cl, %dl
+; FAST_SETZUCC-NEXT:    cmoveq %rsi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_une_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    ucomisd %xmm1, %xmm0
+; FAST_NO-SETZUCC-NEXT:    setp %cl
+; FAST_NO-SETZUCC-NEXT:    setne %dl
+; FAST_NO-SETZUCC-NEXT:    orb %cl, %dl
+; FAST_NO-SETZUCC-NEXT:    cmoveq %rsi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp une double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -315,6 +535,16 @@ define i64 @select_fcmp_true_cmov(double %a, double %b, i64 %c, i64 %d) {
 ; CHECK:       ## %bb.0:
 ; CHECK-NEXT:    movq %rdi, %rax
 ; CHECK-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_fcmp_true_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_fcmp_true_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdi, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = fcmp true double %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -327,6 +557,20 @@ define i64 @select_icmp_eq_cmov(i64 %a, i64 %b, i64 %c, i64 %d) {
 ; CHECK-NEXT:    cmpq %rsi, %rdi
 ; CHECK-NEXT:    cmovneq %rcx, %rax
 ; CHECK-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_icmp_eq_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_SETZUCC-NEXT:    cmovneq %rcx, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_icmp_eq_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_NO-SETZUCC-NEXT:    cmovneq %rcx, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp eq i64 %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -339,6 +583,20 @@ define i64 @select_icmp_ne_cmov(i64 %a, i64 %b, i64 %c, i64 %d) {
 ; CHECK-NEXT:    cmpq %rsi, %rdi
 ; CHECK-NEXT:    cmoveq %rcx, %rax
 ; CHECK-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_icmp_ne_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_SETZUCC-NEXT:    cmoveq %rcx, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_icmp_ne_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_NO-SETZUCC-NEXT:    cmoveq %rcx, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp ne i64 %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -351,6 +609,20 @@ define i64 @select_icmp_ugt_cmov(i64 %a, i64 %b, i64 %c, i64 %d) {
 ; CHECK-NEXT:    cmpq %rsi, %rdi
 ; CHECK-NEXT:    cmovbeq %rcx, %rax
 ; CHECK-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_icmp_ugt_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_SETZUCC-NEXT:    cmovbeq %rcx, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_icmp_ugt_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_NO-SETZUCC-NEXT:    cmovbeq %rcx, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp ugt i64 %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -364,6 +636,20 @@ define i64 @select_icmp_uge_cmov(i64 %a, i64 %b, i64 %c, i64 %d) {
 ; CHECK-NEXT:    cmpq %rsi, %rdi
 ; CHECK-NEXT:    cmovbq %rcx, %rax
 ; CHECK-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_icmp_uge_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_SETZUCC-NEXT:    cmovbq %rcx, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_icmp_uge_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_NO-SETZUCC-NEXT:    cmovbq %rcx, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp uge i64 %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -376,6 +662,20 @@ define i64 @select_icmp_ult_cmov(i64 %a, i64 %b, i64 %c, i64 %d) {
 ; CHECK-NEXT:    cmpq %rsi, %rdi
 ; CHECK-NEXT:    cmovaeq %rcx, %rax
 ; CHECK-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_icmp_ult_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_SETZUCC-NEXT:    cmovaeq %rcx, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_icmp_ult_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_NO-SETZUCC-NEXT:    cmovaeq %rcx, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp ult i64 %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -388,6 +688,20 @@ define i64 @select_icmp_ule_cmov(i64 %a, i64 %b, i64 %c, i64 %d) {
 ; CHECK-NEXT:    cmpq %rsi, %rdi
 ; CHECK-NEXT:    cmovaq %rcx, %rax
 ; CHECK-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_icmp_ule_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_SETZUCC-NEXT:    cmovaq %rcx, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_icmp_ule_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_NO-SETZUCC-NEXT:    cmovaq %rcx, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp ule i64 %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -400,6 +714,20 @@ define i64 @select_icmp_sgt_cmov(i64 %a, i64 %b, i64 %c, i64 %d) {
 ; CHECK-NEXT:    cmpq %rsi, %rdi
 ; CHECK-NEXT:    cmovleq %rcx, %rax
 ; CHECK-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_icmp_sgt_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_SETZUCC-NEXT:    cmovleq %rcx, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_icmp_sgt_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_NO-SETZUCC-NEXT:    cmovleq %rcx, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp sgt i64 %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -412,6 +740,20 @@ define i64 @select_icmp_sge_cmov(i64 %a, i64 %b, i64 %c, i64 %d) {
 ; CHECK-NEXT:    cmpq %rsi, %rdi
 ; CHECK-NEXT:    cmovlq %rcx, %rax
 ; CHECK-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_icmp_sge_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_SETZUCC-NEXT:    cmovlq %rcx, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_icmp_sge_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_NO-SETZUCC-NEXT:    cmovlq %rcx, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp sge i64 %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -424,6 +766,20 @@ define i64 @select_icmp_slt_cmov(i64 %a, i64 %b, i64 %c, i64 %d) {
 ; CHECK-NEXT:    cmpq %rsi, %rdi
 ; CHECK-NEXT:    cmovgeq %rcx, %rax
 ; CHECK-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_icmp_slt_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_SETZUCC-NEXT:    cmovgeq %rcx, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_icmp_slt_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_NO-SETZUCC-NEXT:    cmovgeq %rcx, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp slt i64 %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
@@ -436,6 +792,20 @@ define i64 @select_icmp_sle_cmov(i64 %a, i64 %b, i64 %c, i64 %d) {
 ; CHECK-NEXT:    cmpq %rsi, %rdi
 ; CHECK-NEXT:    cmovgq %rcx, %rax
 ; CHECK-NEXT:    retq
+;
+; FAST_SETZUCC-LABEL: select_icmp_sle_cmov:
+; FAST_SETZUCC:       ## %bb.0:
+; FAST_SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_SETZUCC-NEXT:    cmovgq %rcx, %rax
+; FAST_SETZUCC-NEXT:    retq
+;
+; FAST_NO-SETZUCC-LABEL: select_icmp_sle_cmov:
+; FAST_NO-SETZUCC:       ## %bb.0:
+; FAST_NO-SETZUCC-NEXT:    movq %rdx, %rax
+; FAST_NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; FAST_NO-SETZUCC-NEXT:    cmovgq %rcx, %rax
+; FAST_NO-SETZUCC-NEXT:    retq
   %1 = icmp sle i64 %a, %b
   %2 = select i1 %1, i64 %c, i64 %d
   ret i64 %2
diff --git a/llvm/test/CodeGen/X86/pr27591.ll b/llvm/test/CodeGen/X86/pr27591.ll
index c3c15e7bac959..b01ee9ab75b99 100644
--- a/llvm/test/CodeGen/X86/pr27591.ll
+++ b/llvm/test/CodeGen/X86/pr27591.ll
@@ -1,5 +1,8 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc -o - -O0 < %s | FileCheck %s
+; RUN: llc -mattr=+zu,+prefer-setzucc -o - -O0 < %s | FileCheck %s -check-prefix=SETZUCC
+; RUN: llc -mattr=+zu,-prefer-setzucc -o - -O0 < %s | FileCheck %s -check-prefix=NO-SETZUCC
+
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
@@ -14,6 +17,28 @@ define void @test1(i32 %x) #0 {
 ; CHECK-NEXT:    callq callee1 at PLT
 ; CHECK-NEXT:    popq %rax
 ; CHECK-NEXT:    retq
+;
+; SETZUCC-LABEL: test1:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    pushq %rax
+; SETZUCC-NEXT:    cmpl $0, %edi
+; SETZUCC-NEXT:    setzune %al
+; SETZUCC-NEXT:    movzbl %al, %edi
+; SETZUCC-NEXT:    andl $1, %edi
+; SETZUCC-NEXT:    callq callee1 at PLT
+; SETZUCC-NEXT:    popq %rax
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: test1:
+; NO-SETZUCC:       # %bb.0: # %entry
+; NO-SETZUCC-NEXT:    pushq %rax
+; NO-SETZUCC-NEXT:    cmpl $0, %edi
+; NO-SETZUCC-NEXT:    setne %al
+; NO-SETZUCC-NEXT:    movzbl %al, %edi
+; NO-SETZUCC-NEXT:    andl $1, %edi
+; NO-SETZUCC-NEXT:    callq callee1 at PLT
+; NO-SETZUCC-NEXT:    popq %rax
+; NO-SETZUCC-NEXT:    retq
 entry:
   %tobool = icmp ne i32 %x, 0
   call void @callee1(i1 zeroext %tobool)
@@ -32,6 +57,30 @@ define void @test2(i32 %x) #0 {
 ; CHECK-NEXT:    callq callee2 at PLT
 ; CHECK-NEXT:    popq %rax
 ; CHECK-NEXT:    retq
+;
+; SETZUCC-LABEL: test2:
+; SETZUCC:       # %bb.0: # %entry
+; SETZUCC-NEXT:    pushq %rax
+; SETZUCC-NEXT:    cmpl $0, %edi
+; SETZUCC-NEXT:    setzune %al
+; SETZUCC-NEXT:    movzbl %al, %edi
+; SETZUCC-NEXT:    andl $1, %edi
+; SETZUCC-NEXT:    negl %edi
+; SETZUCC-NEXT:    callq callee2 at PLT
+; SETZUCC-NEXT:    popq %rax
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: test2:
+; NO-SETZUCC:       # %bb.0: # %entry
+; NO-SETZUCC-NEXT:    pushq %rax
+; NO-SETZUCC-NEXT:    cmpl $0, %edi
+; NO-SETZUCC-NEXT:    setne %al
+; NO-SETZUCC-NEXT:    movzbl %al, %edi
+; NO-SETZUCC-NEXT:    andl $1, %edi
+; NO-SETZUCC-NEXT:    negl %edi
+; NO-SETZUCC-NEXT:    callq callee2 at PLT
+; NO-SETZUCC-NEXT:    popq %rax
+; NO-SETZUCC-NEXT:    retq
 entry:
   %tobool = icmp ne i32 %x, 0
   call void @callee2(i1 signext %tobool)
diff --git a/llvm/test/CodeGen/X86/pr32284.ll b/llvm/test/CodeGen/X86/pr32284.ll
index 8a726a469b61e..42a7ba82710b5 100644
--- a/llvm/test/CodeGen/X86/pr32284.ll
+++ b/llvm/test/CodeGen/X86/pr32284.ll
@@ -3,6 +3,13 @@
 ; RUN: llc     -mtriple=x86_64-unknown -mcpu=skx -o - %s | FileCheck %s --check-prefix=X64
 ; RUN: llc -O0 -mtriple=i686-unknown   -mcpu=skx -o - %s | FileCheck %s --check-prefix=X86-O0
 ; RUN: llc     -mtriple=i686-unknown   -mcpu=skx -o - %s | FileCheck %s --check-prefix=X86
+; RUN: llc -O0 -mtriple=x86_64-unknown -mcpu=skx -mattr=+zu,+prefer-setzucc -o - %s | FileCheck %s --check-prefix=X64-O0-SETZUCC
+; RUN: llc -O0 -mtriple=x86_64-unknown -mcpu=skx -mattr=+zu,-prefer-setzucc -o - %s | FileCheck %s --check-prefix=X64-O0-NO-SETZUCC
+; RUN: llc     -mtriple=x86_64-unknown -mcpu=skx -mattr=+zu,+prefer-setzucc -o - %s | FileCheck %s --check-prefix=X64-SETZUCC
+; RUN: llc     -mtriple=x86_64-unknown -mcpu=skx -mattr=+zu,-prefer-setzucc -o - %s | FileCheck %s --check-prefix=X64-NO-SETZUCC
+
+; The test is to check if setzucc instruction is emitted when prefer-setzucc
+; feature is specified in llc option.
 
 @c = external dso_local constant i8, align 1
 
@@ -89,6 +96,84 @@ define void @foo() {
 ; X86-NEXT:    addl $8, %esp
 ; X86-NEXT:    .cfi_def_cfa_offset 4
 ; X86-NEXT:    retl
+;
+; X64-O0-SETZUCC-LABEL: foo:
+; X64-O0-SETZUCC:       # %bb.0: # %entry
+; X64-O0-SETZUCC-NEXT:    movzbl c, %ecx
+; X64-O0-SETZUCC-NEXT:    xorl %eax, %eax
+; X64-O0-SETZUCC-NEXT:    subl %ecx, %eax
+; X64-O0-SETZUCC-NEXT:    movslq %eax, %rcx
+; X64-O0-SETZUCC-NEXT:    xorl %eax, %eax
+; X64-O0-SETZUCC-NEXT:    # kill: def $rax killed $eax
+; X64-O0-SETZUCC-NEXT:    subq %rcx, %rax
+; X64-O0-SETZUCC-NEXT:    # kill: def $al killed $al killed $rax
+; X64-O0-SETZUCC-NEXT:    cmpb $0, %al
+; X64-O0-SETZUCC-NEXT:    setzune %al
+; X64-O0-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-SETZUCC-NEXT:    movb %al, -{{[0-9]+}}(%rsp)
+; X64-O0-SETZUCC-NEXT:    cmpb $0, c
+; X64-O0-SETZUCC-NEXT:    setzune %al
+; X64-O0-SETZUCC-NEXT:    xorb $-1, %al
+; X64-O0-SETZUCC-NEXT:    xorb $-1, %al
+; X64-O0-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-SETZUCC-NEXT:    movzbl c, %ecx
+; X64-O0-SETZUCC-NEXT:    cmpl %ecx, %eax
+; X64-O0-SETZUCC-NEXT:    setzule %al
+; X64-O0-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-SETZUCC-NEXT:    movl %eax, -{{[0-9]+}}(%rsp)
+; X64-O0-SETZUCC-NEXT:    retq
+;
+; X64-O0-NO-SETZUCC-LABEL: foo:
+; X64-O0-NO-SETZUCC:       # %bb.0: # %entry
+; X64-O0-NO-SETZUCC-NEXT:    movzbl c, %ecx
+; X64-O0-NO-SETZUCC-NEXT:    xorl %eax, %eax
+; X64-O0-NO-SETZUCC-NEXT:    subl %ecx, %eax
+; X64-O0-NO-SETZUCC-NEXT:    movslq %eax, %rcx
+; X64-O0-NO-SETZUCC-NEXT:    xorl %eax, %eax
+; X64-O0-NO-SETZUCC-NEXT:    # kill: def $rax killed $eax
+; X64-O0-NO-SETZUCC-NEXT:    subq %rcx, %rax
+; X64-O0-NO-SETZUCC-NEXT:    # kill: def $al killed $al killed $rax
+; X64-O0-NO-SETZUCC-NEXT:    cmpb $0, %al
+; X64-O0-NO-SETZUCC-NEXT:    setne %al
+; X64-O0-NO-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-NO-SETZUCC-NEXT:    movb %al, -{{[0-9]+}}(%rsp)
+; X64-O0-NO-SETZUCC-NEXT:    cmpb $0, c
+; X64-O0-NO-SETZUCC-NEXT:    setne %al
+; X64-O0-NO-SETZUCC-NEXT:    xorb $-1, %al
+; X64-O0-NO-SETZUCC-NEXT:    xorb $-1, %al
+; X64-O0-NO-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-NO-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-NO-SETZUCC-NEXT:    movzbl c, %ecx
+; X64-O0-NO-SETZUCC-NEXT:    cmpl %ecx, %eax
+; X64-O0-NO-SETZUCC-NEXT:    setle %al
+; X64-O0-NO-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-NO-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-NO-SETZUCC-NEXT:    movl %eax, -{{[0-9]+}}(%rsp)
+; X64-O0-NO-SETZUCC-NEXT:    retq
+;
+; X64-SETZUCC-LABEL: foo:
+; X64-SETZUCC:       # %bb.0: # %entry
+; X64-SETZUCC-NEXT:    movzbl c(%rip), %eax
+; X64-SETZUCC-NEXT:    testl %eax, %eax
+; X64-SETZUCC-NEXT:    setzune %cl
+; X64-SETZUCC-NEXT:    setne -{{[0-9]+}}(%rsp)
+; X64-SETZUCC-NEXT:    cmpl %eax, %ecx
+; X64-SETZUCC-NEXT:    setzule %al
+; X64-SETZUCC-NEXT:    movl %eax, -{{[0-9]+}}(%rsp)
+; X64-SETZUCC-NEXT:    retq
+;
+; X64-NO-SETZUCC-LABEL: foo:
+; X64-NO-SETZUCC:       # %bb.0: # %entry
+; X64-NO-SETZUCC-NEXT:    movzbl c(%rip), %eax
+; X64-NO-SETZUCC-NEXT:    testl %eax, %eax
+; X64-NO-SETZUCC-NEXT:    setzune %cl
+; X64-NO-SETZUCC-NEXT:    setne -{{[0-9]+}}(%rsp)
+; X64-NO-SETZUCC-NEXT:    cmpl %eax, %ecx
+; X64-NO-SETZUCC-NEXT:    setzule %al
+; X64-NO-SETZUCC-NEXT:    movl %eax, -{{[0-9]+}}(%rsp)
+; X64-NO-SETZUCC-NEXT:    retq
 entry:
   %a = alloca i8, align 1
   %b = alloca i32, align 4
@@ -255,6 +340,112 @@ define void @f1() {
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    .cfi_def_cfa_offset 4
 ; X86-NEXT:    retl
+;
+; X64-O0-SETZUCC-LABEL: f1:
+; X64-O0-SETZUCC:       # %bb.0: # %entry
+; X64-O0-SETZUCC-NEXT:    movslq var_5, %rax
+; X64-O0-SETZUCC-NEXT:    movabsq $8381627093, %rcx # imm = 0x1F3957AD5
+; X64-O0-SETZUCC-NEXT:    addq %rcx, %rax
+; X64-O0-SETZUCC-NEXT:    cmpq $0, %rax
+; X64-O0-SETZUCC-NEXT:    setzune %al
+; X64-O0-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-SETZUCC-NEXT:    movb %al, -{{[0-9]+}}(%rsp)
+; X64-O0-SETZUCC-NEXT:    movl var_5, %eax
+; X64-O0-SETZUCC-NEXT:    xorl $-1, %eax
+; X64-O0-SETZUCC-NEXT:    cmpl $0, %eax
+; X64-O0-SETZUCC-NEXT:    setzune %al
+; X64-O0-SETZUCC-NEXT:    xorb $-1, %al
+; X64-O0-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-SETZUCC-NEXT:    # kill: def $rax killed $eax
+; X64-O0-SETZUCC-NEXT:    movslq var_5, %rcx
+; X64-O0-SETZUCC-NEXT:    addq $7093, %rcx # imm = 0x1BB5
+; X64-O0-SETZUCC-NEXT:    cmpq %rcx, %rax
+; X64-O0-SETZUCC-NEXT:    setzug %al
+; X64-O0-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-SETZUCC-NEXT:    # kill: def $rax killed $eax
+; X64-O0-SETZUCC-NEXT:    movq %rax, var_57
+; X64-O0-SETZUCC-NEXT:    movl var_5, %eax
+; X64-O0-SETZUCC-NEXT:    xorl $-1, %eax
+; X64-O0-SETZUCC-NEXT:    cmpl $0, %eax
+; X64-O0-SETZUCC-NEXT:    setzune %al
+; X64-O0-SETZUCC-NEXT:    xorb $-1, %al
+; X64-O0-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-SETZUCC-NEXT:    # kill: def $rax killed $eax
+; X64-O0-SETZUCC-NEXT:    movq %rax, _ZN8struct_210member_2_0E
+; X64-O0-SETZUCC-NEXT:    retq
+;
+; X64-O0-NO-SETZUCC-LABEL: f1:
+; X64-O0-NO-SETZUCC:       # %bb.0: # %entry
+; X64-O0-NO-SETZUCC-NEXT:    movslq var_5, %rax
+; X64-O0-NO-SETZUCC-NEXT:    movabsq $8381627093, %rcx # imm = 0x1F3957AD5
+; X64-O0-NO-SETZUCC-NEXT:    addq %rcx, %rax
+; X64-O0-NO-SETZUCC-NEXT:    cmpq $0, %rax
+; X64-O0-NO-SETZUCC-NEXT:    setne %al
+; X64-O0-NO-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-NO-SETZUCC-NEXT:    movb %al, -{{[0-9]+}}(%rsp)
+; X64-O0-NO-SETZUCC-NEXT:    movl var_5, %eax
+; X64-O0-NO-SETZUCC-NEXT:    xorl $-1, %eax
+; X64-O0-NO-SETZUCC-NEXT:    cmpl $0, %eax
+; X64-O0-NO-SETZUCC-NEXT:    setne %al
+; X64-O0-NO-SETZUCC-NEXT:    xorb $-1, %al
+; X64-O0-NO-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-NO-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-NO-SETZUCC-NEXT:    # kill: def $rax killed $eax
+; X64-O0-NO-SETZUCC-NEXT:    movslq var_5, %rcx
+; X64-O0-NO-SETZUCC-NEXT:    addq $7093, %rcx # imm = 0x1BB5
+; X64-O0-NO-SETZUCC-NEXT:    cmpq %rcx, %rax
+; X64-O0-NO-SETZUCC-NEXT:    setg %al
+; X64-O0-NO-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-NO-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-NO-SETZUCC-NEXT:    # kill: def $rax killed $eax
+; X64-O0-NO-SETZUCC-NEXT:    movq %rax, var_57
+; X64-O0-NO-SETZUCC-NEXT:    movl var_5, %eax
+; X64-O0-NO-SETZUCC-NEXT:    xorl $-1, %eax
+; X64-O0-NO-SETZUCC-NEXT:    cmpl $0, %eax
+; X64-O0-NO-SETZUCC-NEXT:    setne %al
+; X64-O0-NO-SETZUCC-NEXT:    xorb $-1, %al
+; X64-O0-NO-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-NO-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-NO-SETZUCC-NEXT:    # kill: def $rax killed $eax
+; X64-O0-NO-SETZUCC-NEXT:    movq %rax, _ZN8struct_210member_2_0E
+; X64-O0-NO-SETZUCC-NEXT:    retq
+;
+; X64-SETZUCC-LABEL: f1:
+; X64-SETZUCC:       # %bb.0: # %entry
+; X64-SETZUCC-NEXT:    movslq var_5(%rip), %rax
+; X64-SETZUCC-NEXT:    movabsq $-8381627093, %rcx # imm = 0xFFFFFFFE0C6A852B
+; X64-SETZUCC-NEXT:    cmpq %rcx, %rax
+; X64-SETZUCC-NEXT:    setne -{{[0-9]+}}(%rsp)
+; X64-SETZUCC-NEXT:    cmpq $-1, %rax
+; X64-SETZUCC-NEXT:    setzue %cl
+; X64-SETZUCC-NEXT:    cmpl $-1, %eax
+; X64-SETZUCC-NEXT:    setzue %dl
+; X64-SETZUCC-NEXT:    addq $7093, %rax # imm = 0x1BB5
+; X64-SETZUCC-NEXT:    cmpq %rax, %rdx
+; X64-SETZUCC-NEXT:    setzug %al
+; X64-SETZUCC-NEXT:    movq %rax, var_57(%rip)
+; X64-SETZUCC-NEXT:    movq %rcx, _ZN8struct_210member_2_0E(%rip)
+; X64-SETZUCC-NEXT:    retq
+;
+; X64-NO-SETZUCC-LABEL: f1:
+; X64-NO-SETZUCC:       # %bb.0: # %entry
+; X64-NO-SETZUCC-NEXT:    movslq var_5(%rip), %rax
+; X64-NO-SETZUCC-NEXT:    movabsq $-8381627093, %rcx # imm = 0xFFFFFFFE0C6A852B
+; X64-NO-SETZUCC-NEXT:    cmpq %rcx, %rax
+; X64-NO-SETZUCC-NEXT:    setne -{{[0-9]+}}(%rsp)
+; X64-NO-SETZUCC-NEXT:    cmpq $-1, %rax
+; X64-NO-SETZUCC-NEXT:    setzue %cl
+; X64-NO-SETZUCC-NEXT:    cmpl $-1, %eax
+; X64-NO-SETZUCC-NEXT:    setzue %dl
+; X64-NO-SETZUCC-NEXT:    addq $7093, %rax # imm = 0x1BB5
+; X64-NO-SETZUCC-NEXT:    cmpq %rax, %rdx
+; X64-NO-SETZUCC-NEXT:    setzug %al
+; X64-NO-SETZUCC-NEXT:    movq %rax, var_57(%rip)
+; X64-NO-SETZUCC-NEXT:    movq %rcx, _ZN8struct_210member_2_0E(%rip)
+; X64-NO-SETZUCC-NEXT:    retq
 entry:
   %a = alloca i8, align 1
   %0 = load i32, ptr @var_5, align 4
@@ -376,6 +567,84 @@ define void @f2() {
 ; X86-NEXT:    addl $2, %esp
 ; X86-NEXT:    .cfi_def_cfa_offset 4
 ; X86-NEXT:    retl
+;
+; X64-O0-SETZUCC-LABEL: f2:
+; X64-O0-SETZUCC:       # %bb.0: # %entry
+; X64-O0-SETZUCC-NEXT:    movzbl var_7, %eax
+; X64-O0-SETZUCC-NEXT:    cmpb $0, var_7
+; X64-O0-SETZUCC-NEXT:    setzune %cl
+; X64-O0-SETZUCC-NEXT:    xorb $-1, %cl
+; X64-O0-SETZUCC-NEXT:    andb $1, %cl
+; X64-O0-SETZUCC-NEXT:    movzbl %cl, %ecx
+; X64-O0-SETZUCC-NEXT:    xorl %ecx, %eax
+; X64-O0-SETZUCC-NEXT:    # kill: def $ax killed $ax killed $eax
+; X64-O0-SETZUCC-NEXT:    movw %ax, -{{[0-9]+}}(%rsp)
+; X64-O0-SETZUCC-NEXT:    movzbl var_7, %eax
+; X64-O0-SETZUCC-NEXT:    # kill: def $ax killed $ax killed $eax
+; X64-O0-SETZUCC-NEXT:    cmpw $0, %ax
+; X64-O0-SETZUCC-NEXT:    setzune %al
+; X64-O0-SETZUCC-NEXT:    xorb $-1, %al
+; X64-O0-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-SETZUCC-NEXT:    movzbl var_7, %ecx
+; X64-O0-SETZUCC-NEXT:    cmpl %ecx, %eax
+; X64-O0-SETZUCC-NEXT:    setzue %al
+; X64-O0-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-SETZUCC-NEXT:    movw %ax, %cx
+; X64-O0-SETZUCC-NEXT:    # implicit-def: $rax
+; X64-O0-SETZUCC-NEXT:    movw %cx, (%rax)
+; X64-O0-SETZUCC-NEXT:    retq
+;
+; X64-O0-NO-SETZUCC-LABEL: f2:
+; X64-O0-NO-SETZUCC:       # %bb.0: # %entry
+; X64-O0-NO-SETZUCC-NEXT:    movzbl var_7, %eax
+; X64-O0-NO-SETZUCC-NEXT:    cmpb $0, var_7
+; X64-O0-NO-SETZUCC-NEXT:    setne %cl
+; X64-O0-NO-SETZUCC-NEXT:    xorb $-1, %cl
+; X64-O0-NO-SETZUCC-NEXT:    andb $1, %cl
+; X64-O0-NO-SETZUCC-NEXT:    movzbl %cl, %ecx
+; X64-O0-NO-SETZUCC-NEXT:    xorl %ecx, %eax
+; X64-O0-NO-SETZUCC-NEXT:    # kill: def $ax killed $ax killed $eax
+; X64-O0-NO-SETZUCC-NEXT:    movw %ax, -{{[0-9]+}}(%rsp)
+; X64-O0-NO-SETZUCC-NEXT:    movzbl var_7, %eax
+; X64-O0-NO-SETZUCC-NEXT:    # kill: def $ax killed $ax killed $eax
+; X64-O0-NO-SETZUCC-NEXT:    cmpw $0, %ax
+; X64-O0-NO-SETZUCC-NEXT:    setne %al
+; X64-O0-NO-SETZUCC-NEXT:    xorb $-1, %al
+; X64-O0-NO-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-NO-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-NO-SETZUCC-NEXT:    movzbl var_7, %ecx
+; X64-O0-NO-SETZUCC-NEXT:    cmpl %ecx, %eax
+; X64-O0-NO-SETZUCC-NEXT:    sete %al
+; X64-O0-NO-SETZUCC-NEXT:    andb $1, %al
+; X64-O0-NO-SETZUCC-NEXT:    movzbl %al, %eax
+; X64-O0-NO-SETZUCC-NEXT:    movw %ax, %cx
+; X64-O0-NO-SETZUCC-NEXT:    # implicit-def: $rax
+; X64-O0-NO-SETZUCC-NEXT:    movw %cx, (%rax)
+; X64-O0-NO-SETZUCC-NEXT:    retq
+;
+; X64-SETZUCC-LABEL: f2:
+; X64-SETZUCC:       # %bb.0: # %entry
+; X64-SETZUCC-NEXT:    movzbl var_7(%rip), %eax
+; X64-SETZUCC-NEXT:    testl %eax, %eax
+; X64-SETZUCC-NEXT:    setzue %cl
+; X64-SETZUCC-NEXT:    xorl %eax, %ecx
+; X64-SETZUCC-NEXT:    movw %cx, -{{[0-9]+}}(%rsp)
+; X64-SETZUCC-NEXT:    setzue %al
+; X64-SETZUCC-NEXT:    movw %ax, (%rax)
+; X64-SETZUCC-NEXT:    retq
+;
+; X64-NO-SETZUCC-LABEL: f2:
+; X64-NO-SETZUCC:       # %bb.0: # %entry
+; X64-NO-SETZUCC-NEXT:    movzbl var_7(%rip), %eax
+; X64-NO-SETZUCC-NEXT:    testl %eax, %eax
+; X64-NO-SETZUCC-NEXT:    setzue %cl
+; X64-NO-SETZUCC-NEXT:    xorl %eax, %ecx
+; X64-NO-SETZUCC-NEXT:    movw %cx, -{{[0-9]+}}(%rsp)
+; X64-NO-SETZUCC-NEXT:    setzue %al
+; X64-NO-SETZUCC-NEXT:    movw %ax, (%rax)
+; X64-NO-SETZUCC-NEXT:    retq
 entry:
   %a = alloca i16, align 2
   %0 = load i8, ptr @var_7, align 1
@@ -516,6 +785,106 @@ define void @f3() #0 {
 ; X86-NEXT:    popl %ebp
 ; X86-NEXT:    .cfi_def_cfa %esp, 4
 ; X86-NEXT:    retl
+;
+; X64-O0-SETZUCC-LABEL: f3:
+; X64-O0-SETZUCC:       # %bb.0: # %entry
+; X64-O0-SETZUCC-NEXT:    movl var_13, %eax
+; X64-O0-SETZUCC-NEXT:    xorl $-1, %eax
+; X64-O0-SETZUCC-NEXT:    movl %eax, %eax
+; X64-O0-SETZUCC-NEXT:    # kill: def $rax killed $eax
+; X64-O0-SETZUCC-NEXT:    cmpl $0, var_13
+; X64-O0-SETZUCC-NEXT:    setzune %cl
+; X64-O0-SETZUCC-NEXT:    xorb $-1, %cl
+; X64-O0-SETZUCC-NEXT:    andb $1, %cl
+; X64-O0-SETZUCC-NEXT:    movzbl %cl, %ecx
+; X64-O0-SETZUCC-NEXT:    # kill: def $rcx killed $ecx
+; X64-O0-SETZUCC-NEXT:    movl var_13, %edx
+; X64-O0-SETZUCC-NEXT:    xorl $-1, %edx
+; X64-O0-SETZUCC-NEXT:    xorl var_16, %edx
+; X64-O0-SETZUCC-NEXT:    movl %edx, %edx
+; X64-O0-SETZUCC-NEXT:    # kill: def $rdx killed $edx
+; X64-O0-SETZUCC-NEXT:    andq %rdx, %rcx
+; X64-O0-SETZUCC-NEXT:    orq %rcx, %rax
+; X64-O0-SETZUCC-NEXT:    movq %rax, -{{[0-9]+}}(%rsp)
+; X64-O0-SETZUCC-NEXT:    movl var_13, %eax
+; X64-O0-SETZUCC-NEXT:    xorl $-1, %eax
+; X64-O0-SETZUCC-NEXT:    movl %eax, %eax
+; X64-O0-SETZUCC-NEXT:    # kill: def $rax killed $eax
+; X64-O0-SETZUCC-NEXT:    cmpl $0, var_13
+; X64-O0-SETZUCC-NEXT:    setzune %cl
+; X64-O0-SETZUCC-NEXT:    xorb $-1, %cl
+; X64-O0-SETZUCC-NEXT:    andb $1, %cl
+; X64-O0-SETZUCC-NEXT:    movzbl %cl, %ecx
+; X64-O0-SETZUCC-NEXT:    # kill: def $rcx killed $ecx
+; X64-O0-SETZUCC-NEXT:    andq $0, %rcx
+; X64-O0-SETZUCC-NEXT:    orq %rcx, %rax
+; X64-O0-SETZUCC-NEXT:    # kill: def $eax killed $eax killed $rax
+; X64-O0-SETZUCC-NEXT:    movl %eax, var_46
+; X64-O0-SETZUCC-NEXT:    retq
+;
+; X64-O0-NO-SETZUCC-LABEL: f3:
+; X64-O0-NO-SETZUCC:       # %bb.0: # %entry
+; X64-O0-NO-SETZUCC-NEXT:    movl var_13, %eax
+; X64-O0-NO-SETZUCC-NEXT:    xorl $-1, %eax
+; X64-O0-NO-SETZUCC-NEXT:    movl %eax, %eax
+; X64-O0-NO-SETZUCC-NEXT:    # kill: def $rax killed $eax
+; X64-O0-NO-SETZUCC-NEXT:    cmpl $0, var_13
+; X64-O0-NO-SETZUCC-NEXT:    setne %cl
+; X64-O0-NO-SETZUCC-NEXT:    xorb $-1, %cl
+; X64-O0-NO-SETZUCC-NEXT:    andb $1, %cl
+; X64-O0-NO-SETZUCC-NEXT:    movzbl %cl, %ecx
+; X64-O0-NO-SETZUCC-NEXT:    # kill: def $rcx killed $ecx
+; X64-O0-NO-SETZUCC-NEXT:    movl var_13, %edx
+; X64-O0-NO-SETZUCC-NEXT:    xorl $-1, %edx
+; X64-O0-NO-SETZUCC-NEXT:    xorl var_16, %edx
+; X64-O0-NO-SETZUCC-NEXT:    movl %edx, %edx
+; X64-O0-NO-SETZUCC-NEXT:    # kill: def $rdx killed $edx
+; X64-O0-NO-SETZUCC-NEXT:    andq %rdx, %rcx
+; X64-O0-NO-SETZUCC-NEXT:    orq %rcx, %rax
+; X64-O0-NO-SETZUCC-NEXT:    movq %rax, -{{[0-9]+}}(%rsp)
+; X64-O0-NO-SETZUCC-NEXT:    movl var_13, %eax
+; X64-O0-NO-SETZUCC-NEXT:    xorl $-1, %eax
+; X64-O0-NO-SETZUCC-NEXT:    movl %eax, %eax
+; X64-O0-NO-SETZUCC-NEXT:    # kill: def $rax killed $eax
+; X64-O0-NO-SETZUCC-NEXT:    cmpl $0, var_13
+; X64-O0-NO-SETZUCC-NEXT:    setne %cl
+; X64-O0-NO-SETZUCC-NEXT:    xorb $-1, %cl
+; X64-O0-NO-SETZUCC-NEXT:    andb $1, %cl
+; X64-O0-NO-SETZUCC-NEXT:    movzbl %cl, %ecx
+; X64-O0-NO-SETZUCC-NEXT:    # kill: def $rcx killed $ecx
+; X64-O0-NO-SETZUCC-NEXT:    andq $0, %rcx
+; X64-O0-NO-SETZUCC-NEXT:    orq %rcx, %rax
+; X64-O0-NO-SETZUCC-NEXT:    # kill: def $eax killed $eax killed $rax
+; X64-O0-NO-SETZUCC-NEXT:    movl %eax, var_46
+; X64-O0-NO-SETZUCC-NEXT:    retq
+;
+; X64-SETZUCC-LABEL: f3:
+; X64-SETZUCC:       # %bb.0: # %entry
+; X64-SETZUCC-NEXT:    movl var_13(%rip), %eax
+; X64-SETZUCC-NEXT:    testl %eax, %eax
+; X64-SETZUCC-NEXT:    notl %eax
+; X64-SETZUCC-NEXT:    setzue %cl
+; X64-SETZUCC-NEXT:    movl var_16(%rip), %edx
+; X64-SETZUCC-NEXT:    xorl %eax, %edx
+; X64-SETZUCC-NEXT:    andl %edx, %ecx
+; X64-SETZUCC-NEXT:    orl %eax, %ecx
+; X64-SETZUCC-NEXT:    movq %rcx, -{{[0-9]+}}(%rsp)
+; X64-SETZUCC-NEXT:    movl %eax, var_46(%rip)
+; X64-SETZUCC-NEXT:    retq
+;
+; X64-NO-SETZUCC-LABEL: f3:
+; X64-NO-SETZUCC:       # %bb.0: # %entry
+; X64-NO-SETZUCC-NEXT:    movl var_13(%rip), %eax
+; X64-NO-SETZUCC-NEXT:    testl %eax, %eax
+; X64-NO-SETZUCC-NEXT:    notl %eax
+; X64-NO-SETZUCC-NEXT:    setzue %cl
+; X64-NO-SETZUCC-NEXT:    movl var_16(%rip), %edx
+; X64-NO-SETZUCC-NEXT:    xorl %eax, %edx
+; X64-NO-SETZUCC-NEXT:    andl %edx, %ecx
+; X64-NO-SETZUCC-NEXT:    orl %eax, %ecx
+; X64-NO-SETZUCC-NEXT:    movq %rcx, -{{[0-9]+}}(%rsp)
+; X64-NO-SETZUCC-NEXT:    movl %eax, var_46(%rip)
+; X64-NO-SETZUCC-NEXT:    retq
 entry:
   %a = alloca i64, align 8
   %0 = load i32, ptr @var_13, align 4
diff --git a/llvm/test/CodeGen/X86/pr54369.ll b/llvm/test/CodeGen/X86/pr54369.ll
index bebe8a0b2dc01..412d567a9c34f 100644
--- a/llvm/test/CodeGen/X86/pr54369.ll
+++ b/llvm/test/CodeGen/X86/pr54369.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc -mtriple=x86_64-- -O0 < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-- -O0 -mattr=+zu,+prefer-setzucc < %s | FileCheck %s -check-prefix=SETZUCC
+; RUN: llc -mtriple=x86_64-- -O0 -mattr=+zu,-prefer-setzucc < %s | FileCheck %s -check-prefix=NO-SETZUCC
 
 define i64 @adder(i64 %lhs, i64 %rhs) {
 ; CHECK-LABEL: adder:
@@ -12,6 +14,28 @@ define i64 @adder(i64 %lhs, i64 %rhs) {
 ; CHECK-NEXT:    testb $1, %dl
 ; CHECK-NEXT:    cmovneq %rcx, %rax
 ; CHECK-NEXT:    retq
+;
+; SETZUCC-LABEL: adder:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    addq %rsi, %rdi
+; SETZUCC-NEXT:    setzuo %dl
+; SETZUCC-NEXT:    xorl %eax, %eax
+; SETZUCC-NEXT:    # kill: def $rax killed $eax
+; SETZUCC-NEXT:    movl $148, %ecx
+; SETZUCC-NEXT:    testb $1, %dl
+; SETZUCC-NEXT:    cmovneq %rcx, %rax
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: adder:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    addq %rsi, %rdi
+; NO-SETZUCC-NEXT:    seto %dl
+; NO-SETZUCC-NEXT:    xorl %eax, %eax
+; NO-SETZUCC-NEXT:    # kill: def $rax killed $eax
+; NO-SETZUCC-NEXT:    movl $148, %ecx
+; NO-SETZUCC-NEXT:    testb $1, %dl
+; NO-SETZUCC-NEXT:    cmovneq %rcx, %rax
+; NO-SETZUCC-NEXT:    retq
 	%res = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %lhs, i64 %rhs)
 	%errorbit = extractvalue { i64, i1 } %res, 1
 	%errorval = select i1 %errorbit, i64 148, i64 0
@@ -31,6 +55,28 @@ define i64 @adder_constexpr(i64 %lhs, i64 %rhs) {
 ; CHECK-NEXT:    testb $1, %dl
 ; CHECK-NEXT:    cmovneq %rcx, %rax
 ; CHECK-NEXT:    retq
+;
+; SETZUCC-LABEL: adder_constexpr:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    addq %rsi, %rdi
+; SETZUCC-NEXT:    setzuo %dl
+; SETZUCC-NEXT:    movq a at GOTPCREL(%rip), %rax
+; SETZUCC-NEXT:    addq $5, %rax
+; SETZUCC-NEXT:    movl $148, %ecx
+; SETZUCC-NEXT:    testb $1, %dl
+; SETZUCC-NEXT:    cmovneq %rcx, %rax
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: adder_constexpr:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    addq %rsi, %rdi
+; NO-SETZUCC-NEXT:    seto %dl
+; NO-SETZUCC-NEXT:    movq a at GOTPCREL(%rip), %rax
+; NO-SETZUCC-NEXT:    addq $5, %rax
+; NO-SETZUCC-NEXT:    movl $148, %ecx
+; NO-SETZUCC-NEXT:    testb $1, %dl
+; NO-SETZUCC-NEXT:    cmovneq %rcx, %rax
+; NO-SETZUCC-NEXT:    retq
   %res = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %lhs, i64 %rhs)
   %errorbit = extractvalue { i64, i1 } %res, 1
   %errorval = select i1 %errorbit, i64 148, i64 add (i64 ptrtoint (ptr @a to i64), i64 5)
diff --git a/llvm/test/CodeGen/X86/scmp.ll b/llvm/test/CodeGen/X86/scmp.ll
index 8a287229a1cb1..83ebae0307605 100644
--- a/llvm/test/CodeGen/X86/scmp.ll
+++ b/llvm/test/CodeGen/X86/scmp.ll
@@ -4,6 +4,8 @@
 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=x86-64-v3 | FileCheck %s --check-prefixes=X64,AVX,AVX2
 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=x86-64-v4 | FileCheck %s --check-prefixes=X64,AVX,AVX512
 ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefix=X86
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+zu,+prefer-setzucc | FileCheck %s --check-prefix=SETZUCC
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+zu,-prefer-setzucc | FileCheck %s --check-prefix=NO-SETZUCC
 
 define i8 @scmp.8.8(i8 %x, i8 %y) nounwind {
 ; X64-LABEL: scmp.8.8:
@@ -22,6 +24,22 @@ define i8 @scmp.8.8(i8 %x, i8 %y) nounwind {
 ; X86-NEXT:    setg %al
 ; X86-NEXT:    subb %cl, %al
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp.8.8:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    cmpb %sil, %dil
+; SETZUCC-NEXT:    setzul %cl
+; SETZUCC-NEXT:    setzug %al
+; SETZUCC-NEXT:    subb %cl, %al
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp.8.8:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    cmpb %sil, %dil
+; NO-SETZUCC-NEXT:    setl %cl
+; NO-SETZUCC-NEXT:    setg %al
+; NO-SETZUCC-NEXT:    subb %cl, %al
+; NO-SETZUCC-NEXT:    retq
   %1 = call i8 @llvm.scmp(i8 %x, i8 %y)
   ret i8 %1
 }
@@ -43,6 +61,22 @@ define i8 @scmp.8.16(i16 %x, i16 %y) nounwind {
 ; X86-NEXT:    setg %al
 ; X86-NEXT:    subb %cl, %al
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp.8.16:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    cmpw %si, %di
+; SETZUCC-NEXT:    setzul %cl
+; SETZUCC-NEXT:    setzug %al
+; SETZUCC-NEXT:    subb %cl, %al
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp.8.16:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    cmpw %si, %di
+; NO-SETZUCC-NEXT:    setl %cl
+; NO-SETZUCC-NEXT:    setg %al
+; NO-SETZUCC-NEXT:    subb %cl, %al
+; NO-SETZUCC-NEXT:    retq
   %1 = call i8 @llvm.scmp(i16 %x, i16 %y)
   ret i8 %1
 }
@@ -64,6 +98,22 @@ define i8 @scmp.8.32(i32 %x, i32 %y) nounwind {
 ; X86-NEXT:    setg %al
 ; X86-NEXT:    subb %cl, %al
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp.8.32:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    cmpl %esi, %edi
+; SETZUCC-NEXT:    setzul %cl
+; SETZUCC-NEXT:    setzug %al
+; SETZUCC-NEXT:    subb %cl, %al
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp.8.32:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; NO-SETZUCC-NEXT:    setl %cl
+; NO-SETZUCC-NEXT:    setg %al
+; NO-SETZUCC-NEXT:    subb %cl, %al
+; NO-SETZUCC-NEXT:    retq
   %1 = call i8 @llvm.scmp(i32 %x, i32 %y)
   ret i8 %1
 }
@@ -98,6 +148,22 @@ define i8 @scmp.8.64(i64 %x, i64 %y) nounwind {
 ; X86-NEXT:    popl %edi
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp.8.64:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    cmpq %rsi, %rdi
+; SETZUCC-NEXT:    setzul %cl
+; SETZUCC-NEXT:    setzug %al
+; SETZUCC-NEXT:    subb %cl, %al
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp.8.64:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; NO-SETZUCC-NEXT:    setl %cl
+; NO-SETZUCC-NEXT:    setg %al
+; NO-SETZUCC-NEXT:    subb %cl, %al
+; NO-SETZUCC-NEXT:    retq
   %1 = call i8 @llvm.scmp(i64 %x, i64 %y)
   ret i8 %1
 }
@@ -150,6 +216,30 @@ define i8 @scmp.8.128(i128 %x, i128 %y) nounwind {
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    popl %ebp
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp.8.128:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    cmpq %rdx, %rdi
+; SETZUCC-NEXT:    movq %rsi, %rax
+; SETZUCC-NEXT:    sbbq %rcx, %rax
+; SETZUCC-NEXT:    setzul %r8b
+; SETZUCC-NEXT:    cmpq %rdi, %rdx
+; SETZUCC-NEXT:    sbbq %rsi, %rcx
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    subb %r8b, %al
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp.8.128:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    cmpq %rdx, %rdi
+; NO-SETZUCC-NEXT:    movq %rsi, %rax
+; NO-SETZUCC-NEXT:    sbbq %rcx, %rax
+; NO-SETZUCC-NEXT:    setl %r8b
+; NO-SETZUCC-NEXT:    cmpq %rdi, %rdx
+; NO-SETZUCC-NEXT:    sbbq %rsi, %rcx
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    subb %r8b, %al
+; NO-SETZUCC-NEXT:    retq
   %1 = call i8 @llvm.scmp(i128 %x, i128 %y)
   ret i8 %1
 }
@@ -173,6 +263,24 @@ define i32 @scmp.32.32(i32 %x, i32 %y) nounwind {
 ; X86-NEXT:    subb %al, %cl
 ; X86-NEXT:    movsbl %cl, %eax
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp.32.32:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    cmpl %esi, %edi
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movsbl %cl, %eax
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp.32.32:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movsbl %cl, %eax
+; NO-SETZUCC-NEXT:    retq
   %1 = call i32 @llvm.scmp(i32 %x, i32 %y)
   ret i32 %1
 }
@@ -209,6 +317,24 @@ define i32 @scmp.32.64(i64 %x, i64 %y) nounwind {
 ; X86-NEXT:    popl %edi
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp.32.64:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    cmpq %rsi, %rdi
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movsbl %cl, %eax
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp.32.64:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movsbl %cl, %eax
+; NO-SETZUCC-NEXT:    retq
   %1 = call i32 @llvm.scmp(i64 %x, i64 %y)
   ret i32 %1
 }
@@ -247,6 +373,24 @@ define i64 @scmp.64.64(i64 %x, i64 %y) nounwind {
 ; X86-NEXT:    popl %edi
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp.64.64:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    cmpq %rsi, %rdi
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movsbq %cl, %rax
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp.64.64:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movsbq %cl, %rax
+; NO-SETZUCC-NEXT:    retq
   %1 = call i64 @llvm.scmp(i64 %x, i64 %y)
   ret i64 %1
 }
@@ -268,6 +412,22 @@ define i4 @scmp_narrow_result(i32 %x, i32 %y) nounwind {
 ; X86-NEXT:    setg %al
 ; X86-NEXT:    subb %cl, %al
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp_narrow_result:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    cmpl %esi, %edi
+; SETZUCC-NEXT:    setzul %cl
+; SETZUCC-NEXT:    setzug %al
+; SETZUCC-NEXT:    subb %cl, %al
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_narrow_result:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; NO-SETZUCC-NEXT:    setl %cl
+; NO-SETZUCC-NEXT:    setg %al
+; NO-SETZUCC-NEXT:    subb %cl, %al
+; NO-SETZUCC-NEXT:    retq
   %1 = call i4 @llvm.scmp(i32 %x, i32 %y)
   ret i4 %1
 }
@@ -310,6 +470,30 @@ define i8 @scmp_narrow_op(i62 %x, i62 %y) nounwind {
 ; X86-NEXT:    popl %edi
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp_narrow_op:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    shlq $2, %rsi
+; SETZUCC-NEXT:    sarq $2, %rsi
+; SETZUCC-NEXT:    shlq $2, %rdi
+; SETZUCC-NEXT:    sarq $2, %rdi
+; SETZUCC-NEXT:    cmpq %rsi, %rdi
+; SETZUCC-NEXT:    setzul %cl
+; SETZUCC-NEXT:    setzug %al
+; SETZUCC-NEXT:    subb %cl, %al
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_narrow_op:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    shlq $2, %rsi
+; NO-SETZUCC-NEXT:    sarq $2, %rsi
+; NO-SETZUCC-NEXT:    shlq $2, %rdi
+; NO-SETZUCC-NEXT:    sarq $2, %rdi
+; NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; NO-SETZUCC-NEXT:    setl %cl
+; NO-SETZUCC-NEXT:    setg %al
+; NO-SETZUCC-NEXT:    subb %cl, %al
+; NO-SETZUCC-NEXT:    retq
   %1 = call i8 @llvm.scmp(i62 %x, i62 %y)
   ret i8 %1
 }
@@ -345,6 +529,32 @@ define i141 @scmp_wide_result(i32 %x, i32 %y) nounwind {
 ; X86-NEXT:    andl $8191, %ecx # imm = 0x1FFF
 ; X86-NEXT:    movw %cx, 16(%eax)
 ; X86-NEXT:    retl $4
+;
+; SETZUCC-LABEL: scmp_wide_result:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    cmpl %esi, %edi
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movsbq %cl, %rax
+; SETZUCC-NEXT:    movq %rax, %rdx
+; SETZUCC-NEXT:    sarq $63, %rdx
+; SETZUCC-NEXT:    movl %edx, %ecx
+; SETZUCC-NEXT:    andl $8191, %ecx # imm = 0x1FFF
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_wide_result:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    cmpl %esi, %edi
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movsbq %cl, %rax
+; NO-SETZUCC-NEXT:    movq %rax, %rdx
+; NO-SETZUCC-NEXT:    sarq $63, %rdx
+; NO-SETZUCC-NEXT:    movl %edx, %ecx
+; NO-SETZUCC-NEXT:    andl $8191, %ecx # imm = 0x1FFF
+; NO-SETZUCC-NEXT:    retq
   %1 = call i141 @llvm.scmp(i32 %x, i32 %y)
   ret i141 %1
 }
@@ -402,6 +612,38 @@ define i8 @scmp_wide_op(i109 %x, i109 %y) nounwind {
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    popl %ebp
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp_wide_op:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    shlq $19, %rcx
+; SETZUCC-NEXT:    sarq $19, %rcx
+; SETZUCC-NEXT:    shlq $19, %rsi
+; SETZUCC-NEXT:    sarq $19, %rsi
+; SETZUCC-NEXT:    cmpq %rdx, %rdi
+; SETZUCC-NEXT:    movq %rsi, %rax
+; SETZUCC-NEXT:    sbbq %rcx, %rax
+; SETZUCC-NEXT:    setzul %r8b
+; SETZUCC-NEXT:    cmpq %rdi, %rdx
+; SETZUCC-NEXT:    sbbq %rsi, %rcx
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    subb %r8b, %al
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_wide_op:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    shlq $19, %rcx
+; NO-SETZUCC-NEXT:    sarq $19, %rcx
+; NO-SETZUCC-NEXT:    shlq $19, %rsi
+; NO-SETZUCC-NEXT:    sarq $19, %rsi
+; NO-SETZUCC-NEXT:    cmpq %rdx, %rdi
+; NO-SETZUCC-NEXT:    movq %rsi, %rax
+; NO-SETZUCC-NEXT:    sbbq %rcx, %rax
+; NO-SETZUCC-NEXT:    setl %r8b
+; NO-SETZUCC-NEXT:    cmpq %rdi, %rdx
+; NO-SETZUCC-NEXT:    sbbq %rsi, %rcx
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    subb %r8b, %al
+; NO-SETZUCC-NEXT:    retq
   %1 = call i8 @llvm.scmp(i109 %x, i109 %y)
   ret i8 %1
 }
@@ -436,6 +678,32 @@ define i41 @scmp_uncommon_types(i7 %x, i7 %y) nounwind {
 ; X86-NEXT:    movl %eax, %edx
 ; X86-NEXT:    sarl $31, %edx
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp_uncommon_types:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    addb %sil, %sil
+; SETZUCC-NEXT:    sarb %sil
+; SETZUCC-NEXT:    addb %dil, %dil
+; SETZUCC-NEXT:    sarb %dil
+; SETZUCC-NEXT:    cmpb %sil, %dil
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movsbq %cl, %rax
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_uncommon_types:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    addb %sil, %sil
+; NO-SETZUCC-NEXT:    sarb %sil
+; NO-SETZUCC-NEXT:    addb %dil, %dil
+; NO-SETZUCC-NEXT:    sarb %dil
+; NO-SETZUCC-NEXT:    cmpb %sil, %dil
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movsbq %cl, %rax
+; NO-SETZUCC-NEXT:    retq
   %1 = call i41 @llvm.scmp(i7 %x, i7 %y)
   ret i41 %1
 }
@@ -504,6 +772,24 @@ define <4 x i32> @scmp_normal_vectors(<4 x i32> %x, <4 x i32> %y) nounwind {
 ; X86-NEXT:    popl %edi
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    retl $4
+;
+; SETZUCC-LABEL: scmp_normal_vectors:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    movdqa %xmm0, %xmm2
+; SETZUCC-NEXT:    pcmpgtd %xmm1, %xmm2
+; SETZUCC-NEXT:    pcmpgtd %xmm0, %xmm1
+; SETZUCC-NEXT:    psubd %xmm2, %xmm1
+; SETZUCC-NEXT:    movdqa %xmm1, %xmm0
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_normal_vectors:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    movdqa %xmm0, %xmm2
+; NO-SETZUCC-NEXT:    pcmpgtd %xmm1, %xmm2
+; NO-SETZUCC-NEXT:    pcmpgtd %xmm0, %xmm1
+; NO-SETZUCC-NEXT:    psubd %xmm2, %xmm1
+; NO-SETZUCC-NEXT:    movdqa %xmm1, %xmm0
+; NO-SETZUCC-NEXT:    retq
   %1 = call <4 x i32> @llvm.scmp(<4 x i32> %x, <4 x i32> %y)
   ret <4 x i32> %1
 }
@@ -657,6 +943,96 @@ define <4 x i8> @scmp_narrow_vec_result(<4 x i32> %x, <4 x i32> %y) nounwind {
 ; X86-NEXT:    popl %edi
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    retl $4
+;
+; SETZUCC-LABEL: scmp_narrow_vec_result:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    movd %xmm1, %eax
+; SETZUCC-NEXT:    movd %xmm0, %ecx
+; SETZUCC-NEXT:    cmpl %eax, %ecx
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm2 = xmm1[1,1,1,1]
+; SETZUCC-NEXT:    movd %xmm2, %ecx
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm2 = xmm0[1,1,1,1]
+; SETZUCC-NEXT:    movd %xmm2, %edx
+; SETZUCC-NEXT:    cmpl %ecx, %edx
+; SETZUCC-NEXT:    setzul %cl
+; SETZUCC-NEXT:    setzug %dl
+; SETZUCC-NEXT:    subb %cl, %dl
+; SETZUCC-NEXT:    movzbl %dl, %ecx
+; SETZUCC-NEXT:    shll $8, %ecx
+; SETZUCC-NEXT:    orl %eax, %ecx
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm2 = xmm1[2,3,2,3]
+; SETZUCC-NEXT:    movd %xmm2, %eax
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm2 = xmm0[2,3,2,3]
+; SETZUCC-NEXT:    movd %xmm2, %edx
+; SETZUCC-NEXT:    cmpl %eax, %edx
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %dl
+; SETZUCC-NEXT:    subb %al, %dl
+; SETZUCC-NEXT:    movzbl %dl, %eax
+; SETZUCC-NEXT:    shll $16, %eax
+; SETZUCC-NEXT:    orl %ecx, %eax
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm1 = xmm1[3,3,3,3]
+; SETZUCC-NEXT:    movd %xmm1, %ecx
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm0 = xmm0[3,3,3,3]
+; SETZUCC-NEXT:    movd %xmm0, %edx
+; SETZUCC-NEXT:    cmpl %ecx, %edx
+; SETZUCC-NEXT:    setzul %cl
+; SETZUCC-NEXT:    setzug %dl
+; SETZUCC-NEXT:    subb %cl, %dl
+; SETZUCC-NEXT:    movzbl %dl, %ecx
+; SETZUCC-NEXT:    shll $24, %ecx
+; SETZUCC-NEXT:    orl %eax, %ecx
+; SETZUCC-NEXT:    movd %ecx, %xmm0
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_narrow_vec_result:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    movd %xmm1, %eax
+; NO-SETZUCC-NEXT:    movd %xmm0, %ecx
+; NO-SETZUCC-NEXT:    cmpl %eax, %ecx
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm2 = xmm1[1,1,1,1]
+; NO-SETZUCC-NEXT:    movd %xmm2, %ecx
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm2 = xmm0[1,1,1,1]
+; NO-SETZUCC-NEXT:    movd %xmm2, %edx
+; NO-SETZUCC-NEXT:    cmpl %ecx, %edx
+; NO-SETZUCC-NEXT:    setl %cl
+; NO-SETZUCC-NEXT:    setg %dl
+; NO-SETZUCC-NEXT:    subb %cl, %dl
+; NO-SETZUCC-NEXT:    movzbl %dl, %ecx
+; NO-SETZUCC-NEXT:    shll $8, %ecx
+; NO-SETZUCC-NEXT:    orl %eax, %ecx
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm2 = xmm1[2,3,2,3]
+; NO-SETZUCC-NEXT:    movd %xmm2, %eax
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm2 = xmm0[2,3,2,3]
+; NO-SETZUCC-NEXT:    movd %xmm2, %edx
+; NO-SETZUCC-NEXT:    cmpl %eax, %edx
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %dl
+; NO-SETZUCC-NEXT:    subb %al, %dl
+; NO-SETZUCC-NEXT:    movzbl %dl, %eax
+; NO-SETZUCC-NEXT:    shll $16, %eax
+; NO-SETZUCC-NEXT:    orl %ecx, %eax
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm1 = xmm1[3,3,3,3]
+; NO-SETZUCC-NEXT:    movd %xmm1, %ecx
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm0 = xmm0[3,3,3,3]
+; NO-SETZUCC-NEXT:    movd %xmm0, %edx
+; NO-SETZUCC-NEXT:    cmpl %ecx, %edx
+; NO-SETZUCC-NEXT:    setl %cl
+; NO-SETZUCC-NEXT:    setg %dl
+; NO-SETZUCC-NEXT:    subb %cl, %dl
+; NO-SETZUCC-NEXT:    movzbl %dl, %ecx
+; NO-SETZUCC-NEXT:    shll $24, %ecx
+; NO-SETZUCC-NEXT:    orl %eax, %ecx
+; NO-SETZUCC-NEXT:    movd %ecx, %xmm0
+; NO-SETZUCC-NEXT:    retq
   %1 = call <4 x i8> @llvm.scmp(<4 x i32> %x, <4 x i32> %y)
   ret <4 x i8> %1
 }
@@ -746,6 +1122,36 @@ define <4 x i32> @scmp_narrow_vec_op(<4 x i8> %x, <4 x i8> %y) nounwind {
 ; X86-NEXT:    popl %edi
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    retl $4
+;
+; SETZUCC-LABEL: scmp_narrow_vec_op:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
+; SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3]
+; SETZUCC-NEXT:    psrad $24, %xmm1
+; SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
+; SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
+; SETZUCC-NEXT:    psrad $24, %xmm0
+; SETZUCC-NEXT:    movdqa %xmm0, %xmm2
+; SETZUCC-NEXT:    pcmpgtd %xmm1, %xmm2
+; SETZUCC-NEXT:    pcmpgtd %xmm0, %xmm1
+; SETZUCC-NEXT:    psubd %xmm2, %xmm1
+; SETZUCC-NEXT:    movdqa %xmm1, %xmm0
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_narrow_vec_op:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
+; NO-SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3]
+; NO-SETZUCC-NEXT:    psrad $24, %xmm1
+; NO-SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
+; NO-SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
+; NO-SETZUCC-NEXT:    psrad $24, %xmm0
+; NO-SETZUCC-NEXT:    movdqa %xmm0, %xmm2
+; NO-SETZUCC-NEXT:    pcmpgtd %xmm1, %xmm2
+; NO-SETZUCC-NEXT:    pcmpgtd %xmm0, %xmm1
+; NO-SETZUCC-NEXT:    psubd %xmm2, %xmm1
+; NO-SETZUCC-NEXT:    movdqa %xmm1, %xmm0
+; NO-SETZUCC-NEXT:    retq
   %1 = call <4 x i32> @llvm.scmp(<4 x i8> %x, <4 x i8> %y)
   ret <4 x i32> %1
 }
@@ -992,6 +1398,90 @@ define <16 x i32> @scmp_wide_vec_result(<16 x i8> %x, <16 x i8> %y) nounwind {
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    popl %ebp
 ; X86-NEXT:    retl $4
+;
+; SETZUCC-LABEL: scmp_wide_vec_result:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    movdqa %xmm1, %xmm2
+; SETZUCC-NEXT:    movdqa %xmm0, %xmm3
+; SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
+; SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
+; SETZUCC-NEXT:    psrad $24, %xmm0
+; SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm4 = xmm4[0],xmm3[0],xmm4[1],xmm3[1],xmm4[2],xmm3[2],xmm4[3],xmm3[3],xmm4[4],xmm3[4],xmm4[5],xmm3[5],xmm4[6],xmm3[6],xmm4[7],xmm3[7]
+; SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1],xmm5[2],xmm4[2],xmm5[3],xmm4[3]
+; SETZUCC-NEXT:    psrad $24, %xmm5
+; SETZUCC-NEXT:    movdqa %xmm5, %xmm6
+; SETZUCC-NEXT:    pcmpgtd %xmm0, %xmm6
+; SETZUCC-NEXT:    pcmpgtd %xmm5, %xmm0
+; SETZUCC-NEXT:    psubd %xmm6, %xmm0
+; SETZUCC-NEXT:    punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
+; SETZUCC-NEXT:    psrad $24, %xmm1
+; SETZUCC-NEXT:    punpckhwd {{.*#+}} xmm4 = xmm4[4,4,5,5,6,6,7,7]
+; SETZUCC-NEXT:    psrad $24, %xmm4
+; SETZUCC-NEXT:    movdqa %xmm4, %xmm5
+; SETZUCC-NEXT:    pcmpgtd %xmm1, %xmm5
+; SETZUCC-NEXT:    pcmpgtd %xmm4, %xmm1
+; SETZUCC-NEXT:    psubd %xmm5, %xmm1
+; SETZUCC-NEXT:    punpckhbw {{.*#+}} xmm4 = xmm4[8],xmm2[8],xmm4[9],xmm2[9],xmm4[10],xmm2[10],xmm4[11],xmm2[11],xmm4[12],xmm2[12],xmm4[13],xmm2[13],xmm4[14],xmm2[14],xmm4[15],xmm2[15]
+; SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1],xmm2[2],xmm4[2],xmm2[3],xmm4[3]
+; SETZUCC-NEXT:    psrad $24, %xmm2
+; SETZUCC-NEXT:    punpckhbw {{.*#+}} xmm5 = xmm5[8],xmm3[8],xmm5[9],xmm3[9],xmm5[10],xmm3[10],xmm5[11],xmm3[11],xmm5[12],xmm3[12],xmm5[13],xmm3[13],xmm5[14],xmm3[14],xmm5[15],xmm3[15]
+; SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1],xmm3[2],xmm5[2],xmm3[3],xmm5[3]
+; SETZUCC-NEXT:    psrad $24, %xmm3
+; SETZUCC-NEXT:    movdqa %xmm3, %xmm6
+; SETZUCC-NEXT:    pcmpgtd %xmm2, %xmm6
+; SETZUCC-NEXT:    pcmpgtd %xmm3, %xmm2
+; SETZUCC-NEXT:    psubd %xmm6, %xmm2
+; SETZUCC-NEXT:    punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm4[4],xmm3[5],xmm4[5],xmm3[6],xmm4[6],xmm3[7],xmm4[7]
+; SETZUCC-NEXT:    psrad $24, %xmm3
+; SETZUCC-NEXT:    punpckhwd {{.*#+}} xmm4 = xmm4[4],xmm5[4],xmm4[5],xmm5[5],xmm4[6],xmm5[6],xmm4[7],xmm5[7]
+; SETZUCC-NEXT:    psrad $24, %xmm4
+; SETZUCC-NEXT:    movdqa %xmm4, %xmm5
+; SETZUCC-NEXT:    pcmpgtd %xmm3, %xmm5
+; SETZUCC-NEXT:    pcmpgtd %xmm4, %xmm3
+; SETZUCC-NEXT:    psubd %xmm5, %xmm3
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_wide_vec_result:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    movdqa %xmm1, %xmm2
+; NO-SETZUCC-NEXT:    movdqa %xmm0, %xmm3
+; NO-SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
+; NO-SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
+; NO-SETZUCC-NEXT:    psrad $24, %xmm0
+; NO-SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm4 = xmm4[0],xmm3[0],xmm4[1],xmm3[1],xmm4[2],xmm3[2],xmm4[3],xmm3[3],xmm4[4],xmm3[4],xmm4[5],xmm3[5],xmm4[6],xmm3[6],xmm4[7],xmm3[7]
+; NO-SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1],xmm5[2],xmm4[2],xmm5[3],xmm4[3]
+; NO-SETZUCC-NEXT:    psrad $24, %xmm5
+; NO-SETZUCC-NEXT:    movdqa %xmm5, %xmm6
+; NO-SETZUCC-NEXT:    pcmpgtd %xmm0, %xmm6
+; NO-SETZUCC-NEXT:    pcmpgtd %xmm5, %xmm0
+; NO-SETZUCC-NEXT:    psubd %xmm6, %xmm0
+; NO-SETZUCC-NEXT:    punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
+; NO-SETZUCC-NEXT:    psrad $24, %xmm1
+; NO-SETZUCC-NEXT:    punpckhwd {{.*#+}} xmm4 = xmm4[4,4,5,5,6,6,7,7]
+; NO-SETZUCC-NEXT:    psrad $24, %xmm4
+; NO-SETZUCC-NEXT:    movdqa %xmm4, %xmm5
+; NO-SETZUCC-NEXT:    pcmpgtd %xmm1, %xmm5
+; NO-SETZUCC-NEXT:    pcmpgtd %xmm4, %xmm1
+; NO-SETZUCC-NEXT:    psubd %xmm5, %xmm1
+; NO-SETZUCC-NEXT:    punpckhbw {{.*#+}} xmm4 = xmm4[8],xmm2[8],xmm4[9],xmm2[9],xmm4[10],xmm2[10],xmm4[11],xmm2[11],xmm4[12],xmm2[12],xmm4[13],xmm2[13],xmm4[14],xmm2[14],xmm4[15],xmm2[15]
+; NO-SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1],xmm2[2],xmm4[2],xmm2[3],xmm4[3]
+; NO-SETZUCC-NEXT:    psrad $24, %xmm2
+; NO-SETZUCC-NEXT:    punpckhbw {{.*#+}} xmm5 = xmm5[8],xmm3[8],xmm5[9],xmm3[9],xmm5[10],xmm3[10],xmm5[11],xmm3[11],xmm5[12],xmm3[12],xmm5[13],xmm3[13],xmm5[14],xmm3[14],xmm5[15],xmm3[15]
+; NO-SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1],xmm3[2],xmm5[2],xmm3[3],xmm5[3]
+; NO-SETZUCC-NEXT:    psrad $24, %xmm3
+; NO-SETZUCC-NEXT:    movdqa %xmm3, %xmm6
+; NO-SETZUCC-NEXT:    pcmpgtd %xmm2, %xmm6
+; NO-SETZUCC-NEXT:    pcmpgtd %xmm3, %xmm2
+; NO-SETZUCC-NEXT:    psubd %xmm6, %xmm2
+; NO-SETZUCC-NEXT:    punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm4[4],xmm3[5],xmm4[5],xmm3[6],xmm4[6],xmm3[7],xmm4[7]
+; NO-SETZUCC-NEXT:    psrad $24, %xmm3
+; NO-SETZUCC-NEXT:    punpckhwd {{.*#+}} xmm4 = xmm4[4],xmm5[4],xmm4[5],xmm5[5],xmm4[6],xmm5[6],xmm4[7],xmm5[7]
+; NO-SETZUCC-NEXT:    psrad $24, %xmm4
+; NO-SETZUCC-NEXT:    movdqa %xmm4, %xmm5
+; NO-SETZUCC-NEXT:    pcmpgtd %xmm3, %xmm5
+; NO-SETZUCC-NEXT:    pcmpgtd %xmm4, %xmm3
+; NO-SETZUCC-NEXT:    psubd %xmm5, %xmm3
+; NO-SETZUCC-NEXT:    retq
   %1 = call <16 x i32> @llvm.scmp(<16 x i8> %x, <16 x i8> %y)
   ret <16 x i32> %1
 }
@@ -1753,6 +2243,286 @@ define <16 x i8> @scmp_wide_vec_op(<16 x i64> %x, <16 x i64> %y) nounwind {
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    popl %ebp
 ; X86-NEXT:    retl $4
+;
+; SETZUCC-LABEL: scmp_wide_vec_op:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    movq %xmm7, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm8
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm7 = xmm7[2,3,2,3]
+; SETZUCC-NEXT:    movq %xmm7, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm7
+; SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm8 = xmm8[0],xmm7[0],xmm8[1],xmm7[1],xmm8[2],xmm7[2],xmm8[3],xmm7[3],xmm8[4],xmm7[4],xmm8[5],xmm7[5],xmm8[6],xmm7[6],xmm8[7],xmm7[7]
+; SETZUCC-NEXT:    movq %xmm6, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm7
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm6 = xmm6[2,3,2,3]
+; SETZUCC-NEXT:    movq %xmm6, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm6
+; SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm7 = xmm7[0],xmm6[0],xmm7[1],xmm6[1],xmm7[2],xmm6[2],xmm7[3],xmm6[3],xmm7[4],xmm6[4],xmm7[5],xmm6[5],xmm7[6],xmm6[6],xmm7[7],xmm6[7]
+; SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm7 = xmm7[0],xmm8[0],xmm7[1],xmm8[1],xmm7[2],xmm8[2],xmm7[3],xmm8[3]
+; SETZUCC-NEXT:    movq %xmm5, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm6
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm5 = xmm5[2,3,2,3]
+; SETZUCC-NEXT:    movq %xmm5, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm5
+; SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm6 = xmm6[0],xmm5[0],xmm6[1],xmm5[1],xmm6[2],xmm5[2],xmm6[3],xmm5[3],xmm6[4],xmm5[4],xmm6[5],xmm5[5],xmm6[6],xmm5[6],xmm6[7],xmm5[7]
+; SETZUCC-NEXT:    movq %xmm4, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm5
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm4 = xmm4[2,3,2,3]
+; SETZUCC-NEXT:    movq %xmm4, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm4
+; SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1],xmm5[2],xmm4[2],xmm5[3],xmm4[3],xmm5[4],xmm4[4],xmm5[5],xmm4[5],xmm5[6],xmm4[6],xmm5[7],xmm4[7]
+; SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm5 = xmm5[0],xmm6[0],xmm5[1],xmm6[1],xmm5[2],xmm6[2],xmm5[3],xmm6[3]
+; SETZUCC-NEXT:    punpckldq {{.*#+}} xmm5 = xmm5[0],xmm7[0],xmm5[1],xmm7[1]
+; SETZUCC-NEXT:    movq %xmm3, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm4
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm3 = xmm3[2,3,2,3]
+; SETZUCC-NEXT:    movq %xmm3, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm3
+; SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm4 = xmm4[0],xmm3[0],xmm4[1],xmm3[1],xmm4[2],xmm3[2],xmm4[3],xmm3[3],xmm4[4],xmm3[4],xmm4[5],xmm3[5],xmm4[6],xmm3[6],xmm4[7],xmm3[7]
+; SETZUCC-NEXT:    movq %xmm2, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm3
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm2 = xmm2[2,3,2,3]
+; SETZUCC-NEXT:    movq %xmm2, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm2
+; SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1],xmm3[2],xmm2[2],xmm3[3],xmm2[3],xmm3[4],xmm2[4],xmm3[5],xmm2[5],xmm3[6],xmm2[6],xmm3[7],xmm2[7]
+; SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1],xmm3[2],xmm4[2],xmm3[3],xmm4[3]
+; SETZUCC-NEXT:    movq %xmm1, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm2
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm1 = xmm1[2,3,2,3]
+; SETZUCC-NEXT:    movq %xmm1, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm1
+; SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3],xmm2[4],xmm1[4],xmm2[5],xmm1[5],xmm2[6],xmm1[6],xmm2[7],xmm1[7]
+; SETZUCC-NEXT:    movq %xmm0, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm1
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm0 = xmm0[2,3,2,3]
+; SETZUCC-NEXT:    movq %xmm0, %rax
+; SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %cl
+; SETZUCC-NEXT:    subb %al, %cl
+; SETZUCC-NEXT:    movzbl %cl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm0
+; SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
+; SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
+; SETZUCC-NEXT:    punpckldq {{.*#+}} xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
+; SETZUCC-NEXT:    punpcklqdq {{.*#+}} xmm1 = xmm1[0],xmm5[0]
+; SETZUCC-NEXT:    movdqa %xmm1, %xmm0
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_wide_vec_op:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    movq %xmm7, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm8
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm7 = xmm7[2,3,2,3]
+; NO-SETZUCC-NEXT:    movq %xmm7, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm7
+; NO-SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm8 = xmm8[0],xmm7[0],xmm8[1],xmm7[1],xmm8[2],xmm7[2],xmm8[3],xmm7[3],xmm8[4],xmm7[4],xmm8[5],xmm7[5],xmm8[6],xmm7[6],xmm8[7],xmm7[7]
+; NO-SETZUCC-NEXT:    movq %xmm6, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm7
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm6 = xmm6[2,3,2,3]
+; NO-SETZUCC-NEXT:    movq %xmm6, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm6
+; NO-SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm7 = xmm7[0],xmm6[0],xmm7[1],xmm6[1],xmm7[2],xmm6[2],xmm7[3],xmm6[3],xmm7[4],xmm6[4],xmm7[5],xmm6[5],xmm7[6],xmm6[6],xmm7[7],xmm6[7]
+; NO-SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm7 = xmm7[0],xmm8[0],xmm7[1],xmm8[1],xmm7[2],xmm8[2],xmm7[3],xmm8[3]
+; NO-SETZUCC-NEXT:    movq %xmm5, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm6
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm5 = xmm5[2,3,2,3]
+; NO-SETZUCC-NEXT:    movq %xmm5, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm5
+; NO-SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm6 = xmm6[0],xmm5[0],xmm6[1],xmm5[1],xmm6[2],xmm5[2],xmm6[3],xmm5[3],xmm6[4],xmm5[4],xmm6[5],xmm5[5],xmm6[6],xmm5[6],xmm6[7],xmm5[7]
+; NO-SETZUCC-NEXT:    movq %xmm4, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm5
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm4 = xmm4[2,3,2,3]
+; NO-SETZUCC-NEXT:    movq %xmm4, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm4
+; NO-SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1],xmm5[2],xmm4[2],xmm5[3],xmm4[3],xmm5[4],xmm4[4],xmm5[5],xmm4[5],xmm5[6],xmm4[6],xmm5[7],xmm4[7]
+; NO-SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm5 = xmm5[0],xmm6[0],xmm5[1],xmm6[1],xmm5[2],xmm6[2],xmm5[3],xmm6[3]
+; NO-SETZUCC-NEXT:    punpckldq {{.*#+}} xmm5 = xmm5[0],xmm7[0],xmm5[1],xmm7[1]
+; NO-SETZUCC-NEXT:    movq %xmm3, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm4
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm3 = xmm3[2,3,2,3]
+; NO-SETZUCC-NEXT:    movq %xmm3, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm3
+; NO-SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm4 = xmm4[0],xmm3[0],xmm4[1],xmm3[1],xmm4[2],xmm3[2],xmm4[3],xmm3[3],xmm4[4],xmm3[4],xmm4[5],xmm3[5],xmm4[6],xmm3[6],xmm4[7],xmm3[7]
+; NO-SETZUCC-NEXT:    movq %xmm2, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm3
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm2 = xmm2[2,3,2,3]
+; NO-SETZUCC-NEXT:    movq %xmm2, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm2
+; NO-SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1],xmm3[2],xmm2[2],xmm3[3],xmm2[3],xmm3[4],xmm2[4],xmm3[5],xmm2[5],xmm3[6],xmm2[6],xmm3[7],xmm2[7]
+; NO-SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1],xmm3[2],xmm4[2],xmm3[3],xmm4[3]
+; NO-SETZUCC-NEXT:    movq %xmm1, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm2
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm1 = xmm1[2,3,2,3]
+; NO-SETZUCC-NEXT:    movq %xmm1, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm1
+; NO-SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3],xmm2[4],xmm1[4],xmm2[5],xmm1[5],xmm2[6],xmm1[6],xmm2[7],xmm1[7]
+; NO-SETZUCC-NEXT:    movq %xmm0, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm1
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm0 = xmm0[2,3,2,3]
+; NO-SETZUCC-NEXT:    movq %xmm0, %rax
+; NO-SETZUCC-NEXT:    cmpq {{[0-9]+}}(%rsp), %rax
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %cl
+; NO-SETZUCC-NEXT:    subb %al, %cl
+; NO-SETZUCC-NEXT:    movzbl %cl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm0
+; NO-SETZUCC-NEXT:    punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
+; NO-SETZUCC-NEXT:    punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
+; NO-SETZUCC-NEXT:    punpckldq {{.*#+}} xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
+; NO-SETZUCC-NEXT:    punpcklqdq {{.*#+}} xmm1 = xmm1[0],xmm5[0]
+; NO-SETZUCC-NEXT:    movdqa %xmm1, %xmm0
+; NO-SETZUCC-NEXT:    retq
   %1 = call <16 x i8> @llvm.scmp(<16 x i64> %x, <16 x i64> %y)
   ret <16 x i8> %1
 }
@@ -2413,6 +3183,320 @@ define <7 x i117> @scmp_uncommon_vectors(<7 x i7> %x, <7 x i7> %y) nounwind {
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    popl %ebp
 ; X86-NEXT:    retl $4
+;
+; SETZUCC-LABEL: scmp_uncommon_vectors:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    pushq %rbp
+; SETZUCC-NEXT:    pushq %r15
+; SETZUCC-NEXT:    pushq %r14
+; SETZUCC-NEXT:    pushq %r13
+; SETZUCC-NEXT:    pushq %r12
+; SETZUCC-NEXT:    pushq %rbx
+; SETZUCC-NEXT:    movq %rdi, %rax
+; SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %edi
+; SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %r10d
+; SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %r11d
+; SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %ebx
+; SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %ebp
+; SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %r14d
+; SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %r15d
+; SETZUCC-NEXT:    addb %r15b, %r15b
+; SETZUCC-NEXT:    sarb %r15b
+; SETZUCC-NEXT:    addb %sil, %sil
+; SETZUCC-NEXT:    sarb %sil
+; SETZUCC-NEXT:    cmpb %r15b, %sil
+; SETZUCC-NEXT:    setzul %sil
+; SETZUCC-NEXT:    setzug %r15b
+; SETZUCC-NEXT:    subb %sil, %r15b
+; SETZUCC-NEXT:    movsbq %r15b, %rsi
+; SETZUCC-NEXT:    movq %rsi, (%rax)
+; SETZUCC-NEXT:    movq %rsi, %xmm0
+; SETZUCC-NEXT:    sarq $63, %rsi
+; SETZUCC-NEXT:    addb %r14b, %r14b
+; SETZUCC-NEXT:    sarb %r14b
+; SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %r15d
+; SETZUCC-NEXT:    addb %r15b, %r15b
+; SETZUCC-NEXT:    sarb %r15b
+; SETZUCC-NEXT:    cmpb %r14b, %r15b
+; SETZUCC-NEXT:    setzul %r14b
+; SETZUCC-NEXT:    setzug %r15b
+; SETZUCC-NEXT:    subb %r14b, %r15b
+; SETZUCC-NEXT:    movsbq %r15b, %r14
+; SETZUCC-NEXT:    movq %r14, %r15
+; SETZUCC-NEXT:    sarq $63, %r15
+; SETZUCC-NEXT:    addb %bpl, %bpl
+; SETZUCC-NEXT:    sarb %bpl
+; SETZUCC-NEXT:    addb %dl, %dl
+; SETZUCC-NEXT:    sarb %dl
+; SETZUCC-NEXT:    cmpb %bpl, %dl
+; SETZUCC-NEXT:    setzul %dl
+; SETZUCC-NEXT:    setzug %bpl
+; SETZUCC-NEXT:    subb %dl, %bpl
+; SETZUCC-NEXT:    movsbq %bpl, %rdx
+; SETZUCC-NEXT:    movq %rdx, %r12
+; SETZUCC-NEXT:    sarq $63, %r12
+; SETZUCC-NEXT:    addb %bl, %bl
+; SETZUCC-NEXT:    sarb %bl
+; SETZUCC-NEXT:    addb %cl, %cl
+; SETZUCC-NEXT:    sarb %cl
+; SETZUCC-NEXT:    cmpb %bl, %cl
+; SETZUCC-NEXT:    setzul %cl
+; SETZUCC-NEXT:    setzug %bl
+; SETZUCC-NEXT:    subb %cl, %bl
+; SETZUCC-NEXT:    movsbq %bl, %rbx
+; SETZUCC-NEXT:    movq %rbx, %rcx
+; SETZUCC-NEXT:    sarq $63, %rcx
+; SETZUCC-NEXT:    addb %r11b, %r11b
+; SETZUCC-NEXT:    sarb %r11b
+; SETZUCC-NEXT:    addb %r8b, %r8b
+; SETZUCC-NEXT:    sarb %r8b
+; SETZUCC-NEXT:    cmpb %r11b, %r8b
+; SETZUCC-NEXT:    setzul %r8b
+; SETZUCC-NEXT:    setzug %r11b
+; SETZUCC-NEXT:    subb %r8b, %r11b
+; SETZUCC-NEXT:    movsbq %r11b, %r8
+; SETZUCC-NEXT:    movq %r8, %r11
+; SETZUCC-NEXT:    sarq $63, %r11
+; SETZUCC-NEXT:    addb %r10b, %r10b
+; SETZUCC-NEXT:    sarb %r10b
+; SETZUCC-NEXT:    addb %r9b, %r9b
+; SETZUCC-NEXT:    sarb %r9b
+; SETZUCC-NEXT:    cmpb %r10b, %r9b
+; SETZUCC-NEXT:    setzul %r9b
+; SETZUCC-NEXT:    setzug %r10b
+; SETZUCC-NEXT:    subb %r9b, %r10b
+; SETZUCC-NEXT:    movsbq %r10b, %r9
+; SETZUCC-NEXT:    movq %r9, %r10
+; SETZUCC-NEXT:    sarq $63, %r10
+; SETZUCC-NEXT:    addb %dil, %dil
+; SETZUCC-NEXT:    sarb %dil
+; SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %ebp
+; SETZUCC-NEXT:    addb %bpl, %bpl
+; SETZUCC-NEXT:    sarb %bpl
+; SETZUCC-NEXT:    cmpb %dil, %bpl
+; SETZUCC-NEXT:    setzul %dil
+; SETZUCC-NEXT:    setzug %bpl
+; SETZUCC-NEXT:    subb %dil, %bpl
+; SETZUCC-NEXT:    movsbq %bpl, %rdi
+; SETZUCC-NEXT:    movq %rdi, %r13
+; SETZUCC-NEXT:    sarq $63, %r13
+; SETZUCC-NEXT:    movl %r13d, 96(%rax)
+; SETZUCC-NEXT:    movabsq $2251799813685247, %rbp # imm = 0x7FFFFFFFFFFFF
+; SETZUCC-NEXT:    andq %r13, %rbp
+; SETZUCC-NEXT:    shldq $62, %rdi, %r13
+; SETZUCC-NEXT:    movq %r13, 88(%rax)
+; SETZUCC-NEXT:    movq %r10, %r13
+; SETZUCC-NEXT:    shldq $20, %r9, %r13
+; SETZUCC-NEXT:    movq %r13, 64(%rax)
+; SETZUCC-NEXT:    movq %r11, %r13
+; SETZUCC-NEXT:    shldq $31, %r8, %r13
+; SETZUCC-NEXT:    movq %r13, 48(%rax)
+; SETZUCC-NEXT:    movq %rcx, %r13
+; SETZUCC-NEXT:    shldq $42, %rbx, %r13
+; SETZUCC-NEXT:    movq %r13, 32(%rax)
+; SETZUCC-NEXT:    movabsq $9007199254738944, %r13 # imm = 0x1FFFFFFFFFF800
+; SETZUCC-NEXT:    andq %r12, %r13
+; SETZUCC-NEXT:    shldq $53, %rdx, %r12
+; SETZUCC-NEXT:    movq %r12, 16(%rax)
+; SETZUCC-NEXT:    movq %rbp, %r12
+; SETZUCC-NEXT:    shrq $48, %r12
+; SETZUCC-NEXT:    movb %r12b, 102(%rax)
+; SETZUCC-NEXT:    shrq $32, %rbp
+; SETZUCC-NEXT:    movw %bp, 100(%rax)
+; SETZUCC-NEXT:    movabsq $9007199254740991, %r12 # imm = 0x1FFFFFFFFFFFFF
+; SETZUCC-NEXT:    andq %r12, %r15
+; SETZUCC-NEXT:    shldq $9, %r14, %r15
+; SETZUCC-NEXT:    shlq $62, %rdi
+; SETZUCC-NEXT:    orq %r15, %rdi
+; SETZUCC-NEXT:    movq %rdi, 80(%rax)
+; SETZUCC-NEXT:    shlq $42, %rbx
+; SETZUCC-NEXT:    shrq $11, %r13
+; SETZUCC-NEXT:    orq %rbx, %r13
+; SETZUCC-NEXT:    movq %r13, 24(%rax)
+; SETZUCC-NEXT:    shlq $9, %r14
+; SETZUCC-NEXT:    andl $511, %r10d # imm = 0x1FF
+; SETZUCC-NEXT:    orq %r14, %r10
+; SETZUCC-NEXT:    movq %r10, 72(%rax)
+; SETZUCC-NEXT:    shlq $20, %r9
+; SETZUCC-NEXT:    andl $1048575, %r11d # imm = 0xFFFFF
+; SETZUCC-NEXT:    orq %r9, %r11
+; SETZUCC-NEXT:    movq %r11, 56(%rax)
+; SETZUCC-NEXT:    shlq $31, %r8
+; SETZUCC-NEXT:    andl $2147483647, %ecx # imm = 0x7FFFFFFF
+; SETZUCC-NEXT:    orq %r8, %rcx
+; SETZUCC-NEXT:    movq %rcx, 40(%rax)
+; SETZUCC-NEXT:    movq %rsi, %xmm1
+; SETZUCC-NEXT:    punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
+; SETZUCC-NEXT:    pshufd {{.*#+}} xmm0 = xmm0[2,3,2,3]
+; SETZUCC-NEXT:    movq %xmm0, %rcx
+; SETZUCC-NEXT:    andq %r12, %rcx
+; SETZUCC-NEXT:    shlq $53, %rdx
+; SETZUCC-NEXT:    orq %rcx, %rdx
+; SETZUCC-NEXT:    movq %rdx, 8(%rax)
+; SETZUCC-NEXT:    popq %rbx
+; SETZUCC-NEXT:    popq %r12
+; SETZUCC-NEXT:    popq %r13
+; SETZUCC-NEXT:    popq %r14
+; SETZUCC-NEXT:    popq %r15
+; SETZUCC-NEXT:    popq %rbp
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_uncommon_vectors:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    pushq %rbp
+; NO-SETZUCC-NEXT:    pushq %r15
+; NO-SETZUCC-NEXT:    pushq %r14
+; NO-SETZUCC-NEXT:    pushq %r13
+; NO-SETZUCC-NEXT:    pushq %r12
+; NO-SETZUCC-NEXT:    pushq %rbx
+; NO-SETZUCC-NEXT:    movq %rdi, %rax
+; NO-SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %edi
+; NO-SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %r10d
+; NO-SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %r11d
+; NO-SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %ebx
+; NO-SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %ebp
+; NO-SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %r14d
+; NO-SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %r15d
+; NO-SETZUCC-NEXT:    addb %r15b, %r15b
+; NO-SETZUCC-NEXT:    sarb %r15b
+; NO-SETZUCC-NEXT:    addb %sil, %sil
+; NO-SETZUCC-NEXT:    sarb %sil
+; NO-SETZUCC-NEXT:    cmpb %r15b, %sil
+; NO-SETZUCC-NEXT:    setl %sil
+; NO-SETZUCC-NEXT:    setg %r15b
+; NO-SETZUCC-NEXT:    subb %sil, %r15b
+; NO-SETZUCC-NEXT:    movsbq %r15b, %rsi
+; NO-SETZUCC-NEXT:    movq %rsi, (%rax)
+; NO-SETZUCC-NEXT:    movq %rsi, %xmm0
+; NO-SETZUCC-NEXT:    sarq $63, %rsi
+; NO-SETZUCC-NEXT:    addb %r14b, %r14b
+; NO-SETZUCC-NEXT:    sarb %r14b
+; NO-SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %r15d
+; NO-SETZUCC-NEXT:    addb %r15b, %r15b
+; NO-SETZUCC-NEXT:    sarb %r15b
+; NO-SETZUCC-NEXT:    cmpb %r14b, %r15b
+; NO-SETZUCC-NEXT:    setl %r14b
+; NO-SETZUCC-NEXT:    setg %r15b
+; NO-SETZUCC-NEXT:    subb %r14b, %r15b
+; NO-SETZUCC-NEXT:    movsbq %r15b, %r14
+; NO-SETZUCC-NEXT:    movq %r14, %r15
+; NO-SETZUCC-NEXT:    sarq $63, %r15
+; NO-SETZUCC-NEXT:    addb %bpl, %bpl
+; NO-SETZUCC-NEXT:    sarb %bpl
+; NO-SETZUCC-NEXT:    addb %dl, %dl
+; NO-SETZUCC-NEXT:    sarb %dl
+; NO-SETZUCC-NEXT:    cmpb %bpl, %dl
+; NO-SETZUCC-NEXT:    setl %dl
+; NO-SETZUCC-NEXT:    setg %bpl
+; NO-SETZUCC-NEXT:    subb %dl, %bpl
+; NO-SETZUCC-NEXT:    movsbq %bpl, %rdx
+; NO-SETZUCC-NEXT:    movq %rdx, %r12
+; NO-SETZUCC-NEXT:    sarq $63, %r12
+; NO-SETZUCC-NEXT:    addb %bl, %bl
+; NO-SETZUCC-NEXT:    sarb %bl
+; NO-SETZUCC-NEXT:    addb %cl, %cl
+; NO-SETZUCC-NEXT:    sarb %cl
+; NO-SETZUCC-NEXT:    cmpb %bl, %cl
+; NO-SETZUCC-NEXT:    setl %cl
+; NO-SETZUCC-NEXT:    setg %bl
+; NO-SETZUCC-NEXT:    subb %cl, %bl
+; NO-SETZUCC-NEXT:    movsbq %bl, %rbx
+; NO-SETZUCC-NEXT:    movq %rbx, %rcx
+; NO-SETZUCC-NEXT:    sarq $63, %rcx
+; NO-SETZUCC-NEXT:    addb %r11b, %r11b
+; NO-SETZUCC-NEXT:    sarb %r11b
+; NO-SETZUCC-NEXT:    addb %r8b, %r8b
+; NO-SETZUCC-NEXT:    sarb %r8b
+; NO-SETZUCC-NEXT:    cmpb %r11b, %r8b
+; NO-SETZUCC-NEXT:    setl %r8b
+; NO-SETZUCC-NEXT:    setg %r11b
+; NO-SETZUCC-NEXT:    subb %r8b, %r11b
+; NO-SETZUCC-NEXT:    movsbq %r11b, %r8
+; NO-SETZUCC-NEXT:    movq %r8, %r11
+; NO-SETZUCC-NEXT:    sarq $63, %r11
+; NO-SETZUCC-NEXT:    addb %r10b, %r10b
+; NO-SETZUCC-NEXT:    sarb %r10b
+; NO-SETZUCC-NEXT:    addb %r9b, %r9b
+; NO-SETZUCC-NEXT:    sarb %r9b
+; NO-SETZUCC-NEXT:    cmpb %r10b, %r9b
+; NO-SETZUCC-NEXT:    setl %r9b
+; NO-SETZUCC-NEXT:    setg %r10b
+; NO-SETZUCC-NEXT:    subb %r9b, %r10b
+; NO-SETZUCC-NEXT:    movsbq %r10b, %r9
+; NO-SETZUCC-NEXT:    movq %r9, %r10
+; NO-SETZUCC-NEXT:    sarq $63, %r10
+; NO-SETZUCC-NEXT:    addb %dil, %dil
+; NO-SETZUCC-NEXT:    sarb %dil
+; NO-SETZUCC-NEXT:    movzbl {{[0-9]+}}(%rsp), %ebp
+; NO-SETZUCC-NEXT:    addb %bpl, %bpl
+; NO-SETZUCC-NEXT:    sarb %bpl
+; NO-SETZUCC-NEXT:    cmpb %dil, %bpl
+; NO-SETZUCC-NEXT:    setl %dil
+; NO-SETZUCC-NEXT:    setg %bpl
+; NO-SETZUCC-NEXT:    subb %dil, %bpl
+; NO-SETZUCC-NEXT:    movsbq %bpl, %rdi
+; NO-SETZUCC-NEXT:    movq %rdi, %r13
+; NO-SETZUCC-NEXT:    sarq $63, %r13
+; NO-SETZUCC-NEXT:    movl %r13d, 96(%rax)
+; NO-SETZUCC-NEXT:    movabsq $2251799813685247, %rbp # imm = 0x7FFFFFFFFFFFF
+; NO-SETZUCC-NEXT:    andq %r13, %rbp
+; NO-SETZUCC-NEXT:    shldq $62, %rdi, %r13
+; NO-SETZUCC-NEXT:    movq %r13, 88(%rax)
+; NO-SETZUCC-NEXT:    movq %r10, %r13
+; NO-SETZUCC-NEXT:    shldq $20, %r9, %r13
+; NO-SETZUCC-NEXT:    movq %r13, 64(%rax)
+; NO-SETZUCC-NEXT:    movq %r11, %r13
+; NO-SETZUCC-NEXT:    shldq $31, %r8, %r13
+; NO-SETZUCC-NEXT:    movq %r13, 48(%rax)
+; NO-SETZUCC-NEXT:    movq %rcx, %r13
+; NO-SETZUCC-NEXT:    shldq $42, %rbx, %r13
+; NO-SETZUCC-NEXT:    movq %r13, 32(%rax)
+; NO-SETZUCC-NEXT:    movabsq $9007199254738944, %r13 # imm = 0x1FFFFFFFFFF800
+; NO-SETZUCC-NEXT:    andq %r12, %r13
+; NO-SETZUCC-NEXT:    shldq $53, %rdx, %r12
+; NO-SETZUCC-NEXT:    movq %r12, 16(%rax)
+; NO-SETZUCC-NEXT:    movq %rbp, %r12
+; NO-SETZUCC-NEXT:    shrq $48, %r12
+; NO-SETZUCC-NEXT:    movb %r12b, 102(%rax)
+; NO-SETZUCC-NEXT:    shrq $32, %rbp
+; NO-SETZUCC-NEXT:    movw %bp, 100(%rax)
+; NO-SETZUCC-NEXT:    movabsq $9007199254740991, %r12 # imm = 0x1FFFFFFFFFFFFF
+; NO-SETZUCC-NEXT:    andq %r12, %r15
+; NO-SETZUCC-NEXT:    shldq $9, %r14, %r15
+; NO-SETZUCC-NEXT:    shlq $62, %rdi
+; NO-SETZUCC-NEXT:    orq %r15, %rdi
+; NO-SETZUCC-NEXT:    movq %rdi, 80(%rax)
+; NO-SETZUCC-NEXT:    shlq $42, %rbx
+; NO-SETZUCC-NEXT:    shrq $11, %r13
+; NO-SETZUCC-NEXT:    orq %rbx, %r13
+; NO-SETZUCC-NEXT:    movq %r13, 24(%rax)
+; NO-SETZUCC-NEXT:    shlq $9, %r14
+; NO-SETZUCC-NEXT:    andl $511, %r10d # imm = 0x1FF
+; NO-SETZUCC-NEXT:    orq %r14, %r10
+; NO-SETZUCC-NEXT:    movq %r10, 72(%rax)
+; NO-SETZUCC-NEXT:    shlq $20, %r9
+; NO-SETZUCC-NEXT:    andl $1048575, %r11d # imm = 0xFFFFF
+; NO-SETZUCC-NEXT:    orq %r9, %r11
+; NO-SETZUCC-NEXT:    movq %r11, 56(%rax)
+; NO-SETZUCC-NEXT:    shlq $31, %r8
+; NO-SETZUCC-NEXT:    andl $2147483647, %ecx # imm = 0x7FFFFFFF
+; NO-SETZUCC-NEXT:    orq %r8, %rcx
+; NO-SETZUCC-NEXT:    movq %rcx, 40(%rax)
+; NO-SETZUCC-NEXT:    movq %rsi, %xmm1
+; NO-SETZUCC-NEXT:    punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
+; NO-SETZUCC-NEXT:    pshufd {{.*#+}} xmm0 = xmm0[2,3,2,3]
+; NO-SETZUCC-NEXT:    movq %xmm0, %rcx
+; NO-SETZUCC-NEXT:    andq %r12, %rcx
+; NO-SETZUCC-NEXT:    shlq $53, %rdx
+; NO-SETZUCC-NEXT:    orq %rcx, %rdx
+; NO-SETZUCC-NEXT:    movq %rdx, 8(%rax)
+; NO-SETZUCC-NEXT:    popq %rbx
+; NO-SETZUCC-NEXT:    popq %r12
+; NO-SETZUCC-NEXT:    popq %r13
+; NO-SETZUCC-NEXT:    popq %r14
+; NO-SETZUCC-NEXT:    popq %r15
+; NO-SETZUCC-NEXT:    popq %rbp
+; NO-SETZUCC-NEXT:    retq
   %1 = call <7 x i117> @llvm.scmp(<7 x i7> %x, <7 x i7> %y)
   ret <7 x i117> %1
 }
@@ -2455,6 +3539,30 @@ define <1 x i3> @scmp_scalarize(<1 x i33> %x, <1 x i33> %y) nounwind {
 ; X86-NEXT:    popl %edi
 ; X86-NEXT:    popl %ebx
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp_scalarize:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    shlq $31, %rsi
+; SETZUCC-NEXT:    sarq $31, %rsi
+; SETZUCC-NEXT:    shlq $31, %rdi
+; SETZUCC-NEXT:    sarq $31, %rdi
+; SETZUCC-NEXT:    cmpq %rsi, %rdi
+; SETZUCC-NEXT:    setzul %cl
+; SETZUCC-NEXT:    setzug %al
+; SETZUCC-NEXT:    subb %cl, %al
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_scalarize:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    shlq $31, %rsi
+; NO-SETZUCC-NEXT:    sarq $31, %rsi
+; NO-SETZUCC-NEXT:    shlq $31, %rdi
+; NO-SETZUCC-NEXT:    sarq $31, %rdi
+; NO-SETZUCC-NEXT:    cmpq %rsi, %rdi
+; NO-SETZUCC-NEXT:    setl %cl
+; NO-SETZUCC-NEXT:    setg %al
+; NO-SETZUCC-NEXT:    subb %cl, %al
+; NO-SETZUCC-NEXT:    retq
   %1 = call <1 x i3> @llvm.scmp(<1 x i33> %x, <1 x i33> %y)
   ret <1 x i3> %1
 }
@@ -2600,6 +3708,68 @@ define <2 x i8> @scmp_bool_operands(<2 x i1> %x, <2 x i1> %y) nounwind {
 ; X86-NEXT:    setg %dl
 ; X86-NEXT:    subb %cl, %dl
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp_bool_operands:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    movaps %xmm1, -{{[0-9]+}}(%rsp)
+; SETZUCC-NEXT:    movaps %xmm0, -{{[0-9]+}}(%rsp)
+; SETZUCC-NEXT:    movzbl -{{[0-9]+}}(%rsp), %eax
+; SETZUCC-NEXT:    movzbl -{{[0-9]+}}(%rsp), %ecx
+; SETZUCC-NEXT:    andb $1, %al
+; SETZUCC-NEXT:    negb %al
+; SETZUCC-NEXT:    movzbl -{{[0-9]+}}(%rsp), %edx
+; SETZUCC-NEXT:    movzbl -{{[0-9]+}}(%rsp), %esi
+; SETZUCC-NEXT:    andb $1, %dl
+; SETZUCC-NEXT:    negb %dl
+; SETZUCC-NEXT:    cmpb %al, %dl
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %dl
+; SETZUCC-NEXT:    subb %al, %dl
+; SETZUCC-NEXT:    movzbl %dl, %eax
+; SETZUCC-NEXT:    andb $1, %cl
+; SETZUCC-NEXT:    negb %cl
+; SETZUCC-NEXT:    andb $1, %sil
+; SETZUCC-NEXT:    negb %sil
+; SETZUCC-NEXT:    cmpb %cl, %sil
+; SETZUCC-NEXT:    setzul %cl
+; SETZUCC-NEXT:    setzug %dl
+; SETZUCC-NEXT:    subb %cl, %dl
+; SETZUCC-NEXT:    movzbl %dl, %ecx
+; SETZUCC-NEXT:    shll $8, %ecx
+; SETZUCC-NEXT:    orl %eax, %ecx
+; SETZUCC-NEXT:    movd %ecx, %xmm0
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_bool_operands:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    movaps %xmm1, -{{[0-9]+}}(%rsp)
+; NO-SETZUCC-NEXT:    movaps %xmm0, -{{[0-9]+}}(%rsp)
+; NO-SETZUCC-NEXT:    movzbl -{{[0-9]+}}(%rsp), %eax
+; NO-SETZUCC-NEXT:    movzbl -{{[0-9]+}}(%rsp), %ecx
+; NO-SETZUCC-NEXT:    andb $1, %al
+; NO-SETZUCC-NEXT:    negb %al
+; NO-SETZUCC-NEXT:    movzbl -{{[0-9]+}}(%rsp), %edx
+; NO-SETZUCC-NEXT:    movzbl -{{[0-9]+}}(%rsp), %esi
+; NO-SETZUCC-NEXT:    andb $1, %dl
+; NO-SETZUCC-NEXT:    negb %dl
+; NO-SETZUCC-NEXT:    cmpb %al, %dl
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %dl
+; NO-SETZUCC-NEXT:    subb %al, %dl
+; NO-SETZUCC-NEXT:    movzbl %dl, %eax
+; NO-SETZUCC-NEXT:    andb $1, %cl
+; NO-SETZUCC-NEXT:    negb %cl
+; NO-SETZUCC-NEXT:    andb $1, %sil
+; NO-SETZUCC-NEXT:    negb %sil
+; NO-SETZUCC-NEXT:    cmpb %cl, %sil
+; NO-SETZUCC-NEXT:    setl %cl
+; NO-SETZUCC-NEXT:    setg %dl
+; NO-SETZUCC-NEXT:    subb %cl, %dl
+; NO-SETZUCC-NEXT:    movzbl %dl, %ecx
+; NO-SETZUCC-NEXT:    shll $8, %ecx
+; NO-SETZUCC-NEXT:    orl %eax, %ecx
+; NO-SETZUCC-NEXT:    movd %ecx, %xmm0
+; NO-SETZUCC-NEXT:    retq
   %1 = call <2 x i8> @llvm.scmp(<2 x i1> %x, <2 x i1> %y)
   ret <2 x i8> %1
 }
@@ -2684,6 +3854,50 @@ define <2 x i16> @scmp_ret_wider_than_operands(<2 x i8> %x, <2 x i8> %y) nounwin
 ; X86-NEXT:    # kill: def $ax killed $ax killed $eax
 ; X86-NEXT:    # kill: def $dx killed $dx killed $edx
 ; X86-NEXT:    retl
+;
+; SETZUCC-LABEL: scmp_ret_wider_than_operands:
+; SETZUCC:       # %bb.0:
+; SETZUCC-NEXT:    movd %xmm1, %eax
+; SETZUCC-NEXT:    movl %eax, %ecx
+; SETZUCC-NEXT:    shrl $8, %ecx
+; SETZUCC-NEXT:    movd %xmm0, %edx
+; SETZUCC-NEXT:    movl %edx, %esi
+; SETZUCC-NEXT:    shrl $8, %esi
+; SETZUCC-NEXT:    cmpb %cl, %sil
+; SETZUCC-NEXT:    setzul %cl
+; SETZUCC-NEXT:    setzug %sil
+; SETZUCC-NEXT:    subb %cl, %sil
+; SETZUCC-NEXT:    movsbl %sil, %ecx
+; SETZUCC-NEXT:    cmpb %al, %dl
+; SETZUCC-NEXT:    setzul %al
+; SETZUCC-NEXT:    setzug %dl
+; SETZUCC-NEXT:    subb %al, %dl
+; SETZUCC-NEXT:    movsbl %dl, %eax
+; SETZUCC-NEXT:    movd %eax, %xmm0
+; SETZUCC-NEXT:    pinsrw $1, %ecx, %xmm0
+; SETZUCC-NEXT:    retq
+;
+; NO-SETZUCC-LABEL: scmp_ret_wider_than_operands:
+; NO-SETZUCC:       # %bb.0:
+; NO-SETZUCC-NEXT:    movd %xmm1, %eax
+; NO-SETZUCC-NEXT:    movl %eax, %ecx
+; NO-SETZUCC-NEXT:    shrl $8, %ecx
+; NO-SETZUCC-NEXT:    movd %xmm0, %edx
+; NO-SETZUCC-NEXT:    movl %edx, %esi
+; NO-SETZUCC-NEXT:    shrl $8, %esi
+; NO-SETZUCC-NEXT:    cmpb %cl, %sil
+; NO-SETZUCC-NEXT:    setl %cl
+; NO-SETZUCC-NEXT:    setg %sil
+; NO-SETZUCC-NEXT:    subb %cl, %sil
+; NO-SETZUCC-NEXT:    movsbl %sil, %ecx
+; NO-SETZUCC-NEXT:    cmpb %al, %dl
+; NO-SETZUCC-NEXT:    setl %al
+; NO-SETZUCC-NEXT:    setg %dl
+; NO-SETZUCC-NEXT:    subb %al, %dl
+; NO-SETZUCC-NEXT:    movsbl %dl, %eax
+; NO-SETZUCC-NEXT:    movd %eax, %xmm0
+; NO-SETZUCC-NEXT:    pinsrw $1, %ecx, %xmm0
+; NO-SETZUCC-NEXT:    retq
   %1 = call <2 x i16> @llvm.scmp(<2 x i8> %x, <2 x i8> %y)
   ret <2 x i16> %1
 }



More information about the llvm-commits mailing list