This is the codegen equivalent of D124692. As shown in https://github.com/llvm/llvm-project/issues/55150 - the existing fold may be wrong when converting to a signed value. This is a quick fix to avoid the miscompile. https://alive2.llvm.org/ce/z/KtaDmd Differential Revision: https://reviews.llvm.org/D124771
Copied from x86 tests for multi-target coverage. Also, provides coverage for target-specific asm testing for Alive2 or its follow-ons. See #55150 and D124692