-
Notifications
You must be signed in to change notification settings - Fork 21
Division operations are being incorrectly lowered #70
Comments
This should be __divmodhi4 for AVR. Fixes bug avr-llvm#70.
We should be able to handle this by adding a case to the switch in See the |
Note that a number of the compiler runtime library functions do not follow the normal AVR ABI. See the avr-gcc wiki, heading "Exceptions to the calling convention" for details. |
I believe the best way would be to create a custom calling convention which special cases all of the routines from the AVR-GCC wiki which do not follow the standard convention. This way libcalls would work as expected. |
I have implemented 8 and 16-bit division using custom lowering. We cannot custom lower a 32-bit (or greater) values because the type is illegal. I am not sure how to go about this. |
The follow-up is #149.
Hehe... The whole concept of "legal types" is ... I wouldn't say flawed... but it just doesn't cut it for small targets. It is exactly what I'm trying to hack up to get rid of the pseudo instructions. If I succeed handling the division library calls shouldn't be a problem. |
We are not handling the lowering of various instructions correctly.
This problem came about in this mailing list exchange.
Division is being lowered into a call to the
libgcc
function__udivqi3
. This function does not exist. GCC instead lowers this to__divmodhi4
, which is what we should be doing.The text was updated successfully, but these errors were encountered: