Skip to content

Commit cd03568

Browse files
jgu222igcbot
authored andcommitted
As urem needs positive operands, srcMod could generate negative operands.
To be safe, disable srcMod for urem.
1 parent 014edb1 commit cd03568

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

IGC/Compiler/CISACodeGen/helper.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,9 @@ namespace IGC
12801280
case Instruction::Mul:
12811281
// integer mul supports modifier if not int64.
12821282
return !inst->getType()->isIntegerTy(64);
1283+
case Instruction::URem:
1284+
// neg mod is negative. Disable it as URem must have positive operands,
1285+
return false;
12831286
default:
12841287
break;
12851288
}

0 commit comments

Comments
 (0)