xref: /openbsd-src/sys/arch/hppa/spmath/divufr.c (revision c2feb25228e11b3c285a2d9400475896f2dd1562)
1*c2feb252Smickey /*	$OpenBSD: divufr.c,v 1.6 2002/05/07 22:19:30 mickey Exp $	*/
28a472b3eSmickey /*
3*c2feb252Smickey   (c) Copyright 1986 HEWLETT-PACKARD COMPANY
4*c2feb252Smickey   To anyone who acknowledges that this file is provided "AS IS"
5*c2feb252Smickey   without any express or implied warranty:
6*c2feb252Smickey       permission to use, copy, modify, and distribute this file
7*c2feb252Smickey   for any purpose is hereby granted without fee, provided that
8*c2feb252Smickey   the above copyright notice and this notice appears in all
9*c2feb252Smickey   copies, and that the name of Hewlett-Packard Company not be
10*c2feb252Smickey   used in advertising or publicity pertaining to distribution
11*c2feb252Smickey   of the software without specific, written prior permission.
12*c2feb252Smickey   Hewlett-Packard Company makes no representations about the
13*c2feb252Smickey   suitability of this software for any purpose.
148a472b3eSmickey */
15*c2feb252Smickey /* @(#)divufr.c: Revision: 1.6.88.1 Date: 93/12/07 15:06:03 */
168a472b3eSmickey 
174f9f21c7Smickey #include "md.h"
188a472b3eSmickey 
19b94afd46Smickey void
divufr(opnd1,opnd2,result)20b94afd46Smickey divufr(opnd1,opnd2,result)
218a472b3eSmickey 	unsigned int opnd1, opnd2;
228a472b3eSmickey 	struct mdsfu_register *result;
238a472b3eSmickey {
248a472b3eSmickey 	/* check divisor for zero */
258a472b3eSmickey 	if (opnd2 == 0) {
268a472b3eSmickey 		overflow = TRUE;
278a472b3eSmickey 		return;
288a472b3eSmickey 	}
298a472b3eSmickey 
308a472b3eSmickey 	/* check for overflow */
318a472b3eSmickey 	if (opnd1 >= opnd2) {
328a472b3eSmickey 		overflow = TRUE;
338a472b3eSmickey 		return;
348a472b3eSmickey 	}
358a472b3eSmickey 	overflow = FALSE;
368a472b3eSmickey 
378a472b3eSmickey 	/* do the divide */
388a472b3eSmickey 	divu(opnd1,0,opnd2,result);
398a472b3eSmickey }
40