Open ericastor opened 3 years ago
Eric also pointed out that Clang produces the casts in its AST. It appears to be expected behavior: https://blog.llvm.org/2020/04/the-new-clang-extint-feature-provides.html
So, I figure that a fix probably needs to be XLS[cc] itself, recognizing and ignoring these extra casts.
The initial XLS IR output from xlscc for multiplication of
short
s first does a sign_ext to promote both inputs toint
s, then multiplies them, then returns the lower 16 bits of the result. This makes the optimizer work harder than is necessary, and some targets might not be able to optimize it away.