Skip to content

Commit

Permalink
Merge pull request #33 from slangbot/format-6023-aleino/shift-conversion
Browse files Browse the repository at this point in the history
Format code for PR shader-slang#6023
  • Loading branch information
aleino-nv authored Jan 10, 2025
2 parents ce5388a + 4acf17d commit 8313e15
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions source/slang/slang-ir-legalize-binary-operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ void legalizeBinaryOp(IRInst* inst)
if (inst->getOp() == kIROp_Lsh || inst->getOp() == kIROp_Rsh)
{
auto vectorType = as<IRVectorType>(compositeType);
compositeType = builder.getVectorType(
scalarValue->getDataType(),
vectorType->getElementCount());
compositeType =
builder.getVectorType(scalarValue->getDataType(), vectorType->getElementCount());
}
auto newRhs = builder.emitMakeCompositeFromScalar(compositeType, scalarValue);
builder.replaceOperand(inst->getOperands() + 1, newRhs);
Expand All @@ -86,9 +85,8 @@ void legalizeBinaryOp(IRInst* inst)
if (inst->getOp() == kIROp_Lsh || inst->getOp() == kIROp_Rsh)
{
auto vectorType = as<IRVectorType>(compositeType);
compositeType = builder.getVectorType(
scalarValue->getDataType(),
vectorType->getElementCount());
compositeType =
builder.getVectorType(scalarValue->getDataType(), vectorType->getElementCount());
}
auto newLhs = builder.emitMakeCompositeFromScalar(compositeType, scalarValue);
builder.replaceOperand(inst->getOperands(), newLhs);
Expand Down

0 comments on commit 8313e15

Please sign in to comment.