• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=x86 -mcpu=yonah -mattr=+sse2,-sse4.1 | FileCheck %s
2
3; CHECK-LABEL: vsel_float
4; CHECK-NOT: xorps
5; CHECK: movss
6; CHECK-NOT: orps
7; CHECK: ret
8define void@vsel_float(<4 x float>* %v1, <4 x float>* %v2) {
9  %A = load <4 x float>* %v1
10  %B = load <4 x float>* %v2
11  %vsel = select <4 x i1> <i1 false, i1 true, i1 true, i1 true>, <4 x float> %A, <4 x float> %B
12  store <4 x float > %vsel, <4 x float>* %v1
13  ret void
14}
15
16; CHECK-LABEL: vsel_i32
17; CHECK-NOT: xorps
18; CHECK: movss
19; CHECK-NOT: orps
20; CHECK: ret
21define void@vsel_i32(<4 x i32>* %v1, <4 x i32>* %v2) {
22  %A = load <4 x i32>* %v1
23  %B = load <4 x i32>* %v2
24  %vsel = select <4 x i1> <i1 true, i1 false, i1 false, i1 false>, <4 x i32> %A, <4 x i32> %B
25  store <4 x i32 > %vsel, <4 x i32>* %v1
26  ret void
27}
28
29; Without forcing instructions, fall back to the preferred PS domain.
30; CHECK-LABEL: vsel_i64
31; CHECK: andnps
32; CHECK: orps
33; CHECK: ret
34
35define void@vsel_i64(<2 x i64>* %v1, <2 x i64>* %v2) {
36  %A = load <2 x i64>* %v1
37  %B = load <2 x i64>* %v2
38  %vsel = select <2 x i1> <i1 true, i1 false>, <2 x i64> %A, <2 x i64> %B
39  store <2 x i64 > %vsel, <2 x i64>* %v1
40  ret void
41}
42
43; Without forcing instructions, fall back to the preferred PS domain.
44; CHECK-LABEL: vsel_double
45; CHECK: andnps
46; CHECK: orps
47; CHECK: ret
48
49define void@vsel_double(<2 x double>* %v1, <2 x double>* %v2) {
50  %A = load <2 x double>* %v1
51  %B = load <2 x double>* %v2
52  %vsel = select <2 x i1> <i1 true, i1 false>, <2 x double> %A, <2 x double> %B
53  store <2 x double > %vsel, <2 x double>* %v1
54  ret void
55}
56
57
58