Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/fpu Turn fpu_sub() macro into static inline...



details:   https://anonhg.NetBSD.org/src/rev/3c2f6f18828b
branches:  trunk
changeset: 369904:3c2f6f18828b
user:      rin <rin%NetBSD.org@localhost>
date:      Wed Sep 07 02:41:39 2022 +0000

description:
Turn fpu_sub() macro into static inline function for clarity.
No binary changes.

diffstat:

 sys/arch/powerpc/fpu/fpu_emu.h |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r a32fb1deb57f -r 3c2f6f18828b sys/arch/powerpc/fpu/fpu_emu.h
--- a/sys/arch/powerpc/fpu/fpu_emu.h    Wed Sep 07 01:18:32 2022 +0000
+++ b/sys/arch/powerpc/fpu/fpu_emu.h    Wed Sep 07 02:41:39 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu_emu.h,v 1.11 2022/09/06 23:07:53 rin Exp $ */
+/*     $NetBSD: fpu_emu.h,v 1.12 2022/09/07 02:41:39 rin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -163,12 +163,20 @@
  * Each returns a pointer to the result and/or sets exceptions.
  */
 struct fpn *fpu_add(struct fpemu *);
-#define        fpu_sub(fe)                                                     \
-    ((ISNAN(&(fe)->fe_f2) ? 0 : ((fe)->fe_f2.fp_sign ^= 1)), fpu_add(fe))
 struct fpn *fpu_mul(struct fpemu *);
 struct fpn *fpu_div(struct fpemu *);
 struct fpn *fpu_sqrt(struct fpemu *);
 
+static inline struct fpn *
+fpu_sub(struct fpemu *fe)
+{
+       struct fpn *fp = &fe->fe_f2;
+
+       if (!ISNAN(fp))
+               fp->fp_sign ^= 1;
+       return fpu_add(fe);
+}
+
 /*
  * Other functions.
  */



Home | Main Index | Thread Index | Old Index