[clang] 6c0d5aa - [X86] ExprConstant - correctly detect __builtin_ia32_ucmpw* builtins as unsigned comparisons (#169891)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 28 02:37:02 PST 2025
Author: Simon Pilgrim
Date: 2025-11-28T10:36:58Z
New Revision: 6c0d5aad7fa8756221a415fc3bf2bb6c7bf974f6
URL: https://github.com/llvm/llvm-project/commit/6c0d5aad7fa8756221a415fc3bf2bb6c7bf974f6
DIFF: https://github.com/llvm/llvm-project/commit/6c0d5aad7fa8756221a415fc3bf2bb6c7bf974f6.diff
LOG: [X86] ExprConstant - correctly detect __builtin_ia32_ucmpw* builtins as unsigned comparisons (#169891)
Fixes typo from #164026
Added:
Modified:
clang/lib/AST/ExprConstant.cpp
clang/test/CodeGen/X86/avx512vlbw-builtins.c
Removed:
################################################################################
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index cab17ecdc7b29..b986ee6ca4fa3 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -16978,7 +16978,7 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
bool IsUnsigned =
(BuiltinOp >= clang::X86::BI__builtin_ia32_ucmpb128_mask &&
- BuiltinOp <= clang::X86::BI__builtin_ia32_ucmpq512_mask);
+ BuiltinOp <= clang::X86::BI__builtin_ia32_ucmpw512_mask);
APValue LHS, RHS;
APSInt Mask, Opcode;
diff --git a/clang/test/CodeGen/X86/avx512vlbw-builtins.c b/clang/test/CodeGen/X86/avx512vlbw-builtins.c
index 16e113031bfda..f6f27d9c3da3d 100644
--- a/clang/test/CodeGen/X86/avx512vlbw-builtins.c
+++ b/clang/test/CodeGen/X86/avx512vlbw-builtins.c
@@ -475,6 +475,7 @@ __mmask8 test_mm_cmplt_epu16_mask(__m128i __a, __m128i __b) {
// CHECK: icmp ult <8 x i16> %{{.*}}, %{{.*}}
return (__mmask8)_mm_cmplt_epu16_mask(__a, __b);
}
+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);
__mmask8 test_mm_mask_cmplt_epu16_mask(__mmask8 __u, __m128i __a, __m128i __b) {
// CHECK-LABEL: test_mm_mask_cmplt_epu16_mask
More information about the cfe-commits
mailing list