Skip to content

Commit 6c0d5aa

Browse files
authored
[X86] ExprConstant - correctly detect __builtin_ia32_ucmpw* builtins as unsigned comparisons (#169891)
Fixes typo from #164026
1 parent 310211c commit 6c0d5aa

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clang/lib/AST/ExprConstant.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16978,7 +16978,7 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
1697816978

1697916979
bool IsUnsigned =
1698016980
(BuiltinOp >= clang::X86::BI__builtin_ia32_ucmpb128_mask &&
16981-
BuiltinOp <= clang::X86::BI__builtin_ia32_ucmpq512_mask);
16981+
BuiltinOp <= clang::X86::BI__builtin_ia32_ucmpw512_mask);
1698216982

1698316983
APValue LHS, RHS;
1698416984
APSInt Mask, Opcode;

clang/test/CodeGen/X86/avx512vlbw-builtins.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ __mmask8 test_mm_cmplt_epu16_mask(__m128i __a, __m128i __b) {
475475
// CHECK: icmp ult <8 x i16> %{{.*}}, %{{.*}}
476476
return (__mmask8)_mm_cmplt_epu16_mask(__a, __b);
477477
}
478+
TEST_CONSTEXPR(_mm_cmplt_epu16_mask(((__m128i)(__v8hu){12351, 47995, 11802, 16970, 16956, 13965, 33529, 18928}), ((__m128i)(__v8hu){48792, 59915, 50576, 62643, 3758, 16415, 7966, 39475})) == (__mmask8)0xAF);
478479

479480
__mmask8 test_mm_mask_cmplt_epu16_mask(__mmask8 __u, __m128i __a, __m128i __b) {
480481
// CHECK-LABEL: test_mm_mask_cmplt_epu16_mask

0 commit comments

Comments
 (0)