]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgcc/config/arm/fp16.c
Update copyright years.
[thirdparty/gcc.git] / libgcc / config / arm / fp16.c
index 76f73275b00204000e7a5fdb3c3c86e7aa2d0968..177ce1c5c192da808bb1dc9a785c0ea50a7bcb07 100644 (file)
@@ -1,6 +1,6 @@
 /* Half-float conversion routines.
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2024 Free Software Foundation, Inc.
    Contributed by CodeSourcery.
 
    This file is free software; you can redistribute it and/or modify it
@@ -43,6 +43,23 @@ binary32 =
   23    /* significand.  */
 };
 
+static const struct format
+binary64 =
+{
+  64,    /* size.  */
+  1023,  /* bias.  */
+  11,    /* exponent.  */
+  52     /* significand.  */
+};
+
+/* Function prototypes.  */
+unsigned short __gnu_f2h_ieee (unsigned int a);
+unsigned int __gnu_h2f_ieee (unsigned short a);
+unsigned short __gnu_f2h_alternative (unsigned int x);
+unsigned int __gnu_h2f_alternative (unsigned short a);
+unsigned short __gnu_d2h_ieee (unsigned long long a);
+unsigned short __gnu_d2h_alternative (unsigned long long x);
+
 static inline unsigned short
 __gnu_float2h_internal (const struct format* fmt,
                        unsigned long long a, int ieee)
@@ -150,7 +167,13 @@ __gnu_f2h_internal (unsigned int a, int ieee)
   return __gnu_float2h_internal (&binary32, (unsigned long long) a, ieee);
 }
 
-unsigned int
+static inline unsigned short
+__gnu_d2h_internal (unsigned long long a, int ieee)
+{
+  return __gnu_float2h_internal (&binary64, a, ieee);
+}
+
+static inline unsigned int
 __gnu_h2f_internal(unsigned short a, int ieee)
 {
   unsigned int sign = (unsigned int)(a & 0x8000) << 16;
@@ -198,3 +221,15 @@ __gnu_h2f_alternative(unsigned short a)
 {
   return __gnu_h2f_internal(a, 0);
 }
+
+unsigned short
+__gnu_d2h_ieee (unsigned long long a)
+{
+  return __gnu_d2h_internal (a, 1);
+}
+
+unsigned short
+__gnu_d2h_alternative (unsigned long long x)
+{
+  return __gnu_d2h_internal (x, 0);
+}