Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3946
b: refs/heads/master
c: 438a761
h: refs/heads/master
v: v3
  • Loading branch information
Russell King authored and Russell King committed Jun 29, 2005
1 parent e1a9356 commit cc24785
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b3402cf50efead37dd9553b90fbf1486e09fb78e
refs/heads/master: 438a76167959061e371025f727fabec2ad9e70a7
15 changes: 13 additions & 2 deletions trunk/arch/arm/vfp/vfp.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,13 @@ static inline u64 vfp_estimate_div128to64(u64 nh, u64 nl, u64 m)
if (nh >= m)
return ~0ULL;
mh = m >> 32;
z = (mh << 32 <= nh) ? 0xffffffff00000000ULL : (nh / mh) << 32;
if (mh << 32 <= nh) {
z = 0xffffffff00000000ULL;
} else {
z = nh;
do_div(z, mh);
z <<= 32;
}
mul64to128(&termh, &terml, m, z);
sub128(&remh, &reml, nh, nl, termh, terml);
ml = m << 32;
Expand All @@ -126,7 +132,12 @@ static inline u64 vfp_estimate_div128to64(u64 nh, u64 nl, u64 m)
add128(&remh, &reml, remh, reml, mh, ml);
}
remh = (remh << 32) | (reml >> 32);
z |= (mh << 32 <= remh) ? 0xffffffff : remh / mh;
if (mh << 32 <= remh) {
z |= 0xffffffff;
} else {
do_div(remh, mh);
z |= remh;
}
return z;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/vfp/vfpdouble.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
#include <linux/kernel.h>
#include <linux/bitops.h>

#include <asm/div64.h>
#include <asm/ptrace.h>
#include <asm/vfp.h>

Expand Down
14 changes: 12 additions & 2 deletions trunk/arch/arm/vfp/vfpsingle.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
#include <linux/kernel.h>
#include <linux/bitops.h>

#include <asm/div64.h>
#include <asm/ptrace.h>
#include <asm/vfp.h>

Expand Down Expand Up @@ -303,7 +305,11 @@ u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand)
if (z <= a)
return (s32)a >> 1;
}
return (u32)(((u64)a << 31) / z) + (z >> 1);
{
u64 v = (u64)a << 31;
do_div(v, z);
return v + (z >> 1);
}
}

static u32 vfp_single_fsqrt(int sd, int unused, s32 m, u32 fpscr)
Expand Down Expand Up @@ -1107,7 +1113,11 @@ static u32 vfp_single_fdiv(int sd, int sn, s32 m, u32 fpscr)
vsn.significand >>= 1;
vsd.exponent++;
}
vsd.significand = ((u64)vsn.significand << 32) / vsm.significand;
{
u64 significand = (u64)vsn.significand << 32;
do_div(significand, vsm.significand);
vsd.significand = significand;
}
if ((vsd.significand & 0x3f) == 0)
vsd.significand |= ((u64)vsm.significand * vsd.significand != (u64)vsn.significand << 32);

Expand Down

0 comments on commit cc24785

Please sign in to comment.