]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Aarch64: Define WIDEST_HARDWARE_FP_SIZE
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 3 Oct 2024 17:46:59 +0000 (19:46 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Thu, 3 Oct 2024 18:02:27 +0000 (20:02 +0200)
The macro is documented like this in the internal manual:

 -- Macro: WIDEST_HARDWARE_FP_SIZE
     A C expression for the size in bits of the widest floating-point
     format supported by the hardware.  If you define this macro, you
     must specify a value less than or equal to mode precision of the
     mode used for C type 'long double' (from hook
     'targetm.c.mode_for_floating_type' with argument
     'TI_LONG_DOUBLE_TYPE').  If you do not define this macro, mode
     precision of the mode used for C type 'long double' is the default.

AArch64 uses 128-bit TFmode for long double but, as far as I know, no FPU
implemented in hardware supports it.

gcc/
* config/aarch64/aarch64.h (WIDEST_HARDWARE_FP_SIZE): Define to 64.

gcc/testsuite/
* gnat.dg/specs/size_clause6.ads: New test.

gcc/config/aarch64/aarch64.h
gcc/testsuite/gnat.dg/specs/size_clause6.ads [new file with mode: 0644]

index ec8fde783b3593286c2e553b9890d07fb69a7fae..030cffb17606c1062af62398dd631bae50b448af 100644 (file)
@@ -96,6 +96,8 @@
 
 #define LONG_LONG_TYPE_SIZE    64
 
+#define WIDEST_HARDWARE_FP_SIZE        64
+
 /* This value is the amount of bytes a caller is allowed to drop the stack
    before probing has to be done for stack clash protection.  */
 #define STACK_CLASH_CALLER_GUARD 1024
diff --git a/gcc/testsuite/gnat.dg/specs/size_clause6.ads b/gcc/testsuite/gnat.dg/specs/size_clause6.ads
new file mode 100644 (file)
index 0000000..6015bcd
--- /dev/null
@@ -0,0 +1,12 @@
+-- { dg-do compile }
+
+with Interfaces;
+
+package Size_Clause6 is
+
+  type Long_Double is new Interfaces.IEEE_Extended_Float;
+  for Long_Double'Size use 128; -- { dg-warning "unused" "" { target { ! { { i?86-*-* x86_64-*-* } && lp64 } } } }
+
+  function Int (X : in Long_Double) return Integer is (0);
+
+end Size_Clause6;