id = 1788 title = "Floating point rounding fails on mps3-an547 amd cortex-m55 while using LLVM-embedded-toolchain-for-Arm and Picolibic." state = "closed" created_at = "2023-07-25T08:31:42.354Z" closed_at = "2023-08-01T14:41:51.146Z" labels = ["workflow::Patch available"] url = "https://gitlab.com/qemu-project/qemu/-/issues/1788" host-os = "Ubuntu 20.04.5 LTS" host-arch = "x86_64" qemu-version = "QEMU emulator version 7.1.0" guest-os = "N/A" guest-arch = "mps3-an547 and cortex-m55" description = """Rounding of long double gives unexpected result. Simple code as example: ``` #include int main(void) { long double value = -8.5L; long rounded_value = lrintl(value); if( -8 == rounded_value ) { return 0; } return 1; } ```""" reproduce = """1. Checkout project: [LLVM-embedded-toolchain-for-ARM](https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm) 2. Configure it with option -DLLVM_TOOLCHAIN_LIBRARY_VARIANTS=armv8.1m.main_hard_nofp_mve 3. Build project 4. Run Picolbic tests with ninja picolibc_armv8.1m.main_hard_nofp_mve-test As a result long_double test fails with incorrect rounding. Last qemu version which successfully execute mentioned test is: qemu 7.0.0 downloaded via [qemu-7.0.0](https://download.qemu.org/qemu-7.0.0.tar.bz2). Issue is present since qemu version 7.1.""" additional = """As a result long_double test fails with incorrect rounding. Last qemu version which successfully execute mentioned test is: qemu 7.0.0 downloaded via [qemu-7.0.0](https://download.qemu.org/qemu-7.0.0.tar.bz2). Issue is present since qemu version 7.1."""