Closed codebje closed 3 years ago
Duplicate of #12.
Note that even if I hack the shift to narrow, there's no way that the 24-bit mul overflow is going to be computed any way other than with a >= 48-bit multiply libcall, so even though I could provide a workaround for the crash, I can't do much about the original issue.
In some circumstances llvm will emit a 64-bit shift and multiply instead of a 32-bit divide. I was experimenting to see if I could avoid the 64-bit ops since
__llshru
and__llmulu
aren't in the ZDSII RTL, by targeting a 24-bit divide instead:This fails with:
fatal error: error in backend: unable to legalize instruction: %19:_(s48) = G_LSHR %17:_, %20:_(s8) (in function: foo)