-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MOVZ/MOVN does not gives correct code. #36
Comments
did you fix the issue? |
No... :-( I am going to bed now. |
Ok, can you elaborate what the issue is exactly and in which context (for instance, MOVZ/N are systematically wrong or just inside a delay slot? etc.). |
The statements does not generate the move function. So it is generally broken. And in a delayslot after a JR it will not generate the statement before the JR but in a separate function. |
gives the following 'extra function':
|
just generates the return-statement. |
snowman tends to discard a lot of values in a function. I think snowman doesn't understand movn is setting the first function argument (a0) conditionally BEFORE calling the function given in t9 in:
that is, if (v0) t9(a0 = a3); else t9(a0); --> if (v0) t9(a3); else t9(a0); and we have a similar issue but with return value being a 64-bit integer (v1:v0), the v1 of which is also set conditionally BEFORE the return. It should have been: v1 = 2; v0 = 1; if (a0) return LLONG(v1,v0); else LLONG((v1 = v0),v0); --> if (a0) return 0x000000200000001ULL; else return 0x0000000100000001ULL; |
@hlide that's why I implemented addNonVolatileRegister() :-) Then it won't discard so those registers. |
I guess part of the problem is for fixing when it is a delay slot. |
@hlide I can see the logic is correct however if you wanna try this I suggest you use 'tuxera.bench' (BE MIPS-I) |
I improved the code generation in 8be261d |
@hlide actually when there is a jump statement in the delay slot like having MOVN/MOVZ in a delay slot, the generated code will not come before the branching but in a separate function. Any clues? This is not specific for MOVN/MOVZ but for jumps to a 'MipsExpressionFactoryCallback' |
There were a long discussion in a topic about that and how to fix the issue with two contiguous jumps in a block. A solution was found and applied in my snowman repository. I thought it was fixed once for all. |
@hlide: I'll try to find a MIPS-LE file for using with Allegrex. |
@hlide any clues why this is so?
The text was updated successfully, but these errors were encountered: