Message ID | 20220721190330.9739-1-palmer@rivosinc.com |
---|---|
State | New |
Headers | show |
Series | longlong: Update the checks for "mul" on RISC-V | expand |
On Jul 21 2022, Palmer Dabbelt wrote: > It's not super clear that keeping glibc support for non-M systems is > even useful, as we're now mandating M in Linux, but what's there might > as well match the docs. longlong.h should be kept in sync with gcc, so it should not assume linux-only. It used to be shared with gmp as well, but they have diverted quite a bit by now.
On Thu, 21 Jul 2022 12:37:25 PDT (-0700), schwab@linux-m68k.org wrote: > On Jul 21 2022, Palmer Dabbelt wrote: > >> It's not super clear that keeping glibc support for non-M systems is >> even useful, as we're now mandating M in Linux, but what's there might >> as well match the docs. > > longlong.h should be kept in sync with gcc, so it should not assume > linux-only. It used to be shared with gmp as well, but they have > diverted quite a bit by now. Thanks, I didn't know/remember that. Looks like it's supposed to be updated in GCC first, so we can do it when we do the Zmmul support which makes things a bit easier.
diff --git a/stdlib/longlong.h b/stdlib/longlong.h index 9b89469ac2..fe3f1989af 100644 --- a/stdlib/longlong.h +++ b/stdlib/longlong.h @@ -1053,7 +1053,7 @@ extern UDItype __umulsidi3 (USItype, USItype); #endif #if defined(__riscv) -#ifdef __riscv_mul +#if defined(__riscv_mul) || defined(__riscv_m) || defined(__riscv_zmmul) #define __umulsidi3(u,v) ((UDWtype)(UWtype)(u) * (UWtype)(v)) #define __muluw3(a, b) ((UWtype)(a) * (UWtype)(b)) #else @@ -1076,7 +1076,7 @@ extern UDItype __umulsidi3 (USItype, USItype); : "ra", "a2", "a3"); \ __op0; \ }) -#endif /* __riscv_mul */ +#endif /* __riscv_mul || __riscv_m || __riscv_zmmul */ #define umul_ppmm(w1, w0, u, v) \ do { \ UWtype __x0, __x1, __x2, __x3; \