1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -mcpu=yonah -mtriple=i386-apple-darwin | FileCheck %s 3 4 5define <4 x i32> @test1(<4 x i32> %A, <4 x i32> %B) nounwind { 6; CHECK-LABEL: test1: 7; CHECK: ## %bb.0: 8; CHECK-NEXT: pcmpgtd %xmm1, %xmm0 9; CHECK-NEXT: retl 10 11 %C = icmp sgt <4 x i32> %A, %B 12 %D = sext <4 x i1> %C to <4 x i32> 13 ret <4 x i32> %D 14} 15 16define <4 x i32> @test2(<4 x i32> %A, <4 x i32> %B) nounwind { 17; CHECK-LABEL: test2: 18; CHECK: ## %bb.0: 19; CHECK-NEXT: pcmpgtd %xmm0, %xmm1 20; CHECK-NEXT: pcmpeqd %xmm0, %xmm0 21; CHECK-NEXT: pxor %xmm1, %xmm0 22; CHECK-NEXT: retl 23 %C = icmp sge <4 x i32> %A, %B 24 %D = sext <4 x i1> %C to <4 x i32> 25 ret <4 x i32> %D 26} 27 28define <4 x i32> @test3(<4 x i32> %A, <4 x i32> %B) nounwind { 29; CHECK-LABEL: test3: 30; CHECK: ## %bb.0: 31; CHECK-NEXT: pcmpgtd %xmm0, %xmm1 32; CHECK-NEXT: movdqa %xmm1, %xmm0 33; CHECK-NEXT: retl 34 %C = icmp slt <4 x i32> %A, %B 35 %D = sext <4 x i1> %C to <4 x i32> 36 ret <4 x i32> %D 37} 38 39define <4 x i32> @test4(<4 x i32> %A, <4 x i32> %B) nounwind { 40; CHECK-LABEL: test4: 41; CHECK: ## %bb.0: 42; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648,2147483648,2147483648] 43; CHECK-NEXT: pxor %xmm2, %xmm1 44; CHECK-NEXT: pxor %xmm2, %xmm0 45; CHECK-NEXT: pcmpgtd %xmm1, %xmm0 46; CHECK-NEXT: retl 47 %C = icmp ugt <4 x i32> %A, %B 48 %D = sext <4 x i1> %C to <4 x i32> 49 ret <4 x i32> %D 50} 51 52define <2 x i64> @test5(<2 x i64> %A, <2 x i64> %B) nounwind { 53; CHECK-LABEL: test5: 54; CHECK: ## %bb.0: 55; CHECK-NEXT: pcmpeqd %xmm1, %xmm0 56; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2] 57; CHECK-NEXT: pand %xmm1, %xmm0 58; CHECK-NEXT: retl 59 %C = icmp eq <2 x i64> %A, %B 60 %D = sext <2 x i1> %C to <2 x i64> 61 ret <2 x i64> %D 62} 63 64define <2 x i64> @test6(<2 x i64> %A, <2 x i64> %B) nounwind { 65; CHECK-LABEL: test6: 66; CHECK: ## %bb.0: 67; CHECK-NEXT: pcmpeqd %xmm1, %xmm0 68; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2] 69; CHECK-NEXT: pand %xmm1, %xmm0 70; CHECK-NEXT: pcmpeqd %xmm1, %xmm1 71; CHECK-NEXT: pxor %xmm1, %xmm0 72; CHECK-NEXT: retl 73 %C = icmp ne <2 x i64> %A, %B 74 %D = sext <2 x i1> %C to <2 x i64> 75 ret <2 x i64> %D 76} 77 78define <2 x i64> @test7(<2 x i64> %A, <2 x i64> %B) nounwind { 79; CHECK-LABEL: test7: 80; CHECK: ## %bb.0: 81; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,0,2147483648,0] 82; CHECK-NEXT: pxor %xmm2, %xmm1 83; CHECK-NEXT: pxor %xmm2, %xmm0 84; CHECK-NEXT: movdqa %xmm0, %xmm2 85; CHECK-NEXT: pcmpgtd %xmm1, %xmm2 86; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2] 87; CHECK-NEXT: pcmpeqd %xmm1, %xmm0 88; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3] 89; CHECK-NEXT: pand %xmm3, %xmm1 90; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm2[1,1,3,3] 91; CHECK-NEXT: por %xmm1, %xmm0 92; CHECK-NEXT: retl 93 %C = icmp sgt <2 x i64> %A, %B 94 %D = sext <2 x i1> %C to <2 x i64> 95 ret <2 x i64> %D 96} 97 98define <2 x i64> @test8(<2 x i64> %A, <2 x i64> %B) nounwind { 99; CHECK-LABEL: test8: 100; CHECK: ## %bb.0: 101; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,0,2147483648,0] 102; CHECK-NEXT: pxor %xmm2, %xmm0 103; CHECK-NEXT: pxor %xmm2, %xmm1 104; CHECK-NEXT: movdqa %xmm1, %xmm2 105; CHECK-NEXT: pcmpgtd %xmm0, %xmm2 106; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2] 107; CHECK-NEXT: pcmpeqd %xmm0, %xmm1 108; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3] 109; CHECK-NEXT: pand %xmm3, %xmm1 110; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm2[1,1,3,3] 111; CHECK-NEXT: por %xmm1, %xmm0 112; CHECK-NEXT: retl 113 %C = icmp slt <2 x i64> %A, %B 114 %D = sext <2 x i1> %C to <2 x i64> 115 ret <2 x i64> %D 116} 117 118define <2 x i64> @test9(<2 x i64> %A, <2 x i64> %B) nounwind { 119; CHECK-LABEL: test9: 120; CHECK: ## %bb.0: 121; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,0,2147483648,0] 122; CHECK-NEXT: pxor %xmm2, %xmm0 123; CHECK-NEXT: pxor %xmm2, %xmm1 124; CHECK-NEXT: movdqa %xmm1, %xmm2 125; CHECK-NEXT: pcmpgtd %xmm0, %xmm2 126; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2] 127; CHECK-NEXT: pcmpeqd %xmm0, %xmm1 128; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,3,3] 129; CHECK-NEXT: pand %xmm3, %xmm0 130; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm2[1,1,3,3] 131; CHECK-NEXT: por %xmm0, %xmm1 132; CHECK-NEXT: pcmpeqd %xmm0, %xmm0 133; CHECK-NEXT: pxor %xmm1, %xmm0 134; CHECK-NEXT: retl 135 %C = icmp sge <2 x i64> %A, %B 136 %D = sext <2 x i1> %C to <2 x i64> 137 ret <2 x i64> %D 138} 139 140define <2 x i64> @test10(<2 x i64> %A, <2 x i64> %B) nounwind { 141; CHECK-LABEL: test10: 142; CHECK: ## %bb.0: 143; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,0,2147483648,0] 144; CHECK-NEXT: pxor %xmm2, %xmm1 145; CHECK-NEXT: pxor %xmm2, %xmm0 146; CHECK-NEXT: movdqa %xmm0, %xmm2 147; CHECK-NEXT: pcmpgtd %xmm1, %xmm2 148; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2] 149; CHECK-NEXT: pcmpeqd %xmm1, %xmm0 150; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3] 151; CHECK-NEXT: pand %xmm3, %xmm0 152; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm2[1,1,3,3] 153; CHECK-NEXT: por %xmm0, %xmm1 154; CHECK-NEXT: pcmpeqd %xmm0, %xmm0 155; CHECK-NEXT: pxor %xmm1, %xmm0 156; CHECK-NEXT: retl 157 %C = icmp sle <2 x i64> %A, %B 158 %D = sext <2 x i1> %C to <2 x i64> 159 ret <2 x i64> %D 160} 161 162define <2 x i64> @test11(<2 x i64> %A, <2 x i64> %B) nounwind { 163; CHECK-LABEL: test11: 164; CHECK: ## %bb.0: 165; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648,2147483648,2147483648] 166; CHECK-NEXT: pxor %xmm2, %xmm1 167; CHECK-NEXT: pxor %xmm2, %xmm0 168; CHECK-NEXT: movdqa %xmm0, %xmm2 169; CHECK-NEXT: pcmpgtd %xmm1, %xmm2 170; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2] 171; CHECK-NEXT: pcmpeqd %xmm1, %xmm0 172; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3] 173; CHECK-NEXT: pand %xmm3, %xmm1 174; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm2[1,1,3,3] 175; CHECK-NEXT: por %xmm1, %xmm0 176; CHECK-NEXT: retl 177 %C = icmp ugt <2 x i64> %A, %B 178 %D = sext <2 x i1> %C to <2 x i64> 179 ret <2 x i64> %D 180} 181 182define <2 x i64> @test12(<2 x i64> %A, <2 x i64> %B) nounwind { 183; CHECK-LABEL: test12: 184; CHECK: ## %bb.0: 185; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648,2147483648,2147483648] 186; CHECK-NEXT: pxor %xmm2, %xmm0 187; CHECK-NEXT: pxor %xmm2, %xmm1 188; CHECK-NEXT: movdqa %xmm1, %xmm2 189; CHECK-NEXT: pcmpgtd %xmm0, %xmm2 190; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2] 191; CHECK-NEXT: pcmpeqd %xmm0, %xmm1 192; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3] 193; CHECK-NEXT: pand %xmm3, %xmm1 194; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm2[1,1,3,3] 195; CHECK-NEXT: por %xmm1, %xmm0 196; CHECK-NEXT: retl 197 %C = icmp ult <2 x i64> %A, %B 198 %D = sext <2 x i1> %C to <2 x i64> 199 ret <2 x i64> %D 200} 201 202define <2 x i64> @test13(<2 x i64> %A, <2 x i64> %B) nounwind { 203; CHECK-LABEL: test13: 204; CHECK: ## %bb.0: 205; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648,2147483648,2147483648] 206; CHECK-NEXT: pxor %xmm2, %xmm0 207; CHECK-NEXT: pxor %xmm2, %xmm1 208; CHECK-NEXT: movdqa %xmm1, %xmm2 209; CHECK-NEXT: pcmpgtd %xmm0, %xmm2 210; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2] 211; CHECK-NEXT: pcmpeqd %xmm0, %xmm1 212; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,3,3] 213; CHECK-NEXT: pand %xmm3, %xmm0 214; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm2[1,1,3,3] 215; CHECK-NEXT: por %xmm0, %xmm1 216; CHECK-NEXT: pcmpeqd %xmm0, %xmm0 217; CHECK-NEXT: pxor %xmm1, %xmm0 218; CHECK-NEXT: retl 219 %C = icmp uge <2 x i64> %A, %B 220 %D = sext <2 x i1> %C to <2 x i64> 221 ret <2 x i64> %D 222} 223 224define <2 x i64> @test14(<2 x i64> %A, <2 x i64> %B) nounwind { 225; CHECK-LABEL: test14: 226; CHECK: ## %bb.0: 227; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648,2147483648,2147483648] 228; CHECK-NEXT: pxor %xmm2, %xmm1 229; CHECK-NEXT: pxor %xmm2, %xmm0 230; CHECK-NEXT: movdqa %xmm0, %xmm2 231; CHECK-NEXT: pcmpgtd %xmm1, %xmm2 232; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2] 233; CHECK-NEXT: pcmpeqd %xmm1, %xmm0 234; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3] 235; CHECK-NEXT: pand %xmm3, %xmm0 236; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm2[1,1,3,3] 237; CHECK-NEXT: por %xmm0, %xmm1 238; CHECK-NEXT: pcmpeqd %xmm0, %xmm0 239; CHECK-NEXT: pxor %xmm1, %xmm0 240; CHECK-NEXT: retl 241 %C = icmp ule <2 x i64> %A, %B 242 %D = sext <2 x i1> %C to <2 x i64> 243 ret <2 x i64> %D 244} 245