Skip to content

Commit

Permalink
alpha: move __udiv_qrnnd library function to arch/alpha/lib/
Browse files Browse the repository at this point in the history
We already had the implementation for __udiv_qrnnd (unsigned divide for
multi-precision arithmetic) as part of the alpha math emulation code.

But you can disable the math emulation code - even if you shouldn't -
and then the MPI code that actually wants this functionality (and is
needed by various crypto functions) will fail to build.

So move the extended-precision divide code to be a regular library
function, just like all the regular division code is.  That way ie is
available regardless of math-emulation.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Linus Torvalds committed Sep 18, 2021
1 parent ab41f75 commit d4d016c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions arch/alpha/include/asm/asm-prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ extern void __divlu(void);
extern void __remlu(void);
extern void __divqu(void);
extern void __remqu(void);
extern unsigned long __udiv_qrnnd(unsigned long *, unsigned long, unsigned long , unsigned long);
1 change: 1 addition & 0 deletions arch/alpha/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ev6-$(CONFIG_ALPHA_EV6) := ev6-
ev67-$(CONFIG_ALPHA_EV67) := ev67-

lib-y = __divqu.o __remqu.o __divlu.o __remlu.o \
udiv-qrnnd.o \
udelay.o \
$(ev6-y)memset.o \
$(ev6-y)memcpy.o \
Expand Down
2 changes: 2 additions & 0 deletions arch/alpha/math-emu/qrnnd.S → arch/alpha/lib/udiv-qrnnd.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# along with GCC; see the file COPYING. If not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
#include <asm/export.h>

.set noreorder
.set noat
Expand Down Expand Up @@ -161,3 +162,4 @@ $Odd:
ret $31,($26),1

.end __udiv_qrnnd
EXPORT_SYMBOL(__udiv_qrnnd)
2 changes: 1 addition & 1 deletion arch/alpha/math-emu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ ccflags-y := -w

obj-$(CONFIG_MATHEMU) += math-emu.o

math-emu-objs := math.o qrnnd.o
math-emu-objs := math.o
2 changes: 0 additions & 2 deletions arch/alpha/math-emu/math.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,5 +403,3 @@ alpha_fp_emul_imprecise (struct pt_regs *regs, unsigned long write_mask)
egress:
return si_code;
}

EXPORT_SYMBOL(__udiv_qrnnd);

0 comments on commit d4d016c

Please sign in to comment.