Commit 6dd570fa authored by Ilia Mirkin's avatar Ilia Mirkin Committed by Emil Velikov

nvc0/ir: SHLADD's middle source must be an immediate

The instruction encodings only allow for immediates. Don't try to
replace a zero (which is dumb to have in that op in any case) with RZ.
Signed-off-by: Ilia Mirkin's avatarIlia Mirkin <>
(cherry picked from commit 82e77d4e)
parent 33f3ae1d
......@@ -521,6 +521,8 @@ NVC0LegalizePostRA::replaceZero(Instruction *i)
for (int s = 0; i->srcExists(s); ++s) {
if (s == 2 && i->op == OP_SUCLAMP)
if (s == 1 && i->op == OP_SHLADD)
ImmediateValue *imm = i->getSrc(s)->asImm();
if (imm) {
if (i->op == OP_SELP && s == 2) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment