1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin9 -mcpu=knl | FileCheck %s --check-prefix=ALL_X64 --check-prefix=KNL 3 ; RUN: llc < %s -mtriple=x86_64-apple-darwin9 -mcpu=skx | FileCheck %s --check-prefix=ALL_X64 --check-prefix=SKX 4 ; RUN: llc < %s -mtriple=i686-apple-darwin9 -mcpu=knl | FileCheck %s --check-prefix=KNL_X32 5 6 define <16 x i1> @test1() { 7 ; KNL-LABEL: test1: 8 ; KNL: ## BB#0: 9 ; KNL-NEXT: vxorps %xmm0, %xmm0, %xmm0 10 ; KNL-NEXT: retq 11 ; 12 ; SKX-LABEL: test1: 13 ; SKX: ## BB#0: 14 ; SKX-NEXT: vpxord %xmm0, %xmm0, %xmm0 15 ; SKX-NEXT: retq 16 ; 17 ; KNL_X32-LABEL: test1: 18 ; KNL_X32: ## BB#0: 19 ; KNL_X32-NEXT: vxorps %xmm0, %xmm0, %xmm0 20 ; KNL_X32-NEXT: retl 21 ret <16 x i1> zeroinitializer 22 } 23 24 define <16 x i1> @test2(<16 x i1>%a, <16 x i1>%b) { 25 ; KNL-LABEL: test2: 26 ; KNL: ## BB#0: 27 ; KNL-NEXT: vpmovsxbd %xmm1, %zmm1 28 ; KNL-NEXT: vpslld $31, %zmm1, %zmm1 29 ; KNL-NEXT: vpmovsxbd %xmm0, %zmm0 30 ; KNL-NEXT: vpslld $31, %zmm0, %zmm0 31 ; KNL-NEXT: vptestmd %zmm0, %zmm0, %k1 32 ; KNL-NEXT: vptestmd %zmm1, %zmm1, %k1 {%k1} 33 ; KNL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 34 ; KNL-NEXT: vmovdqa32 %zmm0, %zmm0 {%k1} {z} 35 ; KNL-NEXT: vpmovdb %zmm0, %xmm0 36 ; KNL-NEXT: retq 37 ; 38 ; SKX-LABEL: test2: 39 ; SKX: ## BB#0: 40 ; SKX-NEXT: vpsllw $7, %xmm1, %xmm1 41 ; SKX-NEXT: vpmovb2m %xmm1, %k0 42 ; SKX-NEXT: vpsllw $7, %xmm0, %xmm0 43 ; SKX-NEXT: vpmovb2m %xmm0, %k1 44 ; SKX-NEXT: kandw %k0, %k1, %k0 45 ; SKX-NEXT: vpmovm2b %k0, %xmm0 46 ; SKX-NEXT: retq 47 ; 48 ; KNL_X32-LABEL: test2: 49 ; KNL_X32: ## BB#0: 50 ; KNL_X32-NEXT: vpmovsxbd %xmm1, %zmm1 51 ; KNL_X32-NEXT: vpslld $31, %zmm1, %zmm1 52 ; KNL_X32-NEXT: vpmovsxbd %xmm0, %zmm0 53 ; KNL_X32-NEXT: vpslld $31, %zmm0, %zmm0 54 ; KNL_X32-NEXT: vptestmd %zmm0, %zmm0, %k1 55 ; KNL_X32-NEXT: vptestmd %zmm1, %zmm1, %k1 {%k1} 56 ; KNL_X32-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 57 ; KNL_X32-NEXT: vmovdqa32 %zmm0, %zmm0 {%k1} {z} 58 ; KNL_X32-NEXT: vpmovdb %zmm0, %xmm0 59 ; KNL_X32-NEXT: retl 60 %c = and <16 x i1>%a, %b 61 ret <16 x i1> %c 62 } 63 64 define <8 x i1> @test3(<8 x i1>%a, <8 x i1>%b) { 65 ; KNL-LABEL: test3: 66 ; KNL: ## BB#0: 67 ; KNL-NEXT: vpmovsxwq %xmm1, %zmm1 68 ; KNL-NEXT: vpsllq $63, %zmm1, %zmm1 69 ; KNL-NEXT: vpmovsxwq %xmm0, %zmm0 70 ; KNL-NEXT: vpsllq $63, %zmm0, %zmm0 71 ; KNL-NEXT: vptestmq %zmm0, %zmm0, %k1 72 ; KNL-NEXT: vptestmq %zmm1, %zmm1, %k1 {%k1} 73 ; KNL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 74 ; KNL-NEXT: vmovdqa64 %zmm0, %zmm0 {%k1} {z} 75 ; KNL-NEXT: vpmovqw %zmm0, %xmm0 76 ; KNL-NEXT: retq 77 ; 78 ; SKX-LABEL: test3: 79 ; SKX: ## BB#0: 80 ; SKX-NEXT: vpsllw $15, %xmm1, %xmm1 81 ; SKX-NEXT: vpmovw2m %xmm1, %k0 82 ; SKX-NEXT: vpsllw $15, %xmm0, %xmm0 83 ; SKX-NEXT: vpmovw2m %xmm0, %k1 84 ; SKX-NEXT: kandb %k0, %k1, %k0 85 ; SKX-NEXT: vpmovm2w %k0, %xmm0 86 ; SKX-NEXT: retq 87 ; 88 ; KNL_X32-LABEL: test3: 89 ; KNL_X32: ## BB#0: 90 ; KNL_X32-NEXT: vpmovsxwq %xmm1, %zmm1 91 ; KNL_X32-NEXT: vmovdqa64 {{.*#+}} zmm2 = [63,0,63,0,63,0,63,0,63,0,63,0,63,0,63,0] 92 ; KNL_X32-NEXT: vpsllvq %zmm2, %zmm1, %zmm1 93 ; KNL_X32-NEXT: vpmovsxwq %xmm0, %zmm0 94 ; KNL_X32-NEXT: vpsllvq %zmm2, %zmm0, %zmm0 95 ; KNL_X32-NEXT: vptestmq %zmm0, %zmm0, %k1 96 ; KNL_X32-NEXT: vptestmq %zmm1, %zmm1, %k1 {%k1} 97 ; KNL_X32-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 98 ; KNL_X32-NEXT: vmovdqa64 %zmm0, %zmm0 {%k1} {z} 99 ; KNL_X32-NEXT: vpmovqw %zmm0, %xmm0 100 ; KNL_X32-NEXT: retl 101 %c = and <8 x i1>%a, %b 102 ret <8 x i1> %c 103 } 104 105 define <4 x i1> @test4(<4 x i1>%a, <4 x i1>%b) { 106 ; KNL-LABEL: test4: 107 ; KNL: ## BB#0: 108 ; KNL-NEXT: vandps %xmm1, %xmm0, %xmm0 109 ; KNL-NEXT: retq 110 ; 111 ; SKX-LABEL: test4: 112 ; SKX: ## BB#0: 113 ; SKX-NEXT: vpslld $31, %xmm1, %xmm1 114 ; SKX-NEXT: vpslld $31, %xmm0, %xmm0 115 ; SKX-NEXT: vptestmd %xmm0, %xmm0, %k1 116 ; SKX-NEXT: vptestmd %xmm1, %xmm1, %k0 {%k1} 117 ; SKX-NEXT: vpmovm2d %k0, %xmm0 118 ; SKX-NEXT: retq 119 ; 120 ; KNL_X32-LABEL: test4: 121 ; KNL_X32: ## BB#0: 122 ; KNL_X32-NEXT: vandps %xmm1, %xmm0, %xmm0 123 ; KNL_X32-NEXT: retl 124 %c = and <4 x i1>%a, %b 125 ret <4 x i1> %c 126 } 127 128 declare <8 x i1> @func8xi1(<8 x i1> %a) 129 130 define <8 x i32> @test5(<8 x i32>%a, <8 x i32>%b) { 131 ; KNL-LABEL: test5: 132 ; KNL: ## BB#0: 133 ; KNL-NEXT: pushq %rax 134 ; KNL-NEXT: Ltmp0: 135 ; KNL-NEXT: .cfi_def_cfa_offset 16 136 ; KNL-NEXT: vpcmpgtd %ymm1, %ymm0, %ymm0 137 ; KNL-NEXT: vpmovdw %zmm0, %ymm0 138 ; KNL-NEXT: ## kill: %XMM0<def> %XMM0<kill> %YMM0<kill> 139 ; KNL-NEXT: callq _func8xi1 140 ; KNL-NEXT: vpmovzxwd {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero 141 ; KNL-NEXT: vpslld $31, %ymm0, %ymm0 142 ; KNL-NEXT: vpsrad $31, %ymm0, %ymm0 143 ; KNL-NEXT: popq %rax 144 ; KNL-NEXT: retq 145 ; 146 ; SKX-LABEL: test5: 147 ; SKX: ## BB#0: 148 ; SKX-NEXT: pushq %rax 149 ; SKX-NEXT: Ltmp0: 150 ; SKX-NEXT: .cfi_def_cfa_offset 16 151 ; SKX-NEXT: vpcmpgtd %ymm1, %ymm0, %k0 152 ; SKX-NEXT: vpmovm2w %k0, %xmm0 153 ; SKX-NEXT: callq _func8xi1 154 ; SKX-NEXT: vpmovzxwd {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero 155 ; SKX-NEXT: vpslld $31, %ymm0, %ymm0 156 ; SKX-NEXT: vpsrad $31, %ymm0, %ymm0 157 ; SKX-NEXT: popq %rax 158 ; SKX-NEXT: retq 159 ; 160 ; KNL_X32-LABEL: test5: 161 ; KNL_X32: ## BB#0: 162 ; KNL_X32-NEXT: subl $12, %esp 163 ; KNL_X32-NEXT: Ltmp0: 164 ; KNL_X32-NEXT: .cfi_def_cfa_offset 16 165 ; KNL_X32-NEXT: vpcmpgtd %ymm1, %ymm0, %ymm0 166 ; KNL_X32-NEXT: vpmovdw %zmm0, %ymm0 167 ; KNL_X32-NEXT: ## kill: %XMM0<def> %XMM0<kill> %YMM0<kill> 168 ; KNL_X32-NEXT: calll _func8xi1 169 ; KNL_X32-NEXT: vpmovzxwd {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero 170 ; KNL_X32-NEXT: vpslld $31, %ymm0, %ymm0 171 ; KNL_X32-NEXT: vpsrad $31, %ymm0, %ymm0 172 ; KNL_X32-NEXT: addl $12, %esp 173 ; KNL_X32-NEXT: retl 174 %cmpRes = icmp sgt <8 x i32>%a, %b 175 %resi = call <8 x i1> @func8xi1(<8 x i1> %cmpRes) 176 %res = sext <8 x i1>%resi to <8 x i32> 177 ret <8 x i32> %res 178 } 179 180 declare <16 x i1> @func16xi1(<16 x i1> %a) 181 182 define <16 x i32> @test6(<16 x i32>%a, <16 x i32>%b) { 183 ; KNL-LABEL: test6: 184 ; KNL: ## BB#0: 185 ; KNL-NEXT: pushq %rax 186 ; KNL-NEXT: Ltmp1: 187 ; KNL-NEXT: .cfi_def_cfa_offset 16 188 ; KNL-NEXT: vpcmpgtd %zmm1, %zmm0, %k1 189 ; KNL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 190 ; KNL-NEXT: vmovdqa32 %zmm0, %zmm0 {%k1} {z} 191 ; KNL-NEXT: vpmovdb %zmm0, %xmm0 192 ; KNL-NEXT: callq _func16xi1 193 ; KNL-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero 194 ; KNL-NEXT: vpslld $31, %zmm0, %zmm0 195 ; KNL-NEXT: vpsrad $31, %zmm0, %zmm0 196 ; KNL-NEXT: popq %rax 197 ; KNL-NEXT: retq 198 ; 199 ; SKX-LABEL: test6: 200 ; SKX: ## BB#0: 201 ; SKX-NEXT: pushq %rax 202 ; SKX-NEXT: Ltmp1: 203 ; SKX-NEXT: .cfi_def_cfa_offset 16 204 ; SKX-NEXT: vpcmpgtd %zmm1, %zmm0, %k0 205 ; SKX-NEXT: vpmovm2b %k0, %xmm0 206 ; SKX-NEXT: callq _func16xi1 207 ; SKX-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero 208 ; SKX-NEXT: vpslld $31, %zmm0, %zmm0 209 ; SKX-NEXT: vpsrad $31, %zmm0, %zmm0 210 ; SKX-NEXT: popq %rax 211 ; SKX-NEXT: retq 212 ; 213 ; KNL_X32-LABEL: test6: 214 ; KNL_X32: ## BB#0: 215 ; KNL_X32-NEXT: subl $12, %esp 216 ; KNL_X32-NEXT: Ltmp1: 217 ; KNL_X32-NEXT: .cfi_def_cfa_offset 16 218 ; KNL_X32-NEXT: vpcmpgtd %zmm1, %zmm0, %k1 219 ; KNL_X32-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 220 ; KNL_X32-NEXT: vmovdqa32 %zmm0, %zmm0 {%k1} {z} 221 ; KNL_X32-NEXT: vpmovdb %zmm0, %xmm0 222 ; KNL_X32-NEXT: calll _func16xi1 223 ; KNL_X32-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero 224 ; KNL_X32-NEXT: vpslld $31, %zmm0, %zmm0 225 ; KNL_X32-NEXT: vpsrad $31, %zmm0, %zmm0 226 ; KNL_X32-NEXT: addl $12, %esp 227 ; KNL_X32-NEXT: retl 228 %cmpRes = icmp sgt <16 x i32>%a, %b 229 %resi = call <16 x i1> @func16xi1(<16 x i1> %cmpRes) 230 %res = sext <16 x i1>%resi to <16 x i32> 231 ret <16 x i32> %res 232 } 233 234 declare <4 x i1> @func4xi1(<4 x i1> %a) 235 236 define <4 x i32> @test7(<4 x i32>%a, <4 x i32>%b) { 237 ; KNL-LABEL: test7: 238 ; KNL: ## BB#0: 239 ; KNL-NEXT: pushq %rax 240 ; KNL-NEXT: Ltmp2: 241 ; KNL-NEXT: .cfi_def_cfa_offset 16 242 ; KNL-NEXT: vpcmpgtd %xmm1, %xmm0, %xmm0 243 ; KNL-NEXT: callq _func4xi1 244 ; KNL-NEXT: vpslld $31, %xmm0, %xmm0 245 ; KNL-NEXT: vpsrad $31, %xmm0, %xmm0 246 ; KNL-NEXT: popq %rax 247 ; KNL-NEXT: retq 248 ; 249 ; SKX-LABEL: test7: 250 ; SKX: ## BB#0: 251 ; SKX-NEXT: pushq %rax 252 ; SKX-NEXT: Ltmp2: 253 ; SKX-NEXT: .cfi_def_cfa_offset 16 254 ; SKX-NEXT: vpcmpgtd %xmm1, %xmm0, %k0 255 ; SKX-NEXT: vpmovm2d %k0, %xmm0 256 ; SKX-NEXT: callq _func4xi1 257 ; SKX-NEXT: vpslld $31, %xmm0, %xmm0 258 ; SKX-NEXT: vpsrad $31, %xmm0, %xmm0 259 ; SKX-NEXT: popq %rax 260 ; SKX-NEXT: retq 261 ; 262 ; KNL_X32-LABEL: test7: 263 ; KNL_X32: ## BB#0: 264 ; KNL_X32-NEXT: subl $12, %esp 265 ; KNL_X32-NEXT: Ltmp2: 266 ; KNL_X32-NEXT: .cfi_def_cfa_offset 16 267 ; KNL_X32-NEXT: vpcmpgtd %xmm1, %xmm0, %xmm0 268 ; KNL_X32-NEXT: calll _func4xi1 269 ; KNL_X32-NEXT: vpslld $31, %xmm0, %xmm0 270 ; KNL_X32-NEXT: vpsrad $31, %xmm0, %xmm0 271 ; KNL_X32-NEXT: addl $12, %esp 272 ; KNL_X32-NEXT: retl 273 %cmpRes = icmp sgt <4 x i32>%a, %b 274 %resi = call <4 x i1> @func4xi1(<4 x i1> %cmpRes) 275 %res = sext <4 x i1>%resi to <4 x i32> 276 ret <4 x i32> %res 277 } 278 279 define <8 x i1> @test7a(<8 x i32>%a, <8 x i32>%b) { 280 ; KNL-LABEL: test7a: 281 ; KNL: ## BB#0: 282 ; KNL-NEXT: pushq %rax 283 ; KNL-NEXT: Ltmp3: 284 ; KNL-NEXT: .cfi_def_cfa_offset 16 285 ; KNL-NEXT: vpcmpgtd %ymm1, %ymm0, %ymm0 286 ; KNL-NEXT: vpmovdw %zmm0, %ymm0 287 ; KNL-NEXT: ## kill: %XMM0<def> %XMM0<kill> %YMM0<kill> 288 ; KNL-NEXT: callq _func8xi1 289 ; KNL-NEXT: vpmovsxwq %xmm0, %zmm0 290 ; KNL-NEXT: vpsllq $63, %zmm0, %zmm0 291 ; KNL-NEXT: movb $85, %al 292 ; KNL-NEXT: kmovw %eax, %k1 293 ; KNL-NEXT: vptestmq %zmm0, %zmm0, %k1 {%k1} 294 ; KNL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 295 ; KNL-NEXT: vmovdqa64 %zmm0, %zmm0 {%k1} {z} 296 ; KNL-NEXT: vpmovqw %zmm0, %xmm0 297 ; KNL-NEXT: popq %rax 298 ; KNL-NEXT: retq 299 ; 300 ; SKX-LABEL: test7a: 301 ; SKX: ## BB#0: 302 ; SKX-NEXT: pushq %rax 303 ; SKX-NEXT: Ltmp3: 304 ; SKX-NEXT: .cfi_def_cfa_offset 16 305 ; SKX-NEXT: vpcmpgtd %ymm1, %ymm0, %k0 306 ; SKX-NEXT: vpmovm2w %k0, %xmm0 307 ; SKX-NEXT: callq _func8xi1 308 ; SKX-NEXT: vpsllw $15, %xmm0, %xmm0 309 ; SKX-NEXT: vpmovw2m %xmm0, %k0 310 ; SKX-NEXT: movb $85, %al 311 ; SKX-NEXT: kmovb %eax, %k1 312 ; SKX-NEXT: kandb %k1, %k0, %k0 313 ; SKX-NEXT: vpmovm2w %k0, %xmm0 314 ; SKX-NEXT: popq %rax 315 ; SKX-NEXT: retq 316 ; 317 ; KNL_X32-LABEL: test7a: 318 ; KNL_X32: ## BB#0: 319 ; KNL_X32-NEXT: subl $12, %esp 320 ; KNL_X32-NEXT: Ltmp3: 321 ; KNL_X32-NEXT: .cfi_def_cfa_offset 16 322 ; KNL_X32-NEXT: vpcmpgtd %ymm1, %ymm0, %ymm0 323 ; KNL_X32-NEXT: vpmovdw %zmm0, %ymm0 324 ; KNL_X32-NEXT: ## kill: %XMM0<def> %XMM0<kill> %YMM0<kill> 325 ; KNL_X32-NEXT: calll _func8xi1 326 ; KNL_X32-NEXT: vpmovsxwq %xmm0, %zmm0 327 ; KNL_X32-NEXT: vpsllvq LCPI7_0, %zmm0, %zmm0 328 ; KNL_X32-NEXT: movb $85, %al 329 ; KNL_X32-NEXT: kmovw %eax, %k1 330 ; KNL_X32-NEXT: vptestmq %zmm0, %zmm0, %k1 {%k1} 331 ; KNL_X32-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 332 ; KNL_X32-NEXT: vmovdqa64 %zmm0, %zmm0 {%k1} {z} 333 ; KNL_X32-NEXT: vpmovqw %zmm0, %xmm0 334 ; KNL_X32-NEXT: addl $12, %esp 335 ; KNL_X32-NEXT: retl 336 %cmpRes = icmp sgt <8 x i32>%a, %b 337 %resi = call <8 x i1> @func8xi1(<8 x i1> %cmpRes) 338 %res = and <8 x i1>%resi, <i1 true, i1 false, i1 true, i1 false, i1 true, i1 false, i1 true, i1 false> 339 ret <8 x i1> %res 340 } 341 342 define <16 x i8> @test8(<16 x i8> %a1, <16 x i8> %a2, i1 %cond) { 343 ; ALL_X64-LABEL: test8: 344 ; ALL_X64: ## BB#0: 345 ; ALL_X64-NEXT: testb $1, %dil 346 ; ALL_X64-NEXT: jne LBB8_2 347 ; ALL_X64-NEXT: ## BB#1: 348 ; ALL_X64-NEXT: vmovaps %zmm1, %zmm0 349 ; ALL_X64-NEXT: LBB8_2: 350 ; ALL_X64-NEXT: retq 351 ; 352 ; KNL_X32-LABEL: test8: 353 ; KNL_X32: ## BB#0: 354 ; KNL_X32-NEXT: testb $1, {{[0-9]+}}(%esp) 355 ; KNL_X32-NEXT: jne LBB8_2 356 ; KNL_X32-NEXT: ## BB#1: 357 ; KNL_X32-NEXT: vmovaps %zmm1, %zmm0 358 ; KNL_X32-NEXT: LBB8_2: 359 ; KNL_X32-NEXT: retl 360 %res = select i1 %cond, <16 x i8> %a1, <16 x i8> %a2 361 ret <16 x i8> %res 362 } 363 364 define i1 @test9(double %a, double %b) { 365 ; ALL_X64-LABEL: test9: 366 ; ALL_X64: ## BB#0: 367 ; ALL_X64-NEXT: vucomisd %xmm0, %xmm1 368 ; ALL_X64-NEXT: setb %al 369 ; ALL_X64-NEXT: retq 370 ; 371 ; KNL_X32-LABEL: test9: 372 ; KNL_X32: ## BB#0: 373 ; KNL_X32-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero 374 ; KNL_X32-NEXT: vucomisd {{[0-9]+}}(%esp), %xmm0 375 ; KNL_X32-NEXT: setb %al 376 ; KNL_X32-NEXT: retl 377 %c = fcmp ugt double %a, %b 378 ret i1 %c 379 } 380 381 define i32 @test10(i32 %a, i32 %b, i1 %cond) { 382 ; ALL_X64-LABEL: test10: 383 ; ALL_X64: ## BB#0: 384 ; ALL_X64-NEXT: testb $1, %dl 385 ; ALL_X64-NEXT: cmovel %esi, %edi 386 ; ALL_X64-NEXT: movl %edi, %eax 387 ; ALL_X64-NEXT: retq 388 ; 389 ; KNL_X32-LABEL: test10: 390 ; KNL_X32: ## BB#0: 391 ; KNL_X32-NEXT: testb $1, {{[0-9]+}}(%esp) 392 ; KNL_X32-NEXT: leal {{[0-9]+}}(%esp), %eax 393 ; KNL_X32-NEXT: leal {{[0-9]+}}(%esp), %ecx 394 ; KNL_X32-NEXT: cmovnel %eax, %ecx 395 ; KNL_X32-NEXT: movl (%ecx), %eax 396 ; KNL_X32-NEXT: retl 397 %c = select i1 %cond, i32 %a, i32 %b 398 ret i32 %c 399 } 400 401 define i1 @test11(i32 %a, i32 %b) { 402 ; ALL_X64-LABEL: test11: 403 ; ALL_X64: ## BB#0: 404 ; ALL_X64-NEXT: cmpl %esi, %edi 405 ; ALL_X64-NEXT: setg %al 406 ; ALL_X64-NEXT: retq 407 ; 408 ; KNL_X32-LABEL: test11: 409 ; KNL_X32: ## BB#0: 410 ; KNL_X32-NEXT: movl {{[0-9]+}}(%esp), %eax 411 ; KNL_X32-NEXT: cmpl {{[0-9]+}}(%esp), %eax 412 ; KNL_X32-NEXT: setg %al 413 ; KNL_X32-NEXT: retl 414 %c = icmp sgt i32 %a, %b 415 ret i1 %c 416 } 417 418 define i32 @test12(i32 %a1, i32 %a2, i32 %b1) { 419 ; ALL_X64-LABEL: test12: 420 ; ALL_X64: ## BB#0: 421 ; ALL_X64-NEXT: pushq %rbp 422 ; ALL_X64-NEXT: Ltmp4: 423 ; ALL_X64-NEXT: .cfi_def_cfa_offset 16 424 ; ALL_X64-NEXT: pushq %r14 425 ; ALL_X64-NEXT: Ltmp5: 426 ; ALL_X64-NEXT: .cfi_def_cfa_offset 24 427 ; ALL_X64-NEXT: pushq %rbx 428 ; ALL_X64-NEXT: Ltmp6: 429 ; ALL_X64-NEXT: .cfi_def_cfa_offset 32 430 ; ALL_X64-NEXT: Ltmp7: 431 ; ALL_X64-NEXT: .cfi_offset %rbx, -32 432 ; ALL_X64-NEXT: Ltmp8: 433 ; ALL_X64-NEXT: .cfi_offset %r14, -24 434 ; ALL_X64-NEXT: Ltmp9: 435 ; ALL_X64-NEXT: .cfi_offset %rbp, -16 436 ; ALL_X64-NEXT: movl %esi, %r14d 437 ; ALL_X64-NEXT: movl %edi, %ebp 438 ; ALL_X64-NEXT: movl %edx, %esi 439 ; ALL_X64-NEXT: callq _test11 440 ; ALL_X64-NEXT: movzbl %al, %ebx 441 ; ALL_X64-NEXT: movl %ebp, %edi 442 ; ALL_X64-NEXT: movl %r14d, %esi 443 ; ALL_X64-NEXT: movl %ebx, %edx 444 ; ALL_X64-NEXT: callq _test10 445 ; ALL_X64-NEXT: xorl %ecx, %ecx 446 ; ALL_X64-NEXT: testb $1, %bl 447 ; ALL_X64-NEXT: cmovel %ecx, %eax 448 ; ALL_X64-NEXT: popq %rbx 449 ; ALL_X64-NEXT: popq %r14 450 ; ALL_X64-NEXT: popq %rbp 451 ; ALL_X64-NEXT: retq 452 ; 453 ; KNL_X32-LABEL: test12: 454 ; KNL_X32: ## BB#0: 455 ; KNL_X32-NEXT: pushl %ebx 456 ; KNL_X32-NEXT: Ltmp4: 457 ; KNL_X32-NEXT: .cfi_def_cfa_offset 8 458 ; KNL_X32-NEXT: pushl %edi 459 ; KNL_X32-NEXT: Ltmp5: 460 ; KNL_X32-NEXT: .cfi_def_cfa_offset 12 461 ; KNL_X32-NEXT: pushl %esi 462 ; KNL_X32-NEXT: Ltmp6: 463 ; KNL_X32-NEXT: .cfi_def_cfa_offset 16 464 ; KNL_X32-NEXT: subl $16, %esp 465 ; KNL_X32-NEXT: Ltmp7: 466 ; KNL_X32-NEXT: .cfi_def_cfa_offset 32 467 ; KNL_X32-NEXT: Ltmp8: 468 ; KNL_X32-NEXT: .cfi_offset %esi, -16 469 ; KNL_X32-NEXT: Ltmp9: 470 ; KNL_X32-NEXT: .cfi_offset %edi, -12 471 ; KNL_X32-NEXT: Ltmp10: 472 ; KNL_X32-NEXT: .cfi_offset %ebx, -8 473 ; KNL_X32-NEXT: movl {{[0-9]+}}(%esp), %esi 474 ; KNL_X32-NEXT: movl {{[0-9]+}}(%esp), %edi 475 ; KNL_X32-NEXT: movl {{[0-9]+}}(%esp), %eax 476 ; KNL_X32-NEXT: movl %eax, {{[0-9]+}}(%esp) 477 ; KNL_X32-NEXT: movl %edi, (%esp) 478 ; KNL_X32-NEXT: calll _test11 479 ; KNL_X32-NEXT: movl %eax, %ebx 480 ; KNL_X32-NEXT: movzbl %bl, %eax 481 ; KNL_X32-NEXT: movl %eax, {{[0-9]+}}(%esp) 482 ; KNL_X32-NEXT: movl %esi, {{[0-9]+}}(%esp) 483 ; KNL_X32-NEXT: movl %edi, (%esp) 484 ; KNL_X32-NEXT: calll _test10 485 ; KNL_X32-NEXT: xorl %ecx, %ecx 486 ; KNL_X32-NEXT: testb $1, %bl 487 ; KNL_X32-NEXT: cmovel %ecx, %eax 488 ; KNL_X32-NEXT: addl $16, %esp 489 ; KNL_X32-NEXT: popl %esi 490 ; KNL_X32-NEXT: popl %edi 491 ; KNL_X32-NEXT: popl %ebx 492 ; KNL_X32-NEXT: retl 493 %cond = call i1 @test11(i32 %a1, i32 %b1) 494 %res = call i32 @test10(i32 %a1, i32 %a2, i1 %cond) 495 %res1 = select i1 %cond, i32 %res, i32 0 496 ret i32 %res1 497 } 498