@@ -53,3 +53,54 @@ __m128d test_cmpnlepd(__m128d A, __m128d B) {
5353 // OG-NEXT: ret <2 x double> [[CAST]]
5454 return __builtin_ia32_cmpnlepd (A , B );
5555}
56+
57+
58+ __m128 test_cmpnltps (__m128 A , __m128 B ) {
59+
60+ // CIR-LABEL: @test_cmpnltps
61+ // CIR: [[CMP:%.*]] = cir.vec.cmp(lt, [[A:%.*]], [[B:%.*]]) : !cir.vector<!cir.float x 4>, !cir.vector<!s32i x 4>
62+ // CIR: [[NOTCMP:%.*]] = cir.unary(not, [[CMP]]) : !cir.vector<!s32i x 4>, !cir.vector<!s32i x 4>
63+ // CIR-NEXT: [[CAST:%.*]] = cir.cast(bitcast, [[NOTCMP:%.*]] : !cir.vector<!s32i x 4>), !cir.vector<!cir.float x 4>
64+ // CIR-NEXT: cir.store [[CAST]], [[ALLOCA:%.*]] : !cir.vector<!cir.float x 4>, !cir.ptr<!cir.vector<!cir.float x 4>>
65+ // CIR-NEXT: [[LD:%.*]] = cir.load [[ALLOCA]] :
66+ // CIR-NEXT: cir.return [[LD]] : !cir.vector<!cir.float x 4>
67+
68+ // LLVM-LABEL: test_cmpnltps
69+ // LLVM: [[CMP:%.*]] = fcmp uge <4 x float> {{.*}}, {{.*}}
70+ // LLVM-NEXT: [[SEXT:%.*]] = sext <4 x i1> [[CMP]] to <4 x i32>
71+ // LLVM-NEXT: [[CAST:%.*]] = bitcast <4 x i32> [[SEXT]] to <4 x float>
72+ // LLVM-NEXT: ret <4 x float> [[CAST]]
73+
74+ // OG-LABEL: test_cmpnltps
75+ // OG: [[CMP:%.*]] = fcmp uge <4 x float> {{.*}}, {{.*}}
76+ // OG-NEXT: [[SEXT:%.*]] = sext <4 x i1> [[CMP]] to <4 x i32>
77+ // OG-NEXT: [[CAST:%.*]] = bitcast <4 x i32> [[SEXT]] to <4 x float>
78+ // OG-NEXT: ret <4 x float> [[CAST]]
79+ return __builtin_ia32_cmpnltps (A , B );
80+ }
81+
82+
83+ __m128d test_cmpnltpd (__m128d A , __m128d B ) {
84+
85+ // CIR-LABEL: @test_cmpnltpd
86+ // CIR: [[CMP:%.*]] = cir.vec.cmp(lt, [[A:%.*]], [[B:%.*]]) : !cir.vector<!cir.double x 2>, !cir.vector<!s64i x 2>
87+ // CIR-NEXT: [[NOTCMP:%.*]] = cir.unary(not, [[CMP]]) : !cir.vector<!s64i x 2>, !cir.vector<!s64i x 2>
88+ // CIR-NEXT: [[CAST:%.*]] = cir.cast(bitcast, [[NOTCMP]] : !cir.vector<!s64i x 2>), !cir.vector<!cir.double x 2>
89+ // CIR-NEXT: cir.store [[CAST]], [[ALLOCA:%.*]] : !cir.vector<!cir.double x 2>, !cir.ptr<!cir.vector<!cir.double x 2>>
90+ // CIR-NEXT: [[LD:%.*]] = cir.load [[ALLOCA]] :
91+ // CIR-NEXT: cir.return [[LD]] : !cir.vector<!cir.double x 2>
92+
93+ // LLVM-LABEL: test_cmpnltpd
94+ // LLVM: [[CMP:%.*]] = fcmp uge <2 x double> {{.*}}, {{.*}}
95+ // LLVM-NEXT: [[SEXT:%.*]] = sext <2 x i1> [[CMP]] to <2 x i64>
96+ // LLVM-NEXT: [[CAST:%.*]] = bitcast <2 x i64> [[SEXT]] to <2 x double>
97+ // LLVM-NEXT: ret <2 x double> [[CAST]]
98+
99+ // OG-LABEL: test_cmpnltpd
100+ // OG: [[CMP:%.*]] = fcmp uge <2 x double> {{.*}}, {{.*}}
101+ // OG-NEXT: [[SEXT:%.*]] = sext <2 x i1> [[CMP]] to <2 x i64>
102+ // OG-NEXT: [[CAST:%.*]] = bitcast <2 x i64> [[SEXT]] to <2 x double>
103+ // OG-NEXT: ret <2 x double> [[CAST]]
104+ return __builtin_ia32_cmpnltpd (A , B );
105+ }
106+
0 commit comments