Module Name:    src
Committed By:   rin
Date:           Wed Sep  7 02:41:39 UTC 2022

Modified Files:
        src/sys/arch/powerpc/fpu: fpu_emu.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/powerpc/fpu/fpu_emu.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_emu.h
diff -u src/sys/arch/powerpc/fpu/fpu_emu.h:1.11 src/sys/arch/powerpc/fpu/fpu_emu.h:1.12
--- src/sys/arch/powerpc/fpu/fpu_emu.h:1.11	Tue Sep  6 23:07:53 2022
+++ src/sys/arch/powerpc/fpu/fpu_emu.h	Wed Sep  7 02:41:39 2022
@@ -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 @@ struct fpemu {
  * 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.
  */

Reply via email to