Skip to content

Commit a365f49

Browse files
committed
rebase, update comment
1 parent e522547 commit a365f49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ static mlir::Value emitX86FunnelShift(CIRGenBuilderTy &builder,
188188
auto amtTy = mlir::cast<cir::IntType>(amt.getType());
189189
auto vecElemTy = mlir::cast<cir::IntType>(vecTy.getElementType());
190190

191-
// Cast to same width unsigned if not already unsigned.
191+
// If signed, cast to the same width but unsigned first to
192+
// ensure zero-extension when casting to a bigger unsigned `vecElemeTy`.
192193
if (amtTy.isSigned()) {
193194
cir::IntType unsignedAmtTy = builder.getUIntNTy(amtTy.getWidth());
194195
amt = builder.createIntCast(amt, unsignedAmtTy);
195196
}
196-
// Cast the unsigned `amt` to operand element type's width unsigned.
197197
cir::IntType unsignedVecElemType = builder.getUIntNTy(vecElemTy.getWidth());
198198
amt = builder.createIntCast(amt, unsignedVecElemType);
199199
amt = cir::VecSplatOp::create(

0 commit comments

Comments
 (0)