1 ; This file checks support for comparing vector values with the fcmp
4 ; RUN: %p2i -i %s --filetype=obj --disassemble -a -O2 | FileCheck %s
5 ; RUN: %p2i -i %s --filetype=obj --disassemble -a -Om1 | FileCheck %s
7 ; Check that sext elimination occurs when the result of the comparison
8 ; instruction is alrady sign extended. Sign extension to 4 x i32 uses
9 ; the pslld instruction.
10 define <4 x i32> @sextElimination(<4 x float> %a, <4 x float> %b) {
12 %res.trunc = fcmp oeq <4 x float> %a, %b
13 %res = sext <4 x i1> %res.trunc to <4 x i32>
15 ; CHECK-LABEL: sextElimination
20 define <4 x i32> @fcmpFalseVector(<4 x float> %a, <4 x float> %b) {
22 %res.trunc = fcmp false <4 x float> %a, %b
23 %res = sext <4 x i1> %res.trunc to <4 x i32>
25 ; CHECK-LABEL: fcmpFalseVector
29 define <4 x i32> @fcmpOeqVector(<4 x float> %a, <4 x float> %b) {
31 %res.trunc = fcmp oeq <4 x float> %a, %b
32 %res = sext <4 x i1> %res.trunc to <4 x i32>
34 ; CHECK-LABEL: fcmpOeqVector
38 define <4 x i32> @fcmpOgeVector(<4 x float> %a, <4 x float> %b) {
40 %res.trunc = fcmp oge <4 x float> %a, %b
41 %res = sext <4 x i1> %res.trunc to <4 x i32>
43 ; CHECK-LABEL: fcmpOgeVector
47 define <4 x i32> @fcmpOgtVector(<4 x float> %a, <4 x float> %b) {
49 %res.trunc = fcmp ogt <4 x float> %a, %b
50 %res = sext <4 x i1> %res.trunc to <4 x i32>
52 ; CHECK-LABEL: fcmpOgtVector
56 define <4 x i32> @fcmpOleVector(<4 x float> %a, <4 x float> %b) {
58 %res.trunc = fcmp ole <4 x float> %a, %b
59 %res = sext <4 x i1> %res.trunc to <4 x i32>
61 ; CHECK-LABEL: fcmpOleVector
65 define <4 x i32> @fcmpOltVector(<4 x float> %a, <4 x float> %b) {
67 %res.trunc = fcmp olt <4 x float> %a, %b
68 %res = sext <4 x i1> %res.trunc to <4 x i32>
70 ; CHECK-LABEL: fcmpOltVector
74 define <4 x i32> @fcmpOneVector(<4 x float> %a, <4 x float> %b) {
76 %res.trunc = fcmp one <4 x float> %a, %b
77 %res = sext <4 x i1> %res.trunc to <4 x i32>
79 ; CHECK-LABEL: fcmpOneVector
85 define <4 x i32> @fcmpOrdVector(<4 x float> %a, <4 x float> %b) {
87 %res.trunc = fcmp ord <4 x float> %a, %b
88 %res = sext <4 x i1> %res.trunc to <4 x i32>
90 ; CHECK-LABEL: fcmpOrdVector
94 define <4 x i32> @fcmpTrueVector(<4 x float> %a, <4 x float> %b) {
96 %res.trunc = fcmp true <4 x float> %a, %b
97 %res = sext <4 x i1> %res.trunc to <4 x i32>
99 ; CHECK-LABEL: fcmpTrueVector
103 define <4 x i32> @fcmpUeqVector(<4 x float> %a, <4 x float> %b) {
105 %res.trunc = fcmp ueq <4 x float> %a, %b
106 %res = sext <4 x i1> %res.trunc to <4 x i32>
108 ; CHECK-LABEL: fcmpUeqVector
114 define <4 x i32> @fcmpUgeVector(<4 x float> %a, <4 x float> %b) {
116 %res.trunc = fcmp uge <4 x float> %a, %b
117 %res = sext <4 x i1> %res.trunc to <4 x i32>
119 ; CHECK-LABEL: fcmpUgeVector
123 define <4 x i32> @fcmpUgtVector(<4 x float> %a, <4 x float> %b) {
125 %res.trunc = fcmp ugt <4 x float> %a, %b
126 %res = sext <4 x i1> %res.trunc to <4 x i32>
128 ; CHECK-LABEL: fcmpUgtVector
132 define <4 x i32> @fcmpUleVector(<4 x float> %a, <4 x float> %b) {
134 %res.trunc = fcmp ule <4 x float> %a, %b
135 %res = sext <4 x i1> %res.trunc to <4 x i32>
137 ; CHECK-LABEL: fcmpUleVector
141 define <4 x i32> @fcmpUltVector(<4 x float> %a, <4 x float> %b) {
143 %res.trunc = fcmp ult <4 x float> %a, %b
144 %res = sext <4 x i1> %res.trunc to <4 x i32>
146 ; CHECK-LABEL: fcmpUltVector
150 define <4 x i32> @fcmpUneVector(<4 x float> %a, <4 x float> %b) {
152 %res.trunc = fcmp une <4 x float> %a, %b
153 %res = sext <4 x i1> %res.trunc to <4 x i32>
155 ; CHECK-LABEL: fcmpUneVector
159 define <4 x i32> @fcmpUnoVector(<4 x float> %a, <4 x float> %b) {
161 %res.trunc = fcmp uno <4 x float> %a, %b
162 %res = sext <4 x i1> %res.trunc to <4 x i32>
164 ; CHECK-LABEL: fcmpUnoVector