Skip to content

Commit

Permalink
Merge pull request #15 from slangbot/format-5692-aleino/wgsl-signedne…
Browse files Browse the repository at this point in the history
…ss-mismatch-fixes

Format code for PR #5692
  • Loading branch information
aleino-nv authored Nov 27, 2024
2 parents 93330ed + 87f61e0 commit a68ec83
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions source/slang/slang-ir-wgsl-legalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1516,16 +1516,15 @@ struct LegalizeWGSLEntryPointContext
builder.replaceOperand(inst->getOperands(), newLhs);
}
else if (
isIntegralType(inst->getOperand(0)->getDataType()) &&
isIntegralType(inst->getOperand(1)->getDataType()))
isIntegralType(inst->getOperand(0)->getDataType()) &&
isIntegralType(inst->getOperand(1)->getDataType()))
{
// If integer operands differ in signedness, convert the signed one to unsigned.
// We're assuming that the cases where this is bad have already been caught by
// common validation checks.
IntInfo opIntInfo[2] = {
getIntTypeInfo(inst->getOperand(0)->getDataType()),
getIntTypeInfo(inst->getOperand(1)->getDataType())
};
getIntTypeInfo(inst->getOperand(1)->getDataType())};
if (opIntInfo[0].isSigned != opIntInfo[1].isSigned)
{
int signedOpIndex = (int)opIntInfo[1].isSigned;
Expand Down

0 comments on commit a68ec83

Please sign in to comment.