https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119408

            Bug ID: 119408
           Summary: LoongArch: Q Suffix for __float128 Literals Not
                    Supported
           Product: gcc
           Version: 14.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wszqkzqk at qq dot com
  Target Milestone: ---

The GCC manual explicitly states that __float128 literals require the Q suffix.
According to [GCC Manual: Floating
Types](https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html?spm=a2ty_o01.29997173.0.0.7c72c921e8gZ5X):

> Use a suffix ‘q’ or ‘Q’ for __float128. 

> __float128 is available on [...] LoongArch [...] as an alias for _Float128.

This means platforms including LoongArch that support `__float128` should
support `Q` suffix in 128-bit float point literals. However, LoongArch's GCC
implementation contradicts this:   

* The Q suffix (e.g., `1.0Q`) fails with `error: unsupported non-standard
suffix on floating constant`,  
* While the GNU-extension f128 suffix (e.g., `1.0f128`) works for `_Float128`.

This inconsistency breaks code using `__float128` literals. (I found it by
build sleef on LoongArch64 platform).

Tested on Arch Linux for Loong64 with:

* gcc 14.2.1
* demo:
```c
#include <float.h>

int main() {
  __float128 a = 1.11111111Q;
}

```

Reply via email to