openDLX icon indicating copy to clipboard operation
openDLX copied to clipboard

beqz and bnez not working

Open schferbe opened this issue 9 years ago • 0 comments

When executing following code I expect that the 1st branch is taken and the 2nd one isn't. Instead the 1st is not taken and the 2nd is.

.global main
main:
addi r1,r0,42
beqz r0,end
addi r1,r1,42
bnez r0,end
addi r1,r1,42
end:
nop

When executing the following code it gets even stranger.

.global main
main:
addi r1,r0,42
beqz r1,end
addi r1,r1,42
bnez r1,end
addi r1,r1,42
end:
nop

None of the branches are taken although I would have expected the 1st not to be and the 2nd to be taken. This happens whether forwarding is active or not. I am using version 1.0-6.

schferbe avatar Sep 17 '15 10:09 schferbe