llvm.org GIT mirror llvm / bbbc2c2
Revert r274692 to check whether this is what breaks windows selfhost. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274771 91177308-0d34-0410-b5e6-96231b3b80d8 Michael Kuperstein 3 years ago
32 changed file(s) with 324 addition(s) and 559 deletion(s). Raw diff Collapse all Expand all
1818 X86FastISel.cpp
1919 X86FixupBWInsts.cpp
2020 X86FixupLEAs.cpp
21 X86FixupSetCC.cpp
2221 X86FloatingPoint.cpp
2322 X86FrameLowering.cpp
2423 X86ISelDAGToDAG.cpp
5858 /// recalculations.
5959 FunctionPass *createX86OptimizeLEAs();
6060
61 /// Return a pass that transforms setcc + movzx pairs into xor + setcc.
62 FunctionPass *createX86FixupSetCC();
63
6461 /// Return a pass that expands WinAlloca pseudo-instructions.
6562 FunctionPass *createX86WinAllocaExpander();
6663
+0
-183
lib/Target/X86/X86FixupSetCC.cpp less more
None //===---- X86FixupSetCC.cpp - optimize usage of LEA instructions ----------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines a pass that fixes zero-extension of setcc patterns.
10 // X86 setcc instructions are modeled to have no input arguments, and a single
11 // GR8 output argument. This is consistent with other similar instructions
12 // (e.g. movb), but means it is impossible to directly generate a setcc into
13 // the lower GR8 of a specified GR32.
14 // This means that ISel must select (zext (setcc)) into something like
15 // seta %al; movzbl %al, %eax.
16 // Unfortunately, this can cause a stall due to the partial register write
17 // performed by the setcc. Instead, we can use:
18 // xor %eax, %eax; seta %al
19 // This both avoids the stall, and encodes shorter.
20 //===----------------------------------------------------------------------===//
21
22 #include "X86.h"
23 #include "X86InstrInfo.h"
24 #include "X86Subtarget.h"
25 #include "llvm/ADT/Statistic.h"
26 #include "llvm/CodeGen/MachineFunctionPass.h"
27 #include "llvm/CodeGen/MachineInstrBuilder.h"
28 #include "llvm/CodeGen/MachineRegisterInfo.h"
29
30 using namespace llvm;
31
32 #define DEBUG_TYPE "x86-fixup-setcc"
33
34 STATISTIC(NumSubstZexts, "Number of setcc + zext pairs substituted");
35
36 namespace {
37 class X86FixupSetCCPass : public MachineFunctionPass {
38 public:
39 X86FixupSetCCPass() : MachineFunctionPass(ID) {}
40
41 const char *getPassName() const override { return "X86 Fixup SetCC"; }
42
43 bool runOnMachineFunction(MachineFunction &MF) override;
44
45 private:
46 // Find the preceding instruction that imp-defs eflags.
47 MachineInstr *findFlagsImpDef(MachineBasicBlock *MBB,
48 MachineBasicBlock::reverse_iterator MI);
49
50 // Return true if MI imp-uses eflags.
51 bool impUsesFlags(MachineInstr *MI);
52
53 // Return true if this is the opcode of a SetCC instruction with a register
54 // output.
55 bool isSetCCr(unsigned Opode);
56
57 MachineRegisterInfo *MRI;
58 const X86InstrInfo *TII;
59
60 enum { SearchBound = 16 };
61
62 static char ID;
63 };
64
65 char X86FixupSetCCPass::ID = 0;
66 }
67
68 FunctionPass *llvm::createX86FixupSetCC() { return new X86FixupSetCCPass(); }
69
70 bool X86FixupSetCCPass::isSetCCr(unsigned Opcode) {
71 switch (Opcode) {
72 default:
73 return false;
74 case X86::SETOr:
75 case X86::SETNOr:
76 case X86::SETBr:
77 case X86::SETAEr:
78 case X86::SETEr:
79 case X86::SETNEr:
80 case X86::SETBEr:
81 case X86::SETAr:
82 case X86::SETSr:
83 case X86::SETNSr:
84 case X86::SETPr:
85 case X86::SETNPr:
86 case X86::SETLr:
87 case X86::SETGEr:
88 case X86::SETLEr:
89 case X86::SETGr:
90 return true;
91 }
92 }
93
94 // We expect the instruction *immediately* before the setcc to imp-def
95 // EFLAGS (because of scheduling glue). To make this less brittle w.r.t
96 // scheduling, look backwards until we hit the beginning of the
97 // basic-block, or a small bound (to avoid quadratic behavior).
98 MachineInstr *
99 X86FixupSetCCPass::findFlagsImpDef(MachineBasicBlock *MBB,
100 MachineBasicBlock::reverse_iterator MI) {
101 auto MBBStart = MBB->instr_rend();
102 for (int i = 0; (i < SearchBound) && (MI != MBBStart); ++i, ++MI)
103 for (auto &Op : MI->implicit_operands())
104 if ((Op.getReg() == X86::EFLAGS) && (Op.isDef()))
105 return &*MI;
106
107 return nullptr;
108 }
109
110 bool X86FixupSetCCPass::impUsesFlags(MachineInstr *MI) {
111 for (auto &Op : MI->implicit_operands())
112 if ((Op.getReg() == X86::EFLAGS) && (Op.isUse()))
113 return true;
114
115 return false;
116 }
117
118 bool X86FixupSetCCPass::runOnMachineFunction(MachineFunction &MF) {
119 bool Changed = false;
120 MRI = &MF.getRegInfo();
121 TII = MF.getSubtarget().getInstrInfo();
122
123 SmallVector ToErase;
124
125 for (auto &MBB : MF) {
126 for (auto &MI : MBB) {
127 // Find a setcc that is used by a zext.
128 // This doesn't have to be the only use, the transformation is safe
129 // regardless.
130 if (!isSetCCr(MI.getOpcode()))
131 continue;
132
133 MachineInstr *ZExt = nullptr;
134 for (auto &Use : MRI->use_instructions(MI.getOperand(0).getReg()))
135 if (Use.getOpcode() == X86::MOVZX32rr8)
136 ZExt = &Use;
137
138 if (!ZExt)
139 continue;
140
141 // Find the preceding instruction that imp-defs eflags.
142 MachineInstr *FlagsDefMI = findFlagsImpDef(
143 MI.getParent(), MachineBasicBlock::reverse_iterator(&MI));
144 if (!FlagsDefMI)
145 continue;
146
147 // We'd like to put something that clobbers eflags directly before
148 // FlagsDefMI. This can't hurt anything after FlagsDefMI, because
149 // it, itself, by definition, clobbers eflags. But it may happen that
150 // FlagsDefMI also *uses* eflags, in which case the transformation is
151 // invalid.
152 if (impUsesFlags(FlagsDefMI))
153 continue;
154
155 ++NumSubstZexts;
156 Changed = true;
157
158 auto *RC = MRI->getRegClass(ZExt->getOperand(0).getReg());
159 unsigned ZeroReg = MRI->createVirtualRegister(RC);
160 unsigned InsertReg = MRI->createVirtualRegister(RC);
161
162 // Initialize a register with 0. This must go before the eflags def
163 BuildMI(MBB, FlagsDefMI, MI.getDebugLoc(), TII->get(X86::MOV32r0),
164 ZeroReg);
165
166 // X86 setcc only takes an output GR8, so fake a GR32 input by inserting
167 // the setcc result into the low byte of the zeroed register.
168 BuildMI(*ZExt->getParent(), ZExt, ZExt->getDebugLoc(),
169 TII->get(X86::INSERT_SUBREG), InsertReg)
170 .addReg(ZeroReg)
171 .addReg(MI.getOperand(0).getReg())
172 .addImm(X86::sub_8bit);
173 MRI->replaceRegWith(ZExt->getOperand(0).getReg(), InsertReg);
174 ToErase.push_back(ZExt);
175 }
176 }
177
178 for (auto &I : ToErase)
179 I->eraseFromParent();
180
181 return Changed;
182 }
284284 addPass(createCleanupLocalDynamicTLSPass());
285285
286286 addPass(createX86GlobalBaseRegPass());
287
287288 return false;
288289 }
289290
303304 }
304305
305306 void X86PassConfig::addPreRegAlloc() {
306 addPass(createX86FixupSetCC());
307
308307 if (getOptLevel() != CodeGenOpt::None)
309308 addPass(createX86OptimizeLEAs());
310309
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin | grep xorl
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin | grep movzbl
11
22 define i32 @foo(<4 x float> %a, <4 x float> %b) nounwind {
33 entry:
99 ; SOURCE-SCHED: subl
1010 ; SOURCE-SCHED: movl
1111 ; SOURCE-SCHED: sarl
12 ; SOURCE-SCHED: xorl
1312 ; SOURCE-SCHED: cmpl
1413 ; SOURCE-SCHED: setg
14 ; SOURCE-SCHED: movzbl
1515 ; SOURCE-SCHED: movb
1616 ; SOURCE-SCHED: xorl
1717 ; SOURCE-SCHED: subl
33833383 define i32 @test_mm_testnzc_pd(<2 x double> %a0, <2 x double> %a1) nounwind {
33843384 ; X32-LABEL: test_mm_testnzc_pd:
33853385 ; X32: # BB#0:
3386 ; X32-NEXT: xorl %eax, %eax
33873386 ; X32-NEXT: vtestpd %xmm1, %xmm0
33883387 ; X32-NEXT: seta %al
3388 ; X32-NEXT: movzbl %al, %eax
33893389 ; X32-NEXT: retl
33903390 ;
33913391 ; X64-LABEL: test_mm_testnzc_pd:
33923392 ; X64: # BB#0:
3393 ; X64-NEXT: xorl %eax, %eax
33943393 ; X64-NEXT: vtestpd %xmm1, %xmm0
33953394 ; X64-NEXT: seta %al
3395 ; X64-NEXT: movzbl %al, %eax
33963396 ; X64-NEXT: retq
33973397 %res = call i32 @llvm.x86.avx.vtestnzc.pd(<2 x double> %a0, <2 x double> %a1)
33983398 ret i32 %res
34023402 define i32 @test_mm256_testnzc_pd(<4 x double> %a0, <4 x double> %a1) nounwind {
34033403 ; X32-LABEL: test_mm256_testnzc_pd:
34043404 ; X32: # BB#0:
3405 ; X32-NEXT: xorl %eax, %eax
34063405 ; X32-NEXT: vtestpd %ymm1, %ymm0
34073406 ; X32-NEXT: seta %al
3407 ; X32-NEXT: movzbl %al, %eax
34083408 ; X32-NEXT: vzeroupper
34093409 ; X32-NEXT: retl
34103410 ;
34113411 ; X64-LABEL: test_mm256_testnzc_pd:
34123412 ; X64: # BB#0:
3413 ; X64-NEXT: xorl %eax, %eax
34143413 ; X64-NEXT: vtestpd %ymm1, %ymm0
34153414 ; X64-NEXT: seta %al
3415 ; X64-NEXT: movzbl %al, %eax
34163416 ; X64-NEXT: vzeroupper
34173417 ; X64-NEXT: retq
34183418 %res = call i32 @llvm.x86.avx.vtestnzc.pd.256(<4 x double> %a0, <4 x double> %a1)
34233423 define i32 @test_mm_testnzc_ps(<4 x float> %a0, <4 x float> %a1) nounwind {
34243424 ; X32-LABEL: test_mm_testnzc_ps:
34253425 ; X32: # BB#0:
3426 ; X32-NEXT: xorl %eax, %eax
34273426 ; X32-NEXT: vtestps %xmm1, %xmm0
34283427 ; X32-NEXT: seta %al
3428 ; X32-NEXT: movzbl %al, %eax
34293429 ; X32-NEXT: retl
34303430 ;
34313431 ; X64-LABEL: test_mm_testnzc_ps:
34323432 ; X64: # BB#0:
3433 ; X64-NEXT: xorl %eax, %eax
34343433 ; X64-NEXT: vtestps %xmm1, %xmm0
34353434 ; X64-NEXT: seta %al
3435 ; X64-NEXT: movzbl %al, %eax
34363436 ; X64-NEXT: retq
34373437 %res = call i32 @llvm.x86.avx.vtestnzc.ps(<4 x float> %a0, <4 x float> %a1)
34383438 ret i32 %res
34423442 define i32 @test_mm256_testnzc_ps(<8 x float> %a0, <8 x float> %a1) nounwind {
34433443 ; X32-LABEL: test_mm256_testnzc_ps:
34443444 ; X32: # BB#0:
3445 ; X32-NEXT: xorl %eax, %eax
34463445 ; X32-NEXT: vtestps %ymm1, %ymm0
34473446 ; X32-NEXT: seta %al
3447 ; X32-NEXT: movzbl %al, %eax
34483448 ; X32-NEXT: vzeroupper
34493449 ; X32-NEXT: retl
34503450 ;
34513451 ; X64-LABEL: test_mm256_testnzc_ps:
34523452 ; X64: # BB#0:
3453 ; X64-NEXT: xorl %eax, %eax
34543453 ; X64-NEXT: vtestps %ymm1, %ymm0
34553454 ; X64-NEXT: seta %al
3455 ; X64-NEXT: movzbl %al, %eax
34563456 ; X64-NEXT: vzeroupper
34573457 ; X64-NEXT: retq
34583458 %res = call i32 @llvm.x86.avx.vtestnzc.ps.256(<8 x float> %a0, <8 x float> %a1)
34633463 define i32 @test_mm256_testnzc_si256(<4 x i64> %a0, <4 x i64> %a1) nounwind {
34643464 ; X32-LABEL: test_mm256_testnzc_si256:
34653465 ; X32: # BB#0:
3466 ; X32-NEXT: xorl %eax, %eax
34673466 ; X32-NEXT: vptest %ymm1, %ymm0
34683467 ; X32-NEXT: seta %al
3468 ; X32-NEXT: movzbl %al, %eax
34693469 ; X32-NEXT: vzeroupper
34703470 ; X32-NEXT: retl
34713471 ;
34723472 ; X64-LABEL: test_mm256_testnzc_si256:
34733473 ; X64: # BB#0:
3474 ; X64-NEXT: xorl %eax, %eax
34753474 ; X64-NEXT: vptest %ymm1, %ymm0
34763475 ; X64-NEXT: seta %al
3476 ; X64-NEXT: movzbl %al, %eax
34773477 ; X64-NEXT: vzeroupper
34783478 ; X64-NEXT: retq
34793479 %res = call i32 @llvm.x86.avx.ptestnzc.256(<4 x i64> %a0, <4 x i64> %a1)
34843484 define i32 @test_mm_testz_pd(<2 x double> %a0, <2 x double> %a1) nounwind {
34853485 ; X32-LABEL: test_mm_testz_pd:
34863486 ; X32: # BB#0:
3487 ; X32-NEXT: xorl %eax, %eax
34883487 ; X32-NEXT: vtestpd %xmm1, %xmm0
34893488 ; X32-NEXT: sete %al
3489 ; X32-NEXT: movzbl %al, %eax
34903490 ; X32-NEXT: retl
34913491 ;
34923492 ; X64-LABEL: test_mm_testz_pd:
34933493 ; X64: # BB#0:
3494 ; X64-NEXT: xorl %eax, %eax
34953494 ; X64-NEXT: vtestpd %xmm1, %xmm0
34963495 ; X64-NEXT: sete %al
3496 ; X64-NEXT: movzbl %al, %eax
34973497 ; X64-NEXT: retq
34983498 %res = call i32 @llvm.x86.avx.vtestz.pd(<2 x double> %a0, <2 x double> %a1)
34993499 ret i32 %res
35033503 define i32 @test_mm256_testz_pd(<4 x double> %a0, <4 x double> %a1) nounwind {
35043504 ; X32-LABEL: test_mm256_testz_pd:
35053505 ; X32: # BB#0:
3506 ; X32-NEXT: xorl %eax, %eax
35073506 ; X32-NEXT: vtestpd %ymm1, %ymm0
35083507 ; X32-NEXT: sete %al
3508 ; X32-NEXT: movzbl %al, %eax
35093509 ; X32-NEXT: vzeroupper
35103510 ; X32-NEXT: retl
35113511 ;
35123512 ; X64-LABEL: test_mm256_testz_pd:
35133513 ; X64: # BB#0:
3514 ; X64-NEXT: xorl %eax, %eax
35153514 ; X64-NEXT: vtestpd %ymm1, %ymm0
35163515 ; X64-NEXT: sete %al
3516 ; X64-NEXT: movzbl %al, %eax
35173517 ; X64-NEXT: vzeroupper
35183518 ; X64-NEXT: retq
35193519 %res = call i32 @llvm.x86.avx.vtestz.pd.256(<4 x double> %a0, <4 x double> %a1)
35243524 define i32 @test_mm_testz_ps(<4 x float> %a0, <4 x float> %a1) nounwind {
35253525 ; X32-LABEL: test_mm_testz_ps:
35263526 ; X32: # BB#0:
3527 ; X32-NEXT: xorl %eax, %eax
35283527 ; X32-NEXT: vtestps %xmm1, %xmm0
35293528 ; X32-NEXT: sete %al
3529 ; X32-NEXT: movzbl %al, %eax
35303530 ; X32-NEXT: retl
35313531 ;
35323532 ; X64-LABEL: test_mm_testz_ps:
35333533 ; X64: # BB#0:
3534 ; X64-NEXT: xorl %eax, %eax
35353534 ; X64-NEXT: vtestps %xmm1, %xmm0
35363535 ; X64-NEXT: sete %al
3536 ; X64-NEXT: movzbl %al, %eax
35373537 ; X64-NEXT: retq
35383538 %res = call i32 @llvm.x86.avx.vtestz.ps(<4 x float> %a0, <4 x float> %a1)
35393539 ret i32 %res
35433543 define i32 @test_mm256_testz_ps(<8 x float> %a0, <8 x float> %a1) nounwind {
35443544 ; X32-LABEL: test_mm256_testz_ps:
35453545 ; X32: # BB#0:
3546 ; X32-NEXT: xorl %eax, %eax
35473546 ; X32-NEXT: vtestps %ymm1, %ymm0
35483547 ; X32-NEXT: sete %al
3548 ; X32-NEXT: movzbl %al, %eax
35493549 ; X32-NEXT: vzeroupper
35503550 ; X32-NEXT: retl
35513551 ;
35523552 ; X64-LABEL: test_mm256_testz_ps:
35533553 ; X64: # BB#0:
3554 ; X64-NEXT: xorl %eax, %eax
35553554 ; X64-NEXT: vtestps %ymm1, %ymm0
35563555 ; X64-NEXT: sete %al
3556 ; X64-NEXT: movzbl %al, %eax
35573557 ; X64-NEXT: vzeroupper
35583558 ; X64-NEXT: retq
35593559 %res = call i32 @llvm.x86.avx.vtestz.ps.256(<8 x float> %a0, <8 x float> %a1)
35643564 define i32 @test_mm256_testz_si256(<4 x i64> %a0, <4 x i64> %a1) nounwind {
35653565 ; X32-LABEL: test_mm256_testz_si256:
35663566 ; X32: # BB#0:
3567 ; X32-NEXT: xorl %eax, %eax
35683567 ; X32-NEXT: vptest %ymm1, %ymm0
35693568 ; X32-NEXT: sete %al
3569 ; X32-NEXT: movzbl %al, %eax
35703570 ; X32-NEXT: vzeroupper
35713571 ; X32-NEXT: retl
35723572 ;
35733573 ; X64-LABEL: test_mm256_testz_si256:
35743574 ; X64: # BB#0:
3575 ; X64-NEXT: xorl %eax, %eax
35763575 ; X64-NEXT: vptest %ymm1, %ymm0
35773576 ; X64-NEXT: sete %al
3577 ; X64-NEXT: movzbl %al, %eax
35783578 ; X64-NEXT: vzeroupper
35793579 ; X64-NEXT: retq
35803580 %res = call i32 @llvm.x86.avx.ptestz.256(<4 x i64> %a0, <4 x i64> %a1)
172172 define i32 @test_x86_sse2_comige_sd(<2 x double> %a0, <2 x double> %a1) {
173173 ; AVX-LABEL: test_x86_sse2_comige_sd:
174174 ; AVX: ## BB#0:
175 ; AVX-NEXT: xorl %eax, %eax
176175 ; AVX-NEXT: vcomisd %xmm1, %xmm0
177176 ; AVX-NEXT: setae %al
177 ; AVX-NEXT: movzbl %al, %eax
178178 ; AVX-NEXT: retl
179179 ;
180180 ; AVX512VL-LABEL: test_x86_sse2_comige_sd:
181181 ; AVX512VL: ## BB#0:
182 ; AVX512VL-NEXT: xorl %eax, %eax
183182 ; AVX512VL-NEXT: vcomisd %xmm1, %xmm0
184183 ; AVX512VL-NEXT: setae %al
184 ; AVX512VL-NEXT: movzbl %al, %eax
185185 ; AVX512VL-NEXT: retl
186186 %res = call i32 @llvm.x86.sse2.comige.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
187187 ret i32 %res
192192 define i32 @test_x86_sse2_comigt_sd(<2 x double> %a0, <2 x double> %a1) {
193193 ; AVX-LABEL: test_x86_sse2_comigt_sd:
194194 ; AVX: ## BB#0:
195 ; AVX-NEXT: xorl %eax, %eax
196195 ; AVX-NEXT: vcomisd %xmm1, %xmm0
197196 ; AVX-NEXT: seta %al
197 ; AVX-NEXT: movzbl %al, %eax
198198 ; AVX-NEXT: retl
199199 ;
200200 ; AVX512VL-LABEL: test_x86_sse2_comigt_sd:
201201 ; AVX512VL: ## BB#0:
202 ; AVX512VL-NEXT: xorl %eax, %eax
203202 ; AVX512VL-NEXT: vcomisd %xmm1, %xmm0
204203 ; AVX512VL-NEXT: seta %al
204 ; AVX512VL-NEXT: movzbl %al, %eax
205205 ; AVX512VL-NEXT: retl
206206 %res = call i32 @llvm.x86.sse2.comigt.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
207207 ret i32 %res
212212 define i32 @test_x86_sse2_comile_sd(<2 x double> %a0, <2 x double> %a1) {
213213 ; AVX-LABEL: test_x86_sse2_comile_sd:
214214 ; AVX: ## BB#0:
215 ; AVX-NEXT: xorl %eax, %eax
216215 ; AVX-NEXT: vcomisd %xmm0, %xmm1
217216 ; AVX-NEXT: setae %al
217 ; AVX-NEXT: movzbl %al, %eax
218218 ; AVX-NEXT: retl
219219 ;
220220 ; AVX512VL-LABEL: test_x86_sse2_comile_sd:
221221 ; AVX512VL: ## BB#0:
222 ; AVX512VL-NEXT: xorl %eax, %eax
223222 ; AVX512VL-NEXT: vcomisd %xmm0, %xmm1
224223 ; AVX512VL-NEXT: setae %al
224 ; AVX512VL-NEXT: movzbl %al, %eax
225225 ; AVX512VL-NEXT: retl
226226 %res = call i32 @llvm.x86.sse2.comile.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
227227 ret i32 %res
232232 define i32 @test_x86_sse2_comilt_sd(<2 x double> %a0, <2 x double> %a1) {
233233 ; AVX-LABEL: test_x86_sse2_comilt_sd:
234234 ; AVX: ## BB#0:
235 ; AVX-NEXT: xorl %eax, %eax
236235 ; AVX-NEXT: vcomisd %xmm0, %xmm1
237236 ; AVX-NEXT: seta %al
237 ; AVX-NEXT: movzbl %al, %eax
238238 ; AVX-NEXT: retl
239239 ;
240240 ; AVX512VL-LABEL: test_x86_sse2_comilt_sd:
241241 ; AVX512VL: ## BB#0:
242 ; AVX512VL-NEXT: xorl %eax, %eax
243242 ; AVX512VL-NEXT: vcomisd %xmm0, %xmm1
244243 ; AVX512VL-NEXT: seta %al
244 ; AVX512VL-NEXT: movzbl %al, %eax
245245 ; AVX512VL-NEXT: retl
246246 %res = call i32 @llvm.x86.sse2.comilt.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
247247 ret i32 %res
12631263 define i32 @test_x86_sse2_ucomige_sd(<2 x double> %a0, <2 x double> %a1) {
12641264 ; AVX-LABEL: test_x86_sse2_ucomige_sd:
12651265 ; AVX: ## BB#0:
1266 ; AVX-NEXT: xorl %eax, %eax
12671266 ; AVX-NEXT: vucomisd %xmm1, %xmm0
12681267 ; AVX-NEXT: setae %al
1268 ; AVX-NEXT: movzbl %al, %eax
12691269 ; AVX-NEXT: retl
12701270 ;
12711271 ; AVX512VL-LABEL: test_x86_sse2_ucomige_sd:
12721272 ; AVX512VL: ## BB#0:
1273 ; AVX512VL-NEXT: xorl %eax, %eax
12741273 ; AVX512VL-NEXT: vucomisd %xmm1, %xmm0
12751274 ; AVX512VL-NEXT: setae %al
1275 ; AVX512VL-NEXT: movzbl %al, %eax
12761276 ; AVX512VL-NEXT: retl
12771277 %res = call i32 @llvm.x86.sse2.ucomige.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
12781278 ret i32 %res
12831283 define i32 @test_x86_sse2_ucomigt_sd(<2 x double> %a0, <2 x double> %a1) {
12841284 ; AVX-LABEL: test_x86_sse2_ucomigt_sd:
12851285 ; AVX: ## BB#0:
1286 ; AVX-NEXT: xorl %eax, %eax
12871286 ; AVX-NEXT: vucomisd %xmm1, %xmm0
12881287 ; AVX-NEXT: seta %al
1288 ; AVX-NEXT: movzbl %al, %eax
12891289 ; AVX-NEXT: retl
12901290 ;
12911291 ; AVX512VL-LABEL: test_x86_sse2_ucomigt_sd:
12921292 ; AVX512VL: ## BB#0:
1293 ; AVX512VL-NEXT: xorl %eax, %eax
12941293 ; AVX512VL-NEXT: vucomisd %xmm1, %xmm0
12951294 ; AVX512VL-NEXT: seta %al
1295 ; AVX512VL-NEXT: movzbl %al, %eax
12961296 ; AVX512VL-NEXT: retl
12971297 %res = call i32 @llvm.x86.sse2.ucomigt.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
12981298 ret i32 %res
13031303 define i32 @test_x86_sse2_ucomile_sd(<2 x double> %a0, <2 x double> %a1) {
13041304 ; AVX-LABEL: test_x86_sse2_ucomile_sd:
13051305 ; AVX: ## BB#0:
1306 ; AVX-NEXT: xorl %eax, %eax
13071306 ; AVX-NEXT: vucomisd %xmm0, %xmm1
13081307 ; AVX-NEXT: setae %al
1308 ; AVX-NEXT: movzbl %al, %eax
13091309 ; AVX-NEXT: retl
13101310 ;
13111311 ; AVX512VL-LABEL: test_x86_sse2_ucomile_sd:
13121312 ; AVX512VL: ## BB#0:
1313 ; AVX512VL-NEXT: xorl %eax, %eax
13141313 ; AVX512VL-NEXT: vucomisd %xmm0, %xmm1
13151314 ; AVX512VL-NEXT: setae %al
1315 ; AVX512VL-NEXT: movzbl %al, %eax
13161316 ; AVX512VL-NEXT: retl
13171317 %res = call i32 @llvm.x86.sse2.ucomile.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
13181318 ret i32 %res
13231323 define i32 @test_x86_sse2_ucomilt_sd(<2 x double> %a0, <2 x double> %a1) {
13241324 ; AVX-LABEL: test_x86_sse2_ucomilt_sd:
13251325 ; AVX: ## BB#0:
1326 ; AVX-NEXT: xorl %eax, %eax
13271326 ; AVX-NEXT: vucomisd %xmm0, %xmm1
13281327 ; AVX-NEXT: seta %al
1328 ; AVX-NEXT: movzbl %al, %eax
13291329 ; AVX-NEXT: retl
13301330 ;
13311331 ; AVX512VL-LABEL: test_x86_sse2_ucomilt_sd:
13321332 ; AVX512VL: ## BB#0:
1333 ; AVX512VL-NEXT: xorl %eax, %eax
13341333 ; AVX512VL-NEXT: vucomisd %xmm0, %xmm1
13351334 ; AVX512VL-NEXT: seta %al
1335 ; AVX512VL-NEXT: movzbl %al, %eax
13361336 ; AVX512VL-NEXT: retl
13371337 %res = call i32 @llvm.x86.sse2.ucomilt.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
13381338 ret i32 %res
17901790 define i32 @test_x86_sse41_ptestnzc(<2 x i64> %a0, <2 x i64> %a1) {
17911791 ; AVX-LABEL: test_x86_sse41_ptestnzc:
17921792 ; AVX: ## BB#0:
1793 ; AVX-NEXT: xorl %eax, %eax
17941793 ; AVX-NEXT: vptest %xmm1, %xmm0
17951794 ; AVX-NEXT: seta %al
1795 ; AVX-NEXT: movzbl %al, %eax
17961796 ; AVX-NEXT: retl
17971797 ;
17981798 ; AVX512VL-LABEL: test_x86_sse41_ptestnzc:
17991799 ; AVX512VL: ## BB#0:
1800 ; AVX512VL-NEXT: xorl %eax, %eax
18011800 ; AVX512VL-NEXT: vptest %xmm1, %xmm0
18021801 ; AVX512VL-NEXT: seta %al
1802 ; AVX512VL-NEXT: movzbl %al, %eax
18031803 ; AVX512VL-NEXT: retl
18041804 %res = call i32 @llvm.x86.sse41.ptestnzc(<2 x i64> %a0, <2 x i64> %a1) ; [#uses=1]
18051805 ret i32 %res
18101810 define i32 @test_x86_sse41_ptestz(<2 x i64> %a0, <2 x i64> %a1) {
18111811 ; AVX-LABEL: test_x86_sse41_ptestz:
18121812 ; AVX: ## BB#0:
1813 ; AVX-NEXT: xorl %eax, %eax
18141813 ; AVX-NEXT: vptest %xmm1, %xmm0
18151814 ; AVX-NEXT: sete %al
1815 ; AVX-NEXT: movzbl %al, %eax
18161816 ; AVX-NEXT: retl
18171817 ;
18181818 ; AVX512VL-LABEL: test_x86_sse41_ptestz:
18191819 ; AVX512VL: ## BB#0:
1820 ; AVX512VL-NEXT: xorl %eax, %eax
18211820 ; AVX512VL-NEXT: vptest %xmm1, %xmm0
18221821 ; AVX512VL-NEXT: sete %al
1822 ; AVX512VL-NEXT: movzbl %al, %eax
18231823 ; AVX512VL-NEXT: retl
18241824 %res = call i32 @llvm.x86.sse41.ptestz(<2 x i64> %a0, <2 x i64> %a1) ; [#uses=1]
18251825 ret i32 %res
19421942 }
19431943
19441944
1945 define i32 @test_x86_sse42_pcmpestria128(<16 x i8> %a0, <16 x i8> %a2) nounwind {
1945 define i32 @test_x86_sse42_pcmpestria128(<16 x i8> %a0, <16 x i8> %a2) {
19461946 ; AVX-LABEL: test_x86_sse42_pcmpestria128:
19471947 ; AVX: ## BB#0:
1948 ; AVX-NEXT: pushl %ebx
19491948 ; AVX-NEXT: movl $7, %eax
19501949 ; AVX-NEXT: movl $7, %edx
1951 ; AVX-NEXT: xorl %ebx, %ebx
19521950 ; AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
1953 ; AVX-NEXT: seta %bl
1954 ; AVX-NEXT: movl %ebx, %eax
1955 ; AVX-NEXT: popl %ebx
1951 ; AVX-NEXT: seta %al
1952 ; AVX-NEXT: movzbl %al, %eax
19561953 ; AVX-NEXT: retl
19571954 ;
19581955 ; AVX512VL-LABEL: test_x86_sse42_pcmpestria128:
19591956 ; AVX512VL: ## BB#0:
1960 ; AVX512VL-NEXT: pushl %ebx
19611957 ; AVX512VL-NEXT: movl $7, %eax
19621958 ; AVX512VL-NEXT: movl $7, %edx
1963 ; AVX512VL-NEXT: xorl %ebx, %ebx
19641959 ; AVX512VL-NEXT: vpcmpestri $7, %xmm1, %xmm0
1965 ; AVX512VL-NEXT: seta %bl
1966 ; AVX512VL-NEXT: movl %ebx, %eax
1967 ; AVX512VL-NEXT: popl %ebx
1960 ; AVX512VL-NEXT: seta %al
1961 ; AVX512VL-NEXT: movzbl %al, %eax
19681962 ; AVX512VL-NEXT: retl
19691963 %res = call i32 @llvm.x86.sse42.pcmpestria128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; [#uses=1]
19701964 ret i32 %res
19961990 declare i32 @llvm.x86.sse42.pcmpestric128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
19971991
19981992
1999 define i32 @test_x86_sse42_pcmpestrio128(<16 x i8> %a0, <16 x i8> %a2) nounwind {
1993 define i32 @test_x86_sse42_pcmpestrio128(<16 x i8> %a0, <16 x i8> %a2) {
20001994 ; AVX-LABEL: test_x86_sse42_pcmpestrio128:
20011995 ; AVX: ## BB#0:
2002 ; AVX-NEXT: pushl %ebx
20031996 ; AVX-NEXT: movl $7, %eax
20041997 ; AVX-NEXT: movl $7, %edx
2005 ; AVX-NEXT: xorl %ebx, %ebx
20061998 ; AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
2007 ; AVX-NEXT: seto %bl
2008 ; AVX-NEXT: movl %ebx, %eax
2009 ; AVX-NEXT: popl %ebx
1999 ; AVX-NEXT: seto %al
2000 ; AVX-NEXT: movzbl %al, %eax
20102001 ; AVX-NEXT: retl
20112002 ;
20122003 ; AVX512VL-LABEL: test_x86_sse42_pcmpestrio128:
20132004 ; AVX512VL: ## BB#0:
2014 ; AVX512VL-NEXT: pushl %ebx
20152005 ; AVX512VL-NEXT: movl $7, %eax
20162006 ; AVX512VL-NEXT: movl $7, %edx
2017 ; AVX512VL-NEXT: xorl %ebx, %ebx
20182007 ; AVX512VL-NEXT: vpcmpestri $7, %xmm1, %xmm0
2019 ; AVX512VL-NEXT: seto %bl
2020 ; AVX512VL-NEXT: movl %ebx, %eax
2021 ; AVX512VL-NEXT: popl %ebx
2008 ; AVX512VL-NEXT: seto %al
2009 ; AVX512VL-NEXT: movzbl %al, %eax
20222010 ; AVX512VL-NEXT: retl
20232011 %res = call i32 @llvm.x86.sse42.pcmpestrio128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; [#uses=1]
20242012 ret i32 %res
20262014 declare i32 @llvm.x86.sse42.pcmpestrio128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
20272015
20282016
2029 define i32 @test_x86_sse42_pcmpestris128(<16 x i8> %a0, <16 x i8> %a2) nounwind {
2017 define i32 @test_x86_sse42_pcmpestris128(<16 x i8> %a0, <16 x i8> %a2) {
20302018 ; AVX-LABEL: test_x86_sse42_pcmpestris128:
20312019 ; AVX: ## BB#0:
2032 ; AVX-NEXT: pushl %ebx
20332020 ; AVX-NEXT: movl $7, %eax
20342021 ; AVX-NEXT: movl $7, %edx
2035 ; AVX-NEXT: xorl %ebx, %ebx
20362022 ; AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
2037 ; AVX-NEXT: sets %bl
2038 ; AVX-NEXT: movl %ebx, %eax
2039 ; AVX-NEXT: popl %ebx
2023 ; AVX-NEXT: sets %al
2024 ; AVX-NEXT: movzbl %al, %eax
20402025 ; AVX-NEXT: retl
20412026 ;
20422027 ; AVX512VL-LABEL: test_x86_sse42_pcmpestris128:
20432028 ; AVX512VL: ## BB#0:
2044 ; AVX512VL-NEXT: pushl %ebx
20452029 ; AVX512VL-NEXT: movl $7, %eax
20462030 ; AVX512VL-NEXT: movl $7, %edx
2047 ; AVX512VL-NEXT: xorl %ebx, %ebx
20482031 ; AVX512VL-NEXT: vpcmpestri $7, %xmm1, %xmm0
2049 ; AVX512VL-NEXT: sets %bl
2050 ; AVX512VL-NEXT: movl %ebx, %eax
2051 ; AVX512VL-NEXT: popl %ebx
2032 ; AVX512VL-NEXT: sets %al
2033 ; AVX512VL-NEXT: movzbl %al, %eax
20522034 ; AVX512VL-NEXT: retl
20532035 %res = call i32 @llvm.x86.sse42.pcmpestris128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; [#uses=1]
20542036 ret i32 %res
20562038 declare i32 @llvm.x86.sse42.pcmpestris128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
20572039
20582040
2059 define i32 @test_x86_sse42_pcmpestriz128(<16 x i8> %a0, <16 x i8> %a2) nounwind {
2041 define i32 @test_x86_sse42_pcmpestriz128(<16 x i8> %a0, <16 x i8> %a2) {
20602042 ; AVX-LABEL: test_x86_sse42_pcmpestriz128:
20612043 ; AVX: ## BB#0:
2062 ; AVX-NEXT: pushl %ebx
20632044 ; AVX-NEXT: movl $7, %eax
20642045 ; AVX-NEXT: movl $7, %edx
2065 ; AVX-NEXT: xorl %ebx, %ebx
20662046 ; AVX-NEXT: vpcmpestri $7, %xmm1, %xmm0
2067 ; AVX-NEXT: sete %bl
2068 ; AVX-NEXT: movl %ebx, %eax
2069 ; AVX-NEXT: popl %ebx
2047 ; AVX-NEXT: sete %al
2048 ; AVX-NEXT: movzbl %al, %eax
20702049 ; AVX-NEXT: retl
20712050 ;
20722051 ; AVX512VL-LABEL: test_x86_sse42_pcmpestriz128:
20732052 ; AVX512VL: ## BB#0:
2074 ; AVX512VL-NEXT: pushl %ebx
20752053 ; AVX512VL-NEXT: movl $7, %eax
20762054 ; AVX512VL-NEXT: movl $7, %edx
2077 ; AVX512VL-NEXT: xorl %ebx, %ebx
20782055 ; AVX512VL-NEXT: vpcmpestri $7, %xmm1, %xmm0
2079 ; AVX512VL-NEXT: sete %bl
2080 ; AVX512VL-NEXT: movl %ebx, %eax
2081 ; AVX512VL-NEXT: popl %ebx
2056 ; AVX512VL-NEXT: sete %al
2057 ; AVX512VL-NEXT: movzbl %al, %eax
20822058 ; AVX512VL-NEXT: retl
20832059 %res = call i32 @llvm.x86.sse42.pcmpestriz128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; [#uses=1]
20842060 ret i32 %res
21742150 define i32 @test_x86_sse42_pcmpistria128(<16 x i8> %a0, <16 x i8> %a1) {
21752151 ; AVX-LABEL: test_x86_sse42_pcmpistria128:
21762152 ; AVX: ## BB#0:
2177 ; AVX-NEXT: xorl %eax, %eax
21782153 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
21792154 ; AVX-NEXT: seta %al
2155 ; AVX-NEXT: movzbl %al, %eax
21802156 ; AVX-NEXT: retl
21812157 ;
21822158 ; AVX512VL-LABEL: test_x86_sse42_pcmpistria128:
21832159 ; AVX512VL: ## BB#0:
2184 ; AVX512VL-NEXT: xorl %eax, %eax
21852160 ; AVX512VL-NEXT: vpcmpistri $7, %xmm1, %xmm0
21862161 ; AVX512VL-NEXT: seta %al
2162 ; AVX512VL-NEXT: movzbl %al, %eax
21872163 ; AVX512VL-NEXT: retl
21882164 %res = call i32 @llvm.x86.sse42.pcmpistria128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; [#uses=1]
21892165 ret i32 %res
22142190 define i32 @test_x86_sse42_pcmpistrio128(<16 x i8> %a0, <16 x i8> %a1) {
22152191 ; AVX-LABEL: test_x86_sse42_pcmpistrio128:
22162192 ; AVX: ## BB#0:
2217 ; AVX-NEXT: xorl %eax, %eax
22182193 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
22192194 ; AVX-NEXT: seto %al
2195 ; AVX-NEXT: movzbl %al, %eax
22202196 ; AVX-NEXT: retl
22212197 ;
22222198 ; AVX512VL-LABEL: test_x86_sse42_pcmpistrio128:
22232199 ; AVX512VL: ## BB#0:
2224 ; AVX512VL-NEXT: xorl %eax, %eax
22252200 ; AVX512VL-NEXT: vpcmpistri $7, %xmm1, %xmm0
22262201 ; AVX512VL-NEXT: seto %al
2202 ; AVX512VL-NEXT: movzbl %al, %eax
22272203 ; AVX512VL-NEXT: retl
22282204 %res = call i32 @llvm.x86.sse42.pcmpistrio128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; [#uses=1]
22292205 ret i32 %res
22342210 define i32 @test_x86_sse42_pcmpistris128(<16 x i8> %a0, <16 x i8> %a1) {
22352211 ; AVX-LABEL: test_x86_sse42_pcmpistris128:
22362212 ; AVX: ## BB#0:
2237 ; AVX-NEXT: xorl %eax, %eax
22382213 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
22392214 ; AVX-NEXT: sets %al
2215 ; AVX-NEXT: movzbl %al, %eax
22402216 ; AVX-NEXT: retl
22412217 ;
22422218 ; AVX512VL-LABEL: test_x86_sse42_pcmpistris128:
22432219 ; AVX512VL: ## BB#0:
2244 ; AVX512VL-NEXT: xorl %eax, %eax
22452220 ; AVX512VL-NEXT: vpcmpistri $7, %xmm1, %xmm0
22462221 ; AVX512VL-NEXT: sets %al
2222 ; AVX512VL-NEXT: movzbl %al, %eax
22472223 ; AVX512VL-NEXT: retl
22482224 %res = call i32 @llvm.x86.sse42.pcmpistris128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; [#uses=1]
22492225 ret i32 %res
22542230 define i32 @test_x86_sse42_pcmpistriz128(<16 x i8> %a0, <16 x i8> %a1) {
22552231 ; AVX-LABEL: test_x86_sse42_pcmpistriz128:
22562232 ; AVX: ## BB#0:
2257 ; AVX-NEXT: xorl %eax, %eax
22582233 ; AVX-NEXT: vpcmpistri $7, %xmm1, %xmm0
22592234 ; AVX-NEXT: sete %al
2235 ; AVX-NEXT: movzbl %al, %eax
22602236 ; AVX-NEXT: retl
22612237 ;
22622238 ; AVX512VL-LABEL: test_x86_sse42_pcmpistriz128:
22632239 ; AVX512VL: ## BB#0:
2264 ; AVX512VL-NEXT: xorl %eax, %eax
22652240 ; AVX512VL-NEXT: vpcmpistri $7, %xmm1, %xmm0
22662241 ; AVX512VL-NEXT: sete %al
2242 ; AVX512VL-NEXT: movzbl %al, %eax
22672243 ; AVX512VL-NEXT: retl
22682244 %res = call i32 @llvm.x86.sse42.pcmpistriz128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; [#uses=1]
22692245 ret i32 %res
23802356 define i32 @test_x86_sse_comige_ss(<4 x float> %a0, <4 x float> %a1) {
23812357 ; AVX-LABEL: test_x86_sse_comige_ss:
23822358 ; AVX: ## BB#0:
2383 ; AVX-NEXT: xorl %eax, %eax
23842359 ; AVX-NEXT: vcomiss %xmm1, %xmm0
23852360 ; AVX-NEXT: setae %al
2361 ; AVX-NEXT: movzbl %al, %eax
23862362 ; AVX-NEXT: retl
23872363 ;
23882364 ; AVX512VL-LABEL: test_x86_sse_comige_ss:
23892365 ; AVX512VL: ## BB#0:
2390 ; AVX512VL-NEXT: xorl %eax, %eax
23912366 ; AVX512VL-NEXT: vcomiss %xmm1, %xmm0
23922367 ; AVX512VL-NEXT: setae %al
2368 ; AVX512VL-NEXT: movzbl %al, %eax
23932369 ; AVX512VL-NEXT: retl
23942370 %res = call i32 @llvm.x86.sse.comige.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
23952371 ret i32 %res
24002376 define i32 @test_x86_sse_comigt_ss(<4 x float> %a0, <4 x float> %a1) {
24012377 ; AVX-LABEL: test_x86_sse_comigt_ss:
24022378 ; AVX: ## BB#0:
2403 ; AVX-NEXT: xorl %eax, %eax
24042379 ; AVX-NEXT: vcomiss %xmm1, %xmm0
24052380 ; AVX-NEXT: seta %al
2381 ; AVX-NEXT: movzbl %al, %eax
24062382 ; AVX-NEXT: retl
24072383 ;
24082384 ; AVX512VL-LABEL: test_x86_sse_comigt_ss:
24092385 ; AVX512VL: ## BB#0:
2410 ; AVX512VL-NEXT: xorl %eax, %eax
24112386 ; AVX512VL-NEXT: vcomiss %xmm1, %xmm0
24122387 ; AVX512VL-NEXT: seta %al
2388 ; AVX512VL-NEXT: movzbl %al, %eax
24132389 ; AVX512VL-NEXT: retl
24142390 %res = call i32 @llvm.x86.sse.comigt.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
24152391 ret i32 %res
24202396 define i32 @test_x86_sse_comile_ss(<4 x float> %a0, <4 x float> %a1) {
24212397 ; AVX-LABEL: test_x86_sse_comile_ss:
24222398 ; AVX: ## BB#0:
2423 ; AVX-NEXT: xorl %eax, %eax
24242399 ; AVX-NEXT: vcomiss %xmm0, %xmm1
24252400 ; AVX-NEXT: setae %al
2401 ; AVX-NEXT: movzbl %al, %eax
24262402 ; AVX-NEXT: retl
24272403 ;
24282404 ; AVX512VL-LABEL: test_x86_sse_comile_ss:
24292405 ; AVX512VL: ## BB#0:
2430 ; AVX512VL-NEXT: xorl %eax, %eax
24312406 ; AVX512VL-NEXT: vcomiss %xmm0, %xmm1
24322407 ; AVX512VL-NEXT: setae %al
2408 ; AVX512VL-NEXT: movzbl %al, %eax
24332409 ; AVX512VL-NEXT: retl
24342410 %res = call i32 @llvm.x86.sse.comile.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
24352411 ret i32 %res
24402416 define i32 @test_x86_sse_comilt_ss(<4 x float> %a0, <4 x float> %a1) {
24412417 ; AVX-LABEL: test_x86_sse_comilt_ss:
24422418 ; AVX: ## BB#0:
2443 ; AVX-NEXT: xorl %eax, %eax
24442419 ; AVX-NEXT: vcomiss %xmm0, %xmm1
24452420 ; AVX-NEXT: seta %al
2421 ; AVX-NEXT: movzbl %al, %eax
24462422 ; AVX-NEXT: retl
24472423 ;
24482424 ; AVX512VL-LABEL: test_x86_sse_comilt_ss:
24492425 ; AVX512VL: ## BB#0:
2450 ; AVX512VL-NEXT: xorl %eax, %eax
24512426 ; AVX512VL-NEXT: vcomiss %xmm0, %xmm1
24522427 ; AVX512VL-NEXT: seta %al
2428 ; AVX512VL-NEXT: movzbl %al, %eax
24532429 ; AVX512VL-NEXT: retl
24542430 %res = call i32 @llvm.x86.sse.comilt.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
24552431 ret i32 %res
28202796 define i32 @test_x86_sse_ucomige_ss(<4 x float> %a0, <4 x float> %a1) {
28212797 ; AVX-LABEL: test_x86_sse_ucomige_ss:
28222798 ; AVX: ## BB#0:
2823 ; AVX-NEXT: xorl %eax, %eax
28242799 ; AVX-NEXT: vucomiss %xmm1, %xmm0
28252800 ; AVX-NEXT: setae %al
2801 ; AVX-NEXT: movzbl %al, %eax
28262802 ; AVX-NEXT: retl
28272803 ;
28282804 ; AVX512VL-LABEL: test_x86_sse_ucomige_ss:
28292805 ; AVX512VL: ## BB#0:
2830 ; AVX512VL-NEXT: xorl %eax, %eax
28312806 ; AVX512VL-NEXT: vucomiss %xmm1, %xmm0
28322807 ; AVX512VL-NEXT: setae %al
2808 ; AVX512VL-NEXT: movzbl %al, %eax
28332809 ; AVX512VL-NEXT: retl
28342810 %res = call i32 @llvm.x86.sse.ucomige.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
28352811 ret i32 %res
28402816 define i32 @test_x86_sse_ucomigt_ss(<4 x float> %a0, <4 x float> %a1) {
28412817 ; AVX-LABEL: test_x86_sse_ucomigt_ss:
28422818 ; AVX: ## BB#0:
2843 ; AVX-NEXT: xorl %eax, %eax
28442819 ; AVX-NEXT: vucomiss %xmm1, %xmm0
28452820 ; AVX-NEXT: seta %al
2821 ; AVX-NEXT: movzbl %al, %eax
28462822 ; AVX-NEXT: retl
28472823 ;
28482824 ; AVX512VL-LABEL: test_x86_sse_ucomigt_ss:
28492825 ; AVX512VL: ## BB#0:
2850 ; AVX512VL-NEXT: xorl %eax, %eax
28512826 ; AVX512VL-NEXT: vucomiss %xmm1, %xmm0
28522827 ; AVX512VL-NEXT: seta %al
2828 ; AVX512VL-NEXT: movzbl %al, %eax
28532829 ; AVX512VL-NEXT: retl
28542830 %res = call i32 @llvm.x86.sse.ucomigt.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
28552831 ret i32 %res
28602836 define i32 @test_x86_sse_ucomile_ss(<4 x float> %a0, <4 x float> %a1) {
28612837 ; AVX-LABEL: test_x86_sse_ucomile_ss:
28622838 ; AVX: ## BB#0:
2863 ; AVX-NEXT: xorl %eax, %eax
28642839 ; AVX-NEXT: vucomiss %xmm0, %xmm1
28652840 ; AVX-NEXT: setae %al
2841 ; AVX-NEXT: movzbl %al, %eax
28662842 ; AVX-NEXT: retl
28672843 ;
28682844 ; AVX512VL-LABEL: test_x86_sse_ucomile_ss:
28692845 ; AVX512VL: ## BB#0:
2870 ; AVX512VL-NEXT: xorl %eax, %eax
28712846 ; AVX512VL-NEXT: vucomiss %xmm0, %xmm1
28722847 ; AVX512VL-NEXT: setae %al
2848 ; AVX512VL-NEXT: movzbl %al, %eax
28732849 ; AVX512VL-NEXT: retl
28742850 %res = call i32 @llvm.x86.sse.ucomile.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
28752851 ret i32 %res
28802856 define i32 @test_x86_sse_ucomilt_ss(<4 x float> %a0, <4 x float> %a1) {
28812857 ; AVX-LABEL: test_x86_sse_ucomilt_ss:
28822858 ; AVX: ## BB#0:
2883 ; AVX-NEXT: xorl %eax, %eax
28842859 ; AVX-NEXT: vucomiss %xmm0, %xmm1
28852860 ; AVX-NEXT: seta %al
2861 ; AVX-NEXT: movzbl %al, %eax
28862862 ; AVX-NEXT: retl
28872863 ;
28882864 ; AVX512VL-LABEL: test_x86_sse_ucomilt_ss:
28892865 ; AVX512VL: ## BB#0:
2890 ; AVX512VL-NEXT: xorl %eax, %eax
28912866 ; AVX512VL-NEXT: vucomiss %xmm0, %xmm1
28922867 ; AVX512VL-NEXT: seta %al
2868 ; AVX512VL-NEXT: movzbl %al, %eax
28932869 ; AVX512VL-NEXT: retl
28942870 %res = call i32 @llvm.x86.sse.ucomilt.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
28952871 ret i32 %res
38013777 define i32 @test_x86_avx_ptestnzc_256(<4 x i64> %a0, <4 x i64> %a1) {
38023778 ; AVX-LABEL: test_x86_avx_ptestnzc_256:
38033779 ; AVX: ## BB#0:
3804 ; AVX-NEXT: xorl %eax, %eax
38053780 ; AVX-NEXT: vptest %ymm1, %ymm0
38063781 ; AVX-NEXT: seta %al
3782 ; AVX-NEXT: movzbl %al, %eax
38073783 ; AVX-NEXT: vzeroupper
38083784 ; AVX-NEXT: retl
38093785 ;
38103786 ; AVX512VL-LABEL: test_x86_avx_ptestnzc_256:
38113787 ; AVX512VL: ## BB#0:
3812 ; AVX512VL-NEXT: xorl %eax, %eax
38133788 ; AVX512VL-NEXT: vptest %ymm1, %ymm0
38143789 ; AVX512VL-NEXT: seta %al
3790 ; AVX512VL-NEXT: movzbl %al, %eax
38153791 ; AVX512VL-NEXT: retl
38163792 %res = call i32 @llvm.x86.avx.ptestnzc.256(<4 x i64> %a0, <4 x i64> %a1) ; [#uses=1]
38173793 ret i32 %res
38223798 define i32 @test_x86_avx_ptestz_256(<4 x i64> %a0, <4 x i64> %a1) {
38233799 ; AVX-LABEL: test_x86_avx_ptestz_256:
38243800 ; AVX: ## BB#0:
3825 ; AVX-NEXT: xorl %eax, %eax
38263801 ; AVX-NEXT: vptest %ymm1, %ymm0
38273802 ; AVX-NEXT: sete %al
3803 ; AVX-NEXT: movzbl %al, %eax
38283804 ; AVX-NEXT: vzeroupper
38293805 ; AVX-NEXT: retl
38303806 ;
38313807 ; AVX512VL-LABEL: test_x86_avx_ptestz_256:
38323808 ; AVX512VL: ## BB#0:
3833 ; AVX512VL-NEXT: xorl %eax, %eax
38343809 ; AVX512VL-NEXT: vptest %ymm1, %ymm0
38353810 ; AVX512VL-NEXT: sete %al
3811 ; AVX512VL-NEXT: movzbl %al, %eax
38363812 ; AVX512VL-NEXT: retl
38373813 %res = call i32 @llvm.x86.avx.ptestz.256(<4 x i64> %a0, <4 x i64> %a1) ; [#uses=1]
38383814 ret i32 %res
41984174 define i32 @test_x86_avx_vtestnzc_pd(<2 x double> %a0, <2 x double> %a1) {
41994175 ; AVX-LABEL: test_x86_avx_vtestnzc_pd:
42004176 ; AVX: ## BB#0:
4201 ; AVX-NEXT: xorl %eax, %eax
42024177 ; AVX-NEXT: vtestpd %xmm1, %xmm0
42034178 ; AVX-NEXT: seta %al
4179 ; AVX-NEXT: movzbl %al, %eax
42044180 ; AVX-NEXT: retl
42054181 ;
42064182 ; AVX512VL-LABEL: test_x86_avx_vtestnzc_pd:
42074183 ; AVX512VL: ## BB#0:
4208 ; AVX512VL-NEXT: xorl %eax, %eax
42094184 ; AVX512VL-NEXT: vtestpd %xmm1, %xmm0
42104185 ; AVX512VL-NEXT: seta %al
4186 ; AVX512VL-NEXT: movzbl %al, %eax
42114187 ; AVX512VL-NEXT: retl
42124188 %res = call i32 @llvm.x86.avx.vtestnzc.pd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
42134189 ret i32 %res
42184194 define i32 @test_x86_avx_vtestnzc_pd_256(<4 x double> %a0, <4 x double> %a1) {
42194195 ; AVX-LABEL: test_x86_avx_vtestnzc_pd_256:
42204196 ; AVX: ## BB#0:
4221 ; AVX-NEXT: xorl %eax, %eax
42224197 ; AVX-NEXT: vtestpd %ymm1, %ymm0
42234198 ; AVX-NEXT: seta %al
4199 ; AVX-NEXT: movzbl %al, %eax
42244200 ; AVX-NEXT: vzeroupper
42254201 ; AVX-NEXT: retl
42264202 ;
42274203 ; AVX512VL-LABEL: test_x86_avx_vtestnzc_pd_256:
42284204 ; AVX512VL: ## BB#0:
4229 ; AVX512VL-NEXT: xorl %eax, %eax
42304205 ; AVX512VL-NEXT: vtestpd %ymm1, %ymm0
42314206 ; AVX512VL-NEXT: seta %al
4207 ; AVX512VL-NEXT: movzbl %al, %eax
42324208 ; AVX512VL-NEXT: retl
42334209 %res = call i32 @llvm.x86.avx.vtestnzc.pd.256(<4 x double> %a0, <4 x double> %a1) ; [#uses=1]
42344210 ret i32 %res
42394215 define i32 @test_x86_avx_vtestnzc_ps(<4 x float> %a0, <4 x float> %a1) {
42404216 ; AVX-LABEL: test_x86_avx_vtestnzc_ps:
42414217 ; AVX: ## BB#0:
4242 ; AVX-NEXT: xorl %eax, %eax
42434218 ; AVX-NEXT: vtestps %xmm1, %xmm0
42444219 ; AVX-NEXT: seta %al
4220 ; AVX-NEXT: movzbl %al, %eax
42454221 ; AVX-NEXT: retl
42464222 ;
42474223 ; AVX512VL-LABEL: test_x86_avx_vtestnzc_ps:
42484224 ; AVX512VL: ## BB#0:
4249 ; AVX512VL-NEXT: xorl %eax, %eax
42504225 ; AVX512VL-NEXT: vtestps %xmm1, %xmm0
42514226 ; AVX512VL-NEXT: seta %al
4227 ; AVX512VL-NEXT: movzbl %al, %eax
42524228 ; AVX512VL-NEXT: retl
42534229 %res = call i32 @llvm.x86.avx.vtestnzc.ps(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
42544230 ret i32 %res
42594235 define i32 @test_x86_avx_vtestnzc_ps_256(<8 x float> %a0, <8 x float> %a1) {
42604236 ; AVX-LABEL: test_x86_avx_vtestnzc_ps_256:
42614237 ; AVX: ## BB#0:
4262 ; AVX-NEXT: xorl %eax, %eax
42634238 ; AVX-NEXT: vtestps %ymm1, %ymm0
42644239 ; AVX-NEXT: seta %al
4240 ; AVX-NEXT: movzbl %al, %eax
42654241 ; AVX-NEXT: vzeroupper
42664242 ; AVX-NEXT: retl
42674243 ;
42684244 ; AVX512VL-LABEL: test_x86_avx_vtestnzc_ps_256:
42694245 ; AVX512VL: ## BB#0:
4270 ; AVX512VL-NEXT: xorl %eax, %eax
42714246 ; AVX512VL-NEXT: vtestps %ymm1, %ymm0
42724247 ; AVX512VL-NEXT: seta %al
4248 ; AVX512VL-NEXT: movzbl %al, %eax
42734249 ; AVX512VL-NEXT: retl
42744250 %res = call i32 @llvm.x86.avx.vtestnzc.ps.256(<8 x float> %a0, <8 x float> %a1) ; [#uses=1]
42754251 ret i32 %res
42804256 define i32 @test_x86_avx_vtestz_pd(<2 x double> %a0, <2 x double> %a1) {
42814257 ; AVX-LABEL: test_x86_avx_vtestz_pd:
42824258 ; AVX: ## BB#0:
4283 ; AVX-NEXT: xorl %eax, %eax
42844259 ; AVX-NEXT: vtestpd %xmm1, %xmm0
42854260 ; AVX-NEXT: sete %al
4261 ; AVX-NEXT: movzbl %al, %eax
42864262 ; AVX-NEXT: retl
42874263 ;
42884264 ; AVX512VL-LABEL: test_x86_avx_vtestz_pd:
42894265 ; AVX512VL: ## BB#0:
4290 ; AVX512VL-NEXT: xorl %eax, %eax
42914266 ; AVX512VL-NEXT: vtestpd %xmm1, %xmm0
42924267 ; AVX512VL-NEXT: sete %al
4268 ; AVX512VL-NEXT: movzbl %al, %eax
42934269 ; AVX512VL-NEXT: retl
42944270 %res = call i32 @llvm.x86.avx.vtestz.pd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
42954271 ret i32 %res
43004276 define i32 @test_x86_avx_vtestz_pd_256(<4 x double> %a0, <4 x double> %a1) {
43014277 ; AVX-LABEL: test_x86_avx_vtestz_pd_256:
43024278 ; AVX: ## BB#0:
4303 ; AVX-NEXT: xorl %eax, %eax
43044279 ; AVX-NEXT: vtestpd %ymm1, %ymm0
43054280 ; AVX-NEXT: sete %al
4281 ; AVX-NEXT: movzbl %al, %eax
43064282 ; AVX-NEXT: vzeroupper
43074283 ; AVX-NEXT: retl
43084284 ;
43094285 ; AVX512VL-LABEL: test_x86_avx_vtestz_pd_256:
43104286 ; AVX512VL: ## BB#0:
4311 ; AVX512VL-NEXT: xorl %eax, %eax
43124287 ; AVX512VL-NEXT: vtestpd %ymm1, %ymm0
43134288 ; AVX512VL-NEXT: sete %al
4289 ; AVX512VL-NEXT: movzbl %al, %eax
43144290 ; AVX512VL-NEXT: retl
43154291 %res = call i32 @llvm.x86.avx.vtestz.pd.256(<4 x double> %a0, <4 x double> %a1) ; [#uses=1]
43164292 ret i32 %res
43214297 define i32 @test_x86_avx_vtestz_ps(<4 x float> %a0, <4 x float> %a1) {
43224298 ; AVX-LABEL: test_x86_avx_vtestz_ps:
43234299 ; AVX: ## BB#0:
4324 ; AVX-NEXT: xorl %eax, %eax
43254300 ; AVX-NEXT: vtestps %xmm1, %xmm0
43264301 ; AVX-NEXT: sete %al
4302 ; AVX-NEXT: movzbl %al, %eax
43274303 ; AVX-NEXT: retl
43284304 ;
43294305 ; AVX512VL-LABEL: test_x86_avx_vtestz_ps:
43304306 ; AVX512VL: ## BB#0:
4331 ; AVX512VL-NEXT: xorl %eax, %eax
43324307 ; AVX512VL-NEXT: vtestps %xmm1, %xmm0
43334308 ; AVX512VL-NEXT: sete %al
4309 ; AVX512VL-NEXT: movzbl %al, %eax
43344310 ; AVX512VL-NEXT: retl
43354311 %res = call i32 @llvm.x86.avx.vtestz.ps(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
43364312 ret i32 %res
43414317 define i32 @test_x86_avx_vtestz_ps_256(<8 x float> %a0, <8 x float> %a1) {
43424318 ; AVX-LABEL: test_x86_avx_vtestz_ps_256:
43434319 ; AVX: ## BB#0:
4344 ; AVX-NEXT: xorl %eax, %eax
43454320 ; AVX-NEXT: vtestps %ymm1, %ymm0
43464321 ; AVX-NEXT: sete %al
4322 ; AVX-NEXT: movzbl %al, %eax
43474323 ; AVX-NEXT: vzeroupper
43484324 ; AVX-NEXT: retl
43494325 ;
43504326 ; AVX512VL-LABEL: test_x86_avx_vtestz_ps_256:
43514327 ; AVX512VL: ## BB#0:
4352 ; AVX512VL-NEXT: xorl %eax, %eax
43534328 ; AVX512VL-NEXT: vtestps %ymm1, %ymm0
43544329 ; AVX512VL-NEXT: sete %al
4330 ; AVX512VL-NEXT: movzbl %al, %eax
43554331 ; AVX512VL-NEXT: retl
43564332 %res = call i32 @llvm.x86.avx.vtestz.ps.256(<8 x float> %a0, <8 x float> %a1) ; [#uses=1]
43574333 ret i32 %res
9393 define i32 @test6(i32 %a, i32 %b) {
9494 ; ALL-LABEL: test6:
9595 ; ALL: ## BB#0:
96 ; ALL-NEXT: xorl %eax, %eax
9796 ; ALL-NEXT: cmpl %esi, %edi
9897 ; ALL-NEXT: sete %al
98 ; ALL-NEXT: movzbl %al, %eax
9999 ; ALL-NEXT: retq
100100 %cmp = icmp eq i32 %a, %b
101101 %res = zext i1 %cmp to i32
105105 define i32 @test7(double %x, double %y) #2 {
106106 ; ALL-LABEL: test7:
107107 ; ALL: ## BB#0: ## %entry
108 ; ALL-NEXT: xorl %eax, %eax
109108 ; ALL-NEXT: vucomisd %xmm1, %xmm0
110109 ; ALL-NEXT: setne %al
110 ; ALL-NEXT: movzbl %al, %eax
111111 ; ALL-NEXT: retq
112112 entry:
113113 %0 = fcmp one double %x, %y
66 ; CHECK: ## BB#0:
77 ; CHECK-NEXT: kmovw %esi, %k0
88 ; CHECK-NEXT: kmovw %edi, %k1
9 ; CHECK-NEXT: xorl %eax, %eax
109 ; CHECK-NEXT: kortestw %k0, %k1
1110 ; CHECK-NEXT: sete %al
11 ; CHECK-NEXT: movzbl %al, %eax
1212 ; CHECK-NEXT: retq
1313 %res = call i32 @llvm.x86.avx512.kortestz.w(i16 %a0, i16 %a1)
1414 ret i32 %res
570570 ; KNL-NEXT: vpbroadcastd %eax, %zmm1 {%k1} {z}
571571 ; KNL-NEXT: vpmovdb %zmm1, %xmm1
572572 ; KNL-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm1
573 ; KNL-NEXT: xorl %ecx, %ecx
574573 ; KNL-NEXT: cmpl %edx, %esi
575574 ; KNL-NEXT: setg %cl
575 ; KNL-NEXT: movzbl %cl, %ecx
576576 ; KNL-NEXT: vpinsrb $5, %ecx, %xmm0, %xmm0
577577 ; KNL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
578578 ; KNL-NEXT: vpsllw $7, %ymm0, %ymm0
200200 ; CHECK-NEXT: btl %esi, %edi
201201 ; CHECK-NEXT: setae %al
202202 ; CHECK-NEXT: retq
203 ;
203204 %shl = shl i32 1, %y
204205 %and = and i32 %x, %shl
205206 %cmp = icmp ne i32 %and, %shl
211212 ; CHECK-LABEL: and_cmp_not_one_use:
212213 ; CHECK: # BB#0:
213214 ; CHECK-NEXT: andl $37, %edi
214 ; CHECK-NEXT: xorl %eax, %eax
215215 ; CHECK-NEXT: cmpl $37, %edi
216216 ; CHECK-NEXT: sete %al
217 ; CHECK-NEXT: movzbl %al, %eax
217218 ; CHECK-NEXT: addl %edi, %eax
218219 ; CHECK-NEXT: retq
220 ;
219221 %and = and i32 %x, 37
220222 %cmp = icmp eq i32 %and, 37
221223 %ext = zext i1 %cmp to i32
119119 define i32 @test5(i32* nocapture %P) nounwind readonly {
120120 entry:
121121 ; CHECK-LABEL: test5:
122 ; CHECK: xorl %eax, %eax
123122 ; CHECK: setg %al
123 ; CHECK: movzbl %al, %eax
124124 ; CHECK: orl $-2, %eax
125125 ; CHECK: ret
126126
133133 define i32 @test6(i32* nocapture %P) nounwind readonly {
134134 entry:
135135 ; CHECK-LABEL: test6:
136 ; CHECK: xorl %eax, %eax
137136 ; CHECK: setl %al
137 ; CHECK: movzbl %al, %eax
138138 ; CHECK: leal 4(%rax,%rax,8), %eax
139139 ; CHECK: ret
140140 %0 = load i32, i32* %P, align 4 ; [#uses=1]
4848 %r = zext i1 %t to i64
4949 ret i64 %r
5050 ; CHECK-LABEL: test3:
51 ; CHECK: xorl %eax, %eax
5251 ; CHECK: testq %rdi, %rdi
5352 ; CHECK: sete %al
53 ; CHECK: movzbl %al, %eax
5454 ; CHECK: ret
5555 }
5656
5959 %r = zext i1 %t to i64
6060 ret i64 %r
6161 ; CHECK-LABEL: test4:
62 ; CHECK: xorl %eax, %eax
6362 ; CHECK: testq %rdi, %rdi
6463 ; CHECK: setle %al
64 ; CHECK: movzbl %al, %eax
6565 ; CHECK: ret
6666 }
6767
3333 ; CHECK-LABEL: cmpxchg_sext:
3434 ; CHECK-DAG: cmpxchgl
3535 ; CHECK-NOT: cmpl
36 ; CHECK: sete %cl
36 ; CHECK: sete %al
3737 ; CHECK: retq
3838 %pair = cmpxchg i32* %addr, i32 %desired, i32 %new seq_cst seq_cst
3939 %success = extractvalue { i32, i1 } %pair, 1
4343
4444 define i32 @cmpxchg_zext(i32* %addr, i32 %desired, i32 %new) {
4545 ; CHECK-LABEL: cmpxchg_zext:
46 ; CHECK: xorl %e[[R:[a-z]]]x
4746 ; CHECK: cmpxchgl
4847 ; CHECK-NOT: cmp
49 ; CHECK: sete %[[R]]l
48 ; CHECK: sete [[BYTE:%[a-z0-9]+]]
49 ; CHECK: movzbl [[BYTE]], %eax
5050 %pair = cmpxchg i32* %addr, i32 %desired, i32 %new seq_cst seq_cst
5151 %success = extractvalue { i32, i1 } %pair, 1
5252 %mask = zext i1 %success to i32
4343
4444 define i128 @cmpxchg_zext(i128* %addr, i128 %desired, i128 %new) {
4545 ; CHECK-LABEL: cmpxchg_zext:
46 ; CHECK: xorl
4746 ; CHECK: cmpxchg16b
4847 ; CHECK-NOT: cmpq
49 ; CHECK: sete
48 ; CHECK: sete [[BYTE:%[a-z0-9]+]]
49 ; CHECK: movzbl [[BYTE]], %eax
5050 %pair = cmpxchg i128* %addr, i128 %desired, i128 %new seq_cst seq_cst
5151 %success = extractvalue { i128, i1 } %pair, 1
5252 %mask = zext i1 %success to i128
55 define i32 @test1(i64 %x) nounwind readnone {
66 ; CHECK-LABEL: test1:
77 ; CHECK: # BB#0:
8 ; CHECK-NEXT: leaq -1(%rdi), %rcx
9 ; CHECK-NEXT: xorl %eax, %eax
10 ; CHECK-NEXT: testq %rcx, %rdi
8 ; CHECK-NEXT: leaq -1(%rdi), %rax
9 ; CHECK-NEXT: testq %rax, %rdi
1110 ; CHECK-NEXT: setne %al
11 ; CHECK-NEXT: movzbl %al, %eax
1212 ; CHECK-NEXT: retq
1313 %count = tail call i64 @llvm.ctpop.i64(i64 %x)
1414 %cast = trunc i64 %count to i32
2121 define i32 @test2(i64 %x) nounwind readnone {
2222 ; CHECK-LABEL: test2:
2323 ; CHECK: # BB#0:
24 ; CHECK-NEXT: leaq -1(%rdi), %rcx
25 ; CHECK-NEXT: xorl %eax, %eax
26 ; CHECK-NEXT: testq %rcx, %rdi
24 ; CHECK-NEXT: leaq -1(%rdi), %rax
25 ; CHECK-NEXT: testq %rax, %rdi
2726 ; CHECK-NEXT: sete %al
27 ; CHECK-NEXT: movzbl %al, %eax
2828 ; CHECK-NEXT: retq
2929 %count = tail call i64 @llvm.ctpop.i64(i64 %x)
3030 %cmp = icmp ult i64 %count, 2
237237 ; X64-LABEL: TestConst128:
238238 ; X64: movaps {{.*}}, %xmm1
239239 ; X64-NEXT: callq __gttf2
240 ; X64-NEXT: xorl
241240 ; X64-NEXT: test
242241 ; X64: retq
243242 }
277276 ; X64-NEXT: movq (%rsp),
278277 ; X64-NEXT: movq %
279278 ; X64-NEXT: shrq $32,
280 ; X64: xorl %eax, %eax
281 ; X64-NEXT: orl
279 ; X64: orl
282280 ; X64-NEXT: sete %al
281 ; X64-NEXT: movzbl %al, %eax
283282 ; X64: retq
284283 ;
285284 ; If TestBits128 fails due to any llvm or clang change,
77 ret i32 %conv
88 ; CHECK-LABEL: TestComp128GT:
99 ; CHECK: callq __gttf2
10 ; CHECK: xorl %ecx, %ecx
11 ; CHECK: setg %cl
12 ; CHECK: movl %ecx, %eax
10 ; CHECK: setg %al
11 ; CHECK: movzbl %al, %eax
1312 ; CHECK: retq
1413 }
1514
2019 ret i32 %conv
2120 ; CHECK-LABEL: TestComp128GE:
2221 ; CHECK: callq __getf2
23 ; CHECK: xorl %ecx, %ecx
2422 ; CHECK: testl %eax, %eax
25 ; CHECK: setns %cl
26 ; CHECK: movl %ecx, %eax
23 ; CHECK: setns %al
24 ; CHECK: movzbl %al, %eax
2725 ; CHECK: retq
2826 }
2927
4947 ret i32 %conv
5048 ; CHECK-LABEL: TestComp128LE:
5149 ; CHECK: callq __letf2
52 ; CHECK: xorl %ecx, %ecx
53 ; CHECK: testl %eax, %eax
54 ; CHECK: setle %cl
55 ; CHECK: movl %ecx, %eax
50 ; CHECK-NEXT: testl %eax, %eax
51 ; CHECK: setle %al
52 ; CHECK: movzbl %al, %eax
5653 ; CHECK: retq
5754 }
5855
6360 ret i32 %conv
6461 ; CHECK-LABEL: TestComp128EQ:
6562 ; CHECK: callq __eqtf2
66 ; CHECK: xorl %ecx, %ecx
67 ; CHECK: testl %eax, %eax
68 ; CHECK: sete %cl
69 ; CHECK: movl %ecx, %eax
63 ; CHECK-NEXT: testl %eax, %eax
64 ; CHECK: sete %al
65 ; CHECK: movzbl %al, %eax
7066 ; CHECK: retq
7167 }
7268
7773 ret i32 %conv
7874 ; CHECK-LABEL: TestComp128NE:
7975 ; CHECK: callq __netf2
80 ; CHECK: xorl %ecx, %ecx
81 ; CHECK: testl %eax, %eax
82 ; CHECK: setne %cl
83 ; CHECK: movl %ecx, %eax
76 ; CHECK-NEXT: testl %eax, %eax
77 ; CHECK: setne %al
78 ; CHECK: movzbl %al, %eax
8479 ; CHECK: retq
8580 }
8681
22 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
33 target triple = "x86_64-apple-darwin10.0.0"
44
5 declare i32 @foo();
6
75 define i32 @f0(i32* nocapture %x) nounwind readonly ssp {
86 entry:
9 %tmp1 = call i32 @foo()
7 %tmp1 = load i32, i32* %x ; [#uses=2]
8 %tobool = icmp eq i32 %tmp1, 0 ; [#uses=1]
9 br i1 %tobool, label %if.end, label %return
10
11 if.end: ; preds = %entry
12
13 ; Check that we lower to the short form of cmpl, which has a fixed %eax
14 ; register.
15 ;
1016 ; CHECK: cmpl $16777216, %eax
1117 ; CHECK: # encoding: [0x3d,0x00,0x00,0x00,0x01]
1218 %cmp = icmp eq i32 %tmp1, 16777216 ; [#uses=1]
1319
1420 %conv = zext i1 %cmp to i32 ; [#uses=1]
1521 ret i32 %conv
22
23 return: ; preds = %entry
24 ret i32 0
1625 }
1726
1827 define i32 @f1() nounwind {
4141
4242 ; Except on Darwin, for legacy reasons.
4343 ; DARWIN-LABEL: unsigned_i8:
44 ; DARWIN: xorl
45 ; DARWIN-NEXT: cmp
44 ; DARWIN: cmp
4645 ; DARWIN-NEXT: sete
46 ; DARWIN-NEXT: movzbl
4747 ; DARWIN-NEXT: ret
4848 }
4949
6262
6363 ; Except on Darwin, for legacy reasons.
6464 ; DARWIN-LABEL: signed_i8:
65 ; DARWIN: xorl
66 ; DARWIN-NEXT: cmp
65 ; DARWIN: cmp
6766 ; DARWIN-NEXT: sete
67 ; DARWIN-NEXT: movzbl
6868 ; DARWIN-NEXT: ret
6969 }
7070
8484 ; CHECK-NEXT: addw
8585 ; CHECK-NEXT: ret
8686
87 ; Except on Darwin, for legacy reasons.
87 ; Except on Darwin, for legay reasons.
8888 ; DARWIN-LABEL: unsigned_i16:
8989 ; DARWIN-BWOFF: movw
9090 ; DARWIN-BWON: movzwl
55 define i32 @t1() nounwind ssp {
66 entry:
77 ; CHECK-LABEL: t1:
8 ; CHECK: xorl %eax, %eax
9 ; CHECK-NEXT: cmpl $0, _t1.global
8 ; CHECK: cmpl $0, _t1.global
109 ; CHECK-NEXT: setne %al
10 ; CHECK-NEXT: movzbl %al, %eax
1111 ; CHECK-NEXT: ret
1212 %0 = load i64, i64* @t1.global, align 8
1313 %and = and i64 4294967295, %0
66 define zeroext i16 @t1(i16 zeroext %x) nounwind readnone ssp {
77 entry:
88 ; CHECK-LABEL: t1:
9 ; CHECK: xorl %eax, %eax
109 ; CHECK: seta %al
10 ; CHECK: movzbl %al, %eax
1111 ; CHECK: shll $5, %eax
1212 %0 = icmp ugt i16 %x, 26 ; [#uses=1]
1313 %iftmp.1.0 = select i1 %0, i16 32, i16 0 ; [#uses=1]
592592 define i32 @test_mm_comige_ss(<4 x float> %a0, <4 x float> %a1) nounwind {
593593 ; X32-LABEL: test_mm_comige_ss:
594594 ; X32: # BB#0:
595 ; X32-NEXT: xorl %eax, %eax
596595 ; X32-NEXT: comiss %xmm1, %xmm0
597596 ; X32-NEXT: setae %al
597 ; X32-NEXT: movzbl %al, %eax
598598 ; X32-NEXT: retl
599599 ;
600600 ; X64-LABEL: test_mm_comige_ss:
601601 ; X64: # BB#0:
602 ; X64-NEXT: xorl %eax, %eax
603602 ; X64-NEXT: comiss %xmm1, %xmm0
604603 ; X64-NEXT: setae %al
604 ; X64-NEXT: movzbl %al, %eax
605605 ; X64-NEXT: retq
606606 %res = call i32 @llvm.x86.sse.comige.ss(<4 x float> %a0, <4 x float> %a1)
607607 ret i32 %res
611611 define i32 @test_mm_comigt_ss(<4 x float> %a0, <4 x float> %a1) nounwind {
612612 ; X32-LABEL: test_mm_comigt_ss:
613613 ; X32: # BB#0:
614 ; X32-NEXT: xorl %eax, %eax
615614 ; X32-NEXT: comiss %xmm1, %xmm0
616615 ; X32-NEXT: seta %al
616 ; X32-NEXT: movzbl %al, %eax
617617 ; X32-NEXT: retl
618618 ;
619619 ; X64-LABEL: test_mm_comigt_ss:
620620 ; X64: # BB#0:
621 ; X64-NEXT: xorl %eax, %eax
622621 ; X64-NEXT: comiss %xmm1, %xmm0
623622 ; X64-NEXT: seta %al
623 ; X64-NEXT: movzbl %al, %eax
624624 ; X64-NEXT: retq
625625 %res = call i32 @llvm.x86.sse.comigt.ss(<4 x float> %a0, <4 x float> %a1)
626626 ret i32 %res
630630 define i32 @test_mm_comile_ss(<4 x float> %a0, <4 x float> %a1) nounwind {
631631 ; X32-LABEL: test_mm_comile_ss:
632632 ; X32: # BB#0:
633 ; X32-NEXT: xorl %eax, %eax
634633 ; X32-NEXT: comiss %xmm0, %xmm1
635634 ; X32-NEXT: setae %al
635 ; X32-NEXT: movzbl %al, %eax
636636 ; X32-NEXT: retl
637637 ;
638638 ; X64-LABEL: test_mm_comile_ss:
639639 ; X64: # BB#0:
640 ; X64-NEXT: xorl %eax, %eax
641640 ; X64-NEXT: comiss %xmm0, %xmm1
642641 ; X64-NEXT: setae %al
642 ; X64-NEXT: movzbl %al, %eax
643643 ; X64-NEXT: retq
644644 %res = call i32 @llvm.x86.sse.comile.ss(<4 x float> %a0, <4 x float> %a1)
645645 ret i32 %res
649649 define i32 @test_mm_comilt_ss(<4 x float> %a0, <4 x float> %a1) nounwind {
650650 ; X32-LABEL: test_mm_comilt_ss:
651651 ; X32: # BB#0:
652 ; X32-NEXT: xorl %eax, %eax
653652 ; X32-NEXT: comiss %xmm0, %xmm1
654653 ; X32-NEXT: seta %al
654 ; X32-NEXT: movzbl %al, %eax
655655 ; X32-NEXT: retl
656656 ;
657657 ; X64-LABEL: test_mm_comilt_ss:
658658 ; X64: # BB#0:
659 ; X64-NEXT: xorl %eax, %eax
660659 ; X64-NEXT: comiss %xmm0, %xmm1
661660 ; X64-NEXT: seta %al
661 ; X64-NEXT: movzbl %al, %eax
662662 ; X64-NEXT: retq
663663 %res = call i32 @llvm.x86.sse.comilt.ss(<4 x float> %a0, <4 x float> %a1)
664664 ret i32 %res
20932093 define i32 @test_mm_ucomige_ss(<4 x float> %a0, <4 x float> %a1) nounwind {
20942094 ; X32-LABEL: test_mm_ucomige_ss:
20952095 ; X32: # BB#0:
2096 ; X32-NEXT: xorl %eax, %eax
20972096 ; X32-NEXT: ucomiss %xmm1, %xmm0
20982097 ; X32-NEXT: setae %al
2098 ; X32-NEXT: movzbl %al, %eax
20992099 ; X32-NEXT: retl
21002100 ;
21012101 ; X64-LABEL: test_mm_ucomige_ss:
21022102 ; X64: # BB#0:
2103 ; X64-NEXT: xorl %eax, %eax
21042103 ; X64-NEXT: ucomiss %xmm1, %xmm0
21052104 ; X64-NEXT: setae %al
2105 ; X64-NEXT: movzbl %al, %eax
21062106 ; X64-NEXT: retq
21072107 %res = call i32 @llvm.x86.sse.ucomige.ss(<4 x float> %a0, <4 x float> %a1)
21082108 ret i32 %res
21122112 define i32 @test_mm_ucomigt_ss(<4 x float> %a0, <4 x float> %a1) nounwind {
21132113 ; X32-LABEL: test_mm_ucomigt_ss:
21142114 ; X32: # BB#0:
2115 ; X32-NEXT: xorl %eax, %eax
21162115 ; X32-NEXT: ucomiss %xmm1, %xmm0
21172116 ; X32-NEXT: seta %al
2117 ; X32-NEXT: movzbl %al, %eax
21182118 ; X32-NEXT: retl
21192119 ;
21202120 ; X64-LABEL: test_mm_ucomigt_ss:
21212121 ; X64: # BB#0:
2122 ; X64-NEXT: xorl %eax, %eax
21232122 ; X64-NEXT: ucomiss %xmm1, %xmm0
21242123 ; X64-NEXT: seta %al
2124 ; X64-NEXT: movzbl %al, %eax
21252125 ; X64-NEXT: retq
21262126 %res = call i32 @llvm.x86.sse.ucomigt.ss(<4 x float> %a0, <4 x float> %a1)
21272127 ret i32 %res
21312131 define i32 @test_mm_ucomile_ss(<4 x float> %a0, <4 x float> %a1) nounwind {
21322132 ; X32-LABEL: test_mm_ucomile_ss:
21332133 ; X32: # BB#0:
2134 ; X32-NEXT: xorl %eax, %eax
21352134 ; X32-NEXT: ucomiss %xmm0, %xmm1
21362135 ; X32-NEXT: setae %al
2136 ; X32-NEXT: movzbl %al, %eax
21372137 ; X32-NEXT: retl
21382138 ;
21392139 ; X64-LABEL: test_mm_ucomile_ss:
21402140 ; X64: # BB#0:
2141 ; X64-NEXT: xorl %eax, %eax
21422141 ; X64-NEXT: ucomiss %xmm0, %xmm1
21432142 ; X64-NEXT: setae %al
2143 ; X64-NEXT: movzbl %al, %eax
21442144 ; X64-NEXT: retq
21452145 %res = call i32 @llvm.x86.sse.ucomile.ss(<4 x float> %a0, <4 x float> %a1)
21462146 ret i32 %res
21502150 define i32 @test_mm_ucomilt_ss(<4 x float> %a0, <4 x float> %a1) nounwind {
21512151 ; X32-LABEL: test_mm_ucomilt_ss:
21522152 ; X32: # BB#0:
2153 ; X32-NEXT: xorl %eax, %eax
21542153 ; X32-NEXT: ucomiss %xmm0, %xmm1
21552154 ; X32-NEXT: seta %al
2155 ; X32-NEXT: movzbl %al, %eax
21562156 ; X32-NEXT: retl
21572157 ;
21582158 ; X64-LABEL: test_mm_ucomilt_ss:
21592159 ; X64: # BB#0:
2160 ; X64-NEXT: xorl %eax, %eax
21612160 ; X64-NEXT: ucomiss %xmm0, %xmm1
21622161 ; X64-NEXT: seta %al
2162 ; X64-NEXT: movzbl %al, %eax
21632163 ; X64-NEXT: retq
21642164 %res = call i32 @llvm.x86.sse.ucomilt.ss(<4 x float> %a0, <4 x float> %a1)
21652165 ret i32 %res
7676 define i32 @test_x86_sse_comige_ss(<4 x float> %a0, <4 x float> %a1) {
7777 ; SSE-LABEL: test_x86_sse_comige_ss:
7878 ; SSE: ## BB#0:
79 ; SSE-NEXT: xorl %eax, %eax
8079 ; SSE-NEXT: comiss %xmm1, %xmm0
8180 ; SSE-NEXT: setae %al
81 ; SSE-NEXT: movzbl %al, %eax
8282 ; SSE-NEXT: retl
8383 ;
8484 ; KNL-LABEL: test_x86_sse_comige_ss:
8585 ; KNL: ## BB#0:
86 ; KNL-NEXT: xorl %eax, %eax
8786 ; KNL-NEXT: vcomiss %xmm1, %xmm0
8887 ; KNL-NEXT: setae %al
88 ; KNL-NEXT: movzbl %al, %eax
8989 ; KNL-NEXT: retl
9090 %res = call i32 @llvm.x86.sse.comige.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
9191 ret i32 %res
9696 define i32 @test_x86_sse_comigt_ss(<4 x float> %a0, <4 x float> %a1) {
9797 ; SSE-LABEL: test_x86_sse_comigt_ss:
9898 ; SSE: ## BB#0:
99 ; SSE-NEXT: xorl %eax, %eax
10099 ; SSE-NEXT: comiss %xmm1, %xmm0
101100 ; SSE-NEXT: seta %al
101 ; SSE-NEXT: movzbl %al, %eax
102102 ; SSE-NEXT: retl
103103 ;
104104 ; KNL-LABEL: test_x86_sse_comigt_ss:
105105 ; KNL: ## BB#0:
106 ; KNL-NEXT: xorl %eax, %eax
107106 ; KNL-NEXT: vcomiss %xmm1, %xmm0
108107 ; KNL-NEXT: seta %al
108 ; KNL-NEXT: movzbl %al, %eax
109109 ; KNL-NEXT: retl
110110 %res = call i32 @llvm.x86.sse.comigt.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
111111 ret i32 %res
116116 define i32 @test_x86_sse_comile_ss(<4 x float> %a0, <4 x float> %a1) {
117117 ; SSE-LABEL: test_x86_sse_comile_ss:
118118 ; SSE: ## BB#0:
119 ; SSE-NEXT: xorl %eax, %eax
120119 ; SSE-NEXT: comiss %xmm0, %xmm1
121120 ; SSE-NEXT: setae %al
121 ; SSE-NEXT: movzbl %al, %eax
122122 ; SSE-NEXT: retl
123123 ;
124124 ; KNL-LABEL: test_x86_sse_comile_ss:
125125 ; KNL: ## BB#0:
126 ; KNL-NEXT: xorl %eax, %eax
127126 ; KNL-NEXT: vcomiss %xmm0, %xmm1
128127 ; KNL-NEXT: setae %al
128 ; KNL-NEXT: movzbl %al, %eax
129129 ; KNL-NEXT: retl
130130 %res = call i32 @llvm.x86.sse.comile.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
131131 ret i32 %res
136136 define i32 @test_x86_sse_comilt_ss(<4 x float> %a0, <4 x float> %a1) {
137137 ; SSE-LABEL: test_x86_sse_comilt_ss:
138138 ; SSE: ## BB#0:
139 ; SSE-NEXT: xorl %eax, %eax
140139 ; SSE-NEXT: comiss %xmm0, %xmm1
141140 ; SSE-NEXT: seta %al
141 ; SSE-NEXT: movzbl %al, %eax
142142 ; SSE-NEXT: retl
143143 ;
144144 ; KNL-LABEL: test_x86_sse_comilt_ss:
145145 ; KNL: ## BB#0:
146 ; KNL-NEXT: xorl %eax, %eax
147146 ; KNL-NEXT: vcomiss %xmm0, %xmm1
148147 ; KNL-NEXT: seta %al
148 ; KNL-NEXT: movzbl %al, %eax
149149 ; KNL-NEXT: retl
150150 %res = call i32 @llvm.x86.sse.comilt.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
151151 ret i32 %res
516516 define i32 @test_x86_sse_ucomige_ss(<4 x float> %a0, <4 x float> %a1) {
517517 ; SSE-LABEL: test_x86_sse_ucomige_ss:
518518 ; SSE: ## BB#0:
519 ; SSE-NEXT: xorl %eax, %eax
520519 ; SSE-NEXT: ucomiss %xmm1, %xmm0
521520 ; SSE-NEXT: setae %al
521 ; SSE-NEXT: movzbl %al, %eax
522522 ; SSE-NEXT: retl
523523 ;
524524 ; KNL-LABEL: test_x86_sse_ucomige_ss:
525525 ; KNL: ## BB#0:
526 ; KNL-NEXT: xorl %eax, %eax
527526 ; KNL-NEXT: vucomiss %xmm1, %xmm0
528527 ; KNL-NEXT: setae %al
528 ; KNL-NEXT: movzbl %al, %eax
529529 ; KNL-NEXT: retl
530530 %res = call i32 @llvm.x86.sse.ucomige.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
531531 ret i32 %res
536536 define i32 @test_x86_sse_ucomigt_ss(<4 x float> %a0, <4 x float> %a1) {
537537 ; SSE-LABEL: test_x86_sse_ucomigt_ss:
538538 ; SSE: ## BB#0:
539 ; SSE-NEXT: xorl %eax, %eax
540539 ; SSE-NEXT: ucomiss %xmm1, %xmm0
541540 ; SSE-NEXT: seta %al
541 ; SSE-NEXT: movzbl %al, %eax
542542 ; SSE-NEXT: retl
543543 ;
544544 ; KNL-LABEL: test_x86_sse_ucomigt_ss:
545545 ; KNL: ## BB#0:
546 ; KNL-NEXT: xorl %eax, %eax
547546 ; KNL-NEXT: vucomiss %xmm1, %xmm0
548547 ; KNL-NEXT: seta %al
548 ; KNL-NEXT: movzbl %al, %eax
549549 ; KNL-NEXT: retl
550550 %res = call i32 @llvm.x86.sse.ucomigt.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
551551 ret i32 %res
556556 define i32 @test_x86_sse_ucomile_ss(<4 x float> %a0, <4 x float> %a1) {
557557 ; SSE-LABEL: test_x86_sse_ucomile_ss:
558558 ; SSE: ## BB#0:
559 ; SSE-NEXT: xorl %eax, %eax
560559 ; SSE-NEXT: ucomiss %xmm0, %xmm1
561560 ; SSE-NEXT: setae %al
561 ; SSE-NEXT: movzbl %al, %eax
562562 ; SSE-NEXT: retl
563563 ;
564564 ; KNL-LABEL: test_x86_sse_ucomile_ss:
565565 ; KNL: ## BB#0:
566 ; KNL-NEXT: xorl %eax, %eax
567566 ; KNL-NEXT: vucomiss %xmm0, %xmm1
568567 ; KNL-NEXT: setae %al
568 ; KNL-NEXT: movzbl %al, %eax
569569 ; KNL-NEXT: retl
570570 %res = call i32 @llvm.x86.sse.ucomile.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
571571 ret i32 %res
576576 define i32 @test_x86_sse_ucomilt_ss(<4 x float> %a0, <4 x float> %a1) {
577577 ; SSE-LABEL: test_x86_sse_ucomilt_ss:
578578 ; SSE: ## BB#0:
579 ; SSE-NEXT: xorl %eax, %eax
580579 ; SSE-NEXT: ucomiss %xmm0, %xmm1
581580 ; SSE-NEXT: seta %al
581 ; SSE-NEXT: movzbl %al, %eax
582582 ; SSE-NEXT: retl
583583 ;
584584 ; KNL-LABEL: test_x86_sse_ucomilt_ss:
585585 ; KNL: ## BB#0:
586 ; KNL-NEXT: xorl %eax, %eax
587586 ; KNL-NEXT: vucomiss %xmm0, %xmm1
588587 ; KNL-NEXT: seta %al
588 ; KNL-NEXT: movzbl %al, %eax
589589 ; KNL-NEXT: retl
590590 %res = call i32 @llvm.x86.sse.ucomilt.ss(<4 x float> %a0, <4 x float> %a1) ; [#uses=1]
591591 ret i32 %res
982982 define i32 @test_mm_comige_sd(<2 x double> %a0, <2 x double> %a1) nounwind {
983983 ; X32-LABEL: test_mm_comige_sd:
984984 ; X32: # BB#0:
985 ; X32-NEXT: xorl %eax, %eax
986985 ; X32-NEXT: comisd %xmm1, %xmm0
987986 ; X32-NEXT: setae %al
987 ; X32-NEXT: movzbl %al, %eax
988988 ; X32-NEXT: retl
989989 ;
990990 ; X64-LABEL: test_mm_comige_sd:
991991 ; X64: # BB#0:
992 ; X64-NEXT: xorl %eax, %eax
993992 ; X64-NEXT: comisd %xmm1, %xmm0
994993 ; X64-NEXT: setae %al
994 ; X64-NEXT: movzbl %al, %eax
995995 ; X64-NEXT: retq
996996 %res = call i32 @llvm.x86.sse2.comige.sd(<2 x double> %a0, <2 x double> %a1)
997997 ret i32 %res
10011001 define i32 @test_mm_comigt_sd(<2 x double> %a0, <2 x double> %a1) nounwind {
10021002 ; X32-LABEL: test_mm_comigt_sd:
10031003 ; X32: # BB#0:
1004 ; X32-NEXT: xorl %eax, %eax
10051004 ; X32-NEXT: comisd %xmm1, %xmm0
10061005 ; X32-NEXT: seta %al
1006 ; X32-NEXT: movzbl %al, %eax
10071007 ; X32-NEXT: retl
10081008 ;
10091009 ; X64-LABEL: test_mm_comigt_sd:
10101010 ; X64: # BB#0:
1011 ; X64-NEXT: xorl %eax, %eax
10121011 ; X64-NEXT: comisd %xmm1, %xmm0
10131012 ; X64-NEXT: seta %al
1013 ; X64-NEXT: movzbl %al, %eax
10141014 ; X64-NEXT: retq
10151015 %res = call i32 @llvm.x86.sse2.comigt.sd(<2 x double> %a0, <2 x double> %a1)
10161016 ret i32 %res
10201020 define i32 @test_mm_comile_sd(<2 x double> %a0, <2 x double> %a1) nounwind {
10211021 ; X32-LABEL: test_mm_comile_sd:
10221022 ; X32: # BB#0:
1023 ; X32-NEXT: xorl %eax, %eax
10241023 ; X32-NEXT: comisd %xmm0, %xmm1
10251024 ; X32-NEXT: setae %al
1025 ; X32-NEXT: movzbl %al, %eax
10261026 ; X32-NEXT: retl
10271027 ;
10281028 ; X64-LABEL: test_mm_comile_sd:
10291029 ; X64: # BB#0:
1030 ; X64-NEXT: xorl %eax, %eax
10311030 ; X64-NEXT: comisd %xmm0, %xmm1
10321031 ; X64-NEXT: setae %al
1032 ; X64-NEXT: movzbl %al, %eax
10331033 ; X64-NEXT: retq
10341034 %res = call i32 @llvm.x86.sse2.comile.sd(<2 x double> %a0, <2 x double> %a1)
10351035 ret i32 %res
10391039 define i32 @test_mm_comilt_sd(<2 x double> %a0, <2 x double> %a1) nounwind {
10401040 ; X32-LABEL: test_mm_comilt_sd:
10411041 ; X32: # BB#0:
1042 ; X32-NEXT: xorl %eax, %eax
10431042 ; X32-NEXT: comisd %xmm0, %xmm1
10441043 ; X32-NEXT: seta %al
1044 ; X32-NEXT: movzbl %al, %eax
10451045 ; X32-NEXT: retl
10461046 ;
10471047 ; X64-LABEL: test_mm_comilt_sd:
10481048 ; X64: # BB#0:
1049 ; X64-NEXT: xorl %eax, %eax
10501049 ; X64-NEXT: comisd %xmm0, %xmm1
10511050 ; X64-NEXT: seta %al
1051 ; X64-NEXT: movzbl %al, %eax
10521052 ; X64-NEXT: retq
10531053 %res = call i32 @llvm.x86.sse2.comilt.sd(<2 x double> %a0, <2 x double> %a1)
10541054 ret i32 %res
35373537 define i32 @test_mm_ucomige_sd(<2 x double> %a0, <2 x double> %a1) nounwind {
35383538 ; X32-LABEL: test_mm_ucomige_sd:
35393539 ; X32: # BB#0:
3540 ; X32-NEXT: xorl %eax, %eax
35413540 ; X32-NEXT: ucomisd %xmm1, %xmm0
35423541 ; X32-NEXT: setae %al
3542 ; X32-NEXT: movzbl %al, %eax
35433543 ; X32-NEXT: retl
35443544 ;
35453545 ; X64-LABEL: test_mm_ucomige_sd:
35463546 ; X64: # BB#0:
3547 ; X64-NEXT: xorl %eax, %eax
35483547 ; X64-NEXT: ucomisd %xmm1, %xmm0
35493548 ; X64-NEXT: setae %al
3549 ; X64-NEXT: movzbl %al, %eax
35503550 ; X64-NEXT: retq
35513551 %res = call i32 @llvm.x86.sse2.ucomige.sd(<2 x double> %a0, <2 x double> %a1)
35523552 ret i32 %res
35563556 define i32 @test_mm_ucomigt_sd(<2 x double> %a0, <2 x double> %a1) nounwind {
35573557 ; X32-LABEL: test_mm_ucomigt_sd:
35583558 ; X32: # BB#0:
3559 ; X32-NEXT: xorl %eax, %eax
35603559 ; X32-NEXT: ucomisd %xmm1, %xmm0
35613560 ; X32-NEXT: seta %al
3561 ; X32-NEXT: movzbl %al, %eax
35623562 ; X32-NEXT: retl
35633563 ;
35643564 ; X64-LABEL: test_mm_ucomigt_sd:
35653565 ; X64: # BB#0:
3566 ; X64-NEXT: xorl %eax, %eax
35673566 ; X64-NEXT: ucomisd %xmm1, %xmm0
35683567 ; X64-NEXT: seta %al
3568 ; X64-NEXT: movzbl %al, %eax
35693569 ; X64-NEXT: retq
35703570 %res = call i32 @llvm.x86.sse2.ucomigt.sd(<2 x double> %a0, <2 x double> %a1)
35713571 ret i32 %res
35753575 define i32 @test_mm_ucomile_sd(<2 x double> %a0, <2 x double> %a1) nounwind {
35763576 ; X32-LABEL: test_mm_ucomile_sd:
35773577 ; X32: # BB#0:
3578 ; X32-NEXT: xorl %eax, %eax
35793578 ; X32-NEXT: ucomisd %xmm0, %xmm1
35803579 ; X32-NEXT: setae %al
3580 ; X32-NEXT: movzbl %al, %eax
35813581 ; X32-NEXT: retl
35823582 ;
35833583 ; X64-LABEL: test_mm_ucomile_sd:
35843584 ; X64: # BB#0:
3585 ; X64-NEXT: xorl %eax, %eax
35863585 ; X64-NEXT: ucomisd %xmm0, %xmm1
35873586 ; X64-NEXT: setae %al
3587 ; X64-NEXT: movzbl %al, %eax
35883588 ; X64-NEXT: retq
35893589 %res = call i32 @llvm.x86.sse2.ucomile.sd(<2 x double> %a0, <2 x double> %a1)
35903590 ret i32 %res
35943594 define i32 @test_mm_ucomilt_sd(<2 x double> %a0, <2 x double> %a1) nounwind {
35953595 ; X32-LABEL: test_mm_ucomilt_sd:
35963596 ; X32: # BB#0:
3597 ; X32-NEXT: xorl %eax, %eax
35983597 ; X32-NEXT: ucomisd %xmm0, %xmm1
35993598 ; X32-NEXT: seta %al
3599 ; X32-NEXT: movzbl %al, %eax
36003600 ; X32-NEXT: retl
36013601 ;
36023602 ; X64-LABEL: test_mm_ucomilt_sd:
36033603 ; X64: # BB#0:
3604 ; X64-NEXT: xorl %eax, %eax
36053604 ; X64-NEXT: ucomisd %xmm0, %xmm1
36063605 ; X64-NEXT: seta %al
3606 ; X64-NEXT: movzbl %al, %eax
36073607 ; X64-NEXT: retq
36083608 %res = call i32 @llvm.x86.sse2.ucomilt.sd(<2 x double> %a0, <2 x double> %a1)
36093609 ret i32 %res
7676 define i32 @test_x86_sse2_comige_sd(<2 x double> %a0, <2 x double> %a1) {
7777 ; SSE-LABEL: test_x86_sse2_comige_sd:
7878 ; SSE: ## BB#0:
79 ; SSE-NEXT: xorl %eax, %eax
8079 ; SSE-NEXT: comisd %xmm1, %xmm0
8180 ; SSE-NEXT: setae %al
81 ; SSE-NEXT: movzbl %al, %eax
8282 ; SSE-NEXT: retl
8383 ;
8484 ; KNL-LABEL: test_x86_sse2_comige_sd:
8585 ; KNL: ## BB#0:
86 ; KNL-NEXT: xorl %eax, %eax
8786 ; KNL-NEXT: vcomisd %xmm1, %xmm0
8887 ; KNL-NEXT: setae %al
88 ; KNL-NEXT: movzbl %al, %eax
8989 ; KNL-NEXT: retl
9090 %res = call i32 @llvm.x86.sse2.comige.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
9191 ret i32 %res
9696 define i32 @test_x86_sse2_comigt_sd(<2 x double> %a0, <2 x double> %a1) {
9797 ; SSE-LABEL: test_x86_sse2_comigt_sd:
9898 ; SSE: ## BB#0:
99 ; SSE-NEXT: xorl %eax, %eax
10099 ; SSE-NEXT: comisd %xmm1, %xmm0
101100 ; SSE-NEXT: seta %al
101 ; SSE-NEXT: movzbl %al, %eax
102102 ; SSE-NEXT: retl
103103 ;
104104 ; KNL-LABEL: test_x86_sse2_comigt_sd:
105105 ; KNL: ## BB#0:
106 ; KNL-NEXT: xorl %eax, %eax
107106 ; KNL-NEXT: vcomisd %xmm1, %xmm0
108107 ; KNL-NEXT: seta %al
108 ; KNL-NEXT: movzbl %al, %eax
109109 ; KNL-NEXT: retl
110110 %res = call i32 @llvm.x86.sse2.comigt.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
111111 ret i32 %res
116116 define i32 @test_x86_sse2_comile_sd(<2 x double> %a0, <2 x double> %a1) {
117117 ; SSE-LABEL: test_x86_sse2_comile_sd:
118118 ; SSE: ## BB#0:
119 ; SSE-NEXT: xorl %eax, %eax
120119 ; SSE-NEXT: comisd %xmm0, %xmm1
121120 ; SSE-NEXT: setae %al
121 ; SSE-NEXT: movzbl %al, %eax
122122 ; SSE-NEXT: retl
123123 ;
124124 ; KNL-LABEL: test_x86_sse2_comile_sd:
125125 ; KNL: ## BB#0:
126 ; KNL-NEXT: xorl %eax, %eax
127126 ; KNL-NEXT: vcomisd %xmm0, %xmm1
128127 ; KNL-NEXT: setae %al
128 ; KNL-NEXT: movzbl %al, %eax
129129 ; KNL-NEXT: retl
130130 %res = call i32 @llvm.x86.sse2.comile.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
131131 ret i32 %res
136136 define i32 @test_x86_sse2_comilt_sd(<2 x double> %a0, <2 x double> %a1) {
137137 ; SSE-LABEL: test_x86_sse2_comilt_sd:
138138 ; SSE: ## BB#0:
139 ; SSE-NEXT: xorl %eax, %eax
140139 ; SSE-NEXT: comisd %xmm0, %xmm1
141140 ; SSE-NEXT: seta %al
141 ; SSE-NEXT: movzbl %al, %eax
142142 ; SSE-NEXT: retl
143143 ;
144144 ; KNL-LABEL: test_x86_sse2_comilt_sd:
145145 ; KNL: ## BB#0:
146 ; KNL-NEXT: xorl %eax, %eax
147146 ; KNL-NEXT: vcomisd %xmm0, %xmm1
148147 ; KNL-NEXT: seta %al
148 ; KNL-NEXT: movzbl %al, %eax
149149 ; KNL-NEXT: retl
150150 %res = call i32 @llvm.x86.sse2.comilt.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
151151 ret i32 %res
11511151 define i32 @test_x86_sse2_ucomige_sd(<2 x double> %a0, <2 x double> %a1) {
11521152 ; SSE-LABEL: test_x86_sse2_ucomige_sd:
11531153 ; SSE: ## BB#0:
1154 ; SSE-NEXT: xorl %eax, %eax
11551154 ; SSE-NEXT: ucomisd %xmm1, %xmm0
11561155 ; SSE-NEXT: setae %al
1156 ; SSE-NEXT: movzbl %al, %eax
11571157 ; SSE-NEXT: retl
11581158 ;
11591159 ; KNL-LABEL: test_x86_sse2_ucomige_sd:
11601160 ; KNL: ## BB#0:
1161 ; KNL-NEXT: xorl %eax, %eax
11621161 ; KNL-NEXT: vucomisd %xmm1, %xmm0
11631162 ; KNL-NEXT: setae %al
1163 ; KNL-NEXT: movzbl %al, %eax
11641164 ; KNL-NEXT: retl
11651165 %res = call i32 @llvm.x86.sse2.ucomige.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
11661166 ret i32 %res
11711171 define i32 @test_x86_sse2_ucomigt_sd(<2 x double> %a0, <2 x double> %a1) {
11721172 ; SSE-LABEL: test_x86_sse2_ucomigt_sd:
11731173 ; SSE: ## BB#0:
1174 ; SSE-NEXT: xorl %eax, %eax
11751174 ; SSE-NEXT: ucomisd %xmm1, %xmm0
11761175 ; SSE-NEXT: seta %al
1176 ; SSE-NEXT: movzbl %al, %eax
11771177 ; SSE-NEXT: retl
11781178 ;
11791179 ; KNL-LABEL: test_x86_sse2_ucomigt_sd:
11801180 ; KNL: ## BB#0:
1181 ; KNL-NEXT: xorl %eax, %eax
11821181 ; KNL-NEXT: vucomisd %xmm1, %xmm0
11831182 ; KNL-NEXT: seta %al
1183 ; KNL-NEXT: movzbl %al, %eax
11841184 ; KNL-NEXT: retl
11851185 %res = call i32 @llvm.x86.sse2.ucomigt.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
11861186 ret i32 %res
11911191 define i32 @test_x86_sse2_ucomile_sd(<2 x double> %a0, <2 x double> %a1) {
11921192 ; SSE-LABEL: test_x86_sse2_ucomile_sd:
11931193 ; SSE: ## BB#0:
1194 ; SSE-NEXT: xorl %eax, %eax
11951194 ; SSE-NEXT: ucomisd %xmm0, %xmm1
11961195 ; SSE-NEXT: setae %al
1196 ; SSE-NEXT: movzbl %al, %eax
11971197 ; SSE-NEXT: retl
11981198 ;
11991199 ; KNL-LABEL: test_x86_sse2_ucomile_sd:
12001200 ; KNL: ## BB#0:
1201 ; KNL-NEXT: xorl %eax, %eax
12021201 ; KNL-NEXT: vucomisd %xmm0, %xmm1
12031202 ; KNL-NEXT: setae %al
1203 ; KNL-NEXT: movzbl %al, %eax
12041204 ; KNL-NEXT: retl
12051205 %res = call i32 @llvm.x86.sse2.ucomile.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
12061206 ret i32 %res
12111211 define i32 @test_x86_sse2_ucomilt_sd(<2 x double> %a0, <2 x double> %a1) {
12121212 ; SSE-LABEL: test_x86_sse2_ucomilt_sd:
12131213 ; SSE: ## BB#0:
1214 ; SSE-NEXT: xorl %eax, %eax
12151214 ; SSE-NEXT: ucomisd %xmm0, %xmm1
12161215 ; SSE-NEXT: seta %al
1216 ; SSE-NEXT: movzbl %al, %eax
12171217 ; SSE-NEXT: retl
12181218 ;
12191219 ; KNL-LABEL: test_x86_sse2_ucomilt_sd:
12201220 ; KNL: ## BB#0:
1221 ; KNL-NEXT: xorl %eax, %eax
12221221 ; KNL-NEXT: vucomisd %xmm0, %xmm1
12231222 ; KNL-NEXT: seta %al
1223 ; KNL-NEXT: movzbl %al, %eax
12241224 ; KNL-NEXT: retl
12251225 %res = call i32 @llvm.x86.sse2.ucomilt.sd(<2 x double> %a0, <2 x double> %a1) ; [#uses=1]
12261226 ret i32 %res
917917 define i32 @test_mm_test_all_zeros(<2 x i64> %a0, <2 x i64> %a1) {
918918 ; X32-LABEL: test_mm_test_all_zeros:
919919 ; X32: # BB#0:
920 ; X32-NEXT: xorl %eax, %eax
921920 ; X32-NEXT: ptest %xmm1, %xmm0
922921 ; X32-NEXT: sete %al
922 ; X32-NEXT: movzbl %al, %eax
923923 ; X32-NEXT: retl
924924 ;
925925 ; X64-LABEL: test_mm_test_all_zeros:
926926 ; X64: # BB#0:
927 ; X64-NEXT: xorl %eax, %eax
928927 ; X64-NEXT: ptest %xmm1, %xmm0
929928 ; X64-NEXT: sete %al
929 ; X64-NEXT: movzbl %al, %eax
930930 ; X64-NEXT: retq
931931 %res = call i32 @llvm.x86.sse41.ptestz(<2 x i64> %a0, <2 x i64> %a1)
932932 ret i32 %res
936936 define i32 @test_mm_test_mix_ones_zeros(<2 x i64> %a0, <2 x i64> %a1) {
937937 ; X32-LABEL: test_mm_test_mix_ones_zeros:
938938 ; X32: # BB#0:
939 ; X32-NEXT: xorl %eax, %eax
940939 ; X32-NEXT: ptest %xmm1, %xmm0
941940 ; X32-NEXT: seta %al
941 ; X32-NEXT: movzbl %al, %eax
942942 ; X32-NEXT: retl
943943 ;
944944 ; X64-LABEL: test_mm_test_mix_ones_zeros:
945945 ; X64: # BB#0:
946 ; X64-NEXT: xorl %eax, %eax
947946 ; X64-NEXT: ptest %xmm1, %xmm0
948947 ; X64-NEXT: seta %al
948 ; X64-NEXT: movzbl %al, %eax
949949 ; X64-NEXT: retq
950950 %res = call i32 @llvm.x86.sse41.ptestnzc(<2 x i64> %a0, <2 x i64> %a1)
951951 ret i32 %res
973973 define i32 @test_mm_testnzc_si128(<2 x i64> %a0, <2 x i64> %a1) {
974974 ; X32-LABEL: test_mm_testnzc_si128:
975975 ; X32: # BB#0:
976 ; X32-NEXT: xorl %eax, %eax
977976 ; X32-NEXT: ptest %xmm1, %xmm0
978977 ; X32-NEXT: seta %al
978 ; X32-NEXT: movzbl %al, %eax
979979 ; X32-NEXT: retl
980980 ;
981981 ; X64-LABEL: test_mm_testnzc_si128:
982982 ; X64: # BB#0:
983 ; X64-NEXT: xorl %eax, %eax
984983 ; X64-NEXT: ptest %xmm1, %xmm0
985984 ; X64-NEXT: seta %al
985 ; X64-NEXT: movzbl %al, %eax
986986 ; X64-NEXT: retq
987987 %res = call i32 @llvm.x86.sse41.ptestnzc(<2 x i64> %a0, <2 x i64> %a1)
988988 ret i32 %res
991991 define i32 @test_mm_testz_si128(<2 x i64> %a0, <2 x i64> %a1) {
992992 ; X32-LABEL: test_mm_testz_si128:
993993 ; X32: # BB#0:
994 ; X32-NEXT: xorl %eax, %eax
995994 ; X32-NEXT: ptest %xmm1, %xmm0
996995 ; X32-NEXT: sete %al
996 ; X32-NEXT: movzbl %al, %eax
997997 ; X32-NEXT: retl
998998 ;
999999 ; X64-LABEL: test_mm_testz_si128:
10001000 ; X64: # BB#0:
1001 ; X64-NEXT: xorl %eax, %eax
10021001 ; X64-NEXT: ptest %xmm1, %xmm0
10031002 ; X64-NEXT: sete %al
1003 ; X64-NEXT: movzbl %al, %eax
10041004 ; X64-NEXT: retq
10051005 %res = call i32 @llvm.x86.sse41.ptestz(<2 x i64> %a0, <2 x i64> %a1)
10061006 ret i32 %res
322322 define i32 @test_x86_sse41_ptestnzc(<2 x i64> %a0, <2 x i64> %a1) {
323323 ; SSE41-LABEL: test_x86_sse41_ptestnzc:
324324 ; SSE41: ## BB#0:
325 ; SSE41-NEXT: xorl %eax, %eax
326325 ; SSE41-NEXT: ptest %xmm1, %xmm0
327326 ; SSE41-NEXT: seta %al
327 ; SSE41-NEXT: movzbl %al, %eax
328328 ; SSE41-NEXT: retl
329329 ;
330330 ; KNL-LABEL: test_x86_sse41_ptestnzc:
331331 ; KNL: ## BB#0:
332 ; KNL-NEXT: xorl %eax, %eax
333332 ; KNL-NEXT: vptest %xmm1, %xmm0
334333 ; KNL-NEXT: seta %al
334 ; KNL-NEXT: movzbl %al, %eax
335335 ; KNL-NEXT: retl
336336 %res = call i32 @llvm.x86.sse41.ptestnzc(<2 x i64> %a0, <2 x i64> %a1) ; [#uses=1]
337337 ret i32 %res
342342 define i32 @test_x86_sse41_ptestz(<2 x i64> %a0, <2 x i64> %a1) {
343343 ; SSE41-LABEL: test_x86_sse41_ptestz:
344344 ; SSE41: ## BB#0:
345 ; SSE41-NEXT: xorl %eax, %eax
346345 ; SSE41-NEXT: ptest %xmm1, %xmm0
347346 ; SSE41-NEXT: sete %al
347 ; SSE41-NEXT: movzbl %al, %eax
348348 ; SSE41-NEXT: retl
349349 ;
350350 ; KNL-LABEL: test_x86_sse41_ptestz:
351351 ; KNL: ## BB#0:
352 ; KNL-NEXT: xorl %eax, %eax
353352 ; KNL-NEXT: vptest %xmm1, %xmm0
354353 ; KNL-NEXT: sete %al
354 ; KNL-NEXT: movzbl %al, %eax
355355 ; KNL-NEXT: retl
356356 %res = call i32 @llvm.x86.sse41.ptestz(<2 x i64> %a0, <2 x i64> %a1) ; [#uses=1]
357357 ret i32 %res
207207 define i32 @ptestz_1(<2 x i64> %t1, <2 x i64> %t2) nounwind {
208208 ; X32-LABEL: ptestz_1:
209209 ; X32: ## BB#0:
210 ; X32-NEXT: xorl %eax, %eax
211210 ; X32-NEXT: ptest %xmm1, %xmm0
212211 ; X32-NEXT: sete %al
212 ; X32-NEXT: movzbl %al, %eax
213213 ; X32-NEXT: retl
214214 ;
215215 ; X64-LABEL: ptestz_1:
216216 ; X64: ## BB#0:
217 ; X64-NEXT: xorl %eax, %eax
218217 ; X64-NEXT: ptest %xmm1, %xmm0
219218 ; X64-NEXT: sete %al
219 ; X64-NEXT: movzbl %al, %eax
220220 ; X64-NEXT: retq
221221 %tmp1 = call i32 @llvm.x86.sse41.ptestz(<2 x i64> %t1, <2 x i64> %t2) nounwind readnone
222222 ret i32 %tmp1
243243 define i32 @ptestz_3(<2 x i64> %t1, <2 x i64> %t2) nounwind {
244244 ; X32-LABEL: ptestz_3:
245245 ; X32: ## BB#0:
246 ; X32-NEXT: xorl %eax, %eax
247246 ; X32-NEXT: ptest %xmm1, %xmm0
248247 ; X32-NEXT: seta %al
248 ; X32-NEXT: movzbl %al, %eax
249249 ; X32-NEXT: retl
250250 ;
251251 ; X64-LABEL: ptestz_3:
252252 ; X64: ## BB#0:
253 ; X64-NEXT: xorl %eax, %eax
254253 ; X64-NEXT: ptest %xmm1, %xmm0
255254 ; X64-NEXT: seta %al
255 ; X64-NEXT: movzbl %al, %eax
256256 ; X64-NEXT: retq
257257 %tmp1 = call i32 @llvm.x86.sse41.ptestnzc(<2 x i64> %t1, <2 x i64> %t2) nounwind readnone
258258 ret i32 %tmp1
33
44 ; NOTE: This should use IR equivalent to what is generated by clang/test/CodeGen/sse42-builtins.c
55
6 define i32 @test_mm_cmpestra(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
6 define i32 @test_mm_cmpestra(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) {
77 ; X32-LABEL: test_mm_cmpestra:
88 ; X32: # BB#0:
9 ; X32-NEXT: pushl %ebx
10 ; X32-NEXT: movl {{[0-9]+}}(%esp), %edx
11 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
12 ; X32-NEXT: xorl %ebx, %ebx
13 ; X32-NEXT: pcmpestri $7, %xmm1, %xmm0
14 ; X32-NEXT: seta %bl
15 ; X32-NEXT: movl %ebx, %eax
16 ; X32-NEXT: popl %ebx
9 ; X32-NEXT: movl {{[0-9]+}}(%esp), %edx
10 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
11 ; X32-NEXT: pcmpestri $7, %xmm1, %xmm0
12 ; X32-NEXT: seta %al
13 ; X32-NEXT: movzbl %al, %eax
1714 ; X32-NEXT: retl
1815 ;
1916 ; X64-LABEL: test_mm_cmpestra:
2017 ; X64: # BB#0:
21 ; X64-NEXT: xorl %r8d, %r8d
22 ; X64-NEXT: movl %edi, %eax
23 ; X64-NEXT: movl %esi, %edx
24 ; X64-NEXT: pcmpestri $7, %xmm1, %xmm0
25 ; X64-NEXT: seta %r8b
26 ; X64-NEXT: movl %r8d, %eax
18 ; X64-NEXT: movl %edi, %eax
19 ; X64-NEXT: movl %esi, %edx
20 ; X64-NEXT: pcmpestri $7, %xmm1, %xmm0
21 ; X64-NEXT: seta %al
22 ; X64-NEXT: movzbl %al, %eax
2723 ; X64-NEXT: retq
2824 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
2925 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
10298 }
10399 declare <16 x i8> @llvm.x86.sse42.pcmpestrm128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
104100
105 define i32 @test_mm_cmpestro(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
101 define i32 @test_mm_cmpestro(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) {
106102 ; X32-LABEL: test_mm_cmpestro:
107103 ; X32: # BB#0:
108 ; X32-NEXT: pushl %ebx
109 ; X32-NEXT: movl {{[0-9]+}}(%esp), %edx
110 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
111 ; X32-NEXT: xorl %ebx, %ebx
112 ; X32-NEXT: pcmpestri $7, %xmm1, %xmm0
113 ; X32-NEXT: seto %bl
114 ; X32-NEXT: movl %ebx, %eax
115 ; X32-NEXT: popl %ebx
104 ; X32-NEXT: movl {{[0-9]+}}(%esp), %edx
105 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
106 ; X32-NEXT: pcmpestri $7, %xmm1, %xmm0
107 ; X32-NEXT: seto %al
108 ; X32-NEXT: movzbl %al, %eax
116109 ; X32-NEXT: retl
117110 ;
118111 ; X64-LABEL: test_mm_cmpestro:
119112 ; X64: # BB#0:
120 ; X64-NEXT: xorl %r8d, %r8d
121 ; X64-NEXT: movl %edi, %eax
122 ; X64-NEXT: movl %esi, %edx
123 ; X64-NEXT: pcmpestri $7, %xmm1, %xmm0
124 ; X64-NEXT: seto %r8b
125 ; X64-NEXT: movl %r8d, %eax
113 ; X64-NEXT: movl %edi, %eax
114 ; X64-NEXT: movl %esi, %edx
115 ; X64-NEXT: pcmpestri $7, %xmm1, %xmm0
116 ; X64-NEXT: seto %al
117 ; X64-NEXT: movzbl %al, %eax
126118 ; X64-NEXT: retq
127119 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
128120 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
131123 }
132124 declare i32 @llvm.x86.sse42.pcmpestrio128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
133125
134 define i32 @test_mm_cmpestrs(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
126 define i32 @test_mm_cmpestrs(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) {
135127 ; X32-LABEL: test_mm_cmpestrs:
136128 ; X32: # BB#0:
137 ; X32-NEXT: pushl %ebx
138 ; X32-NEXT: movl {{[0-9]+}}(%esp), %edx
139 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
140 ; X32-NEXT: xorl %ebx, %ebx
141 ; X32-NEXT: pcmpestri $7, %xmm1, %xmm0
142 ; X32-NEXT: sets %bl
143 ; X32-NEXT: movl %ebx, %eax
144 ; X32-NEXT: popl %ebx
129 ; X32-NEXT: movl {{[0-9]+}}(%esp), %edx
130 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
131 ; X32-NEXT: pcmpestri $7, %xmm1, %xmm0
132 ; X32-NEXT: sets %al
133 ; X32-NEXT: movzbl %al, %eax
145134 ; X32-NEXT: retl
146135 ;
147136 ; X64-LABEL: test_mm_cmpestrs:
148137 ; X64: # BB#0:
149 ; X64-NEXT: xorl %r8d, %r8d
150 ; X64-NEXT: movl %edi, %eax
151 ; X64-NEXT: movl %esi, %edx
152 ; X64-NEXT: pcmpestri $7, %xmm1, %xmm0
153 ; X64-NEXT: sets %r8b
154 ; X64-NEXT: movl %r8d, %eax
138 ; X64-NEXT: movl %edi, %eax
139 ; X64-NEXT: movl %esi, %edx
140 ; X64-NEXT: pcmpestri $7, %xmm1, %xmm0
141 ; X64-NEXT: sets %al
142 ; X64-NEXT: movzbl %al, %eax
155143 ; X64-NEXT: retq
156144 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
157145 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
160148 }
161149 declare i32 @llvm.x86.sse42.pcmpestris128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
162150
163 define i32 @test_mm_cmpestrz(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) nounwind {
151 define i32 @test_mm_cmpestrz(<2 x i64> %a0, i32 %a1, <2 x i64> %a2, i32 %a3) {
164152 ; X32-LABEL: test_mm_cmpestrz:
165153 ; X32: # BB#0:
166 ; X32-NEXT: pushl %ebx
167 ; X32-NEXT: movl {{[0-9]+}}(%esp), %edx
168 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
169 ; X32-NEXT: xorl %ebx, %ebx
170 ; X32-NEXT: pcmpestri $7, %xmm1, %xmm0
171 ; X32-NEXT: sete %bl
172 ; X32-NEXT: movl %ebx, %eax
173 ; X32-NEXT: popl %ebx
154 ; X32-NEXT: movl {{[0-9]+}}(%esp), %edx
155 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
156 ; X32-NEXT: pcmpestri $7, %xmm1, %xmm0
157 ; X32-NEXT: sete %al
158 ; X32-NEXT: movzbl %al, %eax
174159 ; X32-NEXT: retl
175160 ;
176161 ; X64-LABEL: test_mm_cmpestrz:
177162 ; X64: # BB#0:
178 ; X64-NEXT: xorl %r8d, %r8d
179 ; X64-NEXT: movl %edi, %eax
180 ; X64-NEXT: movl %esi, %edx
181 ; X64-NEXT: pcmpestri $7, %xmm1, %xmm0
182 ; X64-NEXT: sete %r8b
183 ; X64-NEXT: movl %r8d, %eax
163 ; X64-NEXT: movl %edi, %eax
164 ; X64-NEXT: movl %esi, %edx
165 ; X64-NEXT: pcmpestri $7, %xmm1, %xmm0
166 ; X64-NEXT: sete %al
167 ; X64-NEXT: movzbl %al, %eax
184168 ; X64-NEXT: retq
185169 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
186170 %arg2 = bitcast <2 x i64> %a2 to <16 x i8>
207191 define i32 @test_mm_cmpistra(<2 x i64> %a0, <2 x i64> %a1) {
208192 ; X32-LABEL: test_mm_cmpistra:
209193 ; X32: # BB#0:
210 ; X32-NEXT: xorl %eax, %eax
211194 ; X32-NEXT: pcmpistri $7, %xmm1, %xmm0
212195 ; X32-NEXT: seta %al
196 ; X32-NEXT: movzbl %al, %eax
213197 ; X32-NEXT: retl
214198 ;
215199 ; X64-LABEL: test_mm_cmpistra:
216200 ; X64: # BB#0:
217 ; X64-NEXT: xorl %eax, %eax
218201 ; X64-NEXT: pcmpistri $7, %xmm1, %xmm0
219202 ; X64-NEXT: seta %al
203 ; X64-NEXT: movzbl %al, %eax
220204 ; X64-NEXT: retq
221205 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
222206 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
286270 define i32 @test_mm_cmpistro(<2 x i64> %a0, <2 x i64> %a1) {
287271 ; X32-LABEL: test_mm_cmpistro:
288272 ; X32: # BB#0:
289 ; X32-NEXT: xorl %eax, %eax
290273 ; X32-NEXT: pcmpistri $7, %xmm1, %xmm0
291274 ; X32-NEXT: seto %al
275 ; X32-NEXT: movzbl %al, %eax
292276 ; X32-NEXT: retl
293277 ;
294278 ; X64-LABEL: test_mm_cmpistro:
295279 ; X64: # BB#0:
296 ; X64-NEXT: xorl %eax, %eax
297280 ; X64-NEXT: pcmpistri $7, %xmm1, %xmm0
298281 ; X64-NEXT: seto %al
282 ; X64-NEXT: movzbl %al, %eax
299283 ; X64-NEXT: retq
300284 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
301285 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
307291 define i32 @test_mm_cmpistrs(<2 x i64> %a0, <2 x i64> %a1) {
308292 ; X32-LABEL: test_mm_cmpistrs:
309293 ; X32: # BB#0:
310 ; X32-NEXT: xorl %eax, %eax
311294 ; X32-NEXT: pcmpistri $7, %xmm1, %xmm0
312295 ; X32-NEXT: sets %al
296 ; X32-NEXT: movzbl %al, %eax
313297 ; X32-NEXT: retl
314298 ;
315299 ; X64-LABEL: test_mm_cmpistrs:
316300 ; X64: # BB#0:
317 ; X64-NEXT: xorl %eax, %eax
318301 ; X64-NEXT: pcmpistri $7, %xmm1, %xmm0
319302 ; X64-NEXT: sets %al
303 ; X64-NEXT: movzbl %al, %eax
320304 ; X64-NEXT: retq
321305 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
322306 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
328312 define i32 @test_mm_cmpistrz(<2 x i64> %a0, <2 x i64> %a1) {
329313 ; X32-LABEL: test_mm_cmpistrz:
330314 ; X32: # BB#0:
331 ; X32-NEXT: xorl %eax, %eax
332315 ; X32-NEXT: pcmpistri $7, %xmm1, %xmm0
333316 ; X32-NEXT: sete %al
317 ; X32-NEXT: movzbl %al, %eax
334318 ; X32-NEXT: retl
335319 ;
336320 ; X64-LABEL: test_mm_cmpistrz:
337321 ; X64: # BB#0:
338 ; X64-NEXT: xorl %eax, %eax
339322 ; X64-NEXT: pcmpistri $7, %xmm1, %xmm0
340323 ; X64-NEXT: sete %al
324 ; X64-NEXT: movzbl %al, %eax
341325 ; X64-NEXT: retq
342326 %arg0 = bitcast <2 x i64> %a0 to <16 x i8>
343327 %arg1 = bitcast <2 x i64> %a1 to <16 x i8>
3232 }
3333
3434
35 define i32 @test_x86_sse42_pcmpestria128(<16 x i8> %a0, <16 x i8> %a2) nounwind {
35 define i32 @test_x86_sse42_pcmpestria128(<16 x i8> %a0, <16 x i8> %a2) {
3636 ; CHECK-LABEL: test_x86_sse42_pcmpestria128:
3737 ; CHECK: ## BB#0:
38 ; CHECK-NEXT: pushl %ebx
39 ; CHECK-NEXT: movl $7, %eax
40 ; CHECK-NEXT: movl $7, %edx
41 ; CHECK-NEXT: xorl %ebx, %ebx
42 ; CHECK-NEXT: pcmpestri $7, %xmm1, %xmm0
43 ; CHECK-NEXT: seta %bl
44 ; CHECK-NEXT: movl %ebx, %eax
45 ; CHECK-NEXT: popl %ebx
38 ; CHECK-NEXT: movl $7, %eax
39 ; CHECK-NEXT: movl $7, %edx
40 ; CHECK-NEXT: pcmpestri $7, %xmm1, %xmm0
41 ; CHECK-NEXT: seta %al
42 ; CHECK-NEXT: movzbl %al, %eax
4643 ; CHECK-NEXT: retl
4744 %res = call i32 @llvm.x86.sse42.pcmpestria128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; [#uses=1]
4845 ret i32 %res
6562 declare i32 @llvm.x86.sse42.pcmpestric128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
6663
6764
68 define i32 @test_x86_sse42_pcmpestrio128(<16 x i8> %a0, <16 x i8> %a2) nounwind {
65 define i32 @test_x86_sse42_pcmpestrio128(<16 x i8> %a0, <16 x i8> %a2) {
6966 ; CHECK-LABEL: test_x86_sse42_pcmpestrio128:
7067 ; CHECK: ## BB#0:
71 ; CHECK-NEXT: pushl %ebx
72 ; CHECK-NEXT: movl $7, %eax
73 ; CHECK-NEXT: movl $7, %edx
74 ; CHECK-NEXT: xorl %ebx, %ebx
75 ; CHECK-NEXT: pcmpestri $7, %xmm1, %xmm0
76 ; CHECK-NEXT: seto %bl
77 ; CHECK-NEXT: movl %ebx, %eax
78 ; CHECK-NEXT: popl %ebx
68 ; CHECK-NEXT: movl $7, %eax
69 ; CHECK-NEXT: movl $7, %edx
70 ; CHECK-NEXT: pcmpestri $7, %xmm1, %xmm0
71 ; CHECK-NEXT: seto %al
72 ; CHECK-NEXT: movzbl %al, %eax
7973 ; CHECK-NEXT: retl
8074 %res = call i32 @llvm.x86.sse42.pcmpestrio128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; [#uses=1]
8175 ret i32 %res
8377 declare i32 @llvm.x86.sse42.pcmpestrio128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
8478
8579
86 define i32 @test_x86_sse42_pcmpestris128(<16 x i8> %a0, <16 x i8> %a2) nounwind {
80 define i32 @test_x86_sse42_pcmpestris128(<16 x i8> %a0, <16 x i8> %a2) {
8781 ; CHECK-LABEL: test_x86_sse42_pcmpestris128:
8882 ; CHECK: ## BB#0:
89 ; CHECK-NEXT: pushl %ebx
90 ; CHECK-NEXT: movl $7, %eax
91 ; CHECK-NEXT: movl $7, %edx
92 ; CHECK-NEXT: xorl %ebx, %ebx
93 ; CHECK-NEXT: pcmpestri $7, %xmm1, %xmm0
94 ; CHECK-NEXT: sets %bl
95 ; CHECK-NEXT: movl %ebx, %eax
96 ; CHECK-NEXT: popl %ebx
83 ; CHECK-NEXT: movl $7, %eax
84 ; CHECK-NEXT: movl $7, %edx
85 ; CHECK-NEXT: pcmpestri $7, %xmm1, %xmm0
86 ; CHECK-NEXT: sets %al
87 ; CHECK-NEXT: movzbl %al, %eax
9788 ; CHECK-NEXT: retl
9889 %res = call i32 @llvm.x86.sse42.pcmpestris128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; [#uses=1]
9990 ret i32 %res
10192 declare i32 @llvm.x86.sse42.pcmpestris128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
10293
10394
104 define i32 @test_x86_sse42_pcmpestriz128(<16 x i8> %a0, <16 x i8> %a2) nounwind {
95 define i32 @test_x86_sse42_pcmpestriz128(<16 x i8> %a0, <16 x i8> %a2) {
10596 ; CHECK-LABEL: test_x86_sse42_pcmpestriz128:
10697 ; CHECK: ## BB#0:
107 ; CHECK-NEXT: pushl %ebx
108 ; CHECK-NEXT: movl $7, %eax
109 ; CHECK-NEXT: movl $7, %edx
110 ; CHECK-NEXT: xorl %ebx, %ebx
111 ; CHECK-NEXT: pcmpestri $7, %xmm1, %xmm0
112 ; CHECK-NEXT: sete %bl
113 ; CHECK-NEXT: movl %ebx, %eax
114 ; CHECK-NEXT: popl %ebx
98 ; CHECK-NEXT: movl $7, %eax
99 ; CHECK-NEXT: movl $7, %edx
100 ; CHECK-NEXT: pcmpestri $7, %xmm1, %xmm0
101 ; CHECK-NEXT: sete %al
102 ; CHECK-NEXT: movzbl %al, %eax
115103 ; CHECK-NEXT: retl
116104 %res = call i32 @llvm.x86.sse42.pcmpestriz128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; [#uses=1]
117105 ret i32 %res
177165 define i32 @test_x86_sse42_pcmpistria128(<16 x i8> %a0, <16 x i8> %a1) {
178166 ; CHECK-LABEL: test_x86_sse42_pcmpistria128:
179167 ; CHECK: ## BB#0:
180 ; CHECK-NEXT: xorl %eax, %eax
181168 ; CHECK-NEXT: pcmpistri $7, %xmm1, %xmm0
182169 ; CHECK-NEXT: seta %al
170 ; CHECK-NEXT: movzbl %al, %eax
183171 ; CHECK-NEXT: retl
184172 %res = call i32 @llvm.x86.sse42.pcmpistria128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; [#uses=1]
185173 ret i32 %res
203191 define i32 @test_x86_sse42_pcmpistrio128(<16 x i8> %a0, <16 x i8> %a1) {
204192 ; CHECK-LABEL: test_x86_sse42_pcmpistrio128:
205193 ; CHECK: ## BB#0:
206 ; CHECK-NEXT: xorl %eax, %eax
207194 ; CHECK-NEXT: pcmpistri $7, %xmm1, %xmm0
208195 ; CHECK-NEXT: seto %al
196 ; CHECK-NEXT: movzbl %al, %eax
209197 ; CHECK-NEXT: retl
210198 %res = call i32 @llvm.x86.sse42.pcmpistrio128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; [#uses=1]
211199 ret i32 %res
216204 define i32 @test_x86_sse42_pcmpistris128(<16 x i8> %a0, <16 x i8> %a1) {
217205 ; CHECK-LABEL: test_x86_sse42_pcmpistris128:
218206 ; CHECK: ## BB#0:
219 ; CHECK-NEXT: xorl %eax, %eax
220207 ; CHECK-NEXT: pcmpistri $7, %xmm1, %xmm0
221208 ; CHECK-NEXT: sets %al
209 ; CHECK-NEXT: movzbl %al, %eax
222210 ; CHECK-NEXT: retl
223211 %res = call i32 @llvm.x86.sse42.pcmpistris128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; [#uses=1]
224212 ret i32 %res
229217 define i32 @test_x86_sse42_pcmpistriz128(<16 x i8> %a0, <16 x i8> %a1) {
230218 ; CHECK-LABEL: test_x86_sse42_pcmpistriz128:
231219 ; CHECK: ## BB#0:
232 ; CHECK-NEXT: xorl %eax, %eax
233220 ; CHECK-NEXT: pcmpistri $7, %xmm1, %xmm0
234221 ; CHECK-NEXT: sete %al
222 ; CHECK-NEXT: movzbl %al, %eax
235223 ; CHECK-NEXT: retl
236224 %res = call i32 @llvm.x86.sse42.pcmpistriz128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; [#uses=1]
237225 ret i32 %res