-
Notifications
You must be signed in to change notification settings - Fork 46
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
Assuming that char is signed #4
Comments
Hello. I have verified that this is a problem on compiler that assume char is unsigned. I think that the OP meant to indicate that the xtensa compiler assumes char is unsigned. I compiled my project with char as unsigned by default and also ran into the same shift issues. Just wanted to confirm that this is indeed a problem. |
Ah yes.... I got confused while writing this issue - sorry for that. :-) But you are understanding me correctly. The xtensa compiler have unsigned chars whereas the code assumes that chars are signed. But my crc's was slightly different from yours:
|
Hi everyone, Thank you for reporting this bug. Best regards, |
Hi again, Ok, I reproduced the problem using gcc and "-funsigned-char" option. Best regards, |
Hi everyone, Ok, I've fixed the code. And tested with "-funsigned-char". Best regards, |
Runs fine on myLX106 hardware now. You even found the RLC_INDIRECT_HL: which I had missed in my fixes. Strangely enough it seems like the zex'es doesn't cover that particular instruction fully enough to discover errors in the displacement. Great job! Thanks for this. |
Hi, thanks for putting up this project at github. I've currently using it in a project running on a ESP8266 (Xtensa LX106 CPU) and ran in to some troubles with the code expecting that a char is signed in a few places.
The xtensa compiler assumes that a char is
signedunsigned.This screwed up the implementation of relative jumps (something that zexall didn't detect!) and also made zexall report failures for the shift and rolls instructions. I spent a good while trying to figure out what what wrong with the shf/rol implementation, but when I by chance discovered the bug in the relative jumps I then realized what was the cause and it was an easy fix to get it all working perfectly.
Would you be interested in a pull request for my fix of these issues?
The text was updated successfully, but these errors were encountered: