Hi Hongtao, >> was reverted since it changed libgcc to use fegetround and fegetround in >> libm, I wasn’t aware that we should avoid using these functions from libm.
Thank you very much for the patch. I applied it to the GCC 15.1 sources and successfully built GCC. I also ran a simple test case and confirmed that the result was correct. That said, I’d like to review the updates you made — particularly the codes for the DFP_GET_ROUNDMODE and DFP_SET_ROUNDMODE macros — and I’ll get back to you soon. Best regards, Ahmet ________________________________ From: H.J. Lu <[email protected]> Sent: Monday, September 8, 2025 11:29 AM To: Cornea, Marius <[email protected]> Cc: Hongtao Liu <[email protected]>; GCC Patches <[email protected]>; Liu, Hongtao <[email protected]>; Anderson, Cristina S <[email protected]>; Akkas, Ahmet <[email protected]> Subject: Re: PING: [PATCH] libbid: Set rounding mode to round-to-nearest for _Decimal128 arithmetic On Mon, Sep 8, 2025 at 11:20 AM Cornea, Marius <[email protected]> wrote: > > Hello, > > Ahmet will be back only on Oct 6. > > However, I do not fully understand this request. > > Where does this requirement come from: “_Decimal128 arithmetic requires the > round-to-nearest rounding mode”? Is that the DFP rounding mode set in SW > using DFP library functions, or the BFP (Binary Floating-Point) rounding mode > set in HW, in MXCSR and/or the x87 Control Register? > _Decimal128 arithmetic in Intel Binary Floating-Point library works only when the rounding mode in HW (MXCSR) is set to round-to-nearest: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120691 The original fix: https://gcc.gnu.org/cgit/gcc/commit/?id=50064b2898edfb83bc37f2597a35cbd3c1c853e3 was reverted since it changed libgcc to use fegetround and fegetround in libm, which we don't want in libgccc. My patch does the same thing without using libm functions. -- H.J.
