-
Notifications
You must be signed in to change notification settings - Fork 6.9k
PIC18: fix double increment / decrement #8501
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
base: master
Are you sure you want to change the base?
PIC18: fix double increment / decrement #8501
Conversation
|
Do you have some instruction bytes that demonstrate the problem? |
|
The I think overall the fix is good. |
Thanks for checking. I'll fix them the same way and ping you once completed (unless you want to split that up in a separate PR). |
|
No, it's the same issue, so same PR makes sense. |
|
I've looked at the destREG32 instructions more, and the only one that potentially had an issue is the The behaviour with these is actually already correct though, if you specify both differently they have to be individually incremented/decremented, and if they are specified to be the same, it is correct to increment/decrement it twice. The Therefor I think this PR is ready to merge. |
|
After reviewing this PR, the fix is definitely needed, but this is going about it the wrong way. Because of the way sleigh works, code is going to be duplicated one way or the other, but rather than duplicating the constructor logic code, the It might be simplest if you rename |


Fixing the same bug as #3342 (double FSR increment / decrement when using POSTINC/POSTDEC as both src and dest).
PR #3342 doesn't actually end up writing to the correct registers, since the increment / decrement of FSR already happens before the value is written out again.
Few notes: