Skip to content

Commit 5aeb4e4

Browse files
committed
minor changes
1 parent d84d68c commit 5aeb4e4

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3101,9 +3101,9 @@ static bool interp__builtin_vec_set(InterpState &S, CodePtr OpPC,
31013101
return true;
31023102
}
31033103

3104-
static bool evalICmpImm(const uint8_t imm, APSInt A, APSInt B,
3104+
static bool evalICmpImm(uint8_t Imm, APSInt A, APSInt B,
31053105
bool IsUnsigned) {
3106-
switch (imm & 0x7) {
3106+
switch (Imm & 0x7) {
31073107
case 0x00: // _MM_CMPINT_EQ
31083108
return (A == B);
31093109
case 0x01: // _MM_CMPINT_LT
@@ -3125,7 +3125,7 @@ static bool evalICmpImm(const uint8_t imm, APSInt A, APSInt B,
31253125
}
31263126
}
31273127

3128-
static bool interp__builtin_cmp_mask(InterpState &S, CodePtr OpPC,
3128+
static bool interp__builtin_ia32_cmp_mask(InterpState &S, CodePtr OpPC,
31293129
const CallExpr *Call, unsigned ID,
31303130
bool IsUnsigned) {
31313131
assert(Call->getNumArgs() == 4);
@@ -3143,8 +3143,7 @@ static bool interp__builtin_cmp_mask(InterpState &S, CodePtr OpPC,
31433143
PrimType ElemT = LHS.getFieldDesc()->getPrimType();
31443144

31453145
for (unsigned ElemNum = 0; ElemNum < VectorLen; ++ElemNum) {
3146-
APSInt A;
3147-
APSInt B;
3146+
APSInt A, B;
31483147
INT_TYPE_SWITCH_NO_BOOL(ElemT, {
31493148
A = LHS.elem<T>(ElemNum).toAPSInt();
31503149
B = RHS.elem<T>(ElemNum).toAPSInt();
@@ -4208,7 +4207,7 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
42084207
case X86::BI__builtin_ia32_cmpw512_mask:
42094208
case X86::BI__builtin_ia32_cmpd512_mask:
42104209
case X86::BI__builtin_ia32_cmpq512_mask:
4211-
return interp__builtin_cmp_mask(S, OpPC, Call, BuiltinID,
4210+
return interp__builtin_ia32_cmp_mask(S, OpPC, Call, BuiltinID,
42124211
/*IsUnsigned=*/false);
42134212

42144213
case X86::BI__builtin_ia32_ucmpb128_mask:
@@ -4223,7 +4222,7 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
42234222
case X86::BI__builtin_ia32_ucmpw512_mask:
42244223
case X86::BI__builtin_ia32_ucmpd512_mask:
42254224
case X86::BI__builtin_ia32_ucmpq512_mask:
4226-
return interp__builtin_cmp_mask(S, OpPC, Call, BuiltinID,
4225+
return interp__builtin_ia32_cmp_mask(S, OpPC, Call, BuiltinID,
42274226
/*IsUnsigned=*/true);
42284227

42294228
default:

clang/lib/AST/ExprConstant.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15491,11 +15491,10 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
1549115491
assert(LHS.getVectorLength() == RHS.getVectorLength());
1549215492

1549315493
unsigned VectorLen = LHS.getVectorLength();
15494-
unsigned RetWidth = VectorLen ? VectorLen : 1;
15495-
if (Mask.getBitWidth() > RetWidth)
15496-
RetWidth = Mask.getBitWidth();
15494+
unsigned RetWidth = Mask.getBitWidth();
1549715495

1549815496
APSInt RetMask(llvm::APInt(RetWidth, 0), /*isUnsigned=*/true);
15497+
1549915498
for (unsigned ElemNum = 0; ElemNum < VectorLen; ++ElemNum) {
1550015499
const APSInt &A = LHS.getVectorElt(ElemNum).getInt();
1550115500
const APSInt &B = RHS.getVectorElt(ElemNum).getInt();

0 commit comments

Comments
 (0)