[clang] [llvm] [LoongArch] Support LA V1.1 feature that div.w[u] and mod.w[u] instructions with inputs not signed-extended. (PR #116764)
Lu Weining via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 20 00:40:06 PST 2024
SixWeining wrote:
> the original test is from gcc
>
> ```c++
> int divw(long a, long b) {
> return (int)a / (int)b;
> }
>
> unsigned int divwu(long a, long b) {
> return (unsigned int)a / (unsigned int)b;
> }
>
> int modw(long a, long b) {
> return (int)a % (int)b;
> }
>
> unsigned int modwu(long a, long b) {
> return (unsigned int)a % (unsigned int)b;
> }
> ```
Prefer to use simple IR like what I mentioned above.
https://github.com/llvm/llvm-project/pull/116764
More information about the cfe-commits
mailing list