You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to my understanding, CondBr currently receives an IntegerCompare as kind. However, the registers rs1 and rs2 of this IntegerCompare don’t contain values to compare. Instead rs1 contains the result of the comparison related to CondBr and rs2 is set to zero_reg. This is based on:
Change CondBr to something like CondBr { condition: ..., target: ..., rs1: ... } which would no longer imply that it compares stuff internally.
2) Compare stuff in CondBr
To avoid misinterpretations of the kind field of CondBr. I assume in this case rs1 and rs2 should be the registers to be compared.
Notes
@Akashin pointed out that later on it might be necessary to use CondBr in ways incompatible with the refactoring described in 1). Such use cases can be found in emit.rs, though they are currently commented out. More generally, it might be too early to refactor CondBr now.
The text was updated successfully, but these errors were encountered:
According to my understanding,
CondBr
currently receives anIntegerCompare
askind
. However, the registersrs1
andrs2
of thisIntegerCompare
don’t contain values to compare. Insteadrs1
contains the result of the comparison related toCondBr
andrs2
is set tozero_reg
. This is based on:test
is passed subsequently intoIntegerCompare
)Potential refactorings
1) Change
CondBr
structureBrought up by @nagisa in this comment:
2) Compare stuff in
CondBr
To avoid misinterpretations of the
kind
field ofCondBr
. I assume in this casers1
andrs2
should be the registers to be compared.Notes
@Akashin pointed out that later on it might be necessary to use
CondBr
in ways incompatible with the refactoring described in 1). Such use cases can be found in emit.rs, though they are currently commented out. More generally, it might be too early to refactorCondBr
now.The text was updated successfully, but these errors were encountered: