[Midnightbsd-cvs] src [9680] trunk/contrib/gcc4: madd swap functions

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Dec 13 15:15:00 EST 2017


Revision: 9680
          http://svnweb.midnightbsd.org/src/?rev=9680
Author:   laffer1
Date:     2017-12-13 15:14:59 -0500 (Wed, 13 Dec 2017)
Log Message:
-----------
madd swap functions

Modified Paths:
--------------
    trunk/contrib/gcc4/libgcc2.c
    trunk/contrib/gcc4/libgcc2.h

Modified: trunk/contrib/gcc4/libgcc2.c
===================================================================
--- trunk/contrib/gcc4/libgcc2.c	2017-12-13 20:12:38 UTC (rev 9679)
+++ trunk/contrib/gcc4/libgcc2.c	2017-12-13 20:14:59 UTC (rev 9680)
@@ -492,6 +492,30 @@
 }
 #endif
 

+#ifdef L_bswapsi2
+UWtype
+__bswapsi2 (UWtype u)
+{
+  return ((((u) & 0xff000000) >> 24)
+	  | (((u) & 0x00ff0000) >>  8)
+	  | (((u) & 0x0000ff00) <<  8)
+	  | (((u) & 0x000000ff) << 24));
+}
+#endif
+#ifdef L_bswapdi2
+UDWtype
+__bswapdi2 (UDWtype u)
+{
+  return ((((u) & 0xff00000000000000ull) >> 56)
+	  | (((u) & 0x00ff000000000000ull) >> 40)
+	  | (((u) & 0x0000ff0000000000ull) >> 24)
+	  | (((u) & 0x000000ff00000000ull) >>  8)
+	  | (((u) & 0x00000000ff000000ull) <<  8)
+	  | (((u) & 0x0000000000ff0000ull) << 24)
+	  | (((u) & 0x000000000000ff00ull) << 40)
+	  | (((u) & 0x00000000000000ffull) << 56));
+}
+#endif
 #ifdef L_ffssi2
 #undef int
 int
@@ -1862,7 +1886,7 @@
 {
   MTYPE denom, ratio, x, y;
 
-  /* ??? We can get better behavior from logarithmic scaling instead of 
+  /* ??? We can get better behavior from logarithmic scaling instead of
      the division.  But that would mean starting to link libgcc against
      libm.  We could implement something akin to ldexp/frexp as gcc builtins
      fairly easily...  */
@@ -1983,8 +2007,8 @@
 /* Clear part of an instruction cache.  */
 
 void
-__clear_cache (char *beg __attribute__((__unused__)),
-	       char *end __attribute__((__unused__)))
+__clear_cache (void *beg __attribute__((__unused__)),
+	       void *end __attribute__((__unused__)))
 {
 #ifdef CLEAR_INSN_CACHE
   CLEAR_INSN_CACHE (beg, end);

Modified: trunk/contrib/gcc4/libgcc2.h
===================================================================
--- trunk/contrib/gcc4/libgcc2.h	2017-12-13 20:12:38 UTC (rev 9679)
+++ trunk/contrib/gcc4/libgcc2.h	2017-12-13 20:14:59 UTC (rev 9680)
@@ -35,7 +35,7 @@
 #endif
 
 extern int __gcc_bcmp (const unsigned char *, const unsigned char *, size_t);
-extern void __clear_cache (char *, char *);
+extern void __clear_cache (void *, void *);
 extern void __eprintf (const char *, const char *, unsigned int, const char *)
   __attribute__ ((__noreturn__));
 
@@ -345,11 +345,13 @@
 extern Wtype __subvSI3 (Wtype, Wtype);
 extern Wtype __mulvSI3 (Wtype, Wtype);
 extern Wtype __negvSI2 (Wtype);
+extern UWtype __bswapsi2 (UWtype);
 extern DWtype __absvDI2 (DWtype);
 extern DWtype __addvDI3 (DWtype, DWtype);
 extern DWtype __subvDI3 (DWtype, DWtype);
 extern DWtype __mulvDI3 (DWtype, DWtype);
 extern DWtype __negvDI2 (DWtype);
+extern UDWtype __bswapdi2 (UDWtype);
 
 #ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC
 extern SItype __absvsi2 (SItype);



More information about the Midnightbsd-cvs mailing list