12 Jun, 2008
2 commits
-
iter_div_u64_rem is used in the x86-64 vdso, which cannot call other
kernel code. For this case, provide the always_inlined version,
__iter_div_u64_rem.Signed-off-by: Jeremy Fitzhardinge
Signed-off-by: Ingo Molnar -
We have a few instances of the open-coded iterative div/mod loop, used
when we don't expcet the dividend to be much bigger than the divisor.
Unfortunately modern gcc's have the tendency to strength "reduce" this
into a full mod operation, which isn't necessarily any faster, and
even if it were, doesn't exist if gcc implements it in libgcc.The workaround is to put a dummy asm statement in the loop to prevent
gcc from performing the transformation.This patch creates a single implementation of this loop, and uses it
to replace the open-coded versions I know about.Signed-off-by: Jeremy Fitzhardinge
Cc: Andrew Morton
Cc: john stultz
Cc: Segher Boessenkool
Cc: Christian Kujau
Cc: Robert Hancock
Signed-off-by: Ingo Molnar
01 May, 2008
2 commits
-
Rename div64_64 to div64_u64 to make it consistent with the other divide
functions, so it clearly includes the type of the divide. Move its definition
to math64.h as currently no architecture overrides the generic implementation.
They can still override it of course, but the duplicated declarations are
avoided.Signed-off-by: Roman Zippel
Cc: Avi Kivity
Cc: Russell King
Cc: Geert Uytterhoeven
Cc: Ralf Baechle
Cc: David Howells
Cc: Jeff Dike
Cc: Ingo Molnar
Cc: "David S. Miller"
Cc: Patrick McHardy
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The current do_div doesn't explicitly say that it's unsigned and the signed
counterpart is missing, which is e.g. needed when dealing with time values.This introduces 64bit signed/unsigned divide functions which also attempts to
cleanup the somewhat awkward calling API, which often requires the use of
temporary variables for the dividend. To avoid the need for temporary
variables everywhere for the remainder, each divide variant also provides a
version which doesn't return the remainder.Each architecture can now provide optimized versions of these function,
otherwise generic fallback implementations will be used.As an example I provided an alternative for the current x86 divide, which
avoids the asm casts and using an union allows gcc to generate better code.
It also avoids the upper divde in a few more cases, where the result is known
(i.e. upper quotient is zero).Signed-off-by: Roman Zippel
Cc: john stultz
Cc: Thomas Gleixner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
26 Apr, 2007
3 commits
-
Allow s390 to properly override the generic
__div64_32() implementation by:1) Using obj-y for div64.o in s390's makefile instead
of lib-y2) Adding the weak attribute to the generic implementation.
Signed-off-by: David S. Miller
-
Minor optimization of div64_64. do_div() already does optimization
for the case of 32 by 32 divide, so no need to do it here.Signed-off-by: Stephen Hemminger
Signed-off-by: David S. Miller -
Here is the current version of the 64 bit divide common code.
Signed-off-by: Stephen Hemminger
Signed-off-by: David S. Miller
17 Apr, 2005
1 commit
-
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.Let it rip!