Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ade2fe0 authored by Russell King's avatar Russell King
Browse files

[PATCH] ARM: Lindent GCC helper functions

parent f29481c0
Loading
Loading
Loading
Loading
+21 −26
Original line number Diff line number Diff line
@@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */

#include "gcclib.h"

s64
__ashldi3 (s64 u, int b)
s64 __ashldi3(s64 u, int b)
{
	DIunion w;
	int bm;
@@ -44,13 +43,10 @@ __ashldi3 (s64 u, int b)
	uu.ll = u;

	bm = (sizeof(s32) * BITS_PER_UNIT) - b;
  if (bm <= 0)
    {
	if (bm <= 0) {
		w.s.low = 0;
		w.s.high = (u32) uu.s.low << -bm;
    }
  else
    {
	} else {
		u32 carries = (u32) uu.s.low >> bm;
		w.s.low = (u32) uu.s.low << b;
		w.s.high = ((u32) uu.s.high << b) | carries;
@@ -58,4 +54,3 @@ __ashldi3 (s64 u, int b)

	return w.ll;
}
+22 −26
Original line number Diff line number Diff line
@@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */

#include "gcclib.h"

s64
__ashrdi3 (s64 u, int b)
s64 __ashrdi3(s64 u, int b)
{
	DIunion w;
	int bm;
@@ -44,14 +43,11 @@ __ashrdi3 (s64 u, int b)
	uu.ll = u;

	bm = (sizeof(s32) * BITS_PER_UNIT) - b;
  if (bm <= 0)
    {
	if (bm <= 0) {
		/* w.s.high = 1..1 or 0..0 */
		w.s.high = uu.s.high >> (sizeof(s32) * BITS_PER_UNIT - 1);
		w.s.low = uu.s.high >> -bm;
    }
  else
    {
	} else {
		u32 carries = (u32) uu.s.high << bm;
		w.s.high = uu.s.high >> b;
		w.s.low = ((u32) uu.s.low >> b) | carries;
+11 −9
Original line number Diff line number Diff line
@@ -7,14 +7,16 @@
#define SI_TYPE_SIZE	(sizeof(s32) * BITS_PER_UNIT)

#ifdef __ARMEB__
  struct DIstruct {s32 high, low;};
struct DIstruct {
	s32 high, low;
};
#else
  struct DIstruct {s32 low, high;};
struct DIstruct {
	s32 low, high;
};
#endif

typedef union
{
typedef union {
	struct DIstruct s;
	s64 ll;
} DIunion;
+21 −26
Original line number Diff line number Diff line
@@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */

#include "gcclib.h"

s64
__lshrdi3 (s64 u, int b)
s64 __lshrdi3(s64 u, int b)
{
	DIunion w;
	int bm;
@@ -44,13 +43,10 @@ __lshrdi3 (s64 u, int b)
	uu.ll = u;

	bm = (sizeof(s32) * BITS_PER_UNIT) - b;
  if (bm <= 0)
    {
	if (bm <= 0) {
		w.s.high = 0;
		w.s.low = (u32) uu.s.high >> -bm;
    }
  else
    {
	} else {
		u32 carries = (u32) uu.s.high << bm;
		w.s.high = (u32) uu.s.high >> b;
		w.s.low = ((u32) uu.s.low >> b) | carries;
@@ -58,4 +54,3 @@ __lshrdi3 (s64 u, int b)

	return w.ll;
}
+8 −13
Original line number Diff line number Diff line
@@ -52,21 +52,17 @@ Boston, MA 02111-1307, USA. */
           : "r" ((u32) (a)),                                       \
             "r" ((u32) (b)));}


#define __umulsidi3(u, v) \
  ({DIunion __w;                                                        \
    umul_ppmm (__w.s.high, __w.s.low, u, v);                            \
    __w.ll; })


s64
__muldi3 (s64 u, s64 v)
s64 __muldi3(s64 u, s64 v)
{
	DIunion w;
	DIunion uu, vv;

  uu.ll = u,
  vv.ll = v;
	uu.ll = u, vv.ll = v;

	w.ll = __umulsidi3(uu.s.low, vv.s.low);
	w.s.high += ((u32) uu.s.low * (u32) vv.s.high
@@ -74,4 +70,3 @@ __muldi3 (s64 u, s64 v)

	return w.ll;
}
Loading