diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2016-05-08 18:41:18 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2016-05-08 18:41:18 +0000 |
commit | 19aefaad50c189078fd3c3bf161bb809dad995e9 (patch) | |
tree | 30d2b3bbe8cee5173f1cfd376b9f9244fbc5180e | |
parent | b61f0f67e210a88e18916e4bbdb390b31ccb5250 (diff) |
Hide __fpu_* and make internal _Qp_* calls go direct.
ok kettenis@
-rw-r--r-- | lib/libc/arch/sparc64/Symbols.list | 26 | ||||
-rw-r--r-- | lib/libc/arch/sparc64/fpu/Makefile.inc | 6 | ||||
-rw-r--r-- | lib/libc/arch/sparc64/fpu/fpu_explode.c | 4 | ||||
-rw-r--r-- | lib/libc/arch/sparc64/fpu/fpu_extern.h | 4 | ||||
-rw-r--r-- | lib/libc/arch/sparc64/fpu/fpu_q.h | 22 | ||||
-rw-r--r-- | lib/libc/arch/sparc64/fpu/fpu_qp.c | 30 |
6 files changed, 53 insertions, 39 deletions
diff --git a/lib/libc/arch/sparc64/Symbols.list b/lib/libc/arch/sparc64/Symbols.list index c34776bbc62..69b66c95f8c 100644 --- a/lib/libc/arch/sparc64/Symbols.list +++ b/lib/libc/arch/sparc64/Symbols.list @@ -51,32 +51,6 @@ _Qp_uxtoq _Qp_xtoq __builtin_saveregs __dtoul -__fpu_add -__fpu_compare -__fpu_div -__fpu_dtof -__fpu_explode -__fpu_ftod -__fpu_ftoi -__fpu_ftoq -__fpu_ftos -__fpu_ftox -__fpu_getreg32 -__fpu_getreg64 -__fpu_implode -__fpu_itof -__fpu_mul -__fpu_newnan -__fpu_norm -__fpu_qtof -__fpu_setreg32 -__fpu_setreg64 -__fpu_shr -__fpu_sqrt -__fpu_stof -__fpu_uitof -__fpu_uxtof -__fpu_xtof __ftoul __plt_end __plt_start diff --git a/lib/libc/arch/sparc64/fpu/Makefile.inc b/lib/libc/arch/sparc64/fpu/Makefile.inc index 79b3c6329f6..74cebe80a13 100644 --- a/lib/libc/arch/sparc64/fpu/Makefile.inc +++ b/lib/libc/arch/sparc64/fpu/Makefile.inc @@ -1,4 +1,6 @@ -# $OpenBSD: Makefile.inc,v 1.1 2003/07/21 18:41:30 jason Exp $ +# $OpenBSD: Makefile.inc,v 1.2 2016/05/08 18:41:17 guenther Exp $ SRCS += fpu_add.c fpu_compare.c fpu_div.c fpu_explode.c fpu_implode.c \ - fpu_mul.c fpu_qp.c fpu_q.c fpu_sqrt.c fpu_subr.c fpu_reg.c + fpu_mul.c fpu_qp.c fpu_q.c fpu_sqrt.c fpu_subr.c +# unneeded, going way: fpu_reg.c + .PATH: ${.CURDIR}/arch/sparc64/fpu diff --git a/lib/libc/arch/sparc64/fpu/fpu_explode.c b/lib/libc/arch/sparc64/fpu/fpu_explode.c index 5f9062199fe..81418ac43f2 100644 --- a/lib/libc/arch/sparc64/fpu/fpu_explode.c +++ b/lib/libc/arch/sparc64/fpu/fpu_explode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu_explode.c,v 1.7 2012/12/05 23:19:59 deraadt Exp $ */ +/* $OpenBSD: fpu_explode.c,v 1.8 2016/05/08 18:41:17 guenther Exp $ */ /* * Copyright (c) 1992, 1993 @@ -292,6 +292,7 @@ __fpu_qtof(fp, i, j, k, l) FP_TOF(exp, EXT_EXP_BIAS, frac, f0, f1, f2, f3); } +#if 0 /* __fpu_explode is unused */ /* * Explode the contents of a / regpair / regquad. * If the input is a signalling NaN, an NV (invalid) exception @@ -362,3 +363,4 @@ __fpu_explode(fe, fp, type, reg) DUMPFPN(FPE_REG, fp); DPRINTF(FPE_REG, ("\n")); } +#endif diff --git a/lib/libc/arch/sparc64/fpu/fpu_extern.h b/lib/libc/arch/sparc64/fpu/fpu_extern.h index 9b23e5333d2..86b35eab6b8 100644 --- a/lib/libc/arch/sparc64/fpu/fpu_extern.h +++ b/lib/libc/arch/sparc64/fpu/fpu_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu_extern.h,v 1.3 2008/06/26 05:42:05 ray Exp $ */ +/* $OpenBSD: fpu_extern.h,v 1.4 2016/05/08 18:41:17 guenther Exp $ */ /*- * Copyright (c) 1995 The NetBSD Foundation, Inc. @@ -40,6 +40,7 @@ union instr; struct fpemu; struct fpn; +__BEGIN_HIDDEN_DECLS /* fpu.c */ int __fpu_exception(struct utrapframe *tf); @@ -86,5 +87,6 @@ int __fpu_shr(register struct fpn *, register int); void __fpu_norm(register struct fpn *); /* Build a new Quiet NaN (sign=0, frac=all 1's). */ struct fpn *__fpu_newnan(register struct fpemu *); +__END_HIDDEN_DECLS #endif /* !_SPARC64_FPU_FPU_EXTERN_H_ */ diff --git a/lib/libc/arch/sparc64/fpu/fpu_q.h b/lib/libc/arch/sparc64/fpu/fpu_q.h index 48300f7ae12..4434c705019 100644 --- a/lib/libc/arch/sparc64/fpu/fpu_q.h +++ b/lib/libc/arch/sparc64/fpu/fpu_q.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu_q.h,v 1.2 2004/02/03 17:18:13 jason Exp $ */ +/* $OpenBSD: fpu_q.h,v 1.3 2016/05/08 18:41:17 guenther Exp $ */ /* * Copyright (c) 2003 Jason L. Wright (jason@thought.net) @@ -70,3 +70,23 @@ int _Qp_fgt(long double *, long double *); int _Qp_flt(long double *, long double *); int _Qp_fne(long double *, long double *); void _Qp_sqrt(long double *, long double *); + +PROTO_NORMAL(_Qp_add); +PROTO_NORMAL(_Qp_div); +PROTO_NORMAL(_Qp_dtoq); +PROTO_NORMAL(_Qp_feq); +PROTO_NORMAL(_Qp_fge); +PROTO_NORMAL(_Qp_fgt); +PROTO_NORMAL(_Qp_fle); +PROTO_NORMAL(_Qp_flt); +PROTO_NORMAL(_Qp_fne); +PROTO_NORMAL(_Qp_itoq); +PROTO_NORMAL(_Qp_mul); +PROTO_NORMAL(_Qp_qtod); +PROTO_NORMAL(_Qp_qtoi); +PROTO_NORMAL(_Qp_qtos); +PROTO_NORMAL(_Qp_qtoui); +PROTO_NORMAL(_Qp_sqrt); +PROTO_NORMAL(_Qp_stoq); +PROTO_NORMAL(_Qp_sub); +PROTO_NORMAL(_Qp_uitoq); diff --git a/lib/libc/arch/sparc64/fpu/fpu_qp.c b/lib/libc/arch/sparc64/fpu/fpu_qp.c index d5d9a8c4a8a..c9c34499aaa 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.5 2014/04/17 09:01:25 guenther Exp $ */ +/* $OpenBSD: fpu_qp.c,v 1.6 2016/05/08 18:41:17 guenther Exp $ */ /*- * Copyright (c) 2002 Jake Burkholder. @@ -37,7 +37,8 @@ __FBSDID("$FreeBSD: src/lib/libc/sparc64/fpu/fpu_qp.c,v 1.3 2002/09/02 02:30:20 #include "fpu_extern.h" #define _QP_OP(op) \ -void _Qp_ ## op(u_int *c, u_int *a, u_int *b); \ +__dso_hidden void _Qp_ ## op(u_int *c, u_int *a, u_int *b); \ +PROTO_NORMAL(_Qp_ ## op); \ void \ _Qp_ ## op(u_int *c, u_int *a, u_int *b) \ { \ @@ -52,10 +53,12 @@ _Qp_ ## op(u_int *c, u_int *a, u_int *b) \ fe.fe_f2.fp_class = __fpu_qtof(&fe.fe_f2, b[0], b[1], b[2], b[3]); \ r = __fpu_ ## op(&fe); \ c[0] = __fpu_ftoq(&fe, r, c); \ -} +} \ +DEF_STRONG(_Qp_ ## op); #define _QP_TTOQ(qname, fname, ntype, atype, signed, ...) \ void _Qp_ ## qname ## toq(u_int *c, ntype n); \ +PROTO_NORMAL(_Qp_ ## qname ## toq); \ void \ _Qp_ ## qname ## toq(u_int *c, ntype n) \ { \ @@ -67,10 +70,12 @@ _Qp_ ## qname ## toq(u_int *c, ntype n) \ fe.fe_f1.fp_sticky = 0; \ fe.fe_f1.fp_class = __fpu_ ## fname ## tof(&fe.fe_f1, __VA_ARGS__); \ c[0] = __fpu_ftoq(&fe, &fe.fe_f1, c); \ -} +} \ +DEF_STRONG(_Qp_ ## qname ## toq); #define _QP_QTOT4(qname, fname, type, x) \ type _Qp_qto ## qname(u_int *c); \ +PROTO_NORMAL(_Qp_qto ## qname); \ type \ _Qp_qto ## qname(u_int *c) \ { \ @@ -84,10 +89,12 @@ _Qp_qto ## qname(u_int *c) \ fe.fe_f1.fp_class = __fpu_qtof(&fe.fe_f1, c[0], c[1], c[2], c[3]); \ a[0] = __fpu_fto ## fname(&fe, &fe.fe_f1, x); \ return (n); \ -} +} \ +DEF_STRONG(_Qp_qto ## qname); #define _QP_QTOT3(qname, fname, type) \ type _Qp_qto ## qname(u_int *c); \ +PROTO_NORMAL(_Qp_qto ## qname); \ type \ _Qp_qto ## qname(u_int *c) \ { \ @@ -101,10 +108,12 @@ _Qp_qto ## qname(u_int *c) \ fe.fe_f1.fp_class = __fpu_qtof(&fe.fe_f1, c[0], c[1], c[2], c[3]); \ a[0] = __fpu_fto ## fname(&fe, &fe.fe_f1); \ return (n); \ -} +} \ +DEF_STRONG(_Qp_qto ## qname); #define _QP_QTOT(qname, fname, type, ...) \ type _Qp_qto ## qname(u_int *c); \ +PROTO_NORMAL(_Qp_qto ## qname); \ type \ _Qp_qto ## qname(u_int *c) \ { \ @@ -118,7 +127,8 @@ _Qp_qto ## qname(u_int *c) \ fe.fe_f1.fp_class = __fpu_qtof(&fe.fe_f1, c[0], c[1], c[2], c[3]); \ a[0] = __fpu_fto ## fname(&fe, &fe.fe_f1, ## __VA_ARGS__); \ return (n); \ -} +} \ +DEF_STRONG(_Qp_qto ## qname); #define FCC_EQ(fcc) ((fcc) == FSR_CC_EQ) #define FCC_GE(fcc) ((fcc) == FSR_CC_EQ || (fcc) == FSR_CC_GT) @@ -132,6 +142,7 @@ _Qp_qto ## qname(u_int *c) \ #define _QP_CMP(name, cmpe, test) \ int _Qp_ ## name(u_int *a, u_int *b) ; \ +PROTO_NORMAL(_Qp_ ## name); \ int \ _Qp_ ## name(u_int *a, u_int *b) \ { \ @@ -145,9 +156,11 @@ _Qp_ ## name(u_int *a, u_int *b) \ fe.fe_f2.fp_class = __fpu_qtof(&fe.fe_f2, b[0], b[1], b[2], b[3]); \ __fpu_compare(&fe, cmpe, 0); \ return (test(FSR_GET_FCC0(fe.fe_fsr))); \ -} +} \ +DEF_STRONG(_Qp_ ## name); void _Qp_sqrt(u_int *c, u_int *a); +PROTO_NORMAL(_Qp_sqrt); void _Qp_sqrt(u_int *c, u_int *a) { @@ -160,6 +173,7 @@ _Qp_sqrt(u_int *c, u_int *a) r = __fpu_sqrt(&fe); c[0] = __fpu_ftoq(&fe, r, c); } +DEF_STRONG(_Qp_sqrt); _QP_OP(add) _QP_OP(div) |