From 4536d8389bd7dd95349a2fd3f2e1767accbbe182 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Mon, 3 Dec 2012 20:09:41 +0000 Subject: Add two missing quad-precision emulation functions: _Qp_cmp and _Qp_cmpe. At least the former is emitted by modern versions of GCC. --- lib/libc/arch/sparc64/fpu/fpu_qp.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/libc/arch/sparc64/fpu/fpu_qp.c b/lib/libc/arch/sparc64/fpu/fpu_qp.c index 698c72a2b64..a59eceeb858 100644 --- a/lib/libc/arch/sparc64/fpu/fpu_qp.c +++ b/lib/libc/arch/sparc64/fpu/fpu_qp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu_qp.c,v 1.2 2004/09/28 18:03:36 otto Exp $ */ +/* $OpenBSD: fpu_qp.c,v 1.3 2012/12/03 20:09:40 kettenis Exp $ */ /*- * Copyright (c) 2002 Jake Burkholder. @@ -127,13 +127,14 @@ _Qp_qto ## qname(u_int *c) \ #define FCC_LE(fcc) ((fcc) == FSR_CC_EQ || (fcc) == FSR_CC_LT) #define FCC_LT(fcc) ((fcc) == FSR_CC_LT) #define FCC_NE(fcc) ((fcc) != FSR_CC_EQ) +#define FCC_ID(fcc) (fcc) #define FSR_GET_FCC0(fsr) (((fsr) >> FSR_FCC_SHIFT) & FSR_FCC_MASK) #define _QP_CMP(name, cmpe, test) \ -int _Qp_f ## name(u_int *a, u_int *b) ; \ +int _Qp_ ## name(u_int *a, u_int *b) ; \ int \ -_Qp_f ## name(u_int *a, u_int *b) \ +_Qp_ ## name(u_int *a, u_int *b) \ { \ struct fpemu fe; \ __asm __volatile("stx %%fsr, %0" : "=m" (fe.fe_fsr) :); \ @@ -180,9 +181,11 @@ _QP_QTOT4(x, x, long, a) _QP_QTOT3(ui, i, u_int) _QP_QTOT4(ux, x, u_long, a) -_QP_CMP(eq, 0, FCC_EQ) -_QP_CMP(ge, 0, FCC_GE) -_QP_CMP(gt, 0, FCC_GT) -_QP_CMP(le, 0, FCC_LE) -_QP_CMP(lt, 0, FCC_LT) -_QP_CMP(ne, 0, FCC_NE) +_QP_CMP(feq, 0, FCC_EQ) +_QP_CMP(fge, 0, FCC_GE) +_QP_CMP(fgt, 0, FCC_GT) +_QP_CMP(fle, 0, FCC_LE) +_QP_CMP(flt, 0, FCC_LT) +_QP_CMP(fne, 0, FCC_NE) +_QP_CMP(cmp, 0, FCC_ID) +_QP_CMP(cmpe, 1, FCC_ID) -- cgit v1.2.3