All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-06 17:25 ` Joseph Myers
  0 siblings, 0 replies; 20+ messages in thread
From: Joseph Myers @ 2015-02-06 17:25 UTC (permalink / raw)
  To: linux-kernel, linux-alpha, linuxppc-dev, linux-s390, linux-sh,
	sparclinux

The include/math-emu code (used for alpha powerpc s390 sh sparc) was
taken from an old version of glibc's soft-fp code around 15 years ago
(in the pre-git era, anyway, and some of the initial code may have
been developed around 1997-9 with a view to being used in both
places).  Since then, there have only been a handful of small changes
in the kernel version, while the glibc version has been extensively
developed, with many bug fixes, performance improvements and
miscellaneous cleanups, and is also now used in libgcc, including for
__float128 on x86_64 since GCC 4.3 (see
<https://ols.fedoraproject.org/GCC/Reprints-2006/sidwell-reprint.pdf>
for more information regarding performance improvements and use in
libgcc).

Thus the kernel version is missing those various improvements and it
would make sense to update it to include them (as was noted back in
2006 <https://sourceware.org/ml/libc-alpha/2006-02/msg00075.html> when
a large group of changes went into glibc).  I believe it also makes
sense to aim to have *exactly* the same code in both places to
simplify future updates of the kernel version.  (And in particular, as
external code imported largely verbatim into the kernel,
include/math-emu has never followed the kernel coding style and it
doesn't make sense for it to do so.)

I made an analysis of what kernel-local changes there were to this
code in <https://sourceware.org/ml/libc-alpha/2013-10/msg00345.html>,
and since then have added the various missing features to the glibc
version so that it is feature-complete regarding features used in the
kernel.  This patch updates the include/math-emu code, and its kernel
users, so that the shared code is the same as glibc's current soft-fp
code, except for the following:

(a) Multiple-include guards.

(b) Initializations in _FP_FRAC_DECL_* and _FP_DECL to avoid warnings
about possible uninitialized use (not appropriate in glibc; relevant
in the kernel because of large functions that do various unpacking,
conditionally, then use the results of unpacking, conditionally, where
it may not be visible to the compiler that variables are only used
after being initialized).

(c) Changes to how soft-fp.h includes other headers.

(d) Disabling the declaration of abort in soft-fp.h.

(c) and (d) are conditional on __KERNEL__, in the expectation that if
this goes into the kernel then those conditionals will go into glibc
and further reduce the differences between the two versions of the
code, and I may also look at how to avoid the differences in (a) and
(b) to make the versions identical; some form of multiple-include
guards could be added to glibc, but maybe not with the same names as
in the kernel; how strict is the kernel about rules for
multiple-include guard naming in imported code?  (Standard glibc
practice would be names such as SOFT_FP_DOUBLE_H, with op-*.h not
having such guards but instead having a #error if SOFT_FP_H, like
installed bits/*.h headers.)

At this point this patch is an RFC rather than yet being ready for
inclusion, because I've only tested it for powerpc (both e500 and
emulation of classic hard float); it's quite likely there are bugs in
the changes for other architectures, quite possibly breaking the
build.  I've also posted it to libc-alpha
<https://sourceware.org/ml/libc-alpha/2015-02/msg00107.html> with a
call for testing and notes on what testing might be appropriate.

The bulk of the changes are updating the code from glibc and a
detailed review of that part probably does not make sense in this
context if you want to aim for the same code in both places.  The
trickier part is the architecture updates for the various API changes
in soft-fp since the version used by the kernel.  The following
changes have occurred in the soft-fp API since the version used in the
kernel and so are addressed in the architecture updates in this patch.
(This list only includes changes relating to features used in the
kernel, not pure new features that aren't relevant to updating
existing code, and not pure bug fixes.)

* <https://sourceware.org/ml/libc-alpha/2006-02/msg00028.html>

  - Semi-raw unpacking is added, as something intermediate between raw
    and cooked unpacking, for efficiency.

  - Addition and subtraction are changed to work on semi-raw values.
    Thus, cooked results of multiplication can't be passed directly
    into addition, as was done in some kernel emulations of fused
    multiply-add, but that isn't a proper fused operation anyway (a
    proper fused operation involves using the unrounded multiplication
    result in twice the input precision, not an intermediate value in
    input precision plus three working bits); the appropriate fix is
    to use the new fused multiply-add support in soft-fp.

  - Conversions from one floating-point type to another now use
    FP_EXTEND (raw) and FP_TRUNC (semi-raw) instead of FP_CONV
    (cooked).  Those operations now deal with quieting signaling NaNs.

  - Conversions from floating-point to integer now use raw inputs, and
    require the integer variable passed to the FP_TO_INT macros to
    have unsigned type.

  - Conversions from integer to floating-point now use raw outputs.

* <https://sourceware.org/ml/libc-alpha/2006-02/msg00044.html>

  - Conversions from integer to floating-point now pass the name of an
    unsigned type to the FP_FROM_INT macros, not a signed type to
    which "unsigned" is added in the macro definition.

* <https://sourceware.org/ml/libc-alpha/2013-04/msg00646.html>

  - soft-fp supports the reversed quiet NaN convention used on MIPS
    and HPPA; sfp-machine.h must define _FP_QNANNEGATEDP (to 0, for
    architectures using the normal convention; to 1, for architectures
    using the MIPS convention).

* <https://sourceware.org/ml/libc-alpha/2013-10/msg00348.html>

  - Negation now works on raw values.

* <https://sourceware.org/ml/libc-alpha/2014-02/msg00068.html>

  - soft-fp now supports after-rounding tininess detection for
    architectures where that is the defined way in which tiny results
    are detected (of the architectures for which the Linux kernel uses
    this code, that's Alpha and SH).  sfp-machine.h must define
    _FP_TININESS_AFTER_ROUNDING to either 0 or 1.

* <https://sourceware.org/ml/libc-alpha/2014-09/msg00411.html>

  - FP_CLEAR_EXCEPTIONS is removed; all uses in the Linux kernel are
    no longer needed as, now unpacking only occurs in the correct
    format, exceptions are already clear at that point.

* <https://sourceware.org/ml/libc-alpha/2014-09/msg00461.html>

  - The FP_CMP macros have an extra argument to specify when
    exceptions should be set (0 for no exception setting, 1 for
    exceptions only for signaling NaNs, 2 for exceptions for all
    NaNs).  In the old version in the kernel, it was necessary for the
    caller to handle all exception setting for comparisons.

* <https://sourceware.org/ml/libc-alpha/2014-09/msg00488.html>

  - FP_DENORM_ZERO does not set "inexact" when flushing to zero, as
    that does not appear to match the documented semantics for either
    of the architectures (Alpha and SH) for which the kernel uses
    FP_DENORM_ZERO.  FP_DENORM_ZERO is also checked for comparisons
    (the documentation for both Alpha and SH is explicit that their
    corresponding control bits do apply to comparisons).

* <https://sourceware.org/ml/libc-alpha/2014-09/msg00462.html>

  - The more precise FP_EX_INVALID_* exceptions include more cases
    than in the kernel version (in particular, FP_EX_INVALID_IMZ_FMA
    is split out from FP_EX_INVALID_IMZ, so if only the latter is
    defined then fma using the new fma support would not raise that
    exception any more - except that this doesn't actually affect
    powerpc because it hardcodes setting various exceptions in
    powerpc-specific code despite also defining FP_EX_INVALID_*).

Generally this patch only does cleanups and bug fixes to
architecture-specific code when they are closely connected to API
changes in the new code (either required by such API changes, or the
new API means the idiomatic way to do something has changed).  Where
something was already odd with the old version of the code, or
apparently did not match documented instruction set semantics, it's
not changed if that seems unconnected to the update from glibc.  I've
noted various such cases (especially for powerpc) that may be
addressed in followup patch series once the main upgrade is in (or,
where the fix seems more complicated and difficult to fix without
convenient access to the architecture for testing, I may just list the
issues on the relevant architecture mailing list).

The following architecture-specific cleanups or bug fixes (that might
change how the emulation behaves, or that go beyond mechanical
conversion to new APIs) are included in this patch because of their
close connection to the API changes:

* Alpha and SH now use after-rounding tininess detection.

* On Alpha, extensions from single to double now use FP_EXTEND with
  raw unpacking instead of the previous hardcoded code with cooked
  unpacking; these should be equivalent and the new code, with the
  optimizations in FP_EXTEND relative to the old FP_CONV, should be as
  efficient as the previous hardcoded code.

* On PowerPC, S/390 and SH, fused multiply-add operations now use the
  new soft-fp fma support (meaning they are properly fused rather than
  only having 3 extra bits precision on the intermediate result of the
  multiplication).

* On PowerPC for SPE floating-point emulation, the pre-existing bug of
  comparisons using cooked unpacking is fixed (as the structure of the
  code meant unpacking types naturally needed specifying explicitly
  for all operations).  This should not in fact change how the
  emulation behaves, other than making it more efficient.  Various
  operations that should not have unpacked at all now no longer unpack
  instead of using cooked unpacking, so avoiding spurious exceptions
  on signaling NaNs (on the other case of arguments that are actually
  a different floating-point type but would wrongly be interpreted as
  signaling NaNs by the unpacking, FP_CLEAR_EXCEPTIONS may have
  avoided the issue).

* On S/390, negation / absolute value now use raw unpacking / packing,
  meaning SNaNs no longer generate exceptions, which is in accordance
  with the architecture documentation.

* On SPARC, comparisons now use raw unpacking (this should not in fact
  change how the emulation behaves, just make it more efficient).

Signed-off-by: Joseph Myers <joseph@codesourcery.com>

---

diff --git a/arch/alpha/include/asm/sfp-machine.h b/arch/alpha/include/asm/sfp-machine.h
index 5fe63af..96c266a 100644
--- a/arch/alpha/include/asm/sfp-machine.h
+++ b/arch/alpha/include/asm/sfp-machine.h
@@ -48,6 +48,7 @@
 #define _FP_NANSIGN_Q		1
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /* Alpha Architecture Handbook, 4.7.10.4 sais that
  * we should prefer any type of NaN in Fb, then Fa.
@@ -79,4 +80,6 @@
 /* We write the results always */
 #define FP_INHIBIT_RESULTS 0
 
+#define _FP_TININESS_AFTER_ROUNDING 1
+
 #endif
diff --git a/arch/alpha/math-emu/math.c b/arch/alpha/math-emu/math.c
index 58c2669..1fdb122 100644
--- a/arch/alpha/math-emu/math.c
+++ b/arch/alpha/math-emu/math.c
@@ -127,17 +127,27 @@ alpha_fp_emul (unsigned long pc)
 		va = alpha_read_fp_reg_s(fa);
 		vb = alpha_read_fp_reg_s(fb);
 		
-		FP_UNPACK_SP(SA, &va);
-		FP_UNPACK_SP(SB, &vb);
+		switch (func) {
+		case FOP_FNC_SUBx:
+		case FOP_FNC_ADDx:
+			FP_UNPACK_SEMIRAW_SP(SA, &va);
+			FP_UNPACK_SEMIRAW_SP(SB, &vb);
+			break;
+
+		default:
+			FP_UNPACK_SP(SA, &va);
+			FP_UNPACK_SP(SB, &vb);
+			break;
+		}
 
 		switch (func) {
 		case FOP_FNC_SUBx:
 			FP_SUB_S(SR, SA, SB);
-			goto pack_s;
+			goto pack_semiraw_s;
 
 		case FOP_FNC_ADDx:
 			FP_ADD_S(SR, SA, SB);
-			goto pack_s;
+			goto pack_semiraw_s;
 
 		case FOP_FNC_MULx:
 			FP_MUL_S(SR, SA, SB);
@@ -160,26 +170,10 @@ alpha_fp_emul (unsigned long pc)
 		if ((func & ~3) == FOP_FNC_CMPxUN) {
 			FP_UNPACK_RAW_DP(DA, &va);
 			FP_UNPACK_RAW_DP(DB, &vb);
-			if (!DA_e && !_FP_FRAC_ZEROP_1(DA)) {
-				FP_SET_EXCEPTION(FP_EX_DENORM);
-				if (FP_DENORM_ZERO)
-					_FP_FRAC_SET_1(DA, _FP_ZEROFRAC_1);
-			}
-			if (!DB_e && !_FP_FRAC_ZEROP_1(DB)) {
-				FP_SET_EXCEPTION(FP_EX_DENORM);
-				if (FP_DENORM_ZERO)
-					_FP_FRAC_SET_1(DB, _FP_ZEROFRAC_1);
-			}
-			FP_CMP_D(res, DA, DB, 3);
-			vc = 0x4000000000000000UL;
 			/* CMPTEQ, CMPTUN don't trap on QNaN,
 			   while CMPTLT and CMPTLE do */
-			if (res == 3
-			    && ((func & 3) >= 2
-				|| FP_ISSIGNAN_D(DA)
-				|| FP_ISSIGNAN_D(DB))) {
-				FP_SET_EXCEPTION(FP_EX_INVALID);
-			}
+			FP_CMP_D(res, DA, DB, 3, (func & 3) >= 2 ? 2 : 1);
+			vc = 0x4000000000000000UL;
 			switch (func) {
 			case FOP_FNC_CMPxUN: if (res != 3) vc = 0; break;
 			case FOP_FNC_CMPxEQ: if (res) vc = 0; break;
@@ -189,55 +183,64 @@ alpha_fp_emul (unsigned long pc)
 			goto done_d;
 		}
 
-		FP_UNPACK_DP(DA, &va);
-		FP_UNPACK_DP(DB, &vb);
-
 		switch (func) {
 		case FOP_FNC_SUBx:
-			FP_SUB_D(DR, DA, DB);
-			goto pack_d;
-
 		case FOP_FNC_ADDx:
-			FP_ADD_D(DR, DA, DB);
-			goto pack_d;
-
-		case FOP_FNC_MULx:
-			FP_MUL_D(DR, DA, DB);
-			goto pack_d;
-
-		case FOP_FNC_DIVx:
-			FP_DIV_D(DR, DA, DB);
-			goto pack_d;
-
-		case FOP_FNC_SQRTx:
-			FP_SQRT_D(DR, DB);
-			goto pack_d;
+			FP_UNPACK_SEMIRAW_DP(DA, &va);
+			FP_UNPACK_SEMIRAW_DP(DB, &vb);
+			break;
 
 		case FOP_FNC_CVTxS:
 			/* It is irritating that DEC encoded CVTST with
 			   SRC == T_floating.  It is also interesting that
 			   the bit used to tell the two apart is /U... */
 			if (insn & 0x2000) {
-				FP_CONV(S,D,1,1,SR,DB);
-				goto pack_s;
+				FP_UNPACK_SEMIRAW_DP(DB, &vb);
+				FP_TRUNC(S,D,1,1,SR,DB);
+				goto pack_semiraw_s;
 			} else {
 				vb = alpha_read_fp_reg_s(fb);
-				FP_UNPACK_SP(SB, &vb);
-				DR_c = DB_c;
-				DR_s = DB_s;
-				DR_e = DB_e + (1024 - 128);
-				DR_f = SB_f << (52 - 23);
-				goto pack_d;
+				FP_UNPACK_RAW_SP(SB, &vb);
+				FP_EXTEND(D,S,1,1,DR,SB);
+				goto pack_raw_d;
 			}
 
 		case FOP_FNC_CVTxQ:
-			if (DB_c == FP_CLS_NAN
+			FP_UNPACK_RAW_DP(DB, &vb);
+			if (DB_e == _FP_EXPMAX_D
 			    && (_FP_FRAC_HIGH_RAW_D(DB) & _FP_QNANBIT_D)) {
 			  /* AAHB Table B-2 says QNaN should not trigger INV */
 				vc = 0;
 			} else
 				FP_TO_INT_ROUND_D(vc, DB, 64, 2);
 			goto done_d;
+
+		default:
+			FP_UNPACK_DP(DA, &va);
+			FP_UNPACK_DP(DB, &vb);
+			break;
+		}
+
+		switch (func) {
+		case FOP_FNC_SUBx:
+			FP_SUB_D(DR, DA, DB);
+			goto pack_semiraw_d;
+
+		case FOP_FNC_ADDx:
+			FP_ADD_D(DR, DA, DB);
+			goto pack_semiraw_d;
+
+		case FOP_FNC_MULx:
+			FP_MUL_D(DR, DA, DB);
+			goto pack_d;
+
+		case FOP_FNC_DIVx:
+			FP_DIV_D(DR, DA, DB);
+			goto pack_d;
+
+		case FOP_FNC_SQRTx:
+			FP_SQRT_D(DR, DB);
+			goto pack_d;
 		}
 		goto bad_insn;
 
@@ -256,26 +259,44 @@ alpha_fp_emul (unsigned long pc)
 			goto done_d;
 
 		case FOP_FNC_CVTxS:
-			FP_FROM_INT_S(SR, ((long)vb), 64, long);
-			goto pack_s;
+			FP_FROM_INT_S(SR, ((long)vb), 64, unsigned long);
+			goto pack_raw_s;
 
 		case FOP_FNC_CVTxT:
-			FP_FROM_INT_D(DR, ((long)vb), 64, long);
-			goto pack_d;
+			FP_FROM_INT_D(DR, ((long)vb), 64, unsigned long);
+			goto pack_raw_d;
 		}
 		goto bad_insn;
 	}
 	goto bad_insn;
 
+pack_raw_s:
+	FP_PACK_RAW_SP(&vc, SR);
+	goto packed_s;
+
+pack_semiraw_s:
+	FP_PACK_SEMIRAW_SP(&vc, SR);
+	goto packed_s;
+
 pack_s:
 	FP_PACK_SP(&vc, SR);
+packed_s:
 	if ((_fex & FP_EX_UNDERFLOW) && (swcr & IEEE_MAP_UMZ))
 		vc = 0;
 	alpha_write_fp_reg_s(fc, vc);
 	goto done;
 
+pack_raw_d:
+	FP_PACK_RAW_DP(&vc, DR);
+	goto packed_d;
+
+pack_semiraw_d:
+	FP_PACK_SEMIRAW_DP(&vc, DR);
+	goto packed_d;
+
 pack_d:
 	FP_PACK_DP(&vc, DR);
+packed_d:
 	if ((_fex & FP_EX_UNDERFLOW) && (swcr & IEEE_MAP_UMZ))
 		vc = 0;
 done_d:
diff --git a/arch/powerpc/include/asm/sfp-machine.h b/arch/powerpc/include/asm/sfp-machine.h
index d89beab..607ee14 100644
--- a/arch/powerpc/include/asm/sfp-machine.h
+++ b/arch/powerpc/include/asm/sfp-machine.h
@@ -82,6 +82,9 @@
 #define _FP_MUL_MEAT_S(R,X,Y)   _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
 #define _FP_MUL_MEAT_D(R,X,Y)   _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
 
+#define _FP_MUL_MEAT_DW_S(R,X,Y)   _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_D(R,X,Y)   _FP_MUL_MEAT_DW_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+
 #define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv_norm(S,R,X,Y)
 #define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
 
@@ -96,6 +99,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 #ifdef FP_EX_BOOKE_E500_SPE
 #define FP_EX_INEXACT		(1 << 21)
@@ -178,15 +182,40 @@
 		_FP_PACK_RAW_2_P(D, val, X);				\
    } while (0)
 
+#define __FP_PACK_SEMIRAW_D(val,X)			\
+   do {									\
+	_FP_PACK_SEMIRAW(D, 2, X);					\
+	if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS))	\
+		_FP_PACK_RAW_2_P(D, val, X);				\
+   } while (0)
+
 #define __FP_PACK_DS(val,X)							\
    do {										\
 	   FP_DECL_S(__X);							\
-	   FP_CONV(S, D, 1, 2, __X, X);						\
+	   if (X##_c != FP_CLS_NAN)						\
+		   _FP_FRAC_SRS_2(X, _FP_WFRACBITS_D - _FP_WFRACBITS_S,		\
+			   _FP_WFRACBITS_D);					\
+	   else									\
+		   _FP_FRAC_SRL_2(X, _FP_WFRACBITS_D - _FP_WFRACBITS_S);	\
+	   _FP_FRAC_COPY_1_2(__X, X);						\
+	   __X##_e = X##_e;							\
+	   __X##_c = X##_c;							\
+	   __X##_s = X##_s;							\
 	   _FP_PACK_CANONICAL(S, 1, __X);					\
 	   if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS)) {	\
-		   _FP_UNPACK_CANONICAL(S, 1, __X);				\
-		   FP_CONV(D, S, 2, 1, X, __X);					\
-		   _FP_PACK_CANONICAL(D, 2, X);					\
+		   FP_EXTEND(D, S, 2, 1, X, __X);				\
+		   if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS))	\
+		   _FP_PACK_RAW_2_P(D, val, X);					\
+	   }									\
+   } while (0)
+
+#define __FP_PACK_SEMIRAW_DS(val,X)						\
+   do {										\
+	   FP_DECL_S(__X);							\
+	   FP_TRUNC(S, D, 1, 2, __X, X);					\
+	   _FP_PACK_SEMIRAW(S, 1, __X);						\
+	   if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS)) {	\
+		   FP_EXTEND(D, S, 2, 1, X, __X);				\
 		   if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS))	\
 		   _FP_PACK_RAW_2_P(D, val, X);					\
 	   }									\
@@ -198,6 +227,8 @@
 	__FPU_FPSCR & 0x3;		\
 })
 
+#define _FP_TININESS_AFTER_ROUNDING 0
+
 /* the asm fragments go here: all these are taken from glibc-2.0.5's
  * stdlib/longlong.h
  */
diff --git a/arch/powerpc/math-emu/fadd.c b/arch/powerpc/math-emu/fadd.c
index 0158a16..6deb27a 100644
--- a/arch/powerpc/math-emu/fadd.c
+++ b/arch/powerpc/math-emu/fadd.c
@@ -18,8 +18,8 @@ fadd(void *frD, void *frA, void *frB)
 	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
-	FP_UNPACK_DP(A, frA);
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_SEMIRAW_DP(A, frA);
+	FP_UNPACK_SEMIRAW_DP(B, frB);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
@@ -32,7 +32,7 @@ fadd(void *frD, void *frA, void *frB)
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	__FP_PACK_D(frD, R);
+	__FP_PACK_SEMIRAW_D(frD, R);
 
 	return FP_CUR_EXCEPTIONS;
 }
diff --git a/arch/powerpc/math-emu/fadds.c b/arch/powerpc/math-emu/fadds.c
index 5930f40..9e2fb9e 100644
--- a/arch/powerpc/math-emu/fadds.c
+++ b/arch/powerpc/math-emu/fadds.c
@@ -19,8 +19,8 @@ fadds(void *frD, void *frA, void *frB)
 	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
-	FP_UNPACK_DP(A, frA);
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_SEMIRAW_DP(A, frA);
+	FP_UNPACK_SEMIRAW_DP(B, frB);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
@@ -33,7 +33,7 @@ fadds(void *frD, void *frA, void *frB)
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	__FP_PACK_DS(frD, R);
+	__FP_PACK_SEMIRAW_DS(frD, R);
 
 	return FP_CUR_EXCEPTIONS;
 }
diff --git a/arch/powerpc/math-emu/fcmpo.c b/arch/powerpc/math-emu/fcmpo.c
index 5bce011..8ebdb28 100644
--- a/arch/powerpc/math-emu/fcmpo.c
+++ b/arch/powerpc/math-emu/fcmpo.c
@@ -30,7 +30,7 @@ fcmpo(u32 *ccr, int crfD, void *frA, void *frB)
 	if (A_c == FP_CLS_NAN || B_c == FP_CLS_NAN)
 		FP_SET_EXCEPTION(EFLAG_VXVC);
 
-	FP_CMP_D(cmp, A, B, 2);
+	FP_CMP_D(cmp, A, B, 2, 0);
 	cmp = code[(cmp + 1) & 3];
 
 	__FPU_FPSCR &= ~(0x1f000);
diff --git a/arch/powerpc/math-emu/fcmpu.c b/arch/powerpc/math-emu/fcmpu.c
index d4fb1ba..3b385c6 100644
--- a/arch/powerpc/math-emu/fcmpu.c
+++ b/arch/powerpc/math-emu/fcmpu.c
@@ -27,7 +27,7 @@ fcmpu(u32 *ccr, int crfD, void *frA, void *frB)
 	printk("B: %ld %lu %lu %ld (%ld)\n", B_s, B_f1, B_f0, B_e, B_c);
 #endif
 
-	FP_CMP_D(cmp, A, B, 2);
+	FP_CMP_D(cmp, A, B, 2, 0);
 	cmp = code[(cmp + 1) & 3];
 
 	__FPU_FPSCR &= ~(0x1f000);
diff --git a/arch/powerpc/math-emu/fctiw.c b/arch/powerpc/math-emu/fctiw.c
index f694440..9d7c7c9 100644
--- a/arch/powerpc/math-emu/fctiw.c
+++ b/arch/powerpc/math-emu/fctiw.c
@@ -13,7 +13,7 @@ fctiw(u32 *frD, void *frB)
 	FP_DECL_EX;
 	unsigned int r;
 
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_RAW_DP(B, frB);
 	FP_TO_INT_D(r, B, 32, 1);
 	frD[1] = r;
 
diff --git a/arch/powerpc/math-emu/fctiwz.c b/arch/powerpc/math-emu/fctiwz.c
index 71e782f..d55b3e7 100644
--- a/arch/powerpc/math-emu/fctiwz.c
+++ b/arch/powerpc/math-emu/fctiwz.c
@@ -18,7 +18,7 @@ fctiwz(u32 *frD, void *frB)
 	__FPU_FPSCR &= ~(3);
 	__FPU_FPSCR |= FP_RND_ZERO;
 
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_RAW_DP(B, frB);
 	FP_TO_INT_D(r, B, 32, 1);
 	frD[1] = r;
 
diff --git a/arch/powerpc/math-emu/fmadd.c b/arch/powerpc/math-emu/fmadd.c
index 8c3f20a..0f450fb 100644
--- a/arch/powerpc/math-emu/fmadd.c
+++ b/arch/powerpc/math-emu/fmadd.c
@@ -13,7 +13,6 @@ fmadd(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -34,12 +33,7 @@ fmadd(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
                 FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 #ifdef DEBUG
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
diff --git a/arch/powerpc/math-emu/fmadds.c b/arch/powerpc/math-emu/fmadds.c
index 794fb31..79885eb 100644
--- a/arch/powerpc/math-emu/fmadds.c
+++ b/arch/powerpc/math-emu/fmadds.c
@@ -14,7 +14,6 @@ fmadds(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -35,12 +34,7 @@ fmadds(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
                 FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 #ifdef DEBUG
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
diff --git a/arch/powerpc/math-emu/fmsub.c b/arch/powerpc/math-emu/fmsub.c
index 626f6fe..ee2385d 100644
--- a/arch/powerpc/math-emu/fmsub.c
+++ b/arch/powerpc/math-emu/fmsub.c
@@ -13,7 +13,6 @@ fmsub(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -34,15 +33,10 @@ fmsub(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
 		FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
 	if (B_c != FP_CLS_NAN)
 		B_s ^= 1;
 
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 #ifdef DEBUG
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
diff --git a/arch/powerpc/math-emu/fmsubs.c b/arch/powerpc/math-emu/fmsubs.c
index 3425bc8..fe081c0 100644
--- a/arch/powerpc/math-emu/fmsubs.c
+++ b/arch/powerpc/math-emu/fmsubs.c
@@ -14,7 +14,6 @@ fmsubs(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -35,15 +34,10 @@ fmsubs(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
 		FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
 	if (B_c != FP_CLS_NAN)
 		B_s ^= 1;
 
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 #ifdef DEBUG
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
diff --git a/arch/powerpc/math-emu/fnmadd.c b/arch/powerpc/math-emu/fnmadd.c
index e817bc5..330353e6 100644
--- a/arch/powerpc/math-emu/fnmadd.c
+++ b/arch/powerpc/math-emu/fnmadd.c
@@ -13,7 +13,6 @@ fnmadd(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -34,12 +33,7 @@ fnmadd(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
                 FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 	if (R_c != FP_CLS_NAN)
 		R_s ^= 1;
diff --git a/arch/powerpc/math-emu/fnmadds.c b/arch/powerpc/math-emu/fnmadds.c
index 4db4b7d..dd27045 100644
--- a/arch/powerpc/math-emu/fnmadds.c
+++ b/arch/powerpc/math-emu/fnmadds.c
@@ -14,7 +14,6 @@ fnmadds(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -35,12 +34,7 @@ fnmadds(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
                 FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 	if (R_c != FP_CLS_NAN)
 		R_s ^= 1;
diff --git a/arch/powerpc/math-emu/fnmsub.c b/arch/powerpc/math-emu/fnmsub.c
index f65979f..87c8b4c 100644
--- a/arch/powerpc/math-emu/fnmsub.c
+++ b/arch/powerpc/math-emu/fnmsub.c
@@ -13,7 +13,6 @@ fnmsub(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -34,15 +33,10 @@ fnmsub(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
 		FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
 	if (B_c != FP_CLS_NAN)
 		B_s ^= 1;
 
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 	if (R_c != FP_CLS_NAN)
 		R_s ^= 1;
diff --git a/arch/powerpc/math-emu/fnmsubs.c b/arch/powerpc/math-emu/fnmsubs.c
index 9021dac..72b860b 100644
--- a/arch/powerpc/math-emu/fnmsubs.c
+++ b/arch/powerpc/math-emu/fnmsubs.c
@@ -14,7 +14,6 @@ fnmsubs(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -35,15 +34,10 @@ fnmsubs(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
 		FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
 	if (B_c != FP_CLS_NAN)
 		B_s ^= 1;
 
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 	if (R_c != FP_CLS_NAN)
 		R_s ^= 1;
diff --git a/arch/powerpc/math-emu/fsub.c b/arch/powerpc/math-emu/fsub.c
index 02c5dff..8070976 100644
--- a/arch/powerpc/math-emu/fsub.c
+++ b/arch/powerpc/math-emu/fsub.c
@@ -18,8 +18,8 @@ fsub(void *frD, void *frA, void *frB)
 	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
-	FP_UNPACK_DP(A, frA);
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_SEMIRAW_DP(A, frA);
+	FP_UNPACK_SEMIRAW_DP(B, frB);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
@@ -38,7 +38,7 @@ fsub(void *frD, void *frA, void *frB)
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	__FP_PACK_D(frD, R);
+	__FP_PACK_SEMIRAW_D(frD, R);
 
 	return FP_CUR_EXCEPTIONS;
 }
diff --git a/arch/powerpc/math-emu/fsubs.c b/arch/powerpc/math-emu/fsubs.c
index 5d9b18c..5b96755 100644
--- a/arch/powerpc/math-emu/fsubs.c
+++ b/arch/powerpc/math-emu/fsubs.c
@@ -19,8 +19,8 @@ fsubs(void *frD, void *frA, void *frB)
 	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
-	FP_UNPACK_DP(A, frA);
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_SEMIRAW_DP(A, frA);
+	FP_UNPACK_SEMIRAW_DP(B, frB);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
@@ -39,7 +39,7 @@ fsubs(void *frD, void *frA, void *frB)
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	__FP_PACK_DS(frD, R);
+	__FP_PACK_SEMIRAW_DS(frD, R);
 
 	return FP_CUR_EXCEPTIONS;
 }
diff --git a/arch/powerpc/math-emu/lfs.c b/arch/powerpc/math-emu/lfs.c
index 434ed27..16da2c2 100644
--- a/arch/powerpc/math-emu/lfs.c
+++ b/arch/powerpc/math-emu/lfs.c
@@ -22,25 +22,20 @@ lfs(void *frD, void *ea)
 	if (copy_from_user(&f, ea, sizeof(float)))
 		return -EFAULT;
 
-	FP_UNPACK_S(A, f);
+	FP_UNPACK_RAW_S(A, f);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %ld (%ld) [%08lx]\n", A_s, A_f, A_e, A_c,
 	       *(unsigned long *)&f);
 #endif
 
-	FP_CONV(D, S, 2, 1, R, A);
+	_FP_EXTEND_CNAN(D, S, 2, 1, R, A, 0);
 
 #ifdef DEBUG
 	printk("R: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	if (R_c == FP_CLS_NAN) {
-		R_e = _FP_EXPMAX_D;
-		_FP_PACK_RAW_2_P(D, frD, R);
-	} else {
-		__FP_PACK_D(frD, R);
-	}
+	FP_PACK_RAW_DP(frD, R);
 
 	return 0;
 }
diff --git a/arch/powerpc/math-emu/math_efp.c b/arch/powerpc/math-emu/math_efp.c
index 28337c9..833394c 100644
--- a/arch/powerpc/math-emu/math_efp.c
+++ b/arch/powerpc/math-emu/math_efp.c
@@ -99,6 +99,11 @@
 #define XB	4
 #define XCR	5
 #define NOTYPE	0
+#define TYPE_MASK	7
+#define UNONE	0
+#define URAW	8
+#define USEMI	16
+#define UCOOK	24
 
 #define SIGN_BIT_S	(1UL << 31)
 #define SIGN_BIT_D	(1ULL << 63)
@@ -114,64 +119,64 @@ union dw_union {
 
 static unsigned long insn_type(unsigned long speinsn)
 {
-	unsigned long ret = NOTYPE;
+	unsigned long ret = NOTYPE|UNONE;
 
 	switch (speinsn & 0x7ff) {
-	case EFSABS:	ret = XA;	break;
-	case EFSADD:	ret = AB;	break;
-	case EFSCFD:	ret = XB;	break;
-	case EFSCMPEQ:	ret = XCR;	break;
-	case EFSCMPGT:	ret = XCR;	break;
-	case EFSCMPLT:	ret = XCR;	break;
-	case EFSCTSF:	ret = XB;	break;
-	case EFSCTSI:	ret = XB;	break;
-	case EFSCTSIZ:	ret = XB;	break;
-	case EFSCTUF:	ret = XB;	break;
-	case EFSCTUI:	ret = XB;	break;
-	case EFSCTUIZ:	ret = XB;	break;
-	case EFSDIV:	ret = AB;	break;
-	case EFSMUL:	ret = AB;	break;
-	case EFSNABS:	ret = XA;	break;
-	case EFSNEG:	ret = XA;	break;
-	case EFSSUB:	ret = AB;	break;
-	case EFSCFSI:	ret = XB;	break;
-
-	case EVFSABS:	ret = XA;	break;
-	case EVFSADD:	ret = AB;	break;
-	case EVFSCMPEQ:	ret = XCR;	break;
-	case EVFSCMPGT:	ret = XCR;	break;
-	case EVFSCMPLT:	ret = XCR;	break;
-	case EVFSCTSF:	ret = XB;	break;
-	case EVFSCTSI:	ret = XB;	break;
-	case EVFSCTSIZ:	ret = XB;	break;
-	case EVFSCTUF:	ret = XB;	break;
-	case EVFSCTUI:	ret = XB;	break;
-	case EVFSCTUIZ:	ret = XB;	break;
-	case EVFSDIV:	ret = AB;	break;
-	case EVFSMUL:	ret = AB;	break;
-	case EVFSNABS:	ret = XA;	break;
-	case EVFSNEG:	ret = XA;	break;
-	case EVFSSUB:	ret = AB;	break;
-
-	case EFDABS:	ret = XA;	break;
-	case EFDADD:	ret = AB;	break;
-	case EFDCFS:	ret = XB;	break;
-	case EFDCMPEQ:	ret = XCR;	break;
-	case EFDCMPGT:	ret = XCR;	break;
-	case EFDCMPLT:	ret = XCR;	break;
-	case EFDCTSF:	ret = XB;	break;
-	case EFDCTSI:	ret = XB;	break;
-	case EFDCTSIDZ:	ret = XB;	break;
-	case EFDCTSIZ:	ret = XB;	break;
-	case EFDCTUF:	ret = XB;	break;
-	case EFDCTUI:	ret = XB;	break;
-	case EFDCTUIDZ:	ret = XB;	break;
-	case EFDCTUIZ:	ret = XB;	break;
-	case EFDDIV:	ret = AB;	break;
-	case EFDMUL:	ret = AB;	break;
-	case EFDNABS:	ret = XA;	break;
-	case EFDNEG:	ret = XA;	break;
-	case EFDSUB:	ret = AB;	break;
+	case EFSABS:	ret = XA|UNONE;	break;
+	case EFSADD:	ret = AB|USEMI;	break;
+	case EFSCFD:	ret = XB|UNONE;	break;
+	case EFSCMPEQ:	ret = XCR|URAW;	break;
+	case EFSCMPGT:	ret = XCR|URAW;	break;
+	case EFSCMPLT:	ret = XCR|URAW;	break;
+	case EFSCTSF:	ret = XB|URAW;	break;
+	case EFSCTSI:	ret = XB|URAW;	break;
+	case EFSCTSIZ:	ret = XB|URAW;	break;
+	case EFSCTUF:	ret = XB|URAW;	break;
+	case EFSCTUI:	ret = XB|URAW;	break;
+	case EFSCTUIZ:	ret = XB|URAW;	break;
+	case EFSDIV:	ret = AB|UCOOK;	break;
+	case EFSMUL:	ret = AB|UCOOK;	break;
+	case EFSNABS:	ret = XA|UNONE;	break;
+	case EFSNEG:	ret = XA|UNONE;	break;
+	case EFSSUB:	ret = AB|USEMI;	break;
+	case EFSCFSI:	ret = XB|UNONE;	break;
+
+	case EVFSABS:	ret = XA|UNONE;	break;
+	case EVFSADD:	ret = AB|USEMI;	break;
+	case EVFSCMPEQ:	ret = XCR|URAW;	break;
+	case EVFSCMPGT:	ret = XCR|URAW;	break;
+	case EVFSCMPLT:	ret = XCR|URAW;	break;
+	case EVFSCTSF:	ret = XB|URAW;	break;
+	case EVFSCTSI:	ret = XB|URAW;	break;
+	case EVFSCTSIZ:	ret = XB|URAW;	break;
+	case EVFSCTUF:	ret = XB|URAW;	break;
+	case EVFSCTUI:	ret = XB|URAW;	break;
+	case EVFSCTUIZ:	ret = XB|URAW;	break;
+	case EVFSDIV:	ret = AB|UCOOK;	break;
+	case EVFSMUL:	ret = AB|UCOOK;	break;
+	case EVFSNABS:	ret = XA|UNONE;	break;
+	case EVFSNEG:	ret = XA|UNONE;	break;
+	case EVFSSUB:	ret = AB|USEMI;	break;
+
+	case EFDABS:	ret = XA|UNONE;	break;
+	case EFDADD:	ret = AB|USEMI;	break;
+	case EFDCFS:	ret = XB|UNONE;	break;
+	case EFDCMPEQ:	ret = XCR|URAW;	break;
+	case EFDCMPGT:	ret = XCR|URAW;	break;
+	case EFDCMPLT:	ret = XCR|URAW;	break;
+	case EFDCTSF:	ret = XB|URAW;	break;
+	case EFDCTSI:	ret = XB|URAW;	break;
+	case EFDCTSIDZ:	ret = XB|URAW;	break;
+	case EFDCTSIZ:	ret = XB|URAW;	break;
+	case EFDCTUF:	ret = XB|URAW;	break;
+	case EFDCTUI:	ret = XB|URAW;	break;
+	case EFDCTUIDZ:	ret = XB|URAW;	break;
+	case EFDCTUIZ:	ret = XB|URAW;	break;
+	case EFDDIV:	ret = AB|UCOOK;	break;
+	case EFDMUL:	ret = AB|UCOOK;	break;
+	case EFDNABS:	ret = XA|UNONE;	break;
+	case EFDNEG:	ret = XA|UNONE;	break;
+	case EFDSUB:	ret = AB|USEMI;	break;
 	}
 
 	return ret;
@@ -191,7 +196,7 @@ int do_spe_mathemu(struct pt_regs *regs)
 		return -EINVAL;         /* not an spe instruction */
 
 	type = insn_type(speinsn);
-	if (type == NOTYPE)
+	if (type == (NOTYPE|UNONE))
 		goto illegal;
 
 	func = speinsn & 0x7ff;
@@ -219,14 +224,18 @@ int do_spe_mathemu(struct pt_regs *regs)
 		FP_DECL_S(SA); FP_DECL_S(SB); FP_DECL_S(SR);
 
 		switch (type) {
-		case AB:
-		case XCR:
-			FP_UNPACK_SP(SA, va.wp + 1);
-		case XB:
-			FP_UNPACK_SP(SB, vb.wp + 1);
+		case XCR|URAW:
+			FP_UNPACK_RAW_SP(SA, va.wp + 1);
+		case XB|URAW:
+			FP_UNPACK_RAW_SP(SB, vb.wp + 1);
+			break;
+		case AB|USEMI:
+			FP_UNPACK_SEMIRAW_SP(SA, va.wp + 1);
+			FP_UNPACK_SEMIRAW_SP(SB, vb.wp + 1);
 			break;
-		case XA:
+		case AB|UCOOK:
 			FP_UNPACK_SP(SA, va.wp + 1);
+			FP_UNPACK_SP(SB, vb.wp + 1);
 			break;
 		}
 
@@ -248,11 +257,11 @@ int do_spe_mathemu(struct pt_regs *regs)
 
 		case EFSADD:
 			FP_ADD_S(SR, SA, SB);
-			goto pack_s;
+			goto pack_semiraw_s;
 
 		case EFSSUB:
 			FP_SUB_S(SR, SA, SB);
-			goto pack_s;
+			goto pack_semiraw_s;
 
 		case EFSMUL:
 			FP_MUL_S(SR, SA, SB);
@@ -288,14 +297,13 @@ int do_spe_mathemu(struct pt_regs *regs)
 
 		case EFSCFD: {
 			FP_DECL_D(DB);
-			FP_CLEAR_EXCEPTIONS;
-			FP_UNPACK_DP(DB, vb.dp);
+			FP_UNPACK_SEMIRAW_DP(DB, vb.dp);
 
-			pr_debug("DB: %ld %08lx %08lx %ld (%ld)\n",
-					DB_s, DB_f1, DB_f0, DB_e, DB_c);
+			pr_debug("DB: %ld %08lx %08lx %ld\n",
+					DB_s, DB_f1, DB_f0, DB_e);
 
-			FP_CONV(S, D, 1, 2, SR, DB);
-			goto pack_s;
+			FP_TRUNC(S, D, 1, 2, SR, DB);
+			goto pack_semiraw_s;
 		}
 
 		case EFSCTSI:
@@ -325,6 +333,12 @@ int do_spe_mathemu(struct pt_regs *regs)
 		}
 		break;
 
+pack_semiraw_s:
+		pr_debug("SR: %ld %08lx %ld\n", SR_s, SR_f, SR_e);
+
+		FP_PACK_SEMIRAW_SP(vc.wp + 1, SR);
+		goto update_regs;
+
 pack_s:
 		pr_debug("SR: %ld %08lx %ld (%ld)\n", SR_s, SR_f, SR_e, SR_c);
 
@@ -332,9 +346,7 @@ pack_s:
 		goto update_regs;
 
 cmp_s:
-		FP_CMP_S(IR, SA, SB, 3);
-		if (IR == 3 && (FP_ISSIGNAN_S(SA) || FP_ISSIGNAN_S(SB)))
-			FP_SET_EXCEPTION(FP_EX_INVALID);
+		FP_CMP_S(IR, SA, SB, 3, 1);
 		if (IR == cmp) {
 			IR = 0x4;
 		} else {
@@ -347,14 +359,18 @@ cmp_s:
 		FP_DECL_D(DA); FP_DECL_D(DB); FP_DECL_D(DR);
 
 		switch (type) {
-		case AB:
-		case XCR:
-			FP_UNPACK_DP(DA, va.dp);
-		case XB:
-			FP_UNPACK_DP(DB, vb.dp);
+		case XCR|URAW:
+			FP_UNPACK_RAW_DP(DA, va.dp);
+		case XB|URAW:
+			FP_UNPACK_RAW_DP(DB, vb.dp);
 			break;
-		case XA:
+		case AB|USEMI:
+			FP_UNPACK_SEMIRAW_DP(DA, va.dp);
+			FP_UNPACK_SEMIRAW_DP(DB, vb.dp);
+			break;
+		case AB|UCOOK:
 			FP_UNPACK_DP(DA, va.dp);
+			FP_UNPACK_DP(DB, vb.dp);
 			break;
 		}
 
@@ -378,11 +394,11 @@ cmp_s:
 
 		case EFDADD:
 			FP_ADD_D(DR, DA, DB);
-			goto pack_d;
+			goto pack_semiraw_d;
 
 		case EFDSUB:
 			FP_SUB_D(DR, DA, DB);
-			goto pack_d;
+			goto pack_semiraw_d;
 
 		case EFDMUL:
 			FP_MUL_D(DR, DA, DB);
@@ -418,14 +434,13 @@ cmp_s:
 
 		case EFDCFS: {
 			FP_DECL_S(SB);
-			FP_CLEAR_EXCEPTIONS;
-			FP_UNPACK_SP(SB, vb.wp + 1);
+			FP_UNPACK_RAW_SP(SB, vb.wp + 1);
 
-			pr_debug("SB: %ld %08lx %ld (%ld)\n",
-					SB_s, SB_f, SB_e, SB_c);
+			pr_debug("SB: %ld %08lx %ld\n",
+					SB_s, SB_f, SB_e);
 
-			FP_CONV(D, S, 2, 1, DR, SB);
-			goto pack_d;
+			FP_EXTEND(D, S, 2, 1, DR, SB);
+			goto pack_raw_d;
 		}
 
 		case EFDCTUIDZ:
@@ -466,6 +481,20 @@ cmp_s:
 		}
 		break;
 
+pack_raw_d:
+		pr_debug("DR: %ld %08lx %08lx %ld\n",
+				DR_s, DR_f1, DR_f0, DR_e);
+
+		FP_PACK_RAW_DP(vc.dp, DR);
+		goto update_regs;
+
+pack_semiraw_d:
+		pr_debug("DR: %ld %08lx %08lx %ld\n",
+				DR_s, DR_f1, DR_f0, DR_e);
+
+		FP_PACK_SEMIRAW_DP(vc.dp, DR);
+		goto update_regs;
+
 pack_d:
 		pr_debug("DR: %ld %08lx %08lx %ld (%ld)\n",
 				DR_s, DR_f1, DR_f0, DR_e, DR_c);
@@ -474,9 +503,7 @@ pack_d:
 		goto update_regs;
 
 cmp_d:
-		FP_CMP_D(IR, DA, DB, 3);
-		if (IR == 3 && (FP_ISSIGNAN_D(DA) || FP_ISSIGNAN_D(DB)))
-			FP_SET_EXCEPTION(FP_EX_INVALID);
+		FP_CMP_D(IR, DA, DB, 3, 1);
 		if (IR == cmp) {
 			IR = 0x4;
 		} else {
@@ -492,18 +519,25 @@ cmp_d:
 		int IR0, IR1;
 
 		switch (type) {
-		case AB:
-		case XCR:
+		case XCR|URAW:
+			FP_UNPACK_RAW_SP(SA0, va.wp);
+			FP_UNPACK_RAW_SP(SA1, va.wp + 1);
+		case XB|URAW:
+			FP_UNPACK_RAW_SP(SB0, vb.wp);
+			FP_UNPACK_RAW_SP(SB1, vb.wp + 1);
+			break;
+		case AB|USEMI:
+			FP_UNPACK_SEMIRAW_SP(SA0, va.wp);
+			FP_UNPACK_SEMIRAW_SP(SA1, va.wp + 1);
+			FP_UNPACK_SEMIRAW_SP(SB0, vb.wp);
+			FP_UNPACK_SEMIRAW_SP(SB1, vb.wp + 1);
+			break;
+		case AB|UCOOK:
 			FP_UNPACK_SP(SA0, va.wp);
 			FP_UNPACK_SP(SA1, va.wp + 1);
-		case XB:
 			FP_UNPACK_SP(SB0, vb.wp);
 			FP_UNPACK_SP(SB1, vb.wp + 1);
 			break;
-		case XA:
-			FP_UNPACK_SP(SA0, va.wp);
-			FP_UNPACK_SP(SA1, va.wp + 1);
-			break;
 		}
 
 		pr_debug("SA0: %ld %08lx %ld (%ld)\n",
@@ -534,12 +568,12 @@ cmp_d:
 		case EVFSADD:
 			FP_ADD_S(SR0, SA0, SB0);
 			FP_ADD_S(SR1, SA1, SB1);
-			goto pack_vs;
+			goto pack_semiraw_vs;
 
 		case EVFSSUB:
 			FP_SUB_S(SR0, SA0, SB0);
 			FP_SUB_S(SR1, SA1, SB1);
-			goto pack_vs;
+			goto pack_semiraw_vs;
 
 		case EVFSMUL:
 			FP_MUL_S(SR0, SA0, SB0);
@@ -624,6 +658,16 @@ cmp_d:
 		}
 		break;
 
+pack_semiraw_vs:
+		pr_debug("SR0: %ld %08lx %ld\n",
+				SR0_s, SR0_f, SR0_e);
+		pr_debug("SR1: %ld %08lx %ld\n",
+				SR1_s, SR1_f, SR1_e);
+
+		FP_PACK_SEMIRAW_SP(vc.wp, SR0);
+		FP_PACK_SEMIRAW_SP(vc.wp + 1, SR1);
+		goto update_regs;
+
 pack_vs:
 		pr_debug("SR0: %ld %08lx %ld (%ld)\n",
 				SR0_s, SR0_f, SR0_e, SR0_c);
@@ -638,12 +682,8 @@ cmp_vs:
 		{
 			int ch, cl;
 
-			FP_CMP_S(IR0, SA0, SB0, 3);
-			FP_CMP_S(IR1, SA1, SB1, 3);
-			if (IR0 == 3 && (FP_ISSIGNAN_S(SA0) || FP_ISSIGNAN_S(SB0)))
-				FP_SET_EXCEPTION(FP_EX_INVALID);
-			if (IR1 == 3 && (FP_ISSIGNAN_S(SA1) || FP_ISSIGNAN_S(SB1)))
-				FP_SET_EXCEPTION(FP_EX_INVALID);
+			FP_CMP_S(IR0, SA0, SB0, 3, 1);
+			FP_CMP_S(IR1, SA1, SB1, 3, 1);
 			ch = (IR0 == cmp) ? 1 : 0;
 			cl = (IR1 == cmp) ? 1 : 0;
 			IR = (ch << 3) | (cl << 2) | ((ch | cl) << 1) |
@@ -737,7 +777,7 @@ int speround_handler(struct pt_regs *regs)
 		return -EINVAL;         /* not an spe instruction */
 
 	func = speinsn & 0x7ff;
-	type = insn_type(func);
+	type = insn_type(func) & TYPE_MASK;
 	if (type == XCR) return -ENOSYS;
 
 	__FPU_FPSCR = mfspr(SPRN_SPEFSCR);
diff --git a/arch/powerpc/math-emu/stfs.c b/arch/powerpc/math-emu/stfs.c
index 6122147..6072b14 100644
--- a/arch/powerpc/math-emu/stfs.c
+++ b/arch/powerpc/math-emu/stfs.c
@@ -19,19 +19,19 @@ stfs(void *frS, void *ea)
 	printk("%s: S %p, ea %p\n", __func__, frS, ea);
 #endif
 
-	FP_UNPACK_DP(A, frS);
+	FP_UNPACK_SEMIRAW_DP(A, frS);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
 #endif
 
-	FP_CONV(S, D, 1, 2, R, A);
+	FP_TRUNC(S, D, 1, 2, R, A);
 
 #ifdef DEBUG
 	printk("R: %ld %lu %ld (%ld)\n", R_s, R_f, R_e, R_c);
 #endif
 
-	_FP_PACK_CANONICAL(S, 1, R);
+	_FP_PACK_SEMIRAW(S, 1, R);
 	if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS)) {
 		_FP_PACK_RAW_1_P(S, &f, R);
 		if (copy_to_user(ea, &f, sizeof(float)))
diff --git a/arch/s390/include/asm/sfp-machine.h b/arch/s390/include/asm/sfp-machine.h
index 4e16aed..67f9eed 100644
--- a/arch/s390/include/asm/sfp-machine.h
+++ b/arch/s390/include/asm/sfp-machine.h
@@ -38,6 +38,13 @@
 #define _FP_MUL_MEAT_Q(R,X,Y)					\
   _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
 
+#define _FP_MUL_MEAT_DW_S(R,X,Y)				\
+  _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_D(R,X,Y)				\
+  _FP_MUL_MEAT_DW_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_Q(R,X,Y)				\
+  _FP_MUL_MEAT_DW_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
 #define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv(S,R,X,Y)
 #define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
 #define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
@@ -50,6 +57,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /*
  * If one NaN is signaling and the other is not,
@@ -139,4 +147,6 @@
 /* We write the results always */
 #define FP_INHIBIT_RESULTS 0
 
+#define _FP_TININESS_AFTER_ROUNDING 0
+
 #endif
diff --git a/arch/s390/math-emu/math.c b/arch/s390/math-emu/math.c
index a6ba0d7..4dd5015 100644
--- a/arch/s390/math-emu/math.c
+++ b/arch/s390/math-emu/math.c
@@ -152,12 +152,12 @@ static int emu_axbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[rx].ui;
         cvt.w.low = current->thread.fp_regs.fprs[rx+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_SEMIRAW_QP(QA, &cvt.ld);
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QB, &cvt.ld);
+        FP_UNPACK_SEMIRAW_QP(QB, &cvt.ld);
         FP_ADD_Q(QR, QA, QB);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_PACK_SEMIRAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         emu_set_CC_cs(regs, QR_c, QR_s);
@@ -171,10 +171,10 @@ static int emu_adbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-        FP_UNPACK_DP(DB, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+        FP_UNPACK_SEMIRAW_DP(DB, &current->thread.fp_regs.fprs[ry].d);
         FP_ADD_D(DR, DA, DB);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -186,10 +186,10 @@ static int emu_adb (struct pt_regs *regs, int rx, double *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-        FP_UNPACK_DP(DB, val);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+        FP_UNPACK_SEMIRAW_DP(DB, val);
         FP_ADD_D(DR, DA, DB);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -201,10 +201,10 @@ static int emu_aebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-        FP_UNPACK_SP(SB, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_SEMIRAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+        FP_UNPACK_SEMIRAW_SP(SB, &current->thread.fp_regs.fprs[ry].f);
         FP_ADD_S(SR, SA, SB);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
@@ -216,10 +216,10 @@ static int emu_aeb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-        FP_UNPACK_SP(SB, val);
+        FP_UNPACK_SEMIRAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+        FP_UNPACK_SEMIRAW_SP(SB, val);
         FP_ADD_S(SR, SA, SB);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
@@ -236,7 +236,7 @@ static int emu_cxbr (struct pt_regs *regs, int rx, int ry) {
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
         FP_UNPACK_RAW_QP(QB, &cvt.ld);
-        FP_CMP_Q(IR, QA, QB, 3);
+        FP_CMP_Q(IR, QA, QB, 3, 0);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
@@ -252,7 +252,7 @@ static int emu_cdbr (struct pt_regs *regs, int rx, int ry) {
 
         FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_RAW_DP(DB, &current->thread.fp_regs.fprs[ry].d);
-        FP_CMP_D(IR, DA, DB, 3);
+        FP_CMP_D(IR, DA, DB, 3, 0);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
@@ -268,7 +268,7 @@ static int emu_cdb (struct pt_regs *regs, int rx, double *val) {
 
         FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_RAW_DP(DB, val);
-        FP_CMP_D(IR, DA, DB, 3);
+        FP_CMP_D(IR, DA, DB, 3, 0);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
@@ -284,7 +284,7 @@ static int emu_cebr (struct pt_regs *regs, int rx, int ry) {
 
         FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_RAW_SP(SB, &current->thread.fp_regs.fprs[ry].f);
-        FP_CMP_S(IR, SA, SB, 3);
+        FP_CMP_S(IR, SA, SB, 3, 0);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
@@ -300,7 +300,7 @@ static int emu_ceb (struct pt_regs *regs, int rx, float *val) {
 
         FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_RAW_SP(SB, val);
-        FP_CMP_S(IR, SA, SB, 3);
+        FP_CMP_S(IR, SA, SB, 3, 0);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
@@ -322,14 +322,12 @@ static int emu_kxbr (struct pt_regs *regs, int rx, int ry) {
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
         FP_UNPACK_QP(QB, &cvt.ld);
-        FP_CMP_Q(IR, QA, QB, 3);
+        FP_CMP_Q(IR, QA, QB, 3, 2);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
          */
         emu_set_CC(regs, (IR == -1) ? 1 : (IR == 1) ? 2 : IR);
-        if (IR == 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -341,14 +339,12 @@ static int emu_kdbr (struct pt_regs *regs, int rx, int ry) {
 
         FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_RAW_DP(DB, &current->thread.fp_regs.fprs[ry].d);
-        FP_CMP_D(IR, DA, DB, 3);
+        FP_CMP_D(IR, DA, DB, 3, 2);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
          */
         emu_set_CC(regs, (IR == -1) ? 1 : (IR == 1) ? 2 : IR);
-        if (IR == 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -360,14 +356,12 @@ static int emu_kdb (struct pt_regs *regs, int rx, double *val) {
 
         FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_RAW_DP(DB, val);
-        FP_CMP_D(IR, DA, DB, 3);
+        FP_CMP_D(IR, DA, DB, 3, 2);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
          */
         emu_set_CC(regs, (IR == -1) ? 1 : (IR == 1) ? 2 : IR);
-        if (IR == 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -379,14 +373,12 @@ static int emu_kebr (struct pt_regs *regs, int rx, int ry) {
 
         FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_RAW_SP(SB, &current->thread.fp_regs.fprs[ry].f);
-        FP_CMP_S(IR, SA, SB, 3);
+        FP_CMP_S(IR, SA, SB, 3, 2);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
          */
         emu_set_CC(regs, (IR == -1) ? 1 : (IR == 1) ? 2 : IR);
-        if (IR == 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -398,14 +390,12 @@ static int emu_keb (struct pt_regs *regs, int rx, float *val) {
 
         FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_RAW_SP(SB, val);
-        FP_CMP_S(IR, SA, SB, 3);
+        FP_CMP_S(IR, SA, SB, 3, 2);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
          */
         emu_set_CC(regs, (IR == -1) ? 1 : (IR == 1) ? 2 : IR);
-        if (IR == 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -419,8 +409,8 @@ static int emu_cxfbr (struct pt_regs *regs, int rx, int ry) {
 
 	mode = current->thread.fp_regs.fpc & 3;
         si = regs->gprs[ry];
-        FP_FROM_INT_Q(QR, si, 32, int);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_FROM_INT_Q(QR, si, 32, unsigned int);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -435,8 +425,8 @@ static int emu_cdfbr (struct pt_regs *regs, int rx, int ry) {
 
 	mode = current->thread.fp_regs.fpc & 3;
         si = regs->gprs[ry];
-        FP_FROM_INT_D(DR, si, 32, int);
-        FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+        FP_FROM_INT_D(DR, si, 32, unsigned int);
+        FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
 }
 
@@ -449,8 +439,8 @@ static int emu_cefbr (struct pt_regs *regs, int rx, int ry) {
 
 	mode = current->thread.fp_regs.fpc & 3;
         si = regs->gprs[ry];
-        FP_FROM_INT_S(SR, si, 32, int);
-        FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+        FP_FROM_INT_S(SR, si, 32, unsigned int);
+        FP_PACK_RAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         return _fex;
 }
 
@@ -459,7 +449,7 @@ static int emu_cfxbr (struct pt_regs *regs, int rx, int ry, int mask) {
         FP_DECL_Q(QA);
         FP_DECL_EX;
 	mathemu_ldcv cvt;
-        __s32 si;
+        __u32 ui;
         int mode;
 
 	if (mask == 0)
@@ -470,9 +460,9 @@ static int emu_cfxbr (struct pt_regs *regs, int rx, int ry, int mask) {
 		mode = mask - 4;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
-        FP_TO_INT_ROUND_Q(si, QA, 32, 1);
-        regs->gprs[rx] = si;
+        FP_UNPACK_RAW_QP(QA, &cvt.ld);
+        FP_TO_INT_ROUND_Q(ui, QA, 32, 1);
+        regs->gprs[rx] = ui;
         emu_set_CC_cs(regs, QA_c, QA_s);
         return _fex;
 }
@@ -481,7 +471,7 @@ static int emu_cfxbr (struct pt_regs *regs, int rx, int ry, int mask) {
 static int emu_cfdbr (struct pt_regs *regs, int rx, int ry, int mask) {
         FP_DECL_D(DA);
         FP_DECL_EX;
-        __s32 si;
+        __u32 ui;
         int mode;
 
 	if (mask == 0)
@@ -490,9 +480,9 @@ static int emu_cfdbr (struct pt_regs *regs, int rx, int ry, int mask) {
 		mode = FP_RND_NEAREST;
 	else
 		mode = mask - 4;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
-        FP_TO_INT_ROUND_D(si, DA, 32, 1);
-        regs->gprs[rx] = si;
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+        FP_TO_INT_ROUND_D(ui, DA, 32, 1);
+        regs->gprs[rx] = ui;
         emu_set_CC_cs(regs, DA_c, DA_s);
         return _fex;
 }
@@ -501,7 +491,7 @@ static int emu_cfdbr (struct pt_regs *regs, int rx, int ry, int mask) {
 static int emu_cfebr (struct pt_regs *regs, int rx, int ry, int mask) {
         FP_DECL_S(SA);
         FP_DECL_EX;
-        __s32 si;
+        __u32 ui;
         int mode;
 
 	if (mask == 0)
@@ -510,9 +500,9 @@ static int emu_cfebr (struct pt_regs *regs, int rx, int ry, int mask) {
 		mode = FP_RND_NEAREST;
 	else
 		mode = mask - 4;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
-        FP_TO_INT_ROUND_S(si, SA, 32, 1);
-        regs->gprs[rx] = si;
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+        FP_TO_INT_ROUND_S(ui, SA, 32, 1);
+        regs->gprs[rx] = ui;
         emu_set_CC_cs(regs, SA_c, SA_s);
         return _fex;
 }
@@ -662,9 +652,9 @@ static int emu_lcxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_RAW_QP(QA, &cvt.ld);
 	FP_NEG_Q(QR, QA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         emu_set_CC_cs(regs, QR_c, QR_s);
@@ -678,9 +668,9 @@ static int emu_lcdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
 	FP_NEG_D(DR, DA);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -692,9 +682,9 @@ static int emu_lcebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
 	FP_NEG_S(SR, SA);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_RAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
@@ -773,9 +763,9 @@ static int emu_lxdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
-	FP_CONV (Q, D, 4, 2, QR, DA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+	FP_EXTEND (Q, D, 4, 2, QR, DA);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -789,9 +779,9 @@ static int emu_lxdb (struct pt_regs *regs, int rx, double *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, val);
-	FP_CONV (Q, D, 4, 2, QR, DA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_UNPACK_RAW_DP(DA, val);
+	FP_EXTEND (Q, D, 4, 2, QR, DA);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -805,9 +795,9 @@ static int emu_lxebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
-	FP_CONV (Q, S, 4, 1, QR, SA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+	FP_EXTEND (Q, S, 4, 1, QR, SA);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -821,9 +811,9 @@ static int emu_lxeb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, val);
-	FP_CONV (Q, S, 4, 1, QR, SA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_UNPACK_RAW_SP(SA, val);
+	FP_EXTEND (Q, S, 4, 1, QR, SA);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -836,9 +826,9 @@ static int emu_ldebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
-	FP_CONV (D, S, 2, 1, DR, SA);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+	FP_EXTEND (D, S, 2, 1, DR, SA);
+	FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
 }
 
@@ -849,9 +839,9 @@ static int emu_ldeb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, val);
-	FP_CONV (D, S, 2, 1, DR, SA);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+        FP_UNPACK_RAW_SP(SA, val);
+	FP_EXTEND (D, S, 2, 1, DR, SA);
+	FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
 }
 
@@ -865,10 +855,10 @@ static int emu_lnxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_RAW_QP(QA, &cvt.ld);
         if (QA_s == 0) {
 		FP_NEG_Q(QR, QA);
-		FP_PACK_QP(&cvt.ld, QR);
+		FP_PACK_RAW_QP(&cvt.ld, QR);
 		current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
 		current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
 	} else {
@@ -888,10 +878,10 @@ static int emu_lndbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
         if (DA_s == 0) {
 		FP_NEG_D(DR, DA);
-		FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+		FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
 	} else
 		current->thread.fp_regs.fprs[rx].ui =
 			current->thread.fp_regs.fprs[ry].ui;
@@ -906,10 +896,10 @@ static int emu_lnebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
         if (SA_s == 0) {
 		FP_NEG_S(SR, SA);
-		FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+		FP_PACK_RAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
 	} else
 		current->thread.fp_regs.fprs[rx].ui =
 			current->thread.fp_regs.fprs[ry].ui;
@@ -927,10 +917,10 @@ static int emu_lpxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_RAW_QP(QA, &cvt.ld);
         if (QA_s != 0) {
 		FP_NEG_Q(QR, QA);
-		FP_PACK_QP(&cvt.ld, QR);
+		FP_PACK_RAW_QP(&cvt.ld, QR);
 		current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
 		current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
 	} else{
@@ -950,10 +940,10 @@ static int emu_lpdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
         if (DA_s != 0) {
 		FP_NEG_D(DR, DA);
-		FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+		FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
 	} else
 		current->thread.fp_regs.fprs[rx].ui =
 			current->thread.fp_regs.fprs[ry].ui;
@@ -968,10 +958,10 @@ static int emu_lpebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
         if (SA_s != 0) {
 		FP_NEG_S(SR, SA);
-		FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+		FP_PACK_RAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
 	} else
 		current->thread.fp_regs.fprs[rx].ui =
 			current->thread.fp_regs.fprs[ry].ui;
@@ -989,9 +979,9 @@ static int emu_ldxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
-	FP_CONV (D, Q, 2, 4, DR, QA);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].f, DR);
+        FP_UNPACK_SEMIRAW_QP(QA, &cvt.ld);
+	FP_TRUNC (D, Q, 2, 4, DR, QA);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].f, DR);
         return _fex;
 }
 
@@ -1005,9 +995,9 @@ static int emu_lexbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
-	FP_CONV (S, Q, 1, 4, SR, QA);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+        FP_UNPACK_SEMIRAW_QP(QA, &cvt.ld);
+	FP_TRUNC (S, Q, 1, 4, SR, QA);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         return _fex;
 }
 
@@ -1018,9 +1008,9 @@ static int emu_ledbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
-	FP_CONV (S, D, 1, 2, SR, DA);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+	FP_TRUNC (S, D, 1, 2, SR, DA);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         return _fex;
 }
 
@@ -1081,10 +1071,12 @@ static int emu_mxdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-	FP_CONV (Q, D, 4, 2, QA, DA);
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
-	FP_CONV (Q, D, 4, 2, QB, DA);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+	FP_EXTEND (Q, D, 4, 2, QA, DA);
+	_FP_UNPACK_CANONICAL(Q, 4, QA);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+	FP_EXTEND (Q, D, 4, 2, QB, DA);
+	_FP_UNPACK_CANONICAL(Q, 4, QB);
         FP_MUL_Q(QR, QA, QB);
         FP_PACK_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
@@ -1146,10 +1138,12 @@ static int emu_mdebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-	FP_CONV (D, S, 2, 1, DA, SA);
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
-	FP_CONV (D, S, 2, 1, DB, SA);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+	FP_EXTEND (D, S, 2, 1, DA, SA);
+	_FP_UNPACK_CANONICAL(D, 2, DA);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+	FP_EXTEND (D, S, 2, 1, DB, SA);
+	_FP_UNPACK_CANONICAL(D, 2, DB);
         FP_MUL_D(DR, DA, DB);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
@@ -1162,10 +1156,12 @@ static int emu_mdeb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-	FP_CONV (D, S, 2, 1, DA, SA);
-        FP_UNPACK_SP(SA, val);
-	FP_CONV (D, S, 2, 1, DB, SA);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+	FP_EXTEND (D, S, 2, 1, DA, SA);
+	_FP_UNPACK_CANONICAL(D, 2, DA);
+        FP_UNPACK_RAW_SP(SA, val);
+	FP_EXTEND (D, S, 2, 1, DB, SA);
+	_FP_UNPACK_CANONICAL(D, 2, DB);
         FP_MUL_D(DR, DA, DB);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
@@ -1181,8 +1177,7 @@ static int emu_madbr (struct pt_regs *regs, int rx, int ry, int rz) {
         FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_DP(DB, &current->thread.fp_regs.fprs[ry].d);
         FP_UNPACK_DP(DC, &current->thread.fp_regs.fprs[rz].d);
-        FP_MUL_D(DR, DA, DB);
-        FP_ADD_D(DR, DR, DC);
+	FP_FMA_D(DR, DA, DB, DC);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rz].d, DR);
         return _fex;
 }
@@ -1197,8 +1192,7 @@ static int emu_madb (struct pt_regs *regs, int rx, double *val, int rz) {
         FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_DP(DB, val);
         FP_UNPACK_DP(DC, &current->thread.fp_regs.fprs[rz].d);
-        FP_MUL_D(DR, DA, DB);
-        FP_ADD_D(DR, DR, DC);
+	FP_FMA_D(DR, DA, DB, DC);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rz].d, DR);
         return _fex;
 }
@@ -1213,8 +1207,7 @@ static int emu_maebr (struct pt_regs *regs, int rx, int ry, int rz) {
         FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_SP(SB, &current->thread.fp_regs.fprs[ry].f);
         FP_UNPACK_SP(SC, &current->thread.fp_regs.fprs[rz].f);
-        FP_MUL_S(SR, SA, SB);
-        FP_ADD_S(SR, SR, SC);
+        FP_FMA_S(SR, SA, SB, SC);
 	FP_PACK_SP(&current->thread.fp_regs.fprs[rz].f, SR);
         return _fex;
 }
@@ -1229,8 +1222,7 @@ static int emu_maeb (struct pt_regs *regs, int rx, float *val, int rz) {
         FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_SP(SB, val);
         FP_UNPACK_SP(SC, &current->thread.fp_regs.fprs[rz].f);
-        FP_MUL_S(SR, SA, SB);
-        FP_ADD_S(SR, SR, SC);
+        FP_FMA_S(SR, SA, SB, SC);
 	FP_PACK_SP(&current->thread.fp_regs.fprs[rz].f, SR);
         return _fex;
 }
@@ -1245,8 +1237,9 @@ static int emu_msdbr (struct pt_regs *regs, int rx, int ry, int rz) {
         FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_DP(DB, &current->thread.fp_regs.fprs[ry].d);
         FP_UNPACK_DP(DC, &current->thread.fp_regs.fprs[rz].d);
-        FP_MUL_D(DR, DA, DB);
-        FP_SUB_D(DR, DR, DC);
+	if (DC##_c != FP_CLS_NAN)
+		DC##_s ^= 1;
+	FP_FMA_D(DR, DA, DB, DC);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rz].d, DR);
         return _fex;
 }
@@ -1261,8 +1254,9 @@ static int emu_msdb (struct pt_regs *regs, int rx, double *val, int rz) {
         FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_DP(DB, val);
         FP_UNPACK_DP(DC, &current->thread.fp_regs.fprs[rz].d);
-        FP_MUL_D(DR, DA, DB);
-        FP_SUB_D(DR, DR, DC);
+	if (DC##_c != FP_CLS_NAN)
+		DC##_s ^= 1;
+	FP_FMA_D(DR, DA, DB, DC);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rz].d, DR);
         return _fex;
 }
@@ -1277,8 +1271,9 @@ static int emu_msebr (struct pt_regs *regs, int rx, int ry, int rz) {
         FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_SP(SB, &current->thread.fp_regs.fprs[ry].f);
         FP_UNPACK_SP(SC, &current->thread.fp_regs.fprs[rz].f);
-        FP_MUL_S(SR, SA, SB);
-        FP_SUB_S(SR, SR, SC);
+	if (SC##_c != FP_CLS_NAN)
+		SC##_s ^= 1;
+        FP_FMA_S(SR, SA, SB, SC);
 	FP_PACK_SP(&current->thread.fp_regs.fprs[rz].f, SR);
         return _fex;
 }
@@ -1293,8 +1288,9 @@ static int emu_mseb (struct pt_regs *regs, int rx, float *val, int rz) {
         FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_SP(SB, val);
         FP_UNPACK_SP(SC, &current->thread.fp_regs.fprs[rz].f);
-        FP_MUL_S(SR, SA, SB);
-        FP_SUB_S(SR, SR, SC);
+	if (SC##_c != FP_CLS_NAN)
+		SC##_s ^= 1;
+        FP_FMA_S(SR, SA, SB, SC);
 	FP_PACK_SP(&current->thread.fp_regs.fprs[rz].f, SR);
         return _fex;
 }
@@ -1395,12 +1391,12 @@ static int emu_sxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[rx].ui;
         cvt.w.low = current->thread.fp_regs.fprs[rx+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_SEMIRAW_QP(QA, &cvt.ld);
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QB, &cvt.ld);
+        FP_UNPACK_SEMIRAW_QP(QB, &cvt.ld);
         FP_SUB_Q(QR, QA, QB);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_PACK_SEMIRAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         emu_set_CC_cs(regs, QR_c, QR_s);
@@ -1414,10 +1410,10 @@ static int emu_sdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-        FP_UNPACK_DP(DB, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+        FP_UNPACK_SEMIRAW_DP(DB, &current->thread.fp_regs.fprs[ry].d);
         FP_SUB_D(DR, DA, DB);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -1429,10 +1425,10 @@ static int emu_sdb (struct pt_regs *regs, int rx, double *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-        FP_UNPACK_DP(DB, val);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+        FP_UNPACK_SEMIRAW_DP(DB, val);
         FP_SUB_D(DR, DA, DB);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -1444,10 +1440,10 @@ static int emu_sebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-        FP_UNPACK_SP(SB, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_SEMIRAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+        FP_UNPACK_SEMIRAW_SP(SB, &current->thread.fp_regs.fprs[ry].f);
         FP_SUB_S(SR, SA, SB);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
@@ -1459,10 +1455,10 @@ static int emu_seb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-        FP_UNPACK_SP(SB, val);
+        FP_UNPACK_SEMIRAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+        FP_UNPACK_SEMIRAW_SP(SB, val);
         FP_SUB_S(SR, SA, SB);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
diff --git a/arch/sh/include/asm/sfp-machine.h b/arch/sh/include/asm/sfp-machine.h
index d3c5484..01e05fe 100644
--- a/arch/sh/include/asm/sfp-machine.h
+++ b/arch/sh/include/asm/sfp-machine.h
@@ -37,6 +37,13 @@
 #define _FP_MUL_MEAT_Q(R,X,Y)					\
   _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
 
+#define _FP_MUL_MEAT_DW_S(R,X,Y)				\
+  _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_D(R,X,Y)				\
+  _FP_MUL_MEAT_DW_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_Q(R,X,Y)				\
+  _FP_MUL_MEAT_DW_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
 #define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv(S,R,X,Y)
 #define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
 #define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
@@ -49,6 +56,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /*
  * If one NaN is signaling and the other is not,
@@ -80,5 +88,7 @@
 #define FP_EX_UNDERFLOW		(1<<1)
 #define FP_EX_INEXACT		(1<<0)
 
+#define _FP_TININESS_AFTER_ROUNDING 1
+
 #endif
 
diff --git a/arch/sh/math-emu/math.c b/arch/sh/math-emu/math.c
index 04aa55f..5975df5 100644
--- a/arch/sh/math-emu/math.c
+++ b/arch/sh/math-emu/math.c
@@ -55,11 +55,26 @@
 #define READ(d,a)	({if(get_user(d, (typeof (d)*)a)) return -EFAULT;})
 
 #define PACK_S(r,f)	FP_PACK_SP(&r,f)
+#define PACK_SEMIRAW_S(r,f)	FP_PACK_SEMIRAW_SP(&r,f)
+#define PACK_RAW_S(r,f)	FP_PACK_RAW_SP(&r,f)
 #define UNPACK_S(f,r)	FP_UNPACK_SP(f,&r)
+#define UNPACK_SEMIRAW_S(f,r)	FP_UNPACK_SEMIRAW_SP(f,&r)
+#define UNPACK_RAW_S(f,r)	FP_UNPACK_RAW_SP(f,&r)
 #define PACK_D(r,f) \
 	{u32 t[2]; FP_PACK_DP(t,f); ((u32*)&r)[0]=t[1]; ((u32*)&r)[1]=t[0];}
+#define PACK_SEMIRAW_D(r,f) \
+	{u32 t[2]; FP_PACK_SEMIRAW_DP(t,f); ((u32*)&r)[0]=t[1]; \
+		((u32*)&r)[1]=t[0];}
+#define PACK_RAW_D(r,f) \
+	{u32 t[2]; FP_PACK_RAW_DP(t,f); ((u32*)&r)[0]=t[1]; ((u32*)&r)[1]=t[0];}
 #define UNPACK_D(f,r) \
 	{u32 t[2]; t[0]=((u32*)&r)[1]; t[1]=((u32*)&r)[0]; FP_UNPACK_DP(f,t);}
+#define UNPACK_SEMIRAW_D(f,r) \
+	{u32 t[2]; t[0]=((u32*)&r)[1]; t[1]=((u32*)&r)[0]; \
+		FP_UNPACK_SEMIRAW_DP(f,t);}
+#define UNPACK_RAW_D(f,r) \
+	{u32 t[2]; t[0]=((u32*)&r)[1]; t[1]=((u32*)&r)[0]; \
+		FP_UNPACK_RAW_DP(f,t);}
 
 // 2 args instructions.
 #define BOTH_PRmn(op,x) \
@@ -68,11 +83,11 @@
 #define CMP_X(SZ,R,M,N) do{ \
 	FP_DECL_##SZ(Fm); FP_DECL_##SZ(Fn); \
 	UNPACK_##SZ(Fm, M); UNPACK_##SZ(Fn, N); \
-	FP_CMP_##SZ(R, Fn, Fm, 2); }while(0)
+	FP_CMP_##SZ(R, Fn, Fm, 2, 0); }while(0)
 #define EQ_X(SZ,R,M,N) do{ \
 	FP_DECL_##SZ(Fm); FP_DECL_##SZ(Fn); \
 	UNPACK_##SZ(Fm, M); UNPACK_##SZ(Fn, N); \
-	FP_CMP_EQ_##SZ(R, Fn, Fm); }while(0)
+	FP_CMP_EQ_##SZ(R, Fn, Fm, 0); }while(0)
 #define CMP(OP) ({ int r; BOTH_PRmn(OP##_X,r); r; })
 
 static int
@@ -102,17 +117,23 @@ fcmp_eq(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
 	FP_##OP##_##SZ(Fr, Fn, Fm); \
 	PACK_##SZ(N, Fr); }while(0)
 
+#define ARITH_SEMIRAW_X(SZ,OP,M,N) do{ \
+	FP_DECL_##SZ(Fm); FP_DECL_##SZ(Fn); FP_DECL_##SZ(Fr); \
+	UNPACK_SEMIRAW_##SZ(Fm, M); UNPACK_SEMIRAW_##SZ(Fn, N); \
+	FP_##OP##_##SZ(Fr, Fn, Fm); \
+	PACK_SEMIRAW_##SZ(N, Fr); }while(0)
+
 static int
 fadd(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
 {
-	BOTH_PRmn(ARITH_X, ADD);
+	BOTH_PRmn(ARITH_SEMIRAW_X, ADD);
 	return 0;
 }
 
 static int
 fsub(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
 {
-	BOTH_PRmn(ARITH_X, SUB);
+	BOTH_PRmn(ARITH_SEMIRAW_X, SUB);
 	return 0;
 }
 
@@ -135,15 +156,13 @@ fmac(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
 {
 	FP_DECL_EX;
 	FP_DECL_S(Fr);
-	FP_DECL_S(Ft);
 	FP_DECL_S(F0);
 	FP_DECL_S(Fm);
 	FP_DECL_S(Fn);
 	UNPACK_S(F0, FR0);
 	UNPACK_S(Fm, FRm);
 	UNPACK_S(Fn, FRn);
-	FP_MUL_S(Ft, Fm, F0);
-	FP_ADD_S(Fr, Fn, Ft);
+	FP_FMA_S(Fr, Fm, F0, Fn);
 	PACK_S(FRn, Fr);
 	return 0;
 }
@@ -284,8 +303,8 @@ NOTYETn(fsrra)
 
 #define EMU_FLOAT_X(SZ,N) do { \
 	FP_DECL_##SZ(Fn); \
-	FP_FROM_INT_##SZ(Fn, FPUL, 32, int); \
-	PACK_##SZ(N, Fn); }while(0)
+	FP_FROM_INT_##SZ(Fn, FPUL, 32, unsigned int); \
+	PACK_RAW_##SZ(N, Fn); }while(0)
 static int ffloat(struct sh_fpu_soft_struct *fregs, int n)
 {
 	FP_DECL_EX;
@@ -300,7 +319,7 @@ static int ffloat(struct sh_fpu_soft_struct *fregs, int n)
 
 #define EMU_FTRC_X(SZ,N) do { \
 	FP_DECL_##SZ(Fn); \
-	UNPACK_##SZ(Fn, N); \
+	UNPACK_RAW_##SZ(Fn, N); \
 	FP_TO_INT_##SZ(FPUL, Fn, 32, 1); }while(0)
 static int ftrc(struct sh_fpu_soft_struct *fregs, int n)
 {
@@ -319,9 +338,9 @@ static int fcnvsd(struct sh_fpu_soft_struct *fregs, int n)
 	FP_DECL_EX;
 	FP_DECL_S(Fn);
 	FP_DECL_D(Fr);
-	UNPACK_S(Fn, FPUL);
-	FP_CONV(D, S, 2, 1, Fr, Fn);
-	PACK_D(DRn, Fr);
+	UNPACK_RAW_S(Fn, FPUL);
+	FP_EXTEND(D, S, 2, 1, Fr, Fn);
+	PACK_RAW_D(DRn, Fr);
 	return 0;
 }
 
@@ -330,9 +349,9 @@ static int fcnvds(struct sh_fpu_soft_struct *fregs, int n)
 	FP_DECL_EX;
 	FP_DECL_D(Fn);
 	FP_DECL_S(Fr);
-	UNPACK_D(Fn, DRn);
-	FP_CONV(S, D, 1, 2, Fr, Fn);
-	PACK_S(FPUL, Fr);
+	UNPACK_SEMIRAW_D(Fn, DRn);
+	FP_TRUNC(S, D, 1, 2, Fr, Fn);
+	PACK_SEMIRAW_S(FPUL, Fr);
 	return 0;
 }
 
diff --git a/arch/sparc/include/asm/sfp-machine_32.h b/arch/sparc/include/asm/sfp-machine_32.h
index 838c9d5..53ce267 100644
--- a/arch/sparc/include/asm/sfp-machine_32.h
+++ b/arch/sparc/include/asm/sfp-machine_32.h
@@ -50,6 +50,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /* If one NaN is signaling and the other is not,
  * we choose that one, otherwise we choose X.
@@ -209,4 +210,6 @@ extern struct task_struct *last_task_used_math;
 #define FP_TRAPPING_EXCEPTIONS ((last_task_used_math->thread.fsr >> 23) & 0x1f)
 #endif
 
+#define _FP_TININESS_AFTER_ROUNDING 0
+
 #endif
diff --git a/arch/sparc/include/asm/sfp-machine_64.h b/arch/sparc/include/asm/sfp-machine_64.h
index ca913ef..a83dbf6 100644
--- a/arch/sparc/include/asm/sfp-machine_64.h
+++ b/arch/sparc/include/asm/sfp-machine_64.h
@@ -48,6 +48,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /* If one NaN is signaling and the other is not,
  * we choose that one, otherwise we choose X.
@@ -90,4 +91,6 @@
 
 #define FP_TRAPPING_EXCEPTIONS ((current_thread_info()->xfsr[0] >> 23) & 0x1f)
 
+#define _FP_TININESS_AFTER_ROUNDING 0
+
 #endif
diff --git a/arch/sparc/math-emu/math_32.c b/arch/sparc/math-emu/math_32.c
index 5ce8f2f..f708ee0 100644
--- a/arch/sparc/math-emu/math_32.c
+++ b/arch/sparc/math-emu/math_32.c
@@ -276,9 +276,11 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 	/* Emulate the given insn, updating fsr and fregs appropriately. */
 	int type = 0;
 	/* r is rd, b is rs2 and a is rs1. The *u arg tells
-	   whether the argument should be packed/unpacked (0 - do not unpack/pack, 1 - unpack/pack)
+	   whether and how the argument should be packed/unpacked
+	   (0 - do not unpack/pack, 1 - unpack/pack raw, 2 - semi-raw,
+	   3 - cooked)
 	   non-u args tells the size of the argument (0 - no argument, 1 - single, 2 - double, 3 - quad */
-#define TYPE(dummy, r, ru, b, bu, a, au) type = (au << 2) | (a << 0) | (bu << 5) | (b << 3) | (ru << 8) | (r << 6)
+#define TYPE(dummy, r, ru, b, bu, a, au) type = (au << 2) | (a << 0) | (bu << 6) | (b << 4) | (ru << 10) | (r << 8)
 	int freg;
 	argp rs1 = NULL, rs2 = NULL, rd = NULL;
 	FP_DECL_EX;
@@ -286,6 +288,7 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 	FP_DECL_D(DA); FP_DECL_D(DB); FP_DECL_D(DR);
 	FP_DECL_Q(QA); FP_DECL_Q(QB); FP_DECL_Q(QR);
 	int IR;
+	unsigned int UIR;
 	long fsr;
 
 #ifdef DEBUG_MATHEMU
@@ -294,30 +297,30 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 
 	if ((insn & 0xc1f80000) == 0x81a00000)	/* FPOP1 */ {
 		switch ((insn >> 5) & 0x1ff) {
-		case FSQRTQ: TYPE(3,3,1,3,1,0,0); break;
+		case FSQRTQ: TYPE(3,3,3,3,3,0,0); break;
 		case FADDQ:
-		case FSUBQ:
+		case FSUBQ: TYPE(3,3,2,3,2,3,2); break;
 		case FMULQ:
-		case FDIVQ: TYPE(3,3,1,3,1,3,1); break;
-		case FDMULQ: TYPE(3,3,1,2,1,2,1); break;
-		case FQTOS: TYPE(3,1,1,3,1,0,0); break;
-		case FQTOD: TYPE(3,2,1,3,1,0,0); break;
+		case FDIVQ: TYPE(3,3,3,3,3,3,3); break;
+		case FDMULQ: TYPE(3,3,3,2,1,2,1); break;
+		case FQTOS: TYPE(3,1,2,3,2,0,0); break;
+		case FQTOD: TYPE(3,2,2,3,2,0,0); break;
 		case FITOQ: TYPE(3,3,1,1,0,0,0); break;
 		case FSTOQ: TYPE(3,3,1,1,1,0,0); break;
 		case FDTOQ: TYPE(3,3,1,2,1,0,0); break;
 		case FQTOI: TYPE(3,1,0,3,1,0,0); break;
-		case FSQRTS: TYPE(2,1,1,1,1,0,0); break;
-		case FSQRTD: TYPE(2,2,1,2,1,0,0); break;
+		case FSQRTS: TYPE(2,1,3,1,3,0,0); break;
+		case FSQRTD: TYPE(2,2,3,2,3,0,0); break;
 		case FADDD:
-		case FSUBD:
+		case FSUBD: TYPE(2,2,2,2,2,2,2); break;
 		case FMULD:
-		case FDIVD: TYPE(2,2,1,2,1,2,1); break;
+		case FDIVD: TYPE(2,2,3,2,3,2,3); break;
 		case FADDS:
-		case FSUBS:
+		case FSUBS: TYPE(2,1,2,1,2,1,2); break;
 		case FMULS:
-		case FDIVS: TYPE(2,1,1,1,1,1,1); break;
-		case FSMULD: TYPE(2,2,1,1,1,1,1); break;
-		case FDTOS: TYPE(2,1,1,2,1,0,0); break;
+		case FDIVS: TYPE(2,1,3,1,3,1,3); break;
+		case FSMULD: TYPE(2,2,3,1,1,1,1); break;
+		case FDTOS: TYPE(2,1,2,2,2,0,0); break;
 		case FSTOD: TYPE(2,2,1,1,1,0,0); break;
 		case FSTOI: TYPE(2,1,0,1,1,0,0); break;
 		case FDTOI: TYPE(2,1,0,2,1,0,0); break;
@@ -366,13 +369,19 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 		}
 	}
 	rs1 = (argp)&fregs[freg];
-	switch (type & 0x7) {
-	case 7: FP_UNPACK_QP (QA, rs1); break;
-	case 6: FP_UNPACK_DP (DA, rs1); break;
-	case 5: FP_UNPACK_SP (SA, rs1); break;
+	switch (type & 0xf) {
+	case 7: FP_UNPACK_RAW_QP (QA, rs1); break;
+	case 6: FP_UNPACK_RAW_DP (DA, rs1); break;
+	case 5: FP_UNPACK_RAW_SP (SA, rs1); break;
+	case 11: FP_UNPACK_SEMIRAW_QP (QA, rs1); break;
+	case 10: FP_UNPACK_SEMIRAW_DP (DA, rs1); break;
+	case 9: FP_UNPACK_SEMIRAW_SP (SA, rs1); break;
+	case 15: FP_UNPACK_QP (QA, rs1); break;
+	case 14: FP_UNPACK_DP (DA, rs1); break;
+	case 13: FP_UNPACK_SP (SA, rs1); break;
 	}
 	freg = (insn & 0x1f);
-	switch ((type >> 3) & 0x3) {			/* same again for rs2 */
+	switch ((type >> 4) & 0x3) {			/* same again for rs2 */
 	case 3:
 		if (freg & 3) {				/* quadwords must have bits 4&5 of the */
 							/* encoded reg. number set to zero. */
@@ -387,13 +396,19 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 		}
 	}
 	rs2 = (argp)&fregs[freg];
-	switch ((type >> 3) & 0x7) {
-	case 7: FP_UNPACK_QP (QB, rs2); break;
-	case 6: FP_UNPACK_DP (DB, rs2); break;
-	case 5: FP_UNPACK_SP (SB, rs2); break;
+	switch ((type >> 4) & 0xf) {
+	case 7: FP_UNPACK_RAW_QP (QA, rs2); break;
+	case 6: FP_UNPACK_RAW_DP (DA, rs2); break;
+	case 5: FP_UNPACK_RAW_SP (SA, rs2); break;
+	case 11: FP_UNPACK_SEMIRAW_QP (QA, rs2); break;
+	case 10: FP_UNPACK_SEMIRAW_DP (DA, rs2); break;
+	case 9: FP_UNPACK_SEMIRAW_SP (SA, rs2); break;
+	case 15: FP_UNPACK_QP (QA, rs2); break;
+	case 14: FP_UNPACK_DP (DA, rs2); break;
+	case 13: FP_UNPACK_SP (SA, rs2); break;
 	}
 	freg = ((insn >> 25) & 0x1f);
-	switch ((type >> 6) & 0x3) {			/* and finally rd. This one's a bit different */
+	switch ((type >> 8) & 0x3) {			/* and finally rd. This one's a bit different */
 	case 0:						/* dest is fcc. (this must be FCMPQ or FCMPEQ) */
 		if (freg) {				/* V8 has only one set of condition codes, so */
 							/* anything but 0 in the rd field is an error */
@@ -433,11 +448,15 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 	case FSUBQ: FP_SUB_Q (QR, QA, QB); break;
 	/* * */
 	case FMULS: FP_MUL_S (SR, SA, SB); break;
-	case FSMULD: FP_CONV (D, S, 2, 1, DA, SA);
-		     FP_CONV (D, S, 2, 1, DB, SB);
+	case FSMULD: FP_EXTEND (D, S, 2, 1, DA, SA);
+		     _FP_UNPACK_CANONICAL (D, 2, DA);
+		     FP_EXTEND (D, S, 2, 1, DB, SB);
+		     _FP_UNPACK_CANONICAL (D, 2, DB);
 	case FMULD: FP_MUL_D (DR, DA, DB); break;
-	case FDMULQ: FP_CONV (Q, D, 4, 2, QA, DA);
-		     FP_CONV (Q, D, 4, 2, QB, DB);
+	case FDMULQ: FP_EXTEND (Q, D, 4, 2, QA, DA);
+		     _FP_UNPACK_CANONICAL (Q, 4, QA);
+		     FP_EXTEND (Q, D, 4, 2, QB, DB);
+		     _FP_UNPACK_CANONICAL (Q, 4, QB);
 	case FMULQ: FP_MUL_Q (QR, QA, QB); break;
 	/* / */
 	case FDIVS: FP_DIV_S (SR, SA, SB); break;
@@ -452,50 +471,41 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 	case FABSS: rd->s = rs2->s & 0x7fffffff; break;
 	case FNEGS: rd->s = rs2->s ^ 0x80000000; break;
 	/* float to int */
-	case FSTOI: FP_TO_INT_S (IR, SB, 32, 1); break;
-	case FDTOI: FP_TO_INT_D (IR, DB, 32, 1); break;
-	case FQTOI: FP_TO_INT_Q (IR, QB, 32, 1); break;
+	case FSTOI: FP_TO_INT_S (UIR, SB, 32, 1); IR = UIR; break;
+	case FDTOI: FP_TO_INT_D (UIR, DB, 32, 1); IR = UIR; break;
+	case FQTOI: FP_TO_INT_Q (UIR, QB, 32, 1); IR = UIR; break;
 	/* int to float */
-	case FITOS: IR = rs2->s; FP_FROM_INT_S (SR, IR, 32, int); break;
-	case FITOD: IR = rs2->s; FP_FROM_INT_D (DR, IR, 32, int); break;
-	case FITOQ: IR = rs2->s; FP_FROM_INT_Q (QR, IR, 32, int); break;
+	case FITOS: IR = rs2->s; FP_FROM_INT_S (SR, IR, 32, unsigned int);
+		    break;
+	case FITOD: IR = rs2->s; FP_FROM_INT_D (DR, IR, 32, unsigned int);
+		    break;
+	case FITOQ: IR = rs2->s; FP_FROM_INT_Q (QR, IR, 32, unsigned int);
+		    break;
 	/* float to float */
-	case FSTOD: FP_CONV (D, S, 2, 1, DR, SB); break;
-	case FSTOQ: FP_CONV (Q, S, 4, 1, QR, SB); break;
-	case FDTOQ: FP_CONV (Q, D, 4, 2, QR, DB); break;
-	case FDTOS: FP_CONV (S, D, 1, 2, SR, DB); break;
-	case FQTOS: FP_CONV (S, Q, 1, 4, SR, QB); break;
-	case FQTOD: FP_CONV (D, Q, 2, 4, DR, QB); break;
+	case FSTOD: FP_EXTEND (D, S, 2, 1, DR, SB); break;
+	case FSTOQ: FP_EXTEND (Q, S, 4, 1, QR, SB); break;
+	case FDTOQ: FP_EXTEND (Q, D, 4, 2, QR, DB); break;
+	case FDTOS: FP_TRUNC (S, D, 1, 2, SR, DB); break;
+	case FQTOS: FP_TRUNC (S, Q, 1, 4, SR, QB); break;
+	case FQTOD: FP_TRUNC (D, Q, 2, 4, DR, QB); break;
 	/* comparison */
 	case FCMPS:
 	case FCMPES:
-		FP_CMP_S(IR, SB, SA, 3);
-		if (IR == 3 &&
-		    (((insn >> 5) & 0x1ff) == FCMPES ||
-		     FP_ISSIGNAN_S(SA) ||
-		     FP_ISSIGNAN_S(SB)))
-			FP_SET_EXCEPTION (FP_EX_INVALID);
+		FP_CMP_S(IR, SB, SA, 3,
+			((insn >> 5) & 0x1ff) == FCMPES ? 2 : 1);
 		break;
 	case FCMPD:
 	case FCMPED:
-		FP_CMP_D(IR, DB, DA, 3);
-		if (IR == 3 &&
-		    (((insn >> 5) & 0x1ff) == FCMPED ||
-		     FP_ISSIGNAN_D(DA) ||
-		     FP_ISSIGNAN_D(DB)))
-			FP_SET_EXCEPTION (FP_EX_INVALID);
+		FP_CMP_D(IR, DB, DA, 3,
+			((insn >> 5) & 0x1ff) == FCMPED ? 2 : 1);
 		break;
 	case FCMPQ:
 	case FCMPEQ:
-		FP_CMP_Q(IR, QB, QA, 3);
-		if (IR == 3 &&
-		    (((insn >> 5) & 0x1ff) == FCMPEQ ||
-		     FP_ISSIGNAN_Q(QA) ||
-		     FP_ISSIGNAN_Q(QB)))
-			FP_SET_EXCEPTION (FP_EX_INVALID);
+		FP_CMP_Q(IR, QB, QA, 3,
+			((insn >> 5) & 0x1ff) == FCMPEQ ? 2 : 1);
 	}
 	if (!FP_INHIBIT_RESULTS) {
-		switch ((type >> 6) & 0x7) {
+		switch ((type >> 8) & 0xf) {
 		case 0: fsr = *pfsr;
 			if (IR == -1) IR = 2;
 			/* fcc is always fcc0 */
@@ -503,9 +513,15 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 			*pfsr = fsr;
 			break;
 		case 1: rd->s = IR; break;
-		case 5: FP_PACK_SP (rd, SR); break;
-		case 6: FP_PACK_DP (rd, DR); break;
-		case 7: FP_PACK_QP (rd, QR); break;
+		case 5: FP_PACK_RAW_SP (rd, SR); break;
+		case 6: FP_PACK_RAW_DP (rd, DR); break;
+		case 7: FP_PACK_RAW_QP (rd, QR); break;
+		case 9: FP_PACK_SEMIRAW_SP (rd, SR); break;
+		case 10: FP_PACK_SEMIRAW_DP (rd, DR); break;
+		case 11: FP_PACK_SEMIRAW_QP (rd, QR); break;
+		case 13: FP_PACK_SP (rd, SR); break;
+		case 14: FP_PACK_DP (rd, DR); break;
+		case 15: FP_PACK_QP (rd, QR); break;
 		}
 	}
 	if (_fex == 0)
diff --git a/arch/sparc/math-emu/math_64.c b/arch/sparc/math-emu/math_64.c
index 034aadb..973db59 100644
--- a/arch/sparc/math-emu/math_64.c
+++ b/arch/sparc/math-emu/math_64.c
@@ -170,9 +170,11 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 	u32 insn = 0;
 	int type = 0;
 	/* ftt tells which ftt it may happen in, r is rd, b is rs2 and a is rs1. The *u arg tells
-	   whether the argument should be packed/unpacked (0 - do not unpack/pack, 1 - unpack/pack)
+	   whether and how the argument should be packed/unpacked
+	   (0 - do not unpack/pack, 1 - unpack/pack raw, 2 - semi-raw,
+	   3- cooked)
 	   non-u args tells the size of the argument (0 - no argument, 1 - single, 2 - double, 3 - quad */
-#define TYPE(ftt, r, ru, b, bu, a, au) type = (au << 2) | (a << 0) | (bu << 5) | (b << 3) | (ru << 8) | (r << 6) | (ftt << 9)
+#define TYPE(ftt, r, ru, b, bu, a, au) type = (au << 2) | (a << 0) | (bu << 6) | (b << 4) | (ru << 10) | (r << 8) | (ftt << 12)
 	int freg;
 	static u64 zero[2] = { 0L, 0L };
 	int flags;
@@ -181,7 +183,9 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 	FP_DECL_D(DA); FP_DECL_D(DB); FP_DECL_D(DR);
 	FP_DECL_Q(QA); FP_DECL_Q(QB); FP_DECL_Q(QR);
 	int IR;
+	unsigned int UIR;
 	long XR, xfsr;
+	unsigned long UXR;
 
 	if (tstate & TSTATE_PRIV)
 		die_if_kernel("unfinished/unimplemented FPop from kernel", regs);
@@ -195,16 +199,16 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 			case FMOVQ:
 			case FNEGQ:
 			case FABSQ: TYPE(3,3,0,3,0,0,0); break;
-			case FSQRTQ: TYPE(3,3,1,3,1,0,0); break;
+			case FSQRTQ: TYPE(3,3,3,3,3,0,0); break;
 			case FADDQ:
-			case FSUBQ:
+			case FSUBQ: TYPE(3,3,2,3,2,3,2); break;
 			case FMULQ:
-			case FDIVQ: TYPE(3,3,1,3,1,3,1); break;
-			case FDMULQ: TYPE(3,3,1,2,1,2,1); break;
+			case FDIVQ: TYPE(3,3,3,3,3,3,3); break;
+			case FDMULQ: TYPE(3,3,3,2,1,2,1); break;
 			case FQTOX: TYPE(3,2,0,3,1,0,0); break;
 			case FXTOQ: TYPE(3,3,1,2,0,0,0); break;
-			case FQTOS: TYPE(3,1,1,3,1,0,0); break;
-			case FQTOD: TYPE(3,2,1,3,1,0,0); break;
+			case FQTOS: TYPE(3,1,2,3,2,0,0); break;
+			case FQTOD: TYPE(3,2,2,3,2,0,0); break;
 			case FITOQ: TYPE(3,3,1,1,0,0,0); break;
 			case FSTOQ: TYPE(3,3,1,1,1,0,0); break;
 			case FDTOQ: TYPE(3,3,1,2,1,0,0); break;
@@ -219,7 +223,7 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				unsigned long x = current_thread_info()->xfsr[0];
 
 				x = (x >> 14) & 0x7;
-				TYPE(x,1,1,1,1,0,0);
+				TYPE(x,1,3,1,3,0,0);
 				break;
 			}
 
@@ -227,23 +231,23 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				unsigned long x = current_thread_info()->xfsr[0];
 
 				x = (x >> 14) & 0x7;
-				TYPE(x,2,1,2,1,0,0);
+				TYPE(x,2,3,2,3,0,0);
 				break;
 			}
 
 			/* SUBNORMAL - ftt == 2 */
 			case FADDD:
-			case FSUBD:
+			case FSUBD: TYPE(2,2,2,2,2,2,2); break;
 			case FMULD:
-			case FDIVD: TYPE(2,2,1,2,1,2,1); break;
+			case FDIVD: TYPE(2,2,3,2,3,2,3); break;
 			case FADDS:
-			case FSUBS:
+			case FSUBS: TYPE(2,1,2,1,2,1,2); break;
 			case FMULS:
-			case FDIVS: TYPE(2,1,1,1,1,1,1); break;
-			case FSMULD: TYPE(2,2,1,1,1,1,1); break;
+			case FDIVS: TYPE(2,1,3,1,3,1,3); break;
+			case FSMULD: TYPE(2,2,3,1,1,1,1); break;
 			case FSTOX: TYPE(2,2,0,1,1,0,0); break;
 			case FDTOX: TYPE(2,2,0,2,1,0,0); break;
-			case FDTOS: TYPE(2,1,1,2,1,0,0); break;
+			case FDTOS: TYPE(2,1,2,2,2,0,0); break;
 			case FSTOD: TYPE(2,2,1,1,1,0,0); break;
 			case FSTOI: TYPE(2,1,0,1,1,0,0); break;
 			case FDTOI: TYPE(2,1,0,2,1,0,0); break;
@@ -365,7 +369,7 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 		 */
 		if (!illegal_insn_trap) {
 			int ftt = (current_thread_info()->xfsr[0] >> 14) & 0x7;
-			if (ftt != (type >> 9))
+			if (ftt != (type >> 12))
 				goto err;
 		}
 		current_thread_info()->xfsr[0] &= ~0x1c000;
@@ -382,13 +386,19 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				rs1 = (argp)&zero;
 			break;
 		}
-		switch (type & 0x7) {
-		case 7: FP_UNPACK_QP (QA, rs1); break;
-		case 6: FP_UNPACK_DP (DA, rs1); break;
-		case 5: FP_UNPACK_SP (SA, rs1); break;
+		switch (type & 0xf) {
+		case 7: FP_UNPACK_RAW_QP (QA, rs1); break;
+		case 6: FP_UNPACK_RAW_DP (DA, rs1); break;
+		case 5: FP_UNPACK_RAW_SP (SA, rs1); break;
+		case 11: FP_UNPACK_SEMIRAW_QP (QA, rs1); break;
+		case 10: FP_UNPACK_SEMIRAW_DP (DA, rs1); break;
+		case 9: FP_UNPACK_SEMIRAW_SP (SA, rs1); break;
+		case 15: FP_UNPACK_QP (QA, rs1); break;
+		case 14: FP_UNPACK_DP (DA, rs1); break;
+		case 13: FP_UNPACK_SP (SA, rs1); break;
 		}
 		freg = (insn & 0x1f);
-		switch ((type >> 3) & 0x3) {
+		switch ((type >> 4) & 0x3) {
 		case 3: if (freg & 2) {
 				current_thread_info()->xfsr[0] |= (6 << 14) /* invalid_fp_register */;
 				goto err;
@@ -400,13 +410,19 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				rs2 = (argp)&zero;
 			break;
 		}
-		switch ((type >> 3) & 0x7) {
-		case 7: FP_UNPACK_QP (QB, rs2); break;
-		case 6: FP_UNPACK_DP (DB, rs2); break;
-		case 5: FP_UNPACK_SP (SB, rs2); break;
+		switch ((type >> 4) & 0xf) {
+		case 7: FP_UNPACK_RAW_QP (QB, rs2); break;
+		case 6: FP_UNPACK_RAW_DP (DB, rs2); break;
+		case 5: FP_UNPACK_RAW_SP (SB, rs2); break;
+		case 11: FP_UNPACK_SEMIRAW_QP (QB, rs2); break;
+		case 10: FP_UNPACK_SEMIRAW_DP (DB, rs2); break;
+		case 9: FP_UNPACK_SEMIRAW_SP (SB, rs2); break;
+		case 15: FP_UNPACK_QP (QB, rs2); break;
+		case 14: FP_UNPACK_DP (DB, rs2); break;
+		case 13: FP_UNPACK_SP (SB, rs2); break;
 		}
 		freg = ((insn >> 25) & 0x1f);
-		switch ((type >> 6) & 0x3) {
+		switch ((type >> 8) & 0x3) {
 		case 3: if (freg & 2) {
 				current_thread_info()->xfsr[0] |= (6 << 14) /* invalid_fp_register */;
 				goto err;
@@ -438,11 +454,15 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 		case FSUBQ: FP_SUB_Q (QR, QA, QB); break;
 		/* * */
 		case FMULS: FP_MUL_S (SR, SA, SB); break;
-		case FSMULD: FP_CONV (D, S, 1, 1, DA, SA);
-			     FP_CONV (D, S, 1, 1, DB, SB);
+		case FSMULD: FP_EXTEND (D, S, 1, 1, DA, SA);
+			     _FP_UNPACK_CANONICAL (D, 1, DA);
+			     FP_EXTEND (D, S, 1, 1, DB, SB);
+			     _FP_UNPACK_CANONICAL (D, 1, DB);
 		case FMULD: FP_MUL_D (DR, DA, DB); break;
-		case FDMULQ: FP_CONV (Q, D, 2, 1, QA, DA);
-			     FP_CONV (Q, D, 2, 1, QB, DB);
+		case FDMULQ: FP_EXTEND (Q, D, 2, 1, QA, DA);
+			     _FP_UNPACK_CANONICAL (Q, 2, QA);
+			     FP_EXTEND (Q, D, 2, 1, QB, DB);
+			     _FP_UNPACK_CANONICAL (Q, 2, QB);
 		case FMULQ: FP_MUL_Q (QR, QA, QB); break;
 		/* / */
 		case FDIVS: FP_DIV_S (SR, SA, SB); break;
@@ -457,41 +477,37 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 		case FABSQ: rd->q[0] = rs2->q[0] & 0x7fffffffffffffffUL; rd->q[1] = rs2->q[1]; break;
 		case FNEGQ: rd->q[0] = rs2->q[0] ^ 0x8000000000000000UL; rd->q[1] = rs2->q[1]; break;
 		/* float to int */
-		case FSTOI: FP_TO_INT_S (IR, SB, 32, 1); break;
-		case FDTOI: FP_TO_INT_D (IR, DB, 32, 1); break;
-		case FQTOI: FP_TO_INT_Q (IR, QB, 32, 1); break;
-		case FSTOX: FP_TO_INT_S (XR, SB, 64, 1); break;
-		case FDTOX: FP_TO_INT_D (XR, DB, 64, 1); break;
-		case FQTOX: FP_TO_INT_Q (XR, QB, 64, 1); break;
+		case FSTOI: FP_TO_INT_S (UIR, SB, 32, 1); IR = UIR; break;
+		case FDTOI: FP_TO_INT_D (UIR, DB, 32, 1); IR = UIR; break;
+		case FQTOI: FP_TO_INT_Q (UIR, QB, 32, 1); IR = UIR; break;
+		case FSTOX: FP_TO_INT_S (UXR, SB, 64, 1); XR = UXR; break;
+		case FDTOX: FP_TO_INT_D (UXR, DB, 64, 1); XR = UXR; break;
+		case FQTOX: FP_TO_INT_Q (UXR, QB, 64, 1); XR = UXR; break;
 		/* int to float */
-		case FITOQ: IR = rs2->s; FP_FROM_INT_Q (QR, IR, 32, int); break;
-		case FXTOQ: XR = rs2->d; FP_FROM_INT_Q (QR, XR, 64, long); break;
+		case FITOQ: IR = rs2->s; FP_FROM_INT_Q (QR, IR, 32, unsigned int); break;
+		case FXTOQ: XR = rs2->d; FP_FROM_INT_Q (QR, XR, 64, unsigned long); break;
 		/* Only Ultra-III generates these */
-		case FXTOS: XR = rs2->d; FP_FROM_INT_S (SR, XR, 64, long); break;
-		case FXTOD: XR = rs2->d; FP_FROM_INT_D (DR, XR, 64, long); break;
+		case FXTOS: XR = rs2->d; FP_FROM_INT_S (SR, XR, 64, unsigned long); break;
+		case FXTOD: XR = rs2->d; FP_FROM_INT_D (DR, XR, 64, unsigned long); break;
 #if 0		/* Optimized inline in sparc64/kernel/entry.S */
-		case FITOS: IR = rs2->s; FP_FROM_INT_S (SR, IR, 32, int); break;
+		case FITOS: IR = rs2->s; FP_FROM_INT_S (SR, IR, 32, unsigned int); break;
 #endif
-		case FITOD: IR = rs2->s; FP_FROM_INT_D (DR, IR, 32, int); break;
+		case FITOD: IR = rs2->s; FP_FROM_INT_D (DR, IR, 32, unsigned int); break;
 		/* float to float */
-		case FSTOD: FP_CONV (D, S, 1, 1, DR, SB); break;
-		case FSTOQ: FP_CONV (Q, S, 2, 1, QR, SB); break;
-		case FDTOQ: FP_CONV (Q, D, 2, 1, QR, DB); break;
-		case FDTOS: FP_CONV (S, D, 1, 1, SR, DB); break;
-		case FQTOS: FP_CONV (S, Q, 1, 2, SR, QB); break;
-		case FQTOD: FP_CONV (D, Q, 1, 2, DR, QB); break;
+		case FSTOD: FP_EXTEND (D, S, 1, 1, DR, SB); break;
+		case FSTOQ: FP_EXTEND (Q, S, 2, 1, QR, SB); break;
+		case FDTOQ: FP_EXTEND (Q, D, 2, 1, QR, DB); break;
+		case FDTOS: FP_TRUNC (S, D, 1, 1, SR, DB); break;
+		case FQTOS: FP_TRUNC (S, Q, 1, 2, SR, QB); break;
+		case FQTOD: FP_TRUNC (D, Q, 1, 2, DR, QB); break;
 		/* comparison */
 		case FCMPQ:
 		case FCMPEQ:
-			FP_CMP_Q(XR, QB, QA, 3);
-			if (XR == 3 &&
-			    (((insn >> 5) & 0x1ff) == FCMPEQ ||
-			     FP_ISSIGNAN_Q(QA) ||
-			     FP_ISSIGNAN_Q(QB)))
-				FP_SET_EXCEPTION (FP_EX_INVALID);
+			FP_CMP_Q(XR, QB, QA, 3,
+				((insn >> 5) & 0x1ff) == FCMPEQ ? 2 : 1);
 		}
 		if (!FP_INHIBIT_RESULTS) {
-			switch ((type >> 6) & 0x7) {
+			switch ((type >> 8) & 0xf) {
 			case 0: xfsr = current_thread_info()->xfsr[0];
 				if (XR == -1) XR = 2;
 				switch (freg & 3) {
@@ -505,9 +521,15 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				break;
 			case 1: rd->s = IR; break;
 			case 2: rd->d = XR; break;
-			case 5: FP_PACK_SP (rd, SR); break;
-			case 6: FP_PACK_DP (rd, DR); break;
-			case 7: FP_PACK_QP (rd, QR); break;
+			case 5: FP_PACK_RAW_SP (rd, SR); break;
+			case 6: FP_PACK_RAW_DP (rd, DR); break;
+			case 7: FP_PACK_RAW_QP (rd, QR); break;
+			case 9: FP_PACK_SEMIRAW_SP (rd, SR); break;
+			case 10: FP_PACK_SEMIRAW_DP (rd, DR); break;
+			case 11: FP_PACK_SEMIRAW_QP (rd, QR); break;
+			case 13: FP_PACK_SP (rd, SR); break;
+			case 14: FP_PACK_DP (rd, DR); break;
+			case 15: FP_PACK_QP (rd, QR); break;
 			}
 		}
 
diff --git a/include/math-emu/double.h b/include/math-emu/double.h
index 655ccf1..dc8cd33 100644
--- a/include/math-emu/double.h
+++ b/include/math-emu/double.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Definitions for IEEE Double Precision
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,31 +8,41 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef    __MATH_EMU_DOUBLE_H__
 #define    __MATH_EMU_DOUBLE_H__
 
 #if _FP_W_TYPE_SIZE < 32
-#error "Here's a nickel kid.  Go buy yourself a real computer."
+# error "Here's a nickel kid.  Go buy yourself a real computer."
 #endif
 
 #if _FP_W_TYPE_SIZE < 64
-#define _FP_FRACTBITS_D		(2 * _FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_D	(2 * _FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_DW_D	(4 * _FP_W_TYPE_SIZE)
 #else
-#define _FP_FRACTBITS_D		_FP_W_TYPE_SIZE
+# define _FP_FRACTBITS_D	_FP_W_TYPE_SIZE
+# define _FP_FRACTBITS_DW_D	(2 * _FP_W_TYPE_SIZE)
 #endif
 
 #define _FP_FRACBITS_D		53
@@ -44,160 +54,269 @@
 #define _FP_EXPMAX_D		2047
 
 #define _FP_QNANBIT_D		\
-	((_FP_W_TYPE)1 << (_FP_FRACBITS_D-2) % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_D-2) % _FP_W_TYPE_SIZE)
+#define _FP_QNANBIT_SH_D		\
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_D-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
 #define _FP_IMPLBIT_D		\
-	((_FP_W_TYPE)1 << (_FP_FRACBITS_D-1) % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_D-1) % _FP_W_TYPE_SIZE)
+#define _FP_IMPLBIT_SH_D		\
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_D-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
 #define _FP_OVERFLOW_D		\
-	((_FP_W_TYPE)1 << _FP_WFRACBITS_D % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << _FP_WFRACBITS_D % _FP_W_TYPE_SIZE)
+
+#define _FP_WFRACBITS_DW_D	(2 * _FP_WFRACBITS_D)
+#define _FP_WFRACXBITS_DW_D	(_FP_FRACTBITS_DW_D - _FP_WFRACBITS_DW_D)
+#define _FP_HIGHBIT_DW_D	\
+  ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_DW_D - 1) % _FP_W_TYPE_SIZE)
+
+typedef float DFtype __attribute__ ((mode (DF)));
 
 #if _FP_W_TYPE_SIZE < 64
 
 union _FP_UNION_D
 {
-  double flt;
-  struct {
-#if __BYTE_ORDER == __BIG_ENDIAN
+  DFtype flt;
+  struct _FP_STRUCT_LAYOUT
+  {
+# if __BYTE_ORDER == __BIG_ENDIAN
     unsigned sign  : 1;
     unsigned exp   : _FP_EXPBITS_D;
     unsigned frac1 : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0) - _FP_W_TYPE_SIZE;
     unsigned frac0 : _FP_W_TYPE_SIZE;
-#else
+# else
     unsigned frac0 : _FP_W_TYPE_SIZE;
     unsigned frac1 : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0) - _FP_W_TYPE_SIZE;
     unsigned exp   : _FP_EXPBITS_D;
     unsigned sign  : 1;
-#endif
-  } bits __attribute__((packed));
+# endif
+  } bits __attribute__ ((packed));
 };
 
-#define FP_DECL_D(X)		_FP_DECL(2,X)
-#define FP_UNPACK_RAW_D(X,val)	_FP_UNPACK_RAW_2(D,X,val)
-#define FP_UNPACK_RAW_DP(X,val)	_FP_UNPACK_RAW_2_P(D,X,val)
-#define FP_PACK_RAW_D(val,X)	_FP_PACK_RAW_2(D,val,X)
-#define FP_PACK_RAW_DP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_2_P(D,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_D(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_2(D,X,val);		\
-    _FP_UNPACK_CANONICAL(D,2,X);	\
-  } while (0)
-
-#define FP_UNPACK_DP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_2_P(D,X,val);	\
-    _FP_UNPACK_CANONICAL(D,2,X);	\
-  } while (0)
-
-#define FP_PACK_D(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(D,2,X);		\
-    _FP_PACK_RAW_2(D,val,X);		\
-  } while (0)
-
-#define FP_PACK_DP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(D,2,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_2_P(D,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN(D,2,X)
-#define FP_NEG_D(R,X)			_FP_NEG(D,2,R,X)
-#define FP_ADD_D(R,X,Y)			_FP_ADD(D,2,R,X,Y)
-#define FP_SUB_D(R,X,Y)			_FP_SUB(D,2,R,X,Y)
-#define FP_MUL_D(R,X,Y)			_FP_MUL(D,2,R,X,Y)
-#define FP_DIV_D(R,X,Y)			_FP_DIV(D,2,R,X,Y)
-#define FP_SQRT_D(R,X)			_FP_SQRT(D,2,R,X)
-#define _FP_SQRT_MEAT_D(R,S,T,X,Q)	_FP_SQRT_MEAT_2(R,S,T,X,Q)
-
-#define FP_CMP_D(r,X,Y,un)	_FP_CMP(D,2,r,X,Y,un)
-#define FP_CMP_EQ_D(r,X,Y)	_FP_CMP_EQ(D,2,r,X,Y)
-
-#define FP_TO_INT_D(r,X,rsz,rsg)	_FP_TO_INT(D,2,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_D(r,X,rsz,rsg)	_FP_TO_INT_ROUND(D,2,r,X,rsz,rsg)
-#define FP_FROM_INT_D(X,r,rs,rt)	_FP_FROM_INT(D,2,X,r,rs,rt)
-
-#define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_2(X)
-#define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_2(X)
+# define FP_DECL_D(X)		_FP_DECL (2, X)
+# define FP_UNPACK_RAW_D(X, val)	_FP_UNPACK_RAW_2 (D, X, (val))
+# define FP_UNPACK_RAW_DP(X, val)	_FP_UNPACK_RAW_2_P (D, X, (val))
+# define FP_PACK_RAW_D(val, X)	_FP_PACK_RAW_2 (D, (val), X)
+# define FP_PACK_RAW_DP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_D(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2 (D, X, (val));		\
+      _FP_UNPACK_CANONICAL (D, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_DP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2_P (D, X, (val));		\
+      _FP_UNPACK_CANONICAL (D, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_D(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2 (D, X, (val));		\
+      _FP_UNPACK_SEMIRAW (D, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_DP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2_P (D, X, (val));		\
+      _FP_UNPACK_SEMIRAW (D, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_D(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (D, 2, X);		\
+      _FP_PACK_RAW_2 (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_DP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (D, 2, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_D(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (D, 2, X);		\
+      _FP_PACK_RAW_2 (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_DP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (D, 2, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN (D, 2, X)
+# define FP_NEG_D(R, X)			_FP_NEG (D, 2, R, X)
+# define FP_ADD_D(R, X, Y)		_FP_ADD (D, 2, R, X, Y)
+# define FP_SUB_D(R, X, Y)		_FP_SUB (D, 2, R, X, Y)
+# define FP_MUL_D(R, X, Y)		_FP_MUL (D, 2, R, X, Y)
+# define FP_DIV_D(R, X, Y)		_FP_DIV (D, 2, R, X, Y)
+# define FP_SQRT_D(R, X)		_FP_SQRT (D, 2, R, X)
+# define _FP_SQRT_MEAT_D(R, S, T, X, Q)	_FP_SQRT_MEAT_2 (R, S, T, X, (Q))
+# define FP_FMA_D(R, X, Y, Z)		_FP_FMA (D, 2, 4, R, X, Y, Z)
+
+# define FP_CMP_D(r, X, Y, un, ex)	_FP_CMP (D, 2, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_D(r, X, Y, ex)	_FP_CMP_EQ (D, 2, (r), X, Y, (ex))
+# define FP_CMP_UNORD_D(r, X, Y, ex)	_FP_CMP_UNORD (D, 2, (r), X, Y, (ex))
+
+# define FP_TO_INT_D(r, X, rsz, rsg)	_FP_TO_INT (D, 2, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_D(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (D, 2, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_D(X, r, rs, rt)	_FP_FROM_INT (D, 2, X, (r), (rs), rt)
+
+# define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_2 (X)
+# define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_2 (X)
+
+# define _FP_FRAC_HIGH_DW_D(X)	_FP_FRAC_HIGH_4 (X)
 
 #else
 
 union _FP_UNION_D
 {
-  double flt;
-  struct {
-#if __BYTE_ORDER == __BIG_ENDIAN
-    unsigned sign : 1;
-    unsigned exp  : _FP_EXPBITS_D;
-    unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
-#else
-    unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
-    unsigned exp  : _FP_EXPBITS_D;
-    unsigned sign : 1;
-#endif
-  } bits __attribute__((packed));
+  DFtype flt;
+  struct _FP_STRUCT_LAYOUT
+  {
+# if __BYTE_ORDER == __BIG_ENDIAN
+    unsigned sign   : 1;
+    unsigned exp    : _FP_EXPBITS_D;
+    _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
+# else
+    _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
+    unsigned exp    : _FP_EXPBITS_D;
+    unsigned sign   : 1;
+# endif
+  } bits __attribute__ ((packed));
 };
 
-#define FP_DECL_D(X)		_FP_DECL(1,X)
-#define FP_UNPACK_RAW_D(X,val)	_FP_UNPACK_RAW_1(D,X,val)
-#define FP_UNPACK_RAW_DP(X,val)	_FP_UNPACK_RAW_1_P(D,X,val)
-#define FP_PACK_RAW_D(val,X)	_FP_PACK_RAW_1(D,val,X)
-#define FP_PACK_RAW_DP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_1_P(D,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_D(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_1(D,X,val);		\
-    _FP_UNPACK_CANONICAL(D,1,X);	\
-  } while (0)
-
-#define FP_UNPACK_DP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_1_P(D,X,val);	\
-    _FP_UNPACK_CANONICAL(D,1,X);	\
-  } while (0)
-
-#define FP_PACK_D(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(D,1,X);		\
-    _FP_PACK_RAW_1(D,val,X);		\
-  } while (0)
-
-#define FP_PACK_DP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(D,1,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_1_P(D,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN(D,1,X)
-#define FP_NEG_D(R,X)			_FP_NEG(D,1,R,X)
-#define FP_ADD_D(R,X,Y)			_FP_ADD(D,1,R,X,Y)
-#define FP_SUB_D(R,X,Y)			_FP_SUB(D,1,R,X,Y)
-#define FP_MUL_D(R,X,Y)			_FP_MUL(D,1,R,X,Y)
-#define FP_DIV_D(R,X,Y)			_FP_DIV(D,1,R,X,Y)
-#define FP_SQRT_D(R,X)			_FP_SQRT(D,1,R,X)
-#define _FP_SQRT_MEAT_D(R,S,T,X,Q)	_FP_SQRT_MEAT_1(R,S,T,X,Q)
+# define FP_DECL_D(X)		_FP_DECL (1, X)
+# define FP_UNPACK_RAW_D(X, val)	_FP_UNPACK_RAW_1 (D, X, (val))
+# define FP_UNPACK_RAW_DP(X, val)	_FP_UNPACK_RAW_1_P (D, X, (val))
+# define FP_PACK_RAW_D(val, X)	_FP_PACK_RAW_1 (D, (val), X)
+# define FP_PACK_RAW_DP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_D(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1 (D, X, (val));		\
+      _FP_UNPACK_CANONICAL (D, 1, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_DP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1_P (D, X, (val));		\
+      _FP_UNPACK_CANONICAL (D, 1, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_D(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1 (D, X, (val));		\
+      _FP_UNPACK_SEMIRAW (D, 1, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_DP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1_P (D, X, (val));		\
+      _FP_UNPACK_SEMIRAW (D, 1, X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_D(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (D, 1, X);		\
+      _FP_PACK_RAW_1 (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_DP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (D, 1, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_D(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (D, 1, X);		\
+      _FP_PACK_RAW_1 (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_DP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (D, 1, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN (D, 1, X)
+# define FP_NEG_D(R, X)			_FP_NEG (D, 1, R, X)
+# define FP_ADD_D(R, X, Y)		_FP_ADD (D, 1, R, X, Y)
+# define FP_SUB_D(R, X, Y)		_FP_SUB (D, 1, R, X, Y)
+# define FP_MUL_D(R, X, Y)		_FP_MUL (D, 1, R, X, Y)
+# define FP_DIV_D(R, X, Y)		_FP_DIV (D, 1, R, X, Y)
+# define FP_SQRT_D(R, X)		_FP_SQRT (D, 1, R, X)
+# define _FP_SQRT_MEAT_D(R, S, T, X, Q)	_FP_SQRT_MEAT_1 (R, S, T, X, (Q))
+# define FP_FMA_D(R, X, Y, Z)		_FP_FMA (D, 1, 2, R, X, Y, Z)
 
 /* The implementation of _FP_MUL_D and _FP_DIV_D should be chosen by
    the target machine.  */
 
-#define FP_CMP_D(r,X,Y,un)	_FP_CMP(D,1,r,X,Y,un)
-#define FP_CMP_EQ_D(r,X,Y)	_FP_CMP_EQ(D,1,r,X,Y)
+# define FP_CMP_D(r, X, Y, un, ex)	_FP_CMP (D, 1, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_D(r, X, Y, ex)	_FP_CMP_EQ (D, 1, (r), X, Y, (ex))
+# define FP_CMP_UNORD_D(r, X, Y, ex)	_FP_CMP_UNORD (D, 1, (r), X, Y, (ex))
+
+# define FP_TO_INT_D(r, X, rsz, rsg)	_FP_TO_INT (D, 1, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_D(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (D, 1, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_D(X, r, rs, rt)	_FP_FROM_INT (D, 1, X, (r), (rs), rt)
 
-#define FP_TO_INT_D(r,X,rsz,rsg)	_FP_TO_INT(D,1,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_D(r,X,rsz,rsg)	_FP_TO_INT_ROUND(D,1,r,X,rsz,rsg)
-#define FP_FROM_INT_D(X,r,rs,rt)	_FP_FROM_INT(D,1,X,r,rs,rt)
+# define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_1 (X)
+# define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_1 (X)
 
-#define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_1(X)
-#define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_1(X)
+# define _FP_FRAC_HIGH_DW_D(X)	_FP_FRAC_HIGH_2 (X)
 
 #endif /* W_TYPE_SIZE < 64 */
 
diff --git a/include/math-emu/op-1.h b/include/math-emu/op-1.h
index 3be3bb4..342ecd0 100644
--- a/include/math-emu/op-1.h
+++ b/include/math-emu/op-1.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Basic one-word fraction declaration and manipulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,193 +8,260 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef    __MATH_EMU_OP_1_H__
 #define    __MATH_EMU_OP_1_H__
 
-#define _FP_FRAC_DECL_1(X)	_FP_W_TYPE X##_f=0
-#define _FP_FRAC_COPY_1(D,S)	(D##_f = S##_f)
-#define _FP_FRAC_SET_1(X,I)	(X##_f = I)
+#define _FP_FRAC_DECL_1(X)	_FP_W_TYPE X##_f = 0
+#define _FP_FRAC_COPY_1(D, S)	(D##_f = S##_f)
+#define _FP_FRAC_SET_1(X, I)	(X##_f = I)
 #define _FP_FRAC_HIGH_1(X)	(X##_f)
 #define _FP_FRAC_LOW_1(X)	(X##_f)
-#define _FP_FRAC_WORD_1(X,w)	(X##_f)
-
-#define _FP_FRAC_ADDI_1(X,I)	(X##_f += I)
-#define _FP_FRAC_SLL_1(X,N)			\
-  do {						\
-    if (__builtin_constant_p(N) && (N) == 1)	\
-      X##_f += X##_f;				\
-    else					\
-      X##_f <<= (N);				\
-  } while (0)
-#define _FP_FRAC_SRL_1(X,N)	(X##_f >>= N)
+#define _FP_FRAC_WORD_1(X, w)	(X##_f)
+
+#define _FP_FRAC_ADDI_1(X, I)	(X##_f += I)
+#define _FP_FRAC_SLL_1(X, N)			\
+  do						\
+    {						\
+      if (__builtin_constant_p (N) && (N) == 1)	\
+	X##_f += X##_f;				\
+      else					\
+	X##_f <<= (N);				\
+    }						\
+  while (0)
+#define _FP_FRAC_SRL_1(X, N)	(X##_f >>= N)
 
 /* Right shift with sticky-lsb.  */
-#define _FP_FRAC_SRS_1(X,N,sz)	__FP_FRAC_SRS_1(X##_f, N, sz)
-
-#define __FP_FRAC_SRS_1(X,N,sz)						\
-   (X = (X >> (N) | (__builtin_constant_p(N) && (N) == 1		\
-		     ? X & 1 : (X << (_FP_W_TYPE_SIZE - (N))) != 0)))
-
-#define _FP_FRAC_ADD_1(R,X,Y)	(R##_f = X##_f + Y##_f)
-#define _FP_FRAC_SUB_1(R,X,Y)	(R##_f = X##_f - Y##_f)
-#define _FP_FRAC_DEC_1(X,Y)	(X##_f -= Y##_f)
-#define _FP_FRAC_CLZ_1(z, X)	__FP_CLZ(z, X##_f)
-
-/* Predicates */
-#define _FP_FRAC_NEGP_1(X)	((_FP_WS_TYPE)X##_f < 0)
+#define _FP_FRAC_SRST_1(X, S, N, sz)	__FP_FRAC_SRST_1 (X##_f, S, (N), (sz))
+#define _FP_FRAC_SRS_1(X, N, sz)	__FP_FRAC_SRS_1 (X##_f, (N), (sz))
+
+#define __FP_FRAC_SRST_1(X, S, N, sz)			\
+  do							\
+    {							\
+      S = (__builtin_constant_p (N) && (N) == 1		\
+	   ? X & 1					\
+	   : (X << (_FP_W_TYPE_SIZE - (N))) != 0);	\
+      X = X >> (N);					\
+    }							\
+  while (0)
+
+#define __FP_FRAC_SRS_1(X, N, sz)				\
+  (X = (X >> (N) | (__builtin_constant_p (N) && (N) == 1	\
+		    ? X & 1					\
+		    : (X << (_FP_W_TYPE_SIZE - (N))) != 0)))
+
+#define _FP_FRAC_ADD_1(R, X, Y)	(R##_f = X##_f + Y##_f)
+#define _FP_FRAC_SUB_1(R, X, Y)	(R##_f = X##_f - Y##_f)
+#define _FP_FRAC_DEC_1(X, Y)	(X##_f -= Y##_f)
+#define _FP_FRAC_CLZ_1(z, X)	__FP_CLZ ((z), X##_f)
+
+/* Predicates.  */
+#define _FP_FRAC_NEGP_1(X)	((_FP_WS_TYPE) X##_f < 0)
 #define _FP_FRAC_ZEROP_1(X)	(X##_f == 0)
-#define _FP_FRAC_OVERP_1(fs,X)	(X##_f & _FP_OVERFLOW_##fs)
-#define _FP_FRAC_CLEAR_OVERP_1(fs,X)	(X##_f &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_OVERP_1(fs, X)	(X##_f & _FP_OVERFLOW_##fs)
+#define _FP_FRAC_CLEAR_OVERP_1(fs, X)	(X##_f &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_HIGHBIT_DW_1(fs, X)	(X##_f & _FP_HIGHBIT_DW_##fs)
 #define _FP_FRAC_EQ_1(X, Y)	(X##_f == Y##_f)
 #define _FP_FRAC_GE_1(X, Y)	(X##_f >= Y##_f)
 #define _FP_FRAC_GT_1(X, Y)	(X##_f > Y##_f)
 
 #define _FP_ZEROFRAC_1		0
 #define _FP_MINFRAC_1		1
-#define _FP_MAXFRAC_1		(~(_FP_WS_TYPE)0)
-
-/*
- * Unpack the raw bits of a native fp value.  Do not classify or
- * normalize the data.
- */
-
-#define _FP_UNPACK_RAW_1(fs, X, val)				\
-  do {								\
-    union _FP_UNION_##fs _flo; _flo.flt = (val);		\
-								\
-    X##_f = _flo.bits.frac;					\
-    X##_e = _flo.bits.exp;					\
-    X##_s = _flo.bits.sign;					\
-  } while (0)
-
-#define _FP_UNPACK_RAW_1_P(fs, X, val)				\
-  do {								\
-    union _FP_UNION_##fs *_flo =				\
-      (union _FP_UNION_##fs *)(val);				\
-								\
-    X##_f = _flo->bits.frac;					\
-    X##_e = _flo->bits.exp;					\
-    X##_s = _flo->bits.sign;					\
-  } while (0)
-
-/*
- * Repack the raw bits of a native fp value.
- */
-
-#define _FP_PACK_RAW_1(fs, val, X)				\
-  do {								\
-    union _FP_UNION_##fs _flo;					\
-								\
-    _flo.bits.frac = X##_f;					\
-    _flo.bits.exp  = X##_e;					\
-    _flo.bits.sign = X##_s;					\
-								\
-    (val) = _flo.flt;						\
-  } while (0)
-
-#define _FP_PACK_RAW_1_P(fs, val, X)				\
-  do {								\
-    union _FP_UNION_##fs *_flo =				\
-      (union _FP_UNION_##fs *)(val);				\
-								\
-    _flo->bits.frac = X##_f;					\
-    _flo->bits.exp  = X##_e;					\
-    _flo->bits.sign = X##_s;					\
-  } while (0)
-
-
-/*
- * Multiplication algorithms:
- */
+#define _FP_MAXFRAC_1		(~(_FP_WS_TYPE) 0)
+
+/* Unpack the raw bits of a native fp value.  Do not classify or
+   normalize the data.  */
+
+#define _FP_UNPACK_RAW_1(fs, X, val)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs _FP_UNPACK_RAW_1_flo;	\
+      _FP_UNPACK_RAW_1_flo.flt = (val);			\
+							\
+      X##_f = _FP_UNPACK_RAW_1_flo.bits.frac;		\
+      X##_e = _FP_UNPACK_RAW_1_flo.bits.exp;		\
+      X##_s = _FP_UNPACK_RAW_1_flo.bits.sign;		\
+    }							\
+  while (0)
+
+#define _FP_UNPACK_RAW_1_P(fs, X, val)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_UNPACK_RAW_1_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
+							\
+      X##_f = _FP_UNPACK_RAW_1_P_flo->bits.frac;	\
+      X##_e = _FP_UNPACK_RAW_1_P_flo->bits.exp;		\
+      X##_s = _FP_UNPACK_RAW_1_P_flo->bits.sign;	\
+    }							\
+  while (0)
+
+/* Repack the raw bits of a native fp value.  */
+
+#define _FP_PACK_RAW_1(fs, val, X)		\
+  do						\
+    {						\
+      union _FP_UNION_##fs _FP_PACK_RAW_1_flo;	\
+						\
+      _FP_PACK_RAW_1_flo.bits.frac = X##_f;	\
+      _FP_PACK_RAW_1_flo.bits.exp  = X##_e;	\
+      _FP_PACK_RAW_1_flo.bits.sign = X##_s;	\
+						\
+      (val) = _FP_PACK_RAW_1_flo.flt;		\
+    }						\
+  while (0)
+
+#define _FP_PACK_RAW_1_P(fs, val, X)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_PACK_RAW_1_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
+							\
+      _FP_PACK_RAW_1_P_flo->bits.frac = X##_f;		\
+      _FP_PACK_RAW_1_P_flo->bits.exp  = X##_e;		\
+      _FP_PACK_RAW_1_P_flo->bits.sign = X##_s;		\
+    }							\
+  while (0)
+
+
+/* Multiplication algorithms: */
 
 /* Basic.  Assuming the host word size is >= 2*FRACBITS, we can do the
    multiplication immediately.  */
 
+#define _FP_MUL_MEAT_DW_1_imm(wfracbits, R, X, Y)	\
+  do							\
+    {							\
+      R##_f = X##_f * Y##_f;				\
+    }							\
+  while (0)
+
 #define _FP_MUL_MEAT_1_imm(wfracbits, R, X, Y)				\
-  do {									\
-    R##_f = X##_f * Y##_f;						\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_1(R, wfracbits-1, 2*wfracbits);			\
-  } while (0)
+  do									\
+    {									\
+      _FP_MUL_MEAT_DW_1_imm ((wfracbits), R, X, Y);			\
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_1 (R, (wfracbits)-1, 2*(wfracbits));			\
+    }									\
+  while (0)
 
 /* Given a 1W * 1W => 2W primitive, do the extended multiplication.  */
 
+#define _FP_MUL_MEAT_DW_1_wide(wfracbits, R, X, Y, doit)	\
+  do								\
+    {								\
+      doit (R##_f1, R##_f0, X##_f, Y##_f);			\
+    }								\
+  while (0)
+
 #define _FP_MUL_MEAT_1_wide(wfracbits, R, X, Y, doit)			\
-  do {									\
-    _FP_W_TYPE _Z_f0, _Z_f1;						\
-    doit(_Z_f1, _Z_f0, X##_f, Y##_f);					\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_2(_Z, wfracbits-1, 2*wfracbits);			\
-    R##_f = _Z_f0;							\
-  } while (0)
+  do									\
+    {									\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_1_wide_Z);				\
+      _FP_MUL_MEAT_DW_1_wide ((wfracbits), _FP_MUL_MEAT_1_wide_Z,	\
+			      X, Y, doit);				\
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_2 (_FP_MUL_MEAT_1_wide_Z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      R##_f = _FP_MUL_MEAT_1_wide_Z_f0;					\
+    }									\
+  while (0)
 
 /* Finally, a simple widening multiply algorithm.  What fun!  */
 
-#define _FP_MUL_MEAT_1_hard(wfracbits, R, X, Y)				\
-  do {									\
-    _FP_W_TYPE _xh, _xl, _yh, _yl, _z_f0, _z_f1, _a_f0, _a_f1;		\
-									\
-    /* split the words in half */					\
-    _xh = X##_f >> (_FP_W_TYPE_SIZE/2);					\
-    _xl = X##_f & (((_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2)) - 1);		\
-    _yh = Y##_f >> (_FP_W_TYPE_SIZE/2);					\
-    _yl = Y##_f & (((_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2)) - 1);		\
+#define _FP_MUL_MEAT_DW_1_hard(wfracbits, R, X, Y)			\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_1_hard_xh, _FP_MUL_MEAT_DW_1_hard_xl;	\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_1_hard_yh, _FP_MUL_MEAT_DW_1_hard_yl;	\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_1_hard_a);			\
 									\
-    /* multiply the pieces */						\
-    _z_f0 = _xl * _yl;							\
-    _a_f0 = _xh * _yl;							\
-    _a_f1 = _xl * _yh;							\
-    _z_f1 = _xh * _yh;							\
+      /* Split the words in half.  */					\
+      _FP_MUL_MEAT_DW_1_hard_xh = X##_f >> (_FP_W_TYPE_SIZE/2);		\
+      _FP_MUL_MEAT_DW_1_hard_xl						\
+	= X##_f & (((_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE/2)) - 1);	\
+      _FP_MUL_MEAT_DW_1_hard_yh = Y##_f >> (_FP_W_TYPE_SIZE/2);		\
+      _FP_MUL_MEAT_DW_1_hard_yl						\
+	= Y##_f & (((_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE/2)) - 1);	\
 									\
-    /* reassemble into two full words */				\
-    if ((_a_f0 += _a_f1) < _a_f1)					\
-      _z_f1 += (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2);			\
-    _a_f1 = _a_f0 >> (_FP_W_TYPE_SIZE/2);				\
-    _a_f0 = _a_f0 << (_FP_W_TYPE_SIZE/2);				\
-    _FP_FRAC_ADD_2(_z, _z, _a);						\
+      /* Multiply the pieces.  */					\
+      R##_f0 = _FP_MUL_MEAT_DW_1_hard_xl * _FP_MUL_MEAT_DW_1_hard_yl;	\
+      _FP_MUL_MEAT_DW_1_hard_a_f0					\
+	= _FP_MUL_MEAT_DW_1_hard_xh * _FP_MUL_MEAT_DW_1_hard_yl;	\
+      _FP_MUL_MEAT_DW_1_hard_a_f1					\
+	= _FP_MUL_MEAT_DW_1_hard_xl * _FP_MUL_MEAT_DW_1_hard_yh;	\
+      R##_f1 = _FP_MUL_MEAT_DW_1_hard_xh * _FP_MUL_MEAT_DW_1_hard_yh;	\
 									\
-    /* normalize */							\
-    _FP_FRAC_SRS_2(_z, wfracbits - 1, 2*wfracbits);			\
-    R##_f = _z_f0;							\
-  } while (0)
+      /* Reassemble into two full words.  */				\
+      if ((_FP_MUL_MEAT_DW_1_hard_a_f0 += _FP_MUL_MEAT_DW_1_hard_a_f1)	\
+	  < _FP_MUL_MEAT_DW_1_hard_a_f1)				\
+	R##_f1 += (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE/2);		\
+      _FP_MUL_MEAT_DW_1_hard_a_f1					\
+	= _FP_MUL_MEAT_DW_1_hard_a_f0 >> (_FP_W_TYPE_SIZE/2);		\
+      _FP_MUL_MEAT_DW_1_hard_a_f0					\
+	= _FP_MUL_MEAT_DW_1_hard_a_f0 << (_FP_W_TYPE_SIZE/2);		\
+      _FP_FRAC_ADD_2 (R, R, _FP_MUL_MEAT_DW_1_hard_a);			\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_1_hard(wfracbits, R, X, Y)			\
+  do								\
+    {								\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_1_hard_z);			\
+      _FP_MUL_MEAT_DW_1_hard ((wfracbits),			\
+			      _FP_MUL_MEAT_1_hard_z, X, Y);	\
+								\
+      /* Normalize.  */						\
+      _FP_FRAC_SRS_2 (_FP_MUL_MEAT_1_hard_z,			\
+		      (wfracbits) - 1, 2*(wfracbits));		\
+      R##_f = _FP_MUL_MEAT_1_hard_z_f0;				\
+    }								\
+  while (0)
 
 
-/*
- * Division algorithms:
- */
+/* Division algorithms: */
 
 /* Basic.  Assuming the host word size is >= 2*FRACBITS, we can do the
    division immediately.  Give this macro either _FP_DIV_HELP_imm for
    C primitives or _FP_DIV_HELP_ldiv for the ISO function.  Which you
    choose will depend on what the compiler does with divrem4.  */
 
-#define _FP_DIV_MEAT_1_imm(fs, R, X, Y, doit)		\
-  do {							\
-    _FP_W_TYPE _q, _r;					\
-    X##_f <<= (X##_f < Y##_f				\
-	       ? R##_e--, _FP_WFRACBITS_##fs		\
-	       : _FP_WFRACBITS_##fs - 1);		\
-    doit(_q, _r, X##_f, Y##_f);				\
-    R##_f = _q | (_r != 0);				\
-  } while (0)
+#define _FP_DIV_MEAT_1_imm(fs, R, X, Y, doit)				\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_DIV_MEAT_1_imm_q, _FP_DIV_MEAT_1_imm_r;		\
+      X##_f <<= (X##_f < Y##_f						\
+		 ? R##_e--, _FP_WFRACBITS_##fs				\
+		 : _FP_WFRACBITS_##fs - 1);				\
+      doit (_FP_DIV_MEAT_1_imm_q, _FP_DIV_MEAT_1_imm_r, X##_f, Y##_f);	\
+      R##_f = _FP_DIV_MEAT_1_imm_q | (_FP_DIV_MEAT_1_imm_r != 0);	\
+    }									\
+  while (0)
 
 /* GCC's longlong.h defines a 2W / 1W => (1W,1W) primitive udiv_qrnnd
    that may be useful in this situation.  This first is for a primitive
@@ -202,102 +269,101 @@
    for UDIV_NEEDS_NORMALIZATION to tell which your machine needs.  */
 
 #define _FP_DIV_MEAT_1_udiv_norm(fs, R, X, Y)				\
-  do {									\
-    _FP_W_TYPE _nh, _nl, _q, _r, _y;					\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_nh;				\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_nl;				\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_q;				\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_r;				\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_y;				\
+									\
+      /* Normalize Y -- i.e. make the most significant bit set.  */	\
+      _FP_DIV_MEAT_1_udiv_norm_y = Y##_f << _FP_WFRACXBITS_##fs;	\
 									\
-    /* Normalize Y -- i.e. make the most significant bit set.  */	\
-    _y = Y##_f << _FP_WFRACXBITS_##fs;					\
+      /* Shift X op correspondingly high, that is, up one full word.  */ \
+      if (X##_f < Y##_f)						\
+	{								\
+	  R##_e--;							\
+	  _FP_DIV_MEAT_1_udiv_norm_nl = 0;				\
+	  _FP_DIV_MEAT_1_udiv_norm_nh = X##_f;				\
+	}								\
+      else								\
+	{								\
+	  _FP_DIV_MEAT_1_udiv_norm_nl = X##_f << (_FP_W_TYPE_SIZE - 1);	\
+	  _FP_DIV_MEAT_1_udiv_norm_nh = X##_f >> 1;			\
+	}								\
 									\
-    /* Shift X op correspondingly high, that is, up one full word.  */	\
-    if (X##_f < Y##_f)							\
-      {									\
-	R##_e--;							\
-	_nl = 0;							\
-	_nh = X##_f;							\
-      }									\
-    else								\
-      {									\
-	_nl = X##_f << (_FP_W_TYPE_SIZE - 1);				\
-	_nh = X##_f >> 1;						\
-      }									\
-    									\
-    udiv_qrnnd(_q, _r, _nh, _nl, _y);					\
-    R##_f = _q | (_r != 0);						\
-  } while (0)
-
-#define _FP_DIV_MEAT_1_udiv(fs, R, X, Y)		\
-  do {							\
-    _FP_W_TYPE _nh, _nl, _q, _r;			\
-    if (X##_f < Y##_f)					\
-      {							\
-	R##_e--;					\
-	_nl = X##_f << _FP_WFRACBITS_##fs;		\
-	_nh = X##_f >> _FP_WFRACXBITS_##fs;		\
-      }							\
-    else						\
-      {							\
-	_nl = X##_f << (_FP_WFRACBITS_##fs - 1);	\
-	_nh = X##_f >> (_FP_WFRACXBITS_##fs + 1);	\
-      }							\
-    udiv_qrnnd(_q, _r, _nh, _nl, Y##_f);		\
-    R##_f = _q | (_r != 0);				\
-  } while (0)
-  
-  
-/*
- * Square root algorithms:
- * We have just one right now, maybe Newton approximation
- * should be added for those machines where division is fast.
- */
- 
-#define _FP_SQRT_MEAT_1(R, S, T, X, q)			\
-  do {							\
-    while (q != _FP_WORK_ROUND)				\
-      {							\
-        T##_f = S##_f + q;				\
-        if (T##_f <= X##_f)				\
-          {						\
-            S##_f = T##_f + q;				\
-            X##_f -= T##_f;				\
-            R##_f += q;					\
-          }						\
-        _FP_FRAC_SLL_1(X, 1);				\
-        q >>= 1;					\
-      }							\
-    if (X##_f)						\
-      {							\
-	if (S##_f < X##_f)				\
-	  R##_f |= _FP_WORK_ROUND;			\
-	R##_f |= _FP_WORK_STICKY;			\
-      }							\
-  } while (0)
-
-/*
- * Assembly/disassembly for converting to/from integral types.  
- * No shifting or overflow handled here.
- */
-
-#define _FP_FRAC_ASSEMBLE_1(r, X, rsize)	(r = X##_f)
-#define _FP_FRAC_DISASSEMBLE_1(X, r, rsize)	(X##_f = r)
-
-
-/*
- * Convert FP values between word sizes
- */
-
-#define _FP_FRAC_CONV_1_1(dfs, sfs, D, S)				\
-  do {									\
-    D##_f = S##_f;							\
-    if (_FP_WFRACBITS_##sfs > _FP_WFRACBITS_##dfs)			\
-      {									\
-	if (S##_c != FP_CLS_NAN)					\
-	  _FP_FRAC_SRS_1(D, (_FP_WFRACBITS_##sfs-_FP_WFRACBITS_##dfs),	\
-			 _FP_WFRACBITS_##sfs);				\
-	else								\
-	  _FP_FRAC_SRL_1(D, (_FP_WFRACBITS_##sfs-_FP_WFRACBITS_##dfs));	\
-      }									\
-    else								\
-      D##_f <<= _FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs;		\
-  } while (0)
+      udiv_qrnnd (_FP_DIV_MEAT_1_udiv_norm_q,				\
+		  _FP_DIV_MEAT_1_udiv_norm_r,				\
+		  _FP_DIV_MEAT_1_udiv_norm_nh,				\
+		  _FP_DIV_MEAT_1_udiv_norm_nl,				\
+		  _FP_DIV_MEAT_1_udiv_norm_y);				\
+      R##_f = (_FP_DIV_MEAT_1_udiv_norm_q				\
+	       | (_FP_DIV_MEAT_1_udiv_norm_r != 0));			\
+    }									\
+  while (0)
+
+#define _FP_DIV_MEAT_1_udiv(fs, R, X, Y)				\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_nh, _FP_DIV_MEAT_1_udiv_nl;	\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_q, _FP_DIV_MEAT_1_udiv_r;		\
+      if (X##_f < Y##_f)						\
+	{								\
+	  R##_e--;							\
+	  _FP_DIV_MEAT_1_udiv_nl = X##_f << _FP_WFRACBITS_##fs;		\
+	  _FP_DIV_MEAT_1_udiv_nh = X##_f >> _FP_WFRACXBITS_##fs;	\
+	}								\
+      else								\
+	{								\
+	  _FP_DIV_MEAT_1_udiv_nl = X##_f << (_FP_WFRACBITS_##fs - 1);	\
+	  _FP_DIV_MEAT_1_udiv_nh = X##_f >> (_FP_WFRACXBITS_##fs + 1);	\
+	}								\
+      udiv_qrnnd (_FP_DIV_MEAT_1_udiv_q, _FP_DIV_MEAT_1_udiv_r,		\
+		  _FP_DIV_MEAT_1_udiv_nh, _FP_DIV_MEAT_1_udiv_nl,	\
+		  Y##_f);						\
+      R##_f = _FP_DIV_MEAT_1_udiv_q | (_FP_DIV_MEAT_1_udiv_r != 0);	\
+    }									\
+  while (0)
+
+
+/* Square root algorithms:
+   We have just one right now, maybe Newton approximation
+   should be added for those machines where division is fast.  */
+
+#define _FP_SQRT_MEAT_1(R, S, T, X, q)		\
+  do						\
+    {						\
+      while ((q) != _FP_WORK_ROUND)		\
+	{					\
+	  T##_f = S##_f + (q);			\
+	  if (T##_f <= X##_f)			\
+	    {					\
+	      S##_f = T##_f + (q);		\
+	      X##_f -= T##_f;			\
+	      R##_f += (q);			\
+	    }					\
+	  _FP_FRAC_SLL_1 (X, 1);		\
+	  (q) >>= 1;				\
+	}					\
+      if (X##_f)				\
+	{					\
+	  if (S##_f < X##_f)			\
+	    R##_f |= _FP_WORK_ROUND;		\
+	  R##_f |= _FP_WORK_STICKY;		\
+	}					\
+    }						\
+  while (0)
+
+/* Assembly/disassembly for converting to/from integral types.
+   No shifting or overflow handled here.  */
+
+#define _FP_FRAC_ASSEMBLE_1(r, X, rsize)	((r) = X##_f)
+#define _FP_FRAC_DISASSEMBLE_1(X, r, rsize)	(X##_f = (r))
+
+
+/* Convert FP values between word sizes.  */
+
+#define _FP_FRAC_COPY_1_1(D, S)		(D##_f = S##_f)
 
 #endif /* __MATH_EMU_OP_1_H__ */
diff --git a/include/math-emu/op-2.h b/include/math-emu/op-2.h
index 4f26ecc..ed26ae9 100644
--- a/include/math-emu/op-2.h
+++ b/include/math-emu/op-2.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Basic two-word fraction declaration and manipulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,113 +8,139 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_OP_2_H__
 #define __MATH_EMU_OP_2_H__
 
 #define _FP_FRAC_DECL_2(X)	_FP_W_TYPE X##_f0 = 0, X##_f1 = 0
-#define _FP_FRAC_COPY_2(D,S)	(D##_f0 = S##_f0, D##_f1 = S##_f1)
-#define _FP_FRAC_SET_2(X,I)	__FP_FRAC_SET_2(X, I)
+#define _FP_FRAC_COPY_2(D, S)	(D##_f0 = S##_f0, D##_f1 = S##_f1)
+#define _FP_FRAC_SET_2(X, I)	__FP_FRAC_SET_2 (X, I)
 #define _FP_FRAC_HIGH_2(X)	(X##_f1)
 #define _FP_FRAC_LOW_2(X)	(X##_f0)
-#define _FP_FRAC_WORD_2(X,w)	(X##_f##w)
-
-#define _FP_FRAC_SLL_2(X,N)						\
-  do {									\
-    if ((N) < _FP_W_TYPE_SIZE)						\
-      {									\
-	if (__builtin_constant_p(N) && (N) == 1) 			\
-	  {								\
-	    X##_f1 = X##_f1 + X##_f1 + (((_FP_WS_TYPE)(X##_f0)) < 0);	\
-	    X##_f0 += X##_f0;						\
-	  }								\
-	else								\
-	  {								\
-	    X##_f1 = X##_f1 << (N) | X##_f0 >> (_FP_W_TYPE_SIZE - (N));	\
-	    X##_f0 <<= (N);						\
-	  }								\
-      }									\
-    else								\
-      {									\
-	X##_f1 = X##_f0 << ((N) - _FP_W_TYPE_SIZE);			\
-	X##_f0 = 0;							\
-      }									\
-  } while (0)
-
-#define _FP_FRAC_SRL_2(X,N)						\
-  do {									\
-    if ((N) < _FP_W_TYPE_SIZE)						\
-      {									\
-	X##_f0 = X##_f0 >> (N) | X##_f1 << (_FP_W_TYPE_SIZE - (N));	\
-	X##_f1 >>= (N);							\
-      }									\
-    else								\
-      {									\
-	X##_f0 = X##_f1 >> ((N) - _FP_W_TYPE_SIZE);			\
-	X##_f1 = 0;							\
-      }									\
-  } while (0)
+#define _FP_FRAC_WORD_2(X, w)	(X##_f##w)
+
+#define _FP_FRAC_SLL_2(X, N)						\
+  (void) (((N) < _FP_W_TYPE_SIZE)					\
+	  ? ({								\
+	      if (__builtin_constant_p (N) && (N) == 1)			\
+		{							\
+		  X##_f1 = X##_f1 + X##_f1 + (((_FP_WS_TYPE) (X##_f0)) < 0); \
+		  X##_f0 += X##_f0;					\
+		}							\
+	      else							\
+		{							\
+		  X##_f1 = X##_f1 << (N) | X##_f0 >> (_FP_W_TYPE_SIZE - (N)); \
+		  X##_f0 <<= (N);					\
+		}							\
+	      0;							\
+	    })								\
+	  : ({								\
+	      X##_f1 = X##_f0 << ((N) - _FP_W_TYPE_SIZE);		\
+	      X##_f0 = 0;						\
+	    }))
+
+
+#define _FP_FRAC_SRL_2(X, N)						\
+  (void) (((N) < _FP_W_TYPE_SIZE)					\
+	  ? ({								\
+	      X##_f0 = X##_f0 >> (N) | X##_f1 << (_FP_W_TYPE_SIZE - (N)); \
+	      X##_f1 >>= (N);						\
+	    })								\
+	  : ({								\
+	      X##_f0 = X##_f1 >> ((N) - _FP_W_TYPE_SIZE);		\
+	      X##_f1 = 0;						\
+	    }))
 
 /* Right shift with sticky-lsb.  */
-#define _FP_FRAC_SRS_2(X,N,sz)						\
-  do {									\
-    if ((N) < _FP_W_TYPE_SIZE)						\
-      {									\
-	X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) |	\
-		  (__builtin_constant_p(N) && (N) == 1			\
+#define _FP_FRAC_SRST_2(X, S, N, sz)					\
+  (void) (((N) < _FP_W_TYPE_SIZE)					\
+	  ? ({								\
+	      S = (__builtin_constant_p (N) && (N) == 1			\
 		   ? X##_f0 & 1						\
-		   : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0));	\
-	X##_f1 >>= (N);							\
-      }									\
-    else								\
-      {									\
-	X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE) |			\
-		(((X##_f1 << (2*_FP_W_TYPE_SIZE - (N))) | X##_f0) != 0)); \
-	X##_f1 = 0;							\
-      }									\
-  } while (0)
-
-#define _FP_FRAC_ADDI_2(X,I)	\
-  __FP_FRAC_ADDI_2(X##_f1, X##_f0, I)
-
-#define _FP_FRAC_ADD_2(R,X,Y)	\
-  __FP_FRAC_ADD_2(R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
-
-#define _FP_FRAC_SUB_2(R,X,Y)	\
-  __FP_FRAC_SUB_2(R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
-
-#define _FP_FRAC_DEC_2(X,Y)	\
-  __FP_FRAC_DEC_2(X##_f1, X##_f0, Y##_f1, Y##_f0)
-
-#define _FP_FRAC_CLZ_2(R,X)	\
-  do {				\
-    if (X##_f1)			\
-      __FP_CLZ(R,X##_f1);	\
-    else 			\
-    {				\
-      __FP_CLZ(R,X##_f0);	\
-      R += _FP_W_TYPE_SIZE;	\
-    }				\
-  } while(0)
-
-/* Predicates */
-#define _FP_FRAC_NEGP_2(X)	((_FP_WS_TYPE)X##_f1 < 0)
+		   : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0);		\
+	      X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N)); \
+	      X##_f1 >>= (N);						\
+	    })								\
+	  : ({								\
+	      S = ((((N) == _FP_W_TYPE_SIZE				\
+		     ? 0						\
+		     : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N))))		\
+		    | X##_f0) != 0);					\
+	      X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE));		\
+	      X##_f1 = 0;						\
+	    }))
+
+#define _FP_FRAC_SRS_2(X, N, sz)					\
+  (void) (((N) < _FP_W_TYPE_SIZE)					\
+	  ? ({								\
+	      X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) \
+			| (__builtin_constant_p (N) && (N) == 1		\
+			   ? X##_f0 & 1					\
+			   : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0)); \
+	      X##_f1 >>= (N);						\
+	    })								\
+	  : ({								\
+	      X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE)		\
+			| ((((N) == _FP_W_TYPE_SIZE			\
+			     ? 0					\
+			     : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N))))	\
+			    | X##_f0) != 0));				\
+	      X##_f1 = 0;						\
+	    }))
+
+#define _FP_FRAC_ADDI_2(X, I)	\
+  __FP_FRAC_ADDI_2 (X##_f1, X##_f0, I)
+
+#define _FP_FRAC_ADD_2(R, X, Y)	\
+  __FP_FRAC_ADD_2 (R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
+
+#define _FP_FRAC_SUB_2(R, X, Y)	\
+  __FP_FRAC_SUB_2 (R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
+
+#define _FP_FRAC_DEC_2(X, Y)	\
+  __FP_FRAC_DEC_2 (X##_f1, X##_f0, Y##_f1, Y##_f0)
+
+#define _FP_FRAC_CLZ_2(R, X)			\
+  do						\
+    {						\
+      if (X##_f1)				\
+	__FP_CLZ ((R), X##_f1);			\
+      else					\
+	{					\
+	  __FP_CLZ ((R), X##_f0);		\
+	  (R) += _FP_W_TYPE_SIZE;		\
+	}					\
+    }						\
+  while (0)
+
+/* Predicates.  */
+#define _FP_FRAC_NEGP_2(X)	((_FP_WS_TYPE) X##_f1 < 0)
 #define _FP_FRAC_ZEROP_2(X)	((X##_f1 | X##_f0) == 0)
-#define _FP_FRAC_OVERP_2(fs,X)	(_FP_FRAC_HIGH_##fs(X) & _FP_OVERFLOW_##fs)
-#define _FP_FRAC_CLEAR_OVERP_2(fs,X)	(_FP_FRAC_HIGH_##fs(X) &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_OVERP_2(fs, X)	(_FP_FRAC_HIGH_##fs (X) & _FP_OVERFLOW_##fs)
+#define _FP_FRAC_CLEAR_OVERP_2(fs, X)	(_FP_FRAC_HIGH_##fs (X) &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_HIGHBIT_DW_2(fs, X)	\
+  (_FP_FRAC_HIGH_DW_##fs (X) & _FP_HIGHBIT_DW_##fs)
 #define _FP_FRAC_EQ_2(X, Y)	(X##_f1 == Y##_f1 && X##_f0 == Y##_f0)
 #define _FP_FRAC_GT_2(X, Y)	\
   (X##_f1 > Y##_f1 || (X##_f1 == Y##_f1 && X##_f0 > Y##_f0))
@@ -123,491 +149,556 @@
 
 #define _FP_ZEROFRAC_2		0, 0
 #define _FP_MINFRAC_2		0, 1
-#define _FP_MAXFRAC_2		(~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0)
+#define _FP_MAXFRAC_2		(~(_FP_WS_TYPE) 0), (~(_FP_WS_TYPE) 0)
 
-/*
- * Internals 
- */
+/* Internals.  */
 
-#define __FP_FRAC_SET_2(X,I1,I0)	(X##_f0 = I0, X##_f1 = I1)
+#define __FP_FRAC_SET_2(X, I1, I0)	(X##_f0 = I0, X##_f1 = I1)
 
-#define __FP_CLZ_2(R, xh, xl)	\
-  do {				\
-    if (xh)			\
-      __FP_CLZ(R,xh);		\
-    else 			\
-    {				\
-      __FP_CLZ(R,xl);		\
-      R += _FP_W_TYPE_SIZE;	\
-    }				\
-  } while(0)
+#define __FP_CLZ_2(R, xh, xl)			\
+  do						\
+    {						\
+      if (xh)					\
+	__FP_CLZ ((R), xh);			\
+      else					\
+	{					\
+	  __FP_CLZ ((R), xl);			\
+	  (R) += _FP_W_TYPE_SIZE;		\
+	}					\
+    }						\
+  while (0)
 
 #if 0
 
-#ifndef __FP_FRAC_ADDI_2
-#define __FP_FRAC_ADDI_2(xh, xl, i)	\
+# ifndef __FP_FRAC_ADDI_2
+#  define __FP_FRAC_ADDI_2(xh, xl, i)	\
   (xh += ((xl += i) < i))
-#endif
-#ifndef __FP_FRAC_ADD_2
-#define __FP_FRAC_ADD_2(rh, rl, xh, xl, yh, yl)	\
+# endif
+# ifndef __FP_FRAC_ADD_2
+#  define __FP_FRAC_ADD_2(rh, rl, xh, xl, yh, yl)	\
   (rh = xh + yh + ((rl = xl + yl) < xl))
-#endif
-#ifndef __FP_FRAC_SUB_2
-#define __FP_FRAC_SUB_2(rh, rl, xh, xl, yh, yl)	\
+# endif
+# ifndef __FP_FRAC_SUB_2
+#  define __FP_FRAC_SUB_2(rh, rl, xh, xl, yh, yl)	\
   (rh = xh - yh - ((rl = xl - yl) > xl))
-#endif
-#ifndef __FP_FRAC_DEC_2
-#define __FP_FRAC_DEC_2(xh, xl, yh, yl)	\
-  do {					\
-    UWtype _t = xl;			\
-    xh -= yh + ((xl -= yl) > _t);	\
-  } while (0)
-#endif
+# endif
+# ifndef __FP_FRAC_DEC_2
+#  define __FP_FRAC_DEC_2(xh, xl, yh, yl)		\
+  do							\
+    {							\
+      UWtype __FP_FRAC_DEC_2_t = xl;			\
+      xh -= yh + ((xl -= yl) > __FP_FRAC_DEC_2_t);	\
+    }							\
+  while (0)
+# endif
 
 #else
 
-#undef __FP_FRAC_ADDI_2
-#define __FP_FRAC_ADDI_2(xh, xl, i)	add_ssaaaa(xh, xl, xh, xl, 0, i)
-#undef __FP_FRAC_ADD_2
-#define __FP_FRAC_ADD_2			add_ssaaaa
-#undef __FP_FRAC_SUB_2
-#define __FP_FRAC_SUB_2			sub_ddmmss
-#undef __FP_FRAC_DEC_2
-#define __FP_FRAC_DEC_2(xh, xl, yh, yl)	sub_ddmmss(xh, xl, xh, xl, yh, yl)
+# undef __FP_FRAC_ADDI_2
+# define __FP_FRAC_ADDI_2(xh, xl, i)	add_ssaaaa (xh, xl, xh, xl, 0, i)
+# undef __FP_FRAC_ADD_2
+# define __FP_FRAC_ADD_2		add_ssaaaa
+# undef __FP_FRAC_SUB_2
+# define __FP_FRAC_SUB_2		sub_ddmmss
+# undef __FP_FRAC_DEC_2
+# define __FP_FRAC_DEC_2(xh, xl, yh, yl)	\
+  sub_ddmmss (xh, xl, xh, xl, yh, yl)
 
 #endif
 
-/*
- * Unpack the raw bits of a native fp value.  Do not classify or
- * normalize the data.
- */
+/* Unpack the raw bits of a native fp value.  Do not classify or
+   normalize the data.  */
 
 #define _FP_UNPACK_RAW_2(fs, X, val)			\
-  do {							\
-    union _FP_UNION_##fs _flo; _flo.flt = (val);	\
+  do							\
+    {							\
+      union _FP_UNION_##fs _FP_UNPACK_RAW_2_flo;	\
+      _FP_UNPACK_RAW_2_flo.flt = (val);			\
 							\
-    X##_f0 = _flo.bits.frac0;				\
-    X##_f1 = _flo.bits.frac1;				\
-    X##_e  = _flo.bits.exp;				\
-    X##_s  = _flo.bits.sign;				\
-  } while (0)
+      X##_f0 = _FP_UNPACK_RAW_2_flo.bits.frac0;		\
+      X##_f1 = _FP_UNPACK_RAW_2_flo.bits.frac1;		\
+      X##_e  = _FP_UNPACK_RAW_2_flo.bits.exp;		\
+      X##_s  = _FP_UNPACK_RAW_2_flo.bits.sign;		\
+    }							\
+  while (0)
 
 #define _FP_UNPACK_RAW_2_P(fs, X, val)			\
-  do {							\
-    union _FP_UNION_##fs *_flo =			\
-      (union _FP_UNION_##fs *)(val);			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_UNPACK_RAW_2_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
 							\
-    X##_f0 = _flo->bits.frac0;				\
-    X##_f1 = _flo->bits.frac1;				\
-    X##_e  = _flo->bits.exp;				\
-    X##_s  = _flo->bits.sign;				\
-  } while (0)
-
-
-/*
- * Repack the raw bits of a native fp value.
- */
-
-#define _FP_PACK_RAW_2(fs, val, X)			\
-  do {							\
-    union _FP_UNION_##fs _flo;				\
-							\
-    _flo.bits.frac0 = X##_f0;				\
-    _flo.bits.frac1 = X##_f1;				\
-    _flo.bits.exp   = X##_e;				\
-    _flo.bits.sign  = X##_s;				\
-							\
-    (val) = _flo.flt;					\
-  } while (0)
+      X##_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0;	\
+      X##_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1;	\
+      X##_e  = _FP_UNPACK_RAW_2_P_flo->bits.exp;	\
+      X##_s  = _FP_UNPACK_RAW_2_P_flo->bits.sign;	\
+    }							\
+  while (0)
+
+
+/* Repack the raw bits of a native fp value.  */
+
+#define _FP_PACK_RAW_2(fs, val, X)		\
+  do						\
+    {						\
+      union _FP_UNION_##fs _FP_PACK_RAW_2_flo;	\
+						\
+      _FP_PACK_RAW_2_flo.bits.frac0 = X##_f0;	\
+      _FP_PACK_RAW_2_flo.bits.frac1 = X##_f1;	\
+      _FP_PACK_RAW_2_flo.bits.exp   = X##_e;	\
+      _FP_PACK_RAW_2_flo.bits.sign  = X##_s;	\
+						\
+      (val) = _FP_PACK_RAW_2_flo.flt;		\
+    }						\
+  while (0)
 
 #define _FP_PACK_RAW_2_P(fs, val, X)			\
-  do {							\
-    union _FP_UNION_##fs *_flo =			\
-      (union _FP_UNION_##fs *)(val);			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_PACK_RAW_2_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
 							\
-    _flo->bits.frac0 = X##_f0;				\
-    _flo->bits.frac1 = X##_f1;				\
-    _flo->bits.exp   = X##_e;				\
-    _flo->bits.sign  = X##_s;				\
-  } while (0)
+      _FP_PACK_RAW_2_P_flo->bits.frac0 = X##_f0;	\
+      _FP_PACK_RAW_2_P_flo->bits.frac1 = X##_f1;	\
+      _FP_PACK_RAW_2_P_flo->bits.exp   = X##_e;		\
+      _FP_PACK_RAW_2_P_flo->bits.sign  = X##_s;		\
+    }							\
+  while (0)
 
 
-/*
- * Multiplication algorithms:
- */
+/* Multiplication algorithms: */
 
 /* Given a 1W * 1W => 2W primitive, do the extended multiplication.  */
 
-#define _FP_MUL_MEAT_2_wide(wfracbits, R, X, Y, doit)			\
-  do {									\
-    _FP_FRAC_DECL_4(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c);	\
+#define _FP_MUL_MEAT_DW_2_wide(wfracbits, R, X, Y, doit)		\
+  do									\
+    {									\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_2_wide_b);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_2_wide_c);			\
+									\
+      doit (_FP_FRAC_WORD_4 (R, 1), _FP_FRAC_WORD_4 (R, 0),		\
+	    X##_f0, Y##_f0);						\
+      doit (_FP_MUL_MEAT_DW_2_wide_b_f1, _FP_MUL_MEAT_DW_2_wide_b_f0,	\
+	    X##_f0, Y##_f1);						\
+      doit (_FP_MUL_MEAT_DW_2_wide_c_f1, _FP_MUL_MEAT_DW_2_wide_c_f0,	\
+	    X##_f1, Y##_f0);						\
+      doit (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),		\
+	    X##_f1, Y##_f1);						\
 									\
-    doit(_FP_FRAC_WORD_4(_z,1), _FP_FRAC_WORD_4(_z,0), X##_f0, Y##_f0);	\
-    doit(_b_f1, _b_f0, X##_f0, Y##_f1);					\
-    doit(_c_f1, _c_f0, X##_f1, Y##_f0);					\
-    doit(_FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2), X##_f1, Y##_f1);	\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_2_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_2_wide_b_f0,			\
+		       _FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_2_wide_c_f1,			\
+		       _FP_MUL_MEAT_DW_2_wide_c_f0,			\
+		       _FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1));				\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_2_wide(wfracbits, R, X, Y, doit)			\
+  do									\
+    {									\
+      _FP_FRAC_DECL_4 (_FP_MUL_MEAT_2_wide_z);				\
 									\
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1), 0, _b_f1, _b_f0,		\
-		    _FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1));				\
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1), 0, _c_f1, _c_f0,		\
-		    _FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1));				\
+      _FP_MUL_MEAT_DW_2_wide ((wfracbits), _FP_MUL_MEAT_2_wide_z,	\
+			      X, Y, doit);				\
 									\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits);			\
-    R##_f0 = _FP_FRAC_WORD_4(_z,0);					\
-    R##_f1 = _FP_FRAC_WORD_4(_z,1);					\
-  } while (0)
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_4 (_FP_MUL_MEAT_2_wide_z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      R##_f0 = _FP_FRAC_WORD_4 (_FP_MUL_MEAT_2_wide_z, 0);		\
+      R##_f1 = _FP_FRAC_WORD_4 (_FP_MUL_MEAT_2_wide_z, 1);		\
+    }									\
+  while (0)
 
 /* Given a 1W * 1W => 2W primitive, do the extended multiplication.
    Do only 3 multiplications instead of four. This one is for machines
    where multiplication is much more expensive than subtraction.  */
 
-#define _FP_MUL_MEAT_2_wide_3mul(wfracbits, R, X, Y, doit)		\
-  do {									\
-    _FP_FRAC_DECL_4(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c);	\
-    _FP_W_TYPE _d;							\
-    int _c1, _c2;							\
+#define _FP_MUL_MEAT_DW_2_wide_3mul(wfracbits, R, X, Y, doit)		\
+  do									\
+    {									\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_2_wide_3mul_b);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_2_wide_3mul_c);			\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_2_wide_3mul_d;				\
+      int _FP_MUL_MEAT_DW_2_wide_3mul_c1;				\
+      int _FP_MUL_MEAT_DW_2_wide_3mul_c2;				\
 									\
-    _b_f0 = X##_f0 + X##_f1;						\
-    _c1 = _b_f0 < X##_f0;						\
-    _b_f1 = Y##_f0 + Y##_f1;						\
-    _c2 = _b_f1 < Y##_f0;						\
-    doit(_d, _FP_FRAC_WORD_4(_z,0), X##_f0, Y##_f0);			\
-    doit(_FP_FRAC_WORD_4(_z,2), _FP_FRAC_WORD_4(_z,1), _b_f0, _b_f1);	\
-    doit(_c_f1, _c_f0, X##_f1, Y##_f1);					\
+      _FP_MUL_MEAT_DW_2_wide_3mul_b_f0 = X##_f0 + X##_f1;		\
+      _FP_MUL_MEAT_DW_2_wide_3mul_c1					\
+	= _FP_MUL_MEAT_DW_2_wide_3mul_b_f0 < X##_f0;			\
+      _FP_MUL_MEAT_DW_2_wide_3mul_b_f1 = Y##_f0 + Y##_f1;		\
+      _FP_MUL_MEAT_DW_2_wide_3mul_c2					\
+	= _FP_MUL_MEAT_DW_2_wide_3mul_b_f1 < Y##_f0;			\
+      doit (_FP_MUL_MEAT_DW_2_wide_3mul_d, _FP_FRAC_WORD_4 (R, 0),	\
+	    X##_f0, Y##_f0);						\
+      doit (_FP_FRAC_WORD_4 (R, 2), _FP_FRAC_WORD_4 (R, 1),		\
+	    _FP_MUL_MEAT_DW_2_wide_3mul_b_f0,				\
+	    _FP_MUL_MEAT_DW_2_wide_3mul_b_f1);				\
+      doit (_FP_MUL_MEAT_DW_2_wide_3mul_c_f1,				\
+	    _FP_MUL_MEAT_DW_2_wide_3mul_c_f0, X##_f1, Y##_f1);		\
+									\
+      _FP_MUL_MEAT_DW_2_wide_3mul_b_f0					\
+	&= -_FP_MUL_MEAT_DW_2_wide_3mul_c2;				\
+      _FP_MUL_MEAT_DW_2_wide_3mul_b_f1					\
+	&= -_FP_MUL_MEAT_DW_2_wide_3mul_c1;				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1),				\
+		       (_FP_MUL_MEAT_DW_2_wide_3mul_c1			\
+			& _FP_MUL_MEAT_DW_2_wide_3mul_c2), 0,		\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_d,			\
+		       0, _FP_FRAC_WORD_4 (R, 2), _FP_FRAC_WORD_4 (R, 1)); \
+      __FP_FRAC_ADDI_2 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+			_FP_MUL_MEAT_DW_2_wide_3mul_b_f0);		\
+      __FP_FRAC_ADDI_2 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+			_FP_MUL_MEAT_DW_2_wide_3mul_b_f1);		\
+      __FP_FRAC_DEC_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1),				\
+		       0, _FP_MUL_MEAT_DW_2_wide_3mul_d,		\
+		       _FP_FRAC_WORD_4 (R, 0));				\
+      __FP_FRAC_DEC_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_c_f1,		\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_c_f0);		\
+      __FP_FRAC_ADD_2 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_c_f1,		\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_c_f0,		\
+		       _FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2));	\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_2_wide_3mul(wfracbits, R, X, Y, doit)		\
+  do									\
+    {									\
+      _FP_FRAC_DECL_4 (_FP_MUL_MEAT_2_wide_3mul_z);			\
 									\
-    _b_f0 &= -_c2;							\
-    _b_f1 &= -_c1;							\
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1), (_c1 & _c2), 0, _d,		\
-		    0, _FP_FRAC_WORD_4(_z,2), _FP_FRAC_WORD_4(_z,1));	\
-    __FP_FRAC_ADDI_2(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		     _b_f0);						\
-    __FP_FRAC_ADDI_2(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		     _b_f1);						\
-    __FP_FRAC_DEC_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1),				\
-		    0, _d, _FP_FRAC_WORD_4(_z,0));			\
-    __FP_FRAC_DEC_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1), 0, _c_f1, _c_f0);		\
-    __FP_FRAC_ADD_2(_FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2),	\
-		    _c_f1, _c_f0,					\
-		    _FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2));	\
+      _FP_MUL_MEAT_DW_2_wide_3mul ((wfracbits),				\
+				   _FP_MUL_MEAT_2_wide_3mul_z,		\
+				   X, Y, doit);				\
 									\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits);			\
-    R##_f0 = _FP_FRAC_WORD_4(_z,0);					\
-    R##_f1 = _FP_FRAC_WORD_4(_z,1);					\
-  } while (0)
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_4 (_FP_MUL_MEAT_2_wide_3mul_z,			\
+		      (wfracbits)-1, 2*(wfracbits));			\
+      R##_f0 = _FP_FRAC_WORD_4 (_FP_MUL_MEAT_2_wide_3mul_z, 0);		\
+      R##_f1 = _FP_FRAC_WORD_4 (_FP_MUL_MEAT_2_wide_3mul_z, 1);		\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_DW_2_gmp(wfracbits, R, X, Y)	\
+  do							\
+    {							\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_2_gmp_x[2];		\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_2_gmp_y[2];		\
+      _FP_MUL_MEAT_DW_2_gmp_x[0] = X##_f0;		\
+      _FP_MUL_MEAT_DW_2_gmp_x[1] = X##_f1;		\
+      _FP_MUL_MEAT_DW_2_gmp_y[0] = Y##_f0;		\
+      _FP_MUL_MEAT_DW_2_gmp_y[1] = Y##_f1;		\
+							\
+      mpn_mul_n (R##_f, _FP_MUL_MEAT_DW_2_gmp_x,	\
+		 _FP_MUL_MEAT_DW_2_gmp_y, 2);		\
+    }							\
+  while (0)
 
 #define _FP_MUL_MEAT_2_gmp(wfracbits, R, X, Y)				\
-  do {									\
-    _FP_FRAC_DECL_4(_z);						\
-    _FP_W_TYPE _x[2], _y[2];						\
-    _x[0] = X##_f0; _x[1] = X##_f1;					\
-    _y[0] = Y##_f0; _y[1] = Y##_f1;					\
+  do									\
+    {									\
+      _FP_FRAC_DECL_4 (_FP_MUL_MEAT_2_gmp_z);				\
 									\
-    mpn_mul_n(_z_f, _x, _y, 2);						\
+      _FP_MUL_MEAT_DW_2_gmp ((wfracbits), _FP_MUL_MEAT_2_gmp_z, X, Y);	\
 									\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits);			\
-    R##_f0 = _z_f[0];							\
-    R##_f1 = _z_f[1];							\
-  } while (0)
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_4 (_FP_MUL_MEAT_2_gmp_z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      R##_f0 = _FP_MUL_MEAT_2_gmp_z_f[0];				\
+      R##_f1 = _FP_MUL_MEAT_2_gmp_z_f[1];				\
+    }									\
+  while (0)
 
 /* Do at most 120x120=240 bits multiplication using double floating
    point multiplication.  This is useful if floating point
    multiplication has much bigger throughput than integer multiply.
    It is supposed to work for _FP_W_TYPE_SIZE 64 and wfracbits
-   between 106 and 120 only.  
+   between 106 and 120 only.
    Caller guarantees that X and Y has (1LLL << (wfracbits - 1)) set.
    SETFETZ is a macro which will disable all FPU exceptions and set rounding
    towards zero,  RESETFE should optionally reset it back.  */
 
-#define _FP_MUL_MEAT_2_120_240_double(wfracbits, R, X, Y, setfetz, resetfe)	\
-  do {										\
-    static const double _const[] = {						\
-      /* 2^-24 */ 5.9604644775390625e-08,					\
-      /* 2^-48 */ 3.5527136788005009e-15,					\
-      /* 2^-72 */ 2.1175823681357508e-22,					\
-      /* 2^-96 */ 1.2621774483536189e-29,					\
-      /* 2^28 */ 2.68435456e+08,						\
-      /* 2^4 */ 1.600000e+01,							\
-      /* 2^-20 */ 9.5367431640625e-07,						\
-      /* 2^-44 */ 5.6843418860808015e-14,					\
-      /* 2^-68 */ 3.3881317890172014e-21,					\
-      /* 2^-92 */ 2.0194839173657902e-28,					\
-      /* 2^-116 */ 1.2037062152420224e-35};					\
-    double _a240, _b240, _c240, _d240, _e240, _f240, 				\
-	   _g240, _h240, _i240, _j240, _k240;					\
-    union { double d; UDItype i; } _l240, _m240, _n240, _o240,			\
-				   _p240, _q240, _r240, _s240;			\
-    UDItype _t240, _u240, _v240, _w240, _x240, _y240 = 0;			\
-										\
-    if (wfracbits < 106 || wfracbits > 120)					\
-      abort();									\
-										\
-    setfetz;									\
-										\
-    _e240 = (double)(long)(X##_f0 & 0xffffff);					\
-    _j240 = (double)(long)(Y##_f0 & 0xffffff);					\
-    _d240 = (double)(long)((X##_f0 >> 24) & 0xffffff);				\
-    _i240 = (double)(long)((Y##_f0 >> 24) & 0xffffff);				\
-    _c240 = (double)(long)(((X##_f1 << 16) & 0xffffff) | (X##_f0 >> 48));	\
-    _h240 = (double)(long)(((Y##_f1 << 16) & 0xffffff) | (Y##_f0 >> 48));	\
-    _b240 = (double)(long)((X##_f1 >> 8) & 0xffffff);				\
-    _g240 = (double)(long)((Y##_f1 >> 8) & 0xffffff);				\
-    _a240 = (double)(long)(X##_f1 >> 32);					\
-    _f240 = (double)(long)(Y##_f1 >> 32);					\
-    _e240 *= _const[3];								\
-    _j240 *= _const[3];								\
-    _d240 *= _const[2];								\
-    _i240 *= _const[2];								\
-    _c240 *= _const[1];								\
-    _h240 *= _const[1];								\
-    _b240 *= _const[0];								\
-    _g240 *= _const[0];								\
-    _s240.d =							      _e240*_j240;\
-    _r240.d =						_d240*_j240 + _e240*_i240;\
-    _q240.d =				  _c240*_j240 + _d240*_i240 + _e240*_h240;\
-    _p240.d =		    _b240*_j240 + _c240*_i240 + _d240*_h240 + _e240*_g240;\
-    _o240.d = _a240*_j240 + _b240*_i240 + _c240*_h240 + _d240*_g240 + _e240*_f240;\
-    _n240.d = _a240*_i240 + _b240*_h240 + _c240*_g240 + _d240*_f240;		\
-    _m240.d = _a240*_h240 + _b240*_g240 + _c240*_f240;				\
-    _l240.d = _a240*_g240 + _b240*_f240;					\
-    _k240 =   _a240*_f240;							\
-    _r240.d += _s240.d;								\
-    _q240.d += _r240.d;								\
-    _p240.d += _q240.d;								\
-    _o240.d += _p240.d;								\
-    _n240.d += _o240.d;								\
-    _m240.d += _n240.d;								\
-    _l240.d += _m240.d;								\
-    _k240 += _l240.d;								\
-    _s240.d -= ((_const[10]+_s240.d)-_const[10]);				\
-    _r240.d -= ((_const[9]+_r240.d)-_const[9]);					\
-    _q240.d -= ((_const[8]+_q240.d)-_const[8]);					\
-    _p240.d -= ((_const[7]+_p240.d)-_const[7]);					\
-    _o240.d += _const[7];							\
-    _n240.d += _const[6];							\
-    _m240.d += _const[5];							\
-    _l240.d += _const[4];							\
-    if (_s240.d != 0.0) _y240 = 1;						\
-    if (_r240.d != 0.0) _y240 = 1;						\
-    if (_q240.d != 0.0) _y240 = 1;						\
-    if (_p240.d != 0.0) _y240 = 1;						\
-    _t240 = (DItype)_k240;							\
-    _u240 = _l240.i;								\
-    _v240 = _m240.i;								\
-    _w240 = _n240.i;								\
-    _x240 = _o240.i;								\
-    R##_f1 = (_t240 << (128 - (wfracbits - 1)))					\
-	     | ((_u240 & 0xffffff) >> ((wfracbits - 1) - 104));			\
-    R##_f0 = ((_u240 & 0xffffff) << (168 - (wfracbits - 1)))			\
-    	     | ((_v240 & 0xffffff) << (144 - (wfracbits - 1)))			\
-    	     | ((_w240 & 0xffffff) << (120 - (wfracbits - 1)))			\
-    	     | ((_x240 & 0xffffff) >> ((wfracbits - 1) - 96))			\
-    	     | _y240;								\
-    resetfe;									\
-  } while (0)
-
-/*
- * Division algorithms:
- */
+#define _FP_MUL_MEAT_2_120_240_double(wfracbits, R, X, Y, setfetz, resetfe) \
+  do									\
+    {									\
+      static const double _const[] =					\
+	{								\
+	  /* 2^-24 */ 5.9604644775390625e-08,				\
+	  /* 2^-48 */ 3.5527136788005009e-15,				\
+	  /* 2^-72 */ 2.1175823681357508e-22,				\
+	  /* 2^-96 */ 1.2621774483536189e-29,				\
+	  /* 2^28 */ 2.68435456e+08,					\
+	  /* 2^4 */ 1.600000e+01,					\
+	  /* 2^-20 */ 9.5367431640625e-07,				\
+	  /* 2^-44 */ 5.6843418860808015e-14,				\
+	  /* 2^-68 */ 3.3881317890172014e-21,				\
+	  /* 2^-92 */ 2.0194839173657902e-28,				\
+	  /* 2^-116 */ 1.2037062152420224e-35				\
+	};								\
+      double _a240, _b240, _c240, _d240, _e240, _f240,			\
+	_g240, _h240, _i240, _j240, _k240;				\
+      union { double d; UDItype i; } _l240, _m240, _n240, _o240,	\
+				       _p240, _q240, _r240, _s240;	\
+      UDItype _t240, _u240, _v240, _w240, _x240, _y240 = 0;		\
+									\
+      if ((wfracbits) < 106 || (wfracbits) > 120)			\
+	abort ();							\
+									\
+      setfetz;								\
+									\
+      _e240 = (double) (long) (X##_f0 & 0xffffff);			\
+      _j240 = (double) (long) (Y##_f0 & 0xffffff);			\
+      _d240 = (double) (long) ((X##_f0 >> 24) & 0xffffff);		\
+      _i240 = (double) (long) ((Y##_f0 >> 24) & 0xffffff);		\
+      _c240 = (double) (long) (((X##_f1 << 16) & 0xffffff) | (X##_f0 >> 48)); \
+      _h240 = (double) (long) (((Y##_f1 << 16) & 0xffffff) | (Y##_f0 >> 48)); \
+      _b240 = (double) (long) ((X##_f1 >> 8) & 0xffffff);		\
+      _g240 = (double) (long) ((Y##_f1 >> 8) & 0xffffff);		\
+      _a240 = (double) (long) (X##_f1 >> 32);				\
+      _f240 = (double) (long) (Y##_f1 >> 32);				\
+      _e240 *= _const[3];						\
+      _j240 *= _const[3];						\
+      _d240 *= _const[2];						\
+      _i240 *= _const[2];						\
+      _c240 *= _const[1];						\
+      _h240 *= _const[1];						\
+      _b240 *= _const[0];						\
+      _g240 *= _const[0];						\
+      _s240.d =							      _e240*_j240; \
+      _r240.d =						_d240*_j240 + _e240*_i240; \
+      _q240.d =				  _c240*_j240 + _d240*_i240 + _e240*_h240; \
+      _p240.d =		    _b240*_j240 + _c240*_i240 + _d240*_h240 + _e240*_g240; \
+      _o240.d = _a240*_j240 + _b240*_i240 + _c240*_h240 + _d240*_g240 + _e240*_f240; \
+      _n240.d = _a240*_i240 + _b240*_h240 + _c240*_g240 + _d240*_f240;	\
+      _m240.d = _a240*_h240 + _b240*_g240 + _c240*_f240;		\
+      _l240.d = _a240*_g240 + _b240*_f240;				\
+      _k240 =   _a240*_f240;						\
+      _r240.d += _s240.d;						\
+      _q240.d += _r240.d;						\
+      _p240.d += _q240.d;						\
+      _o240.d += _p240.d;						\
+      _n240.d += _o240.d;						\
+      _m240.d += _n240.d;						\
+      _l240.d += _m240.d;						\
+      _k240 += _l240.d;							\
+      _s240.d -= ((_const[10]+_s240.d)-_const[10]);			\
+      _r240.d -= ((_const[9]+_r240.d)-_const[9]);			\
+      _q240.d -= ((_const[8]+_q240.d)-_const[8]);			\
+      _p240.d -= ((_const[7]+_p240.d)-_const[7]);			\
+      _o240.d += _const[7];						\
+      _n240.d += _const[6];						\
+      _m240.d += _const[5];						\
+      _l240.d += _const[4];						\
+      if (_s240.d != 0.0)						\
+	_y240 = 1;							\
+      if (_r240.d != 0.0)						\
+	_y240 = 1;							\
+      if (_q240.d != 0.0)						\
+	_y240 = 1;							\
+      if (_p240.d != 0.0)						\
+	_y240 = 1;							\
+      _t240 = (DItype) _k240;						\
+      _u240 = _l240.i;							\
+      _v240 = _m240.i;							\
+      _w240 = _n240.i;							\
+      _x240 = _o240.i;							\
+      R##_f1 = ((_t240 << (128 - (wfracbits - 1)))			\
+		| ((_u240 & 0xffffff) >> ((wfracbits - 1) - 104)));	\
+      R##_f0 = (((_u240 & 0xffffff) << (168 - (wfracbits - 1)))		\
+		| ((_v240 & 0xffffff) << (144 - (wfracbits - 1)))	\
+		| ((_w240 & 0xffffff) << (120 - (wfracbits - 1)))	\
+		| ((_x240 & 0xffffff) >> ((wfracbits - 1) - 96))	\
+		| _y240);						\
+      resetfe;								\
+    }									\
+  while (0)
+
+/* Division algorithms: */
 
 #define _FP_DIV_MEAT_2_udiv(fs, R, X, Y)				\
-  do {									\
-    _FP_W_TYPE _n_f2, _n_f1, _n_f0, _r_f1, _r_f0, _m_f1, _m_f0;		\
-    if (_FP_FRAC_GT_2(X, Y))						\
-      {									\
-	_n_f2 = X##_f1 >> 1;						\
-	_n_f1 = X##_f1 << (_FP_W_TYPE_SIZE - 1) | X##_f0 >> 1;		\
-	_n_f0 = X##_f0 << (_FP_W_TYPE_SIZE - 1);			\
-      }									\
-    else								\
-      {									\
-	R##_e--;							\
-	_n_f2 = X##_f1;							\
-	_n_f1 = X##_f0;							\
-	_n_f0 = 0;							\
-      }									\
-									\
-    /* Normalize, i.e. make the most significant bit of the 		\
-       denominator set. */						\
-    _FP_FRAC_SLL_2(Y, _FP_WFRACXBITS_##fs);				\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_n_f2;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_n_f1;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_n_f0;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_r_f1;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_r_f0;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_m_f1;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_m_f0;				\
+      if (_FP_FRAC_GE_2 (X, Y))						\
+	{								\
+	  _FP_DIV_MEAT_2_udiv_n_f2 = X##_f1 >> 1;			\
+	  _FP_DIV_MEAT_2_udiv_n_f1					\
+	    = X##_f1 << (_FP_W_TYPE_SIZE - 1) | X##_f0 >> 1;		\
+	  _FP_DIV_MEAT_2_udiv_n_f0					\
+	    = X##_f0 << (_FP_W_TYPE_SIZE - 1);				\
+	}								\
+      else								\
+	{								\
+	  R##_e--;							\
+	  _FP_DIV_MEAT_2_udiv_n_f2 = X##_f1;				\
+	  _FP_DIV_MEAT_2_udiv_n_f1 = X##_f0;				\
+	  _FP_DIV_MEAT_2_udiv_n_f0 = 0;					\
+	}								\
 									\
-    udiv_qrnnd(R##_f1, _r_f1, _n_f2, _n_f1, Y##_f1);			\
-    umul_ppmm(_m_f1, _m_f0, R##_f1, Y##_f0);				\
-    _r_f0 = _n_f0;							\
-    if (_FP_FRAC_GT_2(_m, _r))						\
-      {									\
-	R##_f1--;							\
-	_FP_FRAC_ADD_2(_r, Y, _r);					\
-	if (_FP_FRAC_GE_2(_r, Y) && _FP_FRAC_GT_2(_m, _r))		\
-	  {								\
-	    R##_f1--;							\
-	    _FP_FRAC_ADD_2(_r, Y, _r);					\
-	  }								\
-      }									\
-    _FP_FRAC_DEC_2(_r, _m);						\
+      /* Normalize, i.e. make the most significant bit of the		\
+	 denominator set.  */						\
+      _FP_FRAC_SLL_2 (Y, _FP_WFRACXBITS_##fs);				\
 									\
-    if (_r_f1 == Y##_f1)						\
-      {									\
-	/* This is a special case, not an optimization			\
-	   (_r/Y##_f1 would not fit into UWtype).			\
-	   As _r is guaranteed to be < Y,  R##_f0 can be either		\
-	   (UWtype)-1 or (UWtype)-2.  But as we know what kind		\
-	   of bits it is (sticky, guard, round),  we don't care.	\
-	   We also don't care what the reminder is,  because the	\
-	   guard bit will be set anyway.  -jj */			\
-	R##_f0 = -1;							\
-      }									\
-    else								\
-      {									\
-	udiv_qrnnd(R##_f0, _r_f1, _r_f1, _r_f0, Y##_f1);		\
-	umul_ppmm(_m_f1, _m_f0, R##_f0, Y##_f0);			\
-	_r_f0 = 0;							\
-	if (_FP_FRAC_GT_2(_m, _r))					\
-	  {								\
-	    R##_f0--;							\
-	    _FP_FRAC_ADD_2(_r, Y, _r);					\
-	    if (_FP_FRAC_GE_2(_r, Y) && _FP_FRAC_GT_2(_m, _r))		\
-	      {								\
-		R##_f0--;						\
-		_FP_FRAC_ADD_2(_r, Y, _r);				\
-	      }								\
-	  }								\
-	if (!_FP_FRAC_EQ_2(_r, _m))					\
-	  R##_f0 |= _FP_WORK_STICKY;					\
-      }									\
-  } while (0)
-
-
-#define _FP_DIV_MEAT_2_gmp(fs, R, X, Y)					\
-  do {									\
-    _FP_W_TYPE _x[4], _y[2], _z[4];					\
-    _y[0] = Y##_f0; _y[1] = Y##_f1;					\
-    _x[0] = _x[3] = 0;							\
-    if (_FP_FRAC_GT_2(X, Y))						\
-      {									\
-	R##_e++;							\
-	_x[1] = (X##_f0 << (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE) |	\
-		 X##_f1 >> (_FP_W_TYPE_SIZE -				\
-			    (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE)));	\
-	_x[2] = X##_f1 << (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE);	\
-      }									\
-    else								\
-      {									\
-	_x[1] = (X##_f0 << (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE) |	\
-		 X##_f1 >> (_FP_W_TYPE_SIZE -				\
-			    (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE)));	\
-	_x[2] = X##_f1 << (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE);	\
-      }									\
+      udiv_qrnnd (R##_f1, _FP_DIV_MEAT_2_udiv_r_f1,			\
+		  _FP_DIV_MEAT_2_udiv_n_f2, _FP_DIV_MEAT_2_udiv_n_f1,	\
+		  Y##_f1);						\
+      umul_ppmm (_FP_DIV_MEAT_2_udiv_m_f1, _FP_DIV_MEAT_2_udiv_m_f0,	\
+		 R##_f1, Y##_f0);					\
+      _FP_DIV_MEAT_2_udiv_r_f0 = _FP_DIV_MEAT_2_udiv_n_f0;		\
+      if (_FP_FRAC_GT_2 (_FP_DIV_MEAT_2_udiv_m, _FP_DIV_MEAT_2_udiv_r))	\
+	{								\
+	  R##_f1--;							\
+	  _FP_FRAC_ADD_2 (_FP_DIV_MEAT_2_udiv_r, Y,			\
+			  _FP_DIV_MEAT_2_udiv_r);			\
+	  if (_FP_FRAC_GE_2 (_FP_DIV_MEAT_2_udiv_r, Y)			\
+	      && _FP_FRAC_GT_2 (_FP_DIV_MEAT_2_udiv_m,			\
+				_FP_DIV_MEAT_2_udiv_r))			\
+	    {								\
+	      R##_f1--;							\
+	      _FP_FRAC_ADD_2 (_FP_DIV_MEAT_2_udiv_r, Y,			\
+			      _FP_DIV_MEAT_2_udiv_r);			\
+	    }								\
+	}								\
+      _FP_FRAC_DEC_2 (_FP_DIV_MEAT_2_udiv_r, _FP_DIV_MEAT_2_udiv_m);	\
 									\
-    (void) mpn_divrem (_z, 0, _x, 4, _y, 2);				\
-    R##_f1 = _z[1];							\
-    R##_f0 = _z[0] | ((_x[0] | _x[1]) != 0);				\
-  } while (0)
-
-
-/*
- * Square root algorithms:
- * We have just one right now, maybe Newton approximation
- * should be added for those machines where division is fast.
- */
- 
-#define _FP_SQRT_MEAT_2(R, S, T, X, q)			\
-  do {							\
-    while (q)						\
-      {							\
-	T##_f1 = S##_f1 + q;				\
-	if (T##_f1 <= X##_f1)				\
-	  {						\
-	    S##_f1 = T##_f1 + q;			\
-	    X##_f1 -= T##_f1;				\
-	    R##_f1 += q;				\
-	  }						\
-	_FP_FRAC_SLL_2(X, 1);				\
-	q >>= 1;					\
-      }							\
-    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);		\
-    while (q != _FP_WORK_ROUND)				\
-      {							\
-	T##_f0 = S##_f0 + q;				\
-	T##_f1 = S##_f1;				\
-	if (T##_f1 < X##_f1 || 				\
-	    (T##_f1 == X##_f1 && T##_f0 <= X##_f0))	\
-	  {						\
-	    S##_f0 = T##_f0 + q;			\
-	    S##_f1 += (T##_f0 > S##_f0);		\
-	    _FP_FRAC_DEC_2(X, T);			\
-	    R##_f0 += q;				\
-	  }						\
-	_FP_FRAC_SLL_2(X, 1);				\
-	q >>= 1;					\
-      }							\
-    if (X##_f0 | X##_f1)				\
-      {							\
-	if (S##_f1 < X##_f1 || 				\
-	    (S##_f1 == X##_f1 && S##_f0 < X##_f0))	\
-	  R##_f0 |= _FP_WORK_ROUND;			\
-	R##_f0 |= _FP_WORK_STICKY;			\
-      }							\
-  } while (0)
-
-
-/*
- * Assembly/disassembly for converting to/from integral types.  
- * No shifting or overflow handled here.
- */
+      if (_FP_DIV_MEAT_2_udiv_r_f1 == Y##_f1)				\
+	{								\
+	  /* This is a special case, not an optimization		\
+	     (_FP_DIV_MEAT_2_udiv_r/Y##_f1 would not fit into UWtype).	\
+	     As _FP_DIV_MEAT_2_udiv_r is guaranteed to be < Y,		\
+	     R##_f0 can be either (UWtype)-1 or (UWtype)-2.  But as we	\
+	     know what kind of bits it is (sticky, guard, round),	\
+	     we don't care.  We also don't care what the reminder is,	\
+	     because the guard bit will be set anyway.  -jj */		\
+	  R##_f0 = -1;							\
+	}								\
+      else								\
+	{								\
+	  udiv_qrnnd (R##_f0, _FP_DIV_MEAT_2_udiv_r_f1,			\
+		      _FP_DIV_MEAT_2_udiv_r_f1,				\
+		      _FP_DIV_MEAT_2_udiv_r_f0, Y##_f1);		\
+	  umul_ppmm (_FP_DIV_MEAT_2_udiv_m_f1,				\
+		     _FP_DIV_MEAT_2_udiv_m_f0, R##_f0, Y##_f0);		\
+	  _FP_DIV_MEAT_2_udiv_r_f0 = 0;					\
+	  if (_FP_FRAC_GT_2 (_FP_DIV_MEAT_2_udiv_m,			\
+			     _FP_DIV_MEAT_2_udiv_r))			\
+	    {								\
+	      R##_f0--;							\
+	      _FP_FRAC_ADD_2 (_FP_DIV_MEAT_2_udiv_r, Y,			\
+			      _FP_DIV_MEAT_2_udiv_r);			\
+	      if (_FP_FRAC_GE_2 (_FP_DIV_MEAT_2_udiv_r, Y)		\
+		  && _FP_FRAC_GT_2 (_FP_DIV_MEAT_2_udiv_m,		\
+				    _FP_DIV_MEAT_2_udiv_r))		\
+		{							\
+		  R##_f0--;						\
+		  _FP_FRAC_ADD_2 (_FP_DIV_MEAT_2_udiv_r, Y,		\
+				  _FP_DIV_MEAT_2_udiv_r);		\
+		}							\
+	    }								\
+	  if (!_FP_FRAC_EQ_2 (_FP_DIV_MEAT_2_udiv_r,			\
+			      _FP_DIV_MEAT_2_udiv_m))			\
+	    R##_f0 |= _FP_WORK_STICKY;					\
+	}								\
+    }									\
+  while (0)
+
+
+/* Square root algorithms:
+   We have just one right now, maybe Newton approximation
+   should be added for those machines where division is fast.  */
+
+#define _FP_SQRT_MEAT_2(R, S, T, X, q)				\
+  do								\
+    {								\
+      while (q)							\
+	{							\
+	  T##_f1 = S##_f1 + (q);				\
+	  if (T##_f1 <= X##_f1)					\
+	    {							\
+	      S##_f1 = T##_f1 + (q);				\
+	      X##_f1 -= T##_f1;					\
+	      R##_f1 += (q);					\
+	    }							\
+	  _FP_FRAC_SLL_2 (X, 1);				\
+	  (q) >>= 1;						\
+	}							\
+      (q) = (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE - 1);		\
+      while ((q) != _FP_WORK_ROUND)				\
+	{							\
+	  T##_f0 = S##_f0 + (q);				\
+	  T##_f1 = S##_f1;					\
+	  if (T##_f1 < X##_f1					\
+	      || (T##_f1 == X##_f1 && T##_f0 <= X##_f0))	\
+	    {							\
+	      S##_f0 = T##_f0 + (q);				\
+	      S##_f1 += (T##_f0 > S##_f0);			\
+	      _FP_FRAC_DEC_2 (X, T);				\
+	      R##_f0 += (q);					\
+	    }							\
+	  _FP_FRAC_SLL_2 (X, 1);				\
+	  (q) >>= 1;						\
+	}							\
+      if (X##_f0 | X##_f1)					\
+	{							\
+	  if (S##_f1 < X##_f1					\
+	      || (S##_f1 == X##_f1 && S##_f0 < X##_f0))		\
+	    R##_f0 |= _FP_WORK_ROUND;				\
+	  R##_f0 |= _FP_WORK_STICKY;				\
+	}							\
+    }								\
+  while (0)
+
+
+/* Assembly/disassembly for converting to/from integral types.
+   No shifting or overflow handled here.  */
 
 #define _FP_FRAC_ASSEMBLE_2(r, X, rsize)	\
-  do {						\
-    if (rsize <= _FP_W_TYPE_SIZE)		\
-      r = X##_f0;				\
-    else					\
-      {						\
-	r = X##_f1;				\
-	r <<= _FP_W_TYPE_SIZE;			\
-	r += X##_f0;				\
-      }						\
-  } while (0)
-
-#define _FP_FRAC_DISASSEMBLE_2(X, r, rsize)				\
-  do {									\
-    X##_f0 = r;								\
-    X##_f1 = (rsize <= _FP_W_TYPE_SIZE ? 0 : r >> _FP_W_TYPE_SIZE);	\
-  } while (0)
-
-/*
- * Convert FP values between word sizes
- */
-
-#define _FP_FRAC_CONV_1_2(dfs, sfs, D, S)				\
-  do {									\
-    if (S##_c != FP_CLS_NAN)						\
-      _FP_FRAC_SRS_2(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs),	\
-		     _FP_WFRACBITS_##sfs);				\
-    else								\
-      _FP_FRAC_SRL_2(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs));	\
-    D##_f = S##_f0;							\
-  } while (0)
-
-#define _FP_FRAC_CONV_2_1(dfs, sfs, D, S)				\
-  do {									\
-    D##_f0 = S##_f;							\
-    D##_f1 = 0;								\
-    _FP_FRAC_SLL_2(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs));	\
-  } while (0)
+  (void) (((rsize) <= _FP_W_TYPE_SIZE)		\
+	  ? ({ (r) = X##_f0; })			\
+	  : ({					\
+	      (r) = X##_f1;			\
+	      (r) <<= _FP_W_TYPE_SIZE;		\
+	      (r) += X##_f0;			\
+	    }))
+
+#define _FP_FRAC_DISASSEMBLE_2(X, r, rsize)	\
+  do						\
+    {						\
+      X##_f0 = (r);				\
+      X##_f1 = ((rsize) <= _FP_W_TYPE_SIZE	\
+		? 0				\
+		: (r) >> _FP_W_TYPE_SIZE);	\
+    }						\
+  while (0)
+
+/* Convert FP values between word sizes.  */
+
+#define _FP_FRAC_COPY_1_2(D, S)		(D##_f = S##_f0)
+
+#define _FP_FRAC_COPY_2_1(D, S)		((D##_f0 = S##_f), (D##_f1 = 0))
+
+#define _FP_FRAC_COPY_2_2(D, S)		_FP_FRAC_COPY_2 (D, S)
 
 #endif
diff --git a/include/math-emu/op-4.h b/include/math-emu/op-4.h
index ba226f8..1c409eb 100644
--- a/include/math-emu/op-4.h
+++ b/include/math-emu/op-4.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Basic four-word fraction declaration and manipulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,685 +8,868 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_OP_4_H__
 #define __MATH_EMU_OP_4_H__
 
 #define _FP_FRAC_DECL_4(X)	_FP_W_TYPE X##_f[4]
-#define _FP_FRAC_COPY_4(D,S)			\
+#define _FP_FRAC_COPY_4(D, S)			\
   (D##_f[0] = S##_f[0], D##_f[1] = S##_f[1],	\
    D##_f[2] = S##_f[2], D##_f[3] = S##_f[3])
-#define _FP_FRAC_SET_4(X,I)	__FP_FRAC_SET_4(X, I)
+#define _FP_FRAC_SET_4(X, I)	__FP_FRAC_SET_4 (X, I)
 #define _FP_FRAC_HIGH_4(X)	(X##_f[3])
 #define _FP_FRAC_LOW_4(X)	(X##_f[0])
-#define _FP_FRAC_WORD_4(X,w)	(X##_f[w])
-
-#define _FP_FRAC_SLL_4(X,N)						\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _up = (N) % _FP_W_TYPE_SIZE;					\
-    _down = _FP_W_TYPE_SIZE - _up;					\
-    if (!_up)								\
-      for (_i = 3; _i >= _skip; --_i)					\
-	X##_f[_i] = X##_f[_i-_skip];					\
-    else								\
-      {									\
-	for (_i = 3; _i > _skip; --_i)					\
-	  X##_f[_i] = X##_f[_i-_skip] << _up				\
-		      | X##_f[_i-_skip-1] >> _down;			\
-	X##_f[_i--] = X##_f[0] << _up; 					\
-      }									\
-    for (; _i >= 0; --_i)						\
-      X##_f[_i] = 0;							\
-  } while (0)
-
-/* This one was broken too */
-#define _FP_FRAC_SRL_4(X,N)						\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _down = (N) % _FP_W_TYPE_SIZE;					\
-    _up = _FP_W_TYPE_SIZE - _down;					\
-    if (!_down)								\
-      for (_i = 0; _i <= 3-_skip; ++_i)					\
-	X##_f[_i] = X##_f[_i+_skip];					\
-    else								\
-      {									\
-	for (_i = 0; _i < 3-_skip; ++_i)				\
-	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
-		      | X##_f[_i+_skip+1] << _up;			\
-	X##_f[_i++] = X##_f[3] >> _down;				\
-      }									\
-    for (; _i < 4; ++_i)						\
-      X##_f[_i] = 0;							\
-  } while (0)
-
-
-/* Right shift with sticky-lsb. 
- * What this actually means is that we do a standard right-shift,
- * but that if any of the bits that fall off the right hand side
- * were one then we always set the LSbit.
- */
-#define _FP_FRAC_SRS_4(X,N,size)					\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _FP_W_TYPE _s;							\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _down = (N) % _FP_W_TYPE_SIZE;					\
-    _up = _FP_W_TYPE_SIZE - _down;					\
-    for (_s = _i = 0; _i < _skip; ++_i)					\
-      _s |= X##_f[_i];							\
-    _s |= X##_f[_i] << _up;						\
-/* s is now != 0 if we want to set the LSbit */				\
-    if (!_down)								\
-      for (_i = 0; _i <= 3-_skip; ++_i)					\
-	X##_f[_i] = X##_f[_i+_skip];					\
-    else								\
-      {									\
-	for (_i = 0; _i < 3-_skip; ++_i)				\
-	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
-		      | X##_f[_i+_skip+1] << _up;			\
-	X##_f[_i++] = X##_f[3] >> _down;				\
-      }									\
-    for (; _i < 4; ++_i)						\
-      X##_f[_i] = 0;							\
-    /* don't fix the LSB until the very end when we're sure f[0] is stable */	\
-    X##_f[0] |= (_s != 0);						\
-  } while (0)
-
-#define _FP_FRAC_ADD_4(R,X,Y)						\
-  __FP_FRAC_ADD_4(R##_f[3], R##_f[2], R##_f[1], R##_f[0],		\
-		  X##_f[3], X##_f[2], X##_f[1], X##_f[0],		\
-		  Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
-
-#define _FP_FRAC_SUB_4(R,X,Y)						\
-  __FP_FRAC_SUB_4(R##_f[3], R##_f[2], R##_f[1], R##_f[0],		\
-		  X##_f[3], X##_f[2], X##_f[1], X##_f[0],		\
-		  Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
-
-#define _FP_FRAC_DEC_4(X,Y)						\
-  __FP_FRAC_DEC_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0],		\
-		  Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
-
-#define _FP_FRAC_ADDI_4(X,I)						\
-  __FP_FRAC_ADDI_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0], I)
-
-#define _FP_ZEROFRAC_4  0,0,0,0
-#define _FP_MINFRAC_4   0,0,0,1
-#define _FP_MAXFRAC_4	(~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0)
+#define _FP_FRAC_WORD_4(X, w)	(X##_f[w])
+
+#define _FP_FRAC_SLL_4(X, N)						\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SLL_4_up, _FP_FRAC_SLL_4_down;		\
+      _FP_I_TYPE _FP_FRAC_SLL_4_skip, _FP_FRAC_SLL_4_i;			\
+      _FP_FRAC_SLL_4_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SLL_4_up = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SLL_4_down = _FP_W_TYPE_SIZE - _FP_FRAC_SLL_4_up;	\
+      if (!_FP_FRAC_SLL_4_up)						\
+	for (_FP_FRAC_SLL_4_i = 3;					\
+	     _FP_FRAC_SLL_4_i >= _FP_FRAC_SLL_4_skip;			\
+	     --_FP_FRAC_SLL_4_i)					\
+	  X##_f[_FP_FRAC_SLL_4_i]					\
+	    = X##_f[_FP_FRAC_SLL_4_i-_FP_FRAC_SLL_4_skip];		\
+      else								\
+	{								\
+	  for (_FP_FRAC_SLL_4_i = 3;					\
+	       _FP_FRAC_SLL_4_i > _FP_FRAC_SLL_4_skip;			\
+	       --_FP_FRAC_SLL_4_i)					\
+	    X##_f[_FP_FRAC_SLL_4_i]					\
+	      = ((X##_f[_FP_FRAC_SLL_4_i-_FP_FRAC_SLL_4_skip]		\
+		  << _FP_FRAC_SLL_4_up)					\
+		 | (X##_f[_FP_FRAC_SLL_4_i-_FP_FRAC_SLL_4_skip-1]	\
+		    >> _FP_FRAC_SLL_4_down));				\
+	  X##_f[_FP_FRAC_SLL_4_i--] = X##_f[0] << _FP_FRAC_SLL_4_up;	\
+	}								\
+      for (; _FP_FRAC_SLL_4_i >= 0; --_FP_FRAC_SLL_4_i)			\
+	X##_f[_FP_FRAC_SLL_4_i] = 0;					\
+    }									\
+  while (0)
+
+/* This one was broken too.  */
+#define _FP_FRAC_SRL_4(X, N)						\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SRL_4_up, _FP_FRAC_SRL_4_down;		\
+      _FP_I_TYPE _FP_FRAC_SRL_4_skip, _FP_FRAC_SRL_4_i;			\
+      _FP_FRAC_SRL_4_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRL_4_down = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRL_4_up = _FP_W_TYPE_SIZE - _FP_FRAC_SRL_4_down;	\
+      if (!_FP_FRAC_SRL_4_down)						\
+	for (_FP_FRAC_SRL_4_i = 0;					\
+	     _FP_FRAC_SRL_4_i <= 3-_FP_FRAC_SRL_4_skip;			\
+	     ++_FP_FRAC_SRL_4_i)					\
+	  X##_f[_FP_FRAC_SRL_4_i]					\
+	    = X##_f[_FP_FRAC_SRL_4_i+_FP_FRAC_SRL_4_skip];		\
+      else								\
+	{								\
+	  for (_FP_FRAC_SRL_4_i = 0;					\
+	       _FP_FRAC_SRL_4_i < 3-_FP_FRAC_SRL_4_skip;		\
+	       ++_FP_FRAC_SRL_4_i)					\
+	    X##_f[_FP_FRAC_SRL_4_i]					\
+	      = ((X##_f[_FP_FRAC_SRL_4_i+_FP_FRAC_SRL_4_skip]		\
+		  >> _FP_FRAC_SRL_4_down)				\
+		 | (X##_f[_FP_FRAC_SRL_4_i+_FP_FRAC_SRL_4_skip+1]	\
+		    << _FP_FRAC_SRL_4_up));				\
+	  X##_f[_FP_FRAC_SRL_4_i++] = X##_f[3] >> _FP_FRAC_SRL_4_down;	\
+	}								\
+      for (; _FP_FRAC_SRL_4_i < 4; ++_FP_FRAC_SRL_4_i)			\
+	X##_f[_FP_FRAC_SRL_4_i] = 0;					\
+    }									\
+  while (0)
+
+
+/* Right shift with sticky-lsb.
+   What this actually means is that we do a standard right-shift,
+   but that if any of the bits that fall off the right hand side
+   were one then we always set the LSbit.  */
+#define _FP_FRAC_SRST_4(X, S, N, size)					\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SRST_4_up, _FP_FRAC_SRST_4_down;		\
+      _FP_I_TYPE _FP_FRAC_SRST_4_skip, _FP_FRAC_SRST_4_i;		\
+      _FP_W_TYPE _FP_FRAC_SRST_4_s;					\
+      _FP_FRAC_SRST_4_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRST_4_down = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRST_4_up = _FP_W_TYPE_SIZE - _FP_FRAC_SRST_4_down;	\
+      for (_FP_FRAC_SRST_4_s = _FP_FRAC_SRST_4_i = 0;			\
+	   _FP_FRAC_SRST_4_i < _FP_FRAC_SRST_4_skip;			\
+	   ++_FP_FRAC_SRST_4_i)						\
+	_FP_FRAC_SRST_4_s |= X##_f[_FP_FRAC_SRST_4_i];			\
+      if (!_FP_FRAC_SRST_4_down)					\
+	for (_FP_FRAC_SRST_4_i = 0;					\
+	     _FP_FRAC_SRST_4_i <= 3-_FP_FRAC_SRST_4_skip;		\
+	     ++_FP_FRAC_SRST_4_i)					\
+	  X##_f[_FP_FRAC_SRST_4_i]					\
+	    = X##_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip];		\
+      else								\
+	{								\
+	  _FP_FRAC_SRST_4_s						\
+	    |= X##_f[_FP_FRAC_SRST_4_i] << _FP_FRAC_SRST_4_up;		\
+	  for (_FP_FRAC_SRST_4_i = 0;					\
+	       _FP_FRAC_SRST_4_i < 3-_FP_FRAC_SRST_4_skip;		\
+	       ++_FP_FRAC_SRST_4_i)					\
+	    X##_f[_FP_FRAC_SRST_4_i]					\
+	      = ((X##_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip]		\
+		  >> _FP_FRAC_SRST_4_down)				\
+		 | (X##_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip+1]	\
+		    << _FP_FRAC_SRST_4_up));				\
+	  X##_f[_FP_FRAC_SRST_4_i++]					\
+	    = X##_f[3] >> _FP_FRAC_SRST_4_down;				\
+	}								\
+      for (; _FP_FRAC_SRST_4_i < 4; ++_FP_FRAC_SRST_4_i)		\
+	X##_f[_FP_FRAC_SRST_4_i] = 0;					\
+      S = (_FP_FRAC_SRST_4_s != 0);					\
+    }									\
+  while (0)
+
+#define _FP_FRAC_SRS_4(X, N, size)				\
+  do								\
+    {								\
+      int _FP_FRAC_SRS_4_sticky;				\
+      _FP_FRAC_SRST_4 (X, _FP_FRAC_SRS_4_sticky, (N), (size));	\
+      X##_f[0] |= _FP_FRAC_SRS_4_sticky;			\
+    }								\
+  while (0)
+
+#define _FP_FRAC_ADD_4(R, X, Y)					\
+  __FP_FRAC_ADD_4 (R##_f[3], R##_f[2], R##_f[1], R##_f[0],	\
+		   X##_f[3], X##_f[2], X##_f[1], X##_f[0],	\
+		   Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
+
+#define _FP_FRAC_SUB_4(R, X, Y)					\
+  __FP_FRAC_SUB_4 (R##_f[3], R##_f[2], R##_f[1], R##_f[0],	\
+		   X##_f[3], X##_f[2], X##_f[1], X##_f[0],	\
+		   Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
+
+#define _FP_FRAC_DEC_4(X, Y)					\
+  __FP_FRAC_DEC_4 (X##_f[3], X##_f[2], X##_f[1], X##_f[0],	\
+		   Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
+
+#define _FP_FRAC_ADDI_4(X, I)					\
+  __FP_FRAC_ADDI_4 (X##_f[3], X##_f[2], X##_f[1], X##_f[0], I)
+
+#define _FP_ZEROFRAC_4  0, 0, 0, 0
+#define _FP_MINFRAC_4   0, 0, 0, 1
+#define _FP_MAXFRAC_4	(~(_FP_WS_TYPE) 0), (~(_FP_WS_TYPE) 0), (~(_FP_WS_TYPE) 0), (~(_FP_WS_TYPE) 0)
 
 #define _FP_FRAC_ZEROP_4(X)     ((X##_f[0] | X##_f[1] | X##_f[2] | X##_f[3]) == 0)
-#define _FP_FRAC_NEGP_4(X)      ((_FP_WS_TYPE)X##_f[3] < 0)
-#define _FP_FRAC_OVERP_4(fs,X)  (_FP_FRAC_HIGH_##fs(X) & _FP_OVERFLOW_##fs)
-#define _FP_FRAC_CLEAR_OVERP_4(fs,X)  (_FP_FRAC_HIGH_##fs(X) &= ~_FP_OVERFLOW_##fs)
-
-#define _FP_FRAC_EQ_4(X,Y)				\
- (X##_f[0] == Y##_f[0] && X##_f[1] == Y##_f[1]		\
-  && X##_f[2] == Y##_f[2] && X##_f[3] == Y##_f[3])
-
-#define _FP_FRAC_GT_4(X,Y)				\
- (X##_f[3] > Y##_f[3] ||				\
-  (X##_f[3] == Y##_f[3] && (X##_f[2] > Y##_f[2] ||	\
-   (X##_f[2] == Y##_f[2] && (X##_f[1] > Y##_f[1] ||	\
-    (X##_f[1] == Y##_f[1] && X##_f[0] > Y##_f[0])	\
-   ))							\
-  ))							\
- )
-
-#define _FP_FRAC_GE_4(X,Y)				\
- (X##_f[3] > Y##_f[3] ||				\
-  (X##_f[3] == Y##_f[3] && (X##_f[2] > Y##_f[2] ||	\
-   (X##_f[2] == Y##_f[2] && (X##_f[1] > Y##_f[1] ||	\
-    (X##_f[1] == Y##_f[1] && X##_f[0] >= Y##_f[0])	\
-   ))							\
-  ))							\
- )
-
-
-#define _FP_FRAC_CLZ_4(R,X)		\
-  do {					\
-    if (X##_f[3])			\
-    {					\
-	__FP_CLZ(R,X##_f[3]);		\
-    }					\
-    else if (X##_f[2])			\
-    {					\
-	__FP_CLZ(R,X##_f[2]);		\
-	R += _FP_W_TYPE_SIZE;		\
-    }					\
-    else if (X##_f[1])			\
-    {					\
-	__FP_CLZ(R,X##_f[2]);		\
-	R += _FP_W_TYPE_SIZE*2;		\
-    }					\
-    else				\
-    {					\
-	__FP_CLZ(R,X##_f[0]);		\
-	R += _FP_W_TYPE_SIZE*3;		\
-    }					\
-  } while(0)
-
-
-#define _FP_UNPACK_RAW_4(fs, X, val)				\
-  do {								\
-    union _FP_UNION_##fs _flo; _flo.flt = (val);		\
-    X##_f[0] = _flo.bits.frac0;					\
-    X##_f[1] = _flo.bits.frac1;					\
-    X##_f[2] = _flo.bits.frac2;					\
-    X##_f[3] = _flo.bits.frac3;					\
-    X##_e  = _flo.bits.exp;					\
-    X##_s  = _flo.bits.sign;					\
-  } while (0)
-
-#define _FP_UNPACK_RAW_4_P(fs, X, val)				\
-  do {								\
-    union _FP_UNION_##fs *_flo =				\
-      (union _FP_UNION_##fs *)(val);				\
-								\
-    X##_f[0] = _flo->bits.frac0;				\
-    X##_f[1] = _flo->bits.frac1;				\
-    X##_f[2] = _flo->bits.frac2;				\
-    X##_f[3] = _flo->bits.frac3;				\
-    X##_e  = _flo->bits.exp;					\
-    X##_s  = _flo->bits.sign;					\
-  } while (0)
-
-#define _FP_PACK_RAW_4(fs, val, X)				\
-  do {								\
-    union _FP_UNION_##fs _flo;					\
-    _flo.bits.frac0 = X##_f[0];					\
-    _flo.bits.frac1 = X##_f[1];					\
-    _flo.bits.frac2 = X##_f[2];					\
-    _flo.bits.frac3 = X##_f[3];					\
-    _flo.bits.exp   = X##_e;					\
-    _flo.bits.sign  = X##_s;					\
-    (val) = _flo.flt;				   		\
-  } while (0)
-
-#define _FP_PACK_RAW_4_P(fs, val, X)				\
-  do {								\
-    union _FP_UNION_##fs *_flo =				\
-      (union _FP_UNION_##fs *)(val);				\
-								\
-    _flo->bits.frac0 = X##_f[0];				\
-    _flo->bits.frac1 = X##_f[1];				\
-    _flo->bits.frac2 = X##_f[2];				\
-    _flo->bits.frac3 = X##_f[3];				\
-    _flo->bits.exp   = X##_e;					\
-    _flo->bits.sign  = X##_s;					\
-  } while (0)
-
-/*
- * Multiplication algorithms:
- */
+#define _FP_FRAC_NEGP_4(X)      ((_FP_WS_TYPE) X##_f[3] < 0)
+#define _FP_FRAC_OVERP_4(fs, X)  (_FP_FRAC_HIGH_##fs (X) & _FP_OVERFLOW_##fs)
+#define _FP_FRAC_HIGHBIT_DW_4(fs, X)	\
+  (_FP_FRAC_HIGH_DW_##fs (X) & _FP_HIGHBIT_DW_##fs)
+#define _FP_FRAC_CLEAR_OVERP_4(fs, X)  (_FP_FRAC_HIGH_##fs (X) &= ~_FP_OVERFLOW_##fs)
+
+#define _FP_FRAC_EQ_4(X, Y)				\
+  (X##_f[0] == Y##_f[0] && X##_f[1] == Y##_f[1]		\
+   && X##_f[2] == Y##_f[2] && X##_f[3] == Y##_f[3])
+
+#define _FP_FRAC_GT_4(X, Y)				\
+  (X##_f[3] > Y##_f[3]					\
+   || (X##_f[3] == Y##_f[3]				\
+       && (X##_f[2] > Y##_f[2]				\
+	   || (X##_f[2] == Y##_f[2]			\
+	       && (X##_f[1] > Y##_f[1]			\
+		   || (X##_f[1] == Y##_f[1]		\
+		       && X##_f[0] > Y##_f[0]))))))
+
+#define _FP_FRAC_GE_4(X, Y)				\
+  (X##_f[3] > Y##_f[3]					\
+   || (X##_f[3] == Y##_f[3]				\
+       && (X##_f[2] > Y##_f[2]				\
+	   || (X##_f[2] == Y##_f[2]			\
+	       && (X##_f[1] > Y##_f[1]			\
+		   || (X##_f[1] == Y##_f[1]		\
+		       && X##_f[0] >= Y##_f[0]))))))
+
+
+#define _FP_FRAC_CLZ_4(R, X)			\
+  do						\
+    {						\
+      if (X##_f[3])				\
+	__FP_CLZ ((R), X##_f[3]);		\
+      else if (X##_f[2])			\
+	{					\
+	  __FP_CLZ ((R), X##_f[2]);		\
+	  (R) += _FP_W_TYPE_SIZE;		\
+	}					\
+      else if (X##_f[1])			\
+	{					\
+	  __FP_CLZ ((R), X##_f[1]);		\
+	  (R) += _FP_W_TYPE_SIZE*2;		\
+	}					\
+      else					\
+	{					\
+	  __FP_CLZ ((R), X##_f[0]);		\
+	  (R) += _FP_W_TYPE_SIZE*3;		\
+	}					\
+    }						\
+  while (0)
+
+
+#define _FP_UNPACK_RAW_4(fs, X, val)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs _FP_UNPACK_RAW_4_flo;	\
+      _FP_UNPACK_RAW_4_flo.flt = (val);			\
+      X##_f[0] = _FP_UNPACK_RAW_4_flo.bits.frac0;	\
+      X##_f[1] = _FP_UNPACK_RAW_4_flo.bits.frac1;	\
+      X##_f[2] = _FP_UNPACK_RAW_4_flo.bits.frac2;	\
+      X##_f[3] = _FP_UNPACK_RAW_4_flo.bits.frac3;	\
+      X##_e  = _FP_UNPACK_RAW_4_flo.bits.exp;		\
+      X##_s  = _FP_UNPACK_RAW_4_flo.bits.sign;		\
+    }							\
+  while (0)
+
+#define _FP_UNPACK_RAW_4_P(fs, X, val)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_UNPACK_RAW_4_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
+							\
+      X##_f[0] = _FP_UNPACK_RAW_4_P_flo->bits.frac0;	\
+      X##_f[1] = _FP_UNPACK_RAW_4_P_flo->bits.frac1;	\
+      X##_f[2] = _FP_UNPACK_RAW_4_P_flo->bits.frac2;	\
+      X##_f[3] = _FP_UNPACK_RAW_4_P_flo->bits.frac3;	\
+      X##_e  = _FP_UNPACK_RAW_4_P_flo->bits.exp;	\
+      X##_s  = _FP_UNPACK_RAW_4_P_flo->bits.sign;	\
+    }							\
+  while (0)
+
+#define _FP_PACK_RAW_4(fs, val, X)		\
+  do						\
+    {						\
+      union _FP_UNION_##fs _FP_PACK_RAW_4_flo;	\
+      _FP_PACK_RAW_4_flo.bits.frac0 = X##_f[0];	\
+      _FP_PACK_RAW_4_flo.bits.frac1 = X##_f[1];	\
+      _FP_PACK_RAW_4_flo.bits.frac2 = X##_f[2];	\
+      _FP_PACK_RAW_4_flo.bits.frac3 = X##_f[3];	\
+      _FP_PACK_RAW_4_flo.bits.exp   = X##_e;	\
+      _FP_PACK_RAW_4_flo.bits.sign  = X##_s;	\
+      (val) = _FP_PACK_RAW_4_flo.flt;		\
+    }						\
+  while (0)
+
+#define _FP_PACK_RAW_4_P(fs, val, X)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_PACK_RAW_4_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
+							\
+      _FP_PACK_RAW_4_P_flo->bits.frac0 = X##_f[0];	\
+      _FP_PACK_RAW_4_P_flo->bits.frac1 = X##_f[1];	\
+      _FP_PACK_RAW_4_P_flo->bits.frac2 = X##_f[2];	\
+      _FP_PACK_RAW_4_P_flo->bits.frac3 = X##_f[3];	\
+      _FP_PACK_RAW_4_P_flo->bits.exp   = X##_e;		\
+      _FP_PACK_RAW_4_P_flo->bits.sign  = X##_s;		\
+    }							\
+  while (0)
+
+/* Multiplication algorithms: */
 
 /* Given a 1W * 1W => 2W primitive, do the extended multiplication.  */
 
-#define _FP_MUL_MEAT_4_wide(wfracbits, R, X, Y, doit)			    \
-  do {									    \
-    _FP_FRAC_DECL_8(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c);	    \
-    _FP_FRAC_DECL_2(_d); _FP_FRAC_DECL_2(_e); _FP_FRAC_DECL_2(_f);	    \
-									    \
-    doit(_FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0), X##_f[0], Y##_f[0]); \
-    doit(_b_f1, _b_f0, X##_f[0], Y##_f[1]);				    \
-    doit(_c_f1, _c_f0, X##_f[1], Y##_f[0]);				    \
-    doit(_d_f1, _d_f0, X##_f[1], Y##_f[1]);				    \
-    doit(_e_f1, _e_f0, X##_f[0], Y##_f[2]);				    \
-    doit(_f_f1, _f_f0, X##_f[2], Y##_f[0]);				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1), 0,_b_f1,_b_f0,		    \
-		    0,0,_FP_FRAC_WORD_8(_z,1));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1), 0,_c_f1,_c_f0,		    \
-		    _FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2), 0,_d_f1,_d_f0,		    \
-		    0,_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2));	    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2), 0,_e_f1,_e_f0,		    \
-		    _FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2), 0,_f_f1,_f_f0,		    \
-		    _FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2));				    \
-    doit(_b_f1, _b_f0, X##_f[0], Y##_f[3]);				    \
-    doit(_c_f1, _c_f0, X##_f[3], Y##_f[0]);				    \
-    doit(_d_f1, _d_f0, X##_f[1], Y##_f[2]);				    \
-    doit(_e_f1, _e_f0, X##_f[2], Y##_f[1]);				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3), 0,_b_f1,_b_f0,		    \
-		    0,_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3));	    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3), 0,_c_f1,_c_f0,		    \
-		    _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3), 0,_d_f1,_d_f0,		    \
-		    _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3), 0,_e_f1,_e_f0,		    \
-		    _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3));				    \
-    doit(_b_f1, _b_f0, X##_f[2], Y##_f[2]);				    \
-    doit(_c_f1, _c_f0, X##_f[1], Y##_f[3]);				    \
-    doit(_d_f1, _d_f0, X##_f[3], Y##_f[1]);				    \
-    doit(_e_f1, _e_f0, X##_f[2], Y##_f[3]);				    \
-    doit(_f_f1, _f_f0, X##_f[3], Y##_f[2]);				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4), 0,_b_f1,_b_f0,		    \
-		    0,_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4));	    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4), 0,_c_f1,_c_f0,		    \
-		    _FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4), 0,_d_f1,_d_f0,		    \
-		    _FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
-		    _FP_FRAC_WORD_8(_z,5), 0,_e_f1,_e_f0,		    \
-		    0,_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5));	    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
-		    _FP_FRAC_WORD_8(_z,5), 0,_f_f1,_f_f0,		    \
-		    _FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
-		    _FP_FRAC_WORD_8(_z,5));				    \
-    doit(_b_f1, _b_f0, X##_f[3], Y##_f[3]);				    \
-    __FP_FRAC_ADD_2(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
-		    _b_f1,_b_f0,					    \
-		    _FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6));	    \
-									    \
-    /* Normalize since we know where the msb of the multiplicands	    \
-       were (bit B), we know that the msb of the of the product is	    \
-       at either 2B or 2B-1.  */					    \
-    _FP_FRAC_SRS_8(_z, wfracbits-1, 2*wfracbits);			    \
-    __FP_FRAC_SET_4(R, _FP_FRAC_WORD_8(_z,3), _FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0));	    \
-  } while (0)
-
-#define _FP_MUL_MEAT_4_gmp(wfracbits, R, X, Y)				    \
-  do {									    \
-    _FP_FRAC_DECL_8(_z);						    \
-									    \
-    mpn_mul_n(_z_f, _x_f, _y_f, 4);					    \
-									    \
-    /* Normalize since we know where the msb of the multiplicands	    \
-       were (bit B), we know that the msb of the of the product is	    \
-       at either 2B or 2B-1.  */					    \
-    _FP_FRAC_SRS_8(_z, wfracbits-1, 2*wfracbits);	 		    \
-    __FP_FRAC_SET_4(R, _FP_FRAC_WORD_8(_z,3), _FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0));	    \
-  } while (0)
-
-/*
- * Helper utility for _FP_DIV_MEAT_4_udiv:
- * pppp = m * nnn
- */
-#define umul_ppppmnnn(p3,p2,p1,p0,m,n2,n1,n0)				    \
-  do {									    \
-    UWtype _t;								    \
-    umul_ppmm(p1,p0,m,n0);						    \
-    umul_ppmm(p2,_t,m,n1);						    \
-    __FP_FRAC_ADDI_2(p2,p1,_t);						    \
-    umul_ppmm(p3,_t,m,n2);						    \
-    __FP_FRAC_ADDI_2(p3,p2,_t);						    \
-  } while (0)
-
-/*
- * Division algorithms:
- */
-
-#define _FP_DIV_MEAT_4_udiv(fs, R, X, Y)				    \
-  do {									    \
-    int _i;								    \
-    _FP_FRAC_DECL_4(_n); _FP_FRAC_DECL_4(_m);				    \
-    _FP_FRAC_SET_4(_n, _FP_ZEROFRAC_4);					    \
-    if (_FP_FRAC_GT_4(X, Y))						    \
-      {									    \
-	_n_f[3] = X##_f[0] << (_FP_W_TYPE_SIZE - 1);			    \
-	_FP_FRAC_SRL_4(X, 1);						    \
-      }									    \
-    else								    \
-      R##_e--;								    \
-									    \
-    /* Normalize, i.e. make the most significant bit of the 		    \
-       denominator set. */						    \
-    _FP_FRAC_SLL_4(Y, _FP_WFRACXBITS_##fs);				    \
-									    \
-    for (_i = 3; ; _i--)						    \
-      {									    \
-        if (X##_f[3] == Y##_f[3])					    \
-          {								    \
-            /* This is a special case, not an optimization		    \
-               (X##_f[3]/Y##_f[3] would not fit into UWtype).		    \
-               As X## is guaranteed to be < Y,  R##_f[_i] can be either	    \
-               (UWtype)-1 or (UWtype)-2.  */				    \
-            R##_f[_i] = -1;						    \
-            if (!_i)							    \
-	      break;							    \
-            __FP_FRAC_SUB_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0],	    \
-			    Y##_f[2], Y##_f[1], Y##_f[0], 0,		    \
-			    X##_f[2], X##_f[1], X##_f[0], _n_f[_i]);	    \
-            _FP_FRAC_SUB_4(X, Y, X);					    \
-            if (X##_f[3] > Y##_f[3])					    \
-              {								    \
-                R##_f[_i] = -2;						    \
-                _FP_FRAC_ADD_4(X, Y, X);				    \
-              }								    \
-          }								    \
-        else								    \
-          {								    \
-            udiv_qrnnd(R##_f[_i], X##_f[3], X##_f[3], X##_f[2], Y##_f[3]);  \
-            umul_ppppmnnn(_m_f[3], _m_f[2], _m_f[1], _m_f[0],		    \
-			  R##_f[_i], Y##_f[2], Y##_f[1], Y##_f[0]);	    \
-            X##_f[2] = X##_f[1];					    \
-            X##_f[1] = X##_f[0];					    \
-            X##_f[0] = _n_f[_i];					    \
-            if (_FP_FRAC_GT_4(_m, X))					    \
-              {								    \
-                R##_f[_i]--;						    \
-                _FP_FRAC_ADD_4(X, Y, X);				    \
-                if (_FP_FRAC_GE_4(X, Y) && _FP_FRAC_GT_4(_m, X))	    \
-                  {							    \
-		    R##_f[_i]--;					    \
-		    _FP_FRAC_ADD_4(X, Y, X);				    \
-                  }							    \
-              }								    \
-            _FP_FRAC_DEC_4(X, _m);					    \
-            if (!_i)							    \
-	      {								    \
-		if (!_FP_FRAC_EQ_4(X, _m))				    \
-		  R##_f[0] |= _FP_WORK_STICKY;				    \
-		break;							    \
-	      }								    \
-          }								    \
-      }									    \
-  } while (0)
-
-
-/*
- * Square root algorithms:
- * We have just one right now, maybe Newton approximation
- * should be added for those machines where division is fast.
- */
- 
-#define _FP_SQRT_MEAT_4(R, S, T, X, q)				\
-  do {								\
-    while (q)							\
-      {								\
-	T##_f[3] = S##_f[3] + q;				\
-	if (T##_f[3] <= X##_f[3])				\
-	  {							\
-	    S##_f[3] = T##_f[3] + q;				\
-	    X##_f[3] -= T##_f[3];				\
-	    R##_f[3] += q;					\
-	  }							\
-	_FP_FRAC_SLL_4(X, 1);					\
-	q >>= 1;						\
-      }								\
-    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);			\
-    while (q)							\
-      {								\
-	T##_f[2] = S##_f[2] + q;				\
-	T##_f[3] = S##_f[3];					\
-	if (T##_f[3] < X##_f[3] || 				\
-	    (T##_f[3] == X##_f[3] && T##_f[2] <= X##_f[2]))	\
-	  {							\
-	    S##_f[2] = T##_f[2] + q;				\
-	    S##_f[3] += (T##_f[2] > S##_f[2]);			\
-	    __FP_FRAC_DEC_2(X##_f[3], X##_f[2],			\
-			    T##_f[3], T##_f[2]);		\
-	    R##_f[2] += q;					\
-	  }							\
-	_FP_FRAC_SLL_4(X, 1);					\
-	q >>= 1;						\
-      }								\
-    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);			\
-    while (q)							\
-      {								\
-	T##_f[1] = S##_f[1] + q;				\
-	T##_f[2] = S##_f[2];					\
-	T##_f[3] = S##_f[3];					\
-	if (T##_f[3] < X##_f[3] || 				\
-	    (T##_f[3] == X##_f[3] && (T##_f[2] < X##_f[2] ||	\
-	     (T##_f[2] == X##_f[2] && T##_f[1] <= X##_f[1]))))	\
-	  {							\
-	    S##_f[1] = T##_f[1] + q;				\
-	    S##_f[2] += (T##_f[1] > S##_f[1]);			\
-	    S##_f[3] += (T##_f[2] > S##_f[2]);			\
-	    __FP_FRAC_DEC_3(X##_f[3], X##_f[2], X##_f[1],	\
-	    		    T##_f[3], T##_f[2], T##_f[1]);	\
-	    R##_f[1] += q;					\
-	  }							\
-	_FP_FRAC_SLL_4(X, 1);					\
-	q >>= 1;						\
-      }								\
-    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);			\
-    while (q != _FP_WORK_ROUND)					\
-      {								\
-	T##_f[0] = S##_f[0] + q;				\
-	T##_f[1] = S##_f[1];					\
-	T##_f[2] = S##_f[2];					\
-	T##_f[3] = S##_f[3];					\
-	if (_FP_FRAC_GE_4(X,T))					\
-	  {							\
-	    S##_f[0] = T##_f[0] + q;				\
-	    S##_f[1] += (T##_f[0] > S##_f[0]);			\
-	    S##_f[2] += (T##_f[1] > S##_f[1]);			\
-	    S##_f[3] += (T##_f[2] > S##_f[2]);			\
-	    _FP_FRAC_DEC_4(X, T);				\
-	    R##_f[0] += q;					\
-	  }							\
-	_FP_FRAC_SLL_4(X, 1);					\
-	q >>= 1;						\
-      }								\
-    if (!_FP_FRAC_ZEROP_4(X))					\
-      {								\
-	if (_FP_FRAC_GT_4(X,S))					\
-	  R##_f[0] |= _FP_WORK_ROUND;				\
-	R##_f[0] |= _FP_WORK_STICKY;				\
-      }								\
-  } while (0)
-
-
-/*
- * Internals 
- */
-
-#define __FP_FRAC_SET_4(X,I3,I2,I1,I0)					\
+#define _FP_MUL_MEAT_DW_4_wide(wfracbits, R, X, Y, doit)		\
+  do									\
+    {									\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_b);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_c);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_d);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_e);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_f);			\
+									\
+      doit (_FP_FRAC_WORD_8 (R, 1), _FP_FRAC_WORD_8 (R, 0),		\
+	    X##_f[0], Y##_f[0]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_b_f1, _FP_MUL_MEAT_DW_4_wide_b_f0,	\
+	    X##_f[0], Y##_f[1]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_c_f1, _FP_MUL_MEAT_DW_4_wide_c_f0,	\
+	    X##_f[1], Y##_f[0]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_d_f1, _FP_MUL_MEAT_DW_4_wide_d_f0,	\
+	    X##_f[1], Y##_f[1]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_e_f1, _FP_MUL_MEAT_DW_4_wide_e_f0,	\
+	    X##_f[0], Y##_f[2]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_f_f1, _FP_MUL_MEAT_DW_4_wide_f_f0,	\
+	    X##_f[2], Y##_f[0]);					\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 3), _FP_FRAC_WORD_8 (R, 2),	\
+		       _FP_FRAC_WORD_8 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f0,			\
+		       0, 0, _FP_FRAC_WORD_8 (R, 1));			\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 3), _FP_FRAC_WORD_8 (R, 2),	\
+		       _FP_FRAC_WORD_8 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f0,			\
+		       _FP_FRAC_WORD_8 (R, 3), _FP_FRAC_WORD_8 (R, 2),	\
+		       _FP_FRAC_WORD_8 (R, 1));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f0,			\
+		       0, _FP_FRAC_WORD_8 (R, 3), _FP_FRAC_WORD_8 (R, 2)); \
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f0,			\
+		       _FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_f_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_f_f0,			\
+		       _FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2));				\
+      doit (_FP_MUL_MEAT_DW_4_wide_b_f1,				\
+	    _FP_MUL_MEAT_DW_4_wide_b_f0, X##_f[0], Y##_f[3]);		\
+      doit (_FP_MUL_MEAT_DW_4_wide_c_f1,				\
+	    _FP_MUL_MEAT_DW_4_wide_c_f0, X##_f[3], Y##_f[0]);		\
+      doit (_FP_MUL_MEAT_DW_4_wide_d_f1, _FP_MUL_MEAT_DW_4_wide_d_f0,	\
+	    X##_f[1], Y##_f[2]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_e_f1, _FP_MUL_MEAT_DW_4_wide_e_f0,	\
+	    X##_f[2], Y##_f[1]);					\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f0,			\
+		       0, _FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3)); \
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f0,			\
+		       _FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f0,			\
+		       _FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f0,			\
+		       _FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3));				\
+      doit (_FP_MUL_MEAT_DW_4_wide_b_f1, _FP_MUL_MEAT_DW_4_wide_b_f0,	\
+	    X##_f[2], Y##_f[2]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_c_f1, _FP_MUL_MEAT_DW_4_wide_c_f0,	\
+	    X##_f[1], Y##_f[3]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_d_f1, _FP_MUL_MEAT_DW_4_wide_d_f0,	\
+	    X##_f[3], Y##_f[1]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_e_f1, _FP_MUL_MEAT_DW_4_wide_e_f0,	\
+	    X##_f[2], Y##_f[3]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_f_f1, _FP_MUL_MEAT_DW_4_wide_f_f0,	\
+	    X##_f[3], Y##_f[2]);					\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f0,			\
+		       0, _FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4)); \
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f0,			\
+		       _FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f0,			\
+		       _FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6),	\
+		       _FP_FRAC_WORD_8 (R, 5), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f0,			\
+		       0, _FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5)); \
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6),	\
+		       _FP_FRAC_WORD_8 (R, 5), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_f_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_f_f0,			\
+		       _FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6),	\
+		       _FP_FRAC_WORD_8 (R, 5));				\
+      doit (_FP_MUL_MEAT_DW_4_wide_b_f1, _FP_MUL_MEAT_DW_4_wide_b_f0,	\
+	    X##_f[3], Y##_f[3]);					\
+      __FP_FRAC_ADD_2 (_FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6),	\
+		       _FP_MUL_MEAT_DW_4_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f0,			\
+		       _FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6));	\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_4_wide(wfracbits, R, X, Y, doit)			\
+  do									\
+    {									\
+      _FP_FRAC_DECL_8 (_FP_MUL_MEAT_4_wide_z);				\
+									\
+      _FP_MUL_MEAT_DW_4_wide ((wfracbits), _FP_MUL_MEAT_4_wide_z,	\
+			      X, Y, doit);				\
+									\
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_8 (_FP_MUL_MEAT_4_wide_z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      __FP_FRAC_SET_4 (R, _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_wide_z, 3),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_wide_z, 2),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_wide_z, 1),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_wide_z, 0));	\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_DW_4_gmp(wfracbits, R, X, Y)	\
+  do							\
+    {							\
+      mpn_mul_n (R##_f, _x_f, _y_f, 4);			\
+    }							\
+  while (0)
+
+#define _FP_MUL_MEAT_4_gmp(wfracbits, R, X, Y)				\
+  do									\
+    {									\
+      _FP_FRAC_DECL_8 (_FP_MUL_MEAT_4_gmp_z);				\
+									\
+      _FP_MUL_MEAT_DW_4_gmp ((wfracbits), _FP_MUL_MEAT_4_gmp_z, X, Y);	\
+									\
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_8 (_FP_MUL_MEAT_4_gmp_z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      __FP_FRAC_SET_4 (R, _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_gmp_z, 3),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_gmp_z, 2),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_gmp_z, 1),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_gmp_z, 0));	\
+    }									\
+  while (0)
+
+/* Helper utility for _FP_DIV_MEAT_4_udiv:
+ * pppp = m * nnn.  */
+#define umul_ppppmnnn(p3, p2, p1, p0, m, n2, n1, n0)	\
+  do							\
+    {							\
+      UWtype umul_ppppmnnn_t;				\
+      umul_ppmm (p1, p0, m, n0);			\
+      umul_ppmm (p2, umul_ppppmnnn_t, m, n1);		\
+      __FP_FRAC_ADDI_2 (p2, p1, umul_ppppmnnn_t);	\
+      umul_ppmm (p3, umul_ppppmnnn_t, m, n2);		\
+      __FP_FRAC_ADDI_2 (p3, p2, umul_ppppmnnn_t);	\
+    }							\
+  while (0)
+
+/* Division algorithms: */
+
+#define _FP_DIV_MEAT_4_udiv(fs, R, X, Y)				\
+  do									\
+    {									\
+      int _FP_DIV_MEAT_4_udiv_i;					\
+      _FP_FRAC_DECL_4 (_FP_DIV_MEAT_4_udiv_n);				\
+      _FP_FRAC_DECL_4 (_FP_DIV_MEAT_4_udiv_m);				\
+      _FP_FRAC_SET_4 (_FP_DIV_MEAT_4_udiv_n, _FP_ZEROFRAC_4);		\
+      if (_FP_FRAC_GE_4 (X, Y))						\
+	{								\
+	  _FP_DIV_MEAT_4_udiv_n_f[3]					\
+	    = X##_f[0] << (_FP_W_TYPE_SIZE - 1);			\
+	  _FP_FRAC_SRL_4 (X, 1);					\
+	}								\
+      else								\
+	R##_e--;							\
+									\
+      /* Normalize, i.e. make the most significant bit of the		\
+	 denominator set.  */						\
+      _FP_FRAC_SLL_4 (Y, _FP_WFRACXBITS_##fs);				\
+									\
+      for (_FP_DIV_MEAT_4_udiv_i = 3; ; _FP_DIV_MEAT_4_udiv_i--)	\
+	{								\
+	  if (X##_f[3] == Y##_f[3])					\
+	    {								\
+	      /* This is a special case, not an optimization		\
+		 (X##_f[3]/Y##_f[3] would not fit into UWtype).		\
+		 As X## is guaranteed to be < Y,			\
+		 R##_f[_FP_DIV_MEAT_4_udiv_i] can be either		\
+		 (UWtype)-1 or (UWtype)-2.  */				\
+	      R##_f[_FP_DIV_MEAT_4_udiv_i] = -1;			\
+	      if (!_FP_DIV_MEAT_4_udiv_i)				\
+		break;							\
+	      __FP_FRAC_SUB_4 (X##_f[3], X##_f[2], X##_f[1], X##_f[0],	\
+			       Y##_f[2], Y##_f[1], Y##_f[0], 0,		\
+			       X##_f[2], X##_f[1], X##_f[0],		\
+			       _FP_DIV_MEAT_4_udiv_n_f[_FP_DIV_MEAT_4_udiv_i]); \
+	      _FP_FRAC_SUB_4 (X, Y, X);					\
+	      if (X##_f[3] > Y##_f[3])					\
+		{							\
+		  R##_f[_FP_DIV_MEAT_4_udiv_i] = -2;			\
+		  _FP_FRAC_ADD_4 (X, Y, X);				\
+		}							\
+	    }								\
+	  else								\
+	    {								\
+	      udiv_qrnnd (R##_f[_FP_DIV_MEAT_4_udiv_i],			\
+			  X##_f[3], X##_f[3], X##_f[2], Y##_f[3]);	\
+	      umul_ppppmnnn (_FP_DIV_MEAT_4_udiv_m_f[3],		\
+			     _FP_DIV_MEAT_4_udiv_m_f[2],		\
+			     _FP_DIV_MEAT_4_udiv_m_f[1],		\
+			     _FP_DIV_MEAT_4_udiv_m_f[0],		\
+			     R##_f[_FP_DIV_MEAT_4_udiv_i],		\
+			     Y##_f[2], Y##_f[1], Y##_f[0]);		\
+	      X##_f[2] = X##_f[1];					\
+	      X##_f[1] = X##_f[0];					\
+	      X##_f[0]							\
+		= _FP_DIV_MEAT_4_udiv_n_f[_FP_DIV_MEAT_4_udiv_i];	\
+	      if (_FP_FRAC_GT_4 (_FP_DIV_MEAT_4_udiv_m, X))		\
+		{							\
+		  R##_f[_FP_DIV_MEAT_4_udiv_i]--;			\
+		  _FP_FRAC_ADD_4 (X, Y, X);				\
+		  if (_FP_FRAC_GE_4 (X, Y)				\
+		      && _FP_FRAC_GT_4 (_FP_DIV_MEAT_4_udiv_m, X))	\
+		    {							\
+		      R##_f[_FP_DIV_MEAT_4_udiv_i]--;			\
+		      _FP_FRAC_ADD_4 (X, Y, X);				\
+		    }							\
+		}							\
+	      _FP_FRAC_DEC_4 (X, _FP_DIV_MEAT_4_udiv_m);		\
+	      if (!_FP_DIV_MEAT_4_udiv_i)				\
+		{							\
+		  if (!_FP_FRAC_EQ_4 (X, _FP_DIV_MEAT_4_udiv_m))	\
+		    R##_f[0] |= _FP_WORK_STICKY;			\
+		  break;						\
+		}							\
+	    }								\
+	}								\
+    }									\
+  while (0)
+
+
+/* Square root algorithms:
+   We have just one right now, maybe Newton approximation
+   should be added for those machines where division is fast.  */
+
+#define _FP_SQRT_MEAT_4(R, S, T, X, q)					\
+  do									\
+    {									\
+      while (q)								\
+	{								\
+	  T##_f[3] = S##_f[3] + (q);					\
+	  if (T##_f[3] <= X##_f[3])					\
+	    {								\
+	      S##_f[3] = T##_f[3] + (q);				\
+	      X##_f[3] -= T##_f[3];					\
+	      R##_f[3] += (q);						\
+	    }								\
+	  _FP_FRAC_SLL_4 (X, 1);					\
+	  (q) >>= 1;							\
+	}								\
+      (q) = (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE - 1);			\
+      while (q)								\
+	{								\
+	  T##_f[2] = S##_f[2] + (q);					\
+	  T##_f[3] = S##_f[3];						\
+	  if (T##_f[3] < X##_f[3]					\
+	      || (T##_f[3] == X##_f[3] && T##_f[2] <= X##_f[2]))	\
+	    {								\
+	      S##_f[2] = T##_f[2] + (q);				\
+	      S##_f[3] += (T##_f[2] > S##_f[2]);			\
+	      __FP_FRAC_DEC_2 (X##_f[3], X##_f[2],			\
+			       T##_f[3], T##_f[2]);			\
+	      R##_f[2] += (q);						\
+	    }								\
+	  _FP_FRAC_SLL_4 (X, 1);					\
+	  (q) >>= 1;							\
+	}								\
+      (q) = (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE - 1);			\
+      while (q)								\
+	{								\
+	  T##_f[1] = S##_f[1] + (q);					\
+	  T##_f[2] = S##_f[2];						\
+	  T##_f[3] = S##_f[3];						\
+	  if (T##_f[3] < X##_f[3]					\
+	      || (T##_f[3] == X##_f[3]					\
+		  && (T##_f[2] < X##_f[2]				\
+		      || (T##_f[2] == X##_f[2]				\
+			  && T##_f[1] <= X##_f[1]))))			\
+	    {								\
+	      S##_f[1] = T##_f[1] + (q);				\
+	      S##_f[2] += (T##_f[1] > S##_f[1]);			\
+	      S##_f[3] += (T##_f[2] > S##_f[2]);			\
+	      __FP_FRAC_DEC_3 (X##_f[3], X##_f[2], X##_f[1],		\
+			       T##_f[3], T##_f[2], T##_f[1]);		\
+	      R##_f[1] += (q);						\
+	    }								\
+	  _FP_FRAC_SLL_4 (X, 1);					\
+	  (q) >>= 1;							\
+	}								\
+      (q) = (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE - 1);			\
+      while ((q) != _FP_WORK_ROUND)					\
+	{								\
+	  T##_f[0] = S##_f[0] + (q);					\
+	  T##_f[1] = S##_f[1];						\
+	  T##_f[2] = S##_f[2];						\
+	  T##_f[3] = S##_f[3];						\
+	  if (_FP_FRAC_GE_4 (X, T))					\
+	    {								\
+	      S##_f[0] = T##_f[0] + (q);				\
+	      S##_f[1] += (T##_f[0] > S##_f[0]);			\
+	      S##_f[2] += (T##_f[1] > S##_f[1]);			\
+	      S##_f[3] += (T##_f[2] > S##_f[2]);			\
+	      _FP_FRAC_DEC_4 (X, T);					\
+	      R##_f[0] += (q);						\
+	    }								\
+	  _FP_FRAC_SLL_4 (X, 1);					\
+	  (q) >>= 1;							\
+	}								\
+      if (!_FP_FRAC_ZEROP_4 (X))					\
+	{								\
+	  if (_FP_FRAC_GT_4 (X, S))					\
+	    R##_f[0] |= _FP_WORK_ROUND;					\
+	  R##_f[0] |= _FP_WORK_STICKY;					\
+	}								\
+    }									\
+  while (0)
+
+
+/* Internals.  */
+
+#define __FP_FRAC_SET_4(X, I3, I2, I1, I0)			\
   (X##_f[3] = I3, X##_f[2] = I2, X##_f[1] = I1, X##_f[0] = I0)
 
 #ifndef __FP_FRAC_ADD_3
-#define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0)		\
-  do {								\
-    int _c1, _c2;							\
-    r0 = x0 + y0;						\
-    _c1 = r0 < x0;						\
-    r1 = x1 + y1;						\
-    _c2 = r1 < x1;						\
-    r1 += _c1;							\
-    _c2 |= r1 < _c1;						\
-    r2 = x2 + y2 + _c2;						\
-  } while (0)
+# define __FP_FRAC_ADD_3(r2, r1, r0, x2, x1, x0, y2, y1, y0)	\
+  do								\
+    {								\
+      _FP_W_TYPE __FP_FRAC_ADD_3_c1, __FP_FRAC_ADD_3_c2;	\
+      r0 = x0 + y0;						\
+      __FP_FRAC_ADD_3_c1 = r0 < x0;				\
+      r1 = x1 + y1;						\
+      __FP_FRAC_ADD_3_c2 = r1 < x1;				\
+      r1 += __FP_FRAC_ADD_3_c1;					\
+      __FP_FRAC_ADD_3_c2 |= r1 < __FP_FRAC_ADD_3_c1;		\
+      r2 = x2 + y2 + __FP_FRAC_ADD_3_c2;			\
+    }								\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_ADD_4
-#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)	\
-  do {								\
-    int _c1, _c2, _c3;						\
-    r0 = x0 + y0;						\
-    _c1 = r0 < x0;						\
-    r1 = x1 + y1;						\
-    _c2 = r1 < x1;						\
-    r1 += _c1;							\
-    _c2 |= r1 < _c1;						\
-    r2 = x2 + y2;						\
-    _c3 = r2 < x2;						\
-    r2 += _c2;							\
-    _c3 |= r2 < _c2;						\
-    r3 = x3 + y3 + _c3;						\
-  } while (0)
+# define __FP_FRAC_ADD_4(r3, r2, r1, r0, x3, x2, x1, x0, y3, y2, y1, y0) \
+  do									\
+    {									\
+      _FP_W_TYPE __FP_FRAC_ADD_4_c1, __FP_FRAC_ADD_4_c2;		\
+      _FP_W_TYPE __FP_FRAC_ADD_4_c3;					\
+      r0 = x0 + y0;							\
+      __FP_FRAC_ADD_4_c1 = r0 < x0;					\
+      r1 = x1 + y1;							\
+      __FP_FRAC_ADD_4_c2 = r1 < x1;					\
+      r1 += __FP_FRAC_ADD_4_c1;						\
+      __FP_FRAC_ADD_4_c2 |= r1 < __FP_FRAC_ADD_4_c1;			\
+      r2 = x2 + y2;							\
+      __FP_FRAC_ADD_4_c3 = r2 < x2;					\
+      r2 += __FP_FRAC_ADD_4_c2;						\
+      __FP_FRAC_ADD_4_c3 |= r2 < __FP_FRAC_ADD_4_c2;			\
+      r3 = x3 + y3 + __FP_FRAC_ADD_4_c3;				\
+    }									\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_SUB_3
-#define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0)		\
-  do {								\
-    int _c1, _c2;							\
-    r0 = x0 - y0;						\
-    _c1 = r0 > x0;						\
-    r1 = x1 - y1;						\
-    _c2 = r1 > x1;						\
-    r1 -= _c1;							\
-    _c2 |= r1 > _c1;						\
-    r2 = x2 - y2 - _c2;						\
-  } while (0)
+# define __FP_FRAC_SUB_3(r2, r1, r0, x2, x1, x0, y2, y1, y0)	\
+  do								\
+    {								\
+      _FP_W_TYPE __FP_FRAC_SUB_3_c1, __FP_FRAC_SUB_3_c2;	\
+      r0 = x0 - y0;						\
+      __FP_FRAC_SUB_3_c1 = r0 > x0;				\
+      r1 = x1 - y1;						\
+      __FP_FRAC_SUB_3_c2 = r1 > x1;				\
+      r1 -= __FP_FRAC_SUB_3_c1;					\
+      __FP_FRAC_SUB_3_c2 |= __FP_FRAC_SUB_3_c1 && (y1 == x1);	\
+      r2 = x2 - y2 - __FP_FRAC_SUB_3_c2;			\
+    }								\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_SUB_4
-#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)	\
-  do {								\
-    int _c1, _c2, _c3;						\
-    r0 = x0 - y0;						\
-    _c1 = r0 > x0;						\
-    r1 = x1 - y1;						\
-    _c2 = r1 > x1;						\
-    r1 -= _c1;							\
-    _c2 |= r1 > _c1;						\
-    r2 = x2 - y2;						\
-    _c3 = r2 > x2;						\
-    r2 -= _c2;							\
-    _c3 |= r2 > _c2;						\
-    r3 = x3 - y3 - _c3;						\
-  } while (0)
+# define __FP_FRAC_SUB_4(r3, r2, r1, r0, x3, x2, x1, x0, y3, y2, y1, y0) \
+  do									\
+    {									\
+      _FP_W_TYPE __FP_FRAC_SUB_4_c1, __FP_FRAC_SUB_4_c2;		\
+      _FP_W_TYPE __FP_FRAC_SUB_4_c3;					\
+      r0 = x0 - y0;							\
+      __FP_FRAC_SUB_4_c1 = r0 > x0;					\
+      r1 = x1 - y1;							\
+      __FP_FRAC_SUB_4_c2 = r1 > x1;					\
+      r1 -= __FP_FRAC_SUB_4_c1;						\
+      __FP_FRAC_SUB_4_c2 |= __FP_FRAC_SUB_4_c1 && (y1 == x1);		\
+      r2 = x2 - y2;							\
+      __FP_FRAC_SUB_4_c3 = r2 > x2;					\
+      r2 -= __FP_FRAC_SUB_4_c2;						\
+      __FP_FRAC_SUB_4_c3 |= __FP_FRAC_SUB_4_c2 && (y2 == x2);		\
+      r3 = x3 - y3 - __FP_FRAC_SUB_4_c3;				\
+    }									\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_DEC_3
-#define __FP_FRAC_DEC_3(x2,x1,x0,y2,y1,y0)				\
-  do {									\
-    UWtype _t0, _t1, _t2;						\
-    _t0 = x0, _t1 = x1, _t2 = x2;					\
-    __FP_FRAC_SUB_3 (x2, x1, x0, _t2, _t1, _t0, y2, y1, y0);		\
-  } while (0)
+# define __FP_FRAC_DEC_3(x2, x1, x0, y2, y1, y0)		\
+  do								\
+    {								\
+      UWtype __FP_FRAC_DEC_3_t0, __FP_FRAC_DEC_3_t1;		\
+      UWtype __FP_FRAC_DEC_3_t2;				\
+      __FP_FRAC_DEC_3_t0 = x0;					\
+      __FP_FRAC_DEC_3_t1 = x1;					\
+      __FP_FRAC_DEC_3_t2 = x2;					\
+      __FP_FRAC_SUB_3 (x2, x1, x0, __FP_FRAC_DEC_3_t2,		\
+		       __FP_FRAC_DEC_3_t1, __FP_FRAC_DEC_3_t0,	\
+		       y2, y1, y0);				\
+    }								\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_DEC_4
-#define __FP_FRAC_DEC_4(x3,x2,x1,x0,y3,y2,y1,y0)			\
-  do {									\
-    UWtype _t0, _t1, _t2, _t3;						\
-    _t0 = x0, _t1 = x1, _t2 = x2, _t3 = x3;				\
-    __FP_FRAC_SUB_4 (x3,x2,x1,x0,_t3,_t2,_t1,_t0, y3,y2,y1,y0);		\
-  } while (0)
+# define __FP_FRAC_DEC_4(x3, x2, x1, x0, y3, y2, y1, y0)	\
+  do								\
+    {								\
+      UWtype __FP_FRAC_DEC_4_t0, __FP_FRAC_DEC_4_t1;		\
+      UWtype __FP_FRAC_DEC_4_t2, __FP_FRAC_DEC_4_t3;		\
+      __FP_FRAC_DEC_4_t0 = x0;					\
+      __FP_FRAC_DEC_4_t1 = x1;					\
+      __FP_FRAC_DEC_4_t2 = x2;					\
+      __FP_FRAC_DEC_4_t3 = x3;					\
+      __FP_FRAC_SUB_4 (x3, x2, x1, x0, __FP_FRAC_DEC_4_t3,	\
+		       __FP_FRAC_DEC_4_t2, __FP_FRAC_DEC_4_t1,	\
+		       __FP_FRAC_DEC_4_t0, y3, y2, y1, y0);	\
+    }								\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_ADDI_4
-#define __FP_FRAC_ADDI_4(x3,x2,x1,x0,i)					\
-  do {									\
-    UWtype _t;								\
-    _t = ((x0 += i) < i);						\
-    x1 += _t; _t = (x1 < _t);						\
-    x2 += _t; _t = (x2 < _t);						\
-    x3 += _t;								\
-  } while (0)
+# define __FP_FRAC_ADDI_4(x3, x2, x1, x0, i)		\
+  do							\
+    {							\
+      UWtype __FP_FRAC_ADDI_4_t;			\
+      __FP_FRAC_ADDI_4_t = ((x0 += i) < i);		\
+      x1 += __FP_FRAC_ADDI_4_t;				\
+      __FP_FRAC_ADDI_4_t = (x1 < __FP_FRAC_ADDI_4_t);	\
+      x2 += __FP_FRAC_ADDI_4_t;				\
+      __FP_FRAC_ADDI_4_t = (x2 < __FP_FRAC_ADDI_4_t);	\
+      x3 += __FP_FRAC_ADDI_4_t;				\
+    }							\
+  while (0)
 #endif
 
 /* Convert FP values between word sizes. This appears to be more
- * complicated than I'd have expected it to be, so these might be
- * wrong... These macros are in any case somewhat bogus because they
- * use information about what various FRAC_n variables look like 
- * internally [eg, that 2 word vars are X_f0 and x_f1]. But so do
- * the ones in op-2.h and op-1.h. 
- */
-#define _FP_FRAC_CONV_1_4(dfs, sfs, D, S)				\
-   do {									\
-     if (S##_c != FP_CLS_NAN)						\
-       _FP_FRAC_SRS_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs),	\
-			  _FP_WFRACBITS_##sfs);				\
-     else								\
-       _FP_FRAC_SRL_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs));	\
-     D##_f = S##_f[0];							\
-  } while (0)
-
-#define _FP_FRAC_CONV_2_4(dfs, sfs, D, S)				\
-   do {									\
-     if (S##_c != FP_CLS_NAN)						\
-       _FP_FRAC_SRS_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs),	\
-		      _FP_WFRACBITS_##sfs);				\
-     else								\
-       _FP_FRAC_SRL_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs));	\
-     D##_f0 = S##_f[0];							\
-     D##_f1 = S##_f[1];							\
-  } while (0)
-
-/* Assembly/disassembly for converting to/from integral types.  
- * No shifting or overflow handled here.
- */
-/* Put the FP value X into r, which is an integer of size rsize. */
+   complicated than I'd have expected it to be, so these might be
+   wrong... These macros are in any case somewhat bogus because they
+   use information about what various FRAC_n variables look like
+   internally [eg, that 2 word vars are X_f0 and x_f1]. But so do
+   the ones in op-2.h and op-1.h.  */
+#define _FP_FRAC_COPY_1_4(D, S)		(D##_f = S##_f[0])
+
+#define _FP_FRAC_COPY_2_4(D, S)			\
+  do						\
+    {						\
+      D##_f0 = S##_f[0];			\
+      D##_f1 = S##_f[1];			\
+    }						\
+  while (0)
+
+/* Assembly/disassembly for converting to/from integral types.
+   No shifting or overflow handled here.  */
+/* Put the FP value X into r, which is an integer of size rsize.  */
 #define _FP_FRAC_ASSEMBLE_4(r, X, rsize)				\
-  do {									\
-    if (rsize <= _FP_W_TYPE_SIZE)					\
-      r = X##_f[0];							\
-    else if (rsize <= 2*_FP_W_TYPE_SIZE)				\
-    {									\
-      r = X##_f[1];							\
-      r <<= _FP_W_TYPE_SIZE;						\
-      r += X##_f[0];							\
-    }									\
-    else								\
+  do									\
     {									\
-      /* I'm feeling lazy so we deal with int == 3words (implausible)*/	\
-      /* and int == 4words as a single case.			 */	\
-      r = X##_f[3];							\
-      r <<= _FP_W_TYPE_SIZE;						\
-      r += X##_f[2];							\
-      r <<= _FP_W_TYPE_SIZE;						\
-      r += X##_f[1];							\
-      r <<= _FP_W_TYPE_SIZE;						\
-      r += X##_f[0];							\
+      if ((rsize) <= _FP_W_TYPE_SIZE)					\
+	(r) = X##_f[0];							\
+	else if ((rsize) <= 2*_FP_W_TYPE_SIZE)				\
+	{								\
+	  (r) = X##_f[1];						\
+	  (r) = ((rsize) <= _FP_W_TYPE_SIZE				\
+		 ? 0							\
+		 : (r) << _FP_W_TYPE_SIZE);				\
+	  (r) += X##_f[0];						\
+	}								\
+      else								\
+	{								\
+	  /* I'm feeling lazy so we deal with int == 3words		\
+	     (implausible) and int == 4words as a single case.  */	\
+	  (r) = X##_f[3];						\
+	  (r) = ((rsize) <= _FP_W_TYPE_SIZE				\
+		 ? 0							\
+		 : (r) << _FP_W_TYPE_SIZE);				\
+	  (r) += X##_f[2];						\
+	  (r) = ((rsize) <= _FP_W_TYPE_SIZE				\
+		 ? 0							\
+		 : (r) << _FP_W_TYPE_SIZE);				\
+	  (r) += X##_f[1];						\
+	  (r) = ((rsize) <= _FP_W_TYPE_SIZE				\
+		 ? 0							\
+		 : (r) << _FP_W_TYPE_SIZE);				\
+	  (r) += X##_f[0];						\
+	}								\
     }									\
-  } while (0)
+  while (0)
 
 /* "No disassemble Number Five!" */
-/* move an integer of size rsize into X's fractional part. We rely on
- * the _f[] array consisting of words of size _FP_W_TYPE_SIZE to avoid
- * having to mask the values we store into it.
- */
-#define _FP_FRAC_DISASSEMBLE_4(X, r, rsize)				\
-  do {									\
-    X##_f[0] = r;							\
-    X##_f[1] = (rsize <= _FP_W_TYPE_SIZE ? 0 : r >> _FP_W_TYPE_SIZE);	\
-    X##_f[2] = (rsize <= 2*_FP_W_TYPE_SIZE ? 0 : r >> 2*_FP_W_TYPE_SIZE); \
-    X##_f[3] = (rsize <= 3*_FP_W_TYPE_SIZE ? 0 : r >> 3*_FP_W_TYPE_SIZE); \
-  } while (0)
-
-#define _FP_FRAC_CONV_4_1(dfs, sfs, D, S)				\
-   do {									\
-     D##_f[0] = S##_f;							\
-     D##_f[1] = D##_f[2] = D##_f[3] = 0;				\
-     _FP_FRAC_SLL_4(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs));	\
-   } while (0)
-
-#define _FP_FRAC_CONV_4_2(dfs, sfs, D, S)				\
-   do {									\
-     D##_f[0] = S##_f0;							\
-     D##_f[1] = S##_f1;							\
-     D##_f[2] = D##_f[3] = 0;						\
-     _FP_FRAC_SLL_4(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs));	\
-   } while (0)
+/* Move an integer of size rsize into X's fractional part. We rely on
+   the _f[] array consisting of words of size _FP_W_TYPE_SIZE to avoid
+   having to mask the values we store into it.  */
+#define _FP_FRAC_DISASSEMBLE_4(X, r, rsize)	\
+  do						\
+    {						\
+      X##_f[0] = (r);				\
+      X##_f[1] = ((rsize) <= _FP_W_TYPE_SIZE	\
+		  ? 0				\
+		  : (r) >> _FP_W_TYPE_SIZE);	\
+      X##_f[2] = ((rsize) <= 2*_FP_W_TYPE_SIZE	\
+		  ? 0				\
+		  : (r) >> 2*_FP_W_TYPE_SIZE);	\
+      X##_f[3] = ((rsize) <= 3*_FP_W_TYPE_SIZE	\
+		  ? 0				\
+		  : (r) >> 3*_FP_W_TYPE_SIZE);	\
+    }						\
+  while (0)
+
+#define _FP_FRAC_COPY_4_1(D, S)			\
+  do						\
+    {						\
+      D##_f[0] = S##_f;				\
+      D##_f[1] = D##_f[2] = D##_f[3] = 0;	\
+    }						\
+  while (0)
+
+#define _FP_FRAC_COPY_4_2(D, S)			\
+  do						\
+    {						\
+      D##_f[0] = S##_f0;			\
+      D##_f[1] = S##_f1;			\
+      D##_f[2] = D##_f[3] = 0;			\
+    }						\
+  while (0)
+
+#define _FP_FRAC_COPY_4_4(D, S)	_FP_FRAC_COPY_4 (D, S)
 
 #endif
diff --git a/include/math-emu/op-8.h b/include/math-emu/op-8.h
index 8b8c05e..7705c68 100644
--- a/include/math-emu/op-8.h
+++ b/include/math-emu/op-8.h
@@ -1,107 +1,150 @@
 /* Software floating-point emulation.
    Basic eight-word fraction declaration and manipulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz) and
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
-                                                         
+
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_OP_8_H__
 #define __MATH_EMU_OP_8_H__
 
 /* We need just a few things from here for op-4, if we ever need some
-   other macros, they can be added. */
+   other macros, they can be added.  */
 #define _FP_FRAC_DECL_8(X)	_FP_W_TYPE X##_f[8]
 #define _FP_FRAC_HIGH_8(X)	(X##_f[7])
 #define _FP_FRAC_LOW_8(X)	(X##_f[0])
-#define _FP_FRAC_WORD_8(X,w)	(X##_f[w])
+#define _FP_FRAC_WORD_8(X, w)	(X##_f[w])
 
-#define _FP_FRAC_SLL_8(X,N)						\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _up = (N) % _FP_W_TYPE_SIZE;					\
-    _down = _FP_W_TYPE_SIZE - _up;					\
-    if (!_up)								\
-      for (_i = 7; _i >= _skip; --_i)					\
-	X##_f[_i] = X##_f[_i-_skip];					\
-    else								\
-      {									\
-	for (_i = 7; _i > _skip; --_i)					\
-	  X##_f[_i] = X##_f[_i-_skip] << _up				\
-		      | X##_f[_i-_skip-1] >> _down;			\
-	X##_f[_i--] = X##_f[0] << _up; 					\
-      }									\
-    for (; _i >= 0; --_i)						\
-      X##_f[_i] = 0;							\
-  } while (0)
+#define _FP_FRAC_SLL_8(X, N)						\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SLL_8_up, _FP_FRAC_SLL_8_down;		\
+      _FP_I_TYPE _FP_FRAC_SLL_8_skip, _FP_FRAC_SLL_8_i;			\
+      _FP_FRAC_SLL_8_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SLL_8_up = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SLL_8_down = _FP_W_TYPE_SIZE - _FP_FRAC_SLL_8_up;	\
+      if (!_FP_FRAC_SLL_8_up)						\
+	for (_FP_FRAC_SLL_8_i = 7;					\
+	     _FP_FRAC_SLL_8_i >= _FP_FRAC_SLL_8_skip;			\
+	     --_FP_FRAC_SLL_8_i)					\
+	  X##_f[_FP_FRAC_SLL_8_i]					\
+	    = X##_f[_FP_FRAC_SLL_8_i-_FP_FRAC_SLL_8_skip];		\
+      else								\
+	{								\
+	  for (_FP_FRAC_SLL_8_i = 7;					\
+	       _FP_FRAC_SLL_8_i > _FP_FRAC_SLL_8_skip;			\
+	       --_FP_FRAC_SLL_8_i)					\
+	    X##_f[_FP_FRAC_SLL_8_i]					\
+	      = ((X##_f[_FP_FRAC_SLL_8_i-_FP_FRAC_SLL_8_skip]		\
+		  << _FP_FRAC_SLL_8_up)					\
+		 | (X##_f[_FP_FRAC_SLL_8_i-_FP_FRAC_SLL_8_skip-1]	\
+		    >> _FP_FRAC_SLL_8_down));				\
+	  X##_f[_FP_FRAC_SLL_8_i--] = X##_f[0] << _FP_FRAC_SLL_8_up;	\
+	}								\
+      for (; _FP_FRAC_SLL_8_i >= 0; --_FP_FRAC_SLL_8_i)			\
+	X##_f[_FP_FRAC_SLL_8_i] = 0;					\
+    }									\
+  while (0)
 
-#define _FP_FRAC_SRL_8(X,N)						\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _down = (N) % _FP_W_TYPE_SIZE;					\
-    _up = _FP_W_TYPE_SIZE - _down;					\
-    if (!_down)								\
-      for (_i = 0; _i <= 7-_skip; ++_i)					\
-	X##_f[_i] = X##_f[_i+_skip];					\
-    else								\
-      {									\
-	for (_i = 0; _i < 7-_skip; ++_i)				\
-	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
-		      | X##_f[_i+_skip+1] << _up;			\
-	X##_f[_i++] = X##_f[7] >> _down;				\
-      }									\
-    for (; _i < 8; ++_i)						\
-      X##_f[_i] = 0;							\
-  } while (0)
+#define _FP_FRAC_SRL_8(X, N)						\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SRL_8_up, _FP_FRAC_SRL_8_down;		\
+      _FP_I_TYPE _FP_FRAC_SRL_8_skip, _FP_FRAC_SRL_8_i;			\
+      _FP_FRAC_SRL_8_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRL_8_down = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRL_8_up = _FP_W_TYPE_SIZE - _FP_FRAC_SRL_8_down;	\
+      if (!_FP_FRAC_SRL_8_down)						\
+	for (_FP_FRAC_SRL_8_i = 0;					\
+	     _FP_FRAC_SRL_8_i <= 7-_FP_FRAC_SRL_8_skip;			\
+	     ++_FP_FRAC_SRL_8_i)					\
+	  X##_f[_FP_FRAC_SRL_8_i]					\
+	    = X##_f[_FP_FRAC_SRL_8_i+_FP_FRAC_SRL_8_skip];		\
+      else								\
+	{								\
+	  for (_FP_FRAC_SRL_8_i = 0;					\
+	       _FP_FRAC_SRL_8_i < 7-_FP_FRAC_SRL_8_skip;		\
+	       ++_FP_FRAC_SRL_8_i)					\
+	    X##_f[_FP_FRAC_SRL_8_i]					\
+	      = ((X##_f[_FP_FRAC_SRL_8_i+_FP_FRAC_SRL_8_skip]		\
+		  >> _FP_FRAC_SRL_8_down)				\
+		 | (X##_f[_FP_FRAC_SRL_8_i+_FP_FRAC_SRL_8_skip+1]	\
+		    << _FP_FRAC_SRL_8_up));				\
+	  X##_f[_FP_FRAC_SRL_8_i++] = X##_f[7] >> _FP_FRAC_SRL_8_down;	\
+	}								\
+      for (; _FP_FRAC_SRL_8_i < 8; ++_FP_FRAC_SRL_8_i)			\
+	X##_f[_FP_FRAC_SRL_8_i] = 0;					\
+    }									\
+  while (0)
 
 
-/* Right shift with sticky-lsb. 
- * What this actually means is that we do a standard right-shift,
- * but that if any of the bits that fall off the right hand side
- * were one then we always set the LSbit.
- */
-#define _FP_FRAC_SRS_8(X,N,size)					\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _FP_W_TYPE _s;							\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _down = (N) % _FP_W_TYPE_SIZE;					\
-    _up = _FP_W_TYPE_SIZE - _down;					\
-    for (_s = _i = 0; _i < _skip; ++_i)					\
-      _s |= X##_f[_i];							\
-    _s |= X##_f[_i] << _up;						\
-/* s is now != 0 if we want to set the LSbit */				\
-    if (!_down)								\
-      for (_i = 0; _i <= 7-_skip; ++_i)					\
-	X##_f[_i] = X##_f[_i+_skip];					\
-    else								\
-      {									\
-	for (_i = 0; _i < 7-_skip; ++_i)				\
-	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
-		      | X##_f[_i+_skip+1] << _up;			\
-	X##_f[_i++] = X##_f[7] >> _down;				\
-      }									\
-    for (; _i < 8; ++_i)						\
-      X##_f[_i] = 0;							\
-    /* don't fix the LSB until the very end when we're sure f[0] is stable */	\
-    X##_f[0] |= (_s != 0);						\
-  } while (0)
+/* Right shift with sticky-lsb.
+   What this actually means is that we do a standard right-shift,
+   but that if any of the bits that fall off the right hand side
+   were one then we always set the LSbit.  */
+#define _FP_FRAC_SRS_8(X, N, size)					\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SRS_8_up, _FP_FRAC_SRS_8_down;		\
+      _FP_I_TYPE _FP_FRAC_SRS_8_skip, _FP_FRAC_SRS_8_i;			\
+      _FP_W_TYPE _FP_FRAC_SRS_8_s;					\
+      _FP_FRAC_SRS_8_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRS_8_down = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRS_8_up = _FP_W_TYPE_SIZE - _FP_FRAC_SRS_8_down;	\
+      for (_FP_FRAC_SRS_8_s = _FP_FRAC_SRS_8_i = 0;			\
+	   _FP_FRAC_SRS_8_i < _FP_FRAC_SRS_8_skip;			\
+	   ++_FP_FRAC_SRS_8_i)						\
+	_FP_FRAC_SRS_8_s |= X##_f[_FP_FRAC_SRS_8_i];			\
+      if (!_FP_FRAC_SRS_8_down)						\
+	for (_FP_FRAC_SRS_8_i = 0;					\
+	     _FP_FRAC_SRS_8_i <= 7-_FP_FRAC_SRS_8_skip;			\
+	     ++_FP_FRAC_SRS_8_i)					\
+	  X##_f[_FP_FRAC_SRS_8_i]					\
+	    = X##_f[_FP_FRAC_SRS_8_i+_FP_FRAC_SRS_8_skip];		\
+      else								\
+	{								\
+	  _FP_FRAC_SRS_8_s						\
+	    |= X##_f[_FP_FRAC_SRS_8_i] << _FP_FRAC_SRS_8_up;		\
+	  for (_FP_FRAC_SRS_8_i = 0;					\
+	       _FP_FRAC_SRS_8_i < 7-_FP_FRAC_SRS_8_skip;		\
+	       ++_FP_FRAC_SRS_8_i)					\
+	    X##_f[_FP_FRAC_SRS_8_i]					\
+	      = ((X##_f[_FP_FRAC_SRS_8_i+_FP_FRAC_SRS_8_skip]		\
+		  >> _FP_FRAC_SRS_8_down)				\
+		 | (X##_f[_FP_FRAC_SRS_8_i+_FP_FRAC_SRS_8_skip+1]	\
+		    << _FP_FRAC_SRS_8_up));				\
+	  X##_f[_FP_FRAC_SRS_8_i++] = X##_f[7] >> _FP_FRAC_SRS_8_down;	\
+	}								\
+      for (; _FP_FRAC_SRS_8_i < 8; ++_FP_FRAC_SRS_8_i)			\
+	X##_f[_FP_FRAC_SRS_8_i] = 0;					\
+      /* Don't fix the LSB until the very end when we're sure f[0] is	\
+	 stable.  */							\
+      X##_f[0] |= (_FP_FRAC_SRS_8_s != 0);				\
+    }									\
+  while (0)
 
 #endif
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index 6bdf8c6..b9f5e1a 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -1,5 +1,5 @@
 /* Software floating-point emulation. Common operations.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -7,870 +7,2110 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_OP_COMMON_H__
 #define __MATH_EMU_OP_COMMON_H__
 
-#define _FP_DECL(wc, X)			\
-  _FP_I_TYPE X##_c=0, X##_s=0, X##_e=0;	\
-  _FP_FRAC_DECL_##wc(X)
-
-/*
- * Finish truly unpacking a native fp value by classifying the kind
- * of fp value and normalizing both the exponent and the fraction.
- */
-
-#define _FP_UNPACK_CANONICAL(fs, wc, X)					\
-do {									\
-  switch (X##_e)							\
-  {									\
-  default:								\
-    _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_IMPLBIT_##fs;			\
-    _FP_FRAC_SLL_##wc(X, _FP_WORKBITS);					\
-    X##_e -= _FP_EXPBIAS_##fs;						\
-    X##_c = FP_CLS_NORMAL;						\
-    break;								\
-									\
-  case 0:								\
-    if (_FP_FRAC_ZEROP_##wc(X))						\
-      X##_c = FP_CLS_ZERO;						\
-    else								\
-      {									\
-	/* a denormalized number */					\
-	_FP_I_TYPE _shift;						\
-	_FP_FRAC_CLZ_##wc(_shift, X);					\
-	_shift -= _FP_FRACXBITS_##fs;					\
-	_FP_FRAC_SLL_##wc(X, (_shift+_FP_WORKBITS));			\
-	X##_e -= _FP_EXPBIAS_##fs - 1 + _shift;				\
-	X##_c = FP_CLS_NORMAL;						\
-	FP_SET_EXCEPTION(FP_EX_DENORM);					\
-	if (FP_DENORM_ZERO)						\
-	  {								\
-	    FP_SET_EXCEPTION(FP_EX_INEXACT);				\
-	    X##_c = FP_CLS_ZERO;					\
-	  }								\
-      }									\
-    break;								\
-									\
-  case _FP_EXPMAX_##fs:							\
-    if (_FP_FRAC_ZEROP_##wc(X))						\
-      X##_c = FP_CLS_INF;						\
-    else								\
-      {									\
-	X##_c = FP_CLS_NAN;						\
-	/* Check for signaling NaN */					\
-	if (!(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs))		\
-	  FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_SNAN);		\
-      }									\
-    break;								\
-  }									\
-} while (0)
-
-/*
- * Before packing the bits back into the native fp result, take care
- * of such mundane things as rounding and overflow.  Also, for some
- * kinds of fp values, the original parts may not have been fully
- * extracted -- but that is ok, we can regenerate them now.
- */
-
-#define _FP_PACK_CANONICAL(fs, wc, X)				\
-do {								\
-  switch (X##_c)						\
-  {								\
-  case FP_CLS_NORMAL:						\
-    X##_e += _FP_EXPBIAS_##fs;					\
-    if (X##_e > 0)						\
-      {								\
-	_FP_ROUND(wc, X);					\
-	if (_FP_FRAC_OVERP_##wc(fs, X))				\
-	  {							\
-	    _FP_FRAC_CLEAR_OVERP_##wc(fs, X);			\
-	    X##_e++;						\
-	  }							\
-	_FP_FRAC_SRL_##wc(X, _FP_WORKBITS);			\
-	if (X##_e >= _FP_EXPMAX_##fs)				\
-	  {							\
-	    /* overflow */					\
-	    switch (FP_ROUNDMODE)				\
-	      {							\
-	      case FP_RND_NEAREST:				\
-		X##_c = FP_CLS_INF;				\
-		break;						\
-	      case FP_RND_PINF:					\
-		if (!X##_s) X##_c = FP_CLS_INF;			\
-		break;						\
-	      case FP_RND_MINF:					\
-		if (X##_s) X##_c = FP_CLS_INF;			\
-		break;						\
-	      }							\
-	    if (X##_c == FP_CLS_INF)				\
-	      {							\
-		/* Overflow to infinity */			\
-		X##_e = _FP_EXPMAX_##fs;			\
-		_FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);	\
-	      }							\
-	    else						\
-	      {							\
-		/* Overflow to maximum normal */		\
-		X##_e = _FP_EXPMAX_##fs - 1;			\
-		_FP_FRAC_SET_##wc(X, _FP_MAXFRAC_##wc);		\
-	      }							\
-	    FP_SET_EXCEPTION(FP_EX_OVERFLOW);			\
-            FP_SET_EXCEPTION(FP_EX_INEXACT);			\
-	  }							\
-      }								\
-    else							\
-      {								\
-	/* we've got a denormalized number */			\
-	X##_e = -X##_e + 1;					\
-	if (X##_e <= _FP_WFRACBITS_##fs)			\
-	  {							\
-	    _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs);	\
-	    if (_FP_FRAC_HIGH_##fs(X)				\
-		& (_FP_OVERFLOW_##fs >> 1))			\
-	      {							\
-	        X##_e = 1;					\
-	        _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);	\
-	      }							\
-	    else						\
-	      {							\
-		_FP_ROUND(wc, X);				\
-		if (_FP_FRAC_HIGH_##fs(X)			\
-		   & (_FP_OVERFLOW_##fs >> 1))			\
-		  {						\
-		    X##_e = 1;					\
-		    _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);	\
-		    FP_SET_EXCEPTION(FP_EX_INEXACT);		\
-		  }						\
-		else						\
-		  {						\
-		    X##_e = 0;					\
-		    _FP_FRAC_SRL_##wc(X, _FP_WORKBITS);		\
-		  }						\
-	      }							\
-	    if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) ||		\
-		(FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW))	\
-		FP_SET_EXCEPTION(FP_EX_UNDERFLOW);		\
-	  }							\
-	else							\
-	  {							\
-	    /* underflow to zero */				\
-	    X##_e = 0;						\
-	    if (!_FP_FRAC_ZEROP_##wc(X))			\
-	      {							\
-	        _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc);		\
-	        _FP_ROUND(wc, X);				\
-	        _FP_FRAC_LOW_##wc(X) >>= (_FP_WORKBITS);	\
-	      }							\
-	    FP_SET_EXCEPTION(FP_EX_UNDERFLOW);			\
-	  }							\
-      }								\
-    break;							\
-								\
-  case FP_CLS_ZERO:						\
-    X##_e = 0;							\
-    _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);			\
-    break;							\
+#define _FP_DECL(wc, X)					\
+  _FP_I_TYPE X##_c __attribute__ ((unused)) = 0;	\
+  _FP_I_TYPE X##_s __attribute__ ((unused)) = 0;	\
+  _FP_I_TYPE X##_e __attribute__ ((unused)) = 0;	\
+  _FP_FRAC_DECL_##wc (X)
+
+/* Test whether the qNaN bit denotes a signaling NaN.  */
+#define _FP_FRAC_SNANP(fs, X)				\
+  ((_FP_QNANNEGATEDP)					\
+   ? (_FP_FRAC_HIGH_RAW_##fs (X) & _FP_QNANBIT_##fs)	\
+   : !(_FP_FRAC_HIGH_RAW_##fs (X) & _FP_QNANBIT_##fs))
+#define _FP_FRAC_SNANP_SEMIRAW(fs, X)			\
+  ((_FP_QNANNEGATEDP)					\
+   ? (_FP_FRAC_HIGH_##fs (X) & _FP_QNANBIT_SH_##fs)	\
+   : !(_FP_FRAC_HIGH_##fs (X) & _FP_QNANBIT_SH_##fs))
+
+/* Finish truly unpacking a native fp value by classifying the kind
+   of fp value and normalizing both the exponent and the fraction.  */
+
+#define _FP_UNPACK_CANONICAL(fs, wc, X)				\
+  do								\
+    {								\
+      switch (X##_e)						\
+	{							\
+	default:						\
+	  _FP_FRAC_HIGH_RAW_##fs (X) |= _FP_IMPLBIT_##fs;	\
+	  _FP_FRAC_SLL_##wc (X, _FP_WORKBITS);			\
+	  X##_e -= _FP_EXPBIAS_##fs;				\
+	  X##_c = FP_CLS_NORMAL;				\
+	  break;						\
 								\
-  case FP_CLS_INF:						\
-    X##_e = _FP_EXPMAX_##fs;					\
-    _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);			\
-    break;							\
+	case 0:							\
+	  if (_FP_FRAC_ZEROP_##wc (X))				\
+	    X##_c = FP_CLS_ZERO;				\
+	  else if (FP_DENORM_ZERO)				\
+	    {							\
+	      X##_c = FP_CLS_ZERO;				\
+	      _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);		\
+	      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+	    }							\
+	  else							\
+	    {							\
+	      /* A denormalized number.  */			\
+	      _FP_I_TYPE _FP_UNPACK_CANONICAL_shift;		\
+	      _FP_FRAC_CLZ_##wc (_FP_UNPACK_CANONICAL_shift,	\
+				 X);				\
+	      _FP_UNPACK_CANONICAL_shift -= _FP_FRACXBITS_##fs;	\
+	      _FP_FRAC_SLL_##wc (X, (_FP_UNPACK_CANONICAL_shift \
+				     + _FP_WORKBITS));		\
+	      X##_e -= (_FP_EXPBIAS_##fs - 1			\
+			+ _FP_UNPACK_CANONICAL_shift);		\
+	      X##_c = FP_CLS_NORMAL;				\
+	      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+	    }							\
+	  break;						\
 								\
-  case FP_CLS_NAN:						\
-    X##_e = _FP_EXPMAX_##fs;					\
-    if (!_FP_KEEPNANFRACP)					\
-      {								\
-	_FP_FRAC_SET_##wc(X, _FP_NANFRAC_##fs);			\
-	X##_s = _FP_NANSIGN_##fs;				\
-      }								\
-    else							\
-      _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_QNANBIT_##fs;		\
-    break;							\
-  }								\
-} while (0)
+	case _FP_EXPMAX_##fs:					\
+	  if (_FP_FRAC_ZEROP_##wc (X))				\
+	    X##_c = FP_CLS_INF;					\
+	  else							\
+	    {							\
+	      X##_c = FP_CLS_NAN;				\
+	      /* Check for signaling NaN.  */			\
+	      if (_FP_FRAC_SNANP (fs, X))			\
+		FP_SET_EXCEPTION (FP_EX_INVALID			\
+				  | FP_EX_INVALID_SNAN);	\
+	    }							\
+	  break;						\
+	}							\
+    }								\
+  while (0)
+
+/* Finish unpacking an fp value in semi-raw mode: the mantissa is
+   shifted by _FP_WORKBITS but the implicit MSB is not inserted and
+   other classification is not done.  */
+#define _FP_UNPACK_SEMIRAW(fs, wc, X)	_FP_FRAC_SLL_##wc (X, _FP_WORKBITS)
+
+/* Check whether a raw or semi-raw input value should be flushed to
+   zero, and flush it to zero if so.  */
+#define _FP_CHECK_FLUSH_ZERO(fs, wc, X)			\
+  do							\
+    {							\
+      if (FP_DENORM_ZERO				\
+	  && X##_e == 0					\
+	  && !_FP_FRAC_ZEROP_##wc (X))			\
+	{						\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);	\
+	  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+	}						\
+    }							\
+  while (0)
+
+/* A semi-raw value has overflowed to infinity.  Adjust the mantissa
+   and exponent appropriately.  */
+#define _FP_OVERFLOW_SEMIRAW(fs, wc, X)			\
+  do							\
+    {							\
+      if (FP_ROUNDMODE == FP_RND_NEAREST		\
+	  || (FP_ROUNDMODE == FP_RND_PINF && !X##_s)	\
+	  || (FP_ROUNDMODE == FP_RND_MINF && X##_s))	\
+	{						\
+	  X##_e = _FP_EXPMAX_##fs;			\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);	\
+	}						\
+      else						\
+	{						\
+	  X##_e = _FP_EXPMAX_##fs - 1;			\
+	  _FP_FRAC_SET_##wc (X, _FP_MAXFRAC_##wc);	\
+	}						\
+      FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+      FP_SET_EXCEPTION (FP_EX_OVERFLOW);		\
+    }							\
+  while (0)
+
+/* Check for a semi-raw value being a signaling NaN and raise the
+   invalid exception if so.  */
+#define _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X)			\
+  do								\
+    {								\
+      if (X##_e == _FP_EXPMAX_##fs				\
+	  && !_FP_FRAC_ZEROP_##wc (X)				\
+	  && _FP_FRAC_SNANP_SEMIRAW (fs, X))			\
+	FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_SNAN);	\
+    }								\
+  while (0)
+
+/* Choose a NaN result from an operation on two semi-raw NaN
+   values.  */
+#define _FP_CHOOSENAN_SEMIRAW(fs, wc, R, X, Y, OP)			\
+  do									\
+    {									\
+      /* _FP_CHOOSENAN expects raw values, so shift as required.  */	\
+      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);				\
+      _FP_FRAC_SRL_##wc (Y, _FP_WORKBITS);				\
+      _FP_CHOOSENAN (fs, wc, R, X, Y, OP);				\
+      _FP_FRAC_SLL_##wc (R, _FP_WORKBITS);				\
+    }									\
+  while (0)
+
+/* Make the fractional part a quiet NaN, preserving the payload
+   if possible, otherwise make it the canonical quiet NaN and set
+   the sign bit accordingly.  */
+#define _FP_SETQNAN(fs, wc, X)					\
+  do								\
+    {								\
+      if (_FP_QNANNEGATEDP)					\
+	{							\
+	  _FP_FRAC_HIGH_RAW_##fs (X) &= _FP_QNANBIT_##fs - 1;	\
+	  if (_FP_FRAC_ZEROP_##wc (X))				\
+	    {							\
+	      X##_s = _FP_NANSIGN_##fs;				\
+	      _FP_FRAC_SET_##wc (X, _FP_NANFRAC_##fs);		\
+	    }							\
+	}							\
+      else							\
+	_FP_FRAC_HIGH_RAW_##fs (X) |= _FP_QNANBIT_##fs;		\
+    }								\
+  while (0)
+#define _FP_SETQNAN_SEMIRAW(fs, wc, X)				\
+  do								\
+    {								\
+      if (_FP_QNANNEGATEDP)					\
+	{							\
+	  _FP_FRAC_HIGH_##fs (X) &= _FP_QNANBIT_SH_##fs - 1;	\
+	  if (_FP_FRAC_ZEROP_##wc (X))				\
+	    {							\
+	      X##_s = _FP_NANSIGN_##fs;				\
+	      _FP_FRAC_SET_##wc (X, _FP_NANFRAC_##fs);		\
+	      _FP_FRAC_SLL_##wc (X, _FP_WORKBITS);		\
+	    }							\
+	}							\
+      else							\
+	_FP_FRAC_HIGH_##fs (X) |= _FP_QNANBIT_SH_##fs;		\
+    }								\
+  while (0)
+
+/* Test whether a biased exponent is normal (not zero or maximum).  */
+#define _FP_EXP_NORMAL(fs, wc, X)	(((X##_e + 1) & _FP_EXPMAX_##fs) > 1)
+
+/* Prepare to pack an fp value in semi-raw mode: the mantissa is
+   rounded and shifted right, with the rounding possibly increasing
+   the exponent (including changing a finite value to infinity).  */
+#define _FP_PACK_SEMIRAW(fs, wc, X)				\
+  do								\
+    {								\
+      int _FP_PACK_SEMIRAW_is_tiny				\
+	= X##_e == 0 && !_FP_FRAC_ZEROP_##wc (X);		\
+      if (_FP_TININESS_AFTER_ROUNDING				\
+	  && _FP_PACK_SEMIRAW_is_tiny)				\
+	{							\
+	  FP_DECL_##fs (_FP_PACK_SEMIRAW_T);			\
+	  _FP_FRAC_COPY_##wc (_FP_PACK_SEMIRAW_T, X);		\
+	  _FP_PACK_SEMIRAW_T##_s = X##_s;			\
+	  _FP_PACK_SEMIRAW_T##_e = X##_e;			\
+	  _FP_FRAC_SLL_##wc (_FP_PACK_SEMIRAW_T, 1);		\
+	  _FP_ROUND (wc, _FP_PACK_SEMIRAW_T);			\
+	  if (_FP_FRAC_OVERP_##wc (fs, _FP_PACK_SEMIRAW_T))	\
+	    _FP_PACK_SEMIRAW_is_tiny = 0;			\
+	}							\
+      _FP_ROUND (wc, X);					\
+      if (_FP_PACK_SEMIRAW_is_tiny)				\
+	{							\
+	  if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT)		\
+	      || (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW))	\
+	    FP_SET_EXCEPTION (FP_EX_UNDERFLOW);			\
+	}							\
+      if (_FP_FRAC_HIGH_##fs (X)				\
+	  & (_FP_OVERFLOW_##fs >> 1))				\
+	{							\
+	  _FP_FRAC_HIGH_##fs (X) &= ~(_FP_OVERFLOW_##fs >> 1);	\
+	  X##_e++;						\
+	  if (X##_e == _FP_EXPMAX_##fs)				\
+	    _FP_OVERFLOW_SEMIRAW (fs, wc, X);			\
+	}							\
+      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);			\
+      if (X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (X))	\
+	{							\
+	  if (!_FP_KEEPNANFRACP)				\
+	    {							\
+	      _FP_FRAC_SET_##wc (X, _FP_NANFRAC_##fs);		\
+	      X##_s = _FP_NANSIGN_##fs;				\
+	    }							\
+	  else							\
+	    _FP_SETQNAN (fs, wc, X);				\
+	}							\
+    }								\
+  while (0)
+
+/* Before packing the bits back into the native fp result, take care
+   of such mundane things as rounding and overflow.  Also, for some
+   kinds of fp values, the original parts may not have been fully
+   extracted -- but that is ok, we can regenerate them now.  */
+
+#define _FP_PACK_CANONICAL(fs, wc, X)					\
+  do									\
+    {									\
+      switch (X##_c)							\
+	{								\
+	case FP_CLS_NORMAL:						\
+	  X##_e += _FP_EXPBIAS_##fs;					\
+	  if (X##_e > 0)						\
+	    {								\
+	      _FP_ROUND (wc, X);					\
+	      if (_FP_FRAC_OVERP_##wc (fs, X))				\
+		{							\
+		  _FP_FRAC_CLEAR_OVERP_##wc (fs, X);			\
+		  X##_e++;						\
+		}							\
+	      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);			\
+	      if (X##_e >= _FP_EXPMAX_##fs)				\
+		{							\
+		  /* Overflow.  */					\
+		  switch (FP_ROUNDMODE)					\
+		    {							\
+		    case FP_RND_NEAREST:				\
+		      X##_c = FP_CLS_INF;				\
+		      break;						\
+		    case FP_RND_PINF:					\
+		      if (!X##_s)					\
+			X##_c = FP_CLS_INF;				\
+		      break;						\
+		    case FP_RND_MINF:					\
+		      if (X##_s)					\
+			X##_c = FP_CLS_INF;				\
+		      break;						\
+		    }							\
+		  if (X##_c == FP_CLS_INF)				\
+		    {							\
+		      /* Overflow to infinity.  */			\
+		      X##_e = _FP_EXPMAX_##fs;				\
+		      _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);		\
+		    }							\
+		  else							\
+		    {							\
+		      /* Overflow to maximum normal.  */		\
+		      X##_e = _FP_EXPMAX_##fs - 1;			\
+		      _FP_FRAC_SET_##wc (X, _FP_MAXFRAC_##wc);		\
+		    }							\
+		  FP_SET_EXCEPTION (FP_EX_OVERFLOW);			\
+		  FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+		}							\
+	    }								\
+	  else								\
+	    {								\
+	      /* We've got a denormalized number.  */			\
+	      int _FP_PACK_CANONICAL_is_tiny = 1;			\
+	      if (_FP_TININESS_AFTER_ROUNDING && X##_e == 0)		\
+		{							\
+		  FP_DECL_##fs (_FP_PACK_CANONICAL_T);			\
+		  _FP_FRAC_COPY_##wc (_FP_PACK_CANONICAL_T, X);		\
+		  _FP_PACK_CANONICAL_T##_s = X##_s;			\
+		  _FP_PACK_CANONICAL_T##_e = X##_e;			\
+		  _FP_ROUND (wc, _FP_PACK_CANONICAL_T);			\
+		  if (_FP_FRAC_OVERP_##wc (fs, _FP_PACK_CANONICAL_T))	\
+		    _FP_PACK_CANONICAL_is_tiny = 0;			\
+		}							\
+	      X##_e = -X##_e + 1;					\
+	      if (X##_e <= _FP_WFRACBITS_##fs)				\
+		{							\
+		  _FP_FRAC_SRS_##wc (X, X##_e, _FP_WFRACBITS_##fs);	\
+		  _FP_ROUND (wc, X);					\
+		  if (_FP_FRAC_HIGH_##fs (X)				\
+		      & (_FP_OVERFLOW_##fs >> 1))			\
+		    {							\
+		      X##_e = 1;					\
+		      _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);		\
+		      FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+		    }							\
+		  else							\
+		    {							\
+		      X##_e = 0;					\
+		      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);		\
+		    }							\
+		  if (_FP_PACK_CANONICAL_is_tiny			\
+		      && ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT)		\
+			  || (FP_TRAPPING_EXCEPTIONS			\
+			      & FP_EX_UNDERFLOW)))			\
+		    FP_SET_EXCEPTION (FP_EX_UNDERFLOW);			\
+		}							\
+	      else							\
+		{							\
+		  /* Underflow to zero.  */				\
+		  X##_e = 0;						\
+		  if (!_FP_FRAC_ZEROP_##wc (X))				\
+		    {							\
+		      _FP_FRAC_SET_##wc (X, _FP_MINFRAC_##wc);		\
+		      _FP_ROUND (wc, X);				\
+		      _FP_FRAC_LOW_##wc (X) >>= (_FP_WORKBITS);		\
+		    }							\
+		  FP_SET_EXCEPTION (FP_EX_UNDERFLOW);			\
+		}							\
+	    }								\
+	  break;							\
+									\
+	case FP_CLS_ZERO:						\
+	  X##_e = 0;							\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);			\
+	  break;							\
+									\
+	case FP_CLS_INF:						\
+	  X##_e = _FP_EXPMAX_##fs;					\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);			\
+	  break;							\
+									\
+	case FP_CLS_NAN:						\
+	  X##_e = _FP_EXPMAX_##fs;					\
+	  if (!_FP_KEEPNANFRACP)					\
+	    {								\
+	      _FP_FRAC_SET_##wc (X, _FP_NANFRAC_##fs);			\
+	      X##_s = _FP_NANSIGN_##fs;					\
+	    }								\
+	  else								\
+	    _FP_SETQNAN (fs, wc, X);					\
+	  break;							\
+	}								\
+    }									\
+  while (0)
 
 /* This one accepts raw argument and not cooked,  returns
- * 1 if X is a signaling NaN.
- */
-#define _FP_ISSIGNAN(fs, wc, X)					\
-({								\
-  int __ret = 0;						\
-  if (X##_e == _FP_EXPMAX_##fs)					\
+   1 if X is a signaling NaN.  */
+#define _FP_ISSIGNAN(fs, wc, X)			\
+  ({						\
+    int _FP_ISSIGNAN_ret = 0;			\
+    if (X##_e == _FP_EXPMAX_##fs)		\
+      {						\
+	if (!_FP_FRAC_ZEROP_##wc (X)		\
+	    && _FP_FRAC_SNANP (fs, X))		\
+	  _FP_ISSIGNAN_ret = 1;			\
+      }						\
+    _FP_ISSIGNAN_ret;				\
+  })
+
+
+
+
+
+/* Addition on semi-raw values.  */
+#define _FP_ADD_INTERNAL(fs, wc, R, X, Y, OP)				\
+  do									\
+    {									\
+      _FP_CHECK_FLUSH_ZERO (fs, wc, X);					\
+      _FP_CHECK_FLUSH_ZERO (fs, wc, Y);					\
+      if (X##_s == Y##_s)						\
+	{								\
+	  /* Addition.  */						\
+	  __label__ add1, add2, add3, add_done;				\
+	  R##_s = X##_s;						\
+	  int _FP_ADD_INTERNAL_ediff = X##_e - Y##_e;			\
+	  if (_FP_ADD_INTERNAL_ediff > 0)				\
+	    {								\
+	      R##_e = X##_e;						\
+	      if (Y##_e == 0)						\
+		{							\
+		  /* Y is zero or denormalized.  */			\
+		  if (_FP_FRAC_ZEROP_##wc (Y))				\
+		    {							\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+		      _FP_FRAC_COPY_##wc (R, X);			\
+		      goto add_done;					\
+		    }							\
+		  else							\
+		    {							\
+		      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		      _FP_ADD_INTERNAL_ediff--;				\
+		      if (_FP_ADD_INTERNAL_ediff == 0)			\
+			{						\
+			  _FP_FRAC_ADD_##wc (R, X, Y);			\
+			  goto add3;					\
+			}						\
+		      if (X##_e == _FP_EXPMAX_##fs)			\
+			{						\
+			  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+			  _FP_FRAC_COPY_##wc (R, X);			\
+			  goto add_done;				\
+			}						\
+		      goto add1;					\
+		    }							\
+		}							\
+	      else if (X##_e == _FP_EXPMAX_##fs)			\
+		{							\
+		  /* X is NaN or Inf, Y is normal.  */			\
+		  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);			\
+		  _FP_FRAC_COPY_##wc (R, X);				\
+		  goto add_done;					\
+		}							\
+									\
+	      /* Insert implicit MSB of Y.  */				\
+	      _FP_FRAC_HIGH_##fs (Y) |= _FP_IMPLBIT_SH_##fs;		\
+									\
+	    add1:							\
+	      /* Shift the mantissa of Y to the right			\
+		 _FP_ADD_INTERNAL_EDIFF steps; remember to account	\
+		 later for the implicit MSB of X.  */			\
+	      if (_FP_ADD_INTERNAL_ediff <= _FP_WFRACBITS_##fs)		\
+		_FP_FRAC_SRS_##wc (Y, _FP_ADD_INTERNAL_ediff,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (!_FP_FRAC_ZEROP_##wc (Y))			\
+		_FP_FRAC_SET_##wc (Y, _FP_MINFRAC_##wc);		\
+	      _FP_FRAC_ADD_##wc (R, X, Y);				\
+	    }								\
+	  else if (_FP_ADD_INTERNAL_ediff < 0)				\
+	    {								\
+	      _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff;		\
+	      R##_e = Y##_e;						\
+	      if (X##_e == 0)						\
+		{							\
+		  /* X is zero or denormalized.  */			\
+		  if (_FP_FRAC_ZEROP_##wc (X))				\
+		    {							\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+		      _FP_FRAC_COPY_##wc (R, Y);			\
+		      goto add_done;					\
+		    }							\
+		  else							\
+		    {							\
+		      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		      _FP_ADD_INTERNAL_ediff--;				\
+		      if (_FP_ADD_INTERNAL_ediff == 0)			\
+			{						\
+			  _FP_FRAC_ADD_##wc (R, Y, X);			\
+			  goto add3;					\
+			}						\
+		      if (Y##_e == _FP_EXPMAX_##fs)			\
+			{						\
+			  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+			  _FP_FRAC_COPY_##wc (R, Y);			\
+			  goto add_done;				\
+			}						\
+		      goto add2;					\
+		    }							\
+		}							\
+	      else if (Y##_e == _FP_EXPMAX_##fs)			\
+		{							\
+		  /* Y is NaN or Inf, X is normal.  */			\
+		  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);			\
+		  _FP_FRAC_COPY_##wc (R, Y);				\
+		  goto add_done;					\
+		}							\
+									\
+	      /* Insert implicit MSB of X.  */				\
+	      _FP_FRAC_HIGH_##fs (X) |= _FP_IMPLBIT_SH_##fs;		\
+									\
+	    add2:							\
+	      /* Shift the mantissa of X to the right			\
+		 _FP_ADD_INTERNAL_EDIFF steps; remember to account	\
+		 later for the implicit MSB of Y.  */			\
+	      if (_FP_ADD_INTERNAL_ediff <= _FP_WFRACBITS_##fs)		\
+		_FP_FRAC_SRS_##wc (X, _FP_ADD_INTERNAL_ediff,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (!_FP_FRAC_ZEROP_##wc (X))			\
+		_FP_FRAC_SET_##wc (X, _FP_MINFRAC_##wc);		\
+	      _FP_FRAC_ADD_##wc (R, Y, X);				\
+	    }								\
+	  else								\
+	    {								\
+	      /* _FP_ADD_INTERNAL_ediff == 0.  */			\
+	      if (!_FP_EXP_NORMAL (fs, wc, X))				\
+		{							\
+		  if (X##_e == 0)					\
+		    {							\
+		      /* X and Y are zero or denormalized.  */		\
+		      R##_e = 0;					\
+		      if (_FP_FRAC_ZEROP_##wc (X))			\
+			{						\
+			  if (!_FP_FRAC_ZEROP_##wc (Y))			\
+			    FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_COPY_##wc (R, Y);			\
+			  goto add_done;				\
+			}						\
+		      else if (_FP_FRAC_ZEROP_##wc (Y))			\
+			{						\
+			  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_COPY_##wc (R, X);			\
+			  goto add_done;				\
+			}						\
+		      else						\
+			{						\
+			  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_ADD_##wc (R, X, Y);			\
+			  if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs) \
+			    {						\
+			      /* Normalized result.  */			\
+			      _FP_FRAC_HIGH_##fs (R)			\
+				&= ~(_FP_W_TYPE) _FP_IMPLBIT_SH_##fs;	\
+			      R##_e = 1;				\
+			    }						\
+			  goto add_done;				\
+			}						\
+		    }							\
+		  else							\
+		    {							\
+		      /* X and Y are NaN or Inf.  */			\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+		      R##_e = _FP_EXPMAX_##fs;				\
+		      if (_FP_FRAC_ZEROP_##wc (X))			\
+			_FP_FRAC_COPY_##wc (R, Y);			\
+		      else if (_FP_FRAC_ZEROP_##wc (Y))			\
+			_FP_FRAC_COPY_##wc (R, X);			\
+		      else						\
+			_FP_CHOOSENAN_SEMIRAW (fs, wc, R, X, Y, OP);	\
+		      goto add_done;					\
+		    }							\
+		}							\
+	      /* The exponents of X and Y, both normal, are equal.  The	\
+		 implicit MSBs will always add to increase the		\
+		 exponent.  */						\
+	      _FP_FRAC_ADD_##wc (R, X, Y);				\
+	      R##_e = X##_e + 1;					\
+	      _FP_FRAC_SRS_##wc (R, 1, _FP_WFRACBITS_##fs);		\
+	      if (R##_e == _FP_EXPMAX_##fs)				\
+		/* Overflow to infinity (depending on rounding mode).  */ \
+		_FP_OVERFLOW_SEMIRAW (fs, wc, R);			\
+	      goto add_done;						\
+	    }								\
+	add3:								\
+	  if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs)		\
+	    {								\
+	      /* Overflow.  */						\
+	      _FP_FRAC_HIGH_##fs (R) &= ~(_FP_W_TYPE) _FP_IMPLBIT_SH_##fs; \
+	      R##_e++;							\
+	      _FP_FRAC_SRS_##wc (R, 1, _FP_WFRACBITS_##fs);		\
+	      if (R##_e == _FP_EXPMAX_##fs)				\
+		/* Overflow to infinity (depending on rounding mode).  */ \
+		_FP_OVERFLOW_SEMIRAW (fs, wc, R);			\
+	    }								\
+	add_done: ;							\
+	}								\
+      else								\
+	{								\
+	  /* Subtraction.  */						\
+	  __label__ sub1, sub2, sub3, norm, sub_done;			\
+	  int _FP_ADD_INTERNAL_ediff = X##_e - Y##_e;			\
+	  if (_FP_ADD_INTERNAL_ediff > 0)				\
+	    {								\
+	      R##_e = X##_e;						\
+	      R##_s = X##_s;						\
+	      if (Y##_e == 0)						\
+		{							\
+		  /* Y is zero or denormalized.  */			\
+		  if (_FP_FRAC_ZEROP_##wc (Y))				\
+		    {							\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+		      _FP_FRAC_COPY_##wc (R, X);			\
+		      goto sub_done;					\
+		    }							\
+		  else							\
+		    {							\
+		      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		      _FP_ADD_INTERNAL_ediff--;				\
+		      if (_FP_ADD_INTERNAL_ediff == 0)			\
+			{						\
+			  _FP_FRAC_SUB_##wc (R, X, Y);			\
+			  goto sub3;					\
+			}						\
+		      if (X##_e == _FP_EXPMAX_##fs)			\
+			{						\
+			  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+			  _FP_FRAC_COPY_##wc (R, X);			\
+			  goto sub_done;				\
+			}						\
+		      goto sub1;					\
+		    }							\
+		}							\
+	      else if (X##_e == _FP_EXPMAX_##fs)			\
+		{							\
+		  /* X is NaN or Inf, Y is normal.  */			\
+		  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);			\
+		  _FP_FRAC_COPY_##wc (R, X);				\
+		  goto sub_done;					\
+		}							\
+									\
+	      /* Insert implicit MSB of Y.  */				\
+	      _FP_FRAC_HIGH_##fs (Y) |= _FP_IMPLBIT_SH_##fs;		\
+									\
+	    sub1:							\
+	      /* Shift the mantissa of Y to the right			\
+		 _FP_ADD_INTERNAL_EDIFF steps; remember to account	\
+		 later for the implicit MSB of X.  */			\
+	      if (_FP_ADD_INTERNAL_ediff <= _FP_WFRACBITS_##fs)		\
+		_FP_FRAC_SRS_##wc (Y, _FP_ADD_INTERNAL_ediff,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (!_FP_FRAC_ZEROP_##wc (Y))			\
+		_FP_FRAC_SET_##wc (Y, _FP_MINFRAC_##wc);		\
+	      _FP_FRAC_SUB_##wc (R, X, Y);				\
+	    }								\
+	  else if (_FP_ADD_INTERNAL_ediff < 0)				\
+	    {								\
+	      _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff;		\
+	      R##_e = Y##_e;						\
+	      R##_s = Y##_s;						\
+	      if (X##_e == 0)						\
+		{							\
+		  /* X is zero or denormalized.  */			\
+		  if (_FP_FRAC_ZEROP_##wc (X))				\
+		    {							\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+		      _FP_FRAC_COPY_##wc (R, Y);			\
+		      goto sub_done;					\
+		    }							\
+		  else							\
+		    {							\
+		      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		      _FP_ADD_INTERNAL_ediff--;				\
+		      if (_FP_ADD_INTERNAL_ediff == 0)			\
+			{						\
+			  _FP_FRAC_SUB_##wc (R, Y, X);			\
+			  goto sub3;					\
+			}						\
+		      if (Y##_e == _FP_EXPMAX_##fs)			\
+			{						\
+			  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+			  _FP_FRAC_COPY_##wc (R, Y);			\
+			  goto sub_done;				\
+			}						\
+		      goto sub2;					\
+		    }							\
+		}							\
+	      else if (Y##_e == _FP_EXPMAX_##fs)			\
+		{							\
+		  /* Y is NaN or Inf, X is normal.  */			\
+		  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);			\
+		  _FP_FRAC_COPY_##wc (R, Y);				\
+		  goto sub_done;					\
+		}							\
+									\
+	      /* Insert implicit MSB of X.  */				\
+	      _FP_FRAC_HIGH_##fs (X) |= _FP_IMPLBIT_SH_##fs;		\
+									\
+	    sub2:							\
+	      /* Shift the mantissa of X to the right			\
+		 _FP_ADD_INTERNAL_EDIFF steps; remember to account	\
+		 later for the implicit MSB of Y.  */			\
+	      if (_FP_ADD_INTERNAL_ediff <= _FP_WFRACBITS_##fs)		\
+		_FP_FRAC_SRS_##wc (X, _FP_ADD_INTERNAL_ediff,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (!_FP_FRAC_ZEROP_##wc (X))			\
+		_FP_FRAC_SET_##wc (X, _FP_MINFRAC_##wc);		\
+	      _FP_FRAC_SUB_##wc (R, Y, X);				\
+	    }								\
+	  else								\
+	    {								\
+	      /* ediff == 0.  */					\
+	      if (!_FP_EXP_NORMAL (fs, wc, X))				\
+		{							\
+		  if (X##_e == 0)					\
+		    {							\
+		      /* X and Y are zero or denormalized.  */		\
+		      R##_e = 0;					\
+		      if (_FP_FRAC_ZEROP_##wc (X))			\
+			{						\
+			  _FP_FRAC_COPY_##wc (R, Y);			\
+			  if (_FP_FRAC_ZEROP_##wc (Y))			\
+			    R##_s = (FP_ROUNDMODE == FP_RND_MINF);	\
+			  else						\
+			    {						\
+			      FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			      R##_s = Y##_s;				\
+			    }						\
+			  goto sub_done;				\
+			}						\
+		      else if (_FP_FRAC_ZEROP_##wc (Y))			\
+			{						\
+			  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_COPY_##wc (R, X);			\
+			  R##_s = X##_s;				\
+			  goto sub_done;				\
+			}						\
+		      else						\
+			{						\
+			  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_SUB_##wc (R, X, Y);			\
+			  R##_s = X##_s;				\
+			  if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs) \
+			    {						\
+			      /* |X| < |Y|, negate result.  */		\
+			      _FP_FRAC_SUB_##wc (R, Y, X);		\
+			      R##_s = Y##_s;				\
+			    }						\
+			  else if (_FP_FRAC_ZEROP_##wc (R))		\
+			    R##_s = (FP_ROUNDMODE == FP_RND_MINF);	\
+			  goto sub_done;				\
+			}						\
+		    }							\
+		  else							\
+		    {							\
+		      /* X and Y are NaN or Inf, of opposite signs.  */	\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+		      R##_e = _FP_EXPMAX_##fs;				\
+		      if (_FP_FRAC_ZEROP_##wc (X))			\
+			{						\
+			  if (_FP_FRAC_ZEROP_##wc (Y))			\
+			    {						\
+			      /* Inf - Inf.  */				\
+			      R##_s = _FP_NANSIGN_##fs;			\
+			      _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);	\
+			      _FP_FRAC_SLL_##wc (R, _FP_WORKBITS);	\
+			      FP_SET_EXCEPTION (FP_EX_INVALID		\
+						| FP_EX_INVALID_ISI);	\
+			    }						\
+			  else						\
+			    {						\
+			      /* Inf - NaN.  */				\
+			      R##_s = Y##_s;				\
+			      _FP_FRAC_COPY_##wc (R, Y);		\
+			    }						\
+			}						\
+		      else						\
+			{						\
+			  if (_FP_FRAC_ZEROP_##wc (Y))			\
+			    {						\
+			      /* NaN - Inf.  */				\
+			      R##_s = X##_s;				\
+			      _FP_FRAC_COPY_##wc (R, X);		\
+			    }						\
+			  else						\
+			    {						\
+			      /* NaN - NaN.  */				\
+			      _FP_CHOOSENAN_SEMIRAW (fs, wc, R, X, Y, OP); \
+			    }						\
+			}						\
+		      goto sub_done;					\
+		    }							\
+		}							\
+	      /* The exponents of X and Y, both normal, are equal.  The	\
+		 implicit MSBs cancel.  */				\
+	      R##_e = X##_e;						\
+	      _FP_FRAC_SUB_##wc (R, X, Y);				\
+	      R##_s = X##_s;						\
+	      if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs)		\
+		{							\
+		  /* |X| < |Y|, negate result.  */			\
+		  _FP_FRAC_SUB_##wc (R, Y, X);				\
+		  R##_s = Y##_s;					\
+		}							\
+	      else if (_FP_FRAC_ZEROP_##wc (R))				\
+		{							\
+		  R##_e = 0;						\
+		  R##_s = (FP_ROUNDMODE == FP_RND_MINF);		\
+		  goto sub_done;					\
+		}							\
+	      goto norm;						\
+	    }								\
+	sub3:								\
+	  if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs)		\
+	    {								\
+	      int _FP_ADD_INTERNAL_diff;				\
+	      /* Carry into most significant bit of larger one of X and Y, \
+		 canceling it; renormalize.  */				\
+	      _FP_FRAC_HIGH_##fs (R) &= _FP_IMPLBIT_SH_##fs - 1;	\
+	    norm:							\
+	      _FP_FRAC_CLZ_##wc (_FP_ADD_INTERNAL_diff, R);		\
+	      _FP_ADD_INTERNAL_diff -= _FP_WFRACXBITS_##fs;		\
+	      _FP_FRAC_SLL_##wc (R, _FP_ADD_INTERNAL_diff);		\
+	      if (R##_e <= _FP_ADD_INTERNAL_diff)			\
+		{							\
+		  /* R is denormalized.  */				\
+		  _FP_ADD_INTERNAL_diff					\
+		    = _FP_ADD_INTERNAL_diff - R##_e + 1;		\
+		  _FP_FRAC_SRS_##wc (R, _FP_ADD_INTERNAL_diff,		\
+				     _FP_WFRACBITS_##fs);		\
+		  R##_e = 0;						\
+		}							\
+	      else							\
+		{							\
+		  R##_e -= _FP_ADD_INTERNAL_diff;			\
+		  _FP_FRAC_HIGH_##fs (R) &= ~(_FP_W_TYPE) _FP_IMPLBIT_SH_##fs; \
+		}							\
+	    }								\
+	sub_done: ;							\
+	}								\
+    }									\
+  while (0)
+
+#define _FP_ADD(fs, wc, R, X, Y) _FP_ADD_INTERNAL (fs, wc, R, X, Y, '+')
+#define _FP_SUB(fs, wc, R, X, Y)					\
+  do									\
+    {									\
+      if (!(Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (Y)))	\
+	Y##_s ^= 1;							\
+      _FP_ADD_INTERNAL (fs, wc, R, X, Y, '-');				\
+    }									\
+  while (0)
+
+
+/* Main negation routine.  The input value is raw.  */
+
+#define _FP_NEG(fs, wc, R, X)			\
+  do						\
+    {						\
+      _FP_FRAC_COPY_##wc (R, X);		\
+      R##_e = X##_e;				\
+      R##_s = 1 ^ X##_s;			\
+    }						\
+  while (0)
+
+
+/* Main multiplication routine.  The input values should be cooked.  */
+
+#define _FP_MUL(fs, wc, R, X, Y)				\
+  do								\
+    {								\
+      R##_s = X##_s ^ Y##_s;					\
+      R##_e = X##_e + Y##_e + 1;				\
+      switch (_FP_CLS_COMBINE (X##_c, Y##_c))			\
+	{							\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NORMAL):	\
+	  R##_c = FP_CLS_NORMAL;				\
+								\
+	  _FP_MUL_MEAT_##fs (R, X, Y);				\
+								\
+	  if (_FP_FRAC_OVERP_##wc (fs, R))			\
+	    _FP_FRAC_SRS_##wc (R, 1, _FP_WFRACBITS_##fs);	\
+	  else							\
+	    R##_e--;						\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NAN):		\
+	  _FP_CHOOSENAN (fs, wc, R, X, Y, '*');			\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NORMAL):	\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO):		\
+	  R##_s = X##_s;					\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL):	\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NORMAL):	\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_ZERO):	\
+	  _FP_FRAC_COPY_##wc (R, X);				\
+	  R##_c = X##_c;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NAN):	\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN):		\
+	  R##_s = Y##_s;					\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_INF):	\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_ZERO):	\
+	  _FP_FRAC_COPY_##wc (R, Y);				\
+	  R##_c = Y##_c;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_INF):		\
+	  R##_s = _FP_NANSIGN_##fs;				\
+	  R##_c = FP_CLS_NAN;					\
+	  _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);		\
+	  FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_IMZ);	\
+	  break;						\
+								\
+	default:						\
+	  abort ();						\
+	}							\
+    }								\
+  while (0)
+
+
+/* Fused multiply-add.  The input values should be cooked.  */
+
+#define _FP_FMA(fs, wc, dwc, R, X, Y, Z)				\
+  do									\
+    {									\
+      __label__ done_fma;						\
+      FP_DECL_##fs (_FP_FMA_T);						\
+      _FP_FMA_T##_s = X##_s ^ Y##_s;					\
+      _FP_FMA_T##_e = X##_e + Y##_e + 1;				\
+      switch (_FP_CLS_COMBINE (X##_c, Y##_c))				\
+	{								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NORMAL):		\
+	  switch (Z##_c)						\
+	    {								\
+	    case FP_CLS_INF:						\
+	    case FP_CLS_NAN:						\
+	      R##_s = Z##_s;						\
+	      _FP_FRAC_COPY_##wc (R, Z);				\
+	      R##_c = Z##_c;						\
+	      break;							\
+									\
+	    case FP_CLS_ZERO:						\
+	      R##_c = FP_CLS_NORMAL;					\
+	      R##_s = _FP_FMA_T##_s;					\
+	      R##_e = _FP_FMA_T##_e;					\
+									\
+	      _FP_MUL_MEAT_##fs (R, X, Y);				\
+									\
+	      if (_FP_FRAC_OVERP_##wc (fs, R))				\
+		_FP_FRAC_SRS_##wc (R, 1, _FP_WFRACBITS_##fs);		\
+	      else							\
+		R##_e--;						\
+	      break;							\
+									\
+	    case FP_CLS_NORMAL:;					\
+	      _FP_FRAC_DECL_##dwc (_FP_FMA_TD);				\
+	      _FP_FRAC_DECL_##dwc (_FP_FMA_ZD);				\
+	      _FP_FRAC_DECL_##dwc (_FP_FMA_RD);				\
+	      _FP_MUL_MEAT_DW_##fs (_FP_FMA_TD, X, Y);			\
+	      R##_e = _FP_FMA_T##_e;					\
+	      int _FP_FMA_tsh						\
+		= _FP_FRAC_HIGHBIT_DW_##dwc (fs, _FP_FMA_TD) == 0;	\
+	      _FP_FMA_T##_e -= _FP_FMA_tsh;				\
+	      int _FP_FMA_ediff = _FP_FMA_T##_e - Z##_e;		\
+	      if (_FP_FMA_ediff >= 0)					\
+		{							\
+		  int _FP_FMA_shift					\
+		    = _FP_WFRACBITS_##fs - _FP_FMA_tsh - _FP_FMA_ediff;	\
+		  if (_FP_FMA_shift <= -_FP_WFRACBITS_##fs)		\
+		    _FP_FRAC_SET_##dwc (_FP_FMA_ZD, _FP_MINFRAC_##dwc);	\
+		  else							\
+		    {							\
+		      _FP_FRAC_COPY_##dwc##_##wc (_FP_FMA_ZD, Z);	\
+		      if (_FP_FMA_shift < 0)				\
+			_FP_FRAC_SRS_##dwc (_FP_FMA_ZD, -_FP_FMA_shift,	\
+					    _FP_WFRACBITS_DW_##fs);	\
+		      else if (_FP_FMA_shift > 0)			\
+			_FP_FRAC_SLL_##dwc (_FP_FMA_ZD, _FP_FMA_shift);	\
+		    }							\
+		  R##_s = _FP_FMA_T##_s;				\
+		  if (_FP_FMA_T##_s == Z##_s)				\
+		    _FP_FRAC_ADD_##dwc (_FP_FMA_RD, _FP_FMA_TD,		\
+					_FP_FMA_ZD);			\
+		  else							\
+		    {							\
+		      _FP_FRAC_SUB_##dwc (_FP_FMA_RD, _FP_FMA_TD,	\
+					  _FP_FMA_ZD);			\
+		      if (_FP_FRAC_NEGP_##dwc (_FP_FMA_RD))		\
+			{						\
+			  R##_s = Z##_s;				\
+			  _FP_FRAC_SUB_##dwc (_FP_FMA_RD, _FP_FMA_ZD,	\
+					      _FP_FMA_TD);		\
+			}						\
+		    }							\
+		}							\
+	      else							\
+		{							\
+		  R##_e = Z##_e;					\
+		  R##_s = Z##_s;					\
+		  _FP_FRAC_COPY_##dwc##_##wc (_FP_FMA_ZD, Z);		\
+		  _FP_FRAC_SLL_##dwc (_FP_FMA_ZD, _FP_WFRACBITS_##fs);	\
+		  int _FP_FMA_shift = -_FP_FMA_ediff - _FP_FMA_tsh;	\
+		  if (_FP_FMA_shift >= _FP_WFRACBITS_DW_##fs)		\
+		    _FP_FRAC_SET_##dwc (_FP_FMA_TD, _FP_MINFRAC_##dwc);	\
+		  else if (_FP_FMA_shift > 0)				\
+		    _FP_FRAC_SRS_##dwc (_FP_FMA_TD, _FP_FMA_shift,	\
+					_FP_WFRACBITS_DW_##fs);		\
+		  if (Z##_s == _FP_FMA_T##_s)				\
+		    _FP_FRAC_ADD_##dwc (_FP_FMA_RD, _FP_FMA_ZD,		\
+					_FP_FMA_TD);			\
+		  else							\
+		    _FP_FRAC_SUB_##dwc (_FP_FMA_RD, _FP_FMA_ZD,		\
+					_FP_FMA_TD);			\
+		}							\
+	      if (_FP_FRAC_ZEROP_##dwc (_FP_FMA_RD))			\
+		{							\
+		  if (_FP_FMA_T##_s == Z##_s)				\
+		    R##_s = Z##_s;					\
+		  else							\
+		    R##_s = (FP_ROUNDMODE == FP_RND_MINF);		\
+		  _FP_FRAC_SET_##wc (R, _FP_ZEROFRAC_##wc);		\
+		  R##_c = FP_CLS_ZERO;					\
+		}							\
+	      else							\
+		{							\
+		  int _FP_FMA_rlz;					\
+		  _FP_FRAC_CLZ_##dwc (_FP_FMA_rlz, _FP_FMA_RD);		\
+		  _FP_FMA_rlz -= _FP_WFRACXBITS_DW_##fs;		\
+		  R##_e -= _FP_FMA_rlz;					\
+		  int _FP_FMA_shift = _FP_WFRACBITS_##fs - _FP_FMA_rlz;	\
+		  if (_FP_FMA_shift > 0)				\
+		    _FP_FRAC_SRS_##dwc (_FP_FMA_RD, _FP_FMA_shift,	\
+					_FP_WFRACBITS_DW_##fs);		\
+		  else if (_FP_FMA_shift < 0)				\
+		    _FP_FRAC_SLL_##dwc (_FP_FMA_RD, -_FP_FMA_shift);	\
+		  _FP_FRAC_COPY_##wc##_##dwc (R, _FP_FMA_RD);		\
+		  R##_c = FP_CLS_NORMAL;				\
+		}							\
+	      break;							\
+	    }								\
+	  goto done_fma;						\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NAN):			\
+	  _FP_CHOOSENAN (fs, wc, _FP_FMA_T, X, Y, '*');			\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF):			\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO):			\
+	  _FP_FMA_T##_s = X##_s;					\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF):			\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_ZERO):		\
+	  _FP_FRAC_COPY_##wc (_FP_FMA_T, X);				\
+	  _FP_FMA_T##_c = X##_c;					\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NAN):		\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN):			\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN):			\
+	  _FP_FMA_T##_s = Y##_s;					\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_ZERO):		\
+	  _FP_FRAC_COPY_##wc (_FP_FMA_T, Y);				\
+	  _FP_FMA_T##_c = Y##_c;					\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO):			\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_INF):			\
+	  _FP_FMA_T##_s = _FP_NANSIGN_##fs;				\
+	  _FP_FMA_T##_c = FP_CLS_NAN;					\
+	  _FP_FRAC_SET_##wc (_FP_FMA_T, _FP_NANFRAC_##fs);		\
+	  FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_IMZ_FMA);	\
+	  break;							\
+									\
+	default:							\
+	  abort ();							\
+	}								\
+									\
+      /* T = X * Y is zero, infinity or NaN.  */			\
+      switch (_FP_CLS_COMBINE (_FP_FMA_T##_c, Z##_c))			\
+	{								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NAN):			\
+	  _FP_CHOOSENAN (fs, wc, R, _FP_FMA_T, Z, '+');			\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF):			\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO):			\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO):			\
+	  R##_s = _FP_FMA_T##_s;					\
+	  _FP_FRAC_COPY_##wc (R, _FP_FMA_T);				\
+	  R##_c = _FP_FMA_T##_c;					\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN):			\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN):			\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_INF):			\
+	  R##_s = Z##_s;						\
+	  _FP_FRAC_COPY_##wc (R, Z);					\
+	  R##_c = Z##_c;						\
+	  R##_e = Z##_e;						\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF):			\
+	  if (_FP_FMA_T##_s == Z##_s)					\
+	    {								\
+	      R##_s = Z##_s;						\
+	      _FP_FRAC_COPY_##wc (R, Z);				\
+	      R##_c = Z##_c;						\
+	    }								\
+	  else								\
+	    {								\
+	      R##_s = _FP_NANSIGN_##fs;					\
+	      R##_c = FP_CLS_NAN;					\
+	      _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);			\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_ISI);	\
+	    }								\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_ZERO):		\
+	  if (_FP_FMA_T##_s == Z##_s)					\
+	    R##_s = Z##_s;						\
+	  else								\
+	    R##_s = (FP_ROUNDMODE == FP_RND_MINF);			\
+	  _FP_FRAC_COPY_##wc (R, Z);					\
+	  R##_c = Z##_c;						\
+	  break;							\
+									\
+	default:							\
+	  abort ();							\
+	}								\
+    done_fma: ;								\
+    }									\
+  while (0)
+
+
+/* Main division routine.  The input values should be cooked.  */
+
+#define _FP_DIV(fs, wc, R, X, Y)				\
+  do								\
     {								\
-      if (!_FP_FRAC_ZEROP_##wc(X)				\
-	  && !(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs))	\
-	__ret = 1;						\
+      R##_s = X##_s ^ Y##_s;					\
+      R##_e = X##_e - Y##_e;					\
+      switch (_FP_CLS_COMBINE (X##_c, Y##_c))			\
+	{							\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NORMAL):	\
+	  R##_c = FP_CLS_NORMAL;				\
+								\
+	  _FP_DIV_MEAT_##fs (R, X, Y);				\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NAN):		\
+	  _FP_CHOOSENAN (fs, wc, R, X, Y, '/');			\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NORMAL):	\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO):		\
+	  R##_s = X##_s;					\
+	  _FP_FRAC_COPY_##wc (R, X);				\
+	  R##_c = X##_c;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NAN):	\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN):		\
+	  R##_s = Y##_s;					\
+	  _FP_FRAC_COPY_##wc (R, Y);				\
+	  R##_c = Y##_c;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_INF):	\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NORMAL):	\
+	  R##_c = FP_CLS_ZERO;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_ZERO):	\
+	  FP_SET_EXCEPTION (FP_EX_DIVZERO);			\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO):		\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL):	\
+	  R##_c = FP_CLS_INF;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_ZERO):	\
+	  R##_s = _FP_NANSIGN_##fs;				\
+	  R##_c = FP_CLS_NAN;					\
+	  _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);		\
+	  FP_SET_EXCEPTION (FP_EX_INVALID			\
+			    | (X##_c == FP_CLS_INF		\
+			       ? FP_EX_INVALID_IDI		\
+			       : FP_EX_INVALID_ZDZ));		\
+	  break;						\
+								\
+	default:						\
+	  abort ();						\
+	}							\
     }								\
-  __ret;							\
-})
-
-
-
-
-
-/*
- * Main addition routine.  The input values should be cooked.
- */
-
-#define _FP_ADD_INTERNAL(fs, wc, R, X, Y, OP)				     \
-do {									     \
-  switch (_FP_CLS_COMBINE(X##_c, Y##_c))				     \
-  {									     \
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL):			     \
-    {									     \
-      /* shift the smaller number so that its exponent matches the larger */ \
-      _FP_I_TYPE diff = X##_e - Y##_e;					     \
-									     \
-      if (diff < 0)							     \
-	{								     \
-	  diff = -diff;							     \
-	  if (diff <= _FP_WFRACBITS_##fs)				     \
-	    _FP_FRAC_SRS_##wc(X, diff, _FP_WFRACBITS_##fs);		     \
-	  else if (!_FP_FRAC_ZEROP_##wc(X))				     \
-	    _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc);			     \
-	  R##_e = Y##_e;						     \
-	}								     \
-      else								     \
-	{								     \
-	  if (diff > 0)							     \
-	    {								     \
-	      if (diff <= _FP_WFRACBITS_##fs)				     \
-	        _FP_FRAC_SRS_##wc(Y, diff, _FP_WFRACBITS_##fs);		     \
-	      else if (!_FP_FRAC_ZEROP_##wc(Y))				     \
-	        _FP_FRAC_SET_##wc(Y, _FP_MINFRAC_##wc);			     \
-	    }								     \
-	  R##_e = X##_e;						     \
-	}								     \
-									     \
-      R##_c = FP_CLS_NORMAL;						     \
-									     \
-      if (X##_s == Y##_s)						     \
-	{								     \
-	  R##_s = X##_s;						     \
-	  _FP_FRAC_ADD_##wc(R, X, Y);					     \
-	  if (_FP_FRAC_OVERP_##wc(fs, R))				     \
-	    {								     \
-	      _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs);		     \
-	      R##_e++;							     \
-	    }								     \
-	}								     \
-      else								     \
-	{								     \
-	  R##_s = X##_s;						     \
-	  _FP_FRAC_SUB_##wc(R, X, Y);					     \
-	  if (_FP_FRAC_ZEROP_##wc(R))					     \
-	    {								     \
-	      /* return an exact zero */				     \
-	      if (FP_ROUNDMODE == FP_RND_MINF)				     \
-		R##_s |= Y##_s;						     \
-	      else							     \
-		R##_s &= Y##_s;						     \
-	      R##_c = FP_CLS_ZERO;					     \
-	    }								     \
-	  else								     \
-	    {								     \
-	      if (_FP_FRAC_NEGP_##wc(R))				     \
-		{							     \
-		  _FP_FRAC_SUB_##wc(R, Y, X);				     \
-		  R##_s = Y##_s;					     \
-		}							     \
-									     \
-	      /* renormalize after subtraction */			     \
-	      _FP_FRAC_CLZ_##wc(diff, R);				     \
-	      diff -= _FP_WFRACXBITS_##fs;				     \
-	      if (diff)							     \
-		{							     \
-		  R##_e -= diff;					     \
-		  _FP_FRAC_SLL_##wc(R, diff);				     \
-		}							     \
-	    }								     \
-	}								     \
-      break;								     \
-    }									     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN):				     \
-    _FP_CHOOSENAN(fs, wc, R, X, Y, OP);					     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO):			     \
-    R##_e = X##_e;							     \
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL):			     \
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF):				     \
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO):				     \
-    _FP_FRAC_COPY_##wc(R, X);						     \
-    R##_s = X##_s;							     \
-    R##_c = X##_c;							     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL):			     \
-    R##_e = Y##_e;							     \
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN):			     \
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN):				     \
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN):				     \
-    _FP_FRAC_COPY_##wc(R, Y);						     \
-    R##_s = Y##_s;							     \
-    R##_c = Y##_c;							     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF):				     \
-    if (X##_s != Y##_s)							     \
-      {									     \
-	/* +INF + -INF => NAN */					     \
-	_FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);				     \
-	R##_s = _FP_NANSIGN_##fs;					     \
-	R##_c = FP_CLS_NAN;						     \
-	FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_ISI);		     \
-	break;								     \
-      }									     \
-    /* FALLTHRU */							     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL):			     \
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO):				     \
-    R##_s = X##_s;							     \
-    R##_c = FP_CLS_INF;							     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF):			     \
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF):				     \
-    R##_s = Y##_s;							     \
-    R##_c = FP_CLS_INF;							     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO):			     \
-    /* make sure the sign is correct */					     \
-    if (FP_ROUNDMODE == FP_RND_MINF)					     \
-      R##_s = X##_s | Y##_s;						     \
-    else								     \
-      R##_s = X##_s & Y##_s;						     \
-    R##_c = FP_CLS_ZERO;						     \
-    break;								     \
-									     \
-  default:								     \
-    abort();								     \
-  }									     \
-} while (0)
-
-#define _FP_ADD(fs, wc, R, X, Y) _FP_ADD_INTERNAL(fs, wc, R, X, Y, '+')
-#define _FP_SUB(fs, wc, R, X, Y)					     \
-  do {									     \
-    if (Y##_c != FP_CLS_NAN) Y##_s ^= 1;				     \
-    _FP_ADD_INTERNAL(fs, wc, R, X, Y, '-');				     \
-  } while (0)
-
-
-/*
- * Main negation routine.  FIXME -- when we care about setting exception
- * bits reliably, this will not do.  We should examine all of the fp classes.
- */
-
-#define _FP_NEG(fs, wc, R, X)		\
-  do {					\
-    _FP_FRAC_COPY_##wc(R, X);		\
-    R##_c = X##_c;			\
-    R##_e = X##_e;			\
-    R##_s = 1 ^ X##_s;			\
-  } while (0)
-
-
-/*
- * Main multiplication routine.  The input values should be cooked.
- */
-
-#define _FP_MUL(fs, wc, R, X, Y)			\
-do {							\
-  R##_s = X##_s ^ Y##_s;				\
-  switch (_FP_CLS_COMBINE(X##_c, Y##_c))		\
-  {							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL):	\
-    R##_c = FP_CLS_NORMAL;				\
-    R##_e = X##_e + Y##_e + 1;				\
-							\
-    _FP_MUL_MEAT_##fs(R,X,Y);				\
-							\
-    if (_FP_FRAC_OVERP_##wc(fs, R))			\
-      _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs);	\
-    else						\
-      R##_e--;						\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN):		\
-    _FP_CHOOSENAN(fs, wc, R, X, Y, '*');		\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL):	\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF):		\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO):		\
-    R##_s = X##_s;					\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF):		\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL):	\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL):	\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO):	\
-    _FP_FRAC_COPY_##wc(R, X);				\
-    R##_c = X##_c;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN):	\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN):		\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN):		\
-    R##_s = Y##_s;					\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF):	\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO):	\
-    _FP_FRAC_COPY_##wc(R, Y);				\
-    R##_c = Y##_c;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO):		\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF):		\
-    R##_s = _FP_NANSIGN_##fs;				\
-    R##_c = FP_CLS_NAN;					\
-    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);		\
-    FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IMZ);\
-    break;						\
-							\
-  default:						\
-    abort();						\
-  }							\
-} while (0)
-
-
-/*
- * Main division routine.  The input values should be cooked.
- */
-
-#define _FP_DIV(fs, wc, R, X, Y)			\
-do {							\
-  R##_s = X##_s ^ Y##_s;				\
-  switch (_FP_CLS_COMBINE(X##_c, Y##_c))		\
-  {							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL):	\
-    R##_c = FP_CLS_NORMAL;				\
-    R##_e = X##_e - Y##_e;				\
-							\
-    _FP_DIV_MEAT_##fs(R,X,Y);				\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN):		\
-    _FP_CHOOSENAN(fs, wc, R, X, Y, '/');		\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL):	\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF):		\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO):		\
-    R##_s = X##_s;					\
-    _FP_FRAC_COPY_##wc(R, X);				\
-    R##_c = X##_c;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN):	\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN):		\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN):		\
-    R##_s = Y##_s;					\
-    _FP_FRAC_COPY_##wc(R, Y);				\
-    R##_c = Y##_c;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF):	\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF):		\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL):	\
-    R##_c = FP_CLS_ZERO;				\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO):	\
-    FP_SET_EXCEPTION(FP_EX_DIVZERO);			\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO):		\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL):	\
-    R##_c = FP_CLS_INF;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF):		\
-    R##_s = _FP_NANSIGN_##fs;				\
-    R##_c = FP_CLS_NAN;					\
-    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);		\
-    FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IDI);\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO):	\
-    R##_s = _FP_NANSIGN_##fs;				\
-    R##_c = FP_CLS_NAN;					\
-    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);		\
-    FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_ZDZ);\
-    break;						\
-							\
-  default:						\
-    abort();						\
-  }							\
-} while (0)
-
-
-/*
- * Main differential comparison routine.  The inputs should be raw not
- * cooked.  The return is -1,0,1 for normal values, 2 otherwise.
- */
-
-#define _FP_CMP(fs, wc, ret, X, Y, un)					\
-  do {									\
-    /* NANs are unordered */						\
-    if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X))		\
-	|| (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y)))	\
-      {									\
-	ret = un;							\
-      }									\
-    else								\
-      {									\
-	int __is_zero_x;						\
-	int __is_zero_y;						\
-									\
-	__is_zero_x = (!X##_e && _FP_FRAC_ZEROP_##wc(X)) ? 1 : 0;	\
-	__is_zero_y = (!Y##_e && _FP_FRAC_ZEROP_##wc(Y)) ? 1 : 0;	\
-									\
-	if (__is_zero_x && __is_zero_y)					\
-		ret = 0;						\
-	else if (__is_zero_x)						\
-		ret = Y##_s ? 1 : -1;					\
-	else if (__is_zero_y)						\
-		ret = X##_s ? -1 : 1;					\
-	else if (X##_s != Y##_s)					\
-	  ret = X##_s ? -1 : 1;						\
-	else if (X##_e > Y##_e)						\
-	  ret = X##_s ? -1 : 1;						\
-	else if (X##_e < Y##_e)						\
-	  ret = X##_s ? 1 : -1;						\
-	else if (_FP_FRAC_GT_##wc(X, Y))				\
-	  ret = X##_s ? -1 : 1;						\
-	else if (_FP_FRAC_GT_##wc(Y, X))				\
-	  ret = X##_s ? 1 : -1;						\
-	else								\
-	  ret = 0;							\
-      }									\
-  } while (0)
+  while (0)
+
+
+/* Helper for comparisons.  EX is 0 not to raise exceptions, 1 to
+   raise exceptions for signaling NaN operands, 2 to raise exceptions
+   for all NaN operands.  Conditionals are organized to allow the
+   compiler to optimize away code based on the value of EX.  */
+
+#define _FP_CMP_CHECK_NAN(fs, wc, X, Y, ex)				\
+  do									\
+    {									\
+      /* The arguments are unordered, which may or may not result in	\
+	 an exception.  */						\
+      if (ex)								\
+	{								\
+	  /* At least some cases of unordered arguments result in	\
+	     exceptions; check whether this is one.  */			\
+	  if (FP_EX_INVALID_SNAN || FP_EX_INVALID_VC)			\
+	    {								\
+	      /* Check separately for each case of "invalid"		\
+		 exceptions.  */					\
+	      if ((ex) == 2)						\
+		FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_VC);	\
+	      if (_FP_ISSIGNAN (fs, wc, X)				\
+		  || _FP_ISSIGNAN (fs, wc, Y))				\
+		FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_SNAN);	\
+	    }								\
+	  /* Otherwise, we only need to check whether to raise an	\
+	     exception, not which case or cases it is.  */		\
+	  else if ((ex) == 2						\
+		   || _FP_ISSIGNAN (fs, wc, X)				\
+		   || _FP_ISSIGNAN (fs, wc, Y))				\
+	    FP_SET_EXCEPTION (FP_EX_INVALID);				\
+	}								\
+    }									\
+  while (0)
+
+/* Helper for comparisons.  If denormal operands would raise an
+   exception, check for them, and flush to zero as appropriate
+   (otherwise, we need only check and flush to zero if it might affect
+   the result, which is done later with _FP_CMP_CHECK_FLUSH_ZERO).  */
+#define _FP_CMP_CHECK_DENORM(fs, wc, X, Y)				\
+  do									\
+    {									\
+      if (FP_EX_DENORM != 0)						\
+	{								\
+	  /* We must ensure the correct exceptions are raised for	\
+	     denormal operands, even though this may not affect the	\
+	     result of the comparison.  */				\
+	  if (FP_DENORM_ZERO)						\
+	    {								\
+	      _FP_CHECK_FLUSH_ZERO (fs, wc, X);				\
+	      _FP_CHECK_FLUSH_ZERO (fs, wc, Y);				\
+	    }								\
+	  else								\
+	    {								\
+	      if ((X##_e == 0 && !_FP_FRAC_ZEROP_##wc (X))		\
+		  || (Y##_e == 0 && !_FP_FRAC_ZEROP_##wc (Y)))		\
+		FP_SET_EXCEPTION (FP_EX_DENORM);			\
+	    }								\
+	}								\
+    }									\
+  while (0)
+
+/* Helper for comparisons.  Check for flushing denormals for zero if
+   we didn't need to check earlier for any denormal operands.  */
+#define _FP_CMP_CHECK_FLUSH_ZERO(fs, wc, X, Y)	\
+  do						\
+    {						\
+      if (FP_EX_DENORM == 0)			\
+	{					\
+	  _FP_CHECK_FLUSH_ZERO (fs, wc, X);	\
+	  _FP_CHECK_FLUSH_ZERO (fs, wc, Y);	\
+	}					\
+    }						\
+  while (0)
+
+/* Main differential comparison routine.  The inputs should be raw not
+   cooked.  The return is -1, 0, 1 for normal values, UN
+   otherwise.  */
+
+#define _FP_CMP(fs, wc, ret, X, Y, un, ex)				\
+  do									\
+    {									\
+      _FP_CMP_CHECK_DENORM (fs, wc, X, Y);				\
+      /* NANs are unordered.  */					\
+      if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (X))	\
+	  || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (Y)))	\
+	{								\
+	  (ret) = (un);							\
+	  _FP_CMP_CHECK_NAN (fs, wc, X, Y, (ex));			\
+	}								\
+      else								\
+	{								\
+	  int _FP_CMP_is_zero_x;					\
+	  int _FP_CMP_is_zero_y;					\
+									\
+	  _FP_CMP_CHECK_FLUSH_ZERO (fs, wc, X, Y);			\
+									\
+	  _FP_CMP_is_zero_x						\
+	    = (!X##_e && _FP_FRAC_ZEROP_##wc (X)) ? 1 : 0;		\
+	  _FP_CMP_is_zero_y						\
+	    = (!Y##_e && _FP_FRAC_ZEROP_##wc (Y)) ? 1 : 0;		\
+									\
+	  if (_FP_CMP_is_zero_x && _FP_CMP_is_zero_y)			\
+	    (ret) = 0;							\
+	  else if (_FP_CMP_is_zero_x)					\
+	    (ret) = Y##_s ? 1 : -1;					\
+	  else if (_FP_CMP_is_zero_y)					\
+	    (ret) = X##_s ? -1 : 1;					\
+	  else if (X##_s != Y##_s)					\
+	    (ret) = X##_s ? -1 : 1;					\
+	  else if (X##_e > Y##_e)					\
+	    (ret) = X##_s ? -1 : 1;					\
+	  else if (X##_e < Y##_e)					\
+	    (ret) = X##_s ? 1 : -1;					\
+	  else if (_FP_FRAC_GT_##wc (X, Y))				\
+	    (ret) = X##_s ? -1 : 1;					\
+	  else if (_FP_FRAC_GT_##wc (Y, X))				\
+	    (ret) = X##_s ? 1 : -1;					\
+	  else								\
+	    (ret) = 0;							\
+	}								\
+    }									\
+  while (0)
 
 
 /* Simplification for strict equality.  */
 
-#define _FP_CMP_EQ(fs, wc, ret, X, Y)					  \
-  do {									  \
-    /* NANs are unordered */						  \
-    if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X))		  \
-	|| (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y)))	  \
-      {									  \
-	ret = 1;							  \
-      }									  \
-    else								  \
-      {									  \
-	ret = !(X##_e == Y##_e						  \
-		&& _FP_FRAC_EQ_##wc(X, Y)				  \
-		&& (X##_s == Y##_s || !X##_e && _FP_FRAC_ZEROP_##wc(X))); \
-      }									  \
-  } while (0)
-
-/*
- * Main square root routine.  The input value should be cooked.
- */
+#define _FP_CMP_EQ(fs, wc, ret, X, Y, ex)				\
+  do									\
+    {									\
+      _FP_CMP_CHECK_DENORM (fs, wc, X, Y);				\
+      /* NANs are unordered.  */					\
+      if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (X))	\
+	  || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (Y)))	\
+	{								\
+	  (ret) = 1;							\
+	  _FP_CMP_CHECK_NAN (fs, wc, X, Y, (ex));			\
+	}								\
+      else								\
+	{								\
+	  _FP_CMP_CHECK_FLUSH_ZERO (fs, wc, X, Y);			\
+									\
+	  (ret) = !(X##_e == Y##_e					\
+		    && _FP_FRAC_EQ_##wc (X, Y)				\
+		    && (X##_s == Y##_s					\
+			|| (!X##_e && _FP_FRAC_ZEROP_##wc (X))));	\
+	}								\
+    }									\
+  while (0)
+
+/* Version to test unordered.  */
+
+#define _FP_CMP_UNORD(fs, wc, ret, X, Y, ex)				\
+  do									\
+    {									\
+      _FP_CMP_CHECK_DENORM (fs, wc, X, Y);				\
+      (ret) = ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (X))	\
+	       || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (Y))); \
+      if (ret)								\
+	_FP_CMP_CHECK_NAN (fs, wc, X, Y, (ex));				\
+    }									\
+  while (0)
+
+/* Main square root routine.  The input value should be cooked.  */
 
 #define _FP_SQRT(fs, wc, R, X)						\
-do {									\
-    _FP_FRAC_DECL_##wc(T); _FP_FRAC_DECL_##wc(S);			\
-    _FP_W_TYPE q;							\
-    switch (X##_c)							\
+  do									\
     {									\
-    case FP_CLS_NAN:							\
-	_FP_FRAC_COPY_##wc(R, X);					\
-	R##_s = X##_s;							\
-    	R##_c = FP_CLS_NAN;						\
-    	break;								\
-    case FP_CLS_INF:							\
-    	if (X##_s)							\
-    	  {								\
-    	    R##_s = _FP_NANSIGN_##fs;					\
-	    R##_c = FP_CLS_NAN; /* NAN */				\
-	    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);			\
-	    FP_SET_EXCEPTION(FP_EX_INVALID);				\
-    	  }								\
-    	else								\
-    	  {								\
-    	    R##_s = 0;							\
-    	    R##_c = FP_CLS_INF; /* sqrt(+inf) = +inf */			\
-    	  }								\
-    	break;								\
-    case FP_CLS_ZERO:							\
-	R##_s = X##_s;							\
-	R##_c = FP_CLS_ZERO; /* sqrt(+-0) = +-0 */			\
-	break;								\
-    case FP_CLS_NORMAL:							\
-    	R##_s = 0;							\
-        if (X##_s)							\
-          {								\
-	    R##_c = FP_CLS_NAN; /* sNAN */				\
-	    R##_s = _FP_NANSIGN_##fs;					\
-	    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);			\
-	    FP_SET_EXCEPTION(FP_EX_INVALID);				\
-	    break;							\
-          }								\
-    	R##_c = FP_CLS_NORMAL;						\
-        if (X##_e & 1)							\
-          _FP_FRAC_SLL_##wc(X, 1);					\
-        R##_e = X##_e >> 1;						\
-        _FP_FRAC_SET_##wc(S, _FP_ZEROFRAC_##wc);			\
-        _FP_FRAC_SET_##wc(R, _FP_ZEROFRAC_##wc);			\
-        q = _FP_OVERFLOW_##fs >> 1;					\
-        _FP_SQRT_MEAT_##wc(R, S, T, X, q);				\
+      _FP_FRAC_DECL_##wc (_FP_SQRT_T);					\
+      _FP_FRAC_DECL_##wc (_FP_SQRT_S);					\
+      _FP_W_TYPE _FP_SQRT_q;						\
+      switch (X##_c)							\
+	{								\
+	case FP_CLS_NAN:						\
+	  _FP_FRAC_COPY_##wc (R, X);					\
+	  R##_s = X##_s;						\
+	  R##_c = FP_CLS_NAN;						\
+	  break;							\
+	case FP_CLS_INF:						\
+	  if (X##_s)							\
+	    {								\
+	      R##_s = _FP_NANSIGN_##fs;					\
+	      R##_c = FP_CLS_NAN; /* NAN */				\
+	      _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);			\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_SQRT);	\
+	    }								\
+	  else								\
+	    {								\
+	      R##_s = 0;						\
+	      R##_c = FP_CLS_INF; /* sqrt(+inf) = +inf */		\
+	    }								\
+	  break;							\
+	case FP_CLS_ZERO:						\
+	  R##_s = X##_s;						\
+	  R##_c = FP_CLS_ZERO; /* sqrt(+-0) = +-0 */			\
+	  break;							\
+	case FP_CLS_NORMAL:						\
+	  R##_s = 0;							\
+	  if (X##_s)							\
+	    {								\
+	      R##_c = FP_CLS_NAN; /* NAN */				\
+	      R##_s = _FP_NANSIGN_##fs;					\
+	      _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);			\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_SQRT);	\
+	      break;							\
+	    }								\
+	  R##_c = FP_CLS_NORMAL;					\
+	  if (X##_e & 1)						\
+	    _FP_FRAC_SLL_##wc (X, 1);					\
+	  R##_e = X##_e >> 1;						\
+	  _FP_FRAC_SET_##wc (_FP_SQRT_S, _FP_ZEROFRAC_##wc);		\
+	  _FP_FRAC_SET_##wc (R, _FP_ZEROFRAC_##wc);			\
+	  _FP_SQRT_q = _FP_OVERFLOW_##fs >> 1;				\
+	  _FP_SQRT_MEAT_##wc (R, _FP_SQRT_S, _FP_SQRT_T, X,		\
+			      _FP_SQRT_q);				\
+	}								\
     }									\
-  } while (0)
+  while (0)
 
-/*
- * Convert from FP to integer
- */
+/* Convert from FP to integer.  Input is raw.  */
 
 /* RSIGNED can have following values:
- * 0:  the number is required to be 0..(2^rsize)-1, if not, NV is set plus
- *     the result is either 0 or (2^rsize)-1 depending on the sign in such case.
- * 1:  the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not, NV is
- *     set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 depending
- *     on the sign in such case.
- * 2:  the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not, NV is
- *     set plus the result is truncated to fit into destination.
- * -1: the number is required to be -(2^(rsize-1))..(2^rsize)-1, if not, NV is
- *     set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 depending
- *     on the sign in such case.
- */
-#define _FP_TO_INT(fs, wc, r, X, rsize, rsigned)				\
-  do {										\
-    switch (X##_c)								\
-      {										\
-      case FP_CLS_NORMAL:							\
-	if (X##_e < 0)								\
-	  {									\
-	    FP_SET_EXCEPTION(FP_EX_INEXACT);					\
-	  case FP_CLS_ZERO:							\
-	    r = 0;								\
-	  }									\
-	else if (X##_e >= rsize - (rsigned > 0 || X##_s)			\
-		 || (!rsigned && X##_s))					\
-	  {	/* overflow */							\
-	  case FP_CLS_NAN:                                                      \
-	  case FP_CLS_INF:							\
-	    if (rsigned == 2)							\
-	      {									\
-		if (X##_c != FP_CLS_NORMAL					\
-		    || X##_e >= rsize - 1 + _FP_WFRACBITS_##fs)			\
-		  r = 0;							\
-		else								\
-		  {								\
-		    _FP_FRAC_SLL_##wc(X, (X##_e - _FP_WFRACBITS_##fs + 1));	\
-		    _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);			\
-		  }								\
-	      }									\
-	    else if (rsigned)							\
-	      {									\
-		r = 1;								\
-		r <<= rsize - 1;						\
-		r -= 1 - X##_s;							\
-	      }									\
-	    else								\
-	      {									\
-		r = 0;								\
-		if (!X##_s)							\
-		  r = ~r;							\
-	      }									\
-	    FP_SET_EXCEPTION(FP_EX_INVALID);					\
-	  }									\
-	else									\
-	  {									\
-	    if (_FP_W_TYPE_SIZE*wc < rsize)					\
-	      {									\
-		_FP_FRAC_ASSEMBLE_##wc(r, X, rsize);				\
-		r <<= X##_e - _FP_WFRACBITS_##fs;				\
-	      }									\
-	    else								\
-	      {									\
-		if (X##_e >= _FP_WFRACBITS_##fs)				\
-		  _FP_FRAC_SLL_##wc(X, (X##_e - _FP_WFRACBITS_##fs + 1));	\
-		else if (X##_e < _FP_WFRACBITS_##fs - 1)			\
-		  {								\
-		    _FP_FRAC_SRS_##wc(X, (_FP_WFRACBITS_##fs - X##_e - 2),	\
-				      _FP_WFRACBITS_##fs);			\
-		    if (_FP_FRAC_LOW_##wc(X) & 1)				\
-		      FP_SET_EXCEPTION(FP_EX_INEXACT);				\
-		    _FP_FRAC_SRL_##wc(X, 1);					\
-		  }								\
-		_FP_FRAC_ASSEMBLE_##wc(r, X, rsize);				\
-	      }									\
-	    if (rsigned && X##_s)						\
-	      r = -r;								\
-	  }									\
-	break;									\
-      }										\
-  } while (0)
-
-#define _FP_TO_INT_ROUND(fs, wc, r, X, rsize, rsigned)				\
-  do {										\
-    r = 0;									\
-    switch (X##_c)								\
-      {										\
-      case FP_CLS_NORMAL:							\
-	if (X##_e >= _FP_FRACBITS_##fs - 1)					\
-	  {									\
-	    if (X##_e < rsize - 1 + _FP_WFRACBITS_##fs)				\
-	      {									\
-		if (X##_e >= _FP_WFRACBITS_##fs - 1)				\
-		  {								\
-		    _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);			\
-		    r <<= X##_e - _FP_WFRACBITS_##fs + 1;			\
-		  }								\
-		else								\
-		  {								\
-		    _FP_FRAC_SRL_##wc(X, _FP_WORKBITS - X##_e			\
-				      + _FP_FRACBITS_##fs - 1);			\
-		    _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);			\
-		  }								\
-	      }									\
-	  }									\
-	else									\
-	  {									\
-	    int _lz0, _lz1;							\
-	    if (X##_e <= -_FP_WORKBITS - 1)					\
-	      _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc);				\
-	    else								\
-	      _FP_FRAC_SRS_##wc(X, _FP_FRACBITS_##fs - 1 - X##_e,		\
-				_FP_WFRACBITS_##fs);				\
-	    _FP_FRAC_CLZ_##wc(_lz0, X);						\
-	    _FP_ROUND(wc, X);							\
-	    _FP_FRAC_CLZ_##wc(_lz1, X);						\
-	    if (_lz1 < _lz0)							\
-	      X##_e++; /* For overflow detection.  */				\
-	    _FP_FRAC_SRL_##wc(X, _FP_WORKBITS);					\
-	    _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);				\
-	  }									\
-	if (rsigned && X##_s)							\
-	  r = -r;								\
-	if (X##_e >= rsize - (rsigned > 0 || X##_s)				\
-	    || (!rsigned && X##_s))						\
-	  {	/* overflow */							\
-	  case FP_CLS_NAN:                                                      \
-	  case FP_CLS_INF:							\
-	    if (!rsigned)							\
-	      {									\
-		r = 0;								\
-		if (!X##_s)							\
-		  r = ~r;							\
-	      }									\
-	    else if (rsigned != 2)						\
-	      {									\
-		r = 1;								\
-		r <<= rsize - 1;						\
-		r -= 1 - X##_s;							\
-	      }									\
-	    FP_SET_EXCEPTION(FP_EX_INVALID);					\
-	  }									\
-	break;									\
-      case FP_CLS_ZERO:								\
-        break;									\
-      }										\
-  } while (0)
+   0:  the number is required to be 0..(2^rsize)-1, if not, NV is set plus
+       the result is either 0 or (2^rsize)-1 depending on the sign in such
+       case.
+   1:  the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not,
+       NV is set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1
+       depending on the sign in such case.
+   2:  the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not,
+       NV is set plus the result is reduced modulo 2^rsize.
+   -1: the number is required to be -(2^(rsize-1))..(2^rsize)-1, if not, NV is
+       set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1
+       depending on the sign in such case.  */
+#define _FP_TO_INT(fs, wc, r, X, rsize, rsigned)			\
+  do									\
+    {									\
+      if (X##_e < _FP_EXPBIAS_##fs)					\
+	{								\
+	  (r) = 0;							\
+	  if (X##_e == 0)						\
+	    {								\
+	      if (!_FP_FRAC_ZEROP_##wc (X))				\
+		{							\
+		  if (!FP_DENORM_ZERO)					\
+		    FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		}							\
+	    }								\
+	  else								\
+	    FP_SET_EXCEPTION (FP_EX_INEXACT);				\
+	}								\
+      else if ((rsigned) == 2						\
+	       && (X##_e						\
+		   >= ((_FP_EXPMAX_##fs					\
+			< _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs + (rsize) - 1) \
+		       ? _FP_EXPMAX_##fs				\
+		       : _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs + (rsize) - 1))) \
+	{								\
+	  /* Overflow resulting in 0.  */				\
+	  (r) = 0;							\
+	  FP_SET_EXCEPTION (FP_EX_INVALID				\
+			    | FP_EX_INVALID_CVI				\
+			    | ((FP_EX_INVALID_SNAN			\
+				&& _FP_ISSIGNAN (fs, wc, X))		\
+			       ? FP_EX_INVALID_SNAN			\
+			       : 0));					\
+	}								\
+      else if ((rsigned) != 2						\
+	       && (X##_e >= (_FP_EXPMAX_##fs < _FP_EXPBIAS_##fs + (rsize) \
+			     ? _FP_EXPMAX_##fs				\
+			     : (_FP_EXPBIAS_##fs + (rsize)		\
+				- ((rsigned) > 0 || X##_s)))		\
+		   || (!(rsigned) && X##_s)))				\
+	{								\
+	  /* Overflow or converting to the most negative integer.  */	\
+	  if (rsigned)							\
+	    {								\
+	      (r) = 1;							\
+	      (r) <<= (rsize) - 1;					\
+	      (r) -= 1 - X##_s;						\
+	    }								\
+	  else								\
+	    {								\
+	      (r) = 0;							\
+	      if (!X##_s)						\
+		(r) = ~(r);						\
+	    }								\
+									\
+	  if (_FP_EXPBIAS_##fs + (rsize) - 1 < _FP_EXPMAX_##fs		\
+	      && (rsigned)						\
+	      && X##_s							\
+	      && X##_e == _FP_EXPBIAS_##fs + (rsize) - 1)		\
+	    {								\
+	      /* Possibly converting to most negative integer; check the \
+		 mantissa.  */						\
+	      int _FP_TO_INT_inexact = 0;				\
+	      (void) ((_FP_FRACBITS_##fs > (rsize))			\
+		      ? ({						\
+			  _FP_FRAC_SRST_##wc (X, _FP_TO_INT_inexact,	\
+					      _FP_FRACBITS_##fs - (rsize), \
+					      _FP_FRACBITS_##fs);	\
+			  0;						\
+			})						\
+		      : 0);						\
+	      if (!_FP_FRAC_ZEROP_##wc (X))				\
+		FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+	      else if (_FP_TO_INT_inexact)				\
+		FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+	    }								\
+	  else								\
+	    FP_SET_EXCEPTION (FP_EX_INVALID				\
+			      | FP_EX_INVALID_CVI			\
+			      | ((FP_EX_INVALID_SNAN			\
+				  && _FP_ISSIGNAN (fs, wc, X))		\
+				 ? FP_EX_INVALID_SNAN			\
+				 : 0));					\
+	}								\
+      else								\
+	{								\
+	  int _FP_TO_INT_inexact = 0;					\
+	  _FP_FRAC_HIGH_RAW_##fs (X) |= _FP_IMPLBIT_##fs;		\
+	  if (X##_e >= _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs - 1)	\
+	    {								\
+	      _FP_FRAC_ASSEMBLE_##wc ((r), X, (rsize));			\
+	      (r) <<= X##_e - _FP_EXPBIAS_##fs - _FP_FRACBITS_##fs + 1; \
+	    }								\
+	  else								\
+	    {								\
+	      _FP_FRAC_SRST_##wc (X, _FP_TO_INT_inexact,		\
+				  (_FP_FRACBITS_##fs + _FP_EXPBIAS_##fs - 1 \
+				   - X##_e),				\
+				  _FP_FRACBITS_##fs);			\
+	      _FP_FRAC_ASSEMBLE_##wc ((r), X, (rsize));			\
+	    }								\
+	  if ((rsigned) && X##_s)					\
+	    (r) = -(r);							\
+	  if ((rsigned) == 2 && X##_e >= _FP_EXPBIAS_##fs + (rsize) - 1) \
+	    {								\
+	      /* Overflow or converting to the most negative integer.  */ \
+	      if (X##_e > _FP_EXPBIAS_##fs + (rsize) - 1		\
+		  || !X##_s						\
+		  || (r) != (((typeof (r)) 1) << ((rsize) - 1)))	\
+		{							\
+		  _FP_TO_INT_inexact = 0;				\
+		  FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+		}							\
+	    }								\
+	  if (_FP_TO_INT_inexact)					\
+	    FP_SET_EXCEPTION (FP_EX_INEXACT);				\
+	}								\
+    }									\
+  while (0)
+
+/* Convert from floating point to integer, rounding according to the
+   current rounding direction.  Input is raw.  RSIGNED is as for
+   _FP_TO_INT.  */
+#define _FP_TO_INT_ROUND(fs, wc, r, X, rsize, rsigned)			\
+  do									\
+    {									\
+      __label__ _FP_TO_INT_ROUND_done;					\
+      if (X##_e < _FP_EXPBIAS_##fs)					\
+	{								\
+	  int _FP_TO_INT_ROUND_rounds_away = 0;				\
+	  if (X##_e == 0)						\
+	    {								\
+	      if (_FP_FRAC_ZEROP_##wc (X))				\
+		{							\
+		  (r) = 0;						\
+		  goto _FP_TO_INT_ROUND_done;				\
+		}							\
+	      else							\
+		{							\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		  if (FP_DENORM_ZERO)					\
+		    {							\
+		      (r) = 0;						\
+		      goto _FP_TO_INT_ROUND_done;			\
+		    }							\
+		}							\
+	    }								\
+	  /* The result is 0, 1 or -1 depending on the rounding mode;	\
+	     -1 may cause overflow in the unsigned case.  */		\
+	  switch (FP_ROUNDMODE)						\
+	    {								\
+	    case FP_RND_NEAREST:					\
+	      _FP_TO_INT_ROUND_rounds_away				\
+		= (X##_e == _FP_EXPBIAS_##fs - 1			\
+		   && !_FP_FRAC_ZEROP_##wc (X));			\
+	      break;							\
+	    case FP_RND_ZERO:						\
+	      /* _FP_TO_INT_ROUND_rounds_away is already 0.  */		\
+	      break;							\
+	    case FP_RND_PINF:						\
+	      _FP_TO_INT_ROUND_rounds_away = !X##_s;			\
+	      break;							\
+	    case FP_RND_MINF:						\
+	      _FP_TO_INT_ROUND_rounds_away = X##_s;			\
+	      break;							\
+	    }								\
+	  if ((rsigned) == 0 && _FP_TO_INT_ROUND_rounds_away && X##_s)	\
+	    {								\
+	      /* Result of -1 for an unsigned conversion.  */		\
+	      (r) = 0;							\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+	    }								\
+	  else if ((rsize) == 1 && (rsigned) > 0			\
+		   && _FP_TO_INT_ROUND_rounds_away && !X##_s)		\
+	    {								\
+	      /* Converting to a 1-bit signed bit-field, which cannot	\
+		 represent +1.  */					\
+	      (r) = ((rsigned) == 2 ? -1 : 0);				\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+	    }								\
+	  else								\
+	    {								\
+	      (r) = (_FP_TO_INT_ROUND_rounds_away			\
+		     ? (X##_s ? -1 : 1)					\
+		     : 0);						\
+	      FP_SET_EXCEPTION (FP_EX_INEXACT);				\
+	    }								\
+	}								\
+      else if ((rsigned) == 2						\
+	       && (X##_e						\
+		   >= ((_FP_EXPMAX_##fs					\
+			< _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs + (rsize) - 1) \
+		       ? _FP_EXPMAX_##fs				\
+		       : _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs + (rsize) - 1))) \
+	{								\
+	  /* Overflow resulting in 0.  */				\
+	  (r) = 0;							\
+	  FP_SET_EXCEPTION (FP_EX_INVALID				\
+			    | FP_EX_INVALID_CVI				\
+			    | ((FP_EX_INVALID_SNAN			\
+				&& _FP_ISSIGNAN (fs, wc, X))		\
+			       ? FP_EX_INVALID_SNAN			\
+			       : 0));					\
+	}								\
+      else if ((rsigned) != 2						\
+	       && (X##_e >= (_FP_EXPMAX_##fs < _FP_EXPBIAS_##fs + (rsize) \
+			     ? _FP_EXPMAX_##fs				\
+			     : (_FP_EXPBIAS_##fs + (rsize)		\
+				- ((rsigned) > 0 && !X##_s)))		\
+		   || ((rsigned) == 0 && X##_s)))			\
+	{								\
+	  /* Definite overflow (does not require rounding to tell).  */	\
+	  if ((rsigned) != 0)						\
+	    {								\
+	      (r) = 1;							\
+	      (r) <<= (rsize) - 1;					\
+	      (r) -= 1 - X##_s;						\
+	    }								\
+	  else								\
+	    {								\
+	      (r) = 0;							\
+	      if (!X##_s)						\
+		(r) = ~(r);						\
+	    }								\
+									\
+	  FP_SET_EXCEPTION (FP_EX_INVALID				\
+			    | FP_EX_INVALID_CVI				\
+			    | ((FP_EX_INVALID_SNAN			\
+				&& _FP_ISSIGNAN (fs, wc, X))		\
+			       ? FP_EX_INVALID_SNAN			\
+			       : 0));					\
+	}								\
+      else								\
+	{								\
+	  /* The value is finite, with magnitude at least 1.  If	\
+	     the conversion is unsigned, the value is positive.		\
+	     If RSIGNED is not 2, the value does not definitely		\
+	     overflow by virtue of its exponent, but may still turn	\
+	     out to overflow after rounding; if RSIGNED is 2, the	\
+	     exponent may be such that the value definitely overflows,	\
+	     but at least one mantissa bit will not be shifted out.  */ \
+	  int _FP_TO_INT_ROUND_inexact = 0;				\
+	  _FP_FRAC_HIGH_RAW_##fs (X) |= _FP_IMPLBIT_##fs;		\
+	  if (X##_e >= _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs - 1)	\
+	    {								\
+	      /* The value is an integer, no rounding needed.  */	\
+	      _FP_FRAC_ASSEMBLE_##wc ((r), X, (rsize));			\
+	      (r) <<= X##_e - _FP_EXPBIAS_##fs - _FP_FRACBITS_##fs + 1; \
+	    }								\
+	  else								\
+	    {								\
+	      /* May need to shift in order to round (unless there	\
+		 are exactly _FP_WORKBITS fractional bits already).  */	\
+	      int _FP_TO_INT_ROUND_rshift				\
+		= (_FP_FRACBITS_##fs + _FP_EXPBIAS_##fs			\
+		   - 1 - _FP_WORKBITS - X##_e);				\
+	      if (_FP_TO_INT_ROUND_rshift > 0)				\
+		_FP_FRAC_SRS_##wc (X, _FP_TO_INT_ROUND_rshift,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (_FP_TO_INT_ROUND_rshift < 0)			\
+		_FP_FRAC_SLL_##wc (X, -_FP_TO_INT_ROUND_rshift);	\
+	      /* Round like _FP_ROUND, but setting			\
+		 _FP_TO_INT_ROUND_inexact instead of directly setting	\
+		 the "inexact" exception, since it may turn out we	\
+		 should set "invalid" instead.  */			\
+	      if (_FP_FRAC_LOW_##wc (X) & 7)				\
+		{							\
+		  _FP_TO_INT_ROUND_inexact = 1;				\
+		  switch (FP_ROUNDMODE)					\
+		    {							\
+		    case FP_RND_NEAREST:				\
+		      _FP_ROUND_NEAREST (wc, X);			\
+		      break;						\
+		    case FP_RND_ZERO:					\
+		      _FP_ROUND_ZERO (wc, X);				\
+		      break;						\
+		    case FP_RND_PINF:					\
+		      _FP_ROUND_PINF (wc, X);				\
+		      break;						\
+		    case FP_RND_MINF:					\
+		      _FP_ROUND_MINF (wc, X);				\
+		      break;						\
+		    }							\
+		}							\
+	      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);			\
+	      _FP_FRAC_ASSEMBLE_##wc ((r), X, (rsize));			\
+	    }								\
+	  if ((rsigned) != 0 && X##_s)					\
+	    (r) = -(r);							\
+	  /* An exponent of RSIZE - 1 always needs testing for		\
+	     overflow (either directly overflowing, or overflowing	\
+	     when rounding up results in 2^RSIZE).  An exponent of	\
+	     RSIZE - 2 can overflow for positive values when rounding	\
+	     up to 2^(RSIZE-1), but cannot overflow for negative	\
+	     values.  Smaller exponents cannot overflow.  */		\
+	  if (X##_e >= (_FP_EXPBIAS_##fs + (rsize) - 1			\
+			- ((rsigned) > 0 && !X##_s)))			\
+	    {								\
+	      if (X##_e > _FP_EXPBIAS_##fs + (rsize) - 1		\
+		  || (X##_e == _FP_EXPBIAS_##fs + (rsize) - 1		\
+		      && (X##_s						\
+			  ? (r) != (((typeof (r)) 1) << ((rsize) - 1))	\
+			  : ((rsigned) > 0 || (r) == 0)))		\
+		  || ((rsigned) > 0					\
+		      && !X##_s						\
+		      && X##_e == _FP_EXPBIAS_##fs + (rsize) - 2	\
+		      && (r) == (((typeof (r)) 1) << ((rsize) - 1))))	\
+		{							\
+		  if ((rsigned) != 2)					\
+		    {							\
+		      if ((rsigned) != 0)				\
+			{						\
+			  (r) = 1;					\
+			  (r) <<= (rsize) - 1;				\
+			  (r) -= 1 - X##_s;				\
+			}						\
+		      else						\
+			{						\
+			  (r) = 0;					\
+			  (r) = ~(r);					\
+			}						\
+		    }							\
+		  _FP_TO_INT_ROUND_inexact = 0;				\
+		  FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+		}							\
+	    }								\
+	  if (_FP_TO_INT_ROUND_inexact)					\
+	    FP_SET_EXCEPTION (FP_EX_INEXACT);				\
+	}								\
+    _FP_TO_INT_ROUND_done: ;						\
+    }									\
+  while (0)
 
+/* Convert integer to fp.  Output is raw.  RTYPE is unsigned even if
+   input is signed.  */
 #define _FP_FROM_INT(fs, wc, X, r, rsize, rtype)			\
-  do {									\
-    if (r)								\
-      {									\
-        unsigned rtype ur_;						\
-	X##_c = FP_CLS_NORMAL;						\
-									\
-	if ((X##_s = (r < 0)))						\
-	  ur_ = (unsigned rtype) -r;					\
-	else								\
-	  ur_ = (unsigned rtype) r;					\
-	if (rsize <= _FP_W_TYPE_SIZE)					\
-	  __FP_CLZ(X##_e, ur_);						\
-	else								\
-	  __FP_CLZ_2(X##_e, (_FP_W_TYPE)(ur_ >> _FP_W_TYPE_SIZE), 	\
-		     (_FP_W_TYPE)ur_);					\
-	if (rsize < _FP_W_TYPE_SIZE)					\
-		X##_e -= (_FP_W_TYPE_SIZE - rsize);			\
-	X##_e = rsize - X##_e - 1;					\
-									\
-	if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs <= X##_e)	\
-	  __FP_FRAC_SRS_1(ur_, (X##_e - _FP_WFRACBITS_##fs + 1), rsize);\
-	_FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize);			\
-	if ((_FP_WFRACBITS_##fs - X##_e - 1) > 0)			\
-	  _FP_FRAC_SLL_##wc(X, (_FP_WFRACBITS_##fs - X##_e - 1));	\
-      }									\
-    else								\
-      {									\
-	X##_c = FP_CLS_ZERO, X##_s = 0;					\
-      }									\
-  } while (0)
-
-
-#define FP_CONV(dfs,sfs,dwc,swc,D,S)			\
-  do {							\
-    _FP_FRAC_CONV_##dwc##_##swc(dfs, sfs, D, S);	\
-    D##_e = S##_e;					\
-    D##_c = S##_c;					\
-    D##_s = S##_s;					\
-  } while (0)
-
-/*
- * Helper primitives.
- */
+  do									\
+    {									\
+      __label__ pack_semiraw;						\
+      if (r)								\
+	{								\
+	  rtype _FP_FROM_INT_ur;					\
+									\
+	  if ((X##_s = ((r) < 0)))					\
+	    (r) = -(rtype) (r);						\
+									\
+	  _FP_FROM_INT_ur = (rtype) (r);				\
+	  (void) (((rsize) <= _FP_W_TYPE_SIZE)				\
+		  ? ({							\
+		      int _FP_FROM_INT_lz;				\
+		      __FP_CLZ (_FP_FROM_INT_lz,			\
+				(_FP_W_TYPE) _FP_FROM_INT_ur);		\
+		      X##_e = (_FP_EXPBIAS_##fs + _FP_W_TYPE_SIZE - 1	\
+			       - _FP_FROM_INT_lz);			\
+		    })							\
+		  : (((rsize) <= 2 * _FP_W_TYPE_SIZE)			\
+		     ? ({						\
+			 int _FP_FROM_INT_lz;				\
+			 __FP_CLZ_2 (_FP_FROM_INT_lz,			\
+				     (_FP_W_TYPE) (_FP_FROM_INT_ur	\
+						   >> _FP_W_TYPE_SIZE), \
+				     (_FP_W_TYPE) _FP_FROM_INT_ur);	\
+			 X##_e = (_FP_EXPBIAS_##fs + 2 * _FP_W_TYPE_SIZE - 1 \
+				  - _FP_FROM_INT_lz);			\
+		       })						\
+		     : (abort (), 0)));					\
+									\
+	  if ((rsize) - 1 + _FP_EXPBIAS_##fs >= _FP_EXPMAX_##fs		\
+	      && X##_e >= _FP_EXPMAX_##fs)				\
+	    {								\
+	      /* Exponent too big; overflow to infinity.  (May also	\
+		 happen after rounding below.)  */			\
+	      _FP_OVERFLOW_SEMIRAW (fs, wc, X);				\
+	      goto pack_semiraw;					\
+	    }								\
+									\
+	  if ((rsize) <= _FP_FRACBITS_##fs				\
+	      || X##_e < _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs)		\
+	    {								\
+	      /* Exactly representable; shift left.  */			\
+	      _FP_FRAC_DISASSEMBLE_##wc (X, _FP_FROM_INT_ur, (rsize));	\
+	      if (_FP_EXPBIAS_##fs + _FP_FRACBITS_##fs - 1 - X##_e > 0)	\
+		_FP_FRAC_SLL_##wc (X, (_FP_EXPBIAS_##fs			\
+				       + _FP_FRACBITS_##fs - 1 - X##_e)); \
+	    }								\
+	  else								\
+	    {								\
+	      /* More bits in integer than in floating type; need to	\
+		 round.  */						\
+	      if (_FP_EXPBIAS_##fs + _FP_WFRACBITS_##fs - 1 < X##_e)	\
+		_FP_FROM_INT_ur						\
+		  = ((_FP_FROM_INT_ur >> (X##_e - _FP_EXPBIAS_##fs	\
+					  - _FP_WFRACBITS_##fs + 1))	\
+		     | ((_FP_FROM_INT_ur				\
+			 << ((rsize) - (X##_e - _FP_EXPBIAS_##fs	\
+					- _FP_WFRACBITS_##fs + 1)))	\
+			!= 0));						\
+	      _FP_FRAC_DISASSEMBLE_##wc (X, _FP_FROM_INT_ur, (rsize));	\
+	      if ((_FP_EXPBIAS_##fs + _FP_WFRACBITS_##fs - 1 - X##_e) > 0) \
+		_FP_FRAC_SLL_##wc (X, (_FP_EXPBIAS_##fs			\
+				       + _FP_WFRACBITS_##fs - 1 - X##_e)); \
+	      _FP_FRAC_HIGH_##fs (X) &= ~(_FP_W_TYPE) _FP_IMPLBIT_SH_##fs; \
+	    pack_semiraw:						\
+	      _FP_PACK_SEMIRAW (fs, wc, X);				\
+	    }								\
+	}								\
+      else								\
+	{								\
+	  X##_s = 0;							\
+	  X##_e = 0;							\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);			\
+	}								\
+    }									\
+  while (0)
+
+
+/* Extend from a narrower floating-point format to a wider one.  Input
+   and output are raw.  If CHECK_NAN, then signaling NaNs are
+   converted to quiet with the "invalid" exception raised; otherwise
+   signaling NaNs remain signaling with no exception.  */
+#define _FP_EXTEND_CNAN(dfs, sfs, dwc, swc, D, S, check_nan)		\
+  do									\
+    {									\
+      if (_FP_FRACBITS_##dfs < _FP_FRACBITS_##sfs			\
+	  || (_FP_EXPMAX_##dfs - _FP_EXPBIAS_##dfs			\
+	      < _FP_EXPMAX_##sfs - _FP_EXPBIAS_##sfs)			\
+	  || (_FP_EXPBIAS_##dfs < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1 \
+	      && _FP_EXPBIAS_##dfs != _FP_EXPBIAS_##sfs))		\
+	abort ();							\
+      D##_s = S##_s;							\
+      _FP_FRAC_COPY_##dwc##_##swc (D, S);				\
+      if (_FP_EXP_NORMAL (sfs, swc, S))					\
+	{								\
+	  D##_e = S##_e + _FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs;	\
+	  _FP_FRAC_SLL_##dwc (D, (_FP_FRACBITS_##dfs - _FP_FRACBITS_##sfs)); \
+	}								\
+      else								\
+	{								\
+	  if (S##_e == 0)						\
+	    {								\
+	      _FP_CHECK_FLUSH_ZERO (sfs, swc, S);			\
+	      if (_FP_FRAC_ZEROP_##swc (S))				\
+		D##_e = 0;						\
+	      else if (_FP_EXPBIAS_##dfs				\
+		       < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1)	\
+		{							\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		  _FP_FRAC_SLL_##dwc (D, (_FP_FRACBITS_##dfs		\
+					  - _FP_FRACBITS_##sfs));	\
+		  D##_e = 0;						\
+		  if (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)		\
+		    FP_SET_EXCEPTION (FP_EX_UNDERFLOW);			\
+		}							\
+	      else							\
+		{							\
+		  int FP_EXTEND_lz;					\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		  _FP_FRAC_CLZ_##swc (FP_EXTEND_lz, S);			\
+		  _FP_FRAC_SLL_##dwc (D,				\
+				      FP_EXTEND_lz + _FP_FRACBITS_##dfs	\
+				      - _FP_FRACTBITS_##sfs);		\
+		  D##_e = (_FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs + 1	\
+			   + _FP_FRACXBITS_##sfs - FP_EXTEND_lz);	\
+		}							\
+	    }								\
+	  else								\
+	    {								\
+	      D##_e = _FP_EXPMAX_##dfs;					\
+	      if (!_FP_FRAC_ZEROP_##swc (S))				\
+		{							\
+		  if (check_nan && _FP_FRAC_SNANP (sfs, S))		\
+		    FP_SET_EXCEPTION (FP_EX_INVALID			\
+				      | FP_EX_INVALID_SNAN);		\
+		  _FP_FRAC_SLL_##dwc (D, (_FP_FRACBITS_##dfs		\
+					  - _FP_FRACBITS_##sfs));	\
+		  if (check_nan)					\
+		    _FP_SETQNAN (dfs, dwc, D);				\
+		}							\
+	    }								\
+	}								\
+    }									\
+  while (0)
+
+#define FP_EXTEND(dfs, sfs, dwc, swc, D, S)		\
+    _FP_EXTEND_CNAN (dfs, sfs, dwc, swc, D, S, 1)
+
+/* Truncate from a wider floating-point format to a narrower one.
+   Input and output are semi-raw.  */
+#define FP_TRUNC(dfs, sfs, dwc, swc, D, S)				\
+  do									\
+    {									\
+      if (_FP_FRACBITS_##sfs < _FP_FRACBITS_##dfs			\
+	  || (_FP_EXPBIAS_##sfs < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1 \
+	      && _FP_EXPBIAS_##sfs != _FP_EXPBIAS_##dfs))		\
+	abort ();							\
+      D##_s = S##_s;							\
+      if (_FP_EXP_NORMAL (sfs, swc, S))					\
+	{								\
+	  D##_e = S##_e + _FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs;	\
+	  if (D##_e >= _FP_EXPMAX_##dfs)				\
+	    _FP_OVERFLOW_SEMIRAW (dfs, dwc, D);				\
+	  else								\
+	    {								\
+	      if (D##_e <= 0)						\
+		{							\
+		  if (D##_e < 1 - _FP_FRACBITS_##dfs)			\
+		    {							\
+		      _FP_FRAC_SET_##swc (S, _FP_ZEROFRAC_##swc);	\
+		      _FP_FRAC_LOW_##swc (S) |= 1;			\
+		    }							\
+		  else							\
+		    {							\
+		      _FP_FRAC_HIGH_##sfs (S) |= _FP_IMPLBIT_SH_##sfs;	\
+		      _FP_FRAC_SRS_##swc (S, (_FP_WFRACBITS_##sfs	\
+					      - _FP_WFRACBITS_##dfs	\
+					      + 1 - D##_e),		\
+					  _FP_WFRACBITS_##sfs);		\
+		    }							\
+		  D##_e = 0;						\
+		}							\
+	      else							\
+		_FP_FRAC_SRS_##swc (S, (_FP_WFRACBITS_##sfs		\
+					- _FP_WFRACBITS_##dfs),		\
+				    _FP_WFRACBITS_##sfs);		\
+	      _FP_FRAC_COPY_##dwc##_##swc (D, S);			\
+	    }								\
+	}								\
+      else								\
+	{								\
+	  if (S##_e == 0)						\
+	    {								\
+	      _FP_CHECK_FLUSH_ZERO (sfs, swc, S);			\
+	      D##_e = 0;						\
+	      if (_FP_FRAC_ZEROP_##swc (S))				\
+		_FP_FRAC_SET_##dwc (D, _FP_ZEROFRAC_##dwc);		\
+	      else							\
+		{							\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		  if (_FP_EXPBIAS_##sfs					\
+		      < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1)	\
+		    {							\
+		      _FP_FRAC_SRS_##swc (S, (_FP_WFRACBITS_##sfs	\
+					      - _FP_WFRACBITS_##dfs),	\
+					  _FP_WFRACBITS_##sfs);		\
+		      _FP_FRAC_COPY_##dwc##_##swc (D, S);		\
+		    }							\
+		  else							\
+		    {							\
+		      _FP_FRAC_SET_##dwc (D, _FP_ZEROFRAC_##dwc);	\
+		      _FP_FRAC_LOW_##dwc (D) |= 1;			\
+		    }							\
+		}							\
+	    }								\
+	  else								\
+	    {								\
+	      D##_e = _FP_EXPMAX_##dfs;					\
+	      if (_FP_FRAC_ZEROP_##swc (S))				\
+		_FP_FRAC_SET_##dwc (D, _FP_ZEROFRAC_##dwc);		\
+	      else							\
+		{							\
+		  _FP_CHECK_SIGNAN_SEMIRAW (sfs, swc, S);		\
+		  _FP_FRAC_SRL_##swc (S, (_FP_WFRACBITS_##sfs		\
+					  - _FP_WFRACBITS_##dfs));	\
+		  _FP_FRAC_COPY_##dwc##_##swc (D, S);			\
+		  /* Semi-raw NaN must have all workbits cleared.  */	\
+		  _FP_FRAC_LOW_##dwc (D)				\
+		    &= ~(_FP_W_TYPE) ((1 << _FP_WORKBITS) - 1);		\
+		  _FP_SETQNAN_SEMIRAW (dfs, dwc, D);			\
+		}							\
+	    }								\
+	}								\
+    }									\
+  while (0)
+
+/* Helper primitives.  */
 
 /* Count leading zeros in a word.  */
 
 #ifndef __FP_CLZ
-#if _FP_W_TYPE_SIZE < 64
-/* this is just to shut the compiler up about shifts > word length -- PMM 02/1998 */
-#define __FP_CLZ(r, x)				\
-  do {						\
-    _FP_W_TYPE _t = (x);			\
-    r = _FP_W_TYPE_SIZE - 1;			\
-    if (_t > 0xffff) r -= 16;			\
-    if (_t > 0xffff) _t >>= 16;			\
-    if (_t > 0xff) r -= 8;			\
-    if (_t > 0xff) _t >>= 8;			\
-    if (_t & 0xf0) r -= 4;			\
-    if (_t & 0xf0) _t >>= 4;			\
-    if (_t & 0xc) r -= 2;			\
-    if (_t & 0xc) _t >>= 2;			\
-    if (_t & 0x2) r -= 1;			\
-  } while (0)
-#else /* not _FP_W_TYPE_SIZE < 64 */
-#define __FP_CLZ(r, x)				\
-  do {						\
-    _FP_W_TYPE _t = (x);			\
-    r = _FP_W_TYPE_SIZE - 1;			\
-    if (_t > 0xffffffff) r -= 32;		\
-    if (_t > 0xffffffff) _t >>= 32;		\
-    if (_t > 0xffff) r -= 16;			\
-    if (_t > 0xffff) _t >>= 16;			\
-    if (_t > 0xff) r -= 8;			\
-    if (_t > 0xff) _t >>= 8;			\
-    if (_t & 0xf0) r -= 4;			\
-    if (_t & 0xf0) _t >>= 4;			\
-    if (_t & 0xc) r -= 2;			\
-    if (_t & 0xc) _t >>= 2;			\
-    if (_t & 0x2) r -= 1;			\
-  } while (0)
-#endif /* not _FP_W_TYPE_SIZE < 64 */
+/* GCC 3.4 and later provide the builtins for us.  */
+# define __FP_CLZ(r, x)							\
+  do									\
+    {									\
+      if (sizeof (_FP_W_TYPE) == sizeof (unsigned int))			\
+	(r) = __builtin_clz (x);					\
+      else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long))		\
+	(r) = __builtin_clzl (x);					\
+      else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long long))	\
+	(r) = __builtin_clzll (x);					\
+      else								\
+	abort ();							\
+    }									\
+  while (0)
 #endif /* ndef __FP_CLZ */
 
 #define _FP_DIV_HELP_imm(q, r, n, d)		\
-  do {						\
-    q = n / d, r = n % d;			\
-  } while (0)
+  do						\
+    {						\
+      (q) = (n) / (d), (r) = (n) % (d);		\
+    }						\
+  while (0)
+
+
+/* A restoring bit-by-bit division primitive.  */
+
+#define _FP_DIV_MEAT_N_loop(fs, wc, R, X, Y)				\
+  do									\
+    {									\
+      int _FP_DIV_MEAT_N_loop_count = _FP_WFRACBITS_##fs;		\
+      _FP_FRAC_DECL_##wc (_FP_DIV_MEAT_N_loop_u);			\
+      _FP_FRAC_DECL_##wc (_FP_DIV_MEAT_N_loop_v);			\
+      _FP_FRAC_COPY_##wc (_FP_DIV_MEAT_N_loop_u, X);			\
+      _FP_FRAC_COPY_##wc (_FP_DIV_MEAT_N_loop_v, Y);			\
+      _FP_FRAC_SET_##wc (R, _FP_ZEROFRAC_##wc);				\
+      /* Normalize _FP_DIV_MEAT_N_LOOP_U and _FP_DIV_MEAT_N_LOOP_V.  */	\
+      _FP_FRAC_SLL_##wc (_FP_DIV_MEAT_N_loop_u, _FP_WFRACXBITS_##fs);	\
+      _FP_FRAC_SLL_##wc (_FP_DIV_MEAT_N_loop_v, _FP_WFRACXBITS_##fs);	\
+      /* First round.  Since the operands are normalized, either the	\
+	 first or second bit will be set in the fraction.  Produce a	\
+	 normalized result by checking which and adjusting the loop	\
+	 count and exponent accordingly.  */				\
+      if (_FP_FRAC_GE_1 (_FP_DIV_MEAT_N_loop_u, _FP_DIV_MEAT_N_loop_v))	\
+	{								\
+	  _FP_FRAC_SUB_##wc (_FP_DIV_MEAT_N_loop_u,			\
+			     _FP_DIV_MEAT_N_loop_u,			\
+			     _FP_DIV_MEAT_N_loop_v);			\
+	  _FP_FRAC_LOW_##wc (R) |= 1;					\
+	  _FP_DIV_MEAT_N_loop_count--;					\
+	}								\
+      else								\
+	R##_e--;							\
+      /* Subsequent rounds.  */						\
+      do								\
+	{								\
+	  int _FP_DIV_MEAT_N_loop_msb					\
+	    = (_FP_WS_TYPE) _FP_FRAC_HIGH_##wc (_FP_DIV_MEAT_N_loop_u) < 0; \
+	  _FP_FRAC_SLL_##wc (_FP_DIV_MEAT_N_loop_u, 1);			\
+	  _FP_FRAC_SLL_##wc (R, 1);					\
+	  if (_FP_DIV_MEAT_N_loop_msb					\
+	      || _FP_FRAC_GE_1 (_FP_DIV_MEAT_N_loop_u,			\
+				_FP_DIV_MEAT_N_loop_v))			\
+	    {								\
+	      _FP_FRAC_SUB_##wc (_FP_DIV_MEAT_N_loop_u,			\
+				 _FP_DIV_MEAT_N_loop_u,			\
+				 _FP_DIV_MEAT_N_loop_v);		\
+	      _FP_FRAC_LOW_##wc (R) |= 1;				\
+	    }								\
+	}								\
+      while (--_FP_DIV_MEAT_N_loop_count > 0);				\
+      /* If there's anything left in _FP_DIV_MEAT_N_LOOP_U, the result	\
+	 is inexact.  */						\
+      _FP_FRAC_LOW_##wc (R)						\
+	|= !_FP_FRAC_ZEROP_##wc (_FP_DIV_MEAT_N_loop_u);		\
+    }									\
+  while (0)
+
+#define _FP_DIV_MEAT_1_loop(fs, R, X, Y)  _FP_DIV_MEAT_N_loop (fs, 1, R, X, Y)
+#define _FP_DIV_MEAT_2_loop(fs, R, X, Y)  _FP_DIV_MEAT_N_loop (fs, 2, R, X, Y)
+#define _FP_DIV_MEAT_4_loop(fs, R, X, Y)  _FP_DIV_MEAT_N_loop (fs, 4, R, X, Y)
 
 #endif /* __MATH_EMU_OP_COMMON_H__ */
diff --git a/include/math-emu/quad.h b/include/math-emu/quad.h
index 6161136..367c86c 100644
--- a/include/math-emu/quad.h
+++ b/include/math-emu/quad.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Definitions for IEEE Quad Precision.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,31 +8,41 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef  __MATH_EMU_QUAD_H__
 #define  __MATH_EMU_QUAD_H__
 
 #if _FP_W_TYPE_SIZE < 32
-#error "Here's a nickel, kid. Go buy yourself a real computer."
+# error "Here's a nickel, kid. Go buy yourself a real computer."
 #endif
 
 #if _FP_W_TYPE_SIZE < 64
-#define _FP_FRACTBITS_Q         (4*_FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_Q	(4*_FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_DW_Q	(8*_FP_W_TYPE_SIZE)
 #else
-#define _FP_FRACTBITS_Q		(2*_FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_Q		(2*_FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_DW_Q	(4*_FP_W_TYPE_SIZE)
 #endif
 
 #define _FP_FRACBITS_Q		113
@@ -44,164 +54,276 @@
 #define _FP_EXPMAX_Q		32767
 
 #define _FP_QNANBIT_Q		\
-	((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-2) % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_Q-2) % _FP_W_TYPE_SIZE)
+#define _FP_QNANBIT_SH_Q		\
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_Q-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
 #define _FP_IMPLBIT_Q		\
-	((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-1) % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_Q-1) % _FP_W_TYPE_SIZE)
+#define _FP_IMPLBIT_SH_Q		\
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_Q-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
 #define _FP_OVERFLOW_Q		\
-	((_FP_W_TYPE)1 << (_FP_WFRACBITS_Q % _FP_W_TYPE_SIZE))
+	((_FP_W_TYPE) 1 << (_FP_WFRACBITS_Q % _FP_W_TYPE_SIZE))
+
+#define _FP_WFRACBITS_DW_Q	(2 * _FP_WFRACBITS_Q)
+#define _FP_WFRACXBITS_DW_Q	(_FP_FRACTBITS_DW_Q - _FP_WFRACBITS_DW_Q)
+#define _FP_HIGHBIT_DW_Q	\
+  ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_DW_Q - 1) % _FP_W_TYPE_SIZE)
+
+typedef float TFtype __attribute__ ((mode (TF)));
 
 #if _FP_W_TYPE_SIZE < 64
 
 union _FP_UNION_Q
 {
-   long double flt;
-   struct 
-   {
-#if __BYTE_ORDER == __BIG_ENDIAN
-      unsigned sign : 1;
-      unsigned exp : _FP_EXPBITS_Q;
-      unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
-      unsigned long frac2 : _FP_W_TYPE_SIZE;
-      unsigned long frac1 : _FP_W_TYPE_SIZE;
-      unsigned long frac0 : _FP_W_TYPE_SIZE;
-#else
-      unsigned long frac0 : _FP_W_TYPE_SIZE;
-      unsigned long frac1 : _FP_W_TYPE_SIZE;
-      unsigned long frac2 : _FP_W_TYPE_SIZE;
-      unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
-      unsigned exp : _FP_EXPBITS_Q;
-      unsigned sign : 1;
-#endif /* not bigendian */
-   } bits __attribute__((packed));
+  TFtype flt;
+  struct _FP_STRUCT_LAYOUT
+  {
+# if __BYTE_ORDER == __BIG_ENDIAN
+    unsigned sign : 1;
+    unsigned exp : _FP_EXPBITS_Q;
+    unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
+    unsigned long frac2 : _FP_W_TYPE_SIZE;
+    unsigned long frac1 : _FP_W_TYPE_SIZE;
+    unsigned long frac0 : _FP_W_TYPE_SIZE;
+# else
+    unsigned long frac0 : _FP_W_TYPE_SIZE;
+    unsigned long frac1 : _FP_W_TYPE_SIZE;
+    unsigned long frac2 : _FP_W_TYPE_SIZE;
+    unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
+    unsigned exp : _FP_EXPBITS_Q;
+    unsigned sign : 1;
+# endif /* not bigendian */
+  } bits __attribute__ ((packed));
 };
 
 
-#define FP_DECL_Q(X)		_FP_DECL(4,X)
-#define FP_UNPACK_RAW_Q(X,val)	_FP_UNPACK_RAW_4(Q,X,val)
-#define FP_UNPACK_RAW_QP(X,val)	_FP_UNPACK_RAW_4_P(Q,X,val)
-#define FP_PACK_RAW_Q(val,X)	_FP_PACK_RAW_4(Q,val,X)
-#define FP_PACK_RAW_QP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_4_P(Q,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_Q(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_4(Q,X,val);		\
-    _FP_UNPACK_CANONICAL(Q,4,X);	\
-  } while (0)
-
-#define FP_UNPACK_QP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_4_P(Q,X,val);	\
-    _FP_UNPACK_CANONICAL(Q,4,X);	\
-  } while (0)
-
-#define FP_PACK_Q(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(Q,4,X);		\
-    _FP_PACK_RAW_4(Q,val,X);		\
-  } while (0)
-
-#define FP_PACK_QP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(Q,4,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_4_P(Q,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN(Q,4,X)
-#define FP_NEG_Q(R,X)			_FP_NEG(Q,4,R,X)
-#define FP_ADD_Q(R,X,Y)			_FP_ADD(Q,4,R,X,Y)
-#define FP_SUB_Q(R,X,Y)			_FP_SUB(Q,4,R,X,Y)
-#define FP_MUL_Q(R,X,Y)			_FP_MUL(Q,4,R,X,Y)
-#define FP_DIV_Q(R,X,Y)			_FP_DIV(Q,4,R,X,Y)
-#define FP_SQRT_Q(R,X)			_FP_SQRT(Q,4,R,X)
-#define _FP_SQRT_MEAT_Q(R,S,T,X,Q)	_FP_SQRT_MEAT_4(R,S,T,X,Q)
-
-#define FP_CMP_Q(r,X,Y,un)	_FP_CMP(Q,4,r,X,Y,un)
-#define FP_CMP_EQ_Q(r,X,Y)	_FP_CMP_EQ(Q,4,r,X,Y)
-
-#define FP_TO_INT_Q(r,X,rsz,rsg)	_FP_TO_INT(Q,4,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_Q(r,X,rsz,rsg)	_FP_TO_INT_ROUND(Q,4,r,X,rsz,rsg)
-#define FP_FROM_INT_Q(X,r,rs,rt)	_FP_FROM_INT(Q,4,X,r,rs,rt)
-
-#define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_4(X)
-#define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_4(X)
+# define FP_DECL_Q(X)		_FP_DECL (4, X)
+# define FP_UNPACK_RAW_Q(X, val)	_FP_UNPACK_RAW_4 (Q, X, (val))
+# define FP_UNPACK_RAW_QP(X, val)	_FP_UNPACK_RAW_4_P (Q, X, (val))
+# define FP_PACK_RAW_Q(val, X)	_FP_PACK_RAW_4 (Q, (val), X)
+# define FP_PACK_RAW_QP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_4_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_Q(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_4 (Q, X, (val));		\
+      _FP_UNPACK_CANONICAL (Q, 4, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_QP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_4_P (Q, X, (val));		\
+      _FP_UNPACK_CANONICAL (Q, 4, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_Q(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_4 (Q, X, (val));		\
+      _FP_UNPACK_SEMIRAW (Q, 4, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_QP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_4_P (Q, X, (val));		\
+      _FP_UNPACK_SEMIRAW (Q, 4, X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_Q(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (Q, 4, X);		\
+      _FP_PACK_RAW_4 (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_QP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (Q, 4, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_4_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_Q(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (Q, 4, X);		\
+      _FP_PACK_RAW_4 (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_QP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (Q, 4, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_4_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN (Q, 4, X)
+# define FP_NEG_Q(R, X)			_FP_NEG (Q, 4, R, X)
+# define FP_ADD_Q(R, X, Y)		_FP_ADD (Q, 4, R, X, Y)
+# define FP_SUB_Q(R, X, Y)		_FP_SUB (Q, 4, R, X, Y)
+# define FP_MUL_Q(R, X, Y)		_FP_MUL (Q, 4, R, X, Y)
+# define FP_DIV_Q(R, X, Y)		_FP_DIV (Q, 4, R, X, Y)
+# define FP_SQRT_Q(R, X)		_FP_SQRT (Q, 4, R, X)
+# define _FP_SQRT_MEAT_Q(R, S, T, X, Q)	_FP_SQRT_MEAT_4 (R, S, T, X, (Q))
+# define FP_FMA_Q(R, X, Y, Z)		_FP_FMA (Q, 4, 8, R, X, Y, Z)
+
+# define FP_CMP_Q(r, X, Y, un, ex)	_FP_CMP (Q, 4, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_Q(r, X, Y, ex)	_FP_CMP_EQ (Q, 4, (r), X, Y, (ex))
+# define FP_CMP_UNORD_Q(r, X, Y, ex)	_FP_CMP_UNORD (Q, 4, (r), X, Y, (ex))
+
+# define FP_TO_INT_Q(r, X, rsz, rsg)	_FP_TO_INT (Q, 4, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_Q(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (Q, 4, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_Q(X, r, rs, rt)	_FP_FROM_INT (Q, 4, X, (r), (rs), rt)
+
+# define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_4 (X)
+# define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_4 (X)
+
+# define _FP_FRAC_HIGH_DW_Q(X)	_FP_FRAC_HIGH_8 (X)
 
 #else   /* not _FP_W_TYPE_SIZE < 64 */
 union _FP_UNION_Q
 {
-  long double flt /* __attribute__((mode(TF))) */ ;
-  struct {
-#if __BYTE_ORDER == __BIG_ENDIAN
-    unsigned sign  : 1;
-    unsigned exp   : _FP_EXPBITS_Q;
-    unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
-    unsigned long frac0 : _FP_W_TYPE_SIZE;
-#else
-    unsigned long frac0 : _FP_W_TYPE_SIZE;
-    unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
-    unsigned exp   : _FP_EXPBITS_Q;
-    unsigned sign  : 1;
-#endif
+  TFtype flt /* __attribute__ ((mode (TF))) */ ;
+  struct _FP_STRUCT_LAYOUT
+  {
+    _FP_W_TYPE a, b;
+  } longs;
+  struct _FP_STRUCT_LAYOUT
+  {
+# if __BYTE_ORDER == __BIG_ENDIAN
+    unsigned sign    : 1;
+    unsigned exp     : _FP_EXPBITS_Q;
+    _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
+    _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
+# else
+    _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
+    _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
+    unsigned exp     : _FP_EXPBITS_Q;
+    unsigned sign    : 1;
+# endif
   } bits;
 };
 
-#define FP_DECL_Q(X)		_FP_DECL(2,X)
-#define FP_UNPACK_RAW_Q(X,val)	_FP_UNPACK_RAW_2(Q,X,val)
-#define FP_UNPACK_RAW_QP(X,val)	_FP_UNPACK_RAW_2_P(Q,X,val)
-#define FP_PACK_RAW_Q(val,X)	_FP_PACK_RAW_2(Q,val,X)
-#define FP_PACK_RAW_QP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_2_P(Q,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_Q(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_2(Q,X,val);		\
-    _FP_UNPACK_CANONICAL(Q,2,X);	\
-  } while (0)
-
-#define FP_UNPACK_QP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_2_P(Q,X,val);	\
-    _FP_UNPACK_CANONICAL(Q,2,X);	\
-  } while (0)
-
-#define FP_PACK_Q(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(Q,2,X);		\
-    _FP_PACK_RAW_2(Q,val,X);		\
-  } while (0)
-
-#define FP_PACK_QP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(Q,2,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_2_P(Q,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN(Q,2,X)
-#define FP_NEG_Q(R,X)			_FP_NEG(Q,2,R,X)
-#define FP_ADD_Q(R,X,Y)			_FP_ADD(Q,2,R,X,Y)
-#define FP_SUB_Q(R,X,Y)			_FP_SUB(Q,2,R,X,Y)
-#define FP_MUL_Q(R,X,Y)			_FP_MUL(Q,2,R,X,Y)
-#define FP_DIV_Q(R,X,Y)			_FP_DIV(Q,2,R,X,Y)
-#define FP_SQRT_Q(R,X)			_FP_SQRT(Q,2,R,X)
-#define _FP_SQRT_MEAT_Q(R,S,T,X,Q)	_FP_SQRT_MEAT_2(R,S,T,X,Q)
-
-#define FP_CMP_Q(r,X,Y,un)	_FP_CMP(Q,2,r,X,Y,un)
-#define FP_CMP_EQ_Q(r,X,Y)	_FP_CMP_EQ(Q,2,r,X,Y)
-
-#define FP_TO_INT_Q(r,X,rsz,rsg)	_FP_TO_INT(Q,2,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_Q(r,X,rsz,rsg)	_FP_TO_INT_ROUND(Q,2,r,X,rsz,rsg)
-#define FP_FROM_INT_Q(X,r,rs,rt)	_FP_FROM_INT(Q,2,X,r,rs,rt)
-
-#define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_2(X)
-#define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_2(X)
+# define FP_DECL_Q(X)		_FP_DECL (2, X)
+# define FP_UNPACK_RAW_Q(X, val)	_FP_UNPACK_RAW_2 (Q, X, (val))
+# define FP_UNPACK_RAW_QP(X, val)	_FP_UNPACK_RAW_2_P (Q, X, (val))
+# define FP_PACK_RAW_Q(val, X)	_FP_PACK_RAW_2 (Q, (val), X)
+# define FP_PACK_RAW_QP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_Q(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2 (Q, X, (val));		\
+      _FP_UNPACK_CANONICAL (Q, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_QP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2_P (Q, X, (val));		\
+      _FP_UNPACK_CANONICAL (Q, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_Q(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2 (Q, X, (val));		\
+      _FP_UNPACK_SEMIRAW (Q, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_QP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2_P (Q, X, (val));		\
+      _FP_UNPACK_SEMIRAW (Q, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_Q(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (Q, 2, X);		\
+      _FP_PACK_RAW_2 (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_QP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (Q, 2, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_Q(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (Q, 2, X);		\
+      _FP_PACK_RAW_2 (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_QP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (Q, 2, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN (Q, 2, X)
+# define FP_NEG_Q(R, X)			_FP_NEG (Q, 2, R, X)
+# define FP_ADD_Q(R, X, Y)		_FP_ADD (Q, 2, R, X, Y)
+# define FP_SUB_Q(R, X, Y)		_FP_SUB (Q, 2, R, X, Y)
+# define FP_MUL_Q(R, X, Y)		_FP_MUL (Q, 2, R, X, Y)
+# define FP_DIV_Q(R, X, Y)		_FP_DIV (Q, 2, R, X, Y)
+# define FP_SQRT_Q(R, X)		_FP_SQRT (Q, 2, R, X)
+# define _FP_SQRT_MEAT_Q(R, S, T, X, Q)	_FP_SQRT_MEAT_2 (R, S, T, X, (Q))
+# define FP_FMA_Q(R, X, Y, Z)		_FP_FMA (Q, 2, 4, R, X, Y, Z)
+
+# define FP_CMP_Q(r, X, Y, un, ex)	_FP_CMP (Q, 2, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_Q(r, X, Y, ex)	_FP_CMP_EQ (Q, 2, (r), X, Y, (ex))
+# define FP_CMP_UNORD_Q(r, X, Y, ex)	_FP_CMP_UNORD (Q, 2, (r), X, Y, (ex))
+
+# define FP_TO_INT_Q(r, X, rsz, rsg)	_FP_TO_INT (Q, 2, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_Q(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (Q, 2, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_Q(X, r, rs, rt)	_FP_FROM_INT (Q, 2, X, (r), (rs), rt)
+
+# define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_2 (X)
+# define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_2 (X)
+
+# define _FP_FRAC_HIGH_DW_Q(X)	_FP_FRAC_HIGH_4 (X)
 
 #endif /* not _FP_W_TYPE_SIZE < 64 */
 
diff --git a/include/math-emu/single.h b/include/math-emu/single.h
index 87f90b0..9975e00 100644
--- a/include/math-emu/single.h
+++ b/include/math-emu/single.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Definitions for IEEE Single Precision.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,45 +8,71 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef    __MATH_EMU_SINGLE_H__
 #define    __MATH_EMU_SINGLE_H__
 
 #if _FP_W_TYPE_SIZE < 32
-#error "Here's a nickel kid.  Go buy yourself a real computer."
+# error "Here's a nickel kid.  Go buy yourself a real computer."
+#endif
+
+#define _FP_FRACTBITS_S		_FP_W_TYPE_SIZE
+
+#if _FP_W_TYPE_SIZE < 64
+# define _FP_FRACTBITS_DW_S	(2 * _FP_W_TYPE_SIZE)
+#else
+# define _FP_FRACTBITS_DW_S	_FP_W_TYPE_SIZE
 #endif
 
 #define _FP_FRACBITS_S		24
-#define _FP_FRACXBITS_S		(_FP_W_TYPE_SIZE - _FP_FRACBITS_S)
+#define _FP_FRACXBITS_S		(_FP_FRACTBITS_S - _FP_FRACBITS_S)
 #define _FP_WFRACBITS_S		(_FP_WORKBITS + _FP_FRACBITS_S)
-#define _FP_WFRACXBITS_S	(_FP_W_TYPE_SIZE - _FP_WFRACBITS_S)
+#define _FP_WFRACXBITS_S	(_FP_FRACTBITS_S - _FP_WFRACBITS_S)
 #define _FP_EXPBITS_S		8
 #define _FP_EXPBIAS_S		127
 #define _FP_EXPMAX_S		255
-#define _FP_QNANBIT_S		((_FP_W_TYPE)1 << (_FP_FRACBITS_S-2))
-#define _FP_IMPLBIT_S		((_FP_W_TYPE)1 << (_FP_FRACBITS_S-1))
-#define _FP_OVERFLOW_S		((_FP_W_TYPE)1 << (_FP_WFRACBITS_S))
+#define _FP_QNANBIT_S		((_FP_W_TYPE) 1 << (_FP_FRACBITS_S-2))
+#define _FP_QNANBIT_SH_S	((_FP_W_TYPE) 1 << (_FP_FRACBITS_S-2+_FP_WORKBITS))
+#define _FP_IMPLBIT_S		((_FP_W_TYPE) 1 << (_FP_FRACBITS_S-1))
+#define _FP_IMPLBIT_SH_S	((_FP_W_TYPE) 1 << (_FP_FRACBITS_S-1+_FP_WORKBITS))
+#define _FP_OVERFLOW_S		((_FP_W_TYPE) 1 << (_FP_WFRACBITS_S))
+
+#define _FP_WFRACBITS_DW_S	(2 * _FP_WFRACBITS_S)
+#define _FP_WFRACXBITS_DW_S	(_FP_FRACTBITS_DW_S - _FP_WFRACBITS_DW_S)
+#define _FP_HIGHBIT_DW_S	\
+  ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_DW_S - 1) % _FP_W_TYPE_SIZE)
 
 /* The implementation of _FP_MUL_MEAT_S and _FP_DIV_MEAT_S should be
    chosen by the target machine.  */
 
+typedef float SFtype __attribute__ ((mode (SF)));
+
 union _FP_UNION_S
 {
-  float flt;
-  struct {
+  SFtype flt;
+  struct _FP_STRUCT_LAYOUT
+  {
 #if __BYTE_ORDER == __BIG_ENDIAN
     unsigned sign : 1;
     unsigned exp  : _FP_EXPBITS_S;
@@ -56,61 +82,118 @@ union _FP_UNION_S
     unsigned exp  : _FP_EXPBITS_S;
     unsigned sign : 1;
 #endif
-  } bits __attribute__((packed));
+  } bits __attribute__ ((packed));
 };
 
-#define FP_DECL_S(X)		_FP_DECL(1,X)
-#define FP_UNPACK_RAW_S(X,val)	_FP_UNPACK_RAW_1(S,X,val)
-#define FP_UNPACK_RAW_SP(X,val)	_FP_UNPACK_RAW_1_P(S,X,val)
-#define FP_PACK_RAW_S(val,X)	_FP_PACK_RAW_1(S,val,X)
-#define FP_PACK_RAW_SP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_1_P(S,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_S(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_1(S,X,val);		\
-    _FP_UNPACK_CANONICAL(S,1,X);	\
-  } while (0)
-
-#define FP_UNPACK_SP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_1_P(S,X,val);	\
-    _FP_UNPACK_CANONICAL(S,1,X);	\
-  } while (0)
-
-#define FP_PACK_S(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(S,1,X);		\
-    _FP_PACK_RAW_1(S,val,X);		\
-  } while (0)
-
-#define FP_PACK_SP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(S,1,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_1_P(S,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_S(X)		_FP_ISSIGNAN(S,1,X)
-#define FP_NEG_S(R,X)			_FP_NEG(S,1,R,X)
-#define FP_ADD_S(R,X,Y)			_FP_ADD(S,1,R,X,Y)
-#define FP_SUB_S(R,X,Y)			_FP_SUB(S,1,R,X,Y)
-#define FP_MUL_S(R,X,Y)			_FP_MUL(S,1,R,X,Y)
-#define FP_DIV_S(R,X,Y)			_FP_DIV(S,1,R,X,Y)
-#define FP_SQRT_S(R,X)			_FP_SQRT(S,1,R,X)
-#define _FP_SQRT_MEAT_S(R,S,T,X,Q)	_FP_SQRT_MEAT_1(R,S,T,X,Q)
-
-#define FP_CMP_S(r,X,Y,un)	_FP_CMP(S,1,r,X,Y,un)
-#define FP_CMP_EQ_S(r,X,Y)	_FP_CMP_EQ(S,1,r,X,Y)
-
-#define FP_TO_INT_S(r,X,rsz,rsg)	_FP_TO_INT(S,1,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_S(r,X,rsz,rsg)	_FP_TO_INT_ROUND(S,1,r,X,rsz,rsg)
-#define FP_FROM_INT_S(X,r,rs,rt)	_FP_FROM_INT(S,1,X,r,rs,rt)
-
-#define _FP_FRAC_HIGH_S(X)	_FP_FRAC_HIGH_1(X)
-#define _FP_FRAC_HIGH_RAW_S(X)	_FP_FRAC_HIGH_1(X)
+#define FP_DECL_S(X)		_FP_DECL (1, X)
+#define FP_UNPACK_RAW_S(X, val)	_FP_UNPACK_RAW_1 (S, X, (val))
+#define FP_UNPACK_RAW_SP(X, val)	_FP_UNPACK_RAW_1_P (S, X, (val))
+#define FP_PACK_RAW_S(val, X)	_FP_PACK_RAW_1 (S, (val), X)
+#define FP_PACK_RAW_SP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_UNPACK_S(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1 (S, X, (val));		\
+      _FP_UNPACK_CANONICAL (S, 1, X);		\
+    }						\
+  while (0)
+
+#define FP_UNPACK_SP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1_P (S, X, (val));		\
+      _FP_UNPACK_CANONICAL (S, 1, X);		\
+    }						\
+  while (0)
+
+#define FP_UNPACK_SEMIRAW_S(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1 (S, X, (val));		\
+      _FP_UNPACK_SEMIRAW (S, 1, X);		\
+    }						\
+  while (0)
+
+#define FP_UNPACK_SEMIRAW_SP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1_P (S, X, (val));		\
+      _FP_UNPACK_SEMIRAW (S, 1, X);		\
+    }						\
+  while (0)
+
+#define FP_PACK_S(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (S, 1, X);		\
+      _FP_PACK_RAW_1 (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_PACK_SP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (S, 1, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_PACK_SEMIRAW_S(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (S, 1, X);		\
+      _FP_PACK_RAW_1 (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_PACK_SEMIRAW_SP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (S, 1, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_ISSIGNAN_S(X)		_FP_ISSIGNAN (S, 1, X)
+#define FP_NEG_S(R, X)			_FP_NEG (S, 1, R, X)
+#define FP_ADD_S(R, X, Y)		_FP_ADD (S, 1, R, X, Y)
+#define FP_SUB_S(R, X, Y)		_FP_SUB (S, 1, R, X, Y)
+#define FP_MUL_S(R, X, Y)		_FP_MUL (S, 1, R, X, Y)
+#define FP_DIV_S(R, X, Y)		_FP_DIV (S, 1, R, X, Y)
+#define FP_SQRT_S(R, X)			_FP_SQRT (S, 1, R, X)
+#define _FP_SQRT_MEAT_S(R, S, T, X, Q)	_FP_SQRT_MEAT_1 (R, S, T, X, (Q))
+
+#if _FP_W_TYPE_SIZE < 64
+# define FP_FMA_S(R, X, Y, Z)	_FP_FMA (S, 1, 2, R, X, Y, Z)
+#else
+# define FP_FMA_S(R, X, Y, Z)	_FP_FMA (S, 1, 1, R, X, Y, Z)
+#endif
+
+#define FP_CMP_S(r, X, Y, un, ex)	_FP_CMP (S, 1, (r), X, Y, (un), (ex))
+#define FP_CMP_EQ_S(r, X, Y, ex)	_FP_CMP_EQ (S, 1, (r), X, Y, (ex))
+#define FP_CMP_UNORD_S(r, X, Y, ex)	_FP_CMP_UNORD (S, 1, (r), X, Y, (ex))
+
+#define FP_TO_INT_S(r, X, rsz, rsg)	_FP_TO_INT (S, 1, (r), X, (rsz), (rsg))
+#define FP_TO_INT_ROUND_S(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (S, 1, (r), X, (rsz), (rsg))
+#define FP_FROM_INT_S(X, r, rs, rt)	_FP_FROM_INT (S, 1, X, (r), (rs), rt)
+
+#define _FP_FRAC_HIGH_S(X)	_FP_FRAC_HIGH_1 (X)
+#define _FP_FRAC_HIGH_RAW_S(X)	_FP_FRAC_HIGH_1 (X)
+
+#if _FP_W_TYPE_SIZE < 64
+# define _FP_FRAC_HIGH_DW_S(X)	_FP_FRAC_HIGH_2 (X)
+#else
+# define _FP_FRAC_HIGH_DW_S(X)	_FP_FRAC_HIGH_1 (X)
+#endif
 
 #endif /* __MATH_EMU_SINGLE_H__ */
diff --git a/include/math-emu/soft-fp.h b/include/math-emu/soft-fp.h
index 3f284bc..2283dcd 100644
--- a/include/math-emu/soft-fp.h
+++ b/include/math-emu/soft-fp.h
@@ -1,5 +1,5 @@
 /* Software floating-point emulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -7,201 +7,329 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_SOFT_FP_H__
 #define __MATH_EMU_SOFT_FP_H__
 
-#include <asm/sfp-machine.h>
+#ifdef _LIBC
+# include <sfp-machine.h>
+#elif defined __KERNEL__
+# include <asm/sfp-machine.h>
+#else
+# include "sfp-machine.h"
+#endif
 
-/* Allow sfp-machine to have its own byte order definitions. */
+/* Allow sfp-machine to have its own byte order definitions.  */
 #ifndef __BYTE_ORDER
-#include <endian.h>
+# ifdef _LIBC
+#  include <endian.h>
+# else
+#  error "endianness not defined by sfp-machine.h"
+# endif
 #endif
 
 #define _FP_WORKBITS		3
-#define _FP_WORK_LSB		((_FP_W_TYPE)1 << 3)
-#define _FP_WORK_ROUND		((_FP_W_TYPE)1 << 2)
-#define _FP_WORK_GUARD		((_FP_W_TYPE)1 << 1)
-#define _FP_WORK_STICKY		((_FP_W_TYPE)1 << 0)
+#define _FP_WORK_LSB		((_FP_W_TYPE) 1 << 3)
+#define _FP_WORK_ROUND		((_FP_W_TYPE) 1 << 2)
+#define _FP_WORK_GUARD		((_FP_W_TYPE) 1 << 1)
+#define _FP_WORK_STICKY		((_FP_W_TYPE) 1 << 0)
 
 #ifndef FP_RND_NEAREST
 # define FP_RND_NEAREST		0
 # define FP_RND_ZERO		1
 # define FP_RND_PINF		2
 # define FP_RND_MINF		3
+#endif
 #ifndef FP_ROUNDMODE
 # define FP_ROUNDMODE		FP_RND_NEAREST
 #endif
-#endif
 
-/* By default don't care about exceptions. */
+/* By default don't care about exceptions.  */
 #ifndef FP_EX_INVALID
-#define FP_EX_INVALID		0
+# define FP_EX_INVALID		0
 #endif
-#ifndef FP_EX_INVALID_SNAN
-#define FP_EX_INVALID_SNAN	0
+#ifndef FP_EX_OVERFLOW
+# define FP_EX_OVERFLOW		0
 #endif
-/* inf - inf */
-#ifndef FP_EX_INVALID_ISI
-#define FP_EX_INVALID_ISI	0
+#ifndef FP_EX_UNDERFLOW
+# define FP_EX_UNDERFLOW	0
 #endif
-/* inf / inf */
-#ifndef FP_EX_INVALID_IDI
-#define FP_EX_INVALID_IDI	0
+#ifndef FP_EX_DIVZERO
+# define FP_EX_DIVZERO		0
 #endif
-/* 0 / 0 */
-#ifndef FP_EX_INVALID_ZDZ
-#define FP_EX_INVALID_ZDZ	0
+#ifndef FP_EX_INEXACT
+# define FP_EX_INEXACT		0
+#endif
+#ifndef FP_EX_DENORM
+# define FP_EX_DENORM		0
 #endif
-/* inf * 0 */
+
+/* Sub-exceptions of "invalid".  */
+/* Signaling NaN operand.  */
+#ifndef FP_EX_INVALID_SNAN
+# define FP_EX_INVALID_SNAN	0
+#endif
+/* Inf * 0.  */
 #ifndef FP_EX_INVALID_IMZ
-#define FP_EX_INVALID_IMZ	0
+# define FP_EX_INVALID_IMZ	0
 #endif
-#ifndef FP_EX_OVERFLOW
-#define FP_EX_OVERFLOW		0
+/* fma (Inf, 0, c).  */
+#ifndef FP_EX_INVALID_IMZ_FMA
+# define FP_EX_INVALID_IMZ_FMA	0
 #endif
-#ifndef FP_EX_UNDERFLOW
-#define FP_EX_UNDERFLOW		
+/* Inf - Inf.  */
+#ifndef FP_EX_INVALID_ISI
+# define FP_EX_INVALID_ISI	0
 #endif
-#ifndef FP_EX_DIVZERO
-#define FP_EX_DIVZERO		0
+/* 0 / 0.  */
+#ifndef FP_EX_INVALID_ZDZ
+# define FP_EX_INVALID_ZDZ	0
 #endif
-#ifndef FP_EX_INEXACT
-#define FP_EX_INEXACT		0
+/* Inf / Inf.  */
+#ifndef FP_EX_INVALID_IDI
+# define FP_EX_INVALID_IDI	0
 #endif
-#ifndef FP_EX_DENORM
-#define FP_EX_DENORM		0
+/* sqrt (negative).  */
+#ifndef FP_EX_INVALID_SQRT
+# define FP_EX_INVALID_SQRT	0
+#endif
+/* Invalid conversion to integer.  */
+#ifndef FP_EX_INVALID_CVI
+# define FP_EX_INVALID_CVI	0
+#endif
+/* Invalid comparison.  */
+#ifndef FP_EX_INVALID_VC
+# define FP_EX_INVALID_VC	0
+#endif
+
+/* _FP_STRUCT_LAYOUT may be defined as an attribute to determine the
+   struct layout variant used for structures where bit-fields are used
+   to access specific parts of binary floating-point numbers.  This is
+   required for systems where the default ABI uses struct layout with
+   differences in how consecutive bit-fields are laid out from the
+   default expected by soft-fp.  */
+#ifndef _FP_STRUCT_LAYOUT
+# define _FP_STRUCT_LAYOUT
 #endif
 
 #ifdef _FP_DECL_EX
-#define FP_DECL_EX					\
+# define FP_DECL_EX					\
   int _fex = 0;						\
   _FP_DECL_EX
 #else
-#define FP_DECL_EX int _fex = 0
+# define FP_DECL_EX int _fex = 0
 #endif
-  
+
+/* Initialize any machine-specific state used in FP_ROUNDMODE,
+   FP_TRAPPING_EXCEPTIONS or FP_HANDLE_EXCEPTIONS.  */
 #ifndef FP_INIT_ROUNDMODE
-#define FP_INIT_ROUNDMODE do {} while (0)
+# define FP_INIT_ROUNDMODE do {} while (0)
+#endif
+
+/* Initialize any machine-specific state used in
+   FP_TRAPPING_EXCEPTIONS or FP_HANDLE_EXCEPTIONS.  */
+#ifndef FP_INIT_TRAPPING_EXCEPTIONS
+# define FP_INIT_TRAPPING_EXCEPTIONS FP_INIT_ROUNDMODE
+#endif
+
+/* Initialize any machine-specific state used in
+   FP_HANDLE_EXCEPTIONS.  */
+#ifndef FP_INIT_EXCEPTIONS
+# define FP_INIT_EXCEPTIONS FP_INIT_TRAPPING_EXCEPTIONS
 #endif
 
 #ifndef FP_HANDLE_EXCEPTIONS
-#define FP_HANDLE_EXCEPTIONS do {} while (0)
+# define FP_HANDLE_EXCEPTIONS do {} while (0)
 #endif
 
-/* By default we never flush denormal input operands to signed zero. */
+/* Whether to flush subnormal inputs to zero with the same sign.  */
 #ifndef FP_DENORM_ZERO
-#define FP_DENORM_ZERO 0
+# define FP_DENORM_ZERO 0
 #endif
 
 #ifndef FP_INHIBIT_RESULTS
 /* By default we write the results always.
- * sfp-machine may override this and e.g.
- * check if some exceptions are unmasked
- * and inhibit it in such a case.
- */
-#define FP_INHIBIT_RESULTS 0
-#endif
-
-#ifndef FP_TRAPPING_EXCEPTIONS
-#define FP_TRAPPING_EXCEPTIONS 0
+   sfp-machine may override this and e.g.
+   check if some exceptions are unmasked
+   and inhibit it in such a case.  */
+# define FP_INHIBIT_RESULTS 0
 #endif
 
 #define FP_SET_EXCEPTION(ex)				\
   _fex |= (ex)
-  
-#define FP_UNSET_EXCEPTION(ex)				\
-  _fex &= ~(ex)
 
 #define FP_CUR_EXCEPTIONS				\
   (_fex)
 
-#define FP_CLEAR_EXCEPTIONS				\
-  _fex = 0
+#ifndef FP_TRAPPING_EXCEPTIONS
+# define FP_TRAPPING_EXCEPTIONS 0
+#endif
+
+/* A file using soft-fp may define FP_NO_EXCEPTIONS before including
+   soft-fp.h to indicate that, although a macro used there could raise
+   exceptions, or do rounding and potentially thereby raise
+   exceptions, for some arguments, for the particular arguments used
+   in that file no exceptions or rounding can occur.  Such a file
+   should not itself use macros relating to handling exceptions and
+   rounding modes; this is only for indirect uses (in particular, in
+   _FP_FROM_INT and the macros it calls).  */
+#ifdef FP_NO_EXCEPTIONS
+
+# undef FP_SET_EXCEPTION
+# define FP_SET_EXCEPTION(ex) do {} while (0)
+
+# undef FP_CUR_EXCEPTIONS
+# define FP_CUR_EXCEPTIONS 0
 
-#define _FP_ROUND_NEAREST(wc, X)			\
-do {							\
-    if ((_FP_FRAC_LOW_##wc(X) & 15) != _FP_WORK_ROUND)	\
-      _FP_FRAC_ADDI_##wc(X, _FP_WORK_ROUND);		\
-} while (0)
+# undef FP_TRAPPING_EXCEPTIONS
+# define FP_TRAPPING_EXCEPTIONS 0
 
-#define _FP_ROUND_ZERO(wc, X)		0
+# undef FP_ROUNDMODE
+# define FP_ROUNDMODE FP_RND_ZERO
+
+# undef _FP_TININESS_AFTER_ROUNDING
+# define _FP_TININESS_AFTER_ROUNDING 0
+
+#endif
+
+/* A file using soft-fp may define FP_NO_EXACT_UNDERFLOW before
+   including soft-fp.h to indicate that, although a macro used there
+   could allow for the case of exact underflow requiring the underflow
+   exception to be raised if traps are enabled, for the particular
+   arguments used in that file no exact underflow can occur.  */
+#ifdef FP_NO_EXACT_UNDERFLOW
+# undef FP_TRAPPING_EXCEPTIONS
+# define FP_TRAPPING_EXCEPTIONS 0
+#endif
+
+#define _FP_ROUND_NEAREST(wc, X)				\
+  do								\
+    {								\
+      if ((_FP_FRAC_LOW_##wc (X) & 15) != _FP_WORK_ROUND)	\
+	_FP_FRAC_ADDI_##wc (X, _FP_WORK_ROUND);			\
+    }								\
+  while (0)
+
+#define _FP_ROUND_ZERO(wc, X)		(void) 0
 
 #define _FP_ROUND_PINF(wc, X)				\
-do {							\
-    if (!X##_s && (_FP_FRAC_LOW_##wc(X) & 7))		\
-      _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB);		\
-} while (0)
+  do							\
+    {							\
+      if (!X##_s && (_FP_FRAC_LOW_##wc (X) & 7))	\
+	_FP_FRAC_ADDI_##wc (X, _FP_WORK_LSB);		\
+    }							\
+  while (0)
 
-#define _FP_ROUND_MINF(wc, X)				\
-do {							\
-    if (X##_s && (_FP_FRAC_LOW_##wc(X) & 7))		\
-      _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB);		\
-} while (0)
+#define _FP_ROUND_MINF(wc, X)			\
+  do						\
+    {						\
+      if (X##_s && (_FP_FRAC_LOW_##wc (X) & 7))	\
+	_FP_FRAC_ADDI_##wc (X, _FP_WORK_LSB);	\
+    }						\
+  while (0)
 
 #define _FP_ROUND(wc, X)			\
-do {						\
-	if (_FP_FRAC_LOW_##wc(X) & 7)		\
-	  FP_SET_EXCEPTION(FP_EX_INEXACT);	\
-	switch (FP_ROUNDMODE)			\
+  do						\
+    {						\
+      if (_FP_FRAC_LOW_##wc (X) & 7)		\
 	{					\
-	  case FP_RND_NEAREST:			\
-	    _FP_ROUND_NEAREST(wc,X);		\
-	    break;				\
-	  case FP_RND_ZERO:			\
-	    _FP_ROUND_ZERO(wc,X);		\
-	    break;				\
-	  case FP_RND_PINF:			\
-	    _FP_ROUND_PINF(wc,X);		\
-	    break;				\
-	  case FP_RND_MINF:			\
-	    _FP_ROUND_MINF(wc,X);		\
-	    break;				\
+	  FP_SET_EXCEPTION (FP_EX_INEXACT);	\
+	  switch (FP_ROUNDMODE)			\
+	    {					\
+	    case FP_RND_NEAREST:		\
+	      _FP_ROUND_NEAREST (wc, X);	\
+	      break;				\
+	    case FP_RND_ZERO:			\
+	      _FP_ROUND_ZERO (wc, X);		\
+	      break;				\
+	    case FP_RND_PINF:			\
+	      _FP_ROUND_PINF (wc, X);		\
+	      break;				\
+	    case FP_RND_MINF:			\
+	      _FP_ROUND_MINF (wc, X);		\
+	      break;				\
+	    }					\
 	}					\
-} while (0)
+    }						\
+  while (0)
 
 #define FP_CLS_NORMAL		0
 #define FP_CLS_ZERO		1
 #define FP_CLS_INF		2
 #define FP_CLS_NAN		3
 
-#define _FP_CLS_COMBINE(x,y)	(((x) << 2) | (y))
+#define _FP_CLS_COMBINE(x, y)	(((x) << 2) | (y))
 
-#include <math-emu/op-1.h>
-#include <math-emu/op-2.h>
-#include <math-emu/op-4.h>
-#include <math-emu/op-8.h>
-#include <math-emu/op-common.h>
+#ifdef __KERNEL__
+# include <math-emu/op-1.h>
+# include <math-emu/op-2.h>
+# include <math-emu/op-4.h>
+# include <math-emu/op-8.h>
+# include <math-emu/op-common.h>
+#else
+# include "op-1.h"
+# include "op-2.h"
+# include "op-4.h"
+# include "op-8.h"
+# include "op-common.h"
+#endif
 
 /* Sigh.  Silly things longlong.h needs.  */
 #define UWtype		_FP_W_TYPE
 #define W_TYPE_SIZE	_FP_W_TYPE_SIZE
 
-typedef int SItype __attribute__((mode(SI)));
-typedef int DItype __attribute__((mode(DI)));
-typedef unsigned int USItype __attribute__((mode(SI)));
-typedef unsigned int UDItype __attribute__((mode(DI)));
+typedef int QItype __attribute__ ((mode (QI)));
+typedef int SItype __attribute__ ((mode (SI)));
+typedef int DItype __attribute__ ((mode (DI)));
+typedef unsigned int UQItype __attribute__ ((mode (QI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef unsigned int UDItype __attribute__ ((mode (DI)));
 #if _FP_W_TYPE_SIZE == 32
-typedef unsigned int UHWtype __attribute__((mode(HI)));
+typedef unsigned int UHWtype __attribute__ ((mode (HI)));
 #elif _FP_W_TYPE_SIZE == 64
 typedef USItype UHWtype;
 #endif
 
+#ifndef CMPtype
+# define CMPtype	int
+#endif
+
+#define SI_BITS		(__CHAR_BIT__ * (int) sizeof (SItype))
+#define DI_BITS		(__CHAR_BIT__ * (int) sizeof (DItype))
+
 #ifndef umul_ppmm
-#include <stdlib/longlong.h>
+# ifdef _LIBC
+#  include <stdlib/longlong.h>
+# else
+#  include "longlong.h"
+# endif
+#endif
+
+#ifdef _LIBC
+# include <stdlib.h>
+#elif !defined __KERNEL__
+extern void abort (void);
 #endif
 
 #endif /* __MATH_EMU_SOFT_FP_H__ */


-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-06 17:25 ` Joseph Myers
  0 siblings, 0 replies; 20+ messages in thread
From: Joseph Myers @ 2015-02-06 17:25 UTC (permalink / raw)
  To: linux-kernel, linux-alpha, linuxppc-dev, linux-s390, linux-sh,
	sparclinux

The include/math-emu code (used for alpha powerpc s390 sh sparc) was
taken from an old version of glibc's soft-fp code around 15 years ago
(in the pre-git era, anyway, and some of the initial code may have
been developed around 1997-9 with a view to being used in both
places).  Since then, there have only been a handful of small changes
in the kernel version, while the glibc version has been extensively
developed, with many bug fixes, performance improvements and
miscellaneous cleanups, and is also now used in libgcc, including for
__float128 on x86_64 since GCC 4.3 (see
<https://ols.fedoraproject.org/GCC/Reprints-2006/sidwell-reprint.pdf>
for more information regarding performance improvements and use in
libgcc).

Thus the kernel version is missing those various improvements and it
would make sense to update it to include them (as was noted back in
2006 <https://sourceware.org/ml/libc-alpha/2006-02/msg00075.html> when
a large group of changes went into glibc).  I believe it also makes
sense to aim to have *exactly* the same code in both places to
simplify future updates of the kernel version.  (And in particular, as
external code imported largely verbatim into the kernel,
include/math-emu has never followed the kernel coding style and it
doesn't make sense for it to do so.)

I made an analysis of what kernel-local changes there were to this
code in <https://sourceware.org/ml/libc-alpha/2013-10/msg00345.html>,
and since then have added the various missing features to the glibc
version so that it is feature-complete regarding features used in the
kernel.  This patch updates the include/math-emu code, and its kernel
users, so that the shared code is the same as glibc's current soft-fp
code, except for the following:

(a) Multiple-include guards.

(b) Initializations in _FP_FRAC_DECL_* and _FP_DECL to avoid warnings
about possible uninitialized use (not appropriate in glibc; relevant
in the kernel because of large functions that do various unpacking,
conditionally, then use the results of unpacking, conditionally, where
it may not be visible to the compiler that variables are only used
after being initialized).

(c) Changes to how soft-fp.h includes other headers.

(d) Disabling the declaration of abort in soft-fp.h.

(c) and (d) are conditional on __KERNEL__, in the expectation that if
this goes into the kernel then those conditionals will go into glibc
and further reduce the differences between the two versions of the
code, and I may also look at how to avoid the differences in (a) and
(b) to make the versions identical; some form of multiple-include
guards could be added to glibc, but maybe not with the same names as
in the kernel; how strict is the kernel about rules for
multiple-include guard naming in imported code?  (Standard glibc
practice would be names such as SOFT_FP_DOUBLE_H, with op-*.h not
having such guards but instead having a #error if SOFT_FP_H, like
installed bits/*.h headers.)

At this point this patch is an RFC rather than yet being ready for
inclusion, because I've only tested it for powerpc (both e500 and
emulation of classic hard float); it's quite likely there are bugs in
the changes for other architectures, quite possibly breaking the
build.  I've also posted it to libc-alpha
<https://sourceware.org/ml/libc-alpha/2015-02/msg00107.html> with a
call for testing and notes on what testing might be appropriate.

The bulk of the changes are updating the code from glibc and a
detailed review of that part probably does not make sense in this
context if you want to aim for the same code in both places.  The
trickier part is the architecture updates for the various API changes
in soft-fp since the version used by the kernel.  The following
changes have occurred in the soft-fp API since the version used in the
kernel and so are addressed in the architecture updates in this patch.
(This list only includes changes relating to features used in the
kernel, not pure new features that aren't relevant to updating
existing code, and not pure bug fixes.)

* <https://sourceware.org/ml/libc-alpha/2006-02/msg00028.html>

  - Semi-raw unpacking is added, as something intermediate between raw
    and cooked unpacking, for efficiency.

  - Addition and subtraction are changed to work on semi-raw values.
    Thus, cooked results of multiplication can't be passed directly
    into addition, as was done in some kernel emulations of fused
    multiply-add, but that isn't a proper fused operation anyway (a
    proper fused operation involves using the unrounded multiplication
    result in twice the input precision, not an intermediate value in
    input precision plus three working bits); the appropriate fix is
    to use the new fused multiply-add support in soft-fp.

  - Conversions from one floating-point type to another now use
    FP_EXTEND (raw) and FP_TRUNC (semi-raw) instead of FP_CONV
    (cooked).  Those operations now deal with quieting signaling NaNs.

  - Conversions from floating-point to integer now use raw inputs, and
    require the integer variable passed to the FP_TO_INT macros to
    have unsigned type.

  - Conversions from integer to floating-point now use raw outputs.

* <https://sourceware.org/ml/libc-alpha/2006-02/msg00044.html>

  - Conversions from integer to floating-point now pass the name of an
    unsigned type to the FP_FROM_INT macros, not a signed type to
    which "unsigned" is added in the macro definition.

* <https://sourceware.org/ml/libc-alpha/2013-04/msg00646.html>

  - soft-fp supports the reversed quiet NaN convention used on MIPS
    and HPPA; sfp-machine.h must define _FP_QNANNEGATEDP (to 0, for
    architectures using the normal convention; to 1, for architectures
    using the MIPS convention).

* <https://sourceware.org/ml/libc-alpha/2013-10/msg00348.html>

  - Negation now works on raw values.

* <https://sourceware.org/ml/libc-alpha/2014-02/msg00068.html>

  - soft-fp now supports after-rounding tininess detection for
    architectures where that is the defined way in which tiny results
    are detected (of the architectures for which the Linux kernel uses
    this code, that's Alpha and SH).  sfp-machine.h must define
    _FP_TININESS_AFTER_ROUNDING to either 0 or 1.

* <https://sourceware.org/ml/libc-alpha/2014-09/msg00411.html>

  - FP_CLEAR_EXCEPTIONS is removed; all uses in the Linux kernel are
    no longer needed as, now unpacking only occurs in the correct
    format, exceptions are already clear at that point.

* <https://sourceware.org/ml/libc-alpha/2014-09/msg00461.html>

  - The FP_CMP macros have an extra argument to specify when
    exceptions should be set (0 for no exception setting, 1 for
    exceptions only for signaling NaNs, 2 for exceptions for all
    NaNs).  In the old version in the kernel, it was necessary for the
    caller to handle all exception setting for comparisons.

* <https://sourceware.org/ml/libc-alpha/2014-09/msg00488.html>

  - FP_DENORM_ZERO does not set "inexact" when flushing to zero, as
    that does not appear to match the documented semantics for either
    of the architectures (Alpha and SH) for which the kernel uses
    FP_DENORM_ZERO.  FP_DENORM_ZERO is also checked for comparisons
    (the documentation for both Alpha and SH is explicit that their
    corresponding control bits do apply to comparisons).

* <https://sourceware.org/ml/libc-alpha/2014-09/msg00462.html>

  - The more precise FP_EX_INVALID_* exceptions include more cases
    than in the kernel version (in particular, FP_EX_INVALID_IMZ_FMA
    is split out from FP_EX_INVALID_IMZ, so if only the latter is
    defined then fma using the new fma support would not raise that
    exception any more - except that this doesn't actually affect
    powerpc because it hardcodes setting various exceptions in
    powerpc-specific code despite also defining FP_EX_INVALID_*).

Generally this patch only does cleanups and bug fixes to
architecture-specific code when they are closely connected to API
changes in the new code (either required by such API changes, or the
new API means the idiomatic way to do something has changed).  Where
something was already odd with the old version of the code, or
apparently did not match documented instruction set semantics, it's
not changed if that seems unconnected to the update from glibc.  I've
noted various such cases (especially for powerpc) that may be
addressed in followup patch series once the main upgrade is in (or,
where the fix seems more complicated and difficult to fix without
convenient access to the architecture for testing, I may just list the
issues on the relevant architecture mailing list).

The following architecture-specific cleanups or bug fixes (that might
change how the emulation behaves, or that go beyond mechanical
conversion to new APIs) are included in this patch because of their
close connection to the API changes:

* Alpha and SH now use after-rounding tininess detection.

* On Alpha, extensions from single to double now use FP_EXTEND with
  raw unpacking instead of the previous hardcoded code with cooked
  unpacking; these should be equivalent and the new code, with the
  optimizations in FP_EXTEND relative to the old FP_CONV, should be as
  efficient as the previous hardcoded code.

* On PowerPC, S/390 and SH, fused multiply-add operations now use the
  new soft-fp fma support (meaning they are properly fused rather than
  only having 3 extra bits precision on the intermediate result of the
  multiplication).

* On PowerPC for SPE floating-point emulation, the pre-existing bug of
  comparisons using cooked unpacking is fixed (as the structure of the
  code meant unpacking types naturally needed specifying explicitly
  for all operations).  This should not in fact change how the
  emulation behaves, other than making it more efficient.  Various
  operations that should not have unpacked at all now no longer unpack
  instead of using cooked unpacking, so avoiding spurious exceptions
  on signaling NaNs (on the other case of arguments that are actually
  a different floating-point type but would wrongly be interpreted as
  signaling NaNs by the unpacking, FP_CLEAR_EXCEPTIONS may have
  avoided the issue).

* On S/390, negation / absolute value now use raw unpacking / packing,
  meaning SNaNs no longer generate exceptions, which is in accordance
  with the architecture documentation.

* On SPARC, comparisons now use raw unpacking (this should not in fact
  change how the emulation behaves, just make it more efficient).

Signed-off-by: Joseph Myers <joseph@codesourcery.com>

---

diff --git a/arch/alpha/include/asm/sfp-machine.h b/arch/alpha/include/asm/sfp-machine.h
index 5fe63af..96c266a 100644
--- a/arch/alpha/include/asm/sfp-machine.h
+++ b/arch/alpha/include/asm/sfp-machine.h
@@ -48,6 +48,7 @@
 #define _FP_NANSIGN_Q		1
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /* Alpha Architecture Handbook, 4.7.10.4 sais that
  * we should prefer any type of NaN in Fb, then Fa.
@@ -79,4 +80,6 @@
 /* We write the results always */
 #define FP_INHIBIT_RESULTS 0
 
+#define _FP_TININESS_AFTER_ROUNDING 1
+
 #endif
diff --git a/arch/alpha/math-emu/math.c b/arch/alpha/math-emu/math.c
index 58c2669..1fdb122 100644
--- a/arch/alpha/math-emu/math.c
+++ b/arch/alpha/math-emu/math.c
@@ -127,17 +127,27 @@ alpha_fp_emul (unsigned long pc)
 		va = alpha_read_fp_reg_s(fa);
 		vb = alpha_read_fp_reg_s(fb);
 		
-		FP_UNPACK_SP(SA, &va);
-		FP_UNPACK_SP(SB, &vb);
+		switch (func) {
+		case FOP_FNC_SUBx:
+		case FOP_FNC_ADDx:
+			FP_UNPACK_SEMIRAW_SP(SA, &va);
+			FP_UNPACK_SEMIRAW_SP(SB, &vb);
+			break;
+
+		default:
+			FP_UNPACK_SP(SA, &va);
+			FP_UNPACK_SP(SB, &vb);
+			break;
+		}
 
 		switch (func) {
 		case FOP_FNC_SUBx:
 			FP_SUB_S(SR, SA, SB);
-			goto pack_s;
+			goto pack_semiraw_s;
 
 		case FOP_FNC_ADDx:
 			FP_ADD_S(SR, SA, SB);
-			goto pack_s;
+			goto pack_semiraw_s;
 
 		case FOP_FNC_MULx:
 			FP_MUL_S(SR, SA, SB);
@@ -160,26 +170,10 @@ alpha_fp_emul (unsigned long pc)
 		if ((func & ~3) = FOP_FNC_CMPxUN) {
 			FP_UNPACK_RAW_DP(DA, &va);
 			FP_UNPACK_RAW_DP(DB, &vb);
-			if (!DA_e && !_FP_FRAC_ZEROP_1(DA)) {
-				FP_SET_EXCEPTION(FP_EX_DENORM);
-				if (FP_DENORM_ZERO)
-					_FP_FRAC_SET_1(DA, _FP_ZEROFRAC_1);
-			}
-			if (!DB_e && !_FP_FRAC_ZEROP_1(DB)) {
-				FP_SET_EXCEPTION(FP_EX_DENORM);
-				if (FP_DENORM_ZERO)
-					_FP_FRAC_SET_1(DB, _FP_ZEROFRAC_1);
-			}
-			FP_CMP_D(res, DA, DB, 3);
-			vc = 0x4000000000000000UL;
 			/* CMPTEQ, CMPTUN don't trap on QNaN,
 			   while CMPTLT and CMPTLE do */
-			if (res = 3
-			    && ((func & 3) >= 2
-				|| FP_ISSIGNAN_D(DA)
-				|| FP_ISSIGNAN_D(DB))) {
-				FP_SET_EXCEPTION(FP_EX_INVALID);
-			}
+			FP_CMP_D(res, DA, DB, 3, (func & 3) >= 2 ? 2 : 1);
+			vc = 0x4000000000000000UL;
 			switch (func) {
 			case FOP_FNC_CMPxUN: if (res != 3) vc = 0; break;
 			case FOP_FNC_CMPxEQ: if (res) vc = 0; break;
@@ -189,55 +183,64 @@ alpha_fp_emul (unsigned long pc)
 			goto done_d;
 		}
 
-		FP_UNPACK_DP(DA, &va);
-		FP_UNPACK_DP(DB, &vb);
-
 		switch (func) {
 		case FOP_FNC_SUBx:
-			FP_SUB_D(DR, DA, DB);
-			goto pack_d;
-
 		case FOP_FNC_ADDx:
-			FP_ADD_D(DR, DA, DB);
-			goto pack_d;
-
-		case FOP_FNC_MULx:
-			FP_MUL_D(DR, DA, DB);
-			goto pack_d;
-
-		case FOP_FNC_DIVx:
-			FP_DIV_D(DR, DA, DB);
-			goto pack_d;
-
-		case FOP_FNC_SQRTx:
-			FP_SQRT_D(DR, DB);
-			goto pack_d;
+			FP_UNPACK_SEMIRAW_DP(DA, &va);
+			FP_UNPACK_SEMIRAW_DP(DB, &vb);
+			break;
 
 		case FOP_FNC_CVTxS:
 			/* It is irritating that DEC encoded CVTST with
 			   SRC = T_floating.  It is also interesting that
 			   the bit used to tell the two apart is /U... */
 			if (insn & 0x2000) {
-				FP_CONV(S,D,1,1,SR,DB);
-				goto pack_s;
+				FP_UNPACK_SEMIRAW_DP(DB, &vb);
+				FP_TRUNC(S,D,1,1,SR,DB);
+				goto pack_semiraw_s;
 			} else {
 				vb = alpha_read_fp_reg_s(fb);
-				FP_UNPACK_SP(SB, &vb);
-				DR_c = DB_c;
-				DR_s = DB_s;
-				DR_e = DB_e + (1024 - 128);
-				DR_f = SB_f << (52 - 23);
-				goto pack_d;
+				FP_UNPACK_RAW_SP(SB, &vb);
+				FP_EXTEND(D,S,1,1,DR,SB);
+				goto pack_raw_d;
 			}
 
 		case FOP_FNC_CVTxQ:
-			if (DB_c = FP_CLS_NAN
+			FP_UNPACK_RAW_DP(DB, &vb);
+			if (DB_e = _FP_EXPMAX_D
 			    && (_FP_FRAC_HIGH_RAW_D(DB) & _FP_QNANBIT_D)) {
 			  /* AAHB Table B-2 says QNaN should not trigger INV */
 				vc = 0;
 			} else
 				FP_TO_INT_ROUND_D(vc, DB, 64, 2);
 			goto done_d;
+
+		default:
+			FP_UNPACK_DP(DA, &va);
+			FP_UNPACK_DP(DB, &vb);
+			break;
+		}
+
+		switch (func) {
+		case FOP_FNC_SUBx:
+			FP_SUB_D(DR, DA, DB);
+			goto pack_semiraw_d;
+
+		case FOP_FNC_ADDx:
+			FP_ADD_D(DR, DA, DB);
+			goto pack_semiraw_d;
+
+		case FOP_FNC_MULx:
+			FP_MUL_D(DR, DA, DB);
+			goto pack_d;
+
+		case FOP_FNC_DIVx:
+			FP_DIV_D(DR, DA, DB);
+			goto pack_d;
+
+		case FOP_FNC_SQRTx:
+			FP_SQRT_D(DR, DB);
+			goto pack_d;
 		}
 		goto bad_insn;
 
@@ -256,26 +259,44 @@ alpha_fp_emul (unsigned long pc)
 			goto done_d;
 
 		case FOP_FNC_CVTxS:
-			FP_FROM_INT_S(SR, ((long)vb), 64, long);
-			goto pack_s;
+			FP_FROM_INT_S(SR, ((long)vb), 64, unsigned long);
+			goto pack_raw_s;
 
 		case FOP_FNC_CVTxT:
-			FP_FROM_INT_D(DR, ((long)vb), 64, long);
-			goto pack_d;
+			FP_FROM_INT_D(DR, ((long)vb), 64, unsigned long);
+			goto pack_raw_d;
 		}
 		goto bad_insn;
 	}
 	goto bad_insn;
 
+pack_raw_s:
+	FP_PACK_RAW_SP(&vc, SR);
+	goto packed_s;
+
+pack_semiraw_s:
+	FP_PACK_SEMIRAW_SP(&vc, SR);
+	goto packed_s;
+
 pack_s:
 	FP_PACK_SP(&vc, SR);
+packed_s:
 	if ((_fex & FP_EX_UNDERFLOW) && (swcr & IEEE_MAP_UMZ))
 		vc = 0;
 	alpha_write_fp_reg_s(fc, vc);
 	goto done;
 
+pack_raw_d:
+	FP_PACK_RAW_DP(&vc, DR);
+	goto packed_d;
+
+pack_semiraw_d:
+	FP_PACK_SEMIRAW_DP(&vc, DR);
+	goto packed_d;
+
 pack_d:
 	FP_PACK_DP(&vc, DR);
+packed_d:
 	if ((_fex & FP_EX_UNDERFLOW) && (swcr & IEEE_MAP_UMZ))
 		vc = 0;
 done_d:
diff --git a/arch/powerpc/include/asm/sfp-machine.h b/arch/powerpc/include/asm/sfp-machine.h
index d89beab..607ee14 100644
--- a/arch/powerpc/include/asm/sfp-machine.h
+++ b/arch/powerpc/include/asm/sfp-machine.h
@@ -82,6 +82,9 @@
 #define _FP_MUL_MEAT_S(R,X,Y)   _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
 #define _FP_MUL_MEAT_D(R,X,Y)   _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
 
+#define _FP_MUL_MEAT_DW_S(R,X,Y)   _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_D(R,X,Y)   _FP_MUL_MEAT_DW_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+
 #define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv_norm(S,R,X,Y)
 #define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
 
@@ -96,6 +99,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 #ifdef FP_EX_BOOKE_E500_SPE
 #define FP_EX_INEXACT		(1 << 21)
@@ -178,15 +182,40 @@
 		_FP_PACK_RAW_2_P(D, val, X);				\
    } while (0)
 
+#define __FP_PACK_SEMIRAW_D(val,X)			\
+   do {									\
+	_FP_PACK_SEMIRAW(D, 2, X);					\
+	if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS))	\
+		_FP_PACK_RAW_2_P(D, val, X);				\
+   } while (0)
+
 #define __FP_PACK_DS(val,X)							\
    do {										\
 	   FP_DECL_S(__X);							\
-	   FP_CONV(S, D, 1, 2, __X, X);						\
+	   if (X##_c != FP_CLS_NAN)						\
+		   _FP_FRAC_SRS_2(X, _FP_WFRACBITS_D - _FP_WFRACBITS_S,		\
+			   _FP_WFRACBITS_D);					\
+	   else									\
+		   _FP_FRAC_SRL_2(X, _FP_WFRACBITS_D - _FP_WFRACBITS_S);	\
+	   _FP_FRAC_COPY_1_2(__X, X);						\
+	   __X##_e = X##_e;							\
+	   __X##_c = X##_c;							\
+	   __X##_s = X##_s;							\
 	   _FP_PACK_CANONICAL(S, 1, __X);					\
 	   if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS)) {	\
-		   _FP_UNPACK_CANONICAL(S, 1, __X);				\
-		   FP_CONV(D, S, 2, 1, X, __X);					\
-		   _FP_PACK_CANONICAL(D, 2, X);					\
+		   FP_EXTEND(D, S, 2, 1, X, __X);				\
+		   if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS))	\
+		   _FP_PACK_RAW_2_P(D, val, X);					\
+	   }									\
+   } while (0)
+
+#define __FP_PACK_SEMIRAW_DS(val,X)						\
+   do {										\
+	   FP_DECL_S(__X);							\
+	   FP_TRUNC(S, D, 1, 2, __X, X);					\
+	   _FP_PACK_SEMIRAW(S, 1, __X);						\
+	   if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS)) {	\
+		   FP_EXTEND(D, S, 2, 1, X, __X);				\
 		   if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS))	\
 		   _FP_PACK_RAW_2_P(D, val, X);					\
 	   }									\
@@ -198,6 +227,8 @@
 	__FPU_FPSCR & 0x3;		\
 })
 
+#define _FP_TININESS_AFTER_ROUNDING 0
+
 /* the asm fragments go here: all these are taken from glibc-2.0.5's
  * stdlib/longlong.h
  */
diff --git a/arch/powerpc/math-emu/fadd.c b/arch/powerpc/math-emu/fadd.c
index 0158a16..6deb27a 100644
--- a/arch/powerpc/math-emu/fadd.c
+++ b/arch/powerpc/math-emu/fadd.c
@@ -18,8 +18,8 @@ fadd(void *frD, void *frA, void *frB)
 	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
-	FP_UNPACK_DP(A, frA);
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_SEMIRAW_DP(A, frA);
+	FP_UNPACK_SEMIRAW_DP(B, frB);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
@@ -32,7 +32,7 @@ fadd(void *frD, void *frA, void *frB)
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	__FP_PACK_D(frD, R);
+	__FP_PACK_SEMIRAW_D(frD, R);
 
 	return FP_CUR_EXCEPTIONS;
 }
diff --git a/arch/powerpc/math-emu/fadds.c b/arch/powerpc/math-emu/fadds.c
index 5930f40..9e2fb9e 100644
--- a/arch/powerpc/math-emu/fadds.c
+++ b/arch/powerpc/math-emu/fadds.c
@@ -19,8 +19,8 @@ fadds(void *frD, void *frA, void *frB)
 	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
-	FP_UNPACK_DP(A, frA);
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_SEMIRAW_DP(A, frA);
+	FP_UNPACK_SEMIRAW_DP(B, frB);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
@@ -33,7 +33,7 @@ fadds(void *frD, void *frA, void *frB)
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	__FP_PACK_DS(frD, R);
+	__FP_PACK_SEMIRAW_DS(frD, R);
 
 	return FP_CUR_EXCEPTIONS;
 }
diff --git a/arch/powerpc/math-emu/fcmpo.c b/arch/powerpc/math-emu/fcmpo.c
index 5bce011..8ebdb28 100644
--- a/arch/powerpc/math-emu/fcmpo.c
+++ b/arch/powerpc/math-emu/fcmpo.c
@@ -30,7 +30,7 @@ fcmpo(u32 *ccr, int crfD, void *frA, void *frB)
 	if (A_c = FP_CLS_NAN || B_c = FP_CLS_NAN)
 		FP_SET_EXCEPTION(EFLAG_VXVC);
 
-	FP_CMP_D(cmp, A, B, 2);
+	FP_CMP_D(cmp, A, B, 2, 0);
 	cmp = code[(cmp + 1) & 3];
 
 	__FPU_FPSCR &= ~(0x1f000);
diff --git a/arch/powerpc/math-emu/fcmpu.c b/arch/powerpc/math-emu/fcmpu.c
index d4fb1ba..3b385c6 100644
--- a/arch/powerpc/math-emu/fcmpu.c
+++ b/arch/powerpc/math-emu/fcmpu.c
@@ -27,7 +27,7 @@ fcmpu(u32 *ccr, int crfD, void *frA, void *frB)
 	printk("B: %ld %lu %lu %ld (%ld)\n", B_s, B_f1, B_f0, B_e, B_c);
 #endif
 
-	FP_CMP_D(cmp, A, B, 2);
+	FP_CMP_D(cmp, A, B, 2, 0);
 	cmp = code[(cmp + 1) & 3];
 
 	__FPU_FPSCR &= ~(0x1f000);
diff --git a/arch/powerpc/math-emu/fctiw.c b/arch/powerpc/math-emu/fctiw.c
index f694440..9d7c7c9 100644
--- a/arch/powerpc/math-emu/fctiw.c
+++ b/arch/powerpc/math-emu/fctiw.c
@@ -13,7 +13,7 @@ fctiw(u32 *frD, void *frB)
 	FP_DECL_EX;
 	unsigned int r;
 
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_RAW_DP(B, frB);
 	FP_TO_INT_D(r, B, 32, 1);
 	frD[1] = r;
 
diff --git a/arch/powerpc/math-emu/fctiwz.c b/arch/powerpc/math-emu/fctiwz.c
index 71e782f..d55b3e7 100644
--- a/arch/powerpc/math-emu/fctiwz.c
+++ b/arch/powerpc/math-emu/fctiwz.c
@@ -18,7 +18,7 @@ fctiwz(u32 *frD, void *frB)
 	__FPU_FPSCR &= ~(3);
 	__FPU_FPSCR |= FP_RND_ZERO;
 
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_RAW_DP(B, frB);
 	FP_TO_INT_D(r, B, 32, 1);
 	frD[1] = r;
 
diff --git a/arch/powerpc/math-emu/fmadd.c b/arch/powerpc/math-emu/fmadd.c
index 8c3f20a..0f450fb 100644
--- a/arch/powerpc/math-emu/fmadd.c
+++ b/arch/powerpc/math-emu/fmadd.c
@@ -13,7 +13,6 @@ fmadd(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -34,12 +33,7 @@ fmadd(void *frD, void *frA, void *frB, void *frC)
 	    (A_c = FP_CLS_ZERO && C_c = FP_CLS_INF))
                 FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
-	if (T_s != B_s && T_c = FP_CLS_INF && B_c = FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 #ifdef DEBUG
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
diff --git a/arch/powerpc/math-emu/fmadds.c b/arch/powerpc/math-emu/fmadds.c
index 794fb31..79885eb 100644
--- a/arch/powerpc/math-emu/fmadds.c
+++ b/arch/powerpc/math-emu/fmadds.c
@@ -14,7 +14,6 @@ fmadds(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -35,12 +34,7 @@ fmadds(void *frD, void *frA, void *frB, void *frC)
 	    (A_c = FP_CLS_ZERO && C_c = FP_CLS_INF))
                 FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
-	if (T_s != B_s && T_c = FP_CLS_INF && B_c = FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 #ifdef DEBUG
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
diff --git a/arch/powerpc/math-emu/fmsub.c b/arch/powerpc/math-emu/fmsub.c
index 626f6fe..ee2385d 100644
--- a/arch/powerpc/math-emu/fmsub.c
+++ b/arch/powerpc/math-emu/fmsub.c
@@ -13,7 +13,6 @@ fmsub(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -34,15 +33,10 @@ fmsub(void *frD, void *frA, void *frB, void *frC)
 	    (A_c = FP_CLS_ZERO && C_c = FP_CLS_INF))
 		FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
 	if (B_c != FP_CLS_NAN)
 		B_s ^= 1;
 
-	if (T_s != B_s && T_c = FP_CLS_INF && B_c = FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 #ifdef DEBUG
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
diff --git a/arch/powerpc/math-emu/fmsubs.c b/arch/powerpc/math-emu/fmsubs.c
index 3425bc8..fe081c0 100644
--- a/arch/powerpc/math-emu/fmsubs.c
+++ b/arch/powerpc/math-emu/fmsubs.c
@@ -14,7 +14,6 @@ fmsubs(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -35,15 +34,10 @@ fmsubs(void *frD, void *frA, void *frB, void *frC)
 	    (A_c = FP_CLS_ZERO && C_c = FP_CLS_INF))
 		FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
 	if (B_c != FP_CLS_NAN)
 		B_s ^= 1;
 
-	if (T_s != B_s && T_c = FP_CLS_INF && B_c = FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 #ifdef DEBUG
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
diff --git a/arch/powerpc/math-emu/fnmadd.c b/arch/powerpc/math-emu/fnmadd.c
index e817bc5..330353e6 100644
--- a/arch/powerpc/math-emu/fnmadd.c
+++ b/arch/powerpc/math-emu/fnmadd.c
@@ -13,7 +13,6 @@ fnmadd(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -34,12 +33,7 @@ fnmadd(void *frD, void *frA, void *frB, void *frC)
 	    (A_c = FP_CLS_ZERO && C_c = FP_CLS_INF))
                 FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
-	if (T_s != B_s && T_c = FP_CLS_INF && B_c = FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 	if (R_c != FP_CLS_NAN)
 		R_s ^= 1;
diff --git a/arch/powerpc/math-emu/fnmadds.c b/arch/powerpc/math-emu/fnmadds.c
index 4db4b7d..dd27045 100644
--- a/arch/powerpc/math-emu/fnmadds.c
+++ b/arch/powerpc/math-emu/fnmadds.c
@@ -14,7 +14,6 @@ fnmadds(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -35,12 +34,7 @@ fnmadds(void *frD, void *frA, void *frB, void *frC)
 	    (A_c = FP_CLS_ZERO && C_c = FP_CLS_INF))
                 FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
-	if (T_s != B_s && T_c = FP_CLS_INF && B_c = FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 	if (R_c != FP_CLS_NAN)
 		R_s ^= 1;
diff --git a/arch/powerpc/math-emu/fnmsub.c b/arch/powerpc/math-emu/fnmsub.c
index f65979f..87c8b4c 100644
--- a/arch/powerpc/math-emu/fnmsub.c
+++ b/arch/powerpc/math-emu/fnmsub.c
@@ -13,7 +13,6 @@ fnmsub(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -34,15 +33,10 @@ fnmsub(void *frD, void *frA, void *frB, void *frC)
 	    (A_c = FP_CLS_ZERO && C_c = FP_CLS_INF))
 		FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
 	if (B_c != FP_CLS_NAN)
 		B_s ^= 1;
 
-	if (T_s != B_s && T_c = FP_CLS_INF && B_c = FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 	if (R_c != FP_CLS_NAN)
 		R_s ^= 1;
diff --git a/arch/powerpc/math-emu/fnmsubs.c b/arch/powerpc/math-emu/fnmsubs.c
index 9021dac..72b860b 100644
--- a/arch/powerpc/math-emu/fnmsubs.c
+++ b/arch/powerpc/math-emu/fnmsubs.c
@@ -14,7 +14,6 @@ fnmsubs(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -35,15 +34,10 @@ fnmsubs(void *frD, void *frA, void *frB, void *frC)
 	    (A_c = FP_CLS_ZERO && C_c = FP_CLS_INF))
 		FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
 	if (B_c != FP_CLS_NAN)
 		B_s ^= 1;
 
-	if (T_s != B_s && T_c = FP_CLS_INF && B_c = FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 	if (R_c != FP_CLS_NAN)
 		R_s ^= 1;
diff --git a/arch/powerpc/math-emu/fsub.c b/arch/powerpc/math-emu/fsub.c
index 02c5dff..8070976 100644
--- a/arch/powerpc/math-emu/fsub.c
+++ b/arch/powerpc/math-emu/fsub.c
@@ -18,8 +18,8 @@ fsub(void *frD, void *frA, void *frB)
 	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
-	FP_UNPACK_DP(A, frA);
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_SEMIRAW_DP(A, frA);
+	FP_UNPACK_SEMIRAW_DP(B, frB);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
@@ -38,7 +38,7 @@ fsub(void *frD, void *frA, void *frB)
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	__FP_PACK_D(frD, R);
+	__FP_PACK_SEMIRAW_D(frD, R);
 
 	return FP_CUR_EXCEPTIONS;
 }
diff --git a/arch/powerpc/math-emu/fsubs.c b/arch/powerpc/math-emu/fsubs.c
index 5d9b18c..5b96755 100644
--- a/arch/powerpc/math-emu/fsubs.c
+++ b/arch/powerpc/math-emu/fsubs.c
@@ -19,8 +19,8 @@ fsubs(void *frD, void *frA, void *frB)
 	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
-	FP_UNPACK_DP(A, frA);
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_SEMIRAW_DP(A, frA);
+	FP_UNPACK_SEMIRAW_DP(B, frB);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
@@ -39,7 +39,7 @@ fsubs(void *frD, void *frA, void *frB)
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	__FP_PACK_DS(frD, R);
+	__FP_PACK_SEMIRAW_DS(frD, R);
 
 	return FP_CUR_EXCEPTIONS;
 }
diff --git a/arch/powerpc/math-emu/lfs.c b/arch/powerpc/math-emu/lfs.c
index 434ed27..16da2c2 100644
--- a/arch/powerpc/math-emu/lfs.c
+++ b/arch/powerpc/math-emu/lfs.c
@@ -22,25 +22,20 @@ lfs(void *frD, void *ea)
 	if (copy_from_user(&f, ea, sizeof(float)))
 		return -EFAULT;
 
-	FP_UNPACK_S(A, f);
+	FP_UNPACK_RAW_S(A, f);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %ld (%ld) [%08lx]\n", A_s, A_f, A_e, A_c,
 	       *(unsigned long *)&f);
 #endif
 
-	FP_CONV(D, S, 2, 1, R, A);
+	_FP_EXTEND_CNAN(D, S, 2, 1, R, A, 0);
 
 #ifdef DEBUG
 	printk("R: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	if (R_c = FP_CLS_NAN) {
-		R_e = _FP_EXPMAX_D;
-		_FP_PACK_RAW_2_P(D, frD, R);
-	} else {
-		__FP_PACK_D(frD, R);
-	}
+	FP_PACK_RAW_DP(frD, R);
 
 	return 0;
 }
diff --git a/arch/powerpc/math-emu/math_efp.c b/arch/powerpc/math-emu/math_efp.c
index 28337c9..833394c 100644
--- a/arch/powerpc/math-emu/math_efp.c
+++ b/arch/powerpc/math-emu/math_efp.c
@@ -99,6 +99,11 @@
 #define XB	4
 #define XCR	5
 #define NOTYPE	0
+#define TYPE_MASK	7
+#define UNONE	0
+#define URAW	8
+#define USEMI	16
+#define UCOOK	24
 
 #define SIGN_BIT_S	(1UL << 31)
 #define SIGN_BIT_D	(1ULL << 63)
@@ -114,64 +119,64 @@ union dw_union {
 
 static unsigned long insn_type(unsigned long speinsn)
 {
-	unsigned long ret = NOTYPE;
+	unsigned long ret = NOTYPE|UNONE;
 
 	switch (speinsn & 0x7ff) {
-	case EFSABS:	ret = XA;	break;
-	case EFSADD:	ret = AB;	break;
-	case EFSCFD:	ret = XB;	break;
-	case EFSCMPEQ:	ret = XCR;	break;
-	case EFSCMPGT:	ret = XCR;	break;
-	case EFSCMPLT:	ret = XCR;	break;
-	case EFSCTSF:	ret = XB;	break;
-	case EFSCTSI:	ret = XB;	break;
-	case EFSCTSIZ:	ret = XB;	break;
-	case EFSCTUF:	ret = XB;	break;
-	case EFSCTUI:	ret = XB;	break;
-	case EFSCTUIZ:	ret = XB;	break;
-	case EFSDIV:	ret = AB;	break;
-	case EFSMUL:	ret = AB;	break;
-	case EFSNABS:	ret = XA;	break;
-	case EFSNEG:	ret = XA;	break;
-	case EFSSUB:	ret = AB;	break;
-	case EFSCFSI:	ret = XB;	break;
-
-	case EVFSABS:	ret = XA;	break;
-	case EVFSADD:	ret = AB;	break;
-	case EVFSCMPEQ:	ret = XCR;	break;
-	case EVFSCMPGT:	ret = XCR;	break;
-	case EVFSCMPLT:	ret = XCR;	break;
-	case EVFSCTSF:	ret = XB;	break;
-	case EVFSCTSI:	ret = XB;	break;
-	case EVFSCTSIZ:	ret = XB;	break;
-	case EVFSCTUF:	ret = XB;	break;
-	case EVFSCTUI:	ret = XB;	break;
-	case EVFSCTUIZ:	ret = XB;	break;
-	case EVFSDIV:	ret = AB;	break;
-	case EVFSMUL:	ret = AB;	break;
-	case EVFSNABS:	ret = XA;	break;
-	case EVFSNEG:	ret = XA;	break;
-	case EVFSSUB:	ret = AB;	break;
-
-	case EFDABS:	ret = XA;	break;
-	case EFDADD:	ret = AB;	break;
-	case EFDCFS:	ret = XB;	break;
-	case EFDCMPEQ:	ret = XCR;	break;
-	case EFDCMPGT:	ret = XCR;	break;
-	case EFDCMPLT:	ret = XCR;	break;
-	case EFDCTSF:	ret = XB;	break;
-	case EFDCTSI:	ret = XB;	break;
-	case EFDCTSIDZ:	ret = XB;	break;
-	case EFDCTSIZ:	ret = XB;	break;
-	case EFDCTUF:	ret = XB;	break;
-	case EFDCTUI:	ret = XB;	break;
-	case EFDCTUIDZ:	ret = XB;	break;
-	case EFDCTUIZ:	ret = XB;	break;
-	case EFDDIV:	ret = AB;	break;
-	case EFDMUL:	ret = AB;	break;
-	case EFDNABS:	ret = XA;	break;
-	case EFDNEG:	ret = XA;	break;
-	case EFDSUB:	ret = AB;	break;
+	case EFSABS:	ret = XA|UNONE;	break;
+	case EFSADD:	ret = AB|USEMI;	break;
+	case EFSCFD:	ret = XB|UNONE;	break;
+	case EFSCMPEQ:	ret = XCR|URAW;	break;
+	case EFSCMPGT:	ret = XCR|URAW;	break;
+	case EFSCMPLT:	ret = XCR|URAW;	break;
+	case EFSCTSF:	ret = XB|URAW;	break;
+	case EFSCTSI:	ret = XB|URAW;	break;
+	case EFSCTSIZ:	ret = XB|URAW;	break;
+	case EFSCTUF:	ret = XB|URAW;	break;
+	case EFSCTUI:	ret = XB|URAW;	break;
+	case EFSCTUIZ:	ret = XB|URAW;	break;
+	case EFSDIV:	ret = AB|UCOOK;	break;
+	case EFSMUL:	ret = AB|UCOOK;	break;
+	case EFSNABS:	ret = XA|UNONE;	break;
+	case EFSNEG:	ret = XA|UNONE;	break;
+	case EFSSUB:	ret = AB|USEMI;	break;
+	case EFSCFSI:	ret = XB|UNONE;	break;
+
+	case EVFSABS:	ret = XA|UNONE;	break;
+	case EVFSADD:	ret = AB|USEMI;	break;
+	case EVFSCMPEQ:	ret = XCR|URAW;	break;
+	case EVFSCMPGT:	ret = XCR|URAW;	break;
+	case EVFSCMPLT:	ret = XCR|URAW;	break;
+	case EVFSCTSF:	ret = XB|URAW;	break;
+	case EVFSCTSI:	ret = XB|URAW;	break;
+	case EVFSCTSIZ:	ret = XB|URAW;	break;
+	case EVFSCTUF:	ret = XB|URAW;	break;
+	case EVFSCTUI:	ret = XB|URAW;	break;
+	case EVFSCTUIZ:	ret = XB|URAW;	break;
+	case EVFSDIV:	ret = AB|UCOOK;	break;
+	case EVFSMUL:	ret = AB|UCOOK;	break;
+	case EVFSNABS:	ret = XA|UNONE;	break;
+	case EVFSNEG:	ret = XA|UNONE;	break;
+	case EVFSSUB:	ret = AB|USEMI;	break;
+
+	case EFDABS:	ret = XA|UNONE;	break;
+	case EFDADD:	ret = AB|USEMI;	break;
+	case EFDCFS:	ret = XB|UNONE;	break;
+	case EFDCMPEQ:	ret = XCR|URAW;	break;
+	case EFDCMPGT:	ret = XCR|URAW;	break;
+	case EFDCMPLT:	ret = XCR|URAW;	break;
+	case EFDCTSF:	ret = XB|URAW;	break;
+	case EFDCTSI:	ret = XB|URAW;	break;
+	case EFDCTSIDZ:	ret = XB|URAW;	break;
+	case EFDCTSIZ:	ret = XB|URAW;	break;
+	case EFDCTUF:	ret = XB|URAW;	break;
+	case EFDCTUI:	ret = XB|URAW;	break;
+	case EFDCTUIDZ:	ret = XB|URAW;	break;
+	case EFDCTUIZ:	ret = XB|URAW;	break;
+	case EFDDIV:	ret = AB|UCOOK;	break;
+	case EFDMUL:	ret = AB|UCOOK;	break;
+	case EFDNABS:	ret = XA|UNONE;	break;
+	case EFDNEG:	ret = XA|UNONE;	break;
+	case EFDSUB:	ret = AB|USEMI;	break;
 	}
 
 	return ret;
@@ -191,7 +196,7 @@ int do_spe_mathemu(struct pt_regs *regs)
 		return -EINVAL;         /* not an spe instruction */
 
 	type = insn_type(speinsn);
-	if (type = NOTYPE)
+	if (type = (NOTYPE|UNONE))
 		goto illegal;
 
 	func = speinsn & 0x7ff;
@@ -219,14 +224,18 @@ int do_spe_mathemu(struct pt_regs *regs)
 		FP_DECL_S(SA); FP_DECL_S(SB); FP_DECL_S(SR);
 
 		switch (type) {
-		case AB:
-		case XCR:
-			FP_UNPACK_SP(SA, va.wp + 1);
-		case XB:
-			FP_UNPACK_SP(SB, vb.wp + 1);
+		case XCR|URAW:
+			FP_UNPACK_RAW_SP(SA, va.wp + 1);
+		case XB|URAW:
+			FP_UNPACK_RAW_SP(SB, vb.wp + 1);
+			break;
+		case AB|USEMI:
+			FP_UNPACK_SEMIRAW_SP(SA, va.wp + 1);
+			FP_UNPACK_SEMIRAW_SP(SB, vb.wp + 1);
 			break;
-		case XA:
+		case AB|UCOOK:
 			FP_UNPACK_SP(SA, va.wp + 1);
+			FP_UNPACK_SP(SB, vb.wp + 1);
 			break;
 		}
 
@@ -248,11 +257,11 @@ int do_spe_mathemu(struct pt_regs *regs)
 
 		case EFSADD:
 			FP_ADD_S(SR, SA, SB);
-			goto pack_s;
+			goto pack_semiraw_s;
 
 		case EFSSUB:
 			FP_SUB_S(SR, SA, SB);
-			goto pack_s;
+			goto pack_semiraw_s;
 
 		case EFSMUL:
 			FP_MUL_S(SR, SA, SB);
@@ -288,14 +297,13 @@ int do_spe_mathemu(struct pt_regs *regs)
 
 		case EFSCFD: {
 			FP_DECL_D(DB);
-			FP_CLEAR_EXCEPTIONS;
-			FP_UNPACK_DP(DB, vb.dp);
+			FP_UNPACK_SEMIRAW_DP(DB, vb.dp);
 
-			pr_debug("DB: %ld %08lx %08lx %ld (%ld)\n",
-					DB_s, DB_f1, DB_f0, DB_e, DB_c);
+			pr_debug("DB: %ld %08lx %08lx %ld\n",
+					DB_s, DB_f1, DB_f0, DB_e);
 
-			FP_CONV(S, D, 1, 2, SR, DB);
-			goto pack_s;
+			FP_TRUNC(S, D, 1, 2, SR, DB);
+			goto pack_semiraw_s;
 		}
 
 		case EFSCTSI:
@@ -325,6 +333,12 @@ int do_spe_mathemu(struct pt_regs *regs)
 		}
 		break;
 
+pack_semiraw_s:
+		pr_debug("SR: %ld %08lx %ld\n", SR_s, SR_f, SR_e);
+
+		FP_PACK_SEMIRAW_SP(vc.wp + 1, SR);
+		goto update_regs;
+
 pack_s:
 		pr_debug("SR: %ld %08lx %ld (%ld)\n", SR_s, SR_f, SR_e, SR_c);
 
@@ -332,9 +346,7 @@ pack_s:
 		goto update_regs;
 
 cmp_s:
-		FP_CMP_S(IR, SA, SB, 3);
-		if (IR = 3 && (FP_ISSIGNAN_S(SA) || FP_ISSIGNAN_S(SB)))
-			FP_SET_EXCEPTION(FP_EX_INVALID);
+		FP_CMP_S(IR, SA, SB, 3, 1);
 		if (IR = cmp) {
 			IR = 0x4;
 		} else {
@@ -347,14 +359,18 @@ cmp_s:
 		FP_DECL_D(DA); FP_DECL_D(DB); FP_DECL_D(DR);
 
 		switch (type) {
-		case AB:
-		case XCR:
-			FP_UNPACK_DP(DA, va.dp);
-		case XB:
-			FP_UNPACK_DP(DB, vb.dp);
+		case XCR|URAW:
+			FP_UNPACK_RAW_DP(DA, va.dp);
+		case XB|URAW:
+			FP_UNPACK_RAW_DP(DB, vb.dp);
 			break;
-		case XA:
+		case AB|USEMI:
+			FP_UNPACK_SEMIRAW_DP(DA, va.dp);
+			FP_UNPACK_SEMIRAW_DP(DB, vb.dp);
+			break;
+		case AB|UCOOK:
 			FP_UNPACK_DP(DA, va.dp);
+			FP_UNPACK_DP(DB, vb.dp);
 			break;
 		}
 
@@ -378,11 +394,11 @@ cmp_s:
 
 		case EFDADD:
 			FP_ADD_D(DR, DA, DB);
-			goto pack_d;
+			goto pack_semiraw_d;
 
 		case EFDSUB:
 			FP_SUB_D(DR, DA, DB);
-			goto pack_d;
+			goto pack_semiraw_d;
 
 		case EFDMUL:
 			FP_MUL_D(DR, DA, DB);
@@ -418,14 +434,13 @@ cmp_s:
 
 		case EFDCFS: {
 			FP_DECL_S(SB);
-			FP_CLEAR_EXCEPTIONS;
-			FP_UNPACK_SP(SB, vb.wp + 1);
+			FP_UNPACK_RAW_SP(SB, vb.wp + 1);
 
-			pr_debug("SB: %ld %08lx %ld (%ld)\n",
-					SB_s, SB_f, SB_e, SB_c);
+			pr_debug("SB: %ld %08lx %ld\n",
+					SB_s, SB_f, SB_e);
 
-			FP_CONV(D, S, 2, 1, DR, SB);
-			goto pack_d;
+			FP_EXTEND(D, S, 2, 1, DR, SB);
+			goto pack_raw_d;
 		}
 
 		case EFDCTUIDZ:
@@ -466,6 +481,20 @@ cmp_s:
 		}
 		break;
 
+pack_raw_d:
+		pr_debug("DR: %ld %08lx %08lx %ld\n",
+				DR_s, DR_f1, DR_f0, DR_e);
+
+		FP_PACK_RAW_DP(vc.dp, DR);
+		goto update_regs;
+
+pack_semiraw_d:
+		pr_debug("DR: %ld %08lx %08lx %ld\n",
+				DR_s, DR_f1, DR_f0, DR_e);
+
+		FP_PACK_SEMIRAW_DP(vc.dp, DR);
+		goto update_regs;
+
 pack_d:
 		pr_debug("DR: %ld %08lx %08lx %ld (%ld)\n",
 				DR_s, DR_f1, DR_f0, DR_e, DR_c);
@@ -474,9 +503,7 @@ pack_d:
 		goto update_regs;
 
 cmp_d:
-		FP_CMP_D(IR, DA, DB, 3);
-		if (IR = 3 && (FP_ISSIGNAN_D(DA) || FP_ISSIGNAN_D(DB)))
-			FP_SET_EXCEPTION(FP_EX_INVALID);
+		FP_CMP_D(IR, DA, DB, 3, 1);
 		if (IR = cmp) {
 			IR = 0x4;
 		} else {
@@ -492,18 +519,25 @@ cmp_d:
 		int IR0, IR1;
 
 		switch (type) {
-		case AB:
-		case XCR:
+		case XCR|URAW:
+			FP_UNPACK_RAW_SP(SA0, va.wp);
+			FP_UNPACK_RAW_SP(SA1, va.wp + 1);
+		case XB|URAW:
+			FP_UNPACK_RAW_SP(SB0, vb.wp);
+			FP_UNPACK_RAW_SP(SB1, vb.wp + 1);
+			break;
+		case AB|USEMI:
+			FP_UNPACK_SEMIRAW_SP(SA0, va.wp);
+			FP_UNPACK_SEMIRAW_SP(SA1, va.wp + 1);
+			FP_UNPACK_SEMIRAW_SP(SB0, vb.wp);
+			FP_UNPACK_SEMIRAW_SP(SB1, vb.wp + 1);
+			break;
+		case AB|UCOOK:
 			FP_UNPACK_SP(SA0, va.wp);
 			FP_UNPACK_SP(SA1, va.wp + 1);
-		case XB:
 			FP_UNPACK_SP(SB0, vb.wp);
 			FP_UNPACK_SP(SB1, vb.wp + 1);
 			break;
-		case XA:
-			FP_UNPACK_SP(SA0, va.wp);
-			FP_UNPACK_SP(SA1, va.wp + 1);
-			break;
 		}
 
 		pr_debug("SA0: %ld %08lx %ld (%ld)\n",
@@ -534,12 +568,12 @@ cmp_d:
 		case EVFSADD:
 			FP_ADD_S(SR0, SA0, SB0);
 			FP_ADD_S(SR1, SA1, SB1);
-			goto pack_vs;
+			goto pack_semiraw_vs;
 
 		case EVFSSUB:
 			FP_SUB_S(SR0, SA0, SB0);
 			FP_SUB_S(SR1, SA1, SB1);
-			goto pack_vs;
+			goto pack_semiraw_vs;
 
 		case EVFSMUL:
 			FP_MUL_S(SR0, SA0, SB0);
@@ -624,6 +658,16 @@ cmp_d:
 		}
 		break;
 
+pack_semiraw_vs:
+		pr_debug("SR0: %ld %08lx %ld\n",
+				SR0_s, SR0_f, SR0_e);
+		pr_debug("SR1: %ld %08lx %ld\n",
+				SR1_s, SR1_f, SR1_e);
+
+		FP_PACK_SEMIRAW_SP(vc.wp, SR0);
+		FP_PACK_SEMIRAW_SP(vc.wp + 1, SR1);
+		goto update_regs;
+
 pack_vs:
 		pr_debug("SR0: %ld %08lx %ld (%ld)\n",
 				SR0_s, SR0_f, SR0_e, SR0_c);
@@ -638,12 +682,8 @@ cmp_vs:
 		{
 			int ch, cl;
 
-			FP_CMP_S(IR0, SA0, SB0, 3);
-			FP_CMP_S(IR1, SA1, SB1, 3);
-			if (IR0 = 3 && (FP_ISSIGNAN_S(SA0) || FP_ISSIGNAN_S(SB0)))
-				FP_SET_EXCEPTION(FP_EX_INVALID);
-			if (IR1 = 3 && (FP_ISSIGNAN_S(SA1) || FP_ISSIGNAN_S(SB1)))
-				FP_SET_EXCEPTION(FP_EX_INVALID);
+			FP_CMP_S(IR0, SA0, SB0, 3, 1);
+			FP_CMP_S(IR1, SA1, SB1, 3, 1);
 			ch = (IR0 = cmp) ? 1 : 0;
 			cl = (IR1 = cmp) ? 1 : 0;
 			IR = (ch << 3) | (cl << 2) | ((ch | cl) << 1) |
@@ -737,7 +777,7 @@ int speround_handler(struct pt_regs *regs)
 		return -EINVAL;         /* not an spe instruction */
 
 	func = speinsn & 0x7ff;
-	type = insn_type(func);
+	type = insn_type(func) & TYPE_MASK;
 	if (type = XCR) return -ENOSYS;
 
 	__FPU_FPSCR = mfspr(SPRN_SPEFSCR);
diff --git a/arch/powerpc/math-emu/stfs.c b/arch/powerpc/math-emu/stfs.c
index 6122147..6072b14 100644
--- a/arch/powerpc/math-emu/stfs.c
+++ b/arch/powerpc/math-emu/stfs.c
@@ -19,19 +19,19 @@ stfs(void *frS, void *ea)
 	printk("%s: S %p, ea %p\n", __func__, frS, ea);
 #endif
 
-	FP_UNPACK_DP(A, frS);
+	FP_UNPACK_SEMIRAW_DP(A, frS);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
 #endif
 
-	FP_CONV(S, D, 1, 2, R, A);
+	FP_TRUNC(S, D, 1, 2, R, A);
 
 #ifdef DEBUG
 	printk("R: %ld %lu %ld (%ld)\n", R_s, R_f, R_e, R_c);
 #endif
 
-	_FP_PACK_CANONICAL(S, 1, R);
+	_FP_PACK_SEMIRAW(S, 1, R);
 	if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS)) {
 		_FP_PACK_RAW_1_P(S, &f, R);
 		if (copy_to_user(ea, &f, sizeof(float)))
diff --git a/arch/s390/include/asm/sfp-machine.h b/arch/s390/include/asm/sfp-machine.h
index 4e16aed..67f9eed 100644
--- a/arch/s390/include/asm/sfp-machine.h
+++ b/arch/s390/include/asm/sfp-machine.h
@@ -38,6 +38,13 @@
 #define _FP_MUL_MEAT_Q(R,X,Y)					\
   _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
 
+#define _FP_MUL_MEAT_DW_S(R,X,Y)				\
+  _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_D(R,X,Y)				\
+  _FP_MUL_MEAT_DW_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_Q(R,X,Y)				\
+  _FP_MUL_MEAT_DW_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
 #define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv(S,R,X,Y)
 #define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
 #define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
@@ -50,6 +57,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /*
  * If one NaN is signaling and the other is not,
@@ -139,4 +147,6 @@
 /* We write the results always */
 #define FP_INHIBIT_RESULTS 0
 
+#define _FP_TININESS_AFTER_ROUNDING 0
+
 #endif
diff --git a/arch/s390/math-emu/math.c b/arch/s390/math-emu/math.c
index a6ba0d7..4dd5015 100644
--- a/arch/s390/math-emu/math.c
+++ b/arch/s390/math-emu/math.c
@@ -152,12 +152,12 @@ static int emu_axbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[rx].ui;
         cvt.w.low = current->thread.fp_regs.fprs[rx+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_SEMIRAW_QP(QA, &cvt.ld);
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QB, &cvt.ld);
+        FP_UNPACK_SEMIRAW_QP(QB, &cvt.ld);
         FP_ADD_Q(QR, QA, QB);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_PACK_SEMIRAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         emu_set_CC_cs(regs, QR_c, QR_s);
@@ -171,10 +171,10 @@ static int emu_adbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-        FP_UNPACK_DP(DB, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+        FP_UNPACK_SEMIRAW_DP(DB, &current->thread.fp_regs.fprs[ry].d);
         FP_ADD_D(DR, DA, DB);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -186,10 +186,10 @@ static int emu_adb (struct pt_regs *regs, int rx, double *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-        FP_UNPACK_DP(DB, val);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+        FP_UNPACK_SEMIRAW_DP(DB, val);
         FP_ADD_D(DR, DA, DB);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -201,10 +201,10 @@ static int emu_aebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-        FP_UNPACK_SP(SB, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_SEMIRAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+        FP_UNPACK_SEMIRAW_SP(SB, &current->thread.fp_regs.fprs[ry].f);
         FP_ADD_S(SR, SA, SB);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
@@ -216,10 +216,10 @@ static int emu_aeb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-        FP_UNPACK_SP(SB, val);
+        FP_UNPACK_SEMIRAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+        FP_UNPACK_SEMIRAW_SP(SB, val);
         FP_ADD_S(SR, SA, SB);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
@@ -236,7 +236,7 @@ static int emu_cxbr (struct pt_regs *regs, int rx, int ry) {
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
         FP_UNPACK_RAW_QP(QB, &cvt.ld);
-        FP_CMP_Q(IR, QA, QB, 3);
+        FP_CMP_Q(IR, QA, QB, 3, 0);
         /*
          * IR = -1 if DA < DB, IR = 0 if DA = DB,
          * IR = 1 if DA > DB and IR = 3 if unorderded
@@ -252,7 +252,7 @@ static int emu_cdbr (struct pt_regs *regs, int rx, int ry) {
 
         FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_RAW_DP(DB, &current->thread.fp_regs.fprs[ry].d);
-        FP_CMP_D(IR, DA, DB, 3);
+        FP_CMP_D(IR, DA, DB, 3, 0);
         /*
          * IR = -1 if DA < DB, IR = 0 if DA = DB,
          * IR = 1 if DA > DB and IR = 3 if unorderded
@@ -268,7 +268,7 @@ static int emu_cdb (struct pt_regs *regs, int rx, double *val) {
 
         FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_RAW_DP(DB, val);
-        FP_CMP_D(IR, DA, DB, 3);
+        FP_CMP_D(IR, DA, DB, 3, 0);
         /*
          * IR = -1 if DA < DB, IR = 0 if DA = DB,
          * IR = 1 if DA > DB and IR = 3 if unorderded
@@ -284,7 +284,7 @@ static int emu_cebr (struct pt_regs *regs, int rx, int ry) {
 
         FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_RAW_SP(SB, &current->thread.fp_regs.fprs[ry].f);
-        FP_CMP_S(IR, SA, SB, 3);
+        FP_CMP_S(IR, SA, SB, 3, 0);
         /*
          * IR = -1 if DA < DB, IR = 0 if DA = DB,
          * IR = 1 if DA > DB and IR = 3 if unorderded
@@ -300,7 +300,7 @@ static int emu_ceb (struct pt_regs *regs, int rx, float *val) {
 
         FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_RAW_SP(SB, val);
-        FP_CMP_S(IR, SA, SB, 3);
+        FP_CMP_S(IR, SA, SB, 3, 0);
         /*
          * IR = -1 if DA < DB, IR = 0 if DA = DB,
          * IR = 1 if DA > DB and IR = 3 if unorderded
@@ -322,14 +322,12 @@ static int emu_kxbr (struct pt_regs *regs, int rx, int ry) {
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
         FP_UNPACK_QP(QB, &cvt.ld);
-        FP_CMP_Q(IR, QA, QB, 3);
+        FP_CMP_Q(IR, QA, QB, 3, 2);
         /*
          * IR = -1 if DA < DB, IR = 0 if DA = DB,
          * IR = 1 if DA > DB and IR = 3 if unorderded
          */
         emu_set_CC(regs, (IR = -1) ? 1 : (IR = 1) ? 2 : IR);
-        if (IR = 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -341,14 +339,12 @@ static int emu_kdbr (struct pt_regs *regs, int rx, int ry) {
 
         FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_RAW_DP(DB, &current->thread.fp_regs.fprs[ry].d);
-        FP_CMP_D(IR, DA, DB, 3);
+        FP_CMP_D(IR, DA, DB, 3, 2);
         /*
          * IR = -1 if DA < DB, IR = 0 if DA = DB,
          * IR = 1 if DA > DB and IR = 3 if unorderded
          */
         emu_set_CC(regs, (IR = -1) ? 1 : (IR = 1) ? 2 : IR);
-        if (IR = 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -360,14 +356,12 @@ static int emu_kdb (struct pt_regs *regs, int rx, double *val) {
 
         FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_RAW_DP(DB, val);
-        FP_CMP_D(IR, DA, DB, 3);
+        FP_CMP_D(IR, DA, DB, 3, 2);
         /*
          * IR = -1 if DA < DB, IR = 0 if DA = DB,
          * IR = 1 if DA > DB and IR = 3 if unorderded
          */
         emu_set_CC(regs, (IR = -1) ? 1 : (IR = 1) ? 2 : IR);
-        if (IR = 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -379,14 +373,12 @@ static int emu_kebr (struct pt_regs *regs, int rx, int ry) {
 
         FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_RAW_SP(SB, &current->thread.fp_regs.fprs[ry].f);
-        FP_CMP_S(IR, SA, SB, 3);
+        FP_CMP_S(IR, SA, SB, 3, 2);
         /*
          * IR = -1 if DA < DB, IR = 0 if DA = DB,
          * IR = 1 if DA > DB and IR = 3 if unorderded
          */
         emu_set_CC(regs, (IR = -1) ? 1 : (IR = 1) ? 2 : IR);
-        if (IR = 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -398,14 +390,12 @@ static int emu_keb (struct pt_regs *regs, int rx, float *val) {
 
         FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_RAW_SP(SB, val);
-        FP_CMP_S(IR, SA, SB, 3);
+        FP_CMP_S(IR, SA, SB, 3, 2);
         /*
          * IR = -1 if DA < DB, IR = 0 if DA = DB,
          * IR = 1 if DA > DB and IR = 3 if unorderded
          */
         emu_set_CC(regs, (IR = -1) ? 1 : (IR = 1) ? 2 : IR);
-        if (IR = 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -419,8 +409,8 @@ static int emu_cxfbr (struct pt_regs *regs, int rx, int ry) {
 
 	mode = current->thread.fp_regs.fpc & 3;
         si = regs->gprs[ry];
-        FP_FROM_INT_Q(QR, si, 32, int);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_FROM_INT_Q(QR, si, 32, unsigned int);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -435,8 +425,8 @@ static int emu_cdfbr (struct pt_regs *regs, int rx, int ry) {
 
 	mode = current->thread.fp_regs.fpc & 3;
         si = regs->gprs[ry];
-        FP_FROM_INT_D(DR, si, 32, int);
-        FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+        FP_FROM_INT_D(DR, si, 32, unsigned int);
+        FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
 }
 
@@ -449,8 +439,8 @@ static int emu_cefbr (struct pt_regs *regs, int rx, int ry) {
 
 	mode = current->thread.fp_regs.fpc & 3;
         si = regs->gprs[ry];
-        FP_FROM_INT_S(SR, si, 32, int);
-        FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+        FP_FROM_INT_S(SR, si, 32, unsigned int);
+        FP_PACK_RAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         return _fex;
 }
 
@@ -459,7 +449,7 @@ static int emu_cfxbr (struct pt_regs *regs, int rx, int ry, int mask) {
         FP_DECL_Q(QA);
         FP_DECL_EX;
 	mathemu_ldcv cvt;
-        __s32 si;
+        __u32 ui;
         int mode;
 
 	if (mask = 0)
@@ -470,9 +460,9 @@ static int emu_cfxbr (struct pt_regs *regs, int rx, int ry, int mask) {
 		mode = mask - 4;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
-        FP_TO_INT_ROUND_Q(si, QA, 32, 1);
-        regs->gprs[rx] = si;
+        FP_UNPACK_RAW_QP(QA, &cvt.ld);
+        FP_TO_INT_ROUND_Q(ui, QA, 32, 1);
+        regs->gprs[rx] = ui;
         emu_set_CC_cs(regs, QA_c, QA_s);
         return _fex;
 }
@@ -481,7 +471,7 @@ static int emu_cfxbr (struct pt_regs *regs, int rx, int ry, int mask) {
 static int emu_cfdbr (struct pt_regs *regs, int rx, int ry, int mask) {
         FP_DECL_D(DA);
         FP_DECL_EX;
-        __s32 si;
+        __u32 ui;
         int mode;
 
 	if (mask = 0)
@@ -490,9 +480,9 @@ static int emu_cfdbr (struct pt_regs *regs, int rx, int ry, int mask) {
 		mode = FP_RND_NEAREST;
 	else
 		mode = mask - 4;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
-        FP_TO_INT_ROUND_D(si, DA, 32, 1);
-        regs->gprs[rx] = si;
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+        FP_TO_INT_ROUND_D(ui, DA, 32, 1);
+        regs->gprs[rx] = ui;
         emu_set_CC_cs(regs, DA_c, DA_s);
         return _fex;
 }
@@ -501,7 +491,7 @@ static int emu_cfdbr (struct pt_regs *regs, int rx, int ry, int mask) {
 static int emu_cfebr (struct pt_regs *regs, int rx, int ry, int mask) {
         FP_DECL_S(SA);
         FP_DECL_EX;
-        __s32 si;
+        __u32 ui;
         int mode;
 
 	if (mask = 0)
@@ -510,9 +500,9 @@ static int emu_cfebr (struct pt_regs *regs, int rx, int ry, int mask) {
 		mode = FP_RND_NEAREST;
 	else
 		mode = mask - 4;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
-        FP_TO_INT_ROUND_S(si, SA, 32, 1);
-        regs->gprs[rx] = si;
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+        FP_TO_INT_ROUND_S(ui, SA, 32, 1);
+        regs->gprs[rx] = ui;
         emu_set_CC_cs(regs, SA_c, SA_s);
         return _fex;
 }
@@ -662,9 +652,9 @@ static int emu_lcxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_RAW_QP(QA, &cvt.ld);
 	FP_NEG_Q(QR, QA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         emu_set_CC_cs(regs, QR_c, QR_s);
@@ -678,9 +668,9 @@ static int emu_lcdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
 	FP_NEG_D(DR, DA);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -692,9 +682,9 @@ static int emu_lcebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
 	FP_NEG_S(SR, SA);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_RAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
@@ -773,9 +763,9 @@ static int emu_lxdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
-	FP_CONV (Q, D, 4, 2, QR, DA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+	FP_EXTEND (Q, D, 4, 2, QR, DA);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -789,9 +779,9 @@ static int emu_lxdb (struct pt_regs *regs, int rx, double *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, val);
-	FP_CONV (Q, D, 4, 2, QR, DA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_UNPACK_RAW_DP(DA, val);
+	FP_EXTEND (Q, D, 4, 2, QR, DA);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -805,9 +795,9 @@ static int emu_lxebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
-	FP_CONV (Q, S, 4, 1, QR, SA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+	FP_EXTEND (Q, S, 4, 1, QR, SA);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -821,9 +811,9 @@ static int emu_lxeb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, val);
-	FP_CONV (Q, S, 4, 1, QR, SA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_UNPACK_RAW_SP(SA, val);
+	FP_EXTEND (Q, S, 4, 1, QR, SA);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -836,9 +826,9 @@ static int emu_ldebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
-	FP_CONV (D, S, 2, 1, DR, SA);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+	FP_EXTEND (D, S, 2, 1, DR, SA);
+	FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
 }
 
@@ -849,9 +839,9 @@ static int emu_ldeb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, val);
-	FP_CONV (D, S, 2, 1, DR, SA);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+        FP_UNPACK_RAW_SP(SA, val);
+	FP_EXTEND (D, S, 2, 1, DR, SA);
+	FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
 }
 
@@ -865,10 +855,10 @@ static int emu_lnxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_RAW_QP(QA, &cvt.ld);
         if (QA_s = 0) {
 		FP_NEG_Q(QR, QA);
-		FP_PACK_QP(&cvt.ld, QR);
+		FP_PACK_RAW_QP(&cvt.ld, QR);
 		current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
 		current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
 	} else {
@@ -888,10 +878,10 @@ static int emu_lndbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
         if (DA_s = 0) {
 		FP_NEG_D(DR, DA);
-		FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+		FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
 	} else
 		current->thread.fp_regs.fprs[rx].ui  			current->thread.fp_regs.fprs[ry].ui;
@@ -906,10 +896,10 @@ static int emu_lnebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
         if (SA_s = 0) {
 		FP_NEG_S(SR, SA);
-		FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+		FP_PACK_RAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
 	} else
 		current->thread.fp_regs.fprs[rx].ui  			current->thread.fp_regs.fprs[ry].ui;
@@ -927,10 +917,10 @@ static int emu_lpxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_RAW_QP(QA, &cvt.ld);
         if (QA_s != 0) {
 		FP_NEG_Q(QR, QA);
-		FP_PACK_QP(&cvt.ld, QR);
+		FP_PACK_RAW_QP(&cvt.ld, QR);
 		current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
 		current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
 	} else{
@@ -950,10 +940,10 @@ static int emu_lpdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
         if (DA_s != 0) {
 		FP_NEG_D(DR, DA);
-		FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+		FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
 	} else
 		current->thread.fp_regs.fprs[rx].ui  			current->thread.fp_regs.fprs[ry].ui;
@@ -968,10 +958,10 @@ static int emu_lpebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
         if (SA_s != 0) {
 		FP_NEG_S(SR, SA);
-		FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+		FP_PACK_RAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
 	} else
 		current->thread.fp_regs.fprs[rx].ui  			current->thread.fp_regs.fprs[ry].ui;
@@ -989,9 +979,9 @@ static int emu_ldxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
-	FP_CONV (D, Q, 2, 4, DR, QA);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].f, DR);
+        FP_UNPACK_SEMIRAW_QP(QA, &cvt.ld);
+	FP_TRUNC (D, Q, 2, 4, DR, QA);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].f, DR);
         return _fex;
 }
 
@@ -1005,9 +995,9 @@ static int emu_lexbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
-	FP_CONV (S, Q, 1, 4, SR, QA);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+        FP_UNPACK_SEMIRAW_QP(QA, &cvt.ld);
+	FP_TRUNC (S, Q, 1, 4, SR, QA);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         return _fex;
 }
 
@@ -1018,9 +1008,9 @@ static int emu_ledbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
-	FP_CONV (S, D, 1, 2, SR, DA);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+	FP_TRUNC (S, D, 1, 2, SR, DA);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         return _fex;
 }
 
@@ -1081,10 +1071,12 @@ static int emu_mxdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-	FP_CONV (Q, D, 4, 2, QA, DA);
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
-	FP_CONV (Q, D, 4, 2, QB, DA);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+	FP_EXTEND (Q, D, 4, 2, QA, DA);
+	_FP_UNPACK_CANONICAL(Q, 4, QA);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+	FP_EXTEND (Q, D, 4, 2, QB, DA);
+	_FP_UNPACK_CANONICAL(Q, 4, QB);
         FP_MUL_Q(QR, QA, QB);
         FP_PACK_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
@@ -1146,10 +1138,12 @@ static int emu_mdebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-	FP_CONV (D, S, 2, 1, DA, SA);
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
-	FP_CONV (D, S, 2, 1, DB, SA);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+	FP_EXTEND (D, S, 2, 1, DA, SA);
+	_FP_UNPACK_CANONICAL(D, 2, DA);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+	FP_EXTEND (D, S, 2, 1, DB, SA);
+	_FP_UNPACK_CANONICAL(D, 2, DB);
         FP_MUL_D(DR, DA, DB);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
@@ -1162,10 +1156,12 @@ static int emu_mdeb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-	FP_CONV (D, S, 2, 1, DA, SA);
-        FP_UNPACK_SP(SA, val);
-	FP_CONV (D, S, 2, 1, DB, SA);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+	FP_EXTEND (D, S, 2, 1, DA, SA);
+	_FP_UNPACK_CANONICAL(D, 2, DA);
+        FP_UNPACK_RAW_SP(SA, val);
+	FP_EXTEND (D, S, 2, 1, DB, SA);
+	_FP_UNPACK_CANONICAL(D, 2, DB);
         FP_MUL_D(DR, DA, DB);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
@@ -1181,8 +1177,7 @@ static int emu_madbr (struct pt_regs *regs, int rx, int ry, int rz) {
         FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_DP(DB, &current->thread.fp_regs.fprs[ry].d);
         FP_UNPACK_DP(DC, &current->thread.fp_regs.fprs[rz].d);
-        FP_MUL_D(DR, DA, DB);
-        FP_ADD_D(DR, DR, DC);
+	FP_FMA_D(DR, DA, DB, DC);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rz].d, DR);
         return _fex;
 }
@@ -1197,8 +1192,7 @@ static int emu_madb (struct pt_regs *regs, int rx, double *val, int rz) {
         FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_DP(DB, val);
         FP_UNPACK_DP(DC, &current->thread.fp_regs.fprs[rz].d);
-        FP_MUL_D(DR, DA, DB);
-        FP_ADD_D(DR, DR, DC);
+	FP_FMA_D(DR, DA, DB, DC);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rz].d, DR);
         return _fex;
 }
@@ -1213,8 +1207,7 @@ static int emu_maebr (struct pt_regs *regs, int rx, int ry, int rz) {
         FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_SP(SB, &current->thread.fp_regs.fprs[ry].f);
         FP_UNPACK_SP(SC, &current->thread.fp_regs.fprs[rz].f);
-        FP_MUL_S(SR, SA, SB);
-        FP_ADD_S(SR, SR, SC);
+        FP_FMA_S(SR, SA, SB, SC);
 	FP_PACK_SP(&current->thread.fp_regs.fprs[rz].f, SR);
         return _fex;
 }
@@ -1229,8 +1222,7 @@ static int emu_maeb (struct pt_regs *regs, int rx, float *val, int rz) {
         FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_SP(SB, val);
         FP_UNPACK_SP(SC, &current->thread.fp_regs.fprs[rz].f);
-        FP_MUL_S(SR, SA, SB);
-        FP_ADD_S(SR, SR, SC);
+        FP_FMA_S(SR, SA, SB, SC);
 	FP_PACK_SP(&current->thread.fp_regs.fprs[rz].f, SR);
         return _fex;
 }
@@ -1245,8 +1237,9 @@ static int emu_msdbr (struct pt_regs *regs, int rx, int ry, int rz) {
         FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_DP(DB, &current->thread.fp_regs.fprs[ry].d);
         FP_UNPACK_DP(DC, &current->thread.fp_regs.fprs[rz].d);
-        FP_MUL_D(DR, DA, DB);
-        FP_SUB_D(DR, DR, DC);
+	if (DC##_c != FP_CLS_NAN)
+		DC##_s ^= 1;
+	FP_FMA_D(DR, DA, DB, DC);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rz].d, DR);
         return _fex;
 }
@@ -1261,8 +1254,9 @@ static int emu_msdb (struct pt_regs *regs, int rx, double *val, int rz) {
         FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_DP(DB, val);
         FP_UNPACK_DP(DC, &current->thread.fp_regs.fprs[rz].d);
-        FP_MUL_D(DR, DA, DB);
-        FP_SUB_D(DR, DR, DC);
+	if (DC##_c != FP_CLS_NAN)
+		DC##_s ^= 1;
+	FP_FMA_D(DR, DA, DB, DC);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rz].d, DR);
         return _fex;
 }
@@ -1277,8 +1271,9 @@ static int emu_msebr (struct pt_regs *regs, int rx, int ry, int rz) {
         FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_SP(SB, &current->thread.fp_regs.fprs[ry].f);
         FP_UNPACK_SP(SC, &current->thread.fp_regs.fprs[rz].f);
-        FP_MUL_S(SR, SA, SB);
-        FP_SUB_S(SR, SR, SC);
+	if (SC##_c != FP_CLS_NAN)
+		SC##_s ^= 1;
+        FP_FMA_S(SR, SA, SB, SC);
 	FP_PACK_SP(&current->thread.fp_regs.fprs[rz].f, SR);
         return _fex;
 }
@@ -1293,8 +1288,9 @@ static int emu_mseb (struct pt_regs *regs, int rx, float *val, int rz) {
         FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_SP(SB, val);
         FP_UNPACK_SP(SC, &current->thread.fp_regs.fprs[rz].f);
-        FP_MUL_S(SR, SA, SB);
-        FP_SUB_S(SR, SR, SC);
+	if (SC##_c != FP_CLS_NAN)
+		SC##_s ^= 1;
+        FP_FMA_S(SR, SA, SB, SC);
 	FP_PACK_SP(&current->thread.fp_regs.fprs[rz].f, SR);
         return _fex;
 }
@@ -1395,12 +1391,12 @@ static int emu_sxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[rx].ui;
         cvt.w.low = current->thread.fp_regs.fprs[rx+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_SEMIRAW_QP(QA, &cvt.ld);
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QB, &cvt.ld);
+        FP_UNPACK_SEMIRAW_QP(QB, &cvt.ld);
         FP_SUB_Q(QR, QA, QB);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_PACK_SEMIRAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         emu_set_CC_cs(regs, QR_c, QR_s);
@@ -1414,10 +1410,10 @@ static int emu_sdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-        FP_UNPACK_DP(DB, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+        FP_UNPACK_SEMIRAW_DP(DB, &current->thread.fp_regs.fprs[ry].d);
         FP_SUB_D(DR, DA, DB);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -1429,10 +1425,10 @@ static int emu_sdb (struct pt_regs *regs, int rx, double *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-        FP_UNPACK_DP(DB, val);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+        FP_UNPACK_SEMIRAW_DP(DB, val);
         FP_SUB_D(DR, DA, DB);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -1444,10 +1440,10 @@ static int emu_sebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-        FP_UNPACK_SP(SB, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_SEMIRAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+        FP_UNPACK_SEMIRAW_SP(SB, &current->thread.fp_regs.fprs[ry].f);
         FP_SUB_S(SR, SA, SB);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
@@ -1459,10 +1455,10 @@ static int emu_seb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-        FP_UNPACK_SP(SB, val);
+        FP_UNPACK_SEMIRAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+        FP_UNPACK_SEMIRAW_SP(SB, val);
         FP_SUB_S(SR, SA, SB);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
diff --git a/arch/sh/include/asm/sfp-machine.h b/arch/sh/include/asm/sfp-machine.h
index d3c5484..01e05fe 100644
--- a/arch/sh/include/asm/sfp-machine.h
+++ b/arch/sh/include/asm/sfp-machine.h
@@ -37,6 +37,13 @@
 #define _FP_MUL_MEAT_Q(R,X,Y)					\
   _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
 
+#define _FP_MUL_MEAT_DW_S(R,X,Y)				\
+  _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_D(R,X,Y)				\
+  _FP_MUL_MEAT_DW_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_Q(R,X,Y)				\
+  _FP_MUL_MEAT_DW_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
 #define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv(S,R,X,Y)
 #define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
 #define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
@@ -49,6 +56,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /*
  * If one NaN is signaling and the other is not,
@@ -80,5 +88,7 @@
 #define FP_EX_UNDERFLOW		(1<<1)
 #define FP_EX_INEXACT		(1<<0)
 
+#define _FP_TININESS_AFTER_ROUNDING 1
+
 #endif
 
diff --git a/arch/sh/math-emu/math.c b/arch/sh/math-emu/math.c
index 04aa55f..5975df5 100644
--- a/arch/sh/math-emu/math.c
+++ b/arch/sh/math-emu/math.c
@@ -55,11 +55,26 @@
 #define READ(d,a)	({if(get_user(d, (typeof (d)*)a)) return -EFAULT;})
 
 #define PACK_S(r,f)	FP_PACK_SP(&r,f)
+#define PACK_SEMIRAW_S(r,f)	FP_PACK_SEMIRAW_SP(&r,f)
+#define PACK_RAW_S(r,f)	FP_PACK_RAW_SP(&r,f)
 #define UNPACK_S(f,r)	FP_UNPACK_SP(f,&r)
+#define UNPACK_SEMIRAW_S(f,r)	FP_UNPACK_SEMIRAW_SP(f,&r)
+#define UNPACK_RAW_S(f,r)	FP_UNPACK_RAW_SP(f,&r)
 #define PACK_D(r,f) \
 	{u32 t[2]; FP_PACK_DP(t,f); ((u32*)&r)[0]=t[1]; ((u32*)&r)[1]=t[0];}
+#define PACK_SEMIRAW_D(r,f) \
+	{u32 t[2]; FP_PACK_SEMIRAW_DP(t,f); ((u32*)&r)[0]=t[1]; \
+		((u32*)&r)[1]=t[0];}
+#define PACK_RAW_D(r,f) \
+	{u32 t[2]; FP_PACK_RAW_DP(t,f); ((u32*)&r)[0]=t[1]; ((u32*)&r)[1]=t[0];}
 #define UNPACK_D(f,r) \
 	{u32 t[2]; t[0]=((u32*)&r)[1]; t[1]=((u32*)&r)[0]; FP_UNPACK_DP(f,t);}
+#define UNPACK_SEMIRAW_D(f,r) \
+	{u32 t[2]; t[0]=((u32*)&r)[1]; t[1]=((u32*)&r)[0]; \
+		FP_UNPACK_SEMIRAW_DP(f,t);}
+#define UNPACK_RAW_D(f,r) \
+	{u32 t[2]; t[0]=((u32*)&r)[1]; t[1]=((u32*)&r)[0]; \
+		FP_UNPACK_RAW_DP(f,t);}
 
 // 2 args instructions.
 #define BOTH_PRmn(op,x) \
@@ -68,11 +83,11 @@
 #define CMP_X(SZ,R,M,N) do{ \
 	FP_DECL_##SZ(Fm); FP_DECL_##SZ(Fn); \
 	UNPACK_##SZ(Fm, M); UNPACK_##SZ(Fn, N); \
-	FP_CMP_##SZ(R, Fn, Fm, 2); }while(0)
+	FP_CMP_##SZ(R, Fn, Fm, 2, 0); }while(0)
 #define EQ_X(SZ,R,M,N) do{ \
 	FP_DECL_##SZ(Fm); FP_DECL_##SZ(Fn); \
 	UNPACK_##SZ(Fm, M); UNPACK_##SZ(Fn, N); \
-	FP_CMP_EQ_##SZ(R, Fn, Fm); }while(0)
+	FP_CMP_EQ_##SZ(R, Fn, Fm, 0); }while(0)
 #define CMP(OP) ({ int r; BOTH_PRmn(OP##_X,r); r; })
 
 static int
@@ -102,17 +117,23 @@ fcmp_eq(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
 	FP_##OP##_##SZ(Fr, Fn, Fm); \
 	PACK_##SZ(N, Fr); }while(0)
 
+#define ARITH_SEMIRAW_X(SZ,OP,M,N) do{ \
+	FP_DECL_##SZ(Fm); FP_DECL_##SZ(Fn); FP_DECL_##SZ(Fr); \
+	UNPACK_SEMIRAW_##SZ(Fm, M); UNPACK_SEMIRAW_##SZ(Fn, N); \
+	FP_##OP##_##SZ(Fr, Fn, Fm); \
+	PACK_SEMIRAW_##SZ(N, Fr); }while(0)
+
 static int
 fadd(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
 {
-	BOTH_PRmn(ARITH_X, ADD);
+	BOTH_PRmn(ARITH_SEMIRAW_X, ADD);
 	return 0;
 }
 
 static int
 fsub(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
 {
-	BOTH_PRmn(ARITH_X, SUB);
+	BOTH_PRmn(ARITH_SEMIRAW_X, SUB);
 	return 0;
 }
 
@@ -135,15 +156,13 @@ fmac(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
 {
 	FP_DECL_EX;
 	FP_DECL_S(Fr);
-	FP_DECL_S(Ft);
 	FP_DECL_S(F0);
 	FP_DECL_S(Fm);
 	FP_DECL_S(Fn);
 	UNPACK_S(F0, FR0);
 	UNPACK_S(Fm, FRm);
 	UNPACK_S(Fn, FRn);
-	FP_MUL_S(Ft, Fm, F0);
-	FP_ADD_S(Fr, Fn, Ft);
+	FP_FMA_S(Fr, Fm, F0, Fn);
 	PACK_S(FRn, Fr);
 	return 0;
 }
@@ -284,8 +303,8 @@ NOTYETn(fsrra)
 
 #define EMU_FLOAT_X(SZ,N) do { \
 	FP_DECL_##SZ(Fn); \
-	FP_FROM_INT_##SZ(Fn, FPUL, 32, int); \
-	PACK_##SZ(N, Fn); }while(0)
+	FP_FROM_INT_##SZ(Fn, FPUL, 32, unsigned int); \
+	PACK_RAW_##SZ(N, Fn); }while(0)
 static int ffloat(struct sh_fpu_soft_struct *fregs, int n)
 {
 	FP_DECL_EX;
@@ -300,7 +319,7 @@ static int ffloat(struct sh_fpu_soft_struct *fregs, int n)
 
 #define EMU_FTRC_X(SZ,N) do { \
 	FP_DECL_##SZ(Fn); \
-	UNPACK_##SZ(Fn, N); \
+	UNPACK_RAW_##SZ(Fn, N); \
 	FP_TO_INT_##SZ(FPUL, Fn, 32, 1); }while(0)
 static int ftrc(struct sh_fpu_soft_struct *fregs, int n)
 {
@@ -319,9 +338,9 @@ static int fcnvsd(struct sh_fpu_soft_struct *fregs, int n)
 	FP_DECL_EX;
 	FP_DECL_S(Fn);
 	FP_DECL_D(Fr);
-	UNPACK_S(Fn, FPUL);
-	FP_CONV(D, S, 2, 1, Fr, Fn);
-	PACK_D(DRn, Fr);
+	UNPACK_RAW_S(Fn, FPUL);
+	FP_EXTEND(D, S, 2, 1, Fr, Fn);
+	PACK_RAW_D(DRn, Fr);
 	return 0;
 }
 
@@ -330,9 +349,9 @@ static int fcnvds(struct sh_fpu_soft_struct *fregs, int n)
 	FP_DECL_EX;
 	FP_DECL_D(Fn);
 	FP_DECL_S(Fr);
-	UNPACK_D(Fn, DRn);
-	FP_CONV(S, D, 1, 2, Fr, Fn);
-	PACK_S(FPUL, Fr);
+	UNPACK_SEMIRAW_D(Fn, DRn);
+	FP_TRUNC(S, D, 1, 2, Fr, Fn);
+	PACK_SEMIRAW_S(FPUL, Fr);
 	return 0;
 }
 
diff --git a/arch/sparc/include/asm/sfp-machine_32.h b/arch/sparc/include/asm/sfp-machine_32.h
index 838c9d5..53ce267 100644
--- a/arch/sparc/include/asm/sfp-machine_32.h
+++ b/arch/sparc/include/asm/sfp-machine_32.h
@@ -50,6 +50,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /* If one NaN is signaling and the other is not,
  * we choose that one, otherwise we choose X.
@@ -209,4 +210,6 @@ extern struct task_struct *last_task_used_math;
 #define FP_TRAPPING_EXCEPTIONS ((last_task_used_math->thread.fsr >> 23) & 0x1f)
 #endif
 
+#define _FP_TININESS_AFTER_ROUNDING 0
+
 #endif
diff --git a/arch/sparc/include/asm/sfp-machine_64.h b/arch/sparc/include/asm/sfp-machine_64.h
index ca913ef..a83dbf6 100644
--- a/arch/sparc/include/asm/sfp-machine_64.h
+++ b/arch/sparc/include/asm/sfp-machine_64.h
@@ -48,6 +48,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /* If one NaN is signaling and the other is not,
  * we choose that one, otherwise we choose X.
@@ -90,4 +91,6 @@
 
 #define FP_TRAPPING_EXCEPTIONS ((current_thread_info()->xfsr[0] >> 23) & 0x1f)
 
+#define _FP_TININESS_AFTER_ROUNDING 0
+
 #endif
diff --git a/arch/sparc/math-emu/math_32.c b/arch/sparc/math-emu/math_32.c
index 5ce8f2f..f708ee0 100644
--- a/arch/sparc/math-emu/math_32.c
+++ b/arch/sparc/math-emu/math_32.c
@@ -276,9 +276,11 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 	/* Emulate the given insn, updating fsr and fregs appropriately. */
 	int type = 0;
 	/* r is rd, b is rs2 and a is rs1. The *u arg tells
-	   whether the argument should be packed/unpacked (0 - do not unpack/pack, 1 - unpack/pack)
+	   whether and how the argument should be packed/unpacked
+	   (0 - do not unpack/pack, 1 - unpack/pack raw, 2 - semi-raw,
+	   3 - cooked)
 	   non-u args tells the size of the argument (0 - no argument, 1 - single, 2 - double, 3 - quad */
-#define TYPE(dummy, r, ru, b, bu, a, au) type = (au << 2) | (a << 0) | (bu << 5) | (b << 3) | (ru << 8) | (r << 6)
+#define TYPE(dummy, r, ru, b, bu, a, au) type = (au << 2) | (a << 0) | (bu << 6) | (b << 4) | (ru << 10) | (r << 8)
 	int freg;
 	argp rs1 = NULL, rs2 = NULL, rd = NULL;
 	FP_DECL_EX;
@@ -286,6 +288,7 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 	FP_DECL_D(DA); FP_DECL_D(DB); FP_DECL_D(DR);
 	FP_DECL_Q(QA); FP_DECL_Q(QB); FP_DECL_Q(QR);
 	int IR;
+	unsigned int UIR;
 	long fsr;
 
 #ifdef DEBUG_MATHEMU
@@ -294,30 +297,30 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 
 	if ((insn & 0xc1f80000) = 0x81a00000)	/* FPOP1 */ {
 		switch ((insn >> 5) & 0x1ff) {
-		case FSQRTQ: TYPE(3,3,1,3,1,0,0); break;
+		case FSQRTQ: TYPE(3,3,3,3,3,0,0); break;
 		case FADDQ:
-		case FSUBQ:
+		case FSUBQ: TYPE(3,3,2,3,2,3,2); break;
 		case FMULQ:
-		case FDIVQ: TYPE(3,3,1,3,1,3,1); break;
-		case FDMULQ: TYPE(3,3,1,2,1,2,1); break;
-		case FQTOS: TYPE(3,1,1,3,1,0,0); break;
-		case FQTOD: TYPE(3,2,1,3,1,0,0); break;
+		case FDIVQ: TYPE(3,3,3,3,3,3,3); break;
+		case FDMULQ: TYPE(3,3,3,2,1,2,1); break;
+		case FQTOS: TYPE(3,1,2,3,2,0,0); break;
+		case FQTOD: TYPE(3,2,2,3,2,0,0); break;
 		case FITOQ: TYPE(3,3,1,1,0,0,0); break;
 		case FSTOQ: TYPE(3,3,1,1,1,0,0); break;
 		case FDTOQ: TYPE(3,3,1,2,1,0,0); break;
 		case FQTOI: TYPE(3,1,0,3,1,0,0); break;
-		case FSQRTS: TYPE(2,1,1,1,1,0,0); break;
-		case FSQRTD: TYPE(2,2,1,2,1,0,0); break;
+		case FSQRTS: TYPE(2,1,3,1,3,0,0); break;
+		case FSQRTD: TYPE(2,2,3,2,3,0,0); break;
 		case FADDD:
-		case FSUBD:
+		case FSUBD: TYPE(2,2,2,2,2,2,2); break;
 		case FMULD:
-		case FDIVD: TYPE(2,2,1,2,1,2,1); break;
+		case FDIVD: TYPE(2,2,3,2,3,2,3); break;
 		case FADDS:
-		case FSUBS:
+		case FSUBS: TYPE(2,1,2,1,2,1,2); break;
 		case FMULS:
-		case FDIVS: TYPE(2,1,1,1,1,1,1); break;
-		case FSMULD: TYPE(2,2,1,1,1,1,1); break;
-		case FDTOS: TYPE(2,1,1,2,1,0,0); break;
+		case FDIVS: TYPE(2,1,3,1,3,1,3); break;
+		case FSMULD: TYPE(2,2,3,1,1,1,1); break;
+		case FDTOS: TYPE(2,1,2,2,2,0,0); break;
 		case FSTOD: TYPE(2,2,1,1,1,0,0); break;
 		case FSTOI: TYPE(2,1,0,1,1,0,0); break;
 		case FDTOI: TYPE(2,1,0,2,1,0,0); break;
@@ -366,13 +369,19 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 		}
 	}
 	rs1 = (argp)&fregs[freg];
-	switch (type & 0x7) {
-	case 7: FP_UNPACK_QP (QA, rs1); break;
-	case 6: FP_UNPACK_DP (DA, rs1); break;
-	case 5: FP_UNPACK_SP (SA, rs1); break;
+	switch (type & 0xf) {
+	case 7: FP_UNPACK_RAW_QP (QA, rs1); break;
+	case 6: FP_UNPACK_RAW_DP (DA, rs1); break;
+	case 5: FP_UNPACK_RAW_SP (SA, rs1); break;
+	case 11: FP_UNPACK_SEMIRAW_QP (QA, rs1); break;
+	case 10: FP_UNPACK_SEMIRAW_DP (DA, rs1); break;
+	case 9: FP_UNPACK_SEMIRAW_SP (SA, rs1); break;
+	case 15: FP_UNPACK_QP (QA, rs1); break;
+	case 14: FP_UNPACK_DP (DA, rs1); break;
+	case 13: FP_UNPACK_SP (SA, rs1); break;
 	}
 	freg = (insn & 0x1f);
-	switch ((type >> 3) & 0x3) {			/* same again for rs2 */
+	switch ((type >> 4) & 0x3) {			/* same again for rs2 */
 	case 3:
 		if (freg & 3) {				/* quadwords must have bits 4&5 of the */
 							/* encoded reg. number set to zero. */
@@ -387,13 +396,19 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 		}
 	}
 	rs2 = (argp)&fregs[freg];
-	switch ((type >> 3) & 0x7) {
-	case 7: FP_UNPACK_QP (QB, rs2); break;
-	case 6: FP_UNPACK_DP (DB, rs2); break;
-	case 5: FP_UNPACK_SP (SB, rs2); break;
+	switch ((type >> 4) & 0xf) {
+	case 7: FP_UNPACK_RAW_QP (QA, rs2); break;
+	case 6: FP_UNPACK_RAW_DP (DA, rs2); break;
+	case 5: FP_UNPACK_RAW_SP (SA, rs2); break;
+	case 11: FP_UNPACK_SEMIRAW_QP (QA, rs2); break;
+	case 10: FP_UNPACK_SEMIRAW_DP (DA, rs2); break;
+	case 9: FP_UNPACK_SEMIRAW_SP (SA, rs2); break;
+	case 15: FP_UNPACK_QP (QA, rs2); break;
+	case 14: FP_UNPACK_DP (DA, rs2); break;
+	case 13: FP_UNPACK_SP (SA, rs2); break;
 	}
 	freg = ((insn >> 25) & 0x1f);
-	switch ((type >> 6) & 0x3) {			/* and finally rd. This one's a bit different */
+	switch ((type >> 8) & 0x3) {			/* and finally rd. This one's a bit different */
 	case 0:						/* dest is fcc. (this must be FCMPQ or FCMPEQ) */
 		if (freg) {				/* V8 has only one set of condition codes, so */
 							/* anything but 0 in the rd field is an error */
@@ -433,11 +448,15 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 	case FSUBQ: FP_SUB_Q (QR, QA, QB); break;
 	/* * */
 	case FMULS: FP_MUL_S (SR, SA, SB); break;
-	case FSMULD: FP_CONV (D, S, 2, 1, DA, SA);
-		     FP_CONV (D, S, 2, 1, DB, SB);
+	case FSMULD: FP_EXTEND (D, S, 2, 1, DA, SA);
+		     _FP_UNPACK_CANONICAL (D, 2, DA);
+		     FP_EXTEND (D, S, 2, 1, DB, SB);
+		     _FP_UNPACK_CANONICAL (D, 2, DB);
 	case FMULD: FP_MUL_D (DR, DA, DB); break;
-	case FDMULQ: FP_CONV (Q, D, 4, 2, QA, DA);
-		     FP_CONV (Q, D, 4, 2, QB, DB);
+	case FDMULQ: FP_EXTEND (Q, D, 4, 2, QA, DA);
+		     _FP_UNPACK_CANONICAL (Q, 4, QA);
+		     FP_EXTEND (Q, D, 4, 2, QB, DB);
+		     _FP_UNPACK_CANONICAL (Q, 4, QB);
 	case FMULQ: FP_MUL_Q (QR, QA, QB); break;
 	/* / */
 	case FDIVS: FP_DIV_S (SR, SA, SB); break;
@@ -452,50 +471,41 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 	case FABSS: rd->s = rs2->s & 0x7fffffff; break;
 	case FNEGS: rd->s = rs2->s ^ 0x80000000; break;
 	/* float to int */
-	case FSTOI: FP_TO_INT_S (IR, SB, 32, 1); break;
-	case FDTOI: FP_TO_INT_D (IR, DB, 32, 1); break;
-	case FQTOI: FP_TO_INT_Q (IR, QB, 32, 1); break;
+	case FSTOI: FP_TO_INT_S (UIR, SB, 32, 1); IR = UIR; break;
+	case FDTOI: FP_TO_INT_D (UIR, DB, 32, 1); IR = UIR; break;
+	case FQTOI: FP_TO_INT_Q (UIR, QB, 32, 1); IR = UIR; break;
 	/* int to float */
-	case FITOS: IR = rs2->s; FP_FROM_INT_S (SR, IR, 32, int); break;
-	case FITOD: IR = rs2->s; FP_FROM_INT_D (DR, IR, 32, int); break;
-	case FITOQ: IR = rs2->s; FP_FROM_INT_Q (QR, IR, 32, int); break;
+	case FITOS: IR = rs2->s; FP_FROM_INT_S (SR, IR, 32, unsigned int);
+		    break;
+	case FITOD: IR = rs2->s; FP_FROM_INT_D (DR, IR, 32, unsigned int);
+		    break;
+	case FITOQ: IR = rs2->s; FP_FROM_INT_Q (QR, IR, 32, unsigned int);
+		    break;
 	/* float to float */
-	case FSTOD: FP_CONV (D, S, 2, 1, DR, SB); break;
-	case FSTOQ: FP_CONV (Q, S, 4, 1, QR, SB); break;
-	case FDTOQ: FP_CONV (Q, D, 4, 2, QR, DB); break;
-	case FDTOS: FP_CONV (S, D, 1, 2, SR, DB); break;
-	case FQTOS: FP_CONV (S, Q, 1, 4, SR, QB); break;
-	case FQTOD: FP_CONV (D, Q, 2, 4, DR, QB); break;
+	case FSTOD: FP_EXTEND (D, S, 2, 1, DR, SB); break;
+	case FSTOQ: FP_EXTEND (Q, S, 4, 1, QR, SB); break;
+	case FDTOQ: FP_EXTEND (Q, D, 4, 2, QR, DB); break;
+	case FDTOS: FP_TRUNC (S, D, 1, 2, SR, DB); break;
+	case FQTOS: FP_TRUNC (S, Q, 1, 4, SR, QB); break;
+	case FQTOD: FP_TRUNC (D, Q, 2, 4, DR, QB); break;
 	/* comparison */
 	case FCMPS:
 	case FCMPES:
-		FP_CMP_S(IR, SB, SA, 3);
-		if (IR = 3 &&
-		    (((insn >> 5) & 0x1ff) = FCMPES ||
-		     FP_ISSIGNAN_S(SA) ||
-		     FP_ISSIGNAN_S(SB)))
-			FP_SET_EXCEPTION (FP_EX_INVALID);
+		FP_CMP_S(IR, SB, SA, 3,
+			((insn >> 5) & 0x1ff) = FCMPES ? 2 : 1);
 		break;
 	case FCMPD:
 	case FCMPED:
-		FP_CMP_D(IR, DB, DA, 3);
-		if (IR = 3 &&
-		    (((insn >> 5) & 0x1ff) = FCMPED ||
-		     FP_ISSIGNAN_D(DA) ||
-		     FP_ISSIGNAN_D(DB)))
-			FP_SET_EXCEPTION (FP_EX_INVALID);
+		FP_CMP_D(IR, DB, DA, 3,
+			((insn >> 5) & 0x1ff) = FCMPED ? 2 : 1);
 		break;
 	case FCMPQ:
 	case FCMPEQ:
-		FP_CMP_Q(IR, QB, QA, 3);
-		if (IR = 3 &&
-		    (((insn >> 5) & 0x1ff) = FCMPEQ ||
-		     FP_ISSIGNAN_Q(QA) ||
-		     FP_ISSIGNAN_Q(QB)))
-			FP_SET_EXCEPTION (FP_EX_INVALID);
+		FP_CMP_Q(IR, QB, QA, 3,
+			((insn >> 5) & 0x1ff) = FCMPEQ ? 2 : 1);
 	}
 	if (!FP_INHIBIT_RESULTS) {
-		switch ((type >> 6) & 0x7) {
+		switch ((type >> 8) & 0xf) {
 		case 0: fsr = *pfsr;
 			if (IR = -1) IR = 2;
 			/* fcc is always fcc0 */
@@ -503,9 +513,15 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 			*pfsr = fsr;
 			break;
 		case 1: rd->s = IR; break;
-		case 5: FP_PACK_SP (rd, SR); break;
-		case 6: FP_PACK_DP (rd, DR); break;
-		case 7: FP_PACK_QP (rd, QR); break;
+		case 5: FP_PACK_RAW_SP (rd, SR); break;
+		case 6: FP_PACK_RAW_DP (rd, DR); break;
+		case 7: FP_PACK_RAW_QP (rd, QR); break;
+		case 9: FP_PACK_SEMIRAW_SP (rd, SR); break;
+		case 10: FP_PACK_SEMIRAW_DP (rd, DR); break;
+		case 11: FP_PACK_SEMIRAW_QP (rd, QR); break;
+		case 13: FP_PACK_SP (rd, SR); break;
+		case 14: FP_PACK_DP (rd, DR); break;
+		case 15: FP_PACK_QP (rd, QR); break;
 		}
 	}
 	if (_fex = 0)
diff --git a/arch/sparc/math-emu/math_64.c b/arch/sparc/math-emu/math_64.c
index 034aadb..973db59 100644
--- a/arch/sparc/math-emu/math_64.c
+++ b/arch/sparc/math-emu/math_64.c
@@ -170,9 +170,11 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 	u32 insn = 0;
 	int type = 0;
 	/* ftt tells which ftt it may happen in, r is rd, b is rs2 and a is rs1. The *u arg tells
-	   whether the argument should be packed/unpacked (0 - do not unpack/pack, 1 - unpack/pack)
+	   whether and how the argument should be packed/unpacked
+	   (0 - do not unpack/pack, 1 - unpack/pack raw, 2 - semi-raw,
+	   3- cooked)
 	   non-u args tells the size of the argument (0 - no argument, 1 - single, 2 - double, 3 - quad */
-#define TYPE(ftt, r, ru, b, bu, a, au) type = (au << 2) | (a << 0) | (bu << 5) | (b << 3) | (ru << 8) | (r << 6) | (ftt << 9)
+#define TYPE(ftt, r, ru, b, bu, a, au) type = (au << 2) | (a << 0) | (bu << 6) | (b << 4) | (ru << 10) | (r << 8) | (ftt << 12)
 	int freg;
 	static u64 zero[2] = { 0L, 0L };
 	int flags;
@@ -181,7 +183,9 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 	FP_DECL_D(DA); FP_DECL_D(DB); FP_DECL_D(DR);
 	FP_DECL_Q(QA); FP_DECL_Q(QB); FP_DECL_Q(QR);
 	int IR;
+	unsigned int UIR;
 	long XR, xfsr;
+	unsigned long UXR;
 
 	if (tstate & TSTATE_PRIV)
 		die_if_kernel("unfinished/unimplemented FPop from kernel", regs);
@@ -195,16 +199,16 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 			case FMOVQ:
 			case FNEGQ:
 			case FABSQ: TYPE(3,3,0,3,0,0,0); break;
-			case FSQRTQ: TYPE(3,3,1,3,1,0,0); break;
+			case FSQRTQ: TYPE(3,3,3,3,3,0,0); break;
 			case FADDQ:
-			case FSUBQ:
+			case FSUBQ: TYPE(3,3,2,3,2,3,2); break;
 			case FMULQ:
-			case FDIVQ: TYPE(3,3,1,3,1,3,1); break;
-			case FDMULQ: TYPE(3,3,1,2,1,2,1); break;
+			case FDIVQ: TYPE(3,3,3,3,3,3,3); break;
+			case FDMULQ: TYPE(3,3,3,2,1,2,1); break;
 			case FQTOX: TYPE(3,2,0,3,1,0,0); break;
 			case FXTOQ: TYPE(3,3,1,2,0,0,0); break;
-			case FQTOS: TYPE(3,1,1,3,1,0,0); break;
-			case FQTOD: TYPE(3,2,1,3,1,0,0); break;
+			case FQTOS: TYPE(3,1,2,3,2,0,0); break;
+			case FQTOD: TYPE(3,2,2,3,2,0,0); break;
 			case FITOQ: TYPE(3,3,1,1,0,0,0); break;
 			case FSTOQ: TYPE(3,3,1,1,1,0,0); break;
 			case FDTOQ: TYPE(3,3,1,2,1,0,0); break;
@@ -219,7 +223,7 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				unsigned long x = current_thread_info()->xfsr[0];
 
 				x = (x >> 14) & 0x7;
-				TYPE(x,1,1,1,1,0,0);
+				TYPE(x,1,3,1,3,0,0);
 				break;
 			}
 
@@ -227,23 +231,23 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				unsigned long x = current_thread_info()->xfsr[0];
 
 				x = (x >> 14) & 0x7;
-				TYPE(x,2,1,2,1,0,0);
+				TYPE(x,2,3,2,3,0,0);
 				break;
 			}
 
 			/* SUBNORMAL - ftt = 2 */
 			case FADDD:
-			case FSUBD:
+			case FSUBD: TYPE(2,2,2,2,2,2,2); break;
 			case FMULD:
-			case FDIVD: TYPE(2,2,1,2,1,2,1); break;
+			case FDIVD: TYPE(2,2,3,2,3,2,3); break;
 			case FADDS:
-			case FSUBS:
+			case FSUBS: TYPE(2,1,2,1,2,1,2); break;
 			case FMULS:
-			case FDIVS: TYPE(2,1,1,1,1,1,1); break;
-			case FSMULD: TYPE(2,2,1,1,1,1,1); break;
+			case FDIVS: TYPE(2,1,3,1,3,1,3); break;
+			case FSMULD: TYPE(2,2,3,1,1,1,1); break;
 			case FSTOX: TYPE(2,2,0,1,1,0,0); break;
 			case FDTOX: TYPE(2,2,0,2,1,0,0); break;
-			case FDTOS: TYPE(2,1,1,2,1,0,0); break;
+			case FDTOS: TYPE(2,1,2,2,2,0,0); break;
 			case FSTOD: TYPE(2,2,1,1,1,0,0); break;
 			case FSTOI: TYPE(2,1,0,1,1,0,0); break;
 			case FDTOI: TYPE(2,1,0,2,1,0,0); break;
@@ -365,7 +369,7 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 		 */
 		if (!illegal_insn_trap) {
 			int ftt = (current_thread_info()->xfsr[0] >> 14) & 0x7;
-			if (ftt != (type >> 9))
+			if (ftt != (type >> 12))
 				goto err;
 		}
 		current_thread_info()->xfsr[0] &= ~0x1c000;
@@ -382,13 +386,19 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				rs1 = (argp)&zero;
 			break;
 		}
-		switch (type & 0x7) {
-		case 7: FP_UNPACK_QP (QA, rs1); break;
-		case 6: FP_UNPACK_DP (DA, rs1); break;
-		case 5: FP_UNPACK_SP (SA, rs1); break;
+		switch (type & 0xf) {
+		case 7: FP_UNPACK_RAW_QP (QA, rs1); break;
+		case 6: FP_UNPACK_RAW_DP (DA, rs1); break;
+		case 5: FP_UNPACK_RAW_SP (SA, rs1); break;
+		case 11: FP_UNPACK_SEMIRAW_QP (QA, rs1); break;
+		case 10: FP_UNPACK_SEMIRAW_DP (DA, rs1); break;
+		case 9: FP_UNPACK_SEMIRAW_SP (SA, rs1); break;
+		case 15: FP_UNPACK_QP (QA, rs1); break;
+		case 14: FP_UNPACK_DP (DA, rs1); break;
+		case 13: FP_UNPACK_SP (SA, rs1); break;
 		}
 		freg = (insn & 0x1f);
-		switch ((type >> 3) & 0x3) {
+		switch ((type >> 4) & 0x3) {
 		case 3: if (freg & 2) {
 				current_thread_info()->xfsr[0] |= (6 << 14) /* invalid_fp_register */;
 				goto err;
@@ -400,13 +410,19 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				rs2 = (argp)&zero;
 			break;
 		}
-		switch ((type >> 3) & 0x7) {
-		case 7: FP_UNPACK_QP (QB, rs2); break;
-		case 6: FP_UNPACK_DP (DB, rs2); break;
-		case 5: FP_UNPACK_SP (SB, rs2); break;
+		switch ((type >> 4) & 0xf) {
+		case 7: FP_UNPACK_RAW_QP (QB, rs2); break;
+		case 6: FP_UNPACK_RAW_DP (DB, rs2); break;
+		case 5: FP_UNPACK_RAW_SP (SB, rs2); break;
+		case 11: FP_UNPACK_SEMIRAW_QP (QB, rs2); break;
+		case 10: FP_UNPACK_SEMIRAW_DP (DB, rs2); break;
+		case 9: FP_UNPACK_SEMIRAW_SP (SB, rs2); break;
+		case 15: FP_UNPACK_QP (QB, rs2); break;
+		case 14: FP_UNPACK_DP (DB, rs2); break;
+		case 13: FP_UNPACK_SP (SB, rs2); break;
 		}
 		freg = ((insn >> 25) & 0x1f);
-		switch ((type >> 6) & 0x3) {
+		switch ((type >> 8) & 0x3) {
 		case 3: if (freg & 2) {
 				current_thread_info()->xfsr[0] |= (6 << 14) /* invalid_fp_register */;
 				goto err;
@@ -438,11 +454,15 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 		case FSUBQ: FP_SUB_Q (QR, QA, QB); break;
 		/* * */
 		case FMULS: FP_MUL_S (SR, SA, SB); break;
-		case FSMULD: FP_CONV (D, S, 1, 1, DA, SA);
-			     FP_CONV (D, S, 1, 1, DB, SB);
+		case FSMULD: FP_EXTEND (D, S, 1, 1, DA, SA);
+			     _FP_UNPACK_CANONICAL (D, 1, DA);
+			     FP_EXTEND (D, S, 1, 1, DB, SB);
+			     _FP_UNPACK_CANONICAL (D, 1, DB);
 		case FMULD: FP_MUL_D (DR, DA, DB); break;
-		case FDMULQ: FP_CONV (Q, D, 2, 1, QA, DA);
-			     FP_CONV (Q, D, 2, 1, QB, DB);
+		case FDMULQ: FP_EXTEND (Q, D, 2, 1, QA, DA);
+			     _FP_UNPACK_CANONICAL (Q, 2, QA);
+			     FP_EXTEND (Q, D, 2, 1, QB, DB);
+			     _FP_UNPACK_CANONICAL (Q, 2, QB);
 		case FMULQ: FP_MUL_Q (QR, QA, QB); break;
 		/* / */
 		case FDIVS: FP_DIV_S (SR, SA, SB); break;
@@ -457,41 +477,37 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 		case FABSQ: rd->q[0] = rs2->q[0] & 0x7fffffffffffffffUL; rd->q[1] = rs2->q[1]; break;
 		case FNEGQ: rd->q[0] = rs2->q[0] ^ 0x8000000000000000UL; rd->q[1] = rs2->q[1]; break;
 		/* float to int */
-		case FSTOI: FP_TO_INT_S (IR, SB, 32, 1); break;
-		case FDTOI: FP_TO_INT_D (IR, DB, 32, 1); break;
-		case FQTOI: FP_TO_INT_Q (IR, QB, 32, 1); break;
-		case FSTOX: FP_TO_INT_S (XR, SB, 64, 1); break;
-		case FDTOX: FP_TO_INT_D (XR, DB, 64, 1); break;
-		case FQTOX: FP_TO_INT_Q (XR, QB, 64, 1); break;
+		case FSTOI: FP_TO_INT_S (UIR, SB, 32, 1); IR = UIR; break;
+		case FDTOI: FP_TO_INT_D (UIR, DB, 32, 1); IR = UIR; break;
+		case FQTOI: FP_TO_INT_Q (UIR, QB, 32, 1); IR = UIR; break;
+		case FSTOX: FP_TO_INT_S (UXR, SB, 64, 1); XR = UXR; break;
+		case FDTOX: FP_TO_INT_D (UXR, DB, 64, 1); XR = UXR; break;
+		case FQTOX: FP_TO_INT_Q (UXR, QB, 64, 1); XR = UXR; break;
 		/* int to float */
-		case FITOQ: IR = rs2->s; FP_FROM_INT_Q (QR, IR, 32, int); break;
-		case FXTOQ: XR = rs2->d; FP_FROM_INT_Q (QR, XR, 64, long); break;
+		case FITOQ: IR = rs2->s; FP_FROM_INT_Q (QR, IR, 32, unsigned int); break;
+		case FXTOQ: XR = rs2->d; FP_FROM_INT_Q (QR, XR, 64, unsigned long); break;
 		/* Only Ultra-III generates these */
-		case FXTOS: XR = rs2->d; FP_FROM_INT_S (SR, XR, 64, long); break;
-		case FXTOD: XR = rs2->d; FP_FROM_INT_D (DR, XR, 64, long); break;
+		case FXTOS: XR = rs2->d; FP_FROM_INT_S (SR, XR, 64, unsigned long); break;
+		case FXTOD: XR = rs2->d; FP_FROM_INT_D (DR, XR, 64, unsigned long); break;
 #if 0		/* Optimized inline in sparc64/kernel/entry.S */
-		case FITOS: IR = rs2->s; FP_FROM_INT_S (SR, IR, 32, int); break;
+		case FITOS: IR = rs2->s; FP_FROM_INT_S (SR, IR, 32, unsigned int); break;
 #endif
-		case FITOD: IR = rs2->s; FP_FROM_INT_D (DR, IR, 32, int); break;
+		case FITOD: IR = rs2->s; FP_FROM_INT_D (DR, IR, 32, unsigned int); break;
 		/* float to float */
-		case FSTOD: FP_CONV (D, S, 1, 1, DR, SB); break;
-		case FSTOQ: FP_CONV (Q, S, 2, 1, QR, SB); break;
-		case FDTOQ: FP_CONV (Q, D, 2, 1, QR, DB); break;
-		case FDTOS: FP_CONV (S, D, 1, 1, SR, DB); break;
-		case FQTOS: FP_CONV (S, Q, 1, 2, SR, QB); break;
-		case FQTOD: FP_CONV (D, Q, 1, 2, DR, QB); break;
+		case FSTOD: FP_EXTEND (D, S, 1, 1, DR, SB); break;
+		case FSTOQ: FP_EXTEND (Q, S, 2, 1, QR, SB); break;
+		case FDTOQ: FP_EXTEND (Q, D, 2, 1, QR, DB); break;
+		case FDTOS: FP_TRUNC (S, D, 1, 1, SR, DB); break;
+		case FQTOS: FP_TRUNC (S, Q, 1, 2, SR, QB); break;
+		case FQTOD: FP_TRUNC (D, Q, 1, 2, DR, QB); break;
 		/* comparison */
 		case FCMPQ:
 		case FCMPEQ:
-			FP_CMP_Q(XR, QB, QA, 3);
-			if (XR = 3 &&
-			    (((insn >> 5) & 0x1ff) = FCMPEQ ||
-			     FP_ISSIGNAN_Q(QA) ||
-			     FP_ISSIGNAN_Q(QB)))
-				FP_SET_EXCEPTION (FP_EX_INVALID);
+			FP_CMP_Q(XR, QB, QA, 3,
+				((insn >> 5) & 0x1ff) = FCMPEQ ? 2 : 1);
 		}
 		if (!FP_INHIBIT_RESULTS) {
-			switch ((type >> 6) & 0x7) {
+			switch ((type >> 8) & 0xf) {
 			case 0: xfsr = current_thread_info()->xfsr[0];
 				if (XR = -1) XR = 2;
 				switch (freg & 3) {
@@ -505,9 +521,15 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				break;
 			case 1: rd->s = IR; break;
 			case 2: rd->d = XR; break;
-			case 5: FP_PACK_SP (rd, SR); break;
-			case 6: FP_PACK_DP (rd, DR); break;
-			case 7: FP_PACK_QP (rd, QR); break;
+			case 5: FP_PACK_RAW_SP (rd, SR); break;
+			case 6: FP_PACK_RAW_DP (rd, DR); break;
+			case 7: FP_PACK_RAW_QP (rd, QR); break;
+			case 9: FP_PACK_SEMIRAW_SP (rd, SR); break;
+			case 10: FP_PACK_SEMIRAW_DP (rd, DR); break;
+			case 11: FP_PACK_SEMIRAW_QP (rd, QR); break;
+			case 13: FP_PACK_SP (rd, SR); break;
+			case 14: FP_PACK_DP (rd, DR); break;
+			case 15: FP_PACK_QP (rd, QR); break;
 			}
 		}
 
diff --git a/include/math-emu/double.h b/include/math-emu/double.h
index 655ccf1..dc8cd33 100644
--- a/include/math-emu/double.h
+++ b/include/math-emu/double.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Definitions for IEEE Double Precision
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,31 +8,41 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef    __MATH_EMU_DOUBLE_H__
 #define    __MATH_EMU_DOUBLE_H__
 
 #if _FP_W_TYPE_SIZE < 32
-#error "Here's a nickel kid.  Go buy yourself a real computer."
+# error "Here's a nickel kid.  Go buy yourself a real computer."
 #endif
 
 #if _FP_W_TYPE_SIZE < 64
-#define _FP_FRACTBITS_D		(2 * _FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_D	(2 * _FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_DW_D	(4 * _FP_W_TYPE_SIZE)
 #else
-#define _FP_FRACTBITS_D		_FP_W_TYPE_SIZE
+# define _FP_FRACTBITS_D	_FP_W_TYPE_SIZE
+# define _FP_FRACTBITS_DW_D	(2 * _FP_W_TYPE_SIZE)
 #endif
 
 #define _FP_FRACBITS_D		53
@@ -44,160 +54,269 @@
 #define _FP_EXPMAX_D		2047
 
 #define _FP_QNANBIT_D		\
-	((_FP_W_TYPE)1 << (_FP_FRACBITS_D-2) % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_D-2) % _FP_W_TYPE_SIZE)
+#define _FP_QNANBIT_SH_D		\
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_D-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
 #define _FP_IMPLBIT_D		\
-	((_FP_W_TYPE)1 << (_FP_FRACBITS_D-1) % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_D-1) % _FP_W_TYPE_SIZE)
+#define _FP_IMPLBIT_SH_D		\
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_D-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
 #define _FP_OVERFLOW_D		\
-	((_FP_W_TYPE)1 << _FP_WFRACBITS_D % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << _FP_WFRACBITS_D % _FP_W_TYPE_SIZE)
+
+#define _FP_WFRACBITS_DW_D	(2 * _FP_WFRACBITS_D)
+#define _FP_WFRACXBITS_DW_D	(_FP_FRACTBITS_DW_D - _FP_WFRACBITS_DW_D)
+#define _FP_HIGHBIT_DW_D	\
+  ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_DW_D - 1) % _FP_W_TYPE_SIZE)
+
+typedef float DFtype __attribute__ ((mode (DF)));
 
 #if _FP_W_TYPE_SIZE < 64
 
 union _FP_UNION_D
 {
-  double flt;
-  struct {
-#if __BYTE_ORDER = __BIG_ENDIAN
+  DFtype flt;
+  struct _FP_STRUCT_LAYOUT
+  {
+# if __BYTE_ORDER = __BIG_ENDIAN
     unsigned sign  : 1;
     unsigned exp   : _FP_EXPBITS_D;
     unsigned frac1 : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0) - _FP_W_TYPE_SIZE;
     unsigned frac0 : _FP_W_TYPE_SIZE;
-#else
+# else
     unsigned frac0 : _FP_W_TYPE_SIZE;
     unsigned frac1 : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0) - _FP_W_TYPE_SIZE;
     unsigned exp   : _FP_EXPBITS_D;
     unsigned sign  : 1;
-#endif
-  } bits __attribute__((packed));
+# endif
+  } bits __attribute__ ((packed));
 };
 
-#define FP_DECL_D(X)		_FP_DECL(2,X)
-#define FP_UNPACK_RAW_D(X,val)	_FP_UNPACK_RAW_2(D,X,val)
-#define FP_UNPACK_RAW_DP(X,val)	_FP_UNPACK_RAW_2_P(D,X,val)
-#define FP_PACK_RAW_D(val,X)	_FP_PACK_RAW_2(D,val,X)
-#define FP_PACK_RAW_DP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_2_P(D,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_D(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_2(D,X,val);		\
-    _FP_UNPACK_CANONICAL(D,2,X);	\
-  } while (0)
-
-#define FP_UNPACK_DP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_2_P(D,X,val);	\
-    _FP_UNPACK_CANONICAL(D,2,X);	\
-  } while (0)
-
-#define FP_PACK_D(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(D,2,X);		\
-    _FP_PACK_RAW_2(D,val,X);		\
-  } while (0)
-
-#define FP_PACK_DP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(D,2,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_2_P(D,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN(D,2,X)
-#define FP_NEG_D(R,X)			_FP_NEG(D,2,R,X)
-#define FP_ADD_D(R,X,Y)			_FP_ADD(D,2,R,X,Y)
-#define FP_SUB_D(R,X,Y)			_FP_SUB(D,2,R,X,Y)
-#define FP_MUL_D(R,X,Y)			_FP_MUL(D,2,R,X,Y)
-#define FP_DIV_D(R,X,Y)			_FP_DIV(D,2,R,X,Y)
-#define FP_SQRT_D(R,X)			_FP_SQRT(D,2,R,X)
-#define _FP_SQRT_MEAT_D(R,S,T,X,Q)	_FP_SQRT_MEAT_2(R,S,T,X,Q)
-
-#define FP_CMP_D(r,X,Y,un)	_FP_CMP(D,2,r,X,Y,un)
-#define FP_CMP_EQ_D(r,X,Y)	_FP_CMP_EQ(D,2,r,X,Y)
-
-#define FP_TO_INT_D(r,X,rsz,rsg)	_FP_TO_INT(D,2,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_D(r,X,rsz,rsg)	_FP_TO_INT_ROUND(D,2,r,X,rsz,rsg)
-#define FP_FROM_INT_D(X,r,rs,rt)	_FP_FROM_INT(D,2,X,r,rs,rt)
-
-#define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_2(X)
-#define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_2(X)
+# define FP_DECL_D(X)		_FP_DECL (2, X)
+# define FP_UNPACK_RAW_D(X, val)	_FP_UNPACK_RAW_2 (D, X, (val))
+# define FP_UNPACK_RAW_DP(X, val)	_FP_UNPACK_RAW_2_P (D, X, (val))
+# define FP_PACK_RAW_D(val, X)	_FP_PACK_RAW_2 (D, (val), X)
+# define FP_PACK_RAW_DP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_D(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2 (D, X, (val));		\
+      _FP_UNPACK_CANONICAL (D, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_DP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2_P (D, X, (val));		\
+      _FP_UNPACK_CANONICAL (D, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_D(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2 (D, X, (val));		\
+      _FP_UNPACK_SEMIRAW (D, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_DP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2_P (D, X, (val));		\
+      _FP_UNPACK_SEMIRAW (D, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_D(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (D, 2, X);		\
+      _FP_PACK_RAW_2 (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_DP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (D, 2, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_D(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (D, 2, X);		\
+      _FP_PACK_RAW_2 (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_DP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (D, 2, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN (D, 2, X)
+# define FP_NEG_D(R, X)			_FP_NEG (D, 2, R, X)
+# define FP_ADD_D(R, X, Y)		_FP_ADD (D, 2, R, X, Y)
+# define FP_SUB_D(R, X, Y)		_FP_SUB (D, 2, R, X, Y)
+# define FP_MUL_D(R, X, Y)		_FP_MUL (D, 2, R, X, Y)
+# define FP_DIV_D(R, X, Y)		_FP_DIV (D, 2, R, X, Y)
+# define FP_SQRT_D(R, X)		_FP_SQRT (D, 2, R, X)
+# define _FP_SQRT_MEAT_D(R, S, T, X, Q)	_FP_SQRT_MEAT_2 (R, S, T, X, (Q))
+# define FP_FMA_D(R, X, Y, Z)		_FP_FMA (D, 2, 4, R, X, Y, Z)
+
+# define FP_CMP_D(r, X, Y, un, ex)	_FP_CMP (D, 2, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_D(r, X, Y, ex)	_FP_CMP_EQ (D, 2, (r), X, Y, (ex))
+# define FP_CMP_UNORD_D(r, X, Y, ex)	_FP_CMP_UNORD (D, 2, (r), X, Y, (ex))
+
+# define FP_TO_INT_D(r, X, rsz, rsg)	_FP_TO_INT (D, 2, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_D(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (D, 2, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_D(X, r, rs, rt)	_FP_FROM_INT (D, 2, X, (r), (rs), rt)
+
+# define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_2 (X)
+# define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_2 (X)
+
+# define _FP_FRAC_HIGH_DW_D(X)	_FP_FRAC_HIGH_4 (X)
 
 #else
 
 union _FP_UNION_D
 {
-  double flt;
-  struct {
-#if __BYTE_ORDER = __BIG_ENDIAN
-    unsigned sign : 1;
-    unsigned exp  : _FP_EXPBITS_D;
-    unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
-#else
-    unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
-    unsigned exp  : _FP_EXPBITS_D;
-    unsigned sign : 1;
-#endif
-  } bits __attribute__((packed));
+  DFtype flt;
+  struct _FP_STRUCT_LAYOUT
+  {
+# if __BYTE_ORDER = __BIG_ENDIAN
+    unsigned sign   : 1;
+    unsigned exp    : _FP_EXPBITS_D;
+    _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
+# else
+    _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
+    unsigned exp    : _FP_EXPBITS_D;
+    unsigned sign   : 1;
+# endif
+  } bits __attribute__ ((packed));
 };
 
-#define FP_DECL_D(X)		_FP_DECL(1,X)
-#define FP_UNPACK_RAW_D(X,val)	_FP_UNPACK_RAW_1(D,X,val)
-#define FP_UNPACK_RAW_DP(X,val)	_FP_UNPACK_RAW_1_P(D,X,val)
-#define FP_PACK_RAW_D(val,X)	_FP_PACK_RAW_1(D,val,X)
-#define FP_PACK_RAW_DP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_1_P(D,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_D(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_1(D,X,val);		\
-    _FP_UNPACK_CANONICAL(D,1,X);	\
-  } while (0)
-
-#define FP_UNPACK_DP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_1_P(D,X,val);	\
-    _FP_UNPACK_CANONICAL(D,1,X);	\
-  } while (0)
-
-#define FP_PACK_D(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(D,1,X);		\
-    _FP_PACK_RAW_1(D,val,X);		\
-  } while (0)
-
-#define FP_PACK_DP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(D,1,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_1_P(D,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN(D,1,X)
-#define FP_NEG_D(R,X)			_FP_NEG(D,1,R,X)
-#define FP_ADD_D(R,X,Y)			_FP_ADD(D,1,R,X,Y)
-#define FP_SUB_D(R,X,Y)			_FP_SUB(D,1,R,X,Y)
-#define FP_MUL_D(R,X,Y)			_FP_MUL(D,1,R,X,Y)
-#define FP_DIV_D(R,X,Y)			_FP_DIV(D,1,R,X,Y)
-#define FP_SQRT_D(R,X)			_FP_SQRT(D,1,R,X)
-#define _FP_SQRT_MEAT_D(R,S,T,X,Q)	_FP_SQRT_MEAT_1(R,S,T,X,Q)
+# define FP_DECL_D(X)		_FP_DECL (1, X)
+# define FP_UNPACK_RAW_D(X, val)	_FP_UNPACK_RAW_1 (D, X, (val))
+# define FP_UNPACK_RAW_DP(X, val)	_FP_UNPACK_RAW_1_P (D, X, (val))
+# define FP_PACK_RAW_D(val, X)	_FP_PACK_RAW_1 (D, (val), X)
+# define FP_PACK_RAW_DP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_D(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1 (D, X, (val));		\
+      _FP_UNPACK_CANONICAL (D, 1, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_DP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1_P (D, X, (val));		\
+      _FP_UNPACK_CANONICAL (D, 1, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_D(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1 (D, X, (val));		\
+      _FP_UNPACK_SEMIRAW (D, 1, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_DP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1_P (D, X, (val));		\
+      _FP_UNPACK_SEMIRAW (D, 1, X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_D(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (D, 1, X);		\
+      _FP_PACK_RAW_1 (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_DP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (D, 1, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_D(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (D, 1, X);		\
+      _FP_PACK_RAW_1 (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_DP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (D, 1, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN (D, 1, X)
+# define FP_NEG_D(R, X)			_FP_NEG (D, 1, R, X)
+# define FP_ADD_D(R, X, Y)		_FP_ADD (D, 1, R, X, Y)
+# define FP_SUB_D(R, X, Y)		_FP_SUB (D, 1, R, X, Y)
+# define FP_MUL_D(R, X, Y)		_FP_MUL (D, 1, R, X, Y)
+# define FP_DIV_D(R, X, Y)		_FP_DIV (D, 1, R, X, Y)
+# define FP_SQRT_D(R, X)		_FP_SQRT (D, 1, R, X)
+# define _FP_SQRT_MEAT_D(R, S, T, X, Q)	_FP_SQRT_MEAT_1 (R, S, T, X, (Q))
+# define FP_FMA_D(R, X, Y, Z)		_FP_FMA (D, 1, 2, R, X, Y, Z)
 
 /* The implementation of _FP_MUL_D and _FP_DIV_D should be chosen by
    the target machine.  */
 
-#define FP_CMP_D(r,X,Y,un)	_FP_CMP(D,1,r,X,Y,un)
-#define FP_CMP_EQ_D(r,X,Y)	_FP_CMP_EQ(D,1,r,X,Y)
+# define FP_CMP_D(r, X, Y, un, ex)	_FP_CMP (D, 1, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_D(r, X, Y, ex)	_FP_CMP_EQ (D, 1, (r), X, Y, (ex))
+# define FP_CMP_UNORD_D(r, X, Y, ex)	_FP_CMP_UNORD (D, 1, (r), X, Y, (ex))
+
+# define FP_TO_INT_D(r, X, rsz, rsg)	_FP_TO_INT (D, 1, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_D(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (D, 1, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_D(X, r, rs, rt)	_FP_FROM_INT (D, 1, X, (r), (rs), rt)
 
-#define FP_TO_INT_D(r,X,rsz,rsg)	_FP_TO_INT(D,1,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_D(r,X,rsz,rsg)	_FP_TO_INT_ROUND(D,1,r,X,rsz,rsg)
-#define FP_FROM_INT_D(X,r,rs,rt)	_FP_FROM_INT(D,1,X,r,rs,rt)
+# define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_1 (X)
+# define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_1 (X)
 
-#define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_1(X)
-#define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_1(X)
+# define _FP_FRAC_HIGH_DW_D(X)	_FP_FRAC_HIGH_2 (X)
 
 #endif /* W_TYPE_SIZE < 64 */
 
diff --git a/include/math-emu/op-1.h b/include/math-emu/op-1.h
index 3be3bb4..342ecd0 100644
--- a/include/math-emu/op-1.h
+++ b/include/math-emu/op-1.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Basic one-word fraction declaration and manipulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,193 +8,260 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef    __MATH_EMU_OP_1_H__
 #define    __MATH_EMU_OP_1_H__
 
-#define _FP_FRAC_DECL_1(X)	_FP_W_TYPE X##_f=0
-#define _FP_FRAC_COPY_1(D,S)	(D##_f = S##_f)
-#define _FP_FRAC_SET_1(X,I)	(X##_f = I)
+#define _FP_FRAC_DECL_1(X)	_FP_W_TYPE X##_f = 0
+#define _FP_FRAC_COPY_1(D, S)	(D##_f = S##_f)
+#define _FP_FRAC_SET_1(X, I)	(X##_f = I)
 #define _FP_FRAC_HIGH_1(X)	(X##_f)
 #define _FP_FRAC_LOW_1(X)	(X##_f)
-#define _FP_FRAC_WORD_1(X,w)	(X##_f)
-
-#define _FP_FRAC_ADDI_1(X,I)	(X##_f += I)
-#define _FP_FRAC_SLL_1(X,N)			\
-  do {						\
-    if (__builtin_constant_p(N) && (N) = 1)	\
-      X##_f += X##_f;				\
-    else					\
-      X##_f <<= (N);				\
-  } while (0)
-#define _FP_FRAC_SRL_1(X,N)	(X##_f >>= N)
+#define _FP_FRAC_WORD_1(X, w)	(X##_f)
+
+#define _FP_FRAC_ADDI_1(X, I)	(X##_f += I)
+#define _FP_FRAC_SLL_1(X, N)			\
+  do						\
+    {						\
+      if (__builtin_constant_p (N) && (N) = 1)	\
+	X##_f += X##_f;				\
+      else					\
+	X##_f <<= (N);				\
+    }						\
+  while (0)
+#define _FP_FRAC_SRL_1(X, N)	(X##_f >>= N)
 
 /* Right shift with sticky-lsb.  */
-#define _FP_FRAC_SRS_1(X,N,sz)	__FP_FRAC_SRS_1(X##_f, N, sz)
-
-#define __FP_FRAC_SRS_1(X,N,sz)						\
-   (X = (X >> (N) | (__builtin_constant_p(N) && (N) = 1		\
-		     ? X & 1 : (X << (_FP_W_TYPE_SIZE - (N))) != 0)))
-
-#define _FP_FRAC_ADD_1(R,X,Y)	(R##_f = X##_f + Y##_f)
-#define _FP_FRAC_SUB_1(R,X,Y)	(R##_f = X##_f - Y##_f)
-#define _FP_FRAC_DEC_1(X,Y)	(X##_f -= Y##_f)
-#define _FP_FRAC_CLZ_1(z, X)	__FP_CLZ(z, X##_f)
-
-/* Predicates */
-#define _FP_FRAC_NEGP_1(X)	((_FP_WS_TYPE)X##_f < 0)
+#define _FP_FRAC_SRST_1(X, S, N, sz)	__FP_FRAC_SRST_1 (X##_f, S, (N), (sz))
+#define _FP_FRAC_SRS_1(X, N, sz)	__FP_FRAC_SRS_1 (X##_f, (N), (sz))
+
+#define __FP_FRAC_SRST_1(X, S, N, sz)			\
+  do							\
+    {							\
+      S = (__builtin_constant_p (N) && (N) = 1		\
+	   ? X & 1					\
+	   : (X << (_FP_W_TYPE_SIZE - (N))) != 0);	\
+      X = X >> (N);					\
+    }							\
+  while (0)
+
+#define __FP_FRAC_SRS_1(X, N, sz)				\
+  (X = (X >> (N) | (__builtin_constant_p (N) && (N) = 1	\
+		    ? X & 1					\
+		    : (X << (_FP_W_TYPE_SIZE - (N))) != 0)))
+
+#define _FP_FRAC_ADD_1(R, X, Y)	(R##_f = X##_f + Y##_f)
+#define _FP_FRAC_SUB_1(R, X, Y)	(R##_f = X##_f - Y##_f)
+#define _FP_FRAC_DEC_1(X, Y)	(X##_f -= Y##_f)
+#define _FP_FRAC_CLZ_1(z, X)	__FP_CLZ ((z), X##_f)
+
+/* Predicates.  */
+#define _FP_FRAC_NEGP_1(X)	((_FP_WS_TYPE) X##_f < 0)
 #define _FP_FRAC_ZEROP_1(X)	(X##_f = 0)
-#define _FP_FRAC_OVERP_1(fs,X)	(X##_f & _FP_OVERFLOW_##fs)
-#define _FP_FRAC_CLEAR_OVERP_1(fs,X)	(X##_f &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_OVERP_1(fs, X)	(X##_f & _FP_OVERFLOW_##fs)
+#define _FP_FRAC_CLEAR_OVERP_1(fs, X)	(X##_f &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_HIGHBIT_DW_1(fs, X)	(X##_f & _FP_HIGHBIT_DW_##fs)
 #define _FP_FRAC_EQ_1(X, Y)	(X##_f = Y##_f)
 #define _FP_FRAC_GE_1(X, Y)	(X##_f >= Y##_f)
 #define _FP_FRAC_GT_1(X, Y)	(X##_f > Y##_f)
 
 #define _FP_ZEROFRAC_1		0
 #define _FP_MINFRAC_1		1
-#define _FP_MAXFRAC_1		(~(_FP_WS_TYPE)0)
-
-/*
- * Unpack the raw bits of a native fp value.  Do not classify or
- * normalize the data.
- */
-
-#define _FP_UNPACK_RAW_1(fs, X, val)				\
-  do {								\
-    union _FP_UNION_##fs _flo; _flo.flt = (val);		\
-								\
-    X##_f = _flo.bits.frac;					\
-    X##_e = _flo.bits.exp;					\
-    X##_s = _flo.bits.sign;					\
-  } while (0)
-
-#define _FP_UNPACK_RAW_1_P(fs, X, val)				\
-  do {								\
-    union _FP_UNION_##fs *_flo =				\
-      (union _FP_UNION_##fs *)(val);				\
-								\
-    X##_f = _flo->bits.frac;					\
-    X##_e = _flo->bits.exp;					\
-    X##_s = _flo->bits.sign;					\
-  } while (0)
-
-/*
- * Repack the raw bits of a native fp value.
- */
-
-#define _FP_PACK_RAW_1(fs, val, X)				\
-  do {								\
-    union _FP_UNION_##fs _flo;					\
-								\
-    _flo.bits.frac = X##_f;					\
-    _flo.bits.exp  = X##_e;					\
-    _flo.bits.sign = X##_s;					\
-								\
-    (val) = _flo.flt;						\
-  } while (0)
-
-#define _FP_PACK_RAW_1_P(fs, val, X)				\
-  do {								\
-    union _FP_UNION_##fs *_flo =				\
-      (union _FP_UNION_##fs *)(val);				\
-								\
-    _flo->bits.frac = X##_f;					\
-    _flo->bits.exp  = X##_e;					\
-    _flo->bits.sign = X##_s;					\
-  } while (0)
-
-
-/*
- * Multiplication algorithms:
- */
+#define _FP_MAXFRAC_1		(~(_FP_WS_TYPE) 0)
+
+/* Unpack the raw bits of a native fp value.  Do not classify or
+   normalize the data.  */
+
+#define _FP_UNPACK_RAW_1(fs, X, val)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs _FP_UNPACK_RAW_1_flo;	\
+      _FP_UNPACK_RAW_1_flo.flt = (val);			\
+							\
+      X##_f = _FP_UNPACK_RAW_1_flo.bits.frac;		\
+      X##_e = _FP_UNPACK_RAW_1_flo.bits.exp;		\
+      X##_s = _FP_UNPACK_RAW_1_flo.bits.sign;		\
+    }							\
+  while (0)
+
+#define _FP_UNPACK_RAW_1_P(fs, X, val)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_UNPACK_RAW_1_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
+							\
+      X##_f = _FP_UNPACK_RAW_1_P_flo->bits.frac;	\
+      X##_e = _FP_UNPACK_RAW_1_P_flo->bits.exp;		\
+      X##_s = _FP_UNPACK_RAW_1_P_flo->bits.sign;	\
+    }							\
+  while (0)
+
+/* Repack the raw bits of a native fp value.  */
+
+#define _FP_PACK_RAW_1(fs, val, X)		\
+  do						\
+    {						\
+      union _FP_UNION_##fs _FP_PACK_RAW_1_flo;	\
+						\
+      _FP_PACK_RAW_1_flo.bits.frac = X##_f;	\
+      _FP_PACK_RAW_1_flo.bits.exp  = X##_e;	\
+      _FP_PACK_RAW_1_flo.bits.sign = X##_s;	\
+						\
+      (val) = _FP_PACK_RAW_1_flo.flt;		\
+    }						\
+  while (0)
+
+#define _FP_PACK_RAW_1_P(fs, val, X)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_PACK_RAW_1_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
+							\
+      _FP_PACK_RAW_1_P_flo->bits.frac = X##_f;		\
+      _FP_PACK_RAW_1_P_flo->bits.exp  = X##_e;		\
+      _FP_PACK_RAW_1_P_flo->bits.sign = X##_s;		\
+    }							\
+  while (0)
+
+
+/* Multiplication algorithms: */
 
 /* Basic.  Assuming the host word size is >= 2*FRACBITS, we can do the
    multiplication immediately.  */
 
+#define _FP_MUL_MEAT_DW_1_imm(wfracbits, R, X, Y)	\
+  do							\
+    {							\
+      R##_f = X##_f * Y##_f;				\
+    }							\
+  while (0)
+
 #define _FP_MUL_MEAT_1_imm(wfracbits, R, X, Y)				\
-  do {									\
-    R##_f = X##_f * Y##_f;						\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_1(R, wfracbits-1, 2*wfracbits);			\
-  } while (0)
+  do									\
+    {									\
+      _FP_MUL_MEAT_DW_1_imm ((wfracbits), R, X, Y);			\
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_1 (R, (wfracbits)-1, 2*(wfracbits));			\
+    }									\
+  while (0)
 
 /* Given a 1W * 1W => 2W primitive, do the extended multiplication.  */
 
+#define _FP_MUL_MEAT_DW_1_wide(wfracbits, R, X, Y, doit)	\
+  do								\
+    {								\
+      doit (R##_f1, R##_f0, X##_f, Y##_f);			\
+    }								\
+  while (0)
+
 #define _FP_MUL_MEAT_1_wide(wfracbits, R, X, Y, doit)			\
-  do {									\
-    _FP_W_TYPE _Z_f0, _Z_f1;						\
-    doit(_Z_f1, _Z_f0, X##_f, Y##_f);					\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_2(_Z, wfracbits-1, 2*wfracbits);			\
-    R##_f = _Z_f0;							\
-  } while (0)
+  do									\
+    {									\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_1_wide_Z);				\
+      _FP_MUL_MEAT_DW_1_wide ((wfracbits), _FP_MUL_MEAT_1_wide_Z,	\
+			      X, Y, doit);				\
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_2 (_FP_MUL_MEAT_1_wide_Z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      R##_f = _FP_MUL_MEAT_1_wide_Z_f0;					\
+    }									\
+  while (0)
 
 /* Finally, a simple widening multiply algorithm.  What fun!  */
 
-#define _FP_MUL_MEAT_1_hard(wfracbits, R, X, Y)				\
-  do {									\
-    _FP_W_TYPE _xh, _xl, _yh, _yl, _z_f0, _z_f1, _a_f0, _a_f1;		\
-									\
-    /* split the words in half */					\
-    _xh = X##_f >> (_FP_W_TYPE_SIZE/2);					\
-    _xl = X##_f & (((_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2)) - 1);		\
-    _yh = Y##_f >> (_FP_W_TYPE_SIZE/2);					\
-    _yl = Y##_f & (((_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2)) - 1);		\
+#define _FP_MUL_MEAT_DW_1_hard(wfracbits, R, X, Y)			\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_1_hard_xh, _FP_MUL_MEAT_DW_1_hard_xl;	\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_1_hard_yh, _FP_MUL_MEAT_DW_1_hard_yl;	\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_1_hard_a);			\
 									\
-    /* multiply the pieces */						\
-    _z_f0 = _xl * _yl;							\
-    _a_f0 = _xh * _yl;							\
-    _a_f1 = _xl * _yh;							\
-    _z_f1 = _xh * _yh;							\
+      /* Split the words in half.  */					\
+      _FP_MUL_MEAT_DW_1_hard_xh = X##_f >> (_FP_W_TYPE_SIZE/2);		\
+      _FP_MUL_MEAT_DW_1_hard_xl						\
+	= X##_f & (((_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE/2)) - 1);	\
+      _FP_MUL_MEAT_DW_1_hard_yh = Y##_f >> (_FP_W_TYPE_SIZE/2);		\
+      _FP_MUL_MEAT_DW_1_hard_yl						\
+	= Y##_f & (((_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE/2)) - 1);	\
 									\
-    /* reassemble into two full words */				\
-    if ((_a_f0 += _a_f1) < _a_f1)					\
-      _z_f1 += (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2);			\
-    _a_f1 = _a_f0 >> (_FP_W_TYPE_SIZE/2);				\
-    _a_f0 = _a_f0 << (_FP_W_TYPE_SIZE/2);				\
-    _FP_FRAC_ADD_2(_z, _z, _a);						\
+      /* Multiply the pieces.  */					\
+      R##_f0 = _FP_MUL_MEAT_DW_1_hard_xl * _FP_MUL_MEAT_DW_1_hard_yl;	\
+      _FP_MUL_MEAT_DW_1_hard_a_f0					\
+	= _FP_MUL_MEAT_DW_1_hard_xh * _FP_MUL_MEAT_DW_1_hard_yl;	\
+      _FP_MUL_MEAT_DW_1_hard_a_f1					\
+	= _FP_MUL_MEAT_DW_1_hard_xl * _FP_MUL_MEAT_DW_1_hard_yh;	\
+      R##_f1 = _FP_MUL_MEAT_DW_1_hard_xh * _FP_MUL_MEAT_DW_1_hard_yh;	\
 									\
-    /* normalize */							\
-    _FP_FRAC_SRS_2(_z, wfracbits - 1, 2*wfracbits);			\
-    R##_f = _z_f0;							\
-  } while (0)
+      /* Reassemble into two full words.  */				\
+      if ((_FP_MUL_MEAT_DW_1_hard_a_f0 += _FP_MUL_MEAT_DW_1_hard_a_f1)	\
+	  < _FP_MUL_MEAT_DW_1_hard_a_f1)				\
+	R##_f1 += (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE/2);		\
+      _FP_MUL_MEAT_DW_1_hard_a_f1					\
+	= _FP_MUL_MEAT_DW_1_hard_a_f0 >> (_FP_W_TYPE_SIZE/2);		\
+      _FP_MUL_MEAT_DW_1_hard_a_f0					\
+	= _FP_MUL_MEAT_DW_1_hard_a_f0 << (_FP_W_TYPE_SIZE/2);		\
+      _FP_FRAC_ADD_2 (R, R, _FP_MUL_MEAT_DW_1_hard_a);			\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_1_hard(wfracbits, R, X, Y)			\
+  do								\
+    {								\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_1_hard_z);			\
+      _FP_MUL_MEAT_DW_1_hard ((wfracbits),			\
+			      _FP_MUL_MEAT_1_hard_z, X, Y);	\
+								\
+      /* Normalize.  */						\
+      _FP_FRAC_SRS_2 (_FP_MUL_MEAT_1_hard_z,			\
+		      (wfracbits) - 1, 2*(wfracbits));		\
+      R##_f = _FP_MUL_MEAT_1_hard_z_f0;				\
+    }								\
+  while (0)
 
 
-/*
- * Division algorithms:
- */
+/* Division algorithms: */
 
 /* Basic.  Assuming the host word size is >= 2*FRACBITS, we can do the
    division immediately.  Give this macro either _FP_DIV_HELP_imm for
    C primitives or _FP_DIV_HELP_ldiv for the ISO function.  Which you
    choose will depend on what the compiler does with divrem4.  */
 
-#define _FP_DIV_MEAT_1_imm(fs, R, X, Y, doit)		\
-  do {							\
-    _FP_W_TYPE _q, _r;					\
-    X##_f <<= (X##_f < Y##_f				\
-	       ? R##_e--, _FP_WFRACBITS_##fs		\
-	       : _FP_WFRACBITS_##fs - 1);		\
-    doit(_q, _r, X##_f, Y##_f);				\
-    R##_f = _q | (_r != 0);				\
-  } while (0)
+#define _FP_DIV_MEAT_1_imm(fs, R, X, Y, doit)				\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_DIV_MEAT_1_imm_q, _FP_DIV_MEAT_1_imm_r;		\
+      X##_f <<= (X##_f < Y##_f						\
+		 ? R##_e--, _FP_WFRACBITS_##fs				\
+		 : _FP_WFRACBITS_##fs - 1);				\
+      doit (_FP_DIV_MEAT_1_imm_q, _FP_DIV_MEAT_1_imm_r, X##_f, Y##_f);	\
+      R##_f = _FP_DIV_MEAT_1_imm_q | (_FP_DIV_MEAT_1_imm_r != 0);	\
+    }									\
+  while (0)
 
 /* GCC's longlong.h defines a 2W / 1W => (1W,1W) primitive udiv_qrnnd
    that may be useful in this situation.  This first is for a primitive
@@ -202,102 +269,101 @@
    for UDIV_NEEDS_NORMALIZATION to tell which your machine needs.  */
 
 #define _FP_DIV_MEAT_1_udiv_norm(fs, R, X, Y)				\
-  do {									\
-    _FP_W_TYPE _nh, _nl, _q, _r, _y;					\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_nh;				\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_nl;				\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_q;				\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_r;				\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_y;				\
+									\
+      /* Normalize Y -- i.e. make the most significant bit set.  */	\
+      _FP_DIV_MEAT_1_udiv_norm_y = Y##_f << _FP_WFRACXBITS_##fs;	\
 									\
-    /* Normalize Y -- i.e. make the most significant bit set.  */	\
-    _y = Y##_f << _FP_WFRACXBITS_##fs;					\
+      /* Shift X op correspondingly high, that is, up one full word.  */ \
+      if (X##_f < Y##_f)						\
+	{								\
+	  R##_e--;							\
+	  _FP_DIV_MEAT_1_udiv_norm_nl = 0;				\
+	  _FP_DIV_MEAT_1_udiv_norm_nh = X##_f;				\
+	}								\
+      else								\
+	{								\
+	  _FP_DIV_MEAT_1_udiv_norm_nl = X##_f << (_FP_W_TYPE_SIZE - 1);	\
+	  _FP_DIV_MEAT_1_udiv_norm_nh = X##_f >> 1;			\
+	}								\
 									\
-    /* Shift X op correspondingly high, that is, up one full word.  */	\
-    if (X##_f < Y##_f)							\
-      {									\
-	R##_e--;							\
-	_nl = 0;							\
-	_nh = X##_f;							\
-      }									\
-    else								\
-      {									\
-	_nl = X##_f << (_FP_W_TYPE_SIZE - 1);				\
-	_nh = X##_f >> 1;						\
-      }									\
-    									\
-    udiv_qrnnd(_q, _r, _nh, _nl, _y);					\
-    R##_f = _q | (_r != 0);						\
-  } while (0)
-
-#define _FP_DIV_MEAT_1_udiv(fs, R, X, Y)		\
-  do {							\
-    _FP_W_TYPE _nh, _nl, _q, _r;			\
-    if (X##_f < Y##_f)					\
-      {							\
-	R##_e--;					\
-	_nl = X##_f << _FP_WFRACBITS_##fs;		\
-	_nh = X##_f >> _FP_WFRACXBITS_##fs;		\
-      }							\
-    else						\
-      {							\
-	_nl = X##_f << (_FP_WFRACBITS_##fs - 1);	\
-	_nh = X##_f >> (_FP_WFRACXBITS_##fs + 1);	\
-      }							\
-    udiv_qrnnd(_q, _r, _nh, _nl, Y##_f);		\
-    R##_f = _q | (_r != 0);				\
-  } while (0)
-  
-  
-/*
- * Square root algorithms:
- * We have just one right now, maybe Newton approximation
- * should be added for those machines where division is fast.
- */
- 
-#define _FP_SQRT_MEAT_1(R, S, T, X, q)			\
-  do {							\
-    while (q != _FP_WORK_ROUND)				\
-      {							\
-        T##_f = S##_f + q;				\
-        if (T##_f <= X##_f)				\
-          {						\
-            S##_f = T##_f + q;				\
-            X##_f -= T##_f;				\
-            R##_f += q;					\
-          }						\
-        _FP_FRAC_SLL_1(X, 1);				\
-        q >>= 1;					\
-      }							\
-    if (X##_f)						\
-      {							\
-	if (S##_f < X##_f)				\
-	  R##_f |= _FP_WORK_ROUND;			\
-	R##_f |= _FP_WORK_STICKY;			\
-      }							\
-  } while (0)
-
-/*
- * Assembly/disassembly for converting to/from integral types.  
- * No shifting or overflow handled here.
- */
-
-#define _FP_FRAC_ASSEMBLE_1(r, X, rsize)	(r = X##_f)
-#define _FP_FRAC_DISASSEMBLE_1(X, r, rsize)	(X##_f = r)
-
-
-/*
- * Convert FP values between word sizes
- */
-
-#define _FP_FRAC_CONV_1_1(dfs, sfs, D, S)				\
-  do {									\
-    D##_f = S##_f;							\
-    if (_FP_WFRACBITS_##sfs > _FP_WFRACBITS_##dfs)			\
-      {									\
-	if (S##_c != FP_CLS_NAN)					\
-	  _FP_FRAC_SRS_1(D, (_FP_WFRACBITS_##sfs-_FP_WFRACBITS_##dfs),	\
-			 _FP_WFRACBITS_##sfs);				\
-	else								\
-	  _FP_FRAC_SRL_1(D, (_FP_WFRACBITS_##sfs-_FP_WFRACBITS_##dfs));	\
-      }									\
-    else								\
-      D##_f <<= _FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs;		\
-  } while (0)
+      udiv_qrnnd (_FP_DIV_MEAT_1_udiv_norm_q,				\
+		  _FP_DIV_MEAT_1_udiv_norm_r,				\
+		  _FP_DIV_MEAT_1_udiv_norm_nh,				\
+		  _FP_DIV_MEAT_1_udiv_norm_nl,				\
+		  _FP_DIV_MEAT_1_udiv_norm_y);				\
+      R##_f = (_FP_DIV_MEAT_1_udiv_norm_q				\
+	       | (_FP_DIV_MEAT_1_udiv_norm_r != 0));			\
+    }									\
+  while (0)
+
+#define _FP_DIV_MEAT_1_udiv(fs, R, X, Y)				\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_nh, _FP_DIV_MEAT_1_udiv_nl;	\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_q, _FP_DIV_MEAT_1_udiv_r;		\
+      if (X##_f < Y##_f)						\
+	{								\
+	  R##_e--;							\
+	  _FP_DIV_MEAT_1_udiv_nl = X##_f << _FP_WFRACBITS_##fs;		\
+	  _FP_DIV_MEAT_1_udiv_nh = X##_f >> _FP_WFRACXBITS_##fs;	\
+	}								\
+      else								\
+	{								\
+	  _FP_DIV_MEAT_1_udiv_nl = X##_f << (_FP_WFRACBITS_##fs - 1);	\
+	  _FP_DIV_MEAT_1_udiv_nh = X##_f >> (_FP_WFRACXBITS_##fs + 1);	\
+	}								\
+      udiv_qrnnd (_FP_DIV_MEAT_1_udiv_q, _FP_DIV_MEAT_1_udiv_r,		\
+		  _FP_DIV_MEAT_1_udiv_nh, _FP_DIV_MEAT_1_udiv_nl,	\
+		  Y##_f);						\
+      R##_f = _FP_DIV_MEAT_1_udiv_q | (_FP_DIV_MEAT_1_udiv_r != 0);	\
+    }									\
+  while (0)
+
+
+/* Square root algorithms:
+   We have just one right now, maybe Newton approximation
+   should be added for those machines where division is fast.  */
+
+#define _FP_SQRT_MEAT_1(R, S, T, X, q)		\
+  do						\
+    {						\
+      while ((q) != _FP_WORK_ROUND)		\
+	{					\
+	  T##_f = S##_f + (q);			\
+	  if (T##_f <= X##_f)			\
+	    {					\
+	      S##_f = T##_f + (q);		\
+	      X##_f -= T##_f;			\
+	      R##_f += (q);			\
+	    }					\
+	  _FP_FRAC_SLL_1 (X, 1);		\
+	  (q) >>= 1;				\
+	}					\
+      if (X##_f)				\
+	{					\
+	  if (S##_f < X##_f)			\
+	    R##_f |= _FP_WORK_ROUND;		\
+	  R##_f |= _FP_WORK_STICKY;		\
+	}					\
+    }						\
+  while (0)
+
+/* Assembly/disassembly for converting to/from integral types.
+   No shifting or overflow handled here.  */
+
+#define _FP_FRAC_ASSEMBLE_1(r, X, rsize)	((r) = X##_f)
+#define _FP_FRAC_DISASSEMBLE_1(X, r, rsize)	(X##_f = (r))
+
+
+/* Convert FP values between word sizes.  */
+
+#define _FP_FRAC_COPY_1_1(D, S)		(D##_f = S##_f)
 
 #endif /* __MATH_EMU_OP_1_H__ */
diff --git a/include/math-emu/op-2.h b/include/math-emu/op-2.h
index 4f26ecc..ed26ae9 100644
--- a/include/math-emu/op-2.h
+++ b/include/math-emu/op-2.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Basic two-word fraction declaration and manipulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,113 +8,139 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_OP_2_H__
 #define __MATH_EMU_OP_2_H__
 
 #define _FP_FRAC_DECL_2(X)	_FP_W_TYPE X##_f0 = 0, X##_f1 = 0
-#define _FP_FRAC_COPY_2(D,S)	(D##_f0 = S##_f0, D##_f1 = S##_f1)
-#define _FP_FRAC_SET_2(X,I)	__FP_FRAC_SET_2(X, I)
+#define _FP_FRAC_COPY_2(D, S)	(D##_f0 = S##_f0, D##_f1 = S##_f1)
+#define _FP_FRAC_SET_2(X, I)	__FP_FRAC_SET_2 (X, I)
 #define _FP_FRAC_HIGH_2(X)	(X##_f1)
 #define _FP_FRAC_LOW_2(X)	(X##_f0)
-#define _FP_FRAC_WORD_2(X,w)	(X##_f##w)
-
-#define _FP_FRAC_SLL_2(X,N)						\
-  do {									\
-    if ((N) < _FP_W_TYPE_SIZE)						\
-      {									\
-	if (__builtin_constant_p(N) && (N) = 1) 			\
-	  {								\
-	    X##_f1 = X##_f1 + X##_f1 + (((_FP_WS_TYPE)(X##_f0)) < 0);	\
-	    X##_f0 += X##_f0;						\
-	  }								\
-	else								\
-	  {								\
-	    X##_f1 = X##_f1 << (N) | X##_f0 >> (_FP_W_TYPE_SIZE - (N));	\
-	    X##_f0 <<= (N);						\
-	  }								\
-      }									\
-    else								\
-      {									\
-	X##_f1 = X##_f0 << ((N) - _FP_W_TYPE_SIZE);			\
-	X##_f0 = 0;							\
-      }									\
-  } while (0)
-
-#define _FP_FRAC_SRL_2(X,N)						\
-  do {									\
-    if ((N) < _FP_W_TYPE_SIZE)						\
-      {									\
-	X##_f0 = X##_f0 >> (N) | X##_f1 << (_FP_W_TYPE_SIZE - (N));	\
-	X##_f1 >>= (N);							\
-      }									\
-    else								\
-      {									\
-	X##_f0 = X##_f1 >> ((N) - _FP_W_TYPE_SIZE);			\
-	X##_f1 = 0;							\
-      }									\
-  } while (0)
+#define _FP_FRAC_WORD_2(X, w)	(X##_f##w)
+
+#define _FP_FRAC_SLL_2(X, N)						\
+  (void) (((N) < _FP_W_TYPE_SIZE)					\
+	  ? ({								\
+	      if (__builtin_constant_p (N) && (N) = 1)			\
+		{							\
+		  X##_f1 = X##_f1 + X##_f1 + (((_FP_WS_TYPE) (X##_f0)) < 0); \
+		  X##_f0 += X##_f0;					\
+		}							\
+	      else							\
+		{							\
+		  X##_f1 = X##_f1 << (N) | X##_f0 >> (_FP_W_TYPE_SIZE - (N)); \
+		  X##_f0 <<= (N);					\
+		}							\
+	      0;							\
+	    })								\
+	  : ({								\
+	      X##_f1 = X##_f0 << ((N) - _FP_W_TYPE_SIZE);		\
+	      X##_f0 = 0;						\
+	    }))
+
+
+#define _FP_FRAC_SRL_2(X, N)						\
+  (void) (((N) < _FP_W_TYPE_SIZE)					\
+	  ? ({								\
+	      X##_f0 = X##_f0 >> (N) | X##_f1 << (_FP_W_TYPE_SIZE - (N)); \
+	      X##_f1 >>= (N);						\
+	    })								\
+	  : ({								\
+	      X##_f0 = X##_f1 >> ((N) - _FP_W_TYPE_SIZE);		\
+	      X##_f1 = 0;						\
+	    }))
 
 /* Right shift with sticky-lsb.  */
-#define _FP_FRAC_SRS_2(X,N,sz)						\
-  do {									\
-    if ((N) < _FP_W_TYPE_SIZE)						\
-      {									\
-	X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) |	\
-		  (__builtin_constant_p(N) && (N) = 1			\
+#define _FP_FRAC_SRST_2(X, S, N, sz)					\
+  (void) (((N) < _FP_W_TYPE_SIZE)					\
+	  ? ({								\
+	      S = (__builtin_constant_p (N) && (N) = 1			\
 		   ? X##_f0 & 1						\
-		   : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0));	\
-	X##_f1 >>= (N);							\
-      }									\
-    else								\
-      {									\
-	X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE) |			\
-		(((X##_f1 << (2*_FP_W_TYPE_SIZE - (N))) | X##_f0) != 0)); \
-	X##_f1 = 0;							\
-      }									\
-  } while (0)
-
-#define _FP_FRAC_ADDI_2(X,I)	\
-  __FP_FRAC_ADDI_2(X##_f1, X##_f0, I)
-
-#define _FP_FRAC_ADD_2(R,X,Y)	\
-  __FP_FRAC_ADD_2(R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
-
-#define _FP_FRAC_SUB_2(R,X,Y)	\
-  __FP_FRAC_SUB_2(R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
-
-#define _FP_FRAC_DEC_2(X,Y)	\
-  __FP_FRAC_DEC_2(X##_f1, X##_f0, Y##_f1, Y##_f0)
-
-#define _FP_FRAC_CLZ_2(R,X)	\
-  do {				\
-    if (X##_f1)			\
-      __FP_CLZ(R,X##_f1);	\
-    else 			\
-    {				\
-      __FP_CLZ(R,X##_f0);	\
-      R += _FP_W_TYPE_SIZE;	\
-    }				\
-  } while(0)
-
-/* Predicates */
-#define _FP_FRAC_NEGP_2(X)	((_FP_WS_TYPE)X##_f1 < 0)
+		   : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0);		\
+	      X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N)); \
+	      X##_f1 >>= (N);						\
+	    })								\
+	  : ({								\
+	      S = ((((N) = _FP_W_TYPE_SIZE				\
+		     ? 0						\
+		     : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N))))		\
+		    | X##_f0) != 0);					\
+	      X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE));		\
+	      X##_f1 = 0;						\
+	    }))
+
+#define _FP_FRAC_SRS_2(X, N, sz)					\
+  (void) (((N) < _FP_W_TYPE_SIZE)					\
+	  ? ({								\
+	      X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) \
+			| (__builtin_constant_p (N) && (N) = 1		\
+			   ? X##_f0 & 1					\
+			   : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0)); \
+	      X##_f1 >>= (N);						\
+	    })								\
+	  : ({								\
+	      X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE)		\
+			| ((((N) = _FP_W_TYPE_SIZE			\
+			     ? 0					\
+			     : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N))))	\
+			    | X##_f0) != 0));				\
+	      X##_f1 = 0;						\
+	    }))
+
+#define _FP_FRAC_ADDI_2(X, I)	\
+  __FP_FRAC_ADDI_2 (X##_f1, X##_f0, I)
+
+#define _FP_FRAC_ADD_2(R, X, Y)	\
+  __FP_FRAC_ADD_2 (R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
+
+#define _FP_FRAC_SUB_2(R, X, Y)	\
+  __FP_FRAC_SUB_2 (R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
+
+#define _FP_FRAC_DEC_2(X, Y)	\
+  __FP_FRAC_DEC_2 (X##_f1, X##_f0, Y##_f1, Y##_f0)
+
+#define _FP_FRAC_CLZ_2(R, X)			\
+  do						\
+    {						\
+      if (X##_f1)				\
+	__FP_CLZ ((R), X##_f1);			\
+      else					\
+	{					\
+	  __FP_CLZ ((R), X##_f0);		\
+	  (R) += _FP_W_TYPE_SIZE;		\
+	}					\
+    }						\
+  while (0)
+
+/* Predicates.  */
+#define _FP_FRAC_NEGP_2(X)	((_FP_WS_TYPE) X##_f1 < 0)
 #define _FP_FRAC_ZEROP_2(X)	((X##_f1 | X##_f0) = 0)
-#define _FP_FRAC_OVERP_2(fs,X)	(_FP_FRAC_HIGH_##fs(X) & _FP_OVERFLOW_##fs)
-#define _FP_FRAC_CLEAR_OVERP_2(fs,X)	(_FP_FRAC_HIGH_##fs(X) &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_OVERP_2(fs, X)	(_FP_FRAC_HIGH_##fs (X) & _FP_OVERFLOW_##fs)
+#define _FP_FRAC_CLEAR_OVERP_2(fs, X)	(_FP_FRAC_HIGH_##fs (X) &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_HIGHBIT_DW_2(fs, X)	\
+  (_FP_FRAC_HIGH_DW_##fs (X) & _FP_HIGHBIT_DW_##fs)
 #define _FP_FRAC_EQ_2(X, Y)	(X##_f1 = Y##_f1 && X##_f0 = Y##_f0)
 #define _FP_FRAC_GT_2(X, Y)	\
   (X##_f1 > Y##_f1 || (X##_f1 = Y##_f1 && X##_f0 > Y##_f0))
@@ -123,491 +149,556 @@
 
 #define _FP_ZEROFRAC_2		0, 0
 #define _FP_MINFRAC_2		0, 1
-#define _FP_MAXFRAC_2		(~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0)
+#define _FP_MAXFRAC_2		(~(_FP_WS_TYPE) 0), (~(_FP_WS_TYPE) 0)
 
-/*
- * Internals 
- */
+/* Internals.  */
 
-#define __FP_FRAC_SET_2(X,I1,I0)	(X##_f0 = I0, X##_f1 = I1)
+#define __FP_FRAC_SET_2(X, I1, I0)	(X##_f0 = I0, X##_f1 = I1)
 
-#define __FP_CLZ_2(R, xh, xl)	\
-  do {				\
-    if (xh)			\
-      __FP_CLZ(R,xh);		\
-    else 			\
-    {				\
-      __FP_CLZ(R,xl);		\
-      R += _FP_W_TYPE_SIZE;	\
-    }				\
-  } while(0)
+#define __FP_CLZ_2(R, xh, xl)			\
+  do						\
+    {						\
+      if (xh)					\
+	__FP_CLZ ((R), xh);			\
+      else					\
+	{					\
+	  __FP_CLZ ((R), xl);			\
+	  (R) += _FP_W_TYPE_SIZE;		\
+	}					\
+    }						\
+  while (0)
 
 #if 0
 
-#ifndef __FP_FRAC_ADDI_2
-#define __FP_FRAC_ADDI_2(xh, xl, i)	\
+# ifndef __FP_FRAC_ADDI_2
+#  define __FP_FRAC_ADDI_2(xh, xl, i)	\
   (xh += ((xl += i) < i))
-#endif
-#ifndef __FP_FRAC_ADD_2
-#define __FP_FRAC_ADD_2(rh, rl, xh, xl, yh, yl)	\
+# endif
+# ifndef __FP_FRAC_ADD_2
+#  define __FP_FRAC_ADD_2(rh, rl, xh, xl, yh, yl)	\
   (rh = xh + yh + ((rl = xl + yl) < xl))
-#endif
-#ifndef __FP_FRAC_SUB_2
-#define __FP_FRAC_SUB_2(rh, rl, xh, xl, yh, yl)	\
+# endif
+# ifndef __FP_FRAC_SUB_2
+#  define __FP_FRAC_SUB_2(rh, rl, xh, xl, yh, yl)	\
   (rh = xh - yh - ((rl = xl - yl) > xl))
-#endif
-#ifndef __FP_FRAC_DEC_2
-#define __FP_FRAC_DEC_2(xh, xl, yh, yl)	\
-  do {					\
-    UWtype _t = xl;			\
-    xh -= yh + ((xl -= yl) > _t);	\
-  } while (0)
-#endif
+# endif
+# ifndef __FP_FRAC_DEC_2
+#  define __FP_FRAC_DEC_2(xh, xl, yh, yl)		\
+  do							\
+    {							\
+      UWtype __FP_FRAC_DEC_2_t = xl;			\
+      xh -= yh + ((xl -= yl) > __FP_FRAC_DEC_2_t);	\
+    }							\
+  while (0)
+# endif
 
 #else
 
-#undef __FP_FRAC_ADDI_2
-#define __FP_FRAC_ADDI_2(xh, xl, i)	add_ssaaaa(xh, xl, xh, xl, 0, i)
-#undef __FP_FRAC_ADD_2
-#define __FP_FRAC_ADD_2			add_ssaaaa
-#undef __FP_FRAC_SUB_2
-#define __FP_FRAC_SUB_2			sub_ddmmss
-#undef __FP_FRAC_DEC_2
-#define __FP_FRAC_DEC_2(xh, xl, yh, yl)	sub_ddmmss(xh, xl, xh, xl, yh, yl)
+# undef __FP_FRAC_ADDI_2
+# define __FP_FRAC_ADDI_2(xh, xl, i)	add_ssaaaa (xh, xl, xh, xl, 0, i)
+# undef __FP_FRAC_ADD_2
+# define __FP_FRAC_ADD_2		add_ssaaaa
+# undef __FP_FRAC_SUB_2
+# define __FP_FRAC_SUB_2		sub_ddmmss
+# undef __FP_FRAC_DEC_2
+# define __FP_FRAC_DEC_2(xh, xl, yh, yl)	\
+  sub_ddmmss (xh, xl, xh, xl, yh, yl)
 
 #endif
 
-/*
- * Unpack the raw bits of a native fp value.  Do not classify or
- * normalize the data.
- */
+/* Unpack the raw bits of a native fp value.  Do not classify or
+   normalize the data.  */
 
 #define _FP_UNPACK_RAW_2(fs, X, val)			\
-  do {							\
-    union _FP_UNION_##fs _flo; _flo.flt = (val);	\
+  do							\
+    {							\
+      union _FP_UNION_##fs _FP_UNPACK_RAW_2_flo;	\
+      _FP_UNPACK_RAW_2_flo.flt = (val);			\
 							\
-    X##_f0 = _flo.bits.frac0;				\
-    X##_f1 = _flo.bits.frac1;				\
-    X##_e  = _flo.bits.exp;				\
-    X##_s  = _flo.bits.sign;				\
-  } while (0)
+      X##_f0 = _FP_UNPACK_RAW_2_flo.bits.frac0;		\
+      X##_f1 = _FP_UNPACK_RAW_2_flo.bits.frac1;		\
+      X##_e  = _FP_UNPACK_RAW_2_flo.bits.exp;		\
+      X##_s  = _FP_UNPACK_RAW_2_flo.bits.sign;		\
+    }							\
+  while (0)
 
 #define _FP_UNPACK_RAW_2_P(fs, X, val)			\
-  do {							\
-    union _FP_UNION_##fs *_flo =			\
-      (union _FP_UNION_##fs *)(val);			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_UNPACK_RAW_2_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
 							\
-    X##_f0 = _flo->bits.frac0;				\
-    X##_f1 = _flo->bits.frac1;				\
-    X##_e  = _flo->bits.exp;				\
-    X##_s  = _flo->bits.sign;				\
-  } while (0)
-
-
-/*
- * Repack the raw bits of a native fp value.
- */
-
-#define _FP_PACK_RAW_2(fs, val, X)			\
-  do {							\
-    union _FP_UNION_##fs _flo;				\
-							\
-    _flo.bits.frac0 = X##_f0;				\
-    _flo.bits.frac1 = X##_f1;				\
-    _flo.bits.exp   = X##_e;				\
-    _flo.bits.sign  = X##_s;				\
-							\
-    (val) = _flo.flt;					\
-  } while (0)
+      X##_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0;	\
+      X##_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1;	\
+      X##_e  = _FP_UNPACK_RAW_2_P_flo->bits.exp;	\
+      X##_s  = _FP_UNPACK_RAW_2_P_flo->bits.sign;	\
+    }							\
+  while (0)
+
+
+/* Repack the raw bits of a native fp value.  */
+
+#define _FP_PACK_RAW_2(fs, val, X)		\
+  do						\
+    {						\
+      union _FP_UNION_##fs _FP_PACK_RAW_2_flo;	\
+						\
+      _FP_PACK_RAW_2_flo.bits.frac0 = X##_f0;	\
+      _FP_PACK_RAW_2_flo.bits.frac1 = X##_f1;	\
+      _FP_PACK_RAW_2_flo.bits.exp   = X##_e;	\
+      _FP_PACK_RAW_2_flo.bits.sign  = X##_s;	\
+						\
+      (val) = _FP_PACK_RAW_2_flo.flt;		\
+    }						\
+  while (0)
 
 #define _FP_PACK_RAW_2_P(fs, val, X)			\
-  do {							\
-    union _FP_UNION_##fs *_flo =			\
-      (union _FP_UNION_##fs *)(val);			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_PACK_RAW_2_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
 							\
-    _flo->bits.frac0 = X##_f0;				\
-    _flo->bits.frac1 = X##_f1;				\
-    _flo->bits.exp   = X##_e;				\
-    _flo->bits.sign  = X##_s;				\
-  } while (0)
+      _FP_PACK_RAW_2_P_flo->bits.frac0 = X##_f0;	\
+      _FP_PACK_RAW_2_P_flo->bits.frac1 = X##_f1;	\
+      _FP_PACK_RAW_2_P_flo->bits.exp   = X##_e;		\
+      _FP_PACK_RAW_2_P_flo->bits.sign  = X##_s;		\
+    }							\
+  while (0)
 
 
-/*
- * Multiplication algorithms:
- */
+/* Multiplication algorithms: */
 
 /* Given a 1W * 1W => 2W primitive, do the extended multiplication.  */
 
-#define _FP_MUL_MEAT_2_wide(wfracbits, R, X, Y, doit)			\
-  do {									\
-    _FP_FRAC_DECL_4(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c);	\
+#define _FP_MUL_MEAT_DW_2_wide(wfracbits, R, X, Y, doit)		\
+  do									\
+    {									\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_2_wide_b);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_2_wide_c);			\
+									\
+      doit (_FP_FRAC_WORD_4 (R, 1), _FP_FRAC_WORD_4 (R, 0),		\
+	    X##_f0, Y##_f0);						\
+      doit (_FP_MUL_MEAT_DW_2_wide_b_f1, _FP_MUL_MEAT_DW_2_wide_b_f0,	\
+	    X##_f0, Y##_f1);						\
+      doit (_FP_MUL_MEAT_DW_2_wide_c_f1, _FP_MUL_MEAT_DW_2_wide_c_f0,	\
+	    X##_f1, Y##_f0);						\
+      doit (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),		\
+	    X##_f1, Y##_f1);						\
 									\
-    doit(_FP_FRAC_WORD_4(_z,1), _FP_FRAC_WORD_4(_z,0), X##_f0, Y##_f0);	\
-    doit(_b_f1, _b_f0, X##_f0, Y##_f1);					\
-    doit(_c_f1, _c_f0, X##_f1, Y##_f0);					\
-    doit(_FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2), X##_f1, Y##_f1);	\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_2_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_2_wide_b_f0,			\
+		       _FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_2_wide_c_f1,			\
+		       _FP_MUL_MEAT_DW_2_wide_c_f0,			\
+		       _FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1));				\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_2_wide(wfracbits, R, X, Y, doit)			\
+  do									\
+    {									\
+      _FP_FRAC_DECL_4 (_FP_MUL_MEAT_2_wide_z);				\
 									\
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1), 0, _b_f1, _b_f0,		\
-		    _FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1));				\
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1), 0, _c_f1, _c_f0,		\
-		    _FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1));				\
+      _FP_MUL_MEAT_DW_2_wide ((wfracbits), _FP_MUL_MEAT_2_wide_z,	\
+			      X, Y, doit);				\
 									\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits);			\
-    R##_f0 = _FP_FRAC_WORD_4(_z,0);					\
-    R##_f1 = _FP_FRAC_WORD_4(_z,1);					\
-  } while (0)
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_4 (_FP_MUL_MEAT_2_wide_z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      R##_f0 = _FP_FRAC_WORD_4 (_FP_MUL_MEAT_2_wide_z, 0);		\
+      R##_f1 = _FP_FRAC_WORD_4 (_FP_MUL_MEAT_2_wide_z, 1);		\
+    }									\
+  while (0)
 
 /* Given a 1W * 1W => 2W primitive, do the extended multiplication.
    Do only 3 multiplications instead of four. This one is for machines
    where multiplication is much more expensive than subtraction.  */
 
-#define _FP_MUL_MEAT_2_wide_3mul(wfracbits, R, X, Y, doit)		\
-  do {									\
-    _FP_FRAC_DECL_4(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c);	\
-    _FP_W_TYPE _d;							\
-    int _c1, _c2;							\
+#define _FP_MUL_MEAT_DW_2_wide_3mul(wfracbits, R, X, Y, doit)		\
+  do									\
+    {									\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_2_wide_3mul_b);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_2_wide_3mul_c);			\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_2_wide_3mul_d;				\
+      int _FP_MUL_MEAT_DW_2_wide_3mul_c1;				\
+      int _FP_MUL_MEAT_DW_2_wide_3mul_c2;				\
 									\
-    _b_f0 = X##_f0 + X##_f1;						\
-    _c1 = _b_f0 < X##_f0;						\
-    _b_f1 = Y##_f0 + Y##_f1;						\
-    _c2 = _b_f1 < Y##_f0;						\
-    doit(_d, _FP_FRAC_WORD_4(_z,0), X##_f0, Y##_f0);			\
-    doit(_FP_FRAC_WORD_4(_z,2), _FP_FRAC_WORD_4(_z,1), _b_f0, _b_f1);	\
-    doit(_c_f1, _c_f0, X##_f1, Y##_f1);					\
+      _FP_MUL_MEAT_DW_2_wide_3mul_b_f0 = X##_f0 + X##_f1;		\
+      _FP_MUL_MEAT_DW_2_wide_3mul_c1					\
+	= _FP_MUL_MEAT_DW_2_wide_3mul_b_f0 < X##_f0;			\
+      _FP_MUL_MEAT_DW_2_wide_3mul_b_f1 = Y##_f0 + Y##_f1;		\
+      _FP_MUL_MEAT_DW_2_wide_3mul_c2					\
+	= _FP_MUL_MEAT_DW_2_wide_3mul_b_f1 < Y##_f0;			\
+      doit (_FP_MUL_MEAT_DW_2_wide_3mul_d, _FP_FRAC_WORD_4 (R, 0),	\
+	    X##_f0, Y##_f0);						\
+      doit (_FP_FRAC_WORD_4 (R, 2), _FP_FRAC_WORD_4 (R, 1),		\
+	    _FP_MUL_MEAT_DW_2_wide_3mul_b_f0,				\
+	    _FP_MUL_MEAT_DW_2_wide_3mul_b_f1);				\
+      doit (_FP_MUL_MEAT_DW_2_wide_3mul_c_f1,				\
+	    _FP_MUL_MEAT_DW_2_wide_3mul_c_f0, X##_f1, Y##_f1);		\
+									\
+      _FP_MUL_MEAT_DW_2_wide_3mul_b_f0					\
+	&= -_FP_MUL_MEAT_DW_2_wide_3mul_c2;				\
+      _FP_MUL_MEAT_DW_2_wide_3mul_b_f1					\
+	&= -_FP_MUL_MEAT_DW_2_wide_3mul_c1;				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1),				\
+		       (_FP_MUL_MEAT_DW_2_wide_3mul_c1			\
+			& _FP_MUL_MEAT_DW_2_wide_3mul_c2), 0,		\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_d,			\
+		       0, _FP_FRAC_WORD_4 (R, 2), _FP_FRAC_WORD_4 (R, 1)); \
+      __FP_FRAC_ADDI_2 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+			_FP_MUL_MEAT_DW_2_wide_3mul_b_f0);		\
+      __FP_FRAC_ADDI_2 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+			_FP_MUL_MEAT_DW_2_wide_3mul_b_f1);		\
+      __FP_FRAC_DEC_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1),				\
+		       0, _FP_MUL_MEAT_DW_2_wide_3mul_d,		\
+		       _FP_FRAC_WORD_4 (R, 0));				\
+      __FP_FRAC_DEC_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_c_f1,		\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_c_f0);		\
+      __FP_FRAC_ADD_2 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_c_f1,		\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_c_f0,		\
+		       _FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2));	\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_2_wide_3mul(wfracbits, R, X, Y, doit)		\
+  do									\
+    {									\
+      _FP_FRAC_DECL_4 (_FP_MUL_MEAT_2_wide_3mul_z);			\
 									\
-    _b_f0 &= -_c2;							\
-    _b_f1 &= -_c1;							\
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1), (_c1 & _c2), 0, _d,		\
-		    0, _FP_FRAC_WORD_4(_z,2), _FP_FRAC_WORD_4(_z,1));	\
-    __FP_FRAC_ADDI_2(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		     _b_f0);						\
-    __FP_FRAC_ADDI_2(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		     _b_f1);						\
-    __FP_FRAC_DEC_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1),				\
-		    0, _d, _FP_FRAC_WORD_4(_z,0));			\
-    __FP_FRAC_DEC_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1), 0, _c_f1, _c_f0);		\
-    __FP_FRAC_ADD_2(_FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2),	\
-		    _c_f1, _c_f0,					\
-		    _FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2));	\
+      _FP_MUL_MEAT_DW_2_wide_3mul ((wfracbits),				\
+				   _FP_MUL_MEAT_2_wide_3mul_z,		\
+				   X, Y, doit);				\
 									\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits);			\
-    R##_f0 = _FP_FRAC_WORD_4(_z,0);					\
-    R##_f1 = _FP_FRAC_WORD_4(_z,1);					\
-  } while (0)
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_4 (_FP_MUL_MEAT_2_wide_3mul_z,			\
+		      (wfracbits)-1, 2*(wfracbits));			\
+      R##_f0 = _FP_FRAC_WORD_4 (_FP_MUL_MEAT_2_wide_3mul_z, 0);		\
+      R##_f1 = _FP_FRAC_WORD_4 (_FP_MUL_MEAT_2_wide_3mul_z, 1);		\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_DW_2_gmp(wfracbits, R, X, Y)	\
+  do							\
+    {							\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_2_gmp_x[2];		\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_2_gmp_y[2];		\
+      _FP_MUL_MEAT_DW_2_gmp_x[0] = X##_f0;		\
+      _FP_MUL_MEAT_DW_2_gmp_x[1] = X##_f1;		\
+      _FP_MUL_MEAT_DW_2_gmp_y[0] = Y##_f0;		\
+      _FP_MUL_MEAT_DW_2_gmp_y[1] = Y##_f1;		\
+							\
+      mpn_mul_n (R##_f, _FP_MUL_MEAT_DW_2_gmp_x,	\
+		 _FP_MUL_MEAT_DW_2_gmp_y, 2);		\
+    }							\
+  while (0)
 
 #define _FP_MUL_MEAT_2_gmp(wfracbits, R, X, Y)				\
-  do {									\
-    _FP_FRAC_DECL_4(_z);						\
-    _FP_W_TYPE _x[2], _y[2];						\
-    _x[0] = X##_f0; _x[1] = X##_f1;					\
-    _y[0] = Y##_f0; _y[1] = Y##_f1;					\
+  do									\
+    {									\
+      _FP_FRAC_DECL_4 (_FP_MUL_MEAT_2_gmp_z);				\
 									\
-    mpn_mul_n(_z_f, _x, _y, 2);						\
+      _FP_MUL_MEAT_DW_2_gmp ((wfracbits), _FP_MUL_MEAT_2_gmp_z, X, Y);	\
 									\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits);			\
-    R##_f0 = _z_f[0];							\
-    R##_f1 = _z_f[1];							\
-  } while (0)
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_4 (_FP_MUL_MEAT_2_gmp_z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      R##_f0 = _FP_MUL_MEAT_2_gmp_z_f[0];				\
+      R##_f1 = _FP_MUL_MEAT_2_gmp_z_f[1];				\
+    }									\
+  while (0)
 
 /* Do at most 120x120$0 bits multiplication using double floating
    point multiplication.  This is useful if floating point
    multiplication has much bigger throughput than integer multiply.
    It is supposed to work for _FP_W_TYPE_SIZE 64 and wfracbits
-   between 106 and 120 only.  
+   between 106 and 120 only.
    Caller guarantees that X and Y has (1LLL << (wfracbits - 1)) set.
    SETFETZ is a macro which will disable all FPU exceptions and set rounding
    towards zero,  RESETFE should optionally reset it back.  */
 
-#define _FP_MUL_MEAT_2_120_240_double(wfracbits, R, X, Y, setfetz, resetfe)	\
-  do {										\
-    static const double _const[] = {						\
-      /* 2^-24 */ 5.9604644775390625e-08,					\
-      /* 2^-48 */ 3.5527136788005009e-15,					\
-      /* 2^-72 */ 2.1175823681357508e-22,					\
-      /* 2^-96 */ 1.2621774483536189e-29,					\
-      /* 2^28 */ 2.68435456e+08,						\
-      /* 2^4 */ 1.600000e+01,							\
-      /* 2^-20 */ 9.5367431640625e-07,						\
-      /* 2^-44 */ 5.6843418860808015e-14,					\
-      /* 2^-68 */ 3.3881317890172014e-21,					\
-      /* 2^-92 */ 2.0194839173657902e-28,					\
-      /* 2^-116 */ 1.2037062152420224e-35};					\
-    double _a240, _b240, _c240, _d240, _e240, _f240, 				\
-	   _g240, _h240, _i240, _j240, _k240;					\
-    union { double d; UDItype i; } _l240, _m240, _n240, _o240,			\
-				   _p240, _q240, _r240, _s240;			\
-    UDItype _t240, _u240, _v240, _w240, _x240, _y240 = 0;			\
-										\
-    if (wfracbits < 106 || wfracbits > 120)					\
-      abort();									\
-										\
-    setfetz;									\
-										\
-    _e240 = (double)(long)(X##_f0 & 0xffffff);					\
-    _j240 = (double)(long)(Y##_f0 & 0xffffff);					\
-    _d240 = (double)(long)((X##_f0 >> 24) & 0xffffff);				\
-    _i240 = (double)(long)((Y##_f0 >> 24) & 0xffffff);				\
-    _c240 = (double)(long)(((X##_f1 << 16) & 0xffffff) | (X##_f0 >> 48));	\
-    _h240 = (double)(long)(((Y##_f1 << 16) & 0xffffff) | (Y##_f0 >> 48));	\
-    _b240 = (double)(long)((X##_f1 >> 8) & 0xffffff);				\
-    _g240 = (double)(long)((Y##_f1 >> 8) & 0xffffff);				\
-    _a240 = (double)(long)(X##_f1 >> 32);					\
-    _f240 = (double)(long)(Y##_f1 >> 32);					\
-    _e240 *= _const[3];								\
-    _j240 *= _const[3];								\
-    _d240 *= _const[2];								\
-    _i240 *= _const[2];								\
-    _c240 *= _const[1];								\
-    _h240 *= _const[1];								\
-    _b240 *= _const[0];								\
-    _g240 *= _const[0];								\
-    _s240.d =							      _e240*_j240;\
-    _r240.d =						_d240*_j240 + _e240*_i240;\
-    _q240.d =				  _c240*_j240 + _d240*_i240 + _e240*_h240;\
-    _p240.d =		    _b240*_j240 + _c240*_i240 + _d240*_h240 + _e240*_g240;\
-    _o240.d = _a240*_j240 + _b240*_i240 + _c240*_h240 + _d240*_g240 + _e240*_f240;\
-    _n240.d = _a240*_i240 + _b240*_h240 + _c240*_g240 + _d240*_f240;		\
-    _m240.d = _a240*_h240 + _b240*_g240 + _c240*_f240;				\
-    _l240.d = _a240*_g240 + _b240*_f240;					\
-    _k240 =   _a240*_f240;							\
-    _r240.d += _s240.d;								\
-    _q240.d += _r240.d;								\
-    _p240.d += _q240.d;								\
-    _o240.d += _p240.d;								\
-    _n240.d += _o240.d;								\
-    _m240.d += _n240.d;								\
-    _l240.d += _m240.d;								\
-    _k240 += _l240.d;								\
-    _s240.d -= ((_const[10]+_s240.d)-_const[10]);				\
-    _r240.d -= ((_const[9]+_r240.d)-_const[9]);					\
-    _q240.d -= ((_const[8]+_q240.d)-_const[8]);					\
-    _p240.d -= ((_const[7]+_p240.d)-_const[7]);					\
-    _o240.d += _const[7];							\
-    _n240.d += _const[6];							\
-    _m240.d += _const[5];							\
-    _l240.d += _const[4];							\
-    if (_s240.d != 0.0) _y240 = 1;						\
-    if (_r240.d != 0.0) _y240 = 1;						\
-    if (_q240.d != 0.0) _y240 = 1;						\
-    if (_p240.d != 0.0) _y240 = 1;						\
-    _t240 = (DItype)_k240;							\
-    _u240 = _l240.i;								\
-    _v240 = _m240.i;								\
-    _w240 = _n240.i;								\
-    _x240 = _o240.i;								\
-    R##_f1 = (_t240 << (128 - (wfracbits - 1)))					\
-	     | ((_u240 & 0xffffff) >> ((wfracbits - 1) - 104));			\
-    R##_f0 = ((_u240 & 0xffffff) << (168 - (wfracbits - 1)))			\
-    	     | ((_v240 & 0xffffff) << (144 - (wfracbits - 1)))			\
-    	     | ((_w240 & 0xffffff) << (120 - (wfracbits - 1)))			\
-    	     | ((_x240 & 0xffffff) >> ((wfracbits - 1) - 96))			\
-    	     | _y240;								\
-    resetfe;									\
-  } while (0)
-
-/*
- * Division algorithms:
- */
+#define _FP_MUL_MEAT_2_120_240_double(wfracbits, R, X, Y, setfetz, resetfe) \
+  do									\
+    {									\
+      static const double _const[] =					\
+	{								\
+	  /* 2^-24 */ 5.9604644775390625e-08,				\
+	  /* 2^-48 */ 3.5527136788005009e-15,				\
+	  /* 2^-72 */ 2.1175823681357508e-22,				\
+	  /* 2^-96 */ 1.2621774483536189e-29,				\
+	  /* 2^28 */ 2.68435456e+08,					\
+	  /* 2^4 */ 1.600000e+01,					\
+	  /* 2^-20 */ 9.5367431640625e-07,				\
+	  /* 2^-44 */ 5.6843418860808015e-14,				\
+	  /* 2^-68 */ 3.3881317890172014e-21,				\
+	  /* 2^-92 */ 2.0194839173657902e-28,				\
+	  /* 2^-116 */ 1.2037062152420224e-35				\
+	};								\
+      double _a240, _b240, _c240, _d240, _e240, _f240,			\
+	_g240, _h240, _i240, _j240, _k240;				\
+      union { double d; UDItype i; } _l240, _m240, _n240, _o240,	\
+				       _p240, _q240, _r240, _s240;	\
+      UDItype _t240, _u240, _v240, _w240, _x240, _y240 = 0;		\
+									\
+      if ((wfracbits) < 106 || (wfracbits) > 120)			\
+	abort ();							\
+									\
+      setfetz;								\
+									\
+      _e240 = (double) (long) (X##_f0 & 0xffffff);			\
+      _j240 = (double) (long) (Y##_f0 & 0xffffff);			\
+      _d240 = (double) (long) ((X##_f0 >> 24) & 0xffffff);		\
+      _i240 = (double) (long) ((Y##_f0 >> 24) & 0xffffff);		\
+      _c240 = (double) (long) (((X##_f1 << 16) & 0xffffff) | (X##_f0 >> 48)); \
+      _h240 = (double) (long) (((Y##_f1 << 16) & 0xffffff) | (Y##_f0 >> 48)); \
+      _b240 = (double) (long) ((X##_f1 >> 8) & 0xffffff);		\
+      _g240 = (double) (long) ((Y##_f1 >> 8) & 0xffffff);		\
+      _a240 = (double) (long) (X##_f1 >> 32);				\
+      _f240 = (double) (long) (Y##_f1 >> 32);				\
+      _e240 *= _const[3];						\
+      _j240 *= _const[3];						\
+      _d240 *= _const[2];						\
+      _i240 *= _const[2];						\
+      _c240 *= _const[1];						\
+      _h240 *= _const[1];						\
+      _b240 *= _const[0];						\
+      _g240 *= _const[0];						\
+      _s240.d =							      _e240*_j240; \
+      _r240.d =						_d240*_j240 + _e240*_i240; \
+      _q240.d =				  _c240*_j240 + _d240*_i240 + _e240*_h240; \
+      _p240.d =		    _b240*_j240 + _c240*_i240 + _d240*_h240 + _e240*_g240; \
+      _o240.d = _a240*_j240 + _b240*_i240 + _c240*_h240 + _d240*_g240 + _e240*_f240; \
+      _n240.d = _a240*_i240 + _b240*_h240 + _c240*_g240 + _d240*_f240;	\
+      _m240.d = _a240*_h240 + _b240*_g240 + _c240*_f240;		\
+      _l240.d = _a240*_g240 + _b240*_f240;				\
+      _k240 =   _a240*_f240;						\
+      _r240.d += _s240.d;						\
+      _q240.d += _r240.d;						\
+      _p240.d += _q240.d;						\
+      _o240.d += _p240.d;						\
+      _n240.d += _o240.d;						\
+      _m240.d += _n240.d;						\
+      _l240.d += _m240.d;						\
+      _k240 += _l240.d;							\
+      _s240.d -= ((_const[10]+_s240.d)-_const[10]);			\
+      _r240.d -= ((_const[9]+_r240.d)-_const[9]);			\
+      _q240.d -= ((_const[8]+_q240.d)-_const[8]);			\
+      _p240.d -= ((_const[7]+_p240.d)-_const[7]);			\
+      _o240.d += _const[7];						\
+      _n240.d += _const[6];						\
+      _m240.d += _const[5];						\
+      _l240.d += _const[4];						\
+      if (_s240.d != 0.0)						\
+	_y240 = 1;							\
+      if (_r240.d != 0.0)						\
+	_y240 = 1;							\
+      if (_q240.d != 0.0)						\
+	_y240 = 1;							\
+      if (_p240.d != 0.0)						\
+	_y240 = 1;							\
+      _t240 = (DItype) _k240;						\
+      _u240 = _l240.i;							\
+      _v240 = _m240.i;							\
+      _w240 = _n240.i;							\
+      _x240 = _o240.i;							\
+      R##_f1 = ((_t240 << (128 - (wfracbits - 1)))			\
+		| ((_u240 & 0xffffff) >> ((wfracbits - 1) - 104)));	\
+      R##_f0 = (((_u240 & 0xffffff) << (168 - (wfracbits - 1)))		\
+		| ((_v240 & 0xffffff) << (144 - (wfracbits - 1)))	\
+		| ((_w240 & 0xffffff) << (120 - (wfracbits - 1)))	\
+		| ((_x240 & 0xffffff) >> ((wfracbits - 1) - 96))	\
+		| _y240);						\
+      resetfe;								\
+    }									\
+  while (0)
+
+/* Division algorithms: */
 
 #define _FP_DIV_MEAT_2_udiv(fs, R, X, Y)				\
-  do {									\
-    _FP_W_TYPE _n_f2, _n_f1, _n_f0, _r_f1, _r_f0, _m_f1, _m_f0;		\
-    if (_FP_FRAC_GT_2(X, Y))						\
-      {									\
-	_n_f2 = X##_f1 >> 1;						\
-	_n_f1 = X##_f1 << (_FP_W_TYPE_SIZE - 1) | X##_f0 >> 1;		\
-	_n_f0 = X##_f0 << (_FP_W_TYPE_SIZE - 1);			\
-      }									\
-    else								\
-      {									\
-	R##_e--;							\
-	_n_f2 = X##_f1;							\
-	_n_f1 = X##_f0;							\
-	_n_f0 = 0;							\
-      }									\
-									\
-    /* Normalize, i.e. make the most significant bit of the 		\
-       denominator set. */						\
-    _FP_FRAC_SLL_2(Y, _FP_WFRACXBITS_##fs);				\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_n_f2;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_n_f1;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_n_f0;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_r_f1;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_r_f0;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_m_f1;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_m_f0;				\
+      if (_FP_FRAC_GE_2 (X, Y))						\
+	{								\
+	  _FP_DIV_MEAT_2_udiv_n_f2 = X##_f1 >> 1;			\
+	  _FP_DIV_MEAT_2_udiv_n_f1					\
+	    = X##_f1 << (_FP_W_TYPE_SIZE - 1) | X##_f0 >> 1;		\
+	  _FP_DIV_MEAT_2_udiv_n_f0					\
+	    = X##_f0 << (_FP_W_TYPE_SIZE - 1);				\
+	}								\
+      else								\
+	{								\
+	  R##_e--;							\
+	  _FP_DIV_MEAT_2_udiv_n_f2 = X##_f1;				\
+	  _FP_DIV_MEAT_2_udiv_n_f1 = X##_f0;				\
+	  _FP_DIV_MEAT_2_udiv_n_f0 = 0;					\
+	}								\
 									\
-    udiv_qrnnd(R##_f1, _r_f1, _n_f2, _n_f1, Y##_f1);			\
-    umul_ppmm(_m_f1, _m_f0, R##_f1, Y##_f0);				\
-    _r_f0 = _n_f0;							\
-    if (_FP_FRAC_GT_2(_m, _r))						\
-      {									\
-	R##_f1--;							\
-	_FP_FRAC_ADD_2(_r, Y, _r);					\
-	if (_FP_FRAC_GE_2(_r, Y) && _FP_FRAC_GT_2(_m, _r))		\
-	  {								\
-	    R##_f1--;							\
-	    _FP_FRAC_ADD_2(_r, Y, _r);					\
-	  }								\
-      }									\
-    _FP_FRAC_DEC_2(_r, _m);						\
+      /* Normalize, i.e. make the most significant bit of the		\
+	 denominator set.  */						\
+      _FP_FRAC_SLL_2 (Y, _FP_WFRACXBITS_##fs);				\
 									\
-    if (_r_f1 = Y##_f1)						\
-      {									\
-	/* This is a special case, not an optimization			\
-	   (_r/Y##_f1 would not fit into UWtype).			\
-	   As _r is guaranteed to be < Y,  R##_f0 can be either		\
-	   (UWtype)-1 or (UWtype)-2.  But as we know what kind		\
-	   of bits it is (sticky, guard, round),  we don't care.	\
-	   We also don't care what the reminder is,  because the	\
-	   guard bit will be set anyway.  -jj */			\
-	R##_f0 = -1;							\
-      }									\
-    else								\
-      {									\
-	udiv_qrnnd(R##_f0, _r_f1, _r_f1, _r_f0, Y##_f1);		\
-	umul_ppmm(_m_f1, _m_f0, R##_f0, Y##_f0);			\
-	_r_f0 = 0;							\
-	if (_FP_FRAC_GT_2(_m, _r))					\
-	  {								\
-	    R##_f0--;							\
-	    _FP_FRAC_ADD_2(_r, Y, _r);					\
-	    if (_FP_FRAC_GE_2(_r, Y) && _FP_FRAC_GT_2(_m, _r))		\
-	      {								\
-		R##_f0--;						\
-		_FP_FRAC_ADD_2(_r, Y, _r);				\
-	      }								\
-	  }								\
-	if (!_FP_FRAC_EQ_2(_r, _m))					\
-	  R##_f0 |= _FP_WORK_STICKY;					\
-      }									\
-  } while (0)
-
-
-#define _FP_DIV_MEAT_2_gmp(fs, R, X, Y)					\
-  do {									\
-    _FP_W_TYPE _x[4], _y[2], _z[4];					\
-    _y[0] = Y##_f0; _y[1] = Y##_f1;					\
-    _x[0] = _x[3] = 0;							\
-    if (_FP_FRAC_GT_2(X, Y))						\
-      {									\
-	R##_e++;							\
-	_x[1] = (X##_f0 << (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE) |	\
-		 X##_f1 >> (_FP_W_TYPE_SIZE -				\
-			    (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE)));	\
-	_x[2] = X##_f1 << (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE);	\
-      }									\
-    else								\
-      {									\
-	_x[1] = (X##_f0 << (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE) |	\
-		 X##_f1 >> (_FP_W_TYPE_SIZE -				\
-			    (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE)));	\
-	_x[2] = X##_f1 << (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE);	\
-      }									\
+      udiv_qrnnd (R##_f1, _FP_DIV_MEAT_2_udiv_r_f1,			\
+		  _FP_DIV_MEAT_2_udiv_n_f2, _FP_DIV_MEAT_2_udiv_n_f1,	\
+		  Y##_f1);						\
+      umul_ppmm (_FP_DIV_MEAT_2_udiv_m_f1, _FP_DIV_MEAT_2_udiv_m_f0,	\
+		 R##_f1, Y##_f0);					\
+      _FP_DIV_MEAT_2_udiv_r_f0 = _FP_DIV_MEAT_2_udiv_n_f0;		\
+      if (_FP_FRAC_GT_2 (_FP_DIV_MEAT_2_udiv_m, _FP_DIV_MEAT_2_udiv_r))	\
+	{								\
+	  R##_f1--;							\
+	  _FP_FRAC_ADD_2 (_FP_DIV_MEAT_2_udiv_r, Y,			\
+			  _FP_DIV_MEAT_2_udiv_r);			\
+	  if (_FP_FRAC_GE_2 (_FP_DIV_MEAT_2_udiv_r, Y)			\
+	      && _FP_FRAC_GT_2 (_FP_DIV_MEAT_2_udiv_m,			\
+				_FP_DIV_MEAT_2_udiv_r))			\
+	    {								\
+	      R##_f1--;							\
+	      _FP_FRAC_ADD_2 (_FP_DIV_MEAT_2_udiv_r, Y,			\
+			      _FP_DIV_MEAT_2_udiv_r);			\
+	    }								\
+	}								\
+      _FP_FRAC_DEC_2 (_FP_DIV_MEAT_2_udiv_r, _FP_DIV_MEAT_2_udiv_m);	\
 									\
-    (void) mpn_divrem (_z, 0, _x, 4, _y, 2);				\
-    R##_f1 = _z[1];							\
-    R##_f0 = _z[0] | ((_x[0] | _x[1]) != 0);				\
-  } while (0)
-
-
-/*
- * Square root algorithms:
- * We have just one right now, maybe Newton approximation
- * should be added for those machines where division is fast.
- */
- 
-#define _FP_SQRT_MEAT_2(R, S, T, X, q)			\
-  do {							\
-    while (q)						\
-      {							\
-	T##_f1 = S##_f1 + q;				\
-	if (T##_f1 <= X##_f1)				\
-	  {						\
-	    S##_f1 = T##_f1 + q;			\
-	    X##_f1 -= T##_f1;				\
-	    R##_f1 += q;				\
-	  }						\
-	_FP_FRAC_SLL_2(X, 1);				\
-	q >>= 1;					\
-      }							\
-    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);		\
-    while (q != _FP_WORK_ROUND)				\
-      {							\
-	T##_f0 = S##_f0 + q;				\
-	T##_f1 = S##_f1;				\
-	if (T##_f1 < X##_f1 || 				\
-	    (T##_f1 = X##_f1 && T##_f0 <= X##_f0))	\
-	  {						\
-	    S##_f0 = T##_f0 + q;			\
-	    S##_f1 += (T##_f0 > S##_f0);		\
-	    _FP_FRAC_DEC_2(X, T);			\
-	    R##_f0 += q;				\
-	  }						\
-	_FP_FRAC_SLL_2(X, 1);				\
-	q >>= 1;					\
-      }							\
-    if (X##_f0 | X##_f1)				\
-      {							\
-	if (S##_f1 < X##_f1 || 				\
-	    (S##_f1 = X##_f1 && S##_f0 < X##_f0))	\
-	  R##_f0 |= _FP_WORK_ROUND;			\
-	R##_f0 |= _FP_WORK_STICKY;			\
-      }							\
-  } while (0)
-
-
-/*
- * Assembly/disassembly for converting to/from integral types.  
- * No shifting or overflow handled here.
- */
+      if (_FP_DIV_MEAT_2_udiv_r_f1 = Y##_f1)				\
+	{								\
+	  /* This is a special case, not an optimization		\
+	     (_FP_DIV_MEAT_2_udiv_r/Y##_f1 would not fit into UWtype).	\
+	     As _FP_DIV_MEAT_2_udiv_r is guaranteed to be < Y,		\
+	     R##_f0 can be either (UWtype)-1 or (UWtype)-2.  But as we	\
+	     know what kind of bits it is (sticky, guard, round),	\
+	     we don't care.  We also don't care what the reminder is,	\
+	     because the guard bit will be set anyway.  -jj */		\
+	  R##_f0 = -1;							\
+	}								\
+      else								\
+	{								\
+	  udiv_qrnnd (R##_f0, _FP_DIV_MEAT_2_udiv_r_f1,			\
+		      _FP_DIV_MEAT_2_udiv_r_f1,				\
+		      _FP_DIV_MEAT_2_udiv_r_f0, Y##_f1);		\
+	  umul_ppmm (_FP_DIV_MEAT_2_udiv_m_f1,				\
+		     _FP_DIV_MEAT_2_udiv_m_f0, R##_f0, Y##_f0);		\
+	  _FP_DIV_MEAT_2_udiv_r_f0 = 0;					\
+	  if (_FP_FRAC_GT_2 (_FP_DIV_MEAT_2_udiv_m,			\
+			     _FP_DIV_MEAT_2_udiv_r))			\
+	    {								\
+	      R##_f0--;							\
+	      _FP_FRAC_ADD_2 (_FP_DIV_MEAT_2_udiv_r, Y,			\
+			      _FP_DIV_MEAT_2_udiv_r);			\
+	      if (_FP_FRAC_GE_2 (_FP_DIV_MEAT_2_udiv_r, Y)		\
+		  && _FP_FRAC_GT_2 (_FP_DIV_MEAT_2_udiv_m,		\
+				    _FP_DIV_MEAT_2_udiv_r))		\
+		{							\
+		  R##_f0--;						\
+		  _FP_FRAC_ADD_2 (_FP_DIV_MEAT_2_udiv_r, Y,		\
+				  _FP_DIV_MEAT_2_udiv_r);		\
+		}							\
+	    }								\
+	  if (!_FP_FRAC_EQ_2 (_FP_DIV_MEAT_2_udiv_r,			\
+			      _FP_DIV_MEAT_2_udiv_m))			\
+	    R##_f0 |= _FP_WORK_STICKY;					\
+	}								\
+    }									\
+  while (0)
+
+
+/* Square root algorithms:
+   We have just one right now, maybe Newton approximation
+   should be added for those machines where division is fast.  */
+
+#define _FP_SQRT_MEAT_2(R, S, T, X, q)				\
+  do								\
+    {								\
+      while (q)							\
+	{							\
+	  T##_f1 = S##_f1 + (q);				\
+	  if (T##_f1 <= X##_f1)					\
+	    {							\
+	      S##_f1 = T##_f1 + (q);				\
+	      X##_f1 -= T##_f1;					\
+	      R##_f1 += (q);					\
+	    }							\
+	  _FP_FRAC_SLL_2 (X, 1);				\
+	  (q) >>= 1;						\
+	}							\
+      (q) = (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE - 1);		\
+      while ((q) != _FP_WORK_ROUND)				\
+	{							\
+	  T##_f0 = S##_f0 + (q);				\
+	  T##_f1 = S##_f1;					\
+	  if (T##_f1 < X##_f1					\
+	      || (T##_f1 = X##_f1 && T##_f0 <= X##_f0))	\
+	    {							\
+	      S##_f0 = T##_f0 + (q);				\
+	      S##_f1 += (T##_f0 > S##_f0);			\
+	      _FP_FRAC_DEC_2 (X, T);				\
+	      R##_f0 += (q);					\
+	    }							\
+	  _FP_FRAC_SLL_2 (X, 1);				\
+	  (q) >>= 1;						\
+	}							\
+      if (X##_f0 | X##_f1)					\
+	{							\
+	  if (S##_f1 < X##_f1					\
+	      || (S##_f1 = X##_f1 && S##_f0 < X##_f0))		\
+	    R##_f0 |= _FP_WORK_ROUND;				\
+	  R##_f0 |= _FP_WORK_STICKY;				\
+	}							\
+    }								\
+  while (0)
+
+
+/* Assembly/disassembly for converting to/from integral types.
+   No shifting or overflow handled here.  */
 
 #define _FP_FRAC_ASSEMBLE_2(r, X, rsize)	\
-  do {						\
-    if (rsize <= _FP_W_TYPE_SIZE)		\
-      r = X##_f0;				\
-    else					\
-      {						\
-	r = X##_f1;				\
-	r <<= _FP_W_TYPE_SIZE;			\
-	r += X##_f0;				\
-      }						\
-  } while (0)
-
-#define _FP_FRAC_DISASSEMBLE_2(X, r, rsize)				\
-  do {									\
-    X##_f0 = r;								\
-    X##_f1 = (rsize <= _FP_W_TYPE_SIZE ? 0 : r >> _FP_W_TYPE_SIZE);	\
-  } while (0)
-
-/*
- * Convert FP values between word sizes
- */
-
-#define _FP_FRAC_CONV_1_2(dfs, sfs, D, S)				\
-  do {									\
-    if (S##_c != FP_CLS_NAN)						\
-      _FP_FRAC_SRS_2(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs),	\
-		     _FP_WFRACBITS_##sfs);				\
-    else								\
-      _FP_FRAC_SRL_2(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs));	\
-    D##_f = S##_f0;							\
-  } while (0)
-
-#define _FP_FRAC_CONV_2_1(dfs, sfs, D, S)				\
-  do {									\
-    D##_f0 = S##_f;							\
-    D##_f1 = 0;								\
-    _FP_FRAC_SLL_2(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs));	\
-  } while (0)
+  (void) (((rsize) <= _FP_W_TYPE_SIZE)		\
+	  ? ({ (r) = X##_f0; })			\
+	  : ({					\
+	      (r) = X##_f1;			\
+	      (r) <<= _FP_W_TYPE_SIZE;		\
+	      (r) += X##_f0;			\
+	    }))
+
+#define _FP_FRAC_DISASSEMBLE_2(X, r, rsize)	\
+  do						\
+    {						\
+      X##_f0 = (r);				\
+      X##_f1 = ((rsize) <= _FP_W_TYPE_SIZE	\
+		? 0				\
+		: (r) >> _FP_W_TYPE_SIZE);	\
+    }						\
+  while (0)
+
+/* Convert FP values between word sizes.  */
+
+#define _FP_FRAC_COPY_1_2(D, S)		(D##_f = S##_f0)
+
+#define _FP_FRAC_COPY_2_1(D, S)		((D##_f0 = S##_f), (D##_f1 = 0))
+
+#define _FP_FRAC_COPY_2_2(D, S)		_FP_FRAC_COPY_2 (D, S)
 
 #endif
diff --git a/include/math-emu/op-4.h b/include/math-emu/op-4.h
index ba226f8..1c409eb 100644
--- a/include/math-emu/op-4.h
+++ b/include/math-emu/op-4.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Basic four-word fraction declaration and manipulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,685 +8,868 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_OP_4_H__
 #define __MATH_EMU_OP_4_H__
 
 #define _FP_FRAC_DECL_4(X)	_FP_W_TYPE X##_f[4]
-#define _FP_FRAC_COPY_4(D,S)			\
+#define _FP_FRAC_COPY_4(D, S)			\
   (D##_f[0] = S##_f[0], D##_f[1] = S##_f[1],	\
    D##_f[2] = S##_f[2], D##_f[3] = S##_f[3])
-#define _FP_FRAC_SET_4(X,I)	__FP_FRAC_SET_4(X, I)
+#define _FP_FRAC_SET_4(X, I)	__FP_FRAC_SET_4 (X, I)
 #define _FP_FRAC_HIGH_4(X)	(X##_f[3])
 #define _FP_FRAC_LOW_4(X)	(X##_f[0])
-#define _FP_FRAC_WORD_4(X,w)	(X##_f[w])
-
-#define _FP_FRAC_SLL_4(X,N)						\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _up = (N) % _FP_W_TYPE_SIZE;					\
-    _down = _FP_W_TYPE_SIZE - _up;					\
-    if (!_up)								\
-      for (_i = 3; _i >= _skip; --_i)					\
-	X##_f[_i] = X##_f[_i-_skip];					\
-    else								\
-      {									\
-	for (_i = 3; _i > _skip; --_i)					\
-	  X##_f[_i] = X##_f[_i-_skip] << _up				\
-		      | X##_f[_i-_skip-1] >> _down;			\
-	X##_f[_i--] = X##_f[0] << _up; 					\
-      }									\
-    for (; _i >= 0; --_i)						\
-      X##_f[_i] = 0;							\
-  } while (0)
-
-/* This one was broken too */
-#define _FP_FRAC_SRL_4(X,N)						\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _down = (N) % _FP_W_TYPE_SIZE;					\
-    _up = _FP_W_TYPE_SIZE - _down;					\
-    if (!_down)								\
-      for (_i = 0; _i <= 3-_skip; ++_i)					\
-	X##_f[_i] = X##_f[_i+_skip];					\
-    else								\
-      {									\
-	for (_i = 0; _i < 3-_skip; ++_i)				\
-	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
-		      | X##_f[_i+_skip+1] << _up;			\
-	X##_f[_i++] = X##_f[3] >> _down;				\
-      }									\
-    for (; _i < 4; ++_i)						\
-      X##_f[_i] = 0;							\
-  } while (0)
-
-
-/* Right shift with sticky-lsb. 
- * What this actually means is that we do a standard right-shift,
- * but that if any of the bits that fall off the right hand side
- * were one then we always set the LSbit.
- */
-#define _FP_FRAC_SRS_4(X,N,size)					\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _FP_W_TYPE _s;							\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _down = (N) % _FP_W_TYPE_SIZE;					\
-    _up = _FP_W_TYPE_SIZE - _down;					\
-    for (_s = _i = 0; _i < _skip; ++_i)					\
-      _s |= X##_f[_i];							\
-    _s |= X##_f[_i] << _up;						\
-/* s is now != 0 if we want to set the LSbit */				\
-    if (!_down)								\
-      for (_i = 0; _i <= 3-_skip; ++_i)					\
-	X##_f[_i] = X##_f[_i+_skip];					\
-    else								\
-      {									\
-	for (_i = 0; _i < 3-_skip; ++_i)				\
-	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
-		      | X##_f[_i+_skip+1] << _up;			\
-	X##_f[_i++] = X##_f[3] >> _down;				\
-      }									\
-    for (; _i < 4; ++_i)						\
-      X##_f[_i] = 0;							\
-    /* don't fix the LSB until the very end when we're sure f[0] is stable */	\
-    X##_f[0] |= (_s != 0);						\
-  } while (0)
-
-#define _FP_FRAC_ADD_4(R,X,Y)						\
-  __FP_FRAC_ADD_4(R##_f[3], R##_f[2], R##_f[1], R##_f[0],		\
-		  X##_f[3], X##_f[2], X##_f[1], X##_f[0],		\
-		  Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
-
-#define _FP_FRAC_SUB_4(R,X,Y)						\
-  __FP_FRAC_SUB_4(R##_f[3], R##_f[2], R##_f[1], R##_f[0],		\
-		  X##_f[3], X##_f[2], X##_f[1], X##_f[0],		\
-		  Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
-
-#define _FP_FRAC_DEC_4(X,Y)						\
-  __FP_FRAC_DEC_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0],		\
-		  Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
-
-#define _FP_FRAC_ADDI_4(X,I)						\
-  __FP_FRAC_ADDI_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0], I)
-
-#define _FP_ZEROFRAC_4  0,0,0,0
-#define _FP_MINFRAC_4   0,0,0,1
-#define _FP_MAXFRAC_4	(~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0)
+#define _FP_FRAC_WORD_4(X, w)	(X##_f[w])
+
+#define _FP_FRAC_SLL_4(X, N)						\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SLL_4_up, _FP_FRAC_SLL_4_down;		\
+      _FP_I_TYPE _FP_FRAC_SLL_4_skip, _FP_FRAC_SLL_4_i;			\
+      _FP_FRAC_SLL_4_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SLL_4_up = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SLL_4_down = _FP_W_TYPE_SIZE - _FP_FRAC_SLL_4_up;	\
+      if (!_FP_FRAC_SLL_4_up)						\
+	for (_FP_FRAC_SLL_4_i = 3;					\
+	     _FP_FRAC_SLL_4_i >= _FP_FRAC_SLL_4_skip;			\
+	     --_FP_FRAC_SLL_4_i)					\
+	  X##_f[_FP_FRAC_SLL_4_i]					\
+	    = X##_f[_FP_FRAC_SLL_4_i-_FP_FRAC_SLL_4_skip];		\
+      else								\
+	{								\
+	  for (_FP_FRAC_SLL_4_i = 3;					\
+	       _FP_FRAC_SLL_4_i > _FP_FRAC_SLL_4_skip;			\
+	       --_FP_FRAC_SLL_4_i)					\
+	    X##_f[_FP_FRAC_SLL_4_i]					\
+	      = ((X##_f[_FP_FRAC_SLL_4_i-_FP_FRAC_SLL_4_skip]		\
+		  << _FP_FRAC_SLL_4_up)					\
+		 | (X##_f[_FP_FRAC_SLL_4_i-_FP_FRAC_SLL_4_skip-1]	\
+		    >> _FP_FRAC_SLL_4_down));				\
+	  X##_f[_FP_FRAC_SLL_4_i--] = X##_f[0] << _FP_FRAC_SLL_4_up;	\
+	}								\
+      for (; _FP_FRAC_SLL_4_i >= 0; --_FP_FRAC_SLL_4_i)			\
+	X##_f[_FP_FRAC_SLL_4_i] = 0;					\
+    }									\
+  while (0)
+
+/* This one was broken too.  */
+#define _FP_FRAC_SRL_4(X, N)						\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SRL_4_up, _FP_FRAC_SRL_4_down;		\
+      _FP_I_TYPE _FP_FRAC_SRL_4_skip, _FP_FRAC_SRL_4_i;			\
+      _FP_FRAC_SRL_4_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRL_4_down = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRL_4_up = _FP_W_TYPE_SIZE - _FP_FRAC_SRL_4_down;	\
+      if (!_FP_FRAC_SRL_4_down)						\
+	for (_FP_FRAC_SRL_4_i = 0;					\
+	     _FP_FRAC_SRL_4_i <= 3-_FP_FRAC_SRL_4_skip;			\
+	     ++_FP_FRAC_SRL_4_i)					\
+	  X##_f[_FP_FRAC_SRL_4_i]					\
+	    = X##_f[_FP_FRAC_SRL_4_i+_FP_FRAC_SRL_4_skip];		\
+      else								\
+	{								\
+	  for (_FP_FRAC_SRL_4_i = 0;					\
+	       _FP_FRAC_SRL_4_i < 3-_FP_FRAC_SRL_4_skip;		\
+	       ++_FP_FRAC_SRL_4_i)					\
+	    X##_f[_FP_FRAC_SRL_4_i]					\
+	      = ((X##_f[_FP_FRAC_SRL_4_i+_FP_FRAC_SRL_4_skip]		\
+		  >> _FP_FRAC_SRL_4_down)				\
+		 | (X##_f[_FP_FRAC_SRL_4_i+_FP_FRAC_SRL_4_skip+1]	\
+		    << _FP_FRAC_SRL_4_up));				\
+	  X##_f[_FP_FRAC_SRL_4_i++] = X##_f[3] >> _FP_FRAC_SRL_4_down;	\
+	}								\
+      for (; _FP_FRAC_SRL_4_i < 4; ++_FP_FRAC_SRL_4_i)			\
+	X##_f[_FP_FRAC_SRL_4_i] = 0;					\
+    }									\
+  while (0)
+
+
+/* Right shift with sticky-lsb.
+   What this actually means is that we do a standard right-shift,
+   but that if any of the bits that fall off the right hand side
+   were one then we always set the LSbit.  */
+#define _FP_FRAC_SRST_4(X, S, N, size)					\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SRST_4_up, _FP_FRAC_SRST_4_down;		\
+      _FP_I_TYPE _FP_FRAC_SRST_4_skip, _FP_FRAC_SRST_4_i;		\
+      _FP_W_TYPE _FP_FRAC_SRST_4_s;					\
+      _FP_FRAC_SRST_4_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRST_4_down = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRST_4_up = _FP_W_TYPE_SIZE - _FP_FRAC_SRST_4_down;	\
+      for (_FP_FRAC_SRST_4_s = _FP_FRAC_SRST_4_i = 0;			\
+	   _FP_FRAC_SRST_4_i < _FP_FRAC_SRST_4_skip;			\
+	   ++_FP_FRAC_SRST_4_i)						\
+	_FP_FRAC_SRST_4_s |= X##_f[_FP_FRAC_SRST_4_i];			\
+      if (!_FP_FRAC_SRST_4_down)					\
+	for (_FP_FRAC_SRST_4_i = 0;					\
+	     _FP_FRAC_SRST_4_i <= 3-_FP_FRAC_SRST_4_skip;		\
+	     ++_FP_FRAC_SRST_4_i)					\
+	  X##_f[_FP_FRAC_SRST_4_i]					\
+	    = X##_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip];		\
+      else								\
+	{								\
+	  _FP_FRAC_SRST_4_s						\
+	    |= X##_f[_FP_FRAC_SRST_4_i] << _FP_FRAC_SRST_4_up;		\
+	  for (_FP_FRAC_SRST_4_i = 0;					\
+	       _FP_FRAC_SRST_4_i < 3-_FP_FRAC_SRST_4_skip;		\
+	       ++_FP_FRAC_SRST_4_i)					\
+	    X##_f[_FP_FRAC_SRST_4_i]					\
+	      = ((X##_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip]		\
+		  >> _FP_FRAC_SRST_4_down)				\
+		 | (X##_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip+1]	\
+		    << _FP_FRAC_SRST_4_up));				\
+	  X##_f[_FP_FRAC_SRST_4_i++]					\
+	    = X##_f[3] >> _FP_FRAC_SRST_4_down;				\
+	}								\
+      for (; _FP_FRAC_SRST_4_i < 4; ++_FP_FRAC_SRST_4_i)		\
+	X##_f[_FP_FRAC_SRST_4_i] = 0;					\
+      S = (_FP_FRAC_SRST_4_s != 0);					\
+    }									\
+  while (0)
+
+#define _FP_FRAC_SRS_4(X, N, size)				\
+  do								\
+    {								\
+      int _FP_FRAC_SRS_4_sticky;				\
+      _FP_FRAC_SRST_4 (X, _FP_FRAC_SRS_4_sticky, (N), (size));	\
+      X##_f[0] |= _FP_FRAC_SRS_4_sticky;			\
+    }								\
+  while (0)
+
+#define _FP_FRAC_ADD_4(R, X, Y)					\
+  __FP_FRAC_ADD_4 (R##_f[3], R##_f[2], R##_f[1], R##_f[0],	\
+		   X##_f[3], X##_f[2], X##_f[1], X##_f[0],	\
+		   Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
+
+#define _FP_FRAC_SUB_4(R, X, Y)					\
+  __FP_FRAC_SUB_4 (R##_f[3], R##_f[2], R##_f[1], R##_f[0],	\
+		   X##_f[3], X##_f[2], X##_f[1], X##_f[0],	\
+		   Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
+
+#define _FP_FRAC_DEC_4(X, Y)					\
+  __FP_FRAC_DEC_4 (X##_f[3], X##_f[2], X##_f[1], X##_f[0],	\
+		   Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
+
+#define _FP_FRAC_ADDI_4(X, I)					\
+  __FP_FRAC_ADDI_4 (X##_f[3], X##_f[2], X##_f[1], X##_f[0], I)
+
+#define _FP_ZEROFRAC_4  0, 0, 0, 0
+#define _FP_MINFRAC_4   0, 0, 0, 1
+#define _FP_MAXFRAC_4	(~(_FP_WS_TYPE) 0), (~(_FP_WS_TYPE) 0), (~(_FP_WS_TYPE) 0), (~(_FP_WS_TYPE) 0)
 
 #define _FP_FRAC_ZEROP_4(X)     ((X##_f[0] | X##_f[1] | X##_f[2] | X##_f[3]) = 0)
-#define _FP_FRAC_NEGP_4(X)      ((_FP_WS_TYPE)X##_f[3] < 0)
-#define _FP_FRAC_OVERP_4(fs,X)  (_FP_FRAC_HIGH_##fs(X) & _FP_OVERFLOW_##fs)
-#define _FP_FRAC_CLEAR_OVERP_4(fs,X)  (_FP_FRAC_HIGH_##fs(X) &= ~_FP_OVERFLOW_##fs)
-
-#define _FP_FRAC_EQ_4(X,Y)				\
- (X##_f[0] = Y##_f[0] && X##_f[1] = Y##_f[1]		\
-  && X##_f[2] = Y##_f[2] && X##_f[3] = Y##_f[3])
-
-#define _FP_FRAC_GT_4(X,Y)				\
- (X##_f[3] > Y##_f[3] ||				\
-  (X##_f[3] = Y##_f[3] && (X##_f[2] > Y##_f[2] ||	\
-   (X##_f[2] = Y##_f[2] && (X##_f[1] > Y##_f[1] ||	\
-    (X##_f[1] = Y##_f[1] && X##_f[0] > Y##_f[0])	\
-   ))							\
-  ))							\
- )
-
-#define _FP_FRAC_GE_4(X,Y)				\
- (X##_f[3] > Y##_f[3] ||				\
-  (X##_f[3] = Y##_f[3] && (X##_f[2] > Y##_f[2] ||	\
-   (X##_f[2] = Y##_f[2] && (X##_f[1] > Y##_f[1] ||	\
-    (X##_f[1] = Y##_f[1] && X##_f[0] >= Y##_f[0])	\
-   ))							\
-  ))							\
- )
-
-
-#define _FP_FRAC_CLZ_4(R,X)		\
-  do {					\
-    if (X##_f[3])			\
-    {					\
-	__FP_CLZ(R,X##_f[3]);		\
-    }					\
-    else if (X##_f[2])			\
-    {					\
-	__FP_CLZ(R,X##_f[2]);		\
-	R += _FP_W_TYPE_SIZE;		\
-    }					\
-    else if (X##_f[1])			\
-    {					\
-	__FP_CLZ(R,X##_f[2]);		\
-	R += _FP_W_TYPE_SIZE*2;		\
-    }					\
-    else				\
-    {					\
-	__FP_CLZ(R,X##_f[0]);		\
-	R += _FP_W_TYPE_SIZE*3;		\
-    }					\
-  } while(0)
-
-
-#define _FP_UNPACK_RAW_4(fs, X, val)				\
-  do {								\
-    union _FP_UNION_##fs _flo; _flo.flt = (val);		\
-    X##_f[0] = _flo.bits.frac0;					\
-    X##_f[1] = _flo.bits.frac1;					\
-    X##_f[2] = _flo.bits.frac2;					\
-    X##_f[3] = _flo.bits.frac3;					\
-    X##_e  = _flo.bits.exp;					\
-    X##_s  = _flo.bits.sign;					\
-  } while (0)
-
-#define _FP_UNPACK_RAW_4_P(fs, X, val)				\
-  do {								\
-    union _FP_UNION_##fs *_flo =				\
-      (union _FP_UNION_##fs *)(val);				\
-								\
-    X##_f[0] = _flo->bits.frac0;				\
-    X##_f[1] = _flo->bits.frac1;				\
-    X##_f[2] = _flo->bits.frac2;				\
-    X##_f[3] = _flo->bits.frac3;				\
-    X##_e  = _flo->bits.exp;					\
-    X##_s  = _flo->bits.sign;					\
-  } while (0)
-
-#define _FP_PACK_RAW_4(fs, val, X)				\
-  do {								\
-    union _FP_UNION_##fs _flo;					\
-    _flo.bits.frac0 = X##_f[0];					\
-    _flo.bits.frac1 = X##_f[1];					\
-    _flo.bits.frac2 = X##_f[2];					\
-    _flo.bits.frac3 = X##_f[3];					\
-    _flo.bits.exp   = X##_e;					\
-    _flo.bits.sign  = X##_s;					\
-    (val) = _flo.flt;				   		\
-  } while (0)
-
-#define _FP_PACK_RAW_4_P(fs, val, X)				\
-  do {								\
-    union _FP_UNION_##fs *_flo =				\
-      (union _FP_UNION_##fs *)(val);				\
-								\
-    _flo->bits.frac0 = X##_f[0];				\
-    _flo->bits.frac1 = X##_f[1];				\
-    _flo->bits.frac2 = X##_f[2];				\
-    _flo->bits.frac3 = X##_f[3];				\
-    _flo->bits.exp   = X##_e;					\
-    _flo->bits.sign  = X##_s;					\
-  } while (0)
-
-/*
- * Multiplication algorithms:
- */
+#define _FP_FRAC_NEGP_4(X)      ((_FP_WS_TYPE) X##_f[3] < 0)
+#define _FP_FRAC_OVERP_4(fs, X)  (_FP_FRAC_HIGH_##fs (X) & _FP_OVERFLOW_##fs)
+#define _FP_FRAC_HIGHBIT_DW_4(fs, X)	\
+  (_FP_FRAC_HIGH_DW_##fs (X) & _FP_HIGHBIT_DW_##fs)
+#define _FP_FRAC_CLEAR_OVERP_4(fs, X)  (_FP_FRAC_HIGH_##fs (X) &= ~_FP_OVERFLOW_##fs)
+
+#define _FP_FRAC_EQ_4(X, Y)				\
+  (X##_f[0] = Y##_f[0] && X##_f[1] = Y##_f[1]		\
+   && X##_f[2] = Y##_f[2] && X##_f[3] = Y##_f[3])
+
+#define _FP_FRAC_GT_4(X, Y)				\
+  (X##_f[3] > Y##_f[3]					\
+   || (X##_f[3] = Y##_f[3]				\
+       && (X##_f[2] > Y##_f[2]				\
+	   || (X##_f[2] = Y##_f[2]			\
+	       && (X##_f[1] > Y##_f[1]			\
+		   || (X##_f[1] = Y##_f[1]		\
+		       && X##_f[0] > Y##_f[0]))))))
+
+#define _FP_FRAC_GE_4(X, Y)				\
+  (X##_f[3] > Y##_f[3]					\
+   || (X##_f[3] = Y##_f[3]				\
+       && (X##_f[2] > Y##_f[2]				\
+	   || (X##_f[2] = Y##_f[2]			\
+	       && (X##_f[1] > Y##_f[1]			\
+		   || (X##_f[1] = Y##_f[1]		\
+		       && X##_f[0] >= Y##_f[0]))))))
+
+
+#define _FP_FRAC_CLZ_4(R, X)			\
+  do						\
+    {						\
+      if (X##_f[3])				\
+	__FP_CLZ ((R), X##_f[3]);		\
+      else if (X##_f[2])			\
+	{					\
+	  __FP_CLZ ((R), X##_f[2]);		\
+	  (R) += _FP_W_TYPE_SIZE;		\
+	}					\
+      else if (X##_f[1])			\
+	{					\
+	  __FP_CLZ ((R), X##_f[1]);		\
+	  (R) += _FP_W_TYPE_SIZE*2;		\
+	}					\
+      else					\
+	{					\
+	  __FP_CLZ ((R), X##_f[0]);		\
+	  (R) += _FP_W_TYPE_SIZE*3;		\
+	}					\
+    }						\
+  while (0)
+
+
+#define _FP_UNPACK_RAW_4(fs, X, val)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs _FP_UNPACK_RAW_4_flo;	\
+      _FP_UNPACK_RAW_4_flo.flt = (val);			\
+      X##_f[0] = _FP_UNPACK_RAW_4_flo.bits.frac0;	\
+      X##_f[1] = _FP_UNPACK_RAW_4_flo.bits.frac1;	\
+      X##_f[2] = _FP_UNPACK_RAW_4_flo.bits.frac2;	\
+      X##_f[3] = _FP_UNPACK_RAW_4_flo.bits.frac3;	\
+      X##_e  = _FP_UNPACK_RAW_4_flo.bits.exp;		\
+      X##_s  = _FP_UNPACK_RAW_4_flo.bits.sign;		\
+    }							\
+  while (0)
+
+#define _FP_UNPACK_RAW_4_P(fs, X, val)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_UNPACK_RAW_4_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
+							\
+      X##_f[0] = _FP_UNPACK_RAW_4_P_flo->bits.frac0;	\
+      X##_f[1] = _FP_UNPACK_RAW_4_P_flo->bits.frac1;	\
+      X##_f[2] = _FP_UNPACK_RAW_4_P_flo->bits.frac2;	\
+      X##_f[3] = _FP_UNPACK_RAW_4_P_flo->bits.frac3;	\
+      X##_e  = _FP_UNPACK_RAW_4_P_flo->bits.exp;	\
+      X##_s  = _FP_UNPACK_RAW_4_P_flo->bits.sign;	\
+    }							\
+  while (0)
+
+#define _FP_PACK_RAW_4(fs, val, X)		\
+  do						\
+    {						\
+      union _FP_UNION_##fs _FP_PACK_RAW_4_flo;	\
+      _FP_PACK_RAW_4_flo.bits.frac0 = X##_f[0];	\
+      _FP_PACK_RAW_4_flo.bits.frac1 = X##_f[1];	\
+      _FP_PACK_RAW_4_flo.bits.frac2 = X##_f[2];	\
+      _FP_PACK_RAW_4_flo.bits.frac3 = X##_f[3];	\
+      _FP_PACK_RAW_4_flo.bits.exp   = X##_e;	\
+      _FP_PACK_RAW_4_flo.bits.sign  = X##_s;	\
+      (val) = _FP_PACK_RAW_4_flo.flt;		\
+    }						\
+  while (0)
+
+#define _FP_PACK_RAW_4_P(fs, val, X)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_PACK_RAW_4_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
+							\
+      _FP_PACK_RAW_4_P_flo->bits.frac0 = X##_f[0];	\
+      _FP_PACK_RAW_4_P_flo->bits.frac1 = X##_f[1];	\
+      _FP_PACK_RAW_4_P_flo->bits.frac2 = X##_f[2];	\
+      _FP_PACK_RAW_4_P_flo->bits.frac3 = X##_f[3];	\
+      _FP_PACK_RAW_4_P_flo->bits.exp   = X##_e;		\
+      _FP_PACK_RAW_4_P_flo->bits.sign  = X##_s;		\
+    }							\
+  while (0)
+
+/* Multiplication algorithms: */
 
 /* Given a 1W * 1W => 2W primitive, do the extended multiplication.  */
 
-#define _FP_MUL_MEAT_4_wide(wfracbits, R, X, Y, doit)			    \
-  do {									    \
-    _FP_FRAC_DECL_8(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c);	    \
-    _FP_FRAC_DECL_2(_d); _FP_FRAC_DECL_2(_e); _FP_FRAC_DECL_2(_f);	    \
-									    \
-    doit(_FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0), X##_f[0], Y##_f[0]); \
-    doit(_b_f1, _b_f0, X##_f[0], Y##_f[1]);				    \
-    doit(_c_f1, _c_f0, X##_f[1], Y##_f[0]);				    \
-    doit(_d_f1, _d_f0, X##_f[1], Y##_f[1]);				    \
-    doit(_e_f1, _e_f0, X##_f[0], Y##_f[2]);				    \
-    doit(_f_f1, _f_f0, X##_f[2], Y##_f[0]);				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1), 0,_b_f1,_b_f0,		    \
-		    0,0,_FP_FRAC_WORD_8(_z,1));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1), 0,_c_f1,_c_f0,		    \
-		    _FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2), 0,_d_f1,_d_f0,		    \
-		    0,_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2));	    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2), 0,_e_f1,_e_f0,		    \
-		    _FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2), 0,_f_f1,_f_f0,		    \
-		    _FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2));				    \
-    doit(_b_f1, _b_f0, X##_f[0], Y##_f[3]);				    \
-    doit(_c_f1, _c_f0, X##_f[3], Y##_f[0]);				    \
-    doit(_d_f1, _d_f0, X##_f[1], Y##_f[2]);				    \
-    doit(_e_f1, _e_f0, X##_f[2], Y##_f[1]);				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3), 0,_b_f1,_b_f0,		    \
-		    0,_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3));	    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3), 0,_c_f1,_c_f0,		    \
-		    _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3), 0,_d_f1,_d_f0,		    \
-		    _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3), 0,_e_f1,_e_f0,		    \
-		    _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3));				    \
-    doit(_b_f1, _b_f0, X##_f[2], Y##_f[2]);				    \
-    doit(_c_f1, _c_f0, X##_f[1], Y##_f[3]);				    \
-    doit(_d_f1, _d_f0, X##_f[3], Y##_f[1]);				    \
-    doit(_e_f1, _e_f0, X##_f[2], Y##_f[3]);				    \
-    doit(_f_f1, _f_f0, X##_f[3], Y##_f[2]);				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4), 0,_b_f1,_b_f0,		    \
-		    0,_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4));	    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4), 0,_c_f1,_c_f0,		    \
-		    _FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4), 0,_d_f1,_d_f0,		    \
-		    _FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
-		    _FP_FRAC_WORD_8(_z,5), 0,_e_f1,_e_f0,		    \
-		    0,_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5));	    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
-		    _FP_FRAC_WORD_8(_z,5), 0,_f_f1,_f_f0,		    \
-		    _FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
-		    _FP_FRAC_WORD_8(_z,5));				    \
-    doit(_b_f1, _b_f0, X##_f[3], Y##_f[3]);				    \
-    __FP_FRAC_ADD_2(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
-		    _b_f1,_b_f0,					    \
-		    _FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6));	    \
-									    \
-    /* Normalize since we know where the msb of the multiplicands	    \
-       were (bit B), we know that the msb of the of the product is	    \
-       at either 2B or 2B-1.  */					    \
-    _FP_FRAC_SRS_8(_z, wfracbits-1, 2*wfracbits);			    \
-    __FP_FRAC_SET_4(R, _FP_FRAC_WORD_8(_z,3), _FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0));	    \
-  } while (0)
-
-#define _FP_MUL_MEAT_4_gmp(wfracbits, R, X, Y)				    \
-  do {									    \
-    _FP_FRAC_DECL_8(_z);						    \
-									    \
-    mpn_mul_n(_z_f, _x_f, _y_f, 4);					    \
-									    \
-    /* Normalize since we know where the msb of the multiplicands	    \
-       were (bit B), we know that the msb of the of the product is	    \
-       at either 2B or 2B-1.  */					    \
-    _FP_FRAC_SRS_8(_z, wfracbits-1, 2*wfracbits);	 		    \
-    __FP_FRAC_SET_4(R, _FP_FRAC_WORD_8(_z,3), _FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0));	    \
-  } while (0)
-
-/*
- * Helper utility for _FP_DIV_MEAT_4_udiv:
- * pppp = m * nnn
- */
-#define umul_ppppmnnn(p3,p2,p1,p0,m,n2,n1,n0)				    \
-  do {									    \
-    UWtype _t;								    \
-    umul_ppmm(p1,p0,m,n0);						    \
-    umul_ppmm(p2,_t,m,n1);						    \
-    __FP_FRAC_ADDI_2(p2,p1,_t);						    \
-    umul_ppmm(p3,_t,m,n2);						    \
-    __FP_FRAC_ADDI_2(p3,p2,_t);						    \
-  } while (0)
-
-/*
- * Division algorithms:
- */
-
-#define _FP_DIV_MEAT_4_udiv(fs, R, X, Y)				    \
-  do {									    \
-    int _i;								    \
-    _FP_FRAC_DECL_4(_n); _FP_FRAC_DECL_4(_m);				    \
-    _FP_FRAC_SET_4(_n, _FP_ZEROFRAC_4);					    \
-    if (_FP_FRAC_GT_4(X, Y))						    \
-      {									    \
-	_n_f[3] = X##_f[0] << (_FP_W_TYPE_SIZE - 1);			    \
-	_FP_FRAC_SRL_4(X, 1);						    \
-      }									    \
-    else								    \
-      R##_e--;								    \
-									    \
-    /* Normalize, i.e. make the most significant bit of the 		    \
-       denominator set. */						    \
-    _FP_FRAC_SLL_4(Y, _FP_WFRACXBITS_##fs);				    \
-									    \
-    for (_i = 3; ; _i--)						    \
-      {									    \
-        if (X##_f[3] = Y##_f[3])					    \
-          {								    \
-            /* This is a special case, not an optimization		    \
-               (X##_f[3]/Y##_f[3] would not fit into UWtype).		    \
-               As X## is guaranteed to be < Y,  R##_f[_i] can be either	    \
-               (UWtype)-1 or (UWtype)-2.  */				    \
-            R##_f[_i] = -1;						    \
-            if (!_i)							    \
-	      break;							    \
-            __FP_FRAC_SUB_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0],	    \
-			    Y##_f[2], Y##_f[1], Y##_f[0], 0,		    \
-			    X##_f[2], X##_f[1], X##_f[0], _n_f[_i]);	    \
-            _FP_FRAC_SUB_4(X, Y, X);					    \
-            if (X##_f[3] > Y##_f[3])					    \
-              {								    \
-                R##_f[_i] = -2;						    \
-                _FP_FRAC_ADD_4(X, Y, X);				    \
-              }								    \
-          }								    \
-        else								    \
-          {								    \
-            udiv_qrnnd(R##_f[_i], X##_f[3], X##_f[3], X##_f[2], Y##_f[3]);  \
-            umul_ppppmnnn(_m_f[3], _m_f[2], _m_f[1], _m_f[0],		    \
-			  R##_f[_i], Y##_f[2], Y##_f[1], Y##_f[0]);	    \
-            X##_f[2] = X##_f[1];					    \
-            X##_f[1] = X##_f[0];					    \
-            X##_f[0] = _n_f[_i];					    \
-            if (_FP_FRAC_GT_4(_m, X))					    \
-              {								    \
-                R##_f[_i]--;						    \
-                _FP_FRAC_ADD_4(X, Y, X);				    \
-                if (_FP_FRAC_GE_4(X, Y) && _FP_FRAC_GT_4(_m, X))	    \
-                  {							    \
-		    R##_f[_i]--;					    \
-		    _FP_FRAC_ADD_4(X, Y, X);				    \
-                  }							    \
-              }								    \
-            _FP_FRAC_DEC_4(X, _m);					    \
-            if (!_i)							    \
-	      {								    \
-		if (!_FP_FRAC_EQ_4(X, _m))				    \
-		  R##_f[0] |= _FP_WORK_STICKY;				    \
-		break;							    \
-	      }								    \
-          }								    \
-      }									    \
-  } while (0)
-
-
-/*
- * Square root algorithms:
- * We have just one right now, maybe Newton approximation
- * should be added for those machines where division is fast.
- */
- 
-#define _FP_SQRT_MEAT_4(R, S, T, X, q)				\
-  do {								\
-    while (q)							\
-      {								\
-	T##_f[3] = S##_f[3] + q;				\
-	if (T##_f[3] <= X##_f[3])				\
-	  {							\
-	    S##_f[3] = T##_f[3] + q;				\
-	    X##_f[3] -= T##_f[3];				\
-	    R##_f[3] += q;					\
-	  }							\
-	_FP_FRAC_SLL_4(X, 1);					\
-	q >>= 1;						\
-      }								\
-    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);			\
-    while (q)							\
-      {								\
-	T##_f[2] = S##_f[2] + q;				\
-	T##_f[3] = S##_f[3];					\
-	if (T##_f[3] < X##_f[3] || 				\
-	    (T##_f[3] = X##_f[3] && T##_f[2] <= X##_f[2]))	\
-	  {							\
-	    S##_f[2] = T##_f[2] + q;				\
-	    S##_f[3] += (T##_f[2] > S##_f[2]);			\
-	    __FP_FRAC_DEC_2(X##_f[3], X##_f[2],			\
-			    T##_f[3], T##_f[2]);		\
-	    R##_f[2] += q;					\
-	  }							\
-	_FP_FRAC_SLL_4(X, 1);					\
-	q >>= 1;						\
-      }								\
-    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);			\
-    while (q)							\
-      {								\
-	T##_f[1] = S##_f[1] + q;				\
-	T##_f[2] = S##_f[2];					\
-	T##_f[3] = S##_f[3];					\
-	if (T##_f[3] < X##_f[3] || 				\
-	    (T##_f[3] = X##_f[3] && (T##_f[2] < X##_f[2] ||	\
-	     (T##_f[2] = X##_f[2] && T##_f[1] <= X##_f[1]))))	\
-	  {							\
-	    S##_f[1] = T##_f[1] + q;				\
-	    S##_f[2] += (T##_f[1] > S##_f[1]);			\
-	    S##_f[3] += (T##_f[2] > S##_f[2]);			\
-	    __FP_FRAC_DEC_3(X##_f[3], X##_f[2], X##_f[1],	\
-	    		    T##_f[3], T##_f[2], T##_f[1]);	\
-	    R##_f[1] += q;					\
-	  }							\
-	_FP_FRAC_SLL_4(X, 1);					\
-	q >>= 1;						\
-      }								\
-    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);			\
-    while (q != _FP_WORK_ROUND)					\
-      {								\
-	T##_f[0] = S##_f[0] + q;				\
-	T##_f[1] = S##_f[1];					\
-	T##_f[2] = S##_f[2];					\
-	T##_f[3] = S##_f[3];					\
-	if (_FP_FRAC_GE_4(X,T))					\
-	  {							\
-	    S##_f[0] = T##_f[0] + q;				\
-	    S##_f[1] += (T##_f[0] > S##_f[0]);			\
-	    S##_f[2] += (T##_f[1] > S##_f[1]);			\
-	    S##_f[3] += (T##_f[2] > S##_f[2]);			\
-	    _FP_FRAC_DEC_4(X, T);				\
-	    R##_f[0] += q;					\
-	  }							\
-	_FP_FRAC_SLL_4(X, 1);					\
-	q >>= 1;						\
-      }								\
-    if (!_FP_FRAC_ZEROP_4(X))					\
-      {								\
-	if (_FP_FRAC_GT_4(X,S))					\
-	  R##_f[0] |= _FP_WORK_ROUND;				\
-	R##_f[0] |= _FP_WORK_STICKY;				\
-      }								\
-  } while (0)
-
-
-/*
- * Internals 
- */
-
-#define __FP_FRAC_SET_4(X,I3,I2,I1,I0)					\
+#define _FP_MUL_MEAT_DW_4_wide(wfracbits, R, X, Y, doit)		\
+  do									\
+    {									\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_b);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_c);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_d);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_e);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_f);			\
+									\
+      doit (_FP_FRAC_WORD_8 (R, 1), _FP_FRAC_WORD_8 (R, 0),		\
+	    X##_f[0], Y##_f[0]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_b_f1, _FP_MUL_MEAT_DW_4_wide_b_f0,	\
+	    X##_f[0], Y##_f[1]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_c_f1, _FP_MUL_MEAT_DW_4_wide_c_f0,	\
+	    X##_f[1], Y##_f[0]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_d_f1, _FP_MUL_MEAT_DW_4_wide_d_f0,	\
+	    X##_f[1], Y##_f[1]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_e_f1, _FP_MUL_MEAT_DW_4_wide_e_f0,	\
+	    X##_f[0], Y##_f[2]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_f_f1, _FP_MUL_MEAT_DW_4_wide_f_f0,	\
+	    X##_f[2], Y##_f[0]);					\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 3), _FP_FRAC_WORD_8 (R, 2),	\
+		       _FP_FRAC_WORD_8 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f0,			\
+		       0, 0, _FP_FRAC_WORD_8 (R, 1));			\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 3), _FP_FRAC_WORD_8 (R, 2),	\
+		       _FP_FRAC_WORD_8 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f0,			\
+		       _FP_FRAC_WORD_8 (R, 3), _FP_FRAC_WORD_8 (R, 2),	\
+		       _FP_FRAC_WORD_8 (R, 1));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f0,			\
+		       0, _FP_FRAC_WORD_8 (R, 3), _FP_FRAC_WORD_8 (R, 2)); \
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f0,			\
+		       _FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_f_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_f_f0,			\
+		       _FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2));				\
+      doit (_FP_MUL_MEAT_DW_4_wide_b_f1,				\
+	    _FP_MUL_MEAT_DW_4_wide_b_f0, X##_f[0], Y##_f[3]);		\
+      doit (_FP_MUL_MEAT_DW_4_wide_c_f1,				\
+	    _FP_MUL_MEAT_DW_4_wide_c_f0, X##_f[3], Y##_f[0]);		\
+      doit (_FP_MUL_MEAT_DW_4_wide_d_f1, _FP_MUL_MEAT_DW_4_wide_d_f0,	\
+	    X##_f[1], Y##_f[2]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_e_f1, _FP_MUL_MEAT_DW_4_wide_e_f0,	\
+	    X##_f[2], Y##_f[1]);					\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f0,			\
+		       0, _FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3)); \
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f0,			\
+		       _FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f0,			\
+		       _FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f0,			\
+		       _FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3));				\
+      doit (_FP_MUL_MEAT_DW_4_wide_b_f1, _FP_MUL_MEAT_DW_4_wide_b_f0,	\
+	    X##_f[2], Y##_f[2]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_c_f1, _FP_MUL_MEAT_DW_4_wide_c_f0,	\
+	    X##_f[1], Y##_f[3]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_d_f1, _FP_MUL_MEAT_DW_4_wide_d_f0,	\
+	    X##_f[3], Y##_f[1]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_e_f1, _FP_MUL_MEAT_DW_4_wide_e_f0,	\
+	    X##_f[2], Y##_f[3]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_f_f1, _FP_MUL_MEAT_DW_4_wide_f_f0,	\
+	    X##_f[3], Y##_f[2]);					\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f0,			\
+		       0, _FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4)); \
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f0,			\
+		       _FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f0,			\
+		       _FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6),	\
+		       _FP_FRAC_WORD_8 (R, 5), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f0,			\
+		       0, _FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5)); \
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6),	\
+		       _FP_FRAC_WORD_8 (R, 5), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_f_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_f_f0,			\
+		       _FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6),	\
+		       _FP_FRAC_WORD_8 (R, 5));				\
+      doit (_FP_MUL_MEAT_DW_4_wide_b_f1, _FP_MUL_MEAT_DW_4_wide_b_f0,	\
+	    X##_f[3], Y##_f[3]);					\
+      __FP_FRAC_ADD_2 (_FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6),	\
+		       _FP_MUL_MEAT_DW_4_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f0,			\
+		       _FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6));	\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_4_wide(wfracbits, R, X, Y, doit)			\
+  do									\
+    {									\
+      _FP_FRAC_DECL_8 (_FP_MUL_MEAT_4_wide_z);				\
+									\
+      _FP_MUL_MEAT_DW_4_wide ((wfracbits), _FP_MUL_MEAT_4_wide_z,	\
+			      X, Y, doit);				\
+									\
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_8 (_FP_MUL_MEAT_4_wide_z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      __FP_FRAC_SET_4 (R, _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_wide_z, 3),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_wide_z, 2),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_wide_z, 1),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_wide_z, 0));	\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_DW_4_gmp(wfracbits, R, X, Y)	\
+  do							\
+    {							\
+      mpn_mul_n (R##_f, _x_f, _y_f, 4);			\
+    }							\
+  while (0)
+
+#define _FP_MUL_MEAT_4_gmp(wfracbits, R, X, Y)				\
+  do									\
+    {									\
+      _FP_FRAC_DECL_8 (_FP_MUL_MEAT_4_gmp_z);				\
+									\
+      _FP_MUL_MEAT_DW_4_gmp ((wfracbits), _FP_MUL_MEAT_4_gmp_z, X, Y);	\
+									\
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_8 (_FP_MUL_MEAT_4_gmp_z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      __FP_FRAC_SET_4 (R, _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_gmp_z, 3),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_gmp_z, 2),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_gmp_z, 1),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_gmp_z, 0));	\
+    }									\
+  while (0)
+
+/* Helper utility for _FP_DIV_MEAT_4_udiv:
+ * pppp = m * nnn.  */
+#define umul_ppppmnnn(p3, p2, p1, p0, m, n2, n1, n0)	\
+  do							\
+    {							\
+      UWtype umul_ppppmnnn_t;				\
+      umul_ppmm (p1, p0, m, n0);			\
+      umul_ppmm (p2, umul_ppppmnnn_t, m, n1);		\
+      __FP_FRAC_ADDI_2 (p2, p1, umul_ppppmnnn_t);	\
+      umul_ppmm (p3, umul_ppppmnnn_t, m, n2);		\
+      __FP_FRAC_ADDI_2 (p3, p2, umul_ppppmnnn_t);	\
+    }							\
+  while (0)
+
+/* Division algorithms: */
+
+#define _FP_DIV_MEAT_4_udiv(fs, R, X, Y)				\
+  do									\
+    {									\
+      int _FP_DIV_MEAT_4_udiv_i;					\
+      _FP_FRAC_DECL_4 (_FP_DIV_MEAT_4_udiv_n);				\
+      _FP_FRAC_DECL_4 (_FP_DIV_MEAT_4_udiv_m);				\
+      _FP_FRAC_SET_4 (_FP_DIV_MEAT_4_udiv_n, _FP_ZEROFRAC_4);		\
+      if (_FP_FRAC_GE_4 (X, Y))						\
+	{								\
+	  _FP_DIV_MEAT_4_udiv_n_f[3]					\
+	    = X##_f[0] << (_FP_W_TYPE_SIZE - 1);			\
+	  _FP_FRAC_SRL_4 (X, 1);					\
+	}								\
+      else								\
+	R##_e--;							\
+									\
+      /* Normalize, i.e. make the most significant bit of the		\
+	 denominator set.  */						\
+      _FP_FRAC_SLL_4 (Y, _FP_WFRACXBITS_##fs);				\
+									\
+      for (_FP_DIV_MEAT_4_udiv_i = 3; ; _FP_DIV_MEAT_4_udiv_i--)	\
+	{								\
+	  if (X##_f[3] = Y##_f[3])					\
+	    {								\
+	      /* This is a special case, not an optimization		\
+		 (X##_f[3]/Y##_f[3] would not fit into UWtype).		\
+		 As X## is guaranteed to be < Y,			\
+		 R##_f[_FP_DIV_MEAT_4_udiv_i] can be either		\
+		 (UWtype)-1 or (UWtype)-2.  */				\
+	      R##_f[_FP_DIV_MEAT_4_udiv_i] = -1;			\
+	      if (!_FP_DIV_MEAT_4_udiv_i)				\
+		break;							\
+	      __FP_FRAC_SUB_4 (X##_f[3], X##_f[2], X##_f[1], X##_f[0],	\
+			       Y##_f[2], Y##_f[1], Y##_f[0], 0,		\
+			       X##_f[2], X##_f[1], X##_f[0],		\
+			       _FP_DIV_MEAT_4_udiv_n_f[_FP_DIV_MEAT_4_udiv_i]); \
+	      _FP_FRAC_SUB_4 (X, Y, X);					\
+	      if (X##_f[3] > Y##_f[3])					\
+		{							\
+		  R##_f[_FP_DIV_MEAT_4_udiv_i] = -2;			\
+		  _FP_FRAC_ADD_4 (X, Y, X);				\
+		}							\
+	    }								\
+	  else								\
+	    {								\
+	      udiv_qrnnd (R##_f[_FP_DIV_MEAT_4_udiv_i],			\
+			  X##_f[3], X##_f[3], X##_f[2], Y##_f[3]);	\
+	      umul_ppppmnnn (_FP_DIV_MEAT_4_udiv_m_f[3],		\
+			     _FP_DIV_MEAT_4_udiv_m_f[2],		\
+			     _FP_DIV_MEAT_4_udiv_m_f[1],		\
+			     _FP_DIV_MEAT_4_udiv_m_f[0],		\
+			     R##_f[_FP_DIV_MEAT_4_udiv_i],		\
+			     Y##_f[2], Y##_f[1], Y##_f[0]);		\
+	      X##_f[2] = X##_f[1];					\
+	      X##_f[1] = X##_f[0];					\
+	      X##_f[0]							\
+		= _FP_DIV_MEAT_4_udiv_n_f[_FP_DIV_MEAT_4_udiv_i];	\
+	      if (_FP_FRAC_GT_4 (_FP_DIV_MEAT_4_udiv_m, X))		\
+		{							\
+		  R##_f[_FP_DIV_MEAT_4_udiv_i]--;			\
+		  _FP_FRAC_ADD_4 (X, Y, X);				\
+		  if (_FP_FRAC_GE_4 (X, Y)				\
+		      && _FP_FRAC_GT_4 (_FP_DIV_MEAT_4_udiv_m, X))	\
+		    {							\
+		      R##_f[_FP_DIV_MEAT_4_udiv_i]--;			\
+		      _FP_FRAC_ADD_4 (X, Y, X);				\
+		    }							\
+		}							\
+	      _FP_FRAC_DEC_4 (X, _FP_DIV_MEAT_4_udiv_m);		\
+	      if (!_FP_DIV_MEAT_4_udiv_i)				\
+		{							\
+		  if (!_FP_FRAC_EQ_4 (X, _FP_DIV_MEAT_4_udiv_m))	\
+		    R##_f[0] |= _FP_WORK_STICKY;			\
+		  break;						\
+		}							\
+	    }								\
+	}								\
+    }									\
+  while (0)
+
+
+/* Square root algorithms:
+   We have just one right now, maybe Newton approximation
+   should be added for those machines where division is fast.  */
+
+#define _FP_SQRT_MEAT_4(R, S, T, X, q)					\
+  do									\
+    {									\
+      while (q)								\
+	{								\
+	  T##_f[3] = S##_f[3] + (q);					\
+	  if (T##_f[3] <= X##_f[3])					\
+	    {								\
+	      S##_f[3] = T##_f[3] + (q);				\
+	      X##_f[3] -= T##_f[3];					\
+	      R##_f[3] += (q);						\
+	    }								\
+	  _FP_FRAC_SLL_4 (X, 1);					\
+	  (q) >>= 1;							\
+	}								\
+      (q) = (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE - 1);			\
+      while (q)								\
+	{								\
+	  T##_f[2] = S##_f[2] + (q);					\
+	  T##_f[3] = S##_f[3];						\
+	  if (T##_f[3] < X##_f[3]					\
+	      || (T##_f[3] = X##_f[3] && T##_f[2] <= X##_f[2]))	\
+	    {								\
+	      S##_f[2] = T##_f[2] + (q);				\
+	      S##_f[3] += (T##_f[2] > S##_f[2]);			\
+	      __FP_FRAC_DEC_2 (X##_f[3], X##_f[2],			\
+			       T##_f[3], T##_f[2]);			\
+	      R##_f[2] += (q);						\
+	    }								\
+	  _FP_FRAC_SLL_4 (X, 1);					\
+	  (q) >>= 1;							\
+	}								\
+      (q) = (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE - 1);			\
+      while (q)								\
+	{								\
+	  T##_f[1] = S##_f[1] + (q);					\
+	  T##_f[2] = S##_f[2];						\
+	  T##_f[3] = S##_f[3];						\
+	  if (T##_f[3] < X##_f[3]					\
+	      || (T##_f[3] = X##_f[3]					\
+		  && (T##_f[2] < X##_f[2]				\
+		      || (T##_f[2] = X##_f[2]				\
+			  && T##_f[1] <= X##_f[1]))))			\
+	    {								\
+	      S##_f[1] = T##_f[1] + (q);				\
+	      S##_f[2] += (T##_f[1] > S##_f[1]);			\
+	      S##_f[3] += (T##_f[2] > S##_f[2]);			\
+	      __FP_FRAC_DEC_3 (X##_f[3], X##_f[2], X##_f[1],		\
+			       T##_f[3], T##_f[2], T##_f[1]);		\
+	      R##_f[1] += (q);						\
+	    }								\
+	  _FP_FRAC_SLL_4 (X, 1);					\
+	  (q) >>= 1;							\
+	}								\
+      (q) = (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE - 1);			\
+      while ((q) != _FP_WORK_ROUND)					\
+	{								\
+	  T##_f[0] = S##_f[0] + (q);					\
+	  T##_f[1] = S##_f[1];						\
+	  T##_f[2] = S##_f[2];						\
+	  T##_f[3] = S##_f[3];						\
+	  if (_FP_FRAC_GE_4 (X, T))					\
+	    {								\
+	      S##_f[0] = T##_f[0] + (q);				\
+	      S##_f[1] += (T##_f[0] > S##_f[0]);			\
+	      S##_f[2] += (T##_f[1] > S##_f[1]);			\
+	      S##_f[3] += (T##_f[2] > S##_f[2]);			\
+	      _FP_FRAC_DEC_4 (X, T);					\
+	      R##_f[0] += (q);						\
+	    }								\
+	  _FP_FRAC_SLL_4 (X, 1);					\
+	  (q) >>= 1;							\
+	}								\
+      if (!_FP_FRAC_ZEROP_4 (X))					\
+	{								\
+	  if (_FP_FRAC_GT_4 (X, S))					\
+	    R##_f[0] |= _FP_WORK_ROUND;					\
+	  R##_f[0] |= _FP_WORK_STICKY;					\
+	}								\
+    }									\
+  while (0)
+
+
+/* Internals.  */
+
+#define __FP_FRAC_SET_4(X, I3, I2, I1, I0)			\
   (X##_f[3] = I3, X##_f[2] = I2, X##_f[1] = I1, X##_f[0] = I0)
 
 #ifndef __FP_FRAC_ADD_3
-#define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0)		\
-  do {								\
-    int _c1, _c2;							\
-    r0 = x0 + y0;						\
-    _c1 = r0 < x0;						\
-    r1 = x1 + y1;						\
-    _c2 = r1 < x1;						\
-    r1 += _c1;							\
-    _c2 |= r1 < _c1;						\
-    r2 = x2 + y2 + _c2;						\
-  } while (0)
+# define __FP_FRAC_ADD_3(r2, r1, r0, x2, x1, x0, y2, y1, y0)	\
+  do								\
+    {								\
+      _FP_W_TYPE __FP_FRAC_ADD_3_c1, __FP_FRAC_ADD_3_c2;	\
+      r0 = x0 + y0;						\
+      __FP_FRAC_ADD_3_c1 = r0 < x0;				\
+      r1 = x1 + y1;						\
+      __FP_FRAC_ADD_3_c2 = r1 < x1;				\
+      r1 += __FP_FRAC_ADD_3_c1;					\
+      __FP_FRAC_ADD_3_c2 |= r1 < __FP_FRAC_ADD_3_c1;		\
+      r2 = x2 + y2 + __FP_FRAC_ADD_3_c2;			\
+    }								\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_ADD_4
-#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)	\
-  do {								\
-    int _c1, _c2, _c3;						\
-    r0 = x0 + y0;						\
-    _c1 = r0 < x0;						\
-    r1 = x1 + y1;						\
-    _c2 = r1 < x1;						\
-    r1 += _c1;							\
-    _c2 |= r1 < _c1;						\
-    r2 = x2 + y2;						\
-    _c3 = r2 < x2;						\
-    r2 += _c2;							\
-    _c3 |= r2 < _c2;						\
-    r3 = x3 + y3 + _c3;						\
-  } while (0)
+# define __FP_FRAC_ADD_4(r3, r2, r1, r0, x3, x2, x1, x0, y3, y2, y1, y0) \
+  do									\
+    {									\
+      _FP_W_TYPE __FP_FRAC_ADD_4_c1, __FP_FRAC_ADD_4_c2;		\
+      _FP_W_TYPE __FP_FRAC_ADD_4_c3;					\
+      r0 = x0 + y0;							\
+      __FP_FRAC_ADD_4_c1 = r0 < x0;					\
+      r1 = x1 + y1;							\
+      __FP_FRAC_ADD_4_c2 = r1 < x1;					\
+      r1 += __FP_FRAC_ADD_4_c1;						\
+      __FP_FRAC_ADD_4_c2 |= r1 < __FP_FRAC_ADD_4_c1;			\
+      r2 = x2 + y2;							\
+      __FP_FRAC_ADD_4_c3 = r2 < x2;					\
+      r2 += __FP_FRAC_ADD_4_c2;						\
+      __FP_FRAC_ADD_4_c3 |= r2 < __FP_FRAC_ADD_4_c2;			\
+      r3 = x3 + y3 + __FP_FRAC_ADD_4_c3;				\
+    }									\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_SUB_3
-#define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0)		\
-  do {								\
-    int _c1, _c2;							\
-    r0 = x0 - y0;						\
-    _c1 = r0 > x0;						\
-    r1 = x1 - y1;						\
-    _c2 = r1 > x1;						\
-    r1 -= _c1;							\
-    _c2 |= r1 > _c1;						\
-    r2 = x2 - y2 - _c2;						\
-  } while (0)
+# define __FP_FRAC_SUB_3(r2, r1, r0, x2, x1, x0, y2, y1, y0)	\
+  do								\
+    {								\
+      _FP_W_TYPE __FP_FRAC_SUB_3_c1, __FP_FRAC_SUB_3_c2;	\
+      r0 = x0 - y0;						\
+      __FP_FRAC_SUB_3_c1 = r0 > x0;				\
+      r1 = x1 - y1;						\
+      __FP_FRAC_SUB_3_c2 = r1 > x1;				\
+      r1 -= __FP_FRAC_SUB_3_c1;					\
+      __FP_FRAC_SUB_3_c2 |= __FP_FRAC_SUB_3_c1 && (y1 = x1);	\
+      r2 = x2 - y2 - __FP_FRAC_SUB_3_c2;			\
+    }								\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_SUB_4
-#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)	\
-  do {								\
-    int _c1, _c2, _c3;						\
-    r0 = x0 - y0;						\
-    _c1 = r0 > x0;						\
-    r1 = x1 - y1;						\
-    _c2 = r1 > x1;						\
-    r1 -= _c1;							\
-    _c2 |= r1 > _c1;						\
-    r2 = x2 - y2;						\
-    _c3 = r2 > x2;						\
-    r2 -= _c2;							\
-    _c3 |= r2 > _c2;						\
-    r3 = x3 - y3 - _c3;						\
-  } while (0)
+# define __FP_FRAC_SUB_4(r3, r2, r1, r0, x3, x2, x1, x0, y3, y2, y1, y0) \
+  do									\
+    {									\
+      _FP_W_TYPE __FP_FRAC_SUB_4_c1, __FP_FRAC_SUB_4_c2;		\
+      _FP_W_TYPE __FP_FRAC_SUB_4_c3;					\
+      r0 = x0 - y0;							\
+      __FP_FRAC_SUB_4_c1 = r0 > x0;					\
+      r1 = x1 - y1;							\
+      __FP_FRAC_SUB_4_c2 = r1 > x1;					\
+      r1 -= __FP_FRAC_SUB_4_c1;						\
+      __FP_FRAC_SUB_4_c2 |= __FP_FRAC_SUB_4_c1 && (y1 = x1);		\
+      r2 = x2 - y2;							\
+      __FP_FRAC_SUB_4_c3 = r2 > x2;					\
+      r2 -= __FP_FRAC_SUB_4_c2;						\
+      __FP_FRAC_SUB_4_c3 |= __FP_FRAC_SUB_4_c2 && (y2 = x2);		\
+      r3 = x3 - y3 - __FP_FRAC_SUB_4_c3;				\
+    }									\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_DEC_3
-#define __FP_FRAC_DEC_3(x2,x1,x0,y2,y1,y0)				\
-  do {									\
-    UWtype _t0, _t1, _t2;						\
-    _t0 = x0, _t1 = x1, _t2 = x2;					\
-    __FP_FRAC_SUB_3 (x2, x1, x0, _t2, _t1, _t0, y2, y1, y0);		\
-  } while (0)
+# define __FP_FRAC_DEC_3(x2, x1, x0, y2, y1, y0)		\
+  do								\
+    {								\
+      UWtype __FP_FRAC_DEC_3_t0, __FP_FRAC_DEC_3_t1;		\
+      UWtype __FP_FRAC_DEC_3_t2;				\
+      __FP_FRAC_DEC_3_t0 = x0;					\
+      __FP_FRAC_DEC_3_t1 = x1;					\
+      __FP_FRAC_DEC_3_t2 = x2;					\
+      __FP_FRAC_SUB_3 (x2, x1, x0, __FP_FRAC_DEC_3_t2,		\
+		       __FP_FRAC_DEC_3_t1, __FP_FRAC_DEC_3_t0,	\
+		       y2, y1, y0);				\
+    }								\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_DEC_4
-#define __FP_FRAC_DEC_4(x3,x2,x1,x0,y3,y2,y1,y0)			\
-  do {									\
-    UWtype _t0, _t1, _t2, _t3;						\
-    _t0 = x0, _t1 = x1, _t2 = x2, _t3 = x3;				\
-    __FP_FRAC_SUB_4 (x3,x2,x1,x0,_t3,_t2,_t1,_t0, y3,y2,y1,y0);		\
-  } while (0)
+# define __FP_FRAC_DEC_4(x3, x2, x1, x0, y3, y2, y1, y0)	\
+  do								\
+    {								\
+      UWtype __FP_FRAC_DEC_4_t0, __FP_FRAC_DEC_4_t1;		\
+      UWtype __FP_FRAC_DEC_4_t2, __FP_FRAC_DEC_4_t3;		\
+      __FP_FRAC_DEC_4_t0 = x0;					\
+      __FP_FRAC_DEC_4_t1 = x1;					\
+      __FP_FRAC_DEC_4_t2 = x2;					\
+      __FP_FRAC_DEC_4_t3 = x3;					\
+      __FP_FRAC_SUB_4 (x3, x2, x1, x0, __FP_FRAC_DEC_4_t3,	\
+		       __FP_FRAC_DEC_4_t2, __FP_FRAC_DEC_4_t1,	\
+		       __FP_FRAC_DEC_4_t0, y3, y2, y1, y0);	\
+    }								\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_ADDI_4
-#define __FP_FRAC_ADDI_4(x3,x2,x1,x0,i)					\
-  do {									\
-    UWtype _t;								\
-    _t = ((x0 += i) < i);						\
-    x1 += _t; _t = (x1 < _t);						\
-    x2 += _t; _t = (x2 < _t);						\
-    x3 += _t;								\
-  } while (0)
+# define __FP_FRAC_ADDI_4(x3, x2, x1, x0, i)		\
+  do							\
+    {							\
+      UWtype __FP_FRAC_ADDI_4_t;			\
+      __FP_FRAC_ADDI_4_t = ((x0 += i) < i);		\
+      x1 += __FP_FRAC_ADDI_4_t;				\
+      __FP_FRAC_ADDI_4_t = (x1 < __FP_FRAC_ADDI_4_t);	\
+      x2 += __FP_FRAC_ADDI_4_t;				\
+      __FP_FRAC_ADDI_4_t = (x2 < __FP_FRAC_ADDI_4_t);	\
+      x3 += __FP_FRAC_ADDI_4_t;				\
+    }							\
+  while (0)
 #endif
 
 /* Convert FP values between word sizes. This appears to be more
- * complicated than I'd have expected it to be, so these might be
- * wrong... These macros are in any case somewhat bogus because they
- * use information about what various FRAC_n variables look like 
- * internally [eg, that 2 word vars are X_f0 and x_f1]. But so do
- * the ones in op-2.h and op-1.h. 
- */
-#define _FP_FRAC_CONV_1_4(dfs, sfs, D, S)				\
-   do {									\
-     if (S##_c != FP_CLS_NAN)						\
-       _FP_FRAC_SRS_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs),	\
-			  _FP_WFRACBITS_##sfs);				\
-     else								\
-       _FP_FRAC_SRL_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs));	\
-     D##_f = S##_f[0];							\
-  } while (0)
-
-#define _FP_FRAC_CONV_2_4(dfs, sfs, D, S)				\
-   do {									\
-     if (S##_c != FP_CLS_NAN)						\
-       _FP_FRAC_SRS_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs),	\
-		      _FP_WFRACBITS_##sfs);				\
-     else								\
-       _FP_FRAC_SRL_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs));	\
-     D##_f0 = S##_f[0];							\
-     D##_f1 = S##_f[1];							\
-  } while (0)
-
-/* Assembly/disassembly for converting to/from integral types.  
- * No shifting or overflow handled here.
- */
-/* Put the FP value X into r, which is an integer of size rsize. */
+   complicated than I'd have expected it to be, so these might be
+   wrong... These macros are in any case somewhat bogus because they
+   use information about what various FRAC_n variables look like
+   internally [eg, that 2 word vars are X_f0 and x_f1]. But so do
+   the ones in op-2.h and op-1.h.  */
+#define _FP_FRAC_COPY_1_4(D, S)		(D##_f = S##_f[0])
+
+#define _FP_FRAC_COPY_2_4(D, S)			\
+  do						\
+    {						\
+      D##_f0 = S##_f[0];			\
+      D##_f1 = S##_f[1];			\
+    }						\
+  while (0)
+
+/* Assembly/disassembly for converting to/from integral types.
+   No shifting or overflow handled here.  */
+/* Put the FP value X into r, which is an integer of size rsize.  */
 #define _FP_FRAC_ASSEMBLE_4(r, X, rsize)				\
-  do {									\
-    if (rsize <= _FP_W_TYPE_SIZE)					\
-      r = X##_f[0];							\
-    else if (rsize <= 2*_FP_W_TYPE_SIZE)				\
-    {									\
-      r = X##_f[1];							\
-      r <<= _FP_W_TYPE_SIZE;						\
-      r += X##_f[0];							\
-    }									\
-    else								\
+  do									\
     {									\
-      /* I'm feeling lazy so we deal with int = 3words (implausible)*/	\
-      /* and int = 4words as a single case.			 */	\
-      r = X##_f[3];							\
-      r <<= _FP_W_TYPE_SIZE;						\
-      r += X##_f[2];							\
-      r <<= _FP_W_TYPE_SIZE;						\
-      r += X##_f[1];							\
-      r <<= _FP_W_TYPE_SIZE;						\
-      r += X##_f[0];							\
+      if ((rsize) <= _FP_W_TYPE_SIZE)					\
+	(r) = X##_f[0];							\
+	else if ((rsize) <= 2*_FP_W_TYPE_SIZE)				\
+	{								\
+	  (r) = X##_f[1];						\
+	  (r) = ((rsize) <= _FP_W_TYPE_SIZE				\
+		 ? 0							\
+		 : (r) << _FP_W_TYPE_SIZE);				\
+	  (r) += X##_f[0];						\
+	}								\
+      else								\
+	{								\
+	  /* I'm feeling lazy so we deal with int = 3words		\
+	     (implausible) and int = 4words as a single case.  */	\
+	  (r) = X##_f[3];						\
+	  (r) = ((rsize) <= _FP_W_TYPE_SIZE				\
+		 ? 0							\
+		 : (r) << _FP_W_TYPE_SIZE);				\
+	  (r) += X##_f[2];						\
+	  (r) = ((rsize) <= _FP_W_TYPE_SIZE				\
+		 ? 0							\
+		 : (r) << _FP_W_TYPE_SIZE);				\
+	  (r) += X##_f[1];						\
+	  (r) = ((rsize) <= _FP_W_TYPE_SIZE				\
+		 ? 0							\
+		 : (r) << _FP_W_TYPE_SIZE);				\
+	  (r) += X##_f[0];						\
+	}								\
     }									\
-  } while (0)
+  while (0)
 
 /* "No disassemble Number Five!" */
-/* move an integer of size rsize into X's fractional part. We rely on
- * the _f[] array consisting of words of size _FP_W_TYPE_SIZE to avoid
- * having to mask the values we store into it.
- */
-#define _FP_FRAC_DISASSEMBLE_4(X, r, rsize)				\
-  do {									\
-    X##_f[0] = r;							\
-    X##_f[1] = (rsize <= _FP_W_TYPE_SIZE ? 0 : r >> _FP_W_TYPE_SIZE);	\
-    X##_f[2] = (rsize <= 2*_FP_W_TYPE_SIZE ? 0 : r >> 2*_FP_W_TYPE_SIZE); \
-    X##_f[3] = (rsize <= 3*_FP_W_TYPE_SIZE ? 0 : r >> 3*_FP_W_TYPE_SIZE); \
-  } while (0)
-
-#define _FP_FRAC_CONV_4_1(dfs, sfs, D, S)				\
-   do {									\
-     D##_f[0] = S##_f;							\
-     D##_f[1] = D##_f[2] = D##_f[3] = 0;				\
-     _FP_FRAC_SLL_4(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs));	\
-   } while (0)
-
-#define _FP_FRAC_CONV_4_2(dfs, sfs, D, S)				\
-   do {									\
-     D##_f[0] = S##_f0;							\
-     D##_f[1] = S##_f1;							\
-     D##_f[2] = D##_f[3] = 0;						\
-     _FP_FRAC_SLL_4(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs));	\
-   } while (0)
+/* Move an integer of size rsize into X's fractional part. We rely on
+   the _f[] array consisting of words of size _FP_W_TYPE_SIZE to avoid
+   having to mask the values we store into it.  */
+#define _FP_FRAC_DISASSEMBLE_4(X, r, rsize)	\
+  do						\
+    {						\
+      X##_f[0] = (r);				\
+      X##_f[1] = ((rsize) <= _FP_W_TYPE_SIZE	\
+		  ? 0				\
+		  : (r) >> _FP_W_TYPE_SIZE);	\
+      X##_f[2] = ((rsize) <= 2*_FP_W_TYPE_SIZE	\
+		  ? 0				\
+		  : (r) >> 2*_FP_W_TYPE_SIZE);	\
+      X##_f[3] = ((rsize) <= 3*_FP_W_TYPE_SIZE	\
+		  ? 0				\
+		  : (r) >> 3*_FP_W_TYPE_SIZE);	\
+    }						\
+  while (0)
+
+#define _FP_FRAC_COPY_4_1(D, S)			\
+  do						\
+    {						\
+      D##_f[0] = S##_f;				\
+      D##_f[1] = D##_f[2] = D##_f[3] = 0;	\
+    }						\
+  while (0)
+
+#define _FP_FRAC_COPY_4_2(D, S)			\
+  do						\
+    {						\
+      D##_f[0] = S##_f0;			\
+      D##_f[1] = S##_f1;			\
+      D##_f[2] = D##_f[3] = 0;			\
+    }						\
+  while (0)
+
+#define _FP_FRAC_COPY_4_4(D, S)	_FP_FRAC_COPY_4 (D, S)
 
 #endif
diff --git a/include/math-emu/op-8.h b/include/math-emu/op-8.h
index 8b8c05e..7705c68 100644
--- a/include/math-emu/op-8.h
+++ b/include/math-emu/op-8.h
@@ -1,107 +1,150 @@
 /* Software floating-point emulation.
    Basic eight-word fraction declaration and manipulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz) and
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
-                                                         
+
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_OP_8_H__
 #define __MATH_EMU_OP_8_H__
 
 /* We need just a few things from here for op-4, if we ever need some
-   other macros, they can be added. */
+   other macros, they can be added.  */
 #define _FP_FRAC_DECL_8(X)	_FP_W_TYPE X##_f[8]
 #define _FP_FRAC_HIGH_8(X)	(X##_f[7])
 #define _FP_FRAC_LOW_8(X)	(X##_f[0])
-#define _FP_FRAC_WORD_8(X,w)	(X##_f[w])
+#define _FP_FRAC_WORD_8(X, w)	(X##_f[w])
 
-#define _FP_FRAC_SLL_8(X,N)						\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _up = (N) % _FP_W_TYPE_SIZE;					\
-    _down = _FP_W_TYPE_SIZE - _up;					\
-    if (!_up)								\
-      for (_i = 7; _i >= _skip; --_i)					\
-	X##_f[_i] = X##_f[_i-_skip];					\
-    else								\
-      {									\
-	for (_i = 7; _i > _skip; --_i)					\
-	  X##_f[_i] = X##_f[_i-_skip] << _up				\
-		      | X##_f[_i-_skip-1] >> _down;			\
-	X##_f[_i--] = X##_f[0] << _up; 					\
-      }									\
-    for (; _i >= 0; --_i)						\
-      X##_f[_i] = 0;							\
-  } while (0)
+#define _FP_FRAC_SLL_8(X, N)						\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SLL_8_up, _FP_FRAC_SLL_8_down;		\
+      _FP_I_TYPE _FP_FRAC_SLL_8_skip, _FP_FRAC_SLL_8_i;			\
+      _FP_FRAC_SLL_8_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SLL_8_up = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SLL_8_down = _FP_W_TYPE_SIZE - _FP_FRAC_SLL_8_up;	\
+      if (!_FP_FRAC_SLL_8_up)						\
+	for (_FP_FRAC_SLL_8_i = 7;					\
+	     _FP_FRAC_SLL_8_i >= _FP_FRAC_SLL_8_skip;			\
+	     --_FP_FRAC_SLL_8_i)					\
+	  X##_f[_FP_FRAC_SLL_8_i]					\
+	    = X##_f[_FP_FRAC_SLL_8_i-_FP_FRAC_SLL_8_skip];		\
+      else								\
+	{								\
+	  for (_FP_FRAC_SLL_8_i = 7;					\
+	       _FP_FRAC_SLL_8_i > _FP_FRAC_SLL_8_skip;			\
+	       --_FP_FRAC_SLL_8_i)					\
+	    X##_f[_FP_FRAC_SLL_8_i]					\
+	      = ((X##_f[_FP_FRAC_SLL_8_i-_FP_FRAC_SLL_8_skip]		\
+		  << _FP_FRAC_SLL_8_up)					\
+		 | (X##_f[_FP_FRAC_SLL_8_i-_FP_FRAC_SLL_8_skip-1]	\
+		    >> _FP_FRAC_SLL_8_down));				\
+	  X##_f[_FP_FRAC_SLL_8_i--] = X##_f[0] << _FP_FRAC_SLL_8_up;	\
+	}								\
+      for (; _FP_FRAC_SLL_8_i >= 0; --_FP_FRAC_SLL_8_i)			\
+	X##_f[_FP_FRAC_SLL_8_i] = 0;					\
+    }									\
+  while (0)
 
-#define _FP_FRAC_SRL_8(X,N)						\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _down = (N) % _FP_W_TYPE_SIZE;					\
-    _up = _FP_W_TYPE_SIZE - _down;					\
-    if (!_down)								\
-      for (_i = 0; _i <= 7-_skip; ++_i)					\
-	X##_f[_i] = X##_f[_i+_skip];					\
-    else								\
-      {									\
-	for (_i = 0; _i < 7-_skip; ++_i)				\
-	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
-		      | X##_f[_i+_skip+1] << _up;			\
-	X##_f[_i++] = X##_f[7] >> _down;				\
-      }									\
-    for (; _i < 8; ++_i)						\
-      X##_f[_i] = 0;							\
-  } while (0)
+#define _FP_FRAC_SRL_8(X, N)						\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SRL_8_up, _FP_FRAC_SRL_8_down;		\
+      _FP_I_TYPE _FP_FRAC_SRL_8_skip, _FP_FRAC_SRL_8_i;			\
+      _FP_FRAC_SRL_8_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRL_8_down = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRL_8_up = _FP_W_TYPE_SIZE - _FP_FRAC_SRL_8_down;	\
+      if (!_FP_FRAC_SRL_8_down)						\
+	for (_FP_FRAC_SRL_8_i = 0;					\
+	     _FP_FRAC_SRL_8_i <= 7-_FP_FRAC_SRL_8_skip;			\
+	     ++_FP_FRAC_SRL_8_i)					\
+	  X##_f[_FP_FRAC_SRL_8_i]					\
+	    = X##_f[_FP_FRAC_SRL_8_i+_FP_FRAC_SRL_8_skip];		\
+      else								\
+	{								\
+	  for (_FP_FRAC_SRL_8_i = 0;					\
+	       _FP_FRAC_SRL_8_i < 7-_FP_FRAC_SRL_8_skip;		\
+	       ++_FP_FRAC_SRL_8_i)					\
+	    X##_f[_FP_FRAC_SRL_8_i]					\
+	      = ((X##_f[_FP_FRAC_SRL_8_i+_FP_FRAC_SRL_8_skip]		\
+		  >> _FP_FRAC_SRL_8_down)				\
+		 | (X##_f[_FP_FRAC_SRL_8_i+_FP_FRAC_SRL_8_skip+1]	\
+		    << _FP_FRAC_SRL_8_up));				\
+	  X##_f[_FP_FRAC_SRL_8_i++] = X##_f[7] >> _FP_FRAC_SRL_8_down;	\
+	}								\
+      for (; _FP_FRAC_SRL_8_i < 8; ++_FP_FRAC_SRL_8_i)			\
+	X##_f[_FP_FRAC_SRL_8_i] = 0;					\
+    }									\
+  while (0)
 
 
-/* Right shift with sticky-lsb. 
- * What this actually means is that we do a standard right-shift,
- * but that if any of the bits that fall off the right hand side
- * were one then we always set the LSbit.
- */
-#define _FP_FRAC_SRS_8(X,N,size)					\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _FP_W_TYPE _s;							\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _down = (N) % _FP_W_TYPE_SIZE;					\
-    _up = _FP_W_TYPE_SIZE - _down;					\
-    for (_s = _i = 0; _i < _skip; ++_i)					\
-      _s |= X##_f[_i];							\
-    _s |= X##_f[_i] << _up;						\
-/* s is now != 0 if we want to set the LSbit */				\
-    if (!_down)								\
-      for (_i = 0; _i <= 7-_skip; ++_i)					\
-	X##_f[_i] = X##_f[_i+_skip];					\
-    else								\
-      {									\
-	for (_i = 0; _i < 7-_skip; ++_i)				\
-	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
-		      | X##_f[_i+_skip+1] << _up;			\
-	X##_f[_i++] = X##_f[7] >> _down;				\
-      }									\
-    for (; _i < 8; ++_i)						\
-      X##_f[_i] = 0;							\
-    /* don't fix the LSB until the very end when we're sure f[0] is stable */	\
-    X##_f[0] |= (_s != 0);						\
-  } while (0)
+/* Right shift with sticky-lsb.
+   What this actually means is that we do a standard right-shift,
+   but that if any of the bits that fall off the right hand side
+   were one then we always set the LSbit.  */
+#define _FP_FRAC_SRS_8(X, N, size)					\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SRS_8_up, _FP_FRAC_SRS_8_down;		\
+      _FP_I_TYPE _FP_FRAC_SRS_8_skip, _FP_FRAC_SRS_8_i;			\
+      _FP_W_TYPE _FP_FRAC_SRS_8_s;					\
+      _FP_FRAC_SRS_8_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRS_8_down = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRS_8_up = _FP_W_TYPE_SIZE - _FP_FRAC_SRS_8_down;	\
+      for (_FP_FRAC_SRS_8_s = _FP_FRAC_SRS_8_i = 0;			\
+	   _FP_FRAC_SRS_8_i < _FP_FRAC_SRS_8_skip;			\
+	   ++_FP_FRAC_SRS_8_i)						\
+	_FP_FRAC_SRS_8_s |= X##_f[_FP_FRAC_SRS_8_i];			\
+      if (!_FP_FRAC_SRS_8_down)						\
+	for (_FP_FRAC_SRS_8_i = 0;					\
+	     _FP_FRAC_SRS_8_i <= 7-_FP_FRAC_SRS_8_skip;			\
+	     ++_FP_FRAC_SRS_8_i)					\
+	  X##_f[_FP_FRAC_SRS_8_i]					\
+	    = X##_f[_FP_FRAC_SRS_8_i+_FP_FRAC_SRS_8_skip];		\
+      else								\
+	{								\
+	  _FP_FRAC_SRS_8_s						\
+	    |= X##_f[_FP_FRAC_SRS_8_i] << _FP_FRAC_SRS_8_up;		\
+	  for (_FP_FRAC_SRS_8_i = 0;					\
+	       _FP_FRAC_SRS_8_i < 7-_FP_FRAC_SRS_8_skip;		\
+	       ++_FP_FRAC_SRS_8_i)					\
+	    X##_f[_FP_FRAC_SRS_8_i]					\
+	      = ((X##_f[_FP_FRAC_SRS_8_i+_FP_FRAC_SRS_8_skip]		\
+		  >> _FP_FRAC_SRS_8_down)				\
+		 | (X##_f[_FP_FRAC_SRS_8_i+_FP_FRAC_SRS_8_skip+1]	\
+		    << _FP_FRAC_SRS_8_up));				\
+	  X##_f[_FP_FRAC_SRS_8_i++] = X##_f[7] >> _FP_FRAC_SRS_8_down;	\
+	}								\
+      for (; _FP_FRAC_SRS_8_i < 8; ++_FP_FRAC_SRS_8_i)			\
+	X##_f[_FP_FRAC_SRS_8_i] = 0;					\
+      /* Don't fix the LSB until the very end when we're sure f[0] is	\
+	 stable.  */							\
+      X##_f[0] |= (_FP_FRAC_SRS_8_s != 0);				\
+    }									\
+  while (0)
 
 #endif
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index 6bdf8c6..b9f5e1a 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -1,5 +1,5 @@
 /* Software floating-point emulation. Common operations.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -7,870 +7,2110 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_OP_COMMON_H__
 #define __MATH_EMU_OP_COMMON_H__
 
-#define _FP_DECL(wc, X)			\
-  _FP_I_TYPE X##_c=0, X##_s=0, X##_e=0;	\
-  _FP_FRAC_DECL_##wc(X)
-
-/*
- * Finish truly unpacking a native fp value by classifying the kind
- * of fp value and normalizing both the exponent and the fraction.
- */
-
-#define _FP_UNPACK_CANONICAL(fs, wc, X)					\
-do {									\
-  switch (X##_e)							\
-  {									\
-  default:								\
-    _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_IMPLBIT_##fs;			\
-    _FP_FRAC_SLL_##wc(X, _FP_WORKBITS);					\
-    X##_e -= _FP_EXPBIAS_##fs;						\
-    X##_c = FP_CLS_NORMAL;						\
-    break;								\
-									\
-  case 0:								\
-    if (_FP_FRAC_ZEROP_##wc(X))						\
-      X##_c = FP_CLS_ZERO;						\
-    else								\
-      {									\
-	/* a denormalized number */					\
-	_FP_I_TYPE _shift;						\
-	_FP_FRAC_CLZ_##wc(_shift, X);					\
-	_shift -= _FP_FRACXBITS_##fs;					\
-	_FP_FRAC_SLL_##wc(X, (_shift+_FP_WORKBITS));			\
-	X##_e -= _FP_EXPBIAS_##fs - 1 + _shift;				\
-	X##_c = FP_CLS_NORMAL;						\
-	FP_SET_EXCEPTION(FP_EX_DENORM);					\
-	if (FP_DENORM_ZERO)						\
-	  {								\
-	    FP_SET_EXCEPTION(FP_EX_INEXACT);				\
-	    X##_c = FP_CLS_ZERO;					\
-	  }								\
-      }									\
-    break;								\
-									\
-  case _FP_EXPMAX_##fs:							\
-    if (_FP_FRAC_ZEROP_##wc(X))						\
-      X##_c = FP_CLS_INF;						\
-    else								\
-      {									\
-	X##_c = FP_CLS_NAN;						\
-	/* Check for signaling NaN */					\
-	if (!(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs))		\
-	  FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_SNAN);		\
-      }									\
-    break;								\
-  }									\
-} while (0)
-
-/*
- * Before packing the bits back into the native fp result, take care
- * of such mundane things as rounding and overflow.  Also, for some
- * kinds of fp values, the original parts may not have been fully
- * extracted -- but that is ok, we can regenerate them now.
- */
-
-#define _FP_PACK_CANONICAL(fs, wc, X)				\
-do {								\
-  switch (X##_c)						\
-  {								\
-  case FP_CLS_NORMAL:						\
-    X##_e += _FP_EXPBIAS_##fs;					\
-    if (X##_e > 0)						\
-      {								\
-	_FP_ROUND(wc, X);					\
-	if (_FP_FRAC_OVERP_##wc(fs, X))				\
-	  {							\
-	    _FP_FRAC_CLEAR_OVERP_##wc(fs, X);			\
-	    X##_e++;						\
-	  }							\
-	_FP_FRAC_SRL_##wc(X, _FP_WORKBITS);			\
-	if (X##_e >= _FP_EXPMAX_##fs)				\
-	  {							\
-	    /* overflow */					\
-	    switch (FP_ROUNDMODE)				\
-	      {							\
-	      case FP_RND_NEAREST:				\
-		X##_c = FP_CLS_INF;				\
-		break;						\
-	      case FP_RND_PINF:					\
-		if (!X##_s) X##_c = FP_CLS_INF;			\
-		break;						\
-	      case FP_RND_MINF:					\
-		if (X##_s) X##_c = FP_CLS_INF;			\
-		break;						\
-	      }							\
-	    if (X##_c = FP_CLS_INF)				\
-	      {							\
-		/* Overflow to infinity */			\
-		X##_e = _FP_EXPMAX_##fs;			\
-		_FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);	\
-	      }							\
-	    else						\
-	      {							\
-		/* Overflow to maximum normal */		\
-		X##_e = _FP_EXPMAX_##fs - 1;			\
-		_FP_FRAC_SET_##wc(X, _FP_MAXFRAC_##wc);		\
-	      }							\
-	    FP_SET_EXCEPTION(FP_EX_OVERFLOW);			\
-            FP_SET_EXCEPTION(FP_EX_INEXACT);			\
-	  }							\
-      }								\
-    else							\
-      {								\
-	/* we've got a denormalized number */			\
-	X##_e = -X##_e + 1;					\
-	if (X##_e <= _FP_WFRACBITS_##fs)			\
-	  {							\
-	    _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs);	\
-	    if (_FP_FRAC_HIGH_##fs(X)				\
-		& (_FP_OVERFLOW_##fs >> 1))			\
-	      {							\
-	        X##_e = 1;					\
-	        _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);	\
-	      }							\
-	    else						\
-	      {							\
-		_FP_ROUND(wc, X);				\
-		if (_FP_FRAC_HIGH_##fs(X)			\
-		   & (_FP_OVERFLOW_##fs >> 1))			\
-		  {						\
-		    X##_e = 1;					\
-		    _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);	\
-		    FP_SET_EXCEPTION(FP_EX_INEXACT);		\
-		  }						\
-		else						\
-		  {						\
-		    X##_e = 0;					\
-		    _FP_FRAC_SRL_##wc(X, _FP_WORKBITS);		\
-		  }						\
-	      }							\
-	    if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) ||		\
-		(FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW))	\
-		FP_SET_EXCEPTION(FP_EX_UNDERFLOW);		\
-	  }							\
-	else							\
-	  {							\
-	    /* underflow to zero */				\
-	    X##_e = 0;						\
-	    if (!_FP_FRAC_ZEROP_##wc(X))			\
-	      {							\
-	        _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc);		\
-	        _FP_ROUND(wc, X);				\
-	        _FP_FRAC_LOW_##wc(X) >>= (_FP_WORKBITS);	\
-	      }							\
-	    FP_SET_EXCEPTION(FP_EX_UNDERFLOW);			\
-	  }							\
-      }								\
-    break;							\
-								\
-  case FP_CLS_ZERO:						\
-    X##_e = 0;							\
-    _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);			\
-    break;							\
+#define _FP_DECL(wc, X)					\
+  _FP_I_TYPE X##_c __attribute__ ((unused)) = 0;	\
+  _FP_I_TYPE X##_s __attribute__ ((unused)) = 0;	\
+  _FP_I_TYPE X##_e __attribute__ ((unused)) = 0;	\
+  _FP_FRAC_DECL_##wc (X)
+
+/* Test whether the qNaN bit denotes a signaling NaN.  */
+#define _FP_FRAC_SNANP(fs, X)				\
+  ((_FP_QNANNEGATEDP)					\
+   ? (_FP_FRAC_HIGH_RAW_##fs (X) & _FP_QNANBIT_##fs)	\
+   : !(_FP_FRAC_HIGH_RAW_##fs (X) & _FP_QNANBIT_##fs))
+#define _FP_FRAC_SNANP_SEMIRAW(fs, X)			\
+  ((_FP_QNANNEGATEDP)					\
+   ? (_FP_FRAC_HIGH_##fs (X) & _FP_QNANBIT_SH_##fs)	\
+   : !(_FP_FRAC_HIGH_##fs (X) & _FP_QNANBIT_SH_##fs))
+
+/* Finish truly unpacking a native fp value by classifying the kind
+   of fp value and normalizing both the exponent and the fraction.  */
+
+#define _FP_UNPACK_CANONICAL(fs, wc, X)				\
+  do								\
+    {								\
+      switch (X##_e)						\
+	{							\
+	default:						\
+	  _FP_FRAC_HIGH_RAW_##fs (X) |= _FP_IMPLBIT_##fs;	\
+	  _FP_FRAC_SLL_##wc (X, _FP_WORKBITS);			\
+	  X##_e -= _FP_EXPBIAS_##fs;				\
+	  X##_c = FP_CLS_NORMAL;				\
+	  break;						\
 								\
-  case FP_CLS_INF:						\
-    X##_e = _FP_EXPMAX_##fs;					\
-    _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);			\
-    break;							\
+	case 0:							\
+	  if (_FP_FRAC_ZEROP_##wc (X))				\
+	    X##_c = FP_CLS_ZERO;				\
+	  else if (FP_DENORM_ZERO)				\
+	    {							\
+	      X##_c = FP_CLS_ZERO;				\
+	      _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);		\
+	      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+	    }							\
+	  else							\
+	    {							\
+	      /* A denormalized number.  */			\
+	      _FP_I_TYPE _FP_UNPACK_CANONICAL_shift;		\
+	      _FP_FRAC_CLZ_##wc (_FP_UNPACK_CANONICAL_shift,	\
+				 X);				\
+	      _FP_UNPACK_CANONICAL_shift -= _FP_FRACXBITS_##fs;	\
+	      _FP_FRAC_SLL_##wc (X, (_FP_UNPACK_CANONICAL_shift \
+				     + _FP_WORKBITS));		\
+	      X##_e -= (_FP_EXPBIAS_##fs - 1			\
+			+ _FP_UNPACK_CANONICAL_shift);		\
+	      X##_c = FP_CLS_NORMAL;				\
+	      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+	    }							\
+	  break;						\
 								\
-  case FP_CLS_NAN:						\
-    X##_e = _FP_EXPMAX_##fs;					\
-    if (!_FP_KEEPNANFRACP)					\
-      {								\
-	_FP_FRAC_SET_##wc(X, _FP_NANFRAC_##fs);			\
-	X##_s = _FP_NANSIGN_##fs;				\
-      }								\
-    else							\
-      _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_QNANBIT_##fs;		\
-    break;							\
-  }								\
-} while (0)
+	case _FP_EXPMAX_##fs:					\
+	  if (_FP_FRAC_ZEROP_##wc (X))				\
+	    X##_c = FP_CLS_INF;					\
+	  else							\
+	    {							\
+	      X##_c = FP_CLS_NAN;				\
+	      /* Check for signaling NaN.  */			\
+	      if (_FP_FRAC_SNANP (fs, X))			\
+		FP_SET_EXCEPTION (FP_EX_INVALID			\
+				  | FP_EX_INVALID_SNAN);	\
+	    }							\
+	  break;						\
+	}							\
+    }								\
+  while (0)
+
+/* Finish unpacking an fp value in semi-raw mode: the mantissa is
+   shifted by _FP_WORKBITS but the implicit MSB is not inserted and
+   other classification is not done.  */
+#define _FP_UNPACK_SEMIRAW(fs, wc, X)	_FP_FRAC_SLL_##wc (X, _FP_WORKBITS)
+
+/* Check whether a raw or semi-raw input value should be flushed to
+   zero, and flush it to zero if so.  */
+#define _FP_CHECK_FLUSH_ZERO(fs, wc, X)			\
+  do							\
+    {							\
+      if (FP_DENORM_ZERO				\
+	  && X##_e = 0					\
+	  && !_FP_FRAC_ZEROP_##wc (X))			\
+	{						\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);	\
+	  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+	}						\
+    }							\
+  while (0)
+
+/* A semi-raw value has overflowed to infinity.  Adjust the mantissa
+   and exponent appropriately.  */
+#define _FP_OVERFLOW_SEMIRAW(fs, wc, X)			\
+  do							\
+    {							\
+      if (FP_ROUNDMODE = FP_RND_NEAREST		\
+	  || (FP_ROUNDMODE = FP_RND_PINF && !X##_s)	\
+	  || (FP_ROUNDMODE = FP_RND_MINF && X##_s))	\
+	{						\
+	  X##_e = _FP_EXPMAX_##fs;			\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);	\
+	}						\
+      else						\
+	{						\
+	  X##_e = _FP_EXPMAX_##fs - 1;			\
+	  _FP_FRAC_SET_##wc (X, _FP_MAXFRAC_##wc);	\
+	}						\
+      FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+      FP_SET_EXCEPTION (FP_EX_OVERFLOW);		\
+    }							\
+  while (0)
+
+/* Check for a semi-raw value being a signaling NaN and raise the
+   invalid exception if so.  */
+#define _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X)			\
+  do								\
+    {								\
+      if (X##_e = _FP_EXPMAX_##fs				\
+	  && !_FP_FRAC_ZEROP_##wc (X)				\
+	  && _FP_FRAC_SNANP_SEMIRAW (fs, X))			\
+	FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_SNAN);	\
+    }								\
+  while (0)
+
+/* Choose a NaN result from an operation on two semi-raw NaN
+   values.  */
+#define _FP_CHOOSENAN_SEMIRAW(fs, wc, R, X, Y, OP)			\
+  do									\
+    {									\
+      /* _FP_CHOOSENAN expects raw values, so shift as required.  */	\
+      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);				\
+      _FP_FRAC_SRL_##wc (Y, _FP_WORKBITS);				\
+      _FP_CHOOSENAN (fs, wc, R, X, Y, OP);				\
+      _FP_FRAC_SLL_##wc (R, _FP_WORKBITS);				\
+    }									\
+  while (0)
+
+/* Make the fractional part a quiet NaN, preserving the payload
+   if possible, otherwise make it the canonical quiet NaN and set
+   the sign bit accordingly.  */
+#define _FP_SETQNAN(fs, wc, X)					\
+  do								\
+    {								\
+      if (_FP_QNANNEGATEDP)					\
+	{							\
+	  _FP_FRAC_HIGH_RAW_##fs (X) &= _FP_QNANBIT_##fs - 1;	\
+	  if (_FP_FRAC_ZEROP_##wc (X))				\
+	    {							\
+	      X##_s = _FP_NANSIGN_##fs;				\
+	      _FP_FRAC_SET_##wc (X, _FP_NANFRAC_##fs);		\
+	    }							\
+	}							\
+      else							\
+	_FP_FRAC_HIGH_RAW_##fs (X) |= _FP_QNANBIT_##fs;		\
+    }								\
+  while (0)
+#define _FP_SETQNAN_SEMIRAW(fs, wc, X)				\
+  do								\
+    {								\
+      if (_FP_QNANNEGATEDP)					\
+	{							\
+	  _FP_FRAC_HIGH_##fs (X) &= _FP_QNANBIT_SH_##fs - 1;	\
+	  if (_FP_FRAC_ZEROP_##wc (X))				\
+	    {							\
+	      X##_s = _FP_NANSIGN_##fs;				\
+	      _FP_FRAC_SET_##wc (X, _FP_NANFRAC_##fs);		\
+	      _FP_FRAC_SLL_##wc (X, _FP_WORKBITS);		\
+	    }							\
+	}							\
+      else							\
+	_FP_FRAC_HIGH_##fs (X) |= _FP_QNANBIT_SH_##fs;		\
+    }								\
+  while (0)
+
+/* Test whether a biased exponent is normal (not zero or maximum).  */
+#define _FP_EXP_NORMAL(fs, wc, X)	(((X##_e + 1) & _FP_EXPMAX_##fs) > 1)
+
+/* Prepare to pack an fp value in semi-raw mode: the mantissa is
+   rounded and shifted right, with the rounding possibly increasing
+   the exponent (including changing a finite value to infinity).  */
+#define _FP_PACK_SEMIRAW(fs, wc, X)				\
+  do								\
+    {								\
+      int _FP_PACK_SEMIRAW_is_tiny				\
+	= X##_e = 0 && !_FP_FRAC_ZEROP_##wc (X);		\
+      if (_FP_TININESS_AFTER_ROUNDING				\
+	  && _FP_PACK_SEMIRAW_is_tiny)				\
+	{							\
+	  FP_DECL_##fs (_FP_PACK_SEMIRAW_T);			\
+	  _FP_FRAC_COPY_##wc (_FP_PACK_SEMIRAW_T, X);		\
+	  _FP_PACK_SEMIRAW_T##_s = X##_s;			\
+	  _FP_PACK_SEMIRAW_T##_e = X##_e;			\
+	  _FP_FRAC_SLL_##wc (_FP_PACK_SEMIRAW_T, 1);		\
+	  _FP_ROUND (wc, _FP_PACK_SEMIRAW_T);			\
+	  if (_FP_FRAC_OVERP_##wc (fs, _FP_PACK_SEMIRAW_T))	\
+	    _FP_PACK_SEMIRAW_is_tiny = 0;			\
+	}							\
+      _FP_ROUND (wc, X);					\
+      if (_FP_PACK_SEMIRAW_is_tiny)				\
+	{							\
+	  if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT)		\
+	      || (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW))	\
+	    FP_SET_EXCEPTION (FP_EX_UNDERFLOW);			\
+	}							\
+      if (_FP_FRAC_HIGH_##fs (X)				\
+	  & (_FP_OVERFLOW_##fs >> 1))				\
+	{							\
+	  _FP_FRAC_HIGH_##fs (X) &= ~(_FP_OVERFLOW_##fs >> 1);	\
+	  X##_e++;						\
+	  if (X##_e = _FP_EXPMAX_##fs)				\
+	    _FP_OVERFLOW_SEMIRAW (fs, wc, X);			\
+	}							\
+      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);			\
+      if (X##_e = _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (X))	\
+	{							\
+	  if (!_FP_KEEPNANFRACP)				\
+	    {							\
+	      _FP_FRAC_SET_##wc (X, _FP_NANFRAC_##fs);		\
+	      X##_s = _FP_NANSIGN_##fs;				\
+	    }							\
+	  else							\
+	    _FP_SETQNAN (fs, wc, X);				\
+	}							\
+    }								\
+  while (0)
+
+/* Before packing the bits back into the native fp result, take care
+   of such mundane things as rounding and overflow.  Also, for some
+   kinds of fp values, the original parts may not have been fully
+   extracted -- but that is ok, we can regenerate them now.  */
+
+#define _FP_PACK_CANONICAL(fs, wc, X)					\
+  do									\
+    {									\
+      switch (X##_c)							\
+	{								\
+	case FP_CLS_NORMAL:						\
+	  X##_e += _FP_EXPBIAS_##fs;					\
+	  if (X##_e > 0)						\
+	    {								\
+	      _FP_ROUND (wc, X);					\
+	      if (_FP_FRAC_OVERP_##wc (fs, X))				\
+		{							\
+		  _FP_FRAC_CLEAR_OVERP_##wc (fs, X);			\
+		  X##_e++;						\
+		}							\
+	      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);			\
+	      if (X##_e >= _FP_EXPMAX_##fs)				\
+		{							\
+		  /* Overflow.  */					\
+		  switch (FP_ROUNDMODE)					\
+		    {							\
+		    case FP_RND_NEAREST:				\
+		      X##_c = FP_CLS_INF;				\
+		      break;						\
+		    case FP_RND_PINF:					\
+		      if (!X##_s)					\
+			X##_c = FP_CLS_INF;				\
+		      break;						\
+		    case FP_RND_MINF:					\
+		      if (X##_s)					\
+			X##_c = FP_CLS_INF;				\
+		      break;						\
+		    }							\
+		  if (X##_c = FP_CLS_INF)				\
+		    {							\
+		      /* Overflow to infinity.  */			\
+		      X##_e = _FP_EXPMAX_##fs;				\
+		      _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);		\
+		    }							\
+		  else							\
+		    {							\
+		      /* Overflow to maximum normal.  */		\
+		      X##_e = _FP_EXPMAX_##fs - 1;			\
+		      _FP_FRAC_SET_##wc (X, _FP_MAXFRAC_##wc);		\
+		    }							\
+		  FP_SET_EXCEPTION (FP_EX_OVERFLOW);			\
+		  FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+		}							\
+	    }								\
+	  else								\
+	    {								\
+	      /* We've got a denormalized number.  */			\
+	      int _FP_PACK_CANONICAL_is_tiny = 1;			\
+	      if (_FP_TININESS_AFTER_ROUNDING && X##_e = 0)		\
+		{							\
+		  FP_DECL_##fs (_FP_PACK_CANONICAL_T);			\
+		  _FP_FRAC_COPY_##wc (_FP_PACK_CANONICAL_T, X);		\
+		  _FP_PACK_CANONICAL_T##_s = X##_s;			\
+		  _FP_PACK_CANONICAL_T##_e = X##_e;			\
+		  _FP_ROUND (wc, _FP_PACK_CANONICAL_T);			\
+		  if (_FP_FRAC_OVERP_##wc (fs, _FP_PACK_CANONICAL_T))	\
+		    _FP_PACK_CANONICAL_is_tiny = 0;			\
+		}							\
+	      X##_e = -X##_e + 1;					\
+	      if (X##_e <= _FP_WFRACBITS_##fs)				\
+		{							\
+		  _FP_FRAC_SRS_##wc (X, X##_e, _FP_WFRACBITS_##fs);	\
+		  _FP_ROUND (wc, X);					\
+		  if (_FP_FRAC_HIGH_##fs (X)				\
+		      & (_FP_OVERFLOW_##fs >> 1))			\
+		    {							\
+		      X##_e = 1;					\
+		      _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);		\
+		      FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+		    }							\
+		  else							\
+		    {							\
+		      X##_e = 0;					\
+		      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);		\
+		    }							\
+		  if (_FP_PACK_CANONICAL_is_tiny			\
+		      && ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT)		\
+			  || (FP_TRAPPING_EXCEPTIONS			\
+			      & FP_EX_UNDERFLOW)))			\
+		    FP_SET_EXCEPTION (FP_EX_UNDERFLOW);			\
+		}							\
+	      else							\
+		{							\
+		  /* Underflow to zero.  */				\
+		  X##_e = 0;						\
+		  if (!_FP_FRAC_ZEROP_##wc (X))				\
+		    {							\
+		      _FP_FRAC_SET_##wc (X, _FP_MINFRAC_##wc);		\
+		      _FP_ROUND (wc, X);				\
+		      _FP_FRAC_LOW_##wc (X) >>= (_FP_WORKBITS);		\
+		    }							\
+		  FP_SET_EXCEPTION (FP_EX_UNDERFLOW);			\
+		}							\
+	    }								\
+	  break;							\
+									\
+	case FP_CLS_ZERO:						\
+	  X##_e = 0;							\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);			\
+	  break;							\
+									\
+	case FP_CLS_INF:						\
+	  X##_e = _FP_EXPMAX_##fs;					\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);			\
+	  break;							\
+									\
+	case FP_CLS_NAN:						\
+	  X##_e = _FP_EXPMAX_##fs;					\
+	  if (!_FP_KEEPNANFRACP)					\
+	    {								\
+	      _FP_FRAC_SET_##wc (X, _FP_NANFRAC_##fs);			\
+	      X##_s = _FP_NANSIGN_##fs;					\
+	    }								\
+	  else								\
+	    _FP_SETQNAN (fs, wc, X);					\
+	  break;							\
+	}								\
+    }									\
+  while (0)
 
 /* This one accepts raw argument and not cooked,  returns
- * 1 if X is a signaling NaN.
- */
-#define _FP_ISSIGNAN(fs, wc, X)					\
-({								\
-  int __ret = 0;						\
-  if (X##_e = _FP_EXPMAX_##fs)					\
+   1 if X is a signaling NaN.  */
+#define _FP_ISSIGNAN(fs, wc, X)			\
+  ({						\
+    int _FP_ISSIGNAN_ret = 0;			\
+    if (X##_e = _FP_EXPMAX_##fs)		\
+      {						\
+	if (!_FP_FRAC_ZEROP_##wc (X)		\
+	    && _FP_FRAC_SNANP (fs, X))		\
+	  _FP_ISSIGNAN_ret = 1;			\
+      }						\
+    _FP_ISSIGNAN_ret;				\
+  })
+
+
+
+
+
+/* Addition on semi-raw values.  */
+#define _FP_ADD_INTERNAL(fs, wc, R, X, Y, OP)				\
+  do									\
+    {									\
+      _FP_CHECK_FLUSH_ZERO (fs, wc, X);					\
+      _FP_CHECK_FLUSH_ZERO (fs, wc, Y);					\
+      if (X##_s = Y##_s)						\
+	{								\
+	  /* Addition.  */						\
+	  __label__ add1, add2, add3, add_done;				\
+	  R##_s = X##_s;						\
+	  int _FP_ADD_INTERNAL_ediff = X##_e - Y##_e;			\
+	  if (_FP_ADD_INTERNAL_ediff > 0)				\
+	    {								\
+	      R##_e = X##_e;						\
+	      if (Y##_e = 0)						\
+		{							\
+		  /* Y is zero or denormalized.  */			\
+		  if (_FP_FRAC_ZEROP_##wc (Y))				\
+		    {							\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+		      _FP_FRAC_COPY_##wc (R, X);			\
+		      goto add_done;					\
+		    }							\
+		  else							\
+		    {							\
+		      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		      _FP_ADD_INTERNAL_ediff--;				\
+		      if (_FP_ADD_INTERNAL_ediff = 0)			\
+			{						\
+			  _FP_FRAC_ADD_##wc (R, X, Y);			\
+			  goto add3;					\
+			}						\
+		      if (X##_e = _FP_EXPMAX_##fs)			\
+			{						\
+			  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+			  _FP_FRAC_COPY_##wc (R, X);			\
+			  goto add_done;				\
+			}						\
+		      goto add1;					\
+		    }							\
+		}							\
+	      else if (X##_e = _FP_EXPMAX_##fs)			\
+		{							\
+		  /* X is NaN or Inf, Y is normal.  */			\
+		  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);			\
+		  _FP_FRAC_COPY_##wc (R, X);				\
+		  goto add_done;					\
+		}							\
+									\
+	      /* Insert implicit MSB of Y.  */				\
+	      _FP_FRAC_HIGH_##fs (Y) |= _FP_IMPLBIT_SH_##fs;		\
+									\
+	    add1:							\
+	      /* Shift the mantissa of Y to the right			\
+		 _FP_ADD_INTERNAL_EDIFF steps; remember to account	\
+		 later for the implicit MSB of X.  */			\
+	      if (_FP_ADD_INTERNAL_ediff <= _FP_WFRACBITS_##fs)		\
+		_FP_FRAC_SRS_##wc (Y, _FP_ADD_INTERNAL_ediff,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (!_FP_FRAC_ZEROP_##wc (Y))			\
+		_FP_FRAC_SET_##wc (Y, _FP_MINFRAC_##wc);		\
+	      _FP_FRAC_ADD_##wc (R, X, Y);				\
+	    }								\
+	  else if (_FP_ADD_INTERNAL_ediff < 0)				\
+	    {								\
+	      _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff;		\
+	      R##_e = Y##_e;						\
+	      if (X##_e = 0)						\
+		{							\
+		  /* X is zero or denormalized.  */			\
+		  if (_FP_FRAC_ZEROP_##wc (X))				\
+		    {							\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+		      _FP_FRAC_COPY_##wc (R, Y);			\
+		      goto add_done;					\
+		    }							\
+		  else							\
+		    {							\
+		      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		      _FP_ADD_INTERNAL_ediff--;				\
+		      if (_FP_ADD_INTERNAL_ediff = 0)			\
+			{						\
+			  _FP_FRAC_ADD_##wc (R, Y, X);			\
+			  goto add3;					\
+			}						\
+		      if (Y##_e = _FP_EXPMAX_##fs)			\
+			{						\
+			  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+			  _FP_FRAC_COPY_##wc (R, Y);			\
+			  goto add_done;				\
+			}						\
+		      goto add2;					\
+		    }							\
+		}							\
+	      else if (Y##_e = _FP_EXPMAX_##fs)			\
+		{							\
+		  /* Y is NaN or Inf, X is normal.  */			\
+		  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);			\
+		  _FP_FRAC_COPY_##wc (R, Y);				\
+		  goto add_done;					\
+		}							\
+									\
+	      /* Insert implicit MSB of X.  */				\
+	      _FP_FRAC_HIGH_##fs (X) |= _FP_IMPLBIT_SH_##fs;		\
+									\
+	    add2:							\
+	      /* Shift the mantissa of X to the right			\
+		 _FP_ADD_INTERNAL_EDIFF steps; remember to account	\
+		 later for the implicit MSB of Y.  */			\
+	      if (_FP_ADD_INTERNAL_ediff <= _FP_WFRACBITS_##fs)		\
+		_FP_FRAC_SRS_##wc (X, _FP_ADD_INTERNAL_ediff,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (!_FP_FRAC_ZEROP_##wc (X))			\
+		_FP_FRAC_SET_##wc (X, _FP_MINFRAC_##wc);		\
+	      _FP_FRAC_ADD_##wc (R, Y, X);				\
+	    }								\
+	  else								\
+	    {								\
+	      /* _FP_ADD_INTERNAL_ediff = 0.  */			\
+	      if (!_FP_EXP_NORMAL (fs, wc, X))				\
+		{							\
+		  if (X##_e = 0)					\
+		    {							\
+		      /* X and Y are zero or denormalized.  */		\
+		      R##_e = 0;					\
+		      if (_FP_FRAC_ZEROP_##wc (X))			\
+			{						\
+			  if (!_FP_FRAC_ZEROP_##wc (Y))			\
+			    FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_COPY_##wc (R, Y);			\
+			  goto add_done;				\
+			}						\
+		      else if (_FP_FRAC_ZEROP_##wc (Y))			\
+			{						\
+			  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_COPY_##wc (R, X);			\
+			  goto add_done;				\
+			}						\
+		      else						\
+			{						\
+			  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_ADD_##wc (R, X, Y);			\
+			  if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs) \
+			    {						\
+			      /* Normalized result.  */			\
+			      _FP_FRAC_HIGH_##fs (R)			\
+				&= ~(_FP_W_TYPE) _FP_IMPLBIT_SH_##fs;	\
+			      R##_e = 1;				\
+			    }						\
+			  goto add_done;				\
+			}						\
+		    }							\
+		  else							\
+		    {							\
+		      /* X and Y are NaN or Inf.  */			\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+		      R##_e = _FP_EXPMAX_##fs;				\
+		      if (_FP_FRAC_ZEROP_##wc (X))			\
+			_FP_FRAC_COPY_##wc (R, Y);			\
+		      else if (_FP_FRAC_ZEROP_##wc (Y))			\
+			_FP_FRAC_COPY_##wc (R, X);			\
+		      else						\
+			_FP_CHOOSENAN_SEMIRAW (fs, wc, R, X, Y, OP);	\
+		      goto add_done;					\
+		    }							\
+		}							\
+	      /* The exponents of X and Y, both normal, are equal.  The	\
+		 implicit MSBs will always add to increase the		\
+		 exponent.  */						\
+	      _FP_FRAC_ADD_##wc (R, X, Y);				\
+	      R##_e = X##_e + 1;					\
+	      _FP_FRAC_SRS_##wc (R, 1, _FP_WFRACBITS_##fs);		\
+	      if (R##_e = _FP_EXPMAX_##fs)				\
+		/* Overflow to infinity (depending on rounding mode).  */ \
+		_FP_OVERFLOW_SEMIRAW (fs, wc, R);			\
+	      goto add_done;						\
+	    }								\
+	add3:								\
+	  if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs)		\
+	    {								\
+	      /* Overflow.  */						\
+	      _FP_FRAC_HIGH_##fs (R) &= ~(_FP_W_TYPE) _FP_IMPLBIT_SH_##fs; \
+	      R##_e++;							\
+	      _FP_FRAC_SRS_##wc (R, 1, _FP_WFRACBITS_##fs);		\
+	      if (R##_e = _FP_EXPMAX_##fs)				\
+		/* Overflow to infinity (depending on rounding mode).  */ \
+		_FP_OVERFLOW_SEMIRAW (fs, wc, R);			\
+	    }								\
+	add_done: ;							\
+	}								\
+      else								\
+	{								\
+	  /* Subtraction.  */						\
+	  __label__ sub1, sub2, sub3, norm, sub_done;			\
+	  int _FP_ADD_INTERNAL_ediff = X##_e - Y##_e;			\
+	  if (_FP_ADD_INTERNAL_ediff > 0)				\
+	    {								\
+	      R##_e = X##_e;						\
+	      R##_s = X##_s;						\
+	      if (Y##_e = 0)						\
+		{							\
+		  /* Y is zero or denormalized.  */			\
+		  if (_FP_FRAC_ZEROP_##wc (Y))				\
+		    {							\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+		      _FP_FRAC_COPY_##wc (R, X);			\
+		      goto sub_done;					\
+		    }							\
+		  else							\
+		    {							\
+		      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		      _FP_ADD_INTERNAL_ediff--;				\
+		      if (_FP_ADD_INTERNAL_ediff = 0)			\
+			{						\
+			  _FP_FRAC_SUB_##wc (R, X, Y);			\
+			  goto sub3;					\
+			}						\
+		      if (X##_e = _FP_EXPMAX_##fs)			\
+			{						\
+			  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+			  _FP_FRAC_COPY_##wc (R, X);			\
+			  goto sub_done;				\
+			}						\
+		      goto sub1;					\
+		    }							\
+		}							\
+	      else if (X##_e = _FP_EXPMAX_##fs)			\
+		{							\
+		  /* X is NaN or Inf, Y is normal.  */			\
+		  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);			\
+		  _FP_FRAC_COPY_##wc (R, X);				\
+		  goto sub_done;					\
+		}							\
+									\
+	      /* Insert implicit MSB of Y.  */				\
+	      _FP_FRAC_HIGH_##fs (Y) |= _FP_IMPLBIT_SH_##fs;		\
+									\
+	    sub1:							\
+	      /* Shift the mantissa of Y to the right			\
+		 _FP_ADD_INTERNAL_EDIFF steps; remember to account	\
+		 later for the implicit MSB of X.  */			\
+	      if (_FP_ADD_INTERNAL_ediff <= _FP_WFRACBITS_##fs)		\
+		_FP_FRAC_SRS_##wc (Y, _FP_ADD_INTERNAL_ediff,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (!_FP_FRAC_ZEROP_##wc (Y))			\
+		_FP_FRAC_SET_##wc (Y, _FP_MINFRAC_##wc);		\
+	      _FP_FRAC_SUB_##wc (R, X, Y);				\
+	    }								\
+	  else if (_FP_ADD_INTERNAL_ediff < 0)				\
+	    {								\
+	      _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff;		\
+	      R##_e = Y##_e;						\
+	      R##_s = Y##_s;						\
+	      if (X##_e = 0)						\
+		{							\
+		  /* X is zero or denormalized.  */			\
+		  if (_FP_FRAC_ZEROP_##wc (X))				\
+		    {							\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+		      _FP_FRAC_COPY_##wc (R, Y);			\
+		      goto sub_done;					\
+		    }							\
+		  else							\
+		    {							\
+		      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		      _FP_ADD_INTERNAL_ediff--;				\
+		      if (_FP_ADD_INTERNAL_ediff = 0)			\
+			{						\
+			  _FP_FRAC_SUB_##wc (R, Y, X);			\
+			  goto sub3;					\
+			}						\
+		      if (Y##_e = _FP_EXPMAX_##fs)			\
+			{						\
+			  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+			  _FP_FRAC_COPY_##wc (R, Y);			\
+			  goto sub_done;				\
+			}						\
+		      goto sub2;					\
+		    }							\
+		}							\
+	      else if (Y##_e = _FP_EXPMAX_##fs)			\
+		{							\
+		  /* Y is NaN or Inf, X is normal.  */			\
+		  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);			\
+		  _FP_FRAC_COPY_##wc (R, Y);				\
+		  goto sub_done;					\
+		}							\
+									\
+	      /* Insert implicit MSB of X.  */				\
+	      _FP_FRAC_HIGH_##fs (X) |= _FP_IMPLBIT_SH_##fs;		\
+									\
+	    sub2:							\
+	      /* Shift the mantissa of X to the right			\
+		 _FP_ADD_INTERNAL_EDIFF steps; remember to account	\
+		 later for the implicit MSB of Y.  */			\
+	      if (_FP_ADD_INTERNAL_ediff <= _FP_WFRACBITS_##fs)		\
+		_FP_FRAC_SRS_##wc (X, _FP_ADD_INTERNAL_ediff,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (!_FP_FRAC_ZEROP_##wc (X))			\
+		_FP_FRAC_SET_##wc (X, _FP_MINFRAC_##wc);		\
+	      _FP_FRAC_SUB_##wc (R, Y, X);				\
+	    }								\
+	  else								\
+	    {								\
+	      /* ediff = 0.  */					\
+	      if (!_FP_EXP_NORMAL (fs, wc, X))				\
+		{							\
+		  if (X##_e = 0)					\
+		    {							\
+		      /* X and Y are zero or denormalized.  */		\
+		      R##_e = 0;					\
+		      if (_FP_FRAC_ZEROP_##wc (X))			\
+			{						\
+			  _FP_FRAC_COPY_##wc (R, Y);			\
+			  if (_FP_FRAC_ZEROP_##wc (Y))			\
+			    R##_s = (FP_ROUNDMODE = FP_RND_MINF);	\
+			  else						\
+			    {						\
+			      FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			      R##_s = Y##_s;				\
+			    }						\
+			  goto sub_done;				\
+			}						\
+		      else if (_FP_FRAC_ZEROP_##wc (Y))			\
+			{						\
+			  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_COPY_##wc (R, X);			\
+			  R##_s = X##_s;				\
+			  goto sub_done;				\
+			}						\
+		      else						\
+			{						\
+			  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_SUB_##wc (R, X, Y);			\
+			  R##_s = X##_s;				\
+			  if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs) \
+			    {						\
+			      /* |X| < |Y|, negate result.  */		\
+			      _FP_FRAC_SUB_##wc (R, Y, X);		\
+			      R##_s = Y##_s;				\
+			    }						\
+			  else if (_FP_FRAC_ZEROP_##wc (R))		\
+			    R##_s = (FP_ROUNDMODE = FP_RND_MINF);	\
+			  goto sub_done;				\
+			}						\
+		    }							\
+		  else							\
+		    {							\
+		      /* X and Y are NaN or Inf, of opposite signs.  */	\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+		      R##_e = _FP_EXPMAX_##fs;				\
+		      if (_FP_FRAC_ZEROP_##wc (X))			\
+			{						\
+			  if (_FP_FRAC_ZEROP_##wc (Y))			\
+			    {						\
+			      /* Inf - Inf.  */				\
+			      R##_s = _FP_NANSIGN_##fs;			\
+			      _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);	\
+			      _FP_FRAC_SLL_##wc (R, _FP_WORKBITS);	\
+			      FP_SET_EXCEPTION (FP_EX_INVALID		\
+						| FP_EX_INVALID_ISI);	\
+			    }						\
+			  else						\
+			    {						\
+			      /* Inf - NaN.  */				\
+			      R##_s = Y##_s;				\
+			      _FP_FRAC_COPY_##wc (R, Y);		\
+			    }						\
+			}						\
+		      else						\
+			{						\
+			  if (_FP_FRAC_ZEROP_##wc (Y))			\
+			    {						\
+			      /* NaN - Inf.  */				\
+			      R##_s = X##_s;				\
+			      _FP_FRAC_COPY_##wc (R, X);		\
+			    }						\
+			  else						\
+			    {						\
+			      /* NaN - NaN.  */				\
+			      _FP_CHOOSENAN_SEMIRAW (fs, wc, R, X, Y, OP); \
+			    }						\
+			}						\
+		      goto sub_done;					\
+		    }							\
+		}							\
+	      /* The exponents of X and Y, both normal, are equal.  The	\
+		 implicit MSBs cancel.  */				\
+	      R##_e = X##_e;						\
+	      _FP_FRAC_SUB_##wc (R, X, Y);				\
+	      R##_s = X##_s;						\
+	      if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs)		\
+		{							\
+		  /* |X| < |Y|, negate result.  */			\
+		  _FP_FRAC_SUB_##wc (R, Y, X);				\
+		  R##_s = Y##_s;					\
+		}							\
+	      else if (_FP_FRAC_ZEROP_##wc (R))				\
+		{							\
+		  R##_e = 0;						\
+		  R##_s = (FP_ROUNDMODE = FP_RND_MINF);		\
+		  goto sub_done;					\
+		}							\
+	      goto norm;						\
+	    }								\
+	sub3:								\
+	  if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs)		\
+	    {								\
+	      int _FP_ADD_INTERNAL_diff;				\
+	      /* Carry into most significant bit of larger one of X and Y, \
+		 canceling it; renormalize.  */				\
+	      _FP_FRAC_HIGH_##fs (R) &= _FP_IMPLBIT_SH_##fs - 1;	\
+	    norm:							\
+	      _FP_FRAC_CLZ_##wc (_FP_ADD_INTERNAL_diff, R);		\
+	      _FP_ADD_INTERNAL_diff -= _FP_WFRACXBITS_##fs;		\
+	      _FP_FRAC_SLL_##wc (R, _FP_ADD_INTERNAL_diff);		\
+	      if (R##_e <= _FP_ADD_INTERNAL_diff)			\
+		{							\
+		  /* R is denormalized.  */				\
+		  _FP_ADD_INTERNAL_diff					\
+		    = _FP_ADD_INTERNAL_diff - R##_e + 1;		\
+		  _FP_FRAC_SRS_##wc (R, _FP_ADD_INTERNAL_diff,		\
+				     _FP_WFRACBITS_##fs);		\
+		  R##_e = 0;						\
+		}							\
+	      else							\
+		{							\
+		  R##_e -= _FP_ADD_INTERNAL_diff;			\
+		  _FP_FRAC_HIGH_##fs (R) &= ~(_FP_W_TYPE) _FP_IMPLBIT_SH_##fs; \
+		}							\
+	    }								\
+	sub_done: ;							\
+	}								\
+    }									\
+  while (0)
+
+#define _FP_ADD(fs, wc, R, X, Y) _FP_ADD_INTERNAL (fs, wc, R, X, Y, '+')
+#define _FP_SUB(fs, wc, R, X, Y)					\
+  do									\
+    {									\
+      if (!(Y##_e = _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (Y)))	\
+	Y##_s ^= 1;							\
+      _FP_ADD_INTERNAL (fs, wc, R, X, Y, '-');				\
+    }									\
+  while (0)
+
+
+/* Main negation routine.  The input value is raw.  */
+
+#define _FP_NEG(fs, wc, R, X)			\
+  do						\
+    {						\
+      _FP_FRAC_COPY_##wc (R, X);		\
+      R##_e = X##_e;				\
+      R##_s = 1 ^ X##_s;			\
+    }						\
+  while (0)
+
+
+/* Main multiplication routine.  The input values should be cooked.  */
+
+#define _FP_MUL(fs, wc, R, X, Y)				\
+  do								\
+    {								\
+      R##_s = X##_s ^ Y##_s;					\
+      R##_e = X##_e + Y##_e + 1;				\
+      switch (_FP_CLS_COMBINE (X##_c, Y##_c))			\
+	{							\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NORMAL):	\
+	  R##_c = FP_CLS_NORMAL;				\
+								\
+	  _FP_MUL_MEAT_##fs (R, X, Y);				\
+								\
+	  if (_FP_FRAC_OVERP_##wc (fs, R))			\
+	    _FP_FRAC_SRS_##wc (R, 1, _FP_WFRACBITS_##fs);	\
+	  else							\
+	    R##_e--;						\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NAN):		\
+	  _FP_CHOOSENAN (fs, wc, R, X, Y, '*');			\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NORMAL):	\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO):		\
+	  R##_s = X##_s;					\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL):	\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NORMAL):	\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_ZERO):	\
+	  _FP_FRAC_COPY_##wc (R, X);				\
+	  R##_c = X##_c;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NAN):	\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN):		\
+	  R##_s = Y##_s;					\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_INF):	\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_ZERO):	\
+	  _FP_FRAC_COPY_##wc (R, Y);				\
+	  R##_c = Y##_c;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_INF):		\
+	  R##_s = _FP_NANSIGN_##fs;				\
+	  R##_c = FP_CLS_NAN;					\
+	  _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);		\
+	  FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_IMZ);	\
+	  break;						\
+								\
+	default:						\
+	  abort ();						\
+	}							\
+    }								\
+  while (0)
+
+
+/* Fused multiply-add.  The input values should be cooked.  */
+
+#define _FP_FMA(fs, wc, dwc, R, X, Y, Z)				\
+  do									\
+    {									\
+      __label__ done_fma;						\
+      FP_DECL_##fs (_FP_FMA_T);						\
+      _FP_FMA_T##_s = X##_s ^ Y##_s;					\
+      _FP_FMA_T##_e = X##_e + Y##_e + 1;				\
+      switch (_FP_CLS_COMBINE (X##_c, Y##_c))				\
+	{								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NORMAL):		\
+	  switch (Z##_c)						\
+	    {								\
+	    case FP_CLS_INF:						\
+	    case FP_CLS_NAN:						\
+	      R##_s = Z##_s;						\
+	      _FP_FRAC_COPY_##wc (R, Z);				\
+	      R##_c = Z##_c;						\
+	      break;							\
+									\
+	    case FP_CLS_ZERO:						\
+	      R##_c = FP_CLS_NORMAL;					\
+	      R##_s = _FP_FMA_T##_s;					\
+	      R##_e = _FP_FMA_T##_e;					\
+									\
+	      _FP_MUL_MEAT_##fs (R, X, Y);				\
+									\
+	      if (_FP_FRAC_OVERP_##wc (fs, R))				\
+		_FP_FRAC_SRS_##wc (R, 1, _FP_WFRACBITS_##fs);		\
+	      else							\
+		R##_e--;						\
+	      break;							\
+									\
+	    case FP_CLS_NORMAL:;					\
+	      _FP_FRAC_DECL_##dwc (_FP_FMA_TD);				\
+	      _FP_FRAC_DECL_##dwc (_FP_FMA_ZD);				\
+	      _FP_FRAC_DECL_##dwc (_FP_FMA_RD);				\
+	      _FP_MUL_MEAT_DW_##fs (_FP_FMA_TD, X, Y);			\
+	      R##_e = _FP_FMA_T##_e;					\
+	      int _FP_FMA_tsh						\
+		= _FP_FRAC_HIGHBIT_DW_##dwc (fs, _FP_FMA_TD) = 0;	\
+	      _FP_FMA_T##_e -= _FP_FMA_tsh;				\
+	      int _FP_FMA_ediff = _FP_FMA_T##_e - Z##_e;		\
+	      if (_FP_FMA_ediff >= 0)					\
+		{							\
+		  int _FP_FMA_shift					\
+		    = _FP_WFRACBITS_##fs - _FP_FMA_tsh - _FP_FMA_ediff;	\
+		  if (_FP_FMA_shift <= -_FP_WFRACBITS_##fs)		\
+		    _FP_FRAC_SET_##dwc (_FP_FMA_ZD, _FP_MINFRAC_##dwc);	\
+		  else							\
+		    {							\
+		      _FP_FRAC_COPY_##dwc##_##wc (_FP_FMA_ZD, Z);	\
+		      if (_FP_FMA_shift < 0)				\
+			_FP_FRAC_SRS_##dwc (_FP_FMA_ZD, -_FP_FMA_shift,	\
+					    _FP_WFRACBITS_DW_##fs);	\
+		      else if (_FP_FMA_shift > 0)			\
+			_FP_FRAC_SLL_##dwc (_FP_FMA_ZD, _FP_FMA_shift);	\
+		    }							\
+		  R##_s = _FP_FMA_T##_s;				\
+		  if (_FP_FMA_T##_s = Z##_s)				\
+		    _FP_FRAC_ADD_##dwc (_FP_FMA_RD, _FP_FMA_TD,		\
+					_FP_FMA_ZD);			\
+		  else							\
+		    {							\
+		      _FP_FRAC_SUB_##dwc (_FP_FMA_RD, _FP_FMA_TD,	\
+					  _FP_FMA_ZD);			\
+		      if (_FP_FRAC_NEGP_##dwc (_FP_FMA_RD))		\
+			{						\
+			  R##_s = Z##_s;				\
+			  _FP_FRAC_SUB_##dwc (_FP_FMA_RD, _FP_FMA_ZD,	\
+					      _FP_FMA_TD);		\
+			}						\
+		    }							\
+		}							\
+	      else							\
+		{							\
+		  R##_e = Z##_e;					\
+		  R##_s = Z##_s;					\
+		  _FP_FRAC_COPY_##dwc##_##wc (_FP_FMA_ZD, Z);		\
+		  _FP_FRAC_SLL_##dwc (_FP_FMA_ZD, _FP_WFRACBITS_##fs);	\
+		  int _FP_FMA_shift = -_FP_FMA_ediff - _FP_FMA_tsh;	\
+		  if (_FP_FMA_shift >= _FP_WFRACBITS_DW_##fs)		\
+		    _FP_FRAC_SET_##dwc (_FP_FMA_TD, _FP_MINFRAC_##dwc);	\
+		  else if (_FP_FMA_shift > 0)				\
+		    _FP_FRAC_SRS_##dwc (_FP_FMA_TD, _FP_FMA_shift,	\
+					_FP_WFRACBITS_DW_##fs);		\
+		  if (Z##_s = _FP_FMA_T##_s)				\
+		    _FP_FRAC_ADD_##dwc (_FP_FMA_RD, _FP_FMA_ZD,		\
+					_FP_FMA_TD);			\
+		  else							\
+		    _FP_FRAC_SUB_##dwc (_FP_FMA_RD, _FP_FMA_ZD,		\
+					_FP_FMA_TD);			\
+		}							\
+	      if (_FP_FRAC_ZEROP_##dwc (_FP_FMA_RD))			\
+		{							\
+		  if (_FP_FMA_T##_s = Z##_s)				\
+		    R##_s = Z##_s;					\
+		  else							\
+		    R##_s = (FP_ROUNDMODE = FP_RND_MINF);		\
+		  _FP_FRAC_SET_##wc (R, _FP_ZEROFRAC_##wc);		\
+		  R##_c = FP_CLS_ZERO;					\
+		}							\
+	      else							\
+		{							\
+		  int _FP_FMA_rlz;					\
+		  _FP_FRAC_CLZ_##dwc (_FP_FMA_rlz, _FP_FMA_RD);		\
+		  _FP_FMA_rlz -= _FP_WFRACXBITS_DW_##fs;		\
+		  R##_e -= _FP_FMA_rlz;					\
+		  int _FP_FMA_shift = _FP_WFRACBITS_##fs - _FP_FMA_rlz;	\
+		  if (_FP_FMA_shift > 0)				\
+		    _FP_FRAC_SRS_##dwc (_FP_FMA_RD, _FP_FMA_shift,	\
+					_FP_WFRACBITS_DW_##fs);		\
+		  else if (_FP_FMA_shift < 0)				\
+		    _FP_FRAC_SLL_##dwc (_FP_FMA_RD, -_FP_FMA_shift);	\
+		  _FP_FRAC_COPY_##wc##_##dwc (R, _FP_FMA_RD);		\
+		  R##_c = FP_CLS_NORMAL;				\
+		}							\
+	      break;							\
+	    }								\
+	  goto done_fma;						\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NAN):			\
+	  _FP_CHOOSENAN (fs, wc, _FP_FMA_T, X, Y, '*');			\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF):			\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO):			\
+	  _FP_FMA_T##_s = X##_s;					\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF):			\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_ZERO):		\
+	  _FP_FRAC_COPY_##wc (_FP_FMA_T, X);				\
+	  _FP_FMA_T##_c = X##_c;					\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NAN):		\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN):			\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN):			\
+	  _FP_FMA_T##_s = Y##_s;					\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_ZERO):		\
+	  _FP_FRAC_COPY_##wc (_FP_FMA_T, Y);				\
+	  _FP_FMA_T##_c = Y##_c;					\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO):			\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_INF):			\
+	  _FP_FMA_T##_s = _FP_NANSIGN_##fs;				\
+	  _FP_FMA_T##_c = FP_CLS_NAN;					\
+	  _FP_FRAC_SET_##wc (_FP_FMA_T, _FP_NANFRAC_##fs);		\
+	  FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_IMZ_FMA);	\
+	  break;							\
+									\
+	default:							\
+	  abort ();							\
+	}								\
+									\
+      /* T = X * Y is zero, infinity or NaN.  */			\
+      switch (_FP_CLS_COMBINE (_FP_FMA_T##_c, Z##_c))			\
+	{								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NAN):			\
+	  _FP_CHOOSENAN (fs, wc, R, _FP_FMA_T, Z, '+');			\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF):			\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO):			\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO):			\
+	  R##_s = _FP_FMA_T##_s;					\
+	  _FP_FRAC_COPY_##wc (R, _FP_FMA_T);				\
+	  R##_c = _FP_FMA_T##_c;					\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN):			\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN):			\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_INF):			\
+	  R##_s = Z##_s;						\
+	  _FP_FRAC_COPY_##wc (R, Z);					\
+	  R##_c = Z##_c;						\
+	  R##_e = Z##_e;						\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF):			\
+	  if (_FP_FMA_T##_s = Z##_s)					\
+	    {								\
+	      R##_s = Z##_s;						\
+	      _FP_FRAC_COPY_##wc (R, Z);				\
+	      R##_c = Z##_c;						\
+	    }								\
+	  else								\
+	    {								\
+	      R##_s = _FP_NANSIGN_##fs;					\
+	      R##_c = FP_CLS_NAN;					\
+	      _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);			\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_ISI);	\
+	    }								\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_ZERO):		\
+	  if (_FP_FMA_T##_s = Z##_s)					\
+	    R##_s = Z##_s;						\
+	  else								\
+	    R##_s = (FP_ROUNDMODE = FP_RND_MINF);			\
+	  _FP_FRAC_COPY_##wc (R, Z);					\
+	  R##_c = Z##_c;						\
+	  break;							\
+									\
+	default:							\
+	  abort ();							\
+	}								\
+    done_fma: ;								\
+    }									\
+  while (0)
+
+
+/* Main division routine.  The input values should be cooked.  */
+
+#define _FP_DIV(fs, wc, R, X, Y)				\
+  do								\
     {								\
-      if (!_FP_FRAC_ZEROP_##wc(X)				\
-	  && !(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs))	\
-	__ret = 1;						\
+      R##_s = X##_s ^ Y##_s;					\
+      R##_e = X##_e - Y##_e;					\
+      switch (_FP_CLS_COMBINE (X##_c, Y##_c))			\
+	{							\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NORMAL):	\
+	  R##_c = FP_CLS_NORMAL;				\
+								\
+	  _FP_DIV_MEAT_##fs (R, X, Y);				\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NAN):		\
+	  _FP_CHOOSENAN (fs, wc, R, X, Y, '/');			\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NORMAL):	\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO):		\
+	  R##_s = X##_s;					\
+	  _FP_FRAC_COPY_##wc (R, X);				\
+	  R##_c = X##_c;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NAN):	\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN):		\
+	  R##_s = Y##_s;					\
+	  _FP_FRAC_COPY_##wc (R, Y);				\
+	  R##_c = Y##_c;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_INF):	\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NORMAL):	\
+	  R##_c = FP_CLS_ZERO;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_ZERO):	\
+	  FP_SET_EXCEPTION (FP_EX_DIVZERO);			\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO):		\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL):	\
+	  R##_c = FP_CLS_INF;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_ZERO):	\
+	  R##_s = _FP_NANSIGN_##fs;				\
+	  R##_c = FP_CLS_NAN;					\
+	  _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);		\
+	  FP_SET_EXCEPTION (FP_EX_INVALID			\
+			    | (X##_c = FP_CLS_INF		\
+			       ? FP_EX_INVALID_IDI		\
+			       : FP_EX_INVALID_ZDZ));		\
+	  break;						\
+								\
+	default:						\
+	  abort ();						\
+	}							\
     }								\
-  __ret;							\
-})
-
-
-
-
-
-/*
- * Main addition routine.  The input values should be cooked.
- */
-
-#define _FP_ADD_INTERNAL(fs, wc, R, X, Y, OP)				     \
-do {									     \
-  switch (_FP_CLS_COMBINE(X##_c, Y##_c))				     \
-  {									     \
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL):			     \
-    {									     \
-      /* shift the smaller number so that its exponent matches the larger */ \
-      _FP_I_TYPE diff = X##_e - Y##_e;					     \
-									     \
-      if (diff < 0)							     \
-	{								     \
-	  diff = -diff;							     \
-	  if (diff <= _FP_WFRACBITS_##fs)				     \
-	    _FP_FRAC_SRS_##wc(X, diff, _FP_WFRACBITS_##fs);		     \
-	  else if (!_FP_FRAC_ZEROP_##wc(X))				     \
-	    _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc);			     \
-	  R##_e = Y##_e;						     \
-	}								     \
-      else								     \
-	{								     \
-	  if (diff > 0)							     \
-	    {								     \
-	      if (diff <= _FP_WFRACBITS_##fs)				     \
-	        _FP_FRAC_SRS_##wc(Y, diff, _FP_WFRACBITS_##fs);		     \
-	      else if (!_FP_FRAC_ZEROP_##wc(Y))				     \
-	        _FP_FRAC_SET_##wc(Y, _FP_MINFRAC_##wc);			     \
-	    }								     \
-	  R##_e = X##_e;						     \
-	}								     \
-									     \
-      R##_c = FP_CLS_NORMAL;						     \
-									     \
-      if (X##_s = Y##_s)						     \
-	{								     \
-	  R##_s = X##_s;						     \
-	  _FP_FRAC_ADD_##wc(R, X, Y);					     \
-	  if (_FP_FRAC_OVERP_##wc(fs, R))				     \
-	    {								     \
-	      _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs);		     \
-	      R##_e++;							     \
-	    }								     \
-	}								     \
-      else								     \
-	{								     \
-	  R##_s = X##_s;						     \
-	  _FP_FRAC_SUB_##wc(R, X, Y);					     \
-	  if (_FP_FRAC_ZEROP_##wc(R))					     \
-	    {								     \
-	      /* return an exact zero */				     \
-	      if (FP_ROUNDMODE = FP_RND_MINF)				     \
-		R##_s |= Y##_s;						     \
-	      else							     \
-		R##_s &= Y##_s;						     \
-	      R##_c = FP_CLS_ZERO;					     \
-	    }								     \
-	  else								     \
-	    {								     \
-	      if (_FP_FRAC_NEGP_##wc(R))				     \
-		{							     \
-		  _FP_FRAC_SUB_##wc(R, Y, X);				     \
-		  R##_s = Y##_s;					     \
-		}							     \
-									     \
-	      /* renormalize after subtraction */			     \
-	      _FP_FRAC_CLZ_##wc(diff, R);				     \
-	      diff -= _FP_WFRACXBITS_##fs;				     \
-	      if (diff)							     \
-		{							     \
-		  R##_e -= diff;					     \
-		  _FP_FRAC_SLL_##wc(R, diff);				     \
-		}							     \
-	    }								     \
-	}								     \
-      break;								     \
-    }									     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN):				     \
-    _FP_CHOOSENAN(fs, wc, R, X, Y, OP);					     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO):			     \
-    R##_e = X##_e;							     \
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL):			     \
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF):				     \
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO):				     \
-    _FP_FRAC_COPY_##wc(R, X);						     \
-    R##_s = X##_s;							     \
-    R##_c = X##_c;							     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL):			     \
-    R##_e = Y##_e;							     \
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN):			     \
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN):				     \
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN):				     \
-    _FP_FRAC_COPY_##wc(R, Y);						     \
-    R##_s = Y##_s;							     \
-    R##_c = Y##_c;							     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF):				     \
-    if (X##_s != Y##_s)							     \
-      {									     \
-	/* +INF + -INF => NAN */					     \
-	_FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);				     \
-	R##_s = _FP_NANSIGN_##fs;					     \
-	R##_c = FP_CLS_NAN;						     \
-	FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_ISI);		     \
-	break;								     \
-      }									     \
-    /* FALLTHRU */							     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL):			     \
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO):				     \
-    R##_s = X##_s;							     \
-    R##_c = FP_CLS_INF;							     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF):			     \
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF):				     \
-    R##_s = Y##_s;							     \
-    R##_c = FP_CLS_INF;							     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO):			     \
-    /* make sure the sign is correct */					     \
-    if (FP_ROUNDMODE = FP_RND_MINF)					     \
-      R##_s = X##_s | Y##_s;						     \
-    else								     \
-      R##_s = X##_s & Y##_s;						     \
-    R##_c = FP_CLS_ZERO;						     \
-    break;								     \
-									     \
-  default:								     \
-    abort();								     \
-  }									     \
-} while (0)
-
-#define _FP_ADD(fs, wc, R, X, Y) _FP_ADD_INTERNAL(fs, wc, R, X, Y, '+')
-#define _FP_SUB(fs, wc, R, X, Y)					     \
-  do {									     \
-    if (Y##_c != FP_CLS_NAN) Y##_s ^= 1;				     \
-    _FP_ADD_INTERNAL(fs, wc, R, X, Y, '-');				     \
-  } while (0)
-
-
-/*
- * Main negation routine.  FIXME -- when we care about setting exception
- * bits reliably, this will not do.  We should examine all of the fp classes.
- */
-
-#define _FP_NEG(fs, wc, R, X)		\
-  do {					\
-    _FP_FRAC_COPY_##wc(R, X);		\
-    R##_c = X##_c;			\
-    R##_e = X##_e;			\
-    R##_s = 1 ^ X##_s;			\
-  } while (0)
-
-
-/*
- * Main multiplication routine.  The input values should be cooked.
- */
-
-#define _FP_MUL(fs, wc, R, X, Y)			\
-do {							\
-  R##_s = X##_s ^ Y##_s;				\
-  switch (_FP_CLS_COMBINE(X##_c, Y##_c))		\
-  {							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL):	\
-    R##_c = FP_CLS_NORMAL;				\
-    R##_e = X##_e + Y##_e + 1;				\
-							\
-    _FP_MUL_MEAT_##fs(R,X,Y);				\
-							\
-    if (_FP_FRAC_OVERP_##wc(fs, R))			\
-      _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs);	\
-    else						\
-      R##_e--;						\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN):		\
-    _FP_CHOOSENAN(fs, wc, R, X, Y, '*');		\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL):	\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF):		\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO):		\
-    R##_s = X##_s;					\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF):		\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL):	\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL):	\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO):	\
-    _FP_FRAC_COPY_##wc(R, X);				\
-    R##_c = X##_c;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN):	\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN):		\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN):		\
-    R##_s = Y##_s;					\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF):	\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO):	\
-    _FP_FRAC_COPY_##wc(R, Y);				\
-    R##_c = Y##_c;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO):		\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF):		\
-    R##_s = _FP_NANSIGN_##fs;				\
-    R##_c = FP_CLS_NAN;					\
-    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);		\
-    FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IMZ);\
-    break;						\
-							\
-  default:						\
-    abort();						\
-  }							\
-} while (0)
-
-
-/*
- * Main division routine.  The input values should be cooked.
- */
-
-#define _FP_DIV(fs, wc, R, X, Y)			\
-do {							\
-  R##_s = X##_s ^ Y##_s;				\
-  switch (_FP_CLS_COMBINE(X##_c, Y##_c))		\
-  {							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL):	\
-    R##_c = FP_CLS_NORMAL;				\
-    R##_e = X##_e - Y##_e;				\
-							\
-    _FP_DIV_MEAT_##fs(R,X,Y);				\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN):		\
-    _FP_CHOOSENAN(fs, wc, R, X, Y, '/');		\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL):	\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF):		\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO):		\
-    R##_s = X##_s;					\
-    _FP_FRAC_COPY_##wc(R, X);				\
-    R##_c = X##_c;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN):	\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN):		\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN):		\
-    R##_s = Y##_s;					\
-    _FP_FRAC_COPY_##wc(R, Y);				\
-    R##_c = Y##_c;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF):	\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF):		\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL):	\
-    R##_c = FP_CLS_ZERO;				\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO):	\
-    FP_SET_EXCEPTION(FP_EX_DIVZERO);			\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO):		\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL):	\
-    R##_c = FP_CLS_INF;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF):		\
-    R##_s = _FP_NANSIGN_##fs;				\
-    R##_c = FP_CLS_NAN;					\
-    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);		\
-    FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IDI);\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO):	\
-    R##_s = _FP_NANSIGN_##fs;				\
-    R##_c = FP_CLS_NAN;					\
-    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);		\
-    FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_ZDZ);\
-    break;						\
-							\
-  default:						\
-    abort();						\
-  }							\
-} while (0)
-
-
-/*
- * Main differential comparison routine.  The inputs should be raw not
- * cooked.  The return is -1,0,1 for normal values, 2 otherwise.
- */
-
-#define _FP_CMP(fs, wc, ret, X, Y, un)					\
-  do {									\
-    /* NANs are unordered */						\
-    if ((X##_e = _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X))		\
-	|| (Y##_e = _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y)))	\
-      {									\
-	ret = un;							\
-      }									\
-    else								\
-      {									\
-	int __is_zero_x;						\
-	int __is_zero_y;						\
-									\
-	__is_zero_x = (!X##_e && _FP_FRAC_ZEROP_##wc(X)) ? 1 : 0;	\
-	__is_zero_y = (!Y##_e && _FP_FRAC_ZEROP_##wc(Y)) ? 1 : 0;	\
-									\
-	if (__is_zero_x && __is_zero_y)					\
-		ret = 0;						\
-	else if (__is_zero_x)						\
-		ret = Y##_s ? 1 : -1;					\
-	else if (__is_zero_y)						\
-		ret = X##_s ? -1 : 1;					\
-	else if (X##_s != Y##_s)					\
-	  ret = X##_s ? -1 : 1;						\
-	else if (X##_e > Y##_e)						\
-	  ret = X##_s ? -1 : 1;						\
-	else if (X##_e < Y##_e)						\
-	  ret = X##_s ? 1 : -1;						\
-	else if (_FP_FRAC_GT_##wc(X, Y))				\
-	  ret = X##_s ? -1 : 1;						\
-	else if (_FP_FRAC_GT_##wc(Y, X))				\
-	  ret = X##_s ? 1 : -1;						\
-	else								\
-	  ret = 0;							\
-      }									\
-  } while (0)
+  while (0)
+
+
+/* Helper for comparisons.  EX is 0 not to raise exceptions, 1 to
+   raise exceptions for signaling NaN operands, 2 to raise exceptions
+   for all NaN operands.  Conditionals are organized to allow the
+   compiler to optimize away code based on the value of EX.  */
+
+#define _FP_CMP_CHECK_NAN(fs, wc, X, Y, ex)				\
+  do									\
+    {									\
+      /* The arguments are unordered, which may or may not result in	\
+	 an exception.  */						\
+      if (ex)								\
+	{								\
+	  /* At least some cases of unordered arguments result in	\
+	     exceptions; check whether this is one.  */			\
+	  if (FP_EX_INVALID_SNAN || FP_EX_INVALID_VC)			\
+	    {								\
+	      /* Check separately for each case of "invalid"		\
+		 exceptions.  */					\
+	      if ((ex) = 2)						\
+		FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_VC);	\
+	      if (_FP_ISSIGNAN (fs, wc, X)				\
+		  || _FP_ISSIGNAN (fs, wc, Y))				\
+		FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_SNAN);	\
+	    }								\
+	  /* Otherwise, we only need to check whether to raise an	\
+	     exception, not which case or cases it is.  */		\
+	  else if ((ex) = 2						\
+		   || _FP_ISSIGNAN (fs, wc, X)				\
+		   || _FP_ISSIGNAN (fs, wc, Y))				\
+	    FP_SET_EXCEPTION (FP_EX_INVALID);				\
+	}								\
+    }									\
+  while (0)
+
+/* Helper for comparisons.  If denormal operands would raise an
+   exception, check for them, and flush to zero as appropriate
+   (otherwise, we need only check and flush to zero if it might affect
+   the result, which is done later with _FP_CMP_CHECK_FLUSH_ZERO).  */
+#define _FP_CMP_CHECK_DENORM(fs, wc, X, Y)				\
+  do									\
+    {									\
+      if (FP_EX_DENORM != 0)						\
+	{								\
+	  /* We must ensure the correct exceptions are raised for	\
+	     denormal operands, even though this may not affect the	\
+	     result of the comparison.  */				\
+	  if (FP_DENORM_ZERO)						\
+	    {								\
+	      _FP_CHECK_FLUSH_ZERO (fs, wc, X);				\
+	      _FP_CHECK_FLUSH_ZERO (fs, wc, Y);				\
+	    }								\
+	  else								\
+	    {								\
+	      if ((X##_e = 0 && !_FP_FRAC_ZEROP_##wc (X))		\
+		  || (Y##_e = 0 && !_FP_FRAC_ZEROP_##wc (Y)))		\
+		FP_SET_EXCEPTION (FP_EX_DENORM);			\
+	    }								\
+	}								\
+    }									\
+  while (0)
+
+/* Helper for comparisons.  Check for flushing denormals for zero if
+   we didn't need to check earlier for any denormal operands.  */
+#define _FP_CMP_CHECK_FLUSH_ZERO(fs, wc, X, Y)	\
+  do						\
+    {						\
+      if (FP_EX_DENORM = 0)			\
+	{					\
+	  _FP_CHECK_FLUSH_ZERO (fs, wc, X);	\
+	  _FP_CHECK_FLUSH_ZERO (fs, wc, Y);	\
+	}					\
+    }						\
+  while (0)
+
+/* Main differential comparison routine.  The inputs should be raw not
+   cooked.  The return is -1, 0, 1 for normal values, UN
+   otherwise.  */
+
+#define _FP_CMP(fs, wc, ret, X, Y, un, ex)				\
+  do									\
+    {									\
+      _FP_CMP_CHECK_DENORM (fs, wc, X, Y);				\
+      /* NANs are unordered.  */					\
+      if ((X##_e = _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (X))	\
+	  || (Y##_e = _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (Y)))	\
+	{								\
+	  (ret) = (un);							\
+	  _FP_CMP_CHECK_NAN (fs, wc, X, Y, (ex));			\
+	}								\
+      else								\
+	{								\
+	  int _FP_CMP_is_zero_x;					\
+	  int _FP_CMP_is_zero_y;					\
+									\
+	  _FP_CMP_CHECK_FLUSH_ZERO (fs, wc, X, Y);			\
+									\
+	  _FP_CMP_is_zero_x						\
+	    = (!X##_e && _FP_FRAC_ZEROP_##wc (X)) ? 1 : 0;		\
+	  _FP_CMP_is_zero_y						\
+	    = (!Y##_e && _FP_FRAC_ZEROP_##wc (Y)) ? 1 : 0;		\
+									\
+	  if (_FP_CMP_is_zero_x && _FP_CMP_is_zero_y)			\
+	    (ret) = 0;							\
+	  else if (_FP_CMP_is_zero_x)					\
+	    (ret) = Y##_s ? 1 : -1;					\
+	  else if (_FP_CMP_is_zero_y)					\
+	    (ret) = X##_s ? -1 : 1;					\
+	  else if (X##_s != Y##_s)					\
+	    (ret) = X##_s ? -1 : 1;					\
+	  else if (X##_e > Y##_e)					\
+	    (ret) = X##_s ? -1 : 1;					\
+	  else if (X##_e < Y##_e)					\
+	    (ret) = X##_s ? 1 : -1;					\
+	  else if (_FP_FRAC_GT_##wc (X, Y))				\
+	    (ret) = X##_s ? -1 : 1;					\
+	  else if (_FP_FRAC_GT_##wc (Y, X))				\
+	    (ret) = X##_s ? 1 : -1;					\
+	  else								\
+	    (ret) = 0;							\
+	}								\
+    }									\
+  while (0)
 
 
 /* Simplification for strict equality.  */
 
-#define _FP_CMP_EQ(fs, wc, ret, X, Y)					  \
-  do {									  \
-    /* NANs are unordered */						  \
-    if ((X##_e = _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X))		  \
-	|| (Y##_e = _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y)))	  \
-      {									  \
-	ret = 1;							  \
-      }									  \
-    else								  \
-      {									  \
-	ret = !(X##_e = Y##_e						  \
-		&& _FP_FRAC_EQ_##wc(X, Y)				  \
-		&& (X##_s = Y##_s || !X##_e && _FP_FRAC_ZEROP_##wc(X))); \
-      }									  \
-  } while (0)
-
-/*
- * Main square root routine.  The input value should be cooked.
- */
+#define _FP_CMP_EQ(fs, wc, ret, X, Y, ex)				\
+  do									\
+    {									\
+      _FP_CMP_CHECK_DENORM (fs, wc, X, Y);				\
+      /* NANs are unordered.  */					\
+      if ((X##_e = _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (X))	\
+	  || (Y##_e = _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (Y)))	\
+	{								\
+	  (ret) = 1;							\
+	  _FP_CMP_CHECK_NAN (fs, wc, X, Y, (ex));			\
+	}								\
+      else								\
+	{								\
+	  _FP_CMP_CHECK_FLUSH_ZERO (fs, wc, X, Y);			\
+									\
+	  (ret) = !(X##_e = Y##_e					\
+		    && _FP_FRAC_EQ_##wc (X, Y)				\
+		    && (X##_s = Y##_s					\
+			|| (!X##_e && _FP_FRAC_ZEROP_##wc (X))));	\
+	}								\
+    }									\
+  while (0)
+
+/* Version to test unordered.  */
+
+#define _FP_CMP_UNORD(fs, wc, ret, X, Y, ex)				\
+  do									\
+    {									\
+      _FP_CMP_CHECK_DENORM (fs, wc, X, Y);				\
+      (ret) = ((X##_e = _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (X))	\
+	       || (Y##_e = _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (Y))); \
+      if (ret)								\
+	_FP_CMP_CHECK_NAN (fs, wc, X, Y, (ex));				\
+    }									\
+  while (0)
+
+/* Main square root routine.  The input value should be cooked.  */
 
 #define _FP_SQRT(fs, wc, R, X)						\
-do {									\
-    _FP_FRAC_DECL_##wc(T); _FP_FRAC_DECL_##wc(S);			\
-    _FP_W_TYPE q;							\
-    switch (X##_c)							\
+  do									\
     {									\
-    case FP_CLS_NAN:							\
-	_FP_FRAC_COPY_##wc(R, X);					\
-	R##_s = X##_s;							\
-    	R##_c = FP_CLS_NAN;						\
-    	break;								\
-    case FP_CLS_INF:							\
-    	if (X##_s)							\
-    	  {								\
-    	    R##_s = _FP_NANSIGN_##fs;					\
-	    R##_c = FP_CLS_NAN; /* NAN */				\
-	    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);			\
-	    FP_SET_EXCEPTION(FP_EX_INVALID);				\
-    	  }								\
-    	else								\
-    	  {								\
-    	    R##_s = 0;							\
-    	    R##_c = FP_CLS_INF; /* sqrt(+inf) = +inf */			\
-    	  }								\
-    	break;								\
-    case FP_CLS_ZERO:							\
-	R##_s = X##_s;							\
-	R##_c = FP_CLS_ZERO; /* sqrt(+-0) = +-0 */			\
-	break;								\
-    case FP_CLS_NORMAL:							\
-    	R##_s = 0;							\
-        if (X##_s)							\
-          {								\
-	    R##_c = FP_CLS_NAN; /* sNAN */				\
-	    R##_s = _FP_NANSIGN_##fs;					\
-	    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);			\
-	    FP_SET_EXCEPTION(FP_EX_INVALID);				\
-	    break;							\
-          }								\
-    	R##_c = FP_CLS_NORMAL;						\
-        if (X##_e & 1)							\
-          _FP_FRAC_SLL_##wc(X, 1);					\
-        R##_e = X##_e >> 1;						\
-        _FP_FRAC_SET_##wc(S, _FP_ZEROFRAC_##wc);			\
-        _FP_FRAC_SET_##wc(R, _FP_ZEROFRAC_##wc);			\
-        q = _FP_OVERFLOW_##fs >> 1;					\
-        _FP_SQRT_MEAT_##wc(R, S, T, X, q);				\
+      _FP_FRAC_DECL_##wc (_FP_SQRT_T);					\
+      _FP_FRAC_DECL_##wc (_FP_SQRT_S);					\
+      _FP_W_TYPE _FP_SQRT_q;						\
+      switch (X##_c)							\
+	{								\
+	case FP_CLS_NAN:						\
+	  _FP_FRAC_COPY_##wc (R, X);					\
+	  R##_s = X##_s;						\
+	  R##_c = FP_CLS_NAN;						\
+	  break;							\
+	case FP_CLS_INF:						\
+	  if (X##_s)							\
+	    {								\
+	      R##_s = _FP_NANSIGN_##fs;					\
+	      R##_c = FP_CLS_NAN; /* NAN */				\
+	      _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);			\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_SQRT);	\
+	    }								\
+	  else								\
+	    {								\
+	      R##_s = 0;						\
+	      R##_c = FP_CLS_INF; /* sqrt(+inf) = +inf */		\
+	    }								\
+	  break;							\
+	case FP_CLS_ZERO:						\
+	  R##_s = X##_s;						\
+	  R##_c = FP_CLS_ZERO; /* sqrt(+-0) = +-0 */			\
+	  break;							\
+	case FP_CLS_NORMAL:						\
+	  R##_s = 0;							\
+	  if (X##_s)							\
+	    {								\
+	      R##_c = FP_CLS_NAN; /* NAN */				\
+	      R##_s = _FP_NANSIGN_##fs;					\
+	      _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);			\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_SQRT);	\
+	      break;							\
+	    }								\
+	  R##_c = FP_CLS_NORMAL;					\
+	  if (X##_e & 1)						\
+	    _FP_FRAC_SLL_##wc (X, 1);					\
+	  R##_e = X##_e >> 1;						\
+	  _FP_FRAC_SET_##wc (_FP_SQRT_S, _FP_ZEROFRAC_##wc);		\
+	  _FP_FRAC_SET_##wc (R, _FP_ZEROFRAC_##wc);			\
+	  _FP_SQRT_q = _FP_OVERFLOW_##fs >> 1;				\
+	  _FP_SQRT_MEAT_##wc (R, _FP_SQRT_S, _FP_SQRT_T, X,		\
+			      _FP_SQRT_q);				\
+	}								\
     }									\
-  } while (0)
+  while (0)
 
-/*
- * Convert from FP to integer
- */
+/* Convert from FP to integer.  Input is raw.  */
 
 /* RSIGNED can have following values:
- * 0:  the number is required to be 0..(2^rsize)-1, if not, NV is set plus
- *     the result is either 0 or (2^rsize)-1 depending on the sign in such case.
- * 1:  the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not, NV is
- *     set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 depending
- *     on the sign in such case.
- * 2:  the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not, NV is
- *     set plus the result is truncated to fit into destination.
- * -1: the number is required to be -(2^(rsize-1))..(2^rsize)-1, if not, NV is
- *     set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 depending
- *     on the sign in such case.
- */
-#define _FP_TO_INT(fs, wc, r, X, rsize, rsigned)				\
-  do {										\
-    switch (X##_c)								\
-      {										\
-      case FP_CLS_NORMAL:							\
-	if (X##_e < 0)								\
-	  {									\
-	    FP_SET_EXCEPTION(FP_EX_INEXACT);					\
-	  case FP_CLS_ZERO:							\
-	    r = 0;								\
-	  }									\
-	else if (X##_e >= rsize - (rsigned > 0 || X##_s)			\
-		 || (!rsigned && X##_s))					\
-	  {	/* overflow */							\
-	  case FP_CLS_NAN:                                                      \
-	  case FP_CLS_INF:							\
-	    if (rsigned = 2)							\
-	      {									\
-		if (X##_c != FP_CLS_NORMAL					\
-		    || X##_e >= rsize - 1 + _FP_WFRACBITS_##fs)			\
-		  r = 0;							\
-		else								\
-		  {								\
-		    _FP_FRAC_SLL_##wc(X, (X##_e - _FP_WFRACBITS_##fs + 1));	\
-		    _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);			\
-		  }								\
-	      }									\
-	    else if (rsigned)							\
-	      {									\
-		r = 1;								\
-		r <<= rsize - 1;						\
-		r -= 1 - X##_s;							\
-	      }									\
-	    else								\
-	      {									\
-		r = 0;								\
-		if (!X##_s)							\
-		  r = ~r;							\
-	      }									\
-	    FP_SET_EXCEPTION(FP_EX_INVALID);					\
-	  }									\
-	else									\
-	  {									\
-	    if (_FP_W_TYPE_SIZE*wc < rsize)					\
-	      {									\
-		_FP_FRAC_ASSEMBLE_##wc(r, X, rsize);				\
-		r <<= X##_e - _FP_WFRACBITS_##fs;				\
-	      }									\
-	    else								\
-	      {									\
-		if (X##_e >= _FP_WFRACBITS_##fs)				\
-		  _FP_FRAC_SLL_##wc(X, (X##_e - _FP_WFRACBITS_##fs + 1));	\
-		else if (X##_e < _FP_WFRACBITS_##fs - 1)			\
-		  {								\
-		    _FP_FRAC_SRS_##wc(X, (_FP_WFRACBITS_##fs - X##_e - 2),	\
-				      _FP_WFRACBITS_##fs);			\
-		    if (_FP_FRAC_LOW_##wc(X) & 1)				\
-		      FP_SET_EXCEPTION(FP_EX_INEXACT);				\
-		    _FP_FRAC_SRL_##wc(X, 1);					\
-		  }								\
-		_FP_FRAC_ASSEMBLE_##wc(r, X, rsize);				\
-	      }									\
-	    if (rsigned && X##_s)						\
-	      r = -r;								\
-	  }									\
-	break;									\
-      }										\
-  } while (0)
-
-#define _FP_TO_INT_ROUND(fs, wc, r, X, rsize, rsigned)				\
-  do {										\
-    r = 0;									\
-    switch (X##_c)								\
-      {										\
-      case FP_CLS_NORMAL:							\
-	if (X##_e >= _FP_FRACBITS_##fs - 1)					\
-	  {									\
-	    if (X##_e < rsize - 1 + _FP_WFRACBITS_##fs)				\
-	      {									\
-		if (X##_e >= _FP_WFRACBITS_##fs - 1)				\
-		  {								\
-		    _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);			\
-		    r <<= X##_e - _FP_WFRACBITS_##fs + 1;			\
-		  }								\
-		else								\
-		  {								\
-		    _FP_FRAC_SRL_##wc(X, _FP_WORKBITS - X##_e			\
-				      + _FP_FRACBITS_##fs - 1);			\
-		    _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);			\
-		  }								\
-	      }									\
-	  }									\
-	else									\
-	  {									\
-	    int _lz0, _lz1;							\
-	    if (X##_e <= -_FP_WORKBITS - 1)					\
-	      _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc);				\
-	    else								\
-	      _FP_FRAC_SRS_##wc(X, _FP_FRACBITS_##fs - 1 - X##_e,		\
-				_FP_WFRACBITS_##fs);				\
-	    _FP_FRAC_CLZ_##wc(_lz0, X);						\
-	    _FP_ROUND(wc, X);							\
-	    _FP_FRAC_CLZ_##wc(_lz1, X);						\
-	    if (_lz1 < _lz0)							\
-	      X##_e++; /* For overflow detection.  */				\
-	    _FP_FRAC_SRL_##wc(X, _FP_WORKBITS);					\
-	    _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);				\
-	  }									\
-	if (rsigned && X##_s)							\
-	  r = -r;								\
-	if (X##_e >= rsize - (rsigned > 0 || X##_s)				\
-	    || (!rsigned && X##_s))						\
-	  {	/* overflow */							\
-	  case FP_CLS_NAN:                                                      \
-	  case FP_CLS_INF:							\
-	    if (!rsigned)							\
-	      {									\
-		r = 0;								\
-		if (!X##_s)							\
-		  r = ~r;							\
-	      }									\
-	    else if (rsigned != 2)						\
-	      {									\
-		r = 1;								\
-		r <<= rsize - 1;						\
-		r -= 1 - X##_s;							\
-	      }									\
-	    FP_SET_EXCEPTION(FP_EX_INVALID);					\
-	  }									\
-	break;									\
-      case FP_CLS_ZERO:								\
-        break;									\
-      }										\
-  } while (0)
+   0:  the number is required to be 0..(2^rsize)-1, if not, NV is set plus
+       the result is either 0 or (2^rsize)-1 depending on the sign in such
+       case.
+   1:  the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not,
+       NV is set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1
+       depending on the sign in such case.
+   2:  the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not,
+       NV is set plus the result is reduced modulo 2^rsize.
+   -1: the number is required to be -(2^(rsize-1))..(2^rsize)-1, if not, NV is
+       set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1
+       depending on the sign in such case.  */
+#define _FP_TO_INT(fs, wc, r, X, rsize, rsigned)			\
+  do									\
+    {									\
+      if (X##_e < _FP_EXPBIAS_##fs)					\
+	{								\
+	  (r) = 0;							\
+	  if (X##_e = 0)						\
+	    {								\
+	      if (!_FP_FRAC_ZEROP_##wc (X))				\
+		{							\
+		  if (!FP_DENORM_ZERO)					\
+		    FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		}							\
+	    }								\
+	  else								\
+	    FP_SET_EXCEPTION (FP_EX_INEXACT);				\
+	}								\
+      else if ((rsigned) = 2						\
+	       && (X##_e						\
+		   >= ((_FP_EXPMAX_##fs					\
+			< _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs + (rsize) - 1) \
+		       ? _FP_EXPMAX_##fs				\
+		       : _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs + (rsize) - 1))) \
+	{								\
+	  /* Overflow resulting in 0.  */				\
+	  (r) = 0;							\
+	  FP_SET_EXCEPTION (FP_EX_INVALID				\
+			    | FP_EX_INVALID_CVI				\
+			    | ((FP_EX_INVALID_SNAN			\
+				&& _FP_ISSIGNAN (fs, wc, X))		\
+			       ? FP_EX_INVALID_SNAN			\
+			       : 0));					\
+	}								\
+      else if ((rsigned) != 2						\
+	       && (X##_e >= (_FP_EXPMAX_##fs < _FP_EXPBIAS_##fs + (rsize) \
+			     ? _FP_EXPMAX_##fs				\
+			     : (_FP_EXPBIAS_##fs + (rsize)		\
+				- ((rsigned) > 0 || X##_s)))		\
+		   || (!(rsigned) && X##_s)))				\
+	{								\
+	  /* Overflow or converting to the most negative integer.  */	\
+	  if (rsigned)							\
+	    {								\
+	      (r) = 1;							\
+	      (r) <<= (rsize) - 1;					\
+	      (r) -= 1 - X##_s;						\
+	    }								\
+	  else								\
+	    {								\
+	      (r) = 0;							\
+	      if (!X##_s)						\
+		(r) = ~(r);						\
+	    }								\
+									\
+	  if (_FP_EXPBIAS_##fs + (rsize) - 1 < _FP_EXPMAX_##fs		\
+	      && (rsigned)						\
+	      && X##_s							\
+	      && X##_e = _FP_EXPBIAS_##fs + (rsize) - 1)		\
+	    {								\
+	      /* Possibly converting to most negative integer; check the \
+		 mantissa.  */						\
+	      int _FP_TO_INT_inexact = 0;				\
+	      (void) ((_FP_FRACBITS_##fs > (rsize))			\
+		      ? ({						\
+			  _FP_FRAC_SRST_##wc (X, _FP_TO_INT_inexact,	\
+					      _FP_FRACBITS_##fs - (rsize), \
+					      _FP_FRACBITS_##fs);	\
+			  0;						\
+			})						\
+		      : 0);						\
+	      if (!_FP_FRAC_ZEROP_##wc (X))				\
+		FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+	      else if (_FP_TO_INT_inexact)				\
+		FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+	    }								\
+	  else								\
+	    FP_SET_EXCEPTION (FP_EX_INVALID				\
+			      | FP_EX_INVALID_CVI			\
+			      | ((FP_EX_INVALID_SNAN			\
+				  && _FP_ISSIGNAN (fs, wc, X))		\
+				 ? FP_EX_INVALID_SNAN			\
+				 : 0));					\
+	}								\
+      else								\
+	{								\
+	  int _FP_TO_INT_inexact = 0;					\
+	  _FP_FRAC_HIGH_RAW_##fs (X) |= _FP_IMPLBIT_##fs;		\
+	  if (X##_e >= _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs - 1)	\
+	    {								\
+	      _FP_FRAC_ASSEMBLE_##wc ((r), X, (rsize));			\
+	      (r) <<= X##_e - _FP_EXPBIAS_##fs - _FP_FRACBITS_##fs + 1; \
+	    }								\
+	  else								\
+	    {								\
+	      _FP_FRAC_SRST_##wc (X, _FP_TO_INT_inexact,		\
+				  (_FP_FRACBITS_##fs + _FP_EXPBIAS_##fs - 1 \
+				   - X##_e),				\
+				  _FP_FRACBITS_##fs);			\
+	      _FP_FRAC_ASSEMBLE_##wc ((r), X, (rsize));			\
+	    }								\
+	  if ((rsigned) && X##_s)					\
+	    (r) = -(r);							\
+	  if ((rsigned) = 2 && X##_e >= _FP_EXPBIAS_##fs + (rsize) - 1) \
+	    {								\
+	      /* Overflow or converting to the most negative integer.  */ \
+	      if (X##_e > _FP_EXPBIAS_##fs + (rsize) - 1		\
+		  || !X##_s						\
+		  || (r) != (((typeof (r)) 1) << ((rsize) - 1)))	\
+		{							\
+		  _FP_TO_INT_inexact = 0;				\
+		  FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+		}							\
+	    }								\
+	  if (_FP_TO_INT_inexact)					\
+	    FP_SET_EXCEPTION (FP_EX_INEXACT);				\
+	}								\
+    }									\
+  while (0)
+
+/* Convert from floating point to integer, rounding according to the
+   current rounding direction.  Input is raw.  RSIGNED is as for
+   _FP_TO_INT.  */
+#define _FP_TO_INT_ROUND(fs, wc, r, X, rsize, rsigned)			\
+  do									\
+    {									\
+      __label__ _FP_TO_INT_ROUND_done;					\
+      if (X##_e < _FP_EXPBIAS_##fs)					\
+	{								\
+	  int _FP_TO_INT_ROUND_rounds_away = 0;				\
+	  if (X##_e = 0)						\
+	    {								\
+	      if (_FP_FRAC_ZEROP_##wc (X))				\
+		{							\
+		  (r) = 0;						\
+		  goto _FP_TO_INT_ROUND_done;				\
+		}							\
+	      else							\
+		{							\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		  if (FP_DENORM_ZERO)					\
+		    {							\
+		      (r) = 0;						\
+		      goto _FP_TO_INT_ROUND_done;			\
+		    }							\
+		}							\
+	    }								\
+	  /* The result is 0, 1 or -1 depending on the rounding mode;	\
+	     -1 may cause overflow in the unsigned case.  */		\
+	  switch (FP_ROUNDMODE)						\
+	    {								\
+	    case FP_RND_NEAREST:					\
+	      _FP_TO_INT_ROUND_rounds_away				\
+		= (X##_e = _FP_EXPBIAS_##fs - 1			\
+		   && !_FP_FRAC_ZEROP_##wc (X));			\
+	      break;							\
+	    case FP_RND_ZERO:						\
+	      /* _FP_TO_INT_ROUND_rounds_away is already 0.  */		\
+	      break;							\
+	    case FP_RND_PINF:						\
+	      _FP_TO_INT_ROUND_rounds_away = !X##_s;			\
+	      break;							\
+	    case FP_RND_MINF:						\
+	      _FP_TO_INT_ROUND_rounds_away = X##_s;			\
+	      break;							\
+	    }								\
+	  if ((rsigned) = 0 && _FP_TO_INT_ROUND_rounds_away && X##_s)	\
+	    {								\
+	      /* Result of -1 for an unsigned conversion.  */		\
+	      (r) = 0;							\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+	    }								\
+	  else if ((rsize) = 1 && (rsigned) > 0			\
+		   && _FP_TO_INT_ROUND_rounds_away && !X##_s)		\
+	    {								\
+	      /* Converting to a 1-bit signed bit-field, which cannot	\
+		 represent +1.  */					\
+	      (r) = ((rsigned) = 2 ? -1 : 0);				\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+	    }								\
+	  else								\
+	    {								\
+	      (r) = (_FP_TO_INT_ROUND_rounds_away			\
+		     ? (X##_s ? -1 : 1)					\
+		     : 0);						\
+	      FP_SET_EXCEPTION (FP_EX_INEXACT);				\
+	    }								\
+	}								\
+      else if ((rsigned) = 2						\
+	       && (X##_e						\
+		   >= ((_FP_EXPMAX_##fs					\
+			< _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs + (rsize) - 1) \
+		       ? _FP_EXPMAX_##fs				\
+		       : _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs + (rsize) - 1))) \
+	{								\
+	  /* Overflow resulting in 0.  */				\
+	  (r) = 0;							\
+	  FP_SET_EXCEPTION (FP_EX_INVALID				\
+			    | FP_EX_INVALID_CVI				\
+			    | ((FP_EX_INVALID_SNAN			\
+				&& _FP_ISSIGNAN (fs, wc, X))		\
+			       ? FP_EX_INVALID_SNAN			\
+			       : 0));					\
+	}								\
+      else if ((rsigned) != 2						\
+	       && (X##_e >= (_FP_EXPMAX_##fs < _FP_EXPBIAS_##fs + (rsize) \
+			     ? _FP_EXPMAX_##fs				\
+			     : (_FP_EXPBIAS_##fs + (rsize)		\
+				- ((rsigned) > 0 && !X##_s)))		\
+		   || ((rsigned) = 0 && X##_s)))			\
+	{								\
+	  /* Definite overflow (does not require rounding to tell).  */	\
+	  if ((rsigned) != 0)						\
+	    {								\
+	      (r) = 1;							\
+	      (r) <<= (rsize) - 1;					\
+	      (r) -= 1 - X##_s;						\
+	    }								\
+	  else								\
+	    {								\
+	      (r) = 0;							\
+	      if (!X##_s)						\
+		(r) = ~(r);						\
+	    }								\
+									\
+	  FP_SET_EXCEPTION (FP_EX_INVALID				\
+			    | FP_EX_INVALID_CVI				\
+			    | ((FP_EX_INVALID_SNAN			\
+				&& _FP_ISSIGNAN (fs, wc, X))		\
+			       ? FP_EX_INVALID_SNAN			\
+			       : 0));					\
+	}								\
+      else								\
+	{								\
+	  /* The value is finite, with magnitude at least 1.  If	\
+	     the conversion is unsigned, the value is positive.		\
+	     If RSIGNED is not 2, the value does not definitely		\
+	     overflow by virtue of its exponent, but may still turn	\
+	     out to overflow after rounding; if RSIGNED is 2, the	\
+	     exponent may be such that the value definitely overflows,	\
+	     but at least one mantissa bit will not be shifted out.  */ \
+	  int _FP_TO_INT_ROUND_inexact = 0;				\
+	  _FP_FRAC_HIGH_RAW_##fs (X) |= _FP_IMPLBIT_##fs;		\
+	  if (X##_e >= _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs - 1)	\
+	    {								\
+	      /* The value is an integer, no rounding needed.  */	\
+	      _FP_FRAC_ASSEMBLE_##wc ((r), X, (rsize));			\
+	      (r) <<= X##_e - _FP_EXPBIAS_##fs - _FP_FRACBITS_##fs + 1; \
+	    }								\
+	  else								\
+	    {								\
+	      /* May need to shift in order to round (unless there	\
+		 are exactly _FP_WORKBITS fractional bits already).  */	\
+	      int _FP_TO_INT_ROUND_rshift				\
+		= (_FP_FRACBITS_##fs + _FP_EXPBIAS_##fs			\
+		   - 1 - _FP_WORKBITS - X##_e);				\
+	      if (_FP_TO_INT_ROUND_rshift > 0)				\
+		_FP_FRAC_SRS_##wc (X, _FP_TO_INT_ROUND_rshift,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (_FP_TO_INT_ROUND_rshift < 0)			\
+		_FP_FRAC_SLL_##wc (X, -_FP_TO_INT_ROUND_rshift);	\
+	      /* Round like _FP_ROUND, but setting			\
+		 _FP_TO_INT_ROUND_inexact instead of directly setting	\
+		 the "inexact" exception, since it may turn out we	\
+		 should set "invalid" instead.  */			\
+	      if (_FP_FRAC_LOW_##wc (X) & 7)				\
+		{							\
+		  _FP_TO_INT_ROUND_inexact = 1;				\
+		  switch (FP_ROUNDMODE)					\
+		    {							\
+		    case FP_RND_NEAREST:				\
+		      _FP_ROUND_NEAREST (wc, X);			\
+		      break;						\
+		    case FP_RND_ZERO:					\
+		      _FP_ROUND_ZERO (wc, X);				\
+		      break;						\
+		    case FP_RND_PINF:					\
+		      _FP_ROUND_PINF (wc, X);				\
+		      break;						\
+		    case FP_RND_MINF:					\
+		      _FP_ROUND_MINF (wc, X);				\
+		      break;						\
+		    }							\
+		}							\
+	      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);			\
+	      _FP_FRAC_ASSEMBLE_##wc ((r), X, (rsize));			\
+	    }								\
+	  if ((rsigned) != 0 && X##_s)					\
+	    (r) = -(r);							\
+	  /* An exponent of RSIZE - 1 always needs testing for		\
+	     overflow (either directly overflowing, or overflowing	\
+	     when rounding up results in 2^RSIZE).  An exponent of	\
+	     RSIZE - 2 can overflow for positive values when rounding	\
+	     up to 2^(RSIZE-1), but cannot overflow for negative	\
+	     values.  Smaller exponents cannot overflow.  */		\
+	  if (X##_e >= (_FP_EXPBIAS_##fs + (rsize) - 1			\
+			- ((rsigned) > 0 && !X##_s)))			\
+	    {								\
+	      if (X##_e > _FP_EXPBIAS_##fs + (rsize) - 1		\
+		  || (X##_e = _FP_EXPBIAS_##fs + (rsize) - 1		\
+		      && (X##_s						\
+			  ? (r) != (((typeof (r)) 1) << ((rsize) - 1))	\
+			  : ((rsigned) > 0 || (r) = 0)))		\
+		  || ((rsigned) > 0					\
+		      && !X##_s						\
+		      && X##_e = _FP_EXPBIAS_##fs + (rsize) - 2	\
+		      && (r) = (((typeof (r)) 1) << ((rsize) - 1))))	\
+		{							\
+		  if ((rsigned) != 2)					\
+		    {							\
+		      if ((rsigned) != 0)				\
+			{						\
+			  (r) = 1;					\
+			  (r) <<= (rsize) - 1;				\
+			  (r) -= 1 - X##_s;				\
+			}						\
+		      else						\
+			{						\
+			  (r) = 0;					\
+			  (r) = ~(r);					\
+			}						\
+		    }							\
+		  _FP_TO_INT_ROUND_inexact = 0;				\
+		  FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+		}							\
+	    }								\
+	  if (_FP_TO_INT_ROUND_inexact)					\
+	    FP_SET_EXCEPTION (FP_EX_INEXACT);				\
+	}								\
+    _FP_TO_INT_ROUND_done: ;						\
+    }									\
+  while (0)
 
+/* Convert integer to fp.  Output is raw.  RTYPE is unsigned even if
+   input is signed.  */
 #define _FP_FROM_INT(fs, wc, X, r, rsize, rtype)			\
-  do {									\
-    if (r)								\
-      {									\
-        unsigned rtype ur_;						\
-	X##_c = FP_CLS_NORMAL;						\
-									\
-	if ((X##_s = (r < 0)))						\
-	  ur_ = (unsigned rtype) -r;					\
-	else								\
-	  ur_ = (unsigned rtype) r;					\
-	if (rsize <= _FP_W_TYPE_SIZE)					\
-	  __FP_CLZ(X##_e, ur_);						\
-	else								\
-	  __FP_CLZ_2(X##_e, (_FP_W_TYPE)(ur_ >> _FP_W_TYPE_SIZE), 	\
-		     (_FP_W_TYPE)ur_);					\
-	if (rsize < _FP_W_TYPE_SIZE)					\
-		X##_e -= (_FP_W_TYPE_SIZE - rsize);			\
-	X##_e = rsize - X##_e - 1;					\
-									\
-	if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs <= X##_e)	\
-	  __FP_FRAC_SRS_1(ur_, (X##_e - _FP_WFRACBITS_##fs + 1), rsize);\
-	_FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize);			\
-	if ((_FP_WFRACBITS_##fs - X##_e - 1) > 0)			\
-	  _FP_FRAC_SLL_##wc(X, (_FP_WFRACBITS_##fs - X##_e - 1));	\
-      }									\
-    else								\
-      {									\
-	X##_c = FP_CLS_ZERO, X##_s = 0;					\
-      }									\
-  } while (0)
-
-
-#define FP_CONV(dfs,sfs,dwc,swc,D,S)			\
-  do {							\
-    _FP_FRAC_CONV_##dwc##_##swc(dfs, sfs, D, S);	\
-    D##_e = S##_e;					\
-    D##_c = S##_c;					\
-    D##_s = S##_s;					\
-  } while (0)
-
-/*
- * Helper primitives.
- */
+  do									\
+    {									\
+      __label__ pack_semiraw;						\
+      if (r)								\
+	{								\
+	  rtype _FP_FROM_INT_ur;					\
+									\
+	  if ((X##_s = ((r) < 0)))					\
+	    (r) = -(rtype) (r);						\
+									\
+	  _FP_FROM_INT_ur = (rtype) (r);				\
+	  (void) (((rsize) <= _FP_W_TYPE_SIZE)				\
+		  ? ({							\
+		      int _FP_FROM_INT_lz;				\
+		      __FP_CLZ (_FP_FROM_INT_lz,			\
+				(_FP_W_TYPE) _FP_FROM_INT_ur);		\
+		      X##_e = (_FP_EXPBIAS_##fs + _FP_W_TYPE_SIZE - 1	\
+			       - _FP_FROM_INT_lz);			\
+		    })							\
+		  : (((rsize) <= 2 * _FP_W_TYPE_SIZE)			\
+		     ? ({						\
+			 int _FP_FROM_INT_lz;				\
+			 __FP_CLZ_2 (_FP_FROM_INT_lz,			\
+				     (_FP_W_TYPE) (_FP_FROM_INT_ur	\
+						   >> _FP_W_TYPE_SIZE), \
+				     (_FP_W_TYPE) _FP_FROM_INT_ur);	\
+			 X##_e = (_FP_EXPBIAS_##fs + 2 * _FP_W_TYPE_SIZE - 1 \
+				  - _FP_FROM_INT_lz);			\
+		       })						\
+		     : (abort (), 0)));					\
+									\
+	  if ((rsize) - 1 + _FP_EXPBIAS_##fs >= _FP_EXPMAX_##fs		\
+	      && X##_e >= _FP_EXPMAX_##fs)				\
+	    {								\
+	      /* Exponent too big; overflow to infinity.  (May also	\
+		 happen after rounding below.)  */			\
+	      _FP_OVERFLOW_SEMIRAW (fs, wc, X);				\
+	      goto pack_semiraw;					\
+	    }								\
+									\
+	  if ((rsize) <= _FP_FRACBITS_##fs				\
+	      || X##_e < _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs)		\
+	    {								\
+	      /* Exactly representable; shift left.  */			\
+	      _FP_FRAC_DISASSEMBLE_##wc (X, _FP_FROM_INT_ur, (rsize));	\
+	      if (_FP_EXPBIAS_##fs + _FP_FRACBITS_##fs - 1 - X##_e > 0)	\
+		_FP_FRAC_SLL_##wc (X, (_FP_EXPBIAS_##fs			\
+				       + _FP_FRACBITS_##fs - 1 - X##_e)); \
+	    }								\
+	  else								\
+	    {								\
+	      /* More bits in integer than in floating type; need to	\
+		 round.  */						\
+	      if (_FP_EXPBIAS_##fs + _FP_WFRACBITS_##fs - 1 < X##_e)	\
+		_FP_FROM_INT_ur						\
+		  = ((_FP_FROM_INT_ur >> (X##_e - _FP_EXPBIAS_##fs	\
+					  - _FP_WFRACBITS_##fs + 1))	\
+		     | ((_FP_FROM_INT_ur				\
+			 << ((rsize) - (X##_e - _FP_EXPBIAS_##fs	\
+					- _FP_WFRACBITS_##fs + 1)))	\
+			!= 0));						\
+	      _FP_FRAC_DISASSEMBLE_##wc (X, _FP_FROM_INT_ur, (rsize));	\
+	      if ((_FP_EXPBIAS_##fs + _FP_WFRACBITS_##fs - 1 - X##_e) > 0) \
+		_FP_FRAC_SLL_##wc (X, (_FP_EXPBIAS_##fs			\
+				       + _FP_WFRACBITS_##fs - 1 - X##_e)); \
+	      _FP_FRAC_HIGH_##fs (X) &= ~(_FP_W_TYPE) _FP_IMPLBIT_SH_##fs; \
+	    pack_semiraw:						\
+	      _FP_PACK_SEMIRAW (fs, wc, X);				\
+	    }								\
+	}								\
+      else								\
+	{								\
+	  X##_s = 0;							\
+	  X##_e = 0;							\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);			\
+	}								\
+    }									\
+  while (0)
+
+
+/* Extend from a narrower floating-point format to a wider one.  Input
+   and output are raw.  If CHECK_NAN, then signaling NaNs are
+   converted to quiet with the "invalid" exception raised; otherwise
+   signaling NaNs remain signaling with no exception.  */
+#define _FP_EXTEND_CNAN(dfs, sfs, dwc, swc, D, S, check_nan)		\
+  do									\
+    {									\
+      if (_FP_FRACBITS_##dfs < _FP_FRACBITS_##sfs			\
+	  || (_FP_EXPMAX_##dfs - _FP_EXPBIAS_##dfs			\
+	      < _FP_EXPMAX_##sfs - _FP_EXPBIAS_##sfs)			\
+	  || (_FP_EXPBIAS_##dfs < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1 \
+	      && _FP_EXPBIAS_##dfs != _FP_EXPBIAS_##sfs))		\
+	abort ();							\
+      D##_s = S##_s;							\
+      _FP_FRAC_COPY_##dwc##_##swc (D, S);				\
+      if (_FP_EXP_NORMAL (sfs, swc, S))					\
+	{								\
+	  D##_e = S##_e + _FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs;	\
+	  _FP_FRAC_SLL_##dwc (D, (_FP_FRACBITS_##dfs - _FP_FRACBITS_##sfs)); \
+	}								\
+      else								\
+	{								\
+	  if (S##_e = 0)						\
+	    {								\
+	      _FP_CHECK_FLUSH_ZERO (sfs, swc, S);			\
+	      if (_FP_FRAC_ZEROP_##swc (S))				\
+		D##_e = 0;						\
+	      else if (_FP_EXPBIAS_##dfs				\
+		       < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1)	\
+		{							\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		  _FP_FRAC_SLL_##dwc (D, (_FP_FRACBITS_##dfs		\
+					  - _FP_FRACBITS_##sfs));	\
+		  D##_e = 0;						\
+		  if (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)		\
+		    FP_SET_EXCEPTION (FP_EX_UNDERFLOW);			\
+		}							\
+	      else							\
+		{							\
+		  int FP_EXTEND_lz;					\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		  _FP_FRAC_CLZ_##swc (FP_EXTEND_lz, S);			\
+		  _FP_FRAC_SLL_##dwc (D,				\
+				      FP_EXTEND_lz + _FP_FRACBITS_##dfs	\
+				      - _FP_FRACTBITS_##sfs);		\
+		  D##_e = (_FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs + 1	\
+			   + _FP_FRACXBITS_##sfs - FP_EXTEND_lz);	\
+		}							\
+	    }								\
+	  else								\
+	    {								\
+	      D##_e = _FP_EXPMAX_##dfs;					\
+	      if (!_FP_FRAC_ZEROP_##swc (S))				\
+		{							\
+		  if (check_nan && _FP_FRAC_SNANP (sfs, S))		\
+		    FP_SET_EXCEPTION (FP_EX_INVALID			\
+				      | FP_EX_INVALID_SNAN);		\
+		  _FP_FRAC_SLL_##dwc (D, (_FP_FRACBITS_##dfs		\
+					  - _FP_FRACBITS_##sfs));	\
+		  if (check_nan)					\
+		    _FP_SETQNAN (dfs, dwc, D);				\
+		}							\
+	    }								\
+	}								\
+    }									\
+  while (0)
+
+#define FP_EXTEND(dfs, sfs, dwc, swc, D, S)		\
+    _FP_EXTEND_CNAN (dfs, sfs, dwc, swc, D, S, 1)
+
+/* Truncate from a wider floating-point format to a narrower one.
+   Input and output are semi-raw.  */
+#define FP_TRUNC(dfs, sfs, dwc, swc, D, S)				\
+  do									\
+    {									\
+      if (_FP_FRACBITS_##sfs < _FP_FRACBITS_##dfs			\
+	  || (_FP_EXPBIAS_##sfs < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1 \
+	      && _FP_EXPBIAS_##sfs != _FP_EXPBIAS_##dfs))		\
+	abort ();							\
+      D##_s = S##_s;							\
+      if (_FP_EXP_NORMAL (sfs, swc, S))					\
+	{								\
+	  D##_e = S##_e + _FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs;	\
+	  if (D##_e >= _FP_EXPMAX_##dfs)				\
+	    _FP_OVERFLOW_SEMIRAW (dfs, dwc, D);				\
+	  else								\
+	    {								\
+	      if (D##_e <= 0)						\
+		{							\
+		  if (D##_e < 1 - _FP_FRACBITS_##dfs)			\
+		    {							\
+		      _FP_FRAC_SET_##swc (S, _FP_ZEROFRAC_##swc);	\
+		      _FP_FRAC_LOW_##swc (S) |= 1;			\
+		    }							\
+		  else							\
+		    {							\
+		      _FP_FRAC_HIGH_##sfs (S) |= _FP_IMPLBIT_SH_##sfs;	\
+		      _FP_FRAC_SRS_##swc (S, (_FP_WFRACBITS_##sfs	\
+					      - _FP_WFRACBITS_##dfs	\
+					      + 1 - D##_e),		\
+					  _FP_WFRACBITS_##sfs);		\
+		    }							\
+		  D##_e = 0;						\
+		}							\
+	      else							\
+		_FP_FRAC_SRS_##swc (S, (_FP_WFRACBITS_##sfs		\
+					- _FP_WFRACBITS_##dfs),		\
+				    _FP_WFRACBITS_##sfs);		\
+	      _FP_FRAC_COPY_##dwc##_##swc (D, S);			\
+	    }								\
+	}								\
+      else								\
+	{								\
+	  if (S##_e = 0)						\
+	    {								\
+	      _FP_CHECK_FLUSH_ZERO (sfs, swc, S);			\
+	      D##_e = 0;						\
+	      if (_FP_FRAC_ZEROP_##swc (S))				\
+		_FP_FRAC_SET_##dwc (D, _FP_ZEROFRAC_##dwc);		\
+	      else							\
+		{							\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		  if (_FP_EXPBIAS_##sfs					\
+		      < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1)	\
+		    {							\
+		      _FP_FRAC_SRS_##swc (S, (_FP_WFRACBITS_##sfs	\
+					      - _FP_WFRACBITS_##dfs),	\
+					  _FP_WFRACBITS_##sfs);		\
+		      _FP_FRAC_COPY_##dwc##_##swc (D, S);		\
+		    }							\
+		  else							\
+		    {							\
+		      _FP_FRAC_SET_##dwc (D, _FP_ZEROFRAC_##dwc);	\
+		      _FP_FRAC_LOW_##dwc (D) |= 1;			\
+		    }							\
+		}							\
+	    }								\
+	  else								\
+	    {								\
+	      D##_e = _FP_EXPMAX_##dfs;					\
+	      if (_FP_FRAC_ZEROP_##swc (S))				\
+		_FP_FRAC_SET_##dwc (D, _FP_ZEROFRAC_##dwc);		\
+	      else							\
+		{							\
+		  _FP_CHECK_SIGNAN_SEMIRAW (sfs, swc, S);		\
+		  _FP_FRAC_SRL_##swc (S, (_FP_WFRACBITS_##sfs		\
+					  - _FP_WFRACBITS_##dfs));	\
+		  _FP_FRAC_COPY_##dwc##_##swc (D, S);			\
+		  /* Semi-raw NaN must have all workbits cleared.  */	\
+		  _FP_FRAC_LOW_##dwc (D)				\
+		    &= ~(_FP_W_TYPE) ((1 << _FP_WORKBITS) - 1);		\
+		  _FP_SETQNAN_SEMIRAW (dfs, dwc, D);			\
+		}							\
+	    }								\
+	}								\
+    }									\
+  while (0)
+
+/* Helper primitives.  */
 
 /* Count leading zeros in a word.  */
 
 #ifndef __FP_CLZ
-#if _FP_W_TYPE_SIZE < 64
-/* this is just to shut the compiler up about shifts > word length -- PMM 02/1998 */
-#define __FP_CLZ(r, x)				\
-  do {						\
-    _FP_W_TYPE _t = (x);			\
-    r = _FP_W_TYPE_SIZE - 1;			\
-    if (_t > 0xffff) r -= 16;			\
-    if (_t > 0xffff) _t >>= 16;			\
-    if (_t > 0xff) r -= 8;			\
-    if (_t > 0xff) _t >>= 8;			\
-    if (_t & 0xf0) r -= 4;			\
-    if (_t & 0xf0) _t >>= 4;			\
-    if (_t & 0xc) r -= 2;			\
-    if (_t & 0xc) _t >>= 2;			\
-    if (_t & 0x2) r -= 1;			\
-  } while (0)
-#else /* not _FP_W_TYPE_SIZE < 64 */
-#define __FP_CLZ(r, x)				\
-  do {						\
-    _FP_W_TYPE _t = (x);			\
-    r = _FP_W_TYPE_SIZE - 1;			\
-    if (_t > 0xffffffff) r -= 32;		\
-    if (_t > 0xffffffff) _t >>= 32;		\
-    if (_t > 0xffff) r -= 16;			\
-    if (_t > 0xffff) _t >>= 16;			\
-    if (_t > 0xff) r -= 8;			\
-    if (_t > 0xff) _t >>= 8;			\
-    if (_t & 0xf0) r -= 4;			\
-    if (_t & 0xf0) _t >>= 4;			\
-    if (_t & 0xc) r -= 2;			\
-    if (_t & 0xc) _t >>= 2;			\
-    if (_t & 0x2) r -= 1;			\
-  } while (0)
-#endif /* not _FP_W_TYPE_SIZE < 64 */
+/* GCC 3.4 and later provide the builtins for us.  */
+# define __FP_CLZ(r, x)							\
+  do									\
+    {									\
+      if (sizeof (_FP_W_TYPE) = sizeof (unsigned int))			\
+	(r) = __builtin_clz (x);					\
+      else if (sizeof (_FP_W_TYPE) = sizeof (unsigned long))		\
+	(r) = __builtin_clzl (x);					\
+      else if (sizeof (_FP_W_TYPE) = sizeof (unsigned long long))	\
+	(r) = __builtin_clzll (x);					\
+      else								\
+	abort ();							\
+    }									\
+  while (0)
 #endif /* ndef __FP_CLZ */
 
 #define _FP_DIV_HELP_imm(q, r, n, d)		\
-  do {						\
-    q = n / d, r = n % d;			\
-  } while (0)
+  do						\
+    {						\
+      (q) = (n) / (d), (r) = (n) % (d);		\
+    }						\
+  while (0)
+
+
+/* A restoring bit-by-bit division primitive.  */
+
+#define _FP_DIV_MEAT_N_loop(fs, wc, R, X, Y)				\
+  do									\
+    {									\
+      int _FP_DIV_MEAT_N_loop_count = _FP_WFRACBITS_##fs;		\
+      _FP_FRAC_DECL_##wc (_FP_DIV_MEAT_N_loop_u);			\
+      _FP_FRAC_DECL_##wc (_FP_DIV_MEAT_N_loop_v);			\
+      _FP_FRAC_COPY_##wc (_FP_DIV_MEAT_N_loop_u, X);			\
+      _FP_FRAC_COPY_##wc (_FP_DIV_MEAT_N_loop_v, Y);			\
+      _FP_FRAC_SET_##wc (R, _FP_ZEROFRAC_##wc);				\
+      /* Normalize _FP_DIV_MEAT_N_LOOP_U and _FP_DIV_MEAT_N_LOOP_V.  */	\
+      _FP_FRAC_SLL_##wc (_FP_DIV_MEAT_N_loop_u, _FP_WFRACXBITS_##fs);	\
+      _FP_FRAC_SLL_##wc (_FP_DIV_MEAT_N_loop_v, _FP_WFRACXBITS_##fs);	\
+      /* First round.  Since the operands are normalized, either the	\
+	 first or second bit will be set in the fraction.  Produce a	\
+	 normalized result by checking which and adjusting the loop	\
+	 count and exponent accordingly.  */				\
+      if (_FP_FRAC_GE_1 (_FP_DIV_MEAT_N_loop_u, _FP_DIV_MEAT_N_loop_v))	\
+	{								\
+	  _FP_FRAC_SUB_##wc (_FP_DIV_MEAT_N_loop_u,			\
+			     _FP_DIV_MEAT_N_loop_u,			\
+			     _FP_DIV_MEAT_N_loop_v);			\
+	  _FP_FRAC_LOW_##wc (R) |= 1;					\
+	  _FP_DIV_MEAT_N_loop_count--;					\
+	}								\
+      else								\
+	R##_e--;							\
+      /* Subsequent rounds.  */						\
+      do								\
+	{								\
+	  int _FP_DIV_MEAT_N_loop_msb					\
+	    = (_FP_WS_TYPE) _FP_FRAC_HIGH_##wc (_FP_DIV_MEAT_N_loop_u) < 0; \
+	  _FP_FRAC_SLL_##wc (_FP_DIV_MEAT_N_loop_u, 1);			\
+	  _FP_FRAC_SLL_##wc (R, 1);					\
+	  if (_FP_DIV_MEAT_N_loop_msb					\
+	      || _FP_FRAC_GE_1 (_FP_DIV_MEAT_N_loop_u,			\
+				_FP_DIV_MEAT_N_loop_v))			\
+	    {								\
+	      _FP_FRAC_SUB_##wc (_FP_DIV_MEAT_N_loop_u,			\
+				 _FP_DIV_MEAT_N_loop_u,			\
+				 _FP_DIV_MEAT_N_loop_v);		\
+	      _FP_FRAC_LOW_##wc (R) |= 1;				\
+	    }								\
+	}								\
+      while (--_FP_DIV_MEAT_N_loop_count > 0);				\
+      /* If there's anything left in _FP_DIV_MEAT_N_LOOP_U, the result	\
+	 is inexact.  */						\
+      _FP_FRAC_LOW_##wc (R)						\
+	|= !_FP_FRAC_ZEROP_##wc (_FP_DIV_MEAT_N_loop_u);		\
+    }									\
+  while (0)
+
+#define _FP_DIV_MEAT_1_loop(fs, R, X, Y)  _FP_DIV_MEAT_N_loop (fs, 1, R, X, Y)
+#define _FP_DIV_MEAT_2_loop(fs, R, X, Y)  _FP_DIV_MEAT_N_loop (fs, 2, R, X, Y)
+#define _FP_DIV_MEAT_4_loop(fs, R, X, Y)  _FP_DIV_MEAT_N_loop (fs, 4, R, X, Y)
 
 #endif /* __MATH_EMU_OP_COMMON_H__ */
diff --git a/include/math-emu/quad.h b/include/math-emu/quad.h
index 6161136..367c86c 100644
--- a/include/math-emu/quad.h
+++ b/include/math-emu/quad.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Definitions for IEEE Quad Precision.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,31 +8,41 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef  __MATH_EMU_QUAD_H__
 #define  __MATH_EMU_QUAD_H__
 
 #if _FP_W_TYPE_SIZE < 32
-#error "Here's a nickel, kid. Go buy yourself a real computer."
+# error "Here's a nickel, kid. Go buy yourself a real computer."
 #endif
 
 #if _FP_W_TYPE_SIZE < 64
-#define _FP_FRACTBITS_Q         (4*_FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_Q	(4*_FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_DW_Q	(8*_FP_W_TYPE_SIZE)
 #else
-#define _FP_FRACTBITS_Q		(2*_FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_Q		(2*_FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_DW_Q	(4*_FP_W_TYPE_SIZE)
 #endif
 
 #define _FP_FRACBITS_Q		113
@@ -44,164 +54,276 @@
 #define _FP_EXPMAX_Q		32767
 
 #define _FP_QNANBIT_Q		\
-	((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-2) % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_Q-2) % _FP_W_TYPE_SIZE)
+#define _FP_QNANBIT_SH_Q		\
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_Q-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
 #define _FP_IMPLBIT_Q		\
-	((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-1) % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_Q-1) % _FP_W_TYPE_SIZE)
+#define _FP_IMPLBIT_SH_Q		\
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_Q-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
 #define _FP_OVERFLOW_Q		\
-	((_FP_W_TYPE)1 << (_FP_WFRACBITS_Q % _FP_W_TYPE_SIZE))
+	((_FP_W_TYPE) 1 << (_FP_WFRACBITS_Q % _FP_W_TYPE_SIZE))
+
+#define _FP_WFRACBITS_DW_Q	(2 * _FP_WFRACBITS_Q)
+#define _FP_WFRACXBITS_DW_Q	(_FP_FRACTBITS_DW_Q - _FP_WFRACBITS_DW_Q)
+#define _FP_HIGHBIT_DW_Q	\
+  ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_DW_Q - 1) % _FP_W_TYPE_SIZE)
+
+typedef float TFtype __attribute__ ((mode (TF)));
 
 #if _FP_W_TYPE_SIZE < 64
 
 union _FP_UNION_Q
 {
-   long double flt;
-   struct 
-   {
-#if __BYTE_ORDER = __BIG_ENDIAN
-      unsigned sign : 1;
-      unsigned exp : _FP_EXPBITS_Q;
-      unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
-      unsigned long frac2 : _FP_W_TYPE_SIZE;
-      unsigned long frac1 : _FP_W_TYPE_SIZE;
-      unsigned long frac0 : _FP_W_TYPE_SIZE;
-#else
-      unsigned long frac0 : _FP_W_TYPE_SIZE;
-      unsigned long frac1 : _FP_W_TYPE_SIZE;
-      unsigned long frac2 : _FP_W_TYPE_SIZE;
-      unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
-      unsigned exp : _FP_EXPBITS_Q;
-      unsigned sign : 1;
-#endif /* not bigendian */
-   } bits __attribute__((packed));
+  TFtype flt;
+  struct _FP_STRUCT_LAYOUT
+  {
+# if __BYTE_ORDER = __BIG_ENDIAN
+    unsigned sign : 1;
+    unsigned exp : _FP_EXPBITS_Q;
+    unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
+    unsigned long frac2 : _FP_W_TYPE_SIZE;
+    unsigned long frac1 : _FP_W_TYPE_SIZE;
+    unsigned long frac0 : _FP_W_TYPE_SIZE;
+# else
+    unsigned long frac0 : _FP_W_TYPE_SIZE;
+    unsigned long frac1 : _FP_W_TYPE_SIZE;
+    unsigned long frac2 : _FP_W_TYPE_SIZE;
+    unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
+    unsigned exp : _FP_EXPBITS_Q;
+    unsigned sign : 1;
+# endif /* not bigendian */
+  } bits __attribute__ ((packed));
 };
 
 
-#define FP_DECL_Q(X)		_FP_DECL(4,X)
-#define FP_UNPACK_RAW_Q(X,val)	_FP_UNPACK_RAW_4(Q,X,val)
-#define FP_UNPACK_RAW_QP(X,val)	_FP_UNPACK_RAW_4_P(Q,X,val)
-#define FP_PACK_RAW_Q(val,X)	_FP_PACK_RAW_4(Q,val,X)
-#define FP_PACK_RAW_QP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_4_P(Q,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_Q(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_4(Q,X,val);		\
-    _FP_UNPACK_CANONICAL(Q,4,X);	\
-  } while (0)
-
-#define FP_UNPACK_QP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_4_P(Q,X,val);	\
-    _FP_UNPACK_CANONICAL(Q,4,X);	\
-  } while (0)
-
-#define FP_PACK_Q(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(Q,4,X);		\
-    _FP_PACK_RAW_4(Q,val,X);		\
-  } while (0)
-
-#define FP_PACK_QP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(Q,4,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_4_P(Q,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN(Q,4,X)
-#define FP_NEG_Q(R,X)			_FP_NEG(Q,4,R,X)
-#define FP_ADD_Q(R,X,Y)			_FP_ADD(Q,4,R,X,Y)
-#define FP_SUB_Q(R,X,Y)			_FP_SUB(Q,4,R,X,Y)
-#define FP_MUL_Q(R,X,Y)			_FP_MUL(Q,4,R,X,Y)
-#define FP_DIV_Q(R,X,Y)			_FP_DIV(Q,4,R,X,Y)
-#define FP_SQRT_Q(R,X)			_FP_SQRT(Q,4,R,X)
-#define _FP_SQRT_MEAT_Q(R,S,T,X,Q)	_FP_SQRT_MEAT_4(R,S,T,X,Q)
-
-#define FP_CMP_Q(r,X,Y,un)	_FP_CMP(Q,4,r,X,Y,un)
-#define FP_CMP_EQ_Q(r,X,Y)	_FP_CMP_EQ(Q,4,r,X,Y)
-
-#define FP_TO_INT_Q(r,X,rsz,rsg)	_FP_TO_INT(Q,4,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_Q(r,X,rsz,rsg)	_FP_TO_INT_ROUND(Q,4,r,X,rsz,rsg)
-#define FP_FROM_INT_Q(X,r,rs,rt)	_FP_FROM_INT(Q,4,X,r,rs,rt)
-
-#define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_4(X)
-#define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_4(X)
+# define FP_DECL_Q(X)		_FP_DECL (4, X)
+# define FP_UNPACK_RAW_Q(X, val)	_FP_UNPACK_RAW_4 (Q, X, (val))
+# define FP_UNPACK_RAW_QP(X, val)	_FP_UNPACK_RAW_4_P (Q, X, (val))
+# define FP_PACK_RAW_Q(val, X)	_FP_PACK_RAW_4 (Q, (val), X)
+# define FP_PACK_RAW_QP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_4_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_Q(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_4 (Q, X, (val));		\
+      _FP_UNPACK_CANONICAL (Q, 4, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_QP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_4_P (Q, X, (val));		\
+      _FP_UNPACK_CANONICAL (Q, 4, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_Q(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_4 (Q, X, (val));		\
+      _FP_UNPACK_SEMIRAW (Q, 4, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_QP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_4_P (Q, X, (val));		\
+      _FP_UNPACK_SEMIRAW (Q, 4, X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_Q(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (Q, 4, X);		\
+      _FP_PACK_RAW_4 (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_QP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (Q, 4, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_4_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_Q(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (Q, 4, X);		\
+      _FP_PACK_RAW_4 (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_QP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (Q, 4, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_4_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN (Q, 4, X)
+# define FP_NEG_Q(R, X)			_FP_NEG (Q, 4, R, X)
+# define FP_ADD_Q(R, X, Y)		_FP_ADD (Q, 4, R, X, Y)
+# define FP_SUB_Q(R, X, Y)		_FP_SUB (Q, 4, R, X, Y)
+# define FP_MUL_Q(R, X, Y)		_FP_MUL (Q, 4, R, X, Y)
+# define FP_DIV_Q(R, X, Y)		_FP_DIV (Q, 4, R, X, Y)
+# define FP_SQRT_Q(R, X)		_FP_SQRT (Q, 4, R, X)
+# define _FP_SQRT_MEAT_Q(R, S, T, X, Q)	_FP_SQRT_MEAT_4 (R, S, T, X, (Q))
+# define FP_FMA_Q(R, X, Y, Z)		_FP_FMA (Q, 4, 8, R, X, Y, Z)
+
+# define FP_CMP_Q(r, X, Y, un, ex)	_FP_CMP (Q, 4, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_Q(r, X, Y, ex)	_FP_CMP_EQ (Q, 4, (r), X, Y, (ex))
+# define FP_CMP_UNORD_Q(r, X, Y, ex)	_FP_CMP_UNORD (Q, 4, (r), X, Y, (ex))
+
+# define FP_TO_INT_Q(r, X, rsz, rsg)	_FP_TO_INT (Q, 4, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_Q(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (Q, 4, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_Q(X, r, rs, rt)	_FP_FROM_INT (Q, 4, X, (r), (rs), rt)
+
+# define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_4 (X)
+# define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_4 (X)
+
+# define _FP_FRAC_HIGH_DW_Q(X)	_FP_FRAC_HIGH_8 (X)
 
 #else   /* not _FP_W_TYPE_SIZE < 64 */
 union _FP_UNION_Q
 {
-  long double flt /* __attribute__((mode(TF))) */ ;
-  struct {
-#if __BYTE_ORDER = __BIG_ENDIAN
-    unsigned sign  : 1;
-    unsigned exp   : _FP_EXPBITS_Q;
-    unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
-    unsigned long frac0 : _FP_W_TYPE_SIZE;
-#else
-    unsigned long frac0 : _FP_W_TYPE_SIZE;
-    unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
-    unsigned exp   : _FP_EXPBITS_Q;
-    unsigned sign  : 1;
-#endif
+  TFtype flt /* __attribute__ ((mode (TF))) */ ;
+  struct _FP_STRUCT_LAYOUT
+  {
+    _FP_W_TYPE a, b;
+  } longs;
+  struct _FP_STRUCT_LAYOUT
+  {
+# if __BYTE_ORDER = __BIG_ENDIAN
+    unsigned sign    : 1;
+    unsigned exp     : _FP_EXPBITS_Q;
+    _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
+    _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
+# else
+    _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
+    _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
+    unsigned exp     : _FP_EXPBITS_Q;
+    unsigned sign    : 1;
+# endif
   } bits;
 };
 
-#define FP_DECL_Q(X)		_FP_DECL(2,X)
-#define FP_UNPACK_RAW_Q(X,val)	_FP_UNPACK_RAW_2(Q,X,val)
-#define FP_UNPACK_RAW_QP(X,val)	_FP_UNPACK_RAW_2_P(Q,X,val)
-#define FP_PACK_RAW_Q(val,X)	_FP_PACK_RAW_2(Q,val,X)
-#define FP_PACK_RAW_QP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_2_P(Q,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_Q(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_2(Q,X,val);		\
-    _FP_UNPACK_CANONICAL(Q,2,X);	\
-  } while (0)
-
-#define FP_UNPACK_QP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_2_P(Q,X,val);	\
-    _FP_UNPACK_CANONICAL(Q,2,X);	\
-  } while (0)
-
-#define FP_PACK_Q(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(Q,2,X);		\
-    _FP_PACK_RAW_2(Q,val,X);		\
-  } while (0)
-
-#define FP_PACK_QP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(Q,2,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_2_P(Q,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN(Q,2,X)
-#define FP_NEG_Q(R,X)			_FP_NEG(Q,2,R,X)
-#define FP_ADD_Q(R,X,Y)			_FP_ADD(Q,2,R,X,Y)
-#define FP_SUB_Q(R,X,Y)			_FP_SUB(Q,2,R,X,Y)
-#define FP_MUL_Q(R,X,Y)			_FP_MUL(Q,2,R,X,Y)
-#define FP_DIV_Q(R,X,Y)			_FP_DIV(Q,2,R,X,Y)
-#define FP_SQRT_Q(R,X)			_FP_SQRT(Q,2,R,X)
-#define _FP_SQRT_MEAT_Q(R,S,T,X,Q)	_FP_SQRT_MEAT_2(R,S,T,X,Q)
-
-#define FP_CMP_Q(r,X,Y,un)	_FP_CMP(Q,2,r,X,Y,un)
-#define FP_CMP_EQ_Q(r,X,Y)	_FP_CMP_EQ(Q,2,r,X,Y)
-
-#define FP_TO_INT_Q(r,X,rsz,rsg)	_FP_TO_INT(Q,2,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_Q(r,X,rsz,rsg)	_FP_TO_INT_ROUND(Q,2,r,X,rsz,rsg)
-#define FP_FROM_INT_Q(X,r,rs,rt)	_FP_FROM_INT(Q,2,X,r,rs,rt)
-
-#define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_2(X)
-#define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_2(X)
+# define FP_DECL_Q(X)		_FP_DECL (2, X)
+# define FP_UNPACK_RAW_Q(X, val)	_FP_UNPACK_RAW_2 (Q, X, (val))
+# define FP_UNPACK_RAW_QP(X, val)	_FP_UNPACK_RAW_2_P (Q, X, (val))
+# define FP_PACK_RAW_Q(val, X)	_FP_PACK_RAW_2 (Q, (val), X)
+# define FP_PACK_RAW_QP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_Q(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2 (Q, X, (val));		\
+      _FP_UNPACK_CANONICAL (Q, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_QP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2_P (Q, X, (val));		\
+      _FP_UNPACK_CANONICAL (Q, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_Q(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2 (Q, X, (val));		\
+      _FP_UNPACK_SEMIRAW (Q, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_QP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2_P (Q, X, (val));		\
+      _FP_UNPACK_SEMIRAW (Q, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_Q(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (Q, 2, X);		\
+      _FP_PACK_RAW_2 (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_QP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (Q, 2, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_Q(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (Q, 2, X);		\
+      _FP_PACK_RAW_2 (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_QP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (Q, 2, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN (Q, 2, X)
+# define FP_NEG_Q(R, X)			_FP_NEG (Q, 2, R, X)
+# define FP_ADD_Q(R, X, Y)		_FP_ADD (Q, 2, R, X, Y)
+# define FP_SUB_Q(R, X, Y)		_FP_SUB (Q, 2, R, X, Y)
+# define FP_MUL_Q(R, X, Y)		_FP_MUL (Q, 2, R, X, Y)
+# define FP_DIV_Q(R, X, Y)		_FP_DIV (Q, 2, R, X, Y)
+# define FP_SQRT_Q(R, X)		_FP_SQRT (Q, 2, R, X)
+# define _FP_SQRT_MEAT_Q(R, S, T, X, Q)	_FP_SQRT_MEAT_2 (R, S, T, X, (Q))
+# define FP_FMA_Q(R, X, Y, Z)		_FP_FMA (Q, 2, 4, R, X, Y, Z)
+
+# define FP_CMP_Q(r, X, Y, un, ex)	_FP_CMP (Q, 2, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_Q(r, X, Y, ex)	_FP_CMP_EQ (Q, 2, (r), X, Y, (ex))
+# define FP_CMP_UNORD_Q(r, X, Y, ex)	_FP_CMP_UNORD (Q, 2, (r), X, Y, (ex))
+
+# define FP_TO_INT_Q(r, X, rsz, rsg)	_FP_TO_INT (Q, 2, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_Q(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (Q, 2, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_Q(X, r, rs, rt)	_FP_FROM_INT (Q, 2, X, (r), (rs), rt)
+
+# define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_2 (X)
+# define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_2 (X)
+
+# define _FP_FRAC_HIGH_DW_Q(X)	_FP_FRAC_HIGH_4 (X)
 
 #endif /* not _FP_W_TYPE_SIZE < 64 */
 
diff --git a/include/math-emu/single.h b/include/math-emu/single.h
index 87f90b0..9975e00 100644
--- a/include/math-emu/single.h
+++ b/include/math-emu/single.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Definitions for IEEE Single Precision.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,45 +8,71 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef    __MATH_EMU_SINGLE_H__
 #define    __MATH_EMU_SINGLE_H__
 
 #if _FP_W_TYPE_SIZE < 32
-#error "Here's a nickel kid.  Go buy yourself a real computer."
+# error "Here's a nickel kid.  Go buy yourself a real computer."
+#endif
+
+#define _FP_FRACTBITS_S		_FP_W_TYPE_SIZE
+
+#if _FP_W_TYPE_SIZE < 64
+# define _FP_FRACTBITS_DW_S	(2 * _FP_W_TYPE_SIZE)
+#else
+# define _FP_FRACTBITS_DW_S	_FP_W_TYPE_SIZE
 #endif
 
 #define _FP_FRACBITS_S		24
-#define _FP_FRACXBITS_S		(_FP_W_TYPE_SIZE - _FP_FRACBITS_S)
+#define _FP_FRACXBITS_S		(_FP_FRACTBITS_S - _FP_FRACBITS_S)
 #define _FP_WFRACBITS_S		(_FP_WORKBITS + _FP_FRACBITS_S)
-#define _FP_WFRACXBITS_S	(_FP_W_TYPE_SIZE - _FP_WFRACBITS_S)
+#define _FP_WFRACXBITS_S	(_FP_FRACTBITS_S - _FP_WFRACBITS_S)
 #define _FP_EXPBITS_S		8
 #define _FP_EXPBIAS_S		127
 #define _FP_EXPMAX_S		255
-#define _FP_QNANBIT_S		((_FP_W_TYPE)1 << (_FP_FRACBITS_S-2))
-#define _FP_IMPLBIT_S		((_FP_W_TYPE)1 << (_FP_FRACBITS_S-1))
-#define _FP_OVERFLOW_S		((_FP_W_TYPE)1 << (_FP_WFRACBITS_S))
+#define _FP_QNANBIT_S		((_FP_W_TYPE) 1 << (_FP_FRACBITS_S-2))
+#define _FP_QNANBIT_SH_S	((_FP_W_TYPE) 1 << (_FP_FRACBITS_S-2+_FP_WORKBITS))
+#define _FP_IMPLBIT_S		((_FP_W_TYPE) 1 << (_FP_FRACBITS_S-1))
+#define _FP_IMPLBIT_SH_S	((_FP_W_TYPE) 1 << (_FP_FRACBITS_S-1+_FP_WORKBITS))
+#define _FP_OVERFLOW_S		((_FP_W_TYPE) 1 << (_FP_WFRACBITS_S))
+
+#define _FP_WFRACBITS_DW_S	(2 * _FP_WFRACBITS_S)
+#define _FP_WFRACXBITS_DW_S	(_FP_FRACTBITS_DW_S - _FP_WFRACBITS_DW_S)
+#define _FP_HIGHBIT_DW_S	\
+  ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_DW_S - 1) % _FP_W_TYPE_SIZE)
 
 /* The implementation of _FP_MUL_MEAT_S and _FP_DIV_MEAT_S should be
    chosen by the target machine.  */
 
+typedef float SFtype __attribute__ ((mode (SF)));
+
 union _FP_UNION_S
 {
-  float flt;
-  struct {
+  SFtype flt;
+  struct _FP_STRUCT_LAYOUT
+  {
 #if __BYTE_ORDER = __BIG_ENDIAN
     unsigned sign : 1;
     unsigned exp  : _FP_EXPBITS_S;
@@ -56,61 +82,118 @@ union _FP_UNION_S
     unsigned exp  : _FP_EXPBITS_S;
     unsigned sign : 1;
 #endif
-  } bits __attribute__((packed));
+  } bits __attribute__ ((packed));
 };
 
-#define FP_DECL_S(X)		_FP_DECL(1,X)
-#define FP_UNPACK_RAW_S(X,val)	_FP_UNPACK_RAW_1(S,X,val)
-#define FP_UNPACK_RAW_SP(X,val)	_FP_UNPACK_RAW_1_P(S,X,val)
-#define FP_PACK_RAW_S(val,X)	_FP_PACK_RAW_1(S,val,X)
-#define FP_PACK_RAW_SP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_1_P(S,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_S(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_1(S,X,val);		\
-    _FP_UNPACK_CANONICAL(S,1,X);	\
-  } while (0)
-
-#define FP_UNPACK_SP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_1_P(S,X,val);	\
-    _FP_UNPACK_CANONICAL(S,1,X);	\
-  } while (0)
-
-#define FP_PACK_S(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(S,1,X);		\
-    _FP_PACK_RAW_1(S,val,X);		\
-  } while (0)
-
-#define FP_PACK_SP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(S,1,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_1_P(S,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_S(X)		_FP_ISSIGNAN(S,1,X)
-#define FP_NEG_S(R,X)			_FP_NEG(S,1,R,X)
-#define FP_ADD_S(R,X,Y)			_FP_ADD(S,1,R,X,Y)
-#define FP_SUB_S(R,X,Y)			_FP_SUB(S,1,R,X,Y)
-#define FP_MUL_S(R,X,Y)			_FP_MUL(S,1,R,X,Y)
-#define FP_DIV_S(R,X,Y)			_FP_DIV(S,1,R,X,Y)
-#define FP_SQRT_S(R,X)			_FP_SQRT(S,1,R,X)
-#define _FP_SQRT_MEAT_S(R,S,T,X,Q)	_FP_SQRT_MEAT_1(R,S,T,X,Q)
-
-#define FP_CMP_S(r,X,Y,un)	_FP_CMP(S,1,r,X,Y,un)
-#define FP_CMP_EQ_S(r,X,Y)	_FP_CMP_EQ(S,1,r,X,Y)
-
-#define FP_TO_INT_S(r,X,rsz,rsg)	_FP_TO_INT(S,1,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_S(r,X,rsz,rsg)	_FP_TO_INT_ROUND(S,1,r,X,rsz,rsg)
-#define FP_FROM_INT_S(X,r,rs,rt)	_FP_FROM_INT(S,1,X,r,rs,rt)
-
-#define _FP_FRAC_HIGH_S(X)	_FP_FRAC_HIGH_1(X)
-#define _FP_FRAC_HIGH_RAW_S(X)	_FP_FRAC_HIGH_1(X)
+#define FP_DECL_S(X)		_FP_DECL (1, X)
+#define FP_UNPACK_RAW_S(X, val)	_FP_UNPACK_RAW_1 (S, X, (val))
+#define FP_UNPACK_RAW_SP(X, val)	_FP_UNPACK_RAW_1_P (S, X, (val))
+#define FP_PACK_RAW_S(val, X)	_FP_PACK_RAW_1 (S, (val), X)
+#define FP_PACK_RAW_SP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_UNPACK_S(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1 (S, X, (val));		\
+      _FP_UNPACK_CANONICAL (S, 1, X);		\
+    }						\
+  while (0)
+
+#define FP_UNPACK_SP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1_P (S, X, (val));		\
+      _FP_UNPACK_CANONICAL (S, 1, X);		\
+    }						\
+  while (0)
+
+#define FP_UNPACK_SEMIRAW_S(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1 (S, X, (val));		\
+      _FP_UNPACK_SEMIRAW (S, 1, X);		\
+    }						\
+  while (0)
+
+#define FP_UNPACK_SEMIRAW_SP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1_P (S, X, (val));		\
+      _FP_UNPACK_SEMIRAW (S, 1, X);		\
+    }						\
+  while (0)
+
+#define FP_PACK_S(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (S, 1, X);		\
+      _FP_PACK_RAW_1 (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_PACK_SP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (S, 1, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_PACK_SEMIRAW_S(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (S, 1, X);		\
+      _FP_PACK_RAW_1 (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_PACK_SEMIRAW_SP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (S, 1, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_ISSIGNAN_S(X)		_FP_ISSIGNAN (S, 1, X)
+#define FP_NEG_S(R, X)			_FP_NEG (S, 1, R, X)
+#define FP_ADD_S(R, X, Y)		_FP_ADD (S, 1, R, X, Y)
+#define FP_SUB_S(R, X, Y)		_FP_SUB (S, 1, R, X, Y)
+#define FP_MUL_S(R, X, Y)		_FP_MUL (S, 1, R, X, Y)
+#define FP_DIV_S(R, X, Y)		_FP_DIV (S, 1, R, X, Y)
+#define FP_SQRT_S(R, X)			_FP_SQRT (S, 1, R, X)
+#define _FP_SQRT_MEAT_S(R, S, T, X, Q)	_FP_SQRT_MEAT_1 (R, S, T, X, (Q))
+
+#if _FP_W_TYPE_SIZE < 64
+# define FP_FMA_S(R, X, Y, Z)	_FP_FMA (S, 1, 2, R, X, Y, Z)
+#else
+# define FP_FMA_S(R, X, Y, Z)	_FP_FMA (S, 1, 1, R, X, Y, Z)
+#endif
+
+#define FP_CMP_S(r, X, Y, un, ex)	_FP_CMP (S, 1, (r), X, Y, (un), (ex))
+#define FP_CMP_EQ_S(r, X, Y, ex)	_FP_CMP_EQ (S, 1, (r), X, Y, (ex))
+#define FP_CMP_UNORD_S(r, X, Y, ex)	_FP_CMP_UNORD (S, 1, (r), X, Y, (ex))
+
+#define FP_TO_INT_S(r, X, rsz, rsg)	_FP_TO_INT (S, 1, (r), X, (rsz), (rsg))
+#define FP_TO_INT_ROUND_S(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (S, 1, (r), X, (rsz), (rsg))
+#define FP_FROM_INT_S(X, r, rs, rt)	_FP_FROM_INT (S, 1, X, (r), (rs), rt)
+
+#define _FP_FRAC_HIGH_S(X)	_FP_FRAC_HIGH_1 (X)
+#define _FP_FRAC_HIGH_RAW_S(X)	_FP_FRAC_HIGH_1 (X)
+
+#if _FP_W_TYPE_SIZE < 64
+# define _FP_FRAC_HIGH_DW_S(X)	_FP_FRAC_HIGH_2 (X)
+#else
+# define _FP_FRAC_HIGH_DW_S(X)	_FP_FRAC_HIGH_1 (X)
+#endif
 
 #endif /* __MATH_EMU_SINGLE_H__ */
diff --git a/include/math-emu/soft-fp.h b/include/math-emu/soft-fp.h
index 3f284bc..2283dcd 100644
--- a/include/math-emu/soft-fp.h
+++ b/include/math-emu/soft-fp.h
@@ -1,5 +1,5 @@
 /* Software floating-point emulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -7,201 +7,329 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_SOFT_FP_H__
 #define __MATH_EMU_SOFT_FP_H__
 
-#include <asm/sfp-machine.h>
+#ifdef _LIBC
+# include <sfp-machine.h>
+#elif defined __KERNEL__
+# include <asm/sfp-machine.h>
+#else
+# include "sfp-machine.h"
+#endif
 
-/* Allow sfp-machine to have its own byte order definitions. */
+/* Allow sfp-machine to have its own byte order definitions.  */
 #ifndef __BYTE_ORDER
-#include <endian.h>
+# ifdef _LIBC
+#  include <endian.h>
+# else
+#  error "endianness not defined by sfp-machine.h"
+# endif
 #endif
 
 #define _FP_WORKBITS		3
-#define _FP_WORK_LSB		((_FP_W_TYPE)1 << 3)
-#define _FP_WORK_ROUND		((_FP_W_TYPE)1 << 2)
-#define _FP_WORK_GUARD		((_FP_W_TYPE)1 << 1)
-#define _FP_WORK_STICKY		((_FP_W_TYPE)1 << 0)
+#define _FP_WORK_LSB		((_FP_W_TYPE) 1 << 3)
+#define _FP_WORK_ROUND		((_FP_W_TYPE) 1 << 2)
+#define _FP_WORK_GUARD		((_FP_W_TYPE) 1 << 1)
+#define _FP_WORK_STICKY		((_FP_W_TYPE) 1 << 0)
 
 #ifndef FP_RND_NEAREST
 # define FP_RND_NEAREST		0
 # define FP_RND_ZERO		1
 # define FP_RND_PINF		2
 # define FP_RND_MINF		3
+#endif
 #ifndef FP_ROUNDMODE
 # define FP_ROUNDMODE		FP_RND_NEAREST
 #endif
-#endif
 
-/* By default don't care about exceptions. */
+/* By default don't care about exceptions.  */
 #ifndef FP_EX_INVALID
-#define FP_EX_INVALID		0
+# define FP_EX_INVALID		0
 #endif
-#ifndef FP_EX_INVALID_SNAN
-#define FP_EX_INVALID_SNAN	0
+#ifndef FP_EX_OVERFLOW
+# define FP_EX_OVERFLOW		0
 #endif
-/* inf - inf */
-#ifndef FP_EX_INVALID_ISI
-#define FP_EX_INVALID_ISI	0
+#ifndef FP_EX_UNDERFLOW
+# define FP_EX_UNDERFLOW	0
 #endif
-/* inf / inf */
-#ifndef FP_EX_INVALID_IDI
-#define FP_EX_INVALID_IDI	0
+#ifndef FP_EX_DIVZERO
+# define FP_EX_DIVZERO		0
 #endif
-/* 0 / 0 */
-#ifndef FP_EX_INVALID_ZDZ
-#define FP_EX_INVALID_ZDZ	0
+#ifndef FP_EX_INEXACT
+# define FP_EX_INEXACT		0
+#endif
+#ifndef FP_EX_DENORM
+# define FP_EX_DENORM		0
 #endif
-/* inf * 0 */
+
+/* Sub-exceptions of "invalid".  */
+/* Signaling NaN operand.  */
+#ifndef FP_EX_INVALID_SNAN
+# define FP_EX_INVALID_SNAN	0
+#endif
+/* Inf * 0.  */
 #ifndef FP_EX_INVALID_IMZ
-#define FP_EX_INVALID_IMZ	0
+# define FP_EX_INVALID_IMZ	0
 #endif
-#ifndef FP_EX_OVERFLOW
-#define FP_EX_OVERFLOW		0
+/* fma (Inf, 0, c).  */
+#ifndef FP_EX_INVALID_IMZ_FMA
+# define FP_EX_INVALID_IMZ_FMA	0
 #endif
-#ifndef FP_EX_UNDERFLOW
-#define FP_EX_UNDERFLOW		
+/* Inf - Inf.  */
+#ifndef FP_EX_INVALID_ISI
+# define FP_EX_INVALID_ISI	0
 #endif
-#ifndef FP_EX_DIVZERO
-#define FP_EX_DIVZERO		0
+/* 0 / 0.  */
+#ifndef FP_EX_INVALID_ZDZ
+# define FP_EX_INVALID_ZDZ	0
 #endif
-#ifndef FP_EX_INEXACT
-#define FP_EX_INEXACT		0
+/* Inf / Inf.  */
+#ifndef FP_EX_INVALID_IDI
+# define FP_EX_INVALID_IDI	0
 #endif
-#ifndef FP_EX_DENORM
-#define FP_EX_DENORM		0
+/* sqrt (negative).  */
+#ifndef FP_EX_INVALID_SQRT
+# define FP_EX_INVALID_SQRT	0
+#endif
+/* Invalid conversion to integer.  */
+#ifndef FP_EX_INVALID_CVI
+# define FP_EX_INVALID_CVI	0
+#endif
+/* Invalid comparison.  */
+#ifndef FP_EX_INVALID_VC
+# define FP_EX_INVALID_VC	0
+#endif
+
+/* _FP_STRUCT_LAYOUT may be defined as an attribute to determine the
+   struct layout variant used for structures where bit-fields are used
+   to access specific parts of binary floating-point numbers.  This is
+   required for systems where the default ABI uses struct layout with
+   differences in how consecutive bit-fields are laid out from the
+   default expected by soft-fp.  */
+#ifndef _FP_STRUCT_LAYOUT
+# define _FP_STRUCT_LAYOUT
 #endif
 
 #ifdef _FP_DECL_EX
-#define FP_DECL_EX					\
+# define FP_DECL_EX					\
   int _fex = 0;						\
   _FP_DECL_EX
 #else
-#define FP_DECL_EX int _fex = 0
+# define FP_DECL_EX int _fex = 0
 #endif
-  
+
+/* Initialize any machine-specific state used in FP_ROUNDMODE,
+   FP_TRAPPING_EXCEPTIONS or FP_HANDLE_EXCEPTIONS.  */
 #ifndef FP_INIT_ROUNDMODE
-#define FP_INIT_ROUNDMODE do {} while (0)
+# define FP_INIT_ROUNDMODE do {} while (0)
+#endif
+
+/* Initialize any machine-specific state used in
+   FP_TRAPPING_EXCEPTIONS or FP_HANDLE_EXCEPTIONS.  */
+#ifndef FP_INIT_TRAPPING_EXCEPTIONS
+# define FP_INIT_TRAPPING_EXCEPTIONS FP_INIT_ROUNDMODE
+#endif
+
+/* Initialize any machine-specific state used in
+   FP_HANDLE_EXCEPTIONS.  */
+#ifndef FP_INIT_EXCEPTIONS
+# define FP_INIT_EXCEPTIONS FP_INIT_TRAPPING_EXCEPTIONS
 #endif
 
 #ifndef FP_HANDLE_EXCEPTIONS
-#define FP_HANDLE_EXCEPTIONS do {} while (0)
+# define FP_HANDLE_EXCEPTIONS do {} while (0)
 #endif
 
-/* By default we never flush denormal input operands to signed zero. */
+/* Whether to flush subnormal inputs to zero with the same sign.  */
 #ifndef FP_DENORM_ZERO
-#define FP_DENORM_ZERO 0
+# define FP_DENORM_ZERO 0
 #endif
 
 #ifndef FP_INHIBIT_RESULTS
 /* By default we write the results always.
- * sfp-machine may override this and e.g.
- * check if some exceptions are unmasked
- * and inhibit it in such a case.
- */
-#define FP_INHIBIT_RESULTS 0
-#endif
-
-#ifndef FP_TRAPPING_EXCEPTIONS
-#define FP_TRAPPING_EXCEPTIONS 0
+   sfp-machine may override this and e.g.
+   check if some exceptions are unmasked
+   and inhibit it in such a case.  */
+# define FP_INHIBIT_RESULTS 0
 #endif
 
 #define FP_SET_EXCEPTION(ex)				\
   _fex |= (ex)
-  
-#define FP_UNSET_EXCEPTION(ex)				\
-  _fex &= ~(ex)
 
 #define FP_CUR_EXCEPTIONS				\
   (_fex)
 
-#define FP_CLEAR_EXCEPTIONS				\
-  _fex = 0
+#ifndef FP_TRAPPING_EXCEPTIONS
+# define FP_TRAPPING_EXCEPTIONS 0
+#endif
+
+/* A file using soft-fp may define FP_NO_EXCEPTIONS before including
+   soft-fp.h to indicate that, although a macro used there could raise
+   exceptions, or do rounding and potentially thereby raise
+   exceptions, for some arguments, for the particular arguments used
+   in that file no exceptions or rounding can occur.  Such a file
+   should not itself use macros relating to handling exceptions and
+   rounding modes; this is only for indirect uses (in particular, in
+   _FP_FROM_INT and the macros it calls).  */
+#ifdef FP_NO_EXCEPTIONS
+
+# undef FP_SET_EXCEPTION
+# define FP_SET_EXCEPTION(ex) do {} while (0)
+
+# undef FP_CUR_EXCEPTIONS
+# define FP_CUR_EXCEPTIONS 0
 
-#define _FP_ROUND_NEAREST(wc, X)			\
-do {							\
-    if ((_FP_FRAC_LOW_##wc(X) & 15) != _FP_WORK_ROUND)	\
-      _FP_FRAC_ADDI_##wc(X, _FP_WORK_ROUND);		\
-} while (0)
+# undef FP_TRAPPING_EXCEPTIONS
+# define FP_TRAPPING_EXCEPTIONS 0
 
-#define _FP_ROUND_ZERO(wc, X)		0
+# undef FP_ROUNDMODE
+# define FP_ROUNDMODE FP_RND_ZERO
+
+# undef _FP_TININESS_AFTER_ROUNDING
+# define _FP_TININESS_AFTER_ROUNDING 0
+
+#endif
+
+/* A file using soft-fp may define FP_NO_EXACT_UNDERFLOW before
+   including soft-fp.h to indicate that, although a macro used there
+   could allow for the case of exact underflow requiring the underflow
+   exception to be raised if traps are enabled, for the particular
+   arguments used in that file no exact underflow can occur.  */
+#ifdef FP_NO_EXACT_UNDERFLOW
+# undef FP_TRAPPING_EXCEPTIONS
+# define FP_TRAPPING_EXCEPTIONS 0
+#endif
+
+#define _FP_ROUND_NEAREST(wc, X)				\
+  do								\
+    {								\
+      if ((_FP_FRAC_LOW_##wc (X) & 15) != _FP_WORK_ROUND)	\
+	_FP_FRAC_ADDI_##wc (X, _FP_WORK_ROUND);			\
+    }								\
+  while (0)
+
+#define _FP_ROUND_ZERO(wc, X)		(void) 0
 
 #define _FP_ROUND_PINF(wc, X)				\
-do {							\
-    if (!X##_s && (_FP_FRAC_LOW_##wc(X) & 7))		\
-      _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB);		\
-} while (0)
+  do							\
+    {							\
+      if (!X##_s && (_FP_FRAC_LOW_##wc (X) & 7))	\
+	_FP_FRAC_ADDI_##wc (X, _FP_WORK_LSB);		\
+    }							\
+  while (0)
 
-#define _FP_ROUND_MINF(wc, X)				\
-do {							\
-    if (X##_s && (_FP_FRAC_LOW_##wc(X) & 7))		\
-      _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB);		\
-} while (0)
+#define _FP_ROUND_MINF(wc, X)			\
+  do						\
+    {						\
+      if (X##_s && (_FP_FRAC_LOW_##wc (X) & 7))	\
+	_FP_FRAC_ADDI_##wc (X, _FP_WORK_LSB);	\
+    }						\
+  while (0)
 
 #define _FP_ROUND(wc, X)			\
-do {						\
-	if (_FP_FRAC_LOW_##wc(X) & 7)		\
-	  FP_SET_EXCEPTION(FP_EX_INEXACT);	\
-	switch (FP_ROUNDMODE)			\
+  do						\
+    {						\
+      if (_FP_FRAC_LOW_##wc (X) & 7)		\
 	{					\
-	  case FP_RND_NEAREST:			\
-	    _FP_ROUND_NEAREST(wc,X);		\
-	    break;				\
-	  case FP_RND_ZERO:			\
-	    _FP_ROUND_ZERO(wc,X);		\
-	    break;				\
-	  case FP_RND_PINF:			\
-	    _FP_ROUND_PINF(wc,X);		\
-	    break;				\
-	  case FP_RND_MINF:			\
-	    _FP_ROUND_MINF(wc,X);		\
-	    break;				\
+	  FP_SET_EXCEPTION (FP_EX_INEXACT);	\
+	  switch (FP_ROUNDMODE)			\
+	    {					\
+	    case FP_RND_NEAREST:		\
+	      _FP_ROUND_NEAREST (wc, X);	\
+	      break;				\
+	    case FP_RND_ZERO:			\
+	      _FP_ROUND_ZERO (wc, X);		\
+	      break;				\
+	    case FP_RND_PINF:			\
+	      _FP_ROUND_PINF (wc, X);		\
+	      break;				\
+	    case FP_RND_MINF:			\
+	      _FP_ROUND_MINF (wc, X);		\
+	      break;				\
+	    }					\
 	}					\
-} while (0)
+    }						\
+  while (0)
 
 #define FP_CLS_NORMAL		0
 #define FP_CLS_ZERO		1
 #define FP_CLS_INF		2
 #define FP_CLS_NAN		3
 
-#define _FP_CLS_COMBINE(x,y)	(((x) << 2) | (y))
+#define _FP_CLS_COMBINE(x, y)	(((x) << 2) | (y))
 
-#include <math-emu/op-1.h>
-#include <math-emu/op-2.h>
-#include <math-emu/op-4.h>
-#include <math-emu/op-8.h>
-#include <math-emu/op-common.h>
+#ifdef __KERNEL__
+# include <math-emu/op-1.h>
+# include <math-emu/op-2.h>
+# include <math-emu/op-4.h>
+# include <math-emu/op-8.h>
+# include <math-emu/op-common.h>
+#else
+# include "op-1.h"
+# include "op-2.h"
+# include "op-4.h"
+# include "op-8.h"
+# include "op-common.h"
+#endif
 
 /* Sigh.  Silly things longlong.h needs.  */
 #define UWtype		_FP_W_TYPE
 #define W_TYPE_SIZE	_FP_W_TYPE_SIZE
 
-typedef int SItype __attribute__((mode(SI)));
-typedef int DItype __attribute__((mode(DI)));
-typedef unsigned int USItype __attribute__((mode(SI)));
-typedef unsigned int UDItype __attribute__((mode(DI)));
+typedef int QItype __attribute__ ((mode (QI)));
+typedef int SItype __attribute__ ((mode (SI)));
+typedef int DItype __attribute__ ((mode (DI)));
+typedef unsigned int UQItype __attribute__ ((mode (QI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef unsigned int UDItype __attribute__ ((mode (DI)));
 #if _FP_W_TYPE_SIZE = 32
-typedef unsigned int UHWtype __attribute__((mode(HI)));
+typedef unsigned int UHWtype __attribute__ ((mode (HI)));
 #elif _FP_W_TYPE_SIZE = 64
 typedef USItype UHWtype;
 #endif
 
+#ifndef CMPtype
+# define CMPtype	int
+#endif
+
+#define SI_BITS		(__CHAR_BIT__ * (int) sizeof (SItype))
+#define DI_BITS		(__CHAR_BIT__ * (int) sizeof (DItype))
+
 #ifndef umul_ppmm
-#include <stdlib/longlong.h>
+# ifdef _LIBC
+#  include <stdlib/longlong.h>
+# else
+#  include "longlong.h"
+# endif
+#endif
+
+#ifdef _LIBC
+# include <stdlib.h>
+#elif !defined __KERNEL__
+extern void abort (void);
 #endif
 
 #endif /* __MATH_EMU_SOFT_FP_H__ */


-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-06 17:25 ` Joseph Myers
  0 siblings, 0 replies; 20+ messages in thread
From: Joseph Myers @ 2015-02-06 17:25 UTC (permalink / raw)
  To: linux-kernel, linux-alpha, linuxppc-dev, linux-s390, linux-sh,
	sparclinux

The include/math-emu code (used for alpha powerpc s390 sh sparc) was
taken from an old version of glibc's soft-fp code around 15 years ago
(in the pre-git era, anyway, and some of the initial code may have
been developed around 1997-9 with a view to being used in both
places).  Since then, there have only been a handful of small changes
in the kernel version, while the glibc version has been extensively
developed, with many bug fixes, performance improvements and
miscellaneous cleanups, and is also now used in libgcc, including for
__float128 on x86_64 since GCC 4.3 (see
<https://ols.fedoraproject.org/GCC/Reprints-2006/sidwell-reprint.pdf>
for more information regarding performance improvements and use in
libgcc).

Thus the kernel version is missing those various improvements and it
would make sense to update it to include them (as was noted back in
2006 <https://sourceware.org/ml/libc-alpha/2006-02/msg00075.html> when
a large group of changes went into glibc).  I believe it also makes
sense to aim to have *exactly* the same code in both places to
simplify future updates of the kernel version.  (And in particular, as
external code imported largely verbatim into the kernel,
include/math-emu has never followed the kernel coding style and it
doesn't make sense for it to do so.)

I made an analysis of what kernel-local changes there were to this
code in <https://sourceware.org/ml/libc-alpha/2013-10/msg00345.html>,
and since then have added the various missing features to the glibc
version so that it is feature-complete regarding features used in the
kernel.  This patch updates the include/math-emu code, and its kernel
users, so that the shared code is the same as glibc's current soft-fp
code, except for the following:

(a) Multiple-include guards.

(b) Initializations in _FP_FRAC_DECL_* and _FP_DECL to avoid warnings
about possible uninitialized use (not appropriate in glibc; relevant
in the kernel because of large functions that do various unpacking,
conditionally, then use the results of unpacking, conditionally, where
it may not be visible to the compiler that variables are only used
after being initialized).

(c) Changes to how soft-fp.h includes other headers.

(d) Disabling the declaration of abort in soft-fp.h.

(c) and (d) are conditional on __KERNEL__, in the expectation that if
this goes into the kernel then those conditionals will go into glibc
and further reduce the differences between the two versions of the
code, and I may also look at how to avoid the differences in (a) and
(b) to make the versions identical; some form of multiple-include
guards could be added to glibc, but maybe not with the same names as
in the kernel; how strict is the kernel about rules for
multiple-include guard naming in imported code?  (Standard glibc
practice would be names such as SOFT_FP_DOUBLE_H, with op-*.h not
having such guards but instead having a #error if SOFT_FP_H, like
installed bits/*.h headers.)

At this point this patch is an RFC rather than yet being ready for
inclusion, because I've only tested it for powerpc (both e500 and
emulation of classic hard float); it's quite likely there are bugs in
the changes for other architectures, quite possibly breaking the
build.  I've also posted it to libc-alpha
<https://sourceware.org/ml/libc-alpha/2015-02/msg00107.html> with a
call for testing and notes on what testing might be appropriate.

The bulk of the changes are updating the code from glibc and a
detailed review of that part probably does not make sense in this
context if you want to aim for the same code in both places.  The
trickier part is the architecture updates for the various API changes
in soft-fp since the version used by the kernel.  The following
changes have occurred in the soft-fp API since the version used in the
kernel and so are addressed in the architecture updates in this patch.
(This list only includes changes relating to features used in the
kernel, not pure new features that aren't relevant to updating
existing code, and not pure bug fixes.)

* <https://sourceware.org/ml/libc-alpha/2006-02/msg00028.html>

  - Semi-raw unpacking is added, as something intermediate between raw
    and cooked unpacking, for efficiency.

  - Addition and subtraction are changed to work on semi-raw values.
    Thus, cooked results of multiplication can't be passed directly
    into addition, as was done in some kernel emulations of fused
    multiply-add, but that isn't a proper fused operation anyway (a
    proper fused operation involves using the unrounded multiplication
    result in twice the input precision, not an intermediate value in
    input precision plus three working bits); the appropriate fix is
    to use the new fused multiply-add support in soft-fp.

  - Conversions from one floating-point type to another now use
    FP_EXTEND (raw) and FP_TRUNC (semi-raw) instead of FP_CONV
    (cooked).  Those operations now deal with quieting signaling NaNs.

  - Conversions from floating-point to integer now use raw inputs, and
    require the integer variable passed to the FP_TO_INT macros to
    have unsigned type.

  - Conversions from integer to floating-point now use raw outputs.

* <https://sourceware.org/ml/libc-alpha/2006-02/msg00044.html>

  - Conversions from integer to floating-point now pass the name of an
    unsigned type to the FP_FROM_INT macros, not a signed type to
    which "unsigned" is added in the macro definition.

* <https://sourceware.org/ml/libc-alpha/2013-04/msg00646.html>

  - soft-fp supports the reversed quiet NaN convention used on MIPS
    and HPPA; sfp-machine.h must define _FP_QNANNEGATEDP (to 0, for
    architectures using the normal convention; to 1, for architectures
    using the MIPS convention).

* <https://sourceware.org/ml/libc-alpha/2013-10/msg00348.html>

  - Negation now works on raw values.

* <https://sourceware.org/ml/libc-alpha/2014-02/msg00068.html>

  - soft-fp now supports after-rounding tininess detection for
    architectures where that is the defined way in which tiny results
    are detected (of the architectures for which the Linux kernel uses
    this code, that's Alpha and SH).  sfp-machine.h must define
    _FP_TININESS_AFTER_ROUNDING to either 0 or 1.

* <https://sourceware.org/ml/libc-alpha/2014-09/msg00411.html>

  - FP_CLEAR_EXCEPTIONS is removed; all uses in the Linux kernel are
    no longer needed as, now unpacking only occurs in the correct
    format, exceptions are already clear at that point.

* <https://sourceware.org/ml/libc-alpha/2014-09/msg00461.html>

  - The FP_CMP macros have an extra argument to specify when
    exceptions should be set (0 for no exception setting, 1 for
    exceptions only for signaling NaNs, 2 for exceptions for all
    NaNs).  In the old version in the kernel, it was necessary for the
    caller to handle all exception setting for comparisons.

* <https://sourceware.org/ml/libc-alpha/2014-09/msg00488.html>

  - FP_DENORM_ZERO does not set "inexact" when flushing to zero, as
    that does not appear to match the documented semantics for either
    of the architectures (Alpha and SH) for which the kernel uses
    FP_DENORM_ZERO.  FP_DENORM_ZERO is also checked for comparisons
    (the documentation for both Alpha and SH is explicit that their
    corresponding control bits do apply to comparisons).

* <https://sourceware.org/ml/libc-alpha/2014-09/msg00462.html>

  - The more precise FP_EX_INVALID_* exceptions include more cases
    than in the kernel version (in particular, FP_EX_INVALID_IMZ_FMA
    is split out from FP_EX_INVALID_IMZ, so if only the latter is
    defined then fma using the new fma support would not raise that
    exception any more - except that this doesn't actually affect
    powerpc because it hardcodes setting various exceptions in
    powerpc-specific code despite also defining FP_EX_INVALID_*).

Generally this patch only does cleanups and bug fixes to
architecture-specific code when they are closely connected to API
changes in the new code (either required by such API changes, or the
new API means the idiomatic way to do something has changed).  Where
something was already odd with the old version of the code, or
apparently did not match documented instruction set semantics, it's
not changed if that seems unconnected to the update from glibc.  I've
noted various such cases (especially for powerpc) that may be
addressed in followup patch series once the main upgrade is in (or,
where the fix seems more complicated and difficult to fix without
convenient access to the architecture for testing, I may just list the
issues on the relevant architecture mailing list).

The following architecture-specific cleanups or bug fixes (that might
change how the emulation behaves, or that go beyond mechanical
conversion to new APIs) are included in this patch because of their
close connection to the API changes:

* Alpha and SH now use after-rounding tininess detection.

* On Alpha, extensions from single to double now use FP_EXTEND with
  raw unpacking instead of the previous hardcoded code with cooked
  unpacking; these should be equivalent and the new code, with the
  optimizations in FP_EXTEND relative to the old FP_CONV, should be as
  efficient as the previous hardcoded code.

* On PowerPC, S/390 and SH, fused multiply-add operations now use the
  new soft-fp fma support (meaning they are properly fused rather than
  only having 3 extra bits precision on the intermediate result of the
  multiplication).

* On PowerPC for SPE floating-point emulation, the pre-existing bug of
  comparisons using cooked unpacking is fixed (as the structure of the
  code meant unpacking types naturally needed specifying explicitly
  for all operations).  This should not in fact change how the
  emulation behaves, other than making it more efficient.  Various
  operations that should not have unpacked at all now no longer unpack
  instead of using cooked unpacking, so avoiding spurious exceptions
  on signaling NaNs (on the other case of arguments that are actually
  a different floating-point type but would wrongly be interpreted as
  signaling NaNs by the unpacking, FP_CLEAR_EXCEPTIONS may have
  avoided the issue).

* On S/390, negation / absolute value now use raw unpacking / packing,
  meaning SNaNs no longer generate exceptions, which is in accordance
  with the architecture documentation.

* On SPARC, comparisons now use raw unpacking (this should not in fact
  change how the emulation behaves, just make it more efficient).

Signed-off-by: Joseph Myers <joseph@codesourcery.com>

---

diff --git a/arch/alpha/include/asm/sfp-machine.h b/arch/alpha/include/asm/sfp-machine.h
index 5fe63af..96c266a 100644
--- a/arch/alpha/include/asm/sfp-machine.h
+++ b/arch/alpha/include/asm/sfp-machine.h
@@ -48,6 +48,7 @@
 #define _FP_NANSIGN_Q		1
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /* Alpha Architecture Handbook, 4.7.10.4 sais that
  * we should prefer any type of NaN in Fb, then Fa.
@@ -79,4 +80,6 @@
 /* We write the results always */
 #define FP_INHIBIT_RESULTS 0
 
+#define _FP_TININESS_AFTER_ROUNDING 1
+
 #endif
diff --git a/arch/alpha/math-emu/math.c b/arch/alpha/math-emu/math.c
index 58c2669..1fdb122 100644
--- a/arch/alpha/math-emu/math.c
+++ b/arch/alpha/math-emu/math.c
@@ -127,17 +127,27 @@ alpha_fp_emul (unsigned long pc)
 		va = alpha_read_fp_reg_s(fa);
 		vb = alpha_read_fp_reg_s(fb);
 		
-		FP_UNPACK_SP(SA, &va);
-		FP_UNPACK_SP(SB, &vb);
+		switch (func) {
+		case FOP_FNC_SUBx:
+		case FOP_FNC_ADDx:
+			FP_UNPACK_SEMIRAW_SP(SA, &va);
+			FP_UNPACK_SEMIRAW_SP(SB, &vb);
+			break;
+
+		default:
+			FP_UNPACK_SP(SA, &va);
+			FP_UNPACK_SP(SB, &vb);
+			break;
+		}
 
 		switch (func) {
 		case FOP_FNC_SUBx:
 			FP_SUB_S(SR, SA, SB);
-			goto pack_s;
+			goto pack_semiraw_s;
 
 		case FOP_FNC_ADDx:
 			FP_ADD_S(SR, SA, SB);
-			goto pack_s;
+			goto pack_semiraw_s;
 
 		case FOP_FNC_MULx:
 			FP_MUL_S(SR, SA, SB);
@@ -160,26 +170,10 @@ alpha_fp_emul (unsigned long pc)
 		if ((func & ~3) == FOP_FNC_CMPxUN) {
 			FP_UNPACK_RAW_DP(DA, &va);
 			FP_UNPACK_RAW_DP(DB, &vb);
-			if (!DA_e && !_FP_FRAC_ZEROP_1(DA)) {
-				FP_SET_EXCEPTION(FP_EX_DENORM);
-				if (FP_DENORM_ZERO)
-					_FP_FRAC_SET_1(DA, _FP_ZEROFRAC_1);
-			}
-			if (!DB_e && !_FP_FRAC_ZEROP_1(DB)) {
-				FP_SET_EXCEPTION(FP_EX_DENORM);
-				if (FP_DENORM_ZERO)
-					_FP_FRAC_SET_1(DB, _FP_ZEROFRAC_1);
-			}
-			FP_CMP_D(res, DA, DB, 3);
-			vc = 0x4000000000000000UL;
 			/* CMPTEQ, CMPTUN don't trap on QNaN,
 			   while CMPTLT and CMPTLE do */
-			if (res == 3
-			    && ((func & 3) >= 2
-				|| FP_ISSIGNAN_D(DA)
-				|| FP_ISSIGNAN_D(DB))) {
-				FP_SET_EXCEPTION(FP_EX_INVALID);
-			}
+			FP_CMP_D(res, DA, DB, 3, (func & 3) >= 2 ? 2 : 1);
+			vc = 0x4000000000000000UL;
 			switch (func) {
 			case FOP_FNC_CMPxUN: if (res != 3) vc = 0; break;
 			case FOP_FNC_CMPxEQ: if (res) vc = 0; break;
@@ -189,55 +183,64 @@ alpha_fp_emul (unsigned long pc)
 			goto done_d;
 		}
 
-		FP_UNPACK_DP(DA, &va);
-		FP_UNPACK_DP(DB, &vb);
-
 		switch (func) {
 		case FOP_FNC_SUBx:
-			FP_SUB_D(DR, DA, DB);
-			goto pack_d;
-
 		case FOP_FNC_ADDx:
-			FP_ADD_D(DR, DA, DB);
-			goto pack_d;
-
-		case FOP_FNC_MULx:
-			FP_MUL_D(DR, DA, DB);
-			goto pack_d;
-
-		case FOP_FNC_DIVx:
-			FP_DIV_D(DR, DA, DB);
-			goto pack_d;
-
-		case FOP_FNC_SQRTx:
-			FP_SQRT_D(DR, DB);
-			goto pack_d;
+			FP_UNPACK_SEMIRAW_DP(DA, &va);
+			FP_UNPACK_SEMIRAW_DP(DB, &vb);
+			break;
 
 		case FOP_FNC_CVTxS:
 			/* It is irritating that DEC encoded CVTST with
 			   SRC == T_floating.  It is also interesting that
 			   the bit used to tell the two apart is /U... */
 			if (insn & 0x2000) {
-				FP_CONV(S,D,1,1,SR,DB);
-				goto pack_s;
+				FP_UNPACK_SEMIRAW_DP(DB, &vb);
+				FP_TRUNC(S,D,1,1,SR,DB);
+				goto pack_semiraw_s;
 			} else {
 				vb = alpha_read_fp_reg_s(fb);
-				FP_UNPACK_SP(SB, &vb);
-				DR_c = DB_c;
-				DR_s = DB_s;
-				DR_e = DB_e + (1024 - 128);
-				DR_f = SB_f << (52 - 23);
-				goto pack_d;
+				FP_UNPACK_RAW_SP(SB, &vb);
+				FP_EXTEND(D,S,1,1,DR,SB);
+				goto pack_raw_d;
 			}
 
 		case FOP_FNC_CVTxQ:
-			if (DB_c == FP_CLS_NAN
+			FP_UNPACK_RAW_DP(DB, &vb);
+			if (DB_e == _FP_EXPMAX_D
 			    && (_FP_FRAC_HIGH_RAW_D(DB) & _FP_QNANBIT_D)) {
 			  /* AAHB Table B-2 says QNaN should not trigger INV */
 				vc = 0;
 			} else
 				FP_TO_INT_ROUND_D(vc, DB, 64, 2);
 			goto done_d;
+
+		default:
+			FP_UNPACK_DP(DA, &va);
+			FP_UNPACK_DP(DB, &vb);
+			break;
+		}
+
+		switch (func) {
+		case FOP_FNC_SUBx:
+			FP_SUB_D(DR, DA, DB);
+			goto pack_semiraw_d;
+
+		case FOP_FNC_ADDx:
+			FP_ADD_D(DR, DA, DB);
+			goto pack_semiraw_d;
+
+		case FOP_FNC_MULx:
+			FP_MUL_D(DR, DA, DB);
+			goto pack_d;
+
+		case FOP_FNC_DIVx:
+			FP_DIV_D(DR, DA, DB);
+			goto pack_d;
+
+		case FOP_FNC_SQRTx:
+			FP_SQRT_D(DR, DB);
+			goto pack_d;
 		}
 		goto bad_insn;
 
@@ -256,26 +259,44 @@ alpha_fp_emul (unsigned long pc)
 			goto done_d;
 
 		case FOP_FNC_CVTxS:
-			FP_FROM_INT_S(SR, ((long)vb), 64, long);
-			goto pack_s;
+			FP_FROM_INT_S(SR, ((long)vb), 64, unsigned long);
+			goto pack_raw_s;
 
 		case FOP_FNC_CVTxT:
-			FP_FROM_INT_D(DR, ((long)vb), 64, long);
-			goto pack_d;
+			FP_FROM_INT_D(DR, ((long)vb), 64, unsigned long);
+			goto pack_raw_d;
 		}
 		goto bad_insn;
 	}
 	goto bad_insn;
 
+pack_raw_s:
+	FP_PACK_RAW_SP(&vc, SR);
+	goto packed_s;
+
+pack_semiraw_s:
+	FP_PACK_SEMIRAW_SP(&vc, SR);
+	goto packed_s;
+
 pack_s:
 	FP_PACK_SP(&vc, SR);
+packed_s:
 	if ((_fex & FP_EX_UNDERFLOW) && (swcr & IEEE_MAP_UMZ))
 		vc = 0;
 	alpha_write_fp_reg_s(fc, vc);
 	goto done;
 
+pack_raw_d:
+	FP_PACK_RAW_DP(&vc, DR);
+	goto packed_d;
+
+pack_semiraw_d:
+	FP_PACK_SEMIRAW_DP(&vc, DR);
+	goto packed_d;
+
 pack_d:
 	FP_PACK_DP(&vc, DR);
+packed_d:
 	if ((_fex & FP_EX_UNDERFLOW) && (swcr & IEEE_MAP_UMZ))
 		vc = 0;
 done_d:
diff --git a/arch/powerpc/include/asm/sfp-machine.h b/arch/powerpc/include/asm/sfp-machine.h
index d89beab..607ee14 100644
--- a/arch/powerpc/include/asm/sfp-machine.h
+++ b/arch/powerpc/include/asm/sfp-machine.h
@@ -82,6 +82,9 @@
 #define _FP_MUL_MEAT_S(R,X,Y)   _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
 #define _FP_MUL_MEAT_D(R,X,Y)   _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
 
+#define _FP_MUL_MEAT_DW_S(R,X,Y)   _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_D(R,X,Y)   _FP_MUL_MEAT_DW_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+
 #define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv_norm(S,R,X,Y)
 #define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
 
@@ -96,6 +99,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 #ifdef FP_EX_BOOKE_E500_SPE
 #define FP_EX_INEXACT		(1 << 21)
@@ -178,15 +182,40 @@
 		_FP_PACK_RAW_2_P(D, val, X);				\
    } while (0)
 
+#define __FP_PACK_SEMIRAW_D(val,X)			\
+   do {									\
+	_FP_PACK_SEMIRAW(D, 2, X);					\
+	if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS))	\
+		_FP_PACK_RAW_2_P(D, val, X);				\
+   } while (0)
+
 #define __FP_PACK_DS(val,X)							\
    do {										\
 	   FP_DECL_S(__X);							\
-	   FP_CONV(S, D, 1, 2, __X, X);						\
+	   if (X##_c != FP_CLS_NAN)						\
+		   _FP_FRAC_SRS_2(X, _FP_WFRACBITS_D - _FP_WFRACBITS_S,		\
+			   _FP_WFRACBITS_D);					\
+	   else									\
+		   _FP_FRAC_SRL_2(X, _FP_WFRACBITS_D - _FP_WFRACBITS_S);	\
+	   _FP_FRAC_COPY_1_2(__X, X);						\
+	   __X##_e = X##_e;							\
+	   __X##_c = X##_c;							\
+	   __X##_s = X##_s;							\
 	   _FP_PACK_CANONICAL(S, 1, __X);					\
 	   if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS)) {	\
-		   _FP_UNPACK_CANONICAL(S, 1, __X);				\
-		   FP_CONV(D, S, 2, 1, X, __X);					\
-		   _FP_PACK_CANONICAL(D, 2, X);					\
+		   FP_EXTEND(D, S, 2, 1, X, __X);				\
+		   if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS))	\
+		   _FP_PACK_RAW_2_P(D, val, X);					\
+	   }									\
+   } while (0)
+
+#define __FP_PACK_SEMIRAW_DS(val,X)						\
+   do {										\
+	   FP_DECL_S(__X);							\
+	   FP_TRUNC(S, D, 1, 2, __X, X);					\
+	   _FP_PACK_SEMIRAW(S, 1, __X);						\
+	   if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS)) {	\
+		   FP_EXTEND(D, S, 2, 1, X, __X);				\
 		   if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS))	\
 		   _FP_PACK_RAW_2_P(D, val, X);					\
 	   }									\
@@ -198,6 +227,8 @@
 	__FPU_FPSCR & 0x3;		\
 })
 
+#define _FP_TININESS_AFTER_ROUNDING 0
+
 /* the asm fragments go here: all these are taken from glibc-2.0.5's
  * stdlib/longlong.h
  */
diff --git a/arch/powerpc/math-emu/fadd.c b/arch/powerpc/math-emu/fadd.c
index 0158a16..6deb27a 100644
--- a/arch/powerpc/math-emu/fadd.c
+++ b/arch/powerpc/math-emu/fadd.c
@@ -18,8 +18,8 @@ fadd(void *frD, void *frA, void *frB)
 	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
-	FP_UNPACK_DP(A, frA);
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_SEMIRAW_DP(A, frA);
+	FP_UNPACK_SEMIRAW_DP(B, frB);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
@@ -32,7 +32,7 @@ fadd(void *frD, void *frA, void *frB)
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	__FP_PACK_D(frD, R);
+	__FP_PACK_SEMIRAW_D(frD, R);
 
 	return FP_CUR_EXCEPTIONS;
 }
diff --git a/arch/powerpc/math-emu/fadds.c b/arch/powerpc/math-emu/fadds.c
index 5930f40..9e2fb9e 100644
--- a/arch/powerpc/math-emu/fadds.c
+++ b/arch/powerpc/math-emu/fadds.c
@@ -19,8 +19,8 @@ fadds(void *frD, void *frA, void *frB)
 	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
-	FP_UNPACK_DP(A, frA);
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_SEMIRAW_DP(A, frA);
+	FP_UNPACK_SEMIRAW_DP(B, frB);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
@@ -33,7 +33,7 @@ fadds(void *frD, void *frA, void *frB)
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	__FP_PACK_DS(frD, R);
+	__FP_PACK_SEMIRAW_DS(frD, R);
 
 	return FP_CUR_EXCEPTIONS;
 }
diff --git a/arch/powerpc/math-emu/fcmpo.c b/arch/powerpc/math-emu/fcmpo.c
index 5bce011..8ebdb28 100644
--- a/arch/powerpc/math-emu/fcmpo.c
+++ b/arch/powerpc/math-emu/fcmpo.c
@@ -30,7 +30,7 @@ fcmpo(u32 *ccr, int crfD, void *frA, void *frB)
 	if (A_c == FP_CLS_NAN || B_c == FP_CLS_NAN)
 		FP_SET_EXCEPTION(EFLAG_VXVC);
 
-	FP_CMP_D(cmp, A, B, 2);
+	FP_CMP_D(cmp, A, B, 2, 0);
 	cmp = code[(cmp + 1) & 3];
 
 	__FPU_FPSCR &= ~(0x1f000);
diff --git a/arch/powerpc/math-emu/fcmpu.c b/arch/powerpc/math-emu/fcmpu.c
index d4fb1ba..3b385c6 100644
--- a/arch/powerpc/math-emu/fcmpu.c
+++ b/arch/powerpc/math-emu/fcmpu.c
@@ -27,7 +27,7 @@ fcmpu(u32 *ccr, int crfD, void *frA, void *frB)
 	printk("B: %ld %lu %lu %ld (%ld)\n", B_s, B_f1, B_f0, B_e, B_c);
 #endif
 
-	FP_CMP_D(cmp, A, B, 2);
+	FP_CMP_D(cmp, A, B, 2, 0);
 	cmp = code[(cmp + 1) & 3];
 
 	__FPU_FPSCR &= ~(0x1f000);
diff --git a/arch/powerpc/math-emu/fctiw.c b/arch/powerpc/math-emu/fctiw.c
index f694440..9d7c7c9 100644
--- a/arch/powerpc/math-emu/fctiw.c
+++ b/arch/powerpc/math-emu/fctiw.c
@@ -13,7 +13,7 @@ fctiw(u32 *frD, void *frB)
 	FP_DECL_EX;
 	unsigned int r;
 
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_RAW_DP(B, frB);
 	FP_TO_INT_D(r, B, 32, 1);
 	frD[1] = r;
 
diff --git a/arch/powerpc/math-emu/fctiwz.c b/arch/powerpc/math-emu/fctiwz.c
index 71e782f..d55b3e7 100644
--- a/arch/powerpc/math-emu/fctiwz.c
+++ b/arch/powerpc/math-emu/fctiwz.c
@@ -18,7 +18,7 @@ fctiwz(u32 *frD, void *frB)
 	__FPU_FPSCR &= ~(3);
 	__FPU_FPSCR |= FP_RND_ZERO;
 
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_RAW_DP(B, frB);
 	FP_TO_INT_D(r, B, 32, 1);
 	frD[1] = r;
 
diff --git a/arch/powerpc/math-emu/fmadd.c b/arch/powerpc/math-emu/fmadd.c
index 8c3f20a..0f450fb 100644
--- a/arch/powerpc/math-emu/fmadd.c
+++ b/arch/powerpc/math-emu/fmadd.c
@@ -13,7 +13,6 @@ fmadd(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -34,12 +33,7 @@ fmadd(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
                 FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 #ifdef DEBUG
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
diff --git a/arch/powerpc/math-emu/fmadds.c b/arch/powerpc/math-emu/fmadds.c
index 794fb31..79885eb 100644
--- a/arch/powerpc/math-emu/fmadds.c
+++ b/arch/powerpc/math-emu/fmadds.c
@@ -14,7 +14,6 @@ fmadds(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -35,12 +34,7 @@ fmadds(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
                 FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 #ifdef DEBUG
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
diff --git a/arch/powerpc/math-emu/fmsub.c b/arch/powerpc/math-emu/fmsub.c
index 626f6fe..ee2385d 100644
--- a/arch/powerpc/math-emu/fmsub.c
+++ b/arch/powerpc/math-emu/fmsub.c
@@ -13,7 +13,6 @@ fmsub(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -34,15 +33,10 @@ fmsub(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
 		FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
 	if (B_c != FP_CLS_NAN)
 		B_s ^= 1;
 
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 #ifdef DEBUG
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
diff --git a/arch/powerpc/math-emu/fmsubs.c b/arch/powerpc/math-emu/fmsubs.c
index 3425bc8..fe081c0 100644
--- a/arch/powerpc/math-emu/fmsubs.c
+++ b/arch/powerpc/math-emu/fmsubs.c
@@ -14,7 +14,6 @@ fmsubs(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -35,15 +34,10 @@ fmsubs(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
 		FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
 	if (B_c != FP_CLS_NAN)
 		B_s ^= 1;
 
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 #ifdef DEBUG
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
diff --git a/arch/powerpc/math-emu/fnmadd.c b/arch/powerpc/math-emu/fnmadd.c
index e817bc5..330353e6 100644
--- a/arch/powerpc/math-emu/fnmadd.c
+++ b/arch/powerpc/math-emu/fnmadd.c
@@ -13,7 +13,6 @@ fnmadd(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -34,12 +33,7 @@ fnmadd(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
                 FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 	if (R_c != FP_CLS_NAN)
 		R_s ^= 1;
diff --git a/arch/powerpc/math-emu/fnmadds.c b/arch/powerpc/math-emu/fnmadds.c
index 4db4b7d..dd27045 100644
--- a/arch/powerpc/math-emu/fnmadds.c
+++ b/arch/powerpc/math-emu/fnmadds.c
@@ -14,7 +14,6 @@ fnmadds(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -35,12 +34,7 @@ fnmadds(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
                 FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 	if (R_c != FP_CLS_NAN)
 		R_s ^= 1;
diff --git a/arch/powerpc/math-emu/fnmsub.c b/arch/powerpc/math-emu/fnmsub.c
index f65979f..87c8b4c 100644
--- a/arch/powerpc/math-emu/fnmsub.c
+++ b/arch/powerpc/math-emu/fnmsub.c
@@ -13,7 +13,6 @@ fnmsub(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -34,15 +33,10 @@ fnmsub(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
 		FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
 	if (B_c != FP_CLS_NAN)
 		B_s ^= 1;
 
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 	if (R_c != FP_CLS_NAN)
 		R_s ^= 1;
diff --git a/arch/powerpc/math-emu/fnmsubs.c b/arch/powerpc/math-emu/fnmsubs.c
index 9021dac..72b860b 100644
--- a/arch/powerpc/math-emu/fnmsubs.c
+++ b/arch/powerpc/math-emu/fnmsubs.c
@@ -14,7 +14,6 @@ fnmsubs(void *frD, void *frA, void *frB, void *frC)
 	FP_DECL_D(A);
 	FP_DECL_D(B);
 	FP_DECL_D(C);
-	FP_DECL_D(T);
 	FP_DECL_EX;
 
 #ifdef DEBUG
@@ -35,15 +34,10 @@ fnmsubs(void *frD, void *frA, void *frB, void *frC)
 	    (A_c == FP_CLS_ZERO && C_c == FP_CLS_INF))
 		FP_SET_EXCEPTION(EFLAG_VXIMZ);
 
-	FP_MUL_D(T, A, C);
-
 	if (B_c != FP_CLS_NAN)
 		B_s ^= 1;
 
-	if (T_s != B_s && T_c == FP_CLS_INF && B_c == FP_CLS_INF)
-		FP_SET_EXCEPTION(EFLAG_VXISI);
-
-	FP_ADD_D(R, T, B);
+	FP_FMA_D(R, A, C, B);
 
 	if (R_c != FP_CLS_NAN)
 		R_s ^= 1;
diff --git a/arch/powerpc/math-emu/fsub.c b/arch/powerpc/math-emu/fsub.c
index 02c5dff..8070976 100644
--- a/arch/powerpc/math-emu/fsub.c
+++ b/arch/powerpc/math-emu/fsub.c
@@ -18,8 +18,8 @@ fsub(void *frD, void *frA, void *frB)
 	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
-	FP_UNPACK_DP(A, frA);
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_SEMIRAW_DP(A, frA);
+	FP_UNPACK_SEMIRAW_DP(B, frB);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
@@ -38,7 +38,7 @@ fsub(void *frD, void *frA, void *frB)
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	__FP_PACK_D(frD, R);
+	__FP_PACK_SEMIRAW_D(frD, R);
 
 	return FP_CUR_EXCEPTIONS;
 }
diff --git a/arch/powerpc/math-emu/fsubs.c b/arch/powerpc/math-emu/fsubs.c
index 5d9b18c..5b96755 100644
--- a/arch/powerpc/math-emu/fsubs.c
+++ b/arch/powerpc/math-emu/fsubs.c
@@ -19,8 +19,8 @@ fsubs(void *frD, void *frA, void *frB)
 	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
-	FP_UNPACK_DP(A, frA);
-	FP_UNPACK_DP(B, frB);
+	FP_UNPACK_SEMIRAW_DP(A, frA);
+	FP_UNPACK_SEMIRAW_DP(B, frB);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
@@ -39,7 +39,7 @@ fsubs(void *frD, void *frA, void *frB)
 	printk("D: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	__FP_PACK_DS(frD, R);
+	__FP_PACK_SEMIRAW_DS(frD, R);
 
 	return FP_CUR_EXCEPTIONS;
 }
diff --git a/arch/powerpc/math-emu/lfs.c b/arch/powerpc/math-emu/lfs.c
index 434ed27..16da2c2 100644
--- a/arch/powerpc/math-emu/lfs.c
+++ b/arch/powerpc/math-emu/lfs.c
@@ -22,25 +22,20 @@ lfs(void *frD, void *ea)
 	if (copy_from_user(&f, ea, sizeof(float)))
 		return -EFAULT;
 
-	FP_UNPACK_S(A, f);
+	FP_UNPACK_RAW_S(A, f);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %ld (%ld) [%08lx]\n", A_s, A_f, A_e, A_c,
 	       *(unsigned long *)&f);
 #endif
 
-	FP_CONV(D, S, 2, 1, R, A);
+	_FP_EXTEND_CNAN(D, S, 2, 1, R, A, 0);
 
 #ifdef DEBUG
 	printk("R: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
 #endif
 
-	if (R_c == FP_CLS_NAN) {
-		R_e = _FP_EXPMAX_D;
-		_FP_PACK_RAW_2_P(D, frD, R);
-	} else {
-		__FP_PACK_D(frD, R);
-	}
+	FP_PACK_RAW_DP(frD, R);
 
 	return 0;
 }
diff --git a/arch/powerpc/math-emu/math_efp.c b/arch/powerpc/math-emu/math_efp.c
index 28337c9..833394c 100644
--- a/arch/powerpc/math-emu/math_efp.c
+++ b/arch/powerpc/math-emu/math_efp.c
@@ -99,6 +99,11 @@
 #define XB	4
 #define XCR	5
 #define NOTYPE	0
+#define TYPE_MASK	7
+#define UNONE	0
+#define URAW	8
+#define USEMI	16
+#define UCOOK	24
 
 #define SIGN_BIT_S	(1UL << 31)
 #define SIGN_BIT_D	(1ULL << 63)
@@ -114,64 +119,64 @@ union dw_union {
 
 static unsigned long insn_type(unsigned long speinsn)
 {
-	unsigned long ret = NOTYPE;
+	unsigned long ret = NOTYPE|UNONE;
 
 	switch (speinsn & 0x7ff) {
-	case EFSABS:	ret = XA;	break;
-	case EFSADD:	ret = AB;	break;
-	case EFSCFD:	ret = XB;	break;
-	case EFSCMPEQ:	ret = XCR;	break;
-	case EFSCMPGT:	ret = XCR;	break;
-	case EFSCMPLT:	ret = XCR;	break;
-	case EFSCTSF:	ret = XB;	break;
-	case EFSCTSI:	ret = XB;	break;
-	case EFSCTSIZ:	ret = XB;	break;
-	case EFSCTUF:	ret = XB;	break;
-	case EFSCTUI:	ret = XB;	break;
-	case EFSCTUIZ:	ret = XB;	break;
-	case EFSDIV:	ret = AB;	break;
-	case EFSMUL:	ret = AB;	break;
-	case EFSNABS:	ret = XA;	break;
-	case EFSNEG:	ret = XA;	break;
-	case EFSSUB:	ret = AB;	break;
-	case EFSCFSI:	ret = XB;	break;
-
-	case EVFSABS:	ret = XA;	break;
-	case EVFSADD:	ret = AB;	break;
-	case EVFSCMPEQ:	ret = XCR;	break;
-	case EVFSCMPGT:	ret = XCR;	break;
-	case EVFSCMPLT:	ret = XCR;	break;
-	case EVFSCTSF:	ret = XB;	break;
-	case EVFSCTSI:	ret = XB;	break;
-	case EVFSCTSIZ:	ret = XB;	break;
-	case EVFSCTUF:	ret = XB;	break;
-	case EVFSCTUI:	ret = XB;	break;
-	case EVFSCTUIZ:	ret = XB;	break;
-	case EVFSDIV:	ret = AB;	break;
-	case EVFSMUL:	ret = AB;	break;
-	case EVFSNABS:	ret = XA;	break;
-	case EVFSNEG:	ret = XA;	break;
-	case EVFSSUB:	ret = AB;	break;
-
-	case EFDABS:	ret = XA;	break;
-	case EFDADD:	ret = AB;	break;
-	case EFDCFS:	ret = XB;	break;
-	case EFDCMPEQ:	ret = XCR;	break;
-	case EFDCMPGT:	ret = XCR;	break;
-	case EFDCMPLT:	ret = XCR;	break;
-	case EFDCTSF:	ret = XB;	break;
-	case EFDCTSI:	ret = XB;	break;
-	case EFDCTSIDZ:	ret = XB;	break;
-	case EFDCTSIZ:	ret = XB;	break;
-	case EFDCTUF:	ret = XB;	break;
-	case EFDCTUI:	ret = XB;	break;
-	case EFDCTUIDZ:	ret = XB;	break;
-	case EFDCTUIZ:	ret = XB;	break;
-	case EFDDIV:	ret = AB;	break;
-	case EFDMUL:	ret = AB;	break;
-	case EFDNABS:	ret = XA;	break;
-	case EFDNEG:	ret = XA;	break;
-	case EFDSUB:	ret = AB;	break;
+	case EFSABS:	ret = XA|UNONE;	break;
+	case EFSADD:	ret = AB|USEMI;	break;
+	case EFSCFD:	ret = XB|UNONE;	break;
+	case EFSCMPEQ:	ret = XCR|URAW;	break;
+	case EFSCMPGT:	ret = XCR|URAW;	break;
+	case EFSCMPLT:	ret = XCR|URAW;	break;
+	case EFSCTSF:	ret = XB|URAW;	break;
+	case EFSCTSI:	ret = XB|URAW;	break;
+	case EFSCTSIZ:	ret = XB|URAW;	break;
+	case EFSCTUF:	ret = XB|URAW;	break;
+	case EFSCTUI:	ret = XB|URAW;	break;
+	case EFSCTUIZ:	ret = XB|URAW;	break;
+	case EFSDIV:	ret = AB|UCOOK;	break;
+	case EFSMUL:	ret = AB|UCOOK;	break;
+	case EFSNABS:	ret = XA|UNONE;	break;
+	case EFSNEG:	ret = XA|UNONE;	break;
+	case EFSSUB:	ret = AB|USEMI;	break;
+	case EFSCFSI:	ret = XB|UNONE;	break;
+
+	case EVFSABS:	ret = XA|UNONE;	break;
+	case EVFSADD:	ret = AB|USEMI;	break;
+	case EVFSCMPEQ:	ret = XCR|URAW;	break;
+	case EVFSCMPGT:	ret = XCR|URAW;	break;
+	case EVFSCMPLT:	ret = XCR|URAW;	break;
+	case EVFSCTSF:	ret = XB|URAW;	break;
+	case EVFSCTSI:	ret = XB|URAW;	break;
+	case EVFSCTSIZ:	ret = XB|URAW;	break;
+	case EVFSCTUF:	ret = XB|URAW;	break;
+	case EVFSCTUI:	ret = XB|URAW;	break;
+	case EVFSCTUIZ:	ret = XB|URAW;	break;
+	case EVFSDIV:	ret = AB|UCOOK;	break;
+	case EVFSMUL:	ret = AB|UCOOK;	break;
+	case EVFSNABS:	ret = XA|UNONE;	break;
+	case EVFSNEG:	ret = XA|UNONE;	break;
+	case EVFSSUB:	ret = AB|USEMI;	break;
+
+	case EFDABS:	ret = XA|UNONE;	break;
+	case EFDADD:	ret = AB|USEMI;	break;
+	case EFDCFS:	ret = XB|UNONE;	break;
+	case EFDCMPEQ:	ret = XCR|URAW;	break;
+	case EFDCMPGT:	ret = XCR|URAW;	break;
+	case EFDCMPLT:	ret = XCR|URAW;	break;
+	case EFDCTSF:	ret = XB|URAW;	break;
+	case EFDCTSI:	ret = XB|URAW;	break;
+	case EFDCTSIDZ:	ret = XB|URAW;	break;
+	case EFDCTSIZ:	ret = XB|URAW;	break;
+	case EFDCTUF:	ret = XB|URAW;	break;
+	case EFDCTUI:	ret = XB|URAW;	break;
+	case EFDCTUIDZ:	ret = XB|URAW;	break;
+	case EFDCTUIZ:	ret = XB|URAW;	break;
+	case EFDDIV:	ret = AB|UCOOK;	break;
+	case EFDMUL:	ret = AB|UCOOK;	break;
+	case EFDNABS:	ret = XA|UNONE;	break;
+	case EFDNEG:	ret = XA|UNONE;	break;
+	case EFDSUB:	ret = AB|USEMI;	break;
 	}
 
 	return ret;
@@ -191,7 +196,7 @@ int do_spe_mathemu(struct pt_regs *regs)
 		return -EINVAL;         /* not an spe instruction */
 
 	type = insn_type(speinsn);
-	if (type == NOTYPE)
+	if (type == (NOTYPE|UNONE))
 		goto illegal;
 
 	func = speinsn & 0x7ff;
@@ -219,14 +224,18 @@ int do_spe_mathemu(struct pt_regs *regs)
 		FP_DECL_S(SA); FP_DECL_S(SB); FP_DECL_S(SR);
 
 		switch (type) {
-		case AB:
-		case XCR:
-			FP_UNPACK_SP(SA, va.wp + 1);
-		case XB:
-			FP_UNPACK_SP(SB, vb.wp + 1);
+		case XCR|URAW:
+			FP_UNPACK_RAW_SP(SA, va.wp + 1);
+		case XB|URAW:
+			FP_UNPACK_RAW_SP(SB, vb.wp + 1);
+			break;
+		case AB|USEMI:
+			FP_UNPACK_SEMIRAW_SP(SA, va.wp + 1);
+			FP_UNPACK_SEMIRAW_SP(SB, vb.wp + 1);
 			break;
-		case XA:
+		case AB|UCOOK:
 			FP_UNPACK_SP(SA, va.wp + 1);
+			FP_UNPACK_SP(SB, vb.wp + 1);
 			break;
 		}
 
@@ -248,11 +257,11 @@ int do_spe_mathemu(struct pt_regs *regs)
 
 		case EFSADD:
 			FP_ADD_S(SR, SA, SB);
-			goto pack_s;
+			goto pack_semiraw_s;
 
 		case EFSSUB:
 			FP_SUB_S(SR, SA, SB);
-			goto pack_s;
+			goto pack_semiraw_s;
 
 		case EFSMUL:
 			FP_MUL_S(SR, SA, SB);
@@ -288,14 +297,13 @@ int do_spe_mathemu(struct pt_regs *regs)
 
 		case EFSCFD: {
 			FP_DECL_D(DB);
-			FP_CLEAR_EXCEPTIONS;
-			FP_UNPACK_DP(DB, vb.dp);
+			FP_UNPACK_SEMIRAW_DP(DB, vb.dp);
 
-			pr_debug("DB: %ld %08lx %08lx %ld (%ld)\n",
-					DB_s, DB_f1, DB_f0, DB_e, DB_c);
+			pr_debug("DB: %ld %08lx %08lx %ld\n",
+					DB_s, DB_f1, DB_f0, DB_e);
 
-			FP_CONV(S, D, 1, 2, SR, DB);
-			goto pack_s;
+			FP_TRUNC(S, D, 1, 2, SR, DB);
+			goto pack_semiraw_s;
 		}
 
 		case EFSCTSI:
@@ -325,6 +333,12 @@ int do_spe_mathemu(struct pt_regs *regs)
 		}
 		break;
 
+pack_semiraw_s:
+		pr_debug("SR: %ld %08lx %ld\n", SR_s, SR_f, SR_e);
+
+		FP_PACK_SEMIRAW_SP(vc.wp + 1, SR);
+		goto update_regs;
+
 pack_s:
 		pr_debug("SR: %ld %08lx %ld (%ld)\n", SR_s, SR_f, SR_e, SR_c);
 
@@ -332,9 +346,7 @@ pack_s:
 		goto update_regs;
 
 cmp_s:
-		FP_CMP_S(IR, SA, SB, 3);
-		if (IR == 3 && (FP_ISSIGNAN_S(SA) || FP_ISSIGNAN_S(SB)))
-			FP_SET_EXCEPTION(FP_EX_INVALID);
+		FP_CMP_S(IR, SA, SB, 3, 1);
 		if (IR == cmp) {
 			IR = 0x4;
 		} else {
@@ -347,14 +359,18 @@ cmp_s:
 		FP_DECL_D(DA); FP_DECL_D(DB); FP_DECL_D(DR);
 
 		switch (type) {
-		case AB:
-		case XCR:
-			FP_UNPACK_DP(DA, va.dp);
-		case XB:
-			FP_UNPACK_DP(DB, vb.dp);
+		case XCR|URAW:
+			FP_UNPACK_RAW_DP(DA, va.dp);
+		case XB|URAW:
+			FP_UNPACK_RAW_DP(DB, vb.dp);
 			break;
-		case XA:
+		case AB|USEMI:
+			FP_UNPACK_SEMIRAW_DP(DA, va.dp);
+			FP_UNPACK_SEMIRAW_DP(DB, vb.dp);
+			break;
+		case AB|UCOOK:
 			FP_UNPACK_DP(DA, va.dp);
+			FP_UNPACK_DP(DB, vb.dp);
 			break;
 		}
 
@@ -378,11 +394,11 @@ cmp_s:
 
 		case EFDADD:
 			FP_ADD_D(DR, DA, DB);
-			goto pack_d;
+			goto pack_semiraw_d;
 
 		case EFDSUB:
 			FP_SUB_D(DR, DA, DB);
-			goto pack_d;
+			goto pack_semiraw_d;
 
 		case EFDMUL:
 			FP_MUL_D(DR, DA, DB);
@@ -418,14 +434,13 @@ cmp_s:
 
 		case EFDCFS: {
 			FP_DECL_S(SB);
-			FP_CLEAR_EXCEPTIONS;
-			FP_UNPACK_SP(SB, vb.wp + 1);
+			FP_UNPACK_RAW_SP(SB, vb.wp + 1);
 
-			pr_debug("SB: %ld %08lx %ld (%ld)\n",
-					SB_s, SB_f, SB_e, SB_c);
+			pr_debug("SB: %ld %08lx %ld\n",
+					SB_s, SB_f, SB_e);
 
-			FP_CONV(D, S, 2, 1, DR, SB);
-			goto pack_d;
+			FP_EXTEND(D, S, 2, 1, DR, SB);
+			goto pack_raw_d;
 		}
 
 		case EFDCTUIDZ:
@@ -466,6 +481,20 @@ cmp_s:
 		}
 		break;
 
+pack_raw_d:
+		pr_debug("DR: %ld %08lx %08lx %ld\n",
+				DR_s, DR_f1, DR_f0, DR_e);
+
+		FP_PACK_RAW_DP(vc.dp, DR);
+		goto update_regs;
+
+pack_semiraw_d:
+		pr_debug("DR: %ld %08lx %08lx %ld\n",
+				DR_s, DR_f1, DR_f0, DR_e);
+
+		FP_PACK_SEMIRAW_DP(vc.dp, DR);
+		goto update_regs;
+
 pack_d:
 		pr_debug("DR: %ld %08lx %08lx %ld (%ld)\n",
 				DR_s, DR_f1, DR_f0, DR_e, DR_c);
@@ -474,9 +503,7 @@ pack_d:
 		goto update_regs;
 
 cmp_d:
-		FP_CMP_D(IR, DA, DB, 3);
-		if (IR == 3 && (FP_ISSIGNAN_D(DA) || FP_ISSIGNAN_D(DB)))
-			FP_SET_EXCEPTION(FP_EX_INVALID);
+		FP_CMP_D(IR, DA, DB, 3, 1);
 		if (IR == cmp) {
 			IR = 0x4;
 		} else {
@@ -492,18 +519,25 @@ cmp_d:
 		int IR0, IR1;
 
 		switch (type) {
-		case AB:
-		case XCR:
+		case XCR|URAW:
+			FP_UNPACK_RAW_SP(SA0, va.wp);
+			FP_UNPACK_RAW_SP(SA1, va.wp + 1);
+		case XB|URAW:
+			FP_UNPACK_RAW_SP(SB0, vb.wp);
+			FP_UNPACK_RAW_SP(SB1, vb.wp + 1);
+			break;
+		case AB|USEMI:
+			FP_UNPACK_SEMIRAW_SP(SA0, va.wp);
+			FP_UNPACK_SEMIRAW_SP(SA1, va.wp + 1);
+			FP_UNPACK_SEMIRAW_SP(SB0, vb.wp);
+			FP_UNPACK_SEMIRAW_SP(SB1, vb.wp + 1);
+			break;
+		case AB|UCOOK:
 			FP_UNPACK_SP(SA0, va.wp);
 			FP_UNPACK_SP(SA1, va.wp + 1);
-		case XB:
 			FP_UNPACK_SP(SB0, vb.wp);
 			FP_UNPACK_SP(SB1, vb.wp + 1);
 			break;
-		case XA:
-			FP_UNPACK_SP(SA0, va.wp);
-			FP_UNPACK_SP(SA1, va.wp + 1);
-			break;
 		}
 
 		pr_debug("SA0: %ld %08lx %ld (%ld)\n",
@@ -534,12 +568,12 @@ cmp_d:
 		case EVFSADD:
 			FP_ADD_S(SR0, SA0, SB0);
 			FP_ADD_S(SR1, SA1, SB1);
-			goto pack_vs;
+			goto pack_semiraw_vs;
 
 		case EVFSSUB:
 			FP_SUB_S(SR0, SA0, SB0);
 			FP_SUB_S(SR1, SA1, SB1);
-			goto pack_vs;
+			goto pack_semiraw_vs;
 
 		case EVFSMUL:
 			FP_MUL_S(SR0, SA0, SB0);
@@ -624,6 +658,16 @@ cmp_d:
 		}
 		break;
 
+pack_semiraw_vs:
+		pr_debug("SR0: %ld %08lx %ld\n",
+				SR0_s, SR0_f, SR0_e);
+		pr_debug("SR1: %ld %08lx %ld\n",
+				SR1_s, SR1_f, SR1_e);
+
+		FP_PACK_SEMIRAW_SP(vc.wp, SR0);
+		FP_PACK_SEMIRAW_SP(vc.wp + 1, SR1);
+		goto update_regs;
+
 pack_vs:
 		pr_debug("SR0: %ld %08lx %ld (%ld)\n",
 				SR0_s, SR0_f, SR0_e, SR0_c);
@@ -638,12 +682,8 @@ cmp_vs:
 		{
 			int ch, cl;
 
-			FP_CMP_S(IR0, SA0, SB0, 3);
-			FP_CMP_S(IR1, SA1, SB1, 3);
-			if (IR0 == 3 && (FP_ISSIGNAN_S(SA0) || FP_ISSIGNAN_S(SB0)))
-				FP_SET_EXCEPTION(FP_EX_INVALID);
-			if (IR1 == 3 && (FP_ISSIGNAN_S(SA1) || FP_ISSIGNAN_S(SB1)))
-				FP_SET_EXCEPTION(FP_EX_INVALID);
+			FP_CMP_S(IR0, SA0, SB0, 3, 1);
+			FP_CMP_S(IR1, SA1, SB1, 3, 1);
 			ch = (IR0 == cmp) ? 1 : 0;
 			cl = (IR1 == cmp) ? 1 : 0;
 			IR = (ch << 3) | (cl << 2) | ((ch | cl) << 1) |
@@ -737,7 +777,7 @@ int speround_handler(struct pt_regs *regs)
 		return -EINVAL;         /* not an spe instruction */
 
 	func = speinsn & 0x7ff;
-	type = insn_type(func);
+	type = insn_type(func) & TYPE_MASK;
 	if (type == XCR) return -ENOSYS;
 
 	__FPU_FPSCR = mfspr(SPRN_SPEFSCR);
diff --git a/arch/powerpc/math-emu/stfs.c b/arch/powerpc/math-emu/stfs.c
index 6122147..6072b14 100644
--- a/arch/powerpc/math-emu/stfs.c
+++ b/arch/powerpc/math-emu/stfs.c
@@ -19,19 +19,19 @@ stfs(void *frS, void *ea)
 	printk("%s: S %p, ea %p\n", __func__, frS, ea);
 #endif
 
-	FP_UNPACK_DP(A, frS);
+	FP_UNPACK_SEMIRAW_DP(A, frS);
 
 #ifdef DEBUG
 	printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c);
 #endif
 
-	FP_CONV(S, D, 1, 2, R, A);
+	FP_TRUNC(S, D, 1, 2, R, A);
 
 #ifdef DEBUG
 	printk("R: %ld %lu %ld (%ld)\n", R_s, R_f, R_e, R_c);
 #endif
 
-	_FP_PACK_CANONICAL(S, 1, R);
+	_FP_PACK_SEMIRAW(S, 1, R);
 	if (!FP_CUR_EXCEPTIONS || !__FPU_TRAP_P(FP_CUR_EXCEPTIONS)) {
 		_FP_PACK_RAW_1_P(S, &f, R);
 		if (copy_to_user(ea, &f, sizeof(float)))
diff --git a/arch/s390/include/asm/sfp-machine.h b/arch/s390/include/asm/sfp-machine.h
index 4e16aed..67f9eed 100644
--- a/arch/s390/include/asm/sfp-machine.h
+++ b/arch/s390/include/asm/sfp-machine.h
@@ -38,6 +38,13 @@
 #define _FP_MUL_MEAT_Q(R,X,Y)					\
   _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
 
+#define _FP_MUL_MEAT_DW_S(R,X,Y)				\
+  _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_D(R,X,Y)				\
+  _FP_MUL_MEAT_DW_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_Q(R,X,Y)				\
+  _FP_MUL_MEAT_DW_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
 #define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv(S,R,X,Y)
 #define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
 #define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
@@ -50,6 +57,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /*
  * If one NaN is signaling and the other is not,
@@ -139,4 +147,6 @@
 /* We write the results always */
 #define FP_INHIBIT_RESULTS 0
 
+#define _FP_TININESS_AFTER_ROUNDING 0
+
 #endif
diff --git a/arch/s390/math-emu/math.c b/arch/s390/math-emu/math.c
index a6ba0d7..4dd5015 100644
--- a/arch/s390/math-emu/math.c
+++ b/arch/s390/math-emu/math.c
@@ -152,12 +152,12 @@ static int emu_axbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[rx].ui;
         cvt.w.low = current->thread.fp_regs.fprs[rx+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_SEMIRAW_QP(QA, &cvt.ld);
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QB, &cvt.ld);
+        FP_UNPACK_SEMIRAW_QP(QB, &cvt.ld);
         FP_ADD_Q(QR, QA, QB);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_PACK_SEMIRAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         emu_set_CC_cs(regs, QR_c, QR_s);
@@ -171,10 +171,10 @@ static int emu_adbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-        FP_UNPACK_DP(DB, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+        FP_UNPACK_SEMIRAW_DP(DB, &current->thread.fp_regs.fprs[ry].d);
         FP_ADD_D(DR, DA, DB);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -186,10 +186,10 @@ static int emu_adb (struct pt_regs *regs, int rx, double *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-        FP_UNPACK_DP(DB, val);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+        FP_UNPACK_SEMIRAW_DP(DB, val);
         FP_ADD_D(DR, DA, DB);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -201,10 +201,10 @@ static int emu_aebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-        FP_UNPACK_SP(SB, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_SEMIRAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+        FP_UNPACK_SEMIRAW_SP(SB, &current->thread.fp_regs.fprs[ry].f);
         FP_ADD_S(SR, SA, SB);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
@@ -216,10 +216,10 @@ static int emu_aeb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-        FP_UNPACK_SP(SB, val);
+        FP_UNPACK_SEMIRAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+        FP_UNPACK_SEMIRAW_SP(SB, val);
         FP_ADD_S(SR, SA, SB);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
@@ -236,7 +236,7 @@ static int emu_cxbr (struct pt_regs *regs, int rx, int ry) {
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
         FP_UNPACK_RAW_QP(QB, &cvt.ld);
-        FP_CMP_Q(IR, QA, QB, 3);
+        FP_CMP_Q(IR, QA, QB, 3, 0);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
@@ -252,7 +252,7 @@ static int emu_cdbr (struct pt_regs *regs, int rx, int ry) {
 
         FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_RAW_DP(DB, &current->thread.fp_regs.fprs[ry].d);
-        FP_CMP_D(IR, DA, DB, 3);
+        FP_CMP_D(IR, DA, DB, 3, 0);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
@@ -268,7 +268,7 @@ static int emu_cdb (struct pt_regs *regs, int rx, double *val) {
 
         FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_RAW_DP(DB, val);
-        FP_CMP_D(IR, DA, DB, 3);
+        FP_CMP_D(IR, DA, DB, 3, 0);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
@@ -284,7 +284,7 @@ static int emu_cebr (struct pt_regs *regs, int rx, int ry) {
 
         FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_RAW_SP(SB, &current->thread.fp_regs.fprs[ry].f);
-        FP_CMP_S(IR, SA, SB, 3);
+        FP_CMP_S(IR, SA, SB, 3, 0);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
@@ -300,7 +300,7 @@ static int emu_ceb (struct pt_regs *regs, int rx, float *val) {
 
         FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_RAW_SP(SB, val);
-        FP_CMP_S(IR, SA, SB, 3);
+        FP_CMP_S(IR, SA, SB, 3, 0);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
@@ -322,14 +322,12 @@ static int emu_kxbr (struct pt_regs *regs, int rx, int ry) {
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
         FP_UNPACK_QP(QB, &cvt.ld);
-        FP_CMP_Q(IR, QA, QB, 3);
+        FP_CMP_Q(IR, QA, QB, 3, 2);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
          */
         emu_set_CC(regs, (IR == -1) ? 1 : (IR == 1) ? 2 : IR);
-        if (IR == 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -341,14 +339,12 @@ static int emu_kdbr (struct pt_regs *regs, int rx, int ry) {
 
         FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_RAW_DP(DB, &current->thread.fp_regs.fprs[ry].d);
-        FP_CMP_D(IR, DA, DB, 3);
+        FP_CMP_D(IR, DA, DB, 3, 2);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
          */
         emu_set_CC(regs, (IR == -1) ? 1 : (IR == 1) ? 2 : IR);
-        if (IR == 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -360,14 +356,12 @@ static int emu_kdb (struct pt_regs *regs, int rx, double *val) {
 
         FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_RAW_DP(DB, val);
-        FP_CMP_D(IR, DA, DB, 3);
+        FP_CMP_D(IR, DA, DB, 3, 2);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
          */
         emu_set_CC(regs, (IR == -1) ? 1 : (IR == 1) ? 2 : IR);
-        if (IR == 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -379,14 +373,12 @@ static int emu_kebr (struct pt_regs *regs, int rx, int ry) {
 
         FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_RAW_SP(SB, &current->thread.fp_regs.fprs[ry].f);
-        FP_CMP_S(IR, SA, SB, 3);
+        FP_CMP_S(IR, SA, SB, 3, 2);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
          */
         emu_set_CC(regs, (IR == -1) ? 1 : (IR == 1) ? 2 : IR);
-        if (IR == 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -398,14 +390,12 @@ static int emu_keb (struct pt_regs *regs, int rx, float *val) {
 
         FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_RAW_SP(SB, val);
-        FP_CMP_S(IR, SA, SB, 3);
+        FP_CMP_S(IR, SA, SB, 3, 2);
         /*
          * IR == -1 if DA < DB, IR == 0 if DA == DB,
          * IR == 1 if DA > DB and IR == 3 if unorderded
          */
         emu_set_CC(regs, (IR == -1) ? 1 : (IR == 1) ? 2 : IR);
-        if (IR == 3)
-                FP_SET_EXCEPTION (FP_EX_INVALID);
         return _fex;
 }
 
@@ -419,8 +409,8 @@ static int emu_cxfbr (struct pt_regs *regs, int rx, int ry) {
 
 	mode = current->thread.fp_regs.fpc & 3;
         si = regs->gprs[ry];
-        FP_FROM_INT_Q(QR, si, 32, int);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_FROM_INT_Q(QR, si, 32, unsigned int);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -435,8 +425,8 @@ static int emu_cdfbr (struct pt_regs *regs, int rx, int ry) {
 
 	mode = current->thread.fp_regs.fpc & 3;
         si = regs->gprs[ry];
-        FP_FROM_INT_D(DR, si, 32, int);
-        FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+        FP_FROM_INT_D(DR, si, 32, unsigned int);
+        FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
 }
 
@@ -449,8 +439,8 @@ static int emu_cefbr (struct pt_regs *regs, int rx, int ry) {
 
 	mode = current->thread.fp_regs.fpc & 3;
         si = regs->gprs[ry];
-        FP_FROM_INT_S(SR, si, 32, int);
-        FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+        FP_FROM_INT_S(SR, si, 32, unsigned int);
+        FP_PACK_RAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         return _fex;
 }
 
@@ -459,7 +449,7 @@ static int emu_cfxbr (struct pt_regs *regs, int rx, int ry, int mask) {
         FP_DECL_Q(QA);
         FP_DECL_EX;
 	mathemu_ldcv cvt;
-        __s32 si;
+        __u32 ui;
         int mode;
 
 	if (mask == 0)
@@ -470,9 +460,9 @@ static int emu_cfxbr (struct pt_regs *regs, int rx, int ry, int mask) {
 		mode = mask - 4;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
-        FP_TO_INT_ROUND_Q(si, QA, 32, 1);
-        regs->gprs[rx] = si;
+        FP_UNPACK_RAW_QP(QA, &cvt.ld);
+        FP_TO_INT_ROUND_Q(ui, QA, 32, 1);
+        regs->gprs[rx] = ui;
         emu_set_CC_cs(regs, QA_c, QA_s);
         return _fex;
 }
@@ -481,7 +471,7 @@ static int emu_cfxbr (struct pt_regs *regs, int rx, int ry, int mask) {
 static int emu_cfdbr (struct pt_regs *regs, int rx, int ry, int mask) {
         FP_DECL_D(DA);
         FP_DECL_EX;
-        __s32 si;
+        __u32 ui;
         int mode;
 
 	if (mask == 0)
@@ -490,9 +480,9 @@ static int emu_cfdbr (struct pt_regs *regs, int rx, int ry, int mask) {
 		mode = FP_RND_NEAREST;
 	else
 		mode = mask - 4;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
-        FP_TO_INT_ROUND_D(si, DA, 32, 1);
-        regs->gprs[rx] = si;
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+        FP_TO_INT_ROUND_D(ui, DA, 32, 1);
+        regs->gprs[rx] = ui;
         emu_set_CC_cs(regs, DA_c, DA_s);
         return _fex;
 }
@@ -501,7 +491,7 @@ static int emu_cfdbr (struct pt_regs *regs, int rx, int ry, int mask) {
 static int emu_cfebr (struct pt_regs *regs, int rx, int ry, int mask) {
         FP_DECL_S(SA);
         FP_DECL_EX;
-        __s32 si;
+        __u32 ui;
         int mode;
 
 	if (mask == 0)
@@ -510,9 +500,9 @@ static int emu_cfebr (struct pt_regs *regs, int rx, int ry, int mask) {
 		mode = FP_RND_NEAREST;
 	else
 		mode = mask - 4;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
-        FP_TO_INT_ROUND_S(si, SA, 32, 1);
-        regs->gprs[rx] = si;
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+        FP_TO_INT_ROUND_S(ui, SA, 32, 1);
+        regs->gprs[rx] = ui;
         emu_set_CC_cs(regs, SA_c, SA_s);
         return _fex;
 }
@@ -662,9 +652,9 @@ static int emu_lcxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_RAW_QP(QA, &cvt.ld);
 	FP_NEG_Q(QR, QA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         emu_set_CC_cs(regs, QR_c, QR_s);
@@ -678,9 +668,9 @@ static int emu_lcdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
 	FP_NEG_D(DR, DA);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -692,9 +682,9 @@ static int emu_lcebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
 	FP_NEG_S(SR, SA);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_RAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
@@ -773,9 +763,9 @@ static int emu_lxdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
-	FP_CONV (Q, D, 4, 2, QR, DA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+	FP_EXTEND (Q, D, 4, 2, QR, DA);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -789,9 +779,9 @@ static int emu_lxdb (struct pt_regs *regs, int rx, double *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, val);
-	FP_CONV (Q, D, 4, 2, QR, DA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_UNPACK_RAW_DP(DA, val);
+	FP_EXTEND (Q, D, 4, 2, QR, DA);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -805,9 +795,9 @@ static int emu_lxebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
-	FP_CONV (Q, S, 4, 1, QR, SA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+	FP_EXTEND (Q, S, 4, 1, QR, SA);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -821,9 +811,9 @@ static int emu_lxeb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, val);
-	FP_CONV (Q, S, 4, 1, QR, SA);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_UNPACK_RAW_SP(SA, val);
+	FP_EXTEND (Q, S, 4, 1, QR, SA);
+        FP_PACK_RAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         return _fex;
@@ -836,9 +826,9 @@ static int emu_ldebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
-	FP_CONV (D, S, 2, 1, DR, SA);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+	FP_EXTEND (D, S, 2, 1, DR, SA);
+	FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
 }
 
@@ -849,9 +839,9 @@ static int emu_ldeb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, val);
-	FP_CONV (D, S, 2, 1, DR, SA);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+        FP_UNPACK_RAW_SP(SA, val);
+	FP_EXTEND (D, S, 2, 1, DR, SA);
+	FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
 }
 
@@ -865,10 +855,10 @@ static int emu_lnxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_RAW_QP(QA, &cvt.ld);
         if (QA_s == 0) {
 		FP_NEG_Q(QR, QA);
-		FP_PACK_QP(&cvt.ld, QR);
+		FP_PACK_RAW_QP(&cvt.ld, QR);
 		current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
 		current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
 	} else {
@@ -888,10 +878,10 @@ static int emu_lndbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
         if (DA_s == 0) {
 		FP_NEG_D(DR, DA);
-		FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+		FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
 	} else
 		current->thread.fp_regs.fprs[rx].ui =
 			current->thread.fp_regs.fprs[ry].ui;
@@ -906,10 +896,10 @@ static int emu_lnebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
         if (SA_s == 0) {
 		FP_NEG_S(SR, SA);
-		FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+		FP_PACK_RAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
 	} else
 		current->thread.fp_regs.fprs[rx].ui =
 			current->thread.fp_regs.fprs[ry].ui;
@@ -927,10 +917,10 @@ static int emu_lpxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_RAW_QP(QA, &cvt.ld);
         if (QA_s != 0) {
 		FP_NEG_Q(QR, QA);
-		FP_PACK_QP(&cvt.ld, QR);
+		FP_PACK_RAW_QP(&cvt.ld, QR);
 		current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
 		current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
 	} else{
@@ -950,10 +940,10 @@ static int emu_lpdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
         if (DA_s != 0) {
 		FP_NEG_D(DR, DA);
-		FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+		FP_PACK_RAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
 	} else
 		current->thread.fp_regs.fprs[rx].ui =
 			current->thread.fp_regs.fprs[ry].ui;
@@ -968,10 +958,10 @@ static int emu_lpebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
         if (SA_s != 0) {
 		FP_NEG_S(SR, SA);
-		FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+		FP_PACK_RAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
 	} else
 		current->thread.fp_regs.fprs[rx].ui =
 			current->thread.fp_regs.fprs[ry].ui;
@@ -989,9 +979,9 @@ static int emu_ldxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
-	FP_CONV (D, Q, 2, 4, DR, QA);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].f, DR);
+        FP_UNPACK_SEMIRAW_QP(QA, &cvt.ld);
+	FP_TRUNC (D, Q, 2, 4, DR, QA);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].f, DR);
         return _fex;
 }
 
@@ -1005,9 +995,9 @@ static int emu_lexbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
-	FP_CONV (S, Q, 1, 4, SR, QA);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+        FP_UNPACK_SEMIRAW_QP(QA, &cvt.ld);
+	FP_TRUNC (S, Q, 1, 4, SR, QA);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         return _fex;
 }
 
@@ -1018,9 +1008,9 @@ static int emu_ledbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
-	FP_CONV (S, D, 1, 2, SR, DA);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+	FP_TRUNC (S, D, 1, 2, SR, DA);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         return _fex;
 }
 
@@ -1081,10 +1071,12 @@ static int emu_mxdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-	FP_CONV (Q, D, 4, 2, QA, DA);
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[ry].d);
-	FP_CONV (Q, D, 4, 2, QB, DA);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+	FP_EXTEND (Q, D, 4, 2, QA, DA);
+	_FP_UNPACK_CANONICAL(Q, 4, QA);
+        FP_UNPACK_RAW_DP(DA, &current->thread.fp_regs.fprs[ry].d);
+	FP_EXTEND (Q, D, 4, 2, QB, DA);
+	_FP_UNPACK_CANONICAL(Q, 4, QB);
         FP_MUL_Q(QR, QA, QB);
         FP_PACK_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
@@ -1146,10 +1138,12 @@ static int emu_mdebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-	FP_CONV (D, S, 2, 1, DA, SA);
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[ry].f);
-	FP_CONV (D, S, 2, 1, DB, SA);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+	FP_EXTEND (D, S, 2, 1, DA, SA);
+	_FP_UNPACK_CANONICAL(D, 2, DA);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[ry].f);
+	FP_EXTEND (D, S, 2, 1, DB, SA);
+	_FP_UNPACK_CANONICAL(D, 2, DB);
         FP_MUL_D(DR, DA, DB);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
@@ -1162,10 +1156,12 @@ static int emu_mdeb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-	FP_CONV (D, S, 2, 1, DA, SA);
-        FP_UNPACK_SP(SA, val);
-	FP_CONV (D, S, 2, 1, DB, SA);
+        FP_UNPACK_RAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+	FP_EXTEND (D, S, 2, 1, DA, SA);
+	_FP_UNPACK_CANONICAL(D, 2, DA);
+        FP_UNPACK_RAW_SP(SA, val);
+	FP_EXTEND (D, S, 2, 1, DB, SA);
+	_FP_UNPACK_CANONICAL(D, 2, DB);
         FP_MUL_D(DR, DA, DB);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         return _fex;
@@ -1181,8 +1177,7 @@ static int emu_madbr (struct pt_regs *regs, int rx, int ry, int rz) {
         FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_DP(DB, &current->thread.fp_regs.fprs[ry].d);
         FP_UNPACK_DP(DC, &current->thread.fp_regs.fprs[rz].d);
-        FP_MUL_D(DR, DA, DB);
-        FP_ADD_D(DR, DR, DC);
+	FP_FMA_D(DR, DA, DB, DC);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rz].d, DR);
         return _fex;
 }
@@ -1197,8 +1192,7 @@ static int emu_madb (struct pt_regs *regs, int rx, double *val, int rz) {
         FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_DP(DB, val);
         FP_UNPACK_DP(DC, &current->thread.fp_regs.fprs[rz].d);
-        FP_MUL_D(DR, DA, DB);
-        FP_ADD_D(DR, DR, DC);
+	FP_FMA_D(DR, DA, DB, DC);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rz].d, DR);
         return _fex;
 }
@@ -1213,8 +1207,7 @@ static int emu_maebr (struct pt_regs *regs, int rx, int ry, int rz) {
         FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_SP(SB, &current->thread.fp_regs.fprs[ry].f);
         FP_UNPACK_SP(SC, &current->thread.fp_regs.fprs[rz].f);
-        FP_MUL_S(SR, SA, SB);
-        FP_ADD_S(SR, SR, SC);
+        FP_FMA_S(SR, SA, SB, SC);
 	FP_PACK_SP(&current->thread.fp_regs.fprs[rz].f, SR);
         return _fex;
 }
@@ -1229,8 +1222,7 @@ static int emu_maeb (struct pt_regs *regs, int rx, float *val, int rz) {
         FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_SP(SB, val);
         FP_UNPACK_SP(SC, &current->thread.fp_regs.fprs[rz].f);
-        FP_MUL_S(SR, SA, SB);
-        FP_ADD_S(SR, SR, SC);
+        FP_FMA_S(SR, SA, SB, SC);
 	FP_PACK_SP(&current->thread.fp_regs.fprs[rz].f, SR);
         return _fex;
 }
@@ -1245,8 +1237,9 @@ static int emu_msdbr (struct pt_regs *regs, int rx, int ry, int rz) {
         FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_DP(DB, &current->thread.fp_regs.fprs[ry].d);
         FP_UNPACK_DP(DC, &current->thread.fp_regs.fprs[rz].d);
-        FP_MUL_D(DR, DA, DB);
-        FP_SUB_D(DR, DR, DC);
+	if (DC##_c != FP_CLS_NAN)
+		DC##_s ^= 1;
+	FP_FMA_D(DR, DA, DB, DC);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rz].d, DR);
         return _fex;
 }
@@ -1261,8 +1254,9 @@ static int emu_msdb (struct pt_regs *regs, int rx, double *val, int rz) {
         FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
         FP_UNPACK_DP(DB, val);
         FP_UNPACK_DP(DC, &current->thread.fp_regs.fprs[rz].d);
-        FP_MUL_D(DR, DA, DB);
-        FP_SUB_D(DR, DR, DC);
+	if (DC##_c != FP_CLS_NAN)
+		DC##_s ^= 1;
+	FP_FMA_D(DR, DA, DB, DC);
 	FP_PACK_DP(&current->thread.fp_regs.fprs[rz].d, DR);
         return _fex;
 }
@@ -1277,8 +1271,9 @@ static int emu_msebr (struct pt_regs *regs, int rx, int ry, int rz) {
         FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_SP(SB, &current->thread.fp_regs.fprs[ry].f);
         FP_UNPACK_SP(SC, &current->thread.fp_regs.fprs[rz].f);
-        FP_MUL_S(SR, SA, SB);
-        FP_SUB_S(SR, SR, SC);
+	if (SC##_c != FP_CLS_NAN)
+		SC##_s ^= 1;
+        FP_FMA_S(SR, SA, SB, SC);
 	FP_PACK_SP(&current->thread.fp_regs.fprs[rz].f, SR);
         return _fex;
 }
@@ -1293,8 +1288,9 @@ static int emu_mseb (struct pt_regs *regs, int rx, float *val, int rz) {
         FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
         FP_UNPACK_SP(SB, val);
         FP_UNPACK_SP(SC, &current->thread.fp_regs.fprs[rz].f);
-        FP_MUL_S(SR, SA, SB);
-        FP_SUB_S(SR, SR, SC);
+	if (SC##_c != FP_CLS_NAN)
+		SC##_s ^= 1;
+        FP_FMA_S(SR, SA, SB, SC);
 	FP_PACK_SP(&current->thread.fp_regs.fprs[rz].f, SR);
         return _fex;
 }
@@ -1395,12 +1391,12 @@ static int emu_sxbr (struct pt_regs *regs, int rx, int ry) {
 	mode = current->thread.fp_regs.fpc & 3;
         cvt.w.high = current->thread.fp_regs.fprs[rx].ui;
         cvt.w.low = current->thread.fp_regs.fprs[rx+2].ui;
-        FP_UNPACK_QP(QA, &cvt.ld);
+        FP_UNPACK_SEMIRAW_QP(QA, &cvt.ld);
         cvt.w.high = current->thread.fp_regs.fprs[ry].ui;
         cvt.w.low = current->thread.fp_regs.fprs[ry+2].ui;
-        FP_UNPACK_QP(QB, &cvt.ld);
+        FP_UNPACK_SEMIRAW_QP(QB, &cvt.ld);
         FP_SUB_Q(QR, QA, QB);
-        FP_PACK_QP(&cvt.ld, QR);
+        FP_PACK_SEMIRAW_QP(&cvt.ld, QR);
         current->thread.fp_regs.fprs[rx].ui = cvt.w.high;
         current->thread.fp_regs.fprs[rx+2].ui = cvt.w.low;
         emu_set_CC_cs(regs, QR_c, QR_s);
@@ -1414,10 +1410,10 @@ static int emu_sdbr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-        FP_UNPACK_DP(DB, &current->thread.fp_regs.fprs[ry].d);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+        FP_UNPACK_SEMIRAW_DP(DB, &current->thread.fp_regs.fprs[ry].d);
         FP_SUB_D(DR, DA, DB);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -1429,10 +1425,10 @@ static int emu_sdb (struct pt_regs *regs, int rx, double *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_DP(DA, &current->thread.fp_regs.fprs[rx].d);
-        FP_UNPACK_DP(DB, val);
+        FP_UNPACK_SEMIRAW_DP(DA, &current->thread.fp_regs.fprs[rx].d);
+        FP_UNPACK_SEMIRAW_DP(DB, val);
         FP_SUB_D(DR, DA, DB);
-	FP_PACK_DP(&current->thread.fp_regs.fprs[rx].d, DR);
+	FP_PACK_SEMIRAW_DP(&current->thread.fp_regs.fprs[rx].d, DR);
         emu_set_CC_cs(regs, DR_c, DR_s);
         return _fex;
 }
@@ -1444,10 +1440,10 @@ static int emu_sebr (struct pt_regs *regs, int rx, int ry) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-        FP_UNPACK_SP(SB, &current->thread.fp_regs.fprs[ry].f);
+        FP_UNPACK_SEMIRAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+        FP_UNPACK_SEMIRAW_SP(SB, &current->thread.fp_regs.fprs[ry].f);
         FP_SUB_S(SR, SA, SB);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
@@ -1459,10 +1455,10 @@ static int emu_seb (struct pt_regs *regs, int rx, float *val) {
         int mode;
 
 	mode = current->thread.fp_regs.fpc & 3;
-        FP_UNPACK_SP(SA, &current->thread.fp_regs.fprs[rx].f);
-        FP_UNPACK_SP(SB, val);
+        FP_UNPACK_SEMIRAW_SP(SA, &current->thread.fp_regs.fprs[rx].f);
+        FP_UNPACK_SEMIRAW_SP(SB, val);
         FP_SUB_S(SR, SA, SB);
-	FP_PACK_SP(&current->thread.fp_regs.fprs[rx].f, SR);
+	FP_PACK_SEMIRAW_SP(&current->thread.fp_regs.fprs[rx].f, SR);
         emu_set_CC_cs(regs, SR_c, SR_s);
         return _fex;
 }
diff --git a/arch/sh/include/asm/sfp-machine.h b/arch/sh/include/asm/sfp-machine.h
index d3c5484..01e05fe 100644
--- a/arch/sh/include/asm/sfp-machine.h
+++ b/arch/sh/include/asm/sfp-machine.h
@@ -37,6 +37,13 @@
 #define _FP_MUL_MEAT_Q(R,X,Y)					\
   _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
 
+#define _FP_MUL_MEAT_DW_S(R,X,Y)				\
+  _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_D(R,X,Y)				\
+  _FP_MUL_MEAT_DW_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_Q(R,X,Y)				\
+  _FP_MUL_MEAT_DW_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
 #define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv(S,R,X,Y)
 #define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
 #define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
@@ -49,6 +56,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /*
  * If one NaN is signaling and the other is not,
@@ -80,5 +88,7 @@
 #define FP_EX_UNDERFLOW		(1<<1)
 #define FP_EX_INEXACT		(1<<0)
 
+#define _FP_TININESS_AFTER_ROUNDING 1
+
 #endif
 
diff --git a/arch/sh/math-emu/math.c b/arch/sh/math-emu/math.c
index 04aa55f..5975df5 100644
--- a/arch/sh/math-emu/math.c
+++ b/arch/sh/math-emu/math.c
@@ -55,11 +55,26 @@
 #define READ(d,a)	({if(get_user(d, (typeof (d)*)a)) return -EFAULT;})
 
 #define PACK_S(r,f)	FP_PACK_SP(&r,f)
+#define PACK_SEMIRAW_S(r,f)	FP_PACK_SEMIRAW_SP(&r,f)
+#define PACK_RAW_S(r,f)	FP_PACK_RAW_SP(&r,f)
 #define UNPACK_S(f,r)	FP_UNPACK_SP(f,&r)
+#define UNPACK_SEMIRAW_S(f,r)	FP_UNPACK_SEMIRAW_SP(f,&r)
+#define UNPACK_RAW_S(f,r)	FP_UNPACK_RAW_SP(f,&r)
 #define PACK_D(r,f) \
 	{u32 t[2]; FP_PACK_DP(t,f); ((u32*)&r)[0]=t[1]; ((u32*)&r)[1]=t[0];}
+#define PACK_SEMIRAW_D(r,f) \
+	{u32 t[2]; FP_PACK_SEMIRAW_DP(t,f); ((u32*)&r)[0]=t[1]; \
+		((u32*)&r)[1]=t[0];}
+#define PACK_RAW_D(r,f) \
+	{u32 t[2]; FP_PACK_RAW_DP(t,f); ((u32*)&r)[0]=t[1]; ((u32*)&r)[1]=t[0];}
 #define UNPACK_D(f,r) \
 	{u32 t[2]; t[0]=((u32*)&r)[1]; t[1]=((u32*)&r)[0]; FP_UNPACK_DP(f,t);}
+#define UNPACK_SEMIRAW_D(f,r) \
+	{u32 t[2]; t[0]=((u32*)&r)[1]; t[1]=((u32*)&r)[0]; \
+		FP_UNPACK_SEMIRAW_DP(f,t);}
+#define UNPACK_RAW_D(f,r) \
+	{u32 t[2]; t[0]=((u32*)&r)[1]; t[1]=((u32*)&r)[0]; \
+		FP_UNPACK_RAW_DP(f,t);}
 
 // 2 args instructions.
 #define BOTH_PRmn(op,x) \
@@ -68,11 +83,11 @@
 #define CMP_X(SZ,R,M,N) do{ \
 	FP_DECL_##SZ(Fm); FP_DECL_##SZ(Fn); \
 	UNPACK_##SZ(Fm, M); UNPACK_##SZ(Fn, N); \
-	FP_CMP_##SZ(R, Fn, Fm, 2); }while(0)
+	FP_CMP_##SZ(R, Fn, Fm, 2, 0); }while(0)
 #define EQ_X(SZ,R,M,N) do{ \
 	FP_DECL_##SZ(Fm); FP_DECL_##SZ(Fn); \
 	UNPACK_##SZ(Fm, M); UNPACK_##SZ(Fn, N); \
-	FP_CMP_EQ_##SZ(R, Fn, Fm); }while(0)
+	FP_CMP_EQ_##SZ(R, Fn, Fm, 0); }while(0)
 #define CMP(OP) ({ int r; BOTH_PRmn(OP##_X,r); r; })
 
 static int
@@ -102,17 +117,23 @@ fcmp_eq(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
 	FP_##OP##_##SZ(Fr, Fn, Fm); \
 	PACK_##SZ(N, Fr); }while(0)
 
+#define ARITH_SEMIRAW_X(SZ,OP,M,N) do{ \
+	FP_DECL_##SZ(Fm); FP_DECL_##SZ(Fn); FP_DECL_##SZ(Fr); \
+	UNPACK_SEMIRAW_##SZ(Fm, M); UNPACK_SEMIRAW_##SZ(Fn, N); \
+	FP_##OP##_##SZ(Fr, Fn, Fm); \
+	PACK_SEMIRAW_##SZ(N, Fr); }while(0)
+
 static int
 fadd(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
 {
-	BOTH_PRmn(ARITH_X, ADD);
+	BOTH_PRmn(ARITH_SEMIRAW_X, ADD);
 	return 0;
 }
 
 static int
 fsub(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
 {
-	BOTH_PRmn(ARITH_X, SUB);
+	BOTH_PRmn(ARITH_SEMIRAW_X, SUB);
 	return 0;
 }
 
@@ -135,15 +156,13 @@ fmac(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
 {
 	FP_DECL_EX;
 	FP_DECL_S(Fr);
-	FP_DECL_S(Ft);
 	FP_DECL_S(F0);
 	FP_DECL_S(Fm);
 	FP_DECL_S(Fn);
 	UNPACK_S(F0, FR0);
 	UNPACK_S(Fm, FRm);
 	UNPACK_S(Fn, FRn);
-	FP_MUL_S(Ft, Fm, F0);
-	FP_ADD_S(Fr, Fn, Ft);
+	FP_FMA_S(Fr, Fm, F0, Fn);
 	PACK_S(FRn, Fr);
 	return 0;
 }
@@ -284,8 +303,8 @@ NOTYETn(fsrra)
 
 #define EMU_FLOAT_X(SZ,N) do { \
 	FP_DECL_##SZ(Fn); \
-	FP_FROM_INT_##SZ(Fn, FPUL, 32, int); \
-	PACK_##SZ(N, Fn); }while(0)
+	FP_FROM_INT_##SZ(Fn, FPUL, 32, unsigned int); \
+	PACK_RAW_##SZ(N, Fn); }while(0)
 static int ffloat(struct sh_fpu_soft_struct *fregs, int n)
 {
 	FP_DECL_EX;
@@ -300,7 +319,7 @@ static int ffloat(struct sh_fpu_soft_struct *fregs, int n)
 
 #define EMU_FTRC_X(SZ,N) do { \
 	FP_DECL_##SZ(Fn); \
-	UNPACK_##SZ(Fn, N); \
+	UNPACK_RAW_##SZ(Fn, N); \
 	FP_TO_INT_##SZ(FPUL, Fn, 32, 1); }while(0)
 static int ftrc(struct sh_fpu_soft_struct *fregs, int n)
 {
@@ -319,9 +338,9 @@ static int fcnvsd(struct sh_fpu_soft_struct *fregs, int n)
 	FP_DECL_EX;
 	FP_DECL_S(Fn);
 	FP_DECL_D(Fr);
-	UNPACK_S(Fn, FPUL);
-	FP_CONV(D, S, 2, 1, Fr, Fn);
-	PACK_D(DRn, Fr);
+	UNPACK_RAW_S(Fn, FPUL);
+	FP_EXTEND(D, S, 2, 1, Fr, Fn);
+	PACK_RAW_D(DRn, Fr);
 	return 0;
 }
 
@@ -330,9 +349,9 @@ static int fcnvds(struct sh_fpu_soft_struct *fregs, int n)
 	FP_DECL_EX;
 	FP_DECL_D(Fn);
 	FP_DECL_S(Fr);
-	UNPACK_D(Fn, DRn);
-	FP_CONV(S, D, 1, 2, Fr, Fn);
-	PACK_S(FPUL, Fr);
+	UNPACK_SEMIRAW_D(Fn, DRn);
+	FP_TRUNC(S, D, 1, 2, Fr, Fn);
+	PACK_SEMIRAW_S(FPUL, Fr);
 	return 0;
 }
 
diff --git a/arch/sparc/include/asm/sfp-machine_32.h b/arch/sparc/include/asm/sfp-machine_32.h
index 838c9d5..53ce267 100644
--- a/arch/sparc/include/asm/sfp-machine_32.h
+++ b/arch/sparc/include/asm/sfp-machine_32.h
@@ -50,6 +50,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /* If one NaN is signaling and the other is not,
  * we choose that one, otherwise we choose X.
@@ -209,4 +210,6 @@ extern struct task_struct *last_task_used_math;
 #define FP_TRAPPING_EXCEPTIONS ((last_task_used_math->thread.fsr >> 23) & 0x1f)
 #endif
 
+#define _FP_TININESS_AFTER_ROUNDING 0
+
 #endif
diff --git a/arch/sparc/include/asm/sfp-machine_64.h b/arch/sparc/include/asm/sfp-machine_64.h
index ca913ef..a83dbf6 100644
--- a/arch/sparc/include/asm/sfp-machine_64.h
+++ b/arch/sparc/include/asm/sfp-machine_64.h
@@ -48,6 +48,7 @@
 #define _FP_NANSIGN_Q		0
 
 #define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
 
 /* If one NaN is signaling and the other is not,
  * we choose that one, otherwise we choose X.
@@ -90,4 +91,6 @@
 
 #define FP_TRAPPING_EXCEPTIONS ((current_thread_info()->xfsr[0] >> 23) & 0x1f)
 
+#define _FP_TININESS_AFTER_ROUNDING 0
+
 #endif
diff --git a/arch/sparc/math-emu/math_32.c b/arch/sparc/math-emu/math_32.c
index 5ce8f2f..f708ee0 100644
--- a/arch/sparc/math-emu/math_32.c
+++ b/arch/sparc/math-emu/math_32.c
@@ -276,9 +276,11 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 	/* Emulate the given insn, updating fsr and fregs appropriately. */
 	int type = 0;
 	/* r is rd, b is rs2 and a is rs1. The *u arg tells
-	   whether the argument should be packed/unpacked (0 - do not unpack/pack, 1 - unpack/pack)
+	   whether and how the argument should be packed/unpacked
+	   (0 - do not unpack/pack, 1 - unpack/pack raw, 2 - semi-raw,
+	   3 - cooked)
 	   non-u args tells the size of the argument (0 - no argument, 1 - single, 2 - double, 3 - quad */
-#define TYPE(dummy, r, ru, b, bu, a, au) type = (au << 2) | (a << 0) | (bu << 5) | (b << 3) | (ru << 8) | (r << 6)
+#define TYPE(dummy, r, ru, b, bu, a, au) type = (au << 2) | (a << 0) | (bu << 6) | (b << 4) | (ru << 10) | (r << 8)
 	int freg;
 	argp rs1 = NULL, rs2 = NULL, rd = NULL;
 	FP_DECL_EX;
@@ -286,6 +288,7 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 	FP_DECL_D(DA); FP_DECL_D(DB); FP_DECL_D(DR);
 	FP_DECL_Q(QA); FP_DECL_Q(QB); FP_DECL_Q(QR);
 	int IR;
+	unsigned int UIR;
 	long fsr;
 
 #ifdef DEBUG_MATHEMU
@@ -294,30 +297,30 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 
 	if ((insn & 0xc1f80000) == 0x81a00000)	/* FPOP1 */ {
 		switch ((insn >> 5) & 0x1ff) {
-		case FSQRTQ: TYPE(3,3,1,3,1,0,0); break;
+		case FSQRTQ: TYPE(3,3,3,3,3,0,0); break;
 		case FADDQ:
-		case FSUBQ:
+		case FSUBQ: TYPE(3,3,2,3,2,3,2); break;
 		case FMULQ:
-		case FDIVQ: TYPE(3,3,1,3,1,3,1); break;
-		case FDMULQ: TYPE(3,3,1,2,1,2,1); break;
-		case FQTOS: TYPE(3,1,1,3,1,0,0); break;
-		case FQTOD: TYPE(3,2,1,3,1,0,0); break;
+		case FDIVQ: TYPE(3,3,3,3,3,3,3); break;
+		case FDMULQ: TYPE(3,3,3,2,1,2,1); break;
+		case FQTOS: TYPE(3,1,2,3,2,0,0); break;
+		case FQTOD: TYPE(3,2,2,3,2,0,0); break;
 		case FITOQ: TYPE(3,3,1,1,0,0,0); break;
 		case FSTOQ: TYPE(3,3,1,1,1,0,0); break;
 		case FDTOQ: TYPE(3,3,1,2,1,0,0); break;
 		case FQTOI: TYPE(3,1,0,3,1,0,0); break;
-		case FSQRTS: TYPE(2,1,1,1,1,0,0); break;
-		case FSQRTD: TYPE(2,2,1,2,1,0,0); break;
+		case FSQRTS: TYPE(2,1,3,1,3,0,0); break;
+		case FSQRTD: TYPE(2,2,3,2,3,0,0); break;
 		case FADDD:
-		case FSUBD:
+		case FSUBD: TYPE(2,2,2,2,2,2,2); break;
 		case FMULD:
-		case FDIVD: TYPE(2,2,1,2,1,2,1); break;
+		case FDIVD: TYPE(2,2,3,2,3,2,3); break;
 		case FADDS:
-		case FSUBS:
+		case FSUBS: TYPE(2,1,2,1,2,1,2); break;
 		case FMULS:
-		case FDIVS: TYPE(2,1,1,1,1,1,1); break;
-		case FSMULD: TYPE(2,2,1,1,1,1,1); break;
-		case FDTOS: TYPE(2,1,1,2,1,0,0); break;
+		case FDIVS: TYPE(2,1,3,1,3,1,3); break;
+		case FSMULD: TYPE(2,2,3,1,1,1,1); break;
+		case FDTOS: TYPE(2,1,2,2,2,0,0); break;
 		case FSTOD: TYPE(2,2,1,1,1,0,0); break;
 		case FSTOI: TYPE(2,1,0,1,1,0,0); break;
 		case FDTOI: TYPE(2,1,0,2,1,0,0); break;
@@ -366,13 +369,19 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 		}
 	}
 	rs1 = (argp)&fregs[freg];
-	switch (type & 0x7) {
-	case 7: FP_UNPACK_QP (QA, rs1); break;
-	case 6: FP_UNPACK_DP (DA, rs1); break;
-	case 5: FP_UNPACK_SP (SA, rs1); break;
+	switch (type & 0xf) {
+	case 7: FP_UNPACK_RAW_QP (QA, rs1); break;
+	case 6: FP_UNPACK_RAW_DP (DA, rs1); break;
+	case 5: FP_UNPACK_RAW_SP (SA, rs1); break;
+	case 11: FP_UNPACK_SEMIRAW_QP (QA, rs1); break;
+	case 10: FP_UNPACK_SEMIRAW_DP (DA, rs1); break;
+	case 9: FP_UNPACK_SEMIRAW_SP (SA, rs1); break;
+	case 15: FP_UNPACK_QP (QA, rs1); break;
+	case 14: FP_UNPACK_DP (DA, rs1); break;
+	case 13: FP_UNPACK_SP (SA, rs1); break;
 	}
 	freg = (insn & 0x1f);
-	switch ((type >> 3) & 0x3) {			/* same again for rs2 */
+	switch ((type >> 4) & 0x3) {			/* same again for rs2 */
 	case 3:
 		if (freg & 3) {				/* quadwords must have bits 4&5 of the */
 							/* encoded reg. number set to zero. */
@@ -387,13 +396,19 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 		}
 	}
 	rs2 = (argp)&fregs[freg];
-	switch ((type >> 3) & 0x7) {
-	case 7: FP_UNPACK_QP (QB, rs2); break;
-	case 6: FP_UNPACK_DP (DB, rs2); break;
-	case 5: FP_UNPACK_SP (SB, rs2); break;
+	switch ((type >> 4) & 0xf) {
+	case 7: FP_UNPACK_RAW_QP (QA, rs2); break;
+	case 6: FP_UNPACK_RAW_DP (DA, rs2); break;
+	case 5: FP_UNPACK_RAW_SP (SA, rs2); break;
+	case 11: FP_UNPACK_SEMIRAW_QP (QA, rs2); break;
+	case 10: FP_UNPACK_SEMIRAW_DP (DA, rs2); break;
+	case 9: FP_UNPACK_SEMIRAW_SP (SA, rs2); break;
+	case 15: FP_UNPACK_QP (QA, rs2); break;
+	case 14: FP_UNPACK_DP (DA, rs2); break;
+	case 13: FP_UNPACK_SP (SA, rs2); break;
 	}
 	freg = ((insn >> 25) & 0x1f);
-	switch ((type >> 6) & 0x3) {			/* and finally rd. This one's a bit different */
+	switch ((type >> 8) & 0x3) {			/* and finally rd. This one's a bit different */
 	case 0:						/* dest is fcc. (this must be FCMPQ or FCMPEQ) */
 		if (freg) {				/* V8 has only one set of condition codes, so */
 							/* anything but 0 in the rd field is an error */
@@ -433,11 +448,15 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 	case FSUBQ: FP_SUB_Q (QR, QA, QB); break;
 	/* * */
 	case FMULS: FP_MUL_S (SR, SA, SB); break;
-	case FSMULD: FP_CONV (D, S, 2, 1, DA, SA);
-		     FP_CONV (D, S, 2, 1, DB, SB);
+	case FSMULD: FP_EXTEND (D, S, 2, 1, DA, SA);
+		     _FP_UNPACK_CANONICAL (D, 2, DA);
+		     FP_EXTEND (D, S, 2, 1, DB, SB);
+		     _FP_UNPACK_CANONICAL (D, 2, DB);
 	case FMULD: FP_MUL_D (DR, DA, DB); break;
-	case FDMULQ: FP_CONV (Q, D, 4, 2, QA, DA);
-		     FP_CONV (Q, D, 4, 2, QB, DB);
+	case FDMULQ: FP_EXTEND (Q, D, 4, 2, QA, DA);
+		     _FP_UNPACK_CANONICAL (Q, 4, QA);
+		     FP_EXTEND (Q, D, 4, 2, QB, DB);
+		     _FP_UNPACK_CANONICAL (Q, 4, QB);
 	case FMULQ: FP_MUL_Q (QR, QA, QB); break;
 	/* / */
 	case FDIVS: FP_DIV_S (SR, SA, SB); break;
@@ -452,50 +471,41 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 	case FABSS: rd->s = rs2->s & 0x7fffffff; break;
 	case FNEGS: rd->s = rs2->s ^ 0x80000000; break;
 	/* float to int */
-	case FSTOI: FP_TO_INT_S (IR, SB, 32, 1); break;
-	case FDTOI: FP_TO_INT_D (IR, DB, 32, 1); break;
-	case FQTOI: FP_TO_INT_Q (IR, QB, 32, 1); break;
+	case FSTOI: FP_TO_INT_S (UIR, SB, 32, 1); IR = UIR; break;
+	case FDTOI: FP_TO_INT_D (UIR, DB, 32, 1); IR = UIR; break;
+	case FQTOI: FP_TO_INT_Q (UIR, QB, 32, 1); IR = UIR; break;
 	/* int to float */
-	case FITOS: IR = rs2->s; FP_FROM_INT_S (SR, IR, 32, int); break;
-	case FITOD: IR = rs2->s; FP_FROM_INT_D (DR, IR, 32, int); break;
-	case FITOQ: IR = rs2->s; FP_FROM_INT_Q (QR, IR, 32, int); break;
+	case FITOS: IR = rs2->s; FP_FROM_INT_S (SR, IR, 32, unsigned int);
+		    break;
+	case FITOD: IR = rs2->s; FP_FROM_INT_D (DR, IR, 32, unsigned int);
+		    break;
+	case FITOQ: IR = rs2->s; FP_FROM_INT_Q (QR, IR, 32, unsigned int);
+		    break;
 	/* float to float */
-	case FSTOD: FP_CONV (D, S, 2, 1, DR, SB); break;
-	case FSTOQ: FP_CONV (Q, S, 4, 1, QR, SB); break;
-	case FDTOQ: FP_CONV (Q, D, 4, 2, QR, DB); break;
-	case FDTOS: FP_CONV (S, D, 1, 2, SR, DB); break;
-	case FQTOS: FP_CONV (S, Q, 1, 4, SR, QB); break;
-	case FQTOD: FP_CONV (D, Q, 2, 4, DR, QB); break;
+	case FSTOD: FP_EXTEND (D, S, 2, 1, DR, SB); break;
+	case FSTOQ: FP_EXTEND (Q, S, 4, 1, QR, SB); break;
+	case FDTOQ: FP_EXTEND (Q, D, 4, 2, QR, DB); break;
+	case FDTOS: FP_TRUNC (S, D, 1, 2, SR, DB); break;
+	case FQTOS: FP_TRUNC (S, Q, 1, 4, SR, QB); break;
+	case FQTOD: FP_TRUNC (D, Q, 2, 4, DR, QB); break;
 	/* comparison */
 	case FCMPS:
 	case FCMPES:
-		FP_CMP_S(IR, SB, SA, 3);
-		if (IR == 3 &&
-		    (((insn >> 5) & 0x1ff) == FCMPES ||
-		     FP_ISSIGNAN_S(SA) ||
-		     FP_ISSIGNAN_S(SB)))
-			FP_SET_EXCEPTION (FP_EX_INVALID);
+		FP_CMP_S(IR, SB, SA, 3,
+			((insn >> 5) & 0x1ff) == FCMPES ? 2 : 1);
 		break;
 	case FCMPD:
 	case FCMPED:
-		FP_CMP_D(IR, DB, DA, 3);
-		if (IR == 3 &&
-		    (((insn >> 5) & 0x1ff) == FCMPED ||
-		     FP_ISSIGNAN_D(DA) ||
-		     FP_ISSIGNAN_D(DB)))
-			FP_SET_EXCEPTION (FP_EX_INVALID);
+		FP_CMP_D(IR, DB, DA, 3,
+			((insn >> 5) & 0x1ff) == FCMPED ? 2 : 1);
 		break;
 	case FCMPQ:
 	case FCMPEQ:
-		FP_CMP_Q(IR, QB, QA, 3);
-		if (IR == 3 &&
-		    (((insn >> 5) & 0x1ff) == FCMPEQ ||
-		     FP_ISSIGNAN_Q(QA) ||
-		     FP_ISSIGNAN_Q(QB)))
-			FP_SET_EXCEPTION (FP_EX_INVALID);
+		FP_CMP_Q(IR, QB, QA, 3,
+			((insn >> 5) & 0x1ff) == FCMPEQ ? 2 : 1);
 	}
 	if (!FP_INHIBIT_RESULTS) {
-		switch ((type >> 6) & 0x7) {
+		switch ((type >> 8) & 0xf) {
 		case 0: fsr = *pfsr;
 			if (IR == -1) IR = 2;
 			/* fcc is always fcc0 */
@@ -503,9 +513,15 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 			*pfsr = fsr;
 			break;
 		case 1: rd->s = IR; break;
-		case 5: FP_PACK_SP (rd, SR); break;
-		case 6: FP_PACK_DP (rd, DR); break;
-		case 7: FP_PACK_QP (rd, QR); break;
+		case 5: FP_PACK_RAW_SP (rd, SR); break;
+		case 6: FP_PACK_RAW_DP (rd, DR); break;
+		case 7: FP_PACK_RAW_QP (rd, QR); break;
+		case 9: FP_PACK_SEMIRAW_SP (rd, SR); break;
+		case 10: FP_PACK_SEMIRAW_DP (rd, DR); break;
+		case 11: FP_PACK_SEMIRAW_QP (rd, QR); break;
+		case 13: FP_PACK_SP (rd, SR); break;
+		case 14: FP_PACK_DP (rd, DR); break;
+		case 15: FP_PACK_QP (rd, QR); break;
 		}
 	}
 	if (_fex == 0)
diff --git a/arch/sparc/math-emu/math_64.c b/arch/sparc/math-emu/math_64.c
index 034aadb..973db59 100644
--- a/arch/sparc/math-emu/math_64.c
+++ b/arch/sparc/math-emu/math_64.c
@@ -170,9 +170,11 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 	u32 insn = 0;
 	int type = 0;
 	/* ftt tells which ftt it may happen in, r is rd, b is rs2 and a is rs1. The *u arg tells
-	   whether the argument should be packed/unpacked (0 - do not unpack/pack, 1 - unpack/pack)
+	   whether and how the argument should be packed/unpacked
+	   (0 - do not unpack/pack, 1 - unpack/pack raw, 2 - semi-raw,
+	   3- cooked)
 	   non-u args tells the size of the argument (0 - no argument, 1 - single, 2 - double, 3 - quad */
-#define TYPE(ftt, r, ru, b, bu, a, au) type = (au << 2) | (a << 0) | (bu << 5) | (b << 3) | (ru << 8) | (r << 6) | (ftt << 9)
+#define TYPE(ftt, r, ru, b, bu, a, au) type = (au << 2) | (a << 0) | (bu << 6) | (b << 4) | (ru << 10) | (r << 8) | (ftt << 12)
 	int freg;
 	static u64 zero[2] = { 0L, 0L };
 	int flags;
@@ -181,7 +183,9 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 	FP_DECL_D(DA); FP_DECL_D(DB); FP_DECL_D(DR);
 	FP_DECL_Q(QA); FP_DECL_Q(QB); FP_DECL_Q(QR);
 	int IR;
+	unsigned int UIR;
 	long XR, xfsr;
+	unsigned long UXR;
 
 	if (tstate & TSTATE_PRIV)
 		die_if_kernel("unfinished/unimplemented FPop from kernel", regs);
@@ -195,16 +199,16 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 			case FMOVQ:
 			case FNEGQ:
 			case FABSQ: TYPE(3,3,0,3,0,0,0); break;
-			case FSQRTQ: TYPE(3,3,1,3,1,0,0); break;
+			case FSQRTQ: TYPE(3,3,3,3,3,0,0); break;
 			case FADDQ:
-			case FSUBQ:
+			case FSUBQ: TYPE(3,3,2,3,2,3,2); break;
 			case FMULQ:
-			case FDIVQ: TYPE(3,3,1,3,1,3,1); break;
-			case FDMULQ: TYPE(3,3,1,2,1,2,1); break;
+			case FDIVQ: TYPE(3,3,3,3,3,3,3); break;
+			case FDMULQ: TYPE(3,3,3,2,1,2,1); break;
 			case FQTOX: TYPE(3,2,0,3,1,0,0); break;
 			case FXTOQ: TYPE(3,3,1,2,0,0,0); break;
-			case FQTOS: TYPE(3,1,1,3,1,0,0); break;
-			case FQTOD: TYPE(3,2,1,3,1,0,0); break;
+			case FQTOS: TYPE(3,1,2,3,2,0,0); break;
+			case FQTOD: TYPE(3,2,2,3,2,0,0); break;
 			case FITOQ: TYPE(3,3,1,1,0,0,0); break;
 			case FSTOQ: TYPE(3,3,1,1,1,0,0); break;
 			case FDTOQ: TYPE(3,3,1,2,1,0,0); break;
@@ -219,7 +223,7 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				unsigned long x = current_thread_info()->xfsr[0];
 
 				x = (x >> 14) & 0x7;
-				TYPE(x,1,1,1,1,0,0);
+				TYPE(x,1,3,1,3,0,0);
 				break;
 			}
 
@@ -227,23 +231,23 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				unsigned long x = current_thread_info()->xfsr[0];
 
 				x = (x >> 14) & 0x7;
-				TYPE(x,2,1,2,1,0,0);
+				TYPE(x,2,3,2,3,0,0);
 				break;
 			}
 
 			/* SUBNORMAL - ftt == 2 */
 			case FADDD:
-			case FSUBD:
+			case FSUBD: TYPE(2,2,2,2,2,2,2); break;
 			case FMULD:
-			case FDIVD: TYPE(2,2,1,2,1,2,1); break;
+			case FDIVD: TYPE(2,2,3,2,3,2,3); break;
 			case FADDS:
-			case FSUBS:
+			case FSUBS: TYPE(2,1,2,1,2,1,2); break;
 			case FMULS:
-			case FDIVS: TYPE(2,1,1,1,1,1,1); break;
-			case FSMULD: TYPE(2,2,1,1,1,1,1); break;
+			case FDIVS: TYPE(2,1,3,1,3,1,3); break;
+			case FSMULD: TYPE(2,2,3,1,1,1,1); break;
 			case FSTOX: TYPE(2,2,0,1,1,0,0); break;
 			case FDTOX: TYPE(2,2,0,2,1,0,0); break;
-			case FDTOS: TYPE(2,1,1,2,1,0,0); break;
+			case FDTOS: TYPE(2,1,2,2,2,0,0); break;
 			case FSTOD: TYPE(2,2,1,1,1,0,0); break;
 			case FSTOI: TYPE(2,1,0,1,1,0,0); break;
 			case FDTOI: TYPE(2,1,0,2,1,0,0); break;
@@ -365,7 +369,7 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 		 */
 		if (!illegal_insn_trap) {
 			int ftt = (current_thread_info()->xfsr[0] >> 14) & 0x7;
-			if (ftt != (type >> 9))
+			if (ftt != (type >> 12))
 				goto err;
 		}
 		current_thread_info()->xfsr[0] &= ~0x1c000;
@@ -382,13 +386,19 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				rs1 = (argp)&zero;
 			break;
 		}
-		switch (type & 0x7) {
-		case 7: FP_UNPACK_QP (QA, rs1); break;
-		case 6: FP_UNPACK_DP (DA, rs1); break;
-		case 5: FP_UNPACK_SP (SA, rs1); break;
+		switch (type & 0xf) {
+		case 7: FP_UNPACK_RAW_QP (QA, rs1); break;
+		case 6: FP_UNPACK_RAW_DP (DA, rs1); break;
+		case 5: FP_UNPACK_RAW_SP (SA, rs1); break;
+		case 11: FP_UNPACK_SEMIRAW_QP (QA, rs1); break;
+		case 10: FP_UNPACK_SEMIRAW_DP (DA, rs1); break;
+		case 9: FP_UNPACK_SEMIRAW_SP (SA, rs1); break;
+		case 15: FP_UNPACK_QP (QA, rs1); break;
+		case 14: FP_UNPACK_DP (DA, rs1); break;
+		case 13: FP_UNPACK_SP (SA, rs1); break;
 		}
 		freg = (insn & 0x1f);
-		switch ((type >> 3) & 0x3) {
+		switch ((type >> 4) & 0x3) {
 		case 3: if (freg & 2) {
 				current_thread_info()->xfsr[0] |= (6 << 14) /* invalid_fp_register */;
 				goto err;
@@ -400,13 +410,19 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				rs2 = (argp)&zero;
 			break;
 		}
-		switch ((type >> 3) & 0x7) {
-		case 7: FP_UNPACK_QP (QB, rs2); break;
-		case 6: FP_UNPACK_DP (DB, rs2); break;
-		case 5: FP_UNPACK_SP (SB, rs2); break;
+		switch ((type >> 4) & 0xf) {
+		case 7: FP_UNPACK_RAW_QP (QB, rs2); break;
+		case 6: FP_UNPACK_RAW_DP (DB, rs2); break;
+		case 5: FP_UNPACK_RAW_SP (SB, rs2); break;
+		case 11: FP_UNPACK_SEMIRAW_QP (QB, rs2); break;
+		case 10: FP_UNPACK_SEMIRAW_DP (DB, rs2); break;
+		case 9: FP_UNPACK_SEMIRAW_SP (SB, rs2); break;
+		case 15: FP_UNPACK_QP (QB, rs2); break;
+		case 14: FP_UNPACK_DP (DB, rs2); break;
+		case 13: FP_UNPACK_SP (SB, rs2); break;
 		}
 		freg = ((insn >> 25) & 0x1f);
-		switch ((type >> 6) & 0x3) {
+		switch ((type >> 8) & 0x3) {
 		case 3: if (freg & 2) {
 				current_thread_info()->xfsr[0] |= (6 << 14) /* invalid_fp_register */;
 				goto err;
@@ -438,11 +454,15 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 		case FSUBQ: FP_SUB_Q (QR, QA, QB); break;
 		/* * */
 		case FMULS: FP_MUL_S (SR, SA, SB); break;
-		case FSMULD: FP_CONV (D, S, 1, 1, DA, SA);
-			     FP_CONV (D, S, 1, 1, DB, SB);
+		case FSMULD: FP_EXTEND (D, S, 1, 1, DA, SA);
+			     _FP_UNPACK_CANONICAL (D, 1, DA);
+			     FP_EXTEND (D, S, 1, 1, DB, SB);
+			     _FP_UNPACK_CANONICAL (D, 1, DB);
 		case FMULD: FP_MUL_D (DR, DA, DB); break;
-		case FDMULQ: FP_CONV (Q, D, 2, 1, QA, DA);
-			     FP_CONV (Q, D, 2, 1, QB, DB);
+		case FDMULQ: FP_EXTEND (Q, D, 2, 1, QA, DA);
+			     _FP_UNPACK_CANONICAL (Q, 2, QA);
+			     FP_EXTEND (Q, D, 2, 1, QB, DB);
+			     _FP_UNPACK_CANONICAL (Q, 2, QB);
 		case FMULQ: FP_MUL_Q (QR, QA, QB); break;
 		/* / */
 		case FDIVS: FP_DIV_S (SR, SA, SB); break;
@@ -457,41 +477,37 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 		case FABSQ: rd->q[0] = rs2->q[0] & 0x7fffffffffffffffUL; rd->q[1] = rs2->q[1]; break;
 		case FNEGQ: rd->q[0] = rs2->q[0] ^ 0x8000000000000000UL; rd->q[1] = rs2->q[1]; break;
 		/* float to int */
-		case FSTOI: FP_TO_INT_S (IR, SB, 32, 1); break;
-		case FDTOI: FP_TO_INT_D (IR, DB, 32, 1); break;
-		case FQTOI: FP_TO_INT_Q (IR, QB, 32, 1); break;
-		case FSTOX: FP_TO_INT_S (XR, SB, 64, 1); break;
-		case FDTOX: FP_TO_INT_D (XR, DB, 64, 1); break;
-		case FQTOX: FP_TO_INT_Q (XR, QB, 64, 1); break;
+		case FSTOI: FP_TO_INT_S (UIR, SB, 32, 1); IR = UIR; break;
+		case FDTOI: FP_TO_INT_D (UIR, DB, 32, 1); IR = UIR; break;
+		case FQTOI: FP_TO_INT_Q (UIR, QB, 32, 1); IR = UIR; break;
+		case FSTOX: FP_TO_INT_S (UXR, SB, 64, 1); XR = UXR; break;
+		case FDTOX: FP_TO_INT_D (UXR, DB, 64, 1); XR = UXR; break;
+		case FQTOX: FP_TO_INT_Q (UXR, QB, 64, 1); XR = UXR; break;
 		/* int to float */
-		case FITOQ: IR = rs2->s; FP_FROM_INT_Q (QR, IR, 32, int); break;
-		case FXTOQ: XR = rs2->d; FP_FROM_INT_Q (QR, XR, 64, long); break;
+		case FITOQ: IR = rs2->s; FP_FROM_INT_Q (QR, IR, 32, unsigned int); break;
+		case FXTOQ: XR = rs2->d; FP_FROM_INT_Q (QR, XR, 64, unsigned long); break;
 		/* Only Ultra-III generates these */
-		case FXTOS: XR = rs2->d; FP_FROM_INT_S (SR, XR, 64, long); break;
-		case FXTOD: XR = rs2->d; FP_FROM_INT_D (DR, XR, 64, long); break;
+		case FXTOS: XR = rs2->d; FP_FROM_INT_S (SR, XR, 64, unsigned long); break;
+		case FXTOD: XR = rs2->d; FP_FROM_INT_D (DR, XR, 64, unsigned long); break;
 #if 0		/* Optimized inline in sparc64/kernel/entry.S */
-		case FITOS: IR = rs2->s; FP_FROM_INT_S (SR, IR, 32, int); break;
+		case FITOS: IR = rs2->s; FP_FROM_INT_S (SR, IR, 32, unsigned int); break;
 #endif
-		case FITOD: IR = rs2->s; FP_FROM_INT_D (DR, IR, 32, int); break;
+		case FITOD: IR = rs2->s; FP_FROM_INT_D (DR, IR, 32, unsigned int); break;
 		/* float to float */
-		case FSTOD: FP_CONV (D, S, 1, 1, DR, SB); break;
-		case FSTOQ: FP_CONV (Q, S, 2, 1, QR, SB); break;
-		case FDTOQ: FP_CONV (Q, D, 2, 1, QR, DB); break;
-		case FDTOS: FP_CONV (S, D, 1, 1, SR, DB); break;
-		case FQTOS: FP_CONV (S, Q, 1, 2, SR, QB); break;
-		case FQTOD: FP_CONV (D, Q, 1, 2, DR, QB); break;
+		case FSTOD: FP_EXTEND (D, S, 1, 1, DR, SB); break;
+		case FSTOQ: FP_EXTEND (Q, S, 2, 1, QR, SB); break;
+		case FDTOQ: FP_EXTEND (Q, D, 2, 1, QR, DB); break;
+		case FDTOS: FP_TRUNC (S, D, 1, 1, SR, DB); break;
+		case FQTOS: FP_TRUNC (S, Q, 1, 2, SR, QB); break;
+		case FQTOD: FP_TRUNC (D, Q, 1, 2, DR, QB); break;
 		/* comparison */
 		case FCMPQ:
 		case FCMPEQ:
-			FP_CMP_Q(XR, QB, QA, 3);
-			if (XR == 3 &&
-			    (((insn >> 5) & 0x1ff) == FCMPEQ ||
-			     FP_ISSIGNAN_Q(QA) ||
-			     FP_ISSIGNAN_Q(QB)))
-				FP_SET_EXCEPTION (FP_EX_INVALID);
+			FP_CMP_Q(XR, QB, QA, 3,
+				((insn >> 5) & 0x1ff) == FCMPEQ ? 2 : 1);
 		}
 		if (!FP_INHIBIT_RESULTS) {
-			switch ((type >> 6) & 0x7) {
+			switch ((type >> 8) & 0xf) {
 			case 0: xfsr = current_thread_info()->xfsr[0];
 				if (XR == -1) XR = 2;
 				switch (freg & 3) {
@@ -505,9 +521,15 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 				break;
 			case 1: rd->s = IR; break;
 			case 2: rd->d = XR; break;
-			case 5: FP_PACK_SP (rd, SR); break;
-			case 6: FP_PACK_DP (rd, DR); break;
-			case 7: FP_PACK_QP (rd, QR); break;
+			case 5: FP_PACK_RAW_SP (rd, SR); break;
+			case 6: FP_PACK_RAW_DP (rd, DR); break;
+			case 7: FP_PACK_RAW_QP (rd, QR); break;
+			case 9: FP_PACK_SEMIRAW_SP (rd, SR); break;
+			case 10: FP_PACK_SEMIRAW_DP (rd, DR); break;
+			case 11: FP_PACK_SEMIRAW_QP (rd, QR); break;
+			case 13: FP_PACK_SP (rd, SR); break;
+			case 14: FP_PACK_DP (rd, DR); break;
+			case 15: FP_PACK_QP (rd, QR); break;
 			}
 		}
 
diff --git a/include/math-emu/double.h b/include/math-emu/double.h
index 655ccf1..dc8cd33 100644
--- a/include/math-emu/double.h
+++ b/include/math-emu/double.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Definitions for IEEE Double Precision
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,31 +8,41 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef    __MATH_EMU_DOUBLE_H__
 #define    __MATH_EMU_DOUBLE_H__
 
 #if _FP_W_TYPE_SIZE < 32
-#error "Here's a nickel kid.  Go buy yourself a real computer."
+# error "Here's a nickel kid.  Go buy yourself a real computer."
 #endif
 
 #if _FP_W_TYPE_SIZE < 64
-#define _FP_FRACTBITS_D		(2 * _FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_D	(2 * _FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_DW_D	(4 * _FP_W_TYPE_SIZE)
 #else
-#define _FP_FRACTBITS_D		_FP_W_TYPE_SIZE
+# define _FP_FRACTBITS_D	_FP_W_TYPE_SIZE
+# define _FP_FRACTBITS_DW_D	(2 * _FP_W_TYPE_SIZE)
 #endif
 
 #define _FP_FRACBITS_D		53
@@ -44,160 +54,269 @@
 #define _FP_EXPMAX_D		2047
 
 #define _FP_QNANBIT_D		\
-	((_FP_W_TYPE)1 << (_FP_FRACBITS_D-2) % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_D-2) % _FP_W_TYPE_SIZE)
+#define _FP_QNANBIT_SH_D		\
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_D-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
 #define _FP_IMPLBIT_D		\
-	((_FP_W_TYPE)1 << (_FP_FRACBITS_D-1) % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_D-1) % _FP_W_TYPE_SIZE)
+#define _FP_IMPLBIT_SH_D		\
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_D-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
 #define _FP_OVERFLOW_D		\
-	((_FP_W_TYPE)1 << _FP_WFRACBITS_D % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << _FP_WFRACBITS_D % _FP_W_TYPE_SIZE)
+
+#define _FP_WFRACBITS_DW_D	(2 * _FP_WFRACBITS_D)
+#define _FP_WFRACXBITS_DW_D	(_FP_FRACTBITS_DW_D - _FP_WFRACBITS_DW_D)
+#define _FP_HIGHBIT_DW_D	\
+  ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_DW_D - 1) % _FP_W_TYPE_SIZE)
+
+typedef float DFtype __attribute__ ((mode (DF)));
 
 #if _FP_W_TYPE_SIZE < 64
 
 union _FP_UNION_D
 {
-  double flt;
-  struct {
-#if __BYTE_ORDER == __BIG_ENDIAN
+  DFtype flt;
+  struct _FP_STRUCT_LAYOUT
+  {
+# if __BYTE_ORDER == __BIG_ENDIAN
     unsigned sign  : 1;
     unsigned exp   : _FP_EXPBITS_D;
     unsigned frac1 : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0) - _FP_W_TYPE_SIZE;
     unsigned frac0 : _FP_W_TYPE_SIZE;
-#else
+# else
     unsigned frac0 : _FP_W_TYPE_SIZE;
     unsigned frac1 : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0) - _FP_W_TYPE_SIZE;
     unsigned exp   : _FP_EXPBITS_D;
     unsigned sign  : 1;
-#endif
-  } bits __attribute__((packed));
+# endif
+  } bits __attribute__ ((packed));
 };
 
-#define FP_DECL_D(X)		_FP_DECL(2,X)
-#define FP_UNPACK_RAW_D(X,val)	_FP_UNPACK_RAW_2(D,X,val)
-#define FP_UNPACK_RAW_DP(X,val)	_FP_UNPACK_RAW_2_P(D,X,val)
-#define FP_PACK_RAW_D(val,X)	_FP_PACK_RAW_2(D,val,X)
-#define FP_PACK_RAW_DP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_2_P(D,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_D(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_2(D,X,val);		\
-    _FP_UNPACK_CANONICAL(D,2,X);	\
-  } while (0)
-
-#define FP_UNPACK_DP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_2_P(D,X,val);	\
-    _FP_UNPACK_CANONICAL(D,2,X);	\
-  } while (0)
-
-#define FP_PACK_D(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(D,2,X);		\
-    _FP_PACK_RAW_2(D,val,X);		\
-  } while (0)
-
-#define FP_PACK_DP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(D,2,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_2_P(D,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN(D,2,X)
-#define FP_NEG_D(R,X)			_FP_NEG(D,2,R,X)
-#define FP_ADD_D(R,X,Y)			_FP_ADD(D,2,R,X,Y)
-#define FP_SUB_D(R,X,Y)			_FP_SUB(D,2,R,X,Y)
-#define FP_MUL_D(R,X,Y)			_FP_MUL(D,2,R,X,Y)
-#define FP_DIV_D(R,X,Y)			_FP_DIV(D,2,R,X,Y)
-#define FP_SQRT_D(R,X)			_FP_SQRT(D,2,R,X)
-#define _FP_SQRT_MEAT_D(R,S,T,X,Q)	_FP_SQRT_MEAT_2(R,S,T,X,Q)
-
-#define FP_CMP_D(r,X,Y,un)	_FP_CMP(D,2,r,X,Y,un)
-#define FP_CMP_EQ_D(r,X,Y)	_FP_CMP_EQ(D,2,r,X,Y)
-
-#define FP_TO_INT_D(r,X,rsz,rsg)	_FP_TO_INT(D,2,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_D(r,X,rsz,rsg)	_FP_TO_INT_ROUND(D,2,r,X,rsz,rsg)
-#define FP_FROM_INT_D(X,r,rs,rt)	_FP_FROM_INT(D,2,X,r,rs,rt)
-
-#define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_2(X)
-#define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_2(X)
+# define FP_DECL_D(X)		_FP_DECL (2, X)
+# define FP_UNPACK_RAW_D(X, val)	_FP_UNPACK_RAW_2 (D, X, (val))
+# define FP_UNPACK_RAW_DP(X, val)	_FP_UNPACK_RAW_2_P (D, X, (val))
+# define FP_PACK_RAW_D(val, X)	_FP_PACK_RAW_2 (D, (val), X)
+# define FP_PACK_RAW_DP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_D(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2 (D, X, (val));		\
+      _FP_UNPACK_CANONICAL (D, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_DP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2_P (D, X, (val));		\
+      _FP_UNPACK_CANONICAL (D, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_D(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2 (D, X, (val));		\
+      _FP_UNPACK_SEMIRAW (D, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_DP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2_P (D, X, (val));		\
+      _FP_UNPACK_SEMIRAW (D, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_D(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (D, 2, X);		\
+      _FP_PACK_RAW_2 (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_DP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (D, 2, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_D(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (D, 2, X);		\
+      _FP_PACK_RAW_2 (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_DP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (D, 2, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN (D, 2, X)
+# define FP_NEG_D(R, X)			_FP_NEG (D, 2, R, X)
+# define FP_ADD_D(R, X, Y)		_FP_ADD (D, 2, R, X, Y)
+# define FP_SUB_D(R, X, Y)		_FP_SUB (D, 2, R, X, Y)
+# define FP_MUL_D(R, X, Y)		_FP_MUL (D, 2, R, X, Y)
+# define FP_DIV_D(R, X, Y)		_FP_DIV (D, 2, R, X, Y)
+# define FP_SQRT_D(R, X)		_FP_SQRT (D, 2, R, X)
+# define _FP_SQRT_MEAT_D(R, S, T, X, Q)	_FP_SQRT_MEAT_2 (R, S, T, X, (Q))
+# define FP_FMA_D(R, X, Y, Z)		_FP_FMA (D, 2, 4, R, X, Y, Z)
+
+# define FP_CMP_D(r, X, Y, un, ex)	_FP_CMP (D, 2, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_D(r, X, Y, ex)	_FP_CMP_EQ (D, 2, (r), X, Y, (ex))
+# define FP_CMP_UNORD_D(r, X, Y, ex)	_FP_CMP_UNORD (D, 2, (r), X, Y, (ex))
+
+# define FP_TO_INT_D(r, X, rsz, rsg)	_FP_TO_INT (D, 2, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_D(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (D, 2, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_D(X, r, rs, rt)	_FP_FROM_INT (D, 2, X, (r), (rs), rt)
+
+# define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_2 (X)
+# define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_2 (X)
+
+# define _FP_FRAC_HIGH_DW_D(X)	_FP_FRAC_HIGH_4 (X)
 
 #else
 
 union _FP_UNION_D
 {
-  double flt;
-  struct {
-#if __BYTE_ORDER == __BIG_ENDIAN
-    unsigned sign : 1;
-    unsigned exp  : _FP_EXPBITS_D;
-    unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
-#else
-    unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
-    unsigned exp  : _FP_EXPBITS_D;
-    unsigned sign : 1;
-#endif
-  } bits __attribute__((packed));
+  DFtype flt;
+  struct _FP_STRUCT_LAYOUT
+  {
+# if __BYTE_ORDER == __BIG_ENDIAN
+    unsigned sign   : 1;
+    unsigned exp    : _FP_EXPBITS_D;
+    _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
+# else
+    _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
+    unsigned exp    : _FP_EXPBITS_D;
+    unsigned sign   : 1;
+# endif
+  } bits __attribute__ ((packed));
 };
 
-#define FP_DECL_D(X)		_FP_DECL(1,X)
-#define FP_UNPACK_RAW_D(X,val)	_FP_UNPACK_RAW_1(D,X,val)
-#define FP_UNPACK_RAW_DP(X,val)	_FP_UNPACK_RAW_1_P(D,X,val)
-#define FP_PACK_RAW_D(val,X)	_FP_PACK_RAW_1(D,val,X)
-#define FP_PACK_RAW_DP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_1_P(D,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_D(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_1(D,X,val);		\
-    _FP_UNPACK_CANONICAL(D,1,X);	\
-  } while (0)
-
-#define FP_UNPACK_DP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_1_P(D,X,val);	\
-    _FP_UNPACK_CANONICAL(D,1,X);	\
-  } while (0)
-
-#define FP_PACK_D(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(D,1,X);		\
-    _FP_PACK_RAW_1(D,val,X);		\
-  } while (0)
-
-#define FP_PACK_DP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(D,1,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_1_P(D,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN(D,1,X)
-#define FP_NEG_D(R,X)			_FP_NEG(D,1,R,X)
-#define FP_ADD_D(R,X,Y)			_FP_ADD(D,1,R,X,Y)
-#define FP_SUB_D(R,X,Y)			_FP_SUB(D,1,R,X,Y)
-#define FP_MUL_D(R,X,Y)			_FP_MUL(D,1,R,X,Y)
-#define FP_DIV_D(R,X,Y)			_FP_DIV(D,1,R,X,Y)
-#define FP_SQRT_D(R,X)			_FP_SQRT(D,1,R,X)
-#define _FP_SQRT_MEAT_D(R,S,T,X,Q)	_FP_SQRT_MEAT_1(R,S,T,X,Q)
+# define FP_DECL_D(X)		_FP_DECL (1, X)
+# define FP_UNPACK_RAW_D(X, val)	_FP_UNPACK_RAW_1 (D, X, (val))
+# define FP_UNPACK_RAW_DP(X, val)	_FP_UNPACK_RAW_1_P (D, X, (val))
+# define FP_PACK_RAW_D(val, X)	_FP_PACK_RAW_1 (D, (val), X)
+# define FP_PACK_RAW_DP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_D(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1 (D, X, (val));		\
+      _FP_UNPACK_CANONICAL (D, 1, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_DP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1_P (D, X, (val));		\
+      _FP_UNPACK_CANONICAL (D, 1, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_D(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1 (D, X, (val));		\
+      _FP_UNPACK_SEMIRAW (D, 1, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_DP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1_P (D, X, (val));		\
+      _FP_UNPACK_SEMIRAW (D, 1, X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_D(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (D, 1, X);		\
+      _FP_PACK_RAW_1 (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_DP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (D, 1, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_D(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (D, 1, X);		\
+      _FP_PACK_RAW_1 (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_DP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (D, 1, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (D, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_ISSIGNAN_D(X)		_FP_ISSIGNAN (D, 1, X)
+# define FP_NEG_D(R, X)			_FP_NEG (D, 1, R, X)
+# define FP_ADD_D(R, X, Y)		_FP_ADD (D, 1, R, X, Y)
+# define FP_SUB_D(R, X, Y)		_FP_SUB (D, 1, R, X, Y)
+# define FP_MUL_D(R, X, Y)		_FP_MUL (D, 1, R, X, Y)
+# define FP_DIV_D(R, X, Y)		_FP_DIV (D, 1, R, X, Y)
+# define FP_SQRT_D(R, X)		_FP_SQRT (D, 1, R, X)
+# define _FP_SQRT_MEAT_D(R, S, T, X, Q)	_FP_SQRT_MEAT_1 (R, S, T, X, (Q))
+# define FP_FMA_D(R, X, Y, Z)		_FP_FMA (D, 1, 2, R, X, Y, Z)
 
 /* The implementation of _FP_MUL_D and _FP_DIV_D should be chosen by
    the target machine.  */
 
-#define FP_CMP_D(r,X,Y,un)	_FP_CMP(D,1,r,X,Y,un)
-#define FP_CMP_EQ_D(r,X,Y)	_FP_CMP_EQ(D,1,r,X,Y)
+# define FP_CMP_D(r, X, Y, un, ex)	_FP_CMP (D, 1, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_D(r, X, Y, ex)	_FP_CMP_EQ (D, 1, (r), X, Y, (ex))
+# define FP_CMP_UNORD_D(r, X, Y, ex)	_FP_CMP_UNORD (D, 1, (r), X, Y, (ex))
+
+# define FP_TO_INT_D(r, X, rsz, rsg)	_FP_TO_INT (D, 1, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_D(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (D, 1, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_D(X, r, rs, rt)	_FP_FROM_INT (D, 1, X, (r), (rs), rt)
 
-#define FP_TO_INT_D(r,X,rsz,rsg)	_FP_TO_INT(D,1,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_D(r,X,rsz,rsg)	_FP_TO_INT_ROUND(D,1,r,X,rsz,rsg)
-#define FP_FROM_INT_D(X,r,rs,rt)	_FP_FROM_INT(D,1,X,r,rs,rt)
+# define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_1 (X)
+# define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_1 (X)
 
-#define _FP_FRAC_HIGH_D(X)	_FP_FRAC_HIGH_1(X)
-#define _FP_FRAC_HIGH_RAW_D(X)	_FP_FRAC_HIGH_1(X)
+# define _FP_FRAC_HIGH_DW_D(X)	_FP_FRAC_HIGH_2 (X)
 
 #endif /* W_TYPE_SIZE < 64 */
 
diff --git a/include/math-emu/op-1.h b/include/math-emu/op-1.h
index 3be3bb4..342ecd0 100644
--- a/include/math-emu/op-1.h
+++ b/include/math-emu/op-1.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Basic one-word fraction declaration and manipulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,193 +8,260 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef    __MATH_EMU_OP_1_H__
 #define    __MATH_EMU_OP_1_H__
 
-#define _FP_FRAC_DECL_1(X)	_FP_W_TYPE X##_f=0
-#define _FP_FRAC_COPY_1(D,S)	(D##_f = S##_f)
-#define _FP_FRAC_SET_1(X,I)	(X##_f = I)
+#define _FP_FRAC_DECL_1(X)	_FP_W_TYPE X##_f = 0
+#define _FP_FRAC_COPY_1(D, S)	(D##_f = S##_f)
+#define _FP_FRAC_SET_1(X, I)	(X##_f = I)
 #define _FP_FRAC_HIGH_1(X)	(X##_f)
 #define _FP_FRAC_LOW_1(X)	(X##_f)
-#define _FP_FRAC_WORD_1(X,w)	(X##_f)
-
-#define _FP_FRAC_ADDI_1(X,I)	(X##_f += I)
-#define _FP_FRAC_SLL_1(X,N)			\
-  do {						\
-    if (__builtin_constant_p(N) && (N) == 1)	\
-      X##_f += X##_f;				\
-    else					\
-      X##_f <<= (N);				\
-  } while (0)
-#define _FP_FRAC_SRL_1(X,N)	(X##_f >>= N)
+#define _FP_FRAC_WORD_1(X, w)	(X##_f)
+
+#define _FP_FRAC_ADDI_1(X, I)	(X##_f += I)
+#define _FP_FRAC_SLL_1(X, N)			\
+  do						\
+    {						\
+      if (__builtin_constant_p (N) && (N) == 1)	\
+	X##_f += X##_f;				\
+      else					\
+	X##_f <<= (N);				\
+    }						\
+  while (0)
+#define _FP_FRAC_SRL_1(X, N)	(X##_f >>= N)
 
 /* Right shift with sticky-lsb.  */
-#define _FP_FRAC_SRS_1(X,N,sz)	__FP_FRAC_SRS_1(X##_f, N, sz)
-
-#define __FP_FRAC_SRS_1(X,N,sz)						\
-   (X = (X >> (N) | (__builtin_constant_p(N) && (N) == 1		\
-		     ? X & 1 : (X << (_FP_W_TYPE_SIZE - (N))) != 0)))
-
-#define _FP_FRAC_ADD_1(R,X,Y)	(R##_f = X##_f + Y##_f)
-#define _FP_FRAC_SUB_1(R,X,Y)	(R##_f = X##_f - Y##_f)
-#define _FP_FRAC_DEC_1(X,Y)	(X##_f -= Y##_f)
-#define _FP_FRAC_CLZ_1(z, X)	__FP_CLZ(z, X##_f)
-
-/* Predicates */
-#define _FP_FRAC_NEGP_1(X)	((_FP_WS_TYPE)X##_f < 0)
+#define _FP_FRAC_SRST_1(X, S, N, sz)	__FP_FRAC_SRST_1 (X##_f, S, (N), (sz))
+#define _FP_FRAC_SRS_1(X, N, sz)	__FP_FRAC_SRS_1 (X##_f, (N), (sz))
+
+#define __FP_FRAC_SRST_1(X, S, N, sz)			\
+  do							\
+    {							\
+      S = (__builtin_constant_p (N) && (N) == 1		\
+	   ? X & 1					\
+	   : (X << (_FP_W_TYPE_SIZE - (N))) != 0);	\
+      X = X >> (N);					\
+    }							\
+  while (0)
+
+#define __FP_FRAC_SRS_1(X, N, sz)				\
+  (X = (X >> (N) | (__builtin_constant_p (N) && (N) == 1	\
+		    ? X & 1					\
+		    : (X << (_FP_W_TYPE_SIZE - (N))) != 0)))
+
+#define _FP_FRAC_ADD_1(R, X, Y)	(R##_f = X##_f + Y##_f)
+#define _FP_FRAC_SUB_1(R, X, Y)	(R##_f = X##_f - Y##_f)
+#define _FP_FRAC_DEC_1(X, Y)	(X##_f -= Y##_f)
+#define _FP_FRAC_CLZ_1(z, X)	__FP_CLZ ((z), X##_f)
+
+/* Predicates.  */
+#define _FP_FRAC_NEGP_1(X)	((_FP_WS_TYPE) X##_f < 0)
 #define _FP_FRAC_ZEROP_1(X)	(X##_f == 0)
-#define _FP_FRAC_OVERP_1(fs,X)	(X##_f & _FP_OVERFLOW_##fs)
-#define _FP_FRAC_CLEAR_OVERP_1(fs,X)	(X##_f &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_OVERP_1(fs, X)	(X##_f & _FP_OVERFLOW_##fs)
+#define _FP_FRAC_CLEAR_OVERP_1(fs, X)	(X##_f &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_HIGHBIT_DW_1(fs, X)	(X##_f & _FP_HIGHBIT_DW_##fs)
 #define _FP_FRAC_EQ_1(X, Y)	(X##_f == Y##_f)
 #define _FP_FRAC_GE_1(X, Y)	(X##_f >= Y##_f)
 #define _FP_FRAC_GT_1(X, Y)	(X##_f > Y##_f)
 
 #define _FP_ZEROFRAC_1		0
 #define _FP_MINFRAC_1		1
-#define _FP_MAXFRAC_1		(~(_FP_WS_TYPE)0)
-
-/*
- * Unpack the raw bits of a native fp value.  Do not classify or
- * normalize the data.
- */
-
-#define _FP_UNPACK_RAW_1(fs, X, val)				\
-  do {								\
-    union _FP_UNION_##fs _flo; _flo.flt = (val);		\
-								\
-    X##_f = _flo.bits.frac;					\
-    X##_e = _flo.bits.exp;					\
-    X##_s = _flo.bits.sign;					\
-  } while (0)
-
-#define _FP_UNPACK_RAW_1_P(fs, X, val)				\
-  do {								\
-    union _FP_UNION_##fs *_flo =				\
-      (union _FP_UNION_##fs *)(val);				\
-								\
-    X##_f = _flo->bits.frac;					\
-    X##_e = _flo->bits.exp;					\
-    X##_s = _flo->bits.sign;					\
-  } while (0)
-
-/*
- * Repack the raw bits of a native fp value.
- */
-
-#define _FP_PACK_RAW_1(fs, val, X)				\
-  do {								\
-    union _FP_UNION_##fs _flo;					\
-								\
-    _flo.bits.frac = X##_f;					\
-    _flo.bits.exp  = X##_e;					\
-    _flo.bits.sign = X##_s;					\
-								\
-    (val) = _flo.flt;						\
-  } while (0)
-
-#define _FP_PACK_RAW_1_P(fs, val, X)				\
-  do {								\
-    union _FP_UNION_##fs *_flo =				\
-      (union _FP_UNION_##fs *)(val);				\
-								\
-    _flo->bits.frac = X##_f;					\
-    _flo->bits.exp  = X##_e;					\
-    _flo->bits.sign = X##_s;					\
-  } while (0)
-
-
-/*
- * Multiplication algorithms:
- */
+#define _FP_MAXFRAC_1		(~(_FP_WS_TYPE) 0)
+
+/* Unpack the raw bits of a native fp value.  Do not classify or
+   normalize the data.  */
+
+#define _FP_UNPACK_RAW_1(fs, X, val)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs _FP_UNPACK_RAW_1_flo;	\
+      _FP_UNPACK_RAW_1_flo.flt = (val);			\
+							\
+      X##_f = _FP_UNPACK_RAW_1_flo.bits.frac;		\
+      X##_e = _FP_UNPACK_RAW_1_flo.bits.exp;		\
+      X##_s = _FP_UNPACK_RAW_1_flo.bits.sign;		\
+    }							\
+  while (0)
+
+#define _FP_UNPACK_RAW_1_P(fs, X, val)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_UNPACK_RAW_1_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
+							\
+      X##_f = _FP_UNPACK_RAW_1_P_flo->bits.frac;	\
+      X##_e = _FP_UNPACK_RAW_1_P_flo->bits.exp;		\
+      X##_s = _FP_UNPACK_RAW_1_P_flo->bits.sign;	\
+    }							\
+  while (0)
+
+/* Repack the raw bits of a native fp value.  */
+
+#define _FP_PACK_RAW_1(fs, val, X)		\
+  do						\
+    {						\
+      union _FP_UNION_##fs _FP_PACK_RAW_1_flo;	\
+						\
+      _FP_PACK_RAW_1_flo.bits.frac = X##_f;	\
+      _FP_PACK_RAW_1_flo.bits.exp  = X##_e;	\
+      _FP_PACK_RAW_1_flo.bits.sign = X##_s;	\
+						\
+      (val) = _FP_PACK_RAW_1_flo.flt;		\
+    }						\
+  while (0)
+
+#define _FP_PACK_RAW_1_P(fs, val, X)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_PACK_RAW_1_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
+							\
+      _FP_PACK_RAW_1_P_flo->bits.frac = X##_f;		\
+      _FP_PACK_RAW_1_P_flo->bits.exp  = X##_e;		\
+      _FP_PACK_RAW_1_P_flo->bits.sign = X##_s;		\
+    }							\
+  while (0)
+
+
+/* Multiplication algorithms: */
 
 /* Basic.  Assuming the host word size is >= 2*FRACBITS, we can do the
    multiplication immediately.  */
 
+#define _FP_MUL_MEAT_DW_1_imm(wfracbits, R, X, Y)	\
+  do							\
+    {							\
+      R##_f = X##_f * Y##_f;				\
+    }							\
+  while (0)
+
 #define _FP_MUL_MEAT_1_imm(wfracbits, R, X, Y)				\
-  do {									\
-    R##_f = X##_f * Y##_f;						\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_1(R, wfracbits-1, 2*wfracbits);			\
-  } while (0)
+  do									\
+    {									\
+      _FP_MUL_MEAT_DW_1_imm ((wfracbits), R, X, Y);			\
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_1 (R, (wfracbits)-1, 2*(wfracbits));			\
+    }									\
+  while (0)
 
 /* Given a 1W * 1W => 2W primitive, do the extended multiplication.  */
 
+#define _FP_MUL_MEAT_DW_1_wide(wfracbits, R, X, Y, doit)	\
+  do								\
+    {								\
+      doit (R##_f1, R##_f0, X##_f, Y##_f);			\
+    }								\
+  while (0)
+
 #define _FP_MUL_MEAT_1_wide(wfracbits, R, X, Y, doit)			\
-  do {									\
-    _FP_W_TYPE _Z_f0, _Z_f1;						\
-    doit(_Z_f1, _Z_f0, X##_f, Y##_f);					\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_2(_Z, wfracbits-1, 2*wfracbits);			\
-    R##_f = _Z_f0;							\
-  } while (0)
+  do									\
+    {									\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_1_wide_Z);				\
+      _FP_MUL_MEAT_DW_1_wide ((wfracbits), _FP_MUL_MEAT_1_wide_Z,	\
+			      X, Y, doit);				\
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_2 (_FP_MUL_MEAT_1_wide_Z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      R##_f = _FP_MUL_MEAT_1_wide_Z_f0;					\
+    }									\
+  while (0)
 
 /* Finally, a simple widening multiply algorithm.  What fun!  */
 
-#define _FP_MUL_MEAT_1_hard(wfracbits, R, X, Y)				\
-  do {									\
-    _FP_W_TYPE _xh, _xl, _yh, _yl, _z_f0, _z_f1, _a_f0, _a_f1;		\
-									\
-    /* split the words in half */					\
-    _xh = X##_f >> (_FP_W_TYPE_SIZE/2);					\
-    _xl = X##_f & (((_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2)) - 1);		\
-    _yh = Y##_f >> (_FP_W_TYPE_SIZE/2);					\
-    _yl = Y##_f & (((_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2)) - 1);		\
+#define _FP_MUL_MEAT_DW_1_hard(wfracbits, R, X, Y)			\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_1_hard_xh, _FP_MUL_MEAT_DW_1_hard_xl;	\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_1_hard_yh, _FP_MUL_MEAT_DW_1_hard_yl;	\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_1_hard_a);			\
 									\
-    /* multiply the pieces */						\
-    _z_f0 = _xl * _yl;							\
-    _a_f0 = _xh * _yl;							\
-    _a_f1 = _xl * _yh;							\
-    _z_f1 = _xh * _yh;							\
+      /* Split the words in half.  */					\
+      _FP_MUL_MEAT_DW_1_hard_xh = X##_f >> (_FP_W_TYPE_SIZE/2);		\
+      _FP_MUL_MEAT_DW_1_hard_xl						\
+	= X##_f & (((_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE/2)) - 1);	\
+      _FP_MUL_MEAT_DW_1_hard_yh = Y##_f >> (_FP_W_TYPE_SIZE/2);		\
+      _FP_MUL_MEAT_DW_1_hard_yl						\
+	= Y##_f & (((_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE/2)) - 1);	\
 									\
-    /* reassemble into two full words */				\
-    if ((_a_f0 += _a_f1) < _a_f1)					\
-      _z_f1 += (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2);			\
-    _a_f1 = _a_f0 >> (_FP_W_TYPE_SIZE/2);				\
-    _a_f0 = _a_f0 << (_FP_W_TYPE_SIZE/2);				\
-    _FP_FRAC_ADD_2(_z, _z, _a);						\
+      /* Multiply the pieces.  */					\
+      R##_f0 = _FP_MUL_MEAT_DW_1_hard_xl * _FP_MUL_MEAT_DW_1_hard_yl;	\
+      _FP_MUL_MEAT_DW_1_hard_a_f0					\
+	= _FP_MUL_MEAT_DW_1_hard_xh * _FP_MUL_MEAT_DW_1_hard_yl;	\
+      _FP_MUL_MEAT_DW_1_hard_a_f1					\
+	= _FP_MUL_MEAT_DW_1_hard_xl * _FP_MUL_MEAT_DW_1_hard_yh;	\
+      R##_f1 = _FP_MUL_MEAT_DW_1_hard_xh * _FP_MUL_MEAT_DW_1_hard_yh;	\
 									\
-    /* normalize */							\
-    _FP_FRAC_SRS_2(_z, wfracbits - 1, 2*wfracbits);			\
-    R##_f = _z_f0;							\
-  } while (0)
+      /* Reassemble into two full words.  */				\
+      if ((_FP_MUL_MEAT_DW_1_hard_a_f0 += _FP_MUL_MEAT_DW_1_hard_a_f1)	\
+	  < _FP_MUL_MEAT_DW_1_hard_a_f1)				\
+	R##_f1 += (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE/2);		\
+      _FP_MUL_MEAT_DW_1_hard_a_f1					\
+	= _FP_MUL_MEAT_DW_1_hard_a_f0 >> (_FP_W_TYPE_SIZE/2);		\
+      _FP_MUL_MEAT_DW_1_hard_a_f0					\
+	= _FP_MUL_MEAT_DW_1_hard_a_f0 << (_FP_W_TYPE_SIZE/2);		\
+      _FP_FRAC_ADD_2 (R, R, _FP_MUL_MEAT_DW_1_hard_a);			\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_1_hard(wfracbits, R, X, Y)			\
+  do								\
+    {								\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_1_hard_z);			\
+      _FP_MUL_MEAT_DW_1_hard ((wfracbits),			\
+			      _FP_MUL_MEAT_1_hard_z, X, Y);	\
+								\
+      /* Normalize.  */						\
+      _FP_FRAC_SRS_2 (_FP_MUL_MEAT_1_hard_z,			\
+		      (wfracbits) - 1, 2*(wfracbits));		\
+      R##_f = _FP_MUL_MEAT_1_hard_z_f0;				\
+    }								\
+  while (0)
 
 
-/*
- * Division algorithms:
- */
+/* Division algorithms: */
 
 /* Basic.  Assuming the host word size is >= 2*FRACBITS, we can do the
    division immediately.  Give this macro either _FP_DIV_HELP_imm for
    C primitives or _FP_DIV_HELP_ldiv for the ISO function.  Which you
    choose will depend on what the compiler does with divrem4.  */
 
-#define _FP_DIV_MEAT_1_imm(fs, R, X, Y, doit)		\
-  do {							\
-    _FP_W_TYPE _q, _r;					\
-    X##_f <<= (X##_f < Y##_f				\
-	       ? R##_e--, _FP_WFRACBITS_##fs		\
-	       : _FP_WFRACBITS_##fs - 1);		\
-    doit(_q, _r, X##_f, Y##_f);				\
-    R##_f = _q | (_r != 0);				\
-  } while (0)
+#define _FP_DIV_MEAT_1_imm(fs, R, X, Y, doit)				\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_DIV_MEAT_1_imm_q, _FP_DIV_MEAT_1_imm_r;		\
+      X##_f <<= (X##_f < Y##_f						\
+		 ? R##_e--, _FP_WFRACBITS_##fs				\
+		 : _FP_WFRACBITS_##fs - 1);				\
+      doit (_FP_DIV_MEAT_1_imm_q, _FP_DIV_MEAT_1_imm_r, X##_f, Y##_f);	\
+      R##_f = _FP_DIV_MEAT_1_imm_q | (_FP_DIV_MEAT_1_imm_r != 0);	\
+    }									\
+  while (0)
 
 /* GCC's longlong.h defines a 2W / 1W => (1W,1W) primitive udiv_qrnnd
    that may be useful in this situation.  This first is for a primitive
@@ -202,102 +269,101 @@
    for UDIV_NEEDS_NORMALIZATION to tell which your machine needs.  */
 
 #define _FP_DIV_MEAT_1_udiv_norm(fs, R, X, Y)				\
-  do {									\
-    _FP_W_TYPE _nh, _nl, _q, _r, _y;					\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_nh;				\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_nl;				\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_q;				\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_r;				\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_norm_y;				\
+									\
+      /* Normalize Y -- i.e. make the most significant bit set.  */	\
+      _FP_DIV_MEAT_1_udiv_norm_y = Y##_f << _FP_WFRACXBITS_##fs;	\
 									\
-    /* Normalize Y -- i.e. make the most significant bit set.  */	\
-    _y = Y##_f << _FP_WFRACXBITS_##fs;					\
+      /* Shift X op correspondingly high, that is, up one full word.  */ \
+      if (X##_f < Y##_f)						\
+	{								\
+	  R##_e--;							\
+	  _FP_DIV_MEAT_1_udiv_norm_nl = 0;				\
+	  _FP_DIV_MEAT_1_udiv_norm_nh = X##_f;				\
+	}								\
+      else								\
+	{								\
+	  _FP_DIV_MEAT_1_udiv_norm_nl = X##_f << (_FP_W_TYPE_SIZE - 1);	\
+	  _FP_DIV_MEAT_1_udiv_norm_nh = X##_f >> 1;			\
+	}								\
 									\
-    /* Shift X op correspondingly high, that is, up one full word.  */	\
-    if (X##_f < Y##_f)							\
-      {									\
-	R##_e--;							\
-	_nl = 0;							\
-	_nh = X##_f;							\
-      }									\
-    else								\
-      {									\
-	_nl = X##_f << (_FP_W_TYPE_SIZE - 1);				\
-	_nh = X##_f >> 1;						\
-      }									\
-    									\
-    udiv_qrnnd(_q, _r, _nh, _nl, _y);					\
-    R##_f = _q | (_r != 0);						\
-  } while (0)
-
-#define _FP_DIV_MEAT_1_udiv(fs, R, X, Y)		\
-  do {							\
-    _FP_W_TYPE _nh, _nl, _q, _r;			\
-    if (X##_f < Y##_f)					\
-      {							\
-	R##_e--;					\
-	_nl = X##_f << _FP_WFRACBITS_##fs;		\
-	_nh = X##_f >> _FP_WFRACXBITS_##fs;		\
-      }							\
-    else						\
-      {							\
-	_nl = X##_f << (_FP_WFRACBITS_##fs - 1);	\
-	_nh = X##_f >> (_FP_WFRACXBITS_##fs + 1);	\
-      }							\
-    udiv_qrnnd(_q, _r, _nh, _nl, Y##_f);		\
-    R##_f = _q | (_r != 0);				\
-  } while (0)
-  
-  
-/*
- * Square root algorithms:
- * We have just one right now, maybe Newton approximation
- * should be added for those machines where division is fast.
- */
- 
-#define _FP_SQRT_MEAT_1(R, S, T, X, q)			\
-  do {							\
-    while (q != _FP_WORK_ROUND)				\
-      {							\
-        T##_f = S##_f + q;				\
-        if (T##_f <= X##_f)				\
-          {						\
-            S##_f = T##_f + q;				\
-            X##_f -= T##_f;				\
-            R##_f += q;					\
-          }						\
-        _FP_FRAC_SLL_1(X, 1);				\
-        q >>= 1;					\
-      }							\
-    if (X##_f)						\
-      {							\
-	if (S##_f < X##_f)				\
-	  R##_f |= _FP_WORK_ROUND;			\
-	R##_f |= _FP_WORK_STICKY;			\
-      }							\
-  } while (0)
-
-/*
- * Assembly/disassembly for converting to/from integral types.  
- * No shifting or overflow handled here.
- */
-
-#define _FP_FRAC_ASSEMBLE_1(r, X, rsize)	(r = X##_f)
-#define _FP_FRAC_DISASSEMBLE_1(X, r, rsize)	(X##_f = r)
-
-
-/*
- * Convert FP values between word sizes
- */
-
-#define _FP_FRAC_CONV_1_1(dfs, sfs, D, S)				\
-  do {									\
-    D##_f = S##_f;							\
-    if (_FP_WFRACBITS_##sfs > _FP_WFRACBITS_##dfs)			\
-      {									\
-	if (S##_c != FP_CLS_NAN)					\
-	  _FP_FRAC_SRS_1(D, (_FP_WFRACBITS_##sfs-_FP_WFRACBITS_##dfs),	\
-			 _FP_WFRACBITS_##sfs);				\
-	else								\
-	  _FP_FRAC_SRL_1(D, (_FP_WFRACBITS_##sfs-_FP_WFRACBITS_##dfs));	\
-      }									\
-    else								\
-      D##_f <<= _FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs;		\
-  } while (0)
+      udiv_qrnnd (_FP_DIV_MEAT_1_udiv_norm_q,				\
+		  _FP_DIV_MEAT_1_udiv_norm_r,				\
+		  _FP_DIV_MEAT_1_udiv_norm_nh,				\
+		  _FP_DIV_MEAT_1_udiv_norm_nl,				\
+		  _FP_DIV_MEAT_1_udiv_norm_y);				\
+      R##_f = (_FP_DIV_MEAT_1_udiv_norm_q				\
+	       | (_FP_DIV_MEAT_1_udiv_norm_r != 0));			\
+    }									\
+  while (0)
+
+#define _FP_DIV_MEAT_1_udiv(fs, R, X, Y)				\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_nh, _FP_DIV_MEAT_1_udiv_nl;	\
+      _FP_W_TYPE _FP_DIV_MEAT_1_udiv_q, _FP_DIV_MEAT_1_udiv_r;		\
+      if (X##_f < Y##_f)						\
+	{								\
+	  R##_e--;							\
+	  _FP_DIV_MEAT_1_udiv_nl = X##_f << _FP_WFRACBITS_##fs;		\
+	  _FP_DIV_MEAT_1_udiv_nh = X##_f >> _FP_WFRACXBITS_##fs;	\
+	}								\
+      else								\
+	{								\
+	  _FP_DIV_MEAT_1_udiv_nl = X##_f << (_FP_WFRACBITS_##fs - 1);	\
+	  _FP_DIV_MEAT_1_udiv_nh = X##_f >> (_FP_WFRACXBITS_##fs + 1);	\
+	}								\
+      udiv_qrnnd (_FP_DIV_MEAT_1_udiv_q, _FP_DIV_MEAT_1_udiv_r,		\
+		  _FP_DIV_MEAT_1_udiv_nh, _FP_DIV_MEAT_1_udiv_nl,	\
+		  Y##_f);						\
+      R##_f = _FP_DIV_MEAT_1_udiv_q | (_FP_DIV_MEAT_1_udiv_r != 0);	\
+    }									\
+  while (0)
+
+
+/* Square root algorithms:
+   We have just one right now, maybe Newton approximation
+   should be added for those machines where division is fast.  */
+
+#define _FP_SQRT_MEAT_1(R, S, T, X, q)		\
+  do						\
+    {						\
+      while ((q) != _FP_WORK_ROUND)		\
+	{					\
+	  T##_f = S##_f + (q);			\
+	  if (T##_f <= X##_f)			\
+	    {					\
+	      S##_f = T##_f + (q);		\
+	      X##_f -= T##_f;			\
+	      R##_f += (q);			\
+	    }					\
+	  _FP_FRAC_SLL_1 (X, 1);		\
+	  (q) >>= 1;				\
+	}					\
+      if (X##_f)				\
+	{					\
+	  if (S##_f < X##_f)			\
+	    R##_f |= _FP_WORK_ROUND;		\
+	  R##_f |= _FP_WORK_STICKY;		\
+	}					\
+    }						\
+  while (0)
+
+/* Assembly/disassembly for converting to/from integral types.
+   No shifting or overflow handled here.  */
+
+#define _FP_FRAC_ASSEMBLE_1(r, X, rsize)	((r) = X##_f)
+#define _FP_FRAC_DISASSEMBLE_1(X, r, rsize)	(X##_f = (r))
+
+
+/* Convert FP values between word sizes.  */
+
+#define _FP_FRAC_COPY_1_1(D, S)		(D##_f = S##_f)
 
 #endif /* __MATH_EMU_OP_1_H__ */
diff --git a/include/math-emu/op-2.h b/include/math-emu/op-2.h
index 4f26ecc..ed26ae9 100644
--- a/include/math-emu/op-2.h
+++ b/include/math-emu/op-2.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Basic two-word fraction declaration and manipulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,113 +8,139 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_OP_2_H__
 #define __MATH_EMU_OP_2_H__
 
 #define _FP_FRAC_DECL_2(X)	_FP_W_TYPE X##_f0 = 0, X##_f1 = 0
-#define _FP_FRAC_COPY_2(D,S)	(D##_f0 = S##_f0, D##_f1 = S##_f1)
-#define _FP_FRAC_SET_2(X,I)	__FP_FRAC_SET_2(X, I)
+#define _FP_FRAC_COPY_2(D, S)	(D##_f0 = S##_f0, D##_f1 = S##_f1)
+#define _FP_FRAC_SET_2(X, I)	__FP_FRAC_SET_2 (X, I)
 #define _FP_FRAC_HIGH_2(X)	(X##_f1)
 #define _FP_FRAC_LOW_2(X)	(X##_f0)
-#define _FP_FRAC_WORD_2(X,w)	(X##_f##w)
-
-#define _FP_FRAC_SLL_2(X,N)						\
-  do {									\
-    if ((N) < _FP_W_TYPE_SIZE)						\
-      {									\
-	if (__builtin_constant_p(N) && (N) == 1) 			\
-	  {								\
-	    X##_f1 = X##_f1 + X##_f1 + (((_FP_WS_TYPE)(X##_f0)) < 0);	\
-	    X##_f0 += X##_f0;						\
-	  }								\
-	else								\
-	  {								\
-	    X##_f1 = X##_f1 << (N) | X##_f0 >> (_FP_W_TYPE_SIZE - (N));	\
-	    X##_f0 <<= (N);						\
-	  }								\
-      }									\
-    else								\
-      {									\
-	X##_f1 = X##_f0 << ((N) - _FP_W_TYPE_SIZE);			\
-	X##_f0 = 0;							\
-      }									\
-  } while (0)
-
-#define _FP_FRAC_SRL_2(X,N)						\
-  do {									\
-    if ((N) < _FP_W_TYPE_SIZE)						\
-      {									\
-	X##_f0 = X##_f0 >> (N) | X##_f1 << (_FP_W_TYPE_SIZE - (N));	\
-	X##_f1 >>= (N);							\
-      }									\
-    else								\
-      {									\
-	X##_f0 = X##_f1 >> ((N) - _FP_W_TYPE_SIZE);			\
-	X##_f1 = 0;							\
-      }									\
-  } while (0)
+#define _FP_FRAC_WORD_2(X, w)	(X##_f##w)
+
+#define _FP_FRAC_SLL_2(X, N)						\
+  (void) (((N) < _FP_W_TYPE_SIZE)					\
+	  ? ({								\
+	      if (__builtin_constant_p (N) && (N) == 1)			\
+		{							\
+		  X##_f1 = X##_f1 + X##_f1 + (((_FP_WS_TYPE) (X##_f0)) < 0); \
+		  X##_f0 += X##_f0;					\
+		}							\
+	      else							\
+		{							\
+		  X##_f1 = X##_f1 << (N) | X##_f0 >> (_FP_W_TYPE_SIZE - (N)); \
+		  X##_f0 <<= (N);					\
+		}							\
+	      0;							\
+	    })								\
+	  : ({								\
+	      X##_f1 = X##_f0 << ((N) - _FP_W_TYPE_SIZE);		\
+	      X##_f0 = 0;						\
+	    }))
+
+
+#define _FP_FRAC_SRL_2(X, N)						\
+  (void) (((N) < _FP_W_TYPE_SIZE)					\
+	  ? ({								\
+	      X##_f0 = X##_f0 >> (N) | X##_f1 << (_FP_W_TYPE_SIZE - (N)); \
+	      X##_f1 >>= (N);						\
+	    })								\
+	  : ({								\
+	      X##_f0 = X##_f1 >> ((N) - _FP_W_TYPE_SIZE);		\
+	      X##_f1 = 0;						\
+	    }))
 
 /* Right shift with sticky-lsb.  */
-#define _FP_FRAC_SRS_2(X,N,sz)						\
-  do {									\
-    if ((N) < _FP_W_TYPE_SIZE)						\
-      {									\
-	X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) |	\
-		  (__builtin_constant_p(N) && (N) == 1			\
+#define _FP_FRAC_SRST_2(X, S, N, sz)					\
+  (void) (((N) < _FP_W_TYPE_SIZE)					\
+	  ? ({								\
+	      S = (__builtin_constant_p (N) && (N) == 1			\
 		   ? X##_f0 & 1						\
-		   : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0));	\
-	X##_f1 >>= (N);							\
-      }									\
-    else								\
-      {									\
-	X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE) |			\
-		(((X##_f1 << (2*_FP_W_TYPE_SIZE - (N))) | X##_f0) != 0)); \
-	X##_f1 = 0;							\
-      }									\
-  } while (0)
-
-#define _FP_FRAC_ADDI_2(X,I)	\
-  __FP_FRAC_ADDI_2(X##_f1, X##_f0, I)
-
-#define _FP_FRAC_ADD_2(R,X,Y)	\
-  __FP_FRAC_ADD_2(R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
-
-#define _FP_FRAC_SUB_2(R,X,Y)	\
-  __FP_FRAC_SUB_2(R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
-
-#define _FP_FRAC_DEC_2(X,Y)	\
-  __FP_FRAC_DEC_2(X##_f1, X##_f0, Y##_f1, Y##_f0)
-
-#define _FP_FRAC_CLZ_2(R,X)	\
-  do {				\
-    if (X##_f1)			\
-      __FP_CLZ(R,X##_f1);	\
-    else 			\
-    {				\
-      __FP_CLZ(R,X##_f0);	\
-      R += _FP_W_TYPE_SIZE;	\
-    }				\
-  } while(0)
-
-/* Predicates */
-#define _FP_FRAC_NEGP_2(X)	((_FP_WS_TYPE)X##_f1 < 0)
+		   : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0);		\
+	      X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N)); \
+	      X##_f1 >>= (N);						\
+	    })								\
+	  : ({								\
+	      S = ((((N) == _FP_W_TYPE_SIZE				\
+		     ? 0						\
+		     : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N))))		\
+		    | X##_f0) != 0);					\
+	      X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE));		\
+	      X##_f1 = 0;						\
+	    }))
+
+#define _FP_FRAC_SRS_2(X, N, sz)					\
+  (void) (((N) < _FP_W_TYPE_SIZE)					\
+	  ? ({								\
+	      X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) \
+			| (__builtin_constant_p (N) && (N) == 1		\
+			   ? X##_f0 & 1					\
+			   : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0)); \
+	      X##_f1 >>= (N);						\
+	    })								\
+	  : ({								\
+	      X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE)		\
+			| ((((N) == _FP_W_TYPE_SIZE			\
+			     ? 0					\
+			     : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N))))	\
+			    | X##_f0) != 0));				\
+	      X##_f1 = 0;						\
+	    }))
+
+#define _FP_FRAC_ADDI_2(X, I)	\
+  __FP_FRAC_ADDI_2 (X##_f1, X##_f0, I)
+
+#define _FP_FRAC_ADD_2(R, X, Y)	\
+  __FP_FRAC_ADD_2 (R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
+
+#define _FP_FRAC_SUB_2(R, X, Y)	\
+  __FP_FRAC_SUB_2 (R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0)
+
+#define _FP_FRAC_DEC_2(X, Y)	\
+  __FP_FRAC_DEC_2 (X##_f1, X##_f0, Y##_f1, Y##_f0)
+
+#define _FP_FRAC_CLZ_2(R, X)			\
+  do						\
+    {						\
+      if (X##_f1)				\
+	__FP_CLZ ((R), X##_f1);			\
+      else					\
+	{					\
+	  __FP_CLZ ((R), X##_f0);		\
+	  (R) += _FP_W_TYPE_SIZE;		\
+	}					\
+    }						\
+  while (0)
+
+/* Predicates.  */
+#define _FP_FRAC_NEGP_2(X)	((_FP_WS_TYPE) X##_f1 < 0)
 #define _FP_FRAC_ZEROP_2(X)	((X##_f1 | X##_f0) == 0)
-#define _FP_FRAC_OVERP_2(fs,X)	(_FP_FRAC_HIGH_##fs(X) & _FP_OVERFLOW_##fs)
-#define _FP_FRAC_CLEAR_OVERP_2(fs,X)	(_FP_FRAC_HIGH_##fs(X) &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_OVERP_2(fs, X)	(_FP_FRAC_HIGH_##fs (X) & _FP_OVERFLOW_##fs)
+#define _FP_FRAC_CLEAR_OVERP_2(fs, X)	(_FP_FRAC_HIGH_##fs (X) &= ~_FP_OVERFLOW_##fs)
+#define _FP_FRAC_HIGHBIT_DW_2(fs, X)	\
+  (_FP_FRAC_HIGH_DW_##fs (X) & _FP_HIGHBIT_DW_##fs)
 #define _FP_FRAC_EQ_2(X, Y)	(X##_f1 == Y##_f1 && X##_f0 == Y##_f0)
 #define _FP_FRAC_GT_2(X, Y)	\
   (X##_f1 > Y##_f1 || (X##_f1 == Y##_f1 && X##_f0 > Y##_f0))
@@ -123,491 +149,556 @@
 
 #define _FP_ZEROFRAC_2		0, 0
 #define _FP_MINFRAC_2		0, 1
-#define _FP_MAXFRAC_2		(~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0)
+#define _FP_MAXFRAC_2		(~(_FP_WS_TYPE) 0), (~(_FP_WS_TYPE) 0)
 
-/*
- * Internals 
- */
+/* Internals.  */
 
-#define __FP_FRAC_SET_2(X,I1,I0)	(X##_f0 = I0, X##_f1 = I1)
+#define __FP_FRAC_SET_2(X, I1, I0)	(X##_f0 = I0, X##_f1 = I1)
 
-#define __FP_CLZ_2(R, xh, xl)	\
-  do {				\
-    if (xh)			\
-      __FP_CLZ(R,xh);		\
-    else 			\
-    {				\
-      __FP_CLZ(R,xl);		\
-      R += _FP_W_TYPE_SIZE;	\
-    }				\
-  } while(0)
+#define __FP_CLZ_2(R, xh, xl)			\
+  do						\
+    {						\
+      if (xh)					\
+	__FP_CLZ ((R), xh);			\
+      else					\
+	{					\
+	  __FP_CLZ ((R), xl);			\
+	  (R) += _FP_W_TYPE_SIZE;		\
+	}					\
+    }						\
+  while (0)
 
 #if 0
 
-#ifndef __FP_FRAC_ADDI_2
-#define __FP_FRAC_ADDI_2(xh, xl, i)	\
+# ifndef __FP_FRAC_ADDI_2
+#  define __FP_FRAC_ADDI_2(xh, xl, i)	\
   (xh += ((xl += i) < i))
-#endif
-#ifndef __FP_FRAC_ADD_2
-#define __FP_FRAC_ADD_2(rh, rl, xh, xl, yh, yl)	\
+# endif
+# ifndef __FP_FRAC_ADD_2
+#  define __FP_FRAC_ADD_2(rh, rl, xh, xl, yh, yl)	\
   (rh = xh + yh + ((rl = xl + yl) < xl))
-#endif
-#ifndef __FP_FRAC_SUB_2
-#define __FP_FRAC_SUB_2(rh, rl, xh, xl, yh, yl)	\
+# endif
+# ifndef __FP_FRAC_SUB_2
+#  define __FP_FRAC_SUB_2(rh, rl, xh, xl, yh, yl)	\
   (rh = xh - yh - ((rl = xl - yl) > xl))
-#endif
-#ifndef __FP_FRAC_DEC_2
-#define __FP_FRAC_DEC_2(xh, xl, yh, yl)	\
-  do {					\
-    UWtype _t = xl;			\
-    xh -= yh + ((xl -= yl) > _t);	\
-  } while (0)
-#endif
+# endif
+# ifndef __FP_FRAC_DEC_2
+#  define __FP_FRAC_DEC_2(xh, xl, yh, yl)		\
+  do							\
+    {							\
+      UWtype __FP_FRAC_DEC_2_t = xl;			\
+      xh -= yh + ((xl -= yl) > __FP_FRAC_DEC_2_t);	\
+    }							\
+  while (0)
+# endif
 
 #else
 
-#undef __FP_FRAC_ADDI_2
-#define __FP_FRAC_ADDI_2(xh, xl, i)	add_ssaaaa(xh, xl, xh, xl, 0, i)
-#undef __FP_FRAC_ADD_2
-#define __FP_FRAC_ADD_2			add_ssaaaa
-#undef __FP_FRAC_SUB_2
-#define __FP_FRAC_SUB_2			sub_ddmmss
-#undef __FP_FRAC_DEC_2
-#define __FP_FRAC_DEC_2(xh, xl, yh, yl)	sub_ddmmss(xh, xl, xh, xl, yh, yl)
+# undef __FP_FRAC_ADDI_2
+# define __FP_FRAC_ADDI_2(xh, xl, i)	add_ssaaaa (xh, xl, xh, xl, 0, i)
+# undef __FP_FRAC_ADD_2
+# define __FP_FRAC_ADD_2		add_ssaaaa
+# undef __FP_FRAC_SUB_2
+# define __FP_FRAC_SUB_2		sub_ddmmss
+# undef __FP_FRAC_DEC_2
+# define __FP_FRAC_DEC_2(xh, xl, yh, yl)	\
+  sub_ddmmss (xh, xl, xh, xl, yh, yl)
 
 #endif
 
-/*
- * Unpack the raw bits of a native fp value.  Do not classify or
- * normalize the data.
- */
+/* Unpack the raw bits of a native fp value.  Do not classify or
+   normalize the data.  */
 
 #define _FP_UNPACK_RAW_2(fs, X, val)			\
-  do {							\
-    union _FP_UNION_##fs _flo; _flo.flt = (val);	\
+  do							\
+    {							\
+      union _FP_UNION_##fs _FP_UNPACK_RAW_2_flo;	\
+      _FP_UNPACK_RAW_2_flo.flt = (val);			\
 							\
-    X##_f0 = _flo.bits.frac0;				\
-    X##_f1 = _flo.bits.frac1;				\
-    X##_e  = _flo.bits.exp;				\
-    X##_s  = _flo.bits.sign;				\
-  } while (0)
+      X##_f0 = _FP_UNPACK_RAW_2_flo.bits.frac0;		\
+      X##_f1 = _FP_UNPACK_RAW_2_flo.bits.frac1;		\
+      X##_e  = _FP_UNPACK_RAW_2_flo.bits.exp;		\
+      X##_s  = _FP_UNPACK_RAW_2_flo.bits.sign;		\
+    }							\
+  while (0)
 
 #define _FP_UNPACK_RAW_2_P(fs, X, val)			\
-  do {							\
-    union _FP_UNION_##fs *_flo =			\
-      (union _FP_UNION_##fs *)(val);			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_UNPACK_RAW_2_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
 							\
-    X##_f0 = _flo->bits.frac0;				\
-    X##_f1 = _flo->bits.frac1;				\
-    X##_e  = _flo->bits.exp;				\
-    X##_s  = _flo->bits.sign;				\
-  } while (0)
-
-
-/*
- * Repack the raw bits of a native fp value.
- */
-
-#define _FP_PACK_RAW_2(fs, val, X)			\
-  do {							\
-    union _FP_UNION_##fs _flo;				\
-							\
-    _flo.bits.frac0 = X##_f0;				\
-    _flo.bits.frac1 = X##_f1;				\
-    _flo.bits.exp   = X##_e;				\
-    _flo.bits.sign  = X##_s;				\
-							\
-    (val) = _flo.flt;					\
-  } while (0)
+      X##_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0;	\
+      X##_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1;	\
+      X##_e  = _FP_UNPACK_RAW_2_P_flo->bits.exp;	\
+      X##_s  = _FP_UNPACK_RAW_2_P_flo->bits.sign;	\
+    }							\
+  while (0)
+
+
+/* Repack the raw bits of a native fp value.  */
+
+#define _FP_PACK_RAW_2(fs, val, X)		\
+  do						\
+    {						\
+      union _FP_UNION_##fs _FP_PACK_RAW_2_flo;	\
+						\
+      _FP_PACK_RAW_2_flo.bits.frac0 = X##_f0;	\
+      _FP_PACK_RAW_2_flo.bits.frac1 = X##_f1;	\
+      _FP_PACK_RAW_2_flo.bits.exp   = X##_e;	\
+      _FP_PACK_RAW_2_flo.bits.sign  = X##_s;	\
+						\
+      (val) = _FP_PACK_RAW_2_flo.flt;		\
+    }						\
+  while (0)
 
 #define _FP_PACK_RAW_2_P(fs, val, X)			\
-  do {							\
-    union _FP_UNION_##fs *_flo =			\
-      (union _FP_UNION_##fs *)(val);			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_PACK_RAW_2_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
 							\
-    _flo->bits.frac0 = X##_f0;				\
-    _flo->bits.frac1 = X##_f1;				\
-    _flo->bits.exp   = X##_e;				\
-    _flo->bits.sign  = X##_s;				\
-  } while (0)
+      _FP_PACK_RAW_2_P_flo->bits.frac0 = X##_f0;	\
+      _FP_PACK_RAW_2_P_flo->bits.frac1 = X##_f1;	\
+      _FP_PACK_RAW_2_P_flo->bits.exp   = X##_e;		\
+      _FP_PACK_RAW_2_P_flo->bits.sign  = X##_s;		\
+    }							\
+  while (0)
 
 
-/*
- * Multiplication algorithms:
- */
+/* Multiplication algorithms: */
 
 /* Given a 1W * 1W => 2W primitive, do the extended multiplication.  */
 
-#define _FP_MUL_MEAT_2_wide(wfracbits, R, X, Y, doit)			\
-  do {									\
-    _FP_FRAC_DECL_4(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c);	\
+#define _FP_MUL_MEAT_DW_2_wide(wfracbits, R, X, Y, doit)		\
+  do									\
+    {									\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_2_wide_b);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_2_wide_c);			\
+									\
+      doit (_FP_FRAC_WORD_4 (R, 1), _FP_FRAC_WORD_4 (R, 0),		\
+	    X##_f0, Y##_f0);						\
+      doit (_FP_MUL_MEAT_DW_2_wide_b_f1, _FP_MUL_MEAT_DW_2_wide_b_f0,	\
+	    X##_f0, Y##_f1);						\
+      doit (_FP_MUL_MEAT_DW_2_wide_c_f1, _FP_MUL_MEAT_DW_2_wide_c_f0,	\
+	    X##_f1, Y##_f0);						\
+      doit (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),		\
+	    X##_f1, Y##_f1);						\
 									\
-    doit(_FP_FRAC_WORD_4(_z,1), _FP_FRAC_WORD_4(_z,0), X##_f0, Y##_f0);	\
-    doit(_b_f1, _b_f0, X##_f0, Y##_f1);					\
-    doit(_c_f1, _c_f0, X##_f1, Y##_f0);					\
-    doit(_FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2), X##_f1, Y##_f1);	\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_2_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_2_wide_b_f0,			\
+		       _FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_2_wide_c_f1,			\
+		       _FP_MUL_MEAT_DW_2_wide_c_f0,			\
+		       _FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1));				\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_2_wide(wfracbits, R, X, Y, doit)			\
+  do									\
+    {									\
+      _FP_FRAC_DECL_4 (_FP_MUL_MEAT_2_wide_z);				\
 									\
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1), 0, _b_f1, _b_f0,		\
-		    _FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1));				\
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1), 0, _c_f1, _c_f0,		\
-		    _FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1));				\
+      _FP_MUL_MEAT_DW_2_wide ((wfracbits), _FP_MUL_MEAT_2_wide_z,	\
+			      X, Y, doit);				\
 									\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits);			\
-    R##_f0 = _FP_FRAC_WORD_4(_z,0);					\
-    R##_f1 = _FP_FRAC_WORD_4(_z,1);					\
-  } while (0)
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_4 (_FP_MUL_MEAT_2_wide_z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      R##_f0 = _FP_FRAC_WORD_4 (_FP_MUL_MEAT_2_wide_z, 0);		\
+      R##_f1 = _FP_FRAC_WORD_4 (_FP_MUL_MEAT_2_wide_z, 1);		\
+    }									\
+  while (0)
 
 /* Given a 1W * 1W => 2W primitive, do the extended multiplication.
    Do only 3 multiplications instead of four. This one is for machines
    where multiplication is much more expensive than subtraction.  */
 
-#define _FP_MUL_MEAT_2_wide_3mul(wfracbits, R, X, Y, doit)		\
-  do {									\
-    _FP_FRAC_DECL_4(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c);	\
-    _FP_W_TYPE _d;							\
-    int _c1, _c2;							\
+#define _FP_MUL_MEAT_DW_2_wide_3mul(wfracbits, R, X, Y, doit)		\
+  do									\
+    {									\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_2_wide_3mul_b);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_2_wide_3mul_c);			\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_2_wide_3mul_d;				\
+      int _FP_MUL_MEAT_DW_2_wide_3mul_c1;				\
+      int _FP_MUL_MEAT_DW_2_wide_3mul_c2;				\
 									\
-    _b_f0 = X##_f0 + X##_f1;						\
-    _c1 = _b_f0 < X##_f0;						\
-    _b_f1 = Y##_f0 + Y##_f1;						\
-    _c2 = _b_f1 < Y##_f0;						\
-    doit(_d, _FP_FRAC_WORD_4(_z,0), X##_f0, Y##_f0);			\
-    doit(_FP_FRAC_WORD_4(_z,2), _FP_FRAC_WORD_4(_z,1), _b_f0, _b_f1);	\
-    doit(_c_f1, _c_f0, X##_f1, Y##_f1);					\
+      _FP_MUL_MEAT_DW_2_wide_3mul_b_f0 = X##_f0 + X##_f1;		\
+      _FP_MUL_MEAT_DW_2_wide_3mul_c1					\
+	= _FP_MUL_MEAT_DW_2_wide_3mul_b_f0 < X##_f0;			\
+      _FP_MUL_MEAT_DW_2_wide_3mul_b_f1 = Y##_f0 + Y##_f1;		\
+      _FP_MUL_MEAT_DW_2_wide_3mul_c2					\
+	= _FP_MUL_MEAT_DW_2_wide_3mul_b_f1 < Y##_f0;			\
+      doit (_FP_MUL_MEAT_DW_2_wide_3mul_d, _FP_FRAC_WORD_4 (R, 0),	\
+	    X##_f0, Y##_f0);						\
+      doit (_FP_FRAC_WORD_4 (R, 2), _FP_FRAC_WORD_4 (R, 1),		\
+	    _FP_MUL_MEAT_DW_2_wide_3mul_b_f0,				\
+	    _FP_MUL_MEAT_DW_2_wide_3mul_b_f1);				\
+      doit (_FP_MUL_MEAT_DW_2_wide_3mul_c_f1,				\
+	    _FP_MUL_MEAT_DW_2_wide_3mul_c_f0, X##_f1, Y##_f1);		\
+									\
+      _FP_MUL_MEAT_DW_2_wide_3mul_b_f0					\
+	&= -_FP_MUL_MEAT_DW_2_wide_3mul_c2;				\
+      _FP_MUL_MEAT_DW_2_wide_3mul_b_f1					\
+	&= -_FP_MUL_MEAT_DW_2_wide_3mul_c1;				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1),				\
+		       (_FP_MUL_MEAT_DW_2_wide_3mul_c1			\
+			& _FP_MUL_MEAT_DW_2_wide_3mul_c2), 0,		\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_d,			\
+		       0, _FP_FRAC_WORD_4 (R, 2), _FP_FRAC_WORD_4 (R, 1)); \
+      __FP_FRAC_ADDI_2 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+			_FP_MUL_MEAT_DW_2_wide_3mul_b_f0);		\
+      __FP_FRAC_ADDI_2 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+			_FP_MUL_MEAT_DW_2_wide_3mul_b_f1);		\
+      __FP_FRAC_DEC_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1),				\
+		       0, _FP_MUL_MEAT_DW_2_wide_3mul_d,		\
+		       _FP_FRAC_WORD_4 (R, 0));				\
+      __FP_FRAC_DEC_3 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_FRAC_WORD_4 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_c_f1,		\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_c_f0);		\
+      __FP_FRAC_ADD_2 (_FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2),	\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_c_f1,		\
+		       _FP_MUL_MEAT_DW_2_wide_3mul_c_f0,		\
+		       _FP_FRAC_WORD_4 (R, 3), _FP_FRAC_WORD_4 (R, 2));	\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_2_wide_3mul(wfracbits, R, X, Y, doit)		\
+  do									\
+    {									\
+      _FP_FRAC_DECL_4 (_FP_MUL_MEAT_2_wide_3mul_z);			\
 									\
-    _b_f0 &= -_c2;							\
-    _b_f1 &= -_c1;							\
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1), (_c1 & _c2), 0, _d,		\
-		    0, _FP_FRAC_WORD_4(_z,2), _FP_FRAC_WORD_4(_z,1));	\
-    __FP_FRAC_ADDI_2(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		     _b_f0);						\
-    __FP_FRAC_ADDI_2(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		     _b_f1);						\
-    __FP_FRAC_DEC_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1),				\
-		    0, _d, _FP_FRAC_WORD_4(_z,0));			\
-    __FP_FRAC_DEC_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2),	\
-		    _FP_FRAC_WORD_4(_z,1), 0, _c_f1, _c_f0);		\
-    __FP_FRAC_ADD_2(_FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2),	\
-		    _c_f1, _c_f0,					\
-		    _FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2));	\
+      _FP_MUL_MEAT_DW_2_wide_3mul ((wfracbits),				\
+				   _FP_MUL_MEAT_2_wide_3mul_z,		\
+				   X, Y, doit);				\
 									\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits);			\
-    R##_f0 = _FP_FRAC_WORD_4(_z,0);					\
-    R##_f1 = _FP_FRAC_WORD_4(_z,1);					\
-  } while (0)
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_4 (_FP_MUL_MEAT_2_wide_3mul_z,			\
+		      (wfracbits)-1, 2*(wfracbits));			\
+      R##_f0 = _FP_FRAC_WORD_4 (_FP_MUL_MEAT_2_wide_3mul_z, 0);		\
+      R##_f1 = _FP_FRAC_WORD_4 (_FP_MUL_MEAT_2_wide_3mul_z, 1);		\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_DW_2_gmp(wfracbits, R, X, Y)	\
+  do							\
+    {							\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_2_gmp_x[2];		\
+      _FP_W_TYPE _FP_MUL_MEAT_DW_2_gmp_y[2];		\
+      _FP_MUL_MEAT_DW_2_gmp_x[0] = X##_f0;		\
+      _FP_MUL_MEAT_DW_2_gmp_x[1] = X##_f1;		\
+      _FP_MUL_MEAT_DW_2_gmp_y[0] = Y##_f0;		\
+      _FP_MUL_MEAT_DW_2_gmp_y[1] = Y##_f1;		\
+							\
+      mpn_mul_n (R##_f, _FP_MUL_MEAT_DW_2_gmp_x,	\
+		 _FP_MUL_MEAT_DW_2_gmp_y, 2);		\
+    }							\
+  while (0)
 
 #define _FP_MUL_MEAT_2_gmp(wfracbits, R, X, Y)				\
-  do {									\
-    _FP_FRAC_DECL_4(_z);						\
-    _FP_W_TYPE _x[2], _y[2];						\
-    _x[0] = X##_f0; _x[1] = X##_f1;					\
-    _y[0] = Y##_f0; _y[1] = Y##_f1;					\
+  do									\
+    {									\
+      _FP_FRAC_DECL_4 (_FP_MUL_MEAT_2_gmp_z);				\
 									\
-    mpn_mul_n(_z_f, _x, _y, 2);						\
+      _FP_MUL_MEAT_DW_2_gmp ((wfracbits), _FP_MUL_MEAT_2_gmp_z, X, Y);	\
 									\
-    /* Normalize since we know where the msb of the multiplicands	\
-       were (bit B), we know that the msb of the of the product is	\
-       at either 2B or 2B-1.  */					\
-    _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits);			\
-    R##_f0 = _z_f[0];							\
-    R##_f1 = _z_f[1];							\
-  } while (0)
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_4 (_FP_MUL_MEAT_2_gmp_z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      R##_f0 = _FP_MUL_MEAT_2_gmp_z_f[0];				\
+      R##_f1 = _FP_MUL_MEAT_2_gmp_z_f[1];				\
+    }									\
+  while (0)
 
 /* Do at most 120x120=240 bits multiplication using double floating
    point multiplication.  This is useful if floating point
    multiplication has much bigger throughput than integer multiply.
    It is supposed to work for _FP_W_TYPE_SIZE 64 and wfracbits
-   between 106 and 120 only.  
+   between 106 and 120 only.
    Caller guarantees that X and Y has (1LLL << (wfracbits - 1)) set.
    SETFETZ is a macro which will disable all FPU exceptions and set rounding
    towards zero,  RESETFE should optionally reset it back.  */
 
-#define _FP_MUL_MEAT_2_120_240_double(wfracbits, R, X, Y, setfetz, resetfe)	\
-  do {										\
-    static const double _const[] = {						\
-      /* 2^-24 */ 5.9604644775390625e-08,					\
-      /* 2^-48 */ 3.5527136788005009e-15,					\
-      /* 2^-72 */ 2.1175823681357508e-22,					\
-      /* 2^-96 */ 1.2621774483536189e-29,					\
-      /* 2^28 */ 2.68435456e+08,						\
-      /* 2^4 */ 1.600000e+01,							\
-      /* 2^-20 */ 9.5367431640625e-07,						\
-      /* 2^-44 */ 5.6843418860808015e-14,					\
-      /* 2^-68 */ 3.3881317890172014e-21,					\
-      /* 2^-92 */ 2.0194839173657902e-28,					\
-      /* 2^-116 */ 1.2037062152420224e-35};					\
-    double _a240, _b240, _c240, _d240, _e240, _f240, 				\
-	   _g240, _h240, _i240, _j240, _k240;					\
-    union { double d; UDItype i; } _l240, _m240, _n240, _o240,			\
-				   _p240, _q240, _r240, _s240;			\
-    UDItype _t240, _u240, _v240, _w240, _x240, _y240 = 0;			\
-										\
-    if (wfracbits < 106 || wfracbits > 120)					\
-      abort();									\
-										\
-    setfetz;									\
-										\
-    _e240 = (double)(long)(X##_f0 & 0xffffff);					\
-    _j240 = (double)(long)(Y##_f0 & 0xffffff);					\
-    _d240 = (double)(long)((X##_f0 >> 24) & 0xffffff);				\
-    _i240 = (double)(long)((Y##_f0 >> 24) & 0xffffff);				\
-    _c240 = (double)(long)(((X##_f1 << 16) & 0xffffff) | (X##_f0 >> 48));	\
-    _h240 = (double)(long)(((Y##_f1 << 16) & 0xffffff) | (Y##_f0 >> 48));	\
-    _b240 = (double)(long)((X##_f1 >> 8) & 0xffffff);				\
-    _g240 = (double)(long)((Y##_f1 >> 8) & 0xffffff);				\
-    _a240 = (double)(long)(X##_f1 >> 32);					\
-    _f240 = (double)(long)(Y##_f1 >> 32);					\
-    _e240 *= _const[3];								\
-    _j240 *= _const[3];								\
-    _d240 *= _const[2];								\
-    _i240 *= _const[2];								\
-    _c240 *= _const[1];								\
-    _h240 *= _const[1];								\
-    _b240 *= _const[0];								\
-    _g240 *= _const[0];								\
-    _s240.d =							      _e240*_j240;\
-    _r240.d =						_d240*_j240 + _e240*_i240;\
-    _q240.d =				  _c240*_j240 + _d240*_i240 + _e240*_h240;\
-    _p240.d =		    _b240*_j240 + _c240*_i240 + _d240*_h240 + _e240*_g240;\
-    _o240.d = _a240*_j240 + _b240*_i240 + _c240*_h240 + _d240*_g240 + _e240*_f240;\
-    _n240.d = _a240*_i240 + _b240*_h240 + _c240*_g240 + _d240*_f240;		\
-    _m240.d = _a240*_h240 + _b240*_g240 + _c240*_f240;				\
-    _l240.d = _a240*_g240 + _b240*_f240;					\
-    _k240 =   _a240*_f240;							\
-    _r240.d += _s240.d;								\
-    _q240.d += _r240.d;								\
-    _p240.d += _q240.d;								\
-    _o240.d += _p240.d;								\
-    _n240.d += _o240.d;								\
-    _m240.d += _n240.d;								\
-    _l240.d += _m240.d;								\
-    _k240 += _l240.d;								\
-    _s240.d -= ((_const[10]+_s240.d)-_const[10]);				\
-    _r240.d -= ((_const[9]+_r240.d)-_const[9]);					\
-    _q240.d -= ((_const[8]+_q240.d)-_const[8]);					\
-    _p240.d -= ((_const[7]+_p240.d)-_const[7]);					\
-    _o240.d += _const[7];							\
-    _n240.d += _const[6];							\
-    _m240.d += _const[5];							\
-    _l240.d += _const[4];							\
-    if (_s240.d != 0.0) _y240 = 1;						\
-    if (_r240.d != 0.0) _y240 = 1;						\
-    if (_q240.d != 0.0) _y240 = 1;						\
-    if (_p240.d != 0.0) _y240 = 1;						\
-    _t240 = (DItype)_k240;							\
-    _u240 = _l240.i;								\
-    _v240 = _m240.i;								\
-    _w240 = _n240.i;								\
-    _x240 = _o240.i;								\
-    R##_f1 = (_t240 << (128 - (wfracbits - 1)))					\
-	     | ((_u240 & 0xffffff) >> ((wfracbits - 1) - 104));			\
-    R##_f0 = ((_u240 & 0xffffff) << (168 - (wfracbits - 1)))			\
-    	     | ((_v240 & 0xffffff) << (144 - (wfracbits - 1)))			\
-    	     | ((_w240 & 0xffffff) << (120 - (wfracbits - 1)))			\
-    	     | ((_x240 & 0xffffff) >> ((wfracbits - 1) - 96))			\
-    	     | _y240;								\
-    resetfe;									\
-  } while (0)
-
-/*
- * Division algorithms:
- */
+#define _FP_MUL_MEAT_2_120_240_double(wfracbits, R, X, Y, setfetz, resetfe) \
+  do									\
+    {									\
+      static const double _const[] =					\
+	{								\
+	  /* 2^-24 */ 5.9604644775390625e-08,				\
+	  /* 2^-48 */ 3.5527136788005009e-15,				\
+	  /* 2^-72 */ 2.1175823681357508e-22,				\
+	  /* 2^-96 */ 1.2621774483536189e-29,				\
+	  /* 2^28 */ 2.68435456e+08,					\
+	  /* 2^4 */ 1.600000e+01,					\
+	  /* 2^-20 */ 9.5367431640625e-07,				\
+	  /* 2^-44 */ 5.6843418860808015e-14,				\
+	  /* 2^-68 */ 3.3881317890172014e-21,				\
+	  /* 2^-92 */ 2.0194839173657902e-28,				\
+	  /* 2^-116 */ 1.2037062152420224e-35				\
+	};								\
+      double _a240, _b240, _c240, _d240, _e240, _f240,			\
+	_g240, _h240, _i240, _j240, _k240;				\
+      union { double d; UDItype i; } _l240, _m240, _n240, _o240,	\
+				       _p240, _q240, _r240, _s240;	\
+      UDItype _t240, _u240, _v240, _w240, _x240, _y240 = 0;		\
+									\
+      if ((wfracbits) < 106 || (wfracbits) > 120)			\
+	abort ();							\
+									\
+      setfetz;								\
+									\
+      _e240 = (double) (long) (X##_f0 & 0xffffff);			\
+      _j240 = (double) (long) (Y##_f0 & 0xffffff);			\
+      _d240 = (double) (long) ((X##_f0 >> 24) & 0xffffff);		\
+      _i240 = (double) (long) ((Y##_f0 >> 24) & 0xffffff);		\
+      _c240 = (double) (long) (((X##_f1 << 16) & 0xffffff) | (X##_f0 >> 48)); \
+      _h240 = (double) (long) (((Y##_f1 << 16) & 0xffffff) | (Y##_f0 >> 48)); \
+      _b240 = (double) (long) ((X##_f1 >> 8) & 0xffffff);		\
+      _g240 = (double) (long) ((Y##_f1 >> 8) & 0xffffff);		\
+      _a240 = (double) (long) (X##_f1 >> 32);				\
+      _f240 = (double) (long) (Y##_f1 >> 32);				\
+      _e240 *= _const[3];						\
+      _j240 *= _const[3];						\
+      _d240 *= _const[2];						\
+      _i240 *= _const[2];						\
+      _c240 *= _const[1];						\
+      _h240 *= _const[1];						\
+      _b240 *= _const[0];						\
+      _g240 *= _const[0];						\
+      _s240.d =							      _e240*_j240; \
+      _r240.d =						_d240*_j240 + _e240*_i240; \
+      _q240.d =				  _c240*_j240 + _d240*_i240 + _e240*_h240; \
+      _p240.d =		    _b240*_j240 + _c240*_i240 + _d240*_h240 + _e240*_g240; \
+      _o240.d = _a240*_j240 + _b240*_i240 + _c240*_h240 + _d240*_g240 + _e240*_f240; \
+      _n240.d = _a240*_i240 + _b240*_h240 + _c240*_g240 + _d240*_f240;	\
+      _m240.d = _a240*_h240 + _b240*_g240 + _c240*_f240;		\
+      _l240.d = _a240*_g240 + _b240*_f240;				\
+      _k240 =   _a240*_f240;						\
+      _r240.d += _s240.d;						\
+      _q240.d += _r240.d;						\
+      _p240.d += _q240.d;						\
+      _o240.d += _p240.d;						\
+      _n240.d += _o240.d;						\
+      _m240.d += _n240.d;						\
+      _l240.d += _m240.d;						\
+      _k240 += _l240.d;							\
+      _s240.d -= ((_const[10]+_s240.d)-_const[10]);			\
+      _r240.d -= ((_const[9]+_r240.d)-_const[9]);			\
+      _q240.d -= ((_const[8]+_q240.d)-_const[8]);			\
+      _p240.d -= ((_const[7]+_p240.d)-_const[7]);			\
+      _o240.d += _const[7];						\
+      _n240.d += _const[6];						\
+      _m240.d += _const[5];						\
+      _l240.d += _const[4];						\
+      if (_s240.d != 0.0)						\
+	_y240 = 1;							\
+      if (_r240.d != 0.0)						\
+	_y240 = 1;							\
+      if (_q240.d != 0.0)						\
+	_y240 = 1;							\
+      if (_p240.d != 0.0)						\
+	_y240 = 1;							\
+      _t240 = (DItype) _k240;						\
+      _u240 = _l240.i;							\
+      _v240 = _m240.i;							\
+      _w240 = _n240.i;							\
+      _x240 = _o240.i;							\
+      R##_f1 = ((_t240 << (128 - (wfracbits - 1)))			\
+		| ((_u240 & 0xffffff) >> ((wfracbits - 1) - 104)));	\
+      R##_f0 = (((_u240 & 0xffffff) << (168 - (wfracbits - 1)))		\
+		| ((_v240 & 0xffffff) << (144 - (wfracbits - 1)))	\
+		| ((_w240 & 0xffffff) << (120 - (wfracbits - 1)))	\
+		| ((_x240 & 0xffffff) >> ((wfracbits - 1) - 96))	\
+		| _y240);						\
+      resetfe;								\
+    }									\
+  while (0)
+
+/* Division algorithms: */
 
 #define _FP_DIV_MEAT_2_udiv(fs, R, X, Y)				\
-  do {									\
-    _FP_W_TYPE _n_f2, _n_f1, _n_f0, _r_f1, _r_f0, _m_f1, _m_f0;		\
-    if (_FP_FRAC_GT_2(X, Y))						\
-      {									\
-	_n_f2 = X##_f1 >> 1;						\
-	_n_f1 = X##_f1 << (_FP_W_TYPE_SIZE - 1) | X##_f0 >> 1;		\
-	_n_f0 = X##_f0 << (_FP_W_TYPE_SIZE - 1);			\
-      }									\
-    else								\
-      {									\
-	R##_e--;							\
-	_n_f2 = X##_f1;							\
-	_n_f1 = X##_f0;							\
-	_n_f0 = 0;							\
-      }									\
-									\
-    /* Normalize, i.e. make the most significant bit of the 		\
-       denominator set. */						\
-    _FP_FRAC_SLL_2(Y, _FP_WFRACXBITS_##fs);				\
+  do									\
+    {									\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_n_f2;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_n_f1;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_n_f0;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_r_f1;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_r_f0;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_m_f1;				\
+      _FP_W_TYPE _FP_DIV_MEAT_2_udiv_m_f0;				\
+      if (_FP_FRAC_GE_2 (X, Y))						\
+	{								\
+	  _FP_DIV_MEAT_2_udiv_n_f2 = X##_f1 >> 1;			\
+	  _FP_DIV_MEAT_2_udiv_n_f1					\
+	    = X##_f1 << (_FP_W_TYPE_SIZE - 1) | X##_f0 >> 1;		\
+	  _FP_DIV_MEAT_2_udiv_n_f0					\
+	    = X##_f0 << (_FP_W_TYPE_SIZE - 1);				\
+	}								\
+      else								\
+	{								\
+	  R##_e--;							\
+	  _FP_DIV_MEAT_2_udiv_n_f2 = X##_f1;				\
+	  _FP_DIV_MEAT_2_udiv_n_f1 = X##_f0;				\
+	  _FP_DIV_MEAT_2_udiv_n_f0 = 0;					\
+	}								\
 									\
-    udiv_qrnnd(R##_f1, _r_f1, _n_f2, _n_f1, Y##_f1);			\
-    umul_ppmm(_m_f1, _m_f0, R##_f1, Y##_f0);				\
-    _r_f0 = _n_f0;							\
-    if (_FP_FRAC_GT_2(_m, _r))						\
-      {									\
-	R##_f1--;							\
-	_FP_FRAC_ADD_2(_r, Y, _r);					\
-	if (_FP_FRAC_GE_2(_r, Y) && _FP_FRAC_GT_2(_m, _r))		\
-	  {								\
-	    R##_f1--;							\
-	    _FP_FRAC_ADD_2(_r, Y, _r);					\
-	  }								\
-      }									\
-    _FP_FRAC_DEC_2(_r, _m);						\
+      /* Normalize, i.e. make the most significant bit of the		\
+	 denominator set.  */						\
+      _FP_FRAC_SLL_2 (Y, _FP_WFRACXBITS_##fs);				\
 									\
-    if (_r_f1 == Y##_f1)						\
-      {									\
-	/* This is a special case, not an optimization			\
-	   (_r/Y##_f1 would not fit into UWtype).			\
-	   As _r is guaranteed to be < Y,  R##_f0 can be either		\
-	   (UWtype)-1 or (UWtype)-2.  But as we know what kind		\
-	   of bits it is (sticky, guard, round),  we don't care.	\
-	   We also don't care what the reminder is,  because the	\
-	   guard bit will be set anyway.  -jj */			\
-	R##_f0 = -1;							\
-      }									\
-    else								\
-      {									\
-	udiv_qrnnd(R##_f0, _r_f1, _r_f1, _r_f0, Y##_f1);		\
-	umul_ppmm(_m_f1, _m_f0, R##_f0, Y##_f0);			\
-	_r_f0 = 0;							\
-	if (_FP_FRAC_GT_2(_m, _r))					\
-	  {								\
-	    R##_f0--;							\
-	    _FP_FRAC_ADD_2(_r, Y, _r);					\
-	    if (_FP_FRAC_GE_2(_r, Y) && _FP_FRAC_GT_2(_m, _r))		\
-	      {								\
-		R##_f0--;						\
-		_FP_FRAC_ADD_2(_r, Y, _r);				\
-	      }								\
-	  }								\
-	if (!_FP_FRAC_EQ_2(_r, _m))					\
-	  R##_f0 |= _FP_WORK_STICKY;					\
-      }									\
-  } while (0)
-
-
-#define _FP_DIV_MEAT_2_gmp(fs, R, X, Y)					\
-  do {									\
-    _FP_W_TYPE _x[4], _y[2], _z[4];					\
-    _y[0] = Y##_f0; _y[1] = Y##_f1;					\
-    _x[0] = _x[3] = 0;							\
-    if (_FP_FRAC_GT_2(X, Y))						\
-      {									\
-	R##_e++;							\
-	_x[1] = (X##_f0 << (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE) |	\
-		 X##_f1 >> (_FP_W_TYPE_SIZE -				\
-			    (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE)));	\
-	_x[2] = X##_f1 << (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE);	\
-      }									\
-    else								\
-      {									\
-	_x[1] = (X##_f0 << (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE) |	\
-		 X##_f1 >> (_FP_W_TYPE_SIZE -				\
-			    (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE)));	\
-	_x[2] = X##_f1 << (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE);	\
-      }									\
+      udiv_qrnnd (R##_f1, _FP_DIV_MEAT_2_udiv_r_f1,			\
+		  _FP_DIV_MEAT_2_udiv_n_f2, _FP_DIV_MEAT_2_udiv_n_f1,	\
+		  Y##_f1);						\
+      umul_ppmm (_FP_DIV_MEAT_2_udiv_m_f1, _FP_DIV_MEAT_2_udiv_m_f0,	\
+		 R##_f1, Y##_f0);					\
+      _FP_DIV_MEAT_2_udiv_r_f0 = _FP_DIV_MEAT_2_udiv_n_f0;		\
+      if (_FP_FRAC_GT_2 (_FP_DIV_MEAT_2_udiv_m, _FP_DIV_MEAT_2_udiv_r))	\
+	{								\
+	  R##_f1--;							\
+	  _FP_FRAC_ADD_2 (_FP_DIV_MEAT_2_udiv_r, Y,			\
+			  _FP_DIV_MEAT_2_udiv_r);			\
+	  if (_FP_FRAC_GE_2 (_FP_DIV_MEAT_2_udiv_r, Y)			\
+	      && _FP_FRAC_GT_2 (_FP_DIV_MEAT_2_udiv_m,			\
+				_FP_DIV_MEAT_2_udiv_r))			\
+	    {								\
+	      R##_f1--;							\
+	      _FP_FRAC_ADD_2 (_FP_DIV_MEAT_2_udiv_r, Y,			\
+			      _FP_DIV_MEAT_2_udiv_r);			\
+	    }								\
+	}								\
+      _FP_FRAC_DEC_2 (_FP_DIV_MEAT_2_udiv_r, _FP_DIV_MEAT_2_udiv_m);	\
 									\
-    (void) mpn_divrem (_z, 0, _x, 4, _y, 2);				\
-    R##_f1 = _z[1];							\
-    R##_f0 = _z[0] | ((_x[0] | _x[1]) != 0);				\
-  } while (0)
-
-
-/*
- * Square root algorithms:
- * We have just one right now, maybe Newton approximation
- * should be added for those machines where division is fast.
- */
- 
-#define _FP_SQRT_MEAT_2(R, S, T, X, q)			\
-  do {							\
-    while (q)						\
-      {							\
-	T##_f1 = S##_f1 + q;				\
-	if (T##_f1 <= X##_f1)				\
-	  {						\
-	    S##_f1 = T##_f1 + q;			\
-	    X##_f1 -= T##_f1;				\
-	    R##_f1 += q;				\
-	  }						\
-	_FP_FRAC_SLL_2(X, 1);				\
-	q >>= 1;					\
-      }							\
-    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);		\
-    while (q != _FP_WORK_ROUND)				\
-      {							\
-	T##_f0 = S##_f0 + q;				\
-	T##_f1 = S##_f1;				\
-	if (T##_f1 < X##_f1 || 				\
-	    (T##_f1 == X##_f1 && T##_f0 <= X##_f0))	\
-	  {						\
-	    S##_f0 = T##_f0 + q;			\
-	    S##_f1 += (T##_f0 > S##_f0);		\
-	    _FP_FRAC_DEC_2(X, T);			\
-	    R##_f0 += q;				\
-	  }						\
-	_FP_FRAC_SLL_2(X, 1);				\
-	q >>= 1;					\
-      }							\
-    if (X##_f0 | X##_f1)				\
-      {							\
-	if (S##_f1 < X##_f1 || 				\
-	    (S##_f1 == X##_f1 && S##_f0 < X##_f0))	\
-	  R##_f0 |= _FP_WORK_ROUND;			\
-	R##_f0 |= _FP_WORK_STICKY;			\
-      }							\
-  } while (0)
-
-
-/*
- * Assembly/disassembly for converting to/from integral types.  
- * No shifting or overflow handled here.
- */
+      if (_FP_DIV_MEAT_2_udiv_r_f1 == Y##_f1)				\
+	{								\
+	  /* This is a special case, not an optimization		\
+	     (_FP_DIV_MEAT_2_udiv_r/Y##_f1 would not fit into UWtype).	\
+	     As _FP_DIV_MEAT_2_udiv_r is guaranteed to be < Y,		\
+	     R##_f0 can be either (UWtype)-1 or (UWtype)-2.  But as we	\
+	     know what kind of bits it is (sticky, guard, round),	\
+	     we don't care.  We also don't care what the reminder is,	\
+	     because the guard bit will be set anyway.  -jj */		\
+	  R##_f0 = -1;							\
+	}								\
+      else								\
+	{								\
+	  udiv_qrnnd (R##_f0, _FP_DIV_MEAT_2_udiv_r_f1,			\
+		      _FP_DIV_MEAT_2_udiv_r_f1,				\
+		      _FP_DIV_MEAT_2_udiv_r_f0, Y##_f1);		\
+	  umul_ppmm (_FP_DIV_MEAT_2_udiv_m_f1,				\
+		     _FP_DIV_MEAT_2_udiv_m_f0, R##_f0, Y##_f0);		\
+	  _FP_DIV_MEAT_2_udiv_r_f0 = 0;					\
+	  if (_FP_FRAC_GT_2 (_FP_DIV_MEAT_2_udiv_m,			\
+			     _FP_DIV_MEAT_2_udiv_r))			\
+	    {								\
+	      R##_f0--;							\
+	      _FP_FRAC_ADD_2 (_FP_DIV_MEAT_2_udiv_r, Y,			\
+			      _FP_DIV_MEAT_2_udiv_r);			\
+	      if (_FP_FRAC_GE_2 (_FP_DIV_MEAT_2_udiv_r, Y)		\
+		  && _FP_FRAC_GT_2 (_FP_DIV_MEAT_2_udiv_m,		\
+				    _FP_DIV_MEAT_2_udiv_r))		\
+		{							\
+		  R##_f0--;						\
+		  _FP_FRAC_ADD_2 (_FP_DIV_MEAT_2_udiv_r, Y,		\
+				  _FP_DIV_MEAT_2_udiv_r);		\
+		}							\
+	    }								\
+	  if (!_FP_FRAC_EQ_2 (_FP_DIV_MEAT_2_udiv_r,			\
+			      _FP_DIV_MEAT_2_udiv_m))			\
+	    R##_f0 |= _FP_WORK_STICKY;					\
+	}								\
+    }									\
+  while (0)
+
+
+/* Square root algorithms:
+   We have just one right now, maybe Newton approximation
+   should be added for those machines where division is fast.  */
+
+#define _FP_SQRT_MEAT_2(R, S, T, X, q)				\
+  do								\
+    {								\
+      while (q)							\
+	{							\
+	  T##_f1 = S##_f1 + (q);				\
+	  if (T##_f1 <= X##_f1)					\
+	    {							\
+	      S##_f1 = T##_f1 + (q);				\
+	      X##_f1 -= T##_f1;					\
+	      R##_f1 += (q);					\
+	    }							\
+	  _FP_FRAC_SLL_2 (X, 1);				\
+	  (q) >>= 1;						\
+	}							\
+      (q) = (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE - 1);		\
+      while ((q) != _FP_WORK_ROUND)				\
+	{							\
+	  T##_f0 = S##_f0 + (q);				\
+	  T##_f1 = S##_f1;					\
+	  if (T##_f1 < X##_f1					\
+	      || (T##_f1 == X##_f1 && T##_f0 <= X##_f0))	\
+	    {							\
+	      S##_f0 = T##_f0 + (q);				\
+	      S##_f1 += (T##_f0 > S##_f0);			\
+	      _FP_FRAC_DEC_2 (X, T);				\
+	      R##_f0 += (q);					\
+	    }							\
+	  _FP_FRAC_SLL_2 (X, 1);				\
+	  (q) >>= 1;						\
+	}							\
+      if (X##_f0 | X##_f1)					\
+	{							\
+	  if (S##_f1 < X##_f1					\
+	      || (S##_f1 == X##_f1 && S##_f0 < X##_f0))		\
+	    R##_f0 |= _FP_WORK_ROUND;				\
+	  R##_f0 |= _FP_WORK_STICKY;				\
+	}							\
+    }								\
+  while (0)
+
+
+/* Assembly/disassembly for converting to/from integral types.
+   No shifting or overflow handled here.  */
 
 #define _FP_FRAC_ASSEMBLE_2(r, X, rsize)	\
-  do {						\
-    if (rsize <= _FP_W_TYPE_SIZE)		\
-      r = X##_f0;				\
-    else					\
-      {						\
-	r = X##_f1;				\
-	r <<= _FP_W_TYPE_SIZE;			\
-	r += X##_f0;				\
-      }						\
-  } while (0)
-
-#define _FP_FRAC_DISASSEMBLE_2(X, r, rsize)				\
-  do {									\
-    X##_f0 = r;								\
-    X##_f1 = (rsize <= _FP_W_TYPE_SIZE ? 0 : r >> _FP_W_TYPE_SIZE);	\
-  } while (0)
-
-/*
- * Convert FP values between word sizes
- */
-
-#define _FP_FRAC_CONV_1_2(dfs, sfs, D, S)				\
-  do {									\
-    if (S##_c != FP_CLS_NAN)						\
-      _FP_FRAC_SRS_2(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs),	\
-		     _FP_WFRACBITS_##sfs);				\
-    else								\
-      _FP_FRAC_SRL_2(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs));	\
-    D##_f = S##_f0;							\
-  } while (0)
-
-#define _FP_FRAC_CONV_2_1(dfs, sfs, D, S)				\
-  do {									\
-    D##_f0 = S##_f;							\
-    D##_f1 = 0;								\
-    _FP_FRAC_SLL_2(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs));	\
-  } while (0)
+  (void) (((rsize) <= _FP_W_TYPE_SIZE)		\
+	  ? ({ (r) = X##_f0; })			\
+	  : ({					\
+	      (r) = X##_f1;			\
+	      (r) <<= _FP_W_TYPE_SIZE;		\
+	      (r) += X##_f0;			\
+	    }))
+
+#define _FP_FRAC_DISASSEMBLE_2(X, r, rsize)	\
+  do						\
+    {						\
+      X##_f0 = (r);				\
+      X##_f1 = ((rsize) <= _FP_W_TYPE_SIZE	\
+		? 0				\
+		: (r) >> _FP_W_TYPE_SIZE);	\
+    }						\
+  while (0)
+
+/* Convert FP values between word sizes.  */
+
+#define _FP_FRAC_COPY_1_2(D, S)		(D##_f = S##_f0)
+
+#define _FP_FRAC_COPY_2_1(D, S)		((D##_f0 = S##_f), (D##_f1 = 0))
+
+#define _FP_FRAC_COPY_2_2(D, S)		_FP_FRAC_COPY_2 (D, S)
 
 #endif
diff --git a/include/math-emu/op-4.h b/include/math-emu/op-4.h
index ba226f8..1c409eb 100644
--- a/include/math-emu/op-4.h
+++ b/include/math-emu/op-4.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Basic four-word fraction declaration and manipulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,685 +8,868 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_OP_4_H__
 #define __MATH_EMU_OP_4_H__
 
 #define _FP_FRAC_DECL_4(X)	_FP_W_TYPE X##_f[4]
-#define _FP_FRAC_COPY_4(D,S)			\
+#define _FP_FRAC_COPY_4(D, S)			\
   (D##_f[0] = S##_f[0], D##_f[1] = S##_f[1],	\
    D##_f[2] = S##_f[2], D##_f[3] = S##_f[3])
-#define _FP_FRAC_SET_4(X,I)	__FP_FRAC_SET_4(X, I)
+#define _FP_FRAC_SET_4(X, I)	__FP_FRAC_SET_4 (X, I)
 #define _FP_FRAC_HIGH_4(X)	(X##_f[3])
 #define _FP_FRAC_LOW_4(X)	(X##_f[0])
-#define _FP_FRAC_WORD_4(X,w)	(X##_f[w])
-
-#define _FP_FRAC_SLL_4(X,N)						\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _up = (N) % _FP_W_TYPE_SIZE;					\
-    _down = _FP_W_TYPE_SIZE - _up;					\
-    if (!_up)								\
-      for (_i = 3; _i >= _skip; --_i)					\
-	X##_f[_i] = X##_f[_i-_skip];					\
-    else								\
-      {									\
-	for (_i = 3; _i > _skip; --_i)					\
-	  X##_f[_i] = X##_f[_i-_skip] << _up				\
-		      | X##_f[_i-_skip-1] >> _down;			\
-	X##_f[_i--] = X##_f[0] << _up; 					\
-      }									\
-    for (; _i >= 0; --_i)						\
-      X##_f[_i] = 0;							\
-  } while (0)
-
-/* This one was broken too */
-#define _FP_FRAC_SRL_4(X,N)						\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _down = (N) % _FP_W_TYPE_SIZE;					\
-    _up = _FP_W_TYPE_SIZE - _down;					\
-    if (!_down)								\
-      for (_i = 0; _i <= 3-_skip; ++_i)					\
-	X##_f[_i] = X##_f[_i+_skip];					\
-    else								\
-      {									\
-	for (_i = 0; _i < 3-_skip; ++_i)				\
-	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
-		      | X##_f[_i+_skip+1] << _up;			\
-	X##_f[_i++] = X##_f[3] >> _down;				\
-      }									\
-    for (; _i < 4; ++_i)						\
-      X##_f[_i] = 0;							\
-  } while (0)
-
-
-/* Right shift with sticky-lsb. 
- * What this actually means is that we do a standard right-shift,
- * but that if any of the bits that fall off the right hand side
- * were one then we always set the LSbit.
- */
-#define _FP_FRAC_SRS_4(X,N,size)					\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _FP_W_TYPE _s;							\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _down = (N) % _FP_W_TYPE_SIZE;					\
-    _up = _FP_W_TYPE_SIZE - _down;					\
-    for (_s = _i = 0; _i < _skip; ++_i)					\
-      _s |= X##_f[_i];							\
-    _s |= X##_f[_i] << _up;						\
-/* s is now != 0 if we want to set the LSbit */				\
-    if (!_down)								\
-      for (_i = 0; _i <= 3-_skip; ++_i)					\
-	X##_f[_i] = X##_f[_i+_skip];					\
-    else								\
-      {									\
-	for (_i = 0; _i < 3-_skip; ++_i)				\
-	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
-		      | X##_f[_i+_skip+1] << _up;			\
-	X##_f[_i++] = X##_f[3] >> _down;				\
-      }									\
-    for (; _i < 4; ++_i)						\
-      X##_f[_i] = 0;							\
-    /* don't fix the LSB until the very end when we're sure f[0] is stable */	\
-    X##_f[0] |= (_s != 0);						\
-  } while (0)
-
-#define _FP_FRAC_ADD_4(R,X,Y)						\
-  __FP_FRAC_ADD_4(R##_f[3], R##_f[2], R##_f[1], R##_f[0],		\
-		  X##_f[3], X##_f[2], X##_f[1], X##_f[0],		\
-		  Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
-
-#define _FP_FRAC_SUB_4(R,X,Y)						\
-  __FP_FRAC_SUB_4(R##_f[3], R##_f[2], R##_f[1], R##_f[0],		\
-		  X##_f[3], X##_f[2], X##_f[1], X##_f[0],		\
-		  Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
-
-#define _FP_FRAC_DEC_4(X,Y)						\
-  __FP_FRAC_DEC_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0],		\
-		  Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
-
-#define _FP_FRAC_ADDI_4(X,I)						\
-  __FP_FRAC_ADDI_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0], I)
-
-#define _FP_ZEROFRAC_4  0,0,0,0
-#define _FP_MINFRAC_4   0,0,0,1
-#define _FP_MAXFRAC_4	(~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0)
+#define _FP_FRAC_WORD_4(X, w)	(X##_f[w])
+
+#define _FP_FRAC_SLL_4(X, N)						\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SLL_4_up, _FP_FRAC_SLL_4_down;		\
+      _FP_I_TYPE _FP_FRAC_SLL_4_skip, _FP_FRAC_SLL_4_i;			\
+      _FP_FRAC_SLL_4_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SLL_4_up = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SLL_4_down = _FP_W_TYPE_SIZE - _FP_FRAC_SLL_4_up;	\
+      if (!_FP_FRAC_SLL_4_up)						\
+	for (_FP_FRAC_SLL_4_i = 3;					\
+	     _FP_FRAC_SLL_4_i >= _FP_FRAC_SLL_4_skip;			\
+	     --_FP_FRAC_SLL_4_i)					\
+	  X##_f[_FP_FRAC_SLL_4_i]					\
+	    = X##_f[_FP_FRAC_SLL_4_i-_FP_FRAC_SLL_4_skip];		\
+      else								\
+	{								\
+	  for (_FP_FRAC_SLL_4_i = 3;					\
+	       _FP_FRAC_SLL_4_i > _FP_FRAC_SLL_4_skip;			\
+	       --_FP_FRAC_SLL_4_i)					\
+	    X##_f[_FP_FRAC_SLL_4_i]					\
+	      = ((X##_f[_FP_FRAC_SLL_4_i-_FP_FRAC_SLL_4_skip]		\
+		  << _FP_FRAC_SLL_4_up)					\
+		 | (X##_f[_FP_FRAC_SLL_4_i-_FP_FRAC_SLL_4_skip-1]	\
+		    >> _FP_FRAC_SLL_4_down));				\
+	  X##_f[_FP_FRAC_SLL_4_i--] = X##_f[0] << _FP_FRAC_SLL_4_up;	\
+	}								\
+      for (; _FP_FRAC_SLL_4_i >= 0; --_FP_FRAC_SLL_4_i)			\
+	X##_f[_FP_FRAC_SLL_4_i] = 0;					\
+    }									\
+  while (0)
+
+/* This one was broken too.  */
+#define _FP_FRAC_SRL_4(X, N)						\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SRL_4_up, _FP_FRAC_SRL_4_down;		\
+      _FP_I_TYPE _FP_FRAC_SRL_4_skip, _FP_FRAC_SRL_4_i;			\
+      _FP_FRAC_SRL_4_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRL_4_down = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRL_4_up = _FP_W_TYPE_SIZE - _FP_FRAC_SRL_4_down;	\
+      if (!_FP_FRAC_SRL_4_down)						\
+	for (_FP_FRAC_SRL_4_i = 0;					\
+	     _FP_FRAC_SRL_4_i <= 3-_FP_FRAC_SRL_4_skip;			\
+	     ++_FP_FRAC_SRL_4_i)					\
+	  X##_f[_FP_FRAC_SRL_4_i]					\
+	    = X##_f[_FP_FRAC_SRL_4_i+_FP_FRAC_SRL_4_skip];		\
+      else								\
+	{								\
+	  for (_FP_FRAC_SRL_4_i = 0;					\
+	       _FP_FRAC_SRL_4_i < 3-_FP_FRAC_SRL_4_skip;		\
+	       ++_FP_FRAC_SRL_4_i)					\
+	    X##_f[_FP_FRAC_SRL_4_i]					\
+	      = ((X##_f[_FP_FRAC_SRL_4_i+_FP_FRAC_SRL_4_skip]		\
+		  >> _FP_FRAC_SRL_4_down)				\
+		 | (X##_f[_FP_FRAC_SRL_4_i+_FP_FRAC_SRL_4_skip+1]	\
+		    << _FP_FRAC_SRL_4_up));				\
+	  X##_f[_FP_FRAC_SRL_4_i++] = X##_f[3] >> _FP_FRAC_SRL_4_down;	\
+	}								\
+      for (; _FP_FRAC_SRL_4_i < 4; ++_FP_FRAC_SRL_4_i)			\
+	X##_f[_FP_FRAC_SRL_4_i] = 0;					\
+    }									\
+  while (0)
+
+
+/* Right shift with sticky-lsb.
+   What this actually means is that we do a standard right-shift,
+   but that if any of the bits that fall off the right hand side
+   were one then we always set the LSbit.  */
+#define _FP_FRAC_SRST_4(X, S, N, size)					\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SRST_4_up, _FP_FRAC_SRST_4_down;		\
+      _FP_I_TYPE _FP_FRAC_SRST_4_skip, _FP_FRAC_SRST_4_i;		\
+      _FP_W_TYPE _FP_FRAC_SRST_4_s;					\
+      _FP_FRAC_SRST_4_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRST_4_down = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRST_4_up = _FP_W_TYPE_SIZE - _FP_FRAC_SRST_4_down;	\
+      for (_FP_FRAC_SRST_4_s = _FP_FRAC_SRST_4_i = 0;			\
+	   _FP_FRAC_SRST_4_i < _FP_FRAC_SRST_4_skip;			\
+	   ++_FP_FRAC_SRST_4_i)						\
+	_FP_FRAC_SRST_4_s |= X##_f[_FP_FRAC_SRST_4_i];			\
+      if (!_FP_FRAC_SRST_4_down)					\
+	for (_FP_FRAC_SRST_4_i = 0;					\
+	     _FP_FRAC_SRST_4_i <= 3-_FP_FRAC_SRST_4_skip;		\
+	     ++_FP_FRAC_SRST_4_i)					\
+	  X##_f[_FP_FRAC_SRST_4_i]					\
+	    = X##_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip];		\
+      else								\
+	{								\
+	  _FP_FRAC_SRST_4_s						\
+	    |= X##_f[_FP_FRAC_SRST_4_i] << _FP_FRAC_SRST_4_up;		\
+	  for (_FP_FRAC_SRST_4_i = 0;					\
+	       _FP_FRAC_SRST_4_i < 3-_FP_FRAC_SRST_4_skip;		\
+	       ++_FP_FRAC_SRST_4_i)					\
+	    X##_f[_FP_FRAC_SRST_4_i]					\
+	      = ((X##_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip]		\
+		  >> _FP_FRAC_SRST_4_down)				\
+		 | (X##_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip+1]	\
+		    << _FP_FRAC_SRST_4_up));				\
+	  X##_f[_FP_FRAC_SRST_4_i++]					\
+	    = X##_f[3] >> _FP_FRAC_SRST_4_down;				\
+	}								\
+      for (; _FP_FRAC_SRST_4_i < 4; ++_FP_FRAC_SRST_4_i)		\
+	X##_f[_FP_FRAC_SRST_4_i] = 0;					\
+      S = (_FP_FRAC_SRST_4_s != 0);					\
+    }									\
+  while (0)
+
+#define _FP_FRAC_SRS_4(X, N, size)				\
+  do								\
+    {								\
+      int _FP_FRAC_SRS_4_sticky;				\
+      _FP_FRAC_SRST_4 (X, _FP_FRAC_SRS_4_sticky, (N), (size));	\
+      X##_f[0] |= _FP_FRAC_SRS_4_sticky;			\
+    }								\
+  while (0)
+
+#define _FP_FRAC_ADD_4(R, X, Y)					\
+  __FP_FRAC_ADD_4 (R##_f[3], R##_f[2], R##_f[1], R##_f[0],	\
+		   X##_f[3], X##_f[2], X##_f[1], X##_f[0],	\
+		   Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
+
+#define _FP_FRAC_SUB_4(R, X, Y)					\
+  __FP_FRAC_SUB_4 (R##_f[3], R##_f[2], R##_f[1], R##_f[0],	\
+		   X##_f[3], X##_f[2], X##_f[1], X##_f[0],	\
+		   Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
+
+#define _FP_FRAC_DEC_4(X, Y)					\
+  __FP_FRAC_DEC_4 (X##_f[3], X##_f[2], X##_f[1], X##_f[0],	\
+		   Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0])
+
+#define _FP_FRAC_ADDI_4(X, I)					\
+  __FP_FRAC_ADDI_4 (X##_f[3], X##_f[2], X##_f[1], X##_f[0], I)
+
+#define _FP_ZEROFRAC_4  0, 0, 0, 0
+#define _FP_MINFRAC_4   0, 0, 0, 1
+#define _FP_MAXFRAC_4	(~(_FP_WS_TYPE) 0), (~(_FP_WS_TYPE) 0), (~(_FP_WS_TYPE) 0), (~(_FP_WS_TYPE) 0)
 
 #define _FP_FRAC_ZEROP_4(X)     ((X##_f[0] | X##_f[1] | X##_f[2] | X##_f[3]) == 0)
-#define _FP_FRAC_NEGP_4(X)      ((_FP_WS_TYPE)X##_f[3] < 0)
-#define _FP_FRAC_OVERP_4(fs,X)  (_FP_FRAC_HIGH_##fs(X) & _FP_OVERFLOW_##fs)
-#define _FP_FRAC_CLEAR_OVERP_4(fs,X)  (_FP_FRAC_HIGH_##fs(X) &= ~_FP_OVERFLOW_##fs)
-
-#define _FP_FRAC_EQ_4(X,Y)				\
- (X##_f[0] == Y##_f[0] && X##_f[1] == Y##_f[1]		\
-  && X##_f[2] == Y##_f[2] && X##_f[3] == Y##_f[3])
-
-#define _FP_FRAC_GT_4(X,Y)				\
- (X##_f[3] > Y##_f[3] ||				\
-  (X##_f[3] == Y##_f[3] && (X##_f[2] > Y##_f[2] ||	\
-   (X##_f[2] == Y##_f[2] && (X##_f[1] > Y##_f[1] ||	\
-    (X##_f[1] == Y##_f[1] && X##_f[0] > Y##_f[0])	\
-   ))							\
-  ))							\
- )
-
-#define _FP_FRAC_GE_4(X,Y)				\
- (X##_f[3] > Y##_f[3] ||				\
-  (X##_f[3] == Y##_f[3] && (X##_f[2] > Y##_f[2] ||	\
-   (X##_f[2] == Y##_f[2] && (X##_f[1] > Y##_f[1] ||	\
-    (X##_f[1] == Y##_f[1] && X##_f[0] >= Y##_f[0])	\
-   ))							\
-  ))							\
- )
-
-
-#define _FP_FRAC_CLZ_4(R,X)		\
-  do {					\
-    if (X##_f[3])			\
-    {					\
-	__FP_CLZ(R,X##_f[3]);		\
-    }					\
-    else if (X##_f[2])			\
-    {					\
-	__FP_CLZ(R,X##_f[2]);		\
-	R += _FP_W_TYPE_SIZE;		\
-    }					\
-    else if (X##_f[1])			\
-    {					\
-	__FP_CLZ(R,X##_f[2]);		\
-	R += _FP_W_TYPE_SIZE*2;		\
-    }					\
-    else				\
-    {					\
-	__FP_CLZ(R,X##_f[0]);		\
-	R += _FP_W_TYPE_SIZE*3;		\
-    }					\
-  } while(0)
-
-
-#define _FP_UNPACK_RAW_4(fs, X, val)				\
-  do {								\
-    union _FP_UNION_##fs _flo; _flo.flt = (val);		\
-    X##_f[0] = _flo.bits.frac0;					\
-    X##_f[1] = _flo.bits.frac1;					\
-    X##_f[2] = _flo.bits.frac2;					\
-    X##_f[3] = _flo.bits.frac3;					\
-    X##_e  = _flo.bits.exp;					\
-    X##_s  = _flo.bits.sign;					\
-  } while (0)
-
-#define _FP_UNPACK_RAW_4_P(fs, X, val)				\
-  do {								\
-    union _FP_UNION_##fs *_flo =				\
-      (union _FP_UNION_##fs *)(val);				\
-								\
-    X##_f[0] = _flo->bits.frac0;				\
-    X##_f[1] = _flo->bits.frac1;				\
-    X##_f[2] = _flo->bits.frac2;				\
-    X##_f[3] = _flo->bits.frac3;				\
-    X##_e  = _flo->bits.exp;					\
-    X##_s  = _flo->bits.sign;					\
-  } while (0)
-
-#define _FP_PACK_RAW_4(fs, val, X)				\
-  do {								\
-    union _FP_UNION_##fs _flo;					\
-    _flo.bits.frac0 = X##_f[0];					\
-    _flo.bits.frac1 = X##_f[1];					\
-    _flo.bits.frac2 = X##_f[2];					\
-    _flo.bits.frac3 = X##_f[3];					\
-    _flo.bits.exp   = X##_e;					\
-    _flo.bits.sign  = X##_s;					\
-    (val) = _flo.flt;				   		\
-  } while (0)
-
-#define _FP_PACK_RAW_4_P(fs, val, X)				\
-  do {								\
-    union _FP_UNION_##fs *_flo =				\
-      (union _FP_UNION_##fs *)(val);				\
-								\
-    _flo->bits.frac0 = X##_f[0];				\
-    _flo->bits.frac1 = X##_f[1];				\
-    _flo->bits.frac2 = X##_f[2];				\
-    _flo->bits.frac3 = X##_f[3];				\
-    _flo->bits.exp   = X##_e;					\
-    _flo->bits.sign  = X##_s;					\
-  } while (0)
-
-/*
- * Multiplication algorithms:
- */
+#define _FP_FRAC_NEGP_4(X)      ((_FP_WS_TYPE) X##_f[3] < 0)
+#define _FP_FRAC_OVERP_4(fs, X)  (_FP_FRAC_HIGH_##fs (X) & _FP_OVERFLOW_##fs)
+#define _FP_FRAC_HIGHBIT_DW_4(fs, X)	\
+  (_FP_FRAC_HIGH_DW_##fs (X) & _FP_HIGHBIT_DW_##fs)
+#define _FP_FRAC_CLEAR_OVERP_4(fs, X)  (_FP_FRAC_HIGH_##fs (X) &= ~_FP_OVERFLOW_##fs)
+
+#define _FP_FRAC_EQ_4(X, Y)				\
+  (X##_f[0] == Y##_f[0] && X##_f[1] == Y##_f[1]		\
+   && X##_f[2] == Y##_f[2] && X##_f[3] == Y##_f[3])
+
+#define _FP_FRAC_GT_4(X, Y)				\
+  (X##_f[3] > Y##_f[3]					\
+   || (X##_f[3] == Y##_f[3]				\
+       && (X##_f[2] > Y##_f[2]				\
+	   || (X##_f[2] == Y##_f[2]			\
+	       && (X##_f[1] > Y##_f[1]			\
+		   || (X##_f[1] == Y##_f[1]		\
+		       && X##_f[0] > Y##_f[0]))))))
+
+#define _FP_FRAC_GE_4(X, Y)				\
+  (X##_f[3] > Y##_f[3]					\
+   || (X##_f[3] == Y##_f[3]				\
+       && (X##_f[2] > Y##_f[2]				\
+	   || (X##_f[2] == Y##_f[2]			\
+	       && (X##_f[1] > Y##_f[1]			\
+		   || (X##_f[1] == Y##_f[1]		\
+		       && X##_f[0] >= Y##_f[0]))))))
+
+
+#define _FP_FRAC_CLZ_4(R, X)			\
+  do						\
+    {						\
+      if (X##_f[3])				\
+	__FP_CLZ ((R), X##_f[3]);		\
+      else if (X##_f[2])			\
+	{					\
+	  __FP_CLZ ((R), X##_f[2]);		\
+	  (R) += _FP_W_TYPE_SIZE;		\
+	}					\
+      else if (X##_f[1])			\
+	{					\
+	  __FP_CLZ ((R), X##_f[1]);		\
+	  (R) += _FP_W_TYPE_SIZE*2;		\
+	}					\
+      else					\
+	{					\
+	  __FP_CLZ ((R), X##_f[0]);		\
+	  (R) += _FP_W_TYPE_SIZE*3;		\
+	}					\
+    }						\
+  while (0)
+
+
+#define _FP_UNPACK_RAW_4(fs, X, val)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs _FP_UNPACK_RAW_4_flo;	\
+      _FP_UNPACK_RAW_4_flo.flt = (val);			\
+      X##_f[0] = _FP_UNPACK_RAW_4_flo.bits.frac0;	\
+      X##_f[1] = _FP_UNPACK_RAW_4_flo.bits.frac1;	\
+      X##_f[2] = _FP_UNPACK_RAW_4_flo.bits.frac2;	\
+      X##_f[3] = _FP_UNPACK_RAW_4_flo.bits.frac3;	\
+      X##_e  = _FP_UNPACK_RAW_4_flo.bits.exp;		\
+      X##_s  = _FP_UNPACK_RAW_4_flo.bits.sign;		\
+    }							\
+  while (0)
+
+#define _FP_UNPACK_RAW_4_P(fs, X, val)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_UNPACK_RAW_4_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
+							\
+      X##_f[0] = _FP_UNPACK_RAW_4_P_flo->bits.frac0;	\
+      X##_f[1] = _FP_UNPACK_RAW_4_P_flo->bits.frac1;	\
+      X##_f[2] = _FP_UNPACK_RAW_4_P_flo->bits.frac2;	\
+      X##_f[3] = _FP_UNPACK_RAW_4_P_flo->bits.frac3;	\
+      X##_e  = _FP_UNPACK_RAW_4_P_flo->bits.exp;	\
+      X##_s  = _FP_UNPACK_RAW_4_P_flo->bits.sign;	\
+    }							\
+  while (0)
+
+#define _FP_PACK_RAW_4(fs, val, X)		\
+  do						\
+    {						\
+      union _FP_UNION_##fs _FP_PACK_RAW_4_flo;	\
+      _FP_PACK_RAW_4_flo.bits.frac0 = X##_f[0];	\
+      _FP_PACK_RAW_4_flo.bits.frac1 = X##_f[1];	\
+      _FP_PACK_RAW_4_flo.bits.frac2 = X##_f[2];	\
+      _FP_PACK_RAW_4_flo.bits.frac3 = X##_f[3];	\
+      _FP_PACK_RAW_4_flo.bits.exp   = X##_e;	\
+      _FP_PACK_RAW_4_flo.bits.sign  = X##_s;	\
+      (val) = _FP_PACK_RAW_4_flo.flt;		\
+    }						\
+  while (0)
+
+#define _FP_PACK_RAW_4_P(fs, val, X)			\
+  do							\
+    {							\
+      union _FP_UNION_##fs *_FP_PACK_RAW_4_P_flo	\
+	= (union _FP_UNION_##fs *) (val);		\
+							\
+      _FP_PACK_RAW_4_P_flo->bits.frac0 = X##_f[0];	\
+      _FP_PACK_RAW_4_P_flo->bits.frac1 = X##_f[1];	\
+      _FP_PACK_RAW_4_P_flo->bits.frac2 = X##_f[2];	\
+      _FP_PACK_RAW_4_P_flo->bits.frac3 = X##_f[3];	\
+      _FP_PACK_RAW_4_P_flo->bits.exp   = X##_e;		\
+      _FP_PACK_RAW_4_P_flo->bits.sign  = X##_s;		\
+    }							\
+  while (0)
+
+/* Multiplication algorithms: */
 
 /* Given a 1W * 1W => 2W primitive, do the extended multiplication.  */
 
-#define _FP_MUL_MEAT_4_wide(wfracbits, R, X, Y, doit)			    \
-  do {									    \
-    _FP_FRAC_DECL_8(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c);	    \
-    _FP_FRAC_DECL_2(_d); _FP_FRAC_DECL_2(_e); _FP_FRAC_DECL_2(_f);	    \
-									    \
-    doit(_FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0), X##_f[0], Y##_f[0]); \
-    doit(_b_f1, _b_f0, X##_f[0], Y##_f[1]);				    \
-    doit(_c_f1, _c_f0, X##_f[1], Y##_f[0]);				    \
-    doit(_d_f1, _d_f0, X##_f[1], Y##_f[1]);				    \
-    doit(_e_f1, _e_f0, X##_f[0], Y##_f[2]);				    \
-    doit(_f_f1, _f_f0, X##_f[2], Y##_f[0]);				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1), 0,_b_f1,_b_f0,		    \
-		    0,0,_FP_FRAC_WORD_8(_z,1));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1), 0,_c_f1,_c_f0,		    \
-		    _FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2), 0,_d_f1,_d_f0,		    \
-		    0,_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2));	    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2), 0,_e_f1,_e_f0,		    \
-		    _FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2), 0,_f_f1,_f_f0,		    \
-		    _FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3),	    \
-		    _FP_FRAC_WORD_8(_z,2));				    \
-    doit(_b_f1, _b_f0, X##_f[0], Y##_f[3]);				    \
-    doit(_c_f1, _c_f0, X##_f[3], Y##_f[0]);				    \
-    doit(_d_f1, _d_f0, X##_f[1], Y##_f[2]);				    \
-    doit(_e_f1, _e_f0, X##_f[2], Y##_f[1]);				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3), 0,_b_f1,_b_f0,		    \
-		    0,_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3));	    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3), 0,_c_f1,_c_f0,		    \
-		    _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3), 0,_d_f1,_d_f0,		    \
-		    _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3), 0,_e_f1,_e_f0,		    \
-		    _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4),	    \
-		    _FP_FRAC_WORD_8(_z,3));				    \
-    doit(_b_f1, _b_f0, X##_f[2], Y##_f[2]);				    \
-    doit(_c_f1, _c_f0, X##_f[1], Y##_f[3]);				    \
-    doit(_d_f1, _d_f0, X##_f[3], Y##_f[1]);				    \
-    doit(_e_f1, _e_f0, X##_f[2], Y##_f[3]);				    \
-    doit(_f_f1, _f_f0, X##_f[3], Y##_f[2]);				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4), 0,_b_f1,_b_f0,		    \
-		    0,_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4));	    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4), 0,_c_f1,_c_f0,		    \
-		    _FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4), 0,_d_f1,_d_f0,		    \
-		    _FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5),	    \
-		    _FP_FRAC_WORD_8(_z,4));				    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
-		    _FP_FRAC_WORD_8(_z,5), 0,_e_f1,_e_f0,		    \
-		    0,_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5));	    \
-    __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
-		    _FP_FRAC_WORD_8(_z,5), 0,_f_f1,_f_f0,		    \
-		    _FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
-		    _FP_FRAC_WORD_8(_z,5));				    \
-    doit(_b_f1, _b_f0, X##_f[3], Y##_f[3]);				    \
-    __FP_FRAC_ADD_2(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6),	    \
-		    _b_f1,_b_f0,					    \
-		    _FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6));	    \
-									    \
-    /* Normalize since we know where the msb of the multiplicands	    \
-       were (bit B), we know that the msb of the of the product is	    \
-       at either 2B or 2B-1.  */					    \
-    _FP_FRAC_SRS_8(_z, wfracbits-1, 2*wfracbits);			    \
-    __FP_FRAC_SET_4(R, _FP_FRAC_WORD_8(_z,3), _FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0));	    \
-  } while (0)
-
-#define _FP_MUL_MEAT_4_gmp(wfracbits, R, X, Y)				    \
-  do {									    \
-    _FP_FRAC_DECL_8(_z);						    \
-									    \
-    mpn_mul_n(_z_f, _x_f, _y_f, 4);					    \
-									    \
-    /* Normalize since we know where the msb of the multiplicands	    \
-       were (bit B), we know that the msb of the of the product is	    \
-       at either 2B or 2B-1.  */					    \
-    _FP_FRAC_SRS_8(_z, wfracbits-1, 2*wfracbits);	 		    \
-    __FP_FRAC_SET_4(R, _FP_FRAC_WORD_8(_z,3), _FP_FRAC_WORD_8(_z,2),	    \
-		    _FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0));	    \
-  } while (0)
-
-/*
- * Helper utility for _FP_DIV_MEAT_4_udiv:
- * pppp = m * nnn
- */
-#define umul_ppppmnnn(p3,p2,p1,p0,m,n2,n1,n0)				    \
-  do {									    \
-    UWtype _t;								    \
-    umul_ppmm(p1,p0,m,n0);						    \
-    umul_ppmm(p2,_t,m,n1);						    \
-    __FP_FRAC_ADDI_2(p2,p1,_t);						    \
-    umul_ppmm(p3,_t,m,n2);						    \
-    __FP_FRAC_ADDI_2(p3,p2,_t);						    \
-  } while (0)
-
-/*
- * Division algorithms:
- */
-
-#define _FP_DIV_MEAT_4_udiv(fs, R, X, Y)				    \
-  do {									    \
-    int _i;								    \
-    _FP_FRAC_DECL_4(_n); _FP_FRAC_DECL_4(_m);				    \
-    _FP_FRAC_SET_4(_n, _FP_ZEROFRAC_4);					    \
-    if (_FP_FRAC_GT_4(X, Y))						    \
-      {									    \
-	_n_f[3] = X##_f[0] << (_FP_W_TYPE_SIZE - 1);			    \
-	_FP_FRAC_SRL_4(X, 1);						    \
-      }									    \
-    else								    \
-      R##_e--;								    \
-									    \
-    /* Normalize, i.e. make the most significant bit of the 		    \
-       denominator set. */						    \
-    _FP_FRAC_SLL_4(Y, _FP_WFRACXBITS_##fs);				    \
-									    \
-    for (_i = 3; ; _i--)						    \
-      {									    \
-        if (X##_f[3] == Y##_f[3])					    \
-          {								    \
-            /* This is a special case, not an optimization		    \
-               (X##_f[3]/Y##_f[3] would not fit into UWtype).		    \
-               As X## is guaranteed to be < Y,  R##_f[_i] can be either	    \
-               (UWtype)-1 or (UWtype)-2.  */				    \
-            R##_f[_i] = -1;						    \
-            if (!_i)							    \
-	      break;							    \
-            __FP_FRAC_SUB_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0],	    \
-			    Y##_f[2], Y##_f[1], Y##_f[0], 0,		    \
-			    X##_f[2], X##_f[1], X##_f[0], _n_f[_i]);	    \
-            _FP_FRAC_SUB_4(X, Y, X);					    \
-            if (X##_f[3] > Y##_f[3])					    \
-              {								    \
-                R##_f[_i] = -2;						    \
-                _FP_FRAC_ADD_4(X, Y, X);				    \
-              }								    \
-          }								    \
-        else								    \
-          {								    \
-            udiv_qrnnd(R##_f[_i], X##_f[3], X##_f[3], X##_f[2], Y##_f[3]);  \
-            umul_ppppmnnn(_m_f[3], _m_f[2], _m_f[1], _m_f[0],		    \
-			  R##_f[_i], Y##_f[2], Y##_f[1], Y##_f[0]);	    \
-            X##_f[2] = X##_f[1];					    \
-            X##_f[1] = X##_f[0];					    \
-            X##_f[0] = _n_f[_i];					    \
-            if (_FP_FRAC_GT_4(_m, X))					    \
-              {								    \
-                R##_f[_i]--;						    \
-                _FP_FRAC_ADD_4(X, Y, X);				    \
-                if (_FP_FRAC_GE_4(X, Y) && _FP_FRAC_GT_4(_m, X))	    \
-                  {							    \
-		    R##_f[_i]--;					    \
-		    _FP_FRAC_ADD_4(X, Y, X);				    \
-                  }							    \
-              }								    \
-            _FP_FRAC_DEC_4(X, _m);					    \
-            if (!_i)							    \
-	      {								    \
-		if (!_FP_FRAC_EQ_4(X, _m))				    \
-		  R##_f[0] |= _FP_WORK_STICKY;				    \
-		break;							    \
-	      }								    \
-          }								    \
-      }									    \
-  } while (0)
-
-
-/*
- * Square root algorithms:
- * We have just one right now, maybe Newton approximation
- * should be added for those machines where division is fast.
- */
- 
-#define _FP_SQRT_MEAT_4(R, S, T, X, q)				\
-  do {								\
-    while (q)							\
-      {								\
-	T##_f[3] = S##_f[3] + q;				\
-	if (T##_f[3] <= X##_f[3])				\
-	  {							\
-	    S##_f[3] = T##_f[3] + q;				\
-	    X##_f[3] -= T##_f[3];				\
-	    R##_f[3] += q;					\
-	  }							\
-	_FP_FRAC_SLL_4(X, 1);					\
-	q >>= 1;						\
-      }								\
-    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);			\
-    while (q)							\
-      {								\
-	T##_f[2] = S##_f[2] + q;				\
-	T##_f[3] = S##_f[3];					\
-	if (T##_f[3] < X##_f[3] || 				\
-	    (T##_f[3] == X##_f[3] && T##_f[2] <= X##_f[2]))	\
-	  {							\
-	    S##_f[2] = T##_f[2] + q;				\
-	    S##_f[3] += (T##_f[2] > S##_f[2]);			\
-	    __FP_FRAC_DEC_2(X##_f[3], X##_f[2],			\
-			    T##_f[3], T##_f[2]);		\
-	    R##_f[2] += q;					\
-	  }							\
-	_FP_FRAC_SLL_4(X, 1);					\
-	q >>= 1;						\
-      }								\
-    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);			\
-    while (q)							\
-      {								\
-	T##_f[1] = S##_f[1] + q;				\
-	T##_f[2] = S##_f[2];					\
-	T##_f[3] = S##_f[3];					\
-	if (T##_f[3] < X##_f[3] || 				\
-	    (T##_f[3] == X##_f[3] && (T##_f[2] < X##_f[2] ||	\
-	     (T##_f[2] == X##_f[2] && T##_f[1] <= X##_f[1]))))	\
-	  {							\
-	    S##_f[1] = T##_f[1] + q;				\
-	    S##_f[2] += (T##_f[1] > S##_f[1]);			\
-	    S##_f[3] += (T##_f[2] > S##_f[2]);			\
-	    __FP_FRAC_DEC_3(X##_f[3], X##_f[2], X##_f[1],	\
-	    		    T##_f[3], T##_f[2], T##_f[1]);	\
-	    R##_f[1] += q;					\
-	  }							\
-	_FP_FRAC_SLL_4(X, 1);					\
-	q >>= 1;						\
-      }								\
-    q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1);			\
-    while (q != _FP_WORK_ROUND)					\
-      {								\
-	T##_f[0] = S##_f[0] + q;				\
-	T##_f[1] = S##_f[1];					\
-	T##_f[2] = S##_f[2];					\
-	T##_f[3] = S##_f[3];					\
-	if (_FP_FRAC_GE_4(X,T))					\
-	  {							\
-	    S##_f[0] = T##_f[0] + q;				\
-	    S##_f[1] += (T##_f[0] > S##_f[0]);			\
-	    S##_f[2] += (T##_f[1] > S##_f[1]);			\
-	    S##_f[3] += (T##_f[2] > S##_f[2]);			\
-	    _FP_FRAC_DEC_4(X, T);				\
-	    R##_f[0] += q;					\
-	  }							\
-	_FP_FRAC_SLL_4(X, 1);					\
-	q >>= 1;						\
-      }								\
-    if (!_FP_FRAC_ZEROP_4(X))					\
-      {								\
-	if (_FP_FRAC_GT_4(X,S))					\
-	  R##_f[0] |= _FP_WORK_ROUND;				\
-	R##_f[0] |= _FP_WORK_STICKY;				\
-      }								\
-  } while (0)
-
-
-/*
- * Internals 
- */
-
-#define __FP_FRAC_SET_4(X,I3,I2,I1,I0)					\
+#define _FP_MUL_MEAT_DW_4_wide(wfracbits, R, X, Y, doit)		\
+  do									\
+    {									\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_b);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_c);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_d);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_e);			\
+      _FP_FRAC_DECL_2 (_FP_MUL_MEAT_DW_4_wide_f);			\
+									\
+      doit (_FP_FRAC_WORD_8 (R, 1), _FP_FRAC_WORD_8 (R, 0),		\
+	    X##_f[0], Y##_f[0]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_b_f1, _FP_MUL_MEAT_DW_4_wide_b_f0,	\
+	    X##_f[0], Y##_f[1]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_c_f1, _FP_MUL_MEAT_DW_4_wide_c_f0,	\
+	    X##_f[1], Y##_f[0]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_d_f1, _FP_MUL_MEAT_DW_4_wide_d_f0,	\
+	    X##_f[1], Y##_f[1]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_e_f1, _FP_MUL_MEAT_DW_4_wide_e_f0,	\
+	    X##_f[0], Y##_f[2]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_f_f1, _FP_MUL_MEAT_DW_4_wide_f_f0,	\
+	    X##_f[2], Y##_f[0]);					\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 3), _FP_FRAC_WORD_8 (R, 2),	\
+		       _FP_FRAC_WORD_8 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f0,			\
+		       0, 0, _FP_FRAC_WORD_8 (R, 1));			\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 3), _FP_FRAC_WORD_8 (R, 2),	\
+		       _FP_FRAC_WORD_8 (R, 1), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f0,			\
+		       _FP_FRAC_WORD_8 (R, 3), _FP_FRAC_WORD_8 (R, 2),	\
+		       _FP_FRAC_WORD_8 (R, 1));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f0,			\
+		       0, _FP_FRAC_WORD_8 (R, 3), _FP_FRAC_WORD_8 (R, 2)); \
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f0,			\
+		       _FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_f_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_f_f0,			\
+		       _FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3),	\
+		       _FP_FRAC_WORD_8 (R, 2));				\
+      doit (_FP_MUL_MEAT_DW_4_wide_b_f1,				\
+	    _FP_MUL_MEAT_DW_4_wide_b_f0, X##_f[0], Y##_f[3]);		\
+      doit (_FP_MUL_MEAT_DW_4_wide_c_f1,				\
+	    _FP_MUL_MEAT_DW_4_wide_c_f0, X##_f[3], Y##_f[0]);		\
+      doit (_FP_MUL_MEAT_DW_4_wide_d_f1, _FP_MUL_MEAT_DW_4_wide_d_f0,	\
+	    X##_f[1], Y##_f[2]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_e_f1, _FP_MUL_MEAT_DW_4_wide_e_f0,	\
+	    X##_f[2], Y##_f[1]);					\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f0,			\
+		       0, _FP_FRAC_WORD_8 (R, 4), _FP_FRAC_WORD_8 (R, 3)); \
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f0,			\
+		       _FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f0,			\
+		       _FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f0,			\
+		       _FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4),	\
+		       _FP_FRAC_WORD_8 (R, 3));				\
+      doit (_FP_MUL_MEAT_DW_4_wide_b_f1, _FP_MUL_MEAT_DW_4_wide_b_f0,	\
+	    X##_f[2], Y##_f[2]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_c_f1, _FP_MUL_MEAT_DW_4_wide_c_f0,	\
+	    X##_f[1], Y##_f[3]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_d_f1, _FP_MUL_MEAT_DW_4_wide_d_f0,	\
+	    X##_f[3], Y##_f[1]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_e_f1, _FP_MUL_MEAT_DW_4_wide_e_f0,	\
+	    X##_f[2], Y##_f[3]);					\
+      doit (_FP_MUL_MEAT_DW_4_wide_f_f1, _FP_MUL_MEAT_DW_4_wide_f_f0,	\
+	    X##_f[3], Y##_f[2]);					\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f0,			\
+		       0, _FP_FRAC_WORD_8 (R, 5), _FP_FRAC_WORD_8 (R, 4)); \
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_c_f0,			\
+		       _FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_d_f0,			\
+		       _FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5),	\
+		       _FP_FRAC_WORD_8 (R, 4));				\
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6),	\
+		       _FP_FRAC_WORD_8 (R, 5), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_e_f0,			\
+		       0, _FP_FRAC_WORD_8 (R, 6), _FP_FRAC_WORD_8 (R, 5)); \
+      __FP_FRAC_ADD_3 (_FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6),	\
+		       _FP_FRAC_WORD_8 (R, 5), 0,			\
+		       _FP_MUL_MEAT_DW_4_wide_f_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_f_f0,			\
+		       _FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6),	\
+		       _FP_FRAC_WORD_8 (R, 5));				\
+      doit (_FP_MUL_MEAT_DW_4_wide_b_f1, _FP_MUL_MEAT_DW_4_wide_b_f0,	\
+	    X##_f[3], Y##_f[3]);					\
+      __FP_FRAC_ADD_2 (_FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6),	\
+		       _FP_MUL_MEAT_DW_4_wide_b_f1,			\
+		       _FP_MUL_MEAT_DW_4_wide_b_f0,			\
+		       _FP_FRAC_WORD_8 (R, 7), _FP_FRAC_WORD_8 (R, 6));	\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_4_wide(wfracbits, R, X, Y, doit)			\
+  do									\
+    {									\
+      _FP_FRAC_DECL_8 (_FP_MUL_MEAT_4_wide_z);				\
+									\
+      _FP_MUL_MEAT_DW_4_wide ((wfracbits), _FP_MUL_MEAT_4_wide_z,	\
+			      X, Y, doit);				\
+									\
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_8 (_FP_MUL_MEAT_4_wide_z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      __FP_FRAC_SET_4 (R, _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_wide_z, 3),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_wide_z, 2),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_wide_z, 1),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_wide_z, 0));	\
+    }									\
+  while (0)
+
+#define _FP_MUL_MEAT_DW_4_gmp(wfracbits, R, X, Y)	\
+  do							\
+    {							\
+      mpn_mul_n (R##_f, _x_f, _y_f, 4);			\
+    }							\
+  while (0)
+
+#define _FP_MUL_MEAT_4_gmp(wfracbits, R, X, Y)				\
+  do									\
+    {									\
+      _FP_FRAC_DECL_8 (_FP_MUL_MEAT_4_gmp_z);				\
+									\
+      _FP_MUL_MEAT_DW_4_gmp ((wfracbits), _FP_MUL_MEAT_4_gmp_z, X, Y);	\
+									\
+      /* Normalize since we know where the msb of the multiplicands	\
+	 were (bit B), we know that the msb of the of the product is	\
+	 at either 2B or 2B-1.  */					\
+      _FP_FRAC_SRS_8 (_FP_MUL_MEAT_4_gmp_z, (wfracbits)-1,		\
+		      2*(wfracbits));					\
+      __FP_FRAC_SET_4 (R, _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_gmp_z, 3),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_gmp_z, 2),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_gmp_z, 1),	\
+		       _FP_FRAC_WORD_8 (_FP_MUL_MEAT_4_gmp_z, 0));	\
+    }									\
+  while (0)
+
+/* Helper utility for _FP_DIV_MEAT_4_udiv:
+ * pppp = m * nnn.  */
+#define umul_ppppmnnn(p3, p2, p1, p0, m, n2, n1, n0)	\
+  do							\
+    {							\
+      UWtype umul_ppppmnnn_t;				\
+      umul_ppmm (p1, p0, m, n0);			\
+      umul_ppmm (p2, umul_ppppmnnn_t, m, n1);		\
+      __FP_FRAC_ADDI_2 (p2, p1, umul_ppppmnnn_t);	\
+      umul_ppmm (p3, umul_ppppmnnn_t, m, n2);		\
+      __FP_FRAC_ADDI_2 (p3, p2, umul_ppppmnnn_t);	\
+    }							\
+  while (0)
+
+/* Division algorithms: */
+
+#define _FP_DIV_MEAT_4_udiv(fs, R, X, Y)				\
+  do									\
+    {									\
+      int _FP_DIV_MEAT_4_udiv_i;					\
+      _FP_FRAC_DECL_4 (_FP_DIV_MEAT_4_udiv_n);				\
+      _FP_FRAC_DECL_4 (_FP_DIV_MEAT_4_udiv_m);				\
+      _FP_FRAC_SET_4 (_FP_DIV_MEAT_4_udiv_n, _FP_ZEROFRAC_4);		\
+      if (_FP_FRAC_GE_4 (X, Y))						\
+	{								\
+	  _FP_DIV_MEAT_4_udiv_n_f[3]					\
+	    = X##_f[0] << (_FP_W_TYPE_SIZE - 1);			\
+	  _FP_FRAC_SRL_4 (X, 1);					\
+	}								\
+      else								\
+	R##_e--;							\
+									\
+      /* Normalize, i.e. make the most significant bit of the		\
+	 denominator set.  */						\
+      _FP_FRAC_SLL_4 (Y, _FP_WFRACXBITS_##fs);				\
+									\
+      for (_FP_DIV_MEAT_4_udiv_i = 3; ; _FP_DIV_MEAT_4_udiv_i--)	\
+	{								\
+	  if (X##_f[3] == Y##_f[3])					\
+	    {								\
+	      /* This is a special case, not an optimization		\
+		 (X##_f[3]/Y##_f[3] would not fit into UWtype).		\
+		 As X## is guaranteed to be < Y,			\
+		 R##_f[_FP_DIV_MEAT_4_udiv_i] can be either		\
+		 (UWtype)-1 or (UWtype)-2.  */				\
+	      R##_f[_FP_DIV_MEAT_4_udiv_i] = -1;			\
+	      if (!_FP_DIV_MEAT_4_udiv_i)				\
+		break;							\
+	      __FP_FRAC_SUB_4 (X##_f[3], X##_f[2], X##_f[1], X##_f[0],	\
+			       Y##_f[2], Y##_f[1], Y##_f[0], 0,		\
+			       X##_f[2], X##_f[1], X##_f[0],		\
+			       _FP_DIV_MEAT_4_udiv_n_f[_FP_DIV_MEAT_4_udiv_i]); \
+	      _FP_FRAC_SUB_4 (X, Y, X);					\
+	      if (X##_f[3] > Y##_f[3])					\
+		{							\
+		  R##_f[_FP_DIV_MEAT_4_udiv_i] = -2;			\
+		  _FP_FRAC_ADD_4 (X, Y, X);				\
+		}							\
+	    }								\
+	  else								\
+	    {								\
+	      udiv_qrnnd (R##_f[_FP_DIV_MEAT_4_udiv_i],			\
+			  X##_f[3], X##_f[3], X##_f[2], Y##_f[3]);	\
+	      umul_ppppmnnn (_FP_DIV_MEAT_4_udiv_m_f[3],		\
+			     _FP_DIV_MEAT_4_udiv_m_f[2],		\
+			     _FP_DIV_MEAT_4_udiv_m_f[1],		\
+			     _FP_DIV_MEAT_4_udiv_m_f[0],		\
+			     R##_f[_FP_DIV_MEAT_4_udiv_i],		\
+			     Y##_f[2], Y##_f[1], Y##_f[0]);		\
+	      X##_f[2] = X##_f[1];					\
+	      X##_f[1] = X##_f[0];					\
+	      X##_f[0]							\
+		= _FP_DIV_MEAT_4_udiv_n_f[_FP_DIV_MEAT_4_udiv_i];	\
+	      if (_FP_FRAC_GT_4 (_FP_DIV_MEAT_4_udiv_m, X))		\
+		{							\
+		  R##_f[_FP_DIV_MEAT_4_udiv_i]--;			\
+		  _FP_FRAC_ADD_4 (X, Y, X);				\
+		  if (_FP_FRAC_GE_4 (X, Y)				\
+		      && _FP_FRAC_GT_4 (_FP_DIV_MEAT_4_udiv_m, X))	\
+		    {							\
+		      R##_f[_FP_DIV_MEAT_4_udiv_i]--;			\
+		      _FP_FRAC_ADD_4 (X, Y, X);				\
+		    }							\
+		}							\
+	      _FP_FRAC_DEC_4 (X, _FP_DIV_MEAT_4_udiv_m);		\
+	      if (!_FP_DIV_MEAT_4_udiv_i)				\
+		{							\
+		  if (!_FP_FRAC_EQ_4 (X, _FP_DIV_MEAT_4_udiv_m))	\
+		    R##_f[0] |= _FP_WORK_STICKY;			\
+		  break;						\
+		}							\
+	    }								\
+	}								\
+    }									\
+  while (0)
+
+
+/* Square root algorithms:
+   We have just one right now, maybe Newton approximation
+   should be added for those machines where division is fast.  */
+
+#define _FP_SQRT_MEAT_4(R, S, T, X, q)					\
+  do									\
+    {									\
+      while (q)								\
+	{								\
+	  T##_f[3] = S##_f[3] + (q);					\
+	  if (T##_f[3] <= X##_f[3])					\
+	    {								\
+	      S##_f[3] = T##_f[3] + (q);				\
+	      X##_f[3] -= T##_f[3];					\
+	      R##_f[3] += (q);						\
+	    }								\
+	  _FP_FRAC_SLL_4 (X, 1);					\
+	  (q) >>= 1;							\
+	}								\
+      (q) = (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE - 1);			\
+      while (q)								\
+	{								\
+	  T##_f[2] = S##_f[2] + (q);					\
+	  T##_f[3] = S##_f[3];						\
+	  if (T##_f[3] < X##_f[3]					\
+	      || (T##_f[3] == X##_f[3] && T##_f[2] <= X##_f[2]))	\
+	    {								\
+	      S##_f[2] = T##_f[2] + (q);				\
+	      S##_f[3] += (T##_f[2] > S##_f[2]);			\
+	      __FP_FRAC_DEC_2 (X##_f[3], X##_f[2],			\
+			       T##_f[3], T##_f[2]);			\
+	      R##_f[2] += (q);						\
+	    }								\
+	  _FP_FRAC_SLL_4 (X, 1);					\
+	  (q) >>= 1;							\
+	}								\
+      (q) = (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE - 1);			\
+      while (q)								\
+	{								\
+	  T##_f[1] = S##_f[1] + (q);					\
+	  T##_f[2] = S##_f[2];						\
+	  T##_f[3] = S##_f[3];						\
+	  if (T##_f[3] < X##_f[3]					\
+	      || (T##_f[3] == X##_f[3]					\
+		  && (T##_f[2] < X##_f[2]				\
+		      || (T##_f[2] == X##_f[2]				\
+			  && T##_f[1] <= X##_f[1]))))			\
+	    {								\
+	      S##_f[1] = T##_f[1] + (q);				\
+	      S##_f[2] += (T##_f[1] > S##_f[1]);			\
+	      S##_f[3] += (T##_f[2] > S##_f[2]);			\
+	      __FP_FRAC_DEC_3 (X##_f[3], X##_f[2], X##_f[1],		\
+			       T##_f[3], T##_f[2], T##_f[1]);		\
+	      R##_f[1] += (q);						\
+	    }								\
+	  _FP_FRAC_SLL_4 (X, 1);					\
+	  (q) >>= 1;							\
+	}								\
+      (q) = (_FP_W_TYPE) 1 << (_FP_W_TYPE_SIZE - 1);			\
+      while ((q) != _FP_WORK_ROUND)					\
+	{								\
+	  T##_f[0] = S##_f[0] + (q);					\
+	  T##_f[1] = S##_f[1];						\
+	  T##_f[2] = S##_f[2];						\
+	  T##_f[3] = S##_f[3];						\
+	  if (_FP_FRAC_GE_4 (X, T))					\
+	    {								\
+	      S##_f[0] = T##_f[0] + (q);				\
+	      S##_f[1] += (T##_f[0] > S##_f[0]);			\
+	      S##_f[2] += (T##_f[1] > S##_f[1]);			\
+	      S##_f[3] += (T##_f[2] > S##_f[2]);			\
+	      _FP_FRAC_DEC_4 (X, T);					\
+	      R##_f[0] += (q);						\
+	    }								\
+	  _FP_FRAC_SLL_4 (X, 1);					\
+	  (q) >>= 1;							\
+	}								\
+      if (!_FP_FRAC_ZEROP_4 (X))					\
+	{								\
+	  if (_FP_FRAC_GT_4 (X, S))					\
+	    R##_f[0] |= _FP_WORK_ROUND;					\
+	  R##_f[0] |= _FP_WORK_STICKY;					\
+	}								\
+    }									\
+  while (0)
+
+
+/* Internals.  */
+
+#define __FP_FRAC_SET_4(X, I3, I2, I1, I0)			\
   (X##_f[3] = I3, X##_f[2] = I2, X##_f[1] = I1, X##_f[0] = I0)
 
 #ifndef __FP_FRAC_ADD_3
-#define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0)		\
-  do {								\
-    int _c1, _c2;							\
-    r0 = x0 + y0;						\
-    _c1 = r0 < x0;						\
-    r1 = x1 + y1;						\
-    _c2 = r1 < x1;						\
-    r1 += _c1;							\
-    _c2 |= r1 < _c1;						\
-    r2 = x2 + y2 + _c2;						\
-  } while (0)
+# define __FP_FRAC_ADD_3(r2, r1, r0, x2, x1, x0, y2, y1, y0)	\
+  do								\
+    {								\
+      _FP_W_TYPE __FP_FRAC_ADD_3_c1, __FP_FRAC_ADD_3_c2;	\
+      r0 = x0 + y0;						\
+      __FP_FRAC_ADD_3_c1 = r0 < x0;				\
+      r1 = x1 + y1;						\
+      __FP_FRAC_ADD_3_c2 = r1 < x1;				\
+      r1 += __FP_FRAC_ADD_3_c1;					\
+      __FP_FRAC_ADD_3_c2 |= r1 < __FP_FRAC_ADD_3_c1;		\
+      r2 = x2 + y2 + __FP_FRAC_ADD_3_c2;			\
+    }								\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_ADD_4
-#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)	\
-  do {								\
-    int _c1, _c2, _c3;						\
-    r0 = x0 + y0;						\
-    _c1 = r0 < x0;						\
-    r1 = x1 + y1;						\
-    _c2 = r1 < x1;						\
-    r1 += _c1;							\
-    _c2 |= r1 < _c1;						\
-    r2 = x2 + y2;						\
-    _c3 = r2 < x2;						\
-    r2 += _c2;							\
-    _c3 |= r2 < _c2;						\
-    r3 = x3 + y3 + _c3;						\
-  } while (0)
+# define __FP_FRAC_ADD_4(r3, r2, r1, r0, x3, x2, x1, x0, y3, y2, y1, y0) \
+  do									\
+    {									\
+      _FP_W_TYPE __FP_FRAC_ADD_4_c1, __FP_FRAC_ADD_4_c2;		\
+      _FP_W_TYPE __FP_FRAC_ADD_4_c3;					\
+      r0 = x0 + y0;							\
+      __FP_FRAC_ADD_4_c1 = r0 < x0;					\
+      r1 = x1 + y1;							\
+      __FP_FRAC_ADD_4_c2 = r1 < x1;					\
+      r1 += __FP_FRAC_ADD_4_c1;						\
+      __FP_FRAC_ADD_4_c2 |= r1 < __FP_FRAC_ADD_4_c1;			\
+      r2 = x2 + y2;							\
+      __FP_FRAC_ADD_4_c3 = r2 < x2;					\
+      r2 += __FP_FRAC_ADD_4_c2;						\
+      __FP_FRAC_ADD_4_c3 |= r2 < __FP_FRAC_ADD_4_c2;			\
+      r3 = x3 + y3 + __FP_FRAC_ADD_4_c3;				\
+    }									\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_SUB_3
-#define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0)		\
-  do {								\
-    int _c1, _c2;							\
-    r0 = x0 - y0;						\
-    _c1 = r0 > x0;						\
-    r1 = x1 - y1;						\
-    _c2 = r1 > x1;						\
-    r1 -= _c1;							\
-    _c2 |= r1 > _c1;						\
-    r2 = x2 - y2 - _c2;						\
-  } while (0)
+# define __FP_FRAC_SUB_3(r2, r1, r0, x2, x1, x0, y2, y1, y0)	\
+  do								\
+    {								\
+      _FP_W_TYPE __FP_FRAC_SUB_3_c1, __FP_FRAC_SUB_3_c2;	\
+      r0 = x0 - y0;						\
+      __FP_FRAC_SUB_3_c1 = r0 > x0;				\
+      r1 = x1 - y1;						\
+      __FP_FRAC_SUB_3_c2 = r1 > x1;				\
+      r1 -= __FP_FRAC_SUB_3_c1;					\
+      __FP_FRAC_SUB_3_c2 |= __FP_FRAC_SUB_3_c1 && (y1 == x1);	\
+      r2 = x2 - y2 - __FP_FRAC_SUB_3_c2;			\
+    }								\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_SUB_4
-#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)	\
-  do {								\
-    int _c1, _c2, _c3;						\
-    r0 = x0 - y0;						\
-    _c1 = r0 > x0;						\
-    r1 = x1 - y1;						\
-    _c2 = r1 > x1;						\
-    r1 -= _c1;							\
-    _c2 |= r1 > _c1;						\
-    r2 = x2 - y2;						\
-    _c3 = r2 > x2;						\
-    r2 -= _c2;							\
-    _c3 |= r2 > _c2;						\
-    r3 = x3 - y3 - _c3;						\
-  } while (0)
+# define __FP_FRAC_SUB_4(r3, r2, r1, r0, x3, x2, x1, x0, y3, y2, y1, y0) \
+  do									\
+    {									\
+      _FP_W_TYPE __FP_FRAC_SUB_4_c1, __FP_FRAC_SUB_4_c2;		\
+      _FP_W_TYPE __FP_FRAC_SUB_4_c3;					\
+      r0 = x0 - y0;							\
+      __FP_FRAC_SUB_4_c1 = r0 > x0;					\
+      r1 = x1 - y1;							\
+      __FP_FRAC_SUB_4_c2 = r1 > x1;					\
+      r1 -= __FP_FRAC_SUB_4_c1;						\
+      __FP_FRAC_SUB_4_c2 |= __FP_FRAC_SUB_4_c1 && (y1 == x1);		\
+      r2 = x2 - y2;							\
+      __FP_FRAC_SUB_4_c3 = r2 > x2;					\
+      r2 -= __FP_FRAC_SUB_4_c2;						\
+      __FP_FRAC_SUB_4_c3 |= __FP_FRAC_SUB_4_c2 && (y2 == x2);		\
+      r3 = x3 - y3 - __FP_FRAC_SUB_4_c3;				\
+    }									\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_DEC_3
-#define __FP_FRAC_DEC_3(x2,x1,x0,y2,y1,y0)				\
-  do {									\
-    UWtype _t0, _t1, _t2;						\
-    _t0 = x0, _t1 = x1, _t2 = x2;					\
-    __FP_FRAC_SUB_3 (x2, x1, x0, _t2, _t1, _t0, y2, y1, y0);		\
-  } while (0)
+# define __FP_FRAC_DEC_3(x2, x1, x0, y2, y1, y0)		\
+  do								\
+    {								\
+      UWtype __FP_FRAC_DEC_3_t0, __FP_FRAC_DEC_3_t1;		\
+      UWtype __FP_FRAC_DEC_3_t2;				\
+      __FP_FRAC_DEC_3_t0 = x0;					\
+      __FP_FRAC_DEC_3_t1 = x1;					\
+      __FP_FRAC_DEC_3_t2 = x2;					\
+      __FP_FRAC_SUB_3 (x2, x1, x0, __FP_FRAC_DEC_3_t2,		\
+		       __FP_FRAC_DEC_3_t1, __FP_FRAC_DEC_3_t0,	\
+		       y2, y1, y0);				\
+    }								\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_DEC_4
-#define __FP_FRAC_DEC_4(x3,x2,x1,x0,y3,y2,y1,y0)			\
-  do {									\
-    UWtype _t0, _t1, _t2, _t3;						\
-    _t0 = x0, _t1 = x1, _t2 = x2, _t3 = x3;				\
-    __FP_FRAC_SUB_4 (x3,x2,x1,x0,_t3,_t2,_t1,_t0, y3,y2,y1,y0);		\
-  } while (0)
+# define __FP_FRAC_DEC_4(x3, x2, x1, x0, y3, y2, y1, y0)	\
+  do								\
+    {								\
+      UWtype __FP_FRAC_DEC_4_t0, __FP_FRAC_DEC_4_t1;		\
+      UWtype __FP_FRAC_DEC_4_t2, __FP_FRAC_DEC_4_t3;		\
+      __FP_FRAC_DEC_4_t0 = x0;					\
+      __FP_FRAC_DEC_4_t1 = x1;					\
+      __FP_FRAC_DEC_4_t2 = x2;					\
+      __FP_FRAC_DEC_4_t3 = x3;					\
+      __FP_FRAC_SUB_4 (x3, x2, x1, x0, __FP_FRAC_DEC_4_t3,	\
+		       __FP_FRAC_DEC_4_t2, __FP_FRAC_DEC_4_t1,	\
+		       __FP_FRAC_DEC_4_t0, y3, y2, y1, y0);	\
+    }								\
+  while (0)
 #endif
 
 #ifndef __FP_FRAC_ADDI_4
-#define __FP_FRAC_ADDI_4(x3,x2,x1,x0,i)					\
-  do {									\
-    UWtype _t;								\
-    _t = ((x0 += i) < i);						\
-    x1 += _t; _t = (x1 < _t);						\
-    x2 += _t; _t = (x2 < _t);						\
-    x3 += _t;								\
-  } while (0)
+# define __FP_FRAC_ADDI_4(x3, x2, x1, x0, i)		\
+  do							\
+    {							\
+      UWtype __FP_FRAC_ADDI_4_t;			\
+      __FP_FRAC_ADDI_4_t = ((x0 += i) < i);		\
+      x1 += __FP_FRAC_ADDI_4_t;				\
+      __FP_FRAC_ADDI_4_t = (x1 < __FP_FRAC_ADDI_4_t);	\
+      x2 += __FP_FRAC_ADDI_4_t;				\
+      __FP_FRAC_ADDI_4_t = (x2 < __FP_FRAC_ADDI_4_t);	\
+      x3 += __FP_FRAC_ADDI_4_t;				\
+    }							\
+  while (0)
 #endif
 
 /* Convert FP values between word sizes. This appears to be more
- * complicated than I'd have expected it to be, so these might be
- * wrong... These macros are in any case somewhat bogus because they
- * use information about what various FRAC_n variables look like 
- * internally [eg, that 2 word vars are X_f0 and x_f1]. But so do
- * the ones in op-2.h and op-1.h. 
- */
-#define _FP_FRAC_CONV_1_4(dfs, sfs, D, S)				\
-   do {									\
-     if (S##_c != FP_CLS_NAN)						\
-       _FP_FRAC_SRS_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs),	\
-			  _FP_WFRACBITS_##sfs);				\
-     else								\
-       _FP_FRAC_SRL_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs));	\
-     D##_f = S##_f[0];							\
-  } while (0)
-
-#define _FP_FRAC_CONV_2_4(dfs, sfs, D, S)				\
-   do {									\
-     if (S##_c != FP_CLS_NAN)						\
-       _FP_FRAC_SRS_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs),	\
-		      _FP_WFRACBITS_##sfs);				\
-     else								\
-       _FP_FRAC_SRL_4(S, (_FP_WFRACBITS_##sfs - _FP_WFRACBITS_##dfs));	\
-     D##_f0 = S##_f[0];							\
-     D##_f1 = S##_f[1];							\
-  } while (0)
-
-/* Assembly/disassembly for converting to/from integral types.  
- * No shifting or overflow handled here.
- */
-/* Put the FP value X into r, which is an integer of size rsize. */
+   complicated than I'd have expected it to be, so these might be
+   wrong... These macros are in any case somewhat bogus because they
+   use information about what various FRAC_n variables look like
+   internally [eg, that 2 word vars are X_f0 and x_f1]. But so do
+   the ones in op-2.h and op-1.h.  */
+#define _FP_FRAC_COPY_1_4(D, S)		(D##_f = S##_f[0])
+
+#define _FP_FRAC_COPY_2_4(D, S)			\
+  do						\
+    {						\
+      D##_f0 = S##_f[0];			\
+      D##_f1 = S##_f[1];			\
+    }						\
+  while (0)
+
+/* Assembly/disassembly for converting to/from integral types.
+   No shifting or overflow handled here.  */
+/* Put the FP value X into r, which is an integer of size rsize.  */
 #define _FP_FRAC_ASSEMBLE_4(r, X, rsize)				\
-  do {									\
-    if (rsize <= _FP_W_TYPE_SIZE)					\
-      r = X##_f[0];							\
-    else if (rsize <= 2*_FP_W_TYPE_SIZE)				\
-    {									\
-      r = X##_f[1];							\
-      r <<= _FP_W_TYPE_SIZE;						\
-      r += X##_f[0];							\
-    }									\
-    else								\
+  do									\
     {									\
-      /* I'm feeling lazy so we deal with int == 3words (implausible)*/	\
-      /* and int == 4words as a single case.			 */	\
-      r = X##_f[3];							\
-      r <<= _FP_W_TYPE_SIZE;						\
-      r += X##_f[2];							\
-      r <<= _FP_W_TYPE_SIZE;						\
-      r += X##_f[1];							\
-      r <<= _FP_W_TYPE_SIZE;						\
-      r += X##_f[0];							\
+      if ((rsize) <= _FP_W_TYPE_SIZE)					\
+	(r) = X##_f[0];							\
+	else if ((rsize) <= 2*_FP_W_TYPE_SIZE)				\
+	{								\
+	  (r) = X##_f[1];						\
+	  (r) = ((rsize) <= _FP_W_TYPE_SIZE				\
+		 ? 0							\
+		 : (r) << _FP_W_TYPE_SIZE);				\
+	  (r) += X##_f[0];						\
+	}								\
+      else								\
+	{								\
+	  /* I'm feeling lazy so we deal with int == 3words		\
+	     (implausible) and int == 4words as a single case.  */	\
+	  (r) = X##_f[3];						\
+	  (r) = ((rsize) <= _FP_W_TYPE_SIZE				\
+		 ? 0							\
+		 : (r) << _FP_W_TYPE_SIZE);				\
+	  (r) += X##_f[2];						\
+	  (r) = ((rsize) <= _FP_W_TYPE_SIZE				\
+		 ? 0							\
+		 : (r) << _FP_W_TYPE_SIZE);				\
+	  (r) += X##_f[1];						\
+	  (r) = ((rsize) <= _FP_W_TYPE_SIZE				\
+		 ? 0							\
+		 : (r) << _FP_W_TYPE_SIZE);				\
+	  (r) += X##_f[0];						\
+	}								\
     }									\
-  } while (0)
+  while (0)
 
 /* "No disassemble Number Five!" */
-/* move an integer of size rsize into X's fractional part. We rely on
- * the _f[] array consisting of words of size _FP_W_TYPE_SIZE to avoid
- * having to mask the values we store into it.
- */
-#define _FP_FRAC_DISASSEMBLE_4(X, r, rsize)				\
-  do {									\
-    X##_f[0] = r;							\
-    X##_f[1] = (rsize <= _FP_W_TYPE_SIZE ? 0 : r >> _FP_W_TYPE_SIZE);	\
-    X##_f[2] = (rsize <= 2*_FP_W_TYPE_SIZE ? 0 : r >> 2*_FP_W_TYPE_SIZE); \
-    X##_f[3] = (rsize <= 3*_FP_W_TYPE_SIZE ? 0 : r >> 3*_FP_W_TYPE_SIZE); \
-  } while (0)
-
-#define _FP_FRAC_CONV_4_1(dfs, sfs, D, S)				\
-   do {									\
-     D##_f[0] = S##_f;							\
-     D##_f[1] = D##_f[2] = D##_f[3] = 0;				\
-     _FP_FRAC_SLL_4(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs));	\
-   } while (0)
-
-#define _FP_FRAC_CONV_4_2(dfs, sfs, D, S)				\
-   do {									\
-     D##_f[0] = S##_f0;							\
-     D##_f[1] = S##_f1;							\
-     D##_f[2] = D##_f[3] = 0;						\
-     _FP_FRAC_SLL_4(D, (_FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs));	\
-   } while (0)
+/* Move an integer of size rsize into X's fractional part. We rely on
+   the _f[] array consisting of words of size _FP_W_TYPE_SIZE to avoid
+   having to mask the values we store into it.  */
+#define _FP_FRAC_DISASSEMBLE_4(X, r, rsize)	\
+  do						\
+    {						\
+      X##_f[0] = (r);				\
+      X##_f[1] = ((rsize) <= _FP_W_TYPE_SIZE	\
+		  ? 0				\
+		  : (r) >> _FP_W_TYPE_SIZE);	\
+      X##_f[2] = ((rsize) <= 2*_FP_W_TYPE_SIZE	\
+		  ? 0				\
+		  : (r) >> 2*_FP_W_TYPE_SIZE);	\
+      X##_f[3] = ((rsize) <= 3*_FP_W_TYPE_SIZE	\
+		  ? 0				\
+		  : (r) >> 3*_FP_W_TYPE_SIZE);	\
+    }						\
+  while (0)
+
+#define _FP_FRAC_COPY_4_1(D, S)			\
+  do						\
+    {						\
+      D##_f[0] = S##_f;				\
+      D##_f[1] = D##_f[2] = D##_f[3] = 0;	\
+    }						\
+  while (0)
+
+#define _FP_FRAC_COPY_4_2(D, S)			\
+  do						\
+    {						\
+      D##_f[0] = S##_f0;			\
+      D##_f[1] = S##_f1;			\
+      D##_f[2] = D##_f[3] = 0;			\
+    }						\
+  while (0)
+
+#define _FP_FRAC_COPY_4_4(D, S)	_FP_FRAC_COPY_4 (D, S)
 
 #endif
diff --git a/include/math-emu/op-8.h b/include/math-emu/op-8.h
index 8b8c05e..7705c68 100644
--- a/include/math-emu/op-8.h
+++ b/include/math-emu/op-8.h
@@ -1,107 +1,150 @@
 /* Software floating-point emulation.
    Basic eight-word fraction declaration and manipulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz) and
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
-                                                         
+
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_OP_8_H__
 #define __MATH_EMU_OP_8_H__
 
 /* We need just a few things from here for op-4, if we ever need some
-   other macros, they can be added. */
+   other macros, they can be added.  */
 #define _FP_FRAC_DECL_8(X)	_FP_W_TYPE X##_f[8]
 #define _FP_FRAC_HIGH_8(X)	(X##_f[7])
 #define _FP_FRAC_LOW_8(X)	(X##_f[0])
-#define _FP_FRAC_WORD_8(X,w)	(X##_f[w])
+#define _FP_FRAC_WORD_8(X, w)	(X##_f[w])
 
-#define _FP_FRAC_SLL_8(X,N)						\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _up = (N) % _FP_W_TYPE_SIZE;					\
-    _down = _FP_W_TYPE_SIZE - _up;					\
-    if (!_up)								\
-      for (_i = 7; _i >= _skip; --_i)					\
-	X##_f[_i] = X##_f[_i-_skip];					\
-    else								\
-      {									\
-	for (_i = 7; _i > _skip; --_i)					\
-	  X##_f[_i] = X##_f[_i-_skip] << _up				\
-		      | X##_f[_i-_skip-1] >> _down;			\
-	X##_f[_i--] = X##_f[0] << _up; 					\
-      }									\
-    for (; _i >= 0; --_i)						\
-      X##_f[_i] = 0;							\
-  } while (0)
+#define _FP_FRAC_SLL_8(X, N)						\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SLL_8_up, _FP_FRAC_SLL_8_down;		\
+      _FP_I_TYPE _FP_FRAC_SLL_8_skip, _FP_FRAC_SLL_8_i;			\
+      _FP_FRAC_SLL_8_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SLL_8_up = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SLL_8_down = _FP_W_TYPE_SIZE - _FP_FRAC_SLL_8_up;	\
+      if (!_FP_FRAC_SLL_8_up)						\
+	for (_FP_FRAC_SLL_8_i = 7;					\
+	     _FP_FRAC_SLL_8_i >= _FP_FRAC_SLL_8_skip;			\
+	     --_FP_FRAC_SLL_8_i)					\
+	  X##_f[_FP_FRAC_SLL_8_i]					\
+	    = X##_f[_FP_FRAC_SLL_8_i-_FP_FRAC_SLL_8_skip];		\
+      else								\
+	{								\
+	  for (_FP_FRAC_SLL_8_i = 7;					\
+	       _FP_FRAC_SLL_8_i > _FP_FRAC_SLL_8_skip;			\
+	       --_FP_FRAC_SLL_8_i)					\
+	    X##_f[_FP_FRAC_SLL_8_i]					\
+	      = ((X##_f[_FP_FRAC_SLL_8_i-_FP_FRAC_SLL_8_skip]		\
+		  << _FP_FRAC_SLL_8_up)					\
+		 | (X##_f[_FP_FRAC_SLL_8_i-_FP_FRAC_SLL_8_skip-1]	\
+		    >> _FP_FRAC_SLL_8_down));				\
+	  X##_f[_FP_FRAC_SLL_8_i--] = X##_f[0] << _FP_FRAC_SLL_8_up;	\
+	}								\
+      for (; _FP_FRAC_SLL_8_i >= 0; --_FP_FRAC_SLL_8_i)			\
+	X##_f[_FP_FRAC_SLL_8_i] = 0;					\
+    }									\
+  while (0)
 
-#define _FP_FRAC_SRL_8(X,N)						\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _down = (N) % _FP_W_TYPE_SIZE;					\
-    _up = _FP_W_TYPE_SIZE - _down;					\
-    if (!_down)								\
-      for (_i = 0; _i <= 7-_skip; ++_i)					\
-	X##_f[_i] = X##_f[_i+_skip];					\
-    else								\
-      {									\
-	for (_i = 0; _i < 7-_skip; ++_i)				\
-	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
-		      | X##_f[_i+_skip+1] << _up;			\
-	X##_f[_i++] = X##_f[7] >> _down;				\
-      }									\
-    for (; _i < 8; ++_i)						\
-      X##_f[_i] = 0;							\
-  } while (0)
+#define _FP_FRAC_SRL_8(X, N)						\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SRL_8_up, _FP_FRAC_SRL_8_down;		\
+      _FP_I_TYPE _FP_FRAC_SRL_8_skip, _FP_FRAC_SRL_8_i;			\
+      _FP_FRAC_SRL_8_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRL_8_down = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRL_8_up = _FP_W_TYPE_SIZE - _FP_FRAC_SRL_8_down;	\
+      if (!_FP_FRAC_SRL_8_down)						\
+	for (_FP_FRAC_SRL_8_i = 0;					\
+	     _FP_FRAC_SRL_8_i <= 7-_FP_FRAC_SRL_8_skip;			\
+	     ++_FP_FRAC_SRL_8_i)					\
+	  X##_f[_FP_FRAC_SRL_8_i]					\
+	    = X##_f[_FP_FRAC_SRL_8_i+_FP_FRAC_SRL_8_skip];		\
+      else								\
+	{								\
+	  for (_FP_FRAC_SRL_8_i = 0;					\
+	       _FP_FRAC_SRL_8_i < 7-_FP_FRAC_SRL_8_skip;		\
+	       ++_FP_FRAC_SRL_8_i)					\
+	    X##_f[_FP_FRAC_SRL_8_i]					\
+	      = ((X##_f[_FP_FRAC_SRL_8_i+_FP_FRAC_SRL_8_skip]		\
+		  >> _FP_FRAC_SRL_8_down)				\
+		 | (X##_f[_FP_FRAC_SRL_8_i+_FP_FRAC_SRL_8_skip+1]	\
+		    << _FP_FRAC_SRL_8_up));				\
+	  X##_f[_FP_FRAC_SRL_8_i++] = X##_f[7] >> _FP_FRAC_SRL_8_down;	\
+	}								\
+      for (; _FP_FRAC_SRL_8_i < 8; ++_FP_FRAC_SRL_8_i)			\
+	X##_f[_FP_FRAC_SRL_8_i] = 0;					\
+    }									\
+  while (0)
 
 
-/* Right shift with sticky-lsb. 
- * What this actually means is that we do a standard right-shift,
- * but that if any of the bits that fall off the right hand side
- * were one then we always set the LSbit.
- */
-#define _FP_FRAC_SRS_8(X,N,size)					\
-  do {									\
-    _FP_I_TYPE _up, _down, _skip, _i;					\
-    _FP_W_TYPE _s;							\
-    _skip = (N) / _FP_W_TYPE_SIZE;					\
-    _down = (N) % _FP_W_TYPE_SIZE;					\
-    _up = _FP_W_TYPE_SIZE - _down;					\
-    for (_s = _i = 0; _i < _skip; ++_i)					\
-      _s |= X##_f[_i];							\
-    _s |= X##_f[_i] << _up;						\
-/* s is now != 0 if we want to set the LSbit */				\
-    if (!_down)								\
-      for (_i = 0; _i <= 7-_skip; ++_i)					\
-	X##_f[_i] = X##_f[_i+_skip];					\
-    else								\
-      {									\
-	for (_i = 0; _i < 7-_skip; ++_i)				\
-	  X##_f[_i] = X##_f[_i+_skip] >> _down				\
-		      | X##_f[_i+_skip+1] << _up;			\
-	X##_f[_i++] = X##_f[7] >> _down;				\
-      }									\
-    for (; _i < 8; ++_i)						\
-      X##_f[_i] = 0;							\
-    /* don't fix the LSB until the very end when we're sure f[0] is stable */	\
-    X##_f[0] |= (_s != 0);						\
-  } while (0)
+/* Right shift with sticky-lsb.
+   What this actually means is that we do a standard right-shift,
+   but that if any of the bits that fall off the right hand side
+   were one then we always set the LSbit.  */
+#define _FP_FRAC_SRS_8(X, N, size)					\
+  do									\
+    {									\
+      _FP_I_TYPE _FP_FRAC_SRS_8_up, _FP_FRAC_SRS_8_down;		\
+      _FP_I_TYPE _FP_FRAC_SRS_8_skip, _FP_FRAC_SRS_8_i;			\
+      _FP_W_TYPE _FP_FRAC_SRS_8_s;					\
+      _FP_FRAC_SRS_8_skip = (N) / _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRS_8_down = (N) % _FP_W_TYPE_SIZE;			\
+      _FP_FRAC_SRS_8_up = _FP_W_TYPE_SIZE - _FP_FRAC_SRS_8_down;	\
+      for (_FP_FRAC_SRS_8_s = _FP_FRAC_SRS_8_i = 0;			\
+	   _FP_FRAC_SRS_8_i < _FP_FRAC_SRS_8_skip;			\
+	   ++_FP_FRAC_SRS_8_i)						\
+	_FP_FRAC_SRS_8_s |= X##_f[_FP_FRAC_SRS_8_i];			\
+      if (!_FP_FRAC_SRS_8_down)						\
+	for (_FP_FRAC_SRS_8_i = 0;					\
+	     _FP_FRAC_SRS_8_i <= 7-_FP_FRAC_SRS_8_skip;			\
+	     ++_FP_FRAC_SRS_8_i)					\
+	  X##_f[_FP_FRAC_SRS_8_i]					\
+	    = X##_f[_FP_FRAC_SRS_8_i+_FP_FRAC_SRS_8_skip];		\
+      else								\
+	{								\
+	  _FP_FRAC_SRS_8_s						\
+	    |= X##_f[_FP_FRAC_SRS_8_i] << _FP_FRAC_SRS_8_up;		\
+	  for (_FP_FRAC_SRS_8_i = 0;					\
+	       _FP_FRAC_SRS_8_i < 7-_FP_FRAC_SRS_8_skip;		\
+	       ++_FP_FRAC_SRS_8_i)					\
+	    X##_f[_FP_FRAC_SRS_8_i]					\
+	      = ((X##_f[_FP_FRAC_SRS_8_i+_FP_FRAC_SRS_8_skip]		\
+		  >> _FP_FRAC_SRS_8_down)				\
+		 | (X##_f[_FP_FRAC_SRS_8_i+_FP_FRAC_SRS_8_skip+1]	\
+		    << _FP_FRAC_SRS_8_up));				\
+	  X##_f[_FP_FRAC_SRS_8_i++] = X##_f[7] >> _FP_FRAC_SRS_8_down;	\
+	}								\
+      for (; _FP_FRAC_SRS_8_i < 8; ++_FP_FRAC_SRS_8_i)			\
+	X##_f[_FP_FRAC_SRS_8_i] = 0;					\
+      /* Don't fix the LSB until the very end when we're sure f[0] is	\
+	 stable.  */							\
+      X##_f[0] |= (_FP_FRAC_SRS_8_s != 0);				\
+    }									\
+  while (0)
 
 #endif
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index 6bdf8c6..b9f5e1a 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -1,5 +1,5 @@
 /* Software floating-point emulation. Common operations.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -7,870 +7,2110 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_OP_COMMON_H__
 #define __MATH_EMU_OP_COMMON_H__
 
-#define _FP_DECL(wc, X)			\
-  _FP_I_TYPE X##_c=0, X##_s=0, X##_e=0;	\
-  _FP_FRAC_DECL_##wc(X)
-
-/*
- * Finish truly unpacking a native fp value by classifying the kind
- * of fp value and normalizing both the exponent and the fraction.
- */
-
-#define _FP_UNPACK_CANONICAL(fs, wc, X)					\
-do {									\
-  switch (X##_e)							\
-  {									\
-  default:								\
-    _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_IMPLBIT_##fs;			\
-    _FP_FRAC_SLL_##wc(X, _FP_WORKBITS);					\
-    X##_e -= _FP_EXPBIAS_##fs;						\
-    X##_c = FP_CLS_NORMAL;						\
-    break;								\
-									\
-  case 0:								\
-    if (_FP_FRAC_ZEROP_##wc(X))						\
-      X##_c = FP_CLS_ZERO;						\
-    else								\
-      {									\
-	/* a denormalized number */					\
-	_FP_I_TYPE _shift;						\
-	_FP_FRAC_CLZ_##wc(_shift, X);					\
-	_shift -= _FP_FRACXBITS_##fs;					\
-	_FP_FRAC_SLL_##wc(X, (_shift+_FP_WORKBITS));			\
-	X##_e -= _FP_EXPBIAS_##fs - 1 + _shift;				\
-	X##_c = FP_CLS_NORMAL;						\
-	FP_SET_EXCEPTION(FP_EX_DENORM);					\
-	if (FP_DENORM_ZERO)						\
-	  {								\
-	    FP_SET_EXCEPTION(FP_EX_INEXACT);				\
-	    X##_c = FP_CLS_ZERO;					\
-	  }								\
-      }									\
-    break;								\
-									\
-  case _FP_EXPMAX_##fs:							\
-    if (_FP_FRAC_ZEROP_##wc(X))						\
-      X##_c = FP_CLS_INF;						\
-    else								\
-      {									\
-	X##_c = FP_CLS_NAN;						\
-	/* Check for signaling NaN */					\
-	if (!(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs))		\
-	  FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_SNAN);		\
-      }									\
-    break;								\
-  }									\
-} while (0)
-
-/*
- * Before packing the bits back into the native fp result, take care
- * of such mundane things as rounding and overflow.  Also, for some
- * kinds of fp values, the original parts may not have been fully
- * extracted -- but that is ok, we can regenerate them now.
- */
-
-#define _FP_PACK_CANONICAL(fs, wc, X)				\
-do {								\
-  switch (X##_c)						\
-  {								\
-  case FP_CLS_NORMAL:						\
-    X##_e += _FP_EXPBIAS_##fs;					\
-    if (X##_e > 0)						\
-      {								\
-	_FP_ROUND(wc, X);					\
-	if (_FP_FRAC_OVERP_##wc(fs, X))				\
-	  {							\
-	    _FP_FRAC_CLEAR_OVERP_##wc(fs, X);			\
-	    X##_e++;						\
-	  }							\
-	_FP_FRAC_SRL_##wc(X, _FP_WORKBITS);			\
-	if (X##_e >= _FP_EXPMAX_##fs)				\
-	  {							\
-	    /* overflow */					\
-	    switch (FP_ROUNDMODE)				\
-	      {							\
-	      case FP_RND_NEAREST:				\
-		X##_c = FP_CLS_INF;				\
-		break;						\
-	      case FP_RND_PINF:					\
-		if (!X##_s) X##_c = FP_CLS_INF;			\
-		break;						\
-	      case FP_RND_MINF:					\
-		if (X##_s) X##_c = FP_CLS_INF;			\
-		break;						\
-	      }							\
-	    if (X##_c == FP_CLS_INF)				\
-	      {							\
-		/* Overflow to infinity */			\
-		X##_e = _FP_EXPMAX_##fs;			\
-		_FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);	\
-	      }							\
-	    else						\
-	      {							\
-		/* Overflow to maximum normal */		\
-		X##_e = _FP_EXPMAX_##fs - 1;			\
-		_FP_FRAC_SET_##wc(X, _FP_MAXFRAC_##wc);		\
-	      }							\
-	    FP_SET_EXCEPTION(FP_EX_OVERFLOW);			\
-            FP_SET_EXCEPTION(FP_EX_INEXACT);			\
-	  }							\
-      }								\
-    else							\
-      {								\
-	/* we've got a denormalized number */			\
-	X##_e = -X##_e + 1;					\
-	if (X##_e <= _FP_WFRACBITS_##fs)			\
-	  {							\
-	    _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs);	\
-	    if (_FP_FRAC_HIGH_##fs(X)				\
-		& (_FP_OVERFLOW_##fs >> 1))			\
-	      {							\
-	        X##_e = 1;					\
-	        _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);	\
-	      }							\
-	    else						\
-	      {							\
-		_FP_ROUND(wc, X);				\
-		if (_FP_FRAC_HIGH_##fs(X)			\
-		   & (_FP_OVERFLOW_##fs >> 1))			\
-		  {						\
-		    X##_e = 1;					\
-		    _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);	\
-		    FP_SET_EXCEPTION(FP_EX_INEXACT);		\
-		  }						\
-		else						\
-		  {						\
-		    X##_e = 0;					\
-		    _FP_FRAC_SRL_##wc(X, _FP_WORKBITS);		\
-		  }						\
-	      }							\
-	    if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) ||		\
-		(FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW))	\
-		FP_SET_EXCEPTION(FP_EX_UNDERFLOW);		\
-	  }							\
-	else							\
-	  {							\
-	    /* underflow to zero */				\
-	    X##_e = 0;						\
-	    if (!_FP_FRAC_ZEROP_##wc(X))			\
-	      {							\
-	        _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc);		\
-	        _FP_ROUND(wc, X);				\
-	        _FP_FRAC_LOW_##wc(X) >>= (_FP_WORKBITS);	\
-	      }							\
-	    FP_SET_EXCEPTION(FP_EX_UNDERFLOW);			\
-	  }							\
-      }								\
-    break;							\
-								\
-  case FP_CLS_ZERO:						\
-    X##_e = 0;							\
-    _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);			\
-    break;							\
+#define _FP_DECL(wc, X)					\
+  _FP_I_TYPE X##_c __attribute__ ((unused)) = 0;	\
+  _FP_I_TYPE X##_s __attribute__ ((unused)) = 0;	\
+  _FP_I_TYPE X##_e __attribute__ ((unused)) = 0;	\
+  _FP_FRAC_DECL_##wc (X)
+
+/* Test whether the qNaN bit denotes a signaling NaN.  */
+#define _FP_FRAC_SNANP(fs, X)				\
+  ((_FP_QNANNEGATEDP)					\
+   ? (_FP_FRAC_HIGH_RAW_##fs (X) & _FP_QNANBIT_##fs)	\
+   : !(_FP_FRAC_HIGH_RAW_##fs (X) & _FP_QNANBIT_##fs))
+#define _FP_FRAC_SNANP_SEMIRAW(fs, X)			\
+  ((_FP_QNANNEGATEDP)					\
+   ? (_FP_FRAC_HIGH_##fs (X) & _FP_QNANBIT_SH_##fs)	\
+   : !(_FP_FRAC_HIGH_##fs (X) & _FP_QNANBIT_SH_##fs))
+
+/* Finish truly unpacking a native fp value by classifying the kind
+   of fp value and normalizing both the exponent and the fraction.  */
+
+#define _FP_UNPACK_CANONICAL(fs, wc, X)				\
+  do								\
+    {								\
+      switch (X##_e)						\
+	{							\
+	default:						\
+	  _FP_FRAC_HIGH_RAW_##fs (X) |= _FP_IMPLBIT_##fs;	\
+	  _FP_FRAC_SLL_##wc (X, _FP_WORKBITS);			\
+	  X##_e -= _FP_EXPBIAS_##fs;				\
+	  X##_c = FP_CLS_NORMAL;				\
+	  break;						\
 								\
-  case FP_CLS_INF:						\
-    X##_e = _FP_EXPMAX_##fs;					\
-    _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);			\
-    break;							\
+	case 0:							\
+	  if (_FP_FRAC_ZEROP_##wc (X))				\
+	    X##_c = FP_CLS_ZERO;				\
+	  else if (FP_DENORM_ZERO)				\
+	    {							\
+	      X##_c = FP_CLS_ZERO;				\
+	      _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);		\
+	      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+	    }							\
+	  else							\
+	    {							\
+	      /* A denormalized number.  */			\
+	      _FP_I_TYPE _FP_UNPACK_CANONICAL_shift;		\
+	      _FP_FRAC_CLZ_##wc (_FP_UNPACK_CANONICAL_shift,	\
+				 X);				\
+	      _FP_UNPACK_CANONICAL_shift -= _FP_FRACXBITS_##fs;	\
+	      _FP_FRAC_SLL_##wc (X, (_FP_UNPACK_CANONICAL_shift \
+				     + _FP_WORKBITS));		\
+	      X##_e -= (_FP_EXPBIAS_##fs - 1			\
+			+ _FP_UNPACK_CANONICAL_shift);		\
+	      X##_c = FP_CLS_NORMAL;				\
+	      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+	    }							\
+	  break;						\
 								\
-  case FP_CLS_NAN:						\
-    X##_e = _FP_EXPMAX_##fs;					\
-    if (!_FP_KEEPNANFRACP)					\
-      {								\
-	_FP_FRAC_SET_##wc(X, _FP_NANFRAC_##fs);			\
-	X##_s = _FP_NANSIGN_##fs;				\
-      }								\
-    else							\
-      _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_QNANBIT_##fs;		\
-    break;							\
-  }								\
-} while (0)
+	case _FP_EXPMAX_##fs:					\
+	  if (_FP_FRAC_ZEROP_##wc (X))				\
+	    X##_c = FP_CLS_INF;					\
+	  else							\
+	    {							\
+	      X##_c = FP_CLS_NAN;				\
+	      /* Check for signaling NaN.  */			\
+	      if (_FP_FRAC_SNANP (fs, X))			\
+		FP_SET_EXCEPTION (FP_EX_INVALID			\
+				  | FP_EX_INVALID_SNAN);	\
+	    }							\
+	  break;						\
+	}							\
+    }								\
+  while (0)
+
+/* Finish unpacking an fp value in semi-raw mode: the mantissa is
+   shifted by _FP_WORKBITS but the implicit MSB is not inserted and
+   other classification is not done.  */
+#define _FP_UNPACK_SEMIRAW(fs, wc, X)	_FP_FRAC_SLL_##wc (X, _FP_WORKBITS)
+
+/* Check whether a raw or semi-raw input value should be flushed to
+   zero, and flush it to zero if so.  */
+#define _FP_CHECK_FLUSH_ZERO(fs, wc, X)			\
+  do							\
+    {							\
+      if (FP_DENORM_ZERO				\
+	  && X##_e == 0					\
+	  && !_FP_FRAC_ZEROP_##wc (X))			\
+	{						\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);	\
+	  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+	}						\
+    }							\
+  while (0)
+
+/* A semi-raw value has overflowed to infinity.  Adjust the mantissa
+   and exponent appropriately.  */
+#define _FP_OVERFLOW_SEMIRAW(fs, wc, X)			\
+  do							\
+    {							\
+      if (FP_ROUNDMODE == FP_RND_NEAREST		\
+	  || (FP_ROUNDMODE == FP_RND_PINF && !X##_s)	\
+	  || (FP_ROUNDMODE == FP_RND_MINF && X##_s))	\
+	{						\
+	  X##_e = _FP_EXPMAX_##fs;			\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);	\
+	}						\
+      else						\
+	{						\
+	  X##_e = _FP_EXPMAX_##fs - 1;			\
+	  _FP_FRAC_SET_##wc (X, _FP_MAXFRAC_##wc);	\
+	}						\
+      FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+      FP_SET_EXCEPTION (FP_EX_OVERFLOW);		\
+    }							\
+  while (0)
+
+/* Check for a semi-raw value being a signaling NaN and raise the
+   invalid exception if so.  */
+#define _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X)			\
+  do								\
+    {								\
+      if (X##_e == _FP_EXPMAX_##fs				\
+	  && !_FP_FRAC_ZEROP_##wc (X)				\
+	  && _FP_FRAC_SNANP_SEMIRAW (fs, X))			\
+	FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_SNAN);	\
+    }								\
+  while (0)
+
+/* Choose a NaN result from an operation on two semi-raw NaN
+   values.  */
+#define _FP_CHOOSENAN_SEMIRAW(fs, wc, R, X, Y, OP)			\
+  do									\
+    {									\
+      /* _FP_CHOOSENAN expects raw values, so shift as required.  */	\
+      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);				\
+      _FP_FRAC_SRL_##wc (Y, _FP_WORKBITS);				\
+      _FP_CHOOSENAN (fs, wc, R, X, Y, OP);				\
+      _FP_FRAC_SLL_##wc (R, _FP_WORKBITS);				\
+    }									\
+  while (0)
+
+/* Make the fractional part a quiet NaN, preserving the payload
+   if possible, otherwise make it the canonical quiet NaN and set
+   the sign bit accordingly.  */
+#define _FP_SETQNAN(fs, wc, X)					\
+  do								\
+    {								\
+      if (_FP_QNANNEGATEDP)					\
+	{							\
+	  _FP_FRAC_HIGH_RAW_##fs (X) &= _FP_QNANBIT_##fs - 1;	\
+	  if (_FP_FRAC_ZEROP_##wc (X))				\
+	    {							\
+	      X##_s = _FP_NANSIGN_##fs;				\
+	      _FP_FRAC_SET_##wc (X, _FP_NANFRAC_##fs);		\
+	    }							\
+	}							\
+      else							\
+	_FP_FRAC_HIGH_RAW_##fs (X) |= _FP_QNANBIT_##fs;		\
+    }								\
+  while (0)
+#define _FP_SETQNAN_SEMIRAW(fs, wc, X)				\
+  do								\
+    {								\
+      if (_FP_QNANNEGATEDP)					\
+	{							\
+	  _FP_FRAC_HIGH_##fs (X) &= _FP_QNANBIT_SH_##fs - 1;	\
+	  if (_FP_FRAC_ZEROP_##wc (X))				\
+	    {							\
+	      X##_s = _FP_NANSIGN_##fs;				\
+	      _FP_FRAC_SET_##wc (X, _FP_NANFRAC_##fs);		\
+	      _FP_FRAC_SLL_##wc (X, _FP_WORKBITS);		\
+	    }							\
+	}							\
+      else							\
+	_FP_FRAC_HIGH_##fs (X) |= _FP_QNANBIT_SH_##fs;		\
+    }								\
+  while (0)
+
+/* Test whether a biased exponent is normal (not zero or maximum).  */
+#define _FP_EXP_NORMAL(fs, wc, X)	(((X##_e + 1) & _FP_EXPMAX_##fs) > 1)
+
+/* Prepare to pack an fp value in semi-raw mode: the mantissa is
+   rounded and shifted right, with the rounding possibly increasing
+   the exponent (including changing a finite value to infinity).  */
+#define _FP_PACK_SEMIRAW(fs, wc, X)				\
+  do								\
+    {								\
+      int _FP_PACK_SEMIRAW_is_tiny				\
+	= X##_e == 0 && !_FP_FRAC_ZEROP_##wc (X);		\
+      if (_FP_TININESS_AFTER_ROUNDING				\
+	  && _FP_PACK_SEMIRAW_is_tiny)				\
+	{							\
+	  FP_DECL_##fs (_FP_PACK_SEMIRAW_T);			\
+	  _FP_FRAC_COPY_##wc (_FP_PACK_SEMIRAW_T, X);		\
+	  _FP_PACK_SEMIRAW_T##_s = X##_s;			\
+	  _FP_PACK_SEMIRAW_T##_e = X##_e;			\
+	  _FP_FRAC_SLL_##wc (_FP_PACK_SEMIRAW_T, 1);		\
+	  _FP_ROUND (wc, _FP_PACK_SEMIRAW_T);			\
+	  if (_FP_FRAC_OVERP_##wc (fs, _FP_PACK_SEMIRAW_T))	\
+	    _FP_PACK_SEMIRAW_is_tiny = 0;			\
+	}							\
+      _FP_ROUND (wc, X);					\
+      if (_FP_PACK_SEMIRAW_is_tiny)				\
+	{							\
+	  if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT)		\
+	      || (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW))	\
+	    FP_SET_EXCEPTION (FP_EX_UNDERFLOW);			\
+	}							\
+      if (_FP_FRAC_HIGH_##fs (X)				\
+	  & (_FP_OVERFLOW_##fs >> 1))				\
+	{							\
+	  _FP_FRAC_HIGH_##fs (X) &= ~(_FP_OVERFLOW_##fs >> 1);	\
+	  X##_e++;						\
+	  if (X##_e == _FP_EXPMAX_##fs)				\
+	    _FP_OVERFLOW_SEMIRAW (fs, wc, X);			\
+	}							\
+      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);			\
+      if (X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (X))	\
+	{							\
+	  if (!_FP_KEEPNANFRACP)				\
+	    {							\
+	      _FP_FRAC_SET_##wc (X, _FP_NANFRAC_##fs);		\
+	      X##_s = _FP_NANSIGN_##fs;				\
+	    }							\
+	  else							\
+	    _FP_SETQNAN (fs, wc, X);				\
+	}							\
+    }								\
+  while (0)
+
+/* Before packing the bits back into the native fp result, take care
+   of such mundane things as rounding and overflow.  Also, for some
+   kinds of fp values, the original parts may not have been fully
+   extracted -- but that is ok, we can regenerate them now.  */
+
+#define _FP_PACK_CANONICAL(fs, wc, X)					\
+  do									\
+    {									\
+      switch (X##_c)							\
+	{								\
+	case FP_CLS_NORMAL:						\
+	  X##_e += _FP_EXPBIAS_##fs;					\
+	  if (X##_e > 0)						\
+	    {								\
+	      _FP_ROUND (wc, X);					\
+	      if (_FP_FRAC_OVERP_##wc (fs, X))				\
+		{							\
+		  _FP_FRAC_CLEAR_OVERP_##wc (fs, X);			\
+		  X##_e++;						\
+		}							\
+	      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);			\
+	      if (X##_e >= _FP_EXPMAX_##fs)				\
+		{							\
+		  /* Overflow.  */					\
+		  switch (FP_ROUNDMODE)					\
+		    {							\
+		    case FP_RND_NEAREST:				\
+		      X##_c = FP_CLS_INF;				\
+		      break;						\
+		    case FP_RND_PINF:					\
+		      if (!X##_s)					\
+			X##_c = FP_CLS_INF;				\
+		      break;						\
+		    case FP_RND_MINF:					\
+		      if (X##_s)					\
+			X##_c = FP_CLS_INF;				\
+		      break;						\
+		    }							\
+		  if (X##_c == FP_CLS_INF)				\
+		    {							\
+		      /* Overflow to infinity.  */			\
+		      X##_e = _FP_EXPMAX_##fs;				\
+		      _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);		\
+		    }							\
+		  else							\
+		    {							\
+		      /* Overflow to maximum normal.  */		\
+		      X##_e = _FP_EXPMAX_##fs - 1;			\
+		      _FP_FRAC_SET_##wc (X, _FP_MAXFRAC_##wc);		\
+		    }							\
+		  FP_SET_EXCEPTION (FP_EX_OVERFLOW);			\
+		  FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+		}							\
+	    }								\
+	  else								\
+	    {								\
+	      /* We've got a denormalized number.  */			\
+	      int _FP_PACK_CANONICAL_is_tiny = 1;			\
+	      if (_FP_TININESS_AFTER_ROUNDING && X##_e == 0)		\
+		{							\
+		  FP_DECL_##fs (_FP_PACK_CANONICAL_T);			\
+		  _FP_FRAC_COPY_##wc (_FP_PACK_CANONICAL_T, X);		\
+		  _FP_PACK_CANONICAL_T##_s = X##_s;			\
+		  _FP_PACK_CANONICAL_T##_e = X##_e;			\
+		  _FP_ROUND (wc, _FP_PACK_CANONICAL_T);			\
+		  if (_FP_FRAC_OVERP_##wc (fs, _FP_PACK_CANONICAL_T))	\
+		    _FP_PACK_CANONICAL_is_tiny = 0;			\
+		}							\
+	      X##_e = -X##_e + 1;					\
+	      if (X##_e <= _FP_WFRACBITS_##fs)				\
+		{							\
+		  _FP_FRAC_SRS_##wc (X, X##_e, _FP_WFRACBITS_##fs);	\
+		  _FP_ROUND (wc, X);					\
+		  if (_FP_FRAC_HIGH_##fs (X)				\
+		      & (_FP_OVERFLOW_##fs >> 1))			\
+		    {							\
+		      X##_e = 1;					\
+		      _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);		\
+		      FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+		    }							\
+		  else							\
+		    {							\
+		      X##_e = 0;					\
+		      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);		\
+		    }							\
+		  if (_FP_PACK_CANONICAL_is_tiny			\
+		      && ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT)		\
+			  || (FP_TRAPPING_EXCEPTIONS			\
+			      & FP_EX_UNDERFLOW)))			\
+		    FP_SET_EXCEPTION (FP_EX_UNDERFLOW);			\
+		}							\
+	      else							\
+		{							\
+		  /* Underflow to zero.  */				\
+		  X##_e = 0;						\
+		  if (!_FP_FRAC_ZEROP_##wc (X))				\
+		    {							\
+		      _FP_FRAC_SET_##wc (X, _FP_MINFRAC_##wc);		\
+		      _FP_ROUND (wc, X);				\
+		      _FP_FRAC_LOW_##wc (X) >>= (_FP_WORKBITS);		\
+		    }							\
+		  FP_SET_EXCEPTION (FP_EX_UNDERFLOW);			\
+		}							\
+	    }								\
+	  break;							\
+									\
+	case FP_CLS_ZERO:						\
+	  X##_e = 0;							\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);			\
+	  break;							\
+									\
+	case FP_CLS_INF:						\
+	  X##_e = _FP_EXPMAX_##fs;					\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);			\
+	  break;							\
+									\
+	case FP_CLS_NAN:						\
+	  X##_e = _FP_EXPMAX_##fs;					\
+	  if (!_FP_KEEPNANFRACP)					\
+	    {								\
+	      _FP_FRAC_SET_##wc (X, _FP_NANFRAC_##fs);			\
+	      X##_s = _FP_NANSIGN_##fs;					\
+	    }								\
+	  else								\
+	    _FP_SETQNAN (fs, wc, X);					\
+	  break;							\
+	}								\
+    }									\
+  while (0)
 
 /* This one accepts raw argument and not cooked,  returns
- * 1 if X is a signaling NaN.
- */
-#define _FP_ISSIGNAN(fs, wc, X)					\
-({								\
-  int __ret = 0;						\
-  if (X##_e == _FP_EXPMAX_##fs)					\
+   1 if X is a signaling NaN.  */
+#define _FP_ISSIGNAN(fs, wc, X)			\
+  ({						\
+    int _FP_ISSIGNAN_ret = 0;			\
+    if (X##_e == _FP_EXPMAX_##fs)		\
+      {						\
+	if (!_FP_FRAC_ZEROP_##wc (X)		\
+	    && _FP_FRAC_SNANP (fs, X))		\
+	  _FP_ISSIGNAN_ret = 1;			\
+      }						\
+    _FP_ISSIGNAN_ret;				\
+  })
+
+
+
+
+
+/* Addition on semi-raw values.  */
+#define _FP_ADD_INTERNAL(fs, wc, R, X, Y, OP)				\
+  do									\
+    {									\
+      _FP_CHECK_FLUSH_ZERO (fs, wc, X);					\
+      _FP_CHECK_FLUSH_ZERO (fs, wc, Y);					\
+      if (X##_s == Y##_s)						\
+	{								\
+	  /* Addition.  */						\
+	  __label__ add1, add2, add3, add_done;				\
+	  R##_s = X##_s;						\
+	  int _FP_ADD_INTERNAL_ediff = X##_e - Y##_e;			\
+	  if (_FP_ADD_INTERNAL_ediff > 0)				\
+	    {								\
+	      R##_e = X##_e;						\
+	      if (Y##_e == 0)						\
+		{							\
+		  /* Y is zero or denormalized.  */			\
+		  if (_FP_FRAC_ZEROP_##wc (Y))				\
+		    {							\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+		      _FP_FRAC_COPY_##wc (R, X);			\
+		      goto add_done;					\
+		    }							\
+		  else							\
+		    {							\
+		      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		      _FP_ADD_INTERNAL_ediff--;				\
+		      if (_FP_ADD_INTERNAL_ediff == 0)			\
+			{						\
+			  _FP_FRAC_ADD_##wc (R, X, Y);			\
+			  goto add3;					\
+			}						\
+		      if (X##_e == _FP_EXPMAX_##fs)			\
+			{						\
+			  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+			  _FP_FRAC_COPY_##wc (R, X);			\
+			  goto add_done;				\
+			}						\
+		      goto add1;					\
+		    }							\
+		}							\
+	      else if (X##_e == _FP_EXPMAX_##fs)			\
+		{							\
+		  /* X is NaN or Inf, Y is normal.  */			\
+		  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);			\
+		  _FP_FRAC_COPY_##wc (R, X);				\
+		  goto add_done;					\
+		}							\
+									\
+	      /* Insert implicit MSB of Y.  */				\
+	      _FP_FRAC_HIGH_##fs (Y) |= _FP_IMPLBIT_SH_##fs;		\
+									\
+	    add1:							\
+	      /* Shift the mantissa of Y to the right			\
+		 _FP_ADD_INTERNAL_EDIFF steps; remember to account	\
+		 later for the implicit MSB of X.  */			\
+	      if (_FP_ADD_INTERNAL_ediff <= _FP_WFRACBITS_##fs)		\
+		_FP_FRAC_SRS_##wc (Y, _FP_ADD_INTERNAL_ediff,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (!_FP_FRAC_ZEROP_##wc (Y))			\
+		_FP_FRAC_SET_##wc (Y, _FP_MINFRAC_##wc);		\
+	      _FP_FRAC_ADD_##wc (R, X, Y);				\
+	    }								\
+	  else if (_FP_ADD_INTERNAL_ediff < 0)				\
+	    {								\
+	      _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff;		\
+	      R##_e = Y##_e;						\
+	      if (X##_e == 0)						\
+		{							\
+		  /* X is zero or denormalized.  */			\
+		  if (_FP_FRAC_ZEROP_##wc (X))				\
+		    {							\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+		      _FP_FRAC_COPY_##wc (R, Y);			\
+		      goto add_done;					\
+		    }							\
+		  else							\
+		    {							\
+		      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		      _FP_ADD_INTERNAL_ediff--;				\
+		      if (_FP_ADD_INTERNAL_ediff == 0)			\
+			{						\
+			  _FP_FRAC_ADD_##wc (R, Y, X);			\
+			  goto add3;					\
+			}						\
+		      if (Y##_e == _FP_EXPMAX_##fs)			\
+			{						\
+			  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+			  _FP_FRAC_COPY_##wc (R, Y);			\
+			  goto add_done;				\
+			}						\
+		      goto add2;					\
+		    }							\
+		}							\
+	      else if (Y##_e == _FP_EXPMAX_##fs)			\
+		{							\
+		  /* Y is NaN or Inf, X is normal.  */			\
+		  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);			\
+		  _FP_FRAC_COPY_##wc (R, Y);				\
+		  goto add_done;					\
+		}							\
+									\
+	      /* Insert implicit MSB of X.  */				\
+	      _FP_FRAC_HIGH_##fs (X) |= _FP_IMPLBIT_SH_##fs;		\
+									\
+	    add2:							\
+	      /* Shift the mantissa of X to the right			\
+		 _FP_ADD_INTERNAL_EDIFF steps; remember to account	\
+		 later for the implicit MSB of Y.  */			\
+	      if (_FP_ADD_INTERNAL_ediff <= _FP_WFRACBITS_##fs)		\
+		_FP_FRAC_SRS_##wc (X, _FP_ADD_INTERNAL_ediff,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (!_FP_FRAC_ZEROP_##wc (X))			\
+		_FP_FRAC_SET_##wc (X, _FP_MINFRAC_##wc);		\
+	      _FP_FRAC_ADD_##wc (R, Y, X);				\
+	    }								\
+	  else								\
+	    {								\
+	      /* _FP_ADD_INTERNAL_ediff == 0.  */			\
+	      if (!_FP_EXP_NORMAL (fs, wc, X))				\
+		{							\
+		  if (X##_e == 0)					\
+		    {							\
+		      /* X and Y are zero or denormalized.  */		\
+		      R##_e = 0;					\
+		      if (_FP_FRAC_ZEROP_##wc (X))			\
+			{						\
+			  if (!_FP_FRAC_ZEROP_##wc (Y))			\
+			    FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_COPY_##wc (R, Y);			\
+			  goto add_done;				\
+			}						\
+		      else if (_FP_FRAC_ZEROP_##wc (Y))			\
+			{						\
+			  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_COPY_##wc (R, X);			\
+			  goto add_done;				\
+			}						\
+		      else						\
+			{						\
+			  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_ADD_##wc (R, X, Y);			\
+			  if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs) \
+			    {						\
+			      /* Normalized result.  */			\
+			      _FP_FRAC_HIGH_##fs (R)			\
+				&= ~(_FP_W_TYPE) _FP_IMPLBIT_SH_##fs;	\
+			      R##_e = 1;				\
+			    }						\
+			  goto add_done;				\
+			}						\
+		    }							\
+		  else							\
+		    {							\
+		      /* X and Y are NaN or Inf.  */			\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+		      R##_e = _FP_EXPMAX_##fs;				\
+		      if (_FP_FRAC_ZEROP_##wc (X))			\
+			_FP_FRAC_COPY_##wc (R, Y);			\
+		      else if (_FP_FRAC_ZEROP_##wc (Y))			\
+			_FP_FRAC_COPY_##wc (R, X);			\
+		      else						\
+			_FP_CHOOSENAN_SEMIRAW (fs, wc, R, X, Y, OP);	\
+		      goto add_done;					\
+		    }							\
+		}							\
+	      /* The exponents of X and Y, both normal, are equal.  The	\
+		 implicit MSBs will always add to increase the		\
+		 exponent.  */						\
+	      _FP_FRAC_ADD_##wc (R, X, Y);				\
+	      R##_e = X##_e + 1;					\
+	      _FP_FRAC_SRS_##wc (R, 1, _FP_WFRACBITS_##fs);		\
+	      if (R##_e == _FP_EXPMAX_##fs)				\
+		/* Overflow to infinity (depending on rounding mode).  */ \
+		_FP_OVERFLOW_SEMIRAW (fs, wc, R);			\
+	      goto add_done;						\
+	    }								\
+	add3:								\
+	  if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs)		\
+	    {								\
+	      /* Overflow.  */						\
+	      _FP_FRAC_HIGH_##fs (R) &= ~(_FP_W_TYPE) _FP_IMPLBIT_SH_##fs; \
+	      R##_e++;							\
+	      _FP_FRAC_SRS_##wc (R, 1, _FP_WFRACBITS_##fs);		\
+	      if (R##_e == _FP_EXPMAX_##fs)				\
+		/* Overflow to infinity (depending on rounding mode).  */ \
+		_FP_OVERFLOW_SEMIRAW (fs, wc, R);			\
+	    }								\
+	add_done: ;							\
+	}								\
+      else								\
+	{								\
+	  /* Subtraction.  */						\
+	  __label__ sub1, sub2, sub3, norm, sub_done;			\
+	  int _FP_ADD_INTERNAL_ediff = X##_e - Y##_e;			\
+	  if (_FP_ADD_INTERNAL_ediff > 0)				\
+	    {								\
+	      R##_e = X##_e;						\
+	      R##_s = X##_s;						\
+	      if (Y##_e == 0)						\
+		{							\
+		  /* Y is zero or denormalized.  */			\
+		  if (_FP_FRAC_ZEROP_##wc (Y))				\
+		    {							\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+		      _FP_FRAC_COPY_##wc (R, X);			\
+		      goto sub_done;					\
+		    }							\
+		  else							\
+		    {							\
+		      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		      _FP_ADD_INTERNAL_ediff--;				\
+		      if (_FP_ADD_INTERNAL_ediff == 0)			\
+			{						\
+			  _FP_FRAC_SUB_##wc (R, X, Y);			\
+			  goto sub3;					\
+			}						\
+		      if (X##_e == _FP_EXPMAX_##fs)			\
+			{						\
+			  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+			  _FP_FRAC_COPY_##wc (R, X);			\
+			  goto sub_done;				\
+			}						\
+		      goto sub1;					\
+		    }							\
+		}							\
+	      else if (X##_e == _FP_EXPMAX_##fs)			\
+		{							\
+		  /* X is NaN or Inf, Y is normal.  */			\
+		  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);			\
+		  _FP_FRAC_COPY_##wc (R, X);				\
+		  goto sub_done;					\
+		}							\
+									\
+	      /* Insert implicit MSB of Y.  */				\
+	      _FP_FRAC_HIGH_##fs (Y) |= _FP_IMPLBIT_SH_##fs;		\
+									\
+	    sub1:							\
+	      /* Shift the mantissa of Y to the right			\
+		 _FP_ADD_INTERNAL_EDIFF steps; remember to account	\
+		 later for the implicit MSB of X.  */			\
+	      if (_FP_ADD_INTERNAL_ediff <= _FP_WFRACBITS_##fs)		\
+		_FP_FRAC_SRS_##wc (Y, _FP_ADD_INTERNAL_ediff,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (!_FP_FRAC_ZEROP_##wc (Y))			\
+		_FP_FRAC_SET_##wc (Y, _FP_MINFRAC_##wc);		\
+	      _FP_FRAC_SUB_##wc (R, X, Y);				\
+	    }								\
+	  else if (_FP_ADD_INTERNAL_ediff < 0)				\
+	    {								\
+	      _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff;		\
+	      R##_e = Y##_e;						\
+	      R##_s = Y##_s;						\
+	      if (X##_e == 0)						\
+		{							\
+		  /* X is zero or denormalized.  */			\
+		  if (_FP_FRAC_ZEROP_##wc (X))				\
+		    {							\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+		      _FP_FRAC_COPY_##wc (R, Y);			\
+		      goto sub_done;					\
+		    }							\
+		  else							\
+		    {							\
+		      FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		      _FP_ADD_INTERNAL_ediff--;				\
+		      if (_FP_ADD_INTERNAL_ediff == 0)			\
+			{						\
+			  _FP_FRAC_SUB_##wc (R, Y, X);			\
+			  goto sub3;					\
+			}						\
+		      if (Y##_e == _FP_EXPMAX_##fs)			\
+			{						\
+			  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+			  _FP_FRAC_COPY_##wc (R, Y);			\
+			  goto sub_done;				\
+			}						\
+		      goto sub2;					\
+		    }							\
+		}							\
+	      else if (Y##_e == _FP_EXPMAX_##fs)			\
+		{							\
+		  /* Y is NaN or Inf, X is normal.  */			\
+		  _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);			\
+		  _FP_FRAC_COPY_##wc (R, Y);				\
+		  goto sub_done;					\
+		}							\
+									\
+	      /* Insert implicit MSB of X.  */				\
+	      _FP_FRAC_HIGH_##fs (X) |= _FP_IMPLBIT_SH_##fs;		\
+									\
+	    sub2:							\
+	      /* Shift the mantissa of X to the right			\
+		 _FP_ADD_INTERNAL_EDIFF steps; remember to account	\
+		 later for the implicit MSB of Y.  */			\
+	      if (_FP_ADD_INTERNAL_ediff <= _FP_WFRACBITS_##fs)		\
+		_FP_FRAC_SRS_##wc (X, _FP_ADD_INTERNAL_ediff,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (!_FP_FRAC_ZEROP_##wc (X))			\
+		_FP_FRAC_SET_##wc (X, _FP_MINFRAC_##wc);		\
+	      _FP_FRAC_SUB_##wc (R, Y, X);				\
+	    }								\
+	  else								\
+	    {								\
+	      /* ediff == 0.  */					\
+	      if (!_FP_EXP_NORMAL (fs, wc, X))				\
+		{							\
+		  if (X##_e == 0)					\
+		    {							\
+		      /* X and Y are zero or denormalized.  */		\
+		      R##_e = 0;					\
+		      if (_FP_FRAC_ZEROP_##wc (X))			\
+			{						\
+			  _FP_FRAC_COPY_##wc (R, Y);			\
+			  if (_FP_FRAC_ZEROP_##wc (Y))			\
+			    R##_s = (FP_ROUNDMODE == FP_RND_MINF);	\
+			  else						\
+			    {						\
+			      FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			      R##_s = Y##_s;				\
+			    }						\
+			  goto sub_done;				\
+			}						\
+		      else if (_FP_FRAC_ZEROP_##wc (Y))			\
+			{						\
+			  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_COPY_##wc (R, X);			\
+			  R##_s = X##_s;				\
+			  goto sub_done;				\
+			}						\
+		      else						\
+			{						\
+			  FP_SET_EXCEPTION (FP_EX_DENORM);		\
+			  _FP_FRAC_SUB_##wc (R, X, Y);			\
+			  R##_s = X##_s;				\
+			  if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs) \
+			    {						\
+			      /* |X| < |Y|, negate result.  */		\
+			      _FP_FRAC_SUB_##wc (R, Y, X);		\
+			      R##_s = Y##_s;				\
+			    }						\
+			  else if (_FP_FRAC_ZEROP_##wc (R))		\
+			    R##_s = (FP_ROUNDMODE == FP_RND_MINF);	\
+			  goto sub_done;				\
+			}						\
+		    }							\
+		  else							\
+		    {							\
+		      /* X and Y are NaN or Inf, of opposite signs.  */	\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, X);		\
+		      _FP_CHECK_SIGNAN_SEMIRAW (fs, wc, Y);		\
+		      R##_e = _FP_EXPMAX_##fs;				\
+		      if (_FP_FRAC_ZEROP_##wc (X))			\
+			{						\
+			  if (_FP_FRAC_ZEROP_##wc (Y))			\
+			    {						\
+			      /* Inf - Inf.  */				\
+			      R##_s = _FP_NANSIGN_##fs;			\
+			      _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);	\
+			      _FP_FRAC_SLL_##wc (R, _FP_WORKBITS);	\
+			      FP_SET_EXCEPTION (FP_EX_INVALID		\
+						| FP_EX_INVALID_ISI);	\
+			    }						\
+			  else						\
+			    {						\
+			      /* Inf - NaN.  */				\
+			      R##_s = Y##_s;				\
+			      _FP_FRAC_COPY_##wc (R, Y);		\
+			    }						\
+			}						\
+		      else						\
+			{						\
+			  if (_FP_FRAC_ZEROP_##wc (Y))			\
+			    {						\
+			      /* NaN - Inf.  */				\
+			      R##_s = X##_s;				\
+			      _FP_FRAC_COPY_##wc (R, X);		\
+			    }						\
+			  else						\
+			    {						\
+			      /* NaN - NaN.  */				\
+			      _FP_CHOOSENAN_SEMIRAW (fs, wc, R, X, Y, OP); \
+			    }						\
+			}						\
+		      goto sub_done;					\
+		    }							\
+		}							\
+	      /* The exponents of X and Y, both normal, are equal.  The	\
+		 implicit MSBs cancel.  */				\
+	      R##_e = X##_e;						\
+	      _FP_FRAC_SUB_##wc (R, X, Y);				\
+	      R##_s = X##_s;						\
+	      if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs)		\
+		{							\
+		  /* |X| < |Y|, negate result.  */			\
+		  _FP_FRAC_SUB_##wc (R, Y, X);				\
+		  R##_s = Y##_s;					\
+		}							\
+	      else if (_FP_FRAC_ZEROP_##wc (R))				\
+		{							\
+		  R##_e = 0;						\
+		  R##_s = (FP_ROUNDMODE == FP_RND_MINF);		\
+		  goto sub_done;					\
+		}							\
+	      goto norm;						\
+	    }								\
+	sub3:								\
+	  if (_FP_FRAC_HIGH_##fs (R) & _FP_IMPLBIT_SH_##fs)		\
+	    {								\
+	      int _FP_ADD_INTERNAL_diff;				\
+	      /* Carry into most significant bit of larger one of X and Y, \
+		 canceling it; renormalize.  */				\
+	      _FP_FRAC_HIGH_##fs (R) &= _FP_IMPLBIT_SH_##fs - 1;	\
+	    norm:							\
+	      _FP_FRAC_CLZ_##wc (_FP_ADD_INTERNAL_diff, R);		\
+	      _FP_ADD_INTERNAL_diff -= _FP_WFRACXBITS_##fs;		\
+	      _FP_FRAC_SLL_##wc (R, _FP_ADD_INTERNAL_diff);		\
+	      if (R##_e <= _FP_ADD_INTERNAL_diff)			\
+		{							\
+		  /* R is denormalized.  */				\
+		  _FP_ADD_INTERNAL_diff					\
+		    = _FP_ADD_INTERNAL_diff - R##_e + 1;		\
+		  _FP_FRAC_SRS_##wc (R, _FP_ADD_INTERNAL_diff,		\
+				     _FP_WFRACBITS_##fs);		\
+		  R##_e = 0;						\
+		}							\
+	      else							\
+		{							\
+		  R##_e -= _FP_ADD_INTERNAL_diff;			\
+		  _FP_FRAC_HIGH_##fs (R) &= ~(_FP_W_TYPE) _FP_IMPLBIT_SH_##fs; \
+		}							\
+	    }								\
+	sub_done: ;							\
+	}								\
+    }									\
+  while (0)
+
+#define _FP_ADD(fs, wc, R, X, Y) _FP_ADD_INTERNAL (fs, wc, R, X, Y, '+')
+#define _FP_SUB(fs, wc, R, X, Y)					\
+  do									\
+    {									\
+      if (!(Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (Y)))	\
+	Y##_s ^= 1;							\
+      _FP_ADD_INTERNAL (fs, wc, R, X, Y, '-');				\
+    }									\
+  while (0)
+
+
+/* Main negation routine.  The input value is raw.  */
+
+#define _FP_NEG(fs, wc, R, X)			\
+  do						\
+    {						\
+      _FP_FRAC_COPY_##wc (R, X);		\
+      R##_e = X##_e;				\
+      R##_s = 1 ^ X##_s;			\
+    }						\
+  while (0)
+
+
+/* Main multiplication routine.  The input values should be cooked.  */
+
+#define _FP_MUL(fs, wc, R, X, Y)				\
+  do								\
+    {								\
+      R##_s = X##_s ^ Y##_s;					\
+      R##_e = X##_e + Y##_e + 1;				\
+      switch (_FP_CLS_COMBINE (X##_c, Y##_c))			\
+	{							\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NORMAL):	\
+	  R##_c = FP_CLS_NORMAL;				\
+								\
+	  _FP_MUL_MEAT_##fs (R, X, Y);				\
+								\
+	  if (_FP_FRAC_OVERP_##wc (fs, R))			\
+	    _FP_FRAC_SRS_##wc (R, 1, _FP_WFRACBITS_##fs);	\
+	  else							\
+	    R##_e--;						\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NAN):		\
+	  _FP_CHOOSENAN (fs, wc, R, X, Y, '*');			\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NORMAL):	\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO):		\
+	  R##_s = X##_s;					\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL):	\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NORMAL):	\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_ZERO):	\
+	  _FP_FRAC_COPY_##wc (R, X);				\
+	  R##_c = X##_c;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NAN):	\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN):		\
+	  R##_s = Y##_s;					\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_INF):	\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_ZERO):	\
+	  _FP_FRAC_COPY_##wc (R, Y);				\
+	  R##_c = Y##_c;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_INF):		\
+	  R##_s = _FP_NANSIGN_##fs;				\
+	  R##_c = FP_CLS_NAN;					\
+	  _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);		\
+	  FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_IMZ);	\
+	  break;						\
+								\
+	default:						\
+	  abort ();						\
+	}							\
+    }								\
+  while (0)
+
+
+/* Fused multiply-add.  The input values should be cooked.  */
+
+#define _FP_FMA(fs, wc, dwc, R, X, Y, Z)				\
+  do									\
+    {									\
+      __label__ done_fma;						\
+      FP_DECL_##fs (_FP_FMA_T);						\
+      _FP_FMA_T##_s = X##_s ^ Y##_s;					\
+      _FP_FMA_T##_e = X##_e + Y##_e + 1;				\
+      switch (_FP_CLS_COMBINE (X##_c, Y##_c))				\
+	{								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NORMAL):		\
+	  switch (Z##_c)						\
+	    {								\
+	    case FP_CLS_INF:						\
+	    case FP_CLS_NAN:						\
+	      R##_s = Z##_s;						\
+	      _FP_FRAC_COPY_##wc (R, Z);				\
+	      R##_c = Z##_c;						\
+	      break;							\
+									\
+	    case FP_CLS_ZERO:						\
+	      R##_c = FP_CLS_NORMAL;					\
+	      R##_s = _FP_FMA_T##_s;					\
+	      R##_e = _FP_FMA_T##_e;					\
+									\
+	      _FP_MUL_MEAT_##fs (R, X, Y);				\
+									\
+	      if (_FP_FRAC_OVERP_##wc (fs, R))				\
+		_FP_FRAC_SRS_##wc (R, 1, _FP_WFRACBITS_##fs);		\
+	      else							\
+		R##_e--;						\
+	      break;							\
+									\
+	    case FP_CLS_NORMAL:;					\
+	      _FP_FRAC_DECL_##dwc (_FP_FMA_TD);				\
+	      _FP_FRAC_DECL_##dwc (_FP_FMA_ZD);				\
+	      _FP_FRAC_DECL_##dwc (_FP_FMA_RD);				\
+	      _FP_MUL_MEAT_DW_##fs (_FP_FMA_TD, X, Y);			\
+	      R##_e = _FP_FMA_T##_e;					\
+	      int _FP_FMA_tsh						\
+		= _FP_FRAC_HIGHBIT_DW_##dwc (fs, _FP_FMA_TD) == 0;	\
+	      _FP_FMA_T##_e -= _FP_FMA_tsh;				\
+	      int _FP_FMA_ediff = _FP_FMA_T##_e - Z##_e;		\
+	      if (_FP_FMA_ediff >= 0)					\
+		{							\
+		  int _FP_FMA_shift					\
+		    = _FP_WFRACBITS_##fs - _FP_FMA_tsh - _FP_FMA_ediff;	\
+		  if (_FP_FMA_shift <= -_FP_WFRACBITS_##fs)		\
+		    _FP_FRAC_SET_##dwc (_FP_FMA_ZD, _FP_MINFRAC_##dwc);	\
+		  else							\
+		    {							\
+		      _FP_FRAC_COPY_##dwc##_##wc (_FP_FMA_ZD, Z);	\
+		      if (_FP_FMA_shift < 0)				\
+			_FP_FRAC_SRS_##dwc (_FP_FMA_ZD, -_FP_FMA_shift,	\
+					    _FP_WFRACBITS_DW_##fs);	\
+		      else if (_FP_FMA_shift > 0)			\
+			_FP_FRAC_SLL_##dwc (_FP_FMA_ZD, _FP_FMA_shift);	\
+		    }							\
+		  R##_s = _FP_FMA_T##_s;				\
+		  if (_FP_FMA_T##_s == Z##_s)				\
+		    _FP_FRAC_ADD_##dwc (_FP_FMA_RD, _FP_FMA_TD,		\
+					_FP_FMA_ZD);			\
+		  else							\
+		    {							\
+		      _FP_FRAC_SUB_##dwc (_FP_FMA_RD, _FP_FMA_TD,	\
+					  _FP_FMA_ZD);			\
+		      if (_FP_FRAC_NEGP_##dwc (_FP_FMA_RD))		\
+			{						\
+			  R##_s = Z##_s;				\
+			  _FP_FRAC_SUB_##dwc (_FP_FMA_RD, _FP_FMA_ZD,	\
+					      _FP_FMA_TD);		\
+			}						\
+		    }							\
+		}							\
+	      else							\
+		{							\
+		  R##_e = Z##_e;					\
+		  R##_s = Z##_s;					\
+		  _FP_FRAC_COPY_##dwc##_##wc (_FP_FMA_ZD, Z);		\
+		  _FP_FRAC_SLL_##dwc (_FP_FMA_ZD, _FP_WFRACBITS_##fs);	\
+		  int _FP_FMA_shift = -_FP_FMA_ediff - _FP_FMA_tsh;	\
+		  if (_FP_FMA_shift >= _FP_WFRACBITS_DW_##fs)		\
+		    _FP_FRAC_SET_##dwc (_FP_FMA_TD, _FP_MINFRAC_##dwc);	\
+		  else if (_FP_FMA_shift > 0)				\
+		    _FP_FRAC_SRS_##dwc (_FP_FMA_TD, _FP_FMA_shift,	\
+					_FP_WFRACBITS_DW_##fs);		\
+		  if (Z##_s == _FP_FMA_T##_s)				\
+		    _FP_FRAC_ADD_##dwc (_FP_FMA_RD, _FP_FMA_ZD,		\
+					_FP_FMA_TD);			\
+		  else							\
+		    _FP_FRAC_SUB_##dwc (_FP_FMA_RD, _FP_FMA_ZD,		\
+					_FP_FMA_TD);			\
+		}							\
+	      if (_FP_FRAC_ZEROP_##dwc (_FP_FMA_RD))			\
+		{							\
+		  if (_FP_FMA_T##_s == Z##_s)				\
+		    R##_s = Z##_s;					\
+		  else							\
+		    R##_s = (FP_ROUNDMODE == FP_RND_MINF);		\
+		  _FP_FRAC_SET_##wc (R, _FP_ZEROFRAC_##wc);		\
+		  R##_c = FP_CLS_ZERO;					\
+		}							\
+	      else							\
+		{							\
+		  int _FP_FMA_rlz;					\
+		  _FP_FRAC_CLZ_##dwc (_FP_FMA_rlz, _FP_FMA_RD);		\
+		  _FP_FMA_rlz -= _FP_WFRACXBITS_DW_##fs;		\
+		  R##_e -= _FP_FMA_rlz;					\
+		  int _FP_FMA_shift = _FP_WFRACBITS_##fs - _FP_FMA_rlz;	\
+		  if (_FP_FMA_shift > 0)				\
+		    _FP_FRAC_SRS_##dwc (_FP_FMA_RD, _FP_FMA_shift,	\
+					_FP_WFRACBITS_DW_##fs);		\
+		  else if (_FP_FMA_shift < 0)				\
+		    _FP_FRAC_SLL_##dwc (_FP_FMA_RD, -_FP_FMA_shift);	\
+		  _FP_FRAC_COPY_##wc##_##dwc (R, _FP_FMA_RD);		\
+		  R##_c = FP_CLS_NORMAL;				\
+		}							\
+	      break;							\
+	    }								\
+	  goto done_fma;						\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NAN):			\
+	  _FP_CHOOSENAN (fs, wc, _FP_FMA_T, X, Y, '*');			\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF):			\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO):			\
+	  _FP_FMA_T##_s = X##_s;					\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF):			\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_ZERO):		\
+	  _FP_FRAC_COPY_##wc (_FP_FMA_T, X);				\
+	  _FP_FMA_T##_c = X##_c;					\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NAN):		\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN):			\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN):			\
+	  _FP_FMA_T##_s = Y##_s;					\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_ZERO):		\
+	  _FP_FRAC_COPY_##wc (_FP_FMA_T, Y);				\
+	  _FP_FMA_T##_c = Y##_c;					\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO):			\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_INF):			\
+	  _FP_FMA_T##_s = _FP_NANSIGN_##fs;				\
+	  _FP_FMA_T##_c = FP_CLS_NAN;					\
+	  _FP_FRAC_SET_##wc (_FP_FMA_T, _FP_NANFRAC_##fs);		\
+	  FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_IMZ_FMA);	\
+	  break;							\
+									\
+	default:							\
+	  abort ();							\
+	}								\
+									\
+      /* T = X * Y is zero, infinity or NaN.  */			\
+      switch (_FP_CLS_COMBINE (_FP_FMA_T##_c, Z##_c))			\
+	{								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NAN):			\
+	  _FP_CHOOSENAN (fs, wc, R, _FP_FMA_T, Z, '+');			\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF):			\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO):			\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO):			\
+	  R##_s = _FP_FMA_T##_s;					\
+	  _FP_FRAC_COPY_##wc (R, _FP_FMA_T);				\
+	  R##_c = _FP_FMA_T##_c;					\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN):			\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN):			\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NORMAL):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_INF):			\
+	  R##_s = Z##_s;						\
+	  _FP_FRAC_COPY_##wc (R, Z);					\
+	  R##_c = Z##_c;						\
+	  R##_e = Z##_e;						\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF):			\
+	  if (_FP_FMA_T##_s == Z##_s)					\
+	    {								\
+	      R##_s = Z##_s;						\
+	      _FP_FRAC_COPY_##wc (R, Z);				\
+	      R##_c = Z##_c;						\
+	    }								\
+	  else								\
+	    {								\
+	      R##_s = _FP_NANSIGN_##fs;					\
+	      R##_c = FP_CLS_NAN;					\
+	      _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);			\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_ISI);	\
+	    }								\
+	  break;							\
+									\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_ZERO):		\
+	  if (_FP_FMA_T##_s == Z##_s)					\
+	    R##_s = Z##_s;						\
+	  else								\
+	    R##_s = (FP_ROUNDMODE == FP_RND_MINF);			\
+	  _FP_FRAC_COPY_##wc (R, Z);					\
+	  R##_c = Z##_c;						\
+	  break;							\
+									\
+	default:							\
+	  abort ();							\
+	}								\
+    done_fma: ;								\
+    }									\
+  while (0)
+
+
+/* Main division routine.  The input values should be cooked.  */
+
+#define _FP_DIV(fs, wc, R, X, Y)				\
+  do								\
     {								\
-      if (!_FP_FRAC_ZEROP_##wc(X)				\
-	  && !(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs))	\
-	__ret = 1;						\
+      R##_s = X##_s ^ Y##_s;					\
+      R##_e = X##_e - Y##_e;					\
+      switch (_FP_CLS_COMBINE (X##_c, Y##_c))			\
+	{							\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NORMAL):	\
+	  R##_c = FP_CLS_NORMAL;				\
+								\
+	  _FP_DIV_MEAT_##fs (R, X, Y);				\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NAN):		\
+	  _FP_CHOOSENAN (fs, wc, R, X, Y, '/');			\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NORMAL):	\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO):		\
+	  R##_s = X##_s;					\
+	  _FP_FRAC_COPY_##wc (R, X);				\
+	  R##_c = X##_c;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_NAN):	\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN):		\
+	  R##_s = Y##_s;					\
+	  _FP_FRAC_COPY_##wc (R, Y);				\
+	  R##_c = Y##_c;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_INF):	\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NORMAL):	\
+	  R##_c = FP_CLS_ZERO;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_ZERO):	\
+	  FP_SET_EXCEPTION (FP_EX_DIVZERO);			\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO):		\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL):	\
+	  R##_c = FP_CLS_INF;					\
+	  break;						\
+								\
+	case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF):		\
+	case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_ZERO):	\
+	  R##_s = _FP_NANSIGN_##fs;				\
+	  R##_c = FP_CLS_NAN;					\
+	  _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);		\
+	  FP_SET_EXCEPTION (FP_EX_INVALID			\
+			    | (X##_c == FP_CLS_INF		\
+			       ? FP_EX_INVALID_IDI		\
+			       : FP_EX_INVALID_ZDZ));		\
+	  break;						\
+								\
+	default:						\
+	  abort ();						\
+	}							\
     }								\
-  __ret;							\
-})
-
-
-
-
-
-/*
- * Main addition routine.  The input values should be cooked.
- */
-
-#define _FP_ADD_INTERNAL(fs, wc, R, X, Y, OP)				     \
-do {									     \
-  switch (_FP_CLS_COMBINE(X##_c, Y##_c))				     \
-  {									     \
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL):			     \
-    {									     \
-      /* shift the smaller number so that its exponent matches the larger */ \
-      _FP_I_TYPE diff = X##_e - Y##_e;					     \
-									     \
-      if (diff < 0)							     \
-	{								     \
-	  diff = -diff;							     \
-	  if (diff <= _FP_WFRACBITS_##fs)				     \
-	    _FP_FRAC_SRS_##wc(X, diff, _FP_WFRACBITS_##fs);		     \
-	  else if (!_FP_FRAC_ZEROP_##wc(X))				     \
-	    _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc);			     \
-	  R##_e = Y##_e;						     \
-	}								     \
-      else								     \
-	{								     \
-	  if (diff > 0)							     \
-	    {								     \
-	      if (diff <= _FP_WFRACBITS_##fs)				     \
-	        _FP_FRAC_SRS_##wc(Y, diff, _FP_WFRACBITS_##fs);		     \
-	      else if (!_FP_FRAC_ZEROP_##wc(Y))				     \
-	        _FP_FRAC_SET_##wc(Y, _FP_MINFRAC_##wc);			     \
-	    }								     \
-	  R##_e = X##_e;						     \
-	}								     \
-									     \
-      R##_c = FP_CLS_NORMAL;						     \
-									     \
-      if (X##_s == Y##_s)						     \
-	{								     \
-	  R##_s = X##_s;						     \
-	  _FP_FRAC_ADD_##wc(R, X, Y);					     \
-	  if (_FP_FRAC_OVERP_##wc(fs, R))				     \
-	    {								     \
-	      _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs);		     \
-	      R##_e++;							     \
-	    }								     \
-	}								     \
-      else								     \
-	{								     \
-	  R##_s = X##_s;						     \
-	  _FP_FRAC_SUB_##wc(R, X, Y);					     \
-	  if (_FP_FRAC_ZEROP_##wc(R))					     \
-	    {								     \
-	      /* return an exact zero */				     \
-	      if (FP_ROUNDMODE == FP_RND_MINF)				     \
-		R##_s |= Y##_s;						     \
-	      else							     \
-		R##_s &= Y##_s;						     \
-	      R##_c = FP_CLS_ZERO;					     \
-	    }								     \
-	  else								     \
-	    {								     \
-	      if (_FP_FRAC_NEGP_##wc(R))				     \
-		{							     \
-		  _FP_FRAC_SUB_##wc(R, Y, X);				     \
-		  R##_s = Y##_s;					     \
-		}							     \
-									     \
-	      /* renormalize after subtraction */			     \
-	      _FP_FRAC_CLZ_##wc(diff, R);				     \
-	      diff -= _FP_WFRACXBITS_##fs;				     \
-	      if (diff)							     \
-		{							     \
-		  R##_e -= diff;					     \
-		  _FP_FRAC_SLL_##wc(R, diff);				     \
-		}							     \
-	    }								     \
-	}								     \
-      break;								     \
-    }									     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN):				     \
-    _FP_CHOOSENAN(fs, wc, R, X, Y, OP);					     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO):			     \
-    R##_e = X##_e;							     \
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL):			     \
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF):				     \
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO):				     \
-    _FP_FRAC_COPY_##wc(R, X);						     \
-    R##_s = X##_s;							     \
-    R##_c = X##_c;							     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL):			     \
-    R##_e = Y##_e;							     \
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN):			     \
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN):				     \
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN):				     \
-    _FP_FRAC_COPY_##wc(R, Y);						     \
-    R##_s = Y##_s;							     \
-    R##_c = Y##_c;							     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF):				     \
-    if (X##_s != Y##_s)							     \
-      {									     \
-	/* +INF + -INF => NAN */					     \
-	_FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);				     \
-	R##_s = _FP_NANSIGN_##fs;					     \
-	R##_c = FP_CLS_NAN;						     \
-	FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_ISI);		     \
-	break;								     \
-      }									     \
-    /* FALLTHRU */							     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL):			     \
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO):				     \
-    R##_s = X##_s;							     \
-    R##_c = FP_CLS_INF;							     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF):			     \
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF):				     \
-    R##_s = Y##_s;							     \
-    R##_c = FP_CLS_INF;							     \
-    break;								     \
-									     \
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO):			     \
-    /* make sure the sign is correct */					     \
-    if (FP_ROUNDMODE == FP_RND_MINF)					     \
-      R##_s = X##_s | Y##_s;						     \
-    else								     \
-      R##_s = X##_s & Y##_s;						     \
-    R##_c = FP_CLS_ZERO;						     \
-    break;								     \
-									     \
-  default:								     \
-    abort();								     \
-  }									     \
-} while (0)
-
-#define _FP_ADD(fs, wc, R, X, Y) _FP_ADD_INTERNAL(fs, wc, R, X, Y, '+')
-#define _FP_SUB(fs, wc, R, X, Y)					     \
-  do {									     \
-    if (Y##_c != FP_CLS_NAN) Y##_s ^= 1;				     \
-    _FP_ADD_INTERNAL(fs, wc, R, X, Y, '-');				     \
-  } while (0)
-
-
-/*
- * Main negation routine.  FIXME -- when we care about setting exception
- * bits reliably, this will not do.  We should examine all of the fp classes.
- */
-
-#define _FP_NEG(fs, wc, R, X)		\
-  do {					\
-    _FP_FRAC_COPY_##wc(R, X);		\
-    R##_c = X##_c;			\
-    R##_e = X##_e;			\
-    R##_s = 1 ^ X##_s;			\
-  } while (0)
-
-
-/*
- * Main multiplication routine.  The input values should be cooked.
- */
-
-#define _FP_MUL(fs, wc, R, X, Y)			\
-do {							\
-  R##_s = X##_s ^ Y##_s;				\
-  switch (_FP_CLS_COMBINE(X##_c, Y##_c))		\
-  {							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL):	\
-    R##_c = FP_CLS_NORMAL;				\
-    R##_e = X##_e + Y##_e + 1;				\
-							\
-    _FP_MUL_MEAT_##fs(R,X,Y);				\
-							\
-    if (_FP_FRAC_OVERP_##wc(fs, R))			\
-      _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs);	\
-    else						\
-      R##_e--;						\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN):		\
-    _FP_CHOOSENAN(fs, wc, R, X, Y, '*');		\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL):	\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF):		\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO):		\
-    R##_s = X##_s;					\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF):		\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL):	\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL):	\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO):	\
-    _FP_FRAC_COPY_##wc(R, X);				\
-    R##_c = X##_c;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN):	\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN):		\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN):		\
-    R##_s = Y##_s;					\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF):	\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO):	\
-    _FP_FRAC_COPY_##wc(R, Y);				\
-    R##_c = Y##_c;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO):		\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF):		\
-    R##_s = _FP_NANSIGN_##fs;				\
-    R##_c = FP_CLS_NAN;					\
-    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);		\
-    FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IMZ);\
-    break;						\
-							\
-  default:						\
-    abort();						\
-  }							\
-} while (0)
-
-
-/*
- * Main division routine.  The input values should be cooked.
- */
-
-#define _FP_DIV(fs, wc, R, X, Y)			\
-do {							\
-  R##_s = X##_s ^ Y##_s;				\
-  switch (_FP_CLS_COMBINE(X##_c, Y##_c))		\
-  {							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL):	\
-    R##_c = FP_CLS_NORMAL;				\
-    R##_e = X##_e - Y##_e;				\
-							\
-    _FP_DIV_MEAT_##fs(R,X,Y);				\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN):		\
-    _FP_CHOOSENAN(fs, wc, R, X, Y, '/');		\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL):	\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF):		\
-  case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO):		\
-    R##_s = X##_s;					\
-    _FP_FRAC_COPY_##wc(R, X);				\
-    R##_c = X##_c;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN):	\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN):		\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN):		\
-    R##_s = Y##_s;					\
-    _FP_FRAC_COPY_##wc(R, Y);				\
-    R##_c = Y##_c;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF):	\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF):		\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL):	\
-    R##_c = FP_CLS_ZERO;				\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO):	\
-    FP_SET_EXCEPTION(FP_EX_DIVZERO);			\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO):		\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL):	\
-    R##_c = FP_CLS_INF;					\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF):		\
-    R##_s = _FP_NANSIGN_##fs;				\
-    R##_c = FP_CLS_NAN;					\
-    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);		\
-    FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IDI);\
-    break;						\
-							\
-  case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO):	\
-    R##_s = _FP_NANSIGN_##fs;				\
-    R##_c = FP_CLS_NAN;					\
-    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);		\
-    FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_ZDZ);\
-    break;						\
-							\
-  default:						\
-    abort();						\
-  }							\
-} while (0)
-
-
-/*
- * Main differential comparison routine.  The inputs should be raw not
- * cooked.  The return is -1,0,1 for normal values, 2 otherwise.
- */
-
-#define _FP_CMP(fs, wc, ret, X, Y, un)					\
-  do {									\
-    /* NANs are unordered */						\
-    if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X))		\
-	|| (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y)))	\
-      {									\
-	ret = un;							\
-      }									\
-    else								\
-      {									\
-	int __is_zero_x;						\
-	int __is_zero_y;						\
-									\
-	__is_zero_x = (!X##_e && _FP_FRAC_ZEROP_##wc(X)) ? 1 : 0;	\
-	__is_zero_y = (!Y##_e && _FP_FRAC_ZEROP_##wc(Y)) ? 1 : 0;	\
-									\
-	if (__is_zero_x && __is_zero_y)					\
-		ret = 0;						\
-	else if (__is_zero_x)						\
-		ret = Y##_s ? 1 : -1;					\
-	else if (__is_zero_y)						\
-		ret = X##_s ? -1 : 1;					\
-	else if (X##_s != Y##_s)					\
-	  ret = X##_s ? -1 : 1;						\
-	else if (X##_e > Y##_e)						\
-	  ret = X##_s ? -1 : 1;						\
-	else if (X##_e < Y##_e)						\
-	  ret = X##_s ? 1 : -1;						\
-	else if (_FP_FRAC_GT_##wc(X, Y))				\
-	  ret = X##_s ? -1 : 1;						\
-	else if (_FP_FRAC_GT_##wc(Y, X))				\
-	  ret = X##_s ? 1 : -1;						\
-	else								\
-	  ret = 0;							\
-      }									\
-  } while (0)
+  while (0)
+
+
+/* Helper for comparisons.  EX is 0 not to raise exceptions, 1 to
+   raise exceptions for signaling NaN operands, 2 to raise exceptions
+   for all NaN operands.  Conditionals are organized to allow the
+   compiler to optimize away code based on the value of EX.  */
+
+#define _FP_CMP_CHECK_NAN(fs, wc, X, Y, ex)				\
+  do									\
+    {									\
+      /* The arguments are unordered, which may or may not result in	\
+	 an exception.  */						\
+      if (ex)								\
+	{								\
+	  /* At least some cases of unordered arguments result in	\
+	     exceptions; check whether this is one.  */			\
+	  if (FP_EX_INVALID_SNAN || FP_EX_INVALID_VC)			\
+	    {								\
+	      /* Check separately for each case of "invalid"		\
+		 exceptions.  */					\
+	      if ((ex) == 2)						\
+		FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_VC);	\
+	      if (_FP_ISSIGNAN (fs, wc, X)				\
+		  || _FP_ISSIGNAN (fs, wc, Y))				\
+		FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_SNAN);	\
+	    }								\
+	  /* Otherwise, we only need to check whether to raise an	\
+	     exception, not which case or cases it is.  */		\
+	  else if ((ex) == 2						\
+		   || _FP_ISSIGNAN (fs, wc, X)				\
+		   || _FP_ISSIGNAN (fs, wc, Y))				\
+	    FP_SET_EXCEPTION (FP_EX_INVALID);				\
+	}								\
+    }									\
+  while (0)
+
+/* Helper for comparisons.  If denormal operands would raise an
+   exception, check for them, and flush to zero as appropriate
+   (otherwise, we need only check and flush to zero if it might affect
+   the result, which is done later with _FP_CMP_CHECK_FLUSH_ZERO).  */
+#define _FP_CMP_CHECK_DENORM(fs, wc, X, Y)				\
+  do									\
+    {									\
+      if (FP_EX_DENORM != 0)						\
+	{								\
+	  /* We must ensure the correct exceptions are raised for	\
+	     denormal operands, even though this may not affect the	\
+	     result of the comparison.  */				\
+	  if (FP_DENORM_ZERO)						\
+	    {								\
+	      _FP_CHECK_FLUSH_ZERO (fs, wc, X);				\
+	      _FP_CHECK_FLUSH_ZERO (fs, wc, Y);				\
+	    }								\
+	  else								\
+	    {								\
+	      if ((X##_e == 0 && !_FP_FRAC_ZEROP_##wc (X))		\
+		  || (Y##_e == 0 && !_FP_FRAC_ZEROP_##wc (Y)))		\
+		FP_SET_EXCEPTION (FP_EX_DENORM);			\
+	    }								\
+	}								\
+    }									\
+  while (0)
+
+/* Helper for comparisons.  Check for flushing denormals for zero if
+   we didn't need to check earlier for any denormal operands.  */
+#define _FP_CMP_CHECK_FLUSH_ZERO(fs, wc, X, Y)	\
+  do						\
+    {						\
+      if (FP_EX_DENORM == 0)			\
+	{					\
+	  _FP_CHECK_FLUSH_ZERO (fs, wc, X);	\
+	  _FP_CHECK_FLUSH_ZERO (fs, wc, Y);	\
+	}					\
+    }						\
+  while (0)
+
+/* Main differential comparison routine.  The inputs should be raw not
+   cooked.  The return is -1, 0, 1 for normal values, UN
+   otherwise.  */
+
+#define _FP_CMP(fs, wc, ret, X, Y, un, ex)				\
+  do									\
+    {									\
+      _FP_CMP_CHECK_DENORM (fs, wc, X, Y);				\
+      /* NANs are unordered.  */					\
+      if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (X))	\
+	  || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (Y)))	\
+	{								\
+	  (ret) = (un);							\
+	  _FP_CMP_CHECK_NAN (fs, wc, X, Y, (ex));			\
+	}								\
+      else								\
+	{								\
+	  int _FP_CMP_is_zero_x;					\
+	  int _FP_CMP_is_zero_y;					\
+									\
+	  _FP_CMP_CHECK_FLUSH_ZERO (fs, wc, X, Y);			\
+									\
+	  _FP_CMP_is_zero_x						\
+	    = (!X##_e && _FP_FRAC_ZEROP_##wc (X)) ? 1 : 0;		\
+	  _FP_CMP_is_zero_y						\
+	    = (!Y##_e && _FP_FRAC_ZEROP_##wc (Y)) ? 1 : 0;		\
+									\
+	  if (_FP_CMP_is_zero_x && _FP_CMP_is_zero_y)			\
+	    (ret) = 0;							\
+	  else if (_FP_CMP_is_zero_x)					\
+	    (ret) = Y##_s ? 1 : -1;					\
+	  else if (_FP_CMP_is_zero_y)					\
+	    (ret) = X##_s ? -1 : 1;					\
+	  else if (X##_s != Y##_s)					\
+	    (ret) = X##_s ? -1 : 1;					\
+	  else if (X##_e > Y##_e)					\
+	    (ret) = X##_s ? -1 : 1;					\
+	  else if (X##_e < Y##_e)					\
+	    (ret) = X##_s ? 1 : -1;					\
+	  else if (_FP_FRAC_GT_##wc (X, Y))				\
+	    (ret) = X##_s ? -1 : 1;					\
+	  else if (_FP_FRAC_GT_##wc (Y, X))				\
+	    (ret) = X##_s ? 1 : -1;					\
+	  else								\
+	    (ret) = 0;							\
+	}								\
+    }									\
+  while (0)
 
 
 /* Simplification for strict equality.  */
 
-#define _FP_CMP_EQ(fs, wc, ret, X, Y)					  \
-  do {									  \
-    /* NANs are unordered */						  \
-    if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X))		  \
-	|| (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y)))	  \
-      {									  \
-	ret = 1;							  \
-      }									  \
-    else								  \
-      {									  \
-	ret = !(X##_e == Y##_e						  \
-		&& _FP_FRAC_EQ_##wc(X, Y)				  \
-		&& (X##_s == Y##_s || !X##_e && _FP_FRAC_ZEROP_##wc(X))); \
-      }									  \
-  } while (0)
-
-/*
- * Main square root routine.  The input value should be cooked.
- */
+#define _FP_CMP_EQ(fs, wc, ret, X, Y, ex)				\
+  do									\
+    {									\
+      _FP_CMP_CHECK_DENORM (fs, wc, X, Y);				\
+      /* NANs are unordered.  */					\
+      if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (X))	\
+	  || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (Y)))	\
+	{								\
+	  (ret) = 1;							\
+	  _FP_CMP_CHECK_NAN (fs, wc, X, Y, (ex));			\
+	}								\
+      else								\
+	{								\
+	  _FP_CMP_CHECK_FLUSH_ZERO (fs, wc, X, Y);			\
+									\
+	  (ret) = !(X##_e == Y##_e					\
+		    && _FP_FRAC_EQ_##wc (X, Y)				\
+		    && (X##_s == Y##_s					\
+			|| (!X##_e && _FP_FRAC_ZEROP_##wc (X))));	\
+	}								\
+    }									\
+  while (0)
+
+/* Version to test unordered.  */
+
+#define _FP_CMP_UNORD(fs, wc, ret, X, Y, ex)				\
+  do									\
+    {									\
+      _FP_CMP_CHECK_DENORM (fs, wc, X, Y);				\
+      (ret) = ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (X))	\
+	       || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc (Y))); \
+      if (ret)								\
+	_FP_CMP_CHECK_NAN (fs, wc, X, Y, (ex));				\
+    }									\
+  while (0)
+
+/* Main square root routine.  The input value should be cooked.  */
 
 #define _FP_SQRT(fs, wc, R, X)						\
-do {									\
-    _FP_FRAC_DECL_##wc(T); _FP_FRAC_DECL_##wc(S);			\
-    _FP_W_TYPE q;							\
-    switch (X##_c)							\
+  do									\
     {									\
-    case FP_CLS_NAN:							\
-	_FP_FRAC_COPY_##wc(R, X);					\
-	R##_s = X##_s;							\
-    	R##_c = FP_CLS_NAN;						\
-    	break;								\
-    case FP_CLS_INF:							\
-    	if (X##_s)							\
-    	  {								\
-    	    R##_s = _FP_NANSIGN_##fs;					\
-	    R##_c = FP_CLS_NAN; /* NAN */				\
-	    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);			\
-	    FP_SET_EXCEPTION(FP_EX_INVALID);				\
-    	  }								\
-    	else								\
-    	  {								\
-    	    R##_s = 0;							\
-    	    R##_c = FP_CLS_INF; /* sqrt(+inf) = +inf */			\
-    	  }								\
-    	break;								\
-    case FP_CLS_ZERO:							\
-	R##_s = X##_s;							\
-	R##_c = FP_CLS_ZERO; /* sqrt(+-0) = +-0 */			\
-	break;								\
-    case FP_CLS_NORMAL:							\
-    	R##_s = 0;							\
-        if (X##_s)							\
-          {								\
-	    R##_c = FP_CLS_NAN; /* sNAN */				\
-	    R##_s = _FP_NANSIGN_##fs;					\
-	    _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);			\
-	    FP_SET_EXCEPTION(FP_EX_INVALID);				\
-	    break;							\
-          }								\
-    	R##_c = FP_CLS_NORMAL;						\
-        if (X##_e & 1)							\
-          _FP_FRAC_SLL_##wc(X, 1);					\
-        R##_e = X##_e >> 1;						\
-        _FP_FRAC_SET_##wc(S, _FP_ZEROFRAC_##wc);			\
-        _FP_FRAC_SET_##wc(R, _FP_ZEROFRAC_##wc);			\
-        q = _FP_OVERFLOW_##fs >> 1;					\
-        _FP_SQRT_MEAT_##wc(R, S, T, X, q);				\
+      _FP_FRAC_DECL_##wc (_FP_SQRT_T);					\
+      _FP_FRAC_DECL_##wc (_FP_SQRT_S);					\
+      _FP_W_TYPE _FP_SQRT_q;						\
+      switch (X##_c)							\
+	{								\
+	case FP_CLS_NAN:						\
+	  _FP_FRAC_COPY_##wc (R, X);					\
+	  R##_s = X##_s;						\
+	  R##_c = FP_CLS_NAN;						\
+	  break;							\
+	case FP_CLS_INF:						\
+	  if (X##_s)							\
+	    {								\
+	      R##_s = _FP_NANSIGN_##fs;					\
+	      R##_c = FP_CLS_NAN; /* NAN */				\
+	      _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);			\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_SQRT);	\
+	    }								\
+	  else								\
+	    {								\
+	      R##_s = 0;						\
+	      R##_c = FP_CLS_INF; /* sqrt(+inf) = +inf */		\
+	    }								\
+	  break;							\
+	case FP_CLS_ZERO:						\
+	  R##_s = X##_s;						\
+	  R##_c = FP_CLS_ZERO; /* sqrt(+-0) = +-0 */			\
+	  break;							\
+	case FP_CLS_NORMAL:						\
+	  R##_s = 0;							\
+	  if (X##_s)							\
+	    {								\
+	      R##_c = FP_CLS_NAN; /* NAN */				\
+	      R##_s = _FP_NANSIGN_##fs;					\
+	      _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);			\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_SQRT);	\
+	      break;							\
+	    }								\
+	  R##_c = FP_CLS_NORMAL;					\
+	  if (X##_e & 1)						\
+	    _FP_FRAC_SLL_##wc (X, 1);					\
+	  R##_e = X##_e >> 1;						\
+	  _FP_FRAC_SET_##wc (_FP_SQRT_S, _FP_ZEROFRAC_##wc);		\
+	  _FP_FRAC_SET_##wc (R, _FP_ZEROFRAC_##wc);			\
+	  _FP_SQRT_q = _FP_OVERFLOW_##fs >> 1;				\
+	  _FP_SQRT_MEAT_##wc (R, _FP_SQRT_S, _FP_SQRT_T, X,		\
+			      _FP_SQRT_q);				\
+	}								\
     }									\
-  } while (0)
+  while (0)
 
-/*
- * Convert from FP to integer
- */
+/* Convert from FP to integer.  Input is raw.  */
 
 /* RSIGNED can have following values:
- * 0:  the number is required to be 0..(2^rsize)-1, if not, NV is set plus
- *     the result is either 0 or (2^rsize)-1 depending on the sign in such case.
- * 1:  the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not, NV is
- *     set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 depending
- *     on the sign in such case.
- * 2:  the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not, NV is
- *     set plus the result is truncated to fit into destination.
- * -1: the number is required to be -(2^(rsize-1))..(2^rsize)-1, if not, NV is
- *     set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 depending
- *     on the sign in such case.
- */
-#define _FP_TO_INT(fs, wc, r, X, rsize, rsigned)				\
-  do {										\
-    switch (X##_c)								\
-      {										\
-      case FP_CLS_NORMAL:							\
-	if (X##_e < 0)								\
-	  {									\
-	    FP_SET_EXCEPTION(FP_EX_INEXACT);					\
-	  case FP_CLS_ZERO:							\
-	    r = 0;								\
-	  }									\
-	else if (X##_e >= rsize - (rsigned > 0 || X##_s)			\
-		 || (!rsigned && X##_s))					\
-	  {	/* overflow */							\
-	  case FP_CLS_NAN:                                                      \
-	  case FP_CLS_INF:							\
-	    if (rsigned == 2)							\
-	      {									\
-		if (X##_c != FP_CLS_NORMAL					\
-		    || X##_e >= rsize - 1 + _FP_WFRACBITS_##fs)			\
-		  r = 0;							\
-		else								\
-		  {								\
-		    _FP_FRAC_SLL_##wc(X, (X##_e - _FP_WFRACBITS_##fs + 1));	\
-		    _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);			\
-		  }								\
-	      }									\
-	    else if (rsigned)							\
-	      {									\
-		r = 1;								\
-		r <<= rsize - 1;						\
-		r -= 1 - X##_s;							\
-	      }									\
-	    else								\
-	      {									\
-		r = 0;								\
-		if (!X##_s)							\
-		  r = ~r;							\
-	      }									\
-	    FP_SET_EXCEPTION(FP_EX_INVALID);					\
-	  }									\
-	else									\
-	  {									\
-	    if (_FP_W_TYPE_SIZE*wc < rsize)					\
-	      {									\
-		_FP_FRAC_ASSEMBLE_##wc(r, X, rsize);				\
-		r <<= X##_e - _FP_WFRACBITS_##fs;				\
-	      }									\
-	    else								\
-	      {									\
-		if (X##_e >= _FP_WFRACBITS_##fs)				\
-		  _FP_FRAC_SLL_##wc(X, (X##_e - _FP_WFRACBITS_##fs + 1));	\
-		else if (X##_e < _FP_WFRACBITS_##fs - 1)			\
-		  {								\
-		    _FP_FRAC_SRS_##wc(X, (_FP_WFRACBITS_##fs - X##_e - 2),	\
-				      _FP_WFRACBITS_##fs);			\
-		    if (_FP_FRAC_LOW_##wc(X) & 1)				\
-		      FP_SET_EXCEPTION(FP_EX_INEXACT);				\
-		    _FP_FRAC_SRL_##wc(X, 1);					\
-		  }								\
-		_FP_FRAC_ASSEMBLE_##wc(r, X, rsize);				\
-	      }									\
-	    if (rsigned && X##_s)						\
-	      r = -r;								\
-	  }									\
-	break;									\
-      }										\
-  } while (0)
-
-#define _FP_TO_INT_ROUND(fs, wc, r, X, rsize, rsigned)				\
-  do {										\
-    r = 0;									\
-    switch (X##_c)								\
-      {										\
-      case FP_CLS_NORMAL:							\
-	if (X##_e >= _FP_FRACBITS_##fs - 1)					\
-	  {									\
-	    if (X##_e < rsize - 1 + _FP_WFRACBITS_##fs)				\
-	      {									\
-		if (X##_e >= _FP_WFRACBITS_##fs - 1)				\
-		  {								\
-		    _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);			\
-		    r <<= X##_e - _FP_WFRACBITS_##fs + 1;			\
-		  }								\
-		else								\
-		  {								\
-		    _FP_FRAC_SRL_##wc(X, _FP_WORKBITS - X##_e			\
-				      + _FP_FRACBITS_##fs - 1);			\
-		    _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);			\
-		  }								\
-	      }									\
-	  }									\
-	else									\
-	  {									\
-	    int _lz0, _lz1;							\
-	    if (X##_e <= -_FP_WORKBITS - 1)					\
-	      _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc);				\
-	    else								\
-	      _FP_FRAC_SRS_##wc(X, _FP_FRACBITS_##fs - 1 - X##_e,		\
-				_FP_WFRACBITS_##fs);				\
-	    _FP_FRAC_CLZ_##wc(_lz0, X);						\
-	    _FP_ROUND(wc, X);							\
-	    _FP_FRAC_CLZ_##wc(_lz1, X);						\
-	    if (_lz1 < _lz0)							\
-	      X##_e++; /* For overflow detection.  */				\
-	    _FP_FRAC_SRL_##wc(X, _FP_WORKBITS);					\
-	    _FP_FRAC_ASSEMBLE_##wc(r, X, rsize);				\
-	  }									\
-	if (rsigned && X##_s)							\
-	  r = -r;								\
-	if (X##_e >= rsize - (rsigned > 0 || X##_s)				\
-	    || (!rsigned && X##_s))						\
-	  {	/* overflow */							\
-	  case FP_CLS_NAN:                                                      \
-	  case FP_CLS_INF:							\
-	    if (!rsigned)							\
-	      {									\
-		r = 0;								\
-		if (!X##_s)							\
-		  r = ~r;							\
-	      }									\
-	    else if (rsigned != 2)						\
-	      {									\
-		r = 1;								\
-		r <<= rsize - 1;						\
-		r -= 1 - X##_s;							\
-	      }									\
-	    FP_SET_EXCEPTION(FP_EX_INVALID);					\
-	  }									\
-	break;									\
-      case FP_CLS_ZERO:								\
-        break;									\
-      }										\
-  } while (0)
+   0:  the number is required to be 0..(2^rsize)-1, if not, NV is set plus
+       the result is either 0 or (2^rsize)-1 depending on the sign in such
+       case.
+   1:  the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not,
+       NV is set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1
+       depending on the sign in such case.
+   2:  the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not,
+       NV is set plus the result is reduced modulo 2^rsize.
+   -1: the number is required to be -(2^(rsize-1))..(2^rsize)-1, if not, NV is
+       set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1
+       depending on the sign in such case.  */
+#define _FP_TO_INT(fs, wc, r, X, rsize, rsigned)			\
+  do									\
+    {									\
+      if (X##_e < _FP_EXPBIAS_##fs)					\
+	{								\
+	  (r) = 0;							\
+	  if (X##_e == 0)						\
+	    {								\
+	      if (!_FP_FRAC_ZEROP_##wc (X))				\
+		{							\
+		  if (!FP_DENORM_ZERO)					\
+		    FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		}							\
+	    }								\
+	  else								\
+	    FP_SET_EXCEPTION (FP_EX_INEXACT);				\
+	}								\
+      else if ((rsigned) == 2						\
+	       && (X##_e						\
+		   >= ((_FP_EXPMAX_##fs					\
+			< _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs + (rsize) - 1) \
+		       ? _FP_EXPMAX_##fs				\
+		       : _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs + (rsize) - 1))) \
+	{								\
+	  /* Overflow resulting in 0.  */				\
+	  (r) = 0;							\
+	  FP_SET_EXCEPTION (FP_EX_INVALID				\
+			    | FP_EX_INVALID_CVI				\
+			    | ((FP_EX_INVALID_SNAN			\
+				&& _FP_ISSIGNAN (fs, wc, X))		\
+			       ? FP_EX_INVALID_SNAN			\
+			       : 0));					\
+	}								\
+      else if ((rsigned) != 2						\
+	       && (X##_e >= (_FP_EXPMAX_##fs < _FP_EXPBIAS_##fs + (rsize) \
+			     ? _FP_EXPMAX_##fs				\
+			     : (_FP_EXPBIAS_##fs + (rsize)		\
+				- ((rsigned) > 0 || X##_s)))		\
+		   || (!(rsigned) && X##_s)))				\
+	{								\
+	  /* Overflow or converting to the most negative integer.  */	\
+	  if (rsigned)							\
+	    {								\
+	      (r) = 1;							\
+	      (r) <<= (rsize) - 1;					\
+	      (r) -= 1 - X##_s;						\
+	    }								\
+	  else								\
+	    {								\
+	      (r) = 0;							\
+	      if (!X##_s)						\
+		(r) = ~(r);						\
+	    }								\
+									\
+	  if (_FP_EXPBIAS_##fs + (rsize) - 1 < _FP_EXPMAX_##fs		\
+	      && (rsigned)						\
+	      && X##_s							\
+	      && X##_e == _FP_EXPBIAS_##fs + (rsize) - 1)		\
+	    {								\
+	      /* Possibly converting to most negative integer; check the \
+		 mantissa.  */						\
+	      int _FP_TO_INT_inexact = 0;				\
+	      (void) ((_FP_FRACBITS_##fs > (rsize))			\
+		      ? ({						\
+			  _FP_FRAC_SRST_##wc (X, _FP_TO_INT_inexact,	\
+					      _FP_FRACBITS_##fs - (rsize), \
+					      _FP_FRACBITS_##fs);	\
+			  0;						\
+			})						\
+		      : 0);						\
+	      if (!_FP_FRAC_ZEROP_##wc (X))				\
+		FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+	      else if (_FP_TO_INT_inexact)				\
+		FP_SET_EXCEPTION (FP_EX_INEXACT);			\
+	    }								\
+	  else								\
+	    FP_SET_EXCEPTION (FP_EX_INVALID				\
+			      | FP_EX_INVALID_CVI			\
+			      | ((FP_EX_INVALID_SNAN			\
+				  && _FP_ISSIGNAN (fs, wc, X))		\
+				 ? FP_EX_INVALID_SNAN			\
+				 : 0));					\
+	}								\
+      else								\
+	{								\
+	  int _FP_TO_INT_inexact = 0;					\
+	  _FP_FRAC_HIGH_RAW_##fs (X) |= _FP_IMPLBIT_##fs;		\
+	  if (X##_e >= _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs - 1)	\
+	    {								\
+	      _FP_FRAC_ASSEMBLE_##wc ((r), X, (rsize));			\
+	      (r) <<= X##_e - _FP_EXPBIAS_##fs - _FP_FRACBITS_##fs + 1; \
+	    }								\
+	  else								\
+	    {								\
+	      _FP_FRAC_SRST_##wc (X, _FP_TO_INT_inexact,		\
+				  (_FP_FRACBITS_##fs + _FP_EXPBIAS_##fs - 1 \
+				   - X##_e),				\
+				  _FP_FRACBITS_##fs);			\
+	      _FP_FRAC_ASSEMBLE_##wc ((r), X, (rsize));			\
+	    }								\
+	  if ((rsigned) && X##_s)					\
+	    (r) = -(r);							\
+	  if ((rsigned) == 2 && X##_e >= _FP_EXPBIAS_##fs + (rsize) - 1) \
+	    {								\
+	      /* Overflow or converting to the most negative integer.  */ \
+	      if (X##_e > _FP_EXPBIAS_##fs + (rsize) - 1		\
+		  || !X##_s						\
+		  || (r) != (((typeof (r)) 1) << ((rsize) - 1)))	\
+		{							\
+		  _FP_TO_INT_inexact = 0;				\
+		  FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+		}							\
+	    }								\
+	  if (_FP_TO_INT_inexact)					\
+	    FP_SET_EXCEPTION (FP_EX_INEXACT);				\
+	}								\
+    }									\
+  while (0)
+
+/* Convert from floating point to integer, rounding according to the
+   current rounding direction.  Input is raw.  RSIGNED is as for
+   _FP_TO_INT.  */
+#define _FP_TO_INT_ROUND(fs, wc, r, X, rsize, rsigned)			\
+  do									\
+    {									\
+      __label__ _FP_TO_INT_ROUND_done;					\
+      if (X##_e < _FP_EXPBIAS_##fs)					\
+	{								\
+	  int _FP_TO_INT_ROUND_rounds_away = 0;				\
+	  if (X##_e == 0)						\
+	    {								\
+	      if (_FP_FRAC_ZEROP_##wc (X))				\
+		{							\
+		  (r) = 0;						\
+		  goto _FP_TO_INT_ROUND_done;				\
+		}							\
+	      else							\
+		{							\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		  if (FP_DENORM_ZERO)					\
+		    {							\
+		      (r) = 0;						\
+		      goto _FP_TO_INT_ROUND_done;			\
+		    }							\
+		}							\
+	    }								\
+	  /* The result is 0, 1 or -1 depending on the rounding mode;	\
+	     -1 may cause overflow in the unsigned case.  */		\
+	  switch (FP_ROUNDMODE)						\
+	    {								\
+	    case FP_RND_NEAREST:					\
+	      _FP_TO_INT_ROUND_rounds_away				\
+		= (X##_e == _FP_EXPBIAS_##fs - 1			\
+		   && !_FP_FRAC_ZEROP_##wc (X));			\
+	      break;							\
+	    case FP_RND_ZERO:						\
+	      /* _FP_TO_INT_ROUND_rounds_away is already 0.  */		\
+	      break;							\
+	    case FP_RND_PINF:						\
+	      _FP_TO_INT_ROUND_rounds_away = !X##_s;			\
+	      break;							\
+	    case FP_RND_MINF:						\
+	      _FP_TO_INT_ROUND_rounds_away = X##_s;			\
+	      break;							\
+	    }								\
+	  if ((rsigned) == 0 && _FP_TO_INT_ROUND_rounds_away && X##_s)	\
+	    {								\
+	      /* Result of -1 for an unsigned conversion.  */		\
+	      (r) = 0;							\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+	    }								\
+	  else if ((rsize) == 1 && (rsigned) > 0			\
+		   && _FP_TO_INT_ROUND_rounds_away && !X##_s)		\
+	    {								\
+	      /* Converting to a 1-bit signed bit-field, which cannot	\
+		 represent +1.  */					\
+	      (r) = ((rsigned) == 2 ? -1 : 0);				\
+	      FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+	    }								\
+	  else								\
+	    {								\
+	      (r) = (_FP_TO_INT_ROUND_rounds_away			\
+		     ? (X##_s ? -1 : 1)					\
+		     : 0);						\
+	      FP_SET_EXCEPTION (FP_EX_INEXACT);				\
+	    }								\
+	}								\
+      else if ((rsigned) == 2						\
+	       && (X##_e						\
+		   >= ((_FP_EXPMAX_##fs					\
+			< _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs + (rsize) - 1) \
+		       ? _FP_EXPMAX_##fs				\
+		       : _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs + (rsize) - 1))) \
+	{								\
+	  /* Overflow resulting in 0.  */				\
+	  (r) = 0;							\
+	  FP_SET_EXCEPTION (FP_EX_INVALID				\
+			    | FP_EX_INVALID_CVI				\
+			    | ((FP_EX_INVALID_SNAN			\
+				&& _FP_ISSIGNAN (fs, wc, X))		\
+			       ? FP_EX_INVALID_SNAN			\
+			       : 0));					\
+	}								\
+      else if ((rsigned) != 2						\
+	       && (X##_e >= (_FP_EXPMAX_##fs < _FP_EXPBIAS_##fs + (rsize) \
+			     ? _FP_EXPMAX_##fs				\
+			     : (_FP_EXPBIAS_##fs + (rsize)		\
+				- ((rsigned) > 0 && !X##_s)))		\
+		   || ((rsigned) == 0 && X##_s)))			\
+	{								\
+	  /* Definite overflow (does not require rounding to tell).  */	\
+	  if ((rsigned) != 0)						\
+	    {								\
+	      (r) = 1;							\
+	      (r) <<= (rsize) - 1;					\
+	      (r) -= 1 - X##_s;						\
+	    }								\
+	  else								\
+	    {								\
+	      (r) = 0;							\
+	      if (!X##_s)						\
+		(r) = ~(r);						\
+	    }								\
+									\
+	  FP_SET_EXCEPTION (FP_EX_INVALID				\
+			    | FP_EX_INVALID_CVI				\
+			    | ((FP_EX_INVALID_SNAN			\
+				&& _FP_ISSIGNAN (fs, wc, X))		\
+			       ? FP_EX_INVALID_SNAN			\
+			       : 0));					\
+	}								\
+      else								\
+	{								\
+	  /* The value is finite, with magnitude at least 1.  If	\
+	     the conversion is unsigned, the value is positive.		\
+	     If RSIGNED is not 2, the value does not definitely		\
+	     overflow by virtue of its exponent, but may still turn	\
+	     out to overflow after rounding; if RSIGNED is 2, the	\
+	     exponent may be such that the value definitely overflows,	\
+	     but at least one mantissa bit will not be shifted out.  */ \
+	  int _FP_TO_INT_ROUND_inexact = 0;				\
+	  _FP_FRAC_HIGH_RAW_##fs (X) |= _FP_IMPLBIT_##fs;		\
+	  if (X##_e >= _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs - 1)	\
+	    {								\
+	      /* The value is an integer, no rounding needed.  */	\
+	      _FP_FRAC_ASSEMBLE_##wc ((r), X, (rsize));			\
+	      (r) <<= X##_e - _FP_EXPBIAS_##fs - _FP_FRACBITS_##fs + 1; \
+	    }								\
+	  else								\
+	    {								\
+	      /* May need to shift in order to round (unless there	\
+		 are exactly _FP_WORKBITS fractional bits already).  */	\
+	      int _FP_TO_INT_ROUND_rshift				\
+		= (_FP_FRACBITS_##fs + _FP_EXPBIAS_##fs			\
+		   - 1 - _FP_WORKBITS - X##_e);				\
+	      if (_FP_TO_INT_ROUND_rshift > 0)				\
+		_FP_FRAC_SRS_##wc (X, _FP_TO_INT_ROUND_rshift,		\
+				   _FP_WFRACBITS_##fs);			\
+	      else if (_FP_TO_INT_ROUND_rshift < 0)			\
+		_FP_FRAC_SLL_##wc (X, -_FP_TO_INT_ROUND_rshift);	\
+	      /* Round like _FP_ROUND, but setting			\
+		 _FP_TO_INT_ROUND_inexact instead of directly setting	\
+		 the "inexact" exception, since it may turn out we	\
+		 should set "invalid" instead.  */			\
+	      if (_FP_FRAC_LOW_##wc (X) & 7)				\
+		{							\
+		  _FP_TO_INT_ROUND_inexact = 1;				\
+		  switch (FP_ROUNDMODE)					\
+		    {							\
+		    case FP_RND_NEAREST:				\
+		      _FP_ROUND_NEAREST (wc, X);			\
+		      break;						\
+		    case FP_RND_ZERO:					\
+		      _FP_ROUND_ZERO (wc, X);				\
+		      break;						\
+		    case FP_RND_PINF:					\
+		      _FP_ROUND_PINF (wc, X);				\
+		      break;						\
+		    case FP_RND_MINF:					\
+		      _FP_ROUND_MINF (wc, X);				\
+		      break;						\
+		    }							\
+		}							\
+	      _FP_FRAC_SRL_##wc (X, _FP_WORKBITS);			\
+	      _FP_FRAC_ASSEMBLE_##wc ((r), X, (rsize));			\
+	    }								\
+	  if ((rsigned) != 0 && X##_s)					\
+	    (r) = -(r);							\
+	  /* An exponent of RSIZE - 1 always needs testing for		\
+	     overflow (either directly overflowing, or overflowing	\
+	     when rounding up results in 2^RSIZE).  An exponent of	\
+	     RSIZE - 2 can overflow for positive values when rounding	\
+	     up to 2^(RSIZE-1), but cannot overflow for negative	\
+	     values.  Smaller exponents cannot overflow.  */		\
+	  if (X##_e >= (_FP_EXPBIAS_##fs + (rsize) - 1			\
+			- ((rsigned) > 0 && !X##_s)))			\
+	    {								\
+	      if (X##_e > _FP_EXPBIAS_##fs + (rsize) - 1		\
+		  || (X##_e == _FP_EXPBIAS_##fs + (rsize) - 1		\
+		      && (X##_s						\
+			  ? (r) != (((typeof (r)) 1) << ((rsize) - 1))	\
+			  : ((rsigned) > 0 || (r) == 0)))		\
+		  || ((rsigned) > 0					\
+		      && !X##_s						\
+		      && X##_e == _FP_EXPBIAS_##fs + (rsize) - 2	\
+		      && (r) == (((typeof (r)) 1) << ((rsize) - 1))))	\
+		{							\
+		  if ((rsigned) != 2)					\
+		    {							\
+		      if ((rsigned) != 0)				\
+			{						\
+			  (r) = 1;					\
+			  (r) <<= (rsize) - 1;				\
+			  (r) -= 1 - X##_s;				\
+			}						\
+		      else						\
+			{						\
+			  (r) = 0;					\
+			  (r) = ~(r);					\
+			}						\
+		    }							\
+		  _FP_TO_INT_ROUND_inexact = 0;				\
+		  FP_SET_EXCEPTION (FP_EX_INVALID | FP_EX_INVALID_CVI);	\
+		}							\
+	    }								\
+	  if (_FP_TO_INT_ROUND_inexact)					\
+	    FP_SET_EXCEPTION (FP_EX_INEXACT);				\
+	}								\
+    _FP_TO_INT_ROUND_done: ;						\
+    }									\
+  while (0)
 
+/* Convert integer to fp.  Output is raw.  RTYPE is unsigned even if
+   input is signed.  */
 #define _FP_FROM_INT(fs, wc, X, r, rsize, rtype)			\
-  do {									\
-    if (r)								\
-      {									\
-        unsigned rtype ur_;						\
-	X##_c = FP_CLS_NORMAL;						\
-									\
-	if ((X##_s = (r < 0)))						\
-	  ur_ = (unsigned rtype) -r;					\
-	else								\
-	  ur_ = (unsigned rtype) r;					\
-	if (rsize <= _FP_W_TYPE_SIZE)					\
-	  __FP_CLZ(X##_e, ur_);						\
-	else								\
-	  __FP_CLZ_2(X##_e, (_FP_W_TYPE)(ur_ >> _FP_W_TYPE_SIZE), 	\
-		     (_FP_W_TYPE)ur_);					\
-	if (rsize < _FP_W_TYPE_SIZE)					\
-		X##_e -= (_FP_W_TYPE_SIZE - rsize);			\
-	X##_e = rsize - X##_e - 1;					\
-									\
-	if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs <= X##_e)	\
-	  __FP_FRAC_SRS_1(ur_, (X##_e - _FP_WFRACBITS_##fs + 1), rsize);\
-	_FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize);			\
-	if ((_FP_WFRACBITS_##fs - X##_e - 1) > 0)			\
-	  _FP_FRAC_SLL_##wc(X, (_FP_WFRACBITS_##fs - X##_e - 1));	\
-      }									\
-    else								\
-      {									\
-	X##_c = FP_CLS_ZERO, X##_s = 0;					\
-      }									\
-  } while (0)
-
-
-#define FP_CONV(dfs,sfs,dwc,swc,D,S)			\
-  do {							\
-    _FP_FRAC_CONV_##dwc##_##swc(dfs, sfs, D, S);	\
-    D##_e = S##_e;					\
-    D##_c = S##_c;					\
-    D##_s = S##_s;					\
-  } while (0)
-
-/*
- * Helper primitives.
- */
+  do									\
+    {									\
+      __label__ pack_semiraw;						\
+      if (r)								\
+	{								\
+	  rtype _FP_FROM_INT_ur;					\
+									\
+	  if ((X##_s = ((r) < 0)))					\
+	    (r) = -(rtype) (r);						\
+									\
+	  _FP_FROM_INT_ur = (rtype) (r);				\
+	  (void) (((rsize) <= _FP_W_TYPE_SIZE)				\
+		  ? ({							\
+		      int _FP_FROM_INT_lz;				\
+		      __FP_CLZ (_FP_FROM_INT_lz,			\
+				(_FP_W_TYPE) _FP_FROM_INT_ur);		\
+		      X##_e = (_FP_EXPBIAS_##fs + _FP_W_TYPE_SIZE - 1	\
+			       - _FP_FROM_INT_lz);			\
+		    })							\
+		  : (((rsize) <= 2 * _FP_W_TYPE_SIZE)			\
+		     ? ({						\
+			 int _FP_FROM_INT_lz;				\
+			 __FP_CLZ_2 (_FP_FROM_INT_lz,			\
+				     (_FP_W_TYPE) (_FP_FROM_INT_ur	\
+						   >> _FP_W_TYPE_SIZE), \
+				     (_FP_W_TYPE) _FP_FROM_INT_ur);	\
+			 X##_e = (_FP_EXPBIAS_##fs + 2 * _FP_W_TYPE_SIZE - 1 \
+				  - _FP_FROM_INT_lz);			\
+		       })						\
+		     : (abort (), 0)));					\
+									\
+	  if ((rsize) - 1 + _FP_EXPBIAS_##fs >= _FP_EXPMAX_##fs		\
+	      && X##_e >= _FP_EXPMAX_##fs)				\
+	    {								\
+	      /* Exponent too big; overflow to infinity.  (May also	\
+		 happen after rounding below.)  */			\
+	      _FP_OVERFLOW_SEMIRAW (fs, wc, X);				\
+	      goto pack_semiraw;					\
+	    }								\
+									\
+	  if ((rsize) <= _FP_FRACBITS_##fs				\
+	      || X##_e < _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs)		\
+	    {								\
+	      /* Exactly representable; shift left.  */			\
+	      _FP_FRAC_DISASSEMBLE_##wc (X, _FP_FROM_INT_ur, (rsize));	\
+	      if (_FP_EXPBIAS_##fs + _FP_FRACBITS_##fs - 1 - X##_e > 0)	\
+		_FP_FRAC_SLL_##wc (X, (_FP_EXPBIAS_##fs			\
+				       + _FP_FRACBITS_##fs - 1 - X##_e)); \
+	    }								\
+	  else								\
+	    {								\
+	      /* More bits in integer than in floating type; need to	\
+		 round.  */						\
+	      if (_FP_EXPBIAS_##fs + _FP_WFRACBITS_##fs - 1 < X##_e)	\
+		_FP_FROM_INT_ur						\
+		  = ((_FP_FROM_INT_ur >> (X##_e - _FP_EXPBIAS_##fs	\
+					  - _FP_WFRACBITS_##fs + 1))	\
+		     | ((_FP_FROM_INT_ur				\
+			 << ((rsize) - (X##_e - _FP_EXPBIAS_##fs	\
+					- _FP_WFRACBITS_##fs + 1)))	\
+			!= 0));						\
+	      _FP_FRAC_DISASSEMBLE_##wc (X, _FP_FROM_INT_ur, (rsize));	\
+	      if ((_FP_EXPBIAS_##fs + _FP_WFRACBITS_##fs - 1 - X##_e) > 0) \
+		_FP_FRAC_SLL_##wc (X, (_FP_EXPBIAS_##fs			\
+				       + _FP_WFRACBITS_##fs - 1 - X##_e)); \
+	      _FP_FRAC_HIGH_##fs (X) &= ~(_FP_W_TYPE) _FP_IMPLBIT_SH_##fs; \
+	    pack_semiraw:						\
+	      _FP_PACK_SEMIRAW (fs, wc, X);				\
+	    }								\
+	}								\
+      else								\
+	{								\
+	  X##_s = 0;							\
+	  X##_e = 0;							\
+	  _FP_FRAC_SET_##wc (X, _FP_ZEROFRAC_##wc);			\
+	}								\
+    }									\
+  while (0)
+
+
+/* Extend from a narrower floating-point format to a wider one.  Input
+   and output are raw.  If CHECK_NAN, then signaling NaNs are
+   converted to quiet with the "invalid" exception raised; otherwise
+   signaling NaNs remain signaling with no exception.  */
+#define _FP_EXTEND_CNAN(dfs, sfs, dwc, swc, D, S, check_nan)		\
+  do									\
+    {									\
+      if (_FP_FRACBITS_##dfs < _FP_FRACBITS_##sfs			\
+	  || (_FP_EXPMAX_##dfs - _FP_EXPBIAS_##dfs			\
+	      < _FP_EXPMAX_##sfs - _FP_EXPBIAS_##sfs)			\
+	  || (_FP_EXPBIAS_##dfs < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1 \
+	      && _FP_EXPBIAS_##dfs != _FP_EXPBIAS_##sfs))		\
+	abort ();							\
+      D##_s = S##_s;							\
+      _FP_FRAC_COPY_##dwc##_##swc (D, S);				\
+      if (_FP_EXP_NORMAL (sfs, swc, S))					\
+	{								\
+	  D##_e = S##_e + _FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs;	\
+	  _FP_FRAC_SLL_##dwc (D, (_FP_FRACBITS_##dfs - _FP_FRACBITS_##sfs)); \
+	}								\
+      else								\
+	{								\
+	  if (S##_e == 0)						\
+	    {								\
+	      _FP_CHECK_FLUSH_ZERO (sfs, swc, S);			\
+	      if (_FP_FRAC_ZEROP_##swc (S))				\
+		D##_e = 0;						\
+	      else if (_FP_EXPBIAS_##dfs				\
+		       < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1)	\
+		{							\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		  _FP_FRAC_SLL_##dwc (D, (_FP_FRACBITS_##dfs		\
+					  - _FP_FRACBITS_##sfs));	\
+		  D##_e = 0;						\
+		  if (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)		\
+		    FP_SET_EXCEPTION (FP_EX_UNDERFLOW);			\
+		}							\
+	      else							\
+		{							\
+		  int FP_EXTEND_lz;					\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		  _FP_FRAC_CLZ_##swc (FP_EXTEND_lz, S);			\
+		  _FP_FRAC_SLL_##dwc (D,				\
+				      FP_EXTEND_lz + _FP_FRACBITS_##dfs	\
+				      - _FP_FRACTBITS_##sfs);		\
+		  D##_e = (_FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs + 1	\
+			   + _FP_FRACXBITS_##sfs - FP_EXTEND_lz);	\
+		}							\
+	    }								\
+	  else								\
+	    {								\
+	      D##_e = _FP_EXPMAX_##dfs;					\
+	      if (!_FP_FRAC_ZEROP_##swc (S))				\
+		{							\
+		  if (check_nan && _FP_FRAC_SNANP (sfs, S))		\
+		    FP_SET_EXCEPTION (FP_EX_INVALID			\
+				      | FP_EX_INVALID_SNAN);		\
+		  _FP_FRAC_SLL_##dwc (D, (_FP_FRACBITS_##dfs		\
+					  - _FP_FRACBITS_##sfs));	\
+		  if (check_nan)					\
+		    _FP_SETQNAN (dfs, dwc, D);				\
+		}							\
+	    }								\
+	}								\
+    }									\
+  while (0)
+
+#define FP_EXTEND(dfs, sfs, dwc, swc, D, S)		\
+    _FP_EXTEND_CNAN (dfs, sfs, dwc, swc, D, S, 1)
+
+/* Truncate from a wider floating-point format to a narrower one.
+   Input and output are semi-raw.  */
+#define FP_TRUNC(dfs, sfs, dwc, swc, D, S)				\
+  do									\
+    {									\
+      if (_FP_FRACBITS_##sfs < _FP_FRACBITS_##dfs			\
+	  || (_FP_EXPBIAS_##sfs < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1 \
+	      && _FP_EXPBIAS_##sfs != _FP_EXPBIAS_##dfs))		\
+	abort ();							\
+      D##_s = S##_s;							\
+      if (_FP_EXP_NORMAL (sfs, swc, S))					\
+	{								\
+	  D##_e = S##_e + _FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs;	\
+	  if (D##_e >= _FP_EXPMAX_##dfs)				\
+	    _FP_OVERFLOW_SEMIRAW (dfs, dwc, D);				\
+	  else								\
+	    {								\
+	      if (D##_e <= 0)						\
+		{							\
+		  if (D##_e < 1 - _FP_FRACBITS_##dfs)			\
+		    {							\
+		      _FP_FRAC_SET_##swc (S, _FP_ZEROFRAC_##swc);	\
+		      _FP_FRAC_LOW_##swc (S) |= 1;			\
+		    }							\
+		  else							\
+		    {							\
+		      _FP_FRAC_HIGH_##sfs (S) |= _FP_IMPLBIT_SH_##sfs;	\
+		      _FP_FRAC_SRS_##swc (S, (_FP_WFRACBITS_##sfs	\
+					      - _FP_WFRACBITS_##dfs	\
+					      + 1 - D##_e),		\
+					  _FP_WFRACBITS_##sfs);		\
+		    }							\
+		  D##_e = 0;						\
+		}							\
+	      else							\
+		_FP_FRAC_SRS_##swc (S, (_FP_WFRACBITS_##sfs		\
+					- _FP_WFRACBITS_##dfs),		\
+				    _FP_WFRACBITS_##sfs);		\
+	      _FP_FRAC_COPY_##dwc##_##swc (D, S);			\
+	    }								\
+	}								\
+      else								\
+	{								\
+	  if (S##_e == 0)						\
+	    {								\
+	      _FP_CHECK_FLUSH_ZERO (sfs, swc, S);			\
+	      D##_e = 0;						\
+	      if (_FP_FRAC_ZEROP_##swc (S))				\
+		_FP_FRAC_SET_##dwc (D, _FP_ZEROFRAC_##dwc);		\
+	      else							\
+		{							\
+		  FP_SET_EXCEPTION (FP_EX_DENORM);			\
+		  if (_FP_EXPBIAS_##sfs					\
+		      < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1)	\
+		    {							\
+		      _FP_FRAC_SRS_##swc (S, (_FP_WFRACBITS_##sfs	\
+					      - _FP_WFRACBITS_##dfs),	\
+					  _FP_WFRACBITS_##sfs);		\
+		      _FP_FRAC_COPY_##dwc##_##swc (D, S);		\
+		    }							\
+		  else							\
+		    {							\
+		      _FP_FRAC_SET_##dwc (D, _FP_ZEROFRAC_##dwc);	\
+		      _FP_FRAC_LOW_##dwc (D) |= 1;			\
+		    }							\
+		}							\
+	    }								\
+	  else								\
+	    {								\
+	      D##_e = _FP_EXPMAX_##dfs;					\
+	      if (_FP_FRAC_ZEROP_##swc (S))				\
+		_FP_FRAC_SET_##dwc (D, _FP_ZEROFRAC_##dwc);		\
+	      else							\
+		{							\
+		  _FP_CHECK_SIGNAN_SEMIRAW (sfs, swc, S);		\
+		  _FP_FRAC_SRL_##swc (S, (_FP_WFRACBITS_##sfs		\
+					  - _FP_WFRACBITS_##dfs));	\
+		  _FP_FRAC_COPY_##dwc##_##swc (D, S);			\
+		  /* Semi-raw NaN must have all workbits cleared.  */	\
+		  _FP_FRAC_LOW_##dwc (D)				\
+		    &= ~(_FP_W_TYPE) ((1 << _FP_WORKBITS) - 1);		\
+		  _FP_SETQNAN_SEMIRAW (dfs, dwc, D);			\
+		}							\
+	    }								\
+	}								\
+    }									\
+  while (0)
+
+/* Helper primitives.  */
 
 /* Count leading zeros in a word.  */
 
 #ifndef __FP_CLZ
-#if _FP_W_TYPE_SIZE < 64
-/* this is just to shut the compiler up about shifts > word length -- PMM 02/1998 */
-#define __FP_CLZ(r, x)				\
-  do {						\
-    _FP_W_TYPE _t = (x);			\
-    r = _FP_W_TYPE_SIZE - 1;			\
-    if (_t > 0xffff) r -= 16;			\
-    if (_t > 0xffff) _t >>= 16;			\
-    if (_t > 0xff) r -= 8;			\
-    if (_t > 0xff) _t >>= 8;			\
-    if (_t & 0xf0) r -= 4;			\
-    if (_t & 0xf0) _t >>= 4;			\
-    if (_t & 0xc) r -= 2;			\
-    if (_t & 0xc) _t >>= 2;			\
-    if (_t & 0x2) r -= 1;			\
-  } while (0)
-#else /* not _FP_W_TYPE_SIZE < 64 */
-#define __FP_CLZ(r, x)				\
-  do {						\
-    _FP_W_TYPE _t = (x);			\
-    r = _FP_W_TYPE_SIZE - 1;			\
-    if (_t > 0xffffffff) r -= 32;		\
-    if (_t > 0xffffffff) _t >>= 32;		\
-    if (_t > 0xffff) r -= 16;			\
-    if (_t > 0xffff) _t >>= 16;			\
-    if (_t > 0xff) r -= 8;			\
-    if (_t > 0xff) _t >>= 8;			\
-    if (_t & 0xf0) r -= 4;			\
-    if (_t & 0xf0) _t >>= 4;			\
-    if (_t & 0xc) r -= 2;			\
-    if (_t & 0xc) _t >>= 2;			\
-    if (_t & 0x2) r -= 1;			\
-  } while (0)
-#endif /* not _FP_W_TYPE_SIZE < 64 */
+/* GCC 3.4 and later provide the builtins for us.  */
+# define __FP_CLZ(r, x)							\
+  do									\
+    {									\
+      if (sizeof (_FP_W_TYPE) == sizeof (unsigned int))			\
+	(r) = __builtin_clz (x);					\
+      else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long))		\
+	(r) = __builtin_clzl (x);					\
+      else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long long))	\
+	(r) = __builtin_clzll (x);					\
+      else								\
+	abort ();							\
+    }									\
+  while (0)
 #endif /* ndef __FP_CLZ */
 
 #define _FP_DIV_HELP_imm(q, r, n, d)		\
-  do {						\
-    q = n / d, r = n % d;			\
-  } while (0)
+  do						\
+    {						\
+      (q) = (n) / (d), (r) = (n) % (d);		\
+    }						\
+  while (0)
+
+
+/* A restoring bit-by-bit division primitive.  */
+
+#define _FP_DIV_MEAT_N_loop(fs, wc, R, X, Y)				\
+  do									\
+    {									\
+      int _FP_DIV_MEAT_N_loop_count = _FP_WFRACBITS_##fs;		\
+      _FP_FRAC_DECL_##wc (_FP_DIV_MEAT_N_loop_u);			\
+      _FP_FRAC_DECL_##wc (_FP_DIV_MEAT_N_loop_v);			\
+      _FP_FRAC_COPY_##wc (_FP_DIV_MEAT_N_loop_u, X);			\
+      _FP_FRAC_COPY_##wc (_FP_DIV_MEAT_N_loop_v, Y);			\
+      _FP_FRAC_SET_##wc (R, _FP_ZEROFRAC_##wc);				\
+      /* Normalize _FP_DIV_MEAT_N_LOOP_U and _FP_DIV_MEAT_N_LOOP_V.  */	\
+      _FP_FRAC_SLL_##wc (_FP_DIV_MEAT_N_loop_u, _FP_WFRACXBITS_##fs);	\
+      _FP_FRAC_SLL_##wc (_FP_DIV_MEAT_N_loop_v, _FP_WFRACXBITS_##fs);	\
+      /* First round.  Since the operands are normalized, either the	\
+	 first or second bit will be set in the fraction.  Produce a	\
+	 normalized result by checking which and adjusting the loop	\
+	 count and exponent accordingly.  */				\
+      if (_FP_FRAC_GE_1 (_FP_DIV_MEAT_N_loop_u, _FP_DIV_MEAT_N_loop_v))	\
+	{								\
+	  _FP_FRAC_SUB_##wc (_FP_DIV_MEAT_N_loop_u,			\
+			     _FP_DIV_MEAT_N_loop_u,			\
+			     _FP_DIV_MEAT_N_loop_v);			\
+	  _FP_FRAC_LOW_##wc (R) |= 1;					\
+	  _FP_DIV_MEAT_N_loop_count--;					\
+	}								\
+      else								\
+	R##_e--;							\
+      /* Subsequent rounds.  */						\
+      do								\
+	{								\
+	  int _FP_DIV_MEAT_N_loop_msb					\
+	    = (_FP_WS_TYPE) _FP_FRAC_HIGH_##wc (_FP_DIV_MEAT_N_loop_u) < 0; \
+	  _FP_FRAC_SLL_##wc (_FP_DIV_MEAT_N_loop_u, 1);			\
+	  _FP_FRAC_SLL_##wc (R, 1);					\
+	  if (_FP_DIV_MEAT_N_loop_msb					\
+	      || _FP_FRAC_GE_1 (_FP_DIV_MEAT_N_loop_u,			\
+				_FP_DIV_MEAT_N_loop_v))			\
+	    {								\
+	      _FP_FRAC_SUB_##wc (_FP_DIV_MEAT_N_loop_u,			\
+				 _FP_DIV_MEAT_N_loop_u,			\
+				 _FP_DIV_MEAT_N_loop_v);		\
+	      _FP_FRAC_LOW_##wc (R) |= 1;				\
+	    }								\
+	}								\
+      while (--_FP_DIV_MEAT_N_loop_count > 0);				\
+      /* If there's anything left in _FP_DIV_MEAT_N_LOOP_U, the result	\
+	 is inexact.  */						\
+      _FP_FRAC_LOW_##wc (R)						\
+	|= !_FP_FRAC_ZEROP_##wc (_FP_DIV_MEAT_N_loop_u);		\
+    }									\
+  while (0)
+
+#define _FP_DIV_MEAT_1_loop(fs, R, X, Y)  _FP_DIV_MEAT_N_loop (fs, 1, R, X, Y)
+#define _FP_DIV_MEAT_2_loop(fs, R, X, Y)  _FP_DIV_MEAT_N_loop (fs, 2, R, X, Y)
+#define _FP_DIV_MEAT_4_loop(fs, R, X, Y)  _FP_DIV_MEAT_N_loop (fs, 4, R, X, Y)
 
 #endif /* __MATH_EMU_OP_COMMON_H__ */
diff --git a/include/math-emu/quad.h b/include/math-emu/quad.h
index 6161136..367c86c 100644
--- a/include/math-emu/quad.h
+++ b/include/math-emu/quad.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Definitions for IEEE Quad Precision.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,31 +8,41 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef  __MATH_EMU_QUAD_H__
 #define  __MATH_EMU_QUAD_H__
 
 #if _FP_W_TYPE_SIZE < 32
-#error "Here's a nickel, kid. Go buy yourself a real computer."
+# error "Here's a nickel, kid. Go buy yourself a real computer."
 #endif
 
 #if _FP_W_TYPE_SIZE < 64
-#define _FP_FRACTBITS_Q         (4*_FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_Q	(4*_FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_DW_Q	(8*_FP_W_TYPE_SIZE)
 #else
-#define _FP_FRACTBITS_Q		(2*_FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_Q		(2*_FP_W_TYPE_SIZE)
+# define _FP_FRACTBITS_DW_Q	(4*_FP_W_TYPE_SIZE)
 #endif
 
 #define _FP_FRACBITS_Q		113
@@ -44,164 +54,276 @@
 #define _FP_EXPMAX_Q		32767
 
 #define _FP_QNANBIT_Q		\
-	((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-2) % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_Q-2) % _FP_W_TYPE_SIZE)
+#define _FP_QNANBIT_SH_Q		\
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_Q-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
 #define _FP_IMPLBIT_Q		\
-	((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-1) % _FP_W_TYPE_SIZE)
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_Q-1) % _FP_W_TYPE_SIZE)
+#define _FP_IMPLBIT_SH_Q		\
+	((_FP_W_TYPE) 1 << (_FP_FRACBITS_Q-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
 #define _FP_OVERFLOW_Q		\
-	((_FP_W_TYPE)1 << (_FP_WFRACBITS_Q % _FP_W_TYPE_SIZE))
+	((_FP_W_TYPE) 1 << (_FP_WFRACBITS_Q % _FP_W_TYPE_SIZE))
+
+#define _FP_WFRACBITS_DW_Q	(2 * _FP_WFRACBITS_Q)
+#define _FP_WFRACXBITS_DW_Q	(_FP_FRACTBITS_DW_Q - _FP_WFRACBITS_DW_Q)
+#define _FP_HIGHBIT_DW_Q	\
+  ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_DW_Q - 1) % _FP_W_TYPE_SIZE)
+
+typedef float TFtype __attribute__ ((mode (TF)));
 
 #if _FP_W_TYPE_SIZE < 64
 
 union _FP_UNION_Q
 {
-   long double flt;
-   struct 
-   {
-#if __BYTE_ORDER == __BIG_ENDIAN
-      unsigned sign : 1;
-      unsigned exp : _FP_EXPBITS_Q;
-      unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
-      unsigned long frac2 : _FP_W_TYPE_SIZE;
-      unsigned long frac1 : _FP_W_TYPE_SIZE;
-      unsigned long frac0 : _FP_W_TYPE_SIZE;
-#else
-      unsigned long frac0 : _FP_W_TYPE_SIZE;
-      unsigned long frac1 : _FP_W_TYPE_SIZE;
-      unsigned long frac2 : _FP_W_TYPE_SIZE;
-      unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
-      unsigned exp : _FP_EXPBITS_Q;
-      unsigned sign : 1;
-#endif /* not bigendian */
-   } bits __attribute__((packed));
+  TFtype flt;
+  struct _FP_STRUCT_LAYOUT
+  {
+# if __BYTE_ORDER == __BIG_ENDIAN
+    unsigned sign : 1;
+    unsigned exp : _FP_EXPBITS_Q;
+    unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
+    unsigned long frac2 : _FP_W_TYPE_SIZE;
+    unsigned long frac1 : _FP_W_TYPE_SIZE;
+    unsigned long frac0 : _FP_W_TYPE_SIZE;
+# else
+    unsigned long frac0 : _FP_W_TYPE_SIZE;
+    unsigned long frac1 : _FP_W_TYPE_SIZE;
+    unsigned long frac2 : _FP_W_TYPE_SIZE;
+    unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3);
+    unsigned exp : _FP_EXPBITS_Q;
+    unsigned sign : 1;
+# endif /* not bigendian */
+  } bits __attribute__ ((packed));
 };
 
 
-#define FP_DECL_Q(X)		_FP_DECL(4,X)
-#define FP_UNPACK_RAW_Q(X,val)	_FP_UNPACK_RAW_4(Q,X,val)
-#define FP_UNPACK_RAW_QP(X,val)	_FP_UNPACK_RAW_4_P(Q,X,val)
-#define FP_PACK_RAW_Q(val,X)	_FP_PACK_RAW_4(Q,val,X)
-#define FP_PACK_RAW_QP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_4_P(Q,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_Q(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_4(Q,X,val);		\
-    _FP_UNPACK_CANONICAL(Q,4,X);	\
-  } while (0)
-
-#define FP_UNPACK_QP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_4_P(Q,X,val);	\
-    _FP_UNPACK_CANONICAL(Q,4,X);	\
-  } while (0)
-
-#define FP_PACK_Q(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(Q,4,X);		\
-    _FP_PACK_RAW_4(Q,val,X);		\
-  } while (0)
-
-#define FP_PACK_QP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(Q,4,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_4_P(Q,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN(Q,4,X)
-#define FP_NEG_Q(R,X)			_FP_NEG(Q,4,R,X)
-#define FP_ADD_Q(R,X,Y)			_FP_ADD(Q,4,R,X,Y)
-#define FP_SUB_Q(R,X,Y)			_FP_SUB(Q,4,R,X,Y)
-#define FP_MUL_Q(R,X,Y)			_FP_MUL(Q,4,R,X,Y)
-#define FP_DIV_Q(R,X,Y)			_FP_DIV(Q,4,R,X,Y)
-#define FP_SQRT_Q(R,X)			_FP_SQRT(Q,4,R,X)
-#define _FP_SQRT_MEAT_Q(R,S,T,X,Q)	_FP_SQRT_MEAT_4(R,S,T,X,Q)
-
-#define FP_CMP_Q(r,X,Y,un)	_FP_CMP(Q,4,r,X,Y,un)
-#define FP_CMP_EQ_Q(r,X,Y)	_FP_CMP_EQ(Q,4,r,X,Y)
-
-#define FP_TO_INT_Q(r,X,rsz,rsg)	_FP_TO_INT(Q,4,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_Q(r,X,rsz,rsg)	_FP_TO_INT_ROUND(Q,4,r,X,rsz,rsg)
-#define FP_FROM_INT_Q(X,r,rs,rt)	_FP_FROM_INT(Q,4,X,r,rs,rt)
-
-#define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_4(X)
-#define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_4(X)
+# define FP_DECL_Q(X)		_FP_DECL (4, X)
+# define FP_UNPACK_RAW_Q(X, val)	_FP_UNPACK_RAW_4 (Q, X, (val))
+# define FP_UNPACK_RAW_QP(X, val)	_FP_UNPACK_RAW_4_P (Q, X, (val))
+# define FP_PACK_RAW_Q(val, X)	_FP_PACK_RAW_4 (Q, (val), X)
+# define FP_PACK_RAW_QP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_4_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_Q(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_4 (Q, X, (val));		\
+      _FP_UNPACK_CANONICAL (Q, 4, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_QP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_4_P (Q, X, (val));		\
+      _FP_UNPACK_CANONICAL (Q, 4, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_Q(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_4 (Q, X, (val));		\
+      _FP_UNPACK_SEMIRAW (Q, 4, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_QP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_4_P (Q, X, (val));		\
+      _FP_UNPACK_SEMIRAW (Q, 4, X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_Q(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (Q, 4, X);		\
+      _FP_PACK_RAW_4 (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_QP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (Q, 4, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_4_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_Q(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (Q, 4, X);		\
+      _FP_PACK_RAW_4 (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_QP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (Q, 4, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_4_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN (Q, 4, X)
+# define FP_NEG_Q(R, X)			_FP_NEG (Q, 4, R, X)
+# define FP_ADD_Q(R, X, Y)		_FP_ADD (Q, 4, R, X, Y)
+# define FP_SUB_Q(R, X, Y)		_FP_SUB (Q, 4, R, X, Y)
+# define FP_MUL_Q(R, X, Y)		_FP_MUL (Q, 4, R, X, Y)
+# define FP_DIV_Q(R, X, Y)		_FP_DIV (Q, 4, R, X, Y)
+# define FP_SQRT_Q(R, X)		_FP_SQRT (Q, 4, R, X)
+# define _FP_SQRT_MEAT_Q(R, S, T, X, Q)	_FP_SQRT_MEAT_4 (R, S, T, X, (Q))
+# define FP_FMA_Q(R, X, Y, Z)		_FP_FMA (Q, 4, 8, R, X, Y, Z)
+
+# define FP_CMP_Q(r, X, Y, un, ex)	_FP_CMP (Q, 4, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_Q(r, X, Y, ex)	_FP_CMP_EQ (Q, 4, (r), X, Y, (ex))
+# define FP_CMP_UNORD_Q(r, X, Y, ex)	_FP_CMP_UNORD (Q, 4, (r), X, Y, (ex))
+
+# define FP_TO_INT_Q(r, X, rsz, rsg)	_FP_TO_INT (Q, 4, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_Q(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (Q, 4, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_Q(X, r, rs, rt)	_FP_FROM_INT (Q, 4, X, (r), (rs), rt)
+
+# define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_4 (X)
+# define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_4 (X)
+
+# define _FP_FRAC_HIGH_DW_Q(X)	_FP_FRAC_HIGH_8 (X)
 
 #else   /* not _FP_W_TYPE_SIZE < 64 */
 union _FP_UNION_Q
 {
-  long double flt /* __attribute__((mode(TF))) */ ;
-  struct {
-#if __BYTE_ORDER == __BIG_ENDIAN
-    unsigned sign  : 1;
-    unsigned exp   : _FP_EXPBITS_Q;
-    unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
-    unsigned long frac0 : _FP_W_TYPE_SIZE;
-#else
-    unsigned long frac0 : _FP_W_TYPE_SIZE;
-    unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
-    unsigned exp   : _FP_EXPBITS_Q;
-    unsigned sign  : 1;
-#endif
+  TFtype flt /* __attribute__ ((mode (TF))) */ ;
+  struct _FP_STRUCT_LAYOUT
+  {
+    _FP_W_TYPE a, b;
+  } longs;
+  struct _FP_STRUCT_LAYOUT
+  {
+# if __BYTE_ORDER == __BIG_ENDIAN
+    unsigned sign    : 1;
+    unsigned exp     : _FP_EXPBITS_Q;
+    _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
+    _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
+# else
+    _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
+    _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
+    unsigned exp     : _FP_EXPBITS_Q;
+    unsigned sign    : 1;
+# endif
   } bits;
 };
 
-#define FP_DECL_Q(X)		_FP_DECL(2,X)
-#define FP_UNPACK_RAW_Q(X,val)	_FP_UNPACK_RAW_2(Q,X,val)
-#define FP_UNPACK_RAW_QP(X,val)	_FP_UNPACK_RAW_2_P(Q,X,val)
-#define FP_PACK_RAW_Q(val,X)	_FP_PACK_RAW_2(Q,val,X)
-#define FP_PACK_RAW_QP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_2_P(Q,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_Q(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_2(Q,X,val);		\
-    _FP_UNPACK_CANONICAL(Q,2,X);	\
-  } while (0)
-
-#define FP_UNPACK_QP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_2_P(Q,X,val);	\
-    _FP_UNPACK_CANONICAL(Q,2,X);	\
-  } while (0)
-
-#define FP_PACK_Q(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(Q,2,X);		\
-    _FP_PACK_RAW_2(Q,val,X);		\
-  } while (0)
-
-#define FP_PACK_QP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(Q,2,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_2_P(Q,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN(Q,2,X)
-#define FP_NEG_Q(R,X)			_FP_NEG(Q,2,R,X)
-#define FP_ADD_Q(R,X,Y)			_FP_ADD(Q,2,R,X,Y)
-#define FP_SUB_Q(R,X,Y)			_FP_SUB(Q,2,R,X,Y)
-#define FP_MUL_Q(R,X,Y)			_FP_MUL(Q,2,R,X,Y)
-#define FP_DIV_Q(R,X,Y)			_FP_DIV(Q,2,R,X,Y)
-#define FP_SQRT_Q(R,X)			_FP_SQRT(Q,2,R,X)
-#define _FP_SQRT_MEAT_Q(R,S,T,X,Q)	_FP_SQRT_MEAT_2(R,S,T,X,Q)
-
-#define FP_CMP_Q(r,X,Y,un)	_FP_CMP(Q,2,r,X,Y,un)
-#define FP_CMP_EQ_Q(r,X,Y)	_FP_CMP_EQ(Q,2,r,X,Y)
-
-#define FP_TO_INT_Q(r,X,rsz,rsg)	_FP_TO_INT(Q,2,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_Q(r,X,rsz,rsg)	_FP_TO_INT_ROUND(Q,2,r,X,rsz,rsg)
-#define FP_FROM_INT_Q(X,r,rs,rt)	_FP_FROM_INT(Q,2,X,r,rs,rt)
-
-#define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_2(X)
-#define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_2(X)
+# define FP_DECL_Q(X)		_FP_DECL (2, X)
+# define FP_UNPACK_RAW_Q(X, val)	_FP_UNPACK_RAW_2 (Q, X, (val))
+# define FP_UNPACK_RAW_QP(X, val)	_FP_UNPACK_RAW_2_P (Q, X, (val))
+# define FP_PACK_RAW_Q(val, X)	_FP_PACK_RAW_2 (Q, (val), X)
+# define FP_PACK_RAW_QP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_Q(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2 (Q, X, (val));		\
+      _FP_UNPACK_CANONICAL (Q, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_QP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2_P (Q, X, (val));		\
+      _FP_UNPACK_CANONICAL (Q, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_Q(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2 (Q, X, (val));		\
+      _FP_UNPACK_SEMIRAW (Q, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_UNPACK_SEMIRAW_QP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_2_P (Q, X, (val));		\
+      _FP_UNPACK_SEMIRAW (Q, 2, X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_Q(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (Q, 2, X);		\
+      _FP_PACK_RAW_2 (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_QP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (Q, 2, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_Q(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (Q, 2, X);		\
+      _FP_PACK_RAW_2 (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_PACK_SEMIRAW_QP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (Q, 2, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_2_P (Q, (val), X);		\
+    }						\
+  while (0)
+
+# define FP_ISSIGNAN_Q(X)		_FP_ISSIGNAN (Q, 2, X)
+# define FP_NEG_Q(R, X)			_FP_NEG (Q, 2, R, X)
+# define FP_ADD_Q(R, X, Y)		_FP_ADD (Q, 2, R, X, Y)
+# define FP_SUB_Q(R, X, Y)		_FP_SUB (Q, 2, R, X, Y)
+# define FP_MUL_Q(R, X, Y)		_FP_MUL (Q, 2, R, X, Y)
+# define FP_DIV_Q(R, X, Y)		_FP_DIV (Q, 2, R, X, Y)
+# define FP_SQRT_Q(R, X)		_FP_SQRT (Q, 2, R, X)
+# define _FP_SQRT_MEAT_Q(R, S, T, X, Q)	_FP_SQRT_MEAT_2 (R, S, T, X, (Q))
+# define FP_FMA_Q(R, X, Y, Z)		_FP_FMA (Q, 2, 4, R, X, Y, Z)
+
+# define FP_CMP_Q(r, X, Y, un, ex)	_FP_CMP (Q, 2, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_Q(r, X, Y, ex)	_FP_CMP_EQ (Q, 2, (r), X, Y, (ex))
+# define FP_CMP_UNORD_Q(r, X, Y, ex)	_FP_CMP_UNORD (Q, 2, (r), X, Y, (ex))
+
+# define FP_TO_INT_Q(r, X, rsz, rsg)	_FP_TO_INT (Q, 2, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_Q(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (Q, 2, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_Q(X, r, rs, rt)	_FP_FROM_INT (Q, 2, X, (r), (rs), rt)
+
+# define _FP_FRAC_HIGH_Q(X)	_FP_FRAC_HIGH_2 (X)
+# define _FP_FRAC_HIGH_RAW_Q(X)	_FP_FRAC_HIGH_2 (X)
+
+# define _FP_FRAC_HIGH_DW_Q(X)	_FP_FRAC_HIGH_4 (X)
 
 #endif /* not _FP_W_TYPE_SIZE < 64 */
 
diff --git a/include/math-emu/single.h b/include/math-emu/single.h
index 87f90b0..9975e00 100644
--- a/include/math-emu/single.h
+++ b/include/math-emu/single.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Definitions for IEEE Single Precision.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -8,45 +8,71 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef    __MATH_EMU_SINGLE_H__
 #define    __MATH_EMU_SINGLE_H__
 
 #if _FP_W_TYPE_SIZE < 32
-#error "Here's a nickel kid.  Go buy yourself a real computer."
+# error "Here's a nickel kid.  Go buy yourself a real computer."
+#endif
+
+#define _FP_FRACTBITS_S		_FP_W_TYPE_SIZE
+
+#if _FP_W_TYPE_SIZE < 64
+# define _FP_FRACTBITS_DW_S	(2 * _FP_W_TYPE_SIZE)
+#else
+# define _FP_FRACTBITS_DW_S	_FP_W_TYPE_SIZE
 #endif
 
 #define _FP_FRACBITS_S		24
-#define _FP_FRACXBITS_S		(_FP_W_TYPE_SIZE - _FP_FRACBITS_S)
+#define _FP_FRACXBITS_S		(_FP_FRACTBITS_S - _FP_FRACBITS_S)
 #define _FP_WFRACBITS_S		(_FP_WORKBITS + _FP_FRACBITS_S)
-#define _FP_WFRACXBITS_S	(_FP_W_TYPE_SIZE - _FP_WFRACBITS_S)
+#define _FP_WFRACXBITS_S	(_FP_FRACTBITS_S - _FP_WFRACBITS_S)
 #define _FP_EXPBITS_S		8
 #define _FP_EXPBIAS_S		127
 #define _FP_EXPMAX_S		255
-#define _FP_QNANBIT_S		((_FP_W_TYPE)1 << (_FP_FRACBITS_S-2))
-#define _FP_IMPLBIT_S		((_FP_W_TYPE)1 << (_FP_FRACBITS_S-1))
-#define _FP_OVERFLOW_S		((_FP_W_TYPE)1 << (_FP_WFRACBITS_S))
+#define _FP_QNANBIT_S		((_FP_W_TYPE) 1 << (_FP_FRACBITS_S-2))
+#define _FP_QNANBIT_SH_S	((_FP_W_TYPE) 1 << (_FP_FRACBITS_S-2+_FP_WORKBITS))
+#define _FP_IMPLBIT_S		((_FP_W_TYPE) 1 << (_FP_FRACBITS_S-1))
+#define _FP_IMPLBIT_SH_S	((_FP_W_TYPE) 1 << (_FP_FRACBITS_S-1+_FP_WORKBITS))
+#define _FP_OVERFLOW_S		((_FP_W_TYPE) 1 << (_FP_WFRACBITS_S))
+
+#define _FP_WFRACBITS_DW_S	(2 * _FP_WFRACBITS_S)
+#define _FP_WFRACXBITS_DW_S	(_FP_FRACTBITS_DW_S - _FP_WFRACBITS_DW_S)
+#define _FP_HIGHBIT_DW_S	\
+  ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_DW_S - 1) % _FP_W_TYPE_SIZE)
 
 /* The implementation of _FP_MUL_MEAT_S and _FP_DIV_MEAT_S should be
    chosen by the target machine.  */
 
+typedef float SFtype __attribute__ ((mode (SF)));
+
 union _FP_UNION_S
 {
-  float flt;
-  struct {
+  SFtype flt;
+  struct _FP_STRUCT_LAYOUT
+  {
 #if __BYTE_ORDER == __BIG_ENDIAN
     unsigned sign : 1;
     unsigned exp  : _FP_EXPBITS_S;
@@ -56,61 +82,118 @@ union _FP_UNION_S
     unsigned exp  : _FP_EXPBITS_S;
     unsigned sign : 1;
 #endif
-  } bits __attribute__((packed));
+  } bits __attribute__ ((packed));
 };
 
-#define FP_DECL_S(X)		_FP_DECL(1,X)
-#define FP_UNPACK_RAW_S(X,val)	_FP_UNPACK_RAW_1(S,X,val)
-#define FP_UNPACK_RAW_SP(X,val)	_FP_UNPACK_RAW_1_P(S,X,val)
-#define FP_PACK_RAW_S(val,X)	_FP_PACK_RAW_1(S,val,X)
-#define FP_PACK_RAW_SP(val,X)		\
-  do {					\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_1_P(S,val,X);	\
-  } while (0)
-
-#define FP_UNPACK_S(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_1(S,X,val);		\
-    _FP_UNPACK_CANONICAL(S,1,X);	\
-  } while (0)
-
-#define FP_UNPACK_SP(X,val)		\
-  do {					\
-    _FP_UNPACK_RAW_1_P(S,X,val);	\
-    _FP_UNPACK_CANONICAL(S,1,X);	\
-  } while (0)
-
-#define FP_PACK_S(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(S,1,X);		\
-    _FP_PACK_RAW_1(S,val,X);		\
-  } while (0)
-
-#define FP_PACK_SP(val,X)		\
-  do {					\
-    _FP_PACK_CANONICAL(S,1,X);		\
-    if (!FP_INHIBIT_RESULTS)		\
-      _FP_PACK_RAW_1_P(S,val,X);	\
-  } while (0)
-
-#define FP_ISSIGNAN_S(X)		_FP_ISSIGNAN(S,1,X)
-#define FP_NEG_S(R,X)			_FP_NEG(S,1,R,X)
-#define FP_ADD_S(R,X,Y)			_FP_ADD(S,1,R,X,Y)
-#define FP_SUB_S(R,X,Y)			_FP_SUB(S,1,R,X,Y)
-#define FP_MUL_S(R,X,Y)			_FP_MUL(S,1,R,X,Y)
-#define FP_DIV_S(R,X,Y)			_FP_DIV(S,1,R,X,Y)
-#define FP_SQRT_S(R,X)			_FP_SQRT(S,1,R,X)
-#define _FP_SQRT_MEAT_S(R,S,T,X,Q)	_FP_SQRT_MEAT_1(R,S,T,X,Q)
-
-#define FP_CMP_S(r,X,Y,un)	_FP_CMP(S,1,r,X,Y,un)
-#define FP_CMP_EQ_S(r,X,Y)	_FP_CMP_EQ(S,1,r,X,Y)
-
-#define FP_TO_INT_S(r,X,rsz,rsg)	_FP_TO_INT(S,1,r,X,rsz,rsg)
-#define FP_TO_INT_ROUND_S(r,X,rsz,rsg)	_FP_TO_INT_ROUND(S,1,r,X,rsz,rsg)
-#define FP_FROM_INT_S(X,r,rs,rt)	_FP_FROM_INT(S,1,X,r,rs,rt)
-
-#define _FP_FRAC_HIGH_S(X)	_FP_FRAC_HIGH_1(X)
-#define _FP_FRAC_HIGH_RAW_S(X)	_FP_FRAC_HIGH_1(X)
+#define FP_DECL_S(X)		_FP_DECL (1, X)
+#define FP_UNPACK_RAW_S(X, val)	_FP_UNPACK_RAW_1 (S, X, (val))
+#define FP_UNPACK_RAW_SP(X, val)	_FP_UNPACK_RAW_1_P (S, X, (val))
+#define FP_PACK_RAW_S(val, X)	_FP_PACK_RAW_1 (S, (val), X)
+#define FP_PACK_RAW_SP(val, X)			\
+  do						\
+    {						\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_UNPACK_S(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1 (S, X, (val));		\
+      _FP_UNPACK_CANONICAL (S, 1, X);		\
+    }						\
+  while (0)
+
+#define FP_UNPACK_SP(X, val)			\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1_P (S, X, (val));		\
+      _FP_UNPACK_CANONICAL (S, 1, X);		\
+    }						\
+  while (0)
+
+#define FP_UNPACK_SEMIRAW_S(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1 (S, X, (val));		\
+      _FP_UNPACK_SEMIRAW (S, 1, X);		\
+    }						\
+  while (0)
+
+#define FP_UNPACK_SEMIRAW_SP(X, val)		\
+  do						\
+    {						\
+      _FP_UNPACK_RAW_1_P (S, X, (val));		\
+      _FP_UNPACK_SEMIRAW (S, 1, X);		\
+    }						\
+  while (0)
+
+#define FP_PACK_S(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (S, 1, X);		\
+      _FP_PACK_RAW_1 (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_PACK_SP(val, X)			\
+  do						\
+    {						\
+      _FP_PACK_CANONICAL (S, 1, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_PACK_SEMIRAW_S(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (S, 1, X);		\
+      _FP_PACK_RAW_1 (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_PACK_SEMIRAW_SP(val, X)		\
+  do						\
+    {						\
+      _FP_PACK_SEMIRAW (S, 1, X);		\
+      if (!FP_INHIBIT_RESULTS)			\
+	_FP_PACK_RAW_1_P (S, (val), X);		\
+    }						\
+  while (0)
+
+#define FP_ISSIGNAN_S(X)		_FP_ISSIGNAN (S, 1, X)
+#define FP_NEG_S(R, X)			_FP_NEG (S, 1, R, X)
+#define FP_ADD_S(R, X, Y)		_FP_ADD (S, 1, R, X, Y)
+#define FP_SUB_S(R, X, Y)		_FP_SUB (S, 1, R, X, Y)
+#define FP_MUL_S(R, X, Y)		_FP_MUL (S, 1, R, X, Y)
+#define FP_DIV_S(R, X, Y)		_FP_DIV (S, 1, R, X, Y)
+#define FP_SQRT_S(R, X)			_FP_SQRT (S, 1, R, X)
+#define _FP_SQRT_MEAT_S(R, S, T, X, Q)	_FP_SQRT_MEAT_1 (R, S, T, X, (Q))
+
+#if _FP_W_TYPE_SIZE < 64
+# define FP_FMA_S(R, X, Y, Z)	_FP_FMA (S, 1, 2, R, X, Y, Z)
+#else
+# define FP_FMA_S(R, X, Y, Z)	_FP_FMA (S, 1, 1, R, X, Y, Z)
+#endif
+
+#define FP_CMP_S(r, X, Y, un, ex)	_FP_CMP (S, 1, (r), X, Y, (un), (ex))
+#define FP_CMP_EQ_S(r, X, Y, ex)	_FP_CMP_EQ (S, 1, (r), X, Y, (ex))
+#define FP_CMP_UNORD_S(r, X, Y, ex)	_FP_CMP_UNORD (S, 1, (r), X, Y, (ex))
+
+#define FP_TO_INT_S(r, X, rsz, rsg)	_FP_TO_INT (S, 1, (r), X, (rsz), (rsg))
+#define FP_TO_INT_ROUND_S(r, X, rsz, rsg)	\
+  _FP_TO_INT_ROUND (S, 1, (r), X, (rsz), (rsg))
+#define FP_FROM_INT_S(X, r, rs, rt)	_FP_FROM_INT (S, 1, X, (r), (rs), rt)
+
+#define _FP_FRAC_HIGH_S(X)	_FP_FRAC_HIGH_1 (X)
+#define _FP_FRAC_HIGH_RAW_S(X)	_FP_FRAC_HIGH_1 (X)
+
+#if _FP_W_TYPE_SIZE < 64
+# define _FP_FRAC_HIGH_DW_S(X)	_FP_FRAC_HIGH_2 (X)
+#else
+# define _FP_FRAC_HIGH_DW_S(X)	_FP_FRAC_HIGH_1 (X)
+#endif
 
 #endif /* __MATH_EMU_SINGLE_H__ */
diff --git a/include/math-emu/soft-fp.h b/include/math-emu/soft-fp.h
index 3f284bc..2283dcd 100644
--- a/include/math-emu/soft-fp.h
+++ b/include/math-emu/soft-fp.h
@@ -1,5 +1,5 @@
 /* Software floating-point emulation.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -7,201 +7,329 @@
 		  Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file into
+   combinations with other programs, and to distribute those
+   combinations without any restriction coming from the use of this
+   file.  (The Lesser General Public License restrictions do apply in
+   other respects; for example, they cover modification of the file,
+   and distribution when not linked into a combine executable.)
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef __MATH_EMU_SOFT_FP_H__
 #define __MATH_EMU_SOFT_FP_H__
 
-#include <asm/sfp-machine.h>
+#ifdef _LIBC
+# include <sfp-machine.h>
+#elif defined __KERNEL__
+# include <asm/sfp-machine.h>
+#else
+# include "sfp-machine.h"
+#endif
 
-/* Allow sfp-machine to have its own byte order definitions. */
+/* Allow sfp-machine to have its own byte order definitions.  */
 #ifndef __BYTE_ORDER
-#include <endian.h>
+# ifdef _LIBC
+#  include <endian.h>
+# else
+#  error "endianness not defined by sfp-machine.h"
+# endif
 #endif
 
 #define _FP_WORKBITS		3
-#define _FP_WORK_LSB		((_FP_W_TYPE)1 << 3)
-#define _FP_WORK_ROUND		((_FP_W_TYPE)1 << 2)
-#define _FP_WORK_GUARD		((_FP_W_TYPE)1 << 1)
-#define _FP_WORK_STICKY		((_FP_W_TYPE)1 << 0)
+#define _FP_WORK_LSB		((_FP_W_TYPE) 1 << 3)
+#define _FP_WORK_ROUND		((_FP_W_TYPE) 1 << 2)
+#define _FP_WORK_GUARD		((_FP_W_TYPE) 1 << 1)
+#define _FP_WORK_STICKY		((_FP_W_TYPE) 1 << 0)
 
 #ifndef FP_RND_NEAREST
 # define FP_RND_NEAREST		0
 # define FP_RND_ZERO		1
 # define FP_RND_PINF		2
 # define FP_RND_MINF		3
+#endif
 #ifndef FP_ROUNDMODE
 # define FP_ROUNDMODE		FP_RND_NEAREST
 #endif
-#endif
 
-/* By default don't care about exceptions. */
+/* By default don't care about exceptions.  */
 #ifndef FP_EX_INVALID
-#define FP_EX_INVALID		0
+# define FP_EX_INVALID		0
 #endif
-#ifndef FP_EX_INVALID_SNAN
-#define FP_EX_INVALID_SNAN	0
+#ifndef FP_EX_OVERFLOW
+# define FP_EX_OVERFLOW		0
 #endif
-/* inf - inf */
-#ifndef FP_EX_INVALID_ISI
-#define FP_EX_INVALID_ISI	0
+#ifndef FP_EX_UNDERFLOW
+# define FP_EX_UNDERFLOW	0
 #endif
-/* inf / inf */
-#ifndef FP_EX_INVALID_IDI
-#define FP_EX_INVALID_IDI	0
+#ifndef FP_EX_DIVZERO
+# define FP_EX_DIVZERO		0
 #endif
-/* 0 / 0 */
-#ifndef FP_EX_INVALID_ZDZ
-#define FP_EX_INVALID_ZDZ	0
+#ifndef FP_EX_INEXACT
+# define FP_EX_INEXACT		0
+#endif
+#ifndef FP_EX_DENORM
+# define FP_EX_DENORM		0
 #endif
-/* inf * 0 */
+
+/* Sub-exceptions of "invalid".  */
+/* Signaling NaN operand.  */
+#ifndef FP_EX_INVALID_SNAN
+# define FP_EX_INVALID_SNAN	0
+#endif
+/* Inf * 0.  */
 #ifndef FP_EX_INVALID_IMZ
-#define FP_EX_INVALID_IMZ	0
+# define FP_EX_INVALID_IMZ	0
 #endif
-#ifndef FP_EX_OVERFLOW
-#define FP_EX_OVERFLOW		0
+/* fma (Inf, 0, c).  */
+#ifndef FP_EX_INVALID_IMZ_FMA
+# define FP_EX_INVALID_IMZ_FMA	0
 #endif
-#ifndef FP_EX_UNDERFLOW
-#define FP_EX_UNDERFLOW		
+/* Inf - Inf.  */
+#ifndef FP_EX_INVALID_ISI
+# define FP_EX_INVALID_ISI	0
 #endif
-#ifndef FP_EX_DIVZERO
-#define FP_EX_DIVZERO		0
+/* 0 / 0.  */
+#ifndef FP_EX_INVALID_ZDZ
+# define FP_EX_INVALID_ZDZ	0
 #endif
-#ifndef FP_EX_INEXACT
-#define FP_EX_INEXACT		0
+/* Inf / Inf.  */
+#ifndef FP_EX_INVALID_IDI
+# define FP_EX_INVALID_IDI	0
 #endif
-#ifndef FP_EX_DENORM
-#define FP_EX_DENORM		0
+/* sqrt (negative).  */
+#ifndef FP_EX_INVALID_SQRT
+# define FP_EX_INVALID_SQRT	0
+#endif
+/* Invalid conversion to integer.  */
+#ifndef FP_EX_INVALID_CVI
+# define FP_EX_INVALID_CVI	0
+#endif
+/* Invalid comparison.  */
+#ifndef FP_EX_INVALID_VC
+# define FP_EX_INVALID_VC	0
+#endif
+
+/* _FP_STRUCT_LAYOUT may be defined as an attribute to determine the
+   struct layout variant used for structures where bit-fields are used
+   to access specific parts of binary floating-point numbers.  This is
+   required for systems where the default ABI uses struct layout with
+   differences in how consecutive bit-fields are laid out from the
+   default expected by soft-fp.  */
+#ifndef _FP_STRUCT_LAYOUT
+# define _FP_STRUCT_LAYOUT
 #endif
 
 #ifdef _FP_DECL_EX
-#define FP_DECL_EX					\
+# define FP_DECL_EX					\
   int _fex = 0;						\
   _FP_DECL_EX
 #else
-#define FP_DECL_EX int _fex = 0
+# define FP_DECL_EX int _fex = 0
 #endif
-  
+
+/* Initialize any machine-specific state used in FP_ROUNDMODE,
+   FP_TRAPPING_EXCEPTIONS or FP_HANDLE_EXCEPTIONS.  */
 #ifndef FP_INIT_ROUNDMODE
-#define FP_INIT_ROUNDMODE do {} while (0)
+# define FP_INIT_ROUNDMODE do {} while (0)
+#endif
+
+/* Initialize any machine-specific state used in
+   FP_TRAPPING_EXCEPTIONS or FP_HANDLE_EXCEPTIONS.  */
+#ifndef FP_INIT_TRAPPING_EXCEPTIONS
+# define FP_INIT_TRAPPING_EXCEPTIONS FP_INIT_ROUNDMODE
+#endif
+
+/* Initialize any machine-specific state used in
+   FP_HANDLE_EXCEPTIONS.  */
+#ifndef FP_INIT_EXCEPTIONS
+# define FP_INIT_EXCEPTIONS FP_INIT_TRAPPING_EXCEPTIONS
 #endif
 
 #ifndef FP_HANDLE_EXCEPTIONS
-#define FP_HANDLE_EXCEPTIONS do {} while (0)
+# define FP_HANDLE_EXCEPTIONS do {} while (0)
 #endif
 
-/* By default we never flush denormal input operands to signed zero. */
+/* Whether to flush subnormal inputs to zero with the same sign.  */
 #ifndef FP_DENORM_ZERO
-#define FP_DENORM_ZERO 0
+# define FP_DENORM_ZERO 0
 #endif
 
 #ifndef FP_INHIBIT_RESULTS
 /* By default we write the results always.
- * sfp-machine may override this and e.g.
- * check if some exceptions are unmasked
- * and inhibit it in such a case.
- */
-#define FP_INHIBIT_RESULTS 0
-#endif
-
-#ifndef FP_TRAPPING_EXCEPTIONS
-#define FP_TRAPPING_EXCEPTIONS 0
+   sfp-machine may override this and e.g.
+   check if some exceptions are unmasked
+   and inhibit it in such a case.  */
+# define FP_INHIBIT_RESULTS 0
 #endif
 
 #define FP_SET_EXCEPTION(ex)				\
   _fex |= (ex)
-  
-#define FP_UNSET_EXCEPTION(ex)				\
-  _fex &= ~(ex)
 
 #define FP_CUR_EXCEPTIONS				\
   (_fex)
 
-#define FP_CLEAR_EXCEPTIONS				\
-  _fex = 0
+#ifndef FP_TRAPPING_EXCEPTIONS
+# define FP_TRAPPING_EXCEPTIONS 0
+#endif
+
+/* A file using soft-fp may define FP_NO_EXCEPTIONS before including
+   soft-fp.h to indicate that, although a macro used there could raise
+   exceptions, or do rounding and potentially thereby raise
+   exceptions, for some arguments, for the particular arguments used
+   in that file no exceptions or rounding can occur.  Such a file
+   should not itself use macros relating to handling exceptions and
+   rounding modes; this is only for indirect uses (in particular, in
+   _FP_FROM_INT and the macros it calls).  */
+#ifdef FP_NO_EXCEPTIONS
+
+# undef FP_SET_EXCEPTION
+# define FP_SET_EXCEPTION(ex) do {} while (0)
+
+# undef FP_CUR_EXCEPTIONS
+# define FP_CUR_EXCEPTIONS 0
 
-#define _FP_ROUND_NEAREST(wc, X)			\
-do {							\
-    if ((_FP_FRAC_LOW_##wc(X) & 15) != _FP_WORK_ROUND)	\
-      _FP_FRAC_ADDI_##wc(X, _FP_WORK_ROUND);		\
-} while (0)
+# undef FP_TRAPPING_EXCEPTIONS
+# define FP_TRAPPING_EXCEPTIONS 0
 
-#define _FP_ROUND_ZERO(wc, X)		0
+# undef FP_ROUNDMODE
+# define FP_ROUNDMODE FP_RND_ZERO
+
+# undef _FP_TININESS_AFTER_ROUNDING
+# define _FP_TININESS_AFTER_ROUNDING 0
+
+#endif
+
+/* A file using soft-fp may define FP_NO_EXACT_UNDERFLOW before
+   including soft-fp.h to indicate that, although a macro used there
+   could allow for the case of exact underflow requiring the underflow
+   exception to be raised if traps are enabled, for the particular
+   arguments used in that file no exact underflow can occur.  */
+#ifdef FP_NO_EXACT_UNDERFLOW
+# undef FP_TRAPPING_EXCEPTIONS
+# define FP_TRAPPING_EXCEPTIONS 0
+#endif
+
+#define _FP_ROUND_NEAREST(wc, X)				\
+  do								\
+    {								\
+      if ((_FP_FRAC_LOW_##wc (X) & 15) != _FP_WORK_ROUND)	\
+	_FP_FRAC_ADDI_##wc (X, _FP_WORK_ROUND);			\
+    }								\
+  while (0)
+
+#define _FP_ROUND_ZERO(wc, X)		(void) 0
 
 #define _FP_ROUND_PINF(wc, X)				\
-do {							\
-    if (!X##_s && (_FP_FRAC_LOW_##wc(X) & 7))		\
-      _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB);		\
-} while (0)
+  do							\
+    {							\
+      if (!X##_s && (_FP_FRAC_LOW_##wc (X) & 7))	\
+	_FP_FRAC_ADDI_##wc (X, _FP_WORK_LSB);		\
+    }							\
+  while (0)
 
-#define _FP_ROUND_MINF(wc, X)				\
-do {							\
-    if (X##_s && (_FP_FRAC_LOW_##wc(X) & 7))		\
-      _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB);		\
-} while (0)
+#define _FP_ROUND_MINF(wc, X)			\
+  do						\
+    {						\
+      if (X##_s && (_FP_FRAC_LOW_##wc (X) & 7))	\
+	_FP_FRAC_ADDI_##wc (X, _FP_WORK_LSB);	\
+    }						\
+  while (0)
 
 #define _FP_ROUND(wc, X)			\
-do {						\
-	if (_FP_FRAC_LOW_##wc(X) & 7)		\
-	  FP_SET_EXCEPTION(FP_EX_INEXACT);	\
-	switch (FP_ROUNDMODE)			\
+  do						\
+    {						\
+      if (_FP_FRAC_LOW_##wc (X) & 7)		\
 	{					\
-	  case FP_RND_NEAREST:			\
-	    _FP_ROUND_NEAREST(wc,X);		\
-	    break;				\
-	  case FP_RND_ZERO:			\
-	    _FP_ROUND_ZERO(wc,X);		\
-	    break;				\
-	  case FP_RND_PINF:			\
-	    _FP_ROUND_PINF(wc,X);		\
-	    break;				\
-	  case FP_RND_MINF:			\
-	    _FP_ROUND_MINF(wc,X);		\
-	    break;				\
+	  FP_SET_EXCEPTION (FP_EX_INEXACT);	\
+	  switch (FP_ROUNDMODE)			\
+	    {					\
+	    case FP_RND_NEAREST:		\
+	      _FP_ROUND_NEAREST (wc, X);	\
+	      break;				\
+	    case FP_RND_ZERO:			\
+	      _FP_ROUND_ZERO (wc, X);		\
+	      break;				\
+	    case FP_RND_PINF:			\
+	      _FP_ROUND_PINF (wc, X);		\
+	      break;				\
+	    case FP_RND_MINF:			\
+	      _FP_ROUND_MINF (wc, X);		\
+	      break;				\
+	    }					\
 	}					\
-} while (0)
+    }						\
+  while (0)
 
 #define FP_CLS_NORMAL		0
 #define FP_CLS_ZERO		1
 #define FP_CLS_INF		2
 #define FP_CLS_NAN		3
 
-#define _FP_CLS_COMBINE(x,y)	(((x) << 2) | (y))
+#define _FP_CLS_COMBINE(x, y)	(((x) << 2) | (y))
 
-#include <math-emu/op-1.h>
-#include <math-emu/op-2.h>
-#include <math-emu/op-4.h>
-#include <math-emu/op-8.h>
-#include <math-emu/op-common.h>
+#ifdef __KERNEL__
+# include <math-emu/op-1.h>
+# include <math-emu/op-2.h>
+# include <math-emu/op-4.h>
+# include <math-emu/op-8.h>
+# include <math-emu/op-common.h>
+#else
+# include "op-1.h"
+# include "op-2.h"
+# include "op-4.h"
+# include "op-8.h"
+# include "op-common.h"
+#endif
 
 /* Sigh.  Silly things longlong.h needs.  */
 #define UWtype		_FP_W_TYPE
 #define W_TYPE_SIZE	_FP_W_TYPE_SIZE
 
-typedef int SItype __attribute__((mode(SI)));
-typedef int DItype __attribute__((mode(DI)));
-typedef unsigned int USItype __attribute__((mode(SI)));
-typedef unsigned int UDItype __attribute__((mode(DI)));
+typedef int QItype __attribute__ ((mode (QI)));
+typedef int SItype __attribute__ ((mode (SI)));
+typedef int DItype __attribute__ ((mode (DI)));
+typedef unsigned int UQItype __attribute__ ((mode (QI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef unsigned int UDItype __attribute__ ((mode (DI)));
 #if _FP_W_TYPE_SIZE == 32
-typedef unsigned int UHWtype __attribute__((mode(HI)));
+typedef unsigned int UHWtype __attribute__ ((mode (HI)));
 #elif _FP_W_TYPE_SIZE == 64
 typedef USItype UHWtype;
 #endif
 
+#ifndef CMPtype
+# define CMPtype	int
+#endif
+
+#define SI_BITS		(__CHAR_BIT__ * (int) sizeof (SItype))
+#define DI_BITS		(__CHAR_BIT__ * (int) sizeof (DItype))
+
 #ifndef umul_ppmm
-#include <stdlib/longlong.h>
+# ifdef _LIBC
+#  include <stdlib/longlong.h>
+# else
+#  include "longlong.h"
+# endif
+#endif
+
+#ifdef _LIBC
+# include <stdlib.h>
+#elif !defined __KERNEL__
+extern void abort (void);
 #endif
 
 #endif /* __MATH_EMU_SOFT_FP_H__ */


-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
  2015-02-06 17:25 ` Joseph Myers
@ 2015-02-06 17:41   ` Randy Dunlap
  -1 siblings, 0 replies; 20+ messages in thread
From: Randy Dunlap @ 2015-02-06 17:41 UTC (permalink / raw)
  To: Joseph Myers, linux-kernel, linux-alpha, linuxppc-dev,
	linux-s390, linux-sh, sparclinux

On 02/06/15 09:25, Joseph Myers wrote:
> At this point this patch is an RFC rather than yet being ready for
> inclusion, because I've only tested it for powerpc (both e500 and
> emulation of classic hard float); it's quite likely there are bugs in
> the changes for other architectures, quite possibly breaking the
> build.  I've also posted it to libc-alpha
> <https://sourceware.org/ml/libc-alpha/2015-02/msg00107.html> with a
> call for testing and notes on what testing might be appropriate.

Is there a test suite?


and a diffstat is good to see:

 arch/alpha/include/asm/sfp-machine.h    |    3 
 arch/alpha/math-emu/math.c              |  131 -
 arch/powerpc/include/asm/sfp-machine.h  |   39 
 arch/powerpc/math-emu/fadd.c            |    6 
 arch/powerpc/math-emu/fadds.c           |    6 
 arch/powerpc/math-emu/fcmpo.c           |    2 
 arch/powerpc/math-emu/fcmpu.c           |    2 
 arch/powerpc/math-emu/fctiw.c           |    2 
 arch/powerpc/math-emu/fctiwz.c          |    2 
 arch/powerpc/math-emu/fmadd.c           |    8 
 arch/powerpc/math-emu/fmadds.c          |    8 
 arch/powerpc/math-emu/fmsub.c           |    8 
 arch/powerpc/math-emu/fmsubs.c          |    8 
 arch/powerpc/math-emu/fnmadd.c          |    8 
 arch/powerpc/math-emu/fnmadds.c         |    8 
 arch/powerpc/math-emu/fnmsub.c          |    8 
 arch/powerpc/math-emu/fnmsubs.c         |    8 
 arch/powerpc/math-emu/fsub.c            |    6 
 arch/powerpc/math-emu/fsubs.c           |    6 
 arch/powerpc/math-emu/lfs.c             |   11 
 arch/powerpc/math-emu/math_efp.c        |  254 +-
 arch/powerpc/math-emu/stfs.c            |    6 
 arch/s390/include/asm/sfp-machine.h     |   10 
 arch/s390/math-emu/math.c               |  278 +--
 arch/sh/include/asm/sfp-machine.h       |   10 
 arch/sh/math-emu/math.c                 |   51 
 arch/sparc/include/asm/sfp-machine_32.h |    3 
 arch/sparc/include/asm/sfp-machine_64.h |    3 
 arch/sparc/math-emu/math_32.c           |  144 -
 arch/sparc/math-emu/math_64.c           |  140 -
 include/math-emu/double.h               |  391 ++--
 include/math-emu/op-1.h                 |  546 +++---
 include/math-emu/op-2.h                 | 1127 ++++++------
 include/math-emu/op-4.h                 | 1449 ++++++++-------
 include/math-emu/op-8.h                 |  205 +-
 include/math-emu/op-common.h            | 2902 ++++++++++++++++++++++----------
 include/math-emu/quad.h                 |  428 +++-
 include/math-emu/single.h               |  225 +-
 include/math-emu/soft-fp.h              |  342 ++-
 39 files changed, 5495 insertions(+), 3299 deletions(-)




-- 
~Randy

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-06 17:41   ` Randy Dunlap
  0 siblings, 0 replies; 20+ messages in thread
From: Randy Dunlap @ 2015-02-06 17:41 UTC (permalink / raw)
  To: Joseph Myers, linux-kernel, linux-alpha, linuxppc-dev,
	linux-s390, linux-sh, sparclinux

On 02/06/15 09:25, Joseph Myers wrote:
> At this point this patch is an RFC rather than yet being ready for
> inclusion, because I've only tested it for powerpc (both e500 and
> emulation of classic hard float); it's quite likely there are bugs in
> the changes for other architectures, quite possibly breaking the
> build.  I've also posted it to libc-alpha
> <https://sourceware.org/ml/libc-alpha/2015-02/msg00107.html> with a
> call for testing and notes on what testing might be appropriate.

Is there a test suite?


and a diffstat is good to see:

 arch/alpha/include/asm/sfp-machine.h    |    3 
 arch/alpha/math-emu/math.c              |  131 -
 arch/powerpc/include/asm/sfp-machine.h  |   39 
 arch/powerpc/math-emu/fadd.c            |    6 
 arch/powerpc/math-emu/fadds.c           |    6 
 arch/powerpc/math-emu/fcmpo.c           |    2 
 arch/powerpc/math-emu/fcmpu.c           |    2 
 arch/powerpc/math-emu/fctiw.c           |    2 
 arch/powerpc/math-emu/fctiwz.c          |    2 
 arch/powerpc/math-emu/fmadd.c           |    8 
 arch/powerpc/math-emu/fmadds.c          |    8 
 arch/powerpc/math-emu/fmsub.c           |    8 
 arch/powerpc/math-emu/fmsubs.c          |    8 
 arch/powerpc/math-emu/fnmadd.c          |    8 
 arch/powerpc/math-emu/fnmadds.c         |    8 
 arch/powerpc/math-emu/fnmsub.c          |    8 
 arch/powerpc/math-emu/fnmsubs.c         |    8 
 arch/powerpc/math-emu/fsub.c            |    6 
 arch/powerpc/math-emu/fsubs.c           |    6 
 arch/powerpc/math-emu/lfs.c             |   11 
 arch/powerpc/math-emu/math_efp.c        |  254 +-
 arch/powerpc/math-emu/stfs.c            |    6 
 arch/s390/include/asm/sfp-machine.h     |   10 
 arch/s390/math-emu/math.c               |  278 +--
 arch/sh/include/asm/sfp-machine.h       |   10 
 arch/sh/math-emu/math.c                 |   51 
 arch/sparc/include/asm/sfp-machine_32.h |    3 
 arch/sparc/include/asm/sfp-machine_64.h |    3 
 arch/sparc/math-emu/math_32.c           |  144 -
 arch/sparc/math-emu/math_64.c           |  140 -
 include/math-emu/double.h               |  391 ++--
 include/math-emu/op-1.h                 |  546 +++---
 include/math-emu/op-2.h                 | 1127 ++++++------
 include/math-emu/op-4.h                 | 1449 ++++++++-------
 include/math-emu/op-8.h                 |  205 +-
 include/math-emu/op-common.h            | 2902 ++++++++++++++++++++++----------
 include/math-emu/quad.h                 |  428 +++-
 include/math-emu/single.h               |  225 +-
 include/math-emu/soft-fp.h              |  342 ++-
 39 files changed, 5495 insertions(+), 3299 deletions(-)




-- 
~Randy

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
  2015-02-06 17:41   ` Randy Dunlap
  (?)
  (?)
@ 2015-02-06 18:03     ` Joseph Myers
  -1 siblings, 0 replies; 20+ messages in thread
From: Joseph Myers @ 2015-02-06 18:03 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-s390, linux-sh, linux-kernel, linux-alpha, sparclinux,
	linuxppc-dev

On Fri, 6 Feb 2015, Randy Dunlap wrote:

> On 02/06/15 09:25, Joseph Myers wrote:
> > At this point this patch is an RFC rather than yet being ready for
> > inclusion, because I've only tested it for powerpc (both e500 and
> > emulation of classic hard float); it's quite likely there are bugs in
> > the changes for other architectures, quite possibly breaking the
> > build.  I've also posted it to libc-alpha
> > <https://sourceware.org/ml/libc-alpha/2015-02/msg00107.html> with a
> > call for testing and notes on what testing might be appropriate.
> 
> Is there a test suite?

In practice, the current glibc testsuite ("make math/tests" then look in 
math/subdir-tests.sum for FAILs and examine those in more detail - some 
may well be pre-existing and appear without my patch) provides pretty 
thorough coverage of basic floating-point operations.  There are at least 
two pre-existing bugs in the powerpc emulation that show up that way 
(running the testsuite, built for classic hard-float, on a processor where 
classic hard-float isn't supported in hardware), but as they are 
independent of this update I put them on my list of issues to look at 
later.  Various of the issues I fixed in Nov/Dec 2013 with the powerpc 
e500 SPE float emulation were also found through the glibc testsuite.

People have also used other testsuites such as TestFloat and ucbtest in 
the past to validate floating-point emulation (ucbtest was used to 
validate some of the past soft-fp changes, for example).  All of these end 
up testing some combination of compiler, library, hardware and kernel so 
it's not always immediately obvious where a failure is coming from.  If 
there are architectural tests of instruction semantics available, those 
could be used and might validate choices of results where they aren't 
fully specified by IEEE 754 (of course, the existing code may not always 
make such choices in a way that matches the hardware, either).  There 
isn't a testsuite specific to soft-fp.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-06 18:03     ` Joseph Myers
  0 siblings, 0 replies; 20+ messages in thread
From: Joseph Myers @ 2015-02-06 18:03 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, linux-alpha, linuxppc-dev, linux-s390, linux-sh,
	sparclinux

On Fri, 6 Feb 2015, Randy Dunlap wrote:

> On 02/06/15 09:25, Joseph Myers wrote:
> > At this point this patch is an RFC rather than yet being ready for
> > inclusion, because I've only tested it for powerpc (both e500 and
> > emulation of classic hard float); it's quite likely there are bugs in
> > the changes for other architectures, quite possibly breaking the
> > build.  I've also posted it to libc-alpha
> > <https://sourceware.org/ml/libc-alpha/2015-02/msg00107.html> with a
> > call for testing and notes on what testing might be appropriate.
> 
> Is there a test suite?

In practice, the current glibc testsuite ("make math/tests" then look in 
math/subdir-tests.sum for FAILs and examine those in more detail - some 
may well be pre-existing and appear without my patch) provides pretty 
thorough coverage of basic floating-point operations.  There are at least 
two pre-existing bugs in the powerpc emulation that show up that way 
(running the testsuite, built for classic hard-float, on a processor where 
classic hard-float isn't supported in hardware), but as they are 
independent of this update I put them on my list of issues to look at 
later.  Various of the issues I fixed in Nov/Dec 2013 with the powerpc 
e500 SPE float emulation were also found through the glibc testsuite.

People have also used other testsuites such as TestFloat and ucbtest in 
the past to validate floating-point emulation (ucbtest was used to 
validate some of the past soft-fp changes, for example).  All of these end 
up testing some combination of compiler, library, hardware and kernel so 
it's not always immediately obvious where a failure is coming from.  If 
there are architectural tests of instruction semantics available, those 
could be used and might validate choices of results where they aren't 
fully specified by IEEE 754 (of course, the existing code may not always 
make such choices in a way that matches the hardware, either).  There 
isn't a testsuite specific to soft-fp.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-06 18:03     ` Joseph Myers
  0 siblings, 0 replies; 20+ messages in thread
From: Joseph Myers @ 2015-02-06 18:03 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-s390, linux-sh, linux-kernel, linux-alpha, sparclinux,
	linuxppc-dev

On Fri, 6 Feb 2015, Randy Dunlap wrote:

> On 02/06/15 09:25, Joseph Myers wrote:
> > At this point this patch is an RFC rather than yet being ready for
> > inclusion, because I've only tested it for powerpc (both e500 and
> > emulation of classic hard float); it's quite likely there are bugs in
> > the changes for other architectures, quite possibly breaking the
> > build.  I've also posted it to libc-alpha
> > <https://sourceware.org/ml/libc-alpha/2015-02/msg00107.html> with a
> > call for testing and notes on what testing might be appropriate.
> 
> Is there a test suite?

In practice, the current glibc testsuite ("make math/tests" then look in 
math/subdir-tests.sum for FAILs and examine those in more detail - some 
may well be pre-existing and appear without my patch) provides pretty 
thorough coverage of basic floating-point operations.  There are at least 
two pre-existing bugs in the powerpc emulation that show up that way 
(running the testsuite, built for classic hard-float, on a processor where 
classic hard-float isn't supported in hardware), but as they are 
independent of this update I put them on my list of issues to look at 
later.  Various of the issues I fixed in Nov/Dec 2013 with the powerpc 
e500 SPE float emulation were also found through the glibc testsuite.

People have also used other testsuites such as TestFloat and ucbtest in 
the past to validate floating-point emulation (ucbtest was used to 
validate some of the past soft-fp changes, for example).  All of these end 
up testing some combination of compiler, library, hardware and kernel so 
it's not always immediately obvious where a failure is coming from.  If 
there are architectural tests of instruction semantics available, those 
could be used and might validate choices of results where they aren't 
fully specified by IEEE 754 (of course, the existing code may not always 
make such choices in a way that matches the hardware, either).  There 
isn't a testsuite specific to soft-fp.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-06 18:03     ` Joseph Myers
  0 siblings, 0 replies; 20+ messages in thread
From: Joseph Myers @ 2015-02-06 18:03 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, linux-alpha, linuxppc-dev, linux-s390, linux-sh,
	sparclinux

On Fri, 6 Feb 2015, Randy Dunlap wrote:

> On 02/06/15 09:25, Joseph Myers wrote:
> > At this point this patch is an RFC rather than yet being ready for
> > inclusion, because I've only tested it for powerpc (both e500 and
> > emulation of classic hard float); it's quite likely there are bugs in
> > the changes for other architectures, quite possibly breaking the
> > build.  I've also posted it to libc-alpha
> > <https://sourceware.org/ml/libc-alpha/2015-02/msg00107.html> with a
> > call for testing and notes on what testing might be appropriate.
> 
> Is there a test suite?

In practice, the current glibc testsuite ("make math/tests" then look in 
math/subdir-tests.sum for FAILs and examine those in more detail - some 
may well be pre-existing and appear without my patch) provides pretty 
thorough coverage of basic floating-point operations.  There are at least 
two pre-existing bugs in the powerpc emulation that show up that way 
(running the testsuite, built for classic hard-float, on a processor where 
classic hard-float isn't supported in hardware), but as they are 
independent of this update I put them on my list of issues to look at 
later.  Various of the issues I fixed in Nov/Dec 2013 with the powerpc 
e500 SPE float emulation were also found through the glibc testsuite.

People have also used other testsuites such as TestFloat and ucbtest in 
the past to validate floating-point emulation (ucbtest was used to 
validate some of the past soft-fp changes, for example).  All of these end 
up testing some combination of compiler, library, hardware and kernel so 
it's not always immediately obvious where a failure is coming from.  If 
there are architectural tests of instruction semantics available, those 
could be used and might validate choices of results where they aren't 
fully specified by IEEE 754 (of course, the existing code may not always 
make such choices in a way that matches the hardware, either).  There 
isn't a testsuite specific to soft-fp.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
  2015-02-06 17:25 ` Joseph Myers
@ 2015-02-19 18:21   ` David Miller
  -1 siblings, 0 replies; 20+ messages in thread
From: David Miller @ 2015-02-19 18:21 UTC (permalink / raw)
  To: joseph
  Cc: linux-s390, linux-sh, linux-kernel, linux-alpha, sparclinux,
	linuxppc-dev

[-- Attachment #1: Type: Text/Plain, Size: 812 bytes --]

From: Joseph Myers <joseph@codesourcery.com>
Date: Fri, 6 Feb 2015 17:25:29 +0000

> * On SPARC, comparisons now use raw unpacking (this should not in fact
>   change how the emulation behaves, just make it more efficient).

I did a sparc64 test build and it failed like so:

arch/sparc/math-emu/math_64.c: In function ‘do_mathemu’:
arch/sparc/math-emu/math_64.c:487:1: error: expected expression before ‘return’
arch/sparc/math-emu/math_64.c:488:1: error: expected expression before ‘return’
arch/sparc/math-emu/math_64.c:490:1: error: expected expression before ‘return’
arch/sparc/math-emu/math_64.c:491:1: error: expected expression before ‘return’
arch/sparc/math-emu/math_64.c:495:1: error: expected expression before ‘return’

I'm attaching a CPP processed math_64.c for your convenience:

[-- Attachment #2: math_64.i --]
[-- Type: Application/Octet-Stream, Size: 1117818 bytes --]

# 1 "arch/sparc/math-emu/math_64.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "././include/linux/kconfig.h" 1



# 1 "include/generated/autoconf.h" 1
# 5 "././include/linux/kconfig.h" 2
# 1 "<command-line>" 2
# 1 "arch/sparc/math-emu/math_64.c"
# 11 "arch/sparc/math-emu/math_64.c"
# 1 "include/linux/types.h" 1




# 1 "include/uapi/linux/types.h" 1



# 1 "arch/sparc/include/generated/asm/types.h" 1
# 1 "./include/uapi/asm-generic/types.h" 1





# 1 "include/asm-generic/int-ll64.h" 1
# 10 "include/asm-generic/int-ll64.h"
# 1 "include/uapi/asm-generic/int-ll64.h" 1
# 11 "include/uapi/asm-generic/int-ll64.h"
# 1 "./arch/sparc/include/uapi/asm/bitsperlong.h" 1
# 10 "./arch/sparc/include/uapi/asm/bitsperlong.h"
# 1 "include/asm-generic/bitsperlong.h" 1



# 1 "include/uapi/asm-generic/bitsperlong.h" 1
# 5 "include/asm-generic/bitsperlong.h" 2
# 11 "./arch/sparc/include/uapi/asm/bitsperlong.h" 2
# 12 "include/uapi/asm-generic/int-ll64.h" 2







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 11 "include/asm-generic/int-ll64.h" 2




typedef signed char s8;
typedef unsigned char u8;

typedef signed short s16;
typedef unsigned short u16;

typedef signed int s32;
typedef unsigned int u32;

typedef signed long long s64;
typedef unsigned long long u64;
# 7 "./include/uapi/asm-generic/types.h" 2
# 1 "arch/sparc/include/generated/asm/types.h" 2
# 5 "include/uapi/linux/types.h" 2
# 13 "include/uapi/linux/types.h"
# 1 "./include/uapi/linux/posix_types.h" 1



# 1 "include/linux/stddef.h" 1



# 1 "include/uapi/linux/stddef.h" 1
# 1 "include/linux/compiler.h" 1
# 54 "include/linux/compiler.h"
# 1 "include/linux/compiler-gcc.h" 1
# 107 "include/linux/compiler-gcc.h"
# 1 "include/linux/compiler-gcc4.h" 1
# 108 "include/linux/compiler-gcc.h" 2
# 55 "include/linux/compiler.h" 2
# 83 "include/linux/compiler.h"
struct ftrace_branch_data {
 const char *func;
 const char *file;
 unsigned line;
 union {
  struct {
   unsigned long correct;
   unsigned long incorrect;
  };
  struct {
   unsigned long miss;
   unsigned long hit;
  };
  unsigned long miss_hit[2];
 };
};
# 193 "include/linux/compiler.h"
# 1 "include/uapi/linux/types.h" 1
# 194 "include/linux/compiler.h" 2

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void data_access_exceeds_word_size(void)

__attribute__((warning("data access exceeds word size and won't be atomic")))

;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void data_access_exceeds_word_size(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __read_once_size(volatile void *p, void *res, int size)
{
 switch (size) {
 case 1: *(__u8 *)res = *(volatile __u8 *)p; break;
 case 2: *(__u16 *)res = *(volatile __u16 *)p; break;
 case 4: *(__u32 *)res = *(volatile __u32 *)p; break;

 case 8: *(__u64 *)res = *(volatile __u64 *)p; break;

 default:
  __asm__ __volatile__("": : :"memory");
  __builtin_memcpy((void *)res, (const void *)p, size);
  data_access_exceeds_word_size();
  __asm__ __volatile__("": : :"memory");
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __write_once_size(volatile void *p, void *res, int size)
{
 switch (size) {
 case 1: *(volatile __u8 *)p = *(__u8 *)res; break;
 case 2: *(volatile __u16 *)p = *(__u16 *)res; break;
 case 4: *(volatile __u32 *)p = *(__u32 *)res; break;

 case 8: *(volatile __u64 *)p = *(__u64 *)res; break;

 default:
  __asm__ __volatile__("": : :"memory");
  __builtin_memcpy((void *)p, (const void *)res, size);
  data_access_exceeds_word_size();
  __asm__ __volatile__("": : :"memory");
 }
}
# 1 "include/uapi/linux/stddef.h" 2
# 5 "include/linux/stddef.h" 2





enum {
 false = 0,
 true = 1
};
# 5 "./include/uapi/linux/posix_types.h" 2
# 24 "./include/uapi/linux/posix_types.h"
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "./arch/sparc/include/uapi/asm/posix_types.h" 1
# 13 "./arch/sparc/include/uapi/asm/posix_types.h"
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;



typedef int __kernel_suseconds_t;
# 47 "./arch/sparc/include/uapi/asm/posix_types.h"
# 1 "./include/uapi/asm-generic/posix_types.h" 1
# 14 "./include/uapi/asm-generic/posix_types.h"
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;







typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 58 "./include/uapi/asm-generic/posix_types.h"
typedef unsigned int __kernel_old_dev_t;
# 71 "./include/uapi/asm-generic/posix_types.h"
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_time_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 48 "./arch/sparc/include/uapi/asm/posix_types.h" 2
# 36 "./include/uapi/linux/posix_types.h" 2
# 14 "include/uapi/linux/types.h" 2
# 32 "include/uapi/linux/types.h"
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 6 "include/linux/types.h" 2






typedef __u32 __kernel_dev_t;

typedef __kernel_fd_set fd_set;
typedef __kernel_dev_t dev_t;
typedef __kernel_ino_t ino_t;
typedef __kernel_mode_t mode_t;
typedef unsigned short umode_t;
typedef __u32 nlink_t;
typedef __kernel_off_t off_t;
typedef __kernel_pid_t pid_t;
typedef __kernel_daddr_t daddr_t;
typedef __kernel_key_t key_t;
typedef __kernel_suseconds_t suseconds_t;
typedef __kernel_timer_t timer_t;
typedef __kernel_clockid_t clockid_t;
typedef __kernel_mqd_t mqd_t;

typedef _Bool bool;

typedef __kernel_uid32_t uid_t;
typedef __kernel_gid32_t gid_t;
typedef __kernel_uid16_t uid16_t;
typedef __kernel_gid16_t gid16_t;

typedef unsigned long uintptr_t;



typedef __kernel_old_uid_t old_uid_t;
typedef __kernel_old_gid_t old_gid_t;



typedef __kernel_loff_t loff_t;
# 54 "include/linux/types.h"
typedef __kernel_size_t size_t;




typedef __kernel_ssize_t ssize_t;




typedef __kernel_ptrdiff_t ptrdiff_t;




typedef __kernel_time_t time_t;




typedef __kernel_clock_t clock_t;




typedef __kernel_caddr_t caddr_t;



typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;


typedef unsigned char unchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;




typedef __u8 u_int8_t;
typedef __s8 int8_t;
typedef __u16 u_int16_t;
typedef __s16 int16_t;
typedef __u32 u_int32_t;
typedef __s32 int32_t;



typedef __u8 uint8_t;
typedef __u16 uint16_t;
typedef __u32 uint32_t;


typedef __u64 uint64_t;
typedef __u64 u_int64_t;
typedef __s64 int64_t;
# 133 "include/linux/types.h"
typedef unsigned long sector_t;
typedef unsigned long blkcnt_t;
# 146 "include/linux/types.h"
typedef u32 dma_addr_t;
# 155 "include/linux/types.h"
typedef unsigned gfp_t;
typedef unsigned fmode_t;
typedef unsigned oom_flags_t;


typedef u64 phys_addr_t;




typedef phys_addr_t resource_size_t;





typedef unsigned long irq_hw_number_t;

typedef struct {
 int counter;
} atomic_t;


typedef struct {
 long counter;
} atomic64_t;


struct list_head {
 struct list_head *next, *prev;
};

struct hlist_head {
 struct hlist_node *first;
};

struct hlist_node {
 struct hlist_node *next, **pprev;
};

struct ustat {
 __kernel_daddr_t f_tfree;
 __kernel_ino_t f_tinode;
 char f_fname[6];
 char f_fpack[6];
};






struct callback_head {
 struct callback_head *next;
 void (*func)(struct callback_head *head);
};



typedef u64 cycle_t;
# 12 "arch/sparc/math-emu/math_64.c" 2
# 1 "include/linux/sched.h" 1



# 1 "include/uapi/linux/sched.h" 1
# 5 "include/linux/sched.h" 2

# 1 "include/linux/sched/prio.h" 1
# 47 "include/linux/sched/prio.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long nice_to_rlimit(long nice)
{
 return (19 - nice + 1);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long rlimit_to_nice(long prio)
{
 return (19 - prio + 1);
}
# 7 "include/linux/sched.h" 2


struct sched_param {
 int sched_priority;
};

# 1 "./arch/sparc/include/uapi/asm/param.h" 1




# 1 "include/asm-generic/param.h" 1



# 1 "include/uapi/asm-generic/param.h" 1
# 5 "include/asm-generic/param.h" 2
# 6 "./arch/sparc/include/uapi/asm/param.h" 2
# 14 "include/linux/sched.h" 2

# 1 "include/linux/capability.h" 1
# 15 "include/linux/capability.h"
# 1 "include/uapi/linux/capability.h" 1
# 18 "include/uapi/linux/capability.h"
struct task_struct;
# 40 "include/uapi/linux/capability.h"
typedef struct __user_cap_header_struct {
 __u32 version;
 int pid;
} *cap_user_header_t;

typedef struct __user_cap_data_struct {
        __u32 effective;
        __u32 permitted;
        __u32 inheritable;
} *cap_user_data_t;
# 69 "include/uapi/linux/capability.h"
struct vfs_cap_data {
 __le32 magic_etc;
 struct {
  __le32 permitted;
  __le32 inheritable;
 } data[2];
};
# 16 "include/linux/capability.h" 2





extern int file_caps_enabled;

typedef struct kernel_cap_struct {
 __u32 cap[2];
} kernel_cap_t;


struct cpu_vfs_cap_data {
 __u32 magic_etc;
 kernel_cap_t permitted;
 kernel_cap_t inheritable;
};





struct file;
struct inode;
struct dentry;
struct user_namespace;

struct user_namespace *current_user_ns(void);

extern const kernel_cap_t __cap_empty_set;
extern const kernel_cap_t __cap_init_eff_set;
# 117 "include/linux/capability.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_combine(const kernel_cap_t a,
           const kernel_cap_t b)
{
 kernel_cap_t dest;
 do { unsigned __capi; for (__capi = 0; __capi < 2; ++__capi) { dest.cap[__capi] = a.cap[__capi] | b.cap[__capi]; } } while (0);
 return dest;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_intersect(const kernel_cap_t a,
      const kernel_cap_t b)
{
 kernel_cap_t dest;
 do { unsigned __capi; for (__capi = 0; __capi < 2; ++__capi) { dest.cap[__capi] = a.cap[__capi] & b.cap[__capi]; } } while (0);
 return dest;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_drop(const kernel_cap_t a,
        const kernel_cap_t drop)
{
 kernel_cap_t dest;
 do { unsigned __capi; for (__capi = 0; __capi < 2; ++__capi) { dest.cap[__capi] = a.cap[__capi] &~ drop.cap[__capi]; } } while (0);
 return dest;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_invert(const kernel_cap_t c)
{
 kernel_cap_t dest;
 do { unsigned __capi; for (__capi = 0; __capi < 2; ++__capi) { dest.cap[__capi] = ~ c.cap[__capi]; } } while (0);
 return dest;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cap_isclear(const kernel_cap_t a)
{
 unsigned __capi;
 for (__capi = 0; __capi < 2; ++__capi) {
  if (a.cap[__capi] != 0)
   return 0;
 }
 return 1;
}
# 165 "include/linux/capability.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cap_issubset(const kernel_cap_t a, const kernel_cap_t set)
{
 kernel_cap_t dest;
 dest = cap_drop(a, set);
 return cap_isclear(dest);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cap_is_fs_cap(int cap)
{
 const kernel_cap_t __cap_fs_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((9) & 31)), ((1 << ((32) & 31))) } });
 return !!((1 << ((cap) & 31)) & __cap_fs_set.cap[((cap) >> 5)]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_drop_fs_set(const kernel_cap_t a)
{
 const kernel_cap_t __cap_fs_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((9) & 31)), ((1 << ((32) & 31))) } });
 return cap_drop(a, __cap_fs_set);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_raise_fs_set(const kernel_cap_t a,
         const kernel_cap_t permitted)
{
 const kernel_cap_t __cap_fs_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((9) & 31)), ((1 << ((32) & 31))) } });
 return cap_combine(a,
      cap_intersect(permitted, __cap_fs_set));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_drop_nfsd_set(const kernel_cap_t a)
{
 const kernel_cap_t __cap_fs_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((24) & 31)), ((1 << ((32) & 31))) } });
 return cap_drop(a, __cap_fs_set);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_raise_nfsd_set(const kernel_cap_t a,
           const kernel_cap_t permitted)
{
 const kernel_cap_t __cap_nfsd_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((24) & 31)), ((1 << ((32) & 31))) } });
 return cap_combine(a,
      cap_intersect(permitted, __cap_nfsd_set));
}

extern bool has_capability(struct task_struct *t, int cap);
extern bool has_ns_capability(struct task_struct *t,
         struct user_namespace *ns, int cap);
extern bool has_capability_noaudit(struct task_struct *t, int cap);
extern bool has_ns_capability_noaudit(struct task_struct *t,
          struct user_namespace *ns, int cap);
extern bool capable(int cap);
extern bool ns_capable(struct user_namespace *ns, int cap);
extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);


extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
# 16 "include/linux/sched.h" 2
# 1 "include/linux/threads.h" 1
# 17 "include/linux/sched.h" 2
# 1 "include/linux/kernel.h" 1




# 1 "/usr/lib/gcc/sparc-linux-gnu/4.6/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/sparc-linux-gnu/4.6/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 102 "/usr/lib/gcc/sparc-linux-gnu/4.6/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 6 "include/linux/kernel.h" 2
# 1 "include/linux/linkage.h" 1




# 1 "include/linux/stringify.h" 1
# 6 "include/linux/linkage.h" 2
# 1 "include/linux/export.h" 1
# 26 "include/linux/export.h"
struct kernel_symbol
{
 unsigned long value;
 const char *name;
};
# 7 "include/linux/linkage.h" 2
# 1 "arch/sparc/include/generated/asm/linkage.h" 1
# 1 "include/asm-generic/linkage.h" 1
# 1 "arch/sparc/include/generated/asm/linkage.h" 2
# 8 "include/linux/linkage.h" 2
# 7 "include/linux/kernel.h" 2



# 1 "include/linux/bitops.h" 1


# 1 "arch/sparc/include/generated/asm/types.h" 1
# 4 "include/linux/bitops.h" 2
# 27 "include/linux/bitops.h"
extern unsigned int __sw_hweight8(unsigned int w);
extern unsigned int __sw_hweight16(unsigned int w);
extern unsigned int __sw_hweight32(unsigned int w);
extern unsigned long __sw_hweight64(__u64 w);





# 1 "./arch/sparc/include/asm/bitops.h" 1



# 1 "./arch/sparc/include/asm/bitops_64.h" 1
# 15 "./arch/sparc/include/asm/bitops_64.h"
# 1 "./arch/sparc/include/uapi/asm/byteorder.h" 1



# 1 "include/linux/byteorder/big_endian.h" 1



# 1 "include/uapi/linux/byteorder/big_endian.h" 1
# 12 "include/uapi/linux/byteorder/big_endian.h"
# 1 "include/linux/swab.h" 1



# 1 "include/uapi/linux/swab.h" 1





# 1 "./arch/sparc/include/uapi/asm/swab.h" 1




# 1 "./arch/sparc/include/uapi/asm/asi.h" 1
# 6 "./arch/sparc/include/uapi/asm/swab.h" 2


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 __arch_swab16p(const __u16 *addr)
{
 __u16 ret;

 __asm__ __volatile__ ("lduha [%2] %3, %0"
         : "=r" (ret)
         : "m" (*addr), "r" (addr), "i" (0x88));
 return ret;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __arch_swab32p(const __u32 *addr)
{
 __u32 ret;

 __asm__ __volatile__ ("lduwa [%2] %3, %0"
         : "=r" (ret)
         : "m" (*addr), "r" (addr), "i" (0x88));
 return ret;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 __arch_swab64p(const __u64 *addr)
{
 __u64 ret;

 __asm__ __volatile__ ("ldxa [%2] %3, %0"
         : "=r" (ret)
         : "m" (*addr), "r" (addr), "i" (0x88));
 return ret;
}
# 7 "include/uapi/linux/swab.h" 2
# 46 "include/uapi/linux/swab.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u16 __fswab16(__u16 val)
{





 return ((__u16)( (((__u16)(val) & (__u16)0x00ffU) << 8) | (((__u16)(val) & (__u16)0xff00U) >> 8)));

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u32 __fswab32(__u32 val)
{





 return ((__u32)( (((__u32)(val) & (__u32)0x000000ffUL) << 24) | (((__u32)(val) & (__u32)0x0000ff00UL) << 8) | (((__u32)(val) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(val) & (__u32)0xff000000UL) >> 24)));

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u64 __fswab64(__u64 val)
{
# 79 "include/uapi/linux/swab.h"
 return ((__u64)( (((__u64)(val) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(val) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(val) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(val) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(val) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(val) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(val) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(val) & (__u64)0xff00000000000000ULL) >> 56)));

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u32 __fswahw32(__u32 val)
{



 return ((__u32)( (((__u32)(val) & (__u32)0x0000ffffUL) << 16) | (((__u32)(val) & (__u32)0xffff0000UL) >> 16)));

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u32 __fswahb32(__u32 val)
{



 return ((__u32)( (((__u32)(val) & (__u32)0x00ff00ffUL) << 8) | (((__u32)(val) & (__u32)0xff00ff00UL) >> 8)));

}
# 154 "include/uapi/linux/swab.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 __swab16p(const __u16 *p)
{

 return __arch_swab16p(p);



}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __swab32p(const __u32 *p)
{

 return __arch_swab32p(p);



}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 __swab64p(const __u64 *p)
{

 return __arch_swab64p(p);



}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __swahw32p(const __u32 *p)
{



 return (__builtin_constant_p((__u32)(*p)) ? ((__u32)( (((__u32)(*p) & (__u32)0x0000ffffUL) << 16) | (((__u32)(*p) & (__u32)0xffff0000UL) >> 16))) : __fswahw32(*p));

}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __swahb32p(const __u32 *p)
{



 return (__builtin_constant_p((__u32)(*p)) ? ((__u32)( (((__u32)(*p) & (__u32)0x00ff00ffUL) << 8) | (((__u32)(*p) & (__u32)0xff00ff00UL) >> 8))) : __fswahb32(*p));

}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swab16s(__u16 *p)
{



 *p = __swab16p(p);

}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swab32s(__u32 *p)
{



 *p = __swab32p(p);

}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swab64s(__u64 *p)
{



 *p = __swab64p(p);

}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swahw32s(__u32 *p)
{



 *p = __swahw32p(p);

}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swahb32s(__u32 *p)
{



 *p = __swahb32p(p);

}
# 5 "include/linux/swab.h" 2
# 13 "include/uapi/linux/byteorder/big_endian.h" 2
# 43 "include/uapi/linux/byteorder/big_endian.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __le64 __cpu_to_le64p(const __u64 *p)
{
 return ( __le64)__swab64p(p);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 __le64_to_cpup(const __le64 *p)
{
 return __swab64p((__u64 *)p);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __le32 __cpu_to_le32p(const __u32 *p)
{
 return ( __le32)__swab32p(p);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __le32_to_cpup(const __le32 *p)
{
 return __swab32p((__u32 *)p);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __le16 __cpu_to_le16p(const __u16 *p)
{
 return ( __le16)__swab16p(p);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 __le16_to_cpup(const __le16 *p)
{
 return __swab16p((__u16 *)p);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be64 __cpu_to_be64p(const __u64 *p)
{
 return ( __be64)*p;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 __be64_to_cpup(const __be64 *p)
{
 return ( __u64)*p;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be32 __cpu_to_be32p(const __u32 *p)
{
 return ( __be32)*p;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __be32_to_cpup(const __be32 *p)
{
 return ( __u32)*p;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be16 __cpu_to_be16p(const __u16 *p)
{
 return ( __be16)*p;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 __be16_to_cpup(const __be16 *p)
{
 return ( __u16)*p;
}
# 5 "include/linux/byteorder/big_endian.h" 2

# 1 "include/linux/byteorder/generic.h" 1
# 143 "include/linux/byteorder/generic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void le16_add_cpu(__le16 *var, u16 val)
{
 *var = (( __le16)(__builtin_constant_p((__u16)(((__builtin_constant_p((__u16)(( __u16)(__le16)(*var))) ? ((__u16)( (((__u16)(( __u16)(__le16)(*var)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__le16)(*var)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__le16)(*var))) + val))) ? ((__u16)( (((__u16)(((__builtin_constant_p((__u16)(( __u16)(__le16)(*var))) ? ((__u16)( (((__u16)(( __u16)(__le16)(*var)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__le16)(*var)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__le16)(*var))) + val)) & (__u16)0x00ffU) << 8) | (((__u16)(((__builtin_constant_p((__u16)(( __u16)(__le16)(*var))) ? ((__u16)( (((__u16)(( __u16)(__le16)(*var)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__le16)(*var)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__le16)(*var))) + val)) & (__u16)0xff00U) >> 8))) : __fswab16(((__builtin_constant_p((__u16)(( __u16)(__le16)(*var))) ? ((__u16)( (((__u16)(( __u16)(__le16)(*var)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__le16)(*var)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__le16)(*var))) + val))));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void le32_add_cpu(__le32 *var, u32 val)
{
 *var = (( __le32)(__builtin_constant_p((__u32)(((__builtin_constant_p((__u32)(( __u32)(__le32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__le32)(*var))) + val))) ? ((__u32)( (((__u32)(((__builtin_constant_p((__u32)(( __u32)(__le32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__le32)(*var))) + val)) & (__u32)0x000000ffUL) << 24) | (((__u32)(((__builtin_constant_p((__u32)(( __u32)(__le32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__le32)(*var))) + val)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(((__builtin_constant_p((__u32)(( __u32)(__le32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__le32)(*var))) + val)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(((__builtin_constant_p((__u32)(( __u32)(__le32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__le32)(*var))) + val)) & (__u32)0xff000000UL) >> 24))) : __fswab32(((__builtin_constant_p((__u32)(( __u32)(__le32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__le32)(*var))) + val))));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void le64_add_cpu(__le64 *var, u64 val)
{
 *var = (( __le64)(__builtin_constant_p((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val))) ? ((__u64)( (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val))));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void be16_add_cpu(__be16 *var, u16 val)
{
 *var = (( __be16)(__u16)((( __u16)(__be16)(*var)) + val));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void be32_add_cpu(__be32 *var, u32 val)
{
 *var = (( __be32)(__u32)((( __u32)(__be32)(*var)) + val));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void be64_add_cpu(__be64 *var, u64 val)
{
 *var = (( __be64)(__u64)((( __u64)(__be64)(*var)) + val));
}
# 7 "include/linux/byteorder/big_endian.h" 2
# 5 "./arch/sparc/include/uapi/asm/byteorder.h" 2
# 16 "./arch/sparc/include/asm/bitops_64.h" 2
# 1 "./arch/sparc/include/asm/barrier.h" 1



# 1 "./arch/sparc/include/asm/barrier_64.h" 1
# 5 "./arch/sparc/include/asm/barrier.h" 2
# 17 "./arch/sparc/include/asm/bitops_64.h" 2

int test_and_set_bit(unsigned long nr, volatile unsigned long *addr);
int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr);
int test_and_change_bit(unsigned long nr, volatile unsigned long *addr);
void set_bit(unsigned long nr, volatile unsigned long *addr);
void clear_bit(unsigned long nr, volatile unsigned long *addr);
void change_bit(unsigned long nr, volatile unsigned long *addr);

# 1 "include/asm-generic/bitops/non-atomic.h" 1



# 1 "arch/sparc/include/generated/asm/types.h" 1
# 5 "include/asm-generic/bitops/non-atomic.h" 2
# 15 "include/asm-generic/bitops/non-atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __set_bit(int nr, volatile unsigned long *addr)
{
 unsigned long mask = (1UL << ((nr) % 64));
 unsigned long *p = ((unsigned long *)addr) + ((nr) / 64);

 *p |= mask;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __clear_bit(int nr, volatile unsigned long *addr)
{
 unsigned long mask = (1UL << ((nr) % 64));
 unsigned long *p = ((unsigned long *)addr) + ((nr) / 64);

 *p &= ~mask;
}
# 40 "include/asm-generic/bitops/non-atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __change_bit(int nr, volatile unsigned long *addr)
{
 unsigned long mask = (1UL << ((nr) % 64));
 unsigned long *p = ((unsigned long *)addr) + ((nr) / 64);

 *p ^= mask;
}
# 57 "include/asm-generic/bitops/non-atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_set_bit(int nr, volatile unsigned long *addr)
{
 unsigned long mask = (1UL << ((nr) % 64));
 unsigned long *p = ((unsigned long *)addr) + ((nr) / 64);
 unsigned long old = *p;

 *p = old | mask;
 return (old & mask) != 0;
}
# 76 "include/asm-generic/bitops/non-atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_clear_bit(int nr, volatile unsigned long *addr)
{
 unsigned long mask = (1UL << ((nr) % 64));
 unsigned long *p = ((unsigned long *)addr) + ((nr) / 64);
 unsigned long old = *p;

 *p = old & ~mask;
 return (old & mask) != 0;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_change_bit(int nr,
         volatile unsigned long *addr)
{
 unsigned long mask = (1UL << ((nr) % 64));
 unsigned long *p = ((unsigned long *)addr) + ((nr) / 64);
 unsigned long old = *p;

 *p = old ^ mask;
 return (old & mask) != 0;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_bit(int nr, const volatile unsigned long *addr)
{
 return 1UL & (addr[((nr) / 64)] >> (nr & (64 -1)));
}
# 26 "./arch/sparc/include/asm/bitops_64.h" 2

# 1 "include/asm-generic/bitops/fls.h" 1
# 12 "include/asm-generic/bitops/fls.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int fls(int x)
{
 int r = 32;

 if (!x)
  return 0;
 if (!(x & 0xffff0000u)) {
  x <<= 16;
  r -= 16;
 }
 if (!(x & 0xff000000u)) {
  x <<= 8;
  r -= 8;
 }
 if (!(x & 0xf0000000u)) {
  x <<= 4;
  r -= 4;
 }
 if (!(x & 0xc0000000u)) {
  x <<= 2;
  r -= 2;
 }
 if (!(x & 0x80000000u)) {
  x <<= 1;
  r -= 1;
 }
 return r;
}
# 28 "./arch/sparc/include/asm/bitops_64.h" 2
# 1 "include/asm-generic/bitops/__fls.h" 1



# 1 "arch/sparc/include/generated/asm/types.h" 1
# 5 "include/asm-generic/bitops/__fls.h" 2







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) unsigned long __fls(unsigned long word)
{
 int num = 64 - 1;


 if (!(word & (~0ul << 32))) {
  num -= 32;
  word <<= 32;
 }

 if (!(word & (~0ul << (64 -16)))) {
  num -= 16;
  word <<= 16;
 }
 if (!(word & (~0ul << (64 -8)))) {
  num -= 8;
  word <<= 8;
 }
 if (!(word & (~0ul << (64 -4)))) {
  num -= 4;
  word <<= 4;
 }
 if (!(word & (~0ul << (64 -2)))) {
  num -= 2;
  word <<= 2;
 }
 if (!(word & (~0ul << (64 -1))))
  num -= 1;
 return num;
}
# 29 "./arch/sparc/include/asm/bitops_64.h" 2
# 1 "include/asm-generic/bitops/fls64.h" 1



# 1 "arch/sparc/include/generated/asm/types.h" 1
# 5 "include/asm-generic/bitops/fls64.h" 2
# 26 "include/asm-generic/bitops/fls64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int fls64(__u64 x)
{
 if (x == 0)
  return 0;
 return __fls(x) + 1;
}
# 30 "./arch/sparc/include/asm/bitops_64.h" 2



int ffs(int x);
unsigned long __ffs(unsigned long);

# 1 "include/asm-generic/bitops/ffz.h" 1
# 37 "./arch/sparc/include/asm/bitops_64.h" 2
# 1 "include/asm-generic/bitops/sched.h" 1




# 1 "arch/sparc/include/generated/asm/types.h" 1
# 6 "include/asm-generic/bitops/sched.h" 2






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sched_find_first_bit(const unsigned long *b)
{

 if (b[0])
  return __ffs(b[0]);
 return __ffs(b[1]) + 64;
# 29 "include/asm-generic/bitops/sched.h"
}
# 38 "./arch/sparc/include/asm/bitops_64.h" 2






unsigned long __arch_hweight64(__u64 w);
unsigned int __arch_hweight32(unsigned int w);
unsigned int __arch_hweight16(unsigned int w);
unsigned int __arch_hweight8(unsigned int w);

# 1 "include/asm-generic/bitops/const_hweight.h" 1
# 50 "./arch/sparc/include/asm/bitops_64.h" 2
# 1 "include/asm-generic/bitops/lock.h" 1
# 51 "./arch/sparc/include/asm/bitops_64.h" 2


# 1 "include/asm-generic/bitops/find.h" 1
# 14 "include/asm-generic/bitops/find.h"
extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
  size, unsigned long offset);
# 28 "include/asm-generic/bitops/find.h"
extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
  long size, unsigned long offset);
# 54 "./arch/sparc/include/asm/bitops_64.h" 2



# 1 "include/asm-generic/bitops/le.h" 1



# 1 "arch/sparc/include/generated/asm/types.h" 1
# 5 "include/asm-generic/bitops/le.h" 2
# 34 "include/asm-generic/bitops/le.h"
extern unsigned long find_next_zero_bit_le(const void *addr,
  unsigned long size, unsigned long offset);



extern unsigned long find_next_bit_le(const void *addr,
  unsigned long size, unsigned long offset);
# 52 "include/asm-generic/bitops/le.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_bit_le(int nr, const void *addr)
{
 return test_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_bit_le(int nr, void *addr)
{
 set_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_bit_le(int nr, void *addr)
{
 clear_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __set_bit_le(int nr, void *addr)
{
 __set_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __clear_bit_le(int nr, void *addr)
{
 __clear_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_set_bit_le(int nr, void *addr)
{
 return test_and_set_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_clear_bit_le(int nr, void *addr)
{
 return test_and_clear_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_set_bit_le(int nr, void *addr)
{
 return __test_and_set_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_clear_bit_le(int nr, void *addr)
{
 return __test_and_clear_bit(nr ^ ((64 -1) & ~0x7), addr);
}
# 58 "./arch/sparc/include/asm/bitops_64.h" 2

# 1 "include/asm-generic/bitops/ext2-atomic-setbit.h" 1
# 60 "./arch/sparc/include/asm/bitops_64.h" 2
# 5 "./arch/sparc/include/asm/bitops.h" 2
# 37 "include/linux/bitops.h" 2
# 60 "include/linux/bitops.h"
static __inline__ __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_bitmask_order(unsigned int count)
{
 int order;

 order = fls(count);
 return order;
}

static __inline__ __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_count_order(unsigned int count)
{
 int order;

 order = fls(count) - 1;
 if (count & (count - 1))
  order++;
 return order;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long hweight_long(unsigned long w)
{
 return sizeof(w) == 4 ? (__builtin_constant_p(w) ? ((((unsigned int) ((!!((w) & (1ULL << 0))) + (!!((w) & (1ULL << 1))) + (!!((w) & (1ULL << 2))) + (!!((w) & (1ULL << 3))) + (!!((w) & (1ULL << 4))) + (!!((w) & (1ULL << 5))) + (!!((w) & (1ULL << 6))) + (!!((w) & (1ULL << 7))))) + ((unsigned int) ((!!(((w) >> 8) & (1ULL << 0))) + (!!(((w) >> 8) & (1ULL << 1))) + (!!(((w) >> 8) & (1ULL << 2))) + (!!(((w) >> 8) & (1ULL << 3))) + (!!(((w) >> 8) & (1ULL << 4))) + (!!(((w) >> 8) & (1ULL << 5))) + (!!(((w) >> 8) & (1ULL << 6))) + (!!(((w) >> 8) & (1ULL << 7)))))) + (((unsigned int) ((!!(((w) >> 16) & (1ULL << 0))) + (!!(((w) >> 16) & (1ULL << 1))) + (!!(((w) >> 16) & (1ULL << 2))) + (!!(((w) >> 16) & (1ULL << 3))) + (!!(((w) >> 16) & (1ULL << 4))) + (!!(((w) >> 16) & (1ULL << 5))) + (!!(((w) >> 16) & (1ULL << 6))) + (!!(((w) >> 16) & (1ULL << 7))))) + ((unsigned int) ((!!((((w) >> 16) >> 8) & (1ULL << 0))) + (!!((((w) >> 16) >> 8) & (1ULL << 1))) + (!!((((w) >> 16) >> 8) & (1ULL << 2))) + (!!((((w) >> 16) >> 8) & (1ULL << 3))) + (!!((((w) >> 16) >> 8) & (1ULL << 4))) + (!!((((w) >> 16) >> 8) & (1ULL << 5))) + (!!((((w) >> 16) >> 8) & (1ULL << 6))) + (!!((((w) >> 16) >> 8) & (1ULL << 7))))))) : __arch_hweight32(w)) : (__builtin_constant_p(w) ? (((((unsigned int) ((!!((w) & (1ULL << 0))) + (!!((w) & (1ULL << 1))) + (!!((w) & (1ULL << 2))) + (!!((w) & (1ULL << 3))) + (!!((w) & (1ULL << 4))) + (!!((w) & (1ULL << 5))) + (!!((w) & (1ULL << 6))) + (!!((w) & (1ULL << 7))))) + ((unsigned int) ((!!(((w) >> 8) & (1ULL << 0))) + (!!(((w) >> 8) & (1ULL << 1))) + (!!(((w) >> 8) & (1ULL << 2))) + (!!(((w) >> 8) & (1ULL << 3))) + (!!(((w) >> 8) & (1ULL << 4))) + (!!(((w) >> 8) & (1ULL << 5))) + (!!(((w) >> 8) & (1ULL << 6))) + (!!(((w) >> 8) & (1ULL << 7)))))) + (((unsigned int) ((!!(((w) >> 16) & (1ULL << 0))) + (!!(((w) >> 16) & (1ULL << 1))) + (!!(((w) >> 16) & (1ULL << 2))) + (!!(((w) >> 16) & (1ULL << 3))) + (!!(((w) >> 16) & (1ULL << 4))) + (!!(((w) >> 16) & (1ULL << 5))) + (!!(((w) >> 16) & (1ULL << 6))) + (!!(((w) >> 16) & (1ULL << 7))))) + ((unsigned int) ((!!((((w) >> 16) >> 8) & (1ULL << 0))) + (!!((((w) >> 16) >> 8) & (1ULL << 1))) + (!!((((w) >> 16) >> 8) & (1ULL << 2))) + (!!((((w) >> 16) >> 8) & (1ULL << 3))) + (!!((((w) >> 16) >> 8) & (1ULL << 4))) + (!!((((w) >> 16) >> 8) & (1ULL << 5))) + (!!((((w) >> 16) >> 8) & (1ULL << 6))) + (!!((((w) >> 16) >> 8) & (1ULL << 7))))))) + ((((unsigned int) ((!!(((w) >> 32) & (1ULL << 0))) + (!!(((w) >> 32) & (1ULL << 1))) + (!!(((w) >> 32) & (1ULL << 2))) + (!!(((w) >> 32) & (1ULL << 3))) + (!!(((w) >> 32) & (1ULL << 4))) + (!!(((w) >> 32) & (1ULL << 5))) + (!!(((w) >> 32) & (1ULL << 6))) + (!!(((w) >> 32) & (1ULL << 7))))) + ((unsigned int) ((!!((((w) >> 32) >> 8) & (1ULL << 0))) + (!!((((w) >> 32) >> 8) & (1ULL << 1))) + (!!((((w) >> 32) >> 8) & (1ULL << 2))) + (!!((((w) >> 32) >> 8) & (1ULL << 3))) + (!!((((w) >> 32) >> 8) & (1ULL << 4))) + (!!((((w) >> 32) >> 8) & (1ULL << 5))) + (!!((((w) >> 32) >> 8) & (1ULL << 6))) + (!!((((w) >> 32) >> 8) & (1ULL << 7)))))) + (((unsigned int) ((!!((((w) >> 32) >> 16) & (1ULL << 0))) + (!!((((w) >> 32) >> 16) & (1ULL << 1))) + (!!((((w) >> 32) >> 16) & (1ULL << 2))) + (!!((((w) >> 32) >> 16) & (1ULL << 3))) + (!!((((w) >> 32) >> 16) & (1ULL << 4))) + (!!((((w) >> 32) >> 16) & (1ULL << 5))) + (!!((((w) >> 32) >> 16) & (1ULL << 6))) + (!!((((w) >> 32) >> 16) & (1ULL << 7))))) + ((unsigned int) ((!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 0))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 1))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 2))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 3))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 4))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 5))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 6))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 7)))))))) : __arch_hweight64(w));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 rol64(__u64 word, unsigned int shift)
{
 return (word << shift) | (word >> (64 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 ror64(__u64 word, unsigned int shift)
{
 return (word >> shift) | (word << (64 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 rol32(__u32 word, unsigned int shift)
{
 return (word << shift) | (word >> (32 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 ror32(__u32 word, unsigned int shift)
{
 return (word >> shift) | (word << (32 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 rol16(__u16 word, unsigned int shift)
{
 return (word << shift) | (word >> (16 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 ror16(__u16 word, unsigned int shift)
{
 return (word >> shift) | (word << (16 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u8 rol8(__u8 word, unsigned int shift)
{
 return (word << shift) | (word >> (8 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u8 ror8(__u8 word, unsigned int shift)
{
 return (word >> shift) | (word << (8 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __s32 sign_extend32(__u32 value, int index)
{
 __u8 shift = 31 - index;
 return (__s32)(value << shift) >> shift;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned fls_long(unsigned long l)
{
 if (sizeof(l) == 4)
  return fls(l);
 return fls64(l);
}
# 189 "include/linux/bitops.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __ffs64(u64 word)
{






 return __ffs((unsigned long)word);
}
# 225 "include/linux/bitops.h"
extern unsigned long find_last_bit(const unsigned long *addr,
       unsigned long size);
# 11 "include/linux/kernel.h" 2
# 1 "include/linux/log2.h" 1
# 21 "include/linux/log2.h"
extern __attribute__((const, noreturn))
int ____ilog2_NaN(void);
# 31 "include/linux/log2.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
int __ilog2_u32(u32 n)
{
 return fls(n) - 1;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
int __ilog2_u64(u64 n)
{
 return fls64(n) - 1;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
bool is_power_of_2(unsigned long n)
{
 return (n != 0 && ((n & (n - 1)) == 0));
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
unsigned long __roundup_pow_of_two(unsigned long n)
{
 return 1UL << fls_long(n - 1);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
unsigned long __rounddown_pow_of_two(unsigned long n)
{
 return 1UL << (fls_long(n) - 1);
}
# 12 "include/linux/kernel.h" 2
# 1 "include/linux/typecheck.h" 1
# 13 "include/linux/kernel.h" 2
# 1 "include/linux/printk.h" 1




# 1 "include/linux/init.h" 1
# 135 "include/linux/init.h"
typedef int (*initcall_t)(void);
typedef void (*exitcall_t)(void);

extern initcall_t __con_initcall_start[], __con_initcall_end[];
extern initcall_t __security_initcall_start[], __security_initcall_end[];


typedef void (*ctor_fn_t)(void);


extern int do_one_initcall(initcall_t fn);
extern char __attribute__ ((__section__(".init.data"))) boot_command_line[];
extern char *saved_command_line;
extern unsigned int reset_devices;


void setup_arch(char **);
void prepare_namespace(void);
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) load_default_modules(void);
int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) init_rootfs(void);

extern void (*late_time_init)(void);

extern bool initcall_debug;
# 243 "include/linux/init.h"
struct obs_kernel_param {
 const char *str;
 int (*setup_func)(char *);
 int early;
};
# 272 "include/linux/init.h"
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) parse_early_param(void);
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) parse_early_options(char *cmdline);
# 6 "include/linux/printk.h" 2
# 1 "include/linux/kern_levels.h" 1
# 7 "include/linux/printk.h" 2

# 1 "include/linux/cache.h" 1



# 1 "include/uapi/linux/kernel.h" 1



# 1 "./include/uapi/linux/sysinfo.h" 1






struct sysinfo {
 __kernel_long_t uptime;
 __kernel_ulong_t loads[3];
 __kernel_ulong_t totalram;
 __kernel_ulong_t freeram;
 __kernel_ulong_t sharedram;
 __kernel_ulong_t bufferram;
 __kernel_ulong_t totalswap;
 __kernel_ulong_t freeswap;
 __u16 procs;
 __u16 pad;
 __kernel_ulong_t totalhigh;
 __kernel_ulong_t freehigh;
 __u32 mem_unit;
 char _f[20-2*sizeof(__kernel_ulong_t)-sizeof(__u32)];
};
# 5 "include/uapi/linux/kernel.h" 2
# 5 "include/linux/cache.h" 2
# 1 "./arch/sparc/include/asm/cache.h" 1
# 6 "include/linux/cache.h" 2
# 9 "include/linux/printk.h" 2

extern const char linux_banner[];
extern const char linux_proc_banner[];

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int printk_get_level(const char *buffer)
{
 if (buffer[0] == '\001' && buffer[1]) {
  switch (buffer[1]) {
  case '0' ... '7':
  case 'd':
   return buffer[1];
  }
 }
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *printk_skip_level(const char *buffer)
{
 if (printk_get_level(buffer))
  return buffer + 2;

 return buffer;
}
# 44 "include/linux/printk.h"
extern int console_printk[];






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void console_silent(void)
{
 (console_printk[0]) = 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void console_verbose(void)
{
 if ((console_printk[0]))
  (console_printk[0]) = 15;
}

struct va_format {
 const char *fmt;
 va_list *va;
};
# 109 "include/linux/printk.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((format(printf, 1, 2)))
int no_printk(const char *fmt, ...)
{
 return 0;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((format(printf, 1, 2))) __attribute__((__cold__))
void early_printk(const char *s, ...) { }


typedef int(*printk_func_t)(const char *fmt, va_list args);


 __attribute__((format(printf, 5, 0)))
int vprintk_emit(int facility, int level,
   const char *dict, size_t dictlen,
   const char *fmt, va_list args);

 __attribute__((format(printf, 1, 0)))
int vprintk(const char *fmt, va_list args);

 __attribute__((format(printf, 5, 6))) __attribute__((__cold__))
int printk_emit(int facility, int level,
  const char *dict, size_t dictlen,
  const char *fmt, ...);

 __attribute__((format(printf, 1, 2))) __attribute__((__cold__))
int printk(const char *fmt, ...);




__attribute__((format(printf, 1, 2))) __attribute__((__cold__)) int printk_deferred(const char *fmt, ...);






extern int __printk_ratelimit(const char *func);

extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
       unsigned int interval_msec);

extern int printk_delay_msec;
extern int dmesg_restrict;
extern int kptr_restrict;

extern void wake_up_klogd(void);

char *log_buf_addr_get(void);
u32 log_buf_len_get(void);
void log_buf_kexec_setup(void);
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) setup_log_buf(int early);
void dump_stack_set_arch_desc(const char *fmt, ...);
void dump_stack_print_info(const char *log_lvl);
void show_regs_print_info(const char *log_lvl);
# 231 "include/linux/printk.h"
extern void dump_stack(void) __attribute__((__cold__));
# 270 "include/linux/printk.h"
# 1 "include/linux/dynamic_debug.h" 1
# 9 "include/linux/dynamic_debug.h"
struct _ddebug {




 const char *modname;
 const char *function;
 const char *filename;
 const char *format;
 unsigned int lineno:18;
# 35 "include/linux/dynamic_debug.h"
 unsigned int flags:8;
} __attribute__((aligned(8)));


int ddebug_add_module(struct _ddebug *tab, unsigned int n,
    const char *modname);
# 111 "include/linux/dynamic_debug.h"
# 1 "include/linux/string.h" 1
# 9 "include/linux/string.h"
# 1 "include/uapi/linux/string.h" 1
# 10 "include/linux/string.h" 2

extern char *strndup_user(const char *, long);
extern void *memdup_user(const void *, size_t);




# 1 "./arch/sparc/include/asm/string.h" 1



# 1 "./arch/sparc/include/asm/string_64.h" 1
# 22 "./arch/sparc/include/asm/string_64.h"
void *memmove(void *, const void *, __kernel_size_t);
# 49 "./arch/sparc/include/asm/string_64.h"
int memcmp(const void *,const void *,__kernel_size_t);



__kernel_size_t strlen(const char *);


int strncmp(const char *, const char *, __kernel_size_t);
# 5 "./arch/sparc/include/asm/string.h" 2
# 18 "include/linux/string.h" 2


extern char * strcpy(char *,const char *);


extern char * strncpy(char *,const char *, __kernel_size_t);


size_t strlcpy(char *, const char *, size_t);


extern char * strcat(char *, const char *);


extern char * strncat(char *, const char *, __kernel_size_t);


extern size_t strlcat(char *, const char *, __kernel_size_t);


extern int strcmp(const char *,const char *);





extern int strcasecmp(const char *s1, const char *s2);


extern int strncasecmp(const char *s1, const char *s2, size_t n);


extern char * strchr(const char *,int);


extern char * strchrnul(const char *,int);


extern char * strnchr(const char *, size_t, int);


extern char * strrchr(const char *,int);

extern char * __attribute__((warn_unused_result)) skip_spaces(const char *);

extern char *strim(char *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((warn_unused_result)) char *strstrip(char *str)
{
 return strim(str);
}


extern char * strstr(const char *, const char *);


extern char * strnstr(const char *, const char *, size_t);





extern __kernel_size_t strnlen(const char *,__kernel_size_t);


extern char * strpbrk(const char *,const char *);


extern char * strsep(char **,const char *);


extern __kernel_size_t strspn(const char *,const char *);


extern __kernel_size_t strcspn(const char *,const char *);
# 111 "include/linux/string.h"
extern void * memchr(const void *,int,__kernel_size_t);

void *memchr_inv(const void *s, int c, size_t n);

extern void kfree_const(const void *x);

extern char *kstrdup(const char *s, gfp_t gfp);
extern const char *kstrdup_const(const char *s, gfp_t gfp);
extern char *kstrndup(const char *s, size_t len, gfp_t gfp);
extern void *kmemdup(const void *src, size_t len, gfp_t gfp);

extern char **argv_split(gfp_t gfp, const char *str, int *argcp);
extern void argv_free(char **argv);

extern bool sysfs_streq(const char *s1, const char *s2);
extern int strtobool(const char *s, bool *res);


int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args);
int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf);
int bprintf(u32 *bin_buf, size_t size, const char *fmt, ...) __attribute__((format(printf, 3, 4)));


extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
           const void *from, size_t available);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool strstarts(const char *str, const char *prefix)
{
 return strncmp(str, prefix, strlen(prefix)) == 0;
}

size_t memweight(const void *ptr, size_t bytes);
void memzero_explicit(void *s, size_t count);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *kbasename(const char *path)
{
 const char *tail = strrchr(path, '/');
 return tail ? tail + 1 : path;
}
# 112 "include/linux/dynamic_debug.h" 2
# 1 "include/linux/errno.h" 1



# 1 "include/uapi/linux/errno.h" 1
# 1 "./arch/sparc/include/uapi/asm/errno.h" 1





# 1 "./include/uapi/asm-generic/errno-base.h" 1
# 7 "./arch/sparc/include/uapi/asm/errno.h" 2
# 1 "include/uapi/linux/errno.h" 2
# 5 "include/linux/errno.h" 2
# 113 "include/linux/dynamic_debug.h" 2

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ddebug_remove_module(const char *mod)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ddebug_dyndbg_module_param_cb(char *param, char *val,
      const char *modname)
{
 if (strstr(param, "dyndbg")) {

  printk("\001" "4" "dyndbg param is supported only in "
   "CONFIG_DYNAMIC_DEBUG builds\n");
  return 0;
 }
 return -22;
}
# 271 "include/linux/printk.h" 2
# 413 "include/linux/printk.h"
extern const struct file_operations kmsg_fops;

enum {
 DUMP_PREFIX_NONE,
 DUMP_PREFIX_ADDRESS,
 DUMP_PREFIX_OFFSET
};
extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize,
         int groupsize, char *linebuf, size_t linebuflen,
         bool ascii);

extern void print_hex_dump(const char *level, const char *prefix_str,
      int prefix_type, int rowsize, int groupsize,
      const void *buf, size_t len, bool ascii);




extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
     const void *buf, size_t len);
# 14 "include/linux/kernel.h" 2
# 153 "include/linux/kernel.h"
struct completion;
struct pt_regs;
struct user;


extern int _cond_resched(void);
# 181 "include/linux/kernel.h"
  static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ___might_sleep(const char *file, int line,
       int preempt_offset) { }
  static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __might_sleep(const char *file, int line,
       int preempt_offset) { }
# 228 "include/linux/kernel.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 reciprocal_scale(u32 val, u32 ep_ro)
{
 return (u32)(((u64) val * ep_ro) >> 32);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void might_fault(void) { }


extern struct atomic_notifier_head panic_notifier_list;
extern long (*panic_blink)(int state);
__attribute__((format(printf, 1, 2)))
void panic(const char *fmt, ...)
 __attribute__((noreturn)) __attribute__((__cold__));
extern void oops_enter(void);
extern void oops_exit(void);
void print_oops_end_marker(void);
extern int oops_may_print(void);
void do_exit(long error_code)
 __attribute__((noreturn));
void complete_and_exit(struct completion *, long)
 __attribute__((noreturn));


int __attribute__((warn_unused_result)) _kstrtoul(const char *s, unsigned int base, unsigned long *res);
int __attribute__((warn_unused_result)) _kstrtol(const char *s, unsigned int base, long *res);

int __attribute__((warn_unused_result)) kstrtoull(const char *s, unsigned int base, unsigned long long *res);
int __attribute__((warn_unused_result)) kstrtoll(const char *s, unsigned int base, long long *res);
# 277 "include/linux/kernel.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtoul(const char *s, unsigned int base, unsigned long *res)
{




 if (sizeof(unsigned long) == sizeof(unsigned long long) &&
     __alignof__(unsigned long) == __alignof__(unsigned long long))
  return kstrtoull(s, base, (unsigned long long *)res);
 else
  return _kstrtoul(s, base, res);
}
# 306 "include/linux/kernel.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtol(const char *s, unsigned int base, long *res)
{




 if (sizeof(long) == sizeof(long long) &&
     __alignof__(long) == __alignof__(long long))
  return kstrtoll(s, base, (long long *)res);
 else
  return _kstrtol(s, base, res);
}

int __attribute__((warn_unused_result)) kstrtouint(const char *s, unsigned int base, unsigned int *res);
int __attribute__((warn_unused_result)) kstrtoint(const char *s, unsigned int base, int *res);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtou64(const char *s, unsigned int base, u64 *res)
{
 return kstrtoull(s, base, res);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtos64(const char *s, unsigned int base, s64 *res)
{
 return kstrtoll(s, base, res);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtou32(const char *s, unsigned int base, u32 *res)
{
 return kstrtouint(s, base, res);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtos32(const char *s, unsigned int base, s32 *res)
{
 return kstrtoint(s, base, res);
}

int __attribute__((warn_unused_result)) kstrtou16(const char *s, unsigned int base, u16 *res);
int __attribute__((warn_unused_result)) kstrtos16(const char *s, unsigned int base, s16 *res);
int __attribute__((warn_unused_result)) kstrtou8(const char *s, unsigned int base, u8 *res);
int __attribute__((warn_unused_result)) kstrtos8(const char *s, unsigned int base, s8 *res);

int __attribute__((warn_unused_result)) kstrtoull_from_user(const char *s, size_t count, unsigned int base, unsigned long long *res);
int __attribute__((warn_unused_result)) kstrtoll_from_user(const char *s, size_t count, unsigned int base, long long *res);
int __attribute__((warn_unused_result)) kstrtoul_from_user(const char *s, size_t count, unsigned int base, unsigned long *res);
int __attribute__((warn_unused_result)) kstrtol_from_user(const char *s, size_t count, unsigned int base, long *res);
int __attribute__((warn_unused_result)) kstrtouint_from_user(const char *s, size_t count, unsigned int base, unsigned int *res);
int __attribute__((warn_unused_result)) kstrtoint_from_user(const char *s, size_t count, unsigned int base, int *res);
int __attribute__((warn_unused_result)) kstrtou16_from_user(const char *s, size_t count, unsigned int base, u16 *res);
int __attribute__((warn_unused_result)) kstrtos16_from_user(const char *s, size_t count, unsigned int base, s16 *res);
int __attribute__((warn_unused_result)) kstrtou8_from_user(const char *s, size_t count, unsigned int base, u8 *res);
int __attribute__((warn_unused_result)) kstrtos8_from_user(const char *s, size_t count, unsigned int base, s8 *res);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtou64_from_user(const char *s, size_t count, unsigned int base, u64 *res)
{
 return kstrtoull_from_user(s, count, base, res);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtos64_from_user(const char *s, size_t count, unsigned int base, s64 *res)
{
 return kstrtoll_from_user(s, count, base, res);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtou32_from_user(const char *s, size_t count, unsigned int base, u32 *res)
{
 return kstrtouint_from_user(s, count, base, res);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtos32_from_user(const char *s, size_t count, unsigned int base, s32 *res)
{
 return kstrtoint_from_user(s, count, base, res);
}



extern unsigned long simple_strtoul(const char *,char **,unsigned int);
extern long simple_strtol(const char *,char **,unsigned int);
extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
extern long long simple_strtoll(const char *,char **,unsigned int);

extern int num_to_str(char *buf, int size, unsigned long long num);



extern __attribute__((format(printf, 2, 3))) int sprintf(char *buf, const char * fmt, ...);
extern __attribute__((format(printf, 2, 0))) int vsprintf(char *buf, const char *, va_list);
extern __attribute__((format(printf, 3, 4)))
int snprintf(char *buf, size_t size, const char *fmt, ...);
extern __attribute__((format(printf, 3, 0)))
int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
extern __attribute__((format(printf, 3, 4)))
int scnprintf(char *buf, size_t size, const char *fmt, ...);
extern __attribute__((format(printf, 3, 0)))
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
extern __attribute__((format(printf, 2, 3)))
char *kasprintf(gfp_t gfp, const char *fmt, ...);
extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args);

extern __attribute__((format(scanf, 2, 3)))
int sscanf(const char *, const char *, ...);
extern __attribute__((format(scanf, 2, 0)))
int vsscanf(const char *, const char *, va_list);

extern int get_option(char **str, int *pint);
extern char *get_options(const char *str, int nints, int *ints);
extern unsigned long long memparse(const char *ptr, char **retptr);
extern bool parse_option_str(const char *str, const char *option);

extern int core_kernel_text(unsigned long addr);
extern int core_kernel_data(unsigned long addr);
extern int __kernel_text_address(unsigned long addr);
extern int kernel_text_address(unsigned long addr);
extern int func_ptr_is_kernel_text(void *ptr);

unsigned long int_sqrt(unsigned long);

extern void bust_spinlocks(int yes);
extern int oops_in_progress;
extern int panic_timeout;
extern int panic_on_oops;
extern int panic_on_unrecovered_nmi;
extern int panic_on_io_nmi;
extern int panic_on_warn;
extern int sysctl_panic_on_stackoverflow;




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_arch_panic_timeout(int timeout, int arch_default_timeout)
{
 if (panic_timeout == arch_default_timeout)
  panic_timeout = timeout;
}
extern const char *print_tainted(void);
enum lockdep_ok {
 LOCKDEP_STILL_OK,
 LOCKDEP_NOW_UNRELIABLE
};
extern void add_taint(unsigned flag, enum lockdep_ok);
extern int test_taint(unsigned flag);
extern unsigned long get_taint(void);
extern int root_mountflags;

extern bool early_boot_irqs_disabled;


extern enum system_states {
 SYSTEM_BOOTING,
 SYSTEM_RUNNING,
 SYSTEM_HALT,
 SYSTEM_POWER_OFF,
 SYSTEM_RESTART,
} system_state;
# 476 "include/linux/kernel.h"
extern const char hex_asc[];



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) char *hex_byte_pack(char *buf, u8 byte)
{
 *buf++ = hex_asc[((byte) & 0xf0) >> 4];
 *buf++ = hex_asc[((byte) & 0x0f)];
 return buf;
}

extern const char hex_asc_upper[];



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) char *hex_byte_pack_upper(char *buf, u8 byte)
{
 *buf++ = hex_asc_upper[((byte) & 0xf0) >> 4];
 *buf++ = hex_asc_upper[((byte) & 0x0f)];
 return buf;
}

extern int hex_to_bin(char ch);
extern int __attribute__((warn_unused_result)) hex2bin(u8 *dst, const char *src, size_t count);
extern char *bin2hex(char *dst, const void *src, size_t count);

bool mac_pton(const char *s, u8 *mac);
# 525 "include/linux/kernel.h"
void tracing_off_permanent(void);




enum ftrace_dump_mode {
 DUMP_NONE,
 DUMP_ALL,
 DUMP_ORIG,
};


void tracing_on(void);
void tracing_off(void);
int tracing_is_on(void);
void tracing_snapshot(void);
void tracing_snapshot_alloc(void);

extern void tracing_start(void);
extern void tracing_stop(void);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((format(printf, 1, 2)))
void ____trace_printk_check_format(const char *fmt, ...)
{
}
# 609 "include/linux/kernel.h"
extern __attribute__((format(printf, 2, 3)))
int __trace_bprintk(unsigned long ip, const char *fmt, ...);

extern __attribute__((format(printf, 2, 3)))
int __trace_printk(unsigned long ip, const char *fmt, ...);
# 650 "include/linux/kernel.h"
extern int __trace_bputs(unsigned long ip, const char *str);
extern int __trace_puts(unsigned long ip, const char *str, int size);

extern void trace_dump_stack(int skip);
# 672 "include/linux/kernel.h"
extern int
__ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap);

extern int
__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);

extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
# 18 "include/linux/sched.h" 2

# 1 "include/linux/timex.h" 1
# 56 "include/linux/timex.h"
# 1 "include/uapi/linux/timex.h" 1
# 56 "include/uapi/linux/timex.h"
# 1 "include/linux/time.h" 1




# 1 "include/linux/seqlock.h" 1
# 35 "include/linux/seqlock.h"
# 1 "include/linux/spinlock.h" 1
# 50 "include/linux/spinlock.h"
# 1 "include/linux/preempt.h" 1
# 10 "include/linux/preempt.h"
# 1 "include/linux/list.h" 1





# 1 "include/linux/poison.h" 1
# 7 "include/linux/list.h" 2
# 1 "./include/uapi/linux/const.h" 1
# 8 "include/linux/list.h" 2
# 25 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void INIT_LIST_HEAD(struct list_head *list)
{
 list->next = list;
 list->prev = list;
}
# 38 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_add(struct list_head *new,
         struct list_head *prev,
         struct list_head *next)
{
 next->prev = new;
 new->next = next;
 new->prev = prev;
 prev->next = new;
}
# 61 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_add(struct list_head *new, struct list_head *head)
{
 __list_add(new, head, head->next);
}
# 75 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_add_tail(struct list_head *new, struct list_head *head)
{
 __list_add(new, head->prev, head);
}
# 87 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_del(struct list_head * prev, struct list_head * next)
{
 next->prev = prev;
 prev->next = next;
}
# 100 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_del_entry(struct list_head *entry)
{
 __list_del(entry->prev, entry->next);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_del(struct list_head *entry)
{
 __list_del(entry->prev, entry->next);
 entry->next = ((void *) 0x00100100 + 0);
 entry->prev = ((void *) 0x00200200 + 0);
}
# 123 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_replace(struct list_head *old,
    struct list_head *new)
{
 new->next = old->next;
 new->next->prev = new;
 new->prev = old->prev;
 new->prev->next = new;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_replace_init(struct list_head *old,
     struct list_head *new)
{
 list_replace(old, new);
 INIT_LIST_HEAD(old);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_del_init(struct list_head *entry)
{
 __list_del_entry(entry);
 INIT_LIST_HEAD(entry);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_move(struct list_head *list, struct list_head *head)
{
 __list_del_entry(list);
 list_add(list, head);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_move_tail(struct list_head *list,
      struct list_head *head)
{
 __list_del_entry(list);
 list_add_tail(list, head);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int list_is_last(const struct list_head *list,
    const struct list_head *head)
{
 return list->next == head;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int list_empty(const struct list_head *head)
{
 return head->next == head;
}
# 205 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int list_empty_careful(const struct list_head *head)
{
 struct list_head *next = head->next;
 return (next == head) && (next == head->prev);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_rotate_left(struct list_head *head)
{
 struct list_head *first;

 if (!list_empty(head)) {
  first = head->next;
  list_move_tail(first, head);
 }
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int list_is_singular(const struct list_head *head)
{
 return !list_empty(head) && (head->next == head->prev);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_cut_position(struct list_head *list,
  struct list_head *head, struct list_head *entry)
{
 struct list_head *new_first = entry->next;
 list->next = head->next;
 list->next->prev = list;
 list->prev = entry;
 entry->next = list;
 head->next = new_first;
 new_first->prev = head;
}
# 260 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_cut_position(struct list_head *list,
  struct list_head *head, struct list_head *entry)
{
 if (list_empty(head))
  return;
 if (list_is_singular(head) &&
  (head->next != entry && head != entry))
  return;
 if (entry == head)
  INIT_LIST_HEAD(list);
 else
  __list_cut_position(list, head, entry);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_splice(const struct list_head *list,
     struct list_head *prev,
     struct list_head *next)
{
 struct list_head *first = list->next;
 struct list_head *last = list->prev;

 first->prev = prev;
 prev->next = first;

 last->next = next;
 next->prev = last;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice(const struct list_head *list,
    struct list_head *head)
{
 if (!list_empty(list))
  __list_splice(list, head, head->next);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice_tail(struct list_head *list,
    struct list_head *head)
{
 if (!list_empty(list))
  __list_splice(list, head->prev, head);
}
# 319 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice_init(struct list_head *list,
        struct list_head *head)
{
 if (!list_empty(list)) {
  __list_splice(list, head, head->next);
  INIT_LIST_HEAD(list);
 }
}
# 336 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice_tail_init(struct list_head *list,
      struct list_head *head)
{
 if (!list_empty(list)) {
  __list_splice(list, head->prev, head);
  INIT_LIST_HEAD(list);
 }
}
# 598 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void INIT_HLIST_NODE(struct hlist_node *h)
{
 h->next = ((void *)0);
 h->pprev = ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_unhashed(const struct hlist_node *h)
{
 return !h->pprev;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_empty(const struct hlist_head *h)
{
 return !h->first;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __hlist_del(struct hlist_node *n)
{
 struct hlist_node *next = n->next;
 struct hlist_node **pprev = n->pprev;
 *pprev = next;
 if (next)
  next->pprev = pprev;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_del(struct hlist_node *n)
{
 __hlist_del(n);
 n->next = ((void *) 0x00100100 + 0);
 n->pprev = ((void *) 0x00200200 + 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_del_init(struct hlist_node *n)
{
 if (!hlist_unhashed(n)) {
  __hlist_del(n);
  INIT_HLIST_NODE(n);
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
{
 struct hlist_node *first = h->first;
 n->next = first;
 if (first)
  first->pprev = &n->next;
 h->first = n;
 n->pprev = &h->first;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_before(struct hlist_node *n,
     struct hlist_node *next)
{
 n->pprev = next->pprev;
 n->next = next;
 next->pprev = &n->next;
 *(n->pprev) = n;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_behind(struct hlist_node *n,
        struct hlist_node *prev)
{
 n->next = prev->next;
 prev->next = n;
 n->pprev = &prev->next;

 if (n->next)
  n->next->pprev = &n->next;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_fake(struct hlist_node *n)
{
 n->pprev = &n->next;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_move_list(struct hlist_head *old,
       struct hlist_head *new)
{
 new->first = old->first;
 if (new->first)
  new->first->pprev = &new->first;
 old->first = ((void *)0);
}
# 11 "include/linux/preempt.h" 2







# 1 "arch/sparc/include/generated/asm/preempt.h" 1
# 1 "include/asm-generic/preempt.h" 1



# 1 "include/linux/thread_info.h" 1
# 11 "include/linux/thread_info.h"
# 1 "include/linux/bug.h" 1



# 1 "./arch/sparc/include/asm/bug.h" 1







void do_BUG(const char *file, int line);
# 20 "./arch/sparc/include/asm/bug.h"
# 1 "include/asm-generic/bug.h" 1
# 65 "include/asm-generic/bug.h"
extern __attribute__((format(printf, 3, 4)))
void warn_slowpath_fmt(const char *file, const int line,
         const char *fmt, ...);
extern __attribute__((format(printf, 4, 5)))
void warn_slowpath_fmt_taint(const char *file, const int line, unsigned taint,
        const char *fmt, ...);
extern void warn_slowpath_null(const char *file, const int line);
# 21 "./arch/sparc/include/asm/bug.h" 2

struct pt_regs;
void __attribute__((noreturn)) die_if_kernel(char *str, struct pt_regs *regs);
# 5 "include/linux/bug.h" 2


enum bug_trap_type {
 BUG_TRAP_TYPE_NONE = 0,
 BUG_TRAP_TYPE_WARN = 1,
 BUG_TRAP_TYPE_BUG = 2,
};

struct pt_regs;
# 105 "include/linux/bug.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum bug_trap_type report_bug(unsigned long bug_addr,
         struct pt_regs *regs)
{
 return BUG_TRAP_TYPE_BUG;
}
# 12 "include/linux/thread_info.h" 2

struct timespec;
struct compat_timespec;




struct restart_block {
 long (*fn)(struct restart_block *);
 union {

  struct {
   u32 *uaddr;
   u32 val;
   u32 flags;
   u32 bitset;
   u64 time;
   u32 *uaddr2;
  } futex;

  struct {
   clockid_t clockid;
   struct timespec *rmtp;

   struct compat_timespec *compat_rmtp;

   u64 expires;
  } nanosleep;

  struct {
   struct pollfd *ufds;
   int nfds;
   int has_timeout;
   unsigned long tv_sec;
   unsigned long tv_nsec;
  } poll;
 };
};

extern long do_no_restart_syscall(struct restart_block *parm);


# 1 "./arch/sparc/include/asm/thread_info.h" 1



# 1 "./arch/sparc/include/asm/thread_info_64.h" 1
# 26 "./arch/sparc/include/asm/thread_info_64.h"
# 1 "./arch/sparc/include/asm/page.h" 1






# 1 "./arch/sparc/include/asm/page_64.h" 1
# 33 "./arch/sparc/include/asm/page_64.h"
struct pt_regs;
void hugetlb_setup(struct pt_regs *regs);




void _clear_page(void *page);

struct page;
void clear_user_page(void *addr, unsigned long vaddr, struct page *page);

void copy_user_page(void *to, void *from, unsigned long vaddr, struct page *topage);
# 57 "./arch/sparc/include/asm/page_64.h"
typedef struct { unsigned long pte; } pte_t;
typedef struct { unsigned long iopte; } iopte_t;
typedef struct { unsigned long pmd; } pmd_t;
typedef struct { unsigned long pud; } pud_t;
typedef struct { unsigned long pgd; } pgd_t;
typedef struct { unsigned long pgprot; } pgprot_t;
# 103 "./arch/sparc/include/asm/page_64.h"
typedef pte_t *pgtable_t;

extern unsigned long sparc64_va_hole_top;
extern unsigned long sparc64_va_hole_bottom;
# 118 "./arch/sparc/include/asm/page_64.h"
# 1 "include/asm-generic/memory_model.h" 1
# 119 "./arch/sparc/include/asm/page_64.h" 2

extern unsigned long PAGE_OFFSET;
# 152 "./arch/sparc/include/asm/page_64.h"
# 1 "include/asm-generic/getorder.h" 1
# 12 "include/asm-generic/getorder.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__))
int __get_order(unsigned long size)
{
 int order;

 size--;
 size >>= 13;



 order = fls64(size);

 return order;
}
# 153 "./arch/sparc/include/asm/page_64.h" 2
# 8 "./arch/sparc/include/asm/page.h" 2
# 27 "./arch/sparc/include/asm/thread_info_64.h" 2



# 1 "./arch/sparc/include/asm/ptrace.h" 1



# 1 "./arch/sparc/include/uapi/asm/ptrace.h" 1





# 1 "./arch/sparc/include/uapi/asm/pstate.h" 1
# 7 "./arch/sparc/include/uapi/asm/ptrace.h" 2
# 21 "./arch/sparc/include/uapi/asm/ptrace.h"
struct pt_regs {
 unsigned long u_regs[16];
 unsigned long tstate;
 unsigned long tpc;
 unsigned long tnpc;
 unsigned int y;
# 39 "./arch/sparc/include/uapi/asm/ptrace.h"
 unsigned int magic;
};

struct pt_regs32 {
 unsigned int psr;
 unsigned int pc;
 unsigned int npc;
 unsigned int y;
 unsigned int u_regs[16];
};


struct reg_window {
 unsigned long locals[8];
 unsigned long ins[8];
};


struct reg_window32 {
 unsigned int locals[8];
 unsigned int ins[8];
};


struct sparc_stackf {
 unsigned long locals[8];
        unsigned long ins[6];
 struct sparc_stackf *fp;
 unsigned long callers_pc;
 char *structptr;
 unsigned long xargs[6];
 unsigned long xxargs[1];
};


struct sparc_stackf32 {
 unsigned int locals[8];
        unsigned int ins[6];
 unsigned int fp;
 unsigned int callers_pc;
 unsigned int structptr;
 unsigned int xargs[6];
 unsigned int xxargs[1];
};

struct sparc_trapf {
 unsigned long locals[8];
 unsigned long ins[8];
 unsigned long _unused;
 struct pt_regs *regs;
};
# 5 "./arch/sparc/include/asm/ptrace.h" 2





# 1 "./arch/sparc/include/asm/switch_to.h" 1



# 1 "./arch/sparc/include/asm/switch_to_64.h" 1



# 1 "./arch/sparc/include/asm/visasm.h" 1
# 10 "./arch/sparc/include/asm/visasm.h"
# 1 "./arch/sparc/include/asm/ptrace.h" 1
# 11 "./arch/sparc/include/asm/visasm.h" 2
# 54 "./arch/sparc/include/asm/visasm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void save_and_clear_fpu(void) {
 __asm__ __volatile__ (
"		rd %%fprs, %%o5\n"
"		andcc %%o5, %0, %%g0\n"
"		be,pt %%icc, 299f\n"
"		 sethi %%hi(298f), %%g7\n"
"		sethi %%hi(VISenter), %%g1\n"
"		jmpl %%g1 + %%lo(VISenter), %%g0\n"
"		 or %%g7, %%lo(298f), %%g7\n"
"	298:	wr %%g0, 0, %%fprs\n"
"	299:\n"
"		" : : "i" ((0x0000000000000004UL)|(0x0000000000000002UL)) :
  "o5", "g1", "g2", "g3", "g7", "cc");
}

int vis_emul(struct pt_regs *, unsigned int);
# 5 "./arch/sparc/include/asm/switch_to_64.h" 2
# 68 "./arch/sparc/include/asm/switch_to_64.h"
void synchronize_user_stack(void);
void fault_in_user_windows(void);
# 5 "./arch/sparc/include/asm/switch_to.h" 2
# 11 "./arch/sparc/include/asm/ptrace.h" 2

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pt_regs_trap_type(struct pt_regs *regs)
{
 return regs->magic & 0x1ff;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pt_regs_is_syscall(struct pt_regs *regs)
{
 return (regs->tstate & (0x0000000000000020UL));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pt_regs_clear_syscall(struct pt_regs *regs)
{
 return (regs->tstate &= ~(0x0000000000000020UL));
}
# 38 "./arch/sparc/include/asm/ptrace.h"
struct global_reg_snapshot {
 unsigned long tstate;
 unsigned long tpc;
 unsigned long tnpc;
 unsigned long o7;
 unsigned long i7;
 unsigned long rpc;
 struct thread_info *thread;
 unsigned long pad1;
};

struct global_pmu_snapshot {
 unsigned long pcr[4];
 unsigned long pic[4];
};

union global_cpu_snapshot {
 struct global_reg_snapshot reg;
 struct global_pmu_snapshot pmu;
};

extern union global_cpu_snapshot global_cpu_snapshot[128];






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_syscall_success(struct pt_regs *regs)
{
 return !(regs->tstate & ((0x0000001000000000UL) | (0x0000000100000000UL)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long regs_return_value(struct pt_regs *regs)
{
 return regs->u_regs[8];
}

unsigned long profile_pc(struct pt_regs *);
# 31 "./arch/sparc/include/asm/thread_info_64.h" 2
# 1 "arch/sparc/include/generated/asm/types.h" 1
# 32 "./arch/sparc/include/asm/thread_info_64.h" 2

struct task_struct;
struct exec_domain;

struct thread_info {

 struct task_struct *task;
 unsigned long flags;
 __u8 fpsaved[7];
 __u8 status;
 unsigned long ksp;


 unsigned long fault_address;
 struct pt_regs *kregs;
 struct exec_domain *exec_domain;
 int preempt_count;
 __u8 new_child;
 __u8 current_ds;
 __u16 cpu;

 unsigned long *utraps;

 struct reg_window reg_window[7];
 unsigned long rwbuf_stkptrs[7];

 unsigned long gsr[7];
 unsigned long xfsr[7];

 struct pt_regs *kern_una_regs;
 unsigned int kern_una_insn;

 unsigned long fpregs[(7 * 256) / sizeof(unsigned long)]
  __attribute__ ((aligned(64)));
};
# 130 "./arch/sparc/include/asm/thread_info_64.h"
register struct thread_info *current_thread_info_reg asm("g6");
# 233 "./arch/sparc/include/asm/thread_info_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_restore_sigmask(void)
{
 struct thread_info *ti = (current_thread_info_reg);
 ti->status |= 0x0001;
 ({ int __ret_warn_on = !!(!test_bit(2, &ti->flags)); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("./arch/sparc/include/asm/thread_info_64.h", 237); __builtin_expect(!!(__ret_warn_on), 0); });
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_restore_sigmask(void)
{
 (current_thread_info_reg)->status &= ~0x0001;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool test_restore_sigmask(void)
{
 return (current_thread_info_reg)->status & 0x0001;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool test_and_clear_restore_sigmask(void)
{
 struct thread_info *ti = (current_thread_info_reg);
 if (!(ti->status & 0x0001))
  return false;
 ti->status &= ~0x0001;
 return true;
}
# 5 "./arch/sparc/include/asm/thread_info.h" 2
# 55 "include/linux/thread_info.h" 2
# 69 "include/linux/thread_info.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_ti_thread_flag(struct thread_info *ti, int flag)
{
 set_bit(flag, (unsigned long *)&ti->flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_ti_thread_flag(struct thread_info *ti, int flag)
{
 clear_bit(flag, (unsigned long *)&ti->flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_set_ti_thread_flag(struct thread_info *ti, int flag)
{
 return test_and_set_bit(flag, (unsigned long *)&ti->flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag)
{
 return test_and_clear_bit(flag, (unsigned long *)&ti->flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_ti_thread_flag(struct thread_info *ti, int flag)
{
 return test_bit(flag, (unsigned long *)&ti->flags);
}
# 5 "include/asm-generic/preempt.h" 2



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int preempt_count(void)
{
 return (current_thread_info_reg)->preempt_count;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int *preempt_count_ptr(void)
{
 return &(current_thread_info_reg)->preempt_count;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void preempt_count_set(int pc)
{
 *preempt_count_ptr() = pc;
}
# 34 "include/asm-generic/preempt.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void set_preempt_need_resched(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void clear_preempt_need_resched(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool test_preempt_need_resched(void)
{
 return false;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __preempt_count_add(int val)
{
 *preempt_count_ptr() += val;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __preempt_count_sub(int val)
{
 *preempt_count_ptr() -= val;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool __preempt_count_dec_and_test(void)
{





 return !--*preempt_count_ptr() && test_ti_thread_flag((current_thread_info_reg), 3);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool should_resched(void)
{
 return __builtin_expect(!!(!preempt_count() && test_ti_thread_flag((current_thread_info_reg), 3)), 0);
}
# 1 "arch/sparc/include/generated/asm/preempt.h" 2
# 19 "include/linux/preempt.h" 2
# 51 "include/linux/spinlock.h" 2


# 1 "include/linux/irqflags.h" 1
# 15 "include/linux/irqflags.h"
# 1 "./arch/sparc/include/asm/irqflags.h" 1



# 1 "./arch/sparc/include/asm/irqflags_64.h" 1
# 13 "./arch/sparc/include/asm/irqflags_64.h"
# 1 "./arch/sparc/include/asm/pil.h" 1
# 14 "./arch/sparc/include/asm/irqflags_64.h" 2



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) unsigned long arch_local_save_flags(void)
{
 unsigned long flags;

 __asm__ __volatile__(
  "rdpr	%%pil, %0"
  : "=r" (flags)
 );

 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) void arch_local_irq_restore(unsigned long flags)
{
 __asm__ __volatile__(
  "wrpr	%0, %%pil"
  :
  : "r" (flags)
  : "memory"
 );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) void arch_local_irq_disable(void)
{
 __asm__ __volatile__(
  "wrpr	%0, %%pil"
  :
  : "i" (14)
  : "memory"
 );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) void arch_local_irq_enable(void)
{
 __asm__ __volatile__(
  "wrpr	0, %%pil"
  :
  :
  : "memory"
 );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) int arch_irqs_disabled_flags(unsigned long flags)
{
 return (flags > 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) int arch_irqs_disabled(void)
{
 return arch_irqs_disabled_flags(arch_local_save_flags());
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) unsigned long arch_local_irq_save(void)
{
 unsigned long flags, tmp;
# 83 "./arch/sparc/include/asm/irqflags_64.h"
 __asm__ __volatile__(
  "rdpr	%%pil, %0\n\t"
  "or	%0, %2, %1\n\t"
  "wrpr	%1, 0x0, %%pil"
  : "=r" (flags), "=r" (tmp)
  : "i" (14)
  : "memory"
 );

 return flags;
}
# 5 "./arch/sparc/include/asm/irqflags.h" 2
# 16 "include/linux/irqflags.h" 2
# 54 "include/linux/spinlock.h" 2



# 1 "include/linux/bottom_half.h" 1




# 1 "include/linux/preempt_mask.h" 1
# 6 "include/linux/bottom_half.h" 2




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
{
 __preempt_count_add(cnt);
 __asm__ __volatile__("": : :"memory");
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void local_bh_disable(void)
{
 __local_bh_disable_ip(({ __label__ __here; __here: (unsigned long)&&__here; }), (2 * (1UL << (0 + 8))));
}

extern void _local_bh_enable(void);
extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void local_bh_enable_ip(unsigned long ip)
{
 __local_bh_enable_ip(ip, (2 * (1UL << (0 + 8))));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void local_bh_enable(void)
{
 __local_bh_enable_ip(({ __label__ __here; __here: (unsigned long)&&__here; }), (2 * (1UL << (0 + 8))));
}
# 58 "include/linux/spinlock.h" 2
# 81 "include/linux/spinlock.h"
# 1 "include/linux/spinlock_types.h" 1
# 13 "include/linux/spinlock_types.h"
# 1 "./arch/sparc/include/asm/spinlock_types.h" 1







typedef struct {
 volatile unsigned char lock;
} arch_spinlock_t;



typedef struct {
 volatile unsigned int lock;
} arch_rwlock_t;
# 14 "include/linux/spinlock_types.h" 2




# 1 "include/linux/lockdep.h" 1
# 12 "include/linux/lockdep.h"
struct task_struct;
struct lockdep_map;


extern int prove_locking;
extern int lock_stat;
# 373 "include/linux/lockdep.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void lockdep_off(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void lockdep_on(void)
{
}
# 414 "include/linux/lockdep.h"
struct lock_class_key { };
# 469 "include/linux/lockdep.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void print_irqtrace_events(struct task_struct *curr)
{
}
# 19 "include/linux/spinlock_types.h" 2

typedef struct raw_spinlock {
 arch_spinlock_t raw_lock;
# 32 "include/linux/spinlock_types.h"
} raw_spinlock_t;
# 64 "include/linux/spinlock_types.h"
typedef struct spinlock {
 union {
  struct raw_spinlock rlock;
# 75 "include/linux/spinlock_types.h"
 };
} spinlock_t;
# 86 "include/linux/spinlock_types.h"
# 1 "include/linux/rwlock_types.h" 1
# 11 "include/linux/rwlock_types.h"
typedef struct {
 arch_rwlock_t raw_lock;
# 23 "include/linux/rwlock_types.h"
} rwlock_t;
# 87 "include/linux/spinlock_types.h" 2
# 82 "include/linux/spinlock.h" 2





# 1 "./arch/sparc/include/asm/spinlock.h" 1



# 1 "./arch/sparc/include/asm/spinlock_64.h" 1
# 30 "./arch/sparc/include/asm/spinlock_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_spin_lock(arch_spinlock_t *lock)
{
 unsigned long tmp;

 __asm__ __volatile__(
"1:	ldstub		[%1], %0\n"
"	brnz,pn		%0, 2f\n"
"	 nop\n"
"	.subsection	2\n"
"2:	ldub		[%1], %0\n"
"	brnz,pt		%0, 2b\n"
"	 nop\n"
"	ba,a,pt		%%xcc, 1b\n"
"	.previous"
 : "=&r" (tmp)
 : "r" (lock)
 : "memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_spin_trylock(arch_spinlock_t *lock)
{
 unsigned long result;

 __asm__ __volatile__(
"	ldstub		[%1], %0\n"
 : "=r" (result)
 : "r" (lock)
 : "memory");

 return (result == 0UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_spin_unlock(arch_spinlock_t *lock)
{
 __asm__ __volatile__(
"	stb		%%g0, [%0]"
 :
 : "r" (lock)
 : "memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags)
{
 unsigned long tmp1, tmp2;

 __asm__ __volatile__(
"1:	ldstub		[%2], %0\n"
"	brnz,pn		%0, 2f\n"
"	 nop\n"
"	.subsection	2\n"
"2:	rdpr		%%pil, %1\n"
"	wrpr		%3, %%pil\n"
"3:	ldub		[%2], %0\n"
"	brnz,pt		%0, 3b\n"
"	 nop\n"
"	ba,pt		%%xcc, 1b\n"
"	 wrpr		%1, %%pil\n"
"	.previous"
 : "=&r" (tmp1), "=&r" (tmp2)
 : "r"(lock), "r"(flags)
 : "memory");
}



static void inline __attribute__((always_inline)) __attribute__((no_instrument_function)) arch_read_lock(arch_rwlock_t *lock)
{
 unsigned long tmp1, tmp2;

 __asm__ __volatile__ (
"1:	ldsw		[%2], %0\n"
"	brlz,pn		%0, 2f\n"
"4:	 add		%0, 1, %1\n"
"	cas		[%2], %0, %1\n"
"	cmp		%0, %1\n"
"	bne,pn		%%icc, 1b\n"
"	 nop\n"
"	.subsection	2\n"
"2:	ldsw		[%2], %0\n"
"	brlz,pt		%0, 2b\n"
"	 nop\n"
"	ba,a,pt		%%xcc, 4b\n"
"	.previous"
 : "=&r" (tmp1), "=&r" (tmp2)
 : "r" (lock)
 : "memory");
}

static int inline __attribute__((always_inline)) __attribute__((no_instrument_function)) arch_read_trylock(arch_rwlock_t *lock)
{
 int tmp1, tmp2;

 __asm__ __volatile__ (
"1:	ldsw		[%2], %0\n"
"	brlz,a,pn	%0, 2f\n"
"	 mov		0, %0\n"
"	add		%0, 1, %1\n"
"	cas		[%2], %0, %1\n"
"	cmp		%0, %1\n"
"	bne,pn		%%icc, 1b\n"
"	 mov		1, %0\n"
"2:"
 : "=&r" (tmp1), "=&r" (tmp2)
 : "r" (lock)
 : "memory");

 return tmp1;
}

static void inline __attribute__((always_inline)) __attribute__((no_instrument_function)) arch_read_unlock(arch_rwlock_t *lock)
{
 unsigned long tmp1, tmp2;

 __asm__ __volatile__(
"1:	lduw	[%2], %0\n"
"	sub	%0, 1, %1\n"
"	cas	[%2], %0, %1\n"
"	cmp	%0, %1\n"
"	bne,pn	%%xcc, 1b\n"
"	 nop"
 : "=&r" (tmp1), "=&r" (tmp2)
 : "r" (lock)
 : "memory");
}

static void inline __attribute__((always_inline)) __attribute__((no_instrument_function)) arch_write_lock(arch_rwlock_t *lock)
{
 unsigned long mask, tmp1, tmp2;

 mask = 0x80000000UL;

 __asm__ __volatile__(
"1:	lduw		[%2], %0\n"
"	brnz,pn		%0, 2f\n"
"4:	 or		%0, %3, %1\n"
"	cas		[%2], %0, %1\n"
"	cmp		%0, %1\n"
"	bne,pn		%%icc, 1b\n"
"	 nop\n"
"	.subsection	2\n"
"2:	lduw		[%2], %0\n"
"	brnz,pt		%0, 2b\n"
"	 nop\n"
"	ba,a,pt		%%xcc, 4b\n"
"	.previous"
 : "=&r" (tmp1), "=&r" (tmp2)
 : "r" (lock), "r" (mask)
 : "memory");
}

static void inline __attribute__((always_inline)) __attribute__((no_instrument_function)) arch_write_unlock(arch_rwlock_t *lock)
{
 __asm__ __volatile__(
"	stw		%%g0, [%0]"
 :
 : "r" (lock)
 : "memory");
}

static int inline __attribute__((always_inline)) __attribute__((no_instrument_function)) arch_write_trylock(arch_rwlock_t *lock)
{
 unsigned long mask, tmp1, tmp2, result;

 mask = 0x80000000UL;

 __asm__ __volatile__(
"	mov		0, %2\n"
"1:	lduw		[%3], %0\n"
"	brnz,pn		%0, 2f\n"
"	 or		%0, %4, %1\n"
"	cas		[%3], %0, %1\n"
"	cmp		%0, %1\n"
"	bne,pn		%%icc, 1b\n"
"	 nop\n"
"	mov		1, %2\n"
"2:"
 : "=&r" (tmp1), "=&r" (tmp2), "=&r" (result)
 : "r" (lock), "r" (mask)
 : "memory");

 return result;
}
# 5 "./arch/sparc/include/asm/spinlock.h" 2
# 88 "include/linux/spinlock.h" 2
# 155 "include/linux/spinlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void do_raw_spin_lock(raw_spinlock_t *lock)
{
 (void)0;
 arch_spin_lock(&lock->raw_lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
do_raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long *flags)
{
 (void)0;
 arch_spin_lock_flags(&lock->raw_lock, *flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int do_raw_spin_trylock(raw_spinlock_t *lock)
{
 return arch_spin_trylock(&(lock)->raw_lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void do_raw_spin_unlock(raw_spinlock_t *lock)
{
 arch_spin_unlock(&lock->raw_lock);
 (void)0;
}
# 284 "include/linux/spinlock.h"
# 1 "include/linux/rwlock.h" 1
# 285 "include/linux/spinlock.h" 2





# 1 "include/linux/spinlock_api_smp.h" 1
# 18 "include/linux/spinlock_api_smp.h"
int in_lock_functions(unsigned long addr);



void __attribute__((section(".spinlock.text"))) _raw_spin_lock(raw_spinlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass)
        ;
void __attribute__((section(".spinlock.text"))) _raw_spin_lock_bh_nested(raw_spinlock_t *lock, int subclass)
        ;
void __attribute__((section(".spinlock.text")))
_raw_spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map)
        ;
void __attribute__((section(".spinlock.text"))) _raw_spin_lock_bh(raw_spinlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_spin_lock_irq(raw_spinlock_t *lock)
        ;

unsigned long __attribute__((section(".spinlock.text"))) _raw_spin_lock_irqsave(raw_spinlock_t *lock)
        ;
unsigned long __attribute__((section(".spinlock.text")))
_raw_spin_lock_irqsave_nested(raw_spinlock_t *lock, int subclass)
        ;
int __attribute__((section(".spinlock.text"))) _raw_spin_trylock(raw_spinlock_t *lock);
int __attribute__((section(".spinlock.text"))) _raw_spin_trylock_bh(raw_spinlock_t *lock);
void __attribute__((section(".spinlock.text"))) _raw_spin_unlock(raw_spinlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_spin_unlock_bh(raw_spinlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_spin_unlock_irq(raw_spinlock_t *lock) ;
void __attribute__((section(".spinlock.text")))
_raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags)
        ;
# 88 "include/linux/spinlock_api_smp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __raw_spin_trylock(raw_spinlock_t *lock)
{
 __asm__ __volatile__("": : :"memory");
 if (do_raw_spin_trylock(lock)) {
  do { } while (0);
  return 1;
 }
 __asm__ __volatile__("": : :"memory");
 return 0;
}
# 106 "include/linux/spinlock_api_smp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __raw_spin_lock_irqsave(raw_spinlock_t *lock)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); do { } while (0); } while (0);
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
# 121 "include/linux/spinlock_api_smp.h"
 do_raw_spin_lock_flags(lock, &flags);

 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_lock_irq(raw_spinlock_t *lock)
{
 do { arch_local_irq_disable(); do { } while (0); } while (0);
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do_raw_spin_lock(lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_lock_bh(raw_spinlock_t *lock)
{
 __local_bh_disable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
 do { } while (0);
 do_raw_spin_lock(lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_lock(raw_spinlock_t *lock)
{
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do_raw_spin_lock(lock);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_unlock(raw_spinlock_t *lock)
{
 do { } while (0);
 do_raw_spin_unlock(lock);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_unlock_irqrestore(raw_spinlock_t *lock,
         unsigned long flags)
{
 do { } while (0);
 do_raw_spin_unlock(lock);
 do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_unlock_irq(raw_spinlock_t *lock)
{
 do { } while (0);
 do_raw_spin_unlock(lock);
 do { do { } while (0); arch_local_irq_enable(); } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_unlock_bh(raw_spinlock_t *lock)
{
 do { } while (0);
 do_raw_spin_unlock(lock);
 __local_bh_enable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __raw_spin_trylock_bh(raw_spinlock_t *lock)
{
 __local_bh_disable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
 if (do_raw_spin_trylock(lock)) {
  do { } while (0);
  return 1;
 }
 __local_bh_enable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
 return 0;
}

# 1 "include/linux/rwlock_api_smp.h" 1
# 18 "include/linux/rwlock_api_smp.h"
void __attribute__((section(".spinlock.text"))) _raw_read_lock(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_write_lock(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_read_lock_bh(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_write_lock_bh(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_read_lock_irq(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_write_lock_irq(rwlock_t *lock) ;
unsigned long __attribute__((section(".spinlock.text"))) _raw_read_lock_irqsave(rwlock_t *lock)
       ;
unsigned long __attribute__((section(".spinlock.text"))) _raw_write_lock_irqsave(rwlock_t *lock)
       ;
int __attribute__((section(".spinlock.text"))) _raw_read_trylock(rwlock_t *lock);
int __attribute__((section(".spinlock.text"))) _raw_write_trylock(rwlock_t *lock);
void __attribute__((section(".spinlock.text"))) _raw_read_unlock(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_write_unlock(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_read_unlock_bh(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_write_unlock_bh(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_read_unlock_irq(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_write_unlock_irq(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text")))
_raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
       ;
void __attribute__((section(".spinlock.text")))
_raw_write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
       ;
# 117 "include/linux/rwlock_api_smp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __raw_read_trylock(rwlock_t *lock)
{
 __asm__ __volatile__("": : :"memory");
 if (arch_read_trylock(&(lock)->raw_lock)) {
  do { } while (0);
  return 1;
 }
 __asm__ __volatile__("": : :"memory");
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __raw_write_trylock(rwlock_t *lock)
{
 __asm__ __volatile__("": : :"memory");
 if (arch_write_trylock(&(lock)->raw_lock)) {
  do { } while (0);
  return 1;
 }
 __asm__ __volatile__("": : :"memory");
 return 0;
}
# 146 "include/linux/rwlock_api_smp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_lock(rwlock_t *lock)
{
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do {(void)0; arch_read_lock(&(lock)->raw_lock); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __raw_read_lock_irqsave(rwlock_t *lock)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); do { } while (0); } while (0);
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do {(void)0; arch_read_lock(&((lock))->raw_lock); } while (0)
                                       ;
 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_lock_irq(rwlock_t *lock)
{
 do { arch_local_irq_disable(); do { } while (0); } while (0);
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do {(void)0; arch_read_lock(&(lock)->raw_lock); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_lock_bh(rwlock_t *lock)
{
 __local_bh_disable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
 do { } while (0);
 do {(void)0; arch_read_lock(&(lock)->raw_lock); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __raw_write_lock_irqsave(rwlock_t *lock)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); do { } while (0); } while (0);
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do {(void)0; arch_write_lock(&((lock))->raw_lock); } while (0)
                                        ;
 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_lock_irq(rwlock_t *lock)
{
 do { arch_local_irq_disable(); do { } while (0); } while (0);
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do {(void)0; arch_write_lock(&(lock)->raw_lock); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_lock_bh(rwlock_t *lock)
{
 __local_bh_disable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
 do { } while (0);
 do {(void)0; arch_write_lock(&(lock)->raw_lock); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_lock(rwlock_t *lock)
{
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do {(void)0; arch_write_lock(&(lock)->raw_lock); } while (0);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_unlock(rwlock_t *lock)
{
 do { } while (0);
 do {arch_write_unlock(&(lock)->raw_lock); (void)0; } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_unlock(rwlock_t *lock)
{
 do { } while (0);
 do {arch_read_unlock(&(lock)->raw_lock); (void)0; } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
__raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
{
 do { } while (0);
 do {arch_read_unlock(&(lock)->raw_lock); (void)0; } while (0);
 do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_unlock_irq(rwlock_t *lock)
{
 do { } while (0);
 do {arch_read_unlock(&(lock)->raw_lock); (void)0; } while (0);
 do { do { } while (0); arch_local_irq_enable(); } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_unlock_bh(rwlock_t *lock)
{
 do { } while (0);
 do {arch_read_unlock(&(lock)->raw_lock); (void)0; } while (0);
 __local_bh_enable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_unlock_irqrestore(rwlock_t *lock,
          unsigned long flags)
{
 do { } while (0);
 do {arch_write_unlock(&(lock)->raw_lock); (void)0; } while (0);
 do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_unlock_irq(rwlock_t *lock)
{
 do { } while (0);
 do {arch_write_unlock(&(lock)->raw_lock); (void)0; } while (0);
 do { do { } while (0); arch_local_irq_enable(); } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_unlock_bh(rwlock_t *lock)
{
 do { } while (0);
 do {arch_write_unlock(&(lock)->raw_lock); (void)0; } while (0);
 __local_bh_enable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
}
# 193 "include/linux/spinlock_api_smp.h" 2
# 291 "include/linux/spinlock.h" 2
# 299 "include/linux/spinlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) raw_spinlock_t *spinlock_check(spinlock_t *lock)
{
 return &lock->rlock;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_lock(spinlock_t *lock)
{
 _raw_spin_lock(&lock->rlock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_lock_bh(spinlock_t *lock)
{
 _raw_spin_lock_bh(&lock->rlock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_trylock(spinlock_t *lock)
{
 return (_raw_spin_trylock(&lock->rlock));
}
# 340 "include/linux/spinlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_lock_irq(spinlock_t *lock)
{
 _raw_spin_lock_irq(&lock->rlock);
}
# 355 "include/linux/spinlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_unlock(spinlock_t *lock)
{
 __raw_spin_unlock(&lock->rlock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_unlock_bh(spinlock_t *lock)
{
 _raw_spin_unlock_bh(&lock->rlock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_unlock_irq(spinlock_t *lock)
{
 __raw_spin_unlock_irq(&lock->rlock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
{
 do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); _raw_spin_unlock_irqrestore(&lock->rlock, flags); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_trylock_bh(spinlock_t *lock)
{
 return (_raw_spin_trylock_bh(&lock->rlock));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_trylock_irq(spinlock_t *lock)
{
 return ({ do { arch_local_irq_disable(); do { } while (0); } while (0); (_raw_spin_trylock(&lock->rlock)) ? 1 : ({ do { do { } while (0); arch_local_irq_enable(); } while (0); 0; }); });
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_unlock_wait(spinlock_t *lock)
{
 do { __asm__ __volatile__("":::"memory"); } while((&(&lock->rlock)->raw_lock)->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_is_locked(spinlock_t *lock)
{
 return ((&(&lock->rlock)->raw_lock)->lock != 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_is_contended(spinlock_t *lock)
{
 return (((void)(&lock->rlock), 0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_can_lock(spinlock_t *lock)
{
 return (!((&(&lock->rlock)->raw_lock)->lock != 0));
}







# 1 "include/linux/atomic.h" 1



# 1 "./arch/sparc/include/asm/atomic.h" 1



# 1 "./arch/sparc/include/asm/atomic_64.h" 1
# 11 "./arch/sparc/include/asm/atomic_64.h"
# 1 "./arch/sparc/include/asm/cmpxchg.h" 1



# 1 "./arch/sparc/include/asm/cmpxchg_64.h" 1
# 9 "./arch/sparc/include/asm/cmpxchg_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val)
{
 unsigned long tmp1, tmp2;

 __asm__ __volatile__(
"	mov		%0, %1\n"
"1:	lduw		[%4], %2\n"
"	cas		[%4], %2, %0\n"
"	cmp		%2, %0\n"
"	bne,a,pn	%%icc, 1b\n"
"	 mov		%1, %0\n"
 : "=&r" (val), "=&r" (tmp1), "=&r" (tmp2)
 : "0" (val), "r" (m)
 : "cc", "memory");
 return val;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long xchg64(__volatile__ unsigned long *m, unsigned long val)
{
 unsigned long tmp1, tmp2;

 __asm__ __volatile__(
"	mov		%0, %1\n"
"1:	ldx		[%4], %2\n"
"	casx		[%4], %2, %0\n"
"	cmp		%2, %0\n"
"	bne,a,pn	%%xcc, 1b\n"
"	 mov		%1, %0\n"
 : "=&r" (val), "=&r" (tmp1), "=&r" (tmp2)
 : "0" (val), "r" (m)
 : "cc", "memory");
 return val;
}



void __xchg_called_with_bad_pointer(void);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __xchg(unsigned long x, __volatile__ void * ptr,
           int size)
{
 switch (size) {
 case 4:
  return xchg32(ptr, x);
 case 8:
  return xchg64(ptr, x);
 }
 __xchg_called_with_bad_pointer();
 return x;
}







# 1 "include/asm-generic/cmpxchg-local.h" 1






extern unsigned long wrong_size_cmpxchg(volatile void *ptr)
 __attribute__((noreturn));





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __cmpxchg_local_generic(volatile void *ptr,
  unsigned long old, unsigned long new, int size)
{
 unsigned long flags, prev;




 if (size == 8 && sizeof(unsigned long) != 8)
  wrong_size_cmpxchg(ptr);

 do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0);
 switch (size) {
 case 1: prev = *(u8 *)ptr;
  if (prev == old)
   *(u8 *)ptr = (u8)new;
  break;
 case 2: prev = *(u16 *)ptr;
  if (prev == old)
   *(u16 *)ptr = (u16)new;
  break;
 case 4: prev = *(u32 *)ptr;
  if (prev == old)
   *(u32 *)ptr = (u32)new;
  break;
 case 8: prev = *(u64 *)ptr;
  if (prev == old)
   *(u64 *)ptr = (u64)new;
  break;
 default:
  wrong_size_cmpxchg(ptr);
 }
 do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0);
 return prev;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 __cmpxchg64_local_generic(volatile void *ptr,
  u64 old, u64 new)
{
 u64 prev;
 unsigned long flags;

 do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0);
 prev = *(u64 *)ptr;
 if (prev == old)
  *(u64 *)ptr = new;
 do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0);
 return prev;
}
# 67 "./arch/sparc/include/asm/cmpxchg_64.h" 2



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
__cmpxchg_u32(volatile int *m, int old, int new)
{
 __asm__ __volatile__("cas [%2], %3, %0"
        : "=&r" (new)
        : "0" (new), "r" (m), "r" (old)
        : "memory");

 return new;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
{
 __asm__ __volatile__("casx [%2], %3, %0"
        : "=&r" (new)
        : "0" (new), "r" (m), "r" (old)
        : "memory");

 return new;
}



void __cmpxchg_called_with_bad_pointer(void);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
{
 switch (size) {
  case 4:
   return __cmpxchg_u32(ptr, old, new);
  case 8:
   return __cmpxchg_u64(ptr, old, new);
 }
 __cmpxchg_called_with_bad_pointer();
 return old;
}
# 122 "./arch/sparc/include/asm/cmpxchg_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __cmpxchg_local(volatile void *ptr,
          unsigned long old,
          unsigned long new, int size)
{
 switch (size) {
 case 4:
 case 8: return __cmpxchg(ptr, old, new, size);
 default:
  return __cmpxchg_local_generic(ptr, old, new, size);
 }

 return old;
}
# 5 "./arch/sparc/include/asm/cmpxchg.h" 2
# 12 "./arch/sparc/include/asm/atomic_64.h" 2
# 33 "./arch/sparc/include/asm/atomic_64.h"
void atomic_add(int, atomic_t *); void atomic64_add(long, atomic64_t *); int atomic_add_return(int, atomic_t *); long atomic64_add_return(long, atomic64_t *);
void atomic_sub(int, atomic_t *); void atomic64_sub(long, atomic64_t *); int atomic_sub_return(int, atomic_t *); long atomic64_sub_return(long, atomic64_t *);
# 75 "./arch/sparc/include/asm/atomic_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __atomic_add_unless(atomic_t *v, int a, int u)
{
 int c, old;
 c = (*({ __attribute__((unused)) typeof((v)->counter) __var = ( typeof((v)->counter)) 0; (volatile typeof((v)->counter) *)&((v)->counter); }));
 for (;;) {
  if (__builtin_expect(!!(c == (u)), 0))
   break;
  old = (({ __typeof__(*(&(((v))->counter))) _o_ = ((c)); __typeof__(*(&(((v))->counter))) _n_ = ((c + (a))); (__typeof__(*(&(((v))->counter)))) __cmpxchg((&(((v))->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&(((v))->counter)))); }));
  if (__builtin_expect(!!(old == c), 1))
   break;
  c = old;
 }
 return c;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic64_add_unless(atomic64_t *v, long a, long u)
{
 long c, old;
 c = (*({ __attribute__((unused)) typeof((v)->counter) __var = ( typeof((v)->counter)) 0; (volatile typeof((v)->counter) *)&((v)->counter); }));
 for (;;) {
  if (__builtin_expect(!!(c == (u)), 0))
   break;
  old = ((__typeof__(((v))->counter))({ __typeof__(*(&(((v))->counter))) _o_ = ((c)); __typeof__(*(&(((v))->counter))) _n_ = ((c + (a))); (__typeof__(*(&(((v))->counter)))) __cmpxchg((&(((v))->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&(((v))->counter)))); }));
  if (__builtin_expect(!!(old == c), 1))
   break;
  c = old;
 }
 return c != (u);
}



long atomic64_dec_if_positive(atomic64_t *v);
# 5 "./arch/sparc/include/asm/atomic.h" 2
# 5 "include/linux/atomic.h" 2
# 15 "include/linux/atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_add_unless(atomic_t *v, int a, int u)
{
 return __atomic_add_unless(v, a, u) != u;
}
# 44 "include/linux/atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_inc_not_zero_hint(atomic_t *v, int hint)
{
 int val, c = hint;


 if (!hint)
  return atomic_add_unless((v), 1, 0);

 do {
  val = (({ __typeof__(*(&((v)->counter))) _o_ = ((c)); __typeof__(*(&((v)->counter))) _n_ = ((c + 1)); (__typeof__(*(&((v)->counter)))) __cmpxchg((&((v)->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&((v)->counter)))); }));
  if (val == c)
   return 1;
  c = val;
 } while (c);

 return 0;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_inc_unless_negative(atomic_t *p)
{
 int v, v1;
 for (v = 0; v >= 0; v = v1) {
  v1 = (({ __typeof__(*(&((p)->counter))) _o_ = ((v)); __typeof__(*(&((p)->counter))) _n_ = ((v + 1)); (__typeof__(*(&((p)->counter)))) __cmpxchg((&((p)->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&((p)->counter)))); }));
  if (__builtin_expect(!!(v1 == v), 1))
   return 1;
 }
 return 0;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_dec_unless_positive(atomic_t *p)
{
 int v, v1;
 for (v = 0; v <= 0; v = v1) {
  v1 = (({ __typeof__(*(&((p)->counter))) _o_ = ((v)); __typeof__(*(&((p)->counter))) _n_ = ((v - 1)); (__typeof__(*(&((p)->counter)))) __cmpxchg((&((p)->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&((p)->counter)))); }));
  if (__builtin_expect(!!(v1 == v), 1))
   return 1;
 }
 return 0;
}
# 97 "include/linux/atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_dec_if_positive(atomic_t *v)
{
 int c, old, dec;
 c = (*({ __attribute__((unused)) typeof((v)->counter) __var = ( typeof((v)->counter)) 0; (volatile typeof((v)->counter) *)&((v)->counter); }));
 for (;;) {
  dec = c - 1;
  if (__builtin_expect(!!(dec < 0), 0))
   break;
  old = (({ __typeof__(*(&(((v))->counter))) _o_ = ((c)); __typeof__(*(&(((v))->counter))) _n_ = ((dec)); (__typeof__(*(&(((v))->counter)))) __cmpxchg((&(((v))->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&(((v))->counter)))); }));
  if (__builtin_expect(!!(old == c), 1))
   break;
  c = old;
 }
 return dec;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_or(int i, atomic_t *v)
{
 int old;
 int new;

 do {
  old = (*({ __attribute__((unused)) typeof((v)->counter) __var = ( typeof((v)->counter)) 0; (volatile typeof((v)->counter) *)&((v)->counter); }));
  new = old | i;
 } while ((({ __typeof__(*(&((v)->counter))) _o_ = ((old)); __typeof__(*(&((v)->counter))) _n_ = ((new)); (__typeof__(*(&((v)->counter)))) __cmpxchg((&((v)->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&((v)->counter)))); })) != old);
}


# 1 "include/asm-generic/atomic-long.h" 1
# 11 "include/asm-generic/atomic-long.h"
# 1 "arch/sparc/include/generated/asm/types.h" 1
# 12 "include/asm-generic/atomic-long.h" 2
# 23 "include/asm-generic/atomic-long.h"
typedef atomic64_t atomic_long_t;



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_read(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (long)(*({ __attribute__((unused)) typeof((v)->counter) __var = ( typeof((v)->counter)) 0; (volatile typeof((v)->counter) *)&((v)->counter); }));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_set(atomic_long_t *l, long i)
{
 atomic64_t *v = (atomic64_t *)l;

 (((v)->counter) = i);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_inc(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 atomic64_add(1, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_dec(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 atomic64_sub(1, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_add(long i, atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 atomic64_add(i, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_sub(long i, atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 atomic64_sub(i, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_long_sub_and_test(long i, atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (atomic64_sub_return(i, v) == 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_long_dec_and_test(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (atomic64_sub_return(1, v) == 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_long_inc_and_test(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (atomic64_add_return(1, v) == 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_long_add_negative(long i, atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (atomic64_add_return(i, v) < 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_add_return(long i, atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (long)atomic64_add_return(i, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_sub_return(long i, atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (long)atomic64_sub_return(i, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_inc_return(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (long)atomic64_add_return(1, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_dec_return(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (long)atomic64_sub_return(1, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_add_unless(atomic_long_t *l, long a, long u)
{
 atomic64_t *v = (atomic64_t *)l;

 return (long)atomic64_add_unless(v, a, u);
}
# 128 "include/linux/atomic.h" 2
# 417 "include/linux/spinlock.h" 2
# 425 "include/linux/spinlock.h"
extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock);
# 36 "include/linux/seqlock.h" 2


# 1 "./arch/sparc/include/asm/processor.h" 1



# 1 "./arch/sparc/include/asm/processor_64.h" 1
# 59 "./arch/sparc/include/asm/processor_64.h"
typedef struct {
 unsigned char seg;
} mm_segment_t;



struct thread_struct {
# 74 "./arch/sparc/include/asm/processor_64.h"
 int dummy;

};
# 94 "./arch/sparc/include/asm/processor_64.h"
# 1 "./arch/sparc/include/asm/fpumacro.h" 1
# 13 "./arch/sparc/include/asm/fpumacro.h"
struct fpustate {
 u32 regs[64];
};



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long fprs_read(void)
{
 unsigned long retval;

 __asm__ __volatile__("rd %%fprs, %0" : "=r" (retval));

 return retval;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void fprs_write(unsigned long val)
{
 __asm__ __volatile__("wr %0, 0x0, %%fprs" : : "r" (val));
}
# 95 "./arch/sparc/include/asm/processor_64.h" 2


struct task_struct;
unsigned long thread_saved_pc(struct task_struct *);
# 197 "./arch/sparc/include/asm/processor_64.h"
unsigned long get_wchan(struct task_struct *task);
# 229 "./arch/sparc/include/asm/processor_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void prefetch(const void *x)
{






 __asm__ __volatile__("prefetch [%0], #one_write"
        :
        : "r" (x));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void prefetchw(const void *x)
{




 __asm__ __volatile__("prefetch [%0], #n_writes"
        :
        : "r" (x));
}





int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap);
# 5 "./arch/sparc/include/asm/processor.h" 2
# 39 "include/linux/seqlock.h" 2







typedef struct seqcount {
 unsigned sequence;



} seqcount_t;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __seqcount_init(seqcount_t *s, const char *name,
       struct lock_class_key *key)
{



 do { (void)(name); (void)(key); } while (0);
 s->sequence = 0;
}
# 106 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned __read_seqcount_begin(const seqcount_t *s)
{
 unsigned ret;

repeat:
 ret = (*({ __attribute__((unused)) typeof(s->sequence) __var = ( typeof(s->sequence)) 0; (volatile typeof(s->sequence) *)&(s->sequence); }));
 if (__builtin_expect(!!(ret & 1), 0)) {
  asm volatile("\n99:\n\t" "rd	%%ccr, %%g0\n\t" "rd	%%ccr, %%g0\n\t" "rd	%%ccr, %%g0\n\t" ".section	.pause_3insn_patch,\"ax\"\n\t" ".word	99b\n\t" "wr	%%g0, 128, %%asr27\n\t" "nop\n\t" "nop\n\t" ".previous" ::: "memory");
  goto repeat;
 }
 return ret;
}
# 128 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned raw_read_seqcount(const seqcount_t *s)
{
 unsigned ret = (*({ __attribute__((unused)) typeof(s->sequence) __var = ( typeof(s->sequence)) 0; (volatile typeof(s->sequence) *)&(s->sequence); }));
 __asm__ __volatile__("":::"memory");
 return ret;
}
# 144 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned raw_read_seqcount_begin(const seqcount_t *s)
{
 unsigned ret = __read_seqcount_begin(s);
 __asm__ __volatile__("":::"memory");
 return ret;
}
# 160 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned read_seqcount_begin(const seqcount_t *s)
{
 ;
 return raw_read_seqcount_begin(s);
}
# 180 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned raw_seqcount_begin(const seqcount_t *s)
{
 unsigned ret = (*({ __attribute__((unused)) typeof(s->sequence) __var = ( typeof(s->sequence)) 0; (volatile typeof(s->sequence) *)&(s->sequence); }));
 __asm__ __volatile__("":::"memory");
 return ret & ~1;
}
# 201 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __read_seqcount_retry(const seqcount_t *s, unsigned start)
{
 return __builtin_expect(!!(s->sequence != start), 0);
}
# 216 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int read_seqcount_retry(const seqcount_t *s, unsigned start)
{
 __asm__ __volatile__("":::"memory");
 return __read_seqcount_retry(s, start);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void raw_write_seqcount_begin(seqcount_t *s)
{
 s->sequence++;
 __asm__ __volatile__("":::"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void raw_write_seqcount_end(seqcount_t *s)
{
 __asm__ __volatile__("":::"memory");
 s->sequence++;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void raw_write_seqcount_latch(seqcount_t *s)
{
       __asm__ __volatile__("":::"memory");
       s->sequence++;
       __asm__ __volatile__("":::"memory");
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqcount_begin_nested(seqcount_t *s, int subclass)
{
 raw_write_seqcount_begin(s);
 do { } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqcount_begin(seqcount_t *s)
{
 write_seqcount_begin_nested(s, 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqcount_end(seqcount_t *s)
{
 do { } while (0);
 raw_write_seqcount_end(s);
}
# 275 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqcount_barrier(seqcount_t *s)
{
 __asm__ __volatile__("":::"memory");
 s->sequence+=2;
}

typedef struct {
 struct seqcount seqcount;
 spinlock_t lock;
} seqlock_t;
# 308 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned read_seqbegin(const seqlock_t *sl)
{
 return read_seqcount_begin(&sl->seqcount);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned read_seqretry(const seqlock_t *sl, unsigned start)
{
 return read_seqcount_retry(&sl->seqcount, start);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqlock(seqlock_t *sl)
{
 spin_lock(&sl->lock);
 write_seqcount_begin(&sl->seqcount);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_sequnlock(seqlock_t *sl)
{
 write_seqcount_end(&sl->seqcount);
 spin_unlock(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqlock_bh(seqlock_t *sl)
{
 spin_lock_bh(&sl->lock);
 write_seqcount_begin(&sl->seqcount);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_sequnlock_bh(seqlock_t *sl)
{
 write_seqcount_end(&sl->seqcount);
 spin_unlock_bh(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqlock_irq(seqlock_t *sl)
{
 spin_lock_irq(&sl->lock);
 write_seqcount_begin(&sl->seqcount);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_sequnlock_irq(seqlock_t *sl)
{
 write_seqcount_end(&sl->seqcount);
 spin_unlock_irq(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __write_seqlock_irqsave(seqlock_t *sl)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(&sl->lock)); } while (0); } while (0);
 write_seqcount_begin(&sl->seqcount);
 return flags;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
write_sequnlock_irqrestore(seqlock_t *sl, unsigned long flags)
{
 write_seqcount_end(&sl->seqcount);
 spin_unlock_irqrestore(&sl->lock, flags);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_seqlock_excl(seqlock_t *sl)
{
 spin_lock(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_sequnlock_excl(seqlock_t *sl)
{
 spin_unlock(&sl->lock);
}
# 403 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_seqbegin_or_lock(seqlock_t *lock, int *seq)
{
 if (!(*seq & 1))
  *seq = read_seqbegin(lock);
 else
  read_seqlock_excl(lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int need_seqretry(seqlock_t *lock, int seq)
{
 return !(seq & 1) && read_seqretry(lock, seq);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void done_seqretry(seqlock_t *lock, int seq)
{
 if (seq & 1)
  read_sequnlock_excl(lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_seqlock_excl_bh(seqlock_t *sl)
{
 spin_lock_bh(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_sequnlock_excl_bh(seqlock_t *sl)
{
 spin_unlock_bh(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_seqlock_excl_irq(seqlock_t *sl)
{
 spin_lock_irq(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_sequnlock_excl_irq(seqlock_t *sl)
{
 spin_unlock_irq(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __read_seqlock_excl_irqsave(seqlock_t *sl)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(&sl->lock)); } while (0); } while (0);
 return flags;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
read_sequnlock_excl_irqrestore(seqlock_t *sl, unsigned long flags)
{
 spin_unlock_irqrestore(&sl->lock, flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
read_seqbegin_or_lock_irqsave(seqlock_t *lock, int *seq)
{
 unsigned long flags = 0;

 if (!(*seq & 1))
  *seq = read_seqbegin(lock);
 else
  do { flags = __read_seqlock_excl_irqsave(lock); } while (0);

 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
done_seqretry_irqrestore(seqlock_t *lock, int seq, unsigned long flags)
{
 if (seq & 1)
  read_sequnlock_excl_irqrestore(lock, flags);
}
# 6 "include/linux/time.h" 2
# 1 "include/linux/math64.h" 1




# 1 "arch/sparc/include/generated/asm/div64.h" 1
# 1 "include/asm-generic/div64.h" 1
# 1 "arch/sparc/include/generated/asm/div64.h" 2
# 6 "include/linux/math64.h" 2
# 18 "include/linux/math64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
{
 *remainder = dividend % divisor;
 return dividend / divisor;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder)
{
 *remainder = dividend % divisor;
 return dividend / divisor;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder)
{
 *remainder = dividend % divisor;
 return dividend / divisor;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 div64_u64(u64 dividend, u64 divisor)
{
 return dividend / divisor;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 div64_s64(s64 dividend, s64 divisor)
{
 return dividend / divisor;
}
# 97 "include/linux/math64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 div_u64(u64 dividend, u32 divisor)
{
 u32 remainder;
 return div_u64_rem(dividend, divisor, &remainder);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 div_s64(s64 dividend, s32 divisor)
{
 s32 remainder;
 return div_s64_rem(dividend, divisor, &remainder);
}


u32 iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) u32
__iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder)
{
 u32 ret = 0;

 while (dividend >= divisor) {


  asm("" : "+rm"(dividend));

  dividend -= divisor;
  ret++;
 }

 *remainder = dividend;

 return ret;
}
# 148 "include/linux/math64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift)
{
 u32 ah, al;
 u64 ret;

 al = a;
 ah = a >> 32;

 ret = ((u64)al * mul) >> shift;
 if (ah)
  ret += ((u64)ah * mul) << (32 - shift);

 return ret;
}
# 7 "include/linux/time.h" 2
# 1 "include/linux/time64.h" 1



# 1 "include/uapi/linux/time.h" 1
# 9 "include/uapi/linux/time.h"
struct timespec {
 __kernel_time_t tv_sec;
 long tv_nsec;
};


struct timeval {
 __kernel_time_t tv_sec;
 __kernel_suseconds_t tv_usec;
};

struct timezone {
 int tz_minuteswest;
 int tz_dsttime;
};
# 34 "include/uapi/linux/time.h"
struct itimerspec {
 struct timespec it_interval;
 struct timespec it_value;
};

struct itimerval {
 struct timeval it_interval;
 struct timeval it_value;
};
# 5 "include/linux/time64.h" 2

typedef __s64 time64_t;
# 36 "include/linux/time64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec timespec64_to_timespec(const struct timespec ts64)
{
 return ts64;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec timespec_to_timespec64(const struct timespec ts)
{
 return ts;
}
# 8 "include/linux/time.h" 2

extern struct timezone sys_tz;



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timespec_equal(const struct timespec *a,
                                 const struct timespec *b)
{
 return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timespec_compare(const struct timespec *lhs, const struct timespec *rhs)
{
 if (lhs->tv_sec < rhs->tv_sec)
  return -1;
 if (lhs->tv_sec > rhs->tv_sec)
  return 1;
 return lhs->tv_nsec - rhs->tv_nsec;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timeval_compare(const struct timeval *lhs, const struct timeval *rhs)
{
 if (lhs->tv_sec < rhs->tv_sec)
  return -1;
 if (lhs->tv_sec > rhs->tv_sec)
  return 1;
 return lhs->tv_usec - rhs->tv_usec;
}

extern time64_t mktime64(const unsigned int year, const unsigned int mon,
   const unsigned int day, const unsigned int hour,
   const unsigned int min, const unsigned int sec);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long mktime(const unsigned int year,
   const unsigned int mon, const unsigned int day,
   const unsigned int hour, const unsigned int min,
   const unsigned int sec)
{
 return mktime64(year, mon, day, hour, min, sec);
}

extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec);






extern struct timespec timespec_add_safe(const struct timespec lhs,
      const struct timespec rhs);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec timespec_add(struct timespec lhs,
      struct timespec rhs)
{
 struct timespec ts_delta;
 set_normalized_timespec(&ts_delta, lhs.tv_sec + rhs.tv_sec,
    lhs.tv_nsec + rhs.tv_nsec);
 return ts_delta;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec timespec_sub(struct timespec lhs,
      struct timespec rhs)
{
 struct timespec ts_delta;
 set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec,
    lhs.tv_nsec - rhs.tv_nsec);
 return ts_delta;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool timespec_valid(const struct timespec *ts)
{

 if (ts->tv_sec < 0)
  return false;

 if ((unsigned long)ts->tv_nsec >= 1000000000L)
  return false;
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool timespec_valid_strict(const struct timespec *ts)
{
 if (!timespec_valid(ts))
  return false;

 if ((unsigned long long)ts->tv_sec >= (((s64)~((u64)1 << 63)) / 1000000000L))
  return false;
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool timeval_valid(const struct timeval *tv)
{

 if (tv->tv_sec < 0)
  return false;


 if (tv->tv_usec < 0 || tv->tv_usec >= 1000000L)
  return false;

 return true;
}

extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
# 144 "include/linux/time.h"
struct itimerval;
extern int do_setitimer(int which, struct itimerval *value,
   struct itimerval *ovalue);
extern int do_getitimer(int which, struct itimerval *value);

extern unsigned int alarm_setitimer(unsigned int seconds);

extern long do_utimes(int dfd, const char *filename, struct timespec *times, int flags);

struct tms;
extern void do_sys_times(struct tms *);





struct tm {




 int tm_sec;

 int tm_min;

 int tm_hour;

 int tm_mday;

 int tm_mon;

 long tm_year;

 int tm_wday;

 int tm_yday;
};

void time_to_tm(time_t totalsecs, int offset, struct tm *result);
# 191 "include/linux/time.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 timespec_to_ns(const struct timespec *ts)
{
 return ((s64) ts->tv_sec * 1000000000L) + ts->tv_nsec;
}
# 203 "include/linux/time.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 timeval_to_ns(const struct timeval *tv)
{
 return ((s64) tv->tv_sec * 1000000000L) +
  tv->tv_usec * 1000L;
}







extern struct timespec ns_to_timespec(const s64 nsec);







extern struct timeval ns_to_timeval(const s64 nsec);
# 233 "include/linux/time.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void timespec_add_ns(struct timespec *a, u64 ns)
{
 a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, 1000000000L, &ns);
 a->tv_nsec = ns;
}
# 57 "include/uapi/linux/timex.h" 2







struct timex {
 unsigned int modes;
 __kernel_long_t offset;
 __kernel_long_t freq;
 __kernel_long_t maxerror;
 __kernel_long_t esterror;
 int status;
 __kernel_long_t constant;
 __kernel_long_t precision;
 __kernel_long_t tolerance;


 struct timeval time;
 __kernel_long_t tick;

 __kernel_long_t ppsfreq;
 __kernel_long_t jitter;
 int shift;
 __kernel_long_t stabil;
 __kernel_long_t jitcnt;
 __kernel_long_t calcnt;
 __kernel_long_t errcnt;
 __kernel_long_t stbcnt;

 int tai;

 int :32; int :32; int :32; int :32;
 int :32; int :32; int :32; int :32;
 int :32; int :32; int :32;
};
# 57 "include/linux/timex.h" 2






# 1 "./include/uapi/linux/param.h" 1
# 64 "include/linux/timex.h" 2

# 1 "./arch/sparc/include/asm/timex.h" 1



# 1 "./arch/sparc/include/asm/timex_64.h" 1
# 9 "./arch/sparc/include/asm/timex_64.h"
# 1 "./arch/sparc/include/asm/timer.h" 1



# 1 "./arch/sparc/include/asm/timer_64.h" 1
# 12 "./arch/sparc/include/asm/timer_64.h"
struct sparc64_tick_ops {
 unsigned long long (*get_tick)(void);
 int (*add_compare)(unsigned long);
 unsigned long softint_mask;
 void (*disable_irq)(void);

 void (*init_tick)(void);
 unsigned long (*add_tick)(unsigned long);

 char *name;
};

extern struct sparc64_tick_ops *tick_ops;

unsigned long sparc64_get_clock_tick(unsigned int cpu);
void setup_sparc64_timer(void);
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) time_init(void);
# 5 "./arch/sparc/include/asm/timer.h" 2
# 10 "./arch/sparc/include/asm/timex_64.h" 2




typedef unsigned long cycles_t;
# 5 "./arch/sparc/include/asm/timex.h" 2
# 66 "include/linux/timex.h" 2
# 139 "include/linux/timex.h"
extern unsigned long tick_usec;
extern unsigned long tick_nsec;
# 154 "include/linux/timex.h"
extern int do_adjtimex(struct timex *);
extern void hardpps(const struct timespec *, const struct timespec *);

int read_current_timer(unsigned long *timer_val);
void ntp_notify_cmos_timer(void);
# 20 "include/linux/sched.h" 2
# 1 "include/linux/jiffies.h" 1
# 57 "include/linux/jiffies.h"
extern int register_refined_jiffies(long clock_tick_rate);
# 76 "include/linux/jiffies.h"
extern u64 __attribute__((section(".data"))) jiffies_64;
extern unsigned long volatile __attribute__((section(".data"))) jiffies;




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 get_jiffies_64(void)
{
 return (u64)jiffies;
}
# 182 "include/linux/jiffies.h"
extern unsigned long preset_lpj;
# 283 "include/linux/jiffies.h"
extern unsigned int jiffies_to_msecs(const unsigned long j);
extern unsigned int jiffies_to_usecs(const unsigned long j);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 jiffies_to_nsecs(const unsigned long j)
{
 return (u64)jiffies_to_usecs(j) * 1000L;
}

extern unsigned long msecs_to_jiffies(const unsigned int m);
extern unsigned long usecs_to_jiffies(const unsigned int u);
extern unsigned long timespec_to_jiffies(const struct timespec *value);
extern void jiffies_to_timespec(const unsigned long jiffies,
    struct timespec *value);
extern unsigned long timeval_to_jiffies(const struct timeval *value);
extern void jiffies_to_timeval(const unsigned long jiffies,
          struct timeval *value);

extern clock_t jiffies_to_clock_t(unsigned long x);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) clock_t jiffies_delta_to_clock_t(long delta)
{
 return jiffies_to_clock_t(({ typeof(0L) _max1 = (0L); typeof(delta) _max2 = (delta); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; }));
}

extern unsigned long clock_t_to_jiffies(unsigned long x);
extern u64 jiffies_64_to_clock_t(u64 x);
extern u64 nsec_to_clock_t(u64 x);
extern u64 nsecs_to_jiffies64(u64 n);
extern unsigned long nsecs_to_jiffies(u64 n);
# 21 "include/linux/sched.h" 2
# 1 "include/linux/plist.h" 1
# 81 "include/linux/plist.h"
struct plist_head {
 struct list_head node_list;
};

struct plist_node {
 int prio;
 struct list_head prio_list;
 struct list_head node_list;
};
# 123 "include/linux/plist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
plist_head_init(struct plist_head *head)
{
 INIT_LIST_HEAD(&head->node_list);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void plist_node_init(struct plist_node *node, int prio)
{
 node->prio = prio;
 INIT_LIST_HEAD(&node->prio_list);
 INIT_LIST_HEAD(&node->node_list);
}

extern void plist_add(struct plist_node *node, struct plist_head *head);
extern void plist_del(struct plist_node *node, struct plist_head *head);

extern void plist_requeue(struct plist_node *node, struct plist_head *head);
# 212 "include/linux/plist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int plist_head_empty(const struct plist_head *head)
{
 return list_empty(&head->node_list);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int plist_node_empty(const struct plist_node *node)
{
 return list_empty(&node->node_list);
}
# 282 "include/linux/plist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct plist_node *plist_first(const struct plist_head *head)
{
 return ({ const typeof( ((struct plist_node *)0)->node_list ) *__mptr = (head->node_list.next); (struct plist_node *)( (char *)__mptr - __builtin_offsetof(struct plist_node,node_list) );})
                                  ;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct plist_node *plist_last(const struct plist_head *head)
{
 return ({ const typeof( ((struct plist_node *)0)->node_list ) *__mptr = (head->node_list.prev); (struct plist_node *)( (char *)__mptr - __builtin_offsetof(struct plist_node,node_list) );})
                                  ;
}
# 22 "include/linux/sched.h" 2
# 1 "include/linux/rbtree.h" 1
# 35 "include/linux/rbtree.h"
struct rb_node {
 unsigned long __rb_parent_color;
 struct rb_node *rb_right;
 struct rb_node *rb_left;
} __attribute__((aligned(sizeof(long))));


struct rb_root {
 struct rb_node *rb_node;
};
# 61 "include/linux/rbtree.h"
extern void rb_insert_color(struct rb_node *, struct rb_root *);
extern void rb_erase(struct rb_node *, struct rb_root *);



extern struct rb_node *rb_next(const struct rb_node *);
extern struct rb_node *rb_prev(const struct rb_node *);
extern struct rb_node *rb_first(const struct rb_root *);
extern struct rb_node *rb_last(const struct rb_root *);


extern struct rb_node *rb_first_postorder(const struct rb_root *);
extern struct rb_node *rb_next_postorder(const struct rb_node *);


extern void rb_replace_node(struct rb_node *victim, struct rb_node *new,
       struct rb_root *root);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rb_link_node(struct rb_node * node, struct rb_node * parent,
    struct rb_node ** rb_link)
{
 node->__rb_parent_color = (unsigned long)parent;
 node->rb_left = node->rb_right = ((void *)0);

 *rb_link = node;
}
# 23 "include/linux/sched.h" 2

# 1 "include/linux/cpumask.h" 1
# 11 "include/linux/cpumask.h"
# 1 "include/linux/bitmap.h" 1
# 90 "include/linux/bitmap.h"
extern int __bitmap_empty(const unsigned long *bitmap, unsigned int nbits);
extern int __bitmap_full(const unsigned long *bitmap, unsigned int nbits);
extern int __bitmap_equal(const unsigned long *bitmap1,
     const unsigned long *bitmap2, unsigned int nbits);
extern void __bitmap_complement(unsigned long *dst, const unsigned long *src,
   unsigned int nbits);
extern void __bitmap_shift_right(unsigned long *dst, const unsigned long *src,
    unsigned int shift, unsigned int nbits);
extern void __bitmap_shift_left(unsigned long *dst, const unsigned long *src,
    unsigned int shift, unsigned int nbits);
extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
   const unsigned long *bitmap2, unsigned int nbits);
extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
   const unsigned long *bitmap2, unsigned int nbits);
extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1,
   const unsigned long *bitmap2, unsigned int nbits);
extern int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,
   const unsigned long *bitmap2, unsigned int nbits);
extern int __bitmap_intersects(const unsigned long *bitmap1,
   const unsigned long *bitmap2, unsigned int nbits);
extern int __bitmap_subset(const unsigned long *bitmap1,
   const unsigned long *bitmap2, unsigned int nbits);
extern int __bitmap_weight(const unsigned long *bitmap, unsigned int nbits);

extern void bitmap_set(unsigned long *map, unsigned int start, int len);
extern void bitmap_clear(unsigned long *map, unsigned int start, int len);

extern unsigned long bitmap_find_next_zero_area_off(unsigned long *map,
          unsigned long size,
          unsigned long start,
          unsigned int nr,
          unsigned long align_mask,
          unsigned long align_offset);
# 136 "include/linux/bitmap.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
bitmap_find_next_zero_area(unsigned long *map,
      unsigned long size,
      unsigned long start,
      unsigned int nr,
      unsigned long align_mask)
{
 return bitmap_find_next_zero_area_off(map, size, start, nr,
           align_mask, 0);
}

extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user,
   unsigned long *dst, int nbits);
extern int bitmap_parse_user(const char *ubuf, unsigned int ulen,
   unsigned long *dst, int nbits);
extern int bitmap_parselist(const char *buf, unsigned long *maskp,
   int nmaskbits);
extern int bitmap_parselist_user(const char *ubuf, unsigned int ulen,
   unsigned long *dst, int nbits);
extern void bitmap_remap(unsigned long *dst, const unsigned long *src,
  const unsigned long *old, const unsigned long *new, unsigned int nbits);
extern int bitmap_bitremap(int oldbit,
  const unsigned long *old, const unsigned long *new, int bits);
extern void bitmap_onto(unsigned long *dst, const unsigned long *orig,
  const unsigned long *relmap, unsigned int bits);
extern void bitmap_fold(unsigned long *dst, const unsigned long *orig,
  unsigned int sz, unsigned int nbits);
extern int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order);
extern void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order);
extern int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order);

extern void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits);



extern unsigned int bitmap_ord_to_pos(const unsigned long *bitmap, unsigned int ord, unsigned int nbits);
extern int bitmap_print_to_pagebuf(bool list, char *buf,
       const unsigned long *maskp, int nmaskbits);
# 185 "include/linux/bitmap.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_zero(unsigned long *dst, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = 0UL;
 else {
  unsigned int len = (((nbits) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))) * sizeof(unsigned long);
  __builtin_memset(dst, 0, len);
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_fill(unsigned long *dst, unsigned int nbits)
{
 unsigned int nlongs = (((nbits) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)));
 if (!(__builtin_constant_p(nbits) && (nbits) <= 64)) {
  unsigned int len = (nlongs - 1) * sizeof(unsigned long);
  __builtin_memset(dst, 0xff, len);
 }
 dst[nlongs - 1] = ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_copy(unsigned long *dst, const unsigned long *src,
   unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = *src;
 else {
  unsigned int len = (((nbits) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))) * sizeof(unsigned long);
  __builtin_memcpy(dst, src, len);
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_and(unsigned long *dst, const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return (*dst = *src1 & *src2 & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL )) != 0;
 return __bitmap_and(dst, src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_or(unsigned long *dst, const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = *src1 | *src2;
 else
  __bitmap_or(dst, src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_xor(unsigned long *dst, const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = *src1 ^ *src2;
 else
  __bitmap_xor(dst, src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_andnot(unsigned long *dst, const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return (*dst = *src1 & ~(*src2) & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL )) != 0;
 return __bitmap_andnot(dst, src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_complement(unsigned long *dst, const unsigned long *src,
   unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = ~(*src);
 else
  __bitmap_complement(dst, src, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_equal(const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return ! ((*src1 ^ *src2) & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL ));
 else
  return __bitmap_equal(src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_intersects(const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return ((*src1 & *src2) & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL )) != 0;
 else
  return __bitmap_intersects(src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_subset(const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return ! ((*src1 & ~(*src2)) & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL ));
 else
  return __bitmap_subset(src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_empty(const unsigned long *src, unsigned nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return ! (*src & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL ));
 else
  return __bitmap_empty(src, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_full(const unsigned long *src, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return ! (~(*src) & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL ));
 else
  return __bitmap_full(src, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_weight(const unsigned long *src, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return hweight_long(*src & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL ));
 return __bitmap_weight(src, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_shift_right(unsigned long *dst, const unsigned long *src,
    unsigned int shift, int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = (*src & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL )) >> shift;
 else
  __bitmap_shift_right(dst, src, shift, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_shift_left(unsigned long *dst, const unsigned long *src,
    unsigned int shift, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = (*src << shift) & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL );
 else
  __bitmap_shift_left(dst, src, shift, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_parse(const char *buf, unsigned int buflen,
   unsigned long *maskp, int nmaskbits)
{
 return __bitmap_parse(buf, buflen, 0, maskp, nmaskbits);
}
# 12 "include/linux/cpumask.h" 2


typedef struct cpumask { unsigned long bits[(((128) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))]; } cpumask_t;
# 36 "include/linux/cpumask.h"
extern int nr_cpu_ids;
# 87 "include/linux/cpumask.h"
extern const struct cpumask *const cpu_possible_mask;
extern const struct cpumask *const cpu_online_mask;
extern const struct cpumask *const cpu_present_mask;
extern const struct cpumask *const cpu_active_mask;
# 113 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_check(unsigned int cpu)
{



 return cpu;
}
# 173 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_first(const struct cpumask *srcp)
{
 return find_next_bit((((srcp)->bits)), (128), 0);
}
# 185 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_next(int n, const struct cpumask *srcp)
{

 if (n != -1)
  cpumask_check(n);
 return find_next_bit(((srcp)->bits), 128, n+1);
}
# 200 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_next_zero(int n, const struct cpumask *srcp)
{

 if (n != -1)
  cpumask_check(n);
 return find_next_zero_bit(((srcp)->bits), 128, n+1);
}

int cpumask_next_and(int n, const struct cpumask *, const struct cpumask *);
int cpumask_any_but(const struct cpumask *mask, unsigned int cpu);
int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp);
# 271 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
{
 set_bit(cpumask_check(cpu), ((dstp)->bits));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
{
 clear_bit(cpumask_check(cpu), ((dstp)->bits));
}
# 307 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
{
 return test_and_set_bit(cpumask_check(cpu), ((cpumask)->bits));
}
# 321 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask)
{
 return test_and_clear_bit(cpumask_check(cpu), ((cpumask)->bits));
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_setall(struct cpumask *dstp)
{
 bitmap_fill(((dstp)->bits), 128);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_clear(struct cpumask *dstp)
{
 bitmap_zero(((dstp)->bits), 128);
}
# 352 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_and(struct cpumask *dstp,
          const struct cpumask *src1p,
          const struct cpumask *src2p)
{
 return bitmap_and(((dstp)->bits), ((src1p)->bits),
           ((src2p)->bits), 128);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_or(struct cpumask *dstp, const struct cpumask *src1p,
         const struct cpumask *src2p)
{
 bitmap_or(((dstp)->bits), ((src1p)->bits),
          ((src2p)->bits), 128);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_xor(struct cpumask *dstp,
          const struct cpumask *src1p,
          const struct cpumask *src2p)
{
 bitmap_xor(((dstp)->bits), ((src1p)->bits),
           ((src2p)->bits), 128);
}
# 395 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_andnot(struct cpumask *dstp,
      const struct cpumask *src1p,
      const struct cpumask *src2p)
{
 return bitmap_andnot(((dstp)->bits), ((src1p)->bits),
       ((src2p)->bits), 128);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_complement(struct cpumask *dstp,
          const struct cpumask *srcp)
{
 bitmap_complement(((dstp)->bits), ((srcp)->bits),
           128);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpumask_equal(const struct cpumask *src1p,
    const struct cpumask *src2p)
{
 return bitmap_equal(((src1p)->bits), ((src2p)->bits),
       128);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpumask_intersects(const struct cpumask *src1p,
         const struct cpumask *src2p)
{
 return bitmap_intersects(((src1p)->bits), ((src2p)->bits),
            128);
}
# 446 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_subset(const struct cpumask *src1p,
     const struct cpumask *src2p)
{
 return bitmap_subset(((src1p)->bits), ((src2p)->bits),
        128);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpumask_empty(const struct cpumask *srcp)
{
 return bitmap_empty(((srcp)->bits), 128);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpumask_full(const struct cpumask *srcp)
{
 return bitmap_full(((srcp)->bits), 128);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_weight(const struct cpumask *srcp)
{
 return bitmap_weight(((srcp)->bits), 128);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_shift_right(struct cpumask *dstp,
           const struct cpumask *srcp, int n)
{
 bitmap_shift_right(((dstp)->bits), ((srcp)->bits), n,
            128);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_shift_left(struct cpumask *dstp,
          const struct cpumask *srcp, int n)
{
 bitmap_shift_left(((dstp)->bits), ((srcp)->bits), n,
           128);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_copy(struct cpumask *dstp,
    const struct cpumask *srcp)
{
 bitmap_copy(((dstp)->bits), ((srcp)->bits), 128);
}
# 557 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_parse_user(const char *buf, int len,
         struct cpumask *dstp)
{
 return bitmap_parse_user(buf, len, ((dstp)->bits), nr_cpu_ids);
}
# 571 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_parselist_user(const char *buf, int len,
         struct cpumask *dstp)
{
 return bitmap_parselist_user(buf, len, ((dstp)->bits),
         nr_cpu_ids);
}
# 585 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_parse(const char *buf, struct cpumask *dstp)
{
 char *nl = strchr(buf, '\n');
 unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf);

 return bitmap_parse(buf, len, ((dstp)->bits), nr_cpu_ids);
}
# 600 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpulist_parse(const char *buf, struct cpumask *dstp)
{
 return bitmap_parselist(buf, ((dstp)->bits), nr_cpu_ids);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) size_t cpumask_size(void)
{


 return (((128) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))) * sizeof(long);
}
# 668 "include/linux/cpumask.h"
typedef struct cpumask cpumask_var_t[1];



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
{
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags,
       int node)
{
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
{
 cpumask_clear(*mask);
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zalloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags,
       int node)
{
 cpumask_clear(*mask);
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void alloc_bootmem_cpumask_var(cpumask_var_t *mask)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void free_cpumask_var(cpumask_var_t mask)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void free_bootmem_cpumask_var(cpumask_var_t mask)
{
}




extern const unsigned long cpu_all_bits[(((128) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))];
# 722 "include/linux/cpumask.h"
void set_cpu_possible(unsigned int cpu, bool possible);
void set_cpu_present(unsigned int cpu, bool present);
void set_cpu_online(unsigned int cpu, bool online);
void set_cpu_active(unsigned int cpu, bool active);
void init_cpu_present(const struct cpumask *src);
void init_cpu_possible(const struct cpumask *src);
void init_cpu_online(const struct cpumask *src);
# 744 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __check_is_bitmap(const unsigned long *bitmap)
{
 return 1;
}
# 756 "include/linux/cpumask.h"
extern const unsigned long
 cpu_bit_bitmap[64 +1][(((128) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))];

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cpumask *get_cpu_mask(unsigned int cpu)
{
 const unsigned long *p = cpu_bit_bitmap[1 + cpu % 64];
 p -= cpu / 64;
 return ((struct cpumask *)(1 ? (p) : (void *)sizeof(__check_is_bitmap(p))));
}
# 793 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ssize_t
cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask)
{
 return bitmap_print_to_pagebuf(list, buf, ((mask)->bits),
          nr_cpu_ids);
}
# 844 "include/linux/cpumask.h"
int __first_cpu(const cpumask_t *srcp);
int __next_cpu(int n, const cpumask_t *srcp);
# 862 "include/linux/cpumask.h"
int __next_cpu_nr(int n, const cpumask_t *srcp);
# 873 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpu_set(int cpu, volatile cpumask_t *dstp)
{
 set_bit(cpu, dstp->bits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpu_clear(int cpu, volatile cpumask_t *dstp)
{
 clear_bit(cpu, dstp->bits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpus_setall(cpumask_t *dstp, unsigned int nbits)
{
 bitmap_fill(dstp->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpus_clear(cpumask_t *dstp, unsigned int nbits)
{
 bitmap_zero(dstp->bits, nbits);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpu_test_and_set(int cpu, cpumask_t *addr)
{
 return test_and_set_bit(cpu, addr->bits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_equal(const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 return bitmap_equal(src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_intersects(const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 return bitmap_intersects(src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_subset(const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 return bitmap_subset(src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_empty(const cpumask_t *srcp, unsigned int nbits)
{
 return bitmap_empty(srcp->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_weight(const cpumask_t *srcp, unsigned int nbits)
{
 return bitmap_weight(srcp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpus_shift_left(cpumask_t *dstp,
     const cpumask_t *srcp, int n, int nbits)
{
 bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
}
# 25 "include/linux/sched.h" 2

# 1 "include/linux/nodemask.h" 1
# 93 "include/linux/nodemask.h"
# 1 "include/linux/numa.h" 1
# 94 "include/linux/nodemask.h" 2

typedef struct { unsigned long bits[((((1 << 4)) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))]; } nodemask_t;
extern nodemask_t _unused_nodemask_arg_;
# 116 "include/linux/nodemask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __node_set(int node, volatile nodemask_t *dstp)
{
 set_bit(node, dstp->bits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __node_clear(int node, volatile nodemask_t *dstp)
{
 clear_bit(node, dstp->bits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_setall(nodemask_t *dstp, unsigned int nbits)
{
 bitmap_fill(dstp->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_clear(nodemask_t *dstp, unsigned int nbits)
{
 bitmap_zero(dstp->bits, nbits);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __node_test_and_set(int node, nodemask_t *addr)
{
 return test_and_set_bit(node, addr->bits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_and(nodemask_t *dstp, const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_or(nodemask_t *dstp, const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_xor(nodemask_t *dstp, const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_andnot(nodemask_t *dstp, const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_complement(nodemask_t *dstp,
     const nodemask_t *srcp, unsigned int nbits)
{
 bitmap_complement(dstp->bits, srcp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_equal(const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 return bitmap_equal(src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_intersects(const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 return bitmap_intersects(src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_subset(const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 return bitmap_subset(src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_empty(const nodemask_t *srcp, unsigned int nbits)
{
 return bitmap_empty(srcp->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_full(const nodemask_t *srcp, unsigned int nbits)
{
 return bitmap_full(srcp->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_weight(const nodemask_t *srcp, unsigned int nbits)
{
 return bitmap_weight(srcp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_shift_right(nodemask_t *dstp,
     const nodemask_t *srcp, int n, int nbits)
{
 bitmap_shift_right(dstp->bits, srcp->bits, n, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_shift_left(nodemask_t *dstp,
     const nodemask_t *srcp, int n, int nbits)
{
 bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __first_node(const nodemask_t *srcp)
{
 return ({ int __min1 = ((1 << 4)); int __min2 = (find_next_bit((srcp->bits), ((1 << 4)), 0)); __min1 < __min2 ? __min1: __min2; });
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __next_node(int n, const nodemask_t *srcp)
{
 return ({ int __min1 = ((1 << 4)); int __min2 = (find_next_bit(srcp->bits, (1 << 4), n+1)); __min1 < __min2 ? __min1: __min2; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_nodemask_of_node(nodemask_t *mask, int node)
{
 __nodes_clear(&(*mask), (1 << 4));
 __node_set((node), &(*mask));
}
# 280 "include/linux/nodemask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __first_unset_node(const nodemask_t *maskp)
{
 return ({ int __min1 = ((1 << 4)); int __min2 = (find_next_zero_bit((maskp->bits), ((1 << 4)), 0)); __min1 < __min2 ? __min1: __min2; })
                                                  ;
}
# 314 "include/linux/nodemask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodemask_parse_user(const char *buf, int len,
     nodemask_t *dstp, int nbits)
{
 return bitmap_parse_user(buf, len, dstp->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodelist_parse(const char *buf, nodemask_t *dstp, int nbits)
{
 return bitmap_parselist(buf, dstp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __node_remap(int oldbit,
  const nodemask_t *oldp, const nodemask_t *newp, int nbits)
{
 return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_remap(nodemask_t *dstp, const nodemask_t *srcp,
  const nodemask_t *oldp, const nodemask_t *newp, int nbits)
{
 bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_onto(nodemask_t *dstp, const nodemask_t *origp,
  const nodemask_t *relmapp, int nbits)
{
 bitmap_onto(dstp->bits, origp->bits, relmapp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_fold(nodemask_t *dstp, const nodemask_t *origp,
  int sz, int nbits)
{
 bitmap_fold(dstp->bits, origp->bits, sz, nbits);
}
# 372 "include/linux/nodemask.h"
enum node_states {
 N_POSSIBLE,
 N_ONLINE,
 N_NORMAL_MEMORY,



 N_HIGH_MEMORY = N_NORMAL_MEMORY,




 N_MEMORY = N_HIGH_MEMORY,

 N_CPU,
 NR_NODE_STATES
};






extern nodemask_t node_states[NR_NODE_STATES];


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int node_state(int node, enum node_states state)
{
 return test_bit((node), (node_states[state]).bits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void node_set_state(int node, enum node_states state)
{
 __node_set(node, &node_states[state]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void node_clear_state(int node, enum node_states state)
{
 __node_clear(node, &node_states[state]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int num_node_state(enum node_states state)
{
 return __nodes_weight(&(node_states[state]), (1 << 4));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int next_online_node(int nid)
{
 return __next_node((nid), &(node_states[N_ONLINE]));
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int next_memory_node(int nid)
{
 return __next_node((nid), &(node_states[N_MEMORY]));
}

extern int nr_node_ids;
extern int nr_online_nodes;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void node_set_online(int nid)
{
 node_set_state(nid, N_ONLINE);
 nr_online_nodes = num_node_state(N_ONLINE);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void node_set_offline(int nid)
{
 node_clear_state(nid, N_ONLINE);
 nr_online_nodes = num_node_state(N_ONLINE);
}
# 482 "include/linux/nodemask.h"
extern int node_random(const nodemask_t *maskp);
# 516 "include/linux/nodemask.h"
struct nodemask_scratch {
 nodemask_t mask1;
 nodemask_t mask2;
};
# 27 "include/linux/sched.h" 2
# 1 "include/linux/mm_types.h" 1



# 1 "include/linux/auxvec.h" 1



# 1 "include/uapi/linux/auxvec.h" 1



# 1 "./arch/sparc/include/uapi/asm/auxvec.h" 1
# 5 "include/uapi/linux/auxvec.h" 2
# 5 "include/linux/auxvec.h" 2
# 5 "include/linux/mm_types.h" 2





# 1 "include/linux/rwsem.h" 1
# 18 "include/linux/rwsem.h"
# 1 "include/linux/osq_lock.h" 1







struct optimistic_spin_node {
 struct optimistic_spin_node *next, *prev;
 int locked;
 int cpu;
};

struct optimistic_spin_queue {




 atomic_t tail;
};






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void osq_lock_init(struct optimistic_spin_queue *lock)
{
 (((&lock->tail)->counter) = (0));
}

extern bool osq_lock(struct optimistic_spin_queue *lock);
extern void osq_unlock(struct optimistic_spin_queue *lock);
# 19 "include/linux/rwsem.h" 2


struct rw_semaphore;





struct rw_semaphore {
 long count;
 struct list_head wait_list;
 raw_spinlock_t wait_lock;

 struct optimistic_spin_queue osq;




 struct task_struct *owner;




};

extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem);
extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *);
extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);


# 1 "./arch/sparc/include/asm/rwsem.h" 1
# 26 "./arch/sparc/include/asm/rwsem.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __down_read(struct rw_semaphore *sem)
{
 if (__builtin_expect(!!(atomic64_add_return(1, (atomic64_t *)(&sem->count)) <= 0L), 0))
  rwsem_down_read_failed(sem);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __down_read_trylock(struct rw_semaphore *sem)
{
 long tmp;

 while ((tmp = sem->count) >= 0L) {
  if (tmp == ({ __typeof__(*(&sem->count)) _o_ = (tmp); __typeof__(*(&sem->count)) _n_ = (tmp + 0x00000001L); (__typeof__(*(&sem->count))) __cmpxchg((&sem->count), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&sem->count))); })
                                    ) {
   return 1;
  }
 }
 return 0;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __down_write_nested(struct rw_semaphore *sem, int subclass)
{
 long tmp;

 tmp = atomic64_add_return(((-0xffffffffL -1) + 0x00000001L),
      (atomic64_t *)(&sem->count));
 if (__builtin_expect(!!(tmp != ((-0xffffffffL -1) + 0x00000001L)), 0))
  rwsem_down_write_failed(sem);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __down_write(struct rw_semaphore *sem)
{
 __down_write_nested(sem, 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __down_write_trylock(struct rw_semaphore *sem)
{
 long tmp;

 tmp = ({ __typeof__(*(&sem->count)) _o_ = (0x00000000L); __typeof__(*(&sem->count)) _n_ = (((-0xffffffffL -1) + 0x00000001L)); (__typeof__(*(&sem->count))) __cmpxchg((&sem->count), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&sem->count))); })
                                ;
 return tmp == 0x00000000L;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __up_read(struct rw_semaphore *sem)
{
 long tmp;

 tmp = atomic64_sub_return(1, (atomic64_t *)(&sem->count));
 if (__builtin_expect(!!(tmp < -1L && (tmp & 0xffffffffL) == 0L), 0))
  rwsem_wake(sem);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __up_write(struct rw_semaphore *sem)
{
 if (__builtin_expect(!!(atomic64_sub_return(((-0xffffffffL -1) + 0x00000001L), (atomic64_t *)(&sem->count)) < 0L), 0)
                                        )
  rwsem_wake(sem);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
{
 atomic64_add(delta, (atomic64_t *)(&sem->count));
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __downgrade_write(struct rw_semaphore *sem)
{
 long tmp;

 tmp = atomic64_add_return(-(-0xffffffffL -1), (atomic64_t *)(&sem->count));
 if (tmp < 0L)
  rwsem_downgrade_wake(sem);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
{
 return atomic64_add_return(delta, (atomic64_t *)(&sem->count));
}
# 51 "include/linux/rwsem.h" 2


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rwsem_is_locked(struct rw_semaphore *sem)
{
 return sem->count != 0;
}
# 84 "include/linux/rwsem.h"
extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
    struct lock_class_key *key);
# 100 "include/linux/rwsem.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rwsem_is_contended(struct rw_semaphore *sem)
{
 return !list_empty(&sem->wait_list);
}




extern void down_read(struct rw_semaphore *sem);




extern int down_read_trylock(struct rw_semaphore *sem);




extern void down_write(struct rw_semaphore *sem);




extern int down_write_trylock(struct rw_semaphore *sem);




extern void up_read(struct rw_semaphore *sem);




extern void up_write(struct rw_semaphore *sem);




extern void downgrade_write(struct rw_semaphore *sem);
# 11 "include/linux/mm_types.h" 2
# 1 "include/linux/completion.h" 1
# 11 "include/linux/completion.h"
# 1 "include/linux/wait.h" 1
# 9 "include/linux/wait.h"
# 1 "./arch/sparc/include/asm/current.h" 1
# 17 "./arch/sparc/include/asm/current.h"
register struct task_struct *current asm("g4");
# 10 "include/linux/wait.h" 2
# 1 "include/uapi/linux/wait.h" 1
# 11 "include/linux/wait.h" 2

typedef struct __wait_queue wait_queue_t;
typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key);
int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key);





struct __wait_queue {
 unsigned int flags;
 void *private;
 wait_queue_func_t func;
 struct list_head task_list;
};

struct wait_bit_key {
 void *flags;
 int bit_nr;

 unsigned long timeout;
};

struct wait_bit_queue {
 struct wait_bit_key key;
 wait_queue_t wait;
};

struct __wait_queue_head {
 spinlock_t lock;
 struct list_head task_list;
};
typedef struct __wait_queue_head wait_queue_head_t;

struct task_struct;
# 72 "include/linux/wait.h"
extern void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *);
# 90 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p)
{
 q->flags = 0;
 q->private = p;
 q->func = default_wake_function;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
init_waitqueue_func_entry(wait_queue_t *q, wait_queue_func_t func)
{
 q->flags = 0;
 q->private = ((void *)0);
 q->func = func;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int waitqueue_active(wait_queue_head_t *q)
{
 return !list_empty(&q->task_list);
}

extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait);
extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait);
extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
{
 list_add(&new->task_list, &head->task_list);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
__add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait)
{
 wait->flags |= 0x01;
 __add_wait_queue(q, wait);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __add_wait_queue_tail(wait_queue_head_t *head,
      wait_queue_t *new)
{
 list_add_tail(&new->task_list, &head->task_list);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
__add_wait_queue_tail_exclusive(wait_queue_head_t *q, wait_queue_t *wait)
{
 wait->flags |= 0x01;
 __add_wait_queue_tail(q, wait);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
__remove_wait_queue(wait_queue_head_t *head, wait_queue_t *old)
{
 list_del(&old->task_list);
}

typedef int wait_bit_action_f(struct wait_bit_key *);
void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key);
void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
void __wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr);
void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr);
void __wake_up_bit(wait_queue_head_t *, void *, int);
int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, wait_bit_action_f *, unsigned);
int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, wait_bit_action_f *, unsigned);
void wake_up_bit(void *, int);
void wake_up_atomic_t(atomic_t *);
int out_of_line_wait_on_bit(void *, int, wait_bit_action_f *, unsigned);
int out_of_line_wait_on_bit_timeout(void *, int, wait_bit_action_f *, unsigned, unsigned long);
int out_of_line_wait_on_bit_lock(void *, int, wait_bit_action_f *, unsigned);
int out_of_line_wait_on_atomic_t(atomic_t *, int (*)(atomic_t *), unsigned);
wait_queue_head_t *bit_waitqueue(void *, int);
# 911 "include/linux/wait.h"
void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state);
void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state);
long prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state);
void finish_wait(wait_queue_head_t *q, wait_queue_t *wait);
void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, unsigned int mode, void *key);
long wait_woken(wait_queue_t *wait, unsigned mode, long timeout);
int woken_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
# 950 "include/linux/wait.h"
extern int bit_wait(struct wait_bit_key *);
extern int bit_wait_io(struct wait_bit_key *);
extern int bit_wait_timeout(struct wait_bit_key *);
extern int bit_wait_io_timeout(struct wait_bit_key *);
# 971 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit(void *word, int bit, unsigned mode)
{
 do { _cond_resched(); } while (0);
 if (!test_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit(word, bit,
           bit_wait,
           mode);
}
# 996 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit_io(void *word, int bit, unsigned mode)
{
 do { _cond_resched(); } while (0);
 if (!test_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit(word, bit,
           bit_wait_io,
           mode);
}
# 1022 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit_timeout(void *word, int bit, unsigned mode, unsigned long timeout)
{
 do { _cond_resched(); } while (0);
 if (!test_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit_timeout(word, bit,
            bit_wait_timeout,
            mode, timeout);
}
# 1049 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit_action(void *word, int bit, wait_bit_action_f *action, unsigned mode)
{
 do { _cond_resched(); } while (0);
 if (!test_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit(word, bit, action, mode);
}
# 1077 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit_lock(void *word, int bit, unsigned mode)
{
 do { _cond_resched(); } while (0);
 if (!test_and_set_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit_lock(word, bit, bit_wait, mode);
}
# 1101 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit_lock_io(void *word, int bit, unsigned mode)
{
 do { _cond_resched(); } while (0);
 if (!test_and_set_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit_lock(word, bit, bit_wait_io, mode);
}
# 1127 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit_lock_action(void *word, int bit, wait_bit_action_f *action, unsigned mode)
{
 do { _cond_resched(); } while (0);
 if (!test_and_set_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit_lock(word, bit, action, mode);
}
# 1146 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode)
{
 do { _cond_resched(); } while (0);
 if ((*({ __attribute__((unused)) typeof((val)->counter) __var = ( typeof((val)->counter)) 0; (volatile typeof((val)->counter) *)&((val)->counter); })) == 0)
  return 0;
 return out_of_line_wait_on_atomic_t(val, action, mode);
}
# 12 "include/linux/completion.h" 2
# 25 "include/linux/completion.h"
struct completion {
 unsigned int done;
 wait_queue_head_t wait;
};
# 73 "include/linux/completion.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_completion(struct completion *x)
{
 x->done = 0;
 do { static struct lock_class_key __key; __init_waitqueue_head((&x->wait), "&x->wait", &__key); } while (0);
}
# 86 "include/linux/completion.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void reinit_completion(struct completion *x)
{
 x->done = 0;
}

extern void wait_for_completion(struct completion *);
extern void wait_for_completion_io(struct completion *);
extern int wait_for_completion_interruptible(struct completion *x);
extern int wait_for_completion_killable(struct completion *x);
extern unsigned long wait_for_completion_timeout(struct completion *x,
         unsigned long timeout);
extern unsigned long wait_for_completion_io_timeout(struct completion *x,
          unsigned long timeout);
extern long wait_for_completion_interruptible_timeout(
 struct completion *x, unsigned long timeout);
extern long wait_for_completion_killable_timeout(
 struct completion *x, unsigned long timeout);
extern bool try_wait_for_completion(struct completion *x);
extern bool completion_done(struct completion *x);

extern void complete(struct completion *);
extern void complete_all(struct completion *);
# 12 "include/linux/mm_types.h" 2

# 1 "include/linux/uprobes.h" 1
# 31 "include/linux/uprobes.h"
struct vm_area_struct;
struct mm_struct;
struct inode;
struct notifier_block;
struct page;






enum uprobe_filter_ctx {
 UPROBE_FILTER_REGISTER,
 UPROBE_FILTER_UNREGISTER,
 UPROBE_FILTER_MMAP,
};

struct uprobe_consumer {
 int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs);
 int (*ret_handler)(struct uprobe_consumer *self,
    unsigned long func,
    struct pt_regs *regs);
 bool (*filter)(struct uprobe_consumer *self,
    enum uprobe_filter_ctx ctx,
    struct mm_struct *mm);

 struct uprobe_consumer *next;
};
# 135 "include/linux/uprobes.h"
struct uprobes_state {
};



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc)
{
 return -90;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool add)
{
 return -90;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int uprobe_mmap(struct vm_area_struct *vma)
{
 return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_start_dup_mmap(void)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_end_dup_mmap(void)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_notify_resume(struct pt_regs *regs)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uprobe_deny_signal(void)
{
 return false;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_free_utask(struct task_struct *t)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_copy_process(struct task_struct *t, unsigned long flags)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_clear_state(struct mm_struct *mm)
{
}
# 14 "include/linux/mm_types.h" 2
# 1 "include/linux/page-flags-layout.h" 1




# 1 "include/generated/bounds.h" 1
# 6 "include/linux/page-flags-layout.h" 2
# 25 "include/linux/page-flags-layout.h"
# 1 "./arch/sparc/include/asm/sparsemem.h" 1
# 26 "include/linux/page-flags-layout.h" 2
# 15 "include/linux/mm_types.h" 2

# 1 "./arch/sparc/include/asm/mmu.h" 1



# 1 "./arch/sparc/include/asm/mmu_64.h" 1





# 1 "./arch/sparc/include/asm/hypervisor.h" 1
# 101 "./arch/sparc/include/asm/hypervisor.h"
void sun4v_mach_exit(unsigned long exit_code);
# 130 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_mach_desc(unsigned long buffer_pa,
         unsigned long buf_len,
         unsigned long *real_buf_len);
# 151 "./arch/sparc/include/asm/hypervisor.h"
void sun4v_mach_sir(void);
# 207 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_mach_set_watchdog(unsigned long timeout,
          unsigned long *orig_timeout);
# 253 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_cpu_start(unsigned long cpuid,
         unsigned long pc,
         unsigned long rtba,
         unsigned long arg0);
# 281 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_cpu_stop(unsigned long cpuid);
# 298 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_cpu_yield(void);
# 344 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_cpu_qconf(unsigned long type,
         unsigned long queue_paddr,
         unsigned long num_queue_entries);
# 397 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_cpu_mondo_send(unsigned long cpu_count,
       unsigned long cpu_list_pa,
       unsigned long mondo_block_pa);
# 430 "./arch/sparc/include/asm/hypervisor.h"
long sun4v_cpu_state(unsigned long cpuid);
# 466 "./arch/sparc/include/asm/hypervisor.h"
struct hv_tsb_descr {
 unsigned short pgsz_idx;
 unsigned short assoc;
 unsigned int num_ttes;
 unsigned int ctx_idx;
 unsigned int pgsz_mask;
 unsigned long tsb_base;
 unsigned long resv;
};
# 517 "./arch/sparc/include/asm/hypervisor.h"
struct hv_fault_status {
 unsigned long i_fault_type;
 unsigned long i_fault_addr;
 unsigned long i_fault_ctx;
 unsigned long i_reserved[5];
 unsigned long d_fault_type;
 unsigned long d_fault_addr;
 unsigned long d_fault_ctx;
 unsigned long d_reserved[5];
};
# 630 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_mmu_tsb_ctx0(unsigned long num_descriptions,
     unsigned long tsb_desc_ra);
# 715 "./arch/sparc/include/asm/hypervisor.h"
void sun4v_mmu_demap_all(void);
# 745 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_mmu_map_perm_addr(unsigned long vaddr,
          unsigned long set_to_zero,
          unsigned long tte,
          unsigned long flags);
# 950 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_tod_get(unsigned long *time);
# 967 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_tod_set(unsigned long time);
# 1043 "./arch/sparc/include/asm/hypervisor.h"
long sun4v_con_getchar(long *status);
long sun4v_con_putchar(long c);
long sun4v_con_read(unsigned long buffer,
      unsigned long size,
      unsigned long *bytes_read);
unsigned long sun4v_con_write(unsigned long buffer,
         unsigned long size,
         unsigned long *bytes_written);
# 1085 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_mach_set_soft_state(unsigned long soft_state,
            unsigned long msg_string_ra);
# 1164 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_svc_send(unsigned long svc_id,
        unsigned long buffer,
        unsigned long buffer_size,
        unsigned long *sent_bytes);
unsigned long sun4v_svc_recv(unsigned long svc_id,
        unsigned long buffer,
        unsigned long buffer_size,
        unsigned long *recv_bytes);
unsigned long sun4v_svc_getstatus(unsigned long svc_id,
      unsigned long *status_bits);
unsigned long sun4v_svc_setstatus(unsigned long svc_id,
      unsigned long status_bits);
unsigned long sun4v_svc_clrstatus(unsigned long svc_id,
      unsigned long status_bits);
# 1194 "./arch/sparc/include/asm/hypervisor.h"
struct hv_trap_trace_control {
 unsigned long head_offset;
 unsigned long tail_offset;
 unsigned long __reserved[0x30 / sizeof(unsigned long)];
};
# 1213 "./arch/sparc/include/asm/hypervisor.h"
struct hv_trap_trace_entry {
 unsigned char type;
 unsigned char hpstate;
 unsigned char tl;
 unsigned char gl;
 unsigned short tt;
 unsigned short tag;
 unsigned long tstate;
 unsigned long tick;
 unsigned long tpc;
 unsigned long f1;
 unsigned long f2;
 unsigned long f3;
 unsigned long f4;
};
# 1463 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_devino_to_sysino(unsigned long devhandle,
         unsigned long devino);
# 1481 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_intr_getenabled(unsigned long sysino);
# 1497 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_intr_setenabled(unsigned long sysino,
        unsigned long intr_enabled);
# 1514 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_intr_getstate(unsigned long sysino);
# 1534 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_intr_setstate(unsigned long sysino, unsigned long intr_state);
# 1552 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_intr_gettarget(unsigned long sysino);
# 1569 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cpuid);
# 1653 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_vintr_get_cookie(unsigned long dev_handle,
         unsigned long dev_ino,
         unsigned long *cookie);
unsigned long sun4v_vintr_set_cookie(unsigned long dev_handle,
         unsigned long dev_ino,
         unsigned long cookie);
unsigned long sun4v_vintr_get_valid(unsigned long dev_handle,
        unsigned long dev_ino,
        unsigned long *valid);
unsigned long sun4v_vintr_set_valid(unsigned long dev_handle,
        unsigned long dev_ino,
        unsigned long valid);
unsigned long sun4v_vintr_get_state(unsigned long dev_handle,
        unsigned long dev_ino,
        unsigned long *state);
unsigned long sun4v_vintr_set_state(unsigned long dev_handle,
        unsigned long dev_ino,
        unsigned long state);
unsigned long sun4v_vintr_get_target(unsigned long dev_handle,
         unsigned long dev_ino,
         unsigned long *cpuid);
unsigned long sun4v_vintr_set_target(unsigned long dev_handle,
         unsigned long dev_ino,
         unsigned long cpuid);
# 2550 "./arch/sparc/include/asm/hypervisor.h"
struct ldc_mtable_entry {
 unsigned long mte;
 unsigned long cookie;
};
# 2633 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_ldc_tx_qconf(unsigned long channel,
     unsigned long ra,
     unsigned long num_entries);
unsigned long sun4v_ldc_tx_qinfo(unsigned long channel,
     unsigned long *ra,
     unsigned long *num_entries);
unsigned long sun4v_ldc_tx_get_state(unsigned long channel,
         unsigned long *head_off,
         unsigned long *tail_off,
         unsigned long *chan_state);
unsigned long sun4v_ldc_tx_set_qtail(unsigned long channel,
         unsigned long tail_off);
unsigned long sun4v_ldc_rx_qconf(unsigned long channel,
     unsigned long ra,
     unsigned long num_entries);
unsigned long sun4v_ldc_rx_qinfo(unsigned long channel,
     unsigned long *ra,
     unsigned long *num_entries);
unsigned long sun4v_ldc_rx_get_state(unsigned long channel,
         unsigned long *head_off,
         unsigned long *tail_off,
         unsigned long *chan_state);
unsigned long sun4v_ldc_rx_set_qhead(unsigned long channel,
         unsigned long head_off);
unsigned long sun4v_ldc_set_map_table(unsigned long channel,
          unsigned long ra,
          unsigned long num_entries);
unsigned long sun4v_ldc_get_map_table(unsigned long channel,
          unsigned long *ra,
          unsigned long *num_entries);
unsigned long sun4v_ldc_copy(unsigned long channel,
        unsigned long dir_code,
        unsigned long tgt_raddr,
        unsigned long lcl_raddr,
        unsigned long len,
        unsigned long *actual_len);
unsigned long sun4v_ldc_mapin(unsigned long channel,
         unsigned long cookie,
         unsigned long *ra,
         unsigned long *perm);
unsigned long sun4v_ldc_unmap(unsigned long ra);
unsigned long sun4v_ldc_revoke(unsigned long channel,
          unsigned long cookie,
          unsigned long mte_cookie);
# 2733 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_niagara_getperf(unsigned long reg,
        unsigned long *val);
unsigned long sun4v_niagara_setperf(unsigned long reg,
        unsigned long val);
unsigned long sun4v_niagara2_getperf(unsigned long reg,
         unsigned long *val);
unsigned long sun4v_niagara2_setperf(unsigned long reg,
         unsigned long val);
# 2750 "./arch/sparc/include/asm/hypervisor.h"
struct hv_mmu_statistics {
 unsigned long immu_tsb_hits_ctx0_8k_tte;
 unsigned long immu_tsb_ticks_ctx0_8k_tte;
 unsigned long immu_tsb_hits_ctx0_64k_tte;
 unsigned long immu_tsb_ticks_ctx0_64k_tte;
 unsigned long __reserved1[2];
 unsigned long immu_tsb_hits_ctx0_4mb_tte;
 unsigned long immu_tsb_ticks_ctx0_4mb_tte;
 unsigned long __reserved2[2];
 unsigned long immu_tsb_hits_ctx0_256mb_tte;
 unsigned long immu_tsb_ticks_ctx0_256mb_tte;
 unsigned long __reserved3[4];
 unsigned long immu_tsb_hits_ctxnon0_8k_tte;
 unsigned long immu_tsb_ticks_ctxnon0_8k_tte;
 unsigned long immu_tsb_hits_ctxnon0_64k_tte;
 unsigned long immu_tsb_ticks_ctxnon0_64k_tte;
 unsigned long __reserved4[2];
 unsigned long immu_tsb_hits_ctxnon0_4mb_tte;
 unsigned long immu_tsb_ticks_ctxnon0_4mb_tte;
 unsigned long __reserved5[2];
 unsigned long immu_tsb_hits_ctxnon0_256mb_tte;
 unsigned long immu_tsb_ticks_ctxnon0_256mb_tte;
 unsigned long __reserved6[4];
 unsigned long dmmu_tsb_hits_ctx0_8k_tte;
 unsigned long dmmu_tsb_ticks_ctx0_8k_tte;
 unsigned long dmmu_tsb_hits_ctx0_64k_tte;
 unsigned long dmmu_tsb_ticks_ctx0_64k_tte;
 unsigned long __reserved7[2];
 unsigned long dmmu_tsb_hits_ctx0_4mb_tte;
 unsigned long dmmu_tsb_ticks_ctx0_4mb_tte;
 unsigned long __reserved8[2];
 unsigned long dmmu_tsb_hits_ctx0_256mb_tte;
 unsigned long dmmu_tsb_ticks_ctx0_256mb_tte;
 unsigned long __reserved9[4];
 unsigned long dmmu_tsb_hits_ctxnon0_8k_tte;
 unsigned long dmmu_tsb_ticks_ctxnon0_8k_tte;
 unsigned long dmmu_tsb_hits_ctxnon0_64k_tte;
 unsigned long dmmu_tsb_ticks_ctxnon0_64k_tte;
 unsigned long __reserved10[2];
 unsigned long dmmu_tsb_hits_ctxnon0_4mb_tte;
 unsigned long dmmu_tsb_ticks_ctxnon0_4mb_tte;
 unsigned long __reserved11[2];
 unsigned long dmmu_tsb_hits_ctxnon0_256mb_tte;
 unsigned long dmmu_tsb_ticks_ctxnon0_256mb_tte;
 unsigned long __reserved12[4];
};
# 2835 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_mmustat_conf(unsigned long ra, unsigned long *orig_ra);
unsigned long sun4v_mmustat_info(unsigned long *ra);
# 2846 "./arch/sparc/include/asm/hypervisor.h"
struct hv_ncs_queue_entry {

 unsigned long mau_control;
# 2866 "./arch/sparc/include/asm/hypervisor.h"
 unsigned long mau_mpa;


 unsigned long mau_ma;


 unsigned long mau_np;
};

struct hv_ncs_qconf_arg {
 unsigned long mid;
 unsigned long base;
 unsigned long end;
 unsigned long num_ents;
};

struct hv_ncs_qtail_update_arg {
 unsigned long mid;
 unsigned long tail;
 unsigned long syncflag;


};
# 2925 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_ncs_request(unsigned long request,
           unsigned long arg_ra,
           unsigned long arg_size);
# 2936 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_reboot_data_set(unsigned long ra,
        unsigned long len);






unsigned long sun4v_vt_get_perfreg(unsigned long reg_num,
       unsigned long *reg_val);
unsigned long sun4v_vt_set_perfreg(unsigned long reg_num,
       unsigned long reg_val);






unsigned long sun4v_t5_get_perfreg(unsigned long reg_num,
       unsigned long *reg_val);
unsigned long sun4v_t5_set_perfreg(unsigned long reg_num,
       unsigned long reg_val);
# 2995 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_get_version(unsigned long group,
           unsigned long *major,
           unsigned long *minor);
unsigned long sun4v_set_version(unsigned long group,
           unsigned long major,
           unsigned long minor,
           unsigned long *actual_minor);

int sun4v_hvapi_register(unsigned long group, unsigned long major,
    unsigned long *minor);
void sun4v_hvapi_unregister(unsigned long group);
int sun4v_hvapi_get(unsigned long group,
      unsigned long *major,
      unsigned long *minor);
void sun4v_hvapi_init(void);
# 7 "./arch/sparc/include/asm/mmu_64.h" 2
# 65 "./arch/sparc/include/asm/mmu_64.h"
struct tsb {
 unsigned long tag;
 unsigned long pte;
} __attribute__((aligned(16)));

void __tsb_insert(unsigned long ent, unsigned long tag, unsigned long pte);
void tsb_flush(unsigned long ent, unsigned long tag);
void tsb_init(struct tsb *tsb, unsigned long size);

struct tsb_config {
 struct tsb *tsb;
 unsigned long tsb_rss_limit;
 unsigned long tsb_nentries;
 unsigned long tsb_reg_val;
 unsigned long tsb_map_vaddr;
 unsigned long tsb_map_pte;
};
# 92 "./arch/sparc/include/asm/mmu_64.h"
typedef struct {
 spinlock_t lock;
 unsigned long sparc64_ctx_val;
 unsigned long huge_pte_count;
 struct tsb_config tsb_block[2];
 struct hv_tsb_descr tsb_descr[2];
} mm_context_t;
# 5 "./arch/sparc/include/asm/mmu.h" 2
# 17 "include/linux/mm_types.h" 2






struct address_space;
struct mem_cgroup;






typedef void compound_page_dtor(struct page *);
# 46 "include/linux/mm_types.h"
struct page {

 unsigned long flags;

 union {
  struct address_space *mapping;






  void *s_mem;
 };


 struct {
  union {
   unsigned long index;
   void *freelist;
   bool pfmemalloc;
# 75 "include/linux/mm_types.h"
  };

  union {
# 88 "include/linux/mm_types.h"
   unsigned counters;


   struct {

    union {
# 110 "include/linux/mm_types.h"
     atomic_t _mapcount;

     struct {
      unsigned inuse:16;
      unsigned objects:15;
      unsigned frozen:1;
     };
     int units;
    };
    atomic_t _count;
   };
   unsigned int active;
  };
 };


 union {
  struct list_head lru;




  struct {
   struct page *next;

   int pages;
   int pobjects;




  };

  struct slab *slab_page;
  struct callback_head callback_head;



  struct {
   compound_page_dtor *compound_dtor;
   unsigned long compound_order;
  };




 };


 union {
  unsigned long private;
# 171 "include/linux/mm_types.h"
  spinlock_t ptl;


  struct kmem_cache *slab_cache;
  struct page *first_page;
 };
# 193 "include/linux/mm_types.h"
 void *virtual;
# 208 "include/linux/mm_types.h"
}







;

struct page_frag {
 struct page *page;

 __u32 offset;
 __u32 size;




};

typedef unsigned long vm_flags_t;






struct vm_region {
 struct rb_node vm_rb;
 vm_flags_t vm_flags;
 unsigned long vm_start;
 unsigned long vm_end;
 unsigned long vm_top;
 unsigned long vm_pgoff;
 struct file *vm_file;

 int vm_usage;
 bool vm_icache_flushed : 1;

};







struct vm_area_struct {


 unsigned long vm_start;
 unsigned long vm_end;



 struct vm_area_struct *vm_next, *vm_prev;

 struct rb_node vm_rb;







 unsigned long rb_subtree_gap;



 struct mm_struct *vm_mm;
 pgprot_t vm_page_prot;
 unsigned long vm_flags;





 struct {
  struct rb_node rb;
  unsigned long rb_subtree_last;
 } shared;







 struct list_head anon_vma_chain;

 struct anon_vma *anon_vma;


 const struct vm_operations_struct *vm_ops;


 unsigned long vm_pgoff;

 struct file * vm_file;
 void * vm_private_data;





 struct mempolicy *vm_policy;

};

struct core_thread {
 struct task_struct *task;
 struct core_thread *next;
};

struct core_state {
 atomic_t nr_threads;
 struct core_thread dumper;
 struct completion startup;
};

enum {
 MM_FILEPAGES,
 MM_ANONPAGES,
 MM_SWAPENTS,
 NR_MM_COUNTERS
};




struct task_rss_stat {
 int events;
 int count[NR_MM_COUNTERS];
};


struct mm_rss_stat {
 atomic_long_t count[NR_MM_COUNTERS];
};

struct kioctx_table;
struct mm_struct {
 struct vm_area_struct *mmap;
 struct rb_root mm_rb;
 u32 vmacache_seqnum;

 unsigned long (*get_unmapped_area) (struct file *filp,
    unsigned long addr, unsigned long len,
    unsigned long pgoff, unsigned long flags);

 unsigned long mmap_base;
 unsigned long mmap_legacy_base;
 unsigned long task_size;
 unsigned long highest_vm_end;
 pgd_t * pgd;
 atomic_t mm_users;
 atomic_t mm_count;
 atomic_long_t nr_ptes;
 atomic_long_t nr_pmds;
 int map_count;

 spinlock_t page_table_lock;
 struct rw_semaphore mmap_sem;

 struct list_head mmlist;





 unsigned long hiwater_rss;
 unsigned long hiwater_vm;

 unsigned long total_vm;
 unsigned long locked_vm;
 unsigned long pinned_vm;
 unsigned long shared_vm;
 unsigned long exec_vm;
 unsigned long stack_vm;
 unsigned long def_flags;
 unsigned long start_code, end_code, start_data, end_data;
 unsigned long start_brk, brk, start_stack;
 unsigned long arg_start, arg_end, env_start, env_end;

 unsigned long saved_auxv[(2*(0 + 20 + 1))];





 struct mm_rss_stat rss_stat;

 struct linux_binfmt *binfmt;

 cpumask_var_t cpu_vm_mask_var;


 mm_context_t context;

 unsigned long flags;

 struct core_state *core_state;

 spinlock_t ioctx_lock;
 struct kioctx_table *ioctx_table;
# 430 "include/linux/mm_types.h"
 struct file *exe_file;




 pgtable_t pmd_huge_pte;
# 460 "include/linux/mm_types.h"
 bool tlb_flush_pending;

 struct uprobes_state uprobes_state;




};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_init_cpumask(struct mm_struct *mm)
{



 cpumask_clear(mm->cpu_vm_mask_var);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) cpumask_t *mm_cpumask(struct mm_struct *mm)
{
 return mm->cpu_vm_mask_var;
}
# 490 "include/linux/mm_types.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool mm_tlb_flush_pending(struct mm_struct *mm)
{
 __asm__ __volatile__("": : :"memory");
 return mm->tlb_flush_pending;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_tlb_flush_pending(struct mm_struct *mm)
{
 mm->tlb_flush_pending = true;





 __asm__ __volatile__("":::"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_tlb_flush_pending(struct mm_struct *mm)
{
 __asm__ __volatile__("": : :"memory");
 mm->tlb_flush_pending = false;
}
# 524 "include/linux/mm_types.h"
struct vm_special_mapping
{
 const char *name;
 struct page **pages;
};

enum tlb_flush_reason {
 TLB_FLUSH_ON_TASK_SWITCH,
 TLB_REMOTE_SHOOTDOWN,
 TLB_LOCAL_SHOOTDOWN,
 TLB_LOCAL_MM_SHOOTDOWN,
 NR_TLB_FLUSH_REASONS,
};





typedef struct {
 unsigned long val;
} swp_entry_t;
# 28 "include/linux/sched.h" 2




# 1 "include/linux/cputime.h" 1



# 1 "arch/sparc/include/generated/asm/cputime.h" 1
# 1 "include/asm-generic/cputime.h" 1







# 1 "include/asm-generic/cputime_jiffies.h" 1



typedef unsigned long cputime_t;
# 13 "include/asm-generic/cputime_jiffies.h"
typedef u64 cputime64_t;
# 9 "include/asm-generic/cputime.h" 2
# 1 "arch/sparc/include/generated/asm/cputime.h" 2
# 5 "include/linux/cputime.h" 2
# 33 "include/linux/sched.h" 2

# 1 "include/linux/smp.h" 1
# 14 "include/linux/smp.h"
# 1 "include/linux/llist.h" 1
# 61 "include/linux/llist.h"
struct llist_head {
 struct llist_node *first;
};

struct llist_node {
 struct llist_node *next;
};
# 76 "include/linux/llist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_llist_head(struct llist_head *list)
{
 list->first = ((void *)0);
}
# 158 "include/linux/llist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool llist_empty(const struct llist_head *head)
{
 return (*({ __attribute__((unused)) typeof(head->first) __var = ( typeof(head->first)) 0; (volatile typeof(head->first) *)&(head->first); })) == ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct llist_node *llist_next(struct llist_node *node)
{
 return node->next;
}

extern bool llist_add_batch(struct llist_node *new_first,
       struct llist_node *new_last,
       struct llist_head *head);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool llist_add(struct llist_node *new, struct llist_head *head)
{
 return llist_add_batch(new, new, head);
}
# 191 "include/linux/llist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct llist_node *llist_del_all(struct llist_head *head)
{
 return ((__typeof__(*(&head->first)))__xchg((unsigned long)(((void *)0)),(&head->first),sizeof(*(&head->first))));
}

extern struct llist_node *llist_del_first(struct llist_head *head);

struct llist_node *llist_reverse_order(struct llist_node *head);
# 15 "include/linux/smp.h" 2

typedef void (*smp_call_func_t)(void *info);
struct call_single_data {
 struct llist_node llist;
 smp_call_func_t func;
 void *info;
 u16 flags;
};


extern unsigned int total_cpus;

int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
        int wait);




int on_each_cpu(smp_call_func_t func, void *info, int wait);





void on_each_cpu_mask(const struct cpumask *mask, smp_call_func_t func,
  void *info, bool wait);






void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info),
  smp_call_func_t func, void *info, bool wait,
  gfp_t gfp_flags);

int smp_call_function_single_async(int cpu, struct call_single_data *csd);







# 1 "./arch/sparc/include/asm/smp.h" 1



# 1 "./arch/sparc/include/asm/smp_64.h" 1
# 11 "./arch/sparc/include/asm/smp_64.h"
# 1 "./arch/sparc/include/asm/starfire.h" 1
# 12 "./arch/sparc/include/asm/starfire.h"
extern int this_is_starfire;

void check_if_starfire(void);
int starfire_hard_smp_processor_id(void);
void starfire_hookup(int);
unsigned int starfire_translate(unsigned long imap, unsigned int upaid);
# 12 "./arch/sparc/include/asm/smp_64.h" 2
# 1 "./arch/sparc/include/asm/spitfire.h" 1
# 55 "./arch/sparc/include/asm/spitfire.h"
enum ultra_tlb_layout {
 spitfire = 0,
 cheetah = 1,
 cheetah_plus = 2,
 hypervisor = 3,
};

extern enum ultra_tlb_layout tlb_type;

extern int sun4v_chip_type;

extern int cheetah_pcache_forced_on;
void cheetah_enable_pcache(void);






extern int num_kernel_image_mappings;




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spitfire_put_dcache_tag(unsigned long addr, unsigned long tag)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (tag), "r" (addr), "i" (0x47));
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spitfire_put_icache_tag(unsigned long addr, unsigned long tag)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (tag), "r" (addr), "i" (0x67));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long spitfire_get_dtlb_data(int entry)
{
 unsigned long data;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (data)
        : "r" (entry << 3), "i" (0x5d));


 data &= ~0x0003fe0000000000UL;

 return data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long spitfire_get_dtlb_tag(int entry)
{
 unsigned long tag;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (tag)
        : "r" (entry << 3), "i" (0x5e));
 return tag;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spitfire_put_dtlb_data(int entry, unsigned long data)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (data), "r" (entry << 3),
          "i" (0x5d));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long spitfire_get_itlb_data(int entry)
{
 unsigned long data;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (data)
        : "r" (entry << 3), "i" (0x55));


 data &= ~0x0003fe0000000000UL;

 return data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long spitfire_get_itlb_tag(int entry)
{
 unsigned long tag;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (tag)
        : "r" (entry << 3), "i" (0x56));
 return tag;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spitfire_put_itlb_data(int entry, unsigned long data)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (data), "r" (entry << 3),
          "i" (0x55));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spitfire_flush_dtlb_nucleus_page(unsigned long page)
{
 __asm__ __volatile__("stxa	%%g0, [%0] %1\n\t"
        "membar	#Sync"
        :
        : "r" (page | 0x20), "i" (0x5f));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spitfire_flush_itlb_nucleus_page(unsigned long page)
{
 __asm__ __volatile__("stxa	%%g0, [%0] %1\n\t"
        "membar	#Sync"
        :
        : "r" (page | 0x20), "i" (0x57));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cheetah_flush_dtlb_all(void)
{
 __asm__ __volatile__("stxa	%%g0, [%0] %1\n\t"
        "membar	#Sync"
        :
        : "r" (0x80), "i" (0x5f));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cheetah_flush_itlb_all(void)
{
 __asm__ __volatile__("stxa	%%g0, [%0] %1\n\t"
        "membar	#Sync"
        :
        : "r" (0x80), "i" (0x57));
}
# 214 "./arch/sparc/include/asm/spitfire.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_ldtlb_data(int entry)
{
 unsigned long data;

 __asm__ __volatile__("ldxa	[%1] %2, %%g0\n\t"
        "ldxa	[%1] %2, %0"
        : "=r" (data)
        : "r" ((0 << 16) | (entry << 3)),
        "i" (0x5d));

 return data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_litlb_data(int entry)
{
 unsigned long data;

 __asm__ __volatile__("ldxa	[%1] %2, %%g0\n\t"
        "ldxa	[%1] %2, %0"
        : "=r" (data)
        : "r" ((0 << 16) | (entry << 3)),
        "i" (0x55));

 return data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_ldtlb_tag(int entry)
{
 unsigned long tag;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (tag)
        : "r" ((0 << 16) | (entry << 3)),
        "i" (0x5e));

 return tag;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_litlb_tag(int entry)
{
 unsigned long tag;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (tag)
        : "r" ((0 << 16) | (entry << 3)),
        "i" (0x56));

 return tag;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cheetah_put_ldtlb_data(int entry, unsigned long data)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (data),
          "r" ((0 << 16) | (entry << 3)),
          "i" (0x5d));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cheetah_put_litlb_data(int entry, unsigned long data)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (data),
          "r" ((0 << 16) | (entry << 3)),
          "i" (0x55));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_dtlb_data(int entry, int tlb)
{
 unsigned long data;

 __asm__ __volatile__("ldxa	[%1] %2, %%g0\n\t"
        "ldxa	[%1] %2, %0"
        : "=r" (data)
        : "r" ((tlb << 16) | (entry << 3)), "i" (0x5d));

 return data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_dtlb_tag(int entry, int tlb)
{
 unsigned long tag;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (tag)
        : "r" ((tlb << 16) | (entry << 3)), "i" (0x5e));
 return tag;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cheetah_put_dtlb_data(int entry, unsigned long data, int tlb)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (data),
          "r" ((tlb << 16) | (entry << 3)),
          "i" (0x5d));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_itlb_data(int entry)
{
 unsigned long data;

 __asm__ __volatile__("ldxa	[%1] %2, %%g0\n\t"
        "ldxa	[%1] %2, %0"
        : "=r" (data)
        : "r" ((2 << 16) | (entry << 3)),
                               "i" (0x55));

 return data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_itlb_tag(int entry)
{
 unsigned long tag;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (tag)
        : "r" ((2 << 16) | (entry << 3)), "i" (0x56));
 return tag;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cheetah_put_itlb_data(int entry, unsigned long data)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (data), "r" ((2 << 16) | (entry << 3)),
          "i" (0x55));
}
# 13 "./arch/sparc/include/asm/smp_64.h" 2
# 31 "./arch/sparc/include/asm/smp_64.h"
# 1 "./arch/sparc/include/asm/percpu.h" 1



# 1 "./arch/sparc/include/asm/percpu_64.h" 1





register unsigned long __local_per_cpu_offset asm("g5");



# 1 "./arch/sparc/include/asm/trap_block.h" 1
# 22 "./arch/sparc/include/asm/trap_block.h"
struct thread_info;
struct trap_per_cpu {

 struct thread_info *thread;
 unsigned long pgd_paddr;
 unsigned long cpu_mondo_pa;
 unsigned long dev_mondo_pa;


 unsigned long resum_mondo_pa;
 unsigned long resum_kernel_buf_pa;
 unsigned long nonresum_mondo_pa;
 unsigned long nonresum_kernel_buf_pa;


 struct hv_fault_status fault_info;


 unsigned long cpu_mondo_block_pa;
 unsigned long cpu_list_pa;
 unsigned long tsb_huge;
 unsigned long tsb_huge_temp;


 unsigned long irq_worklist_pa;
 unsigned int cpu_mondo_qmask;
 unsigned int dev_mondo_qmask;
 unsigned int resum_qmask;
 unsigned int nonresum_qmask;
 unsigned long __per_cpu_base;
} __attribute__((aligned(64)));
extern struct trap_per_cpu trap_block[128];
void init_cur_cpu_trap(struct thread_info *);
void setup_tba(void);
extern int ncpus_probed;

unsigned long real_hard_smp_processor_id(void);

struct cpuid_patch_entry {
 unsigned int addr;
 unsigned int cheetah_safari[4];
 unsigned int cheetah_jbus[4];
 unsigned int starfire[4];
 unsigned int sun4v[4];
};
extern struct cpuid_patch_entry __cpuid_patch, __cpuid_patch_end;

struct sun4v_1insn_patch_entry {
 unsigned int addr;
 unsigned int insn;
};
extern struct sun4v_1insn_patch_entry __sun4v_1insn_patch,
 __sun4v_1insn_patch_end;

struct sun4v_2insn_patch_entry {
 unsigned int addr;
 unsigned int insns[2];
};
extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
 __sun4v_2insn_patch_end;
# 108 "./arch/sparc/include/asm/trap_block.h"
# 1 "./arch/sparc/include/asm/scratchpad.h" 1
# 109 "./arch/sparc/include/asm/trap_block.h" 2
# 11 "./arch/sparc/include/asm/percpu_64.h" 2
# 22 "./arch/sparc/include/asm/percpu_64.h"
# 1 "include/asm-generic/percpu.h" 1





# 1 "include/linux/percpu-defs.h" 1
# 295 "include/linux/percpu-defs.h"
extern void __bad_size_call_parameter(void);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __this_cpu_preempt_check(const char *op) { }
# 7 "include/asm-generic/percpu.h" 2
# 47 "include/asm-generic/percpu.h"
extern void setup_per_cpu_areas(void);
# 23 "./arch/sparc/include/asm/percpu_64.h" 2
# 5 "./arch/sparc/include/asm/percpu.h" 2
# 32 "./arch/sparc/include/asm/smp_64.h" 2

extern __attribute__((section(".data..percpu" ""))) __typeof__(cpumask_t) cpu_sibling_map;
extern cpumask_t cpu_core_map[128];

void arch_send_call_function_single_ipi(int cpu);
void arch_send_call_function_ipi_mask(const struct cpumask *mask);





int hard_smp_processor_id(void);


void smp_fill_in_sib_core_maps(void);
void cpu_play_dead(void);

void smp_fetch_global_regs(void);
void smp_fetch_global_pmu(void);

struct seq_file;
void smp_bogo(struct seq_file *);
void smp_info(struct seq_file *);

void smp_callin(void);
void cpu_panic(void);
void smp_synchronize_tick_client(void);
void smp_capture(void);
void smp_release(void);


int __cpu_disable(void);
void __cpu_die(unsigned int cpu);
# 5 "./arch/sparc/include/asm/smp.h" 2
# 60 "include/linux/smp.h" 2
# 69 "include/linux/smp.h"
extern void smp_send_stop(void);




extern void smp_send_reschedule(int cpu);





extern void smp_prepare_cpus(unsigned int max_cpus);




extern int __cpu_up(unsigned int cpunum, struct task_struct *tidle);




extern void smp_cpus_done(unsigned int max_cpus);




int smp_call_function(smp_call_func_t func, void *info, int wait);
void smp_call_function_many(const struct cpumask *mask,
       smp_call_func_t func, void *info, bool wait);

int smp_call_function_any(const struct cpumask *mask,
     smp_call_func_t func, void *info, int wait);

void kick_all_cpus_sync(void);
void wake_up_all_idle_cpus(void);




void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) call_function_init(void);
void generic_smp_call_function_single_interrupt(void);







void smp_prepare_boot_cpu(void);

extern unsigned int setup_max_cpus;
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) setup_nr_cpu_ids(void);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) smp_init(void);
# 192 "include/linux/smp.h"
extern void arch_disable_smp_support(void);

extern void arch_enable_nonboot_cpus_begin(void);
extern void arch_enable_nonboot_cpus_end(void);

void smp_setup_processor_id(void);
# 35 "include/linux/sched.h" 2
# 1 "include/linux/sem.h" 1




# 1 "include/linux/rcupdate.h" 1
# 44 "include/linux/rcupdate.h"
# 1 "include/linux/debugobjects.h" 1






enum debug_obj_state {
 ODEBUG_STATE_NONE,
 ODEBUG_STATE_INIT,
 ODEBUG_STATE_INACTIVE,
 ODEBUG_STATE_ACTIVE,
 ODEBUG_STATE_DESTROYED,
 ODEBUG_STATE_NOTAVAILABLE,
 ODEBUG_STATE_MAX,
};

struct debug_obj_descr;
# 27 "include/linux/debugobjects.h"
struct debug_obj {
 struct hlist_node node;
 enum debug_obj_state state;
 unsigned int astate;
 void *object;
 struct debug_obj_descr *descr;
};
# 52 "include/linux/debugobjects.h"
struct debug_obj_descr {
 const char *name;
 void *(*debug_hint) (void *addr);
 int (*fixup_init) (void *addr, enum debug_obj_state state);
 int (*fixup_activate) (void *addr, enum debug_obj_state state);
 int (*fixup_destroy) (void *addr, enum debug_obj_state state);
 int (*fixup_free) (void *addr, enum debug_obj_state state);
 int (*fixup_assert_init)(void *addr, enum debug_obj_state state);
};
# 84 "include/linux/debugobjects.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_object_init (void *addr, struct debug_obj_descr *descr) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
debug_object_activate (void *addr, struct debug_obj_descr *descr) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_object_deactivate(void *addr, struct debug_obj_descr *descr) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_object_destroy (void *addr, struct debug_obj_descr *descr) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_object_free (void *addr, struct debug_obj_descr *descr) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_object_assert_init(void *addr, struct debug_obj_descr *descr) { }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_objects_early_init(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_objects_mem_init(void) { }





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_check_no_obj_freed(const void *address, unsigned long size) { }
# 45 "include/linux/rcupdate.h" 2




extern int rcu_expedited;

enum rcutorture_type {
 RCU_FLAVOR,
 RCU_BH_FLAVOR,
 RCU_SCHED_FLAVOR,
 RCU_TASKS_FLAVOR,
 SRCU_FLAVOR,
 INVALID_RCU_FLAVOR
};


void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
       unsigned long *gpnum, unsigned long *completed);
void rcutorture_record_test_transition(void);
void rcutorture_record_progress(unsigned long vernum);
void do_trace_rcu_torture_read(const char *rcutorturename,
          struct callback_head *rhp,
          unsigned long secs,
          unsigned long c_old,
          unsigned long c);
# 171 "include/linux/rcupdate.h"
void call_rcu_bh(struct callback_head *head,
   void (*func)(struct callback_head *head));
# 193 "include/linux/rcupdate.h"
void call_rcu_sched(struct callback_head *head,
      void (*func)(struct callback_head *rcu));

void synchronize_sched(void);
# 216 "include/linux/rcupdate.h"
void call_rcu_tasks(struct callback_head *head, void (*func)(struct callback_head *head));
void synchronize_rcu_tasks(void);
void rcu_barrier_tasks(void);
# 237 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __rcu_read_lock(void)
{
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __rcu_read_unlock(void)
{
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void synchronize_rcu(void)
{
 synchronize_sched();
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rcu_preempt_depth(void)
{
 return 0;
}




void rcu_init(void);
void rcu_sched_qs(void);
void rcu_bh_qs(void);
void rcu_check_callbacks(int user);
struct notifier_block;
void rcu_idle_enter(void);
void rcu_idle_exit(void);
void rcu_irq_enter(void);
void rcu_irq_exit(void);


void rcu_sysrq_start(void);
void rcu_sysrq_end(void);
# 286 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_user_enter(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_user_exit(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_user_hooks_switch(struct task_struct *prev,
      struct task_struct *next) { }





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_init_nohz(void)
{
}
# 357 "include/linux/rcupdate.h"
bool __rcu_is_watching(void);







typedef void call_rcu_func_t(struct callback_head *head,
        void (*func)(struct callback_head *head));
void wait_rcu_gp(call_rcu_func_t crf);


# 1 "include/linux/rcutree.h" 1
# 33 "include/linux/rcutree.h"
void rcu_note_context_switch(void);

int rcu_needs_cpu(unsigned long *delta_jiffies);

void rcu_cpu_stall_reset(void);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_virt_note_context_switch(int cpu)
{
 rcu_note_context_switch();
}

void synchronize_rcu_bh(void);
void synchronize_sched_expedited(void);
void synchronize_rcu_expedited(void);

void kfree_call_rcu(struct callback_head *head, void (*func)(struct callback_head *rcu));
# 71 "include/linux/rcutree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void synchronize_rcu_bh_expedited(void)
{
 synchronize_sched_expedited();
}

void rcu_barrier(void);
void rcu_barrier_bh(void);
void rcu_barrier_sched(void);
unsigned long get_state_synchronize_rcu(void);
void cond_synchronize_rcu(unsigned long oldstate);

extern unsigned long rcutorture_testseq;
extern unsigned long rcutorture_vernum;
unsigned long rcu_batches_started(void);
unsigned long rcu_batches_started_bh(void);
unsigned long rcu_batches_started_sched(void);
unsigned long rcu_batches_completed(void);
unsigned long rcu_batches_completed_bh(void);
unsigned long rcu_batches_completed_sched(void);
void show_rcu_gp_kthreads(void);

void rcu_force_quiescent_state(void);
void rcu_bh_force_quiescent_state(void);
void rcu_sched_force_quiescent_state(void);

void exit_rcu(void);

void rcu_scheduler_starting(void);
extern int rcu_scheduler_active __attribute__((__section__(".data..read_mostly")));

bool rcu_is_watching(void);

void rcu_all_qs(void);
# 371 "include/linux/rcupdate.h" 2
# 389 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_rcu_head(struct callback_head *head)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_rcu_head(struct callback_head *head)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_rcu_head_on_stack(struct callback_head *head)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_rcu_head_on_stack(struct callback_head *head)
{
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool rcu_lockdep_current_cpu_online(void)
{
 return true;
}
# 494 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rcu_read_lock_held(void)
{
 return 1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rcu_read_lock_bh_held(void)
{
 return 1;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rcu_read_lock_sched_held(void)
{
 return 1;
}
# 878 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_lock(void)
{
 __rcu_read_lock();
 (void)0;
 do { } while (0);
 do { } while (0)
                                                  ;
}
# 932 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_unlock(void)
{
 do { } while (0)
                                                    ;
 do { } while (0);
 (void)0;
 __rcu_read_unlock();
}
# 958 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_lock_bh(void)
{
 local_bh_disable();
 (void)0;
 do { } while (0);
 do { } while (0)
                                                     ;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_unlock_bh(void)
{
 do { } while (0)
                                                       ;
 do { } while (0);
 (void)0;
 local_bh_enable();
}
# 994 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_lock_sched(void)
{
 __asm__ __volatile__("": : :"memory");
 (void)0;
 do { } while (0);
 do { } while (0)
                                                        ;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) void rcu_read_lock_sched_notrace(void)
{
 __asm__ __volatile__("": : :"memory");
 (void)0;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_unlock_sched(void)
{
 do { } while (0)
                                                          ;
 do { } while (0);
 (void)0;
 __asm__ __volatile__("": : :"memory");
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) void rcu_read_unlock_sched_notrace(void)
{
 (void)0;
 __asm__ __volatile__("": : :"memory");
}
# 1137 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool rcu_is_nocb_cpu(int cpu) { return false; }
# 1147 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool rcu_sys_is_idle(void)
{
 return false;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_sysidle_force_exit(void)
{
}
# 6 "include/linux/sem.h" 2

# 1 "include/uapi/linux/sem.h" 1



# 1 "include/linux/ipc.h" 1




# 1 "include/linux/uidgid.h" 1
# 15 "include/linux/uidgid.h"
# 1 "include/linux/highuid.h" 1
# 34 "include/linux/highuid.h"
extern int overflowuid;
extern int overflowgid;

extern void __bad_uid(void);
extern void __bad_gid(void);
# 81 "include/linux/highuid.h"
extern int fs_overflowuid;
extern int fs_overflowgid;
# 16 "include/linux/uidgid.h" 2

struct user_namespace;
extern struct user_namespace init_user_ns;

typedef struct {
 uid_t val;
} kuid_t;


typedef struct {
 gid_t val;
} kgid_t;




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) uid_t __kuid_val(kuid_t uid)
{
 return uid.val;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gid_t __kgid_val(kgid_t gid)
{
 return gid.val;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_eq(kuid_t left, kuid_t right)
{
 return __kuid_val(left) == __kuid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_eq(kgid_t left, kgid_t right)
{
 return __kgid_val(left) == __kgid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_gt(kuid_t left, kuid_t right)
{
 return __kuid_val(left) > __kuid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_gt(kgid_t left, kgid_t right)
{
 return __kgid_val(left) > __kgid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_gte(kuid_t left, kuid_t right)
{
 return __kuid_val(left) >= __kuid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_gte(kgid_t left, kgid_t right)
{
 return __kgid_val(left) >= __kgid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_lt(kuid_t left, kuid_t right)
{
 return __kuid_val(left) < __kuid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_lt(kgid_t left, kgid_t right)
{
 return __kgid_val(left) < __kgid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_lte(kuid_t left, kuid_t right)
{
 return __kuid_val(left) <= __kuid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_lte(kgid_t left, kgid_t right)
{
 return __kgid_val(left) <= __kgid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_valid(kuid_t uid)
{
 return !uid_eq(uid, (kuid_t){ -1 });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_valid(kgid_t gid)
{
 return !gid_eq(gid, (kgid_t){ -1 });
}
# 130 "include/linux/uidgid.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kuid_t make_kuid(struct user_namespace *from, uid_t uid)
{
 return (kuid_t){ uid };
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kgid_t make_kgid(struct user_namespace *from, gid_t gid)
{
 return (kgid_t){ gid };
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) uid_t from_kuid(struct user_namespace *to, kuid_t kuid)
{
 return __kuid_val(kuid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gid_t from_kgid(struct user_namespace *to, kgid_t kgid)
{
 return __kgid_val(kgid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) uid_t from_kuid_munged(struct user_namespace *to, kuid_t kuid)
{
 uid_t uid = from_kuid(to, kuid);
 if (uid == (uid_t)-1)
  uid = overflowuid;
 return uid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gid_t from_kgid_munged(struct user_namespace *to, kgid_t kgid)
{
 gid_t gid = from_kgid(to, kgid);
 if (gid == (gid_t)-1)
  gid = overflowgid;
 return gid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kuid_has_mapping(struct user_namespace *ns, kuid_t uid)
{
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kgid_has_mapping(struct user_namespace *ns, kgid_t gid)
{
 return true;
}
# 6 "include/linux/ipc.h" 2
# 1 "include/uapi/linux/ipc.h" 1
# 9 "include/uapi/linux/ipc.h"
struct ipc_perm
{
 __kernel_key_t key;
 __kernel_uid_t uid;
 __kernel_gid_t gid;
 __kernel_uid_t cuid;
 __kernel_gid_t cgid;
 __kernel_mode_t mode;
 unsigned short seq;
};


# 1 "./arch/sparc/include/uapi/asm/ipcbuf.h" 1
# 15 "./arch/sparc/include/uapi/asm/ipcbuf.h"
struct ipc64_perm
{
 __kernel_key_t key;
 __kernel_uid_t uid;
 __kernel_gid_t gid;
 __kernel_uid_t cuid;
 __kernel_gid_t cgid;



 __kernel_mode_t mode;
 unsigned short __pad1;
 unsigned short seq;
 unsigned long long __unused1;
 unsigned long long __unused2;
};
# 22 "include/uapi/linux/ipc.h" 2
# 57 "include/uapi/linux/ipc.h"
struct ipc_kludge {
 struct msgbuf *msgp;
 long msgtyp;
};
# 7 "include/linux/ipc.h" 2




struct kern_ipc_perm
{
 spinlock_t lock;
 bool deleted;
 int id;
 key_t key;
 kuid_t uid;
 kgid_t gid;
 kuid_t cuid;
 kgid_t cgid;
 umode_t mode;
 unsigned long seq;
 void *security;
};
# 5 "include/uapi/linux/sem.h" 2
# 23 "include/uapi/linux/sem.h"
struct semid_ds {
 struct ipc_perm sem_perm;
 __kernel_time_t sem_otime;
 __kernel_time_t sem_ctime;
 struct sem *sem_base;
 struct sem_queue *sem_pending;
 struct sem_queue **sem_pending_last;
 struct sem_undo *undo;
 unsigned short sem_nsems;
};


# 1 "./arch/sparc/include/uapi/asm/sembuf.h" 1
# 19 "./arch/sparc/include/uapi/asm/sembuf.h"
struct semid64_ds {
 struct ipc64_perm sem_perm;

 __kernel_time_t sem_otime;

 __kernel_time_t sem_ctime;
 unsigned long sem_nsems;
 unsigned long __unused1;
 unsigned long __unused2;
};
# 36 "include/uapi/linux/sem.h" 2


struct sembuf {
 unsigned short sem_num;
 short sem_op;
 short sem_flg;
};


union semun {
 int val;
 struct semid_ds *buf;
 unsigned short *array;
 struct seminfo *__buf;
 void *__pad;
};

struct seminfo {
 int semmap;
 int semmni;
 int semmns;
 int semmnu;
 int semmsl;
 int semopm;
 int semume;
 int semusz;
 int semvmx;
 int semaem;
};
# 8 "include/linux/sem.h" 2

struct task_struct;


struct sem_array {
 struct kern_ipc_perm __attribute__((__aligned__((1 << 6))))
    sem_perm;
 time_t sem_ctime;
 struct sem *sem_base;
 struct list_head pending_alter;

 struct list_head pending_const;

 struct list_head list_id;
 int sem_nsems;
 int complex_count;
};



struct sysv_sem {
 struct sem_undo_list *undo_list;
};

extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
extern void exit_sem(struct task_struct *tsk);
# 36 "include/linux/sched.h" 2
# 1 "include/linux/shm.h" 1





# 1 "include/uapi/linux/shm.h" 1
# 26 "include/uapi/linux/shm.h"
struct shmid_ds {
 struct ipc_perm shm_perm;
 int shm_segsz;
 __kernel_time_t shm_atime;
 __kernel_time_t shm_dtime;
 __kernel_time_t shm_ctime;
 __kernel_ipc_pid_t shm_cpid;
 __kernel_ipc_pid_t shm_lpid;
 unsigned short shm_nattch;
 unsigned short shm_unused;
 void *shm_unused2;
 void *shm_unused3;
};


# 1 "./arch/sparc/include/uapi/asm/shmbuf.h" 1
# 20 "./arch/sparc/include/uapi/asm/shmbuf.h"
struct shmid64_ds {
 struct ipc64_perm shm_perm;

 __kernel_time_t shm_atime;

 __kernel_time_t shm_dtime;

 __kernel_time_t shm_ctime;
 size_t shm_segsz;
 __kernel_pid_t shm_cpid;
 __kernel_pid_t shm_lpid;
 unsigned long shm_nattch;
 unsigned long __unused1;
 unsigned long __unused2;
};

struct shminfo64 {
 unsigned long shmmax;
 unsigned long shmmin;
 unsigned long shmmni;
 unsigned long shmseg;
 unsigned long shmall;
 unsigned long __unused1;
 unsigned long __unused2;
 unsigned long __unused3;
 unsigned long __unused4;
};
# 42 "include/uapi/linux/shm.h" 2
# 62 "include/uapi/linux/shm.h"
struct shminfo {
 int shmmax;
 int shmmin;
 int shmmni;
 int shmseg;
 int shmall;
};

struct shm_info {
 int used_ids;
 __kernel_ulong_t shm_tot;
 __kernel_ulong_t shm_rss;
 __kernel_ulong_t shm_swp;
 __kernel_ulong_t swap_attempts;
 __kernel_ulong_t swap_successes;
};
# 7 "include/linux/shm.h" 2
# 1 "./arch/sparc/include/asm/shmparam.h" 1



# 1 "./arch/sparc/include/asm/shmparam_64.h" 1
# 5 "./arch/sparc/include/asm/shmparam.h" 2
# 8 "include/linux/shm.h" 2

struct shmid_kernel
{
 struct kern_ipc_perm shm_perm;
 struct file *shm_file;
 unsigned long shm_nattch;
 unsigned long shm_segsz;
 time_t shm_atim;
 time_t shm_dtim;
 time_t shm_ctim;
 pid_t shm_cprid;
 pid_t shm_lprid;
 struct user_struct *mlock_user;


 struct task_struct *shm_creator;
 struct list_head shm_clist;
};
# 49 "include/linux/shm.h"
struct sysv_shm {
 struct list_head shm_clist;
};

long do_shmat(int shmid, char *shmaddr, int shmflg, unsigned long *addr,
       unsigned long shmlba);
int is_file_shm_hugepages(struct file *file);
void exit_shm(struct task_struct *task);
# 37 "include/linux/sched.h" 2
# 1 "include/linux/signal.h" 1





# 1 "include/uapi/linux/signal.h" 1



# 1 "./arch/sparc/include/asm/signal.h" 1




# 1 "include/linux/personality.h" 1



# 1 "include/uapi/linux/personality.h" 1
# 10 "include/uapi/linux/personality.h"
enum {
 UNAME26 = 0x0020000,
 ADDR_NO_RANDOMIZE = 0x0040000,
 FDPIC_FUNCPTRS = 0x0080000,


 MMAP_PAGE_ZERO = 0x0100000,
 ADDR_COMPAT_LAYOUT = 0x0200000,
 READ_IMPLIES_EXEC = 0x0400000,
 ADDR_LIMIT_32BIT = 0x0800000,
 SHORT_INODE = 0x1000000,
 WHOLE_SECONDS = 0x2000000,
 STICKY_TIMEOUTS = 0x4000000,
 ADDR_LIMIT_3GB = 0x8000000,
};
# 41 "include/uapi/linux/personality.h"
enum {
 PER_LINUX = 0x0000,
 PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
 PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
 PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
 PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
 PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS |
      WHOLE_SECONDS | SHORT_INODE,
 PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
 PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
 PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
 PER_BSD = 0x0006,
 PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
 PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
 PER_LINUX32 = 0x0008,
 PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
 PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,
 PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,
 PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,
 PER_RISCOS = 0x000c,
 PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
 PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
 PER_OSF4 = 0x000f,
 PER_HPUX = 0x0010,
 PER_MASK = 0x00ff,
};
# 5 "include/linux/personality.h" 2






struct exec_domain;
struct pt_regs;

extern int register_exec_domain(struct exec_domain *);
extern int unregister_exec_domain(struct exec_domain *);
extern int __set_personality(unsigned int);
# 25 "include/linux/personality.h"
typedef void (*handler_t)(int, struct pt_regs *);

struct exec_domain {
 const char *name;
 handler_t handler;
 unsigned char pers_low;
 unsigned char pers_high;
 unsigned long *signal_map;
 unsigned long *signal_invmap;
 struct map_segment *err_map;
 struct map_segment *socktype_map;
 struct map_segment *sockopt_map;
 struct map_segment *af_map;
 struct module *module;
 struct exec_domain *next;
};
# 6 "./arch/sparc/include/asm/signal.h" 2


# 1 "./arch/sparc/include/uapi/asm/signal.h" 1



# 1 "./arch/sparc/include/asm/sigcontext.h" 1




# 1 "./arch/sparc/include/uapi/asm/sigcontext.h" 1
# 6 "./arch/sparc/include/asm/sigcontext.h" 2






struct sigcontext32 {
 int sigc_onstack;
 int sigc_mask;
 int sigc_sp;
 int sigc_pc;
 int sigc_npc;
 int sigc_psr;
 int sigc_g1;
 int sigc_o0;




 int sigc_oswins;


 unsigned sigc_spbuf[31];


 struct reg_window32 sigc_wbuf[31];
};




typedef struct {
 struct {
  unsigned int psr;
  unsigned int pc;
  unsigned int npc;
  unsigned int y;
  unsigned int u_regs[16];
 } si_regs;
 int si_mask;
} __siginfo32_t;



typedef struct {
 unsigned long locals[8];
 unsigned long ins[8];
} __siginfo_reg_window;

typedef struct {
 int wsaved;
 __siginfo_reg_window reg_window[7];
 unsigned long rwbuf_stkptrs[7];
} __siginfo_rwin_t;


typedef struct {
 unsigned int si_float_regs [64];
 unsigned long si_fsr;
 unsigned long si_gsr;
 unsigned long si_fprs;
} __siginfo_fpu_t;



struct sigcontext {

 char sigc_info[128];
 struct {
  unsigned long u_regs[16];
  unsigned long tstate;
  unsigned long tpc;
  unsigned long tnpc;
  unsigned int y;
  unsigned int fprs;
 } sigc_regs;
 __siginfo_fpu_t * sigc_fpu_save;
 struct {
  void * ss_sp;
  int ss_flags;
  unsigned long ss_size;
 } sigc_stack;
 unsigned long sigc_mask;
 __siginfo_rwin_t * sigc_rwin_save;
};
# 5 "./arch/sparc/include/uapi/asm/signal.h" 2
# 109 "./arch/sparc/include/uapi/asm/signal.h"
typedef unsigned long old_sigset_t;

typedef struct {
       unsigned long sig[(64 / 64)];
} sigset_t;


struct sigstack {

 char *the_stack;
 int cur_status;
};
# 154 "./arch/sparc/include/uapi/asm/signal.h"
# 1 "./include/uapi/asm-generic/signal-defs.h" 1
# 17 "./include/uapi/asm-generic/signal-defs.h"
typedef void __signalfn_t(int);
typedef __signalfn_t *__sighandler_t;

typedef void __restorefn_t(void);
typedef __restorefn_t *__sigrestore_t;
# 155 "./arch/sparc/include/uapi/asm/signal.h" 2
# 172 "./arch/sparc/include/uapi/asm/signal.h"
typedef struct sigaltstack {
 void *ss_sp;
 int ss_flags;
 size_t ss_size;
} stack_t;
# 9 "./arch/sparc/include/asm/signal.h" 2
# 5 "include/uapi/linux/signal.h" 2
# 1 "./arch/sparc/include/asm/siginfo.h" 1



# 1 "./arch/sparc/include/uapi/asm/siginfo.h" 1
# 14 "./arch/sparc/include/uapi/asm/siginfo.h"
# 1 "include/asm-generic/siginfo.h" 1



# 1 "include/uapi/asm-generic/siginfo.h" 1






typedef union sigval {
 int sival_int;
 void *sival_ptr;
} sigval_t;
# 48 "include/uapi/asm-generic/siginfo.h"
typedef struct siginfo {
 int si_signo;
 int si_errno;
 int si_code;

 union {
  int _pad[((128 - (4 * sizeof(int))) / sizeof(int))];


  struct {
   __kernel_pid_t _pid;
   __kernel_uid32_t _uid;
  } _kill;


  struct {
   __kernel_timer_t _tid;
   int _overrun;
   char _pad[sizeof( __kernel_uid32_t) - sizeof(int)];
   sigval_t _sigval;
   int _sys_private;
  } _timer;


  struct {
   __kernel_pid_t _pid;
   __kernel_uid32_t _uid;
   sigval_t _sigval;
  } _rt;


  struct {
   __kernel_pid_t _pid;
   __kernel_uid32_t _uid;
   int _status;
   __kernel_clock_t _utime;
   __kernel_clock_t _stime;
  } _sigchld;


  struct {
   void *_addr;

   int _trapno;

   short _addr_lsb;
   struct {
    void *_lower;
    void *_upper;
   } _addr_bnd;
  } _sigfault;


  struct {
   int _band;
   int _fd;
  } _sigpoll;


  struct {
   void *_call_addr;
   int _syscall;
   unsigned int _arch;
  } _sigsys;
 } _sifields;
} siginfo_t;
# 285 "include/uapi/asm-generic/siginfo.h"
typedef struct sigevent {
 sigval_t sigev_value;
 int sigev_signo;
 int sigev_notify;
 union {
  int _pad[((64 - (sizeof(int) * 2 + sizeof(sigval_t))) / sizeof(int))];
   int _tid;

  struct {
   void (*_function)(sigval_t);
   void *_attribute;
  } _sigev_thread;
 } _sigev_un;
} sigevent_t;
# 5 "include/asm-generic/siginfo.h" 2
# 17 "include/asm-generic/siginfo.h"
struct siginfo;
void do_schedule_next_timer(struct siginfo *info);





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void copy_siginfo(struct siginfo *to, struct siginfo *from)
{
 if (from->si_code < 0)
  __builtin_memcpy(to, from, sizeof(*to));
 else

  __builtin_memcpy(to, from, (4 * sizeof(int)) + sizeof(from->_sifields._sigchld));
}



extern int copy_siginfo_to_user(struct siginfo *to, const struct siginfo *from);
# 15 "./arch/sparc/include/uapi/asm/siginfo.h" 2
# 5 "./arch/sparc/include/asm/siginfo.h" 2




struct compat_siginfo;
# 6 "include/uapi/linux/signal.h" 2
# 7 "include/linux/signal.h" 2

struct task_struct;


extern int print_fatal_signals;




struct sigqueue {
 struct list_head list;
 int flags;
 siginfo_t info;
 struct user_struct *user;
};




struct sigpending {
 struct list_head list;
 sigset_t signal;
};
# 40 "include/linux/signal.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigaddset(sigset_t *set, int _sig)
{
 unsigned long sig = _sig - 1;
 if ((64 / 64) == 1)
  set->sig[0] |= 1UL << sig;
 else
  set->sig[sig / 64] |= 1UL << (sig % 64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigdelset(sigset_t *set, int _sig)
{
 unsigned long sig = _sig - 1;
 if ((64 / 64) == 1)
  set->sig[0] &= ~(1UL << sig);
 else
  set->sig[sig / 64] &= ~(1UL << (sig % 64));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sigismember(sigset_t *set, int _sig)
{
 unsigned long sig = _sig - 1;
 if ((64 / 64) == 1)
  return 1 & (set->sig[0] >> sig);
 else
  return 1 & (set->sig[sig / 64] >> (sig % 64));
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sigisemptyset(sigset_t *set)
{
 switch ((64 / 64)) {
 case 4:
  return (set->sig[3] | set->sig[2] |
   set->sig[1] | set->sig[0]) == 0;
 case 2:
  return (set->sig[1] | set->sig[0]) == 0;
 case 1:
  return set->sig[0] == 0;
 default:
  do { bool __cond = !(!(1)); extern void __compiletime_assert_80(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_80(); do { } while (0); } while (0);
  return 0;
 }
}
# 114 "include/linux/signal.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigorsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 64)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) | (b3)); r->sig[2] = ((a2) | (b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) | (b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) | (b0)); break; default: do { bool __cond = !(!(1)); extern void __compiletime_assert_114(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_114(); do { } while (0); } while (0); } }


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigandsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 64)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) & (b3)); r->sig[2] = ((a2) & (b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) & (b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) & (b0)); break; default: do { bool __cond = !(!(1)); extern void __compiletime_assert_117(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_117(); do { } while (0); } while (0); } }


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigandnsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 64)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) & ~(b3)); r->sig[2] = ((a2) & ~(b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) & ~(b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) & ~(b0)); break; default: do { bool __cond = !(!(1)); extern void __compiletime_assert_120(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_120(); do { } while (0); } while (0); } }
# 142 "include/linux/signal.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void signotset(sigset_t *set) { switch ((64 / 64)) { case 4: set->sig[3] = (~(set->sig[3])); set->sig[2] = (~(set->sig[2])); case 2: set->sig[1] = (~(set->sig[1])); case 1: set->sig[0] = (~(set->sig[0])); break; default: do { bool __cond = !(!(1)); extern void __compiletime_assert_142(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_142(); do { } while (0); } while (0); } }




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigemptyset(sigset_t *set)
{
 switch ((64 / 64)) {
 default:
  __builtin_memset(set, 0, sizeof(sigset_t));
  break;
 case 2: set->sig[1] = 0;
 case 1: set->sig[0] = 0;
  break;
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigfillset(sigset_t *set)
{
 switch ((64 / 64)) {
 default:
  __builtin_memset(set, -1, sizeof(sigset_t));
  break;
 case 2: set->sig[1] = -1;
 case 1: set->sig[0] = -1;
  break;
 }
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigaddsetmask(sigset_t *set, unsigned long mask)
{
 set->sig[0] |= mask;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigdelsetmask(sigset_t *set, unsigned long mask)
{
 set->sig[0] &= ~mask;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sigtestsetmask(sigset_t *set, unsigned long mask)
{
 return (set->sig[0] & mask) != 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void siginitset(sigset_t *set, unsigned long mask)
{
 set->sig[0] = mask;
 switch ((64 / 64)) {
 default:
  __builtin_memset(&set->sig[1], 0, sizeof(long)*((64 / 64)-1));
  break;
 case 2: set->sig[1] = 0;
 case 1: ;
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void siginitsetinv(sigset_t *set, unsigned long mask)
{
 set->sig[0] = ~mask;
 switch ((64 / 64)) {
 default:
  __builtin_memset(&set->sig[1], -1, sizeof(long)*((64 / 64)-1));
  break;
 case 2: set->sig[1] = -1;
 case 1: ;
 }
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_sigpending(struct sigpending *sig)
{
 sigemptyset(&sig->signal);
 INIT_LIST_HEAD(&sig->list);
}

extern void flush_sigqueue(struct sigpending *queue);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int valid_signal(unsigned long sig)
{
 return sig <= 64 ? 1 : 0;
}

struct timespec;
struct pt_regs;

extern int next_signal(struct sigpending *pending, sigset_t *mask);
extern int do_send_sig_info(int sig, struct siginfo *info,
    struct task_struct *p, bool group);
extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p);
extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *);
extern int do_sigtimedwait(const sigset_t *, siginfo_t *,
    const struct timespec *);
extern int sigprocmask(int, sigset_t *, sigset_t *);
extern void set_current_blocked(sigset_t *);
extern void __set_current_blocked(const sigset_t *);
extern int show_unhandled_signals;
extern int sigsuspend(sigset_t *);

struct sigaction {

 __sighandler_t sa_handler;
 unsigned long sa_flags;





 __sigrestore_t sa_restorer;

 sigset_t sa_mask;
};

struct k_sigaction {
 struct sigaction sa;

 __sigrestore_t ka_restorer;

};
# 274 "include/linux/signal.h"
struct ksignal {
 struct k_sigaction ka;
 siginfo_t info;
 int sig;
};

extern int get_signal(struct ksignal *ksig);
extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping);
extern void exit_signals(struct task_struct *tsk);
extern void kernel_sigaction(int, __sighandler_t);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void allow_signal(int sig)
{





 kernel_sigaction(sig, ( __sighandler_t)2);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void disallow_signal(int sig)
{
 kernel_sigaction(sig, (( __sighandler_t)1));
}

extern struct kmem_cache *sighand_cachep;

int unhandled_signal(struct task_struct *tsk, int sig);
# 427 "include/linux/signal.h"
void signals_init(void);

int restore_altstack(const stack_t *);
int __save_altstack(stack_t *, unsigned long);
# 441 "include/linux/signal.h"
struct seq_file;
extern void render_sigset_t(struct seq_file *, const char *, sigset_t *);
# 38 "include/linux/sched.h" 2


# 1 "include/linux/pid.h" 1





enum pid_type
{
 PIDTYPE_PID,
 PIDTYPE_PGID,
 PIDTYPE_SID,
 PIDTYPE_MAX
};
# 50 "include/linux/pid.h"
struct upid {

 int nr;
 struct pid_namespace *ns;
 struct hlist_node pid_chain;
};

struct pid
{
 atomic_t count;
 unsigned int level;

 struct hlist_head tasks[PIDTYPE_MAX];
 struct callback_head rcu;
 struct upid numbers[1];
};

extern struct pid init_struct_pid;

struct pid_link
{
 struct hlist_node node;
 struct pid *pid;
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *get_pid(struct pid *pid)
{
 if (pid)
  atomic_add(1, &pid->count);
 return pid;
}

extern void put_pid(struct pid *pid);
extern struct task_struct *pid_task(struct pid *pid, enum pid_type);
extern struct task_struct *get_pid_task(struct pid *pid, enum pid_type);

extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type);




extern void attach_pid(struct task_struct *task, enum pid_type);
extern void detach_pid(struct task_struct *task, enum pid_type);
extern void change_pid(struct task_struct *task, enum pid_type,
   struct pid *pid);
extern void transfer_pid(struct task_struct *old, struct task_struct *new,
    enum pid_type);

struct pid_namespace;
extern struct pid_namespace init_pid_ns;
# 110 "include/linux/pid.h"
extern struct pid *find_pid_ns(int nr, struct pid_namespace *ns);
extern struct pid *find_vpid(int nr);




extern struct pid *find_get_pid(int nr);
extern struct pid *find_ge_pid(int nr, struct pid_namespace *);
int next_pidmap(struct pid_namespace *pid_ns, unsigned int last);

extern struct pid *alloc_pid(struct pid_namespace *ns);
extern void free_pid(struct pid *pid);
extern void disable_pid_allocation(struct pid_namespace *ns);
# 134 "include/linux/pid.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid_namespace *ns_of_pid(struct pid *pid)
{
 struct pid_namespace *ns = ((void *)0);
 if (pid)
  ns = pid->numbers[pid->level].ns;
 return ns;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_child_reaper(struct pid *pid)
{
 return pid->numbers[pid->level].nr == 1;
}
# 164 "include/linux/pid.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t pid_nr(struct pid *pid)
{
 pid_t nr = 0;
 if (pid)
  nr = pid->numbers[0].nr;
 return nr;
}

pid_t pid_nr_ns(struct pid *pid, struct pid_namespace *ns);
pid_t pid_vnr(struct pid *pid);
# 41 "include/linux/sched.h" 2
# 1 "include/linux/percpu.h" 1



# 1 "include/linux/mmdebug.h" 1





struct page;
struct vm_area_struct;
struct mm_struct;

extern void dump_page(struct page *page, const char *reason);
extern void dump_page_badflags(struct page *page, const char *reason,
          unsigned long badflags);
void dump_vma(const struct vm_area_struct *vma);
void dump_mm(const struct mm_struct *mm);
# 5 "include/linux/percpu.h" 2




# 1 "include/linux/pfn.h" 1
# 10 "include/linux/percpu.h" 2
# 57 "include/linux/percpu.h"
extern void *pcpu_base_addr;
extern const unsigned long *pcpu_unit_offsets;

struct pcpu_group_info {
 int nr_units;
 unsigned long base_offset;
 unsigned int *cpu_map;

};

struct pcpu_alloc_info {
 size_t static_size;
 size_t reserved_size;
 size_t dyn_size;
 size_t unit_size;
 size_t atom_size;
 size_t alloc_size;
 size_t __ai_size;
 int nr_groups;
 struct pcpu_group_info groups[];
};

enum pcpu_fc {
 PCPU_FC_AUTO,
 PCPU_FC_EMBED,
 PCPU_FC_PAGE,

 PCPU_FC_NR,
};
extern const char * const pcpu_fc_names[PCPU_FC_NR];

extern enum pcpu_fc pcpu_chosen_fc;

typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int cpu, size_t size,
         size_t align);
typedef void (*pcpu_fc_free_fn_t)(void *ptr, size_t size);
typedef void (*pcpu_fc_populate_pte_fn_t)(unsigned long addr);
typedef int (pcpu_fc_cpu_distance_fn_t)(unsigned int from, unsigned int to);

extern struct pcpu_alloc_info * __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) pcpu_alloc_alloc_info(int nr_groups,
            int nr_units);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) pcpu_free_alloc_info(struct pcpu_alloc_info *ai);

extern int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
      void *base_addr);


extern int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size,
    size_t atom_size,
    pcpu_fc_cpu_distance_fn_t cpu_distance_fn,
    pcpu_fc_alloc_fn_t alloc_fn,
    pcpu_fc_free_fn_t free_fn);



extern int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) pcpu_page_first_chunk(size_t reserved_size,
    pcpu_fc_alloc_fn_t alloc_fn,
    pcpu_fc_free_fn_t free_fn,
    pcpu_fc_populate_pte_fn_t populate_pte_fn);


extern void *__alloc_reserved_percpu(size_t size, size_t align);
extern bool is_kernel_percpu_address(unsigned long addr);




extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) percpu_init_late(void);

extern void *__alloc_percpu_gfp(size_t size, size_t align, gfp_t gfp);
extern void *__alloc_percpu(size_t size, size_t align);
extern void free_percpu(void *__pdata);
extern phys_addr_t per_cpu_ptr_to_phys(void *addr);
# 139 "include/linux/percpu.h"
extern __attribute__((section(".data..percpu" ""))) __typeof__(printk_func_t) printk_func;
# 42 "include/linux/sched.h" 2
# 1 "include/linux/topology.h" 1
# 32 "include/linux/topology.h"
# 1 "include/linux/mmzone.h" 1
# 17 "include/linux/mmzone.h"
# 1 "include/linux/pageblock-flags.h" 1
# 29 "include/linux/pageblock-flags.h"
enum pageblock_bits {
 PB_migrate,
 PB_migrate_end = PB_migrate + 3 - 1,

 PB_migrate_skip,





 NR_PAGEBLOCK_BITS
};
# 66 "include/linux/pageblock-flags.h"
struct page;

unsigned long get_pfnblock_flags_mask(struct page *page,
    unsigned long pfn,
    unsigned long end_bitidx,
    unsigned long mask);

void set_pfnblock_flags_mask(struct page *page,
    unsigned long flags,
    unsigned long pfn,
    unsigned long end_bitidx,
    unsigned long mask);
# 18 "include/linux/mmzone.h" 2
# 38 "include/linux/mmzone.h"
enum {
 MIGRATE_UNMOVABLE,
 MIGRATE_RECLAIMABLE,
 MIGRATE_MOVABLE,
 MIGRATE_PCPTYPES,
 MIGRATE_RESERVE = MIGRATE_PCPTYPES,
# 63 "include/linux/mmzone.h"
 MIGRATE_TYPES
};
# 76 "include/linux/mmzone.h"
extern int page_group_by_mobility_disabled;
# 85 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_pfnblock_migratetype(struct page *page, unsigned long pfn)
{
 do { bool __cond = !(!(PB_migrate_end - PB_migrate != 2)); extern void __compiletime_assert_87(void) __attribute__((error("BUILD_BUG_ON failed: " "PB_migrate_end - PB_migrate != 2"))); if (__cond) __compiletime_assert_87(); do { } while (0); } while (0);
 return get_pfnblock_flags_mask(page, pfn, PB_migrate_end,
     ((1UL << (PB_migrate_end - PB_migrate + 1)) - 1));
}

struct free_area {
 struct list_head free_list[MIGRATE_TYPES];
 unsigned long nr_free;
};

struct pglist_data;
# 106 "include/linux/mmzone.h"
struct zone_padding {
 char x[0];
} __attribute__((__aligned__(1 << (5))));





enum zone_stat_item {

 NR_FREE_PAGES,
 NR_ALLOC_BATCH,
 NR_LRU_BASE,
 NR_INACTIVE_ANON = NR_LRU_BASE,
 NR_ACTIVE_ANON,
 NR_INACTIVE_FILE,
 NR_ACTIVE_FILE,
 NR_UNEVICTABLE,
 NR_MLOCK,
 NR_ANON_PAGES,
 NR_FILE_MAPPED,

 NR_FILE_PAGES,
 NR_FILE_DIRTY,
 NR_WRITEBACK,
 NR_SLAB_RECLAIMABLE,
 NR_SLAB_UNRECLAIMABLE,
 NR_PAGETABLE,
 NR_KERNEL_STACK,

 NR_UNSTABLE_NFS,
 NR_BOUNCE,
 NR_VMSCAN_WRITE,
 NR_VMSCAN_IMMEDIATE,
 NR_WRITEBACK_TEMP,
 NR_ISOLATED_ANON,
 NR_ISOLATED_FILE,
 NR_SHMEM,
 NR_DIRTIED,
 NR_WRITTEN,
 NR_PAGES_SCANNED,

 NUMA_HIT,
 NUMA_MISS,
 NUMA_FOREIGN,
 NUMA_INTERLEAVE_HIT,
 NUMA_LOCAL,
 NUMA_OTHER,

 WORKINGSET_REFAULT,
 WORKINGSET_ACTIVATE,
 WORKINGSET_NODERECLAIM,
 NR_ANON_TRANSPARENT_HUGEPAGES,
 NR_FREE_CMA_PAGES,
 NR_VM_ZONE_STAT_ITEMS };
# 175 "include/linux/mmzone.h"
enum lru_list {
 LRU_INACTIVE_ANON = 0,
 LRU_ACTIVE_ANON = 0 + 1,
 LRU_INACTIVE_FILE = 0 + 2,
 LRU_ACTIVE_FILE = 0 + 2 + 1,
 LRU_UNEVICTABLE,
 NR_LRU_LISTS
};





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_file_lru(enum lru_list lru)
{
 return (lru == LRU_INACTIVE_FILE || lru == LRU_ACTIVE_FILE);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_active_lru(enum lru_list lru)
{
 return (lru == LRU_ACTIVE_ANON || lru == LRU_ACTIVE_FILE);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_unevictable_lru(enum lru_list lru)
{
 return (lru == LRU_UNEVICTABLE);
}

struct zone_reclaim_stat {
# 212 "include/linux/mmzone.h"
 unsigned long recent_rotated[2];
 unsigned long recent_scanned[2];
};

struct lruvec {
 struct list_head lists[NR_LRU_LISTS];
 struct zone_reclaim_stat reclaim_stat;



};
# 239 "include/linux/mmzone.h"
typedef unsigned isolate_mode_t;

enum zone_watermarks {
 WMARK_MIN,
 WMARK_LOW,
 WMARK_HIGH,
 NR_WMARK
};





struct per_cpu_pages {
 int count;
 int high;
 int batch;


 struct list_head lists[MIGRATE_PCPTYPES];
};

struct per_cpu_pageset {
 struct per_cpu_pages pcp;

 s8 expire;


 s8 stat_threshold;
 s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS];

};



enum zone_type {
# 309 "include/linux/mmzone.h"
 ZONE_NORMAL,
# 321 "include/linux/mmzone.h"
 ZONE_MOVABLE,
 __MAX_NR_ZONES
};



struct zone {



 unsigned long watermark[NR_WMARK];
# 341 "include/linux/mmzone.h"
 long lowmem_reserve[2];


 int node;






 unsigned int inactive_ratio;

 struct pglist_data *zone_pgdat;
 struct per_cpu_pageset *pageset;





 unsigned long dirty_balance_reserve;
# 374 "include/linux/mmzone.h"
 unsigned long min_unmapped_pages;
 unsigned long min_slab_pages;



 unsigned long zone_start_pfn;
# 422 "include/linux/mmzone.h"
 unsigned long managed_pages;
 unsigned long spanned_pages;
 unsigned long present_pages;

 const char *name;





 int nr_migrate_reserve_block;
# 472 "include/linux/mmzone.h"
 wait_queue_head_t *wait_table;
 unsigned long wait_table_hash_nr_entries;
 unsigned long wait_table_bits;

 struct zone_padding _pad1_;


 spinlock_t lock;


 struct free_area free_area[11];


 unsigned long flags;

 struct zone_padding _pad2_;




 spinlock_t lru_lock;
 struct lruvec lruvec;


 atomic_long_t inactive_age;






 unsigned long percpu_drift_mark;



 unsigned long compact_cached_free_pfn;

 unsigned long compact_cached_migrate_pfn[2];
# 518 "include/linux/mmzone.h"
 unsigned int compact_considered;
 unsigned int compact_defer_shift;
 int compact_order_failed;




 bool compact_blockskip_flush;


 struct zone_padding _pad3_;

 atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
} __attribute__((__aligned__(1 << (5))));

enum zone_flags {
 ZONE_RECLAIM_LOCKED,
 ZONE_OOM_LOCKED,
 ZONE_CONGESTED,


 ZONE_DIRTY,



 ZONE_WRITEBACK,


 ZONE_FAIR_DEPLETED,
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long zone_end_pfn(const struct zone *zone)
{
 return zone->zone_start_pfn + zone->spanned_pages;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zone_spans_pfn(const struct zone *zone, unsigned long pfn)
{
 return zone->zone_start_pfn <= pfn && pfn < zone_end_pfn(zone);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zone_is_initialized(struct zone *zone)
{
 return !!zone->wait_table;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zone_is_empty(struct zone *zone)
{
 return zone->spanned_pages == 0;
}
# 650 "include/linux/mmzone.h"
struct zonelist_cache {
 unsigned short z_to_n[((1 << 4) * 2)];
 unsigned long fullzones[(((((1 << 4) * 2)) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))];
 unsigned long last_full_zap;
};
# 664 "include/linux/mmzone.h"
struct zoneref {
 struct zone *zone;
 int zone_idx;
};
# 686 "include/linux/mmzone.h"
struct zonelist {
 struct zonelist_cache *zlcache_ptr;
 struct zoneref _zonerefs[((1 << 4) * 2) + 1];

 struct zonelist_cache zlcache;

};


struct node_active_region {
 unsigned long start_pfn;
 unsigned long end_pfn;
 int nid;
};




extern struct page *mem_map;
# 718 "include/linux/mmzone.h"
struct bootmem_data;
typedef struct pglist_data {
 struct zone node_zones[2];
 struct zonelist node_zonelists[2];
 int nr_zones;
# 745 "include/linux/mmzone.h"
 unsigned long node_start_pfn;
 unsigned long node_present_pages;
 unsigned long node_spanned_pages;

 int node_id;
 wait_queue_head_t kswapd_wait;
 wait_queue_head_t pfmemalloc_wait;
 struct task_struct *kswapd;

 int kswapd_max_order;
 enum zone_type classzone_idx;
# 766 "include/linux/mmzone.h"
} pg_data_t;
# 780 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pgdat_end_pfn(pg_data_t *pgdat)
{
 return pgdat->node_start_pfn + pgdat->node_spanned_pages;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pgdat_is_empty(pg_data_t *pgdat)
{
 return !pgdat->node_start_pfn && !pgdat->node_spanned_pages;
}

# 1 "include/linux/memory_hotplug.h" 1



# 1 "include/linux/mmzone.h" 1
# 5 "include/linux/memory_hotplug.h" 2

# 1 "include/linux/notifier.h" 1
# 13 "include/linux/notifier.h"
# 1 "include/linux/mutex.h" 1
# 50 "include/linux/mutex.h"
struct mutex {

 atomic_t count;
 spinlock_t wait_lock;
 struct list_head wait_list;

 struct task_struct *owner;


 struct optimistic_spin_queue osq;







};





struct mutex_waiter {
 struct list_head list;
 struct task_struct *task;



};
# 99 "include/linux/mutex.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mutex_destroy(struct mutex *lock) {}
# 119 "include/linux/mutex.h"
extern void __mutex_init(struct mutex *lock, const char *name,
    struct lock_class_key *key);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mutex_is_locked(struct mutex *lock)
{
 return (*({ __attribute__((unused)) typeof((&lock->count)->counter) __var = ( typeof((&lock->count)->counter)) 0; (volatile typeof((&lock->count)->counter) *)&((&lock->count)->counter); })) != 1;
}
# 157 "include/linux/mutex.h"
extern void mutex_lock(struct mutex *lock);
extern int __attribute__((warn_unused_result)) mutex_lock_interruptible(struct mutex *lock);
extern int __attribute__((warn_unused_result)) mutex_lock_killable(struct mutex *lock);
# 173 "include/linux/mutex.h"
extern int mutex_trylock(struct mutex *lock);
extern void mutex_unlock(struct mutex *lock);

extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
# 14 "include/linux/notifier.h" 2

# 1 "include/linux/srcu.h" 1
# 34 "include/linux/srcu.h"
# 1 "include/linux/workqueue.h" 1







# 1 "include/linux/timer.h" 1




# 1 "include/linux/ktime.h" 1
# 37 "include/linux/ktime.h"
union ktime {
 s64 tv64;
};

typedef union ktime ktime_t;
# 50 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_set(const s64 secs, const unsigned long nsecs)
{
 if (__builtin_expect(!!(secs >= (((s64)~((u64)1 << 63)) / 1000000000L)), 0))
  return (ktime_t){ .tv64 = ((s64)~((u64)1 << 63)) };

 return (ktime_t) { .tv64 = secs * 1000000000L + (s64)nsecs };
}
# 81 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t timespec_to_ktime(struct timespec ts)
{
 return ktime_set(ts.tv_sec, ts.tv_nsec);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t timespec64_to_ktime(struct timespec ts)
{
 return ktime_set(ts.tv_sec, ts.tv_nsec);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t timeval_to_ktime(struct timeval tv)
{
 return ktime_set(tv.tv_sec, tv.tv_usec * 1000L);
}
# 120 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
{
 return cmp1.tv64 == cmp2.tv64;
}
# 135 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ktime_compare(const ktime_t cmp1, const ktime_t cmp2)
{
 if (cmp1.tv64 < cmp2.tv64)
  return -1;
 if (cmp1.tv64 > cmp2.tv64)
  return 1;
 return 0;
}
# 151 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ktime_after(const ktime_t cmp1, const ktime_t cmp2)
{
 return ktime_compare(cmp1, cmp2) > 0;
}
# 163 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ktime_before(const ktime_t cmp1, const ktime_t cmp2)
{
 return ktime_compare(cmp1, cmp2) < 0;
}
# 184 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 ktime_to_us(const ktime_t kt)
{
 return (u64)((kt).tv64 / (1000L));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 ktime_to_ms(const ktime_t kt)
{
 return (u64)((kt).tv64 / (1000000L));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 ktime_us_delta(const ktime_t later, const ktime_t earlier)
{
       return ktime_to_us(({ (ktime_t){ .tv64 = (later).tv64 - (earlier).tv64 }; }));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 ktime_ms_delta(const ktime_t later, const ktime_t earlier)
{
 return ktime_to_ms(({ (ktime_t){ .tv64 = (later).tv64 - (earlier).tv64 }; }));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_add_us(const ktime_t kt, const u64 usec)
{
 return ({ (ktime_t){ .tv64 = (kt).tv64 + (usec * 1000L) }; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_add_ms(const ktime_t kt, const u64 msec)
{
 return ({ (ktime_t){ .tv64 = (kt).tv64 + (msec * 1000000L) }; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_sub_us(const ktime_t kt, const u64 usec)
{
 return ({ (ktime_t){ .tv64 = (kt).tv64 - (usec * 1000L) }; });
}

extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
# 229 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((warn_unused_result)) bool ktime_to_timespec_cond(const ktime_t kt,
             struct timespec *ts)
{
 if (kt.tv64) {
  *ts = ns_to_timespec((kt).tv64);
  return true;
 } else {
  return false;
 }
}
# 248 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((warn_unused_result)) bool ktime_to_timespec64_cond(const ktime_t kt,
             struct timespec *ts)
{
 if (kt.tv64) {
  *ts = ns_to_timespec((kt).tv64);
  return true;
 } else {
  return false;
 }
}
# 268 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ns_to_ktime(u64 ns)
{
 static const ktime_t ktime_zero = { .tv64 = 0 };

 return ({ (ktime_t){ .tv64 = (ktime_zero).tv64 + (ns) }; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ms_to_ktime(u64 ms)
{
 static const ktime_t ktime_zero = { .tv64 = 0 };

 return ktime_add_ms(ktime_zero, ms);
}

# 1 "include/linux/timekeeping.h" 1





void timekeeping_init(void);
extern int timekeeping_suspended;




extern void do_gettimeofday(struct timeval *tv);
extern int do_settimeofday64(const struct timespec *ts);
extern int do_sys_settimeofday(const struct timespec *tv,
          const struct timezone *tz);




unsigned long get_seconds(void);
struct timespec current_kernel_time(void);

struct timespec __current_kernel_time(void);




struct timespec get_monotonic_coarse64(void);
extern void getrawmonotonic64(struct timespec *ts);
extern void ktime_get_ts64(struct timespec *ts);
extern time64_t ktime_get_seconds(void);
extern time64_t ktime_get_real_seconds(void);

extern int __getnstimeofday64(struct timespec *tv);
extern void getnstimeofday64(struct timespec *tv);
extern void getboottime64(struct timespec *ts);





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int do_settimeofday(const struct timespec *ts)
{
 return do_settimeofday64(ts);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __getnstimeofday(struct timespec *ts)
{
 return __getnstimeofday64(ts);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void getnstimeofday(struct timespec *ts)
{
 getnstimeofday64(ts);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ktime_get_ts(struct timespec *ts)
{
 ktime_get_ts64(ts);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ktime_get_real_ts(struct timespec *ts)
{
 getnstimeofday64(ts);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void getrawmonotonic(struct timespec *ts)
{
 getrawmonotonic64(ts);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec get_monotonic_coarse(void)
{
 return get_monotonic_coarse64();
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void getboottime(struct timespec *ts)
{
 return getboottime64(ts);
}
# 155 "include/linux/timekeeping.h"
enum tk_offsets {
 TK_OFFS_REAL,
 TK_OFFS_BOOT,
 TK_OFFS_TAI,
 TK_OFFS_MAX,
};

extern ktime_t ktime_get(void);
extern ktime_t ktime_get_with_offset(enum tk_offsets offs);
extern ktime_t ktime_mono_to_any(ktime_t tmono, enum tk_offsets offs);
extern ktime_t ktime_get_raw(void);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_get_real(void)
{
 return ktime_get_with_offset(TK_OFFS_REAL);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_get_boottime(void)
{
 return ktime_get_with_offset(TK_OFFS_BOOT);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_get_clocktai(void)
{
 return ktime_get_with_offset(TK_OFFS_TAI);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_mono_to_real(ktime_t mono)
{
 return ktime_mono_to_any(mono, TK_OFFS_REAL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 ktime_get_ns(void)
{
 return ((ktime_get()).tv64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 ktime_get_real_ns(void)
{
 return ((ktime_get_real()).tv64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 ktime_get_boot_ns(void)
{
 return ((ktime_get_boottime()).tv64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 ktime_get_raw_ns(void)
{
 return ((ktime_get_raw()).tv64);
}

extern u64 ktime_get_mono_fast_ns(void);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_monotonic_boottime(struct timespec *ts)
{
 *ts = ns_to_timespec((ktime_get_boottime()).tv64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_monotonic_boottime64(struct timespec *ts)
{
 *ts = ns_to_timespec((ktime_get_boottime()).tv64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timekeeping_clocktai(struct timespec *ts)
{
 *ts = ns_to_timespec((ktime_get_clocktai()).tv64);
}




extern void timekeeping_inject_sleeptime64(struct timespec *delta);




extern void getnstime_raw_and_real(struct timespec *ts_raw,
       struct timespec *ts_real);




extern bool persistent_clock_exist;
extern int persistent_clock_is_local;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool has_persistent_clock(void)
{
 return persistent_clock_exist;
}

extern void read_persistent_clock(struct timespec *ts);
extern void read_boot_clock(struct timespec *ts);
extern int update_persistent_clock(struct timespec now);
# 283 "include/linux/ktime.h" 2
# 6 "include/linux/timer.h" 2




struct tvec_base;

struct timer_list {




 struct list_head entry;
 unsigned long expires;
 struct tvec_base *base;

 void (*function)(unsigned long);
 unsigned long data;

 int slack;
# 34 "include/linux/timer.h"
};

extern struct tvec_base boot_tvec_bases;
# 94 "include/linux/timer.h"
void init_timer_key(struct timer_list *timer, unsigned int flags,
      const char *name, struct lock_class_key *key);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_timer_on_stack(struct timer_list *timer) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_timer_on_stack_key(struct timer_list *timer,
        unsigned int flags, const char *name,
        struct lock_class_key *key)
{
 init_timer_key(timer, flags, name, key);
}
# 169 "include/linux/timer.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timer_pending(const struct timer_list * timer)
{
 return timer->entry.next != ((void *)0);
}

extern void add_timer_on(struct timer_list *timer, int cpu);
extern int del_timer(struct timer_list * timer);
extern int mod_timer(struct timer_list *timer, unsigned long expires);
extern int mod_timer_pending(struct timer_list *timer, unsigned long expires);
extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires);

extern void set_timer_slack(struct timer_list *time, int slack_hz);
# 195 "include/linux/timer.h"
extern unsigned long get_next_timer_interrupt(unsigned long now);
# 227 "include/linux/timer.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_timer_stats(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timer_stats_timer_set_start_info(struct timer_list *timer)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timer_stats_timer_clear_start_info(struct timer_list *timer)
{
}


extern void add_timer(struct timer_list *timer);

extern int try_to_del_timer_sync(struct timer_list *timer);


  extern int del_timer_sync(struct timer_list *timer);






extern void init_timers(void);
extern void run_local_timers(void);
struct hrtimer;
extern enum hrtimer_restart it_real_fn(struct hrtimer *);

unsigned long __round_jiffies(unsigned long j, int cpu);
unsigned long __round_jiffies_relative(unsigned long j, int cpu);
unsigned long round_jiffies(unsigned long j);
unsigned long round_jiffies_relative(unsigned long j);

unsigned long __round_jiffies_up(unsigned long j, int cpu);
unsigned long __round_jiffies_up_relative(unsigned long j, int cpu);
unsigned long round_jiffies_up(unsigned long j);
unsigned long round_jiffies_up_relative(unsigned long j);
# 9 "include/linux/workqueue.h" 2







struct workqueue_struct;

struct work_struct;
typedef void (*work_func_t)(struct work_struct *work);
void delayed_work_timer_fn(unsigned long __data);







enum {
 WORK_STRUCT_PENDING_BIT = 0,
 WORK_STRUCT_DELAYED_BIT = 1,
 WORK_STRUCT_PWQ_BIT = 2,
 WORK_STRUCT_LINKED_BIT = 3,




 WORK_STRUCT_COLOR_SHIFT = 4,


 WORK_STRUCT_COLOR_BITS = 4,

 WORK_STRUCT_PENDING = 1 << WORK_STRUCT_PENDING_BIT,
 WORK_STRUCT_DELAYED = 1 << WORK_STRUCT_DELAYED_BIT,
 WORK_STRUCT_PWQ = 1 << WORK_STRUCT_PWQ_BIT,
 WORK_STRUCT_LINKED = 1 << WORK_STRUCT_LINKED_BIT,



 WORK_STRUCT_STATIC = 0,






 WORK_NR_COLORS = (1 << WORK_STRUCT_COLOR_BITS) - 1,
 WORK_NO_COLOR = WORK_NR_COLORS,


 WORK_CPU_UNBOUND = 128,






 WORK_STRUCT_FLAG_BITS = WORK_STRUCT_COLOR_SHIFT +
      WORK_STRUCT_COLOR_BITS,


 WORK_OFFQ_FLAG_BASE = WORK_STRUCT_COLOR_SHIFT,

 WORK_OFFQ_CANCELING = (1 << WORK_OFFQ_FLAG_BASE),






 WORK_OFFQ_FLAG_BITS = 1,
 WORK_OFFQ_POOL_SHIFT = WORK_OFFQ_FLAG_BASE + WORK_OFFQ_FLAG_BITS,
 WORK_OFFQ_LEFT = 64 - WORK_OFFQ_POOL_SHIFT,
 WORK_OFFQ_POOL_BITS = WORK_OFFQ_LEFT <= 31 ? WORK_OFFQ_LEFT : 31,
 WORK_OFFQ_POOL_NONE = (1LU << WORK_OFFQ_POOL_BITS) - 1,


 WORK_STRUCT_FLAG_MASK = (1UL << WORK_STRUCT_FLAG_BITS) - 1,
 WORK_STRUCT_WQ_DATA_MASK = ~WORK_STRUCT_FLAG_MASK,
 WORK_STRUCT_NO_POOL = (unsigned long)WORK_OFFQ_POOL_NONE << WORK_OFFQ_POOL_SHIFT,


 WORK_BUSY_PENDING = 1 << 0,
 WORK_BUSY_RUNNING = 1 << 1,


 WORKER_DESC_LEN = 24,
};

struct work_struct {
 atomic_long_t data;
 struct list_head entry;
 work_func_t func;



};





struct delayed_work {
 struct work_struct work;
 struct timer_list timer;


 struct workqueue_struct *wq;
 int cpu;
};
# 129 "include/linux/workqueue.h"
struct workqueue_attrs {
 int nice;
 cpumask_var_t cpumask;
 bool no_numa;
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct delayed_work *to_delayed_work(struct work_struct *work)
{
 return ({ const typeof( ((struct delayed_work *)0)->work ) *__mptr = (work); (struct delayed_work *)( (char *)__mptr - __builtin_offsetof(struct delayed_work,work) );});
}

struct execute_work {
 struct work_struct work;
};
# 188 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __init_work(struct work_struct *work, int onstack) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_work_on_stack(struct work_struct *work) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_delayed_work_on_stack(struct delayed_work *work) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int work_static(struct work_struct *work) { return 0; }
# 276 "include/linux/workqueue.h"
enum {
 WQ_UNBOUND = 1 << 1,
 WQ_FREEZABLE = 1 << 2,
 WQ_MEM_RECLAIM = 1 << 3,
 WQ_HIGHPRI = 1 << 4,
 WQ_CPU_INTENSIVE = 1 << 5,
 WQ_SYSFS = 1 << 6,
# 309 "include/linux/workqueue.h"
 WQ_POWER_EFFICIENT = 1 << 7,

 __WQ_DRAINING = 1 << 16,
 __WQ_ORDERED = 1 << 17,

 WQ_MAX_ACTIVE = 512,
 WQ_MAX_UNBOUND_PER_CPU = 4,
 WQ_DFL_ACTIVE = WQ_MAX_ACTIVE / 2,
};
# 351 "include/linux/workqueue.h"
extern struct workqueue_struct *system_wq;
extern struct workqueue_struct *system_highpri_wq;
extern struct workqueue_struct *system_long_wq;
extern struct workqueue_struct *system_unbound_wq;
extern struct workqueue_struct *system_freezable_wq;
extern struct workqueue_struct *system_power_efficient_wq;
extern struct workqueue_struct *system_freezable_power_efficient_wq;

extern struct workqueue_struct *
__alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,
 struct lock_class_key *key, const char *lock_name, ...) __attribute__((format(printf, 1, 6)));
# 420 "include/linux/workqueue.h"
extern void destroy_workqueue(struct workqueue_struct *wq);

struct workqueue_attrs *alloc_workqueue_attrs(gfp_t gfp_mask);
void free_workqueue_attrs(struct workqueue_attrs *attrs);
int apply_workqueue_attrs(struct workqueue_struct *wq,
     const struct workqueue_attrs *attrs);

extern bool queue_work_on(int cpu, struct workqueue_struct *wq,
   struct work_struct *work);
extern bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
   struct delayed_work *work, unsigned long delay);
extern bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq,
   struct delayed_work *dwork, unsigned long delay);

extern void flush_workqueue(struct workqueue_struct *wq);
extern void drain_workqueue(struct workqueue_struct *wq);
extern void flush_scheduled_work(void);

extern int schedule_on_each_cpu(work_func_t func);

int execute_in_process_context(work_func_t fn, struct execute_work *);

extern bool flush_work(struct work_struct *work);
extern bool cancel_work_sync(struct work_struct *work);

extern bool flush_delayed_work(struct delayed_work *dwork);
extern bool cancel_delayed_work(struct delayed_work *dwork);
extern bool cancel_delayed_work_sync(struct delayed_work *dwork);

extern void workqueue_set_max_active(struct workqueue_struct *wq,
         int max_active);
extern bool current_is_workqueue_rescuer(void);
extern bool workqueue_congested(int cpu, struct workqueue_struct *wq);
extern unsigned int work_busy(struct work_struct *work);
extern __attribute__((format(printf, 1, 2))) void set_worker_desc(const char *fmt, ...);
extern void print_worker_info(const char *log_lvl, struct task_struct *task);
# 467 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool queue_work(struct workqueue_struct *wq,
         struct work_struct *work)
{
 return queue_work_on(WORK_CPU_UNBOUND, wq, work);
}
# 481 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool queue_delayed_work(struct workqueue_struct *wq,
          struct delayed_work *dwork,
          unsigned long delay)
{
 return queue_delayed_work_on(WORK_CPU_UNBOUND, wq, dwork, delay);
}
# 496 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool mod_delayed_work(struct workqueue_struct *wq,
        struct delayed_work *dwork,
        unsigned long delay)
{
 return mod_delayed_work_on(WORK_CPU_UNBOUND, wq, dwork, delay);
}
# 510 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool schedule_work_on(int cpu, struct work_struct *work)
{
 return queue_work_on(cpu, system_wq, work);
}
# 526 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool schedule_work(struct work_struct *work)
{
 return queue_work(system_wq, work);
}
# 540 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool schedule_delayed_work_on(int cpu, struct delayed_work *dwork,
         unsigned long delay)
{
 return queue_delayed_work_on(cpu, system_wq, dwork, delay);
}
# 554 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool schedule_delayed_work(struct delayed_work *dwork,
      unsigned long delay)
{
 return queue_delayed_work(system_wq, dwork, delay);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool keventd_up(void)
{
 return system_wq != ((void *)0);
}







long work_on_cpu(int cpu, long (*fn)(void *), void *arg);
# 584 "include/linux/workqueue.h"
int workqueue_sysfs_register(struct workqueue_struct *wq);
# 35 "include/linux/srcu.h" 2

struct srcu_struct_array {
 unsigned long c[2];
 unsigned long seq[2];
};

struct rcu_batch {
 struct callback_head *head, **tail;
};



struct srcu_struct {
 unsigned long completed;
 struct srcu_struct_array *per_cpu_ref;
 spinlock_t queue_lock;
 bool running;

 struct rcu_batch batch_queue;

 struct rcu_batch batch_check0;

 struct rcu_batch batch_check1;
 struct rcu_batch batch_done;
 struct delayed_work work;



};
# 80 "include/linux/srcu.h"
int init_srcu_struct(struct srcu_struct *sp);




void process_srcu(struct work_struct *work);
# 128 "include/linux/srcu.h"
void call_srcu(struct srcu_struct *sp, struct callback_head *head,
  void (*func)(struct callback_head *head));

void cleanup_srcu_struct(struct srcu_struct *sp);
int __srcu_read_lock(struct srcu_struct *sp) ;
void __srcu_read_unlock(struct srcu_struct *sp, int idx) ;
void synchronize_srcu(struct srcu_struct *sp);
void synchronize_srcu_expedited(struct srcu_struct *sp);
unsigned long srcu_batches_completed(struct srcu_struct *sp);
void srcu_barrier(struct srcu_struct *sp);
# 165 "include/linux/srcu.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int srcu_read_lock_held(struct srcu_struct *sp)
{
 return 1;
}
# 216 "include/linux/srcu.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int srcu_read_lock(struct srcu_struct *sp)
{
 int retval = __srcu_read_lock(sp);

 do { } while (0);
 return retval;
}
# 231 "include/linux/srcu.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void srcu_read_unlock(struct srcu_struct *sp, int idx)

{
 do { } while (0);
 __srcu_read_unlock(sp, idx);
}
# 247 "include/linux/srcu.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void smp_mb__after_srcu_read_unlock(void)
{

}
# 16 "include/linux/notifier.h" 2
# 50 "include/linux/notifier.h"
typedef int (*notifier_fn_t)(struct notifier_block *nb,
   unsigned long action, void *data);

struct notifier_block {
 notifier_fn_t notifier_call;
 struct notifier_block *next;
 int priority;
};

struct atomic_notifier_head {
 spinlock_t lock;
 struct notifier_block *head;
};

struct blocking_notifier_head {
 struct rw_semaphore rwsem;
 struct notifier_block *head;
};

struct raw_notifier_head {
 struct notifier_block *head;
};

struct srcu_notifier_head {
 struct mutex mutex;
 struct srcu_struct srcu;
 struct notifier_block *head;
};
# 92 "include/linux/notifier.h"
extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
# 118 "include/linux/notifier.h"
extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh,
  struct notifier_block *nb);
extern int blocking_notifier_chain_register(struct blocking_notifier_head *nh,
  struct notifier_block *nb);
extern int raw_notifier_chain_register(struct raw_notifier_head *nh,
  struct notifier_block *nb);
extern int srcu_notifier_chain_register(struct srcu_notifier_head *nh,
  struct notifier_block *nb);

extern int blocking_notifier_chain_cond_register(
  struct blocking_notifier_head *nh,
  struct notifier_block *nb);

extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh,
  struct notifier_block *nb);
extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh,
  struct notifier_block *nb);
extern int raw_notifier_chain_unregister(struct raw_notifier_head *nh,
  struct notifier_block *nb);
extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *nh,
  struct notifier_block *nb);

extern int atomic_notifier_call_chain(struct atomic_notifier_head *nh,
  unsigned long val, void *v);
extern int __atomic_notifier_call_chain(struct atomic_notifier_head *nh,
 unsigned long val, void *v, int nr_to_call, int *nr_calls);
extern int blocking_notifier_call_chain(struct blocking_notifier_head *nh,
  unsigned long val, void *v);
extern int __blocking_notifier_call_chain(struct blocking_notifier_head *nh,
 unsigned long val, void *v, int nr_to_call, int *nr_calls);
extern int raw_notifier_call_chain(struct raw_notifier_head *nh,
  unsigned long val, void *v);
extern int __raw_notifier_call_chain(struct raw_notifier_head *nh,
 unsigned long val, void *v, int nr_to_call, int *nr_calls);
extern int srcu_notifier_call_chain(struct srcu_notifier_head *nh,
  unsigned long val, void *v);
extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
 unsigned long val, void *v, int nr_to_call, int *nr_calls);
# 168 "include/linux/notifier.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int notifier_from_errno(int err)
{
 if (err)
  return 0x8000 | (0x0001 - err);

 return 0x0001;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int notifier_to_errno(int ret)
{
 ret &= ~0x8000;
 return ret > 0x0001 ? 0x0001 - ret : 0;
}
# 212 "include/linux/notifier.h"
extern struct blocking_notifier_head reboot_notifier_list;
# 7 "include/linux/memory_hotplug.h" 2


struct page;
struct zone;
struct pglist_data;
struct mem_section;
struct memory_block;
# 199 "include/linux/memory_hotplug.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgdat_resize_lock(struct pglist_data *p, unsigned long *f) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgdat_resize_unlock(struct pglist_data *p, unsigned long *f) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgdat_resize_init(struct pglist_data *pgdat) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned zone_span_seqbegin(struct zone *zone)
{
 return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zone_span_seqretry(struct zone *zone, unsigned iv)
{
 return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void zone_span_writelock(struct zone *zone) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void zone_span_writeunlock(struct zone *zone) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void zone_seqlock_init(struct zone *zone) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mhp_notimplemented(const char *func)
{
 printk("\001" "4" "%s() called, with CONFIG_MEMORY_HOTPLUG disabled\n", func);
 dump_stack();
 return -90;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void register_page_bootmem_info_node(struct pglist_data *pgdat)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int try_online_node(int nid)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_online_mems(void) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_online_mems(void) {}
# 244 "include/linux/memory_hotplug.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_mem_section_removable(unsigned long pfn,
     unsigned long nr_pages)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void try_offline_node(int nid) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int offline_pages(unsigned long start_pfn, unsigned long nr_pages)
{
 return -22;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void remove_memory(int nid, u64 start, u64 size) {}


extern int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn,
  void *arg, int (*func)(struct memory_block *, void *));
extern int add_memory(int nid, u64 start, u64 size);
extern int zone_for_memory(int nid, u64 start, u64 size, int zone_default);
extern int arch_add_memory(int nid, u64 start, u64 size);
extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages);
extern bool is_memblock_offlined(struct memory_block *mem);
extern void remove_memory(int nid, u64 start, u64 size);
extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn);
extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms);
extern struct page *sparse_decode_mem_map(unsigned long coded_mem_map,
       unsigned long pnum);
# 791 "include/linux/mmzone.h" 2

extern struct mutex zonelists_mutex;
void build_all_zonelists(pg_data_t *pgdat, struct zone *zone);
void wakeup_kswapd(struct zone *zone, int order, enum zone_type classzone_idx);
bool zone_watermark_ok(struct zone *z, unsigned int order,
  unsigned long mark, int classzone_idx, int alloc_flags);
bool zone_watermark_ok_safe(struct zone *z, unsigned int order,
  unsigned long mark, int classzone_idx, int alloc_flags);
enum memmap_context {
 MEMMAP_EARLY,
 MEMMAP_HOTPLUG,
};
extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
         unsigned long size,
         enum memmap_context context);

extern void lruvec_init(struct lruvec *lruvec);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zone *lruvec_zone(struct lruvec *lruvec)
{



 return ({ const typeof( ((struct zone *)0)->lruvec ) *__mptr = (lruvec); (struct zone *)( (char *)__mptr - __builtin_offsetof(struct zone,lruvec) );});

}


void memory_present(int nid, unsigned long start, unsigned long end);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int local_memory_node(int node_id) { return node_id; };
# 839 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int populated_zone(struct zone *zone)
{
 return (!!zone->present_pages);
}

extern int movable_zone;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zone_movable_is_highmem(void)
{





 return 0;

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_highmem_idx(enum zone_type idx)
{




 return 0;

}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_highmem(struct zone *zone)
{






 return 0;

}


struct ctl_table;
int min_free_kbytes_sysctl_handler(struct ctl_table *, int,
     void *, size_t *, loff_t *);
extern int sysctl_lowmem_reserve_ratio[2 -1];
int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int,
     void *, size_t *, loff_t *);
int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int,
     void *, size_t *, loff_t *);
int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int,
   void *, size_t *, loff_t *);
int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int,
   void *, size_t *, loff_t *);

extern int numa_zonelist_order_handler(struct ctl_table *, int,
   void *, size_t *, loff_t *);
extern char numa_zonelist_order[];
# 912 "include/linux/mmzone.h"
# 1 "./arch/sparc/include/asm/mmzone.h" 1







extern struct pglist_data *node_data[];



extern int numa_cpu_lookup_table[];
extern cpumask_t numa_cpumask_lookup_table[];
# 913 "include/linux/mmzone.h" 2



extern struct pglist_data *first_online_pgdat(void);
extern struct pglist_data *next_online_pgdat(struct pglist_data *pgdat);
extern struct zone *next_zone(struct zone *zone);
# 948 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zone *zonelist_zone(struct zoneref *zoneref)
{
 return zoneref->zone;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zonelist_zone_idx(struct zoneref *zoneref)
{
 return zoneref->zone_idx;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zonelist_node_idx(struct zoneref *zoneref)
{


 return zoneref->zone->node;



}
# 980 "include/linux/mmzone.h"
struct zoneref *next_zones_zonelist(struct zoneref *z,
     enum zone_type highest_zoneidx,
     nodemask_t *nodes);
# 996 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zoneref *first_zones_zonelist(struct zonelist *zonelist,
     enum zone_type highest_zoneidx,
     nodemask_t *nodes,
     struct zone **zone)
{
 struct zoneref *z = next_zones_zonelist(zonelist->_zonerefs,
       highest_zoneidx, nodes);
 *zone = zonelist_zone(z);
 return z;
}
# 1081 "include/linux/mmzone.h"
struct page;
struct page_ext;
struct mem_section {
# 1096 "include/linux/mmzone.h"
 unsigned long section_mem_map;


 unsigned long *pageblock_flags;
# 1112 "include/linux/mmzone.h"
};
# 1125 "include/linux/mmzone.h"
extern struct mem_section *mem_section[((((1UL << (53 - 30))) + ((((1UL) << 13) / sizeof (struct mem_section))) - 1) / ((((1UL) << 13) / sizeof (struct mem_section))))];




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct mem_section *__nr_to_section(unsigned long nr)
{
 if (!mem_section[((nr) / (((1UL) << 13) / sizeof (struct mem_section)))])
  return ((void *)0);
 return &mem_section[((nr) / (((1UL) << 13) / sizeof (struct mem_section)))][nr & ((((1UL) << 13) / sizeof (struct mem_section)) - 1)];
}
extern int __section_nr(struct mem_section* ms);
extern unsigned long usemap_size(void);
# 1150 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *__section_mem_map_addr(struct mem_section *section)
{
 unsigned long map = section->section_mem_map;
 map &= (~((1UL<<2)-1));
 return (struct page *)map;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int present_section(struct mem_section *section)
{
 return (section && (section->section_mem_map & (1UL<<0)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int present_section_nr(unsigned long nr)
{
 return present_section(__nr_to_section(nr));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int valid_section(struct mem_section *section)
{
 return (section && (section->section_mem_map & (1UL<<1)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int valid_section_nr(unsigned long nr)
{
 return valid_section(__nr_to_section(nr));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct mem_section *__pfn_to_section(unsigned long pfn)
{
 return __nr_to_section(((pfn) >> (30 - 13)));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pfn_valid(unsigned long pfn)
{
 if (((pfn) >> (30 - 13)) >= (1UL << (53 - 30)))
  return 0;
 return valid_section(__nr_to_section(((pfn) >> (30 - 13))));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pfn_present(unsigned long pfn)
{
 if (((pfn) >> (30 - 13)) >= (1UL << (53 - 30)))
  return 0;
 return present_section(__nr_to_section(((pfn) >> (30 - 13))));
}
# 1214 "include/linux/mmzone.h"
void sparse_init(void);






bool early_pfn_in_nid(unsigned long pfn, int nid);
# 1230 "include/linux/mmzone.h"
void memory_present(int nid, unsigned long start, unsigned long end);
unsigned long __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) node_memmap_size_bytes(int, unsigned long, unsigned long);
# 1264 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int memmap_valid_within(unsigned long pfn,
     struct page *page, struct zone *zone)
{
 return 1;
}
# 33 "include/linux/topology.h" 2


# 1 "./arch/sparc/include/asm/topology.h" 1



# 1 "./arch/sparc/include/asm/topology_64.h" 1







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_to_node(int cpu)
{
 return numa_cpu_lookup_table[cpu];
}







struct pci_bus;

int pcibus_to_node(struct pci_bus *pbus);
# 47 "./arch/sparc/include/asm/topology_64.h"
extern cpumask_t cpu_core_map[128];
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cpumask *cpu_coregroup_mask(int cpu)
{
        return &cpu_core_map[cpu];
}
# 5 "./arch/sparc/include/asm/topology.h" 2
# 36 "include/linux/topology.h" 2
# 49 "include/linux/topology.h"
int arch_update_cpu_topology(void);
# 106 "include/linux/topology.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int numa_node_id(void)
{
 return cpu_to_node(((current_thread_info_reg)->cpu));
}
# 166 "include/linux/topology.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int numa_mem_id(void)
{
 return numa_node_id();
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int node_to_mem_node(int node)
{
 return node;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_to_mem(int cpu)
{
 return cpu_to_node(cpu);
}
# 202 "include/linux/topology.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cpumask *cpu_smt_mask(int cpu)
{
 return (&(*({ do { const void *__vpp_verify = (typeof((&(cpu_sibling_map)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*((&(cpu_sibling_map)))) *)((&(cpu_sibling_map))))); (typeof((typeof(*((&(cpu_sibling_map)))) *)((&(cpu_sibling_map))))) (__ptr + ((((trap_block[((cpu))].__per_cpu_base))))); }); })));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cpumask *cpu_cpu_mask(int cpu)
{
 return ((cpu_to_node(cpu)) == -1 ? ((struct cpumask *)(1 ? (cpu_all_bits) : (void *)sizeof(__check_is_bitmap(cpu_all_bits)))) : &numa_cpumask_lookup_table[cpu_to_node(cpu)]);
}
# 43 "include/linux/sched.h" 2
# 1 "include/linux/proportions.h" 1
# 12 "include/linux/proportions.h"
# 1 "include/linux/percpu_counter.h" 1
# 15 "include/linux/percpu_counter.h"
# 1 "include/linux/gfp.h" 1
# 10 "include/linux/gfp.h"
struct vm_area_struct;
# 156 "include/linux/gfp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int gfpflags_to_migratetype(const gfp_t gfp_flags)
{
 ({ int __ret_warn_on = !!((gfp_flags & ((( gfp_t)0x80000u)|(( gfp_t)0x08u))) == ((( gfp_t)0x80000u)|(( gfp_t)0x08u))); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/gfp.h", 158); __builtin_expect(!!(__ret_warn_on), 0); });

 if (__builtin_expect(!!(page_group_by_mobility_disabled), 0))
  return MIGRATE_UNMOVABLE;


 return (((gfp_flags & (( gfp_t)0x08u)) != 0) << 1) |
  ((gfp_flags & (( gfp_t)0x80000u)) != 0);
}
# 251 "include/linux/gfp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum zone_type gfp_zone(gfp_t flags)
{
 enum zone_type z;
 int bit = ( int) (flags & ((( gfp_t)0x01u)|(( gfp_t)0x02u)|(( gfp_t)0x04u)|(( gfp_t)0x08u)));

 z = (( (ZONE_NORMAL << 0 * 1) | (ZONE_NORMAL << 0x01u * 1) | (ZONE_NORMAL << 0x02u * 1) | (ZONE_NORMAL << 0x04u * 1) | (ZONE_NORMAL << 0x08u * 1) | (ZONE_NORMAL << (0x08u | 0x01u) * 1) | (ZONE_MOVABLE << (0x08u | 0x02u) * 1) | (ZONE_NORMAL << (0x08u | 0x04u) * 1) ) >> (bit * 1)) &
      ((1 << 1) - 1);
 ((void)(sizeof(( long)((( 1 << (0x01u | 0x02u) | 1 << (0x01u | 0x04u) | 1 << (0x04u | 0x02u) | 1 << (0x01u | 0x04u | 0x02u) | 1 << (0x08u | 0x02u | 0x01u) | 1 << (0x08u | 0x04u | 0x01u) | 1 << (0x08u | 0x04u | 0x02u) | 1 << (0x08u | 0x04u | 0x01u | 0x02u) ) >> bit) & 1))));
 return z;
}
# 269 "include/linux/gfp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int gfp_zonelist(gfp_t flags)
{
 if ((1 || 0) && __builtin_expect(!!(flags & (( gfp_t)0x40000u)), 0))
  return 1;

 return 0;
}
# 286 "include/linux/gfp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zonelist *node_zonelist(int nid, gfp_t flags)
{
 return (node_data[nid])->node_zonelists + gfp_zonelist(flags);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_free_page(struct page *page, int order) { }


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_alloc_page(struct page *page, int order) { }


struct page *
__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
         struct zonelist *zonelist, nodemask_t *nodemask);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *
__alloc_pages(gfp_t gfp_mask, unsigned int order,
  struct zonelist *zonelist)
{
 return __alloc_pages_nodemask(gfp_mask, order, zonelist, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
      unsigned int order)
{

 if (nid < 0)
  nid = numa_node_id();

 return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *alloc_pages_exact_node(int nid, gfp_t gfp_mask,
      unsigned int order)
{
 ((void)(sizeof(( long)(nid < 0 || nid >= (1 << 4) || !node_state((nid), N_ONLINE)))));

 return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask));
}


extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *
alloc_pages(gfp_t gfp_mask, unsigned int order)
{
 return alloc_pages_current(gfp_mask, order);
}
extern struct page *alloc_pages_vma(gfp_t gfp_mask, int order,
   struct vm_area_struct *vma, unsigned long addr,
   int node, bool hugepage);
# 354 "include/linux/gfp.h"
extern struct page *alloc_kmem_pages(gfp_t gfp_mask, unsigned int order);
extern struct page *alloc_kmem_pages_node(int nid, gfp_t gfp_mask,
       unsigned int order);

extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order);
extern unsigned long get_zeroed_page(gfp_t gfp_mask);

void *alloc_pages_exact(size_t size, gfp_t gfp_mask);
void free_pages_exact(void *virt, size_t size);

void * __attribute__ ((__section__(".meminit.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask);







extern void __free_pages(struct page *page, unsigned int order);
extern void free_pages(unsigned long addr, unsigned int order);
extern void free_hot_cold_page(struct page *page, bool cold);
extern void free_hot_cold_page_list(struct list_head *list, bool cold);

extern void __free_kmem_pages(struct page *page, unsigned int order);
extern void free_kmem_pages(unsigned long addr, unsigned int order);




void page_alloc_init(void);
void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
void drain_all_pages(struct zone *zone);
void drain_local_pages(struct zone *zone);
# 395 "include/linux/gfp.h"
extern gfp_t gfp_allowed_mask;


bool gfp_pfmemalloc_allowed(gfp_t gfp_mask);

extern void pm_restrict_gfp_mask(void);
extern void pm_restore_gfp_mask(void);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pm_suspended_storage(void)
{
 return false;
}
# 16 "include/linux/percpu_counter.h" 2



struct percpu_counter {
 raw_spinlock_t lock;
 s64 count;

 struct list_head list;

 s32 *counters;
};

extern int percpu_counter_batch;

int __percpu_counter_init(struct percpu_counter *fbc, s64 amount, gfp_t gfp,
     struct lock_class_key *key);
# 40 "include/linux/percpu_counter.h"
void percpu_counter_destroy(struct percpu_counter *fbc);
void percpu_counter_set(struct percpu_counter *fbc, s64 amount);
void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch);
s64 __percpu_counter_sum(struct percpu_counter *fbc);
int percpu_counter_compare(struct percpu_counter *fbc, s64 rhs);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_counter_add(struct percpu_counter *fbc, s64 amount)
{
 __percpu_counter_add(fbc, amount, percpu_counter_batch);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 percpu_counter_sum_positive(struct percpu_counter *fbc)
{
 s64 ret = __percpu_counter_sum(fbc);
 return ret < 0 ? 0 : ret;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 percpu_counter_sum(struct percpu_counter *fbc)
{
 return __percpu_counter_sum(fbc);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 percpu_counter_read(struct percpu_counter *fbc)
{
 return fbc->count;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 percpu_counter_read_positive(struct percpu_counter *fbc)
{
 s64 ret = fbc->count;

 __asm__ __volatile__("": : :"memory");
 if (ret >= 0)
  return ret;
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int percpu_counter_initialized(struct percpu_counter *fbc)
{
 return (fbc->counters != ((void *)0));
}
# 164 "include/linux/percpu_counter.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_counter_inc(struct percpu_counter *fbc)
{
 percpu_counter_add(fbc, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_counter_dec(struct percpu_counter *fbc)
{
 percpu_counter_add(fbc, -1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_counter_sub(struct percpu_counter *fbc, s64 amount)
{
 percpu_counter_add(fbc, -amount);
}
# 13 "include/linux/proportions.h" 2




struct prop_global {





 int shift;






 struct percpu_counter events;
};






struct prop_descriptor {
 int index;
 struct prop_global pg[2];
 struct mutex mutex;
};

int prop_descriptor_init(struct prop_descriptor *pd, int shift, gfp_t gfp);
void prop_change_shift(struct prop_descriptor *pd, int new_shift);





struct prop_local_percpu {



 struct percpu_counter events;




 int shift;
 unsigned long period;
 raw_spinlock_t lock;
};

int prop_local_init_percpu(struct prop_local_percpu *pl, gfp_t gfp);
void prop_local_destroy_percpu(struct prop_local_percpu *pl);
void __prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl);
void prop_fraction_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl,
  long *numerator, long *denominator);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
void prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); do { } while (0); } while (0);
 __prop_inc_percpu(pd, pl);
 do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);
}
# 94 "include/linux/proportions.h"
void __prop_inc_percpu_max(struct prop_descriptor *pd,
      struct prop_local_percpu *pl, long frac);






struct prop_local_single {



 unsigned long events;





 unsigned long period;
 int shift;
 raw_spinlock_t lock;
};





int prop_local_init_single(struct prop_local_single *pl);
void prop_local_destroy_single(struct prop_local_single *pl);
void __prop_inc_single(struct prop_descriptor *pd, struct prop_local_single *pl);
void prop_fraction_single(struct prop_descriptor *pd, struct prop_local_single *pl,
  long *numerator, long *denominator);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
void prop_inc_single(struct prop_descriptor *pd, struct prop_local_single *pl)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); do { } while (0); } while (0);
 __prop_inc_single(pd, pl);
 do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);
}
# 44 "include/linux/sched.h" 2
# 1 "include/linux/seccomp.h" 1



# 1 "include/uapi/linux/seccomp.h" 1
# 47 "include/uapi/linux/seccomp.h"
struct seccomp_data {
 int nr;
 __u32 arch;
 __u64 instruction_pointer;
 __u64 args[6];
};
# 5 "include/linux/seccomp.h" 2






# 1 "./arch/sparc/include/asm/seccomp.h" 1


# 1 "./include/uapi/linux/unistd.h" 1






# 1 "./arch/sparc/include/asm/unistd.h" 1
# 17 "./arch/sparc/include/asm/unistd.h"
# 1 "./arch/sparc/include/uapi/asm/unistd.h" 1
# 18 "./arch/sparc/include/asm/unistd.h" 2
# 8 "./include/uapi/linux/unistd.h" 2
# 4 "./arch/sparc/include/asm/seccomp.h" 2
# 12 "include/linux/seccomp.h" 2

struct seccomp_filter;
# 25 "include/linux/seccomp.h"
struct seccomp {
 int mode;
 struct seccomp_filter *filter;
};
# 45 "include/linux/seccomp.h"
extern void secure_computing_strict(int this_syscall);


extern long prctl_get_seccomp(void);
extern long prctl_set_seccomp(unsigned long, char *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int seccomp_mode(struct seccomp *s)
{
 return s->mode;
}
# 89 "include/linux/seccomp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_seccomp_filter(struct task_struct *tsk)
{
 return;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_seccomp_filter(struct task_struct *tsk)
{
 return;
}
# 45 "include/linux/sched.h" 2

# 1 "include/linux/rculist.h" 1
# 30 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void INIT_LIST_HEAD_RCU(struct list_head *list)
{
 (*({ __attribute__((unused)) typeof(list->next) __var = ( typeof(list->next)) 0; (volatile typeof(list->next) *)&(list->next); })) = list;
 (*({ __attribute__((unused)) typeof(list->prev) __var = ( typeof(list->prev)) 0; (volatile typeof(list->prev) *)&(list->prev); })) = list;
}
# 49 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_add_rcu(struct list_head *new,
  struct list_head *prev, struct list_head *next)
{
 new->next = next;
 new->prev = prev;
 do { do { bool __cond = !((sizeof(*&(*((struct list_head **)(&(prev)->next)))) == sizeof(char) || sizeof(*&(*((struct list_head **)(&(prev)->next)))) == sizeof(short) || sizeof(*&(*((struct list_head **)(&(prev)->next)))) == sizeof(int) || sizeof(*&(*((struct list_head **)(&(prev)->next)))) == sizeof(long))); extern void __compiletime_assert_54(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_54(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&(*((struct list_head **)(&(prev)->next)))) __var = ( typeof(*&(*((struct list_head **)(&(prev)->next))))) 0; (volatile typeof(*&(*((struct list_head **)(&(prev)->next)))) *)&(*&(*((struct list_head **)(&(prev)->next)))); })) = ((typeof(*(new)) *)(new)); } while (0);
 next->prev = new;
}
# 78 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_add_rcu(struct list_head *new, struct list_head *head)
{
 __list_add_rcu(new, head, head->next);
}
# 99 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_add_tail_rcu(struct list_head *new,
     struct list_head *head)
{
 __list_add_rcu(new, head->prev, head);
}
# 129 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_del_rcu(struct list_head *entry)
{
 __list_del_entry(entry);
 entry->prev = ((void *) 0x00200200 + 0);
}
# 155 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_del_init_rcu(struct hlist_node *n)
{
 if (!hlist_unhashed(n)) {
  __hlist_del(n);
  n->pprev = ((void *)0);
 }
}
# 171 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_replace_rcu(struct list_head *old,
    struct list_head *new)
{
 new->next = old->next;
 new->prev = old->prev;
 do { do { bool __cond = !((sizeof(*&(*((struct list_head **)(&(new->prev)->next)))) == sizeof(char) || sizeof(*&(*((struct list_head **)(&(new->prev)->next)))) == sizeof(short) || sizeof(*&(*((struct list_head **)(&(new->prev)->next)))) == sizeof(int) || sizeof(*&(*((struct list_head **)(&(new->prev)->next)))) == sizeof(long))); extern void __compiletime_assert_176(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_176(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&(*((struct list_head **)(&(new->prev)->next)))) __var = ( typeof(*&(*((struct list_head **)(&(new->prev)->next))))) 0; (volatile typeof(*&(*((struct list_head **)(&(new->prev)->next)))) *)&(*&(*((struct list_head **)(&(new->prev)->next)))); })) = ((typeof(*(new)) *)(new)); } while (0);
 new->next->prev = new;
 old->prev = ((void *) 0x00200200 + 0);
}
# 198 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice_init_rcu(struct list_head *list,
     struct list_head *head,
     void (*sync)(void))
{
 struct list_head *first = list->next;
 struct list_head *last = list->prev;
 struct list_head *at = head->next;

 if (list_empty(list))
  return;







 INIT_LIST_HEAD_RCU(list);
# 224 "include/linux/rculist.h"
 sync();
# 234 "include/linux/rculist.h"
 last->next = at;
 do { do { bool __cond = !((sizeof(*&(*((struct list_head **)(&(head)->next)))) == sizeof(char) || sizeof(*&(*((struct list_head **)(&(head)->next)))) == sizeof(short) || sizeof(*&(*((struct list_head **)(&(head)->next)))) == sizeof(int) || sizeof(*&(*((struct list_head **)(&(head)->next)))) == sizeof(long))); extern void __compiletime_assert_235(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_235(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&(*((struct list_head **)(&(head)->next)))) __var = ( typeof(*&(*((struct list_head **)(&(head)->next))))) 0; (volatile typeof(*&(*((struct list_head **)(&(head)->next)))) *)&(*&(*((struct list_head **)(&(head)->next)))); })) = ((typeof(*(first)) *)(first)); } while (0);
 first->prev = head;
 at->prev = last;
}
# 343 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_del_rcu(struct hlist_node *n)
{
 __hlist_del(n);
 n->pprev = ((void *) 0x00200200 + 0);
}
# 356 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_replace_rcu(struct hlist_node *old,
     struct hlist_node *new)
{
 struct hlist_node *next = old->next;

 new->next = next;
 new->pprev = old->pprev;
 do { do { bool __cond = !((sizeof(*&*(struct hlist_node **)new->pprev) == sizeof(char) || sizeof(*&*(struct hlist_node **)new->pprev) == sizeof(short) || sizeof(*&*(struct hlist_node **)new->pprev) == sizeof(int) || sizeof(*&*(struct hlist_node **)new->pprev) == sizeof(long))); extern void __compiletime_assert_363(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_363(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&*(struct hlist_node **)new->pprev) __var = ( typeof(*&*(struct hlist_node **)new->pprev)) 0; (volatile typeof(*&*(struct hlist_node **)new->pprev) *)&(*&*(struct hlist_node **)new->pprev); })) = ((typeof(*(new)) *)(new)); } while (0);
 if (next)
  new->next->pprev = &new->next;
 old->pprev = ((void *) 0x00200200 + 0);
}
# 395 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_head_rcu(struct hlist_node *n,
     struct hlist_head *h)
{
 struct hlist_node *first = h->first;

 n->next = first;
 n->pprev = &h->first;
 do { do { bool __cond = !((sizeof(*&(*((struct hlist_node **)(&(h)->first)))) == sizeof(char) || sizeof(*&(*((struct hlist_node **)(&(h)->first)))) == sizeof(short) || sizeof(*&(*((struct hlist_node **)(&(h)->first)))) == sizeof(int) || sizeof(*&(*((struct hlist_node **)(&(h)->first)))) == sizeof(long))); extern void __compiletime_assert_402(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_402(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&(*((struct hlist_node **)(&(h)->first)))) __var = ( typeof(*&(*((struct hlist_node **)(&(h)->first))))) 0; (volatile typeof(*&(*((struct hlist_node **)(&(h)->first)))) *)&(*&(*((struct hlist_node **)(&(h)->first)))); })) = ((typeof(*(n)) *)(n)); } while (0);
 if (first)
  first->pprev = &n->next;
}
# 425 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_before_rcu(struct hlist_node *n,
     struct hlist_node *next)
{
 n->pprev = next->pprev;
 n->next = next;
 do { do { bool __cond = !((sizeof(*&(*((struct hlist_node **)((n)->pprev)))) == sizeof(char) || sizeof(*&(*((struct hlist_node **)((n)->pprev)))) == sizeof(short) || sizeof(*&(*((struct hlist_node **)((n)->pprev)))) == sizeof(int) || sizeof(*&(*((struct hlist_node **)((n)->pprev)))) == sizeof(long))); extern void __compiletime_assert_430(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_430(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&(*((struct hlist_node **)((n)->pprev)))) __var = ( typeof(*&(*((struct hlist_node **)((n)->pprev))))) 0; (volatile typeof(*&(*((struct hlist_node **)((n)->pprev)))) *)&(*&(*((struct hlist_node **)((n)->pprev)))); })) = ((typeof(*(n)) *)(n)); } while (0);
 next->pprev = &n->next;
}
# 452 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_behind_rcu(struct hlist_node *n,
     struct hlist_node *prev)
{
 n->next = prev->next;
 n->pprev = &prev->next;
 do { do { bool __cond = !((sizeof(*&(*((struct hlist_node **)(&(prev)->next)))) == sizeof(char) || sizeof(*&(*((struct hlist_node **)(&(prev)->next)))) == sizeof(short) || sizeof(*&(*((struct hlist_node **)(&(prev)->next)))) == sizeof(int) || sizeof(*&(*((struct hlist_node **)(&(prev)->next)))) == sizeof(long))); extern void __compiletime_assert_457(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_457(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&(*((struct hlist_node **)(&(prev)->next)))) __var = ( typeof(*&(*((struct hlist_node **)(&(prev)->next))))) 0; (volatile typeof(*&(*((struct hlist_node **)(&(prev)->next)))) *)&(*&(*((struct hlist_node **)(&(prev)->next)))); })) = ((typeof(*(n)) *)(n)); } while (0);
 if (n->next)
  n->next->pprev = &n->next;
}
# 47 "include/linux/sched.h" 2
# 1 "include/linux/rtmutex.h" 1
# 19 "include/linux/rtmutex.h"
extern int max_lock_depth;
# 29 "include/linux/rtmutex.h"
struct rt_mutex {
 raw_spinlock_t wait_lock;
 struct rb_root waiters;
 struct rb_node *waiters_leftmost;
 struct task_struct *owner;






};

struct rt_mutex_waiter;
struct hrtimer_sleeper;






 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rt_mutex_debug_check_no_locks_freed(const void *from,
             unsigned long len)
 {
 return 0;
 }
# 84 "include/linux/rtmutex.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rt_mutex_is_locked(struct rt_mutex *lock)
{
 return lock->owner != ((void *)0);
}

extern void __rt_mutex_init(struct rt_mutex *lock, const char *name);
extern void rt_mutex_destroy(struct rt_mutex *lock);

extern void rt_mutex_lock(struct rt_mutex *lock);
extern int rt_mutex_lock_interruptible(struct rt_mutex *lock);
extern int rt_mutex_timed_lock(struct rt_mutex *lock,
          struct hrtimer_sleeper *timeout);

extern int rt_mutex_trylock(struct rt_mutex *lock);

extern void rt_mutex_unlock(struct rt_mutex *lock);
# 48 "include/linux/sched.h" 2



# 1 "include/linux/resource.h" 1



# 1 "include/uapi/linux/resource.h" 1
# 23 "include/uapi/linux/resource.h"
struct rusage {
 struct timeval ru_utime;
 struct timeval ru_stime;
 __kernel_long_t ru_maxrss;
 __kernel_long_t ru_ixrss;
 __kernel_long_t ru_idrss;
 __kernel_long_t ru_isrss;
 __kernel_long_t ru_minflt;
 __kernel_long_t ru_majflt;
 __kernel_long_t ru_nswap;
 __kernel_long_t ru_inblock;
 __kernel_long_t ru_oublock;
 __kernel_long_t ru_msgsnd;
 __kernel_long_t ru_msgrcv;
 __kernel_long_t ru_nsignals;
 __kernel_long_t ru_nvcsw;
 __kernel_long_t ru_nivcsw;
};

struct rlimit {
 __kernel_ulong_t rlim_cur;
 __kernel_ulong_t rlim_max;
};



struct rlimit64 {
 __u64 rlim_cur;
 __u64 rlim_max;
};
# 77 "include/uapi/linux/resource.h"
# 1 "./arch/sparc/include/uapi/asm/resource.h" 1
# 28 "./arch/sparc/include/uapi/asm/resource.h"
# 1 "include/asm-generic/resource.h" 1



# 1 "include/uapi/asm-generic/resource.h" 1
# 5 "include/asm-generic/resource.h" 2
# 29 "./arch/sparc/include/uapi/asm/resource.h" 2
# 78 "include/uapi/linux/resource.h" 2
# 5 "include/linux/resource.h" 2


struct task_struct;

int getrusage(struct task_struct *p, int who, struct rusage *ru);
int do_prlimit(struct task_struct *tsk, unsigned int resource,
  struct rlimit *new_rlim, struct rlimit *old_rlim);
# 52 "include/linux/sched.h" 2

# 1 "include/linux/hrtimer.h" 1
# 25 "include/linux/hrtimer.h"
# 1 "include/linux/timerqueue.h" 1







struct timerqueue_node {
 struct rb_node node;
 ktime_t expires;
};

struct timerqueue_head {
 struct rb_root head;
 struct timerqueue_node *next;
};


extern void timerqueue_add(struct timerqueue_head *head,
    struct timerqueue_node *node);
extern void timerqueue_del(struct timerqueue_head *head,
    struct timerqueue_node *node);
extern struct timerqueue_node *timerqueue_iterate_next(
      struct timerqueue_node *node);
# 34 "include/linux/timerqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head)
{
 return head->next;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timerqueue_init(struct timerqueue_node *node)
{
 ((&node->node)->__rb_parent_color = (unsigned long)(&node->node));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timerqueue_init_head(struct timerqueue_head *head)
{
 head->head = (struct rb_root) { ((void *)0), };
 head->next = ((void *)0);
}
# 26 "include/linux/hrtimer.h" 2

struct hrtimer_clock_base;
struct hrtimer_cpu_base;




enum hrtimer_mode {
 HRTIMER_MODE_ABS = 0x0,
 HRTIMER_MODE_REL = 0x1,
 HRTIMER_MODE_PINNED = 0x02,
 HRTIMER_MODE_ABS_PINNED = 0x02,
 HRTIMER_MODE_REL_PINNED = 0x03,
};




enum hrtimer_restart {
 HRTIMER_NORESTART,
 HRTIMER_RESTART,
};
# 108 "include/linux/hrtimer.h"
struct hrtimer {
 struct timerqueue_node node;
 ktime_t _softexpires;
 enum hrtimer_restart (*function)(struct hrtimer *);
 struct hrtimer_clock_base *base;
 unsigned long state;





};
# 128 "include/linux/hrtimer.h"
struct hrtimer_sleeper {
 struct hrtimer timer;
 struct task_struct *task;
};
# 145 "include/linux/hrtimer.h"
struct hrtimer_clock_base {
 struct hrtimer_cpu_base *cpu_base;
 int index;
 clockid_t clockid;
 struct timerqueue_head active;
 ktime_t resolution;
 ktime_t (*get_time)(void);
 ktime_t softirq_time;
 ktime_t offset;
};

enum hrtimer_base_type {
 HRTIMER_BASE_MONOTONIC,
 HRTIMER_BASE_REALTIME,
 HRTIMER_BASE_BOOTTIME,
 HRTIMER_BASE_TAI,
 HRTIMER_MAX_CLOCK_BASES,
};
# 182 "include/linux/hrtimer.h"
struct hrtimer_cpu_base {
 raw_spinlock_t lock;
 unsigned int cpu;
 unsigned int active_bases;
 unsigned int clock_was_set;

 ktime_t expires_next;
 int in_hrtirq;
 int hres_active;
 int hang_detected;
 unsigned long nr_events;
 unsigned long nr_retries;
 unsigned long nr_hangs;
 ktime_t max_hang_time;

 struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES];
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_set_expires(struct hrtimer *timer, ktime_t time)
{
 timer->node.expires = time;
 timer->_softexpires = time;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta)
{
 timer->_softexpires = time;
 timer->node.expires = ktime_add_safe(time, delta);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, unsigned long delta)
{
 timer->_softexpires = time;
 timer->node.expires = ktime_add_safe(time, ns_to_ktime(delta));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64)
{
 timer->node.expires.tv64 = tv64;
 timer->_softexpires.tv64 = tv64;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_add_expires(struct hrtimer *timer, ktime_t time)
{
 timer->node.expires = ktime_add_safe(timer->node.expires, time);
 timer->_softexpires = ktime_add_safe(timer->_softexpires, time);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_add_expires_ns(struct hrtimer *timer, u64 ns)
{
 timer->node.expires = ({ (ktime_t){ .tv64 = (timer->node.expires).tv64 + (ns) }; });
 timer->_softexpires = ({ (ktime_t){ .tv64 = (timer->_softexpires).tv64 + (ns) }; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t hrtimer_get_expires(const struct hrtimer *timer)
{
 return timer->node.expires;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t hrtimer_get_softexpires(const struct hrtimer *timer)
{
 return timer->_softexpires;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 hrtimer_get_expires_tv64(const struct hrtimer *timer)
{
 return timer->node.expires.tv64;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer)
{
 return timer->_softexpires.tv64;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 hrtimer_get_expires_ns(const struct hrtimer *timer)
{
 return ((timer->node.expires).tv64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t hrtimer_expires_remaining(const struct hrtimer *timer)
{
 return ({ (ktime_t){ .tv64 = (timer->node.expires).tv64 - (timer->base->get_time()).tv64 }; });
}


struct clock_event_device;

extern void hrtimer_interrupt(struct clock_event_device *dev);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t hrtimer_cb_get_time(struct hrtimer *timer)
{
 return timer->base->get_time();
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_is_hres_active(struct hrtimer *timer)
{
 return timer->base->cpu_base->hres_active;
}

extern void hrtimer_peek_ahead_timers(void);
# 296 "include/linux/hrtimer.h"
extern void clock_was_set_delayed(void);
# 323 "include/linux/hrtimer.h"
extern void clock_was_set(void);

extern void timerfd_clock_was_set(void);



extern void hrtimers_resume(void);

extern __attribute__((section(".data..percpu" ""))) __typeof__(struct tick_device) tick_cpu_device;





extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock,
    enum hrtimer_mode mode);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_init_on_stack(struct hrtimer *timer,
      clockid_t which_clock,
      enum hrtimer_mode mode)
{
 hrtimer_init(timer, which_clock, mode);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_hrtimer_on_stack(struct hrtimer *timer) { }



extern int hrtimer_start(struct hrtimer *timer, ktime_t tim,
    const enum hrtimer_mode mode);
extern int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
   unsigned long range_ns, const enum hrtimer_mode mode);
extern int
__hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
    unsigned long delta_ns,
    const enum hrtimer_mode mode, int wakeup);

extern int hrtimer_cancel(struct hrtimer *timer);
extern int hrtimer_try_to_cancel(struct hrtimer *timer);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_start_expires(struct hrtimer *timer,
      enum hrtimer_mode mode)
{
 unsigned long delta;
 ktime_t soft, hard;
 soft = hrtimer_get_softexpires(timer);
 hard = hrtimer_get_expires(timer);
 delta = ((({ (ktime_t){ .tv64 = (hard).tv64 - (soft).tv64 }; })).tv64);
 return hrtimer_start_range_ns(timer, soft, delta, mode);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_restart(struct hrtimer *timer)
{
 return hrtimer_start_expires(timer, HRTIMER_MODE_ABS);
}


extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer);
extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp);

extern ktime_t hrtimer_get_next_event(void);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_active(const struct hrtimer *timer)
{
 return timer->state != 0x00;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_is_queued(struct hrtimer *timer)
{
 return timer->state & 0x01;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_callback_running(struct hrtimer *timer)
{
 return timer->state & 0x02;
}


extern u64
hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 hrtimer_forward_now(struct hrtimer *timer,
          ktime_t interval)
{
 return hrtimer_forward(timer, timer->base->get_time(), interval);
}


extern long hrtimer_nanosleep(struct timespec *rqtp,
         struct timespec *rmtp,
         const enum hrtimer_mode mode,
         const clockid_t clockid);
extern long hrtimer_nanosleep_restart(struct restart_block *restart_block);

extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
     struct task_struct *tsk);

extern int schedule_hrtimeout_range(ktime_t *expires, unsigned long delta,
      const enum hrtimer_mode mode);
extern int schedule_hrtimeout_range_clock(ktime_t *expires,
  unsigned long delta, const enum hrtimer_mode mode, int clock);
extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode);


extern void hrtimer_run_queues(void);
extern void hrtimer_run_pending(void);


extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) hrtimers_init(void);


extern void sysrq_timer_list_show(void);
# 54 "include/linux/sched.h" 2
# 1 "include/linux/task_io_accounting.h" 1
# 11 "include/linux/task_io_accounting.h"
struct task_io_accounting {
# 45 "include/linux/task_io_accounting.h"
};
# 55 "include/linux/sched.h" 2
# 1 "include/linux/latencytop.h" 1
# 13 "include/linux/latencytop.h"
struct task_struct;
# 42 "include/linux/latencytop.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
account_scheduler_latency(struct task_struct *task, int usecs, int inter)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_all_latency_tracing(struct task_struct *p)
{
}
# 56 "include/linux/sched.h" 2
# 1 "include/linux/cred.h" 1
# 17 "include/linux/cred.h"
# 1 "include/linux/key.h" 1
# 22 "include/linux/key.h"
# 1 "include/linux/sysctl.h" 1
# 28 "include/linux/sysctl.h"
# 1 "include/uapi/linux/sysctl.h" 1
# 29 "include/uapi/linux/sysctl.h"
struct completion;






struct __sysctl_args {
 int *name;
 int nlen;
 void *oldval;
 size_t *oldlenp;
 void *newval;
 size_t newlen;
 unsigned long __unused[4];
};





enum
{
 CTL_KERN=1,
 CTL_VM=2,
 CTL_NET=3,
 CTL_PROC=4,
 CTL_FS=5,
 CTL_DEBUG=6,
 CTL_DEV=7,
 CTL_BUS=8,
 CTL_ABI=9,
 CTL_CPU=10,
 CTL_ARLAN=254,
 CTL_S390DBF=5677,
 CTL_SUNRPC=7249,
 CTL_PM=9899,
 CTL_FRV=9898,
};


enum
{
 CTL_BUS_ISA=1
};


enum
{
 INOTIFY_MAX_USER_INSTANCES=1,
 INOTIFY_MAX_USER_WATCHES=2,
 INOTIFY_MAX_QUEUED_EVENTS=3
};


enum
{
 KERN_OSTYPE=1,
 KERN_OSRELEASE=2,
 KERN_OSREV=3,
 KERN_VERSION=4,
 KERN_SECUREMASK=5,
 KERN_PROF=6,
 KERN_NODENAME=7,
 KERN_DOMAINNAME=8,

 KERN_PANIC=15,
 KERN_REALROOTDEV=16,

 KERN_SPARC_REBOOT=21,
 KERN_CTLALTDEL=22,
 KERN_PRINTK=23,
 KERN_NAMETRANS=24,
 KERN_PPC_HTABRECLAIM=25,
 KERN_PPC_ZEROPAGED=26,
 KERN_PPC_POWERSAVE_NAP=27,
 KERN_MODPROBE=28,
 KERN_SG_BIG_BUFF=29,
 KERN_ACCT=30,
 KERN_PPC_L2CR=31,

 KERN_RTSIGNR=32,
 KERN_RTSIGMAX=33,

 KERN_SHMMAX=34,
 KERN_MSGMAX=35,
 KERN_MSGMNB=36,
 KERN_MSGPOOL=37,
 KERN_SYSRQ=38,
 KERN_MAX_THREADS=39,
  KERN_RANDOM=40,
  KERN_SHMALL=41,
  KERN_MSGMNI=42,
  KERN_SEM=43,
  KERN_SPARC_STOP_A=44,
  KERN_SHMMNI=45,
 KERN_OVERFLOWUID=46,
 KERN_OVERFLOWGID=47,
 KERN_SHMPATH=48,
 KERN_HOTPLUG=49,
 KERN_IEEE_EMULATION_WARNINGS=50,
 KERN_S390_USER_DEBUG_LOGGING=51,
 KERN_CORE_USES_PID=52,
 KERN_TAINTED=53,
 KERN_CADPID=54,
 KERN_PIDMAX=55,
   KERN_CORE_PATTERN=56,
 KERN_PANIC_ON_OOPS=57,
 KERN_HPPA_PWRSW=58,
 KERN_HPPA_UNALIGNED=59,
 KERN_PRINTK_RATELIMIT=60,
 KERN_PRINTK_RATELIMIT_BURST=61,
 KERN_PTY=62,
 KERN_NGROUPS_MAX=63,
 KERN_SPARC_SCONS_PWROFF=64,
 KERN_HZ_TIMER=65,
 KERN_UNKNOWN_NMI_PANIC=66,
 KERN_BOOTLOADER_TYPE=67,
 KERN_RANDOMIZE=68,
 KERN_SETUID_DUMPABLE=69,
 KERN_SPIN_RETRY=70,
 KERN_ACPI_VIDEO_FLAGS=71,
 KERN_IA64_UNALIGNED=72,
 KERN_COMPAT_LOG=73,
 KERN_MAX_LOCK_DEPTH=74,
 KERN_NMI_WATCHDOG=75,
 KERN_PANIC_ON_NMI=76,
 KERN_PANIC_ON_WARN=77,
};




enum
{
 VM_UNUSED1=1,
 VM_UNUSED2=2,
 VM_UNUSED3=3,
 VM_UNUSED4=4,
 VM_OVERCOMMIT_MEMORY=5,
 VM_UNUSED5=6,
 VM_UNUSED7=7,
 VM_UNUSED8=8,
 VM_UNUSED9=9,
 VM_PAGE_CLUSTER=10,
 VM_DIRTY_BACKGROUND=11,
 VM_DIRTY_RATIO=12,
 VM_DIRTY_WB_CS=13,
 VM_DIRTY_EXPIRE_CS=14,
 VM_NR_PDFLUSH_THREADS=15,
 VM_OVERCOMMIT_RATIO=16,
 VM_PAGEBUF=17,
 VM_HUGETLB_PAGES=18,
 VM_SWAPPINESS=19,
 VM_LOWMEM_RESERVE_RATIO=20,
 VM_MIN_FREE_KBYTES=21,
 VM_MAX_MAP_COUNT=22,
 VM_LAPTOP_MODE=23,
 VM_BLOCK_DUMP=24,
 VM_HUGETLB_GROUP=25,
 VM_VFS_CACHE_PRESSURE=26,
 VM_LEGACY_VA_LAYOUT=27,
 VM_SWAP_TOKEN_TIMEOUT=28,
 VM_DROP_PAGECACHE=29,
 VM_PERCPU_PAGELIST_FRACTION=30,
 VM_ZONE_RECLAIM_MODE=31,
 VM_MIN_UNMAPPED=32,
 VM_PANIC_ON_OOM=33,
 VM_VDSO_ENABLED=34,
 VM_MIN_SLAB=35,
};



enum
{
 NET_CORE=1,
 NET_ETHER=2,
 NET_802=3,
 NET_UNIX=4,
 NET_IPV4=5,
 NET_IPX=6,
 NET_ATALK=7,
 NET_NETROM=8,
 NET_AX25=9,
 NET_BRIDGE=10,
 NET_ROSE=11,
 NET_IPV6=12,
 NET_X25=13,
 NET_TR=14,
 NET_DECNET=15,
 NET_ECONET=16,
 NET_SCTP=17,
 NET_LLC=18,
 NET_NETFILTER=19,
 NET_DCCP=20,
 NET_IRDA=412,
};


enum
{
 RANDOM_POOLSIZE=1,
 RANDOM_ENTROPY_COUNT=2,
 RANDOM_READ_THRESH=3,
 RANDOM_WRITE_THRESH=4,
 RANDOM_BOOT_ID=5,
 RANDOM_UUID=6
};


enum
{
 PTY_MAX=1,
 PTY_NR=2
};


enum
{
 BUS_ISA_MEM_BASE=1,
 BUS_ISA_PORT_BASE=2,
 BUS_ISA_PORT_SHIFT=3
};


enum
{
 NET_CORE_WMEM_MAX=1,
 NET_CORE_RMEM_MAX=2,
 NET_CORE_WMEM_DEFAULT=3,
 NET_CORE_RMEM_DEFAULT=4,

 NET_CORE_MAX_BACKLOG=6,
 NET_CORE_FASTROUTE=7,
 NET_CORE_MSG_COST=8,
 NET_CORE_MSG_BURST=9,
 NET_CORE_OPTMEM_MAX=10,
 NET_CORE_HOT_LIST_LENGTH=11,
 NET_CORE_DIVERT_VERSION=12,
 NET_CORE_NO_CONG_THRESH=13,
 NET_CORE_NO_CONG=14,
 NET_CORE_LO_CONG=15,
 NET_CORE_MOD_CONG=16,
 NET_CORE_DEV_WEIGHT=17,
 NET_CORE_SOMAXCONN=18,
 NET_CORE_BUDGET=19,
 NET_CORE_AEVENT_ETIME=20,
 NET_CORE_AEVENT_RSEQTH=21,
 NET_CORE_WARNINGS=22,
};







enum
{
 NET_UNIX_DESTROY_DELAY=1,
 NET_UNIX_DELETE_DELAY=2,
 NET_UNIX_MAX_DGRAM_QLEN=3,
};


enum
{
 NET_NF_CONNTRACK_MAX=1,
 NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
 NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
 NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
 NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
 NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
 NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
 NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
 NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
 NET_NF_CONNTRACK_UDP_TIMEOUT=10,
 NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
 NET_NF_CONNTRACK_ICMP_TIMEOUT=12,
 NET_NF_CONNTRACK_GENERIC_TIMEOUT=13,
 NET_NF_CONNTRACK_BUCKETS=14,
 NET_NF_CONNTRACK_LOG_INVALID=15,
 NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
 NET_NF_CONNTRACK_TCP_LOOSE=17,
 NET_NF_CONNTRACK_TCP_BE_LIBERAL=18,
 NET_NF_CONNTRACK_TCP_MAX_RETRANS=19,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
 NET_NF_CONNTRACK_COUNT=27,
 NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28,
 NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
 NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
 NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
 NET_NF_CONNTRACK_CHECKSUM=32,
};


enum
{

 NET_IPV4_FORWARD=8,
 NET_IPV4_DYNADDR=9,

 NET_IPV4_CONF=16,
 NET_IPV4_NEIGH=17,
 NET_IPV4_ROUTE=18,
 NET_IPV4_FIB_HASH=19,
 NET_IPV4_NETFILTER=20,

 NET_IPV4_TCP_TIMESTAMPS=33,
 NET_IPV4_TCP_WINDOW_SCALING=34,
 NET_IPV4_TCP_SACK=35,
 NET_IPV4_TCP_RETRANS_COLLAPSE=36,
 NET_IPV4_DEFAULT_TTL=37,
 NET_IPV4_AUTOCONFIG=38,
 NET_IPV4_NO_PMTU_DISC=39,
 NET_IPV4_TCP_SYN_RETRIES=40,
 NET_IPV4_IPFRAG_HIGH_THRESH=41,
 NET_IPV4_IPFRAG_LOW_THRESH=42,
 NET_IPV4_IPFRAG_TIME=43,
 NET_IPV4_TCP_MAX_KA_PROBES=44,
 NET_IPV4_TCP_KEEPALIVE_TIME=45,
 NET_IPV4_TCP_KEEPALIVE_PROBES=46,
 NET_IPV4_TCP_RETRIES1=47,
 NET_IPV4_TCP_RETRIES2=48,
 NET_IPV4_TCP_FIN_TIMEOUT=49,
 NET_IPV4_IP_MASQ_DEBUG=50,
 NET_TCP_SYNCOOKIES=51,
 NET_TCP_STDURG=52,
 NET_TCP_RFC1337=53,
 NET_TCP_SYN_TAILDROP=54,
 NET_TCP_MAX_SYN_BACKLOG=55,
 NET_IPV4_LOCAL_PORT_RANGE=56,
 NET_IPV4_ICMP_ECHO_IGNORE_ALL=57,
 NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS=58,
 NET_IPV4_ICMP_SOURCEQUENCH_RATE=59,
 NET_IPV4_ICMP_DESTUNREACH_RATE=60,
 NET_IPV4_ICMP_TIMEEXCEED_RATE=61,
 NET_IPV4_ICMP_PARAMPROB_RATE=62,
 NET_IPV4_ICMP_ECHOREPLY_RATE=63,
 NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64,
 NET_IPV4_IGMP_MAX_MEMBERSHIPS=65,
 NET_TCP_TW_RECYCLE=66,
 NET_IPV4_ALWAYS_DEFRAG=67,
 NET_IPV4_TCP_KEEPALIVE_INTVL=68,
 NET_IPV4_INET_PEER_THRESHOLD=69,
 NET_IPV4_INET_PEER_MINTTL=70,
 NET_IPV4_INET_PEER_MAXTTL=71,
 NET_IPV4_INET_PEER_GC_MINTIME=72,
 NET_IPV4_INET_PEER_GC_MAXTIME=73,
 NET_TCP_ORPHAN_RETRIES=74,
 NET_TCP_ABORT_ON_OVERFLOW=75,
 NET_TCP_SYNACK_RETRIES=76,
 NET_TCP_MAX_ORPHANS=77,
 NET_TCP_MAX_TW_BUCKETS=78,
 NET_TCP_FACK=79,
 NET_TCP_REORDERING=80,
 NET_TCP_ECN=81,
 NET_TCP_DSACK=82,
 NET_TCP_MEM=83,
 NET_TCP_WMEM=84,
 NET_TCP_RMEM=85,
 NET_TCP_APP_WIN=86,
 NET_TCP_ADV_WIN_SCALE=87,
 NET_IPV4_NONLOCAL_BIND=88,
 NET_IPV4_ICMP_RATELIMIT=89,
 NET_IPV4_ICMP_RATEMASK=90,
 NET_TCP_TW_REUSE=91,
 NET_TCP_FRTO=92,
 NET_TCP_LOW_LATENCY=93,
 NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
 NET_IPV4_IGMP_MAX_MSF=96,
 NET_TCP_NO_METRICS_SAVE=97,
 NET_TCP_DEFAULT_WIN_SCALE=105,
 NET_TCP_MODERATE_RCVBUF=106,
 NET_TCP_TSO_WIN_DIVISOR=107,
 NET_TCP_BIC_BETA=108,
 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
 NET_TCP_CONG_CONTROL=110,
 NET_TCP_ABC=111,
 NET_IPV4_IPFRAG_MAX_DIST=112,
  NET_TCP_MTU_PROBING=113,
 NET_TCP_BASE_MSS=114,
 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
 NET_TCP_DMA_COPYBREAK=116,
 NET_TCP_SLOW_START_AFTER_IDLE=117,
 NET_CIPSOV4_CACHE_ENABLE=118,
 NET_CIPSOV4_CACHE_BUCKET_SIZE=119,
 NET_CIPSOV4_RBM_OPTFMT=120,
 NET_CIPSOV4_RBM_STRICTVALID=121,
 NET_TCP_AVAIL_CONG_CONTROL=122,
 NET_TCP_ALLOWED_CONG_CONTROL=123,
 NET_TCP_MAX_SSTHRESH=124,
 NET_TCP_FRTO_RESPONSE=125,
};

enum {
 NET_IPV4_ROUTE_FLUSH=1,
 NET_IPV4_ROUTE_MIN_DELAY=2,
 NET_IPV4_ROUTE_MAX_DELAY=3,
 NET_IPV4_ROUTE_GC_THRESH=4,
 NET_IPV4_ROUTE_MAX_SIZE=5,
 NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
 NET_IPV4_ROUTE_GC_TIMEOUT=7,
 NET_IPV4_ROUTE_GC_INTERVAL=8,
 NET_IPV4_ROUTE_REDIRECT_LOAD=9,
 NET_IPV4_ROUTE_REDIRECT_NUMBER=10,
 NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
 NET_IPV4_ROUTE_ERROR_COST=12,
 NET_IPV4_ROUTE_ERROR_BURST=13,
 NET_IPV4_ROUTE_GC_ELASTICITY=14,
 NET_IPV4_ROUTE_MTU_EXPIRES=15,
 NET_IPV4_ROUTE_MIN_PMTU=16,
 NET_IPV4_ROUTE_MIN_ADVMSS=17,
 NET_IPV4_ROUTE_SECRET_INTERVAL=18,
 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19,
};

enum
{
 NET_PROTO_CONF_ALL=-2,
 NET_PROTO_CONF_DEFAULT=-3


};

enum
{
 NET_IPV4_CONF_FORWARDING=1,
 NET_IPV4_CONF_MC_FORWARDING=2,
 NET_IPV4_CONF_PROXY_ARP=3,
 NET_IPV4_CONF_ACCEPT_REDIRECTS=4,
 NET_IPV4_CONF_SECURE_REDIRECTS=5,
 NET_IPV4_CONF_SEND_REDIRECTS=6,
 NET_IPV4_CONF_SHARED_MEDIA=7,
 NET_IPV4_CONF_RP_FILTER=8,
 NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE=9,
 NET_IPV4_CONF_BOOTP_RELAY=10,
 NET_IPV4_CONF_LOG_MARTIANS=11,
 NET_IPV4_CONF_TAG=12,
 NET_IPV4_CONF_ARPFILTER=13,
 NET_IPV4_CONF_MEDIUM_ID=14,
 NET_IPV4_CONF_NOXFRM=15,
 NET_IPV4_CONF_NOPOLICY=16,
 NET_IPV4_CONF_FORCE_IGMP_VERSION=17,
 NET_IPV4_CONF_ARP_ANNOUNCE=18,
 NET_IPV4_CONF_ARP_IGNORE=19,
 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
 NET_IPV4_CONF_ARP_ACCEPT=21,
 NET_IPV4_CONF_ARP_NOTIFY=22,
};


enum
{
 NET_IPV4_NF_CONNTRACK_MAX=1,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
 NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10,
 NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
 NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12,
 NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13,
 NET_IPV4_NF_CONNTRACK_BUCKETS=14,
 NET_IPV4_NF_CONNTRACK_LOG_INVALID=15,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
 NET_IPV4_NF_CONNTRACK_TCP_LOOSE=17,
 NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL=18,
 NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS=19,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
 NET_IPV4_NF_CONNTRACK_COUNT=27,
 NET_IPV4_NF_CONNTRACK_CHECKSUM=28,
};


enum {
 NET_IPV6_CONF=16,
 NET_IPV6_NEIGH=17,
 NET_IPV6_ROUTE=18,
 NET_IPV6_ICMP=19,
 NET_IPV6_BINDV6ONLY=20,
 NET_IPV6_IP6FRAG_HIGH_THRESH=21,
 NET_IPV6_IP6FRAG_LOW_THRESH=22,
 NET_IPV6_IP6FRAG_TIME=23,
 NET_IPV6_IP6FRAG_SECRET_INTERVAL=24,
 NET_IPV6_MLD_MAX_MSF=25,
};

enum {
 NET_IPV6_ROUTE_FLUSH=1,
 NET_IPV6_ROUTE_GC_THRESH=2,
 NET_IPV6_ROUTE_MAX_SIZE=3,
 NET_IPV6_ROUTE_GC_MIN_INTERVAL=4,
 NET_IPV6_ROUTE_GC_TIMEOUT=5,
 NET_IPV6_ROUTE_GC_INTERVAL=6,
 NET_IPV6_ROUTE_GC_ELASTICITY=7,
 NET_IPV6_ROUTE_MTU_EXPIRES=8,
 NET_IPV6_ROUTE_MIN_ADVMSS=9,
 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS=10
};

enum {
 NET_IPV6_FORWARDING=1,
 NET_IPV6_HOP_LIMIT=2,
 NET_IPV6_MTU=3,
 NET_IPV6_ACCEPT_RA=4,
 NET_IPV6_ACCEPT_REDIRECTS=5,
 NET_IPV6_AUTOCONF=6,
 NET_IPV6_DAD_TRANSMITS=7,
 NET_IPV6_RTR_SOLICITS=8,
 NET_IPV6_RTR_SOLICIT_INTERVAL=9,
 NET_IPV6_RTR_SOLICIT_DELAY=10,
 NET_IPV6_USE_TEMPADDR=11,
 NET_IPV6_TEMP_VALID_LFT=12,
 NET_IPV6_TEMP_PREFERED_LFT=13,
 NET_IPV6_REGEN_MAX_RETRY=14,
 NET_IPV6_MAX_DESYNC_FACTOR=15,
 NET_IPV6_MAX_ADDRESSES=16,
 NET_IPV6_FORCE_MLD_VERSION=17,
 NET_IPV6_ACCEPT_RA_DEFRTR=18,
 NET_IPV6_ACCEPT_RA_PINFO=19,
 NET_IPV6_ACCEPT_RA_RTR_PREF=20,
 NET_IPV6_RTR_PROBE_INTERVAL=21,
 NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22,
 NET_IPV6_PROXY_NDP=23,
 NET_IPV6_ACCEPT_SOURCE_ROUTE=25,
 NET_IPV6_ACCEPT_RA_FROM_LOCAL=26,
 __NET_IPV6_MAX
};


enum {
 NET_IPV6_ICMP_RATELIMIT=1
};


enum {
 NET_NEIGH_MCAST_SOLICIT=1,
 NET_NEIGH_UCAST_SOLICIT=2,
 NET_NEIGH_APP_SOLICIT=3,
 NET_NEIGH_RETRANS_TIME=4,
 NET_NEIGH_REACHABLE_TIME=5,
 NET_NEIGH_DELAY_PROBE_TIME=6,
 NET_NEIGH_GC_STALE_TIME=7,
 NET_NEIGH_UNRES_QLEN=8,
 NET_NEIGH_PROXY_QLEN=9,
 NET_NEIGH_ANYCAST_DELAY=10,
 NET_NEIGH_PROXY_DELAY=11,
 NET_NEIGH_LOCKTIME=12,
 NET_NEIGH_GC_INTERVAL=13,
 NET_NEIGH_GC_THRESH1=14,
 NET_NEIGH_GC_THRESH2=15,
 NET_NEIGH_GC_THRESH3=16,
 NET_NEIGH_RETRANS_TIME_MS=17,
 NET_NEIGH_REACHABLE_TIME_MS=18,
};


enum {
 NET_DCCP_DEFAULT=1,
};


enum {
 NET_IPX_PPROP_BROADCASTING=1,
 NET_IPX_FORWARDING=2
};


enum {
 NET_LLC2=1,
 NET_LLC_STATION=2,
};


enum {
 NET_LLC2_TIMEOUT=1,
};


enum {
 NET_LLC_STATION_ACK_TIMEOUT=1,
};


enum {
 NET_LLC2_ACK_TIMEOUT=1,
 NET_LLC2_P_TIMEOUT=2,
 NET_LLC2_REJ_TIMEOUT=3,
 NET_LLC2_BUSY_TIMEOUT=4,
};


enum {
 NET_ATALK_AARP_EXPIRY_TIME=1,
 NET_ATALK_AARP_TICK_TIME=2,
 NET_ATALK_AARP_RETRANSMIT_LIMIT=3,
 NET_ATALK_AARP_RESOLVE_TIME=4
};



enum {
 NET_NETROM_DEFAULT_PATH_QUALITY=1,
 NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER=2,
 NET_NETROM_NETWORK_TTL_INITIALISER=3,
 NET_NETROM_TRANSPORT_TIMEOUT=4,
 NET_NETROM_TRANSPORT_MAXIMUM_TRIES=5,
 NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY=6,
 NET_NETROM_TRANSPORT_BUSY_DELAY=7,
 NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8,
 NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9,
 NET_NETROM_ROUTING_CONTROL=10,
 NET_NETROM_LINK_FAILS_COUNT=11,
 NET_NETROM_RESET=12
};


enum {
 NET_AX25_IP_DEFAULT_MODE=1,
 NET_AX25_DEFAULT_MODE=2,
 NET_AX25_BACKOFF_TYPE=3,
 NET_AX25_CONNECT_MODE=4,
 NET_AX25_STANDARD_WINDOW=5,
 NET_AX25_EXTENDED_WINDOW=6,
 NET_AX25_T1_TIMEOUT=7,
 NET_AX25_T2_TIMEOUT=8,
 NET_AX25_T3_TIMEOUT=9,
 NET_AX25_IDLE_TIMEOUT=10,
 NET_AX25_N2=11,
 NET_AX25_PACLEN=12,
 NET_AX25_PROTOCOL=13,
 NET_AX25_DAMA_SLAVE_TIMEOUT=14
};


enum {
 NET_ROSE_RESTART_REQUEST_TIMEOUT=1,
 NET_ROSE_CALL_REQUEST_TIMEOUT=2,
 NET_ROSE_RESET_REQUEST_TIMEOUT=3,
 NET_ROSE_CLEAR_REQUEST_TIMEOUT=4,
 NET_ROSE_ACK_HOLD_BACK_TIMEOUT=5,
 NET_ROSE_ROUTING_CONTROL=6,
 NET_ROSE_LINK_FAIL_TIMEOUT=7,
 NET_ROSE_MAX_VCS=8,
 NET_ROSE_WINDOW_SIZE=9,
 NET_ROSE_NO_ACTIVITY_TIMEOUT=10
};


enum {
 NET_X25_RESTART_REQUEST_TIMEOUT=1,
 NET_X25_CALL_REQUEST_TIMEOUT=2,
 NET_X25_RESET_REQUEST_TIMEOUT=3,
 NET_X25_CLEAR_REQUEST_TIMEOUT=4,
 NET_X25_ACK_HOLD_BACK_TIMEOUT=5,
 NET_X25_FORWARD=6
};


enum
{
 NET_TR_RIF_TIMEOUT=1
};


enum {
 NET_DECNET_NODE_TYPE = 1,
 NET_DECNET_NODE_ADDRESS = 2,
 NET_DECNET_NODE_NAME = 3,
 NET_DECNET_DEFAULT_DEVICE = 4,
 NET_DECNET_TIME_WAIT = 5,
 NET_DECNET_DN_COUNT = 6,
 NET_DECNET_DI_COUNT = 7,
 NET_DECNET_DR_COUNT = 8,
 NET_DECNET_DST_GC_INTERVAL = 9,
 NET_DECNET_CONF = 10,
 NET_DECNET_NO_FC_MAX_CWND = 11,
 NET_DECNET_MEM = 12,
 NET_DECNET_RMEM = 13,
 NET_DECNET_WMEM = 14,
 NET_DECNET_DEBUG_LEVEL = 255
};


enum {
 NET_DECNET_CONF_LOOPBACK = -2,
 NET_DECNET_CONF_DDCMP = -3,
 NET_DECNET_CONF_PPP = -4,
 NET_DECNET_CONF_X25 = -5,
 NET_DECNET_CONF_GRE = -6,
 NET_DECNET_CONF_ETHER = -7


};


enum {
 NET_DECNET_CONF_DEV_PRIORITY = 1,
 NET_DECNET_CONF_DEV_T1 = 2,
 NET_DECNET_CONF_DEV_T2 = 3,
 NET_DECNET_CONF_DEV_T3 = 4,
 NET_DECNET_CONF_DEV_FORWARDING = 5,
 NET_DECNET_CONF_DEV_BLKSIZE = 6,
 NET_DECNET_CONF_DEV_STATE = 7
};


enum {
 NET_SCTP_RTO_INITIAL = 1,
 NET_SCTP_RTO_MIN = 2,
 NET_SCTP_RTO_MAX = 3,
 NET_SCTP_RTO_ALPHA = 4,
 NET_SCTP_RTO_BETA = 5,
 NET_SCTP_VALID_COOKIE_LIFE = 6,
 NET_SCTP_ASSOCIATION_MAX_RETRANS = 7,
 NET_SCTP_PATH_MAX_RETRANS = 8,
 NET_SCTP_MAX_INIT_RETRANSMITS = 9,
 NET_SCTP_HB_INTERVAL = 10,
 NET_SCTP_PRESERVE_ENABLE = 11,
 NET_SCTP_MAX_BURST = 12,
 NET_SCTP_ADDIP_ENABLE = 13,
 NET_SCTP_PRSCTP_ENABLE = 14,
 NET_SCTP_SNDBUF_POLICY = 15,
 NET_SCTP_SACK_TIMEOUT = 16,
 NET_SCTP_RCVBUF_POLICY = 17,
};


enum {
 NET_BRIDGE_NF_CALL_ARPTABLES = 1,
 NET_BRIDGE_NF_CALL_IPTABLES = 2,
 NET_BRIDGE_NF_CALL_IP6TABLES = 3,
 NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
 NET_BRIDGE_NF_FILTER_PPPOE_TAGGED = 5,
};


enum {
 NET_IRDA_DISCOVERY=1,
 NET_IRDA_DEVNAME=2,
 NET_IRDA_DEBUG=3,
 NET_IRDA_FAST_POLL=4,
 NET_IRDA_DISCOVERY_SLOTS=5,
 NET_IRDA_DISCOVERY_TIMEOUT=6,
 NET_IRDA_SLOT_TIMEOUT=7,
 NET_IRDA_MAX_BAUD_RATE=8,
 NET_IRDA_MIN_TX_TURN_TIME=9,
 NET_IRDA_MAX_TX_DATA_SIZE=10,
 NET_IRDA_MAX_TX_WINDOW=11,
 NET_IRDA_MAX_NOREPLY_TIME=12,
 NET_IRDA_WARN_NOREPLY_TIME=13,
 NET_IRDA_LAP_KEEPALIVE_TIME=14,
};



enum
{
 FS_NRINODE=1,
 FS_STATINODE=2,
 FS_MAXINODE=3,
 FS_NRDQUOT=4,
 FS_MAXDQUOT=5,
 FS_NRFILE=6,
 FS_MAXFILE=7,
 FS_DENTRY=8,
 FS_NRSUPER=9,
 FS_MAXSUPER=10,
 FS_OVERFLOWUID=11,
 FS_OVERFLOWGID=12,
 FS_LEASES=13,
 FS_DIR_NOTIFY=14,
 FS_LEASE_TIME=15,
 FS_DQSTATS=16,
 FS_XFS=17,
 FS_AIO_NR=18,
 FS_AIO_MAX_NR=19,
 FS_INOTIFY=20,
 FS_OCFS2=988,
};


enum {
 FS_DQ_LOOKUPS = 1,
 FS_DQ_DROPS = 2,
 FS_DQ_READS = 3,
 FS_DQ_WRITES = 4,
 FS_DQ_CACHE_HITS = 5,
 FS_DQ_ALLOCATED = 6,
 FS_DQ_FREE = 7,
 FS_DQ_SYNCS = 8,
 FS_DQ_WARNINGS = 9,
};




enum {
 DEV_CDROM=1,
 DEV_HWMON=2,
 DEV_PARPORT=3,
 DEV_RAID=4,
 DEV_MAC_HID=5,
 DEV_SCSI=6,
 DEV_IPMI=7,
};


enum {
 DEV_CDROM_INFO=1,
 DEV_CDROM_AUTOCLOSE=2,
 DEV_CDROM_AUTOEJECT=3,
 DEV_CDROM_DEBUG=4,
 DEV_CDROM_LOCK=5,
 DEV_CDROM_CHECK_MEDIA=6
};


enum {
 DEV_PARPORT_DEFAULT=-3
};


enum {
 DEV_RAID_SPEED_LIMIT_MIN=1,
 DEV_RAID_SPEED_LIMIT_MAX=2
};


enum {
 DEV_PARPORT_DEFAULT_TIMESLICE=1,
 DEV_PARPORT_DEFAULT_SPINTIME=2
};


enum {
 DEV_PARPORT_SPINTIME=1,
 DEV_PARPORT_BASE_ADDR=2,
 DEV_PARPORT_IRQ=3,
 DEV_PARPORT_DMA=4,
 DEV_PARPORT_MODES=5,
 DEV_PARPORT_DEVICES=6,
 DEV_PARPORT_AUTOPROBE=16
};


enum {
 DEV_PARPORT_DEVICES_ACTIVE=-3,
};


enum {
 DEV_PARPORT_DEVICE_TIMESLICE=1,
};


enum {
 DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1,
 DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2,
 DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3,
 DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4,
 DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5,
 DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6
};


enum {
 DEV_SCSI_LOGGING_LEVEL=1,
};


enum {
 DEV_IPMI_POWEROFF_POWERCYCLE=1,
};


enum
{
 ABI_DEFHANDLER_COFF=1,
 ABI_DEFHANDLER_ELF=2,
 ABI_DEFHANDLER_LCALL7=3,
 ABI_DEFHANDLER_LIBCSO=4,
 ABI_TRACE=5,
 ABI_FAKE_UTSNAME=6,
};
# 29 "include/linux/sysctl.h" 2


struct ctl_table;
struct nsproxy;
struct ctl_table_root;
struct ctl_table_header;
struct ctl_dir;

typedef int proc_handler (struct ctl_table *ctl, int write,
     void *buffer, size_t *lenp, loff_t *ppos);

extern int proc_dostring(struct ctl_table *, int,
    void *, size_t *, loff_t *);
extern int proc_dointvec(struct ctl_table *, int,
    void *, size_t *, loff_t *);
extern int proc_dointvec_minmax(struct ctl_table *, int,
    void *, size_t *, loff_t *);
extern int proc_dointvec_jiffies(struct ctl_table *, int,
     void *, size_t *, loff_t *);
extern int proc_dointvec_userhz_jiffies(struct ctl_table *, int,
     void *, size_t *, loff_t *);
extern int proc_dointvec_ms_jiffies(struct ctl_table *, int,
        void *, size_t *, loff_t *);
extern int proc_doulongvec_minmax(struct ctl_table *, int,
      void *, size_t *, loff_t *);
extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int,
          void *, size_t *, loff_t *);
extern int proc_do_large_bitmap(struct ctl_table *, int,
    void *, size_t *, loff_t *);
# 87 "include/linux/sysctl.h"
struct ctl_table_poll {
 atomic_t event;
 wait_queue_head_t wait;
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *proc_sys_poll_event(struct ctl_table_poll *poll)
{
 return (void *)(unsigned long)(*({ __attribute__((unused)) typeof((&poll->event)->counter) __var = ( typeof((&poll->event)->counter)) 0; (volatile typeof((&poll->event)->counter) *)&((&poll->event)->counter); }));
}
# 105 "include/linux/sysctl.h"
struct ctl_table
{
 const char *procname;
 void *data;
 int maxlen;
 umode_t mode;
 struct ctl_table *child;
 proc_handler *proc_handler;
 struct ctl_table_poll *poll;
 void *extra1;
 void *extra2;
};

struct ctl_node {
 struct rb_node node;
 struct ctl_table_header *header;
};



struct ctl_table_header
{
 union {
  struct {
   struct ctl_table *ctl_table;
   int used;
   int count;
   int nreg;
  };
  struct callback_head rcu;
 };
 struct completion *unregistering;
 struct ctl_table *ctl_table_arg;
 struct ctl_table_root *root;
 struct ctl_table_set *set;
 struct ctl_dir *parent;
 struct ctl_node *node;
};

struct ctl_dir {

 struct ctl_table_header header;
 struct rb_root root;
};

struct ctl_table_set {
 int (*is_seen)(struct ctl_table_set *);
 struct ctl_dir dir;
};

struct ctl_table_root {
 struct ctl_table_set default_set;
 struct ctl_table_set *(*lookup)(struct ctl_table_root *root,
        struct nsproxy *namespaces);
 int (*permissions)(struct ctl_table_header *head, struct ctl_table *table);
};


struct ctl_path {
 const char *procname;
};



void proc_sys_poll_notify(struct ctl_table_poll *poll);

extern void setup_sysctl_set(struct ctl_table_set *p,
 struct ctl_table_root *root,
 int (*is_seen)(struct ctl_table_set *));
extern void retire_sysctl_set(struct ctl_table_set *set);

void register_sysctl_root(struct ctl_table_root *root);
struct ctl_table_header *__register_sysctl_table(
 struct ctl_table_set *set,
 const char *path, struct ctl_table *table);
struct ctl_table_header *__register_sysctl_paths(
 struct ctl_table_set *set,
 const struct ctl_path *path, struct ctl_table *table);
struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table);
struct ctl_table_header *register_sysctl_table(struct ctl_table * table);
struct ctl_table_header *register_sysctl_paths(const struct ctl_path *path,
      struct ctl_table *table);

void unregister_sysctl_table(struct ctl_table_header * table);

extern int sysctl_init(void);
# 23 "include/linux/key.h" 2


# 1 "include/linux/assoc_array.h" 1
# 26 "include/linux/assoc_array.h"
struct assoc_array {
 struct assoc_array_ptr *root;
 unsigned long nr_leaves_on_tree;
};




struct assoc_array_ops {

 unsigned long (*get_key_chunk)(const void *index_key, int level);


 unsigned long (*get_object_key_chunk)(const void *object, int level);


 bool (*compare_object)(const void *object, const void *index_key);




 int (*diff_objects)(const void *object, const void *index_key);


 void (*free_object)(void *object);
};




struct assoc_array_edit;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void assoc_array_init(struct assoc_array *array)
{
 array->root = ((void *)0);
 array->nr_leaves_on_tree = 0;
}

extern int assoc_array_iterate(const struct assoc_array *array,
          int (*iterator)(const void *object,
            void *iterator_data),
          void *iterator_data);
extern void *assoc_array_find(const struct assoc_array *array,
         const struct assoc_array_ops *ops,
         const void *index_key);
extern void assoc_array_destroy(struct assoc_array *array,
    const struct assoc_array_ops *ops);
extern struct assoc_array_edit *assoc_array_insert(struct assoc_array *array,
         const struct assoc_array_ops *ops,
         const void *index_key,
         void *object);
extern void assoc_array_insert_set_object(struct assoc_array_edit *edit,
       void *object);
extern struct assoc_array_edit *assoc_array_delete(struct assoc_array *array,
         const struct assoc_array_ops *ops,
         const void *index_key);
extern struct assoc_array_edit *assoc_array_clear(struct assoc_array *array,
        const struct assoc_array_ops *ops);
extern void assoc_array_apply_edit(struct assoc_array_edit *edit);
extern void assoc_array_cancel_edit(struct assoc_array_edit *edit);
extern int assoc_array_gc(struct assoc_array *array,
     const struct assoc_array_ops *ops,
     bool (*iterator)(void *object, void *iterator_data),
     void *iterator_data);
# 26 "include/linux/key.h" 2





typedef int32_t key_serial_t;


typedef uint32_t key_perm_t;

struct key;
# 76 "include/linux/key.h"
struct seq_file;
struct user_struct;
struct signal_struct;
struct cred;

struct key_type;
struct key_owner;
struct keyring_list;
struct keyring_name;

struct keyring_index_key {
 struct key_type *type;
 const char *description;
 size_t desc_len;
};
# 106 "include/linux/key.h"
typedef struct __key_reference_with_attributes *key_ref_t;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) key_ref_t make_key_ref(const struct key *key,
         bool possession)
{
 return (key_ref_t) ((unsigned long) key | possession);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct key *key_ref_to_ptr(const key_ref_t key_ref)
{
 return (struct key *) ((unsigned long) key_ref & ~1UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_key_possessed(const key_ref_t key_ref)
{
 return (unsigned long) key_ref & 1UL;
}
# 132 "include/linux/key.h"
struct key {
 atomic_t usage;
 key_serial_t serial;
 union {
  struct list_head graveyard_link;
  struct rb_node serial_node;
 };
 struct rw_semaphore sem;
 struct key_user *user;
 void *security;
 union {
  time_t expiry;
  time_t revoked_at;
 };
 time_t last_used_at;
 kuid_t uid;
 kgid_t gid;
 key_perm_t perm;
 unsigned short quotalen;
 unsigned short datalen;
# 162 "include/linux/key.h"
 unsigned long flags;
# 181 "include/linux/key.h"
 union {
  struct keyring_index_key index_key;
  struct {
   struct key_type *type;
   char *description;
  };
 };




 union {
  struct list_head link;
  unsigned long x[2];
  void *p[2];
  int reject_error;
 } type_data;





 union {
  union {
   unsigned long value;
   void *rcudata;
   void *data;
   void *data2[2];
  } payload;
  struct assoc_array keys;
 };
};

extern struct key *key_alloc(struct key_type *type,
        const char *desc,
        kuid_t uid, kgid_t gid,
        const struct cred *cred,
        key_perm_t perm,
        unsigned long flags);







extern void key_revoke(struct key *key);
extern void key_invalidate(struct key *key);
extern void key_put(struct key *key);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct key *__key_get(struct key *key)
{
 atomic_add(1, &key->usage);
 return key;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct key *key_get(struct key *key)
{
 return key ? __key_get(key) : key;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void key_ref_put(key_ref_t key_ref)
{
 key_put(key_ref_to_ptr(key_ref));
}

extern struct key *request_key(struct key_type *type,
          const char *description,
          const char *callout_info);

extern struct key *request_key_with_auxdata(struct key_type *type,
         const char *description,
         const void *callout_info,
         size_t callout_len,
         void *aux);

extern struct key *request_key_async(struct key_type *type,
         const char *description,
         const void *callout_info,
         size_t callout_len);

extern struct key *request_key_async_with_auxdata(struct key_type *type,
        const char *description,
        const void *callout_info,
        size_t callout_len,
        void *aux);

extern int wait_for_key_construction(struct key *key, bool intr);

extern int key_validate(const struct key *key);

extern key_ref_t key_create_or_update(key_ref_t keyring,
          const char *type,
          const char *description,
          const void *payload,
          size_t plen,
          key_perm_t perm,
          unsigned long flags);

extern int key_update(key_ref_t key,
        const void *payload,
        size_t plen);

extern int key_link(struct key *keyring,
      struct key *key);

extern int key_unlink(struct key *keyring,
        struct key *key);

extern struct key *keyring_alloc(const char *description, kuid_t uid, kgid_t gid,
     const struct cred *cred,
     key_perm_t perm,
     unsigned long flags,
     struct key *dest);

extern int keyring_clear(struct key *keyring);

extern key_ref_t keyring_search(key_ref_t keyring,
    struct key_type *type,
    const char *description);

extern int keyring_add_key(struct key *keyring,
      struct key *key);

extern struct key *key_lookup(key_serial_t id);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) key_serial_t key_serial(const struct key *key)
{
 return key ? key->serial : 0;
}

extern void key_set_timeout(struct key *, unsigned);
# 332 "include/linux/key.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool key_is_instantiated(const struct key *key)
{
 return test_bit(0, &key->flags) &&
  !test_bit(5, &key->flags);
}
# 348 "include/linux/key.h"
extern struct ctl_table key_sysctls[];




extern int install_thread_keyring_to_cred(struct cred *cred);
extern void key_fsuid_changed(struct task_struct *tsk);
extern void key_fsgid_changed(struct task_struct *tsk);
extern void key_init(void);
# 18 "include/linux/cred.h" 2
# 1 "include/linux/selinux.h" 1
# 17 "include/linux/selinux.h"
struct selinux_audit_rule;
struct audit_context;
struct kern_ipc_perm;
# 29 "include/linux/selinux.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool selinux_is_enabled(void)
{
 return false;
}
# 19 "include/linux/cred.h" 2



struct user_struct;
struct cred;
struct inode;







struct group_info {
 atomic_t usage;
 int ngroups;
 int nblocks;
 kgid_t small_block[32];
 kgid_t *blocks[0];
};
# 49 "include/linux/cred.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct group_info *get_group_info(struct group_info *gi)
{
 atomic_add(1, &gi->usage);
 return gi;
}
# 65 "include/linux/cred.h"
extern struct group_info *groups_alloc(int);
extern struct group_info init_groups;
extern void groups_free(struct group_info *);
extern int set_current_groups(struct group_info *);
extern void set_groups(struct cred *, struct group_info *);
extern int groups_search(const struct group_info *, kgid_t);
extern bool may_setgroups(void);





extern int in_group_p(kgid_t);
extern int in_egroup_p(kgid_t);
# 103 "include/linux/cred.h"
struct cred {
 atomic_t usage;







 kuid_t uid;
 kgid_t gid;
 kuid_t suid;
 kgid_t sgid;
 kuid_t euid;
 kgid_t egid;
 kuid_t fsuid;
 kgid_t fsgid;
 unsigned securebits;
 kernel_cap_t cap_inheritable;
 kernel_cap_t cap_permitted;
 kernel_cap_t cap_effective;
 kernel_cap_t cap_bset;

 unsigned char jit_keyring;

 struct key *session_keyring;
 struct key *process_keyring;
 struct key *thread_keyring;
 struct key *request_key_auth;




 struct user_struct *user;
 struct user_namespace *user_ns;
 struct group_info *group_info;
 struct callback_head rcu;
};

extern void __put_cred(struct cred *);
extern void exit_creds(struct task_struct *);
extern int copy_creds(struct task_struct *, unsigned long);
extern const struct cred *get_task_cred(struct task_struct *);
extern struct cred *cred_alloc_blank(void);
extern struct cred *prepare_creds(void);
extern struct cred *prepare_exec_creds(void);
extern int commit_creds(struct cred *);
extern void abort_creds(struct cred *);
extern const struct cred *override_creds(const struct cred *);
extern void revert_creds(const struct cred *);
extern struct cred *prepare_kernel_cred(struct task_struct *);
extern int change_create_files_as(struct cred *, struct inode *);
extern int set_security_override(struct cred *, u32);
extern int set_security_override_from_ctx(struct cred *, const char *);
extern int set_create_files_as(struct cred *, struct inode *);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) cred_init(void);
# 189 "include/linux/cred.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void validate_creds(const struct cred *cred)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void validate_creds_for_do_exit(struct task_struct *tsk)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void validate_process_creds(void)
{
}
# 207 "include/linux/cred.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cred *get_new_cred(struct cred *cred)
{
 atomic_add(1, &cred->usage);
 return cred;
}
# 226 "include/linux/cred.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cred *get_cred(const struct cred *cred)
{
 struct cred *nonconst_cred = (struct cred *) cred;
 validate_creds(cred);
 return get_new_cred(nonconst_cred);
}
# 244 "include/linux/cred.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_cred(const struct cred *_cred)
{
 struct cred *cred = (struct cred *) _cred;

 validate_creds(cred);
 if ((atomic_sub_return(1, &(cred)->usage) == 0))
  __put_cred(cred);
}
# 353 "include/linux/cred.h"
extern struct user_namespace init_user_ns;
# 57 "include/linux/sched.h" 2



# 1 "./include/uapi/linux/magic.h" 1
# 61 "include/linux/sched.h" 2
# 110 "include/linux/sched.h"
struct sched_attr {
 u32 size;

 u32 sched_policy;
 u64 sched_flags;


 s32 sched_nice;


 u32 sched_priority;


 u64 sched_runtime;
 u64 sched_deadline;
 u64 sched_period;
};

struct exec_domain;
struct futex_pi_state;
struct robust_list_head;
struct bio_list;
struct fs_struct;
struct perf_event_context;
struct blk_plug;
struct filename;
# 151 "include/linux/sched.h"
extern unsigned long avenrun[];
extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift);
# 166 "include/linux/sched.h"
extern unsigned long total_forks;
extern int nr_threads;
extern __attribute__((section(".data..percpu" ""))) __typeof__(unsigned long) process_counts;
extern int nr_processes(void);
extern unsigned long nr_running(void);
extern bool single_task_running(void);
extern unsigned long nr_iowait(void);
extern unsigned long nr_iowait_cpu(int cpu);
extern void get_iowait_load(unsigned long *nr_waiters, unsigned long *load);

extern void calc_global_load(unsigned long ticks);
extern void update_cpu_load_nohz(void);

extern unsigned long get_parent_ip(unsigned long addr);

extern void dump_cpu_task(int cpu);

struct seq_file;
struct cfs_rq;
struct task_group;
# 221 "include/linux/sched.h"
extern char ___assert_task_state[1 - 2*!!(
  sizeof("RSDTtXZxKWP")-1 != ( __builtin_constant_p(1024) ? ( (1024) < 1 ? ____ilog2_NaN() : (1024) & (1ULL << 63) ? 63 : (1024) & (1ULL << 62) ? 62 : (1024) & (1ULL << 61) ? 61 : (1024) & (1ULL << 60) ? 60 : (1024) & (1ULL << 59) ? 59 : (1024) & (1ULL << 58) ? 58 : (1024) & (1ULL << 57) ? 57 : (1024) & (1ULL << 56) ? 56 : (1024) & (1ULL << 55) ? 55 : (1024) & (1ULL << 54) ? 54 : (1024) & (1ULL << 53) ? 53 : (1024) & (1ULL << 52) ? 52 : (1024) & (1ULL << 51) ? 51 : (1024) & (1ULL << 50) ? 50 : (1024) & (1ULL << 49) ? 49 : (1024) & (1ULL << 48) ? 48 : (1024) & (1ULL << 47) ? 47 : (1024) & (1ULL << 46) ? 46 : (1024) & (1ULL << 45) ? 45 : (1024) & (1ULL << 44) ? 44 : (1024) & (1ULL << 43) ? 43 : (1024) & (1ULL << 42) ? 42 : (1024) & (1ULL << 41) ? 41 : (1024) & (1ULL << 40) ? 40 : (1024) & (1ULL << 39) ? 39 : (1024) & (1ULL << 38) ? 38 : (1024) & (1ULL << 37) ? 37 : (1024) & (1ULL << 36) ? 36 : (1024) & (1ULL << 35) ? 35 : (1024) & (1ULL << 34) ? 34 : (1024) & (1ULL << 33) ? 33 : (1024) & (1ULL << 32) ? 32 : (1024) & (1ULL << 31) ? 31 : (1024) & (1ULL << 30) ? 30 : (1024) & (1ULL << 29) ? 29 : (1024) & (1ULL << 28) ? 28 : (1024) & (1ULL << 27) ? 27 : (1024) & (1ULL << 26) ? 26 : (1024) & (1ULL << 25) ? 25 : (1024) & (1ULL << 24) ? 24 : (1024) & (1ULL << 23) ? 23 : (1024) & (1ULL << 22) ? 22 : (1024) & (1ULL << 21) ? 21 : (1024) & (1ULL << 20) ? 20 : (1024) & (1ULL << 19) ? 19 : (1024) & (1ULL << 18) ? 18 : (1024) & (1ULL << 17) ? 17 : (1024) & (1ULL << 16) ? 16 : (1024) & (1ULL << 15) ? 15 : (1024) & (1ULL << 14) ? 14 : (1024) & (1ULL << 13) ? 13 : (1024) & (1ULL << 12) ? 12 : (1024) & (1ULL << 11) ? 11 : (1024) & (1ULL << 10) ? 10 : (1024) & (1ULL << 9) ? 9 : (1024) & (1ULL << 8) ? 8 : (1024) & (1ULL << 7) ? 7 : (1024) & (1ULL << 6) ? 6 : (1024) & (1ULL << 5) ? 5 : (1024) & (1ULL << 4) ? 4 : (1024) & (1ULL << 3) ? 3 : (1024) & (1ULL << 2) ? 2 : (1024) & (1ULL << 1) ? 1 : (1024) & (1ULL << 0) ? 0 : ____ilog2_NaN() ) : (sizeof(1024) <= 4) ? __ilog2_u32(1024) : __ilog2_u64(1024) )+1)];
# 317 "include/linux/sched.h"
extern rwlock_t tasklist_lock;
extern spinlock_t mmlist_lock;

struct task_struct;





extern void sched_init(void);
extern void sched_init_smp(void);
extern void schedule_tail(struct task_struct *prev);
extern void init_idle(struct task_struct *idle, int cpu);
extern void init_idle_bootup_task(struct task_struct *idle);

extern int runqueue_is_locked(int cpu);


extern void nohz_balance_enter_idle(int cpu);
extern void set_cpu_sd_state_idle(void);
extern int get_nohz_timer_target(int pinned);
# 350 "include/linux/sched.h"
extern void show_state_filter(unsigned long state_filter);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void show_state(void)
{
 show_state_filter(0);
}

extern void show_regs(struct pt_regs *);






extern void show_stack(struct task_struct *task, unsigned long *sp);

void io_schedule(void);
long io_schedule_timeout(long timeout);

extern void cpu_init (void);
extern void trap_init(void);
extern void update_process_times(int user);
extern void scheduler_tick(void);

extern void sched_show_task(struct task_struct *p);


extern void touch_softlockup_watchdog(void);
extern void touch_softlockup_watchdog_sync(void);
extern void touch_all_softlockup_watchdogs(void);
extern int proc_dowatchdog_thresh(struct ctl_table *table, int write,
      void *buffer,
      size_t *lenp, loff_t *ppos);
extern unsigned int softlockup_panic;
void lockup_detector_init(void);
# 401 "include/linux/sched.h"
void reset_hung_task_detector(void);
# 412 "include/linux/sched.h"
extern char __sched_text_start[], __sched_text_end[];


extern int in_sched_functions(unsigned long addr);


extern signed long schedule_timeout(signed long timeout);
extern signed long schedule_timeout_interruptible(signed long timeout);
extern signed long schedule_timeout_killable(signed long timeout);
extern signed long schedule_timeout_uninterruptible(signed long timeout);
 void schedule(void);
extern void schedule_preempt_disabled(void);

struct nsproxy;
struct user_namespace;


extern void arch_pick_mmap_layout(struct mm_struct *mm);
extern unsigned long
arch_get_unmapped_area(struct file *, unsigned long, unsigned long,
         unsigned long, unsigned long);
extern unsigned long
arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
     unsigned long len, unsigned long pgoff,
     unsigned long flags);
# 451 "include/linux/sched.h"
extern void set_dumpable(struct mm_struct *mm, int value);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __get_dumpable(unsigned long mm_flags)
{
 return mm_flags & ((1 << 2) - 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_dumpable(struct mm_struct *mm)
{
 return __get_dumpable(mm->flags);
}
# 500 "include/linux/sched.h"
struct sighand_struct {
 atomic_t count;
 struct k_sigaction action[64];
 spinlock_t siglock;
 wait_queue_head_t signalfd_wqh;
};

struct pacct_struct {
 int ac_flag;
 long ac_exitcode;
 unsigned long ac_mem;
 cputime_t ac_utime, ac_stime;
 unsigned long ac_minflt, ac_majflt;
};

struct cpu_itimer {
 cputime_t expires;
 cputime_t incr;
 u32 error;
 u32 incr_error;
};
# 529 "include/linux/sched.h"
struct cputime {
 cputime_t utime;
 cputime_t stime;
};
# 548 "include/linux/sched.h"
struct task_cputime {
 cputime_t utime;
 cputime_t stime;
 unsigned long long sum_exec_runtime;
};
# 590 "include/linux/sched.h"
struct thread_group_cputimer {
 struct task_cputime cputime;
 int running;
 raw_spinlock_t lock;
};


struct autogroup;
# 606 "include/linux/sched.h"
struct signal_struct {
 atomic_t sigcnt;
 atomic_t live;
 int nr_threads;
 struct list_head thread_head;

 wait_queue_head_t wait_chldexit;


 struct task_struct *curr_target;


 struct sigpending shared_pending;


 int group_exit_code;





 int notify_count;
 struct task_struct *group_exit_task;


 int group_stop_count;
 unsigned int flags;
# 643 "include/linux/sched.h"
 unsigned int is_child_subreaper:1;
 unsigned int has_child_subreaper:1;


 int posix_timer_id;
 struct list_head posix_timers;


 struct hrtimer real_timer;
 struct pid *leader_pid;
 ktime_t it_real_incr;






 struct cpu_itimer it[2];





 struct thread_group_cputimer cputimer;


 struct task_cputime cputime_expires;

 struct list_head cpu_timers[3];

 struct pid *tty_old_pgrp;


 int leader;

 struct tty_struct *tty;
# 689 "include/linux/sched.h"
 seqlock_t stats_lock;
 cputime_t utime, stime, cutime, cstime;
 cputime_t gtime;
 cputime_t cgtime;

 struct cputime prev_cputime;

 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
 unsigned long inblock, oublock, cinblock, coublock;
 unsigned long maxrss, cmaxrss;
 struct task_io_accounting ioac;







 unsigned long long sum_sched_runtime;
# 719 "include/linux/sched.h"
 struct rlimit rlim[16];
# 745 "include/linux/sched.h"
 oom_flags_t oom_flags;
 short oom_score_adj;
 short oom_score_adj_min;


 struct mutex cred_guard_mutex;


};
# 772 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int signal_group_exit(const struct signal_struct *sig)
{
 return (sig->flags & 0x00000004) ||
  (sig->group_exit_task != ((void *)0));
}




struct user_struct {
 atomic_t __count;
 atomic_t processes;
 atomic_t sigpending;

 atomic_t inotify_watches;
 atomic_t inotify_devs;





 atomic_long_t epoll_watches;



 unsigned long mq_bytes;

 unsigned long locked_shm;


 struct key *uid_keyring;
 struct key *session_keyring;



 struct hlist_node uidhash_node;
 kuid_t uid;


 atomic_long_t locked_vm;

};

extern int uids_sysfs_init(void);

extern struct user_struct *find_user(kuid_t);

extern struct user_struct root_user;



struct backing_dev_info;
struct reclaim_state;


struct sched_info {

 unsigned long pcount;
 unsigned long long run_delay;


 unsigned long long last_arrival,
      last_queued;
};
# 872 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sched_info_on(void)
{

 return 1;






}

enum cpu_idle_type {
 CPU_IDLE,
 CPU_NOT_IDLE,
 CPU_NEWLY_IDLE,
 CPU_MAX_IDLE_TYPES
};
# 917 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_smt_flags(void)
{
 return 0x0080 | 0x0200;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_core_flags(void)
{
 return 0x0200;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_numa_flags(void)
{
 return 0x4000;
}


struct sched_domain_attr {
 int relax_domain_level;
};





extern int sched_domain_level_max;

struct sched_group;

struct sched_domain {

 struct sched_domain *parent;
 struct sched_domain *child;
 struct sched_group *groups;
 unsigned long min_interval;
 unsigned long max_interval;
 unsigned int busy_factor;
 unsigned int imbalance_pct;
 unsigned int cache_nice_tries;
 unsigned int busy_idx;
 unsigned int idle_idx;
 unsigned int newidle_idx;
 unsigned int wake_idx;
 unsigned int forkexec_idx;
 unsigned int smt_gain;

 int nohz_idle;
 int flags;
 int level;


 unsigned long last_balance;
 unsigned int balance_interval;
 unsigned int nr_balance_failed;


 u64 max_newidle_lb_cost;
 unsigned long next_decay_max_lb_cost;



 unsigned int lb_count[CPU_MAX_IDLE_TYPES];
 unsigned int lb_failed[CPU_MAX_IDLE_TYPES];
 unsigned int lb_balanced[CPU_MAX_IDLE_TYPES];
 unsigned int lb_imbalance[CPU_MAX_IDLE_TYPES];
 unsigned int lb_gained[CPU_MAX_IDLE_TYPES];
 unsigned int lb_hot_gained[CPU_MAX_IDLE_TYPES];
 unsigned int lb_nobusyg[CPU_MAX_IDLE_TYPES];
 unsigned int lb_nobusyq[CPU_MAX_IDLE_TYPES];


 unsigned int alb_count;
 unsigned int alb_failed;
 unsigned int alb_pushed;


 unsigned int sbe_count;
 unsigned int sbe_balanced;
 unsigned int sbe_pushed;


 unsigned int sbf_count;
 unsigned int sbf_balanced;
 unsigned int sbf_pushed;


 unsigned int ttwu_wake_remote;
 unsigned int ttwu_move_affine;
 unsigned int ttwu_move_balance;




 union {
  void *private;
  struct callback_head rcu;
 };

 unsigned int span_weight;







 unsigned long span[0];
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cpumask *sched_domain_span(struct sched_domain *sd)
{
 return ((struct cpumask *)(1 ? (sd->span) : (void *)sizeof(__check_is_bitmap(sd->span))));
}

extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
        struct sched_domain_attr *dattr_new);


cpumask_var_t *alloc_sched_domains(unsigned int ndoms);
void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms);

bool cpus_share_cache(int this_cpu, int that_cpu);

typedef const struct cpumask *(*sched_domain_mask_f)(int cpu);
typedef int (*sched_domain_flags_f)(void);



struct sd_data {
 struct sched_domain ** sd;
 struct sched_group ** sg;
 struct sched_group_capacity ** sgc;
};

struct sched_domain_topology_level {
 sched_domain_mask_f mask;
 sched_domain_flags_f sd_flags;
 int flags;
 int numa_level;
 struct sd_data data;



};

extern struct sched_domain_topology_level *sched_domain_topology;

extern void set_sched_topology(struct sched_domain_topology_level *tl);
extern void wake_up_if_idle(int cpu);
# 1094 "include/linux/sched.h"
struct io_context;





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void prefetch_stack(struct task_struct *t) { }


struct audit_context;
struct mempolicy;
struct pipe_inode_info;
struct uts_namespace;

struct load_weight {
 unsigned long weight;
 u32 inv_weight;
};

struct sched_avg {





 u32 runnable_avg_sum, runnable_avg_period;
 u64 last_runnable_update;
 s64 decay_count;
 unsigned long load_avg_contrib;
};


struct sched_statistics {
 u64 wait_start;
 u64 wait_max;
 u64 wait_count;
 u64 wait_sum;
 u64 iowait_count;
 u64 iowait_sum;

 u64 sleep_start;
 u64 sleep_max;
 s64 sum_sleep_runtime;

 u64 block_start;
 u64 block_max;
 u64 exec_max;
 u64 slice_max;

 u64 nr_migrations_cold;
 u64 nr_failed_migrations_affine;
 u64 nr_failed_migrations_running;
 u64 nr_failed_migrations_hot;
 u64 nr_forced_migrations;

 u64 nr_wakeups;
 u64 nr_wakeups_sync;
 u64 nr_wakeups_migrate;
 u64 nr_wakeups_local;
 u64 nr_wakeups_remote;
 u64 nr_wakeups_affine;
 u64 nr_wakeups_affine_attempts;
 u64 nr_wakeups_passive;
 u64 nr_wakeups_idle;
};


struct sched_entity {
 struct load_weight load;
 struct rb_node run_node;
 struct list_head group_node;
 unsigned int on_rq;

 u64 exec_start;
 u64 sum_exec_runtime;
 u64 vruntime;
 u64 prev_sum_exec_runtime;

 u64 nr_migrations;


 struct sched_statistics statistics;
# 1189 "include/linux/sched.h"
 struct sched_avg avg;

};

struct sched_rt_entity {
 struct list_head run_list;
 unsigned long timeout;
 unsigned long watchdog_stamp;
 unsigned int time_slice;

 struct sched_rt_entity *back;







};

struct sched_dl_entity {
 struct rb_node rb_node;






 u64 dl_runtime;
 u64 dl_deadline;
 u64 dl_period;
 u64 dl_bw;






 s64 runtime;
 u64 deadline;
 unsigned int flags;
# 1249 "include/linux/sched.h"
 int dl_throttled, dl_new, dl_boosted, dl_yielded;





 struct hrtimer dl_timer;
};

union rcu_special {
 struct {
  bool blocked;
  bool need_qs;
 } b;
 short s;
};
struct rcu_node;

enum perf_event_task_context {
 perf_invalid_context = -1,
 perf_hw_context = 0,
 perf_sw_context,
 perf_nr_task_contexts,
};

struct task_struct {
 volatile long state;
 void *stack;
 atomic_t usage;
 unsigned int flags;
 unsigned int ptrace;


 struct llist_node wake_entry;
 int on_cpu;
 struct task_struct *last_wakee;
 unsigned long wakee_flips;
 unsigned long wakee_flip_decay_ts;

 int wake_cpu;

 int on_rq;

 int prio, static_prio, normal_prio;
 unsigned int rt_priority;
 const struct sched_class *sched_class;
 struct sched_entity se;
 struct sched_rt_entity rt;



 struct sched_dl_entity dl;







 unsigned int btrace_seq;


 unsigned int policy;
 int nr_cpus_allowed;
 cpumask_t cpus_allowed;
# 1331 "include/linux/sched.h"
 struct sched_info sched_info;


 struct list_head tasks;

 struct plist_node pushable_tasks;
 struct rb_node pushable_dl_tasks;


 struct mm_struct *mm, *active_mm;




 u32 vmacache_seqnum;
 struct vm_area_struct *vmacache[(1U << 2)];

 struct task_rss_stat rss_stat;


 int exit_state;
 int exit_code, exit_signal;
 int pdeath_signal;
 unsigned int jobctl;


 unsigned int personality;

 unsigned in_execve:1;

 unsigned in_iowait:1;


 unsigned sched_reset_on_fork:1;
 unsigned sched_contributes_to_load:1;





 unsigned long atomic_flags;

 struct restart_block restart_block;

 pid_t pid;
 pid_t tgid;
# 1387 "include/linux/sched.h"
 struct task_struct *real_parent;
 struct task_struct *parent;



 struct list_head children;
 struct list_head sibling;
 struct task_struct *group_leader;






 struct list_head ptraced;
 struct list_head ptrace_entry;


 struct pid_link pids[PIDTYPE_MAX];
 struct list_head thread_group;
 struct list_head thread_node;

 struct completion *vfork_done;
 int *set_child_tid;
 int *clear_child_tid;

 cputime_t utime, stime, utimescaled, stimescaled;
 cputime_t gtime;

 struct cputime prev_cputime;
# 1427 "include/linux/sched.h"
 unsigned long nvcsw, nivcsw;
 u64 start_time;
 u64 real_start_time;

 unsigned long min_flt, maj_flt;

 struct task_cputime cputime_expires;
 struct list_head cpu_timers[3];


 const struct cred *real_cred;

 const struct cred *cred;

 char comm[16];




 int link_count, total_link_count;


 struct sysv_sem sysvsem;
 struct sysv_shm sysvshm;



 unsigned long last_switch_count;


 struct thread_struct thread;

 struct fs_struct *fs;

 struct files_struct *files;

 struct nsproxy *nsproxy;

 struct signal_struct *signal;
 struct sighand_struct *sighand;

 sigset_t blocked, real_blocked;
 sigset_t saved_sigmask;
 struct sigpending pending;

 unsigned long sas_ss_sp;
 size_t sas_ss_size;
 int (*notifier)(void *priv);
 void *notifier_data;
 sigset_t *notifier_mask;
 struct callback_head *task_works;

 struct audit_context *audit_context;




 struct seccomp seccomp;


    u32 parent_exec_id;
    u32 self_exec_id;


 spinlock_t alloc_lock;


 raw_spinlock_t pi_lock;



 struct rb_root pi_waiters;
 struct rb_node *pi_waiters_leftmost;

 struct rt_mutex_waiter *pi_blocked_on;
# 1533 "include/linux/sched.h"
 void *journal_info;


 struct bio_list *bio_list;



 struct blk_plug *plug;



 struct reclaim_state *reclaim_state;

 struct backing_dev_info *backing_dev_info;

 struct io_context *io_context;

 unsigned long ptrace_message;
 siginfo_t *last_siginfo;
 struct task_io_accounting ioac;
# 1571 "include/linux/sched.h"
 struct robust_list_head *robust_list;

 struct compat_robust_list_head *compat_robust_list;

 struct list_head pi_state_list;
 struct futex_pi_state *pi_state_cache;


 struct perf_event_context *perf_event_ctxp[perf_nr_task_contexts];
 struct mutex perf_event_mutex;
 struct list_head perf_event_list;





 struct mempolicy *mempolicy;
 short il_next;
 short pref_node_fork;
# 1633 "include/linux/sched.h"
 struct callback_head rcu;




 struct pipe_inode_info *splice_pipe;

 struct page_frag task_frag;
# 1652 "include/linux/sched.h"
 int nr_dirtied;
 int nr_dirtied_pause;
 unsigned long dirty_paused_when;
# 1664 "include/linux/sched.h"
 unsigned long timer_slack_ns;
 unsigned long default_timer_slack_ns;
# 1687 "include/linux/sched.h"
 unsigned long trace;

 unsigned long trace_recursion;
# 1709 "include/linux/sched.h"
};
# 1727 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_numa_fault(int last_node, int node, int pages,
       int flags)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_numa_group_id(struct task_struct *p)
{
 return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_numabalancing_state(bool enabled)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_numa_free(struct task_struct *p)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool should_numa_migrate_memory(struct task_struct *p,
    struct page *page, int src_nid, int dst_cpu)
{
 return true;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *task_pid(struct task_struct *task)
{
 return task->pids[PIDTYPE_PID].pid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *task_tgid(struct task_struct *task)
{
 return task->group_leader->pids[PIDTYPE_PID].pid;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *task_pgrp(struct task_struct *task)
{
 return task->group_leader->pids[PIDTYPE_PGID].pid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *task_session(struct task_struct *task)
{
 return task->group_leader->pids[PIDTYPE_SID].pid;
}

struct pid_namespace;
# 1788 "include/linux/sched.h"
pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type,
   struct pid_namespace *ns);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pid_nr(struct task_struct *tsk)
{
 return tsk->pid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pid_nr_ns(struct task_struct *tsk,
     struct pid_namespace *ns)
{
 return __task_pid_nr_ns(tsk, PIDTYPE_PID, ns);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pid_vnr(struct task_struct *tsk)
{
 return __task_pid_nr_ns(tsk, PIDTYPE_PID, ((void *)0));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_tgid_nr(struct task_struct *tsk)
{
 return tsk->tgid;
}

pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_tgid_vnr(struct task_struct *tsk)
{
 return pid_vnr(task_tgid(tsk));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pid_alive(const struct task_struct *p);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns)
{
 pid_t pid = 0;

 rcu_read_lock();
 if (pid_alive(tsk))
  pid = task_tgid_nr_ns(({ typeof(*(tsk->real_parent)) *________p1 = (typeof(*(tsk->real_parent)) *)({ typeof((tsk->real_parent)) _________p1 = (*({ __attribute__((unused)) typeof((tsk->real_parent)) __var = ( typeof((tsk->real_parent))) 0; (volatile typeof((tsk->real_parent)) *)&((tsk->real_parent)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(tsk->real_parent)) *)(________p1)); }), ns);
 rcu_read_unlock();

 return pid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_ppid_nr(const struct task_struct *tsk)
{
 return task_ppid_nr_ns(tsk, &init_pid_ns);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pgrp_nr_ns(struct task_struct *tsk,
     struct pid_namespace *ns)
{
 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, ns);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pgrp_vnr(struct task_struct *tsk)
{
 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, ((void *)0));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_session_nr_ns(struct task_struct *tsk,
     struct pid_namespace *ns)
{
 return __task_pid_nr_ns(tsk, PIDTYPE_SID, ns);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_session_vnr(struct task_struct *tsk)
{
 return __task_pid_nr_ns(tsk, PIDTYPE_SID, ((void *)0));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pgrp_nr(struct task_struct *tsk)
{
 return task_pgrp_nr_ns(tsk, &init_pid_ns);
}
# 1878 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pid_alive(const struct task_struct *p)
{
 return p->pids[PIDTYPE_PID].pid != ((void *)0);
}
# 1891 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_global_init(struct task_struct *tsk)
{
 return tsk->pid == 1;
}

extern struct pid *cad_pid;

extern void free_task(struct task_struct *tsk);


extern void __put_task_struct(struct task_struct *t);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_task_struct(struct task_struct *t)
{
 if ((atomic_sub_return(1, &t->usage) == 0))
  __put_task_struct(t);
}
# 1916 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_cputime(struct task_struct *t,
    cputime_t *utime, cputime_t *stime)
{
 if (utime)
  *utime = t->utime;
 if (stime)
  *stime = t->stime;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_cputime_scaled(struct task_struct *t,
           cputime_t *utimescaled,
           cputime_t *stimescaled)
{
 if (utimescaled)
  *utimescaled = t->utimescaled;
 if (stimescaled)
  *stimescaled = t->stimescaled;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) cputime_t task_gtime(struct task_struct *t)
{
 return t->gtime;
}

extern void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
# 2002 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gfp_t memalloc_noio_flags(gfp_t flags)
{
 if (__builtin_expect(!!(current->flags & 0x00080000), 0))
  flags &= ~((( gfp_t)0x40u) | (( gfp_t)0x80u));
 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int memalloc_noio_save(void)
{
 unsigned int flags = current->flags & 0x00080000;
 current->flags |= 0x00080000;
 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void memalloc_noio_restore(unsigned int flags)
{
 current->flags = (current->flags & ~0x00080000) | flags;
}
# 2037 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool task_no_new_privs(struct task_struct *p) { return test_bit(0, &p->atomic_flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_set_no_new_privs(struct task_struct *p) { set_bit(0, &p->atomic_flags); }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool task_spread_page(struct task_struct *p) { return test_bit(1, &p->atomic_flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_set_spread_page(struct task_struct *p) { set_bit(1, &p->atomic_flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_clear_spread_page(struct task_struct *p) { clear_bit(1, &p->atomic_flags); }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool task_spread_slab(struct task_struct *p) { return test_bit(2, &p->atomic_flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_set_spread_slab(struct task_struct *p) { set_bit(2, &p->atomic_flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_clear_spread_slab(struct task_struct *p) { clear_bit(2, &p->atomic_flags); }
# 2072 "include/linux/sched.h"
extern bool task_set_jobctl_pending(struct task_struct *task,
        unsigned int mask);
extern void task_clear_jobctl_trapping(struct task_struct *task);
extern void task_clear_jobctl_pending(struct task_struct *task,
          unsigned int mask);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_copy_process(struct task_struct *p)
{
# 2091 "include/linux/sched.h"
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tsk_restore_flags(struct task_struct *task,
    unsigned long orig_flags, unsigned long flags)
{
 task->flags &= ~flags;
 task->flags |= orig_flags & flags;
}

extern int cpuset_cpumask_can_shrink(const struct cpumask *cur,
         const struct cpumask *trial);
extern int task_can_attach(struct task_struct *p,
      const struct cpumask *cs_cpus_allowed);

extern void do_set_cpus_allowed(struct task_struct *p,
          const struct cpumask *new_mask);

extern int set_cpus_allowed_ptr(struct task_struct *p,
    const struct cpumask *new_mask);
# 2125 "include/linux/sched.h"
void calc_load_enter_idle(void);
void calc_load_exit_idle(void);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
{
 return set_cpus_allowed_ptr(p, &new_mask);
}
# 2147 "include/linux/sched.h"
extern unsigned long long __attribute__((no_instrument_function)) sched_clock(void);



extern u64 cpu_clock(int cpu);
extern u64 local_clock(void);
extern u64 running_clock(void);
extern u64 sched_clock_cpu(int cpu);


extern void sched_clock_init(void);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_clock_tick(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_clock_idle_sleep_event(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_clock_idle_wakeup_event(u64 delta_ns)
{
}
# 2196 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void enable_sched_clock_irqtime(void) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void disable_sched_clock_irqtime(void) {}


extern unsigned long long
task_sched_runtime(struct task_struct *task);



extern void sched_exec(void);




extern void sched_clock_idle_sleep_event(void);
extern void sched_clock_idle_wakeup_event(u64 delta_ns);


extern void idle_task_exit(void);





extern void wake_up_nohz_cpu(int cpu);
# 2229 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sched_can_stop_tick(void) { return false; }
# 2242 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_autogroup_create_attach(struct task_struct *p) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_autogroup_detach(struct task_struct *p) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_autogroup_fork(struct signal_struct *sig) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_autogroup_exit(struct signal_struct *sig) { }


extern int yield_to(struct task_struct *p, bool preempt);
extern void set_user_nice(struct task_struct *p, long nice);
extern int task_prio(const struct task_struct *p);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int task_nice(const struct task_struct *p)
{
 return (((p)->static_prio) - (100 + (19 - -20 + 1) / 2));
}
extern int can_nice(const struct task_struct *p, const int nice);
extern int task_curr(const struct task_struct *p);
extern int idle_cpu(int cpu);
extern int sched_setscheduler(struct task_struct *, int,
         const struct sched_param *);
extern int sched_setscheduler_nocheck(struct task_struct *, int,
          const struct sched_param *);
extern int sched_setattr(struct task_struct *,
    const struct sched_attr *);
extern struct task_struct *idle_task(int cpu);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_idle_task(const struct task_struct *p)
{
 return p->pid == 0;
}
extern struct task_struct *curr_task(int cpu);
extern void set_curr_task(int cpu, struct task_struct *p);

void yield(void);




extern struct exec_domain default_exec_domain;

union thread_union {
 struct thread_info thread_info;
 unsigned long stack[(2*((1UL) << 13))/sizeof(long)];
};


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kstack_end(void *addr)
{



 return !(((unsigned long)addr+sizeof(void*)-1) & ((2*((1UL) << 13))-sizeof(void*)));
}


extern union thread_union init_thread_union;
extern struct task_struct init_task;

extern struct mm_struct init_mm;

extern struct pid_namespace init_pid_ns;
# 2324 "include/linux/sched.h"
extern struct task_struct *find_task_by_vpid(pid_t nr);
extern struct task_struct *find_task_by_pid_ns(pid_t nr,
  struct pid_namespace *ns);


extern struct user_struct * alloc_uid(kuid_t);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct user_struct *get_uid(struct user_struct *u)
{
 atomic_add(1, &u->__count);
 return u;
}
extern void free_uid(struct user_struct *);



extern void xtime_update(unsigned long ticks);

extern int wake_up_state(struct task_struct *tsk, unsigned int state);
extern int wake_up_process(struct task_struct *tsk);
extern void wake_up_new_task(struct task_struct *tsk);

 extern void kick_process(struct task_struct *tsk);



extern int sched_fork(unsigned long clone_flags, struct task_struct *p);
extern void sched_dead(struct task_struct *p);

extern void proc_caches_init(void);
extern void flush_signals(struct task_struct *);
extern void __flush_signals(struct task_struct *);
extern void ignore_signals(struct task_struct *);
extern void flush_signal_handlers(struct task_struct *, int force_default);
extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dequeue_signal_lock(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
{
 unsigned long flags;
 int ret;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(&tsk->sighand->siglock)); } while (0); } while (0);
 ret = dequeue_signal(tsk, mask, info);
 spin_unlock_irqrestore(&tsk->sighand->siglock, flags);

 return ret;
}

extern void block_all_signals(int (*notifier)(void *priv), void *priv,
         sigset_t *mask);
extern void unblock_all_signals(void);
extern void release_task(struct task_struct * p);
extern int send_sig_info(int, struct siginfo *, struct task_struct *);
extern int force_sigsegv(int, struct task_struct *);
extern int force_sig_info(int, struct siginfo *, struct task_struct *);
extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp);
extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid);
extern int kill_pid_info_as_cred(int, struct siginfo *, struct pid *,
    const struct cred *, u32);
extern int kill_pgrp(struct pid *pid, int sig, int priv);
extern int kill_pid(struct pid *pid, int sig, int priv);
extern int kill_proc_info(int, struct siginfo *, pid_t);
extern __attribute__((warn_unused_result)) bool do_notify_parent(struct task_struct *, int);
extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
extern void force_sig(int, struct task_struct *);
extern int send_sig(int, struct task_struct *, int);
extern int zap_other_threads(struct task_struct *p);
extern struct sigqueue *sigqueue_alloc(void);
extern void sigqueue_free(struct sigqueue *);
extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group);
extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void restore_saved_sigmask(void)
{
 if (test_and_clear_restore_sigmask())
  __set_current_blocked(&current->saved_sigmask);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) sigset_t *sigmask_to_save(void)
{
 sigset_t *res = &current->blocked;
 if (__builtin_expect(!!(test_restore_sigmask()), 0))
  res = &current->saved_sigmask;
 return res;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kill_cad_pid(int sig, int priv)
{
 return kill_pid(cad_pid, sig, priv);
}
# 2422 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int on_sig_stack(unsigned long sp)
{




 return sp > current->sas_ss_sp &&
  sp - current->sas_ss_sp <= current->sas_ss_size;

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sas_ss_flags(unsigned long sp)
{
 if (!current->sas_ss_size)
  return 2;

 return on_sig_stack(sp) ? 1 : 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long sigsp(unsigned long sp, struct ksignal *ksig)
{
 if (__builtin_expect(!!((ksig->ka.sa.sa_flags & 1u)), 0) && ! sas_ss_flags(sp))



  return current->sas_ss_sp + current->sas_ss_size;

 return sp;
}




extern struct mm_struct * mm_alloc(void);


extern void __mmdrop(struct mm_struct *);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mmdrop(struct mm_struct * mm)
{
 if (__builtin_expect(!!((atomic_sub_return(1, &mm->mm_count) == 0)), 0))
  __mmdrop(mm);
}


extern void mmput(struct mm_struct *);

extern struct mm_struct *get_task_mm(struct task_struct *task);





extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode);

extern void mm_release(struct task_struct *, struct mm_struct *);

extern int copy_thread(unsigned long, unsigned long, unsigned long,
   struct task_struct *);
extern void flush_thread(void);
extern void exit_thread(void);

extern void exit_files(struct task_struct *);
extern void __cleanup_sighand(struct sighand_struct *);

extern void exit_itimers(struct signal_struct *);
extern void flush_itimer_signals(void);

extern void do_group_exit(int);

extern int do_execve(struct filename *,
       const char * const *,
       const char * const *);
extern int do_execveat(int, struct filename *,
         const char * const *,
         const char * const *,
         int);
extern long do_fork(unsigned long, unsigned long, unsigned long, int *, int *);
struct task_struct *fork_idle(int);
extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);

extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_task_comm(struct task_struct *tsk, const char *from)
{
 __set_task_comm(tsk, from, false);
}
extern char *get_task_comm(char *to, struct task_struct *tsk);


void scheduler_ipi(void);
extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
# 2527 "include/linux/sched.h"
extern bool current_is_single_threaded(void);
# 2549 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_nr_threads(struct task_struct *tsk)
{
 return tsk->signal->nr_threads;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool thread_group_leader(struct task_struct *p)
{
 return p->exit_signal >= 0;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool has_group_leader_pid(struct task_struct *p)
{
 return task_pid(p) == p->signal->leader_pid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
bool same_thread_group(struct task_struct *p1, struct task_struct *p2)
{
 return p1->signal == p2->signal;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct task_struct *next_thread(const struct task_struct *p)
{
 return ({ typeof(*p->thread_group.next) *__ptr = (typeof(*p->thread_group.next) *)p->thread_group.next; ({ const typeof( ((struct task_struct *)0)->thread_group ) *__mptr = ((typeof(p->thread_group.next))({ typeof(*(__ptr)) *________p1 = (typeof(*(__ptr)) *)({ typeof((__ptr)) _________p1 = (*({ __attribute__((unused)) typeof((__ptr)) __var = ( typeof((__ptr))) 0; (volatile typeof((__ptr)) *)&((__ptr)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(__ptr)) *)(________p1)); })); (struct task_struct *)( (char *)__mptr - __builtin_offsetof(struct task_struct,thread_group) );}); })
                                          ;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int thread_group_empty(struct task_struct *p)
{
 return list_empty(&p->thread_group);
}
# 2600 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_lock(struct task_struct *p)
{
 spin_lock(&p->alloc_lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_unlock(struct task_struct *p)
{
 spin_unlock(&p->alloc_lock);
}

extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
       unsigned long *flags);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sighand_struct *lock_task_sighand(struct task_struct *tsk,
             unsigned long *flags)
{
 struct sighand_struct *ret;

 ret = __lock_task_sighand(tsk, flags);
 (void)(ret);
 return ret;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unlock_task_sighand(struct task_struct *tsk,
      unsigned long *flags)
{
 spin_unlock_irqrestore(&tsk->sighand->siglock, *flags);
}
# 2671 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void threadgroup_change_begin(struct task_struct *tsk) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void threadgroup_change_end(struct task_struct *tsk) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void threadgroup_lock(struct task_struct *tsk) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void threadgroup_unlock(struct task_struct *tsk) {}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void setup_thread_stack(struct task_struct *p, struct task_struct *org)
{
 *((struct thread_info *)(p)->stack) = *((struct thread_info *)(org)->stack);
 ((struct thread_info *)(p)->stack)->task = p;
}
# 2697 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long *end_of_stack(struct task_struct *p)
{



 return (unsigned long *)(((struct thread_info *)(p)->stack) + 1);

}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int object_is_on_stack(void *obj)
{
 void *stack = ((current)->stack);

 return (obj >= stack) && (obj < (stack + (2*((1UL) << 13))));
}

extern void thread_info_cache_init(void);
# 2731 "include/linux/sched.h"
extern void set_task_stack_end_magic(struct task_struct *tsk);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_tsk_thread_flag(struct task_struct *tsk, int flag)
{
 set_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_tsk_thread_flag(struct task_struct *tsk, int flag)
{
 clear_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag)
{
 return test_and_set_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag)
{
 return test_and_clear_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_tsk_thread_flag(struct task_struct *tsk, int flag)
{
 return test_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_tsk_need_resched(struct task_struct *tsk)
{
 set_tsk_thread_flag(tsk,3);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_tsk_need_resched(struct task_struct *tsk)
{
 clear_tsk_thread_flag(tsk,3);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_tsk_need_resched(struct task_struct *tsk)
{
 return __builtin_expect(!!(test_tsk_thread_flag(tsk,3)), 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int restart_syscall(void)
{
 set_tsk_thread_flag(current, 2);
 return -513;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int signal_pending(struct task_struct *p)
{
 return __builtin_expect(!!(test_tsk_thread_flag(p,2)), 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __fatal_signal_pending(struct task_struct *p)
{
 return __builtin_expect(!!(sigismember(&p->pending.signal, 9)), 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fatal_signal_pending(struct task_struct *p)
{
 return signal_pending(p) && __fatal_signal_pending(p);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int signal_pending_state(long state, struct task_struct *p)
{
 if (!(state & (1 | 128)))
  return 0;
 if (!signal_pending(p))
  return 0;

 return (state & 1) || __fatal_signal_pending(p);
}
# 2814 "include/linux/sched.h"
extern int _cond_resched(void);






extern int __cond_resched_lock(spinlock_t *lock);
# 2834 "include/linux/sched.h"
extern int __cond_resched_softirq(void);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cond_resched_rcu(void)
{

 rcu_read_unlock();
 ({ ___might_sleep("include/linux/sched.h", 2845, 0); _cond_resched(); });
 rcu_read_lock();

}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_needbreak(spinlock_t *lock)
{



 return 0;

}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int tsk_is_polling(struct task_struct *p)
{
 return test_tsk_thread_flag(p, 14);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __current_set_polling(void)
{
 set_ti_thread_flag((current_thread_info_reg), 14);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __attribute__((warn_unused_result)) current_set_polling_and_test(void)
{
 __current_set_polling();





 __asm__ __volatile__("": : :"memory");

 return __builtin_expect(!!(test_ti_thread_flag((current_thread_info_reg), 3)), 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __current_clr_polling(void)
{
 clear_ti_thread_flag((current_thread_info_reg), 14);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __attribute__((warn_unused_result)) current_clr_polling_and_test(void)
{
 __current_clr_polling();





 __asm__ __volatile__("": : :"memory");

 return __builtin_expect(!!(test_ti_thread_flag((current_thread_info_reg), 3)), 0);
}
# 2925 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void current_clr_polling(void)
{
 __current_clr_polling();







 do { __asm__ __volatile__("ba,pt	%%xcc, 1f\n\t" " membar	" "#StoreLoad" "\n" "1:\n" : : : "memory"); } while (0);

 do { if (test_ti_thread_flag((current_thread_info_reg), 3)) set_preempt_need_resched(); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool need_resched(void)
{
 return __builtin_expect(!!(test_ti_thread_flag((current_thread_info_reg), 3)), 0);
}




void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);
void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void thread_group_cputime_init(struct signal_struct *sig)
{
 do { *(&sig->cputimer.lock) = (raw_spinlock_t) { .raw_lock = { 0 }, }; } while (0);
}







extern void recalc_sigpending_and_wake(struct task_struct *t);
extern void recalc_sigpending(void);

extern void signal_wake_up_state(struct task_struct *t, unsigned int state);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void signal_wake_up(struct task_struct *t, bool resume)
{
 signal_wake_up_state(t, resume ? 128 : 0);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptrace_signal_wake_up(struct task_struct *t, bool resume)
{
 signal_wake_up_state(t, resume ? 8 : 0);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int task_cpu(const struct task_struct *p)
{
 return ((struct thread_info *)(p)->stack)->cpu;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int task_node(const struct task_struct *p)
{
 return cpu_to_node(task_cpu(p));
}

extern void set_task_cpu(struct task_struct *p, unsigned int cpu);
# 3006 "include/linux/sched.h"
extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
extern long sched_getaffinity(pid_t pid, struct cpumask *mask);





extern int task_can_switch_user(struct user_struct *up,
     struct task_struct *tsk);
# 3037 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void add_rchar(struct task_struct *tsk, ssize_t amt)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void add_wchar(struct task_struct *tsk, ssize_t amt)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inc_syscr(struct task_struct *tsk)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inc_syscw(struct task_struct *tsk)
{
}
# 3061 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_update_next_owner(struct mm_struct *mm)
{
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long task_rlimit(const struct task_struct *tsk,
  unsigned int limit)
{
 return (*({ __attribute__((unused)) typeof(tsk->signal->rlim[limit].rlim_cur) __var = ( typeof(tsk->signal->rlim[limit].rlim_cur)) 0; (volatile typeof(tsk->signal->rlim[limit].rlim_cur) *)&(tsk->signal->rlim[limit].rlim_cur); }));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long task_rlimit_max(const struct task_struct *tsk,
  unsigned int limit)
{
 return (*({ __attribute__((unused)) typeof(tsk->signal->rlim[limit].rlim_max) __var = ( typeof(tsk->signal->rlim[limit].rlim_max)) 0; (volatile typeof(tsk->signal->rlim[limit].rlim_max) *)&(tsk->signal->rlim[limit].rlim_max); }));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long rlimit(unsigned int limit)
{
 return task_rlimit(current, limit);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long rlimit_max(unsigned int limit)
{
 return task_rlimit_max(current, limit);
}
# 13 "arch/sparc/math-emu/math_64.c" 2

# 1 "include/linux/perf_event.h" 1
# 17 "include/linux/perf_event.h"
# 1 "include/uapi/linux/perf_event.h" 1
# 18 "include/uapi/linux/perf_event.h"
# 1 "./include/uapi/linux/ioctl.h" 1



# 1 "./arch/sparc/include/uapi/asm/ioctl.h" 1
# 5 "./include/uapi/linux/ioctl.h" 2
# 19 "include/uapi/linux/perf_event.h" 2
# 28 "include/uapi/linux/perf_event.h"
enum perf_type_id {
 PERF_TYPE_HARDWARE = 0,
 PERF_TYPE_SOFTWARE = 1,
 PERF_TYPE_TRACEPOINT = 2,
 PERF_TYPE_HW_CACHE = 3,
 PERF_TYPE_RAW = 4,
 PERF_TYPE_BREAKPOINT = 5,

 PERF_TYPE_MAX,
};






enum perf_hw_id {



 PERF_COUNT_HW_CPU_CYCLES = 0,
 PERF_COUNT_HW_INSTRUCTIONS = 1,
 PERF_COUNT_HW_CACHE_REFERENCES = 2,
 PERF_COUNT_HW_CACHE_MISSES = 3,
 PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4,
 PERF_COUNT_HW_BRANCH_MISSES = 5,
 PERF_COUNT_HW_BUS_CYCLES = 6,
 PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 7,
 PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 8,
 PERF_COUNT_HW_REF_CPU_CYCLES = 9,

 PERF_COUNT_HW_MAX,
};
# 69 "include/uapi/linux/perf_event.h"
enum perf_hw_cache_id {
 PERF_COUNT_HW_CACHE_L1D = 0,
 PERF_COUNT_HW_CACHE_L1I = 1,
 PERF_COUNT_HW_CACHE_LL = 2,
 PERF_COUNT_HW_CACHE_DTLB = 3,
 PERF_COUNT_HW_CACHE_ITLB = 4,
 PERF_COUNT_HW_CACHE_BPU = 5,
 PERF_COUNT_HW_CACHE_NODE = 6,

 PERF_COUNT_HW_CACHE_MAX,
};

enum perf_hw_cache_op_id {
 PERF_COUNT_HW_CACHE_OP_READ = 0,
 PERF_COUNT_HW_CACHE_OP_WRITE = 1,
 PERF_COUNT_HW_CACHE_OP_PREFETCH = 2,

 PERF_COUNT_HW_CACHE_OP_MAX,
};

enum perf_hw_cache_op_result_id {
 PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0,
 PERF_COUNT_HW_CACHE_RESULT_MISS = 1,

 PERF_COUNT_HW_CACHE_RESULT_MAX,
};







enum perf_sw_ids {
 PERF_COUNT_SW_CPU_CLOCK = 0,
 PERF_COUNT_SW_TASK_CLOCK = 1,
 PERF_COUNT_SW_PAGE_FAULTS = 2,
 PERF_COUNT_SW_CONTEXT_SWITCHES = 3,
 PERF_COUNT_SW_CPU_MIGRATIONS = 4,
 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5,
 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
 PERF_COUNT_SW_EMULATION_FAULTS = 8,
 PERF_COUNT_SW_DUMMY = 9,

 PERF_COUNT_SW_MAX,
};





enum perf_event_sample_format {
 PERF_SAMPLE_IP = 1U << 0,
 PERF_SAMPLE_TID = 1U << 1,
 PERF_SAMPLE_TIME = 1U << 2,
 PERF_SAMPLE_ADDR = 1U << 3,
 PERF_SAMPLE_READ = 1U << 4,
 PERF_SAMPLE_CALLCHAIN = 1U << 5,
 PERF_SAMPLE_ID = 1U << 6,
 PERF_SAMPLE_CPU = 1U << 7,
 PERF_SAMPLE_PERIOD = 1U << 8,
 PERF_SAMPLE_STREAM_ID = 1U << 9,
 PERF_SAMPLE_RAW = 1U << 10,
 PERF_SAMPLE_BRANCH_STACK = 1U << 11,
 PERF_SAMPLE_REGS_USER = 1U << 12,
 PERF_SAMPLE_STACK_USER = 1U << 13,
 PERF_SAMPLE_WEIGHT = 1U << 14,
 PERF_SAMPLE_DATA_SRC = 1U << 15,
 PERF_SAMPLE_IDENTIFIER = 1U << 16,
 PERF_SAMPLE_TRANSACTION = 1U << 17,
 PERF_SAMPLE_REGS_INTR = 1U << 18,

 PERF_SAMPLE_MAX = 1U << 19,
};
# 155 "include/uapi/linux/perf_event.h"
enum perf_branch_sample_type {
 PERF_SAMPLE_BRANCH_USER = 1U << 0,
 PERF_SAMPLE_BRANCH_KERNEL = 1U << 1,
 PERF_SAMPLE_BRANCH_HV = 1U << 2,

 PERF_SAMPLE_BRANCH_ANY = 1U << 3,
 PERF_SAMPLE_BRANCH_ANY_CALL = 1U << 4,
 PERF_SAMPLE_BRANCH_ANY_RETURN = 1U << 5,
 PERF_SAMPLE_BRANCH_IND_CALL = 1U << 6,
 PERF_SAMPLE_BRANCH_ABORT_TX = 1U << 7,
 PERF_SAMPLE_BRANCH_IN_TX = 1U << 8,
 PERF_SAMPLE_BRANCH_NO_TX = 1U << 9,
 PERF_SAMPLE_BRANCH_COND = 1U << 10,

 PERF_SAMPLE_BRANCH_MAX = 1U << 11,
};
# 180 "include/uapi/linux/perf_event.h"
enum perf_sample_regs_abi {
 PERF_SAMPLE_REGS_ABI_NONE = 0,
 PERF_SAMPLE_REGS_ABI_32 = 1,
 PERF_SAMPLE_REGS_ABI_64 = 2,
};





enum {
 PERF_TXN_ELISION = (1 << 0),
 PERF_TXN_TRANSACTION = (1 << 1),
 PERF_TXN_SYNC = (1 << 2),
 PERF_TXN_ASYNC = (1 << 3),
 PERF_TXN_RETRY = (1 << 4),
 PERF_TXN_CONFLICT = (1 << 5),
 PERF_TXN_CAPACITY_WRITE = (1 << 6),
 PERF_TXN_CAPACITY_READ = (1 << 7),

 PERF_TXN_MAX = (1 << 8),



 PERF_TXN_ABORT_MASK = (0xffffffffULL << 32),
 PERF_TXN_ABORT_SHIFT = 32,
};
# 228 "include/uapi/linux/perf_event.h"
enum perf_event_read_format {
 PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
 PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
 PERF_FORMAT_ID = 1U << 2,
 PERF_FORMAT_GROUP = 1U << 3,

 PERF_FORMAT_MAX = 1U << 4,
};
# 247 "include/uapi/linux/perf_event.h"
struct perf_event_attr {




 __u32 type;




 __u32 size;




 __u64 config;

 union {
  __u64 sample_period;
  __u64 sample_freq;
 };

 __u64 sample_type;
 __u64 read_format;

 __u64 disabled : 1,
    inherit : 1,
    pinned : 1,
    exclusive : 1,
    exclude_user : 1,
    exclude_kernel : 1,
    exclude_hv : 1,
    exclude_idle : 1,
    mmap : 1,
    comm : 1,
    freq : 1,
    inherit_stat : 1,
    enable_on_exec : 1,
    task : 1,
    watermark : 1,
# 297 "include/uapi/linux/perf_event.h"
    precise_ip : 2,
    mmap_data : 1,
    sample_id_all : 1,

    exclude_host : 1,
    exclude_guest : 1,

    exclude_callchain_kernel : 1,
    exclude_callchain_user : 1,
    mmap2 : 1,
    comm_exec : 1,
    __reserved_1 : 39;

 union {
  __u32 wakeup_events;
  __u32 wakeup_watermark;
 };

 __u32 bp_type;
 union {
  __u64 bp_addr;
  __u64 config1;
 };
 union {
  __u64 bp_len;
  __u64 config2;
 };
 __u64 branch_sample_type;





 __u64 sample_regs_user;




 __u32 sample_stack_user;


 __u32 __reserved_2;
# 347 "include/uapi/linux/perf_event.h"
 __u64 sample_regs_intr;
};
# 364 "include/uapi/linux/perf_event.h"
enum perf_event_ioc_flags {
 PERF_IOC_FLAG_GROUP = 1U << 0,
};




struct perf_event_mmap_page {
 __u32 version;
 __u32 compat_version;
# 410 "include/uapi/linux/perf_event.h"
 __u32 lock;
 __u32 index;
 __s64 offset;
 __u64 time_enabled;
 __u64 time_running;
 union {
  __u64 capabilities;
  struct {
   __u64 cap_bit0 : 1,
    cap_bit0_is_deprecated : 1,

    cap_user_rdpmc : 1,
    cap_user_time : 1,
    cap_user_time_zero : 1,
    cap_____res : 59;
  };
 };
# 437 "include/uapi/linux/perf_event.h"
 __u16 pmc_width;
# 463 "include/uapi/linux/perf_event.h"
 __u16 time_shift;
 __u32 time_mult;
 __u64 time_offset;
# 482 "include/uapi/linux/perf_event.h"
 __u64 time_zero;
 __u32 size;





 __u8 __reserved[118*8+4];
# 504 "include/uapi/linux/perf_event.h"
 __u64 data_head;
 __u64 data_tail;
};
# 533 "include/uapi/linux/perf_event.h"
struct perf_event_header {
 __u32 type;
 __u16 misc;
 __u16 size;
};

enum perf_event_type {
# 580 "include/uapi/linux/perf_event.h"
 PERF_RECORD_MMAP = 1,
# 590 "include/uapi/linux/perf_event.h"
 PERF_RECORD_LOST = 2,
# 601 "include/uapi/linux/perf_event.h"
 PERF_RECORD_COMM = 3,
# 612 "include/uapi/linux/perf_event.h"
 PERF_RECORD_EXIT = 4,
# 623 "include/uapi/linux/perf_event.h"
 PERF_RECORD_THROTTLE = 5,
 PERF_RECORD_UNTHROTTLE = 6,
# 635 "include/uapi/linux/perf_event.h"
 PERF_RECORD_FORK = 7,
# 646 "include/uapi/linux/perf_event.h"
 PERF_RECORD_READ = 8,
# 704 "include/uapi/linux/perf_event.h"
 PERF_RECORD_SAMPLE = 9,
# 726 "include/uapi/linux/perf_event.h"
 PERF_RECORD_MMAP2 = 10,

 PERF_RECORD_MAX,
};



enum perf_callchain_context {
 PERF_CONTEXT_HV = (__u64)-32,
 PERF_CONTEXT_KERNEL = (__u64)-128,
 PERF_CONTEXT_USER = (__u64)-512,

 PERF_CONTEXT_GUEST = (__u64)-2048,
 PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176,
 PERF_CONTEXT_GUEST_USER = (__u64)-2560,

 PERF_CONTEXT_MAX = (__u64)-4095,
};






union perf_mem_data_src {
 __u64 val;
 struct {
  __u64 mem_op:5,
   mem_lvl:14,
   mem_snoop:5,
   mem_lock:2,
   mem_dtlb:7,
   mem_rsvd:31;
 };
};
# 827 "include/uapi/linux/perf_event.h"
struct perf_branch_entry {
 __u64 from;
 __u64 to;
 __u64 mispred:1,
  predicted:1,
  in_tx:1,
  abort:1,
  reserved:60;
};
# 18 "include/linux/perf_event.h" 2






# 1 "./arch/sparc/include/asm/perf_event.h" 1
# 25 "include/linux/perf_event.h" 2
# 1 "arch/sparc/include/generated/asm/local64.h" 1
# 1 "include/asm-generic/local64.h" 1




# 1 "arch/sparc/include/generated/asm/types.h" 1
# 6 "include/asm-generic/local64.h" 2
# 21 "include/asm-generic/local64.h"
# 1 "arch/sparc/include/generated/asm/local.h" 1
# 1 "include/asm-generic/local.h" 1





# 1 "arch/sparc/include/generated/asm/types.h" 1
# 7 "include/asm-generic/local.h" 2
# 21 "include/asm-generic/local.h"
typedef struct
{
 atomic_long_t a;
} local_t;
# 1 "arch/sparc/include/generated/asm/local.h" 2
# 22 "include/asm-generic/local64.h" 2

typedef struct {
 local_t a;
} local64_t;
# 1 "arch/sparc/include/generated/asm/local64.h" 2
# 26 "include/linux/perf_event.h" 2


struct perf_guest_info_callbacks {
 int (*is_in_guest)(void);
 int (*is_user_mode)(void);
 unsigned long (*get_guest_ip)(void);
};
# 44 "include/linux/perf_event.h"
# 1 "include/linux/fs.h" 1






# 1 "include/linux/kdev_t.h" 1



# 1 "include/uapi/linux/kdev_t.h" 1
# 5 "include/linux/kdev_t.h" 2
# 23 "include/linux/kdev_t.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int old_valid_dev(dev_t dev)
{
 return ((unsigned int) ((dev) >> 20)) < 256 && ((unsigned int) ((dev) & ((1U << 20) - 1))) < 256;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 old_encode_dev(dev_t dev)
{
 return (((unsigned int) ((dev) >> 20)) << 8) | ((unsigned int) ((dev) & ((1U << 20) - 1)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dev_t old_decode_dev(u16 val)
{
 return ((((val >> 8) & 255) << 20) | (val & 255));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int new_valid_dev(dev_t dev)
{
 return 1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 new_encode_dev(dev_t dev)
{
 unsigned major = ((unsigned int) ((dev) >> 20));
 unsigned minor = ((unsigned int) ((dev) & ((1U << 20) - 1)));
 return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dev_t new_decode_dev(u32 dev)
{
 unsigned major = (dev & 0xfff00) >> 8;
 unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00);
 return (((major) << 20) | (minor));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int huge_valid_dev(dev_t dev)
{
 return 1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 huge_encode_dev(dev_t dev)
{
 return new_encode_dev(dev);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dev_t huge_decode_dev(u64 dev)
{
 return new_decode_dev(dev);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sysv_valid_dev(dev_t dev)
{
 return ((unsigned int) ((dev) >> 20)) < (1<<14) && ((unsigned int) ((dev) & ((1U << 20) - 1))) < (1<<18);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 sysv_encode_dev(dev_t dev)
{
 return ((unsigned int) ((dev) & ((1U << 20) - 1))) | (((unsigned int) ((dev) >> 20)) << 18);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned sysv_major(u32 dev)
{
 return (dev >> 18) & 0x3fff;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned sysv_minor(u32 dev)
{
 return dev & 0x3ffff;
}
# 8 "include/linux/fs.h" 2
# 1 "include/linux/dcache.h" 1






# 1 "include/linux/rculist_bl.h" 1






# 1 "include/linux/list_bl.h" 1




# 1 "include/linux/bit_spinlock.h" 1
# 15 "include/linux/bit_spinlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bit_spin_lock(int bitnum, unsigned long *addr)
{







 __asm__ __volatile__("": : :"memory");

 while (__builtin_expect(!!(test_and_set_bit(bitnum, addr)), 0)) {
  __asm__ __volatile__("": : :"memory");
  do {
   asm volatile("\n99:\n\t" "rd	%%ccr, %%g0\n\t" "rd	%%ccr, %%g0\n\t" "rd	%%ccr, %%g0\n\t" ".section	.pause_3insn_patch,\"ax\"\n\t" ".word	99b\n\t" "wr	%%g0, 128, %%asr27\n\t" "nop\n\t" "nop\n\t" ".previous" ::: "memory");
  } while (test_bit(bitnum, addr));
  __asm__ __volatile__("": : :"memory");
 }

 (void)0;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bit_spin_trylock(int bitnum, unsigned long *addr)
{
 __asm__ __volatile__("": : :"memory");

 if (__builtin_expect(!!(test_and_set_bit(bitnum, addr)), 0)) {
  __asm__ __volatile__("": : :"memory");
  return 0;
 }

 (void)0;
 return 1;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bit_spin_unlock(int bitnum, unsigned long *addr)
{




 do { __asm__ __volatile__("": : :"memory"); clear_bit(bitnum, addr); } while (0);

 __asm__ __volatile__("": : :"memory");
 (void)0;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __bit_spin_unlock(int bitnum, unsigned long *addr)
{




 do { do { __asm__ __volatile__("ba,pt	%%xcc, 1f\n\t" " membar	" "#StoreLoad" "\n" "1:\n" : : : "memory"); } while (0); __clear_bit(bitnum, addr); } while (0);

 __asm__ __volatile__("": : :"memory");
 (void)0;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bit_spin_is_locked(int bitnum, unsigned long *addr)
{

 return test_bit(bitnum, addr);





}
# 6 "include/linux/list_bl.h" 2
# 33 "include/linux/list_bl.h"
struct hlist_bl_head {
 struct hlist_bl_node *first;
};

struct hlist_bl_node {
 struct hlist_bl_node *next, **pprev;
};



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void INIT_HLIST_BL_NODE(struct hlist_bl_node *h)
{
 h->next = ((void *)0);
 h->pprev = ((void *)0);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_bl_unhashed(const struct hlist_bl_node *h)
{
 return !h->pprev;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct hlist_bl_node *hlist_bl_first(struct hlist_bl_head *h)
{
 return (struct hlist_bl_node *)
  ((unsigned long)h->first & ~1UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_set_first(struct hlist_bl_head *h,
     struct hlist_bl_node *n)
{
 ;

                        ;
 h->first = (struct hlist_bl_node *)((unsigned long)n | 1UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_bl_empty(const struct hlist_bl_head *h)
{
 return !((unsigned long)h->first & ~1UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_add_head(struct hlist_bl_node *n,
     struct hlist_bl_head *h)
{
 struct hlist_bl_node *first = hlist_bl_first(h);

 n->next = first;
 if (first)
  first->pprev = &n->next;
 n->pprev = &h->first;
 hlist_bl_set_first(h, n);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __hlist_bl_del(struct hlist_bl_node *n)
{
 struct hlist_bl_node *next = n->next;
 struct hlist_bl_node **pprev = n->pprev;

 ;


 *pprev = (struct hlist_bl_node *)
   ((unsigned long)next |
    ((unsigned long)*pprev & 1UL));
 if (next)
  next->pprev = pprev;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_del(struct hlist_bl_node *n)
{
 __hlist_bl_del(n);
 n->next = ((void *) 0x00100100 + 0);
 n->pprev = ((void *) 0x00200200 + 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_del_init(struct hlist_bl_node *n)
{
 if (!hlist_bl_unhashed(n)) {
  __hlist_bl_del(n);
  INIT_HLIST_BL_NODE(n);
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_lock(struct hlist_bl_head *b)
{
 bit_spin_lock(0, (unsigned long *)b);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_unlock(struct hlist_bl_head *b)
{
 __bit_spin_unlock(0, (unsigned long *)b);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool hlist_bl_is_locked(struct hlist_bl_head *b)
{
 return bit_spin_is_locked(0, (unsigned long *)b);
}
# 8 "include/linux/rculist_bl.h" 2


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_set_first_rcu(struct hlist_bl_head *h,
     struct hlist_bl_node *n)
{
 ;

                        ;
 do { do { bool __cond = !((sizeof(*&h->first) == sizeof(char) || sizeof(*&h->first) == sizeof(short) || sizeof(*&h->first) == sizeof(int) || sizeof(*&h->first) == sizeof(long))); extern void
 __compiletime_assert_17
# 16 "include/linux/rculist_bl.h"
 (void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond)
 __compiletime_assert_17
# 16 "include/linux/rculist_bl.h"
 (); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&h->first) __var = ( typeof(*&h->first)) 0; (volatile typeof(*&h->first) *)&(*&h->first); })) = ((typeof(*((struct hlist_bl_node *)((unsigned long)n | 1UL))) *)((struct hlist_bl_node *)((unsigned long)n | 1UL))); } while (0)
                                                                ;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct hlist_bl_node *hlist_bl_first_rcu(struct hlist_bl_head *h)
{
 return (struct hlist_bl_node *)
  ((unsigned long)({ typeof(*(h->first)) *________p1 = (typeof(*(h->first)) *)({ typeof((h->first)) _________p1 = (*({ __attribute__((unused)) typeof((h->first)) __var = ( typeof((h->first))) 0; (volatile typeof((h->first)) *)&((h->first)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(h->first)) *)(________p1)); }) & ~1UL);
}
# 46 "include/linux/rculist_bl.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_del_init_rcu(struct hlist_bl_node *n)
{
 if (!hlist_bl_unhashed(n)) {
  __hlist_bl_del(n);
  n->pprev = ((void *)0);
 }
}
# 73 "include/linux/rculist_bl.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_del_rcu(struct hlist_bl_node *n)
{
 __hlist_bl_del(n);
 n->pprev = ((void *) 0x00200200 + 0);
}
# 98 "include/linux/rculist_bl.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_add_head_rcu(struct hlist_bl_node *n,
     struct hlist_bl_head *h)
{
 struct hlist_bl_node *first;


 first = hlist_bl_first(h);

 n->next = first;
 if (first)
  first->pprev = &n->next;
 n->pprev = &h->first;


 hlist_bl_set_first_rcu(h, n);
}
# 8 "include/linux/dcache.h" 2




# 1 "include/linux/lockref.h" 1
# 24 "include/linux/lockref.h"
struct lockref {
 union {



  struct {
   spinlock_t lock;
   int count;
  };
 };
};

extern void lockref_get(struct lockref *);
extern int lockref_put_return(struct lockref *);
extern int lockref_get_not_zero(struct lockref *);
extern int lockref_get_or_lock(struct lockref *);
extern int lockref_put_or_lock(struct lockref *);

extern void lockref_mark_dead(struct lockref *);
extern int lockref_get_not_dead(struct lockref *);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __lockref_is_dead(const struct lockref *l)
{
 return ((int)l->count < 0);
}
# 13 "include/linux/dcache.h" 2

struct path;
struct vfsmount;
# 44 "include/linux/dcache.h"
struct qstr {
 union {
  struct {
   u32 len; u32 hash;;
  };
  u64 hash_len;
 };
 const unsigned char *name;
};






struct dentry_stat_t {
 long nr_dentry;
 long nr_unused;
 long age_limit;
 long want_pages;
 long dummy[2];
};
extern struct dentry_stat_t dentry_stat;






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
partial_name_hash(unsigned long c, unsigned long prevhash)
{
 return (prevhash + (c << 4) + (c >> 4)) * 11;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long end_name_hash(unsigned long hash)
{
 return (unsigned int) hash;
}


extern unsigned int full_name_hash(const unsigned char *, unsigned int);
# 108 "include/linux/dcache.h"
struct dentry {

 unsigned int d_flags;
 seqcount_t d_seq;
 struct hlist_bl_node d_hash;
 struct dentry *d_parent;
 struct qstr d_name;
 struct inode *d_inode;

 unsigned char d_iname[32];


 struct lockref d_lockref;
 const struct dentry_operations *d_op;
 struct super_block *d_sb;
 unsigned long d_time;
 void *d_fsdata;

 struct list_head d_lru;
 struct list_head d_child;
 struct list_head d_subdirs;



 union {
  struct hlist_node d_alias;
   struct callback_head d_rcu;
 } d_u;
};







enum dentry_d_lock_class
{
 DENTRY_D_LOCK_NORMAL,
 DENTRY_D_LOCK_NESTED
};

struct dentry_operations {
 int (*d_revalidate)(struct dentry *, unsigned int);
 int (*d_weak_revalidate)(struct dentry *, unsigned int);
 int (*d_hash)(const struct dentry *, struct qstr *);
 int (*d_compare)(const struct dentry *, const struct dentry *,
   unsigned int, const char *, const struct qstr *);
 int (*d_delete)(const struct dentry *);
 void (*d_release)(struct dentry *);
 void (*d_prune)(struct dentry *);
 void (*d_iput)(struct dentry *, struct inode *);
 char *(*d_dname)(struct dentry *, char *, int);
 struct vfsmount *(*d_automount)(struct path *);
 int (*d_manage)(struct dentry *, bool);
} __attribute__((__aligned__((1 << 6))));
# 226 "include/linux/dcache.h"
extern seqlock_t rename_lock;




extern void d_instantiate(struct dentry *, struct inode *);
extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *);
extern int d_instantiate_no_diralias(struct dentry *, struct inode *);
extern void __d_drop(struct dentry *dentry);
extern void d_drop(struct dentry *dentry);
extern void d_delete(struct dentry *);
extern void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op);


extern struct dentry * d_alloc(struct dentry *, const struct qstr *);
extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *);
extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *);
extern struct dentry *d_find_any_alias(struct inode *inode);
extern struct dentry * d_obtain_alias(struct inode *);
extern struct dentry * d_obtain_root(struct inode *);
extern void shrink_dcache_sb(struct super_block *);
extern void shrink_dcache_parent(struct dentry *);
extern void shrink_dcache_for_umount(struct super_block *);
extern void d_invalidate(struct dentry *);


extern struct dentry * d_make_root(struct inode *);


extern void d_genocide(struct dentry *);

extern void d_tmpfile(struct dentry *, struct inode *);

extern struct dentry *d_find_alias(struct inode *);
extern void d_prune_aliases(struct inode *);


extern int have_submounts(struct dentry *);




extern void d_rehash(struct dentry *);
# 280 "include/linux/dcache.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void d_add(struct dentry *entry, struct inode *inode)
{
 d_instantiate(entry, inode);
 d_rehash(entry);
}
# 294 "include/linux/dcache.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *d_add_unique(struct dentry *entry, struct inode *inode)
{
 struct dentry *res;

 res = d_instantiate_unique(entry, inode);
 d_rehash(res != ((void *)0) ? res : entry);
 return res;
}

extern void dentry_update_name_case(struct dentry *, struct qstr *);


extern void d_move(struct dentry *, struct dentry *);
extern void d_exchange(struct dentry *, struct dentry *);
extern struct dentry *d_ancestor(struct dentry *, struct dentry *);


extern struct dentry *d_lookup(const struct dentry *, const struct qstr *);
extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *);
extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *);
extern struct dentry *__d_lookup_rcu(const struct dentry *parent,
    const struct qstr *name, unsigned *seq);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned d_count(const struct dentry *dentry)
{
 return dentry->d_lockref.count;
}




extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
extern char *simple_dname(struct dentry *, char *, int);

extern char *__d_path(const struct path *, const struct path *, char *, int);
extern char *d_absolute_path(const struct path *, char *, int);
extern char *d_path(const struct path *, char *, int);
extern char *dentry_path_raw(struct dentry *, char *, int);
extern char *dentry_path(struct dentry *, char *, int);
# 344 "include/linux/dcache.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *dget_dlock(struct dentry *dentry)
{
 if (dentry)
  dentry->d_lockref.count++;
 return dentry;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *dget(struct dentry *dentry)
{
 if (dentry)
  lockref_get(&dentry->d_lockref);
 return dentry;
}

extern struct dentry *dget_parent(struct dentry *dentry);
# 367 "include/linux/dcache.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int d_unhashed(const struct dentry *dentry)
{
 return hlist_bl_unhashed(&dentry->d_hash);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int d_unlinked(const struct dentry *dentry)
{
 return d_unhashed(dentry) && !((dentry) == (dentry)->d_parent);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cant_mount(const struct dentry *dentry)
{
 return (dentry->d_flags & 0x00000100);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dont_mount(struct dentry *dentry)
{
 spin_lock(&dentry->d_lockref.lock);
 dentry->d_flags |= 0x00000100;
 spin_unlock(&dentry->d_lockref.lock);
}

extern void dput(struct dentry *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_managed(const struct dentry *dentry)
{
 return dentry->d_flags & (0x00010000|0x00020000|0x00040000);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_mountpoint(const struct dentry *dentry)
{
 return dentry->d_flags & 0x00010000;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __d_set_type(struct dentry *dentry, unsigned type)
{
 dentry->d_flags = (dentry->d_flags & ~0x00700000) | type;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __d_clear_type(struct dentry *dentry)
{
 __d_set_type(dentry, 0x00000000);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void d_set_type(struct dentry *dentry, unsigned type)
{
 spin_lock(&dentry->d_lockref.lock);
 __d_set_type(dentry, type);
 spin_unlock(&dentry->d_lockref.lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned __d_entry_type(const struct dentry *dentry)
{
 return dentry->d_flags & 0x00700000;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_can_lookup(const struct dentry *dentry)
{
 return __d_entry_type(dentry) == 0x00100000;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_autodir(const struct dentry *dentry)
{
 return __d_entry_type(dentry) == 0x00200000;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_dir(const struct dentry *dentry)
{
 return d_can_lookup(dentry) || d_is_autodir(dentry);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_symlink(const struct dentry *dentry)
{
 return __d_entry_type(dentry) == 0x00300000;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_file(const struct dentry *dentry)
{
 return __d_entry_type(dentry) == 0x00400000;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_negative(const struct dentry *dentry)
{
 return __d_entry_type(dentry) == 0x00000000;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_positive(const struct dentry *dentry)
{
 return !d_is_negative(dentry);
}

extern int sysctl_vfs_cache_pressure;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long vfs_pressure_ratio(unsigned long val)
{
 return ( { typeof(val) quot = (val) / (100); typeof(val) rem = (val) % (100); (quot * (sysctl_vfs_cache_pressure)) + ((rem * (sysctl_vfs_cache_pressure)) / (100)); } );
}
# 9 "include/linux/fs.h" 2
# 1 "include/linux/path.h" 1



struct dentry;
struct vfsmount;

struct path {
 struct vfsmount *mnt;
 struct dentry *dentry;
};

extern void path_get(const struct path *);
extern void path_put(const struct path *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int path_equal(const struct path *path1, const struct path *path2)
{
 return path1->mnt == path2->mnt && path1->dentry == path2->dentry;
}
# 10 "include/linux/fs.h" 2
# 1 "include/linux/stat.h" 1




# 1 "./arch/sparc/include/uapi/asm/stat.h" 1







struct stat {
 unsigned st_dev;
 ino_t st_ino;
 mode_t st_mode;
 short st_nlink;
 uid_t st_uid;
 gid_t st_gid;
 unsigned st_rdev;
 off_t st_size;
 time_t st_atime;
 time_t st_mtime;
 time_t st_ctime;
 off_t st_blksize;
 off_t st_blocks;
 unsigned long __unused4[2];
};

struct stat64 {
 unsigned long st_dev;
 unsigned long st_ino;
 unsigned long st_nlink;

 unsigned int st_mode;
 unsigned int st_uid;
 unsigned int st_gid;
 unsigned int __pad0;

 unsigned long st_rdev;
 long st_size;
 long st_blksize;
 long st_blocks;

 unsigned long st_atime;
 unsigned long st_atime_nsec;
 unsigned long st_mtime;
 unsigned long st_mtime_nsec;
 unsigned long st_ctime;
 unsigned long st_ctime_nsec;
 long __unused[3];
};
# 6 "include/linux/stat.h" 2
# 1 "include/uapi/linux/stat.h" 1
# 7 "include/linux/stat.h" 2
# 21 "include/linux/stat.h"
struct kstat {
 u64 ino;
 dev_t dev;
 umode_t mode;
 unsigned int nlink;
 kuid_t uid;
 kgid_t gid;
 dev_t rdev;
 loff_t size;
 struct timespec atime;
 struct timespec mtime;
 struct timespec ctime;
 unsigned long blksize;
 unsigned long long blocks;
};
# 11 "include/linux/fs.h" 2


# 1 "include/linux/list_lru.h" 1
# 12 "include/linux/list_lru.h"
# 1 "include/linux/shrinker.h" 1
# 11 "include/linux/shrinker.h"
struct shrink_control {
 gfp_t gfp_mask;






 unsigned long nr_to_scan;


 int nid;


 struct mem_cgroup *memcg;
};
# 49 "include/linux/shrinker.h"
struct shrinker {
 unsigned long (*count_objects)(struct shrinker *,
           struct shrink_control *sc);
 unsigned long (*scan_objects)(struct shrinker *,
          struct shrink_control *sc);

 int seeks;
 long batch;
 unsigned long flags;


 struct list_head list;

 atomic_long_t *nr_deferred;
};






extern int register_shrinker(struct shrinker *);
extern void unregister_shrinker(struct shrinker *);
# 13 "include/linux/list_lru.h" 2

struct mem_cgroup;


enum lru_status {
 LRU_REMOVED,
 LRU_REMOVED_RETRY,

 LRU_ROTATE,
 LRU_SKIP,
 LRU_RETRY,

};

struct list_lru_one {
 struct list_head list;

 long nr_items;
};

struct list_lru_memcg {

 struct list_lru_one *lru[0];
};

struct list_lru_node {

 spinlock_t lock;

 struct list_lru_one lru;




} __attribute__((__aligned__((1 << 6))));

struct list_lru {
 struct list_lru_node *node;



};

void list_lru_destroy(struct list_lru *lru);
int __list_lru_init(struct list_lru *lru, bool memcg_aware,
      struct lock_class_key *key);





int memcg_update_all_list_lrus(int num_memcgs);
void memcg_drain_all_list_lrus(int src_idx, int dst_idx);
# 83 "include/linux/list_lru.h"
bool list_lru_add(struct list_lru *lru, struct list_head *item);
# 96 "include/linux/list_lru.h"
bool list_lru_del(struct list_lru *lru, struct list_head *item);
# 108 "include/linux/list_lru.h"
unsigned long list_lru_count_one(struct list_lru *lru,
     int nid, struct mem_cgroup *memcg);
unsigned long list_lru_count_node(struct list_lru *lru, int nid);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long list_lru_shrink_count(struct list_lru *lru,
        struct shrink_control *sc)
{
 return list_lru_count_one(lru, sc->nid, sc->memcg);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long list_lru_count(struct list_lru *lru)
{
 long count = 0;
 int nid;

 for (((nid)) = __first_node(&(node_states[N_NORMAL_MEMORY])); ((nid)) < (1 << 4); ((nid)) = __next_node((((nid))), &((node_states[N_NORMAL_MEMORY]))))
  count += list_lru_count_node(lru, nid);

 return count;
}

void list_lru_isolate(struct list_lru_one *list, struct list_head *item);
void list_lru_isolate_move(struct list_lru_one *list, struct list_head *item,
      struct list_head *head);

typedef enum lru_status (*list_lru_walk_cb)(struct list_head *item,
  struct list_lru_one *list, spinlock_t *lock, void *cb_arg);
# 158 "include/linux/list_lru.h"
unsigned long list_lru_walk_one(struct list_lru *lru,
    int nid, struct mem_cgroup *memcg,
    list_lru_walk_cb isolate, void *cb_arg,
    unsigned long *nr_to_walk);
unsigned long list_lru_walk_node(struct list_lru *lru, int nid,
     list_lru_walk_cb isolate, void *cb_arg,
     unsigned long *nr_to_walk);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
list_lru_shrink_walk(struct list_lru *lru, struct shrink_control *sc,
       list_lru_walk_cb isolate, void *cb_arg)
{
 return list_lru_walk_one(lru, sc->nid, sc->memcg, isolate, cb_arg,
     &sc->nr_to_scan);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
list_lru_walk(struct list_lru *lru, list_lru_walk_cb isolate,
       void *cb_arg, unsigned long nr_to_walk)
{
 long isolated = 0;
 int nid;

 for (((nid)) = __first_node(&(node_states[N_NORMAL_MEMORY])); ((nid)) < (1 << 4); ((nid)) = __next_node((((nid))), &((node_states[N_NORMAL_MEMORY])))) {
  isolated += list_lru_walk_node(lru, nid, isolate,
            cb_arg, &nr_to_walk);
  if (nr_to_walk <= 0)
   break;
 }
 return isolated;
}
# 14 "include/linux/fs.h" 2

# 1 "include/linux/radix-tree.h" 1
# 54 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int radix_tree_is_indirect_ptr(void *ptr)
{
 return (int)((unsigned long)ptr & 1);
}
# 87 "include/linux/radix-tree.h"
struct radix_tree_node {
 unsigned int path;
 unsigned int count;
 union {
  struct {

   struct radix_tree_node *parent;

   void *private_data;
  };

  struct callback_head callback_head;
 };

 struct list_head private_list;
 void *slots[(1UL << (0 ? 4 : 6))];
 unsigned long tags[3][(((1UL << (0 ? 4 : 6)) + 64 - 1) / 64)];
};


struct radix_tree_root {
 unsigned int height;
 gfp_t gfp_mask;
 struct radix_tree_node *rnode;
};
# 194 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *radix_tree_deref_slot(void **pslot)
{
 return ({ typeof(*(*pslot)) *________p1 = (typeof(*(*pslot)) *)({ typeof((*pslot)) _________p1 = (*({ __attribute__((unused)) typeof((*pslot)) __var = ( typeof((*pslot))) 0; (volatile typeof((*pslot)) *)&((*pslot)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(*pslot)) *)(________p1)); });
}
# 209 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *radix_tree_deref_slot_protected(void **pslot,
       spinlock_t *treelock)
{
 return ({ do { } while (0); ; ((typeof(*(*pslot)) *)((*pslot))); });
}
# 222 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int radix_tree_deref_retry(void *arg)
{
 return __builtin_expect(!!((unsigned long)arg & 1), 0);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int radix_tree_exceptional_entry(void *arg)
{

 return (unsigned long)arg & 2;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int radix_tree_exception(void *arg)
{
 return __builtin_expect(!!((unsigned long)arg & (1 | 2)), 0)
                                                           ;
}
# 257 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void radix_tree_replace_slot(void **pslot, void *item)
{
 do { if (__builtin_expect(!!(radix_tree_is_indirect_ptr(item)), 0)) do { do_BUG("include/linux/radix-tree.h", 259); __builtin_trap(); } while (0); } while (0);
 do { do { bool __cond = !((sizeof(*&*pslot) == sizeof(char) || sizeof(*&*pslot) == sizeof(short) || sizeof(*&*pslot) == sizeof(int) || sizeof(*&*pslot) == sizeof(long))); extern void __compiletime_assert_260(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_260(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&*pslot) __var = ( typeof(*&*pslot)) 0; (volatile typeof(*&*pslot) *)&(*&*pslot); })) = ((typeof(*(item)) *)(item)); } while (0);
}

int __radix_tree_create(struct radix_tree_root *root, unsigned long index,
   struct radix_tree_node **nodep, void ***slotp);
int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
void *__radix_tree_lookup(struct radix_tree_root *root, unsigned long index,
     struct radix_tree_node **nodep, void ***slotp);
void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long);
bool __radix_tree_delete_node(struct radix_tree_root *root,
         struct radix_tree_node *node);
void *radix_tree_delete_item(struct radix_tree_root *, unsigned long, void *);
void *radix_tree_delete(struct radix_tree_root *, unsigned long);
unsigned int
radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
   unsigned long first_index, unsigned int max_items);
unsigned int radix_tree_gang_lookup_slot(struct radix_tree_root *root,
   void ***results, unsigned long *indices,
   unsigned long first_index, unsigned int max_items);
int radix_tree_preload(gfp_t gfp_mask);
int radix_tree_maybe_preload(gfp_t gfp_mask);
void radix_tree_init(void);
void *radix_tree_tag_set(struct radix_tree_root *root,
   unsigned long index, unsigned int tag);
void *radix_tree_tag_clear(struct radix_tree_root *root,
   unsigned long index, unsigned int tag);
int radix_tree_tag_get(struct radix_tree_root *root,
   unsigned long index, unsigned int tag);
unsigned int
radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results,
  unsigned long first_index, unsigned int max_items,
  unsigned int tag);
unsigned int
radix_tree_gang_lookup_tag_slot(struct radix_tree_root *root, void ***results,
  unsigned long first_index, unsigned int max_items,
  unsigned int tag);
unsigned long radix_tree_range_tag_if_tagged(struct radix_tree_root *root,
  unsigned long *first_indexp, unsigned long last_index,
  unsigned long nr_to_tag,
  unsigned int fromtag, unsigned int totag);
int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag);
unsigned long radix_tree_locate_item(struct radix_tree_root *root, void *item);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void radix_tree_preload_end(void)
{
 __asm__ __volatile__("": : :"memory");
}
# 323 "include/linux/radix-tree.h"
struct radix_tree_iter {
 unsigned long index;
 unsigned long next_index;
 unsigned long tags;
};
# 340 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void **
radix_tree_iter_init(struct radix_tree_iter *iter, unsigned long start)
{
# 351 "include/linux/radix-tree.h"
 iter->index = 0;
 iter->next_index = start;
 return ((void *)0);
}
# 369 "include/linux/radix-tree.h"
void **radix_tree_next_chunk(struct radix_tree_root *root,
        struct radix_tree_iter *iter, unsigned flags);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) unsigned
radix_tree_chunk_size(struct radix_tree_iter *iter)
{
 return iter->next_index - iter->index;
}
# 395 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void **
radix_tree_next_slot(void **slot, struct radix_tree_iter *iter, unsigned flags)
{
 if (flags & 0x0100) {
  iter->tags >>= 1;
  if (__builtin_expect(!!(iter->tags & 1ul), 1)) {
   iter->index++;
   return slot + 1;
  }
  if (!(flags & 0x0200) && __builtin_expect(!!(iter->tags), 1)) {
   unsigned offset = __ffs(iter->tags);

   iter->tags >>= offset;
   iter->index += offset + 1;
   return slot + offset + 1;
  }
 } else {
  unsigned size = radix_tree_chunk_size(iter) - 1;

  while (size--) {
   slot++;
   iter->index++;
   if (__builtin_expect(!!(*slot), 1))
    return slot;
   if (flags & 0x0200) {

    iter->next_index = 0;
    break;
   }
  }
 }
 return ((void *)0);
}
# 16 "include/linux/fs.h" 2







# 1 "include/linux/semaphore.h" 1
# 16 "include/linux/semaphore.h"
struct semaphore {
 raw_spinlock_t lock;
 unsigned int count;
 struct list_head wait_list;
};
# 32 "include/linux/semaphore.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sema_init(struct semaphore *sem, int val)
{
 static struct lock_class_key __key;
 *sem = (struct semaphore) { .lock = (raw_spinlock_t) { .raw_lock = { 0 }, }, .count = val, .wait_list = { &((*sem).wait_list), &((*sem).wait_list) }, };
 do { (void)("semaphore->lock"); (void)(&__key); } while (0);
}

extern void down(struct semaphore *sem);
extern int __attribute__((warn_unused_result)) down_interruptible(struct semaphore *sem);
extern int __attribute__((warn_unused_result)) down_killable(struct semaphore *sem);
extern int __attribute__((warn_unused_result)) down_trylock(struct semaphore *sem);
extern int __attribute__((warn_unused_result)) down_timeout(struct semaphore *sem, long jiffies);
extern void up(struct semaphore *sem);
# 24 "include/linux/fs.h" 2
# 1 "./include/uapi/linux/fiemap.h" 1
# 16 "./include/uapi/linux/fiemap.h"
struct fiemap_extent {
 __u64 fe_logical;

 __u64 fe_physical;

 __u64 fe_length;
 __u64 fe_reserved64[2];
 __u32 fe_flags;
 __u32 fe_reserved[3];
};

struct fiemap {
 __u64 fm_start;

 __u64 fm_length;

 __u32 fm_flags;
 __u32 fm_mapped_extents;
 __u32 fm_extent_count;
 __u32 fm_reserved;
 struct fiemap_extent fm_extents[0];
};
# 25 "include/linux/fs.h" 2



# 1 "include/linux/migrate_mode.h" 1
# 10 "include/linux/migrate_mode.h"
enum migrate_mode {
 MIGRATE_ASYNC,
 MIGRATE_SYNC_LIGHT,
 MIGRATE_SYNC,
};
# 29 "include/linux/fs.h" 2


# 1 "include/linux/percpu-rwsem.h" 1
# 10 "include/linux/percpu-rwsem.h"
struct percpu_rw_semaphore {
 unsigned int *fast_read_ctr;
 atomic_t write_ctr;
 struct rw_semaphore rw_sem;
 atomic_t slow_read_ctr;
 wait_queue_head_t write_waitq;
};

extern void percpu_down_read(struct percpu_rw_semaphore *);
extern void percpu_up_read(struct percpu_rw_semaphore *);

extern void percpu_down_write(struct percpu_rw_semaphore *);
extern void percpu_up_write(struct percpu_rw_semaphore *);

extern int __percpu_init_rwsem(struct percpu_rw_semaphore *,
    const char *, struct lock_class_key *);
extern void percpu_free_rwsem(struct percpu_rw_semaphore *);
# 32 "include/linux/fs.h" 2
# 1 "include/linux/blk_types.h" 1
# 10 "include/linux/blk_types.h"
struct bio_set;
struct bio;
struct bio_integrity_payload;
struct page;
struct block_device;
struct io_context;
struct cgroup_subsys_state;
typedef void (bio_end_io_t) (struct bio *, int);
typedef void (bio_destructor_t) (struct bio *);




struct bio_vec {
 struct page *bv_page;
 unsigned int bv_len;
 unsigned int bv_offset;
};



struct bvec_iter {
 sector_t bi_sector;

 unsigned int bi_size;

 unsigned int bi_idx;

 unsigned int bi_bvec_done;

};





struct bio {
 struct bio *bi_next;
 struct block_device *bi_bdev;
 unsigned long bi_flags;
 unsigned long bi_rw;



 struct bvec_iter bi_iter;




 unsigned int bi_phys_segments;





 unsigned int bi_seg_front_size;
 unsigned int bi_seg_back_size;

 atomic_t bi_remaining;

 bio_end_io_t *bi_end_io;

 void *bi_private;
# 81 "include/linux/blk_types.h"
 union {



 };

 unsigned short bi_vcnt;





 unsigned short bi_max_vecs;

 atomic_t bi_cnt;

 struct bio_vec *bi_io_vec;

 struct bio_set *bi_pool;






 struct bio_vec bi_inline_vecs[0];
};
# 150 "include/linux/blk_types.h"
enum rq_flag_bits {

 __REQ_WRITE,
 __REQ_FAILFAST_DEV,
 __REQ_FAILFAST_TRANSPORT,
 __REQ_FAILFAST_DRIVER,

 __REQ_SYNC,
 __REQ_META,
 __REQ_PRIO,
 __REQ_DISCARD,
 __REQ_SECURE,
 __REQ_WRITE_SAME,

 __REQ_NOIDLE,
 __REQ_INTEGRITY,
 __REQ_FUA,
 __REQ_FLUSH,


 __REQ_RAHEAD,
 __REQ_THROTTLED,



 __REQ_SORTED,
 __REQ_SOFTBARRIER,
 __REQ_NOMERGE,
 __REQ_STARTED,
 __REQ_DONTPREP,
 __REQ_QUEUED,
 __REQ_ELVPRIV,
 __REQ_FAILED,
 __REQ_QUIET,
 __REQ_PREEMPT,
 __REQ_ALLOCED,
 __REQ_COPY_USER,
 __REQ_FLUSH_SEQ,
 __REQ_IO_STAT,
 __REQ_MIXED_MERGE,
 __REQ_PM,
 __REQ_HASHED,
 __REQ_MQ_INFLIGHT,
 __REQ_NO_TIMEOUT,
 __REQ_NR_BITS,
};
# 33 "include/linux/fs.h" 2


# 1 "include/uapi/linux/fs.h" 1
# 9 "include/uapi/linux/fs.h"
# 1 "./include/uapi/linux/limits.h" 1
# 10 "include/uapi/linux/fs.h" 2
# 42 "include/uapi/linux/fs.h"
struct fstrim_range {
 __u64 start;
 __u64 len;
 __u64 minlen;
};


struct files_stat_struct {
 unsigned long nr_files;
 unsigned long nr_free_files;
 unsigned long max_files;
};

struct inodes_stat_t {
 long nr_inodes;
 long nr_unused;
 long dummy[5];
};
# 36 "include/linux/fs.h" 2

struct backing_dev_info;
struct export_operations;
struct hd_geometry;
struct iovec;
struct nameidata;
struct kiocb;
struct kobject;
struct pipe_inode_info;
struct poll_table_struct;
struct kstatfs;
struct vm_area_struct;
struct vfsmount;
struct cred;
struct swap_info_struct;
struct seq_file;
struct workqueue_struct;
struct iov_iter;
struct vm_fault;

extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) inode_init(void);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) inode_init_early(void);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) files_init(unsigned long);

extern struct files_stat_struct files_stat;
extern unsigned long get_max_files(void);
extern int sysctl_nr_open;
extern struct inodes_stat_t inodes_stat;
extern int leases_enable, lease_break_time;
extern int sysctl_protected_symlinks;
extern int sysctl_protected_hardlinks;

struct buffer_head;
typedef int (get_block_t)(struct inode *inode, sector_t iblock,
   struct buffer_head *bh_result, int create);
typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
   ssize_t bytes, void *private);
# 244 "include/linux/fs.h"
struct iattr {
 unsigned int ia_valid;
 umode_t ia_mode;
 kuid_t ia_uid;
 kgid_t ia_gid;
 loff_t ia_size;
 struct timespec ia_atime;
 struct timespec ia_mtime;
 struct timespec ia_ctime;






 struct file *ia_file;
};




# 1 "include/linux/quota.h" 1
# 42 "include/linux/quota.h"
# 1 "./include/uapi/linux/dqblk_xfs.h" 1
# 51 "./include/uapi/linux/dqblk_xfs.h"
typedef struct fs_disk_quota {
 __s8 d_version;
 __s8 d_flags;
 __u16 d_fieldmask;
 __u32 d_id;
 __u64 d_blk_hardlimit;
 __u64 d_blk_softlimit;
 __u64 d_ino_hardlimit;
 __u64 d_ino_softlimit;
 __u64 d_bcount;
 __u64 d_icount;
 __s32 d_itimer;

 __s32 d_btimer;
 __u16 d_iwarns;
 __u16 d_bwarns;
 __s32 d_padding2;
 __u64 d_rtb_hardlimit;
 __u64 d_rtb_softlimit;
 __u64 d_rtbcount;
 __s32 d_rtbtimer;
 __u16 d_rtbwarns;
 __s16 d_padding3;
 char d_padding4[8];
} fs_disk_quota_t;
# 147 "./include/uapi/linux/dqblk_xfs.h"
typedef struct fs_qfilestat {
 __u64 qfs_ino;
 __u64 qfs_nblks;
 __u32 qfs_nextents;
} fs_qfilestat_t;

typedef struct fs_quota_stat {
 __s8 qs_version;
 __u16 qs_flags;
 __s8 qs_pad;
 fs_qfilestat_t qs_uquota;
 fs_qfilestat_t qs_gquota;
 __u32 qs_incoredqs;
 __s32 qs_btimelimit;
 __s32 qs_itimelimit;
 __s32 qs_rtbtimelimit;
 __u16 qs_bwarnlimit;
 __u16 qs_iwarnlimit;
} fs_quota_stat_t;
# 190 "./include/uapi/linux/dqblk_xfs.h"
struct fs_qfilestatv {
 __u64 qfs_ino;
 __u64 qfs_nblks;
 __u32 qfs_nextents;
 __u32 qfs_pad;
};

struct fs_quota_statv {
 __s8 qs_version;
 __u8 qs_pad1;
 __u16 qs_flags;
 __u32 qs_incoredqs;
 struct fs_qfilestatv qs_uquota;
 struct fs_qfilestatv qs_gquota;
 struct fs_qfilestatv qs_pquota;
 __s32 qs_btimelimit;
 __s32 qs_itimelimit;
 __s32 qs_rtbtimelimit;
 __u16 qs_bwarnlimit;
 __u16 qs_iwarnlimit;
 __u64 qs_pad2[8];
};
# 43 "include/linux/quota.h" 2
# 1 "include/linux/dqblk_v1.h" 1
# 44 "include/linux/quota.h" 2
# 1 "include/linux/dqblk_v2.h" 1







# 1 "include/linux/dqblk_qtree.h" 1
# 17 "include/linux/dqblk_qtree.h"
struct dquot;


struct qtree_fmt_operations {
 void (*mem2disk_dqblk)(void *disk, struct dquot *dquot);
 void (*disk2mem_dqblk)(struct dquot *dquot, void *disk);
 int (*is_id)(void *disk, struct dquot *dquot);
};


struct qtree_mem_dqinfo {
 struct super_block *dqi_sb;
 int dqi_type;
 unsigned int dqi_blocks;
 unsigned int dqi_free_blk;
 unsigned int dqi_free_entry;
 unsigned int dqi_blocksize_bits;
 unsigned int dqi_entry_size;
 unsigned int dqi_usable_bs;
 unsigned int dqi_qtree_depth;
 struct qtree_fmt_operations *dqi_ops;
};

int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
int qtree_entry_unused(struct qtree_mem_dqinfo *info, char *disk);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int qtree_depth(struct qtree_mem_dqinfo *info)
{
 unsigned int epb = info->dqi_usable_bs >> 2;
 unsigned long long entries = epb;
 int i;

 for (i = 1; entries < (1ULL << 32); i++)
  entries *= epb;
 return i;
}
# 9 "include/linux/dqblk_v2.h" 2
# 45 "include/linux/quota.h" 2



# 1 "include/linux/projid.h" 1
# 16 "include/linux/projid.h"
struct user_namespace;
extern struct user_namespace init_user_ns;

typedef __kernel_uid32_t projid_t;

typedef struct {
 projid_t val;
} kprojid_t;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) projid_t __kprojid_val(kprojid_t projid)
{
 return projid.val;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool projid_eq(kprojid_t left, kprojid_t right)
{
 return __kprojid_val(left) == __kprojid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool projid_lt(kprojid_t left, kprojid_t right)
{
 return __kprojid_val(left) < __kprojid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool projid_valid(kprojid_t projid)
{
 return !projid_eq(projid, (kprojid_t){ -1 });
}
# 64 "include/linux/projid.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kprojid_t make_kprojid(struct user_namespace *from, projid_t projid)
{
 return (kprojid_t){ projid };
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) projid_t from_kprojid(struct user_namespace *to, kprojid_t kprojid)
{
 return __kprojid_val(kprojid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) projid_t from_kprojid_munged(struct user_namespace *to, kprojid_t kprojid)
{
 projid_t projid = from_kprojid(to, kprojid);
 if (projid == (projid_t)-1)
  projid = 65534;
 return projid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kprojid_has_mapping(struct user_namespace *ns, kprojid_t projid)
{
 return true;
}
# 49 "include/linux/quota.h" 2
# 1 "include/uapi/linux/quota.h" 1
# 88 "include/uapi/linux/quota.h"
enum {
 QIF_BLIMITS_B = 0,
 QIF_SPACE_B,
 QIF_ILIMITS_B,
 QIF_INODES_B,
 QIF_BTIME_B,
 QIF_ITIME_B,
};
# 108 "include/uapi/linux/quota.h"
struct if_dqblk {
 __u64 dqb_bhardlimit;
 __u64 dqb_bsoftlimit;
 __u64 dqb_curspace;
 __u64 dqb_ihardlimit;
 __u64 dqb_isoftlimit;
 __u64 dqb_curinodes;
 __u64 dqb_btime;
 __u64 dqb_itime;
 __u32 dqb_valid;
};
# 129 "include/uapi/linux/quota.h"
enum {
 DQF_ROOT_SQUASH_B = 0,
 DQF_SYS_FILE_B = 16,

 DQF_PRIVATE
};






struct if_dqinfo {
 __u64 dqi_bgrace;
 __u64 dqi_igrace;
 __u32 dqi_flags;
 __u32 dqi_valid;
};
# 163 "include/uapi/linux/quota.h"
enum {
 QUOTA_NL_C_UNSPEC,
 QUOTA_NL_C_WARNING,
 __QUOTA_NL_C_MAX,
};


enum {
 QUOTA_NL_A_UNSPEC,
 QUOTA_NL_A_QTYPE,
 QUOTA_NL_A_EXCESS_ID,
 QUOTA_NL_A_WARNING,
 QUOTA_NL_A_DEV_MAJOR,
 QUOTA_NL_A_DEV_MINOR,
 QUOTA_NL_A_CAUSED_ID,
 __QUOTA_NL_A_MAX,
};
# 50 "include/linux/quota.h" 2



enum quota_type {
 USRQUOTA = 0,
 GRPQUOTA = 1,
 PRJQUOTA = 2,
};






typedef __kernel_uid32_t qid_t;
typedef long long qsize_t;

struct kqid {
 union {
  kuid_t uid;
  kgid_t gid;
  kprojid_t projid;
 };
 enum quota_type type;
};

extern bool qid_eq(struct kqid left, struct kqid right);
extern bool qid_lt(struct kqid left, struct kqid right);
extern qid_t from_kqid(struct user_namespace *to, struct kqid qid);
extern qid_t from_kqid_munged(struct user_namespace *to, struct kqid qid);
extern bool qid_valid(struct kqid qid);
# 96 "include/linux/quota.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid(struct user_namespace *from,
        enum quota_type type, qid_t qid)
{
 struct kqid kqid;

 kqid.type = type;
 switch (type) {
 case USRQUOTA:
  kqid.uid = make_kuid(from, qid);
  break;
 case GRPQUOTA:
  kqid.gid = make_kgid(from, qid);
  break;
 case PRJQUOTA:
  kqid.projid = make_kprojid(from, qid);
  break;
 default:
  do { do_BUG("include/linux/quota.h", 113); __builtin_trap(); } while (0);
 }
 return kqid;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid_invalid(enum quota_type type)
{
 struct kqid kqid;

 kqid.type = type;
 switch (type) {
 case USRQUOTA:
  kqid.uid = (kuid_t){ -1 };
  break;
 case GRPQUOTA:
  kqid.gid = (kgid_t){ -1 };
  break;
 case PRJQUOTA:
  kqid.projid = (kprojid_t){ -1 };
  break;
 default:
  do { do_BUG("include/linux/quota.h", 140); __builtin_trap(); } while (0);
 }
 return kqid;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid_uid(kuid_t uid)
{
 struct kqid kqid;
 kqid.type = USRQUOTA;
 kqid.uid = uid;
 return kqid;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid_gid(kgid_t gid)
{
 struct kqid kqid;
 kqid.type = GRPQUOTA;
 kqid.gid = gid;
 return kqid;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid_projid(kprojid_t projid)
{
 struct kqid kqid;
 kqid.type = PRJQUOTA;
 kqid.projid = projid;
 return kqid;
}


extern spinlock_t dq_data_lock;
# 194 "include/linux/quota.h"
struct mem_dqblk {
 qsize_t dqb_bhardlimit;
 qsize_t dqb_bsoftlimit;
 qsize_t dqb_curspace;
 qsize_t dqb_rsvspace;
 qsize_t dqb_ihardlimit;
 qsize_t dqb_isoftlimit;
 qsize_t dqb_curinodes;
 time_t dqb_btime;
 time_t dqb_itime;
};




struct quota_format_type;

struct mem_dqinfo {
 struct quota_format_type *dqi_format;
 int dqi_fmt_id;

 struct list_head dqi_dirty_list;
 unsigned long dqi_flags;
 unsigned int dqi_bgrace;
 unsigned int dqi_igrace;
 qsize_t dqi_max_spc_limit;
 qsize_t dqi_max_ino_limit;
 void *dqi_priv;
};

struct super_block;






enum {
 DQF_INFO_DIRTY_B = DQF_PRIVATE,
};


extern void mark_info_dirty(struct super_block *sb, int type);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int info_dirty(struct mem_dqinfo *info)
{
 return test_bit(DQF_INFO_DIRTY_B, &info->dqi_flags);
}

enum {
 DQST_LOOKUPS,
 DQST_DROPS,
 DQST_READS,
 DQST_WRITES,
 DQST_CACHE_HITS,
 DQST_ALLOC_DQUOTS,
 DQST_FREE_DQUOTS,
 DQST_SYNCS,
 _DQST_DQSTAT_LAST
};

struct dqstats {
 int stat[_DQST_DQSTAT_LAST];
 struct percpu_counter counter[_DQST_DQSTAT_LAST];
};

extern struct dqstats *dqstats_pcpu;
extern struct dqstats dqstats;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dqstats_inc(unsigned int type)
{
 percpu_counter_inc(&dqstats.counter[type]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dqstats_dec(unsigned int type)
{
 percpu_counter_dec(&dqstats.counter[type]);
}
# 284 "include/linux/quota.h"
struct dquot {
 struct hlist_node dq_hash;
 struct list_head dq_inuse;
 struct list_head dq_free;
 struct list_head dq_dirty;
 struct mutex dq_lock;
 atomic_t dq_count;
 wait_queue_head_t dq_wait_unused;
 struct super_block *dq_sb;
 struct kqid dq_id;
 loff_t dq_off;
 unsigned long dq_flags;
 struct mem_dqblk dq_dqb;
};


struct quota_format_ops {
 int (*check_quota_file)(struct super_block *sb, int type);
 int (*read_file_info)(struct super_block *sb, int type);
 int (*write_file_info)(struct super_block *sb, int type);
 int (*free_file_info)(struct super_block *sb, int type);
 int (*read_dqblk)(struct dquot *dquot);
 int (*commit_dqblk)(struct dquot *dquot);
 int (*release_dqblk)(struct dquot *dquot);
};


struct dquot_operations {
 int (*write_dquot) (struct dquot *);
 struct dquot *(*alloc_dquot)(struct super_block *, int);
 void (*destroy_dquot)(struct dquot *);
 int (*acquire_dquot) (struct dquot *);
 int (*release_dquot) (struct dquot *);
 int (*mark_dirty) (struct dquot *);
 int (*write_info) (struct super_block *, int);


 qsize_t *(*get_reserved_space) (struct inode *);
};

struct path;


struct qc_dqblk {
 int d_fieldmask;
 u64 d_spc_hardlimit;
 u64 d_spc_softlimit;
 u64 d_ino_hardlimit;
 u64 d_ino_softlimit;
 u64 d_space;
 u64 d_ino_count;
 s64 d_ino_timer;

 s64 d_spc_timer;
 int d_ino_warns;
 int d_spc_warns;
 u64 d_rt_spc_hardlimit;
 u64 d_rt_spc_softlimit;
 u64 d_rt_space;
 s64 d_rt_spc_timer;
 int d_rt_spc_warns;
};
# 370 "include/linux/quota.h"
struct quotactl_ops {
 int (*quota_on)(struct super_block *, int, int, struct path *);
 int (*quota_off)(struct super_block *, int);
 int (*quota_enable)(struct super_block *, unsigned int);
 int (*quota_disable)(struct super_block *, unsigned int);
 int (*quota_sync)(struct super_block *, int);
 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
 int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *);
 int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *);
 int (*get_xstate)(struct super_block *, struct fs_quota_stat *);
 int (*get_xstatev)(struct super_block *, struct fs_quota_statv *);
 int (*rm_xquota)(struct super_block *, unsigned int);
};

struct quota_format_type {
 int qf_fmt_id;
 const struct quota_format_ops *qf_ops;
 struct module *qf_owner;
 struct quota_format_type *qf_next;
};


enum {
 _DQUOT_USAGE_ENABLED = 0,
 _DQUOT_LIMITS_ENABLED,
 _DQUOT_SUSPENDED,


 _DQUOT_STATE_FLAGS
};
# 418 "include/linux/quota.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int dquot_state_flag(unsigned int flags, int type)
{
 return flags << _DQUOT_STATE_FLAGS * type;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int dquot_generic_flag(unsigned int flags, int type)
{
 return (flags >> _DQUOT_STATE_FLAGS * type) & ((1 << _DQUOT_USAGE_ENABLED) | (1 << _DQUOT_LIMITS_ENABLED) | (1 << _DQUOT_SUSPENDED));
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void quota_send_warning(struct kqid qid, dev_t dev,
          const char warntype)
{
 return;
}


struct quota_info {
 unsigned int flags;
 struct mutex dqio_mutex;
 struct mutex dqonoff_mutex;
 struct inode *files[2];
 struct mem_dqinfo info[2];
 const struct quota_format_ops *ops[2];
};

int register_quota_format(struct quota_format_type *fmt);
void unregister_quota_format(struct quota_format_type *fmt);

struct quota_module_name {
 int qm_fmt_id;
 char *qm_mod_name;
};
# 266 "include/linux/fs.h" 2
# 299 "include/linux/fs.h"
enum positive_aop_returns {
 AOP_WRITEPAGE_ACTIVATE = 0x80000,
 AOP_TRUNCATED_PAGE = 0x80001,
};
# 313 "include/linux/fs.h"
struct page;
struct address_space;
struct writeback_control;
# 326 "include/linux/fs.h"
typedef struct {
 size_t written;
 size_t count;
 union {
  char *buf;
  void *data;
 } arg;
 int error;
} read_descriptor_t;

typedef int (*read_actor_t)(read_descriptor_t *, struct page *,
  unsigned long, unsigned long);

struct address_space_operations {
 int (*writepage)(struct page *page, struct writeback_control *wbc);
 int (*readpage)(struct file *, struct page *);


 int (*writepages)(struct address_space *, struct writeback_control *);


 int (*set_page_dirty)(struct page *page);

 int (*readpages)(struct file *filp, struct address_space *mapping,
   struct list_head *pages, unsigned nr_pages);

 int (*write_begin)(struct file *, struct address_space *mapping,
    loff_t pos, unsigned len, unsigned flags,
    struct page **pagep, void **fsdata);
 int (*write_end)(struct file *, struct address_space *mapping,
    loff_t pos, unsigned len, unsigned copied,
    struct page *page, void *fsdata);


 sector_t (*bmap)(struct address_space *, sector_t);
 void (*invalidatepage) (struct page *, unsigned int, unsigned int);
 int (*releasepage) (struct page *, gfp_t);
 void (*freepage)(struct page *);
 ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset);




 int (*migratepage) (struct address_space *,
   struct page *, struct page *, enum migrate_mode);
 int (*launder_page) (struct page *);
 int (*is_partially_uptodate) (struct page *, unsigned long,
     unsigned long);
 void (*is_dirty_writeback) (struct page *, bool *, bool *);
 int (*error_remove_page)(struct address_space *, struct page *);


 int (*swap_activate)(struct swap_info_struct *sis, struct file *file,
    sector_t *span);
 void (*swap_deactivate)(struct file *file);
};

extern const struct address_space_operations empty_aops;





int pagecache_write_begin(struct file *, struct address_space *mapping,
    loff_t pos, unsigned len, unsigned flags,
    struct page **pagep, void **fsdata);

int pagecache_write_end(struct file *, struct address_space *mapping,
    loff_t pos, unsigned len, unsigned copied,
    struct page *page, void *fsdata);

struct address_space {
 struct inode *host;
 struct radix_tree_root page_tree;
 spinlock_t tree_lock;
 atomic_t i_mmap_writable;
 struct rb_root i_mmap;
 struct rw_semaphore i_mmap_rwsem;

 unsigned long nrpages;
 unsigned long nrshadows;
 unsigned long writeback_index;
 const struct address_space_operations *a_ops;
 unsigned long flags;
 spinlock_t private_lock;
 struct list_head private_list;
 void *private_data;
} __attribute__((aligned(sizeof(long))));





struct request_queue;

struct block_device {
 dev_t bd_dev;
 int bd_openers;
 struct inode * bd_inode;
 struct super_block * bd_super;
 struct mutex bd_mutex;
 struct list_head bd_inodes;
 void * bd_claiming;
 void * bd_holder;
 int bd_holders;
 bool bd_write_holder;

 struct list_head bd_holder_disks;

 struct block_device * bd_contains;
 unsigned bd_block_size;
 struct hd_struct * bd_part;

 unsigned bd_part_count;
 int bd_invalidated;
 struct gendisk * bd_disk;
 struct request_queue * bd_queue;
 struct list_head bd_list;






 unsigned long bd_private;


 int bd_fsfreeze_count;

 struct mutex bd_fsfreeze_mutex;
};
# 466 "include/linux/fs.h"
int mapping_tagged(struct address_space *mapping, int tag);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_mmap_lock_write(struct address_space *mapping)
{
 down_write(&mapping->i_mmap_rwsem);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_mmap_unlock_write(struct address_space *mapping)
{
 up_write(&mapping->i_mmap_rwsem);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_mmap_lock_read(struct address_space *mapping)
{
 down_read(&mapping->i_mmap_rwsem);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_mmap_unlock_read(struct address_space *mapping)
{
 up_read(&mapping->i_mmap_rwsem);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mapping_mapped(struct address_space *mapping)
{
 return !((&mapping->i_mmap)->rb_node == ((void *)0));
}
# 505 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mapping_writably_mapped(struct address_space *mapping)
{
 return (*({ __attribute__((unused)) typeof((&mapping->i_mmap_writable)->counter) __var = ( typeof((&mapping->i_mmap_writable)->counter)) 0; (volatile typeof((&mapping->i_mmap_writable)->counter) *)&((&mapping->i_mmap_writable)->counter); })) > 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mapping_map_writable(struct address_space *mapping)
{
 return atomic_inc_unless_negative(&mapping->i_mmap_writable) ?
  0 : -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mapping_unmap_writable(struct address_space *mapping)
{
 atomic_sub(1, &mapping->i_mmap_writable);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mapping_deny_writable(struct address_space *mapping)
{
 return atomic_dec_unless_positive(&mapping->i_mmap_writable) ?
  0 : -16;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mapping_allow_writable(struct address_space *mapping)
{
 atomic_add(1, &mapping->i_mmap_writable);
}
# 543 "include/linux/fs.h"
struct posix_acl;
# 555 "include/linux/fs.h"
struct inode {
 umode_t i_mode;
 unsigned short i_opflags;
 kuid_t i_uid;
 kgid_t i_gid;
 unsigned int i_flags;


 struct posix_acl *i_acl;
 struct posix_acl *i_default_acl;


 const struct inode_operations *i_op;
 struct super_block *i_sb;
 struct address_space *i_mapping;






 unsigned long i_ino;







 union {
  const unsigned int i_nlink;
  unsigned int __i_nlink;
 };
 dev_t i_rdev;
 loff_t i_size;
 struct timespec i_atime;
 struct timespec i_mtime;
 struct timespec i_ctime;
 spinlock_t i_lock;
 unsigned short i_bytes;
 unsigned int i_blkbits;
 blkcnt_t i_blocks;






 unsigned long i_state;
 struct mutex i_mutex;

 unsigned long dirtied_when;

 struct hlist_node i_hash;
 struct list_head i_wb_list;
 struct list_head i_lru;
 struct list_head i_sb_list;
 union {
  struct hlist_head i_dentry;
  struct callback_head i_rcu;
 };
 u64 i_version;
 atomic_t i_count;
 atomic_t i_dio_count;
 atomic_t i_writecount;



 const struct file_operations *i_fop;
 struct file_lock_context *i_flctx;
 struct address_space i_data;
 struct list_head i_devices;
 union {
  struct pipe_inode_info *i_pipe;
  struct block_device *i_bdev;
  struct cdev *i_cdev;
 };

 __u32 i_generation;


 __u32 i_fsnotify_mask;
 struct hlist_head i_fsnotify_marks;


 void *i_private;
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inode_unhashed(struct inode *inode)
{
 return hlist_unhashed(&inode->i_hash);
}
# 664 "include/linux/fs.h"
enum inode_i_mutex_lock_class
{
 I_MUTEX_NORMAL,
 I_MUTEX_PARENT,
 I_MUTEX_CHILD,
 I_MUTEX_XATTR,
 I_MUTEX_NONDIR2,
 I_MUTEX_PARENT2,
};

void lock_two_nondirectories(struct inode *, struct inode*);
void unlock_two_nondirectories(struct inode *, struct inode*);
# 687 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) loff_t i_size_read(const struct inode *inode)
{
# 706 "include/linux/fs.h"
 return inode->i_size;

}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_size_write(struct inode *inode, loff_t i_size)
{
# 728 "include/linux/fs.h"
 inode->i_size = i_size;

}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) uid_t i_uid_read(const struct inode *inode)
{
 return from_kuid(&init_user_ns, inode->i_uid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gid_t i_gid_read(const struct inode *inode)
{
 return from_kgid(&init_user_ns, inode->i_gid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_uid_write(struct inode *inode, uid_t uid)
{
 inode->i_uid = make_kuid(&init_user_ns, uid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_gid_write(struct inode *inode, gid_t gid)
{
 inode->i_gid = make_kgid(&init_user_ns, gid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned iminor(const struct inode *inode)
{
 return ((unsigned int) ((inode->i_rdev) & ((1U << 20) - 1)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned imajor(const struct inode *inode)
{
 return ((unsigned int) ((inode->i_rdev) >> 20));
}

extern struct block_device *I_BDEV(struct inode *inode);

struct fown_struct {
 rwlock_t lock;
 struct pid *pid;
 enum pid_type pid_type;
 kuid_t uid, euid;
 int signum;
};




struct file_ra_state {
 unsigned long start;
 unsigned int size;
 unsigned int async_size;


 unsigned int ra_pages;
 unsigned int mmap_miss;
 loff_t prev_pos;
};




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ra_has_index(struct file_ra_state *ra, unsigned long index)
{
 return (index >= ra->start &&
  index < ra->start + ra->size);
}

struct file {
 union {
  struct llist_node fu_llist;
  struct callback_head fu_rcuhead;
 } f_u;
 struct path f_path;
 struct inode *f_inode;
 const struct file_operations *f_op;





 spinlock_t f_lock;
 atomic_long_t f_count;
 unsigned int f_flags;
 fmode_t f_mode;
 struct mutex f_pos_lock;
 loff_t f_pos;
 struct fown_struct f_owner;
 const struct cred *f_cred;
 struct file_ra_state f_ra;

 u64 f_version;




 void *private_data;



 struct list_head f_ep_links;
 struct list_head f_tfile_llink;

 struct address_space *f_mapping;
} __attribute__((aligned(4)));

struct file_handle {
 __u32 handle_bytes;
 int handle_type;

 unsigned char f_handle[0];
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct file *get_file(struct file *f)
{
 atomic_long_inc(&f->f_count);
 return f;
}
# 883 "include/linux/fs.h"
typedef void *fl_owner_t;

struct file_lock;

struct file_lock_operations {
 void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
 void (*fl_release_private)(struct file_lock *);
};

struct lock_manager_operations {
 int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
 unsigned long (*lm_owner_key)(struct file_lock *);
 void (*lm_get_owner)(struct file_lock *, struct file_lock *);
 void (*lm_put_owner)(struct file_lock *);
 void (*lm_notify)(struct file_lock *);
 int (*lm_grant)(struct file_lock *, int);
 bool (*lm_break)(struct file_lock *);
 int (*lm_change)(struct file_lock *, int, struct list_head *);
 void (*lm_setup)(struct file_lock *, void **);
};

struct lock_manager {
 struct list_head list;
};

struct net;
void locks_start_grace(struct net *, struct lock_manager *);
void locks_end_grace(struct lock_manager *);
int locks_in_grace(struct net *);


# 1 "include/linux/nfs_fs_i.h" 1



struct nlm_lockowner;




struct nfs_lock_info {
 u32 state;
 struct nlm_lockowner *owner;
 struct list_head list;
};

struct nfs4_lock_state;
struct nfs4_lock_info {
 struct nfs4_lock_state *owner;
};
# 915 "include/linux/fs.h" 2
# 933 "include/linux/fs.h"
struct file_lock {
 struct file_lock *fl_next;
 struct list_head fl_list;
 struct hlist_node fl_link;
 struct list_head fl_block;
 fl_owner_t fl_owner;
 unsigned int fl_flags;
 unsigned char fl_type;
 unsigned int fl_pid;
 int fl_link_cpu;
 struct pid *fl_nspid;
 wait_queue_head_t fl_wait;
 struct file *fl_file;
 loff_t fl_start;
 loff_t fl_end;

 struct fasync_struct * fl_fasync;

 unsigned long fl_break_time;
 unsigned long fl_downgrade_time;

 const struct file_lock_operations *fl_ops;
 const struct lock_manager_operations *fl_lmops;
 union {
  struct nfs_lock_info nfs_fl;
  struct nfs4_lock_info nfs4_fl;
  struct {
   struct list_head link;
   int state;
  } afs;
 } fl_u;
};

struct file_lock_context {
 spinlock_t flc_lock;
 struct list_head flc_flock;
 struct list_head flc_posix;
 struct list_head flc_lease;
};
# 980 "include/linux/fs.h"
# 1 "include/linux/fcntl.h" 1



# 1 "include/uapi/linux/fcntl.h" 1



# 1 "./arch/sparc/include/uapi/asm/fcntl.h" 1
# 54 "./arch/sparc/include/uapi/asm/fcntl.h"
# 1 "./include/uapi/asm-generic/fcntl.h" 1
# 155 "./include/uapi/asm-generic/fcntl.h"
struct f_owner_ex {
 int type;
 __kernel_pid_t pid;
};
# 195 "./include/uapi/asm-generic/fcntl.h"
struct flock {
 short l_type;
 short l_whence;
 __kernel_off_t l_start;
 __kernel_off_t l_len;
 __kernel_pid_t l_pid;
 short __unused;
};







struct flock64 {
 short l_type;
 short l_whence;
 __kernel_loff_t l_start;
 __kernel_loff_t l_len;
 __kernel_pid_t l_pid;
 short __unused;
};
# 55 "./arch/sparc/include/uapi/asm/fcntl.h" 2
# 5 "include/uapi/linux/fcntl.h" 2
# 5 "include/linux/fcntl.h" 2
# 981 "include/linux/fs.h" 2

extern void send_sigio(struct fown_struct *fown, int fd, int band);


extern int fcntl_getlk(struct file *, unsigned int, struct flock *);
extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
   struct flock *);







extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
extern int fcntl_getlease(struct file *filp);


void locks_free_lock_context(struct file_lock_context *ctx);
void locks_free_lock(struct file_lock *fl);
extern void locks_init_lock(struct file_lock *);
extern struct file_lock * locks_alloc_lock(void);
extern void locks_copy_lock(struct file_lock *, struct file_lock *);
extern void locks_copy_conflock(struct file_lock *, struct file_lock *);
extern void locks_remove_posix(struct file *, fl_owner_t);
extern void locks_remove_file(struct file *);
extern void locks_release_private(struct file_lock *);
extern void posix_test_lock(struct file *, struct file_lock *);
extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
extern int posix_lock_file_wait(struct file *, struct file_lock *);
extern int posix_unblock_lock(struct file_lock *);
extern int vfs_test_lock(struct file *, struct file_lock *);
extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type);
extern void lease_get_mtime(struct inode *, struct timespec *time);
extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
extern int lease_modify(struct file_lock *, int, struct list_head *);
# 1160 "include/linux/fs.h"
struct fasync_struct {
 spinlock_t fa_lock;
 int magic;
 int fa_fd;
 struct fasync_struct *fa_next;
 struct file *fa_file;
 struct callback_head fa_rcu;
};




extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struct fasync_struct *);
extern int fasync_remove_entry(struct file *, struct fasync_struct **);
extern struct fasync_struct *fasync_alloc(void);
extern void fasync_free(struct fasync_struct *);


extern void kill_fasync(struct fasync_struct **, int, int);

extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
extern void f_setown(struct file *filp, unsigned long arg, int force);
extern void f_delown(struct file *filp);
extern pid_t f_getown(struct file *filp);
extern int send_sigurg(struct fown_struct *fown);

struct mm_struct;
# 1201 "include/linux/fs.h"
enum {
 SB_UNFROZEN = 0,
 SB_FREEZE_WRITE = 1,
 SB_FREEZE_PAGEFAULT = 2,
 SB_FREEZE_FS = 3,

 SB_FREEZE_COMPLETE = 4,
};



struct sb_writers {

 struct percpu_counter counter[(SB_FREEZE_COMPLETE - 1)];
 wait_queue_head_t wait;

 int frozen;
 wait_queue_head_t wait_unfrozen;




};

struct super_block {
 struct list_head s_list;
 dev_t s_dev;
 unsigned char s_blocksize_bits;
 unsigned long s_blocksize;
 loff_t s_maxbytes;
 struct file_system_type *s_type;
 const struct super_operations *s_op;
 const struct dquot_operations *dq_op;
 const struct quotactl_ops *s_qcop;
 const struct export_operations *s_export_op;
 unsigned long s_flags;
 unsigned long s_magic;
 struct dentry *s_root;
 struct rw_semaphore s_umount;
 int s_count;
 atomic_t s_active;



 const struct xattr_handler **s_xattr;

 struct list_head s_inodes;
 struct hlist_bl_head s_anon;
 struct list_head s_mounts;
 struct block_device *s_bdev;
 struct backing_dev_info *s_bdi;
 struct mtd_info *s_mtd;
 struct hlist_node s_instances;
 unsigned int s_quota_types;
 struct quota_info s_dquot;

 struct sb_writers s_writers;

 char s_id[32];
 u8 s_uuid[16];

 void *s_fs_info;
 unsigned int s_max_links;
 fmode_t s_mode;



 u32 s_time_gran;





 struct mutex s_vfs_rename_mutex;





 char *s_subtype;





 char *s_options;
 const struct dentry_operations *s_d_op;




 int cleancache_poolid;

 struct shrinker s_shrink;


 atomic_long_t s_remove_count;


 int s_readonly_remount;


 struct workqueue_struct *s_dio_done_wq;
 struct hlist_head s_pins;





 struct list_lru s_dentry_lru __attribute__((__aligned__((1 << 6))));
 struct list_lru s_inode_lru __attribute__((__aligned__((1 << 6))));
 struct callback_head rcu;




 int s_stack_depth;
};

extern struct timespec current_fs_time(struct super_block *sb);





void __sb_end_write(struct super_block *sb, int level);
int __sb_start_write(struct super_block *sb, int level, bool wait);
# 1336 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_end_write(struct super_block *sb)
{
 __sb_end_write(sb, SB_FREEZE_WRITE);
}
# 1348 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_end_pagefault(struct super_block *sb)
{
 __sb_end_write(sb, SB_FREEZE_PAGEFAULT);
}
# 1360 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_end_intwrite(struct super_block *sb)
{
 __sb_end_write(sb, SB_FREEZE_FS);
}
# 1384 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_start_write(struct super_block *sb)
{
 __sb_start_write(sb, SB_FREEZE_WRITE, true);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sb_start_write_trylock(struct super_block *sb)
{
 return __sb_start_write(sb, SB_FREEZE_WRITE, false);
}
# 1413 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_start_pagefault(struct super_block *sb)
{
 __sb_start_write(sb, SB_FREEZE_PAGEFAULT, true);
}
# 1431 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_start_intwrite(struct super_block *sb)
{
 __sb_start_write(sb, SB_FREEZE_FS, true);
}


extern bool inode_owner_or_capable(const struct inode *inode);




extern int vfs_create(struct inode *, struct dentry *, umode_t, bool);
extern int vfs_mkdir(struct inode *, struct dentry *, umode_t);
extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t);
extern int vfs_symlink(struct inode *, struct dentry *, const char *);
extern int vfs_link(struct dentry *, struct inode *, struct dentry *, struct inode **);
extern int vfs_rmdir(struct inode *, struct dentry *);
extern int vfs_unlink(struct inode *, struct dentry *, struct inode **);
extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *, struct inode **, unsigned int);
extern int vfs_whiteout(struct inode *, struct dentry *);




extern void dentry_unhash(struct dentry *dentry);




extern void inode_init_owner(struct inode *inode, const struct inode *dir,
   umode_t mode);



struct fiemap_extent_info {
 unsigned int fi_flags;
 unsigned int fi_extents_mapped;
 unsigned int fi_extents_max;
 struct fiemap_extent *fi_extents_start;

};
int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical,
       u64 phys, u64 len, u32 flags);
int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
# 1498 "include/linux/fs.h"
struct dir_context;
typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64,
    unsigned);

struct dir_context {
 const filldir_t actor;
 loff_t pos;
};

struct block_device_operations;
# 1535 "include/linux/fs.h"
struct iov_iter;

struct file_operations {
 struct module *owner;
 loff_t (*llseek) (struct file *, loff_t, int);
 ssize_t (*read) (struct file *, char *, size_t, loff_t *);
 ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
 ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
 ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
 ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
 int (*iterate) (struct file *, struct dir_context *);
 unsigned int (*poll) (struct file *, struct poll_table_struct *);
 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
 int (*mmap) (struct file *, struct vm_area_struct *);
 void (*mremap)(struct file *, struct vm_area_struct *);
 int (*open) (struct inode *, struct file *);
 int (*flush) (struct file *, fl_owner_t id);
 int (*release) (struct inode *, struct file *);
 int (*fsync) (struct file *, loff_t, loff_t, int datasync);
 int (*aio_fsync) (struct kiocb *, int datasync);
 int (*fasync) (int, struct file *, int);
 int (*lock) (struct file *, int, struct file_lock *);
 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
 int (*check_flags)(int);
 int (*flock) (struct file *, int, struct file_lock *);
 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
 int (*setlease)(struct file *, long, struct file_lock **, void **);
 long (*fallocate)(struct file *file, int mode, loff_t offset,
     loff_t len);
 void (*show_fdinfo)(struct seq_file *m, struct file *f);



};

struct inode_operations {
 struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
 void * (*follow_link) (struct dentry *, struct nameidata *);
 int (*permission) (struct inode *, int);
 struct posix_acl * (*get_acl)(struct inode *, int);

 int (*readlink) (struct dentry *, char *,int);
 void (*put_link) (struct dentry *, struct nameidata *, void *);

 int (*create) (struct inode *,struct dentry *, umode_t, bool);
 int (*link) (struct dentry *,struct inode *,struct dentry *);
 int (*unlink) (struct inode *,struct dentry *);
 int (*symlink) (struct inode *,struct dentry *,const char *);
 int (*mkdir) (struct inode *,struct dentry *,umode_t);
 int (*rmdir) (struct inode *,struct dentry *);
 int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
 int (*rename) (struct inode *, struct dentry *,
   struct inode *, struct dentry *);
 int (*rename2) (struct inode *, struct dentry *,
   struct inode *, struct dentry *, unsigned int);
 int (*setattr) (struct dentry *, struct iattr *);
 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
 ssize_t (*listxattr) (struct dentry *, char *, size_t);
 int (*removexattr) (struct dentry *, const char *);
 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
        u64 len);
 int (*update_time)(struct inode *, struct timespec *, int);
 int (*atomic_open)(struct inode *, struct dentry *,
      struct file *, unsigned open_flag,
      umode_t create_mode, int *opened);
 int (*tmpfile) (struct inode *, struct dentry *, umode_t);
 int (*set_acl)(struct inode *, struct posix_acl *, int);


 int (*dentry_open)(struct dentry *, struct file *, const struct cred *);
} __attribute__((__aligned__((1 << 6))));

ssize_t rw_copy_check_uvector(int type, const struct iovec * uvector,
         unsigned long nr_segs, unsigned long fast_segs,
         struct iovec *fast_pointer,
         struct iovec **ret_pointer);

extern ssize_t __vfs_read(struct file *, char *, size_t, loff_t *);
extern ssize_t vfs_read(struct file *, char *, size_t, loff_t *);
extern ssize_t vfs_write(struct file *, const char *, size_t, loff_t *);
extern ssize_t vfs_readv(struct file *, const struct iovec *,
  unsigned long, loff_t *);
extern ssize_t vfs_writev(struct file *, const struct iovec *,
  unsigned long, loff_t *);

struct super_operations {
    struct inode *(*alloc_inode)(struct super_block *sb);
 void (*destroy_inode)(struct inode *);

    void (*dirty_inode) (struct inode *, int flags);
 int (*write_inode) (struct inode *, struct writeback_control *wbc);
 int (*drop_inode) (struct inode *);
 void (*evict_inode) (struct inode *);
 void (*put_super) (struct super_block *);
 int (*sync_fs)(struct super_block *sb, int wait);
 int (*freeze_super) (struct super_block *);
 int (*freeze_fs) (struct super_block *);
 int (*thaw_super) (struct super_block *);
 int (*unfreeze_fs) (struct super_block *);
 int (*statfs) (struct dentry *, struct kstatfs *);
 int (*remount_fs) (struct super_block *, int *, char *);
 void (*umount_begin) (struct super_block *);

 int (*show_options)(struct seq_file *, struct dentry *);
 int (*show_devname)(struct seq_file *, struct dentry *);
 int (*show_path)(struct seq_file *, struct dentry *);
 int (*show_stats)(struct seq_file *, struct dentry *);





 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
 long (*nr_cached_objects)(struct super_block *,
      struct shrink_control *);
 long (*free_cached_objects)(struct super_block *,
        struct shrink_control *);
};
# 1797 "include/linux/fs.h"
extern void __mark_inode_dirty(struct inode *, int);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mark_inode_dirty(struct inode *inode)
{
 __mark_inode_dirty(inode, ((1 << 0) | (1 << 1) | (1 << 2)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mark_inode_dirty_sync(struct inode *inode)
{
 __mark_inode_dirty(inode, (1 << 0));
}

extern void inc_nlink(struct inode *inode);
extern void drop_nlink(struct inode *inode);
extern void clear_nlink(struct inode *inode);
extern void set_nlink(struct inode *inode, unsigned int nlink);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_inc_link_count(struct inode *inode)
{
 inc_nlink(inode);
 mark_inode_dirty(inode);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_dec_link_count(struct inode *inode)
{
 drop_nlink(inode);
 mark_inode_dirty(inode);
}
# 1833 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_inc_iversion(struct inode *inode)
{
       spin_lock(&inode->i_lock);
       inode->i_version++;
       spin_unlock(&inode->i_lock);
}

enum file_time_flags {
 S_ATIME = 1,
 S_MTIME = 2,
 S_CTIME = 4,
 S_VERSION = 8,
};

extern void touch_atime(const struct path *);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void file_accessed(struct file *file)
{
 if (!(file->f_flags & 0x200000))
  touch_atime(&file->f_path);
}

int sync_inode(struct inode *inode, struct writeback_control *wbc);
int sync_inode_metadata(struct inode *inode, int wait);

struct file_system_type {
 const char *name;
 int fs_flags;






 struct dentry *(*mount) (struct file_system_type *, int,
         const char *, void *);
 void (*kill_sb) (struct super_block *);
 struct module *owner;
 struct file_system_type * next;
 struct hlist_head fs_supers;

 struct lock_class_key s_lock_key;
 struct lock_class_key s_umount_key;
 struct lock_class_key s_vfs_rename_key;
 struct lock_class_key s_writers_key[(SB_FREEZE_COMPLETE - 1)];

 struct lock_class_key i_lock_key;
 struct lock_class_key i_mutex_key;
 struct lock_class_key i_mutex_dir_key;
};



extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
 void *data, int (*fill_super)(struct super_block *, void *, int));
extern struct dentry *mount_bdev(struct file_system_type *fs_type,
 int flags, const char *dev_name, void *data,
 int (*fill_super)(struct super_block *, void *, int));
extern struct dentry *mount_single(struct file_system_type *fs_type,
 int flags, void *data,
 int (*fill_super)(struct super_block *, void *, int));
extern struct dentry *mount_nodev(struct file_system_type *fs_type,
 int flags, void *data,
 int (*fill_super)(struct super_block *, void *, int));
extern struct dentry *mount_subtree(struct vfsmount *mnt, const char *path);
void generic_shutdown_super(struct super_block *sb);
void kill_block_super(struct super_block *sb);
void kill_anon_super(struct super_block *sb);
void kill_litter_super(struct super_block *sb);
void deactivate_super(struct super_block *sb);
void deactivate_locked_super(struct super_block *sb);
int set_anon_super(struct super_block *s, void *data);
int get_anon_bdev(dev_t *);
void free_anon_bdev(dev_t);
struct super_block *sget(struct file_system_type *type,
   int (*test)(struct super_block *,void *),
   int (*set)(struct super_block *,void *),
   int flags, void *data);
extern struct dentry *mount_pseudo(struct file_system_type *, char *,
 const struct super_operations *ops,
 const struct dentry_operations *dops,
 unsigned long);
# 1932 "include/linux/fs.h"
extern int register_filesystem(struct file_system_type *);
extern int unregister_filesystem(struct file_system_type *);
extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data);

extern void kern_unmount(struct vfsmount *mnt);
extern int may_umount_tree(struct vfsmount *);
extern int may_umount(struct vfsmount *);
extern long do_mount(const char *, const char *,
       const char *, unsigned long, void *);
extern struct vfsmount *collect_mounts(struct path *);
extern void drop_collected_mounts(struct vfsmount *);
extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,
     struct vfsmount *);
extern int vfs_statfs(struct path *, struct kstatfs *);
extern int user_statfs(const char *, struct kstatfs *);
extern int fd_statfs(int, struct kstatfs *);
extern int vfs_ustat(dev_t, struct kstatfs *);
extern int freeze_super(struct super_block *super);
extern int thaw_super(struct super_block *super);
extern bool our_mnt(struct vfsmount *mnt);
extern bool fs_fully_visible(struct file_system_type *);

extern int current_umask(void);

extern void ihold(struct inode * inode);
extern void iput(struct inode *);
extern int generic_update_time(struct inode *, struct timespec *, int);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inode *file_inode(const struct file *f)
{
 return f->f_inode;
}


extern struct kobject *fs_kobj;







extern int locks_mandatory_locked(struct file *);
extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __mandatory_lock(struct inode *ino)
{
 return (ino->i_mode & (0002000 | 00010)) == 0002000;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mandatory_lock(struct inode *ino)
{
 return ((ino)->i_sb->s_flags & (64)) && __mandatory_lock(ino);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int locks_verify_locked(struct file *file)
{
 if (mandatory_lock(file_inode(file)))
  return locks_mandatory_locked(file);
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int locks_verify_truncate(struct inode *inode,
        struct file *filp,
        loff_t size)
{
 if (inode->i_flctx && mandatory_lock(inode))
  return locks_mandatory_area(
   2, inode, filp,
   size < inode->i_size ? size : inode->i_size,
   (size < inode->i_size ? inode->i_size - size
    : size - inode->i_size)
  );
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int break_lease(struct inode *inode, unsigned int mode)
{






 do { __asm__ __volatile__("ba,pt	%%xcc, 1f\n\t" " membar	" "#StoreLoad" "\n" "1:\n" : : : "memory"); } while (0);
 if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))
  return __break_lease(inode, mode, 32);
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int break_deleg(struct inode *inode, unsigned int mode)
{






 do { __asm__ __volatile__("ba,pt	%%xcc, 1f\n\t" " membar	" "#StoreLoad" "\n" "1:\n" : : : "memory"); } while (0);
 if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))
  return __break_lease(inode, mode, 4);
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int try_break_deleg(struct inode *inode, struct inode **delegated_inode)
{
 int ret;

 ret = break_deleg(inode, 00000001|0x4000);
 if (ret == -11 && delegated_inode) {
  *delegated_inode = inode;
  ihold(inode);
 }
 return ret;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int break_deleg_wait(struct inode **delegated_inode)
{
 int ret;

 ret = break_deleg(*delegated_inode, 00000001);
 iput(*delegated_inode);
 *delegated_inode = ((void *)0);
 return ret;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int break_layout(struct inode *inode, bool wait)
{
 do { __asm__ __volatile__("ba,pt	%%xcc, 1f\n\t" " membar	" "#StoreLoad" "\n" "1:\n" : : : "memory"); } while (0);
 if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))
  return __break_lease(inode,
    wait ? 00000001 : 00000001 | 0x4000,
    2048);
 return 0;
}
# 2141 "include/linux/fs.h"
struct audit_names;
struct filename {
 const char *name;
 const char *uptr;
 struct audit_names *aname;
 int refcnt;
 bool separate;
};

extern long vfs_truncate(struct path *, loff_t);
extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
         struct file *filp);
extern int vfs_fallocate(struct file *file, int mode, loff_t offset,
   loff_t len);
extern long do_sys_open(int dfd, const char *filename, int flags,
   umode_t mode);
extern struct file *file_open_name(struct filename *, int, umode_t);
extern struct file *filp_open(const char *, int, umode_t);
extern struct file *file_open_root(struct dentry *, struct vfsmount *,
       const char *, int);
extern int vfs_open(const struct path *, struct file *, const struct cred *);
extern struct file * dentry_open(const struct path *, int, const struct cred *);
extern int filp_close(struct file *, fl_owner_t id);

extern struct filename *getname_flags(const char *, int, int *);
extern struct filename *getname(const char *);
extern struct filename *getname_kernel(const char *);
extern void putname(struct filename *name);

enum {
 FILE_CREATED = 1,
 FILE_OPENED = 2
};
extern int finish_open(struct file *file, struct dentry *dentry,
   int (*open)(struct inode *, struct file *),
   int *opened);
extern int finish_no_open(struct file *file, struct dentry *dentry);



extern int ioctl_preallocate(struct file *filp, void *argp);


extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) vfs_caches_init_early(void);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) vfs_caches_init(unsigned long);

extern struct kmem_cache *names_cachep;





extern int register_blkdev(unsigned int, const char *);
extern void unregister_blkdev(unsigned int, const char *);
extern struct block_device *bdget(dev_t);
extern struct block_device *bdgrab(struct block_device *bdev);
extern void bd_set_size(struct block_device *, loff_t size);
extern void bd_forget(struct inode *inode);
extern void bdput(struct block_device *);
extern void invalidate_bdev(struct block_device *);
extern void iterate_bdevs(void (*)(struct block_device *, void *), void *);
extern int sync_blockdev(struct block_device *bdev);
extern void kill_bdev(struct block_device *);
extern struct super_block *freeze_bdev(struct block_device *);
extern void emergency_thaw_all(void);
extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
extern int fsync_bdev(struct block_device *);
extern int sb_is_blkdev_sb(struct super_block *sb);
# 2234 "include/linux/fs.h"
extern int sync_filesystem(struct super_block *);
extern const struct file_operations def_blk_fops;
extern const struct file_operations def_chr_fops;

extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long);
extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
extern int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder);
extern struct block_device *blkdev_get_by_path(const char *path, fmode_t mode,
            void *holder);
extern struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode,
           void *holder);
extern void blkdev_put(struct block_device *bdev, fmode_t mode);

extern int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk);
extern void bd_unlink_disk_holder(struct block_device *bdev,
      struct gendisk *disk);
# 2266 "include/linux/fs.h"
extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
extern int register_chrdev_region(dev_t, unsigned, const char *);
extern int __register_chrdev(unsigned int major, unsigned int baseminor,
        unsigned int count, const char *name,
        const struct file_operations *fops);
extern void __unregister_chrdev(unsigned int major, unsigned int baseminor,
    unsigned int count, const char *name);
extern void unregister_chrdev_region(dev_t, unsigned);
extern void chrdev_show(struct seq_file *,off_t);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int register_chrdev(unsigned int major, const char *name,
      const struct file_operations *fops)
{
 return __register_chrdev(major, 0, 256, name, fops);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unregister_chrdev(unsigned int major, const char *name)
{
 __unregister_chrdev(major, 0, 256, name);
}







extern const char *__bdevname(dev_t, char *buffer);
extern const char *bdevname(struct block_device *bdev, char *buffer);
extern struct block_device *lookup_bdev(const char *);
extern void blkdev_show(struct seq_file *,off_t);





extern void init_special_inode(struct inode *, umode_t, dev_t);


extern void make_bad_inode(struct inode *);
extern int is_bad_inode(struct inode *);
# 2319 "include/linux/fs.h"
extern void check_disk_size_change(struct gendisk *disk,
       struct block_device *bdev);
extern int revalidate_disk(struct gendisk *);
extern int check_disk_change(struct block_device *);
extern int __invalidate_device(struct block_device *, bool);
extern int invalidate_partition(struct gendisk *, int);

unsigned long invalidate_mapping_pages(struct address_space *mapping,
     unsigned long start, unsigned long end);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void invalidate_remote_inode(struct inode *inode)
{
 if ((((inode->i_mode) & 00170000) == 0100000) || (((inode->i_mode) & 00170000) == 0040000) ||
     (((inode->i_mode) & 00170000) == 0120000))
  invalidate_mapping_pages(inode->i_mapping, 0, -1);
}
extern int invalidate_inode_pages2(struct address_space *mapping);
extern int invalidate_inode_pages2_range(struct address_space *mapping,
      unsigned long start, unsigned long end);
extern int write_inode_now(struct inode *, int);
extern int filemap_fdatawrite(struct address_space *);
extern int filemap_flush(struct address_space *);
extern int filemap_fdatawait(struct address_space *);
extern int filemap_fdatawait_range(struct address_space *, loff_t lstart,
       loff_t lend);
extern int filemap_write_and_wait(struct address_space *mapping);
extern int filemap_write_and_wait_range(struct address_space *mapping,
            loff_t lstart, loff_t lend);
extern int __filemap_fdatawrite_range(struct address_space *mapping,
    loff_t start, loff_t end, int sync_mode);
extern int filemap_fdatawrite_range(struct address_space *mapping,
    loff_t start, loff_t end);

extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
      int datasync);
extern int vfs_fsync(struct file *file, int datasync);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int generic_write_sync(struct file *file, loff_t pos, loff_t count)
{
 if (!(file->f_flags & 0x2000) && !(((file->f_mapping->host)->i_sb->s_flags & (16)) || ((file->f_mapping->host)->i_flags & 1)))
  return 0;
 return vfs_fsync_range(file, pos, pos + count - 1,
          (file->f_flags & 0x800000) ? 0 : 1);
}
extern void emergency_sync(void);
extern void emergency_remount(void);

extern sector_t bmap(struct inode *, sector_t);

extern int notify_change(struct dentry *, struct iattr *, struct inode **);
extern int inode_permission(struct inode *, int);
extern int __inode_permission(struct inode *, int);
extern int generic_permission(struct inode *, int);
extern int __check_sticky(struct inode *dir, struct inode *inode);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool execute_ok(struct inode *inode)
{
 return (inode->i_mode & (00100|00010|00001)) || (((inode->i_mode) & 00170000) == 0040000);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void file_start_write(struct file *file)
{
 if (!(((file_inode(file)->i_mode) & 00170000) == 0100000))
  return;
 __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool file_start_write_trylock(struct file *file)
{
 if (!(((file_inode(file)->i_mode) & 00170000) == 0100000))
  return true;
 return __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, false);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void file_end_write(struct file *file)
{
 if (!(((file_inode(file)->i_mode) & 00170000) == 0100000))
  return;
 __sb_end_write(file_inode(file)->i_sb, SB_FREEZE_WRITE);
}
# 2415 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_write_access(struct inode *inode)
{
 return atomic_inc_unless_negative(&inode->i_writecount) ? 0 : -26;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int deny_write_access(struct file *file)
{
 struct inode *inode = file_inode(file);
 return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -26;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_write_access(struct inode * inode)
{
 atomic_sub(1, &inode->i_writecount);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void allow_write_access(struct file *file)
{
 if (file)
  atomic_add(1, &file_inode(file)->i_writecount);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool inode_is_open_for_write(const struct inode *inode)
{
 return (*({ __attribute__((unused)) typeof((&inode->i_writecount)->counter) __var = ( typeof((&inode->i_writecount)->counter)) 0; (volatile typeof((&inode->i_writecount)->counter) *)&((&inode->i_writecount)->counter); })) > 0;
}
# 2449 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_readcount_dec(struct inode *inode)
{
 return;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_readcount_inc(struct inode *inode)
{
 return;
}

extern int do_pipe_flags(int *, int);

extern int kernel_read(struct file *, loff_t, char *, unsigned long);
extern ssize_t kernel_write(struct file *, const char *, size_t, loff_t);
extern ssize_t __kernel_write(struct file *, const char *, size_t, loff_t *);
extern struct file * open_exec(const char *);


extern int is_subdir(struct dentry *, struct dentry *);
extern int path_is_under(struct path *, struct path *);

# 1 "include/linux/err.h" 1
# 23 "include/linux/err.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void * __attribute__((warn_unused_result)) ERR_PTR(long error)
{
 return (void *) error;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long __attribute__((warn_unused_result)) PTR_ERR( const void *ptr)
{
 return (long) ptr;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __attribute__((warn_unused_result)) IS_ERR( const void *ptr)
{
 return __builtin_expect(!!(((unsigned long)ptr) >= (unsigned long)-4095), 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __attribute__((warn_unused_result)) IS_ERR_OR_NULL( const void *ptr)
{
 return !ptr || __builtin_expect(!!(((unsigned long)ptr) >= (unsigned long)-4095), 0);
}
# 50 "include/linux/err.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void * __attribute__((warn_unused_result)) ERR_CAST( const void *ptr)
{

 return (void *) ptr;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) PTR_ERR_OR_ZERO( const void *ptr)
{
 if (IS_ERR(ptr))
  return PTR_ERR(ptr);
 else
  return 0;
}
# 2470 "include/linux/fs.h" 2


extern loff_t default_llseek(struct file *file, loff_t offset, int whence);

extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence);

extern int inode_init_always(struct super_block *, struct inode *);
extern void inode_init_once(struct inode *);
extern void address_space_init_once(struct address_space *mapping);
extern struct inode * igrab(struct inode *);
extern ino_t iunique(struct super_block *, ino_t);
extern int inode_needs_sync(struct inode *inode);
extern int generic_delete_inode(struct inode *inode);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int generic_drop_inode(struct inode *inode)
{
 return !inode->i_nlink || inode_unhashed(inode);
}

extern struct inode *ilookup5_nowait(struct super_block *sb,
  unsigned long hashval, int (*test)(struct inode *, void *),
  void *data);
extern struct inode *ilookup5(struct super_block *sb, unsigned long hashval,
  int (*test)(struct inode *, void *), void *data);
extern struct inode *ilookup(struct super_block *sb, unsigned long ino);

extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *);
extern struct inode * iget_locked(struct super_block *, unsigned long);
extern struct inode *find_inode_nowait(struct super_block *,
           unsigned long,
           int (*match)(struct inode *,
          unsigned long, void *),
           void *data);
extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
extern int insert_inode_locked(struct inode *);



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void lockdep_annotate_inode_mutex_key(struct inode *inode) { };

extern void unlock_new_inode(struct inode *);
extern unsigned int get_next_ino(void);

extern void __iget(struct inode * inode);
extern void iget_failed(struct inode *);
extern void clear_inode(struct inode *);
extern void __destroy_inode(struct inode *);
extern struct inode *new_inode_pseudo(struct super_block *sb);
extern struct inode *new_inode(struct super_block *sb);
extern void free_inode_nonrcu(struct inode *inode);
extern int should_remove_suid(struct dentry *);
extern int file_remove_suid(struct file *);

extern void __insert_inode_hash(struct inode *, unsigned long hashval);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void insert_inode_hash(struct inode *inode)
{
 __insert_inode_hash(inode, inode->i_ino);
}

extern void __remove_inode_hash(struct inode *);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void remove_inode_hash(struct inode *inode)
{
 if (!inode_unhashed(inode))
  __remove_inode_hash(inode);
}

extern void inode_sb_list_add(struct inode *inode);


extern void submit_bio(int, struct bio *);
extern int bdev_read_only(struct block_device *);

extern int set_blocksize(struct block_device *, int);
extern int sb_set_blocksize(struct super_block *, int);
extern int sb_min_blocksize(struct super_block *, int);

extern int generic_file_mmap(struct file *, struct vm_area_struct *);
extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
extern ssize_t generic_file_read_iter(struct kiocb *, struct iov_iter *);
extern ssize_t __generic_file_write_iter(struct kiocb *, struct iov_iter *);
extern ssize_t generic_file_write_iter(struct kiocb *, struct iov_iter *);
extern ssize_t generic_file_direct_write(struct kiocb *, struct iov_iter *, loff_t);
extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t);
extern ssize_t do_sync_read(struct file *filp, char *buf, size_t len, loff_t *ppos);
extern ssize_t do_sync_write(struct file *filp, const char *buf, size_t len, loff_t *ppos);
extern ssize_t new_sync_read(struct file *filp, char *buf, size_t len, loff_t *ppos);
extern ssize_t new_sync_write(struct file *filp, const char *buf, size_t len, loff_t *ppos);

ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos);
ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos);


extern ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to);
extern ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from);
extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
   int datasync);
extern void block_sync_page(struct page *page);


extern ssize_t generic_file_splice_read(struct file *, loff_t *,
  struct pipe_inode_info *, size_t, unsigned int);
extern ssize_t default_file_splice_read(struct file *, loff_t *,
  struct pipe_inode_info *, size_t, unsigned int);
extern ssize_t iter_file_splice_write(struct pipe_inode_info *,
  struct file *, loff_t *, size_t, unsigned int);
extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe,
  struct file *out, loff_t *, size_t len, unsigned int flags);
extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
  loff_t *opos, size_t len, unsigned int flags);


extern void
file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
extern loff_t noop_llseek(struct file *file, loff_t offset, int whence);
extern loff_t no_llseek(struct file *file, loff_t offset, int whence);
extern loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize);
extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence);
extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
  int whence, loff_t maxsize, loff_t eof);
extern loff_t fixed_size_llseek(struct file *file, loff_t offset,
  int whence, loff_t size);
extern int generic_file_open(struct inode * inode, struct file * filp);
extern int nonseekable_open(struct inode * inode, struct file * filp);

ssize_t dax_do_io(int rw, struct kiocb *, struct inode *, struct iov_iter *,
  loff_t, get_block_t, dio_iodone_t, int flags);
int dax_clear_blocks(struct inode *, sector_t block, long size);
int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t);
int dax_truncate_page(struct inode *, loff_t from, get_block_t);
int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t);



typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode,
       loff_t file_offset);

enum {

 DIO_LOCKING = 0x01,


 DIO_SKIP_HOLES = 0x02,


 DIO_ASYNC_EXTEND = 0x04,
};

void dio_end_io(struct bio *bio, int error);

ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
 struct block_device *bdev, struct iov_iter *iter, loff_t offset,
 get_block_t get_block, dio_iodone_t end_io,
 dio_submit_t submit_io, int flags);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
  struct inode *inode, struct iov_iter *iter, loff_t offset,
  get_block_t get_block)
{
 return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iter,
        offset, get_block, ((void *)0), ((void *)0),
        DIO_LOCKING | DIO_SKIP_HOLES);
}


void inode_dio_wait(struct inode *inode);
void inode_dio_done(struct inode *inode);

extern void inode_set_flags(struct inode *inode, unsigned int flags,
       unsigned int mask);

extern const struct file_operations generic_ro_fops;



extern int readlink_copy(char *, int, const char *);
extern int page_readlink(struct dentry *, char *, int);
extern void *page_follow_link_light(struct dentry *, struct nameidata *);
extern void page_put_link(struct dentry *, struct nameidata *, void *);
extern int __page_symlink(struct inode *inode, const char *symname, int len,
  int nofs);
extern int page_symlink(struct inode *inode, const char *symname, int len);
extern const struct inode_operations page_symlink_inode_operations;
extern void kfree_put_link(struct dentry *, struct nameidata *, void *);
extern int generic_readlink(struct dentry *, char *, int);
extern void generic_fillattr(struct inode *, struct kstat *);
int vfs_getattr_nosec(struct path *path, struct kstat *stat);
extern int vfs_getattr(struct path *, struct kstat *);
void __inode_add_bytes(struct inode *inode, loff_t bytes);
void inode_add_bytes(struct inode *inode, loff_t bytes);
void __inode_sub_bytes(struct inode *inode, loff_t bytes);
void inode_sub_bytes(struct inode *inode, loff_t bytes);
loff_t inode_get_bytes(struct inode *inode);
void inode_set_bytes(struct inode *inode, loff_t bytes);

extern int vfs_readdir(struct file *, filldir_t, void *);
extern int iterate_dir(struct file *, struct dir_context *);

extern int vfs_stat(const char *, struct kstat *);
extern int vfs_lstat(const char *, struct kstat *);
extern int vfs_fstat(unsigned int, struct kstat *);
extern int vfs_fstatat(int , const char *, struct kstat *, int);

extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
      unsigned long arg);
extern int __generic_block_fiemap(struct inode *inode,
      struct fiemap_extent_info *fieinfo,
      loff_t start, loff_t len,
      get_block_t *get_block);
extern int generic_block_fiemap(struct inode *inode,
    struct fiemap_extent_info *fieinfo, u64 start,
    u64 len, get_block_t *get_block);

extern void get_filesystem(struct file_system_type *fs);
extern void put_filesystem(struct file_system_type *fs);
extern struct file_system_type *get_fs_type(const char *name);
extern struct super_block *get_super(struct block_device *);
extern struct super_block *get_super_thawed(struct block_device *);
extern struct super_block *get_active_super(struct block_device *bdev);
extern void drop_super(struct super_block *sb);
extern void iterate_supers(void (*)(struct super_block *, void *), void *);
extern void iterate_supers_type(struct file_system_type *,
           void (*)(struct super_block *, void *), void *);

extern int dcache_dir_open(struct inode *, struct file *);
extern int dcache_dir_close(struct inode *, struct file *);
extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
extern int dcache_readdir(struct file *, struct dir_context *);
extern int simple_setattr(struct dentry *, struct iattr *);
extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
extern int simple_statfs(struct dentry *, struct kstatfs *);
extern int simple_open(struct inode *inode, struct file *file);
extern int simple_link(struct dentry *, struct inode *, struct dentry *);
extern int simple_unlink(struct inode *, struct dentry *);
extern int simple_rmdir(struct inode *, struct dentry *);
extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
extern int noop_fsync(struct file *, loff_t, loff_t, int);
extern int simple_empty(struct dentry *);
extern int simple_readpage(struct file *file, struct page *page);
extern int simple_write_begin(struct file *file, struct address_space *mapping,
   loff_t pos, unsigned len, unsigned flags,
   struct page **pagep, void **fsdata);
extern int simple_write_end(struct file *file, struct address_space *mapping,
   loff_t pos, unsigned len, unsigned copied,
   struct page *page, void *fsdata);
extern int always_delete_dentry(const struct dentry *);
extern struct inode *alloc_anon_inode(struct super_block *);
extern int simple_nosetlease(struct file *, long, struct file_lock **, void **);
extern const struct dentry_operations simple_dentry_operations;

extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags);
extern ssize_t generic_read_dir(struct file *, char *, size_t, loff_t *);
extern const struct file_operations simple_dir_operations;
extern const struct inode_operations simple_dir_inode_operations;
struct tree_descr { char *name; const struct file_operations *ops; int mode; };
struct dentry *d_alloc_name(struct dentry *, const char *);
extern int simple_fill_super(struct super_block *, unsigned long, struct tree_descr *);
extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
extern void simple_release_fs(struct vfsmount **mount, int *count);

extern ssize_t simple_read_from_buffer(void *to, size_t count,
   loff_t *ppos, const void *from, size_t available);
extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
  const void *from, size_t count);

extern int __generic_file_fsync(struct file *, loff_t, loff_t, int);
extern int generic_file_fsync(struct file *, loff_t, loff_t, int);

extern int generic_check_addressable(unsigned, u64);


extern int buffer_migrate_page(struct address_space *,
    struct page *, struct page *,
    enum migrate_mode);




extern int inode_change_ok(const struct inode *, struct iattr *);
extern int inode_newsize_ok(const struct inode *, loff_t offset);
extern void setattr_copy(struct inode *inode, const struct iattr *attr);

extern int file_update_time(struct file *file);

extern int generic_show_options(struct seq_file *m, struct dentry *root);
extern void save_mount_options(struct super_block *sb, char *options);
extern void replace_mount_options(struct super_block *sb, char *options);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool io_is_direct(struct file *filp)
{
 return (filp->f_flags & 0x100000) || ((file_inode(filp))->i_flags & 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ino_t parent_ino(struct dentry *dentry)
{
 ino_t res;





 spin_lock(&dentry->d_lockref.lock);
 res = dentry->d_parent->d_inode->i_ino;
 spin_unlock(&dentry->d_lockref.lock);
 return res;
}







struct simple_transaction_argresp {
 ssize_t size;
 char data[0];
};



char *simple_transaction_get(struct file *file, const char *buf,
    size_t size);
ssize_t simple_transaction_read(struct file *file, char *buf,
    size_t size, loff_t *pos);
int simple_transaction_release(struct inode *inode, struct file *file);

void simple_transaction_set(struct file *file, size_t n);
# 2828 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((format(printf, 1, 2)))
void __simple_attr_check_format(const char *fmt, ...)
{

}

int simple_attr_open(struct inode *inode, struct file *file,
       int (*get)(void *, u64 *), int (*set)(void *, u64),
       const char *fmt);
int simple_attr_release(struct inode *inode, struct file *file);
ssize_t simple_attr_read(struct file *file, char *buf,
    size_t len, loff_t *ppos);
ssize_t simple_attr_write(struct file *file, const char *buf,
     size_t len, loff_t *ppos);

struct ctl_table;
int proc_nr_files(struct ctl_table *table, int write,
    void *buffer, size_t *lenp, loff_t *ppos);
int proc_nr_dentry(struct ctl_table *table, int write,
    void *buffer, size_t *lenp, loff_t *ppos);
int proc_nr_inodes(struct ctl_table *table, int write,
     void *buffer, size_t *lenp, loff_t *ppos);
int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) get_filesystem_list(char *buf);
# 2859 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_sxid(umode_t mode)
{
 return (mode & 0004000) || ((mode & 0002000) && (mode & 00010));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int check_sticky(struct inode *dir, struct inode *inode)
{
 if (!(dir->i_mode & 0001000))
  return 0;

 return __check_sticky(dir, inode);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_has_no_xattr(struct inode *inode)
{
 if (!is_sxid(inode->i_mode) && (inode->i_sb->s_flags & (1<<28)))
  inode->i_flags |= 4096;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_root_inode(struct inode *inode)
{
 return inode == inode->i_sb->s_root->d_inode;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_emit(struct dir_context *ctx,
       const char *name, int namelen,
       u64 ino, unsigned type)
{
 return ctx->actor(ctx, name, namelen, ctx->pos, ino, type) == 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_emit_dot(struct file *file, struct dir_context *ctx)
{
 return ctx->actor(ctx, ".", 1, ctx->pos,
     file->f_path.dentry->d_inode->i_ino, 4) == 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_emit_dotdot(struct file *file, struct dir_context *ctx)
{
 return ctx->actor(ctx, "..", 2, ctx->pos,
     parent_ino(file->f_path.dentry), 4) == 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_emit_dots(struct file *file, struct dir_context *ctx)
{
 if (ctx->pos == 0) {
  if (!dir_emit_dot(file, ctx))
   return false;
  ctx->pos = 1;
 }
 if (ctx->pos == 1) {
  if (!dir_emit_dotdot(file, ctx))
   return false;
  ctx->pos = 2;
 }
 return true;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_relax(struct inode *inode)
{
 mutex_unlock(&inode->i_mutex);
 mutex_lock(&inode->i_mutex);
 return !((inode)->i_flags & 16);
}
# 45 "include/linux/perf_event.h" 2
# 1 "include/linux/pid_namespace.h" 1





# 1 "include/linux/mm.h" 1
# 15 "include/linux/mm.h"
# 1 "include/linux/debug_locks.h" 1







struct task_struct;

extern int debug_locks;
extern int debug_locks_silent;


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __debug_locks_off(void)
{
 return ((__typeof__(*(&debug_locks)))__xchg((unsigned long)(0),(&debug_locks),sizeof(*(&debug_locks))));
}




extern int debug_locks_off(void);
# 48 "include/linux/debug_locks.h"
struct task_struct;







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_show_all_locks(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_show_held_locks(struct task_struct *task)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_check_no_locks_freed(const void *from, unsigned long len)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_check_no_locks_held(void)
{
}
# 16 "include/linux/mm.h" 2

# 1 "include/linux/range.h" 1



struct range {
 u64 start;
 u64 end;
};

int add_range(struct range *range, int az, int nr_range,
  u64 start, u64 end);


int add_range_with_merge(struct range *range, int az, int nr_range,
    u64 start, u64 end);

void subtract_range(struct range *range, int az, u64 start, u64 end);

int clean_sort_range(struct range *range, int az);

void sort_range(struct range *range, int nr_range);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) resource_size_t cap_resource(u64 val)
{
 if (val > ((resource_size_t)~0))
  return ((resource_size_t)~0);

 return val;
}
# 18 "include/linux/mm.h" 2




# 1 "include/linux/page_ext.h" 1




# 1 "include/linux/stacktrace.h" 1





struct task_struct;
struct pt_regs;


struct task_struct;

struct stack_trace {
 unsigned int nr_entries, max_entries;
 unsigned long *entries;
 int skip;
};

extern void save_stack_trace(struct stack_trace *trace);
extern void save_stack_trace_regs(struct pt_regs *regs,
      struct stack_trace *trace);
extern void save_stack_trace_tsk(struct task_struct *tsk,
    struct stack_trace *trace);

extern void print_stack_trace(struct stack_trace *trace, int spaces);
extern int snprint_stack_trace(char *buf, size_t size,
   struct stack_trace *trace, int spaces);
# 6 "include/linux/page_ext.h" 2

struct pglist_data;
struct page_ext_operations {
 bool (*need)(void);
 void (*init)(void);
};
# 65 "include/linux/page_ext.h"
struct page_ext;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgdat_page_ext_init(struct pglist_data *pgdat)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page_ext *lookup_page_ext(struct page *page)
{
 return ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_ext_init(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_ext_init_flatmem(void)
{
}
# 23 "include/linux/mm.h" 2

struct mempolicy;
struct anon_vma;
struct anon_vma_chain;
struct file_ra_state;
struct user_struct;
struct writeback_control;
# 39 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_max_mapnr(unsigned long limit) { }


extern unsigned long totalram_pages;
extern void * high_memory;
extern int page_cluster;


extern int sysctl_legacy_va_layout;





# 1 "./arch/sparc/include/asm/pgtable.h" 1



# 1 "./arch/sparc/include/asm/pgtable_64.h" 1
# 17 "./arch/sparc/include/asm/pgtable_64.h"
# 1 "arch/sparc/include/generated/asm/types.h" 1
# 18 "./arch/sparc/include/asm/pgtable_64.h" 2
# 81 "./arch/sparc/include/asm/pgtable_64.h"
extern unsigned long VMALLOC_END;





bool kern_addr_valid(unsigned long addr);
# 212 "./arch/sparc/include/asm/pgtable_64.h"
pte_t mk_pte_io(unsigned long, pgprot_t, int, unsigned long);

unsigned long pte_sz_bits(unsigned long size);

extern pgprot_t PAGE_KERNEL;
extern pgprot_t PAGE_KERNEL_LOCKED;
extern pgprot_t PAGE_COPY;
extern pgprot_t PAGE_SHARED;


extern unsigned long _PAGE_IE;
extern unsigned long _PAGE_E;
extern unsigned long _PAGE_CACHE;

extern unsigned long pg_iobits;
extern unsigned long _PAGE_ALL_SZ_BITS;

extern struct page *mem_map_zero;







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pfn_pte(unsigned long pfn, pgprot_t prot)
{
 unsigned long paddr = pfn << 13;

 do { bool __cond = !(!((0x0000000000000000UL) != 0UL || (0x0000000000000000UL) != 0UL)); extern void __compiletime_assert_241(void) __attribute__((error("BUILD_BUG_ON failed: " "_PAGE_SZBITS_4U != 0UL || _PAGE_SZBITS_4V != 0UL"))); if (__cond) __compiletime_assert_241(); do { } while (0); } while (0);
 return ((pte_t) { (paddr | ((prot).pgprot)) } );
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)
{
 pte_t pte = pfn_pte(page_nr, pgprot);

 return ((pmd_t) { (((pte).pte)) } );
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_pfn(pte_t pte)
{
 unsigned long ret;

 __asm__ __volatile__(
 "\n661:	sllx		%1, %2, %0\n"
 "	srlx		%0, %3, %0\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sllx		%1, %4, %0\n"
 "	srlx		%0, %5, %0\n"
 "	.previous\n"
 : "=r" (ret)
 : "r" (((pte).pte)),
   "i" (21), "i" (21 + 13),
   "i" (8), "i" (8 + 13));

 return ret;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_modify(pte_t pte, pgprot_t prot)
{
 unsigned long mask, tmp;
# 292 "./arch/sparc/include/asm/pgtable_64.h"
 do { bool __cond = !(!((0x0000000000000000UL) != 0UL || (0x0000000000000000UL) != 0UL)); extern void __compiletime_assert_292(void) __attribute__((error("BUILD_BUG_ON failed: " "_PAGE_SZBITS_4U != 0UL || _PAGE_SZBITS_4V != 0UL"))); if (__cond) __compiletime_assert_292(); do { } while (0); } while (0);
 __asm__ __volatile__(
 "\n661:	sethi		%%uhi(%2), %1\n"
 "	sethi		%%hi(%2), %0\n"
 "\n662:	or		%1, %%ulo(%2), %1\n"
 "	or		%0, %%lo(%2), %0\n"
 "\n663:	sllx		%1, 32, %1\n"
 "	or		%0, %1, %0\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%3), %1\n"
 "	sethi		%%hi(%3), %0\n"
 "	.word		662b\n"
 "	or		%1, %%ulo(%3), %1\n"
 "	or		%0, %%lo(%3), %0\n"
 "	.word		663b\n"
 "	sllx		%1, 32, %1\n"
 "	or		%0, %1, %0\n"
 "	.previous\n"
 : "=r" (mask), "=r" (tmp)
 : "i" ((0x000007FFFFFFE000UL) | (0x0000000000000800UL) | (0x0000000000000400UL) |
        (0x0000000000000020UL) | (0x0000000000000010UL) | (0x0000000000000008UL) |
        (0x0200000000000000UL) | (0x0100000000000000UL) | (0x6001000000000000UL)),
   "i" ((0x00FFFFFFFFFFE000UL) | (0x2000000000000000UL) | (0x1000000000000000UL) |
        (0x0000000000000400UL) | (0x0000000000000200UL) | (0x0000000000000800UL) |
        (0x0200000000000000UL) | (0x0100000000000000UL) | (0x0000000000000007UL)));

 return ((pte_t) { ((((pte).pte) & mask) | (((prot).pgprot) & ~mask)) } );
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_modify(pte, newprot);

 return ((pmd_t) { (((pte).pte)) } );
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pgprot_t pgprot_noncached(pgprot_t prot)
{
 unsigned long val = ((prot).pgprot);

 __asm__ __volatile__(
 "\n661:	andn		%0, %2, %0\n"
 "	or		%0, %3, %0\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	andn		%0, %4, %0\n"
 "	or		%0, %5, %0\n"
 "	.previous\n"
 : "=r" (val)
 : "0" (val), "i" ((0x0000000000000020UL) | (0x0000000000000010UL)), "i" ((0x0000000000000008UL)),
              "i" ((0x0000000000000400UL) | (0x0000000000000200UL)), "i" ((0x0000000000000800UL)));

 return ((pgprot_t) { (val) } );
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkhuge(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	sethi		%%uhi(%1), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	mov		%2, %0\n"
 "	nop\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x6000000000000000UL)), "i" ((0x0000000000000003UL)));

 return ((pte_t) { (((pte).pte) | mask) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mkhuge(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_mkhuge(pte);
 ((pte).pte) |= (0x0100000000000000UL);

 return ((pmd_t) { (((pte).pte)) } );
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkdirty(pte_t pte)
{
 unsigned long val = ((pte).pte), tmp;

 __asm__ __volatile__(
 "\n661:	or		%0, %3, %0\n"
 "	nop\n"
 "\n662:	nop\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%4), %1\n"
 "	sllx		%1, 32, %1\n"
 "	.word		662b\n"
 "	or		%1, %%lo(%4), %1\n"
 "	or		%0, %1, %0\n"
 "	.previous\n"
 : "=r" (val), "=r" (tmp)
 : "0" (val), "i" ((0x0000000000000800UL) | (0x0000000000000002UL)),
   "i" ((0x2000000000000000UL) | (0x0000000000000040UL)));

 return ((pte_t) { (val) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkclean(pte_t pte)
{
 unsigned long val = ((pte).pte), tmp;

 __asm__ __volatile__(
 "\n661:	andn		%0, %3, %0\n"
 "	nop\n"
 "\n662:	nop\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%4), %1\n"
 "	sllx		%1, 32, %1\n"
 "	.word		662b\n"
 "	or		%1, %%lo(%4), %1\n"
 "	andn		%0, %1, %0\n"
 "	.previous\n"
 : "=r" (val), "=r" (tmp)
 : "0" (val), "i" ((0x0000000000000800UL) | (0x0000000000000002UL)),
   "i" ((0x2000000000000000UL) | (0x0000000000000040UL)));

 return ((pte_t) { (val) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkwrite(pte_t pte)
{
 unsigned long val = ((pte).pte), mask;

 __asm__ __volatile__(
 "\n661:	mov		%1, %0\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%2), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000000100UL)), "i" ((0x0400000000000000UL)));

 return ((pte_t) { (val | mask) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_wrprotect(pte_t pte)
{
 unsigned long val = ((pte).pte), tmp;

 __asm__ __volatile__(
 "\n661:	andn		%0, %3, %0\n"
 "	nop\n"
 "\n662:	nop\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%4), %1\n"
 "	sllx		%1, 32, %1\n"
 "	.word		662b\n"
 "	or		%1, %%lo(%4), %1\n"
 "	andn		%0, %1, %0\n"
 "	.previous\n"
 : "=r" (val), "=r" (tmp)
 : "0" (val), "i" ((0x0000000000000100UL) | (0x0000000000000002UL)),
   "i" ((0x0400000000000000UL) | (0x0000000000000040UL)));

 return ((pte_t) { (val) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkold(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	mov		%1, %0\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%2), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000000400UL)), "i" ((0x1000000000000000UL)));

 mask |= (0x8000000000000000UL);

 return ((pte_t) { (((pte).pte) & ~mask) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkyoung(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	mov		%1, %0\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%2), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000000400UL)), "i" ((0x1000000000000000UL)));

 mask |= (0x8000000000000000UL);

 return ((pte_t) { (((pte).pte) | mask) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkspecial(pte_t pte)
{
 ((pte).pte) |= (0x0200000000000000UL);
 return pte;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_young(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	mov		%1, %0\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%2), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000000400UL)), "i" ((0x1000000000000000UL)));

 return (((pte).pte) & mask);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_dirty(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	mov		%1, %0\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%2), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000000800UL)), "i" ((0x2000000000000000UL)));

 return (((pte).pte) & mask);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_write(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	mov		%1, %0\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%2), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000000100UL)), "i" ((0x0400000000000000UL)));

 return (((pte).pte) & mask);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_exec(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	sethi		%%hi(%1), %0\n"
 "	.section	.sun4v_1insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	mov		%2, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000001000UL)), "i" ((0x0000000000000080UL)));

 return (((pte).pte) & mask);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_present(pte_t pte)
{
 unsigned long val = ((pte).pte);

 __asm__ __volatile__(
 "\n661:	and		%0, %2, %0\n"
 "	.section	.sun4v_1insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	and		%0, %3, %0\n"
 "	.previous\n"
 : "=r" (val)
 : "0" (val), "i" ((0x0000000000000080UL)), "i" ((0x0000000000000010UL)));

 return val;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_accessible(struct mm_struct *mm, pte_t a)
{
 return ((a).pte) & (0x8000000000000000UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_special(pte_t pte)
{
 return ((pte).pte) & (0x0200000000000000UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_large(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return ((pte).pte) & (0x0100000000000000UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_pfn(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return pte_pfn(pte);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_dirty(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return pte_dirty(pte);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_young(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return pte_young(pte);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_write(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return pte_write(pte);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_trans_huge(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return ((pte).pte) & (0x0100000000000000UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_trans_splitting(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return pmd_trans_huge(pmd) && pte_special(pte);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mkold(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_mkold(pte);

 return ((pmd_t) { (((pte).pte)) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_wrprotect(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_wrprotect(pte);

 return ((pmd_t) { (((pte).pte)) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mkdirty(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_mkdirty(pte);

 return ((pmd_t) { (((pte).pte)) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mkyoung(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_mkyoung(pte);

 return ((pmd_t) { (((pte).pte)) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mkwrite(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_mkwrite(pte);

 return ((pmd_t) { (((pte).pte)) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mksplitting(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_mkspecial(pte);

 return ((pmd_t) { (((pte).pte)) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pgprot_t pmd_pgprot(pmd_t entry)
{
 unsigned long val = ((entry).pmd);

 return ((pgprot_t) { (val) } );
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_present(pmd_t pmd)
{
 return ((pmd).pmd) != 0UL;
}
# 759 "./arch/sparc/include/asm/pgtable_64.h"
void set_pmd_at(struct mm_struct *mm, unsigned long addr,
  pmd_t *pmdp, pmd_t pmd);
# 769 "./arch/sparc/include/asm/pgtable_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pmd_set(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
{
 unsigned long val = ((unsigned long)((unsigned long) (ptep)) - PAGE_OFFSET);

 ((*pmdp).pmd) = val;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __pmd_page(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );
 unsigned long pfn;

 pfn = pte_pfn(pte);

 return ((unsigned long) ((void *)((unsigned long) (pfn << 13) + PAGE_OFFSET)));
}
# 799 "./arch/sparc/include/asm/pgtable_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pud_large(pud_t pud)
{
 pte_t pte = ((pte_t) { (((pud).pud)) } );

 return ((pte).pte) & (0x0100000000000000UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pud_pfn(pud_t pud)
{
 pte_t pte = ((pte_t) { (((pud).pud)) } );

 return pte_pfn(pte);
}
# 845 "./arch/sparc/include/asm/pgtable_64.h"
void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr,
     pte_t *ptep, pte_t orig, int fullmm);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmdp_get_and_clear(struct mm_struct *mm,
           unsigned long addr,
           pmd_t *pmdp)
{
 pmd_t pmd = *pmdp;
 set_pmd_at(mm, addr, pmdp, ((pmd_t) { (0UL) } ));
 return pmd;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __set_pte_at(struct mm_struct *mm, unsigned long addr,
        pte_t *ptep, pte_t pte, int fullmm)
{
 pte_t orig = *ptep;

 *ptep = pte;







 if (__builtin_expect(!!(mm != &init_mm), 1) && pte_accessible(mm, orig))
  tlb_batch_add(mm, addr, ptep, orig, fullmm);
}
# 902 "./arch/sparc/include/asm/pgtable_64.h"
extern pgd_t swapper_pg_dir[(1UL << (13 - 3))];

void paging_init(void);
unsigned long find_ecache_flush_span(unsigned long size);

struct seq_file;
void mmu_info(struct seq_file *);

struct vm_area_struct;
void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);

void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
     pmd_t *pmd);


extern void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
       pmd_t *pmdp);


void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp,
    pgtable_t pgtable);


pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp);
# 940 "./arch/sparc/include/asm/pgtable_64.h"
int page_in_phys_avail(unsigned long paddr);
# 950 "./arch/sparc/include/asm/pgtable_64.h"
int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long,
      unsigned long, pgprot_t);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int io_remap_pfn_range(struct vm_area_struct *vma,
         unsigned long from, unsigned long pfn,
         unsigned long size, pgprot_t prot)
{
 unsigned long offset = (pfn & 0x0fffffffffffffffUL) << 13;
 int space = (pfn >> (64 - 4));
 unsigned long phys_base;

 phys_base = offset | (((unsigned long) space) << 32UL);

 return remap_pfn_range(vma, from, phys_base >> 13, size, prot);
}


# 1 "./arch/sparc/include/asm/tlbflush.h" 1



# 1 "./arch/sparc/include/asm/tlbflush_64.h" 1



# 1 "./arch/sparc/include/asm/mmu_context.h" 1



# 1 "./arch/sparc/include/asm/mmu_context_64.h" 1
# 10 "./arch/sparc/include/asm/mmu_context_64.h"
# 1 "include/asm-generic/mm_hooks.h" 1
# 9 "include/asm-generic/mm_hooks.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_dup_mmap(struct mm_struct *oldmm,
     struct mm_struct *mm)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_exit_mmap(struct mm_struct *mm)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_unmap(struct mm_struct *mm,
   struct vm_area_struct *vma,
   unsigned long start, unsigned long end)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_bprm_mm_init(struct mm_struct *mm,
         struct vm_area_struct *vma)
{
}
# 11 "./arch/sparc/include/asm/mmu_context_64.h" 2

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}

extern spinlock_t ctx_alloc_lock;
extern unsigned long tlb_context_cache;
extern unsigned long mmu_context_bmap[];

void get_new_mmu_context(struct mm_struct *mm);

void smp_new_mmu_context_version(void);




int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
void destroy_context(struct mm_struct *mm);

void __tsb_context_switch(unsigned long pgd_pa,
     struct tsb_config *tsb_base,
     struct tsb_config *tsb_huge,
     unsigned long tsb_descr_pa);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tsb_context_switch(struct mm_struct *mm)
{
 __tsb_context_switch(((unsigned long)(mm->pgd) - PAGE_OFFSET),
        &mm->context.tsb_block[0],

        (mm->context.tsb_block[1].tsb ?
         &mm->context.tsb_block[1] :
         ((void *)0))



        , ((unsigned long)(&mm->context.tsb_descr[0]) - PAGE_OFFSET));
}

void tsb_grow(struct mm_struct *mm,
       unsigned long tsb_index,
       unsigned long mm_rss);

void smp_tsb_sync(struct mm_struct *mm);
# 71 "./arch/sparc/include/asm/mmu_context_64.h"
void __flush_tlb_mm(unsigned long, unsigned long);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, struct task_struct *tsk)
{
 unsigned long ctx_valid, flags;
 int cpu;

 if (__builtin_expect(!!(mm == &init_mm), 0))
  return;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(&mm->context.lock)); } while (0); } while (0);
 ctx_valid = (!(((mm->context.sparc64_ctx_val) ^ tlb_context_cache) & ((~0UL) << 22)));
 if (!ctx_valid)
  get_new_mmu_context(mm);
# 117 "./arch/sparc/include/asm/mmu_context_64.h"
 __asm__ __volatile__( "\n661:	stxa		%0, [%1] %2\n" "	.section	.sun4v_1insn_patch, \"ax\"\n" "	.word		661b\n" "	stxa		%0, [%1] %3\n" "	.previous\n" "	flush		%%g6\n" : : "r" ((((mm)->context.sparc64_ctx_val) & ((((1UL) << 13) - (1UL)) | (((0x7UL) << 16) | ((0x7UL) << 19))))), "r" (0x0000000000000010), "i" (0x58), "i" (0x21));
 tsb_context_switch(mm);





 cpu = ((current_thread_info_reg)->cpu);
 if (!ctx_valid || !test_bit(cpumask_check(cpu), (((mm_cpumask(mm)))->bits))) {
  cpumask_set_cpu(cpu, mm_cpumask(mm));
  __flush_tlb_mm(((mm->context.sparc64_ctx_val) & ((((1UL) << 13) - (1UL)) | (((0x7UL) << 16) | ((0x7UL) << 19)))),
          0x0000000000000010);
 }
 spin_unlock_irqrestore(&mm->context.lock, flags);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void activate_mm(struct mm_struct *active_mm, struct mm_struct *mm)
{
 unsigned long flags;
 int cpu;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(&mm->context.lock)); } while (0); } while (0);
 if (!(!(((mm->context.sparc64_ctx_val) ^ tlb_context_cache) & ((~0UL) << 22))))
  get_new_mmu_context(mm);
 cpu = ((current_thread_info_reg)->cpu);
 if (!test_bit(cpumask_check(cpu), (((mm_cpumask(mm)))->bits)))
  cpumask_set_cpu(cpu, mm_cpumask(mm));

 __asm__ __volatile__( "\n661:	stxa		%0, [%1] %2\n" "	.section	.sun4v_1insn_patch, \"ax\"\n" "	.word		661b\n" "	stxa		%0, [%1] %3\n" "	.previous\n" "	flush		%%g6\n" : : "r" ((((mm)->context.sparc64_ctx_val) & ((((1UL) << 13) - (1UL)) | (((0x7UL) << 16) | ((0x7UL) << 19))))), "r" (0x0000000000000010), "i" (0x58), "i" (0x21));
 __flush_tlb_mm(((mm->context.sparc64_ctx_val) & ((((1UL) << 13) - (1UL)) | (((0x7UL) << 16) | ((0x7UL) << 19)))), 0x0000000000000010);
 tsb_context_switch(mm);
 spin_unlock_irqrestore(&mm->context.lock, flags);
}
# 5 "./arch/sparc/include/asm/mmu_context.h" 2
# 5 "./arch/sparc/include/asm/tlbflush_64.h" 2





struct tlb_batch {
 struct mm_struct *mm;
 unsigned long tlb_nr;
 unsigned long active;
 unsigned long vaddrs[192];
};

void flush_tsb_kernel_range(unsigned long start, unsigned long end);
void flush_tsb_user(struct tlb_batch *tb);
void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr);



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flush_tlb_mm(struct mm_struct *mm)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flush_tlb_page(struct vm_area_struct *vma,
      unsigned long vmaddr)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flush_tlb_range(struct vm_area_struct *vma,
       unsigned long start, unsigned long end)
{
}

void flush_tlb_kernel_range(unsigned long start, unsigned long end);



void flush_tlb_pending(void);
void arch_enter_lazy_mmu_mode(void);
void arch_leave_lazy_mmu_mode(void);



void __flush_tlb_all(void);
void __flush_tlb_page(unsigned long context, unsigned long vaddr);
void __flush_tlb_kernel_range(unsigned long start, unsigned long end);
# 60 "./arch/sparc/include/asm/tlbflush_64.h"
void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end);
void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr);
# 5 "./arch/sparc/include/asm/tlbflush.h" 2
# 968 "./arch/sparc/include/asm/pgtable_64.h" 2
# 1 "include/asm-generic/pgtable.h" 1
# 21 "include/asm-generic/pgtable.h"
extern int ptep_set_access_flags(struct vm_area_struct *vma,
     unsigned long address, pte_t *ptep,
     pte_t entry, int dirty);



extern int pmdp_set_access_flags(struct vm_area_struct *vma,
     unsigned long address, pmd_t *pmdp,
     pmd_t entry, int dirty);



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ptep_test_and_clear_young(struct vm_area_struct *vma,
         unsigned long address,
         pte_t *ptep)
{
 pte_t pte = *ptep;
 int r = 1;
 if (!pte_young(pte))
  r = 0;
 else
  __set_pte_at((vma->vm_mm), (address), (ptep), (pte_mkold(pte)), 0);
 return r;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmdp_test_and_clear_young(struct vm_area_struct *vma,
         unsigned long address,
         pmd_t *pmdp)
{
 pmd_t pmd = *pmdp;
 int r = 1;
 if (!pmd_young(pmd))
  r = 0;
 else
  set_pmd_at(vma->vm_mm, address, pmdp, pmd_mkold(pmd));
 return r;
}
# 73 "include/asm-generic/pgtable.h"
int ptep_clear_flush_young(struct vm_area_struct *vma,
      unsigned long address, pte_t *ptep);



int pmdp_clear_flush_young(struct vm_area_struct *vma,
      unsigned long address, pmd_t *pmdp);



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t ptep_get_and_clear(struct mm_struct *mm,
           unsigned long address,
           pte_t *ptep)
{
 pte_t pte = *ptep;
 __set_pte_at(((mm)), ((address)), ((ptep)), (((pte_t) { (0UL) } )), 0);
 return pte;
}
# 108 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmdp_get_and_clear_full(struct mm_struct *mm,
         unsigned long address, pmd_t *pmdp,
         int full)
{
 return pmdp_get_and_clear(mm, address, pmdp);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t ptep_get_and_clear_full(struct mm_struct *mm,
         unsigned long address, pte_t *ptep,
         int full)
{
 pte_t pte;
 pte = ptep_get_and_clear(mm, address, ptep);
 return pte;
}
# 144 "include/asm-generic/pgtable.h"
extern pte_t ptep_clear_flush(struct vm_area_struct *vma,
         unsigned long address,
         pte_t *ptep);



extern pmd_t pmdp_clear_flush(struct vm_area_struct *vma,
         unsigned long address,
         pmd_t *pmdp);



struct mm_struct;
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep)
{
 pte_t old_pte = *ptep;
 __set_pte_at((mm), (address), (ptep), (pte_wrprotect(old_pte)), 0);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pmdp_set_wrprotect(struct mm_struct *mm,
          unsigned long address, pmd_t *pmdp)
{
 pmd_t old_pmd = *pmdp;
 set_pmd_at(mm, address, pmdp, pmd_wrprotect(old_pmd));
}
# 182 "include/asm-generic/pgtable.h"
extern void pmdp_splitting_flush(struct vm_area_struct *vma,
     unsigned long address, pmd_t *pmdp);
# 201 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_same(pte_t pte_a, pte_t pte_b)
{
 return ((pte_a).pte) == ((pte_b).pte);
}
# 214 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_unused(pte_t pte)
{
 return 0;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
{
 return ((pmd_a).pmd) == ((pmd_b).pmd);
}
# 265 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
{
 if (((oldprot).pgprot) == ((pgprot_noncached(oldprot)).pgprot))
  newprot = pgprot_noncached(newprot);
 if (((oldprot).pgprot) == ((pgprot_noncached(oldprot)).pgprot))
  newprot = pgprot_noncached(newprot);
 if (((oldprot).pgprot) == ((pgprot_noncached(oldprot)).pgprot))
  newprot = pgprot_noncached(newprot);
 return newprot;
}
# 307 "include/asm-generic/pgtable.h"
void pgd_clear_bad(pgd_t *);
void pud_clear_bad(pud_t *);
void pmd_clear_bad(pmd_t *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pgd_none_or_clear_bad(pgd_t *pgd)
{
 if ((!((*pgd).pgd)))
  return 1;
 if (__builtin_expect(!!((((*pgd).pgd) & ~(~(((1UL) << 13)-1)))), 0)) {
  pgd_clear_bad(pgd);
  return 1;
 }
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pud_none_or_clear_bad(pud_t *pud)
{
 if ((!((*pud).pud)))
  return 1;
 if (__builtin_expect(!!((((*pud).pud) & ~(~(((1UL) << 13)-1)))), 0)) {
  pud_clear_bad(pud);
  return 1;
 }
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_none_or_clear_bad(pmd_t *pmd)
{
 if ((!((*pmd).pmd)))
  return 1;
 if (__builtin_expect(!!((((*pmd).pmd) & ~(~(((1UL) << 13)-1)))), 0)) {
  pmd_clear_bad(pmd);
  return 1;
 }
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t __ptep_modify_prot_start(struct mm_struct *mm,
          unsigned long addr,
          pte_t *ptep)
{





 return ptep_get_and_clear(mm, addr, ptep);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ptep_modify_prot_commit(struct mm_struct *mm,
          unsigned long addr,
          pte_t *ptep, pte_t pte)
{




 __set_pte_at((mm), (addr), (ptep), (pte), 0);
}
# 382 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t ptep_modify_prot_start(struct mm_struct *mm,
        unsigned long addr,
        pte_t *ptep)
{
 return __ptep_modify_prot_start(mm, addr, ptep);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptep_modify_prot_commit(struct mm_struct *mm,
        unsigned long addr,
        pte_t *ptep, pte_t pte)
{
 __ptep_modify_prot_commit(mm, addr, ptep, pte);
}
# 439 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_soft_dirty(pte_t pte)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_soft_dirty(pmd_t pmd)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mksoft_dirty(pte_t pte)
{
 return pte;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mksoft_dirty(pmd_t pmd)
{
 return pmd;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_swp_mksoft_dirty(pte_t pte)
{
 return pte;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_swp_soft_dirty(pte_t pte)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_swp_clear_soft_dirty(pte_t pte)
{
 return pte;
}
# 486 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int track_pfn_remap(struct vm_area_struct *vma, pgprot_t *prot,
      unsigned long pfn, unsigned long addr,
      unsigned long size)
{
 return 0;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
       unsigned long pfn)
{
 return 0;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int track_pfn_copy(struct vm_area_struct *vma)
{
 return 0;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void untrack_pfn(struct vm_area_struct *vma,
          unsigned long pfn, unsigned long size)
{
}
# 543 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_zero_pfn(unsigned long pfn)
{
 extern unsigned long zero_pfn;
 return pfn == zero_pfn;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long my_zero_pfn(unsigned long addr)
{
 extern unsigned long zero_pfn;
 return zero_pfn;
}
# 577 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_read_atomic(pmd_t *pmdp)
{





 return *pmdp;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
      spinlock_t *old_pmd_ptl)
{




 return new_pmd_ptl != old_pmd_ptl;
}
# 621 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd)
{
 pmd_t pmdval = pmd_read_atomic(pmd);
# 639 "include/asm-generic/pgtable.h"
 __asm__ __volatile__("": : :"memory");

 if ((!((pmdval).pmd)) || pmd_trans_huge(pmdval))
  return 1;
 if (__builtin_expect(!!((((pmdval).pmd) & ~(~(((1UL) << 13)-1)))), 0)) {
  pmd_clear_bad(pmd);
  return 1;
 }
 return 0;
}
# 663 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_trans_unstable(pmd_t *pmd)
{

 return pmd_none_or_trans_huge_or_clear_bad(pmd);



}
# 681 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_protnone(pte_t pte)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_protnone(pmd_t pmd)
{
 return 0;
}
# 969 "./arch/sparc/include/asm/pgtable_64.h" 2
# 979 "./arch/sparc/include/asm/pgtable_64.h"
unsigned long get_fb_unmapped_area(struct file *filp, unsigned long,
       unsigned long, unsigned long,
       unsigned long);


void pgtable_cache_init(void);
void sun4v_register_fault_status(void);
void sun4v_ktsb_register(void);
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) cheetah_ecache_flush_init(void);
void sun4v_patch_tlb_handlers(void);

extern unsigned long cmdline_memory_size;

 void do_sparc64_fault(struct pt_regs *regs);
# 5 "./arch/sparc/include/asm/pgtable.h" 2
# 54 "include/linux/mm.h" 2
# 71 "include/linux/mm.h"
extern unsigned long sysctl_user_reserve_kbytes;
extern unsigned long sysctl_admin_reserve_kbytes;

extern int sysctl_overcommit_memory;
extern int sysctl_overcommit_ratio;
extern unsigned long sysctl_overcommit_kbytes;

extern int overcommit_ratio_handler(struct ctl_table *, int, void *,
        size_t *, loff_t *);
extern int overcommit_kbytes_handler(struct ctl_table *, int, void *,
        size_t *, loff_t *);
# 100 "include/linux/mm.h"
extern struct kmem_cache *vm_area_cachep;
# 205 "include/linux/mm.h"
extern pgprot_t protection_map[16];
# 222 "include/linux/mm.h"
struct vm_fault {
 unsigned int flags;
 unsigned long pgoff;
 void *virtual_address;

 struct page *cow_page;
 struct page *page;





 unsigned long max_pgoff;

 pte_t *pte;
};






struct vm_operations_struct {
 void (*open)(struct vm_area_struct * area);
 void (*close)(struct vm_area_struct * area);
 int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf);
 void (*map_pages)(struct vm_area_struct *vma, struct vm_fault *vmf);



 int (*page_mkwrite)(struct vm_area_struct *vma, struct vm_fault *vmf);




 int (*access)(struct vm_area_struct *vma, unsigned long addr,
        void *buf, int len, int write);




 const char *(*name)(struct vm_area_struct *vma);
# 273 "include/linux/mm.h"
 int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new);
# 285 "include/linux/mm.h"
 struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
     unsigned long addr);






 struct page *(*find_special_page)(struct vm_area_struct *vma,
       unsigned long addr);
};

struct mmu_gather;
struct inode;





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_freepage_migratetype(struct page *page, int migratetype)
{
 page->index = migratetype;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_freepage_migratetype(struct page *page)
{
 return page->index;
}





# 1 "include/linux/page-flags.h" 1
# 74 "include/linux/page-flags.h"
enum pageflags {
 PG_locked,
 PG_error,
 PG_referenced,
 PG_uptodate,
 PG_dirty,
 PG_lru,
 PG_active,
 PG_slab,
 PG_owner_priv_1,
 PG_arch_1,
 PG_reserved,
 PG_private,
 PG_private_2,
 PG_writeback,

 PG_head,
 PG_tail,



 PG_swapcache,
 PG_mappedtodisk,
 PG_reclaim,
 PG_swapbacked,
 PG_unevictable,

 PG_mlocked,
# 110 "include/linux/page-flags.h"
 PG_compound_lock,

 __NR_PAGEFLAGS,


 PG_checked = PG_owner_priv_1,





 PG_fscache = PG_private_2,



 PG_pinned = PG_owner_priv_1,

 PG_savepinned = PG_dirty,

 PG_foreign = PG_owner_priv_1,


 PG_slob_free = PG_private,
};
# 208 "include/linux/page-flags.h"
struct page;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageLocked(const struct page *page) { return test_bit(PG_locked, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageError(const struct page *page) { return test_bit(PG_error, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageError(struct page *page) { set_bit(PG_error, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageError(struct page *page) { clear_bit(PG_error, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageError(struct page *page) { return test_and_clear_bit(PG_error, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageReferenced(const struct page *page) { return test_bit(PG_referenced, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageReferenced(struct page *page) { set_bit(PG_referenced, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageReferenced(struct page *page) { clear_bit(PG_referenced, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageReferenced(struct page *page) { return test_and_clear_bit(PG_referenced, &page->flags); }
 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageReferenced(struct page *page) { __set_bit(PG_referenced, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageDirty(const struct page *page) { return test_bit(PG_dirty, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageDirty(struct page *page) { set_bit(PG_dirty, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageDirty(struct page *page) { clear_bit(PG_dirty, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPageDirty(struct page *page) { return test_and_set_bit(PG_dirty, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageDirty(struct page *page) { return test_and_clear_bit(PG_dirty, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageDirty(struct page *page) { __clear_bit(PG_dirty, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageLRU(const struct page *page) { return test_bit(PG_lru, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageLRU(struct page *page) { set_bit(PG_lru, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageLRU(struct page *page) { clear_bit(PG_lru, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageLRU(struct page *page) { __clear_bit(PG_lru, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageActive(const struct page *page) { return test_bit(PG_active, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageActive(struct page *page) { set_bit(PG_active, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageActive(struct page *page) { clear_bit(PG_active, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageActive(struct page *page) { __clear_bit(PG_active, &page->flags); }
 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageActive(struct page *page) { return test_and_clear_bit(PG_active, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSlab(const struct page *page) { return test_bit(PG_slab, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageSlab(struct page *page) { __set_bit(PG_slab, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageSlab(struct page *page) { __clear_bit(PG_slab, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageChecked(const struct page *page) { return test_bit(PG_checked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageChecked(struct page *page) { set_bit(PG_checked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageChecked(struct page *page) { clear_bit(PG_checked, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PagePinned(const struct page *page) { return test_bit(PG_pinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPagePinned(struct page *page) { set_bit(PG_pinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPagePinned(struct page *page) { clear_bit(PG_pinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPagePinned(struct page *page) { return test_and_set_bit(PG_pinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPagePinned(struct page *page) { return test_and_clear_bit(PG_pinned, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSavePinned(const struct page *page) { return test_bit(PG_savepinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageSavePinned(struct page *page) { set_bit(PG_savepinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageSavePinned(struct page *page) { clear_bit(PG_savepinned, &page->flags); };
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageForeign(const struct page *page) { return test_bit(PG_foreign, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageForeign(struct page *page) { set_bit(PG_foreign, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageForeign(struct page *page) { clear_bit(PG_foreign, &page->flags); };
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageReserved(const struct page *page) { return test_bit(PG_reserved, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageReserved(struct page *page) { set_bit(PG_reserved, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageReserved(struct page *page) { clear_bit(PG_reserved, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageReserved(struct page *page) { __clear_bit(PG_reserved, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSwapBacked(const struct page *page) { return test_bit(PG_swapbacked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageSwapBacked(struct page *page) { set_bit(PG_swapbacked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageSwapBacked(struct page *page) { clear_bit(PG_swapbacked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageSwapBacked(struct page *page) { __clear_bit(PG_swapbacked, &page->flags); }
 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageSwapBacked(struct page *page) { __set_bit(PG_swapbacked, &page->flags); }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSlobFree(const struct page *page) { return test_bit(PG_slob_free, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageSlobFree(struct page *page) { __set_bit(PG_slob_free, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageSlobFree(struct page *page) { __clear_bit(PG_slob_free, &page->flags); }






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PagePrivate(const struct page *page) { return test_bit(PG_private, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPagePrivate(struct page *page) { set_bit(PG_private, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPagePrivate(struct page *page) { clear_bit(PG_private, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPagePrivate(struct page *page) { __set_bit(PG_private, &page->flags); }
 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPagePrivate(struct page *page) { __clear_bit(PG_private, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PagePrivate2(const struct page *page) { return test_bit(PG_private_2, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPagePrivate2(struct page *page) { set_bit(PG_private_2, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPagePrivate2(struct page *page) { clear_bit(PG_private_2, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPagePrivate2(struct page *page) { return test_and_set_bit(PG_private_2, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPagePrivate2(struct page *page) { return test_and_clear_bit(PG_private_2, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageOwnerPriv1(const struct page *page) { return test_bit(PG_owner_priv_1, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageOwnerPriv1(struct page *page) { set_bit(PG_owner_priv_1, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageOwnerPriv1(struct page *page) { clear_bit(PG_owner_priv_1, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageOwnerPriv1(struct page *page) { return test_and_clear_bit(PG_owner_priv_1, &page->flags); }





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageWriteback(const struct page *page) { return test_bit(PG_writeback, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPageWriteback(struct page *page) { return test_and_set_bit(PG_writeback, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageWriteback(struct page *page) { return test_and_clear_bit(PG_writeback, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageMappedToDisk(const struct page *page) { return test_bit(PG_mappedtodisk, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageMappedToDisk(struct page *page) { set_bit(PG_mappedtodisk, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageMappedToDisk(struct page *page) { clear_bit(PG_mappedtodisk, &page->flags); }


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageReclaim(const struct page *page) { return test_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageReclaim(struct page *page) { set_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageReclaim(struct page *page) { clear_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageReclaim(struct page *page) { return test_and_clear_bit(PG_reclaim, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageReadahead(const struct page *page) { return test_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageReadahead(struct page *page) { set_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageReadahead(struct page *page) { clear_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageReadahead(struct page *page) { return test_and_clear_bit(PG_reclaim, &page->flags); }
# 257 "include/linux/page-flags.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageHighMem(const struct page *page) { return 0; } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageHighMem(struct page *page) { } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageHighMem(struct page *page) { }



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSwapCache(const struct page *page) { return test_bit(PG_swapcache, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageSwapCache(struct page *page) { set_bit(PG_swapcache, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageSwapCache(struct page *page) { clear_bit(PG_swapcache, &page->flags); }




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageUnevictable(const struct page *page) { return test_bit(PG_unevictable, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageUnevictable(struct page *page) { set_bit(PG_unevictable, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageUnevictable(struct page *page) { clear_bit(PG_unevictable, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageUnevictable(struct page *page) { __clear_bit(PG_unevictable, &page->flags); }
 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageUnevictable(struct page *page) { return test_and_clear_bit(PG_unevictable, &page->flags); }


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageMlocked(const struct page *page) { return test_bit(PG_mlocked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageMlocked(struct page *page) { set_bit(PG_mlocked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageMlocked(struct page *page) { clear_bit(PG_mlocked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageMlocked(struct page *page) { __clear_bit(PG_mlocked, &page->flags); }
 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPageMlocked(struct page *page) { return test_and_set_bit(PG_mlocked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageMlocked(struct page *page) { return test_and_clear_bit(PG_mlocked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __TestClearPageMlocked(struct page *page) { return __test_and_clear_bit(PG_mlocked, &page->flags); }
# 280 "include/linux/page-flags.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageUncached(const struct page *page) { return 0; } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageUncached(struct page *page) { } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageUncached(struct page *page) { }







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageHWPoison(const struct page *page) { return 0; } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageHWPoison(struct page *page) { } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageHWPoison(struct page *page) { }



u64 stable_page_flags(struct page *page);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageUptodate(struct page *page)
{
 int ret = test_bit(PG_uptodate, &(page)->flags);
# 306 "include/linux/page-flags.h"
 if (ret)
  __asm__ __volatile__("":::"memory");

 return ret;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageUptodate(struct page *page)
{
 __asm__ __volatile__("":::"memory");
 __set_bit(PG_uptodate, &(page)->flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageUptodate(struct page *page)
{





 __asm__ __volatile__("":::"memory");
 set_bit(PG_uptodate, &(page)->flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageUptodate(struct page *page) { clear_bit(PG_uptodate, &page->flags); }

extern void cancel_dirty_page(struct page *page, unsigned int account_size);

int test_clear_page_writeback(struct page *page);
int __test_set_page_writeback(struct page *page, bool keep_write);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_writeback(struct page *page)
{
 __test_set_page_writeback(page, false);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_writeback_keepwrite(struct page *page)
{
 __test_set_page_writeback(page, true);
}
# 360 "include/linux/page-flags.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageHead(const struct page *page) { return test_bit(PG_head, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageHead(struct page *page) { __set_bit(PG_head, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageHead(struct page *page) { __clear_bit(PG_head, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageHead(struct page *page) { clear_bit(PG_head, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageTail(const struct page *page) { return test_bit(PG_tail, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageTail(struct page *page) { __set_bit(PG_tail, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageTail(struct page *page) { __clear_bit(PG_tail, &page->flags); }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageCompound(struct page *page)
{
 return page->flags & ((1L << PG_head) | (1L << PG_tail));

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageCompound(struct page *page)
{
 do { if (__builtin_expect(!!(!PageHead(page)), 0)) do { do_BUG("include/linux/page-flags.h", 371); __builtin_trap(); } while (0); } while (0);
 ClearPageHead(page);
}
# 440 "include/linux/page-flags.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageTransHuge(struct page *page)
{
 ((void)(sizeof(( long)(PageTail(page)))));
 return PageHead(page);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageTransCompound(struct page *page)
{
 return PageCompound(page);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageTransTail(struct page *page)
{
 return PageTail(page);
}
# 488 "include/linux/page-flags.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSlabPfmemalloc(struct page *page)
{
 ((void)(sizeof(( long)(!PageSlab(page)))));
 return PageActive(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageSlabPfmemalloc(struct page *page)
{
 ((void)(sizeof(( long)(!PageSlab(page)))));
 SetPageActive(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageSlabPfmemalloc(struct page *page)
{
 ((void)(sizeof(( long)(!PageSlab(page)))));
 __ClearPageActive(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageSlabPfmemalloc(struct page *page)
{
 ((void)(sizeof(( long)(!PageSlab(page)))));
 ClearPageActive(page);
}
# 552 "include/linux/page-flags.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_has_private(struct page *page)
{
 return !!(page->flags & (1 << PG_private | 1 << PG_private_2));
}
# 320 "include/linux/mm.h" 2
# 1 "include/linux/huge_mm.h" 1



extern int do_huge_pmd_anonymous_page(struct mm_struct *mm,
          struct vm_area_struct *vma,
          unsigned long address, pmd_t *pmd,
          unsigned int flags);
extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm,
    pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr,
    struct vm_area_struct *vma);
extern void huge_pmd_set_accessed(struct mm_struct *mm,
      struct vm_area_struct *vma,
      unsigned long address, pmd_t *pmd,
      pmd_t orig_pmd, int dirty);
extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
          unsigned long address, pmd_t *pmd,
          pmd_t orig_pmd);
extern struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
       unsigned long addr,
       pmd_t *pmd,
       unsigned int flags);
extern int zap_huge_pmd(struct mmu_gather *tlb,
   struct vm_area_struct *vma,
   pmd_t *pmd, unsigned long addr);
extern int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
   unsigned long addr, unsigned long end,
   unsigned char *vec);
extern int move_huge_pmd(struct vm_area_struct *vma,
    struct vm_area_struct *new_vma,
    unsigned long old_addr,
    unsigned long new_addr, unsigned long old_end,
    pmd_t *old_pmd, pmd_t *new_pmd);
extern int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
   unsigned long addr, pgprot_t newprot,
   int prot_numa);

enum transparent_hugepage_flag {
 TRANSPARENT_HUGEPAGE_FLAG,
 TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,
 TRANSPARENT_HUGEPAGE_DEFRAG_FLAG,
 TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG,
 TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG,
 TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG,



};

enum page_check_address_pmd_flag {
 PAGE_CHECK_ADDRESS_PMD_FLAG,
 PAGE_CHECK_ADDRESS_PMD_NOTSPLITTING_FLAG,
 PAGE_CHECK_ADDRESS_PMD_SPLITTING_FLAG,
};
extern pmd_t *page_check_address_pmd(struct page *page,
         struct mm_struct *mm,
         unsigned long address,
         enum page_check_address_pmd_flag flag,
         spinlock_t **ptl);
# 68 "include/linux/huge_mm.h"
extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
# 95 "include/linux/huge_mm.h"
extern unsigned long transparent_hugepage_flags;
extern int split_huge_page_to_list(struct page *page, struct list_head *list);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int split_huge_page(struct page *page)
{
 return split_huge_page_to_list(page, ((void *)0));
}
extern void __split_huge_page_pmd(struct vm_area_struct *vma,
  unsigned long address, pmd_t *pmd);
# 118 "include/linux/huge_mm.h"
extern void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address,
  pmd_t *pmd);



extern int hugepage_madvise(struct vm_area_struct *vma,
       unsigned long *vm_flags, int advice);
extern void __vma_adjust_trans_huge(struct vm_area_struct *vma,
        unsigned long start,
        unsigned long end,
        long adjust_next);
extern int __pmd_trans_huge_lock(pmd_t *pmd, struct vm_area_struct *vma,
  spinlock_t **ptl);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_trans_huge_lock(pmd_t *pmd, struct vm_area_struct *vma,
  spinlock_t **ptl)
{
 ((void)(sizeof(( long)(!rwsem_is_locked(&vma->vm_mm->mmap_sem)))));
 if (pmd_trans_huge(*pmd))
  return __pmd_trans_huge_lock(pmd, vma, ptl);
 else
  return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vma_adjust_trans_huge(struct vm_area_struct *vma,
      unsigned long start,
      unsigned long end,
      long adjust_next)
{
 if (!vma->anon_vma || vma->vm_ops)
  return;
 __vma_adjust_trans_huge(vma, start, end, adjust_next);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hpage_nr_pages(struct page *page)
{
 if (__builtin_expect(!!(PageTransHuge(page)), 0))
  return (1<<((13 + (13 -3))-13));
 return 1;
}

extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
    unsigned long addr, pmd_t pmd, pmd_t *pmdp);

extern struct page *huge_zero_page;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_huge_zero_page(struct page *page)
{
 return (*({ __attribute__((unused)) typeof(huge_zero_page) __var = ( typeof(huge_zero_page)) 0; (volatile typeof(huge_zero_page) *)&(huge_zero_page); })) == page;
}
# 321 "include/linux/mm.h" 2
# 338 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int put_page_testzero(struct page *page)
{
 ((void)(sizeof(( long)((*({ __attribute__((unused)) typeof((&page->_count)->counter) __var = ( typeof((&page->_count)->counter)) 0; (volatile typeof((&page->_count)->counter) *)&((&page->_count)->counter); })) == 0))));
 return (atomic_sub_return(1, &page->_count) == 0);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_page_unless_zero(struct page *page)
{
 return atomic_add_unless((&page->_count), 1, 0);
}
# 362 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int put_page_unless_one(struct page *page)
{
 return atomic_add_unless(&page->_count, -1, 1);
}

extern int page_is_ram(unsigned long pfn);
extern int region_is_ram(resource_size_t phys_addr, unsigned long size);


struct page *vmalloc_to_page(const void *addr);
unsigned long vmalloc_to_pfn(const void *addr);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_vmalloc_addr(const void *x)
{

 unsigned long addr = (unsigned long)x;

 return addr >= (0x0000000100000000UL) && addr < VMALLOC_END;



}

extern int is_vmalloc_or_module_addr(const void *x);







extern void kvfree(const void *addr);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void compound_lock(struct page *page)
{

 ((void)(sizeof(( long)(PageSlab(page)))));
 bit_spin_lock(PG_compound_lock, &page->flags);

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void compound_unlock(struct page *page)
{

 ((void)(sizeof(( long)(PageSlab(page)))));
 bit_spin_unlock(PG_compound_lock, &page->flags);

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long compound_lock_irqsave(struct page *page)
{
 unsigned long flags = flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); do { } while (0); } while (0);
 compound_lock(page);

 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void compound_unlock_irqrestore(struct page *page,
           unsigned long flags)
{

 compound_unlock(page);
 do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *compound_head_by_tail(struct page *tail)
{
 struct page *head = tail->first_page;






 __asm__ __volatile__("":::"memory");
 if (__builtin_expect(!!(PageTail(tail)), 1))
  return head;
 return tail;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *compound_head(struct page *page)
{
 if (__builtin_expect(!!(PageTail(page)), 0))
  return compound_head_by_tail(page);
 return page;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *compound_head_fast(struct page *page)
{
 if (__builtin_expect(!!(PageTail(page)), 0))
  return page->first_page;
 return page;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_mapcount_reset(struct page *page)
{
 (((&(page)->_mapcount)->counter) = -1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_mapcount(struct page *page)
{
 ((void)(sizeof(( long)(PageSlab(page)))));
 return (*({ __attribute__((unused)) typeof((&page->_mapcount)->counter) __var = ( typeof((&page->_mapcount)->counter)) 0; (volatile typeof((&page->_mapcount)->counter) *)&((&page->_mapcount)->counter); })) + 1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_count(struct page *page)
{
 return (*({ __attribute__((unused)) typeof((&compound_head(page)->_count)->counter) __var = ( typeof((&compound_head(page)->_count)->counter)) 0; (volatile typeof((&compound_head(page)->_count)->counter) *)&((&compound_head(page)->_count)->counter); }));
}


extern int PageHeadHuge(struct page *page_head);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __compound_tail_refcounted(struct page *page)
{
 return !PageSlab(page) && !PageHeadHuge(page);
}
# 519 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool compound_tail_refcounted(struct page *page)
{
 ((void)(sizeof(( long)(!PageHead(page)))));
 return __compound_tail_refcounted(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_huge_page_tail(struct page *page)
{



 ((void)(sizeof(( long)(!PageTail(page)))));
 ((void)(sizeof(( long)(page_mapcount(page) < 0))));
 ((void)(sizeof(( long)((*({ __attribute__((unused)) typeof((&page->_count)->counter) __var = ( typeof((&page->_count)->counter)) 0; (volatile typeof((&page->_count)->counter) *)&((&page->_count)->counter); })) != 0))));
 if (compound_tail_refcounted(page->first_page))
  atomic_add(1, &page->_mapcount);
}

extern bool __get_page_tail(struct page *page);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_page(struct page *page)
{
 if (__builtin_expect(!!(PageTail(page)), 0))
  if (__builtin_expect(!!(__get_page_tail(page)), 1))
   return;




 ((void)(sizeof(( long)((*({ __attribute__((unused)) typeof((&page->_count)->counter) __var = ( typeof((&page->_count)->counter)) 0; (volatile typeof((&page->_count)->counter) *)&((&page->_count)->counter); })) <= 0))));
 atomic_add(1, &page->_count);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *virt_to_head_page(const void *x)
{
 struct page *page = (((struct page *)VMALLOC_END) + (((unsigned long)(x) - PAGE_OFFSET)>>13));







 return compound_head_fast(page);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_page_count(struct page *page)
{
 (((&page->_count)->counter) = 1);
}
# 585 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageBuddy(struct page *page)
{
 return (*({ __attribute__((unused)) typeof((&page->_mapcount)->counter) __var = ( typeof((&page->_mapcount)->counter)) 0; (volatile typeof((&page->_mapcount)->counter) *)&((&page->_mapcount)->counter); })) == (-128);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageBuddy(struct page *page)
{
 ((void)(sizeof(( long)((*({ __attribute__((unused)) typeof((&page->_mapcount)->counter) __var = ( typeof((&page->_mapcount)->counter)) 0; (volatile typeof((&page->_mapcount)->counter) *)&((&page->_mapcount)->counter); })) != -1))));
 (((&page->_mapcount)->counter) = (-128));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageBuddy(struct page *page)
{
 ((void)(sizeof(( long)(!PageBuddy(page)))));
 (((&page->_mapcount)->counter) = -1);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageBalloon(struct page *page)
{
 return (*({ __attribute__((unused)) typeof((&page->_mapcount)->counter) __var = ( typeof((&page->_mapcount)->counter)) 0; (volatile typeof((&page->_mapcount)->counter) *)&((&page->_mapcount)->counter); })) == (-256);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageBalloon(struct page *page)
{
 ((void)(sizeof(( long)((*({ __attribute__((unused)) typeof((&page->_mapcount)->counter) __var = ( typeof((&page->_mapcount)->counter)) 0; (volatile typeof((&page->_mapcount)->counter) *)&((&page->_mapcount)->counter); })) != -1))));
 (((&page->_mapcount)->counter) = (-256));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageBalloon(struct page *page)
{
 ((void)(sizeof(( long)(!PageBalloon(page)))));
 (((&page->_mapcount)->counter) = -1);
}

void put_page(struct page *page);
void put_pages_list(struct list_head *pages);

void split_page(struct page *page, unsigned int order);
int split_free_page(struct page *page);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_compound_page_dtor(struct page *page,
      compound_page_dtor *dtor)
{
 page[1].compound_dtor = dtor;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) compound_page_dtor *get_compound_page_dtor(struct page *page)
{
 return page[1].compound_dtor;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int compound_order(struct page *page)
{
 if (!PageHead(page))
  return 0;
 return page[1].compound_order;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_compound_order(struct page *page, unsigned long order)
{
 page[1].compound_order = order;
}
# 663 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
{
 if (__builtin_expect(!!(vma->vm_flags & 0x00000002), 1))
  pte = pte_mkwrite(pte);
 return pte;
}

void do_set_pte(struct vm_area_struct *vma, unsigned long address,
  struct page *page, pte_t *pte, bool write, bool anon);
# 778 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum zone_type page_zonenum(const struct page *page)
{
 return (page->flags >> (((((sizeof(unsigned long)*8) - 0) - 4) - 1) * (1 != 0))) & ((1UL << 1) - 1);
}
# 795 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_zone_id(struct page *page)
{
 return (page->flags >> ((((((sizeof(unsigned long)*8) - 0) - 4) < ((((sizeof(unsigned long)*8) - 0) - 4) - 1))? (((sizeof(unsigned long)*8) - 0) - 4) : ((((sizeof(unsigned long)*8) - 0) - 4) - 1)) * ((4 + 1) != 0))) & ((1UL << (4 + 1)) - 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zone_to_nid(struct zone *zone)
{

 return zone->node;



}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_to_nid(const struct page *page)
{
 return (page->flags >> ((((sizeof(unsigned long)*8) - 0) - 4) * (4 != 0))) & ((1UL << 4) - 1);
}
# 886 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_cpupid_xchg_last(struct page *page, int cpupid)
{
 return page_to_nid(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_cpupid_last(struct page *page)
{
 return page_to_nid(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpupid_to_nid(int cpupid)
{
 return -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpupid_to_pid(int cpupid)
{
 return -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpupid_to_cpu(int cpupid)
{
 return -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_pid_to_cpupid(int nid, int pid)
{
 return -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpupid_pid_unset(int cpupid)
{
 return 1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_cpupid_reset_last(struct page *page)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpupid_match_pid(struct task_struct *task, int cpupid)
{
 return false;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zone *page_zone(const struct page *page)
{
 return &(node_data[page_to_nid(page)])->node_zones[page_zonenum(page)];
}
# 949 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_zone(struct page *page, enum zone_type zone)
{
 page->flags &= ~(((1UL << 1) - 1) << (((((sizeof(unsigned long)*8) - 0) - 4) - 1) * (1 != 0)));
 page->flags |= (zone & ((1UL << 1) - 1)) << (((((sizeof(unsigned long)*8) - 0) - 4) - 1) * (1 != 0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_node(struct page *page, unsigned long node)
{
 page->flags &= ~(((1UL << 4) - 1) << ((((sizeof(unsigned long)*8) - 0) - 4) * (4 != 0)));
 page->flags |= (node & ((1UL << 4) - 1)) << ((((sizeof(unsigned long)*8) - 0) - 4) * (4 != 0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_links(struct page *page, enum zone_type zone,
 unsigned long node, unsigned long pfn)
{
 set_page_zone(page, zone);
 set_page_node(page, node);



}




# 1 "include/linux/vmstat.h" 1





# 1 "include/linux/mm.h" 1
# 7 "include/linux/vmstat.h" 2

# 1 "include/linux/vm_event_item.h" 1
# 24 "include/linux/vm_event_item.h"
enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
  PGALLOC_NORMAL , PGALLOC_MOVABLE,
  PGFREE, PGACTIVATE, PGDEACTIVATE,
  PGFAULT, PGMAJFAULT,
  PGREFILL_NORMAL , PGREFILL_MOVABLE,
  PGSTEAL_KSWAPD_NORMAL , PGSTEAL_KSWAPD_MOVABLE,
  PGSTEAL_DIRECT_NORMAL , PGSTEAL_DIRECT_MOVABLE,
  PGSCAN_KSWAPD_NORMAL , PGSCAN_KSWAPD_MOVABLE,
  PGSCAN_DIRECT_NORMAL , PGSCAN_DIRECT_MOVABLE,
  PGSCAN_DIRECT_THROTTLE,

  PGSCAN_ZONE_RECLAIM_FAILED,

  PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL,
  KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY,
  PAGEOUTRUN, ALLOCSTALL, PGROTATED,
  DROP_PAGECACHE, DROP_SLAB,
# 49 "include/linux/vm_event_item.h"
  PGMIGRATE_SUCCESS, PGMIGRATE_FAIL,


  COMPACTMIGRATE_SCANNED, COMPACTFREE_SCANNED,
  COMPACTISOLATED,
  COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS,


  HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL,

  UNEVICTABLE_PGCULLED,
  UNEVICTABLE_PGSCANNED,
  UNEVICTABLE_PGRESCUED,
  UNEVICTABLE_PGMLOCKED,
  UNEVICTABLE_PGMUNLOCKED,
  UNEVICTABLE_PGCLEARED,
  UNEVICTABLE_PGSTRANDED,

  THP_FAULT_ALLOC,
  THP_FAULT_FALLBACK,
  THP_COLLAPSE_ALLOC,
  THP_COLLAPSE_ALLOC_FAILED,
  THP_SPLIT,
  THP_ZERO_PAGE_ALLOC,
  THP_ZERO_PAGE_ALLOC_FAILED,
# 95 "include/linux/vm_event_item.h"
  NR_VM_EVENT_ITEMS
};
# 9 "include/linux/vmstat.h" 2


extern int sysctl_stat_interval;
# 24 "include/linux/vmstat.h"
struct vm_event_state {
 unsigned long event[NR_VM_EVENT_ITEMS];
};

extern __attribute__((section(".data..percpu" ""))) __typeof__(struct vm_event_state) vm_event_states;





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __count_vm_event(enum vm_event_item item)
{
 do { do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(vm_event_states.event[item])) { case 1: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; } while (0);break; case 2: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; } while (0);break; case 4: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; } while (0);break; case 8: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void count_vm_event(enum vm_event_item item)
{
 do { do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(vm_event_states.event[item])) { case 1: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 2: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 4: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 8: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __count_vm_events(enum vm_event_item item, long delta)
{
 do { do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(vm_event_states.event[item])) { case 1: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; } while (0);break; case 2: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; } while (0);break; case 4: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; } while (0);break; case 8: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void count_vm_events(enum vm_event_item item, long delta)
{
 do { do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(vm_event_states.event[item])) { case 1: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 2: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 4: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 8: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
}

extern void all_vm_events(unsigned long *);

extern void vm_events_fold_cpu(int cpu);
# 111 "include/linux/vmstat.h"
extern atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void zone_page_state_add(long x, struct zone *zone,
     enum zone_stat_item item)
{
 atomic_long_add(x, &zone->vm_stat[item]);
 atomic_long_add(x, &vm_stat[item]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long global_page_state(enum zone_stat_item item)
{
 long x = atomic_long_read(&vm_stat[item]);

 if (x < 0)
  x = 0;

 return x;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long zone_page_state(struct zone *zone,
     enum zone_stat_item item)
{
 long x = atomic_long_read(&zone->vm_stat[item]);

 if (x < 0)
  x = 0;

 return x;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long zone_page_state_snapshot(struct zone *zone,
     enum zone_stat_item item)
{
 long x = atomic_long_read(&zone->vm_stat[item]);


 int cpu;
 for (((cpu)) = -1; ((cpu)) = cpumask_next(((cpu)), (cpu_online_mask)), ((cpu)) < nr_cpu_ids;)
  x += ({ do { const void *__vpp_verify = (typeof((zone->pageset) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*((zone->pageset))) *)((zone->pageset)))); (typeof((typeof(*((zone->pageset))) *)((zone->pageset)))) (__ptr + ((((trap_block[((cpu))].__per_cpu_base))))); }); })->vm_stat_diff[item];

 if (x < 0)
  x = 0;

 return x;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long node_page_state(int node,
     enum zone_stat_item item)
{
 struct zone *zones = (node_data[node])->node_zones;

 return
# 184 "include/linux/vmstat.h"
  zone_page_state(&zones[ZONE_NORMAL], item) +
  zone_page_state(&zones[ZONE_MOVABLE], item);
}

extern void zone_statistics(struct zone *, struct zone *, gfp_t gfp);
# 201 "include/linux/vmstat.h"
void __mod_zone_page_state(struct zone *, enum zone_stat_item item, int);
void __inc_zone_page_state(struct page *, enum zone_stat_item);
void __dec_zone_page_state(struct page *, enum zone_stat_item);

void mod_zone_page_state(struct zone *, enum zone_stat_item, int);
void inc_zone_page_state(struct page *, enum zone_stat_item);
void dec_zone_page_state(struct page *, enum zone_stat_item);

extern void inc_zone_state(struct zone *, enum zone_stat_item);
extern void __inc_zone_state(struct zone *, enum zone_stat_item);
extern void dec_zone_state(struct zone *, enum zone_stat_item);
extern void __dec_zone_state(struct zone *, enum zone_stat_item);

void cpu_vm_stats_fold(int cpu);
void refresh_zone_stat_thresholds(void);

void drain_zonestat(struct zone *zone, struct per_cpu_pageset *);

int calculate_pressure_threshold(struct zone *zone);
int calculate_normal_threshold(struct zone *zone);
void set_pgdat_percpu_threshold(pg_data_t *pgdat,
    int (*calculate_pressure)(struct zone *));
# 280 "include/linux/vmstat.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __mod_zone_freepage_state(struct zone *zone, int nr_pages,
          int migratetype)
{
 __mod_zone_page_state(zone, NR_FREE_PAGES, nr_pages);
 if (false)
  __mod_zone_page_state(zone, NR_FREE_CMA_PAGES, nr_pages);
}

extern const char * const vmstat_text[];
# 975 "include/linux/mm.h" 2

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void *lowmem_page_address(const struct page *page)
{
 return ((void *)((unsigned long) (((phys_addr_t)((unsigned long)((page) - ((struct page *)VMALLOC_END))) << 13)) + PAGE_OFFSET));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *page_address(const struct page *page)
{
 return page->virtual;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_address(struct page *page, void *address)
{
 page->virtual = address;
}
# 1029 "include/linux/mm.h"
extern struct address_space *page_mapping(struct page *page);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *page_rmapping(struct page *page)
{
 return (void *)((unsigned long)page->mapping & ~(1 | 2));
}

extern struct address_space *__page_file_mapping(struct page *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
struct address_space *page_file_mapping(struct page *page)
{
 if (__builtin_expect(!!(PageSwapCache(page)), 0))
  return __page_file_mapping(page);

 return page->mapping;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageAnon(struct page *page)
{
 return ((unsigned long)page->mapping & 1) != 0;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long page_index(struct page *page)
{
 if (__builtin_expect(!!(PageSwapCache(page)), 0))
  return ((page)->private);
 return page->index;
}

extern unsigned long __page_file_index(struct page *page);





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long page_file_index(struct page *page)
{
 if (__builtin_expect(!!(PageSwapCache(page)), 0))
  return __page_file_index(page);

 return page->index;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_mapped(struct page *page)
{
 return (*({ __attribute__((unused)) typeof((&(page)->_mapcount)->counter) __var = ( typeof((&(page)->_mapcount)->counter)) 0; (volatile typeof((&(page)->_mapcount)->counter) *)&((&(page)->_mapcount)->counter); })) >= 0;
}
# 1120 "include/linux/mm.h"
extern void pagefault_out_of_memory(void);
# 1130 "include/linux/mm.h"
extern void show_free_areas(unsigned int flags);
extern bool skip_free_areas_node(unsigned int flags, int nid);

int shmem_zero_setup(struct vm_area_struct *);

bool shmem_mapping(struct address_space *mapping);







extern int can_do_mlock(void);
extern int user_shm_lock(size_t, struct user_struct *);
extern void user_shm_unlock(size_t, struct user_struct *);




struct zap_details {
 struct address_space *check_mapping;
 unsigned long first_index;
 unsigned long last_index;
};

struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr,
  pte_t pte);

int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,
  unsigned long size);
void zap_page_range(struct vm_area_struct *vma, unsigned long address,
  unsigned long size, struct zap_details *);
void unmap_vmas(struct mmu_gather *tlb, struct vm_area_struct *start_vma,
  unsigned long start, unsigned long end);
# 1186 "include/linux/mm.h"
struct mm_walk {
 int (*pmd_entry)(pmd_t *pmd, unsigned long addr,
    unsigned long next, struct mm_walk *walk);
 int (*pte_entry)(pte_t *pte, unsigned long addr,
    unsigned long next, struct mm_walk *walk);
 int (*pte_hole)(unsigned long addr, unsigned long next,
   struct mm_walk *walk);
 int (*hugetlb_entry)(pte_t *pte, unsigned long hmask,
        unsigned long addr, unsigned long next,
        struct mm_walk *walk);
 int (*test_walk)(unsigned long addr, unsigned long next,
   struct mm_walk *walk);
 struct mm_struct *mm;
 struct vm_area_struct *vma;
 void *private;
};

int walk_page_range(unsigned long addr, unsigned long end,
  struct mm_walk *walk);
int walk_page_vma(struct vm_area_struct *vma, struct mm_walk *walk);
void free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
  unsigned long end, unsigned long floor, unsigned long ceiling);
int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
   struct vm_area_struct *vma);
void unmap_mapping_range(struct address_space *mapping,
  loff_t const holebegin, loff_t const holelen, int even_cows);
int follow_pfn(struct vm_area_struct *vma, unsigned long address,
 unsigned long *pfn);
int follow_phys(struct vm_area_struct *vma, unsigned long address,
  unsigned int flags, unsigned long *prot, resource_size_t *phys);
int generic_access_phys(struct vm_area_struct *vma, unsigned long addr,
   void *buf, int len, int write);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unmap_shared_mapping_range(struct address_space *mapping,
  loff_t const holebegin, loff_t const holelen)
{
 unmap_mapping_range(mapping, holebegin, holelen, 0);
}

extern void truncate_pagecache(struct inode *inode, loff_t new);
extern void truncate_setsize(struct inode *inode, loff_t newsize);
void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to);
void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end);
int truncate_inode_page(struct address_space *mapping, struct page *page);
int generic_error_remove_page(struct address_space *mapping, struct page *page);
int invalidate_inode_page(struct page *page);


extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
   unsigned long address, unsigned int flags);
extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
       unsigned long address, unsigned int fault_flags);
# 1257 "include/linux/mm.h"
extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
extern int access_remote_vm(struct mm_struct *mm, unsigned long addr,
  void *buf, int len, int write);

long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
        unsigned long start, unsigned long nr_pages,
        unsigned int foll_flags, struct page **pages,
        struct vm_area_struct **vmas, int *nonblocking);
long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
      unsigned long start, unsigned long nr_pages,
      int write, int force, struct page **pages,
      struct vm_area_struct **vmas);
long get_user_pages_locked(struct task_struct *tsk, struct mm_struct *mm,
      unsigned long start, unsigned long nr_pages,
      int write, int force, struct page **pages,
      int *locked);
long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm,
          unsigned long start, unsigned long nr_pages,
          int write, int force, struct page **pages,
          unsigned int gup_flags);
long get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm,
      unsigned long start, unsigned long nr_pages,
      int write, int force, struct page **pages);
int get_user_pages_fast(unsigned long start, int nr_pages, int write,
   struct page **pages);
struct kvec;
int get_kernel_pages(const struct kvec *iov, int nr_pages, int write,
   struct page **pages);
int get_kernel_page(unsigned long start, int write, struct page **pages);
struct page *get_dump_page(unsigned long addr);

extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
extern void do_invalidatepage(struct page *page, unsigned int offset,
         unsigned int length);

int __set_page_dirty_nobuffers(struct page *page);
int __set_page_dirty_no_writeback(struct page *page);
int redirty_page_for_writepage(struct writeback_control *wbc,
    struct page *page);
void account_page_dirtied(struct page *page, struct address_space *mapping);
int set_page_dirty(struct page *page);
int set_page_dirty_lock(struct page *page);
int clear_page_dirty_for_io(struct page *page);
int get_cmdline(struct task_struct *task, char *buffer, int buflen);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int vma_growsdown(struct vm_area_struct *vma, unsigned long addr)
{
 return vma && (vma->vm_end == addr) && (vma->vm_flags & 0x00000100);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int stack_guard_page_start(struct vm_area_struct *vma,
          unsigned long addr)
{
 return (vma->vm_flags & 0x00000100) &&
  (vma->vm_start == addr) &&
  !vma_growsdown(vma->vm_prev, addr);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int vma_growsup(struct vm_area_struct *vma, unsigned long addr)
{
 return vma && (vma->vm_start == addr) && (vma->vm_flags & 0x00000000);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int stack_guard_page_end(struct vm_area_struct *vma,
        unsigned long addr)
{
 return (vma->vm_flags & 0x00000000) &&
  (vma->vm_end == addr) &&
  !vma_growsup(vma->vm_next, addr);
}

extern struct task_struct *task_of_stack(struct task_struct *task,
    struct vm_area_struct *vma, bool in_group);

extern unsigned long move_page_tables(struct vm_area_struct *vma,
  unsigned long old_addr, struct vm_area_struct *new_vma,
  unsigned long new_addr, unsigned long len,
  bool need_rmap_locks);
extern unsigned long change_protection(struct vm_area_struct *vma, unsigned long start,
         unsigned long end, pgprot_t newprot,
         int dirty_accountable, int prot_numa);
extern int mprotect_fixup(struct vm_area_struct *vma,
     struct vm_area_struct **pprev, unsigned long start,
     unsigned long end, unsigned long newflags);




int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
     struct page **pages);



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_mm_counter(struct mm_struct *mm, int member)
{
 long val = atomic_long_read(&mm->rss_stat.count[member]);






 if (val < 0)
  val = 0;

 return (unsigned long)val;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void add_mm_counter(struct mm_struct *mm, int member, long value)
{
 atomic_long_add(value, &mm->rss_stat.count[member]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inc_mm_counter(struct mm_struct *mm, int member)
{
 atomic_long_inc(&mm->rss_stat.count[member]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dec_mm_counter(struct mm_struct *mm, int member)
{
 atomic_long_dec(&mm->rss_stat.count[member]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_mm_rss(struct mm_struct *mm)
{
 return get_mm_counter(mm, MM_FILEPAGES) +
  get_mm_counter(mm, MM_ANONPAGES);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_mm_hiwater_rss(struct mm_struct *mm)
{
 return ({ typeof(mm->hiwater_rss) _max1 = (mm->hiwater_rss); typeof(get_mm_rss(mm)) _max2 = (get_mm_rss(mm)); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_mm_hiwater_vm(struct mm_struct *mm)
{
 return ({ typeof(mm->hiwater_vm) _max1 = (mm->hiwater_vm); typeof(mm->total_vm) _max2 = (mm->total_vm); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void update_hiwater_rss(struct mm_struct *mm)
{
 unsigned long _rss = get_mm_rss(mm);

 if ((mm)->hiwater_rss < _rss)
  (mm)->hiwater_rss = _rss;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void update_hiwater_vm(struct mm_struct *mm)
{
 if (mm->hiwater_vm < mm->total_vm)
  mm->hiwater_vm = mm->total_vm;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void reset_mm_hiwater_rss(struct mm_struct *mm)
{
 mm->hiwater_rss = get_mm_rss(mm);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void setmax_mm_hiwater_rss(unsigned long *maxrss,
      struct mm_struct *mm)
{
 unsigned long hiwater_rss = get_mm_hiwater_rss(mm);

 if (*maxrss < hiwater_rss)
  *maxrss = hiwater_rss;
}


void sync_mm_rss(struct mm_struct *mm);






int vma_wants_writenotify(struct vm_area_struct *vma);

extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
          spinlock_t **ptl);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr,
        spinlock_t **ptl)
{
 pte_t *ptep;
 (ptep = __get_locked_pte(mm, addr, ptl));
 return ptep;
}
# 1453 "include/linux/mm.h"
int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address);
# 1474 "include/linux/mm.h"
int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_nr_pmds_init(struct mm_struct *mm)
{
 atomic_long_set(&mm->nr_pmds, 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long mm_nr_pmds(struct mm_struct *mm)
{
 return atomic_long_read(&mm->nr_pmds);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_inc_nr_pmds(struct mm_struct *mm)
{
 atomic_long_inc(&mm->nr_pmds);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_dec_nr_pmds(struct mm_struct *mm)
{
 atomic_long_dec(&mm->nr_pmds);
}


int __pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
  pmd_t *pmd, unsigned long address);
int __pte_alloc_kernel(pmd_t *pmd, unsigned long address);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
{
 return (__builtin_expect(!!((!((*pgd).pgd))), 0) && __pud_alloc(mm, pgd, address))?
  ((void *)0): ((pud_t *) ((unsigned long) ((void *)((unsigned long) (((*(pgd)).pgd)) + PAGE_OFFSET))) + (((address) >> ((13 + (13 -3)) + (13 - 3))) & ((1UL << (13 - 3)) - 1)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
{
 return (__builtin_expect(!!((!((*pud).pud))), 0) && __pmd_alloc(mm, pud, address))?
  ((void *)0): ((pmd_t *) ((unsigned long) ((void *)((unsigned long) (((*(pud)).pud)) + PAGE_OFFSET))) + (((address) >> (13 + (13 -3))) & ((1UL << (13 - 3))-1)));
}
# 1530 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptlock_cache_init(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ptlock_alloc(struct page *page)
{
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptlock_free(struct page *page)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *ptlock_ptr(struct page *page)
{
 return &page->ptl;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
{
 return ptlock_ptr((((struct page *)VMALLOC_END) + (((unsigned long)((void *)__pmd_page(*pmd)) - PAGE_OFFSET)>>13)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ptlock_init(struct page *page)
{
# 1564 "include/linux/mm.h"
 ((void)(sizeof(( long)(*(unsigned long *)&page->ptl))));
 if (!ptlock_alloc(page))
  return false;
 do { spinlock_check(ptlock_ptr(page)); do { *(&(ptlock_ptr(page))->rlock) = (raw_spinlock_t) { .raw_lock = { 0 }, }; } while (0); } while (0);
 return true;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pte_lock_deinit(struct page *page)
{
 page->mapping = ((void *)0);
 ptlock_free(page);
}
# 1591 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgtable_init(void)
{
 ptlock_cache_init();
 pgtable_cache_init();
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pgtable_page_ctor(struct page *page)
{
 inc_zone_page_state(page, NR_PAGETABLE);
 return ptlock_init(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgtable_page_dtor(struct page *page)
{
 pte_lock_deinit(page);
 dec_zone_page_state(page, NR_PAGETABLE);
}
# 1670 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
{
 return &mm->page_table_lock;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pgtable_pmd_page_ctor(struct page *page) { return true; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgtable_pmd_page_dtor(struct page *page) {}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *pmd_lock(struct mm_struct *mm, pmd_t *pmd)
{
 spinlock_t *ptl = pmd_lockptr(mm, pmd);
 spin_lock(ptl);
 return ptl;
}

extern void free_area_init(unsigned long * zones_size);
extern void free_area_init_node(int nid, unsigned long * zones_size,
  unsigned long zone_start_pfn, unsigned long *zholes_size);
extern void free_initmem(void);







extern unsigned long free_reserved_area(void *start, void *end,
     int poison, char *s);
# 1711 "include/linux/mm.h"
extern void adjust_managed_page_count(struct page *page, long count);
extern void mem_init_print_info(const char *str);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __free_reserved_page(struct page *page)
{
 ClearPageReserved(page);
 init_page_count(page);
 __free_pages((page), 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void free_reserved_page(struct page *page)
{
 __free_reserved_page(page);
 adjust_managed_page_count(page, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mark_page_reserved(struct page *page)
{
 SetPageReserved(page);
 adjust_managed_page_count(page, -1);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long free_initmem_default(int poison)
{
 extern char __init_begin[], __init_end[];

 return free_reserved_area(&__init_begin, &__init_end,
      poison, "unused kernel");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_num_physpages(void)
{
 int nid;
 unsigned long phys_pages = 0;

 for (((nid)) = __first_node(&(node_states[N_ONLINE])); ((nid)) < (1 << 4); ((nid)) = __next_node((((nid))), &((node_states[N_ONLINE]))))
  phys_pages += ((node_data[nid])->node_present_pages);

 return phys_pages;
}
# 1786 "include/linux/mm.h"
extern void free_area_init_nodes(unsigned long *max_zone_pfn);
unsigned long node_map_pfn_alignment(void);
unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn,
      unsigned long end_pfn);
extern unsigned long absent_pages_in_range(unsigned long start_pfn,
      unsigned long end_pfn);
extern void get_pfn_range_for_nid(unsigned int nid,
   unsigned long *start_pfn, unsigned long *end_pfn);
extern unsigned long find_min_pfn_with_active_regions(void);
extern void free_bootmem_with_active_regions(int nid,
      unsigned long max_low_pfn);
extern void sparse_memory_present_with_active_regions(int nid);
# 1809 "include/linux/mm.h"
extern int __attribute__ ((__section__(".meminit.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) early_pfn_to_nid(unsigned long pfn);

extern int __attribute__ ((__section__(".meminit.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) __early_pfn_to_nid(unsigned long pfn);


extern void set_dma_reserve(unsigned long new_dma_reserve);
extern void memmap_init_zone(unsigned long, int, unsigned long,
    unsigned long, enum memmap_context);
extern void setup_per_zone_wmarks(void);
extern int __attribute__ ((__section__(".meminit.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) init_per_zone_wmark_min(void);
extern void mem_init(void);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) mmap_init(void);
extern void show_mem(unsigned int flags);
extern void si_meminfo(struct sysinfo * val);
extern void si_meminfo_node(struct sysinfo *val, int nid);

extern __attribute__((format(printf, 3, 4)))
void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...);

extern void setup_per_cpu_pageset(void);

extern void zone_pcp_update(struct zone *zone);
extern void zone_pcp_reset(struct zone *zone);


extern int min_free_kbytes;


extern atomic_long_t mmap_pages_allocated;
extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t);


void vma_interval_tree_insert(struct vm_area_struct *node,
         struct rb_root *root);
void vma_interval_tree_insert_after(struct vm_area_struct *node,
        struct vm_area_struct *prev,
        struct rb_root *root);
void vma_interval_tree_remove(struct vm_area_struct *node,
         struct rb_root *root);
struct vm_area_struct *vma_interval_tree_iter_first(struct rb_root *root,
    unsigned long start, unsigned long last);
struct vm_area_struct *vma_interval_tree_iter_next(struct vm_area_struct *node,
    unsigned long start, unsigned long last);





void anon_vma_interval_tree_insert(struct anon_vma_chain *node,
       struct rb_root *root);
void anon_vma_interval_tree_remove(struct anon_vma_chain *node,
       struct rb_root *root);
struct anon_vma_chain *anon_vma_interval_tree_iter_first(
 struct rb_root *root, unsigned long start, unsigned long last);
struct anon_vma_chain *anon_vma_interval_tree_iter_next(
 struct anon_vma_chain *node, unsigned long start, unsigned long last);
# 1874 "include/linux/mm.h"
extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin);
extern int vma_adjust(struct vm_area_struct *vma, unsigned long start,
 unsigned long end, unsigned long pgoff, struct vm_area_struct *insert);
extern struct vm_area_struct *vma_merge(struct mm_struct *,
 struct vm_area_struct *prev, unsigned long addr, unsigned long end,
 unsigned long vm_flags, struct anon_vma *, struct file *, unsigned long,
 struct mempolicy *);
extern struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *);
extern int split_vma(struct mm_struct *,
 struct vm_area_struct *, unsigned long addr, int new_below);
extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *,
 struct rb_node **, struct rb_node *);
extern void unlink_file_vma(struct vm_area_struct *);
extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
 unsigned long addr, unsigned long len, unsigned long pgoff,
 bool *need_rmap_locks);
extern void exit_mmap(struct mm_struct *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int check_data_rlimit(unsigned long rlim,
        unsigned long new,
        unsigned long start,
        unsigned long end_data,
        unsigned long start_data)
{
 if (rlim < (~0UL)) {
  if (((new - start) + (end_data - start_data)) > rlim)
   return -28;
 }

 return 0;
}

extern int mm_take_all_locks(struct mm_struct *mm);
extern void mm_drop_all_locks(struct mm_struct *mm);

extern void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file);
extern struct file *get_mm_exe_file(struct mm_struct *mm);

extern int may_expand_vm(struct mm_struct *mm, unsigned long npages);
extern struct vm_area_struct *_install_special_mapping(struct mm_struct *mm,
       unsigned long addr, unsigned long len,
       unsigned long flags,
       const struct vm_special_mapping *spec);

extern int install_special_mapping(struct mm_struct *mm,
       unsigned long addr, unsigned long len,
       unsigned long flags, struct page **pages);

extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);

extern unsigned long mmap_region(struct file *file, unsigned long addr,
 unsigned long len, vm_flags_t vm_flags, unsigned long pgoff);
extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
 unsigned long len, unsigned long prot, unsigned long flags,
 unsigned long pgoff, unsigned long *populate);
extern int do_munmap(struct mm_struct *, unsigned long, size_t);


extern int __mm_populate(unsigned long addr, unsigned long len,
    int ignore_errors);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_populate(unsigned long addr, unsigned long len)
{

 (void) __mm_populate(addr, len, 1);
}





extern unsigned long vm_brk(unsigned long, unsigned long);
extern int vm_munmap(unsigned long, size_t);
extern unsigned long vm_mmap(struct file *, unsigned long,
        unsigned long, unsigned long,
        unsigned long, unsigned long);

struct vm_unmapped_area_info {

 unsigned long flags;
 unsigned long length;
 unsigned long low_limit;
 unsigned long high_limit;
 unsigned long align_mask;
 unsigned long align_offset;
};

extern unsigned long unmapped_area(struct vm_unmapped_area_info *info);
extern unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info);
# 1973 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
vm_unmapped_area(struct vm_unmapped_area_info *info)
{
 if (!(info->flags & 1))
  return unmapped_area(info);
 else
  return unmapped_area_topdown(info);
}


extern void truncate_inode_pages(struct address_space *, loff_t);
extern void truncate_inode_pages_range(struct address_space *,
           loff_t lstart, loff_t lend);
extern void truncate_inode_pages_final(struct address_space *);


extern int filemap_fault(struct vm_area_struct *, struct vm_fault *);
extern void filemap_map_pages(struct vm_area_struct *vma, struct vm_fault *vmf);
extern int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);


int write_one_page(struct page *page, int wait);
void task_dirty_inc(struct task_struct *tsk);





int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
   unsigned long offset, unsigned long nr_to_read);

void page_cache_sync_readahead(struct address_space *mapping,
          struct file_ra_state *ra,
          struct file *filp,
          unsigned long offset,
          unsigned long size);

void page_cache_async_readahead(struct address_space *mapping,
    struct file_ra_state *ra,
    struct file *filp,
    struct page *pg,
    unsigned long offset,
    unsigned long size);

unsigned long max_sane_readahead(unsigned long nr);


extern int expand_stack(struct vm_area_struct *vma, unsigned long address);


extern int expand_downwards(struct vm_area_struct *vma,
  unsigned long address);







extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr);
extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr,
          struct vm_area_struct **pprev);



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct vm_area_struct * find_vma_intersection(struct mm_struct * mm, unsigned long start_addr, unsigned long end_addr)
{
 struct vm_area_struct * vma = find_vma(mm,start_addr);

 if (vma && end_addr <= vma->vm_start)
  vma = ((void *)0);
 return vma;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long vma_pages(struct vm_area_struct *vma)
{
 return (vma->vm_end - vma->vm_start) >> 13;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct vm_area_struct *find_exact_vma(struct mm_struct *mm,
    unsigned long vm_start, unsigned long vm_end)
{
 struct vm_area_struct *vma = find_vma(mm, vm_start);

 if (vma && (vma->vm_start != vm_start || vma->vm_end != vm_end))
  vma = ((void *)0);

 return vma;
}


pgprot_t vm_get_page_prot(unsigned long vm_flags);
void vma_set_page_prot(struct vm_area_struct *vma);
# 2083 "include/linux/mm.h"
struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr);
int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
   unsigned long pfn, unsigned long size, pgprot_t);
int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *);
int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
   unsigned long pfn);
int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
   unsigned long pfn);
int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len);


struct page *follow_page_mask(struct vm_area_struct *vma,
         unsigned long address, unsigned int foll_flags,
         unsigned int *page_mask);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *follow_page(struct vm_area_struct *vma,
  unsigned long address, unsigned int foll_flags)
{
 unsigned int unused_page_mask;
 return follow_page_mask(vma, address, foll_flags, &unused_page_mask);
}
# 2119 "include/linux/mm.h"
typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
   void *data);
extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
          unsigned long size, pte_fn_t fn, void *data);


void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
# 2155 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
kernel_map_pages(struct page *page, int numpages, int enable) {}
# 2167 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
{
 return ((void *)0);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int in_gate_area_no_mm(unsigned long addr) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int in_gate_area(struct mm_struct *mm, unsigned long addr)
{
 return 0;
}



extern int sysctl_drop_caches;
int drop_caches_sysctl_handler(struct ctl_table *, int,
     void *, size_t *, loff_t *);


void drop_slab(void);
void drop_slab_node(int nid);




extern int randomize_va_space;


const char * arch_vma_name(struct vm_area_struct *vma);
void print_vma_addr(char *prefix, unsigned long rip);

void sparse_mem_maps_populate_node(struct page **map_map,
       unsigned long pnum_begin,
       unsigned long pnum_end,
       unsigned long map_count,
       int nodeid);

struct page *sparse_mem_map_populate(unsigned long pnum, int nid);
pgd_t *vmemmap_pgd_populate(unsigned long addr, int node);
pud_t *vmemmap_pud_populate(pgd_t *pgd, unsigned long addr, int node);
pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node);
pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node);
void *vmemmap_alloc_block(unsigned long size, int node);
void *vmemmap_alloc_block_buf(unsigned long size, int node);
void vmemmap_verify(pte_t *, int, unsigned long, unsigned long);
int vmemmap_populate_basepages(unsigned long start, unsigned long end,
          int node);
int vmemmap_populate(unsigned long start, unsigned long end, int node);
void vmemmap_populate_print_last(void);



void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
      unsigned long size);

enum mf_flags {
 MF_COUNT_INCREASED = 1 << 0,
 MF_ACTION_REQUIRED = 1 << 1,
 MF_MUST_KILL = 1 << 2,
 MF_SOFT_OFFLINE = 1 << 3,
};
extern int memory_failure(unsigned long pfn, int trapno, int flags);
extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
extern int unpoison_memory(unsigned long pfn);
extern int sysctl_memory_failure_early_kill;
extern int sysctl_memory_failure_recovery;
extern void shake_page(struct page *p, int access);
extern atomic_long_t num_poisoned_pages;
extern int soft_offline_page(struct page *page, int flags);


extern void clear_huge_page(struct page *page,
       unsigned long addr,
       unsigned int pages_per_huge_page);
extern void copy_user_huge_page(struct page *dst, struct page *src,
    unsigned long addr, struct vm_area_struct *vma,
    unsigned int pages_per_huge_page);


extern struct page_ext_operations debug_guardpage_ops;
extern struct page_ext_operations page_poisoning_ops;
# 2272 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int debug_guardpage_minorder(void) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool debug_guardpage_enabled(void) { return false; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool page_is_guard(struct page *page) { return false; }



void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) setup_nr_node_ids(void);
# 7 "include/linux/pid_namespace.h" 2


# 1 "include/linux/nsproxy.h" 1






struct mnt_namespace;
struct uts_namespace;
struct ipc_namespace;
struct pid_namespace;
struct fs_struct;
# 29 "include/linux/nsproxy.h"
struct nsproxy {
 atomic_t count;
 struct uts_namespace *uts_ns;
 struct ipc_namespace *ipc_ns;
 struct mnt_namespace *mnt_ns;
 struct pid_namespace *pid_ns_for_children;
 struct net *net_ns;
};
extern struct nsproxy init_nsproxy;
# 65 "include/linux/nsproxy.h"
int copy_namespaces(unsigned long flags, struct task_struct *tsk);
void exit_task_namespaces(struct task_struct *tsk);
void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new);
void free_nsproxy(struct nsproxy *ns);
int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
 struct cred *, struct fs_struct *);
int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) nsproxy_cache_init(void);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_nsproxy(struct nsproxy *ns)
{
 if ((atomic_sub_return(1, &ns->count) == 0)) {
  free_nsproxy(ns);
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_nsproxy(struct nsproxy *ns)
{
 atomic_add(1, &ns->count);
}
# 10 "include/linux/pid_namespace.h" 2
# 1 "include/linux/kref.h" 1
# 24 "include/linux/kref.h"
struct kref {
 atomic_t refcount;
};





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kref_init(struct kref *kref)
{
 (((&kref->refcount)->counter) = 1);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kref_get(struct kref *kref)
{




 ({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(atomic_add_return(1, &kref->refcount) < 2); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kref.h", 47); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); });
}
# 68 "include/linux/kref.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kref_sub(struct kref *kref, unsigned int count,
      void (*release)(struct kref *kref))
{
 ({ int __ret_warn_on = !!(release == ((void *)0)); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kref.h", 71); __builtin_expect(!!(__ret_warn_on), 0); });

 if ((atomic_sub_return((int) count, &kref->refcount) == 0)) {
  release(kref);
  return 1;
 }
 return 0;
}
# 97 "include/linux/kref.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kref_put(struct kref *kref, void (*release)(struct kref *kref))
{
 return kref_sub(kref, 1, release);
}
# 115 "include/linux/kref.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kref_put_spinlock_irqsave(struct kref *kref,
  void (*release)(struct kref *kref),
  spinlock_t *lock)
{
 unsigned long flags;

 ({ int __ret_warn_on = !!(release == ((void *)0)); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kref.h", 121); __builtin_expect(!!(__ret_warn_on), 0); });
 if (atomic_add_unless(&kref->refcount, -1, 1))
  return 0;
 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(lock)); } while (0); } while (0);
 if ((atomic_sub_return(1, &kref->refcount) == 0)) {
  release(kref);
  do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);
  return 1;
 }
 spin_unlock_irqrestore(lock, flags);
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kref_put_mutex(struct kref *kref,
     void (*release)(struct kref *kref),
     struct mutex *lock)
{
 ({ int __ret_warn_on = !!(release == ((void *)0)); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kref.h", 138); __builtin_expect(!!(__ret_warn_on), 0); });
 if (__builtin_expect(!!(!atomic_add_unless(&kref->refcount, -1, 1)), 0)) {
  mutex_lock(lock);
  if (__builtin_expect(!!(!(atomic_sub_return(1, &kref->refcount) == 0)), 0)) {
   mutex_unlock(lock);
   return 0;
  }
  release(kref);
  return 1;
 }
 return 0;
}
# 167 "include/linux/kref.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kref_get_unless_zero(struct kref *kref)
{
 return atomic_add_unless(&kref->refcount, 1, 0);
}
# 11 "include/linux/pid_namespace.h" 2
# 1 "include/linux/ns_common.h" 1



struct proc_ns_operations;

struct ns_common {
 atomic_long_t stashed;
 const struct proc_ns_operations *ops;
 unsigned int inum;
};
# 12 "include/linux/pid_namespace.h" 2

struct pidmap {
       atomic_t nr_free;
       void *page;
};





struct fs_pin;

struct pid_namespace {
 struct kref kref;
 struct pidmap pidmap[(((0 ? ((1UL) << 13) * 8 : (sizeof(long) > 4 ? 4 * 1024 * 1024 : (0 ? 0x1000 : 0x8000)))+(((1UL) << 13) * 8)-1)/(((1UL) << 13) * 8))];
 struct callback_head rcu;
 int last_pid;
 unsigned int nr_hashed;
 struct task_struct *child_reaper;
 struct kmem_cache *pid_cachep;
 unsigned int level;
 struct pid_namespace *parent;

 struct vfsmount *proc_mnt;
 struct dentry *proc_self;
 struct dentry *proc_thread_self;




 struct user_namespace *user_ns;
 struct work_struct proc_work;
 kgid_t pid_gid;
 int hide_pid;
 int reboot;
 struct ns_common ns;
};

extern struct pid_namespace init_pid_ns;




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid_namespace *get_pid_ns(struct pid_namespace *ns)
{
 if (ns != &init_pid_ns)
  kref_get(&ns->kref);
 return ns;
}

extern struct pid_namespace *copy_pid_ns(unsigned long flags,
 struct user_namespace *user_ns, struct pid_namespace *ns);
extern void zap_pid_ns_processes(struct pid_namespace *pid_ns);
extern int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd);
extern void put_pid_ns(struct pid_namespace *ns);
# 99 "include/linux/pid_namespace.h"
extern struct pid_namespace *task_active_pid_ns(struct task_struct *tsk);
void pidhash_init(void);
void pidmap_init(void);
# 46 "include/linux/perf_event.h" 2

# 1 "include/linux/ftrace.h" 1
# 9 "include/linux/ftrace.h"
# 1 "include/linux/trace_clock.h" 1
# 15 "include/linux/trace_clock.h"
# 1 "arch/sparc/include/generated/asm/trace_clock.h" 1
# 1 "include/asm-generic/trace_clock.h" 1
# 1 "arch/sparc/include/generated/asm/trace_clock.h" 2
# 16 "include/linux/trace_clock.h" 2

extern u64 __attribute__((no_instrument_function)) trace_clock_local(void);
extern u64 __attribute__((no_instrument_function)) trace_clock(void);
extern u64 __attribute__((no_instrument_function)) trace_clock_jiffies(void);
extern u64 __attribute__((no_instrument_function)) trace_clock_global(void);
extern u64 __attribute__((no_instrument_function)) trace_clock_counter(void);
# 10 "include/linux/ftrace.h" 2
# 1 "include/linux/kallsyms.h" 1
# 16 "include/linux/kallsyms.h"
struct module;



unsigned long kallsyms_lookup_name(const char *name);


int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
          unsigned long),
       void *data);

extern int kallsyms_lookup_size_offset(unsigned long addr,
      unsigned long *symbolsize,
      unsigned long *offset);


const char *kallsyms_lookup(unsigned long addr,
       unsigned long *symbolsize,
       unsigned long *offset,
       char **modname, char *namebuf);


extern int sprint_symbol(char *buffer, unsigned long address);
extern int sprint_symbol_no_offset(char *buffer, unsigned long address);
extern int sprint_backtrace(char *buffer, unsigned long address);


extern void __print_symbol(const char *fmt, unsigned long address);

int lookup_symbol_name(unsigned long addr, char *symname);
int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
# 111 "include/linux/kallsyms.h"
static __attribute__((format(printf, 1, 2)))
void __check_printsym_format(const char *fmt, ...)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void print_symbol(const char *fmt, unsigned long addr)
{
 __check_printsym_format(fmt, "");
 __print_symbol(fmt, (unsigned long)
         __builtin_extract_return_addr((void *)addr));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void print_ip_sym(unsigned long ip)
{
 printk("[<%p>] %pS\n", (void *) ip, (void *) ip);
}
# 11 "include/linux/ftrace.h" 2


# 1 "include/linux/ptrace.h" 1
# 9 "include/linux/ptrace.h"
# 1 "include/uapi/linux/ptrace.h" 1
# 58 "include/uapi/linux/ptrace.h"
struct ptrace_peeksiginfo_args {
 __u64 off;
 __u32 flags;
 __s32 nr;
};
# 10 "include/linux/ptrace.h" 2
# 44 "include/linux/ptrace.h"
extern long arch_ptrace(struct task_struct *child, long request,
   unsigned long addr, unsigned long data);
extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int len);
extern int ptrace_writedata(struct task_struct *tsk, char *src, unsigned long dst, int len);
extern void ptrace_disable(struct task_struct *);
extern int ptrace_request(struct task_struct *child, long request,
     unsigned long addr, unsigned long data);
extern void ptrace_notify(int exit_code);
extern void __ptrace_link(struct task_struct *child,
     struct task_struct *new_parent);
extern void __ptrace_unlink(struct task_struct *child);
extern void exit_ptrace(struct task_struct *tracer, struct list_head *dead);




extern bool ptrace_may_access(struct task_struct *task, unsigned int mode);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ptrace_reparented(struct task_struct *child)
{
 return !same_thread_group(child->real_parent, child->parent);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptrace_unlink(struct task_struct *child)
{
 if (__builtin_expect(!!(child->ptrace), 0))
  __ptrace_unlink(child);
}

int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr,
       unsigned long data);
int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
       unsigned long data);
# 89 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct task_struct *ptrace_parent(struct task_struct *task)
{
 if (__builtin_expect(!!(task->ptrace), 0))
  return ({ typeof(*(task->parent)) *________p1 = (typeof(*(task->parent)) *)({ typeof((task->parent)) _________p1 = (*({ __attribute__((unused)) typeof((task->parent)) __var = ( typeof((task->parent))) 0; (volatile typeof((task->parent)) *)&((task->parent)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(task->parent)) *)(________p1)); });
 return ((void *)0);
}
# 105 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ptrace_event_enabled(struct task_struct *task, int event)
{
 return task->ptrace & (1 << (3 + (event)));
}
# 120 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptrace_event(int event, unsigned long message)
{
 if (__builtin_expect(!!(ptrace_event_enabled(current, event)), 0)) {
  current->ptrace_message = message;
  ptrace_notify((event << 8) | 5);
 } else if (event == 4) {

  if ((current->ptrace & (0x00000001|0x00010000)) == 0x00000001)
   send_sig(5, current, 0);
 }
}
# 143 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptrace_event_pid(int event, struct pid *pid)
{






 unsigned long message = 0;
 struct pid_namespace *ns;

 rcu_read_lock();
 ns = task_active_pid_ns(({ typeof(*(current->parent)) *________p1 = (typeof(*(current->parent)) *)({ typeof((current->parent)) _________p1 = (*({ __attribute__((unused)) typeof((current->parent)) __var = ( typeof((current->parent))) 0; (volatile typeof((current->parent)) *)&((current->parent)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(current->parent)) *)(________p1)); }));
 if (ns)
  message = pid_nr_ns(pid, ns);
 rcu_read_unlock();

 ptrace_event(event, message);
}
# 173 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptrace_init_task(struct task_struct *child, bool ptrace)
{
 INIT_LIST_HEAD(&child->ptrace_entry);
 INIT_LIST_HEAD(&child->ptraced);
 child->jobctl = 0;
 child->ptrace = 0;
 child->parent = child->real_parent;

 if (__builtin_expect(!!(ptrace), 0) && current->ptrace) {
  child->ptrace = current->ptrace;
  __ptrace_link(child, current->parent);

  if (child->ptrace & 0x00010000)
   task_set_jobctl_pending(child, (1 << 19));
  else
   sigaddset(&child->pending.signal, 17);

  set_tsk_thread_flag(child, 2);
 }
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptrace_release_task(struct task_struct *task)
{
 do { if (__builtin_expect(!!(!list_empty(&task->ptraced)), 0)) do { do_BUG("include/linux/ptrace.h", 202); __builtin_trap(); } while (0); } while (0);
 ptrace_unlink(task);
 do { if (__builtin_expect(!!(!list_empty(&task->ptrace_entry)), 0)) do { do_BUG("include/linux/ptrace.h", 204); __builtin_trap(); } while (0); } while (0);
}
# 260 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void user_enable_single_step(struct task_struct *task)
{
 do { do_BUG("include/linux/ptrace.h", 262); __builtin_trap(); } while (0);
}
# 274 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void user_disable_single_step(struct task_struct *task)
{
}
# 303 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void user_enable_block_step(struct task_struct *task)
{
 do { do_BUG("include/linux/ptrace.h", 305); __builtin_trap(); } while (0);
}
# 315 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void user_single_step_siginfo(struct task_struct *tsk,
    struct pt_regs *regs, siginfo_t *info)
{
 __builtin_memset(info, 0, sizeof(*info));
 info->si_signo = 5;
}
# 382 "include/linux/ptrace.h"
extern int task_current_syscall(struct task_struct *target, long *callno,
    unsigned long args[6], unsigned int maxargs,
    unsigned long *sp, unsigned long *pc);
# 14 "include/linux/ftrace.h" 2






# 1 "./arch/sparc/include/asm/ftrace.h" 1
# 25 "./arch/sparc/include/asm/ftrace.h"
unsigned long prepare_ftrace_return(unsigned long parent,
        unsigned long self_addr,
        unsigned long frame_pointer);
# 21 "include/linux/ftrace.h" 2
# 44 "include/linux/ftrace.h"
void trace_init(void);




struct module;
struct ftrace_hash;
# 254 "include/linux/ftrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ftrace_nr_registered_ops(void)
{
 return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_ftrace_function(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_kill(void) { }
# 270 "include/linux/ftrace.h"
struct ftrace_func_command {
 struct list_head list;
 char *name;
 int (*func)(struct ftrace_hash *hash,
     char *func, char *cmd,
     char *params, int enable);
};
# 579 "include/linux/ftrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skip_trace(unsigned long ip) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ftrace_force_update(void) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_disable_daemon(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_enable_daemon(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_release_mod(struct module *mod) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_module_init(struct module *mod) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) int register_ftrace_command(struct ftrace_func_command *cmd)
{
 return -22;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) int unregister_ftrace_command(char *cmd_name)
{
 return -22;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ftrace_text_reserved(const void *start, const void *end)
{
 return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long ftrace_location(unsigned long ip)
{
 return 0;
}
# 614 "include/linux/ftrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ssize_t ftrace_filter_write(struct file *file, const char *ubuf,
       size_t cnt, loff_t *ppos) { return -19; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ssize_t ftrace_notrace_write(struct file *file, const char *ubuf,
        size_t cnt, loff_t *ppos) { return -19; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
ftrace_regex_release(struct inode *inode, struct file *file) { return -19; }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_ftrace_trampoline(unsigned long addr)
{
 return false;
}



void ftrace_kill(void);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tracer_disable(void)
{



}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __ftrace_enabled_save(void)
{





 return 0;

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ftrace_enabled_restore(int enabled)
{



}
# 686 "include/linux/ftrace.h"
  static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void time_hardirqs_on(unsigned long a0, unsigned long a1) { }
  static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void time_hardirqs_off(unsigned long a0, unsigned long a1) { }
# 705 "include/linux/ftrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_init(void) { }





struct ftrace_graph_ent {
 unsigned long func;
 int depth;
};




struct ftrace_graph_ret {
 unsigned long func;
 unsigned long long calltime;
 unsigned long long rettime;

 unsigned long overrun;
 int depth;
};


typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *);
typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *);
# 817 "include/linux/ftrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_graph_init_task(struct task_struct *t) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_graph_exit_task(struct task_struct *t) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_graph_init_idle_task(struct task_struct *t, int cpu) { }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int register_ftrace_graph(trace_func_graph_ret_t retfunc,
     trace_func_graph_ent_t entryfunc)
{
 return -1;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unregister_ftrace_graph(void) { }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int task_curr_ret_stack(struct task_struct *tsk)
{
 return -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pause_graph_tracing(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unpause_graph_tracing(void) { }





enum {
 TSK_TRACE_FL_TRACE_BIT = 0,
 TSK_TRACE_FL_GRAPH_BIT = 1,
};
enum {
 TSK_TRACE_FL_TRACE = 1 << TSK_TRACE_FL_TRACE_BIT,
 TSK_TRACE_FL_GRAPH = 1 << TSK_TRACE_FL_GRAPH_BIT,
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_tsk_trace_trace(struct task_struct *tsk)
{
 set_bit(TSK_TRACE_FL_TRACE_BIT, &tsk->trace);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_tsk_trace_trace(struct task_struct *tsk)
{
 clear_bit(TSK_TRACE_FL_TRACE_BIT, &tsk->trace);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_tsk_trace_trace(struct task_struct *tsk)
{
 return tsk->trace & TSK_TRACE_FL_TRACE;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_tsk_trace_graph(struct task_struct *tsk)
{
 set_bit(TSK_TRACE_FL_GRAPH_BIT, &tsk->trace);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_tsk_trace_graph(struct task_struct *tsk)
{
 clear_bit(TSK_TRACE_FL_GRAPH_BIT, &tsk->trace);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_tsk_trace_graph(struct task_struct *tsk)
{
 return tsk->trace & TSK_TRACE_FL_GRAPH;
}

enum ftrace_dump_mode;

extern enum ftrace_dump_mode ftrace_dump_on_oops;
extern int tracepoint_printk;

extern void disable_trace_on_warning(void);
extern int __disable_trace_on_warning;
# 48 "include/linux/perf_event.h" 2
# 1 "include/linux/cpu.h" 1
# 16 "include/linux/cpu.h"
# 1 "include/linux/node.h" 1
# 17 "include/linux/node.h"
# 1 "include/linux/device.h" 1
# 16 "include/linux/device.h"
# 1 "include/linux/ioport.h" 1
# 18 "include/linux/ioport.h"
struct resource {
 resource_size_t start;
 resource_size_t end;
 const char *name;
 unsigned long flags;
 struct resource *parent, *sibling, *child;
};
# 138 "include/linux/ioport.h"
extern struct resource ioport_resource;
extern struct resource iomem_resource;

extern struct resource *request_resource_conflict(struct resource *root, struct resource *new);
extern int request_resource(struct resource *root, struct resource *new);
extern int release_resource(struct resource *new);
void release_child_resources(struct resource *new);
extern void reserve_region_with_split(struct resource *root,
        resource_size_t start, resource_size_t end,
        const char *name);
extern struct resource *insert_resource_conflict(struct resource *parent, struct resource *new);
extern int insert_resource(struct resource *parent, struct resource *new);
extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new);
extern void arch_remove_reservations(struct resource *avail);
extern int allocate_resource(struct resource *root, struct resource *new,
        resource_size_t size, resource_size_t min,
        resource_size_t max, resource_size_t align,
        resource_size_t (*alignf)(void *,
             const struct resource *,
             resource_size_t,
             resource_size_t),
        void *alignf_data);
struct resource *lookup_resource(struct resource *root, resource_size_t start);
int adjust_resource(struct resource *res, resource_size_t start,
      resource_size_t size);
resource_size_t resource_alignment(struct resource *res);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) resource_size_t resource_size(const struct resource *res)
{
 return res->end - res->start + 1;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long resource_type(const struct resource *res)
{
 return res->flags & 0x00001f00;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool resource_contains(struct resource *r1, struct resource *r2)
{
 if (resource_type(r1) != resource_type(r2))
  return false;
 if (r1->flags & 0x20000000 || r2->flags & 0x20000000)
  return false;
 return r1->start <= r2->start && r1->end >= r2->end;
}
# 192 "include/linux/ioport.h"
extern struct resource * __request_region(struct resource *,
     resource_size_t start,
     resource_size_t n,
     const char *name, int flags);






extern int __check_region(struct resource *, resource_size_t, resource_size_t);
extern void __release_region(struct resource *, resource_size_t,
    resource_size_t);





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int check_region(resource_size_t s,
      resource_size_t n)
{
 return __check_region(&ioport_resource, s, n);
}


struct device;

extern int devm_request_resource(struct device *dev, struct resource *root,
     struct resource *new);
extern void devm_release_resource(struct device *dev, struct resource *new);






extern struct resource * __devm_request_region(struct device *dev,
    struct resource *parent, resource_size_t start,
    resource_size_t n, const char *name);






extern void __devm_release_region(struct device *dev, struct resource *parent,
      resource_size_t start, resource_size_t n);
extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size);
extern int iomem_is_exclusive(u64 addr);

extern int
walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
  void *arg, int (*func)(unsigned long, unsigned long, void *));
extern int
walk_system_ram_res(u64 start, u64 end, void *arg,
      int (*func)(u64, u64, void *));
extern int
walk_iomem_res(char *name, unsigned long flags, u64 start, u64 end, void *arg,
        int (*func)(u64, u64, void *));


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool resource_overlaps(struct resource *r1, struct resource *r2)
{
       return (r1->start <= r2->end && r1->end >= r2->start);
}
# 17 "include/linux/device.h" 2
# 1 "include/linux/kobject.h" 1
# 21 "include/linux/kobject.h"
# 1 "include/linux/sysfs.h" 1
# 15 "include/linux/sysfs.h"
# 1 "include/linux/kernfs.h" 1
# 14 "include/linux/kernfs.h"
# 1 "include/linux/idr.h" 1
# 30 "include/linux/idr.h"
struct idr_layer {
 int prefix;
 int layer;
 struct idr_layer *ary[1<<8];
 int count;
 union {

  unsigned long bitmap[((((1 << 8)) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))];
  struct callback_head callback_head;
 };
};

struct idr {
 struct idr_layer *hint;
 struct idr_layer *top;
 int layers;
 int cur;
 spinlock_t lock;
 int id_free_cnt;
 struct idr_layer *id_free;
};
# 79 "include/linux/idr.h"
void *idr_find_slowpath(struct idr *idp, int id);
void idr_preload(gfp_t gfp_mask);
int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask);
int idr_alloc_cyclic(struct idr *idr, void *ptr, int start, int end, gfp_t gfp_mask);
int idr_for_each(struct idr *idp,
   int (*fn)(int id, void *p, void *data), void *data);
void *idr_get_next(struct idr *idp, int *nextid);
void *idr_replace(struct idr *idp, void *ptr, int id);
void idr_remove(struct idr *idp, int id);
void idr_destroy(struct idr *idp);
void idr_init(struct idr *idp);
bool idr_is_empty(struct idr *idp);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void idr_preload_end(void)
{
 __asm__ __volatile__("": : :"memory");
}
# 115 "include/linux/idr.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *idr_find(struct idr *idr, int id)
{
 struct idr_layer *hint = ({ typeof(*(idr->hint)) *________p1 = (typeof(*(idr->hint)) *)({ typeof((idr->hint)) _________p1 = (*({ __attribute__((unused)) typeof((idr->hint)) __var = ( typeof((idr->hint))) 0; (volatile typeof((idr->hint)) *)&((idr->hint)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(idr->hint)) *)(________p1)); });

 if (hint && (id & ~((1 << 8)-1)) == hint->prefix)
  return ({ typeof(*(hint->ary[id & ((1 << 8)-1)])) *________p1 = (typeof(*(hint->ary[id & ((1 << 8)-1)])) *)({ typeof((hint->ary[id & ((1 << 8)-1)])) _________p1 = (*({ __attribute__((unused)) typeof((hint->ary[id & ((1 << 8)-1)])) __var = ( typeof((hint->ary[id & ((1 << 8)-1)]))) 0; (volatile typeof((hint->ary[id & ((1 << 8)-1)])) *)&((hint->ary[id & ((1 << 8)-1)])); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(hint->ary[id & ((1 << 8)-1)])) *)(________p1)); });

 return idr_find_slowpath(idr, id);
}
# 149 "include/linux/idr.h"
struct ida_bitmap {
 long nr_busy;
 unsigned long bitmap[(128 / sizeof(long) - 1)];
};

struct ida {
 struct idr idr;
 struct ida_bitmap *free_bitmap;
};




int ida_pre_get(struct ida *ida, gfp_t gfp_mask);
int ida_get_new_above(struct ida *ida, int starting_id, int *p_id);
void ida_remove(struct ida *ida, int id);
void ida_destroy(struct ida *ida);
void ida_init(struct ida *ida);

int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
     gfp_t gfp_mask);
void ida_simple_remove(struct ida *ida, unsigned int id);
# 179 "include/linux/idr.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ida_get_new(struct ida *ida, int *p_id)
{
 return ida_get_new_above(ida, 0, p_id);
}

void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) idr_init_cache(void);
# 15 "include/linux/kernfs.h" 2





struct file;
struct dentry;
struct iattr;
struct seq_file;
struct vm_area_struct;
struct super_block;
struct file_system_type;

struct kernfs_open_node;
struct kernfs_iattrs;

enum kernfs_node_type {
 KERNFS_DIR = 0x0001,
 KERNFS_FILE = 0x0002,
 KERNFS_LINK = 0x0004,
};




enum kernfs_node_flag {
 KERNFS_ACTIVATED = 0x0010,
 KERNFS_NS = 0x0020,
 KERNFS_HAS_SEQ_SHOW = 0x0040,
 KERNFS_HAS_MMAP = 0x0080,
 KERNFS_LOCKDEP = 0x0100,
 KERNFS_SUICIDAL = 0x0400,
 KERNFS_SUICIDED = 0x0800,
};


enum kernfs_root_flag {






 KERNFS_ROOT_CREATE_DEACTIVATED = 0x0001,
# 69 "include/linux/kernfs.h"
 KERNFS_ROOT_EXTRA_OPEN_PERM_CHECK = 0x0002,
};


struct kernfs_elem_dir {
 unsigned long subdirs;

 struct rb_root children;





 struct kernfs_root *root;
};

struct kernfs_elem_symlink {
 struct kernfs_node *target_kn;
};

struct kernfs_elem_attr {
 const struct kernfs_ops *ops;
 struct kernfs_open_node *open;
 loff_t size;
 struct kernfs_node *notify_next;
};
# 105 "include/linux/kernfs.h"
struct kernfs_node {
 atomic_t count;
 atomic_t active;
# 117 "include/linux/kernfs.h"
 struct kernfs_node *parent;
 const char *name;

 struct rb_node rb;

 const void *ns;
 unsigned int hash;
 union {
  struct kernfs_elem_dir dir;
  struct kernfs_elem_symlink symlink;
  struct kernfs_elem_attr attr;
 };

 void *priv;

 unsigned short flags;
 umode_t mode;
 unsigned int ino;
 struct kernfs_iattrs *iattr;
};
# 145 "include/linux/kernfs.h"
struct kernfs_syscall_ops {
 int (*remount_fs)(struct kernfs_root *root, int *flags, char *data);
 int (*show_options)(struct seq_file *sf, struct kernfs_root *root);

 int (*mkdir)(struct kernfs_node *parent, const char *name,
       umode_t mode);
 int (*rmdir)(struct kernfs_node *kn);
 int (*rename)(struct kernfs_node *kn, struct kernfs_node *new_parent,
        const char *new_name);
};

struct kernfs_root {

 struct kernfs_node *kn;
 unsigned int flags;


 struct ida ino_ida;
 struct kernfs_syscall_ops *syscall_ops;


 struct list_head supers;

 wait_queue_head_t deactivate_waitq;
};

struct kernfs_open_file {

 struct kernfs_node *kn;
 struct file *file;
 void *priv;


 struct mutex mutex;
 int event;
 struct list_head list;
 char *prealloc_buf;

 size_t atomic_write_len;
 bool mmapped;
 const struct vm_operations_struct *vm_ops;
};

struct kernfs_ops {
# 200 "include/linux/kernfs.h"
 int (*seq_show)(struct seq_file *sf, void *v);

 void *(*seq_start)(struct seq_file *sf, loff_t *ppos);
 void *(*seq_next)(struct seq_file *sf, void *v, loff_t *ppos);
 void (*seq_stop)(struct seq_file *sf, void *v);

 ssize_t (*read)(struct kernfs_open_file *of, char *buf, size_t bytes,
   loff_t off);
# 216 "include/linux/kernfs.h"
 size_t atomic_write_len;






 bool prealloc;
 ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t bytes,
    loff_t off);

 int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma);




};



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
{
 return kn->flags & 0x000f;
}
# 249 "include/linux/kernfs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kernfs_enable_ns(struct kernfs_node *kn)
{
 ({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(kernfs_type(kn) != KERNFS_DIR); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kernfs.h", 251); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); });
 ({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(!((&kn->dir.children)->rb_node == ((void *)0))); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kernfs.h", 252); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); });
 kn->flags |= KERNFS_NS;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kernfs_ns_enabled(struct kernfs_node *kn)
{
 return kn->flags & KERNFS_NS;
}

int kernfs_name(struct kernfs_node *kn, char *buf, size_t buflen);
char * __attribute__((warn_unused_result)) kernfs_path(struct kernfs_node *kn, char *buf,
    size_t buflen);
void pr_cont_kernfs_name(struct kernfs_node *kn);
void pr_cont_kernfs_path(struct kernfs_node *kn);
struct kernfs_node *kernfs_get_parent(struct kernfs_node *kn);
struct kernfs_node *kernfs_find_and_get_ns(struct kernfs_node *parent,
        const char *name, const void *ns);
void kernfs_get(struct kernfs_node *kn);
void kernfs_put(struct kernfs_node *kn);

struct kernfs_node *kernfs_node_from_dentry(struct dentry *dentry);
struct kernfs_root *kernfs_root_from_sb(struct super_block *sb);

struct kernfs_root *kernfs_create_root(struct kernfs_syscall_ops *scops,
           unsigned int flags, void *priv);
void kernfs_destroy_root(struct kernfs_root *root);

struct kernfs_node *kernfs_create_dir_ns(struct kernfs_node *parent,
      const char *name, umode_t mode,
      void *priv, const void *ns);
struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
      const char *name,
      umode_t mode, loff_t size,
      const struct kernfs_ops *ops,
      void *priv, const void *ns,
      struct lock_class_key *key);
struct kernfs_node *kernfs_create_link(struct kernfs_node *parent,
           const char *name,
           struct kernfs_node *target);
void kernfs_activate(struct kernfs_node *kn);
void kernfs_remove(struct kernfs_node *kn);
void kernfs_break_active_protection(struct kernfs_node *kn);
void kernfs_unbreak_active_protection(struct kernfs_node *kn);
bool kernfs_remove_self(struct kernfs_node *kn);
int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name,
        const void *ns);
int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent,
       const char *new_name, const void *new_ns);
int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr);
void kernfs_notify(struct kernfs_node *kn);

const void *kernfs_super_ns(struct super_block *sb);
struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags,
          struct kernfs_root *root, unsigned long magic,
          bool *new_sb_created, const void *ns);
void kernfs_kill_sb(struct super_block *sb);
struct super_block *kernfs_pin_sb(struct kernfs_root *root, const void *ns);

void kernfs_init(void);
# 415 "include/linux/kernfs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *
kernfs_find_and_get(struct kernfs_node *kn, const char *name)
{
 return kernfs_find_and_get_ns(kn, name, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *
kernfs_create_dir(struct kernfs_node *parent, const char *name, umode_t mode,
    void *priv)
{
 return kernfs_create_dir_ns(parent, name, mode, priv, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *
kernfs_create_file_ns(struct kernfs_node *parent, const char *name,
        umode_t mode, loff_t size, const struct kernfs_ops *ops,
        void *priv, const void *ns)
{
 struct lock_class_key *key = ((void *)0);




 return __kernfs_create_file(parent, name, mode, size, ops, priv, ns,
        key);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *
kernfs_create_file(struct kernfs_node *parent, const char *name, umode_t mode,
     loff_t size, const struct kernfs_ops *ops, void *priv)
{
 return kernfs_create_file_ns(parent, name, mode, size, ops, priv, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kernfs_remove_by_name(struct kernfs_node *parent,
     const char *name)
{
 return kernfs_remove_by_name_ns(parent, name, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kernfs_rename(struct kernfs_node *kn,
    struct kernfs_node *new_parent,
    const char *new_name)
{
 return kernfs_rename_ns(kn, new_parent, new_name, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *
kernfs_mount(struct file_system_type *fs_type, int flags,
  struct kernfs_root *root, unsigned long magic,
  bool *new_sb_created)
{
 return kernfs_mount_ns(fs_type, flags, root,
    magic, new_sb_created, ((void *)0));
}
# 16 "include/linux/sysfs.h" 2




# 1 "include/linux/kobject_ns.h" 1
# 20 "include/linux/kobject_ns.h"
struct sock;
struct kobject;





enum kobj_ns_type {
 KOBJ_NS_TYPE_NONE = 0,
 KOBJ_NS_TYPE_NET,
 KOBJ_NS_TYPES
};
# 40 "include/linux/kobject_ns.h"
struct kobj_ns_type_operations {
 enum kobj_ns_type type;
 bool (*current_may_mount)(void);
 void *(*grab_current_ns)(void);
 const void *(*netlink_ns)(struct sock *sk);
 const void *(*initial_ns)(void);
 void (*drop_ns)(void *);
};

int kobj_ns_type_register(const struct kobj_ns_type_operations *ops);
int kobj_ns_type_registered(enum kobj_ns_type type);
const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent);
const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj);

bool kobj_ns_current_may_mount(enum kobj_ns_type type);
void *kobj_ns_grab_current(enum kobj_ns_type type);
const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk);
const void *kobj_ns_initial(enum kobj_ns_type type);
void kobj_ns_drop(enum kobj_ns_type type, void *ns);
# 21 "include/linux/sysfs.h" 2



struct kobject;
struct module;
struct bin_attribute;
enum kobj_ns_type;

struct attribute {
 const char *name;
 umode_t mode;





};
# 60 "include/linux/sysfs.h"
struct attribute_group {
 const char *name;
 umode_t (*is_visible)(struct kobject *,
           struct attribute *, int);
 struct attribute **attrs;
 struct bin_attribute **bin_attrs;
};
# 127 "include/linux/sysfs.h"
struct file;
struct vm_area_struct;

struct bin_attribute {
 struct attribute attr;
 size_t size;
 void *private;
 ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *,
   char *, loff_t, size_t);
 ssize_t (*write)(struct file *, struct kobject *, struct bin_attribute *,
    char *, loff_t, size_t);
 int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr,
      struct vm_area_struct *vma);
};
# 184 "include/linux/sysfs.h"
struct sysfs_ops {
 ssize_t (*show)(struct kobject *, struct attribute *, char *);
 ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t);
};



int __attribute__((warn_unused_result)) sysfs_create_dir_ns(struct kobject *kobj, const void *ns);
void sysfs_remove_dir(struct kobject *kobj);
int __attribute__((warn_unused_result)) sysfs_rename_dir_ns(struct kobject *kobj, const char *new_name,
         const void *new_ns);
int __attribute__((warn_unused_result)) sysfs_move_dir_ns(struct kobject *kobj,
       struct kobject *new_parent_kobj,
       const void *new_ns);

int __attribute__((warn_unused_result)) sysfs_create_file_ns(struct kobject *kobj,
          const struct attribute *attr,
          const void *ns);
int __attribute__((warn_unused_result)) sysfs_create_files(struct kobject *kobj,
       const struct attribute **attr);
int __attribute__((warn_unused_result)) sysfs_chmod_file(struct kobject *kobj,
      const struct attribute *attr, umode_t mode);
void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr,
     const void *ns);
bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr);
void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr);

int __attribute__((warn_unused_result)) sysfs_create_bin_file(struct kobject *kobj,
           const struct bin_attribute *attr);
void sysfs_remove_bin_file(struct kobject *kobj,
      const struct bin_attribute *attr);

int __attribute__((warn_unused_result)) sysfs_create_link(struct kobject *kobj, struct kobject *target,
       const char *name);
int __attribute__((warn_unused_result)) sysfs_create_link_nowarn(struct kobject *kobj,
       struct kobject *target,
       const char *name);
void sysfs_remove_link(struct kobject *kobj, const char *name);

int sysfs_rename_link_ns(struct kobject *kobj, struct kobject *target,
    const char *old_name, const char *new_name,
    const void *new_ns);

void sysfs_delete_link(struct kobject *dir, struct kobject *targ,
   const char *name);

int __attribute__((warn_unused_result)) sysfs_create_group(struct kobject *kobj,
        const struct attribute_group *grp);
int __attribute__((warn_unused_result)) sysfs_create_groups(struct kobject *kobj,
         const struct attribute_group **groups);
int sysfs_update_group(struct kobject *kobj,
         const struct attribute_group *grp);
void sysfs_remove_group(struct kobject *kobj,
   const struct attribute_group *grp);
void sysfs_remove_groups(struct kobject *kobj,
    const struct attribute_group **groups);
int sysfs_add_file_to_group(struct kobject *kobj,
   const struct attribute *attr, const char *group);
void sysfs_remove_file_from_group(struct kobject *kobj,
   const struct attribute *attr, const char *group);
int sysfs_merge_group(struct kobject *kobj,
         const struct attribute_group *grp);
void sysfs_unmerge_group(struct kobject *kobj,
         const struct attribute_group *grp);
int sysfs_add_link_to_group(struct kobject *kobj, const char *group_name,
       struct kobject *target, const char *link_name);
void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name,
      const char *link_name);

void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr);

int __attribute__((warn_unused_result)) sysfs_init(void);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sysfs_enable_ns(struct kernfs_node *kn)
{
 return kernfs_enable_ns(kn);
}
# 440 "include/linux/sysfs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) sysfs_create_file(struct kobject *kobj,
       const struct attribute *attr)
{
 return sysfs_create_file_ns(kobj, attr, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sysfs_remove_file(struct kobject *kobj,
         const struct attribute *attr)
{
 sysfs_remove_file_ns(kobj, attr, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sysfs_rename_link(struct kobject *kobj, struct kobject *target,
        const char *old_name, const char *new_name)
{
 return sysfs_rename_link_ns(kobj, target, old_name, new_name, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sysfs_notify_dirent(struct kernfs_node *kn)
{
 kernfs_notify(kn);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *sysfs_get_dirent(struct kernfs_node *parent,
         const unsigned char *name)
{
 return kernfs_find_and_get(parent, name);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *sysfs_get(struct kernfs_node *kn)
{
 kernfs_get(kn);
 return kn;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sysfs_put(struct kernfs_node *kn)
{
 kernfs_put(kn);
}
# 22 "include/linux/kobject.h" 2
# 37 "include/linux/kobject.h"
extern char uevent_helper[];



extern u64 uevent_seqnum;
# 53 "include/linux/kobject.h"
enum kobject_action {
 KOBJ_ADD,
 KOBJ_REMOVE,
 KOBJ_CHANGE,
 KOBJ_MOVE,
 KOBJ_ONLINE,
 KOBJ_OFFLINE,
 KOBJ_MAX
};

struct kobject {
 const char *name;
 struct list_head entry;
 struct kobject *parent;
 struct kset *kset;
 struct kobj_type *ktype;
 struct kernfs_node *sd;
 struct kref kref;



 unsigned int state_initialized:1;
 unsigned int state_in_sysfs:1;
 unsigned int state_add_uevent_sent:1;
 unsigned int state_remove_uevent_sent:1;
 unsigned int uevent_suppress:1;
};

extern __attribute__((format(printf, 2, 3)))
int kobject_set_name(struct kobject *kobj, const char *name, ...);
extern int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
      va_list vargs);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *kobject_name(const struct kobject *kobj)
{
 return kobj->name;
}

extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype);
extern __attribute__((format(printf, 3, 4))) __attribute__((warn_unused_result))
int kobject_add(struct kobject *kobj, struct kobject *parent,
  const char *fmt, ...);
extern __attribute__((format(printf, 4, 5))) __attribute__((warn_unused_result))
int kobject_init_and_add(struct kobject *kobj,
    struct kobj_type *ktype, struct kobject *parent,
    const char *fmt, ...);

extern void kobject_del(struct kobject *kobj);

extern struct kobject * __attribute__((warn_unused_result)) kobject_create(void);
extern struct kobject * __attribute__((warn_unused_result)) kobject_create_and_add(const char *name,
      struct kobject *parent);

extern int __attribute__((warn_unused_result)) kobject_rename(struct kobject *, const char *new_name);
extern int __attribute__((warn_unused_result)) kobject_move(struct kobject *, struct kobject *);

extern struct kobject *kobject_get(struct kobject *kobj);
extern void kobject_put(struct kobject *kobj);

extern const void *kobject_namespace(struct kobject *kobj);
extern char *kobject_get_path(struct kobject *kobj, gfp_t flag);

struct kobj_type {
 void (*release)(struct kobject *kobj);
 const struct sysfs_ops *sysfs_ops;
 struct attribute **default_attrs;
 const struct kobj_ns_type_operations *(*child_ns_type)(struct kobject *kobj);
 const void *(*namespace)(struct kobject *kobj);
};

struct kobj_uevent_env {
 char *argv[3];
 char *envp[32];
 int envp_idx;
 char buf[2048];
 int buflen;
};

struct kset_uevent_ops {
 int (* const filter)(struct kset *kset, struct kobject *kobj);
 const char *(* const name)(struct kset *kset, struct kobject *kobj);
 int (* const uevent)(struct kset *kset, struct kobject *kobj,
        struct kobj_uevent_env *env);
};

struct kobj_attribute {
 struct attribute attr;
 ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr,
   char *buf);
 ssize_t (*store)(struct kobject *kobj, struct kobj_attribute *attr,
    const char *buf, size_t count);
};

extern const struct sysfs_ops kobj_sysfs_ops;

struct sock;
# 167 "include/linux/kobject.h"
struct kset {
 struct list_head list;
 spinlock_t list_lock;
 struct kobject kobj;
 const struct kset_uevent_ops *uevent_ops;
};

extern void kset_init(struct kset *kset);
extern int __attribute__((warn_unused_result)) kset_register(struct kset *kset);
extern void kset_unregister(struct kset *kset);
extern struct kset * __attribute__((warn_unused_result)) kset_create_and_add(const char *name,
      const struct kset_uevent_ops *u,
      struct kobject *parent_kobj);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kset *to_kset(struct kobject *kobj)
{
 return kobj ? ({ const typeof( ((struct kset *)0)->kobj ) *__mptr = (kobj); (struct kset *)( (char *)__mptr - __builtin_offsetof(struct kset,kobj) );}) : ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kset *kset_get(struct kset *k)
{
 return k ? to_kset(kobject_get(&k->kobj)) : ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kset_put(struct kset *k)
{
 kobject_put(&k->kobj);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kobj_type *get_ktype(struct kobject *kobj)
{
 return kobj->ktype;
}

extern struct kobject *kset_find_obj(struct kset *, const char *);


extern struct kobject *kernel_kobj;

extern struct kobject *mm_kobj;

extern struct kobject *hypervisor_kobj;

extern struct kobject *power_kobj;

extern struct kobject *firmware_kobj;

int kobject_uevent(struct kobject *kobj, enum kobject_action action);
int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
   char *envp[]);

__attribute__((format(printf, 2, 3)))
int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...);

int kobject_action_type(const char *buf, size_t count,
   enum kobject_action *type);
# 18 "include/linux/device.h" 2
# 1 "include/linux/klist.h" 1
# 19 "include/linux/klist.h"
struct klist_node;
struct klist {
 spinlock_t k_lock;
 struct list_head k_list;
 void (*get)(struct klist_node *);
 void (*put)(struct klist_node *);
} __attribute__ ((aligned (sizeof(void *))));
# 36 "include/linux/klist.h"
extern void klist_init(struct klist *k, void (*get)(struct klist_node *),
         void (*put)(struct klist_node *));

struct klist_node {
 void *n_klist;
 struct list_head n_node;
 struct kref n_ref;
};

extern void klist_add_tail(struct klist_node *n, struct klist *k);
extern void klist_add_head(struct klist_node *n, struct klist *k);
extern void klist_add_behind(struct klist_node *n, struct klist_node *pos);
extern void klist_add_before(struct klist_node *n, struct klist_node *pos);

extern void klist_del(struct klist_node *n);
extern void klist_remove(struct klist_node *n);

extern int klist_node_attached(struct klist_node *n);


struct klist_iter {
 struct klist *i_klist;
 struct klist_node *i_cur;
};


extern void klist_iter_init(struct klist *k, struct klist_iter *i);
extern void klist_iter_init_node(struct klist *k, struct klist_iter *i,
     struct klist_node *n);
extern void klist_iter_exit(struct klist_iter *i);
extern struct klist_node *klist_next(struct klist_iter *i);
# 19 "include/linux/device.h" 2





# 1 "include/linux/pinctrl/devinfo.h" 1
# 43 "include/linux/pinctrl/devinfo.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pinctrl_bind_pins(struct device *dev)
{
 return 0;
}
# 25 "include/linux/device.h" 2
# 1 "include/linux/pm.h" 1
# 34 "include/linux/pm.h"
extern void (*pm_power_off)(void);
extern void (*pm_power_off_prepare)(void);

struct device;




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_vt_switch_required(struct device *dev, bool required)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_vt_switch_unregister(struct device *dev)
{
}






struct device;







typedef struct pm_message {
 int event;
} pm_message_t;
# 295 "include/linux/pm.h"
struct dev_pm_ops {
 int (*prepare)(struct device *dev);
 void (*complete)(struct device *dev);
 int (*suspend)(struct device *dev);
 int (*resume)(struct device *dev);
 int (*freeze)(struct device *dev);
 int (*thaw)(struct device *dev);
 int (*poweroff)(struct device *dev);
 int (*restore)(struct device *dev);
 int (*suspend_late)(struct device *dev);
 int (*resume_early)(struct device *dev);
 int (*freeze_late)(struct device *dev);
 int (*thaw_early)(struct device *dev);
 int (*poweroff_late)(struct device *dev);
 int (*restore_early)(struct device *dev);
 int (*suspend_noirq)(struct device *dev);
 int (*resume_noirq)(struct device *dev);
 int (*freeze_noirq)(struct device *dev);
 int (*thaw_noirq)(struct device *dev);
 int (*poweroff_noirq)(struct device *dev);
 int (*restore_noirq)(struct device *dev);
 int (*runtime_suspend)(struct device *dev);
 int (*runtime_resume)(struct device *dev);
 int (*runtime_idle)(struct device *dev);
};
# 501 "include/linux/pm.h"
enum rpm_status {
 RPM_ACTIVE = 0,
 RPM_RESUMING,
 RPM_SUSPENDED,
 RPM_SUSPENDING,
};
# 523 "include/linux/pm.h"
enum rpm_request {
 RPM_REQ_NONE = 0,
 RPM_REQ_IDLE,
 RPM_REQ_SUSPEND,
 RPM_REQ_AUTOSUSPEND,
 RPM_REQ_RESUME,
};

struct wakeup_source;
struct pm_domain_data;

struct pm_subsys_data {
 spinlock_t lock;
 unsigned int refcount;






};

struct dev_pm_info {
 pm_message_t power_state;
 unsigned int can_wakeup:1;
 unsigned int async_suspend:1;
 bool is_prepared:1;
 bool is_suspended:1;
 bool is_noirq_suspended:1;
 bool is_late_suspended:1;
 bool ignore_children:1;
 bool early_init:1;
 bool direct_complete:1;
 spinlock_t lock;







 unsigned int should_wakeup:1;
# 593 "include/linux/pm.h"
 struct pm_subsys_data *subsys_data;
 void (*set_latency_tolerance)(struct device *, s32);
 struct dev_pm_qos *qos;
};

extern void update_pm_runtime_accounting(struct device *dev);
extern int dev_pm_get_subsys_data(struct device *dev);
extern void dev_pm_put_subsys_data(struct device *dev);






struct dev_pm_domain {
 struct dev_pm_ops ops;
 void (*detach)(struct device *dev, bool power_off);
};
# 719 "include/linux/pm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dpm_suspend_start(pm_message_t state)
{
 return 0;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_pm_wait_for_dev(struct device *a, struct device *b)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *))
{
}
# 758 "include/linux/pm.h"
enum dpm_order {
 DPM_ORDER_NONE,
 DPM_ORDER_DEV_AFTER_PARENT,
 DPM_ORDER_PARENT_BEFORE_DEV,
 DPM_ORDER_DEV_LAST,
};
# 26 "include/linux/device.h" 2

# 1 "include/linux/ratelimit.h" 1
# 10 "include/linux/ratelimit.h"
struct ratelimit_state {
 raw_spinlock_t lock;

 int interval;
 int burst;
 int printed;
 int missed;
 unsigned long begin;
};
# 34 "include/linux/ratelimit.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ratelimit_state_init(struct ratelimit_state *rs,
     int interval, int burst)
{
 do { *(&rs->lock) = (raw_spinlock_t) { .raw_lock = { 0 }, }; } while (0);
 rs->interval = interval;
 rs->burst = burst;
 rs->printed = 0;
 rs->missed = 0;
 rs->begin = 0;
}

extern struct ratelimit_state printk_ratelimit_state;

extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
# 28 "include/linux/device.h" 2


# 1 "./arch/sparc/include/asm/device.h" 1
# 9 "./arch/sparc/include/asm/device.h"
# 1 "./arch/sparc/include/asm/openprom.h" 1
# 14 "./arch/sparc/include/asm/openprom.h"
# 1 "include/linux/of.h" 1
# 22 "include/linux/of.h"
# 1 "include/linux/mod_devicetable.h" 1
# 12 "include/linux/mod_devicetable.h"
# 1 "include/linux/uuid.h" 1
# 23 "include/linux/uuid.h"
# 1 "include/uapi/linux/uuid.h" 1
# 27 "include/uapi/linux/uuid.h"
typedef struct {
 __u8 b[16];
} uuid_le;

typedef struct {
 __u8 b[16];
} uuid_be;
# 24 "include/linux/uuid.h" 2


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int uuid_le_cmp(const uuid_le u1, const uuid_le u2)
{
 return memcmp(&u1, &u2, sizeof(uuid_le));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int uuid_be_cmp(const uuid_be u1, const uuid_be u2)
{
 return memcmp(&u1, &u2, sizeof(uuid_be));
}

extern void uuid_le_gen(uuid_le *u);
extern void uuid_be_gen(uuid_be *u);
# 13 "include/linux/mod_devicetable.h" 2
typedef unsigned long kernel_ulong_t;




struct pci_device_id {
 __u32 vendor, device;
 __u32 subvendor, subdevice;
 __u32 class, class_mask;
 kernel_ulong_t driver_data;
};







struct ieee1394_device_id {
 __u32 match_flags;
 __u32 vendor_id;
 __u32 model_id;
 __u32 specifier_id;
 __u32 version;
 kernel_ulong_t driver_data;
};
# 101 "include/linux/mod_devicetable.h"
struct usb_device_id {

 __u16 match_flags;


 __u16 idVendor;
 __u16 idProduct;
 __u16 bcdDevice_lo;
 __u16 bcdDevice_hi;


 __u8 bDeviceClass;
 __u8 bDeviceSubClass;
 __u8 bDeviceProtocol;


 __u8 bInterfaceClass;
 __u8 bInterfaceSubClass;
 __u8 bInterfaceProtocol;


 __u8 bInterfaceNumber;


 kernel_ulong_t driver_info
  __attribute__((aligned(sizeof(kernel_ulong_t))));
};
# 146 "include/linux/mod_devicetable.h"
struct hid_device_id {
 __u16 bus;
 __u16 group;
 __u32 vendor;
 __u32 product;
 kernel_ulong_t driver_data;
};


struct ccw_device_id {
 __u16 match_flags;

 __u16 cu_type;
 __u16 dev_type;
 __u8 cu_model;
 __u8 dev_model;

 kernel_ulong_t driver_info;
};







struct ap_device_id {
 __u16 match_flags;
 __u8 dev_type;
 kernel_ulong_t driver_info;
};




struct css_device_id {
 __u8 match_flags;
 __u8 type;
 kernel_ulong_t driver_data;
};



struct acpi_device_id {
 __u8 id[9];
 kernel_ulong_t driver_data;
};




struct pnp_device_id {
 __u8 id[8];
 kernel_ulong_t driver_data;
};

struct pnp_card_device_id {
 __u8 id[8];
 kernel_ulong_t driver_data;
 struct {
  __u8 id[8];
 } devs[8];
};




struct serio_device_id {
 __u8 type;
 __u8 extra;
 __u8 id;
 __u8 proto;
};




struct of_device_id {
 char name[32];
 char type[32];
 char compatible[128];
 const void *data;
};


struct vio_device_id {
 char type[32];
 char compat[32];
};



struct pcmcia_device_id {
 __u16 match_flags;

 __u16 manf_id;
 __u16 card_id;

 __u8 func_id;


 __u8 function;


 __u8 device_no;

 __u32 prod_id_hash[4];


 const char * prod_id[4];


 kernel_ulong_t driver_info;
 char * cisfile;
};
# 301 "include/linux/mod_devicetable.h"
struct input_device_id {

 kernel_ulong_t flags;

 __u16 bustype;
 __u16 vendor;
 __u16 product;
 __u16 version;

 kernel_ulong_t evbit[0x1f / 64 + 1];
 kernel_ulong_t keybit[0x2ff / 64 + 1];
 kernel_ulong_t relbit[0x0f / 64 + 1];
 kernel_ulong_t absbit[0x3f / 64 + 1];
 kernel_ulong_t mscbit[0x07 / 64 + 1];
 kernel_ulong_t ledbit[0x0f / 64 + 1];
 kernel_ulong_t sndbit[0x07 / 64 + 1];
 kernel_ulong_t ffbit[0x7f / 64 + 1];
 kernel_ulong_t swbit[0x0f / 64 + 1];

 kernel_ulong_t driver_info;
};






struct eisa_device_id {
 char sig[8];
 kernel_ulong_t driver_data;
};



struct parisc_device_id {
 __u8 hw_type;
 __u8 hversion_rev;
 __u16 hversion;
 __u32 sversion;
};
# 351 "include/linux/mod_devicetable.h"
struct sdio_device_id {
 __u8 class;
 __u16 vendor;
 __u16 device;
 kernel_ulong_t driver_data;
};


struct ssb_device_id {
 __u16 vendor;
 __u16 coreid;
 __u8 revision;
 __u8 __pad;
} __attribute__((packed, aligned(2)));
# 373 "include/linux/mod_devicetable.h"
struct bcma_device_id {
 __u16 manuf;
 __u16 id;
 __u8 rev;
 __u8 class;
} __attribute__((packed,aligned(2)));
# 387 "include/linux/mod_devicetable.h"
struct virtio_device_id {
 __u32 device;
 __u32 vendor;
};





struct hv_vmbus_device_id {
 __u8 guid[16];
 kernel_ulong_t driver_data;
};






struct rpmsg_device_id {
 char name[32];
};






struct i2c_device_id {
 char name[20];
 kernel_ulong_t driver_data;
};






struct spi_device_id {
 char name[32];
 kernel_ulong_t driver_data;
};




struct spmi_device_id {
 char name[32];
 kernel_ulong_t driver_data;
};


enum dmi_field {
 DMI_NONE,
 DMI_BIOS_VENDOR,
 DMI_BIOS_VERSION,
 DMI_BIOS_DATE,
 DMI_SYS_VENDOR,
 DMI_PRODUCT_NAME,
 DMI_PRODUCT_VERSION,
 DMI_PRODUCT_SERIAL,
 DMI_PRODUCT_UUID,
 DMI_BOARD_VENDOR,
 DMI_BOARD_NAME,
 DMI_BOARD_VERSION,
 DMI_BOARD_SERIAL,
 DMI_BOARD_ASSET_TAG,
 DMI_CHASSIS_VENDOR,
 DMI_CHASSIS_TYPE,
 DMI_CHASSIS_VERSION,
 DMI_CHASSIS_SERIAL,
 DMI_CHASSIS_ASSET_TAG,
 DMI_STRING_MAX,
};

struct dmi_strmatch {
 unsigned char slot:7;
 unsigned char exact_match:1;
 char substr[79];
};

struct dmi_system_id {
 int (*callback)(const struct dmi_system_id *);
 const char *ident;
 struct dmi_strmatch matches[4];
 void *driver_data;
};
# 488 "include/linux/mod_devicetable.h"
struct platform_device_id {
 char name[20];
 kernel_ulong_t driver_data;
};
# 514 "include/linux/mod_devicetable.h"
struct mdio_device_id {
 __u32 phy_id;
 __u32 phy_id_mask;
};

struct zorro_device_id {
 __u32 id;
 kernel_ulong_t driver_data;
};






struct isapnp_device_id {
 unsigned short card_vendor, card_device;
 unsigned short vendor, function;
 kernel_ulong_t driver_data;
};
# 543 "include/linux/mod_devicetable.h"
struct amba_id {
 unsigned int id;
 unsigned int mask;
 void *data;
};
# 559 "include/linux/mod_devicetable.h"
struct x86_cpu_id {
 __u16 vendor;
 __u16 family;
 __u16 model;
 __u16 feature;
 kernel_ulong_t driver_data;
};
# 580 "include/linux/mod_devicetable.h"
struct cpu_feature {
 __u16 feature;
};



struct ipack_device_id {
 __u8 format;
 __u32 vendor;
 __u32 device;
};




struct mei_cl_device_id {
 char name[32];
 kernel_ulong_t driver_info;
};
# 614 "include/linux/mod_devicetable.h"
struct rio_device_id {
 __u16 did, vid;
 __u16 asm_did, asm_vid;
};

struct mcb_device_id {
 __u16 device;
 kernel_ulong_t driver_data;
};
# 23 "include/linux/of.h" 2



# 1 "include/linux/property.h" 1
# 18 "include/linux/property.h"
struct device;

enum dev_prop_type {
 DEV_PROP_U8,
 DEV_PROP_U16,
 DEV_PROP_U32,
 DEV_PROP_U64,
 DEV_PROP_STRING,
 DEV_PROP_MAX,
};

bool device_property_present(struct device *dev, const char *propname);
int device_property_read_u8_array(struct device *dev, const char *propname,
      u8 *val, size_t nval);
int device_property_read_u16_array(struct device *dev, const char *propname,
       u16 *val, size_t nval);
int device_property_read_u32_array(struct device *dev, const char *propname,
       u32 *val, size_t nval);
int device_property_read_u64_array(struct device *dev, const char *propname,
       u64 *val, size_t nval);
int device_property_read_string_array(struct device *dev, const char *propname,
          const char **val, size_t nval);
int device_property_read_string(struct device *dev, const char *propname,
    const char **val);

enum fwnode_type {
 FWNODE_INVALID = 0,
 FWNODE_OF,
 FWNODE_ACPI,
};

struct fwnode_handle {
 enum fwnode_type type;
};

bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname);
int fwnode_property_read_u8_array(struct fwnode_handle *fwnode,
      const char *propname, u8 *val,
      size_t nval);
int fwnode_property_read_u16_array(struct fwnode_handle *fwnode,
       const char *propname, u16 *val,
       size_t nval);
int fwnode_property_read_u32_array(struct fwnode_handle *fwnode,
       const char *propname, u32 *val,
       size_t nval);
int fwnode_property_read_u64_array(struct fwnode_handle *fwnode,
       const char *propname, u64 *val,
       size_t nval);
int fwnode_property_read_string_array(struct fwnode_handle *fwnode,
          const char *propname, const char **val,
          size_t nval);
int fwnode_property_read_string(struct fwnode_handle *fwnode,
    const char *propname, const char **val);

struct fwnode_handle *device_get_next_child_node(struct device *dev,
       struct fwnode_handle *child);





void fwnode_handle_put(struct fwnode_handle *fwnode);

unsigned int device_get_child_node_count(struct device *dev);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_property_read_bool(struct device *dev,
          const char *propname)
{
 return device_property_present(dev, propname);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_property_read_u8(struct device *dev,
       const char *propname, u8 *val)
{
 return device_property_read_u8_array(dev, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_property_read_u16(struct device *dev,
        const char *propname, u16 *val)
{
 return device_property_read_u16_array(dev, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_property_read_u32(struct device *dev,
        const char *propname, u32 *val)
{
 return device_property_read_u32_array(dev, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_property_read_u64(struct device *dev,
        const char *propname, u64 *val)
{
 return device_property_read_u64_array(dev, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool fwnode_property_read_bool(struct fwnode_handle *fwnode,
          const char *propname)
{
 return fwnode_property_present(fwnode, propname);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fwnode_property_read_u8(struct fwnode_handle *fwnode,
       const char *propname, u8 *val)
{
 return fwnode_property_read_u8_array(fwnode, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fwnode_property_read_u16(struct fwnode_handle *fwnode,
        const char *propname, u16 *val)
{
 return fwnode_property_read_u16_array(fwnode, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fwnode_property_read_u32(struct fwnode_handle *fwnode,
        const char *propname, u32 *val)
{
 return fwnode_property_read_u32_array(fwnode, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fwnode_property_read_u64(struct fwnode_handle *fwnode,
        const char *propname, u64 *val)
{
 return fwnode_property_read_u64_array(fwnode, propname, val, 1);
}
# 27 "include/linux/of.h" 2





typedef u32 phandle;
typedef u32 ihandle;

struct property {
 char *name;
 int length;
 void *value;
 struct property *next;
 unsigned long _flags;
 unsigned int unique_id;
 struct bin_attribute attr;
};


struct of_irq_controller;


struct device_node {
 const char *name;
 const char *type;
 phandle phandle;
 const char *full_name;
 struct fwnode_handle fwnode;

 struct property *properties;
 struct property *deadprops;
 struct device_node *parent;
 struct device_node *child;
 struct device_node *sibling;
 struct kobject kobj;
 unsigned long _flags;
 void *data;

 const char *path_component_name;
 unsigned int unique_id;
 struct of_irq_controller *irq_trans;

};


struct of_phandle_args {
 struct device_node *np;
 int args_count;
 uint32_t args[16];
};

struct of_reconfig_data {
 struct device_node *dn;
 struct property *prop;
 struct property *old_prop;
};


extern struct kobj_type of_node_ktype;
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_node_init(struct device_node *node)
{
 kobject_init(&node->kobj, &of_node_ktype);
 node->fwnode.type = FWNODE_OF;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_node_is_initialized(struct device_node *node)
{
 return node && node->kobj.state_initialized;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_node_is_attached(struct device_node *node)
{
 return node && node->kobj.state_in_sysfs;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *of_node_get(struct device_node *node)
{
 return node;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_node_put(struct device_node *node) { }



extern struct device_node *of_root;
extern struct device_node *of_chosen;
extern struct device_node *of_aliases;
extern struct device_node *of_stdout;
extern raw_spinlock_t devtree_lock;


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_of_node(struct fwnode_handle *fwnode)
{
 return fwnode && fwnode->type == FWNODE_OF;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *of_node(struct fwnode_handle *fwnode)
{
 return fwnode ? ({ const typeof( ((struct device_node *)0)->fwnode ) *__mptr = (fwnode); (struct device_node *)( (char *)__mptr - __builtin_offsetof(struct device_node,fwnode) );}) : ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool of_have_populated_dt(void)
{
 return of_root != ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool of_node_is_root(const struct device_node *node)
{
 return node && (node->parent == ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_node_check_flag(struct device_node *n, unsigned long flag)
{
 return test_bit(flag, &n->_flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_node_test_and_set_flag(struct device_node *n,
         unsigned long flag)
{
 return test_and_set_bit(flag, &n->_flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_node_set_flag(struct device_node *n, unsigned long flag)
{
 set_bit(flag, &n->_flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_node_clear_flag(struct device_node *n, unsigned long flag)
{
 clear_bit(flag, &n->_flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_check_flag(struct property *p, unsigned long flag)
{
 return test_bit(flag, &p->_flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_property_set_flag(struct property *p, unsigned long flag)
{
 set_bit(flag, &p->_flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_property_clear_flag(struct property *p, unsigned long flag)
{
 clear_bit(flag, &p->_flags);
}

extern struct device_node *__of_find_all_nodes(struct device_node *prev);
extern struct device_node *of_find_all_nodes(struct device_node *prev);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 of_read_number(const __be32 *cell, int size)
{
 u64 r = 0;
 while (size--)
  r = (r << 32) | (( __u32)(__be32)(*(cell++)));
 return r;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long of_read_ulong(const __be32 *cell, int size)
{

 return of_read_number(cell, size);
}


# 1 "./arch/sparc/include/asm/prom.h" 1
# 1 "include/linux/of.h" 1
# 2 "./arch/sparc/include/asm/prom.h" 2
# 21 "./arch/sparc/include/asm/prom.h"
# 1 "include/linux/of_pdt.h" 1
# 17 "include/linux/of_pdt.h"
struct of_pdt_ops {




 int (*nextprop)(phandle node, char *prev, char *buf);


 int (*getproplen)(phandle node, const char *prop);
 int (*getproperty)(phandle node, const char *prop, char *buf,
   int bufsize);


 phandle (*getchild)(phandle parent);
 phandle (*getsibling)(phandle node);


 int (*pkg2path)(phandle node, char *buf, const int buflen, int *len);
};

extern void *prom_early_alloc(unsigned long size);


extern void of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops);

extern void (*of_pdt_build_more)(struct device_node *dp);
# 22 "./arch/sparc/include/asm/prom.h" 2
# 1 "include/linux/proc_fs.h" 1
# 10 "include/linux/proc_fs.h"
struct proc_dir_entry;



extern void proc_root_init(void);
extern void proc_flush_task(struct task_struct *);

extern struct proc_dir_entry *proc_symlink(const char *,
  struct proc_dir_entry *, const char *);
extern struct proc_dir_entry *proc_mkdir(const char *, struct proc_dir_entry *);
extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t,
           struct proc_dir_entry *, void *);
extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t,
           struct proc_dir_entry *);

extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
            struct proc_dir_entry *,
            const struct file_operations *,
            void *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct proc_dir_entry *proc_create(
 const char *name, umode_t mode, struct proc_dir_entry *parent,
 const struct file_operations *proc_fops)
{
 return proc_create_data(name, mode, parent, proc_fops, ((void *)0));
}

extern void proc_set_size(struct proc_dir_entry *, loff_t);
extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
extern void *PDE_DATA(const struct inode *);
extern void *proc_get_parent_data(const struct inode *);
extern void proc_remove(struct proc_dir_entry *);
extern void remove_proc_entry(const char *, struct proc_dir_entry *);
extern int remove_proc_subtree(const char *, struct proc_dir_entry *);
# 77 "include/linux/proc_fs.h"
struct net;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct proc_dir_entry *proc_net_mkdir(
 struct net *net, const char *name, struct proc_dir_entry *parent)
{
 return proc_mkdir_data(name, 0, parent, net);
}
# 23 "./arch/sparc/include/asm/prom.h" 2


# 1 "include/linux/irqdomain.h" 1
# 36 "include/linux/irqdomain.h"
# 1 "include/linux/irqhandler.h" 1
# 9 "include/linux/irqhandler.h"
struct irq_desc;
struct irq_data;
typedef void (*irq_flow_handler_t)(unsigned int irq, struct irq_desc *desc);
typedef void (*irq_preflow_handler_t)(struct irq_data *data);
# 37 "include/linux/irqdomain.h" 2


struct device_node;
struct irq_domain;
struct of_device_id;
struct irq_chip;
struct irq_data;
# 63 "include/linux/irqdomain.h"
struct irq_domain_ops {
 int (*match)(struct irq_domain *d, struct device_node *node);
 int (*map)(struct irq_domain *d, unsigned int virq, irq_hw_number_t hw);
 void (*unmap)(struct irq_domain *d, unsigned int virq);
 int (*xlate)(struct irq_domain *d, struct device_node *node,
       const u32 *intspec, unsigned int intsize,
       unsigned long *out_hwirq, unsigned int *out_type);
# 80 "include/linux/irqdomain.h"
};

extern struct irq_domain_ops irq_generic_chip_ops;

struct irq_domain_chip_generic;
# 110 "include/linux/irqdomain.h"
struct irq_domain {
 struct list_head link;
 const char *name;
 const struct irq_domain_ops *ops;
 void *host_data;
 unsigned int flags;


 struct device_node *of_node;
 struct irq_domain_chip_generic *gc;





 irq_hw_number_t hwirq_max;
 unsigned int revmap_direct_max_irq;
 unsigned int revmap_size;
 struct radix_tree_root revmap_tree;
 unsigned int linear_revmap[];
};


enum {

 IRQ_DOMAIN_FLAG_HIERARCHY = (1 << 0),


 IRQ_DOMAIN_FLAG_AUTO_RECURSIVE = (1 << 1),






 IRQ_DOMAIN_FLAG_NONCORE = (1 << 16),
};
# 323 "include/linux/irqdomain.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void irq_dispose_mapping(unsigned int virq) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void irq_domain_activate_irq(struct irq_data *data) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void irq_domain_deactivate_irq(struct irq_data *data) { }
# 26 "./arch/sparc/include/asm/prom.h" 2
# 34 "./arch/sparc/include/asm/prom.h"
struct of_irq_controller {
 unsigned int (*irq_build)(struct device_node *, unsigned int, void *);
 void *data;
};

struct device_node *of_find_node_by_cpuid(int cpuid);
int of_set_property(struct device_node *node, const char *name, void *val, int len);
extern struct mutex of_set_property_mutex;
int of_getintprop_default(struct device_node *np,
     const char *name,
     int def);
int of_find_in_proplist(const char *list, const char *match, int len);

void prom_build_devicetree(void);
void of_populate_present_mask(void);
void of_fill_in_cpu_data(void);

struct resource;
void *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
void of_iounmap(struct resource *res, void *base, unsigned long size);

extern struct device_node *of_console_device;
extern char *of_console_path;
extern char *of_console_options;

void irq_trans_init(struct device_node *dp);
char *build_path_component(struct device_node *dp);
# 205 "include/linux/of.h" 2
# 231 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *of_node_full_name(const struct device_node *np)
{
 return np ? np->full_name : "<no-node>";
}




extern struct device_node *of_find_node_by_name(struct device_node *from,
 const char *name);
extern struct device_node *of_find_node_by_type(struct device_node *from,
 const char *type);
extern struct device_node *of_find_compatible_node(struct device_node *from,
 const char *type, const char *compat);
extern struct device_node *of_find_matching_node_and_match(
 struct device_node *from,
 const struct of_device_id *matches,
 const struct of_device_id **match);

extern struct device_node *of_find_node_opts_by_path(const char *path,
 const char **opts);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *of_find_node_by_path(const char *path)
{
 return of_find_node_opts_by_path(path, ((void *)0));
}

extern struct device_node *of_find_node_by_phandle(phandle handle);
extern struct device_node *of_get_parent(const struct device_node *node);
extern struct device_node *of_get_next_parent(struct device_node *node);
extern struct device_node *of_get_next_child(const struct device_node *node,
          struct device_node *prev);
extern struct device_node *of_get_next_available_child(
 const struct device_node *node, struct device_node *prev);

extern struct device_node *of_get_child_by_name(const struct device_node *node,
     const char *name);


extern struct device_node *of_find_next_cache_node(const struct device_node *);
extern struct device_node *of_find_node_with_property(
 struct device_node *from, const char *prop_name);

extern struct property *of_find_property(const struct device_node *np,
      const char *name,
      int *lenp);
extern int of_property_count_elems_of_size(const struct device_node *np,
    const char *propname, int elem_size);
extern int of_property_read_u32_index(const struct device_node *np,
           const char *propname,
           u32 index, u32 *out_value);
extern int of_property_read_u8_array(const struct device_node *np,
   const char *propname, u8 *out_values, size_t sz);
extern int of_property_read_u16_array(const struct device_node *np,
   const char *propname, u16 *out_values, size_t sz);
extern int of_property_read_u32_array(const struct device_node *np,
          const char *propname,
          u32 *out_values,
          size_t sz);
extern int of_property_read_u64(const struct device_node *np,
    const char *propname, u64 *out_value);
extern int of_property_read_u64_array(const struct device_node *np,
          const char *propname,
          u64 *out_values,
          size_t sz);

extern int of_property_read_string(struct device_node *np,
       const char *propname,
       const char **out_string);
extern int of_property_match_string(struct device_node *np,
        const char *propname,
        const char *string);
extern int of_property_read_string_helper(struct device_node *np,
           const char *propname,
           const char **out_strs, size_t sz, int index);
extern int of_device_is_compatible(const struct device_node *device,
       const char *);
extern bool of_device_is_available(const struct device_node *device);
extern const void *of_get_property(const struct device_node *node,
    const char *name,
    int *lenp);
extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);



extern int of_n_addr_cells(struct device_node *np);
extern int of_n_size_cells(struct device_node *np);
extern const struct of_device_id *of_match_node(
 const struct of_device_id *matches, const struct device_node *node);
extern int of_modalias_node(struct device_node *node, char *modalias, int len);
extern void of_print_phandle_args(const char *msg, const struct of_phandle_args *args);
extern struct device_node *of_parse_phandle(const struct device_node *np,
         const char *phandle_name,
         int index);
extern int of_parse_phandle_with_args(const struct device_node *np,
 const char *list_name, const char *cells_name, int index,
 struct of_phandle_args *out_args);
extern int of_parse_phandle_with_fixed_args(const struct device_node *np,
 const char *list_name, int cells_count, int index,
 struct of_phandle_args *out_args);
extern int of_count_phandle_with_args(const struct device_node *np,
 const char *list_name, const char *cells_name);

extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align));
extern int of_alias_get_id(struct device_node *np, const char *stem);

extern int of_machine_is_compatible(const char *compat);

extern int of_add_property(struct device_node *np, struct property *prop);
extern int of_remove_property(struct device_node *np, struct property *prop);
extern int of_update_property(struct device_node *np, struct property *newprop);
# 349 "include/linux/of.h"
extern int of_attach_node(struct device_node *);
extern int of_detach_node(struct device_node *);
# 362 "include/linux/of.h"
const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur,
          u32 *pu);







const char *of_prop_next_string(struct property *prop, const char *cur);

bool of_console_check(struct device_node *dn, char *name, int index);
# 624 "include/linux/of.h"
extern int of_node_to_nid(struct device_node *np);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *of_find_matching_node(
 struct device_node *from,
 const struct of_device_id *matches)
{
 return of_find_matching_node_and_match(from, matches, ((void *)0));
}
# 647 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_u8_elems(const struct device_node *np,
    const char *propname)
{
 return of_property_count_elems_of_size(np, propname, sizeof(u8));
}
# 664 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_u16_elems(const struct device_node *np,
    const char *propname)
{
 return of_property_count_elems_of_size(np, propname, sizeof(u16));
}
# 681 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_u32_elems(const struct device_node *np,
    const char *propname)
{
 return of_property_count_elems_of_size(np, propname, sizeof(u32));
}
# 698 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_u64_elems(const struct device_node *np,
    const char *propname)
{
 return of_property_count_elems_of_size(np, propname, sizeof(u64));
}
# 717 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_string_array(struct device_node *np,
      const char *propname, const char **out_strs,
      size_t sz)
{
 return of_property_read_string_helper(np, propname, out_strs, sz, 0);
}
# 736 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_strings(struct device_node *np,
         const char *propname)
{
 return of_property_read_string_helper(np, propname, ((void *)0), 0, 0);
}
# 760 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_string_index(struct device_node *np,
      const char *propname,
      int index, const char **output)
{
 int rc = of_property_read_string_helper(np, propname, output, 1, index);
 return rc < 0 ? rc : 0;
}
# 776 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool of_property_read_bool(const struct device_node *np,
      const char *propname)
{
 struct property *prop = of_find_property(np, propname, ((void *)0));

 return prop ? true : false;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_u8(const struct device_node *np,
           const char *propname,
           u8 *out_value)
{
 return of_property_read_u8_array(np, propname, out_value, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_u16(const struct device_node *np,
           const char *propname,
           u16 *out_value)
{
 return of_property_read_u16_array(np, propname, out_value, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_u32(const struct device_node *np,
           const char *propname,
           u32 *out_value)
{
 return of_property_read_u32_array(np, propname, out_value, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_s32(const struct device_node *np,
           const char *propname,
           s32 *out_value)
{
 return of_property_read_u32(np, propname, (u32*) out_value);
}
# 851 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_get_child_count(const struct device_node *np)
{
 struct device_node *child;
 int num = 0;

 for (child = of_get_next_child(np, ((void *)0)); child != ((void *)0); child = of_get_next_child(np, child))
  num++;

 return num;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_get_available_child_count(const struct device_node *np)
{
 struct device_node *child;
 int num = 0;

 for (child = of_get_next_available_child(np, ((void *)0)); child != ((void *)0); child = of_get_next_available_child(np, child))
  num++;

 return num;
}
# 887 "include/linux/of.h"
typedef int (*of_init_fn_2)(struct device_node *, struct device_node *);
typedef void (*of_init_fn_1)(struct device_node *);
# 909 "include/linux/of.h"
struct of_changeset_entry {
 struct list_head node;
 unsigned long action;
 struct device_node *np;
 struct property *prop;
 struct property *old_prop;
};
# 927 "include/linux/of.h"
struct of_changeset {
 struct list_head entries;
};

enum of_reconfig_change {
 OF_RECONFIG_NO_CHANGE = 0,
 OF_RECONFIG_CHANGE_ADD,
 OF_RECONFIG_CHANGE_REMOVE,
};
# 982 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_reconfig_notifier_register(struct notifier_block *nb)
{
 return -22;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_reconfig_notifier_unregister(struct notifier_block *nb)
{
 return -22;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_reconfig_notify(unsigned long action,
         struct of_reconfig_data *arg)
{
 return -22;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_reconfig_get_state_change(unsigned long action,
      struct of_reconfig_data *arg)
{
 return -22;
}



extern int of_resolve_phandles(struct device_node *tree);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool of_device_is_system_power_controller(const struct device_node *np)
{
 return of_property_read_bool(np, "system-power-controller");
}
# 1029 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_overlay_create(struct device_node *tree)
{
 return -524;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_overlay_destroy(int id)
{
 return -524;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_overlay_destroy_all(void)
{
 return -524;
}
# 15 "./arch/sparc/include/asm/openprom.h" 2


struct linux_dev_v0_funcs {
 int (*v0_devopen)(char *device_str);
 int (*v0_devclose)(int dev_desc);
 int (*v0_rdblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
 int (*v0_wrblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
 int (*v0_wrnetdev)(int dev_desc, int num_bytes, char *buf);
 int (*v0_rdnetdev)(int dev_desc, int num_bytes, char *buf);
 int (*v0_rdchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
 int (*v0_wrchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
 int (*v0_seekdev)(int dev_desc, long logical_offst, int from);
};


struct linux_dev_v2_funcs {
 phandle (*v2_inst2pkg)(int d);
 char * (*v2_dumb_mem_alloc)(char *va, unsigned sz);
 void (*v2_dumb_mem_free)(char *va, unsigned sz);


 char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned paddr, unsigned sz);
 void (*v2_dumb_munmap)(char *virta, unsigned size);

 int (*v2_dev_open)(char *devpath);
 void (*v2_dev_close)(int d);
 int (*v2_dev_read)(int d, char *buf, int nbytes);
 int (*v2_dev_write)(int d, const char *buf, int nbytes);
 int (*v2_dev_seek)(int d, int hi, int lo);


 void (*v2_wheee2)(void);
 void (*v2_wheee3)(void);
};

struct linux_mlist_v0 {
 struct linux_mlist_v0 *theres_more;
 unsigned int start_adr;
 unsigned num_bytes;
};

struct linux_mem_v0 {
 struct linux_mlist_v0 **v0_totphys;
 struct linux_mlist_v0 **v0_prommap;
 struct linux_mlist_v0 **v0_available;
};


struct linux_arguments_v0 {
 char *argv[8];
 char args[100];
 char boot_dev[2];
 int boot_dev_ctrl;
 int boot_dev_unit;
 int dev_partition;
 char *kernel_file_name;
 void *aieee1;
};


struct linux_bootargs_v2 {
 char **bootpath;
 char **bootargs;
 int *fd_stdin;
 int *fd_stdout;
};


struct linux_romvec {

 unsigned int pv_magic_cookie;
 unsigned int pv_romvers;
 unsigned int pv_plugin_revision;
 unsigned int pv_printrev;


 struct linux_mem_v0 pv_v0mem;


 struct linux_nodeops *pv_nodeops;

 char **pv_bootstr;
 struct linux_dev_v0_funcs pv_v0devops;

 char *pv_stdin;
 char *pv_stdout;






 int (*pv_getchar)(void);
 void (*pv_putchar)(int ch);


 int (*pv_nbgetchar)(void);
 int (*pv_nbputchar)(int ch);

 void (*pv_putstr)(char *str, int len);


 void (*pv_reboot)(char *bootstr);
 void (*pv_printf)(__const__ char *fmt, ...);
 void (*pv_abort)(void);
 __volatile__ int *pv_ticks;
 void (*pv_halt)(void);
 void (**pv_synchook)(void);


 union {
  void (*v0_eval)(int len, char *str);
  void (*v2_eval)(char *str);
 } pv_fortheval;

 struct linux_arguments_v0 **pv_v0bootargs;


 unsigned int (*pv_enaddr)(int d, char *enaddr);

 struct linux_bootargs_v2 pv_v2bootargs;
 struct linux_dev_v2_funcs pv_v2devops;

 int filler[15];


 void (*pv_setctxt)(int ctxt, char *va, int pmeg);
# 151 "./arch/sparc/include/asm/openprom.h"
 int (*v3_cpustart)(unsigned int whichcpu, int ctxtbl_ptr,
      int thiscontext, char *prog_counter);




 int (*v3_cpustop)(unsigned int whichcpu);




 int (*v3_cpuidle)(unsigned int whichcpu);





 int (*v3_cpuresume)(unsigned int whichcpu);
};


struct linux_nodeops {
 phandle (*no_nextnode)(phandle node);
 phandle (*no_child)(phandle node);
 int (*no_proplen)(phandle node, const char *name);
 int (*no_getprop)(phandle node, const char *name, char *val);
 int (*no_setprop)(phandle node, const char *name, char *val, int len);
 char * (*no_nextprop)(phandle node, char *name);
};
# 192 "./arch/sparc/include/asm/openprom.h"
struct linux_prom_registers {
 unsigned int which_io;
 unsigned int phys_addr;
 unsigned int reg_size;
};

struct linux_prom64_registers {
 unsigned long phys_addr;
 unsigned long reg_size;
};

struct linux_prom_irqs {
 int pri;
 int vector;
};


struct linux_prom_ranges {
 unsigned int ot_child_space;
 unsigned int ot_child_base;
 unsigned int ot_parent_space;
 unsigned int ot_parent_base;
 unsigned int or_size;
};





struct linux_prom_pci_registers {
 unsigned int phys_hi;
 unsigned int phys_mid;
 unsigned int phys_lo;

 unsigned int size_hi;
 unsigned int size_lo;
};
# 247 "./arch/sparc/include/asm/openprom.h"
struct linux_prom_pci_ranges {
 unsigned int child_phys_hi;
 unsigned int child_phys_mid;
 unsigned int child_phys_lo;

 unsigned int parent_phys_hi;
 unsigned int parent_phys_lo;

 unsigned int size_hi;
 unsigned int size_lo;
};

struct linux_prom_pci_intmap {
 unsigned int phys_hi;
 unsigned int phys_mid;
 unsigned int phys_lo;

 unsigned int interrupt;

 int cnode;
 unsigned int cinterrupt;
};

struct linux_prom_pci_intmask {
 unsigned int phys_hi;
 unsigned int phys_mid;
 unsigned int phys_lo;
 unsigned int interrupt;
};
# 10 "./arch/sparc/include/asm/device.h" 2

struct device_node;
struct platform_device;

struct dev_archdata {
 void *iommu;
 void *stc;
 void *host_controller;
 struct platform_device *op;
 int numa_node;
};

void of_propagate_archdata(struct platform_device *bus);

struct pdev_archdata {
 struct resource resource[24];
 unsigned int irqs[32];
 int num_irqs;
};
# 31 "include/linux/device.h" 2

struct device;
struct device_private;
struct device_driver;
struct driver_private;
struct module;
struct class;
struct subsys_private;
struct bus_type;
struct device_node;
struct iommu_ops;
struct iommu_group;

struct bus_attribute {
 struct attribute attr;
 ssize_t (*show)(struct bus_type *bus, char *buf);
 ssize_t (*store)(struct bus_type *bus, const char *buf, size_t count);
};
# 57 "include/linux/device.h"
extern int __attribute__((warn_unused_result)) bus_create_file(struct bus_type *,
     struct bus_attribute *);
extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
# 104 "include/linux/device.h"
struct bus_type {
 const char *name;
 const char *dev_name;
 struct device *dev_root;
 struct device_attribute *dev_attrs;
 const struct attribute_group **bus_groups;
 const struct attribute_group **dev_groups;
 const struct attribute_group **drv_groups;

 int (*match)(struct device *dev, struct device_driver *drv);
 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
 int (*probe)(struct device *dev);
 int (*remove)(struct device *dev);
 void (*shutdown)(struct device *dev);

 int (*online)(struct device *dev);
 int (*offline)(struct device *dev);

 int (*suspend)(struct device *dev, pm_message_t state);
 int (*resume)(struct device *dev);

 const struct dev_pm_ops *pm;

 const struct iommu_ops *iommu_ops;

 struct subsys_private *p;
 struct lock_class_key lock_key;
};

extern int __attribute__((warn_unused_result)) bus_register(struct bus_type *bus);

extern void bus_unregister(struct bus_type *bus);

extern int __attribute__((warn_unused_result)) bus_rescan_devices(struct bus_type *bus);


struct subsys_dev_iter {
 struct klist_iter ki;
 const struct device_type *type;
};
void subsys_dev_iter_init(struct subsys_dev_iter *iter,
    struct bus_type *subsys,
    struct device *start,
    const struct device_type *type);
struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter);
void subsys_dev_iter_exit(struct subsys_dev_iter *iter);

int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
       int (*fn)(struct device *dev, void *data));
struct device *bus_find_device(struct bus_type *bus, struct device *start,
          void *data,
          int (*match)(struct device *dev, void *data));
struct device *bus_find_device_by_name(struct bus_type *bus,
           struct device *start,
           const char *name);
struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id,
     struct device *hint);
int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
       void *data, int (*fn)(struct device_driver *, void *));
void bus_sort_breadthfirst(struct bus_type *bus,
      int (*compare)(const struct device *a,
       const struct device *b));






struct notifier_block;

extern int bus_register_notifier(struct bus_type *bus,
     struct notifier_block *nb);
extern int bus_unregister_notifier(struct bus_type *bus,
       struct notifier_block *nb);
# 194 "include/linux/device.h"
extern struct kset *bus_get_kset(struct bus_type *bus);
extern struct klist *bus_get_device_klist(struct bus_type *bus);
# 229 "include/linux/device.h"
struct device_driver {
 const char *name;
 struct bus_type *bus;

 struct module *owner;
 const char *mod_name;

 bool suppress_bind_attrs;

 const struct of_device_id *of_match_table;
 const struct acpi_device_id *acpi_match_table;

 int (*probe) (struct device *dev);
 int (*remove) (struct device *dev);
 void (*shutdown) (struct device *dev);
 int (*suspend) (struct device *dev, pm_message_t state);
 int (*resume) (struct device *dev);
 const struct attribute_group **groups;

 const struct dev_pm_ops *pm;

 struct driver_private *p;
};


extern int __attribute__((warn_unused_result)) driver_register(struct device_driver *drv);
extern void driver_unregister(struct device_driver *drv);

extern struct device_driver *driver_find(const char *name,
      struct bus_type *bus);
extern int driver_probe_done(void);
extern void wait_for_device_probe(void);




struct driver_attribute {
 struct attribute attr;
 ssize_t (*show)(struct device_driver *driver, char *buf);
 ssize_t (*store)(struct device_driver *driver, const char *buf,
    size_t count);
};
# 281 "include/linux/device.h"
extern int __attribute__((warn_unused_result)) driver_create_file(struct device_driver *driver,
     const struct driver_attribute *attr);
extern void driver_remove_file(struct device_driver *driver,
          const struct driver_attribute *attr);

extern int __attribute__((warn_unused_result)) driver_for_each_device(struct device_driver *drv,
            struct device *start,
            void *data,
            int (*fn)(struct device *dev,
        void *));
struct device *driver_find_device(struct device_driver *drv,
      struct device *start, void *data,
      int (*match)(struct device *dev, void *data));
# 308 "include/linux/device.h"
struct subsys_interface {
 const char *name;
 struct bus_type *subsys;
 struct list_head node;
 int (*add_dev)(struct device *dev, struct subsys_interface *sif);
 int (*remove_dev)(struct device *dev, struct subsys_interface *sif);
};

int subsys_interface_register(struct subsys_interface *sif);
void subsys_interface_unregister(struct subsys_interface *sif);

int subsys_system_register(struct bus_type *subsys,
      const struct attribute_group **groups);
int subsys_virtual_register(struct bus_type *subsys,
       const struct attribute_group **groups);
# 352 "include/linux/device.h"
struct class {
 const char *name;
 struct module *owner;

 struct class_attribute *class_attrs;
 const struct attribute_group **dev_groups;
 struct kobject *dev_kobj;

 int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);
 char *(*devnode)(struct device *dev, umode_t *mode);

 void (*class_release)(struct class *class);
 void (*dev_release)(struct device *dev);

 int (*suspend)(struct device *dev, pm_message_t state);
 int (*resume)(struct device *dev);

 const struct kobj_ns_type_operations *ns_type;
 const void *(*namespace)(struct device *dev);

 const struct dev_pm_ops *pm;

 struct subsys_private *p;
};

struct class_dev_iter {
 struct klist_iter ki;
 const struct device_type *type;
};

extern struct kobject *sysfs_dev_block_kobj;
extern struct kobject *sysfs_dev_char_kobj;
extern int __attribute__((warn_unused_result)) __class_register(struct class *class,
      struct lock_class_key *key);
extern void class_unregister(struct class *class);
# 396 "include/linux/device.h"
struct class_compat;
struct class_compat *class_compat_register(const char *name);
void class_compat_unregister(struct class_compat *cls);
int class_compat_create_link(struct class_compat *cls, struct device *dev,
        struct device *device_link);
void class_compat_remove_link(struct class_compat *cls, struct device *dev,
         struct device *device_link);

extern void class_dev_iter_init(struct class_dev_iter *iter,
    struct class *class,
    struct device *start,
    const struct device_type *type);
extern struct device *class_dev_iter_next(struct class_dev_iter *iter);
extern void class_dev_iter_exit(struct class_dev_iter *iter);

extern int class_for_each_device(struct class *class, struct device *start,
     void *data,
     int (*fn)(struct device *dev, void *data));
extern struct device *class_find_device(struct class *class,
     struct device *start, const void *data,
     int (*match)(struct device *, const void *));

struct class_attribute {
 struct attribute attr;
 ssize_t (*show)(struct class *class, struct class_attribute *attr,
   char *buf);
 ssize_t (*store)(struct class *class, struct class_attribute *attr,
   const char *buf, size_t count);
};
# 433 "include/linux/device.h"
extern int __attribute__((warn_unused_result)) class_create_file_ns(struct class *class,
          const struct class_attribute *attr,
          const void *ns);
extern void class_remove_file_ns(struct class *class,
     const struct class_attribute *attr,
     const void *ns);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) class_create_file(struct class *class,
     const struct class_attribute *attr)
{
 return class_create_file_ns(class, attr, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void class_remove_file(struct class *class,
         const struct class_attribute *attr)
{
 return class_remove_file_ns(class, attr, ((void *)0));
}


struct class_attribute_string {
 struct class_attribute attr;
 char *str;
};
# 465 "include/linux/device.h"
extern ssize_t show_class_attr_string(struct class *class, struct class_attribute *attr,
                        char *buf);

struct class_interface {
 struct list_head node;
 struct class *class;

 int (*add_dev) (struct device *, struct class_interface *);
 void (*remove_dev) (struct device *, struct class_interface *);
};

extern int __attribute__((warn_unused_result)) class_interface_register(struct class_interface *);
extern void class_interface_unregister(struct class_interface *);

extern struct class * __attribute__((warn_unused_result)) __class_create(struct module *owner,
        const char *name,
        struct lock_class_key *key);
extern void class_destroy(struct class *cls);
# 501 "include/linux/device.h"
struct device_type {
 const char *name;
 const struct attribute_group **groups;
 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
 char *(*devnode)(struct device *dev, umode_t *mode,
    kuid_t *uid, kgid_t *gid);
 void (*release)(struct device *dev);

 const struct dev_pm_ops *pm;
};


struct device_attribute {
 struct attribute attr;
 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
   char *buf);
 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
    const char *buf, size_t count);
};

struct dev_ext_attribute {
 struct device_attribute attr;
 void *var;
};

ssize_t device_show_ulong(struct device *dev, struct device_attribute *attr,
     char *buf);
ssize_t device_store_ulong(struct device *dev, struct device_attribute *attr,
      const char *buf, size_t count);
ssize_t device_show_int(struct device *dev, struct device_attribute *attr,
   char *buf);
ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
    const char *buf, size_t count);
ssize_t device_show_bool(struct device *dev, struct device_attribute *attr,
   char *buf);
ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
    const char *buf, size_t count);
# 560 "include/linux/device.h"
extern int device_create_file(struct device *device,
         const struct device_attribute *entry);
extern void device_remove_file(struct device *dev,
          const struct device_attribute *attr);
extern bool device_remove_file_self(struct device *dev,
        const struct device_attribute *attr);
extern int __attribute__((warn_unused_result)) device_create_bin_file(struct device *dev,
     const struct bin_attribute *attr);
extern void device_remove_bin_file(struct device *dev,
       const struct bin_attribute *attr);


typedef void (*dr_release_t)(struct device *dev, void *res);
typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);







extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp);

extern void devres_for_each_res(struct device *dev, dr_release_t release,
    dr_match_t match, void *match_data,
    void (*fn)(struct device *, void *, void *),
    void *data);
extern void devres_free(void *res);
extern void devres_add(struct device *dev, void *res);
extern void *devres_find(struct device *dev, dr_release_t release,
    dr_match_t match, void *match_data);
extern void *devres_get(struct device *dev, void *new_res,
   dr_match_t match, void *match_data);
extern void *devres_remove(struct device *dev, dr_release_t release,
      dr_match_t match, void *match_data);
extern int devres_destroy(struct device *dev, dr_release_t release,
     dr_match_t match, void *match_data);
extern int devres_release(struct device *dev, dr_release_t release,
     dr_match_t match, void *match_data);


extern void * __attribute__((warn_unused_result)) devres_open_group(struct device *dev, void *id,
          gfp_t gfp);
extern void devres_close_group(struct device *dev, void *id);
extern void devres_remove_group(struct device *dev, void *id);
extern int devres_release_group(struct device *dev, void *id);


extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp);
extern char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt,
        va_list ap);
extern __attribute__((format(printf, 3, 4)))
char *devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp)
{
 return devm_kmalloc(dev, size, gfp | (( gfp_t)0x8000u));
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *devm_kmalloc_array(struct device *dev,
           size_t n, size_t size, gfp_t flags)
{
 if (size != 0 && n > (~(size_t)0) / size)
  return ((void *)0);
 return devm_kmalloc(dev, n * size, flags);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *devm_kcalloc(struct device *dev,
     size_t n, size_t size, gfp_t flags)
{
 return devm_kmalloc_array(dev, n, size, flags | (( gfp_t)0x8000u));
}
extern void devm_kfree(struct device *dev, void *p);
extern char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp);
extern void *devm_kmemdup(struct device *dev, const void *src, size_t len,
     gfp_t gfp);

extern unsigned long devm_get_free_pages(struct device *dev,
      gfp_t gfp_mask, unsigned int order);
extern void devm_free_pages(struct device *dev, unsigned long addr);

void *devm_ioremap_resource(struct device *dev, struct resource *res);


int devm_add_action(struct device *dev, void (*action)(void *), void *data);
void devm_remove_action(struct device *dev, void (*action)(void *), void *data);

struct device_dma_parameters {




 unsigned int max_segment_size;
 unsigned long segment_boundary_mask;
};

struct acpi_device;

struct acpi_dev_node {



};
# 730 "include/linux/device.h"
struct device {
 struct device *parent;

 struct device_private *p;

 struct kobject kobj;
 const char *init_name;
 const struct device_type *type;

 struct mutex mutex;



 struct bus_type *bus;
 struct device_driver *driver;

 void *platform_data;

 void *driver_data;

 struct dev_pm_info power;
 struct dev_pm_domain *pm_domain;






 int numa_node;

 u64 *dma_mask;
 u64 coherent_dma_mask;




 unsigned long dma_pfn_offset;

 struct device_dma_parameters *dma_parms;

 struct list_head dma_pools;

 struct dma_coherent_mem *dma_mem;






 struct dev_archdata archdata;

 struct device_node *of_node;
 struct acpi_dev_node acpi_node;

 dev_t devt;
 u32 id;

 spinlock_t devres_lock;
 struct list_head devres_head;

 struct klist_node knode_class;
 struct class *class;
 const struct attribute_group **groups;

 void (*release)(struct device *dev);
 struct iommu_group *iommu_group;

 bool offline_disabled:1;
 bool offline:1;
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device *kobj_to_dev(struct kobject *kobj)
{
 return ({ const typeof( ((struct device *)0)->kobj ) *__mptr = (kobj); (struct device *)( (char *)__mptr - __builtin_offsetof(struct device,kobj) );});
}


# 1 "include/linux/pm_wakeup.h" 1
# 46 "include/linux/pm_wakeup.h"
struct wakeup_source {
 const char *name;
 struct list_head entry;
 spinlock_t lock;
 struct timer_list timer;
 unsigned long timer_expires;
 ktime_t total_time;
 ktime_t max_time;
 ktime_t last_time;
 ktime_t start_prevent_time;
 ktime_t prevent_sleep_time;
 unsigned long event_count;
 unsigned long active_count;
 unsigned long relax_count;
 unsigned long expire_count;
 unsigned long wakeup_count;
 bool active:1;
 bool autosleep_enabled:1;
};
# 105 "include/linux/pm_wakeup.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_set_wakeup_capable(struct device *dev, bool capable)
{
 dev->power.can_wakeup = capable;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_can_wakeup(struct device *dev)
{
 return dev->power.can_wakeup;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_prepare(struct wakeup_source *ws,
      const char *name) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct wakeup_source *wakeup_source_create(const char *name)
{
 return ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_drop(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_destroy(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_add(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_remove(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct wakeup_source *wakeup_source_register(const char *name)
{
 return ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_unregister(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_wakeup_enable(struct device *dev)
{
 dev->power.should_wakeup = true;
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_wakeup_disable(struct device *dev)
{
 dev->power.should_wakeup = false;
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_set_wakeup_enable(struct device *dev, bool enable)
{
 dev->power.should_wakeup = enable;
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_init_wakeup(struct device *dev, bool val)
{
 device_set_wakeup_capable(dev, val);
 device_set_wakeup_enable(dev, val);
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_may_wakeup(struct device *dev)
{
 return dev->power.can_wakeup && dev->power.should_wakeup;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __pm_stay_awake(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_stay_awake(struct device *dev) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __pm_relax(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_relax(struct device *dev) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_wakeup_event(struct device *dev, unsigned int msec) {}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_init(struct wakeup_source *ws,
          const char *name)
{
 wakeup_source_prepare(ws, name);
 wakeup_source_add(ws);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_trash(struct wakeup_source *ws)
{
 wakeup_source_remove(ws);
 wakeup_source_drop(ws);
}
# 808 "include/linux/device.h" 2

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *dev_name(const struct device *dev)
{

 if (dev->init_name)
  return dev->init_name;

 return kobject_name(&dev->kobj);
}

extern __attribute__((format(printf, 2, 3)))
int dev_set_name(struct device *dev, const char *name, ...);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dev_to_node(struct device *dev)
{
 return dev->numa_node;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_dev_node(struct device *dev, int node)
{
 dev->numa_node = node;
}
# 840 "include/linux/device.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *dev_get_drvdata(const struct device *dev)
{
 return dev->driver_data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_set_drvdata(struct device *dev, void *data)
{
 dev->driver_data = data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pm_subsys_data *dev_to_psd(struct device *dev)
{
 return dev ? dev->power.subsys_data : ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int dev_get_uevent_suppress(const struct device *dev)
{
 return dev->kobj.uevent_suppress;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_set_uevent_suppress(struct device *dev, int val)
{
 dev->kobj.uevent_suppress = val;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_is_registered(struct device *dev)
{
 return dev->kobj.state_in_sysfs;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_enable_async_suspend(struct device *dev)
{
 if (!dev->power.is_prepared)
  dev->power.async_suspend = true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_disable_async_suspend(struct device *dev)
{
 if (!dev->power.is_prepared)
  dev->power.async_suspend = false;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_async_suspend_enabled(struct device *dev)
{
 return !!dev->power.async_suspend;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_suspend_ignore_children(struct device *dev, bool enable)
{
 dev->power.ignore_children = enable;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_pm_syscore_device(struct device *dev, bool val)
{



}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_lock(struct device *dev)
{
 mutex_lock(&dev->mutex);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_trylock(struct device *dev)
{
 return mutex_trylock(&dev->mutex);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_unlock(struct device *dev)
{
 mutex_unlock(&dev->mutex);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_lock_assert(struct device *dev)
{
 do { (void)(&dev->mutex); } while (0);
}

void driver_init(void);




extern int __attribute__((warn_unused_result)) device_register(struct device *dev);
extern void device_unregister(struct device *dev);
extern void device_initialize(struct device *dev);
extern int __attribute__((warn_unused_result)) device_add(struct device *dev);
extern void device_del(struct device *dev);
extern int device_for_each_child(struct device *dev, void *data,
       int (*fn)(struct device *dev, void *data));
extern struct device *device_find_child(struct device *dev, void *data,
    int (*match)(struct device *dev, void *data));
extern int device_rename(struct device *dev, const char *new_name);
extern int device_move(struct device *dev, struct device *new_parent,
         enum dpm_order dpm_order);
extern const char *device_get_devnode(struct device *dev,
          umode_t *mode, kuid_t *uid, kgid_t *gid,
          const char **tmp);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_supports_offline(struct device *dev)
{
 return dev->bus && dev->bus->offline && dev->bus->online;
}

extern void lock_device_hotplug(void);
extern void unlock_device_hotplug(void);
extern int lock_device_hotplug_sysfs(void);
extern int device_offline(struct device *dev);
extern int device_online(struct device *dev);



extern struct device *__root_device_register(const char *name,
          struct module *owner);





extern void root_device_unregister(struct device *root);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *dev_get_platdata(const struct device *dev)
{
 return dev->platform_data;
}





extern int __attribute__((warn_unused_result)) device_bind_driver(struct device *dev);
extern void device_release_driver(struct device *dev);
extern int __attribute__((warn_unused_result)) device_attach(struct device *dev);
extern int __attribute__((warn_unused_result)) driver_attach(struct device_driver *drv);
extern int __attribute__((warn_unused_result)) device_reprobe(struct device *dev);




extern struct device *device_create_vargs(struct class *cls,
       struct device *parent,
       dev_t devt,
       void *drvdata,
       const char *fmt,
       va_list vargs);
extern __attribute__((format(printf, 5, 6)))
struct device *device_create(struct class *cls, struct device *parent,
        dev_t devt, void *drvdata,
        const char *fmt, ...);
extern __attribute__((format(printf, 6, 7)))
struct device *device_create_with_groups(struct class *cls,
        struct device *parent, dev_t devt, void *drvdata,
        const struct attribute_group **groups,
        const char *fmt, ...);
extern void device_destroy(struct class *cls, dev_t devt);







extern int (*platform_notify)(struct device *dev);

extern int (*platform_notify_remove)(struct device *dev);






extern struct device *get_device(struct device *dev);
extern void put_device(struct device *dev);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int devtmpfs_create_node(struct device *dev) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int devtmpfs_delete_node(struct device *dev) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int devtmpfs_mount(const char *mountpoint) { return 0; }



extern void device_shutdown(void);


extern const char *dev_driver_string(const struct device *dev);




extern __attribute__((format(printf, 3, 0)))
int dev_vprintk_emit(int level, const struct device *dev,
       const char *fmt, va_list args);
extern __attribute__((format(printf, 3, 4)))
int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...);

extern __attribute__((format(printf, 3, 4)))
void dev_printk(const char *level, const struct device *dev,
  const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void dev_emerg(const struct device *dev, const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void dev_alert(const struct device *dev, const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void dev_crit(const struct device *dev, const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void dev_err(const struct device *dev, const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void dev_warn(const struct device *dev, const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void dev_notice(const struct device *dev, const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void _dev_info(const struct device *dev, const char *fmt, ...);
# 18 "include/linux/node.h" 2



struct node {
 struct device dev;




};

struct memory_block;
extern struct node *node_devices[];
typedef void (*node_registration_func_t)(struct node *);

extern void unregister_node(struct node *node);

extern int register_one_node(int nid);
extern void unregister_one_node(int nid);
extern int register_cpu_under_node(unsigned int cpu, unsigned int nid);
extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid);
extern int register_mem_sect_under_node(struct memory_block *mem_blk,
      int nid);
extern int unregister_mem_sect_under_nodes(struct memory_block *mem_blk,
        unsigned long phys_index);


extern void register_hugetlbfs_with_node(node_registration_func_t doregister,
      node_registration_func_t unregister);
# 17 "include/linux/cpu.h" 2



struct device;
struct device_node;
struct attribute_group;

struct cpu {
 int node_id;
 int hotpluggable;
 struct device dev;
};

extern int register_cpu(struct cpu *cpu, int num);
extern struct device *get_cpu_device(unsigned cpu);
extern bool cpu_is_hotpluggable(unsigned cpu);
extern bool arch_match_cpu_phys_id(int cpu, u64 phys_id);
extern bool arch_find_n_match_cpu_physical_id(struct device_node *cpun,
           int cpu, unsigned int *thread);

extern int cpu_add_dev_attr(struct device_attribute *attr);
extern void cpu_remove_dev_attr(struct device_attribute *attr);

extern int cpu_add_dev_attr_group(struct attribute_group *attrs);
extern void cpu_remove_dev_attr_group(struct attribute_group *attrs);

extern struct device *cpu_device_create(struct device *parent, void *drvdata,
     const struct attribute_group **groups,
     const char *fmt, ...);

extern void unregister_cpu(struct cpu *cpu);
extern ssize_t arch_cpu_probe(const char *, size_t);
extern ssize_t arch_cpu_release(const char *, size_t);

struct notifier_block;




enum {
# 68 "include/linux/cpu.h"
 CPU_PRI_SCHED_ACTIVE = ((int)(~0U>>1)),
 CPU_PRI_CPUSET_ACTIVE = ((int)(~0U>>1)) - 1,
 CPU_PRI_SCHED_INACTIVE = (-((int)(~0U>>1)) - 1) + 1,
 CPU_PRI_CPUSET_INACTIVE = (-((int)(~0U>>1)) - 1),


 CPU_PRI_PERF = 20,
 CPU_PRI_MIGRATION = 10,

 CPU_PRI_WORKQUEUE_UP = 5,
 CPU_PRI_WORKQUEUE_DOWN = -5,
};
# 134 "include/linux/cpu.h"
extern int register_cpu_notifier(struct notifier_block *nb);
extern int __register_cpu_notifier(struct notifier_block *nb);
extern void unregister_cpu_notifier(struct notifier_block *nb);
extern void __unregister_cpu_notifier(struct notifier_block *nb);
# 164 "include/linux/cpu.h"
int cpu_up(unsigned int cpu);
void notify_cpu_starting(unsigned int cpu);
extern void cpu_maps_update_begin(void);
extern void cpu_maps_update_done(void);
# 212 "include/linux/cpu.h"
extern struct bus_type cpu_subsys;




extern void cpu_hotplug_begin(void);
extern void cpu_hotplug_done(void);
extern void get_online_cpus(void);
extern bool try_get_online_cpus(void);
extern void put_online_cpus(void);
extern void cpu_hotplug_disable(void);
extern void cpu_hotplug_enable(void);






void clear_tasks_mm_cpumask(int cpu);
int cpu_down(unsigned int cpu);
# 255 "include/linux/cpu.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int disable_nonboot_cpus(void) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void enable_nonboot_cpus(void) {}


enum cpuhp_state {
 CPUHP_OFFLINE,
 CPUHP_ONLINE,
};

void cpu_startup_entry(enum cpuhp_state state);

void cpu_idle_poll_ctrl(bool enable);

void arch_cpu_idle(void);
void arch_cpu_idle_prepare(void);
void arch_cpu_idle_enter(void);
void arch_cpu_idle_exit(void);
void arch_cpu_idle_dead(void);
# 49 "include/linux/perf_event.h" 2
# 1 "include/linux/irq_work.h" 1
# 20 "include/linux/irq_work.h"
struct irq_work {
 unsigned long flags;
 struct llist_node llnode;
 void (*func)(struct irq_work *);
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *))
{
 work->flags = 0;
 work->func = func;
}



bool irq_work_queue(struct irq_work *work);


bool irq_work_queue_on(struct irq_work *work, int cpu);


void irq_work_run(void);
void irq_work_tick(void);
void irq_work_sync(struct irq_work *work);


# 1 "arch/sparc/include/generated/asm/irq_work.h" 1
# 1 "include/asm-generic/irq_work.h" 1



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool arch_irq_work_has_interrupt(void)
{
 return false;
}
# 1 "arch/sparc/include/generated/asm/irq_work.h" 2
# 47 "include/linux/irq_work.h" 2

bool irq_work_needs_cpu(void);
# 50 "include/linux/perf_event.h" 2
# 1 "include/linux/static_key.h" 1
# 1 "include/linux/jump_label.h" 1
# 52 "include/linux/jump_label.h"
extern bool static_key_initialized;
# 72 "include/linux/jump_label.h"
struct static_key {
 atomic_t enabled;
};


enum jump_label_type {
 JUMP_LABEL_DISABLE = 0,
 JUMP_LABEL_ENABLE,
};

struct module;



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int static_key_count(struct static_key *key)
{
 return (*({ __attribute__((unused)) typeof((&key->enabled)->counter) __var = ( typeof((&key->enabled)->counter)) 0; (volatile typeof((&key->enabled)->counter) *)&((&key->enabled)->counter); }));
}
# 146 "include/linux/jump_label.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void jump_label_init(void)
{
 static_key_initialized = true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool static_key_false(struct static_key *key)
{
 if (__builtin_expect(!!(static_key_count(key) > 0), 0))
  return true;
 return false;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool static_key_true(struct static_key *key)
{
 if (__builtin_expect(!!(static_key_count(key) > 0), 1))
  return true;
 return false;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void static_key_slow_inc(struct static_key *key)
{
 ({ int __ret_warn_on = !!(!static_key_initialized); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_fmt("include/linux/jump_label.h", 167, "%s used before call to jump_label_init", __func__); __builtin_expect(!!(__ret_warn_on), 0); });
 atomic_add(1, &key->enabled);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void static_key_slow_dec(struct static_key *key)
{
 ({ int __ret_warn_on = !!(!static_key_initialized); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_fmt("include/linux/jump_label.h", 173, "%s used before call to jump_label_init", __func__); __builtin_expect(!!(__ret_warn_on), 0); });
 atomic_sub(1, &key->enabled);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int jump_label_text_reserved(void *start, void *end)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void jump_label_lock(void) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void jump_label_unlock(void) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int jump_label_apply_nops(struct module *mod)
{
 return 0;
}
# 200 "include/linux/jump_label.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool static_key_enabled(struct static_key *key)
{
 return static_key_count(key) > 0;
}
# 1 "include/linux/static_key.h" 2
# 51 "include/linux/perf_event.h" 2
# 1 "include/linux/jump_label_ratelimit.h" 1
# 21 "include/linux/jump_label_ratelimit.h"
struct static_key_deferred {
 struct static_key key;
};
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void static_key_slow_dec_deferred(struct static_key_deferred *key)
{
 ({ int __ret_warn_on = !!(!static_key_initialized); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_fmt("include/linux/jump_label_ratelimit.h", 26, "%s used before call to jump_label_init", __func__); __builtin_expect(!!(__ret_warn_on), 0); });
 static_key_slow_dec(&key->key);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
jump_label_rate_limit(struct static_key_deferred *key,
  unsigned long rl)
{
 ({ int __ret_warn_on = !!(!static_key_initialized); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_fmt("include/linux/jump_label_ratelimit.h", 33, "%s used before call to jump_label_init", __func__); __builtin_expect(!!(__ret_warn_on), 0); });
}
# 52 "include/linux/perf_event.h" 2


# 1 "include/linux/perf_regs.h" 1



struct perf_regs {
 __u64 abi;
 struct pt_regs *regs;
};
# 18 "include/linux/perf_regs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 perf_reg_value(struct pt_regs *regs, int idx)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int perf_reg_validate(u64 mask)
{
 return mask ? -90 : 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 perf_reg_abi(struct task_struct *task)
{
 return PERF_SAMPLE_REGS_ABI_NONE;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_get_regs_user(struct perf_regs *regs_user,
          struct pt_regs *regs,
          struct pt_regs *regs_user_copy)
{
 regs_user->regs = (((struct thread_info *)(current)->stack)->kregs);
 regs_user->abi = perf_reg_abi(current);
}
# 55 "include/linux/perf_event.h" 2

# 1 "arch/sparc/include/generated/asm/local.h" 1
# 57 "include/linux/perf_event.h" 2

struct perf_callchain_entry {
 __u64 nr;
 __u64 ip[127];
};

struct perf_raw_record {
 u32 size;
 void *data;
};
# 77 "include/linux/perf_event.h"
struct perf_branch_stack {
 __u64 nr;
 struct perf_branch_entry entries[0];
};

struct task_struct;




struct hw_perf_event_extra {
 u64 config;
 unsigned int reg;
 int alloc;
 int idx;
};

struct event_constraint;




struct hw_perf_event {

 union {
  struct {
   u64 config;
   u64 last_tag;
   unsigned long config_base;
   unsigned long event_base;
   int event_base_rdpmc;
   int idx;
   int last_cpu;
   int flags;

   struct hw_perf_event_extra extra_reg;
   struct hw_perf_event_extra branch_reg;

   struct event_constraint *constraint;
  };
  struct {
   struct hrtimer hrtimer;
  };
  struct {
   struct task_struct *tp_target;

   struct list_head tp_list;
  };
# 137 "include/linux/perf_event.h"
 };
 int state;
 local64_t prev_count;
 u64 sample_period;
 u64 last_period;
 local64_t period_left;
 u64 interrupts_seq;
 u64 interrupts;

 u64 freq_time_stamp;
 u64 freq_count_stamp;

};
# 158 "include/linux/perf_event.h"
struct perf_event;
# 173 "include/linux/perf_event.h"
struct pmu {
 struct list_head entry;

 struct module *module;
 struct device *dev;
 const struct attribute_group **attr_groups;
 const char *name;
 int type;




 int capabilities;

 int * pmu_disable_count;
 struct perf_cpu_context * pmu_cpu_context;
 int task_ctx_nr;
 int hrtimer_interval_ms;





 void (*pmu_enable) (struct pmu *pmu);
 void (*pmu_disable) (struct pmu *pmu);





 int (*event_init) (struct perf_event *event);





 void (*event_mapped) (struct perf_event *event);
 void (*event_unmapped) (struct perf_event *event);
# 220 "include/linux/perf_event.h"
 int (*add) (struct perf_event *event, int flags);
 void (*del) (struct perf_event *event, int flags);






 void (*start) (struct perf_event *event, int flags);
 void (*stop) (struct perf_event *event, int flags);




 void (*read) (struct perf_event *event);
# 244 "include/linux/perf_event.h"
 void (*start_txn) (struct pmu *pmu);






 int (*commit_txn) (struct pmu *pmu);




 void (*cancel_txn) (struct pmu *pmu);





 int (*event_idx) (struct perf_event *event);




 void (*flush_branch_stack) (void);
};




enum perf_event_active_state {
 PERF_EVENT_STATE_EXIT = -3,
 PERF_EVENT_STATE_ERROR = -2,
 PERF_EVENT_STATE_OFF = -1,
 PERF_EVENT_STATE_INACTIVE = 0,
 PERF_EVENT_STATE_ACTIVE = 1,
};

struct file;
struct perf_sample_data;

typedef void (*perf_overflow_handler_t)(struct perf_event *,
     struct perf_sample_data *,
     struct pt_regs *regs);

enum perf_group_flag {
 PERF_GROUP_SOFTWARE = 0x1,
};




struct swevent_hlist {
 struct hlist_head heads[(1 << 8)];
 struct callback_head callback_head;
};





struct perf_cgroup;
struct ring_buffer;




struct perf_event {






 struct list_head event_entry;
# 327 "include/linux/perf_event.h"
 struct list_head group_entry;
 struct list_head sibling_list;






 struct list_head migrate_entry;

 struct hlist_node hlist_entry;
 struct list_head active_entry;
 int nr_siblings;
 int group_flags;
 struct perf_event *group_leader;
 struct pmu *pmu;

 enum perf_event_active_state state;
 unsigned int attach_state;
 local64_t count;
 atomic64_t child_count;
# 358 "include/linux/perf_event.h"
 u64 total_time_enabled;
 u64 total_time_running;
# 371 "include/linux/perf_event.h"
 u64 tstamp_enabled;
 u64 tstamp_running;
 u64 tstamp_stopped;
# 383 "include/linux/perf_event.h"
 u64 shadow_ctx_time;

 struct perf_event_attr attr;
 u16 header_size;
 u16 id_header_size;
 u16 read_size;
 struct hw_perf_event hw;

 struct perf_event_context *ctx;
 atomic_long_t refcount;





 atomic64_t child_total_time_enabled;
 atomic64_t child_total_time_running;




 struct mutex child_mutex;
 struct list_head child_list;
 struct perf_event *parent;

 int oncpu;
 int cpu;

 struct list_head owner_entry;
 struct task_struct *owner;


 struct mutex mmap_mutex;
 atomic_t mmap_count;

 struct ring_buffer *rb;
 struct list_head rb_entry;
 unsigned long rcu_batches;
 int rcu_pending;


 wait_queue_head_t waitq;
 struct fasync_struct *fasync;


 int pending_wakeup;
 int pending_kill;
 int pending_disable;
 struct irq_work pending;

 atomic_t event_limit;

 void (*destroy)(struct perf_event *);
 struct callback_head callback_head;

 struct pid_namespace *ns;
 u64 id;

 perf_overflow_handler_t overflow_handler;
 void *overflow_handler_context;


 struct ftrace_event_call *tp_event;
 struct event_filter *filter;
# 458 "include/linux/perf_event.h"
};






struct perf_event_context {
 struct pmu *pmu;




 raw_spinlock_t lock;





 struct mutex mutex;

 struct list_head active_ctx_list;
 struct list_head pinned_groups;
 struct list_head flexible_groups;
 struct list_head event_list;
 int nr_events;
 int nr_active;
 int is_active;
 int nr_stat;
 int nr_freq;
 int rotate_disable;
 atomic_t refcount;
 struct task_struct *task;




 u64 time;
 u64 timestamp;





 struct perf_event_context *parent_ctx;
 u64 parent_gen;
 u64 generation;
 int pin_count;
 int nr_cgroups;
 int nr_branch_stack;
 struct callback_head callback_head;

 struct delayed_work orphans_remove;
 bool orphans_remove_sched;
};
# 523 "include/linux/perf_event.h"
struct perf_cpu_context {
 struct perf_event_context ctx;
 struct perf_event_context *task_ctx;
 int active_oncpu;
 int exclusive;
 struct hrtimer hrtimer;
 ktime_t hrtimer_interval;
 struct pmu *unique_pmu;
 struct perf_cgroup *cgrp;
};

struct perf_output_handle {
 struct perf_event *event;
 struct ring_buffer *rb;
 unsigned long wakeup;
 unsigned long size;
 void *addr;
 int page;
};



extern int perf_pmu_register(struct pmu *pmu, const char *name, int type);
extern void perf_pmu_unregister(struct pmu *pmu);

extern int perf_num_counters(void);
extern const char *perf_pmu_name(void);
extern void __perf_event_task_sched_in(struct task_struct *prev,
           struct task_struct *task);
extern void __perf_event_task_sched_out(struct task_struct *prev,
     struct task_struct *next);
extern int perf_event_init_task(struct task_struct *child);
extern void perf_event_exit_task(struct task_struct *child);
extern void perf_event_free_task(struct task_struct *task);
extern void perf_event_delayed_put(struct task_struct *task);
extern void perf_event_print_debug(void);
extern void perf_pmu_disable(struct pmu *pmu);
extern void perf_pmu_enable(struct pmu *pmu);
extern int perf_event_task_disable(void);
extern int perf_event_task_enable(void);
extern int perf_event_refresh(struct perf_event *event, int refresh);
extern void perf_event_update_userpage(struct perf_event *event);
extern int perf_event_release_kernel(struct perf_event *event);
extern struct perf_event *
perf_event_create_kernel_counter(struct perf_event_attr *attr,
    int cpu,
    struct task_struct *task,
    perf_overflow_handler_t callback,
    void *context);
extern void perf_pmu_migrate_context(struct pmu *pmu,
    int src_cpu, int dst_cpu);
extern u64 perf_event_read_value(struct perf_event *event,
     u64 *enabled, u64 *running);


struct perf_sample_data {




 u64 addr;
 struct perf_raw_record *raw;
 struct perf_branch_stack *br_stack;
 u64 period;
 u64 weight;
 u64 txn;
 union perf_mem_data_src data_src;





 u64 type;
 u64 ip;
 struct {
  u32 pid;
  u32 tid;
 } tid_entry;
 u64 time;
 u64 id;
 u64 stream_id;
 struct {
  u32 cpu;
  u32 reserved;
 } cpu_entry;
 struct perf_callchain_entry *callchain;





 struct perf_regs regs_user;
 struct pt_regs regs_user_copy;

 struct perf_regs regs_intr;
 u64 stack_user_size;
} __attribute__((__aligned__((1 << 6))));
# 628 "include/linux/perf_event.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_sample_data_init(struct perf_sample_data *data,
      u64 addr, u64 period)
{

 data->addr = addr;
 data->raw = ((void *)0);
 data->br_stack = ((void *)0);
 data->period = period;
 data->weight = 0;
 data->data_src.val = ((((__u64)0x01) << 0) | (((__u64)0x01) << 5) | (((__u64)0x01) << 19) | (((__u64)0x01) << 24) | (((__u64)0x01) << 26));
 data->txn = 0;
}

extern void perf_output_sample(struct perf_output_handle *handle,
          struct perf_event_header *header,
          struct perf_sample_data *data,
          struct perf_event *event);
extern void perf_prepare_sample(struct perf_event_header *header,
    struct perf_sample_data *data,
    struct perf_event *event,
    struct pt_regs *regs);

extern int perf_event_overflow(struct perf_event *event,
     struct perf_sample_data *data,
     struct pt_regs *regs);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_sampling_event(struct perf_event *event)
{
 return event->attr.sample_period != 0;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_software_event(struct perf_event *event)
{
 return event->pmu->task_ctx_nr == perf_sw_context;
}

extern struct static_key perf_swevent_enabled[PERF_COUNT_SW_MAX];

extern void ___perf_sw_event(u32, u64, struct pt_regs *, u64);
extern void __perf_sw_event(u32, u64, struct pt_regs *, u64);
# 684 "include/linux/perf_event.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_fetch_caller_regs(struct pt_regs *regs)
{
 __builtin_memset(regs, 0, sizeof(*regs));

 do { unsigned long _pstate, _asi, _pil, _i7, _fp; __asm__ __volatile__("rdpr %%pstate, %0\n\t" "rd %%asi, %1\n\t" "rdpr %%pil, %2\n\t" "mov %%i7, %3\n\t" "mov %%i6, %4\n\t" : "=r" (_pstate), "=r" (_asi), "=r" (_pil), "=r" (_i7), "=r" (_fp)); (regs)->tstate = (_pstate << 8) | (_asi << 24) | (_pil << 20); (regs)->tpc = (((unsigned long)__builtin_return_address(0))); (regs)->tnpc = (regs)->tpc + 4; (regs)->u_regs[14] = _fp; (regs)->u_regs[15] = _i7; } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void
perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)
{
 if (static_key_false(&perf_swevent_enabled[event_id]))
  __perf_sw_event(event_id, nr, regs, addr);
}

extern __attribute__((section(".data..percpu" ""))) __typeof__(struct pt_regs) __perf_regs[4];






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void
perf_sw_event_sched(u32 event_id, u64 nr, u64 addr)
{
 if (static_key_false(&perf_swevent_enabled[event_id])) {
  struct pt_regs *regs = ({ do { const void *__vpp_verify = (typeof((&__perf_regs[0]) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&__perf_regs[0])) *)(&__perf_regs[0]))); (typeof((typeof(*(&__perf_regs[0])) *)(&__perf_regs[0]))) (__ptr + ((__local_per_cpu_offset))); }); });

  perf_fetch_caller_regs(regs);
  ___perf_sw_event(event_id, nr, regs, addr);
 }
}

extern struct static_key_deferred perf_sched_events;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_event_task_sched_in(struct task_struct *prev,
         struct task_struct *task)
{
 if (static_key_false(&perf_sched_events.key))
  __perf_event_task_sched_in(prev, task);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_event_task_sched_out(struct task_struct *prev,
          struct task_struct *next)
{
 perf_sw_event_sched(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 0);

 if (static_key_false(&perf_sched_events.key))
  __perf_event_task_sched_out(prev, next);
}

extern void perf_event_mmap(struct vm_area_struct *vma);
extern struct perf_guest_info_callbacks *perf_guest_cbs;
extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);
extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);

extern void perf_event_exec(void);
extern void perf_event_comm(struct task_struct *tsk, bool exec);
extern void perf_event_fork(struct task_struct *tsk);


extern __attribute__((section(".data..percpu" ""))) __typeof__(struct perf_callchain_entry) perf_callchain_entry;

extern void perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs);
extern void perf_callchain_kernel(struct perf_callchain_entry *entry, struct pt_regs *regs);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_callchain_store(struct perf_callchain_entry *entry, u64 ip)
{
 if (entry->nr < 127)
  entry->ip[entry->nr++] = ip;
}

extern int sysctl_perf_event_paranoid;
extern int sysctl_perf_event_mlock;
extern int sysctl_perf_event_sample_rate;
extern int sysctl_perf_cpu_time_max_percent;

extern void perf_sample_event_took(u64 sample_len_ns);

extern int perf_proc_update_handler(struct ctl_table *table, int write,
  void *buffer, size_t *lenp,
  loff_t *ppos);
extern int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write,
  void *buffer, size_t *lenp,
  loff_t *ppos);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool perf_paranoid_tracepoint_raw(void)
{
 return sysctl_perf_event_paranoid > -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool perf_paranoid_cpu(void)
{
 return sysctl_perf_event_paranoid > 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool perf_paranoid_kernel(void)
{
 return sysctl_perf_event_paranoid > 1;
}

extern void perf_event_init(void);
extern void perf_tp_event(u64 addr, u64 count, void *record,
     int entry_size, struct pt_regs *regs,
     struct hlist_head *head, int rctx,
     struct task_struct *task);
extern void perf_bp_event(struct perf_event *event, void *data);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool has_branch_stack(struct perf_event *event)
{
 return event->attr.sample_type & PERF_SAMPLE_BRANCH_STACK;
}

extern int perf_output_begin(struct perf_output_handle *handle,
        struct perf_event *event, unsigned int size);
extern void perf_output_end(struct perf_output_handle *handle);
extern unsigned int perf_output_copy(struct perf_output_handle *handle,
        const void *buf, unsigned int len);
extern unsigned int perf_output_skip(struct perf_output_handle *handle,
         unsigned int len);
extern int perf_swevent_get_recursion_context(void);
extern void perf_swevent_put_recursion_context(int rctx);
extern u64 perf_swevent_set_period(struct perf_event *event);
extern void perf_event_enable(struct perf_event *event);
extern void perf_event_disable(struct perf_event *event);
extern int __perf_event_disable(void *info);
extern void perf_event_task_tick(void);
# 865 "include/linux/perf_event.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool perf_event_can_stop_tick(void) { return true; }





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_restore_debug_store(void) { }
# 911 "include/linux/perf_event.h"
struct perf_pmu_events_attr {
 struct device_attribute attr;
 u64 id;
 const char *event_str;
};

ssize_t perf_event_sysfs_show(struct device *dev, struct device_attribute *attr,
         char *page);
# 15 "arch/sparc/math-emu/math_64.c" 2



# 1 "./arch/sparc/include/asm/uaccess.h" 1



# 1 "./arch/sparc/include/asm/uaccess_64.h" 1
# 15 "./arch/sparc/include/asm/uaccess_64.h"
# 1 "include/asm-generic/uaccess-unaligned.h" 1
# 16 "./arch/sparc/include/asm/uaccess_64.h" 2
# 52 "./arch/sparc/include/asm/uaccess_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __access_ok(const void * addr, unsigned long size)
{
 return 1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int access_ok(int type, const void * addr, unsigned long size)
{
 return 1;
}
# 75 "./arch/sparc/include/asm/uaccess_64.h"
struct exception_table_entry {
        unsigned int insn, fixup;
};

void __ret_efault(void);
void __retl_efault(void);
# 106 "./arch/sparc/include/asm/uaccess_64.h"
struct __large_struct { unsigned long buf[100]; };
# 141 "./arch/sparc/include/asm/uaccess_64.h"
int __put_user_bad(void);
# 221 "./arch/sparc/include/asm/uaccess_64.h"
int __get_user_bad(void);

unsigned long __attribute__((warn_unused_result)) ___copy_from_user(void *to,
          const void *from,
          unsigned long size);
unsigned long copy_from_user_fixup(void *to, const void *from,
       unsigned long size);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __attribute__((warn_unused_result))
copy_from_user(void *to, const void *from, unsigned long size)
{
 unsigned long ret = ___copy_from_user(to, from, size);

 if (__builtin_expect(!!(ret), 0))
  ret = copy_from_user_fixup(to, from, size);

 return ret;
}


unsigned long __attribute__((warn_unused_result)) ___copy_to_user(void *to,
        const void *from,
        unsigned long size);
unsigned long copy_to_user_fixup(void *to, const void *from,
     unsigned long size);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __attribute__((warn_unused_result))
copy_to_user(void *to, const void *from, unsigned long size)
{
 unsigned long ret = ___copy_to_user(to, from, size);

 if (__builtin_expect(!!(ret), 0))
  ret = copy_to_user_fixup(to, from, size);
 return ret;
}


unsigned long __attribute__((warn_unused_result)) ___copy_in_user(void *to,
        const void *from,
        unsigned long size);
unsigned long copy_in_user_fixup(void *to, void *from,
     unsigned long size);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __attribute__((warn_unused_result))
copy_in_user(void *to, void *from, unsigned long size)
{
 unsigned long ret = ___copy_in_user(to, from, size);

 if (__builtin_expect(!!(ret), 0))
  ret = copy_in_user_fixup(to, from, size);
 return ret;
}


unsigned long __attribute__((warn_unused_result)) __clear_user(void *, unsigned long);



__attribute__((warn_unused_result)) long strlen_user(const char *str);
__attribute__((warn_unused_result)) long strnlen_user(const char *str, long n);




struct pt_regs;
unsigned long compute_effective_address(struct pt_regs *,
     unsigned int insn,
     unsigned int rd);
# 5 "./arch/sparc/include/asm/uaccess.h" 2







long strncpy_from_user(char *dest, const char *src, long count);
# 19 "arch/sparc/math-emu/math_64.c" 2
# 1 "./arch/sparc/include/asm/cacheflush.h" 1







# 1 "./arch/sparc/include/asm/cacheflush_64.h" 1
# 13 "./arch/sparc/include/asm/cacheflush_64.h"
void __flushw_user(void);
# 33 "./arch/sparc/include/asm/cacheflush_64.h"
void flush_icache_range(unsigned long start, unsigned long end);
void __flush_icache_page(unsigned long);

void __flush_dcache_page(void *addr, int flush_icache);
void flush_dcache_page_impl(struct page *page);

void smp_flush_dcache_page_impl(struct page *page, int cpu);
void flush_dcache_page_all(struct mm_struct *mm, struct page *page);





void __flush_dcache_range(unsigned long start, unsigned long end);

void flush_dcache_page(struct page *page);




void flush_ptrace_access(struct vm_area_struct *, struct page *,
    unsigned long uaddr, void *kaddr,
    unsigned long len, int write);
# 9 "./arch/sparc/include/asm/cacheflush.h" 2
# 20 "arch/sparc/math-emu/math_64.c" 2

# 1 "arch/sparc/math-emu/sfp-util_64.h" 1
# 22 "arch/sparc/math-emu/math_64.c" 2
# 1 "include/math-emu/soft-fp.h" 1
# 38 "include/math-emu/soft-fp.h"
# 1 "./arch/sparc/include/asm/sfp-machine.h" 1



# 1 "./arch/sparc/include/asm/sfp-machine_64.h" 1
# 5 "./arch/sparc/include/asm/sfp-machine.h" 2
# 39 "include/math-emu/soft-fp.h" 2
# 285 "include/math-emu/soft-fp.h"
# 1 "include/math-emu/op-1.h" 1
# 286 "include/math-emu/soft-fp.h" 2
# 1 "include/math-emu/op-2.h" 1
# 287 "include/math-emu/soft-fp.h" 2
# 1 "include/math-emu/op-4.h" 1
# 288 "include/math-emu/soft-fp.h" 2
# 1 "include/math-emu/op-8.h" 1
# 289 "include/math-emu/soft-fp.h" 2
# 1 "include/math-emu/op-common.h" 1
# 290 "include/math-emu/soft-fp.h" 2
# 302 "include/math-emu/soft-fp.h"
typedef int QItype __attribute__ ((mode (QI)));
typedef int SItype __attribute__ ((mode (SI)));
typedef int DItype __attribute__ ((mode (DI)));
typedef unsigned int UQItype __attribute__ ((mode (QI)));
typedef unsigned int USItype __attribute__ ((mode (SI)));
typedef unsigned int UDItype __attribute__ ((mode (DI)));



typedef USItype UHWtype;
# 23 "arch/sparc/math-emu/math_64.c" 2
# 1 "include/math-emu/single.h" 1
# 69 "include/math-emu/single.h"
typedef float SFtype __attribute__ ((mode (SF)));

union _FP_UNION_S
{
  SFtype flt;
  struct
  {

    unsigned sign : 1;
    unsigned exp : 8;
    unsigned frac : 24 - (((unsigned long) 1 << (24 -1)) != 0);





  } bits __attribute__ ((packed));
};
# 24 "arch/sparc/math-emu/math_64.c" 2
# 1 "include/math-emu/double.h" 1
# 72 "include/math-emu/double.h"
typedef float DFtype __attribute__ ((mode (DF)));
# 199 "include/math-emu/double.h"
union _FP_UNION_D
{
  DFtype flt;
  struct
  {

    unsigned sign : 1;
    unsigned exp : 11;
    unsigned long frac : 53 - (((unsigned long) 1 << (53 -1) % 64) != 0);





  } bits __attribute__ ((packed));
};
# 25 "arch/sparc/math-emu/math_64.c" 2
# 1 "include/math-emu/quad.h" 1
# 72 "include/math-emu/quad.h"
typedef float TFtype __attribute__ ((mode (TF)));
# 203 "include/math-emu/quad.h"
union _FP_UNION_Q
{
  TFtype flt ;
  struct
  {
    unsigned long a, b;
  } longs;
  struct
  {

    unsigned sign : 1;
    unsigned exp : 15;
    unsigned long frac1 : 113 - (((unsigned long) 1 << (113 -1) % 64) != 0) - 64;
    unsigned long frac0 : 64;






  } bits;
};
# 26 "arch/sparc/math-emu/math_64.c" 2
# 100 "arch/sparc/math-emu/math_64.c"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int record_exception(struct pt_regs *regs, int eflag)
{
 u64 fsr = (current_thread_info_reg)->xfsr[0];
 int would_trap;


 would_trap = (fsr & ((long)eflag << 23UL)) != 0UL;


 if(would_trap != 0) {
  eflag &= ((fsr & (0x1fUL << 23UL)) >> 23UL);
  if((eflag & (eflag - 1)) != 0) {
   if(eflag & (1 << 4))
    eflag = (1 << 4);
   else if(eflag & (1 << 3))
    eflag = (1 << 3);
   else if(eflag & (1 << 2))
    eflag = (1 << 2);
   else if(eflag & (1 << 1))
    eflag = (1 << 1);
   else if(eflag & (1 << 0))
    eflag = (1 << 0);
  }
 }







 fsr &= ~((0x1fUL << 0UL));
 fsr |= ((long)eflag << 0UL);







 if(would_trap == 0)
  fsr |= ((long)eflag << 5UL);


 if(would_trap != 0)
  fsr |= (1UL << 14);

 (current_thread_info_reg)->xfsr[0] = fsr;




 if(would_trap == 0) {
  regs->tpc = regs->tnpc;
  regs->tnpc += 4;
 }

 return (would_trap ? 0 : 1);
}

typedef union {
 u32 s;
 u64 d;
 u64 q[2];
} *argp;

int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
{
 unsigned long pc = regs->tpc;
 unsigned long tstate = regs->tstate;
 u32 insn = 0;
 int type = 0;






 int freg;
 static u64 zero[2] = { 0L, 0L };
 int flags;
 int _fex = 0;
 long SA_c __attribute__ ((unused)) = 0; long SA_s __attribute__ ((unused)) = 0; long SA_e __attribute__ ((unused)) = 0; unsigned long SA_f = 0; long SB_c __attribute__ ((unused)) = 0; long SB_s __attribute__ ((unused)) = 0; long SB_e __attribute__ ((unused)) = 0; unsigned long SB_f = 0; long SR_c __attribute__ ((unused)) = 0; long SR_s __attribute__ ((unused)) = 0; long SR_e __attribute__ ((unused)) = 0; unsigned long SR_f = 0;
 long DA_c __attribute__ ((unused)) = 0; long DA_s __attribute__ ((unused)) = 0; long DA_e __attribute__ ((unused)) = 0; unsigned long DA_f = 0; long DB_c __attribute__ ((unused)) = 0; long DB_s __attribute__ ((unused)) = 0; long DB_e __attribute__ ((unused)) = 0; unsigned long DB_f = 0; long DR_c __attribute__ ((unused)) = 0; long DR_s __attribute__ ((unused)) = 0; long DR_e __attribute__ ((unused)) = 0; unsigned long DR_f = 0;
 long QA_c __attribute__ ((unused)) = 0; long QA_s __attribute__ ((unused)) = 0; long QA_e __attribute__ ((unused)) = 0; unsigned long QA_f0 = 0, QA_f1 = 0; long QB_c __attribute__ ((unused)) = 0; long QB_s __attribute__ ((unused)) = 0; long QB_e __attribute__ ((unused)) = 0; unsigned long QB_f0 = 0, QB_f1 = 0; long QR_c __attribute__ ((unused)) = 0; long QR_s __attribute__ ((unused)) = 0; long QR_e __attribute__ ((unused)) = 0; unsigned long QR_f0 = 0, QR_f1 = 0;
 int IR;
 unsigned int UIR;
 long XR, xfsr;
 unsigned long UXR;

 if (tstate & (0x0000000000000400UL))
  die_if_kernel("unfinished/unimplemented FPop from kernel", regs);
 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);
 if (test_ti_thread_flag((current_thread_info_reg), 7))
  pc = (u32)pc;
 if (({ unsigned long __gu_addr = (unsigned long)((u32 *) pc); (void)0; ({ register int __gu_ret; register unsigned long __gu_val; switch (sizeof(*((u32 *) pc))) { case 1: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""ub" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 2: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""uh" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 4: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""uw" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 8: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""x" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; default: __gu_val = 0; __gu_ret = __get_user_bad(); break; } (insn) = ( __typeof__(*((u32 *) pc))) __gu_val; __gu_ret; });}) != -14) {
  if ((insn & 0xc1f80000) == 0x81a00000) {
   switch ((insn >> 5) & 0x1ff) {

   case 0x003:
   case 0x007:
   case 0x00b: type = (0 << 2) | (0 << 0) | (0 << 6) | (3 << 4) | (0 << 10) | (3 << 8) | (3 << 12); break;
   case 0x02b: type = (0 << 2) | (0 << 0) | (3 << 6) | (3 << 4) | (3 << 10) | (3 << 8) | (3 << 12); break;
   case 0x043:
   case 0x047: type = (2 << 2) | (3 << 0) | (2 << 6) | (3 << 4) | (2 << 10) | (3 << 8) | (3 << 12); break;
   case 0x04b:
   case 0x04f: type = (3 << 2) | (3 << 0) | (3 << 6) | (3 << 4) | (3 << 10) | (3 << 8) | (3 << 12); break;
   case 0x06e: type = (1 << 2) | (2 << 0) | (1 << 6) | (2 << 4) | (3 << 10) | (3 << 8) | (3 << 12); break;
   case 0x083: type = (0 << 2) | (0 << 0) | (1 << 6) | (3 << 4) | (0 << 10) | (2 << 8) | (3 << 12); break;
   case 0x08c: type = (0 << 2) | (0 << 0) | (0 << 6) | (2 << 4) | (1 << 10) | (3 << 8) | (3 << 12); break;
   case 0x0c7: type = (0 << 2) | (0 << 0) | (2 << 6) | (3 << 4) | (2 << 10) | (1 << 8) | (3 << 12); break;
   case 0x0cb: type = (0 << 2) | (0 << 0) | (2 << 6) | (3 << 4) | (2 << 10) | (2 << 8) | (3 << 12); break;
   case 0x0cc: type = (0 << 2) | (0 << 0) | (0 << 6) | (1 << 4) | (1 << 10) | (3 << 8) | (3 << 12); break;
   case 0x0cd: type = (0 << 2) | (0 << 0) | (1 << 6) | (1 << 4) | (1 << 10) | (3 << 8) | (3 << 12); break;
   case 0x0ce: type = (0 << 2) | (0 << 0) | (1 << 6) | (2 << 4) | (1 << 10) | (3 << 8) | (3 << 12); break;
   case 0x0d3: type = (0 << 2) | (0 << 0) | (1 << 6) | (3 << 4) | (0 << 10) | (1 << 8) | (3 << 12); break;






   case 0x029: {
    unsigned long x = (current_thread_info_reg)->xfsr[0];

    x = (x >> 14) & 0x7;
    type = (0 << 2) | (0 << 0) | (3 << 6) | (1 << 4) | (3 << 10) | (1 << 8) | (x << 12);
    break;
   }

   case 0x02a: {
    unsigned long x = (current_thread_info_reg)->xfsr[0];

    x = (x >> 14) & 0x7;
    type = (0 << 2) | (0 << 0) | (3 << 6) | (2 << 4) | (3 << 10) | (2 << 8) | (x << 12);
    break;
   }


   case 0x042:
   case 0x046: type = (2 << 2) | (2 << 0) | (2 << 6) | (2 << 4) | (2 << 10) | (2 << 8) | (2 << 12); break;
   case 0x04a:
   case 0x04e: type = (3 << 2) | (2 << 0) | (3 << 6) | (2 << 4) | (3 << 10) | (2 << 8) | (2 << 12); break;
   case 0x041:
   case 0x045: type = (2 << 2) | (1 << 0) | (2 << 6) | (1 << 4) | (2 << 10) | (1 << 8) | (2 << 12); break;
   case 0x049:
   case 0x04d: type = (3 << 2) | (1 << 0) | (3 << 6) | (1 << 4) | (3 << 10) | (1 << 8) | (2 << 12); break;
   case 0x069: type = (1 << 2) | (1 << 0) | (1 << 6) | (1 << 4) | (3 << 10) | (2 << 8) | (2 << 12); break;
   case 0x081: type = (0 << 2) | (0 << 0) | (1 << 6) | (1 << 4) | (0 << 10) | (2 << 8) | (2 << 12); break;
   case 0x082: type = (0 << 2) | (0 << 0) | (1 << 6) | (2 << 4) | (0 << 10) | (2 << 8) | (2 << 12); break;
   case 0x0c6: type = (0 << 2) | (0 << 0) | (2 << 6) | (2 << 4) | (2 << 10) | (1 << 8) | (2 << 12); break;
   case 0x0c9: type = (0 << 2) | (0 << 0) | (1 << 6) | (1 << 4) | (1 << 10) | (2 << 8) | (2 << 12); break;
   case 0x0d1: type = (0 << 2) | (0 << 0) | (1 << 6) | (1 << 4) | (0 << 10) | (1 << 8) | (2 << 12); break;
   case 0x0d2: type = (0 << 2) | (0 << 0) | (1 << 6) | (2 << 4) | (0 << 10) | (1 << 8) | (2 << 12); break;


   case 0x084: type = (0 << 2) | (0 << 0) | (0 << 6) | (2 << 4) | (1 << 10) | (1 << 8) | (2 << 12); break;
   case 0x088: type = (0 << 2) | (0 << 0) | (0 << 6) | (2 << 4) | (1 << 10) | (2 << 8) | (2 << 12); break;



   case 0x0c8: type = (0 << 2) | (0 << 0) | (0 << 6) | (1 << 4) | (1 << 10) | (2 << 8) | (2 << 12); break;
   }
  }
  else if ((insn & 0xc1f80000) == 0x81a80000) {
   IR = 2;
   switch ((insn >> 5) & 0x1ff) {
   case 0x053: type = (1 << 2) | (3 << 0) | (1 << 6) | (3 << 4) | (0 << 10) | (0 << 8) | (3 << 12); break;
   case 0x057: type = (1 << 2) | (3 << 0) | (1 << 6) | (3 << 4) | (0 << 10) | (0 << 8) | (3 << 12); break;

   case 0x003:
   case 0x043:
   case 0x083:
   case 0x0c3:

    if (!((insn >> 11) & 3))
     XR = (current_thread_info_reg)->xfsr[0] >> 10;
    else
     XR = (current_thread_info_reg)->xfsr[0] >> (30 + ((insn >> 10) & 0x6));
    XR &= 3;
    IR = 0;
    switch ((insn >> 14) & 0x7) {

    case 1: if (XR) IR = 1; break;
    case 2: if (XR == 1 || XR == 2) IR = 1; break;
    case 3: if (XR & 1) IR = 1; break;
    case 4: if (XR == 1) IR = 1; break;
    case 5: if (XR & 2) IR = 1; break;
    case 6: if (XR == 2) IR = 1; break;
    case 7: if (XR == 3) IR = 1; break;
    }
    if ((insn >> 14) & 8)
     IR ^= 1;
    break;
   case 0x103:
   case 0x183:

    XR = regs->tstate >> 32;
    if ((insn >> 5) & 0x80)
     XR >>= 4;
    XR &= 0xf;
    IR = 0;
    freg = ((XR >> 2) ^ XR) & 2;
    switch ((insn >> 14) & 0x7) {

    case 1: if (XR & 4) IR = 1; break;
    case 2: if ((XR & 4) || freg) IR = 1; break;
    case 3: if (freg) IR = 1; break;
    case 4: if (XR & 5) IR = 1; break;
    case 5: if (XR & 1) IR = 1; break;
    case 6: if (XR & 8) IR = 1; break;
    case 7: if (XR & 2) IR = 1; break;
    }
    if ((insn >> 14) & 8)
     IR ^= 1;
    break;
   case 0x027:
   case 0x047:
   case 0x067:
   case 0x0a7:
   case 0x0c7:
   case 0x0e7:
    freg = (insn >> 14) & 0x1f;
    if (!freg)
     XR = 0;
    else if (freg < 16)
     XR = regs->u_regs[freg];
    else if (!((test_ti_thread_flag((current_thread_info_reg), 7) && !(((regs->u_regs[14]) & 0x1) != 0)) ? false : true)) {
     struct reg_window32 *win32;
     __flushw_user();
     win32 = (struct reg_window32 *)((unsigned long)((u32)regs->u_regs[14]));
     ({ unsigned long __gu_addr = (unsigned long)(&win32->locals[freg - 16]); (void)0; ({ register int __gu_ret; register unsigned long __gu_val; switch (sizeof(*(&win32->locals[freg - 16]))) { case 1: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""ub" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 2: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""uh" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 4: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""uw" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 8: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""x" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; default: __gu_val = 0; __gu_ret = __get_user_bad(); break; } (XR) = ( __typeof__(*(&win32->locals[freg - 16]))) __gu_val; __gu_ret; });});
    } else {
     struct reg_window *win;
     __flushw_user();
     win = (struct reg_window *)(regs->u_regs[14] + 2047);
     ({ unsigned long __gu_addr = (unsigned long)(&win->locals[freg - 16]); (void)0; ({ register int __gu_ret; register unsigned long __gu_val; switch (sizeof(*(&win->locals[freg - 16]))) { case 1: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""ub" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 2: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""uh" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 4: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""uw" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 8: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""x" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; default: __gu_val = 0; __gu_ret = __get_user_bad(); break; } (XR) = ( __typeof__(*(&win->locals[freg - 16]))) __gu_val; __gu_ret; });});
    }
    IR = 0;
    switch ((insn >> 10) & 3) {
    case 1: if (!XR) IR = 1; break;
    case 2: if (XR <= 0) IR = 1; break;
    case 3: if (XR < 0) IR = 1; break;
    }
    if ((insn >> 10) & 4)
     IR ^= 1;
    break;
   }
   if (IR == 0) {

    (current_thread_info_reg)->xfsr[0] &= ~((0x1fUL << 0UL));
    regs->tpc = regs->tnpc;
    regs->tnpc += 4;
    return 1;
   } else if (IR == 1) {

    insn = (insn & 0x3e00001f) | 0x81a00060;
    type = (0 << 2) | (0 << 0) | (0 << 6) | (3 << 4) | (0 << 10) | (3 << 8) | (3 << 12);
   }
  }
 }
 if (type) {
  argp rs1 = ((void *)0), rs2 = ((void *)0), rd = ((void *)0);







  if (!illegal_insn_trap) {
   int ftt = ((current_thread_info_reg)->xfsr[0] >> 14) & 0x7;
   if (ftt != (type >> 12))
    goto err;
  }
  (current_thread_info_reg)->xfsr[0] &= ~0x1c000;
  freg = ((insn >> 14) & 0x1f);
  switch (type & 0x3) {
  case 3: if (freg & 2) {
    (current_thread_info_reg)->xfsr[0] |= (6 << 14) ;
    goto err;
   }
  case 2: freg = ((freg & 1) << 5) | (freg & 0x1e);
  case 1: rs1 = (argp)&f->regs[freg];
   flags = (freg < 32) ? (0x0000000000000001UL) : (0x0000000000000002UL);
   if (!((current_thread_info_reg)->fpsaved[0] & flags))
    rs1 = (argp)&zero;
   break;
  }
  switch (type & 0xf) {
  case 7: do { union _FP_UNION_Q *_FP_UNPACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rs1)); QA_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0; QA_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1; QA_e = _FP_UNPACK_RAW_2_P_flo->bits.exp; QA_s = _FP_UNPACK_RAW_2_P_flo->bits.sign; } while (0); break;
  case 6: do { union _FP_UNION_D *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rs1)); DA_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; DA_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; DA_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); break;
  case 5: do { union _FP_UNION_S *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rs1)); SA_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; SA_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; SA_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); break;
  case 11: do { do { union _FP_UNION_Q *_FP_UNPACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rs1)); QA_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0; QA_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1; QA_e = _FP_UNPACK_RAW_2_P_flo->bits.exp; QA_s = _FP_UNPACK_RAW_2_P_flo->bits.sign; } while (0); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << (3) | QA_f0 >> (64 - (3)); QA_f0 <<= (3); } 0; }) : ({ QA_f1 = QA_f0 << ((3) - 64); QA_f0 = 0; })); } while (0); break;
  case 10: do { do { union _FP_UNION_D *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rs1)); DA_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; DA_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; DA_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) DA_f += DA_f; else DA_f <<= (3); } while (0); } while (0); break;
  case 9: do { do { union _FP_UNION_S *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rs1)); SA_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; SA_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; SA_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) SA_f += SA_f; else SA_f <<= (3); } while (0); } while (0); break;
  case 15: do { do { union _FP_UNION_Q *_FP_UNPACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rs1)); QA_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0; QA_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1; QA_e = _FP_UNPACK_RAW_2_P_flo->bits.exp; QA_s = _FP_UNPACK_RAW_2_P_flo->bits.sign; } while (0); do { switch (QA_e) { default: (QA_f1) |= ((unsigned long) 1 << (113 -1) % 64); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << (3) | QA_f0 >> (64 - (3)); QA_f0 <<= (3); } 0; }) : ({ QA_f1 = QA_f0 << ((3) - 64); QA_f0 = 0; })); QA_e -= 16383; QA_c = 0; break; case 0: if (((QA_f1 | QA_f0) == 0)) QA_c = 1; else if (0) { QA_c = 1; (QA_f0 = 0, QA_f1 = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (QA_f1) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QA_f1); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QA_f1); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QA_f1); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QA_f0); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QA_f0); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QA_f0); else return 0; } while (0); (_FP_UNPACK_CANONICAL_shift) += 64; } } while (0); _FP_UNPACK_CANONICAL_shift -= ((2*64) - 113); (void) ((((_FP_UNPACK_CANONICAL_shift + 3)) < 64) ? ({ if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << ((_FP_UNPACK_CANONICAL_shift + 3)) | QA_f0 >> (64 - ((_FP_UNPACK_CANONICAL_shift + 3))); QA_f0 <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } 0; }) : ({ QA_f1 = QA_f0 << (((_FP_UNPACK_CANONICAL_shift + 3)) - 64); QA_f0 = 0; })); QA_e -= (16383 - 1 + _FP_UNPACK_CANONICAL_shift); QA_c = 0; _fex |= (0); } break; case 32767: if (((QA_f1 | QA_f0) == 0)) QA_c = 2; else { QA_c = 3; if (((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0); } while (0); break;
  case 14: do { do { union _FP_UNION_D *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rs1)); DA_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; DA_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; DA_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { switch (DA_e) { default: (DA_f) |= ((unsigned long) 1 << (53 -1) % 64); do { if (__builtin_constant_p (3) && (3) == 1) DA_f += DA_f; else DA_f <<= (3); } while (0); DA_e -= 1023; DA_c = 0; break; case 0: if ((DA_f == 0)) DA_c = 1; else if (0) { DA_c = 1; (DA_f = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (DA_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (DA_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (DA_f); else return 0; } while (0); _FP_UNPACK_CANONICAL_shift -= (64 - 53); do { if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) DA_f += DA_f; else DA_f <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } while (0); DA_e -= (1023 - 1 + _FP_UNPACK_CANONICAL_shift); DA_c = 0; _fex |= (0); } break; case 2047: if ((DA_f == 0)) DA_c = 2; else { DA_c = 3; if (((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0); } while (0); break;
  case 13: do { do { union _FP_UNION_S *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rs1)); SA_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; SA_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; SA_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { switch (SA_e) { default: (SA_f) |= ((unsigned long) 1 << (24 -1)); do { if (__builtin_constant_p (3) && (3) == 1) SA_f += SA_f; else SA_f <<= (3); } while (0); SA_e -= 127; SA_c = 0; break; case 0: if ((SA_f == 0)) SA_c = 1; else if (0) { SA_c = 1; (SA_f = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (SA_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (SA_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (SA_f); else return 0; } while (0); _FP_UNPACK_CANONICAL_shift -= (64 - 24); do { if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) SA_f += SA_f; else SA_f <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } while (0); SA_e -= (127 - 1 + _FP_UNPACK_CANONICAL_shift); SA_c = 0; _fex |= (0); } break; case 255: if ((SA_f == 0)) SA_c = 2; else { SA_c = 3; if (((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2))) : !((SA_f) & ((unsigned long) 1 << (24 -2))))) _fex |= ((1 << 4) | 0); } break; } } while (0); } while (0); break;
  }
  freg = (insn & 0x1f);
  switch ((type >> 4) & 0x3) {
  case 3: if (freg & 2) {
    (current_thread_info_reg)->xfsr[0] |= (6 << 14) ;
    goto err;
   }
  case 2: freg = ((freg & 1) << 5) | (freg & 0x1e);
  case 1: rs2 = (argp)&f->regs[freg];
   flags = (freg < 32) ? (0x0000000000000001UL) : (0x0000000000000002UL);
   if (!((current_thread_info_reg)->fpsaved[0] & flags))
    rs2 = (argp)&zero;
   break;
  }
  switch ((type >> 4) & 0xf) {
  case 7: do { union _FP_UNION_Q *_FP_UNPACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rs2)); QB_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0; QB_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1; QB_e = _FP_UNPACK_RAW_2_P_flo->bits.exp; QB_s = _FP_UNPACK_RAW_2_P_flo->bits.sign; } while (0); break;
  case 6: do { union _FP_UNION_D *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rs2)); DB_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; DB_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; DB_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); break;
  case 5: do { union _FP_UNION_S *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rs2)); SB_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; SB_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; SB_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); break;
  case 11: do { do { union _FP_UNION_Q *_FP_UNPACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rs2)); QB_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0; QB_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1; QB_e = _FP_UNPACK_RAW_2_P_flo->bits.exp; QB_s = _FP_UNPACK_RAW_2_P_flo->bits.sign; } while (0); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (3) | QB_f0 >> (64 - (3)); QB_f0 <<= (3); } 0; }) : ({ QB_f1 = QB_f0 << ((3) - 64); QB_f0 = 0; })); } while (0); break;
  case 10: do { do { union _FP_UNION_D *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rs2)); DB_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; DB_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; DB_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) DB_f += DB_f; else DB_f <<= (3); } while (0); } while (0); break;
  case 9: do { do { union _FP_UNION_S *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rs2)); SB_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; SB_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; SB_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) SB_f += SB_f; else SB_f <<= (3); } while (0); } while (0); break;
  case 15: do { do { union _FP_UNION_Q *_FP_UNPACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rs2)); QB_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0; QB_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1; QB_e = _FP_UNPACK_RAW_2_P_flo->bits.exp; QB_s = _FP_UNPACK_RAW_2_P_flo->bits.sign; } while (0); do { switch (QB_e) { default: (QB_f1) |= ((unsigned long) 1 << (113 -1) % 64); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (3) | QB_f0 >> (64 - (3)); QB_f0 <<= (3); } 0; }) : ({ QB_f1 = QB_f0 << ((3) - 64); QB_f0 = 0; })); QB_e -= 16383; QB_c = 0; break; case 0: if (((QB_f1 | QB_f0) == 0)) QB_c = 1; else if (0) { QB_c = 1; (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (QB_f1) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QB_f1); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QB_f1); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QB_f1); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QB_f0); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QB_f0); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QB_f0); else return 0; } while (0); (_FP_UNPACK_CANONICAL_shift) += 64; } } while (0); _FP_UNPACK_CANONICAL_shift -= ((2*64) - 113); (void) ((((_FP_UNPACK_CANONICAL_shift + 3)) < 64) ? ({ if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << ((_FP_UNPACK_CANONICAL_shift + 3)) | QB_f0 >> (64 - ((_FP_UNPACK_CANONICAL_shift + 3))); QB_f0 <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } 0; }) : ({ QB_f1 = QB_f0 << (((_FP_UNPACK_CANONICAL_shift + 3)) - 64); QB_f0 = 0; })); QB_e -= (16383 - 1 + _FP_UNPACK_CANONICAL_shift); QB_c = 0; _fex |= (0); } break; case 32767: if (((QB_f1 | QB_f0) == 0)) QB_c = 2; else { QB_c = 3; if (((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0); } while (0); break;
  case 14: do { do { union _FP_UNION_D *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rs2)); DB_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; DB_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; DB_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { switch (DB_e) { default: (DB_f) |= ((unsigned long) 1 << (53 -1) % 64); do { if (__builtin_constant_p (3) && (3) == 1) DB_f += DB_f; else DB_f <<= (3); } while (0); DB_e -= 1023; DB_c = 0; break; case 0: if ((DB_f == 0)) DB_c = 1; else if (0) { DB_c = 1; (DB_f = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (DB_f); else return 0; } while (0); _FP_UNPACK_CANONICAL_shift -= (64 - 53); do { if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) DB_f += DB_f; else DB_f <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } while (0); DB_e -= (1023 - 1 + _FP_UNPACK_CANONICAL_shift); DB_c = 0; _fex |= (0); } break; case 2047: if ((DB_f == 0)) DB_c = 2; else { DB_c = 3; if (((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0); } while (0); break;
  case 13: do { do { union _FP_UNION_S *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rs2)); SB_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; SB_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; SB_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { switch (SB_e) { default: (SB_f) |= ((unsigned long) 1 << (24 -1)); do { if (__builtin_constant_p (3) && (3) == 1) SB_f += SB_f; else SB_f <<= (3); } while (0); SB_e -= 127; SB_c = 0; break; case 0: if ((SB_f == 0)) SB_c = 1; else if (0) { SB_c = 1; (SB_f = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (SB_f); else return 0; } while (0); _FP_UNPACK_CANONICAL_shift -= (64 - 24); do { if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) SB_f += SB_f; else SB_f <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } while (0); SB_e -= (127 - 1 + _FP_UNPACK_CANONICAL_shift); SB_c = 0; _fex |= (0); } break; case 255: if ((SB_f == 0)) SB_c = 2; else { SB_c = 3; if (((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _fex |= ((1 << 4) | 0); } break; } } while (0); } while (0); break;
  }
  freg = ((insn >> 25) & 0x1f);
  switch ((type >> 8) & 0x3) {
  case 3: if (freg & 2) {
    (current_thread_info_reg)->xfsr[0] |= (6 << 14) ;
    goto err;
   }
  case 2: freg = ((freg & 1) << 5) | (freg & 0x1e);
  case 1: rd = (argp)&f->regs[freg];
   flags = (freg < 32) ? (0x0000000000000001UL) : (0x0000000000000002UL);
   if (!((current_thread_info_reg)->fpsaved[0] & (0x0000000000000004UL))) {
    (current_thread_info_reg)->fpsaved[0] = (0x0000000000000004UL);
    (current_thread_info_reg)->gsr[0] = 0;
   }
   if (!((current_thread_info_reg)->fpsaved[0] & flags)) {
    if (freg < 32)
     __builtin_memset(f->regs, 0, 32*sizeof(u32));
    else
     __builtin_memset(f->regs+32, 0, 32*sizeof(u32));
   }
   (current_thread_info_reg)->fpsaved[0] |= flags;
   break;
  }
  switch ((insn >> 5) & 0x1ff) {

  case 0x041: do { do { if (0 && SA_e == 0 && !(SA_f == 0)) { (SA_f = 0); _fex |= (0); } } while (0); do { if (0 && SB_e == 0 && !(SB_f == 0)) { (SB_f = 0); _fex |= (0); } } while (0); if (SA_s == SB_s) { __label__ add1, add2, add3, add_done; SR_s = SA_s; int _FP_ADD_INTERNAL_ediff = SA_e - SB_e; if (_FP_ADD_INTERNAL_ediff > 0) { SR_e = SA_e; if (SB_e == 0) { if ((SB_f == 0)) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SA_f + SB_f); goto add3; } if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto add_done; } goto add1; } } else if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto add_done; } (SB_f) |= ((unsigned long) 1 << (24 -1+3)); add1: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SB_f = (SB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SB_f & 1 : (SB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SB_f == 0)) (SB_f = 1); (SR_f = SA_f + SB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; SR_e = SB_e; if (SA_e == 0) { if ((SA_f == 0)) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SB_f + SA_f); goto add3; } if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto add_done; } goto add2; } } else if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto add_done; } (SA_f) |= ((unsigned long) 1 << (24 -1+3)); add2: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SA_f = (SA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SA_f & 1 : (SA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SA_f == 0)) (SA_f = 1); (SR_f = SB_f + SA_f); } else { if (!(((SA_e + 1) & 255) > 1)) { if (SA_e == 0) { SR_e = 0; if ((SA_f == 0)) { if (!(SB_f == 0)) _fex |= (0); (SR_f = SB_f); goto add_done; } else if ((SB_f == 0)) { _fex |= (0); (SR_f = SA_f); goto add_done; } else { _fex |= (0); (SR_f = SA_f + SB_f); if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); SR_e = 1; } goto add_done; } } else { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); SR_e = 255; if ((SA_f == 0)) (SR_f = SB_f); else if ((SB_f == 0)) (SR_f = SA_f); else do { (SA_f >>= 3); (SB_f >>= 3); do { if (((SB_f) & ((unsigned long) 1 << (24 -2))) && !((SA_f) & ((unsigned long) 1 << (24 -2)))) { SR_s = SA_s; (SR_f = SA_f); } else { SR_s = SB_s; (SR_f = SB_f); } SR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); } while (0); goto add_done; } } (SR_f = SA_f + SB_f); SR_e = SA_e + 1; (SR_f = (SR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? SR_f & 1 : (SR_f << (64 - ((1)))) != 0))); if (SR_e == 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto add_done; } add3: if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); SR_e++; (SR_f = (SR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? SR_f & 1 : (SR_f << (64 - ((1)))) != 0))); if (SR_e == 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } add_done: ; } else { __label__ sub1, sub2, sub3, norm, sub_done; int _FP_ADD_INTERNAL_ediff = SA_e - SB_e; if (_FP_ADD_INTERNAL_ediff > 0) { SR_e = SA_e; SR_s = SA_s; if (SB_e == 0) { if ((SB_f == 0)) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SA_f - SB_f); goto sub3; } if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto sub_done; } goto sub1; } } else if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto sub_done; } (SB_f) |= ((unsigned long) 1 << (24 -1+3)); sub1: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SB_f = (SB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SB_f & 1 : (SB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SB_f == 0)) (SB_f = 1); (SR_f = SA_f - SB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; SR_e = SB_e; SR_s = SB_s; if (SA_e == 0) { if ((SA_f == 0)) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SB_f - SA_f); goto sub3; } if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto sub_done; } goto sub2; } } else if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto sub_done; } (SA_f) |= ((unsigned long) 1 << (24 -1+3)); sub2: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SA_f = (SA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SA_f & 1 : (SA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SA_f == 0)) (SA_f = 1); (SR_f = SB_f - SA_f); } else { if (!(((SA_e + 1) & 255) > 1)) { if (SA_e == 0) { SR_e = 0; if ((SA_f == 0)) { (SR_f = SB_f); if ((SB_f == 0)) SR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); else { _fex |= (0); SR_s = SB_s; } goto sub_done; } else if ((SB_f == 0)) { _fex |= (0); (SR_f = SA_f); SR_s = SA_s; goto sub_done; } else { _fex |= (0); (SR_f = SA_f - SB_f); SR_s = SA_s; if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f = SB_f - SA_f); SR_s = SB_s; } else if ((SR_f == 0)) SR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } } else { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); SR_e = 255; if ((SA_f == 0)) { if ((SB_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); _fex |= ((1 << 4) | 0); } else { SR_s = SB_s; (SR_f = SB_f); } } else { if ((SB_f == 0)) { SR_s = SA_s; (SR_f = SA_f); } else { do { (SA_f >>= 3); (SB_f >>= 3); do { if (((SB_f) & ((unsigned long) 1 << (24 -2))) && !((SA_f) & ((unsigned long) 1 << (24 -2)))) { SR_s = SA_s; (SR_f = SA_f); } else { SR_s = SB_s; (SR_f = SB_f); } SR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); } while (0); } } goto sub_done; } } SR_e = SA_e; (SR_f = SA_f - SB_f); SR_s = SA_s; if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f = SB_f - SA_f); SR_s = SB_s; } else if ((SR_f == 0)) { SR_e = 0; SR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } goto norm; } sub3: if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { int _FP_ADD_INTERNAL_diff; (SR_f) &= ((unsigned long) 1 << (24 -1+3)) - 1; norm: do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (SR_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (SR_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (SR_f); else return 0; } while (0); _FP_ADD_INTERNAL_diff -= (64 - (3 + 24)); do { if (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1) SR_f += SR_f; else SR_f <<= (_FP_ADD_INTERNAL_diff); } while (0); if (SR_e <= _FP_ADD_INTERNAL_diff) { _FP_ADD_INTERNAL_diff = _FP_ADD_INTERNAL_diff - SR_e + 1; (SR_f = (SR_f >> ((_FP_ADD_INTERNAL_diff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_diff)) && ((_FP_ADD_INTERNAL_diff)) == 1 ? SR_f & 1 : (SR_f << (64 - ((_FP_ADD_INTERNAL_diff)))) != 0))); SR_e = 0; } else { SR_e -= _FP_ADD_INTERNAL_diff; (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); } } sub_done: ; } } while (0); break;
  case 0x042: do { do { if (0 && DA_e == 0 && !(DA_f == 0)) { (DA_f = 0); _fex |= (0); } } while (0); do { if (0 && DB_e == 0 && !(DB_f == 0)) { (DB_f = 0); _fex |= (0); } } while (0); if (DA_s == DB_s) { __label__ add1, add2, add3, add_done; DR_s = DA_s; int _FP_ADD_INTERNAL_ediff = DA_e - DB_e; if (_FP_ADD_INTERNAL_ediff > 0) { DR_e = DA_e; if (DB_e == 0) { if ((DB_f == 0)) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DA_f + DB_f); goto add3; } if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto add_done; } goto add1; } } else if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto add_done; } (DB_f) |= ((unsigned long) 1 << (53 -1+3) % 64); add1: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DB_f = (DB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DB_f & 1 : (DB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DB_f == 0)) (DB_f = 1); (DR_f = DA_f + DB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; DR_e = DB_e; if (DA_e == 0) { if ((DA_f == 0)) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DB_f + DA_f); goto add3; } if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto add_done; } goto add2; } } else if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto add_done; } (DA_f) |= ((unsigned long) 1 << (53 -1+3) % 64); add2: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DA_f = (DA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DA_f & 1 : (DA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DA_f == 0)) (DA_f = 1); (DR_f = DB_f + DA_f); } else { if (!(((DA_e + 1) & 2047) > 1)) { if (DA_e == 0) { DR_e = 0; if ((DA_f == 0)) { if (!(DB_f == 0)) _fex |= (0); (DR_f = DB_f); goto add_done; } else if ((DB_f == 0)) { _fex |= (0); (DR_f = DA_f); goto add_done; } else { _fex |= (0); (DR_f = DA_f + DB_f); if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); DR_e = 1; } goto add_done; } } else { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); DR_e = 2047; if ((DA_f == 0)) (DR_f = DB_f); else if ((DB_f == 0)) (DR_f = DA_f); else do { (DA_f >>= 3); (DB_f >>= 3); do { if (((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) && !((DA_f) & ((unsigned long) 1 << (53 -2) % 64))) { DR_s = DA_s; (DR_f = DA_f); } else { DR_s = DB_s; (DR_f = DB_f); } DR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); } while (0); goto add_done; } } (DR_f = DA_f + DB_f); DR_e = DA_e + 1; (DR_f = (DR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? DR_f & 1 : (DR_f << (64 - ((1)))) != 0))); if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto add_done; } add3: if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); DR_e++; (DR_f = (DR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? DR_f & 1 : (DR_f << (64 - ((1)))) != 0))); if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } add_done: ; } else { __label__ sub1, sub2, sub3, norm, sub_done; int _FP_ADD_INTERNAL_ediff = DA_e - DB_e; if (_FP_ADD_INTERNAL_ediff > 0) { DR_e = DA_e; DR_s = DA_s; if (DB_e == 0) { if ((DB_f == 0)) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DA_f - DB_f); goto sub3; } if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto sub_done; } goto sub1; } } else if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto sub_done; } (DB_f) |= ((unsigned long) 1 << (53 -1+3) % 64); sub1: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DB_f = (DB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DB_f & 1 : (DB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DB_f == 0)) (DB_f = 1); (DR_f = DA_f - DB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; DR_e = DB_e; DR_s = DB_s; if (DA_e == 0) { if ((DA_f == 0)) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DB_f - DA_f); goto sub3; } if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto sub_done; } goto sub2; } } else if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto sub_done; } (DA_f) |= ((unsigned long) 1 << (53 -1+3) % 64); sub2: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DA_f = (DA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DA_f & 1 : (DA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DA_f == 0)) (DA_f = 1); (DR_f = DB_f - DA_f); } else { if (!(((DA_e + 1) & 2047) > 1)) { if (DA_e == 0) { DR_e = 0; if ((DA_f == 0)) { (DR_f = DB_f); if ((DB_f == 0)) DR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); else { _fex |= (0); DR_s = DB_s; } goto sub_done; } else if ((DB_f == 0)) { _fex |= (0); (DR_f = DA_f); DR_s = DA_s; goto sub_done; } else { _fex |= (0); (DR_f = DA_f - DB_f); DR_s = DA_s; if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f = DB_f - DA_f); DR_s = DB_s; } else if ((DR_f == 0)) DR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } } else { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); DR_e = 2047; if ((DA_f == 0)) { if ((DB_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); _fex |= ((1 << 4) | 0); } else { DR_s = DB_s; (DR_f = DB_f); } } else { if ((DB_f == 0)) { DR_s = DA_s; (DR_f = DA_f); } else { do { (DA_f >>= 3); (DB_f >>= 3); do { if (((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) && !((DA_f) & ((unsigned long) 1 << (53 -2) % 64))) { DR_s = DA_s; (DR_f = DA_f); } else { DR_s = DB_s; (DR_f = DB_f); } DR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); } while (0); } } goto sub_done; } } DR_e = DA_e; (DR_f = DA_f - DB_f); DR_s = DA_s; if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f = DB_f - DA_f); DR_s = DB_s; } else if ((DR_f == 0)) { DR_e = 0; DR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } goto norm; } sub3: if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { int _FP_ADD_INTERNAL_diff; (DR_f) &= ((unsigned long) 1 << (53 -1+3) % 64) - 1; norm: do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (DR_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (DR_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (DR_f); else return 0; } while (0); _FP_ADD_INTERNAL_diff -= (64 - (3 + 53)); do { if (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1) DR_f += DR_f; else DR_f <<= (_FP_ADD_INTERNAL_diff); } while (0); if (DR_e <= _FP_ADD_INTERNAL_diff) { _FP_ADD_INTERNAL_diff = _FP_ADD_INTERNAL_diff - DR_e + 1; (DR_f = (DR_f >> ((_FP_ADD_INTERNAL_diff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_diff)) && ((_FP_ADD_INTERNAL_diff)) == 1 ? DR_f & 1 : (DR_f << (64 - ((_FP_ADD_INTERNAL_diff)))) != 0))); DR_e = 0; } else { DR_e -= _FP_ADD_INTERNAL_diff; (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); } } sub_done: ; } } while (0); break;
  case 0x043: do { do { if (0 && QA_e == 0 && !((QA_f1 | QA_f0) == 0)) { (QA_f0 = 0, QA_f1 = 0); _fex |= (0); } } while (0); do { if (0 && QB_e == 0 && !((QB_f1 | QB_f0) == 0)) { (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } } while (0); if (QA_s == QB_s) { __label__ add1, add2, add3, add_done; QR_s = QA_s; int _FP_ADD_INTERNAL_ediff = QA_e - QB_e; if (_FP_ADD_INTERNAL_ediff > 0) { QR_e = QA_e; if (QB_e == 0) { if (((QB_f1 | QB_f0) == 0)) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); goto add3; } if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } goto add1; } } else if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } (QB_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); add1: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QB_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QB_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QB_f0 = (QB_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QB_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QB_f0) != 0)); QB_f1 = 0; })); else if (!((QB_f1 | QB_f0) == 0)) (QB_f0 = 1, QB_f1 = 0); __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; QR_e = QB_e; if (QA_e == 0) { if (((QA_f1 | QA_f0) == 0)) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); goto add3; } if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } goto add2; } } else if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } (QA_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); add2: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QA_f0 = (QA_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QA_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QA_f0 & 1 : (QA_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QA_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QA_f0 = (QA_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QA_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QA_f0) != 0)); QA_f1 = 0; })); else if (!((QA_f1 | QA_f0) == 0)) (QA_f0 = 1, QA_f1 = 0); __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); } else { if (!(((QA_e + 1) & 32767) > 1)) { if (QA_e == 0) { QR_e = 0; if (((QA_f1 | QA_f0) == 0)) { if (!((QB_f1 | QB_f0) == 0)) _fex |= (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } else if (((QB_f1 | QB_f0) == 0)) { _fex |= (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } else { _fex |= (0); __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); QR_e = 1; } goto add_done; } } else { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); QR_e = 32767; if (((QA_f1 | QA_f0) == 0)) (QR_f0 = QB_f0, QR_f1 = QB_f1); else if (((QB_f1 | QB_f0) == 0)) (QR_f0 = QA_f0, QR_f1 = QA_f1); else do { (void) (((3) < 64) ? ({ QA_f0 = QA_f0 >> (3) | QA_f1 << (64 - (3)); QA_f1 >>= (3); }) : ({ QA_f0 = QA_f1 >> ((3) - 64); QA_f1 = 0; })); (void) (((3) < 64) ? ({ QB_f0 = QB_f0 >> (3) | QB_f1 << (64 - (3)); QB_f1 >>= (3); }) : ({ QB_f0 = QB_f1 >> ((3) - 64); QB_f1 = 0; })); do { if (((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) && !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64))) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } QR_c = 3; } while (0); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (3) | QR_f0 >> (64 - (3)); QR_f0 <<= (3); } 0; }) : ({ QR_f1 = QR_f0 << ((3) - 64); QR_f0 = 0; })); } while (0); goto add_done; } } __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); QR_e = QA_e + 1; (void) (((1) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (1)) | QR_f0 >> (1) | (__builtin_constant_p (1) && (1) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (1))) != 0)); QR_f1 >>= (1); }) : ({ QR_f0 = (QR_f1 >> ((1) - 64) | ((((1) == 64 ? 0 : (QR_f1 << (2*64 - (1)))) | QR_f0) != 0)); QR_f1 = 0; })); if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto add_done; } add3: if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); QR_e++; (void) (((1) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (1)) | QR_f0 >> (1) | (__builtin_constant_p (1) && (1) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (1))) != 0)); QR_f1 >>= (1); }) : ({ QR_f0 = (QR_f1 >> ((1) - 64) | ((((1) == 64 ? 0 : (QR_f1 << (2*64 - (1)))) | QR_f0) != 0)); QR_f1 = 0; })); if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } add_done: ; } else { __label__ sub1, sub2, sub3, norm, sub_done; int _FP_ADD_INTERNAL_ediff = QA_e - QB_e; if (_FP_ADD_INTERNAL_ediff > 0) { QR_e = QA_e; QR_s = QA_s; if (QB_e == 0) { if (((QB_f1 | QB_f0) == 0)) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); goto sub3; } if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto sub_done; } goto sub1; } } else if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto sub_done; } (QB_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); sub1: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QB_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QB_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QB_f0 = (QB_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QB_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QB_f0) != 0)); QB_f1 = 0; })); else if (!((QB_f1 | QB_f0) == 0)) (QB_f0 = 1, QB_f1 = 0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; QR_e = QB_e; QR_s = QB_s; if (QA_e == 0) { if (((QA_f1 | QA_f0) == 0)) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); goto sub3; } if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto sub_done; } goto sub2; } } else if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto sub_done; } (QA_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); sub2: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QA_f0 = (QA_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QA_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QA_f0 & 1 : (QA_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QA_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QA_f0 = (QA_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QA_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QA_f0) != 0)); QA_f1 = 0; })); else if (!((QA_f1 | QA_f0) == 0)) (QA_f0 = 1, QA_f1 = 0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); } else { if (!(((QA_e + 1) & 32767) > 1)) { if (QA_e == 0) { QR_e = 0; if (((QA_f1 | QA_f0) == 0)) { (QR_f0 = QB_f0, QR_f1 = QB_f1); if (((QB_f1 | QB_f0) == 0)) QR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); else { _fex |= (0); QR_s = QB_s; } goto sub_done; } else if (((QB_f1 | QB_f0) == 0)) { _fex |= (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); QR_s = QA_s; goto sub_done; } else { _fex |= (0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); QR_s = QA_s; if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); QR_s = QB_s; } else if (((QR_f1 | QR_f0) == 0)) QR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } } else { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); QR_e = 32767; if (((QA_f1 | QA_f0) == 0)) { if (((QB_f1 | QB_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (3) | QR_f0 >> (64 - (3)); QR_f0 <<= (3); } 0; }) : ({ QR_f1 = QR_f0 << ((3) - 64); QR_f0 = 0; })); _fex |= ((1 << 4) | 0); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } } else { if (((QB_f1 | QB_f0) == 0)) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { do { (void) (((3) < 64) ? ({ QA_f0 = QA_f0 >> (3) | QA_f1 << (64 - (3)); QA_f1 >>= (3); }) : ({ QA_f0 = QA_f1 >> ((3) - 64); QA_f1 = 0; })); (void) (((3) < 64) ? ({ QB_f0 = QB_f0 >> (3) | QB_f1 << (64 - (3)); QB_f1 >>= (3); }) : ({ QB_f0 = QB_f1 >> ((3) - 64); QB_f1 = 0; })); do { if (((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) && !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64))) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } QR_c = 3; } while (0); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (3) | QR_f0 >> (64 - (3)); QR_f0 <<= (3); } 0; }) : ({ QR_f1 = QR_f0 << ((3) - 64); QR_f0 = 0; })); } while (0); } } goto sub_done; } } QR_e = QA_e; __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); QR_s = QA_s; if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); QR_s = QB_s; } else if (((QR_f1 | QR_f0) == 0)) { QR_e = 0; QR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } goto norm; } sub3: if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { int _FP_ADD_INTERNAL_diff; (QR_f1) &= ((unsigned long) 1 << (113 -1+3) % 64) - 1; norm: do { if (QR_f1) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (QR_f1); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (QR_f1); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (QR_f1); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (QR_f0); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (QR_f0); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (QR_f0); else return 0; } while (0); (_FP_ADD_INTERNAL_diff) += 64; } } while (0); _FP_ADD_INTERNAL_diff -= ((2*64) - (3 + 113)); (void) (((_FP_ADD_INTERNAL_diff) < 64) ? ({ if (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (_FP_ADD_INTERNAL_diff) | QR_f0 >> (64 - (_FP_ADD_INTERNAL_diff)); QR_f0 <<= (_FP_ADD_INTERNAL_diff); } 0; }) : ({ QR_f1 = QR_f0 << ((_FP_ADD_INTERNAL_diff) - 64); QR_f0 = 0; })); if (QR_e <= _FP_ADD_INTERNAL_diff) { _FP_ADD_INTERNAL_diff = _FP_ADD_INTERNAL_diff - QR_e + 1; (void) (((_FP_ADD_INTERNAL_diff) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (_FP_ADD_INTERNAL_diff)) | QR_f0 >> (_FP_ADD_INTERNAL_diff) | (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (_FP_ADD_INTERNAL_diff))) != 0)); QR_f1 >>= (_FP_ADD_INTERNAL_diff); }) : ({ QR_f0 = (QR_f1 >> ((_FP_ADD_INTERNAL_diff) - 64) | ((((_FP_ADD_INTERNAL_diff) == 64 ? 0 : (QR_f1 << (2*64 - (_FP_ADD_INTERNAL_diff)))) | QR_f0) != 0)); QR_f1 = 0; })); QR_e = 0; } else { QR_e -= _FP_ADD_INTERNAL_diff; (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); } } sub_done: ; } } while (0); break;

  case 0x045: do { if (!(SB_e == 255 && !(SB_f == 0))) SB_s ^= 1; do { do { if (0 && SA_e == 0 && !(SA_f == 0)) { (SA_f = 0); _fex |= (0); } } while (0); do { if (0 && SB_e == 0 && !(SB_f == 0)) { (SB_f = 0); _fex |= (0); } } while (0); if (SA_s == SB_s) { __label__ add1, add2, add3, add_done; SR_s = SA_s; int _FP_ADD_INTERNAL_ediff = SA_e - SB_e; if (_FP_ADD_INTERNAL_ediff > 0) { SR_e = SA_e; if (SB_e == 0) { if ((SB_f == 0)) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SA_f + SB_f); goto add3; } if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto add_done; } goto add1; } } else if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto add_done; } (SB_f) |= ((unsigned long) 1 << (24 -1+3)); add1: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SB_f = (SB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SB_f & 1 : (SB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SB_f == 0)) (SB_f = 1); (SR_f = SA_f + SB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; SR_e = SB_e; if (SA_e == 0) { if ((SA_f == 0)) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SB_f + SA_f); goto add3; } if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto add_done; } goto add2; } } else if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto add_done; } (SA_f) |= ((unsigned long) 1 << (24 -1+3)); add2: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SA_f = (SA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SA_f & 1 : (SA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SA_f == 0)) (SA_f = 1); (SR_f = SB_f + SA_f); } else { if (!(((SA_e + 1) & 255) > 1)) { if (SA_e == 0) { SR_e = 0; if ((SA_f == 0)) { if (!(SB_f == 0)) _fex |= (0); (SR_f = SB_f); goto add_done; } else if ((SB_f == 0)) { _fex |= (0); (SR_f = SA_f); goto add_done; } else { _fex |= (0); (SR_f = SA_f + SB_f); if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); SR_e = 1; } goto add_done; } } else { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); SR_e = 255; if ((SA_f == 0)) (SR_f = SB_f); else if ((SB_f == 0)) (SR_f = SA_f); else do { (SA_f >>= 3); (SB_f >>= 3); do { if (((SB_f) & ((unsigned long) 1 << (24 -2))) && !((SA_f) & ((unsigned long) 1 << (24 -2)))) { SR_s = SA_s; (SR_f = SA_f); } else { SR_s = SB_s; (SR_f = SB_f); } SR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); } while (0); goto add_done; } } (SR_f = SA_f + SB_f); SR_e = SA_e + 1; (SR_f = (SR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? SR_f & 1 : (SR_f << (64 - ((1)))) != 0))); if (SR_e == 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto add_done; } add3: if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); SR_e++; (SR_f = (SR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? SR_f & 1 : (SR_f << (64 - ((1)))) != 0))); if (SR_e == 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } add_done: ; } else { __label__ sub1, sub2, sub3, norm, sub_done; int _FP_ADD_INTERNAL_ediff = SA_e - SB_e; if (_FP_ADD_INTERNAL_ediff > 0) { SR_e = SA_e; SR_s = SA_s; if (SB_e == 0) { if ((SB_f == 0)) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SA_f - SB_f); goto sub3; } if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto sub_done; } goto sub1; } } else if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto sub_done; } (SB_f) |= ((unsigned long) 1 << (24 -1+3)); sub1: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SB_f = (SB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SB_f & 1 : (SB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SB_f == 0)) (SB_f = 1); (SR_f = SA_f - SB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; SR_e = SB_e; SR_s = SB_s; if (SA_e == 0) { if ((SA_f == 0)) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SB_f - SA_f); goto sub3; } if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto sub_done; } goto sub2; } } else if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto sub_done; } (SA_f) |= ((unsigned long) 1 << (24 -1+3)); sub2: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SA_f = (SA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SA_f & 1 : (SA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SA_f == 0)) (SA_f = 1); (SR_f = SB_f - SA_f); } else { if (!(((SA_e + 1) & 255) > 1)) { if (SA_e == 0) { SR_e = 0; if ((SA_f == 0)) { (SR_f = SB_f); if ((SB_f == 0)) SR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); else { _fex |= (0); SR_s = SB_s; } goto sub_done; } else if ((SB_f == 0)) { _fex |= (0); (SR_f = SA_f); SR_s = SA_s; goto sub_done; } else { _fex |= (0); (SR_f = SA_f - SB_f); SR_s = SA_s; if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f = SB_f - SA_f); SR_s = SB_s; } else if ((SR_f == 0)) SR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } } else { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); SR_e = 255; if ((SA_f == 0)) { if ((SB_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); _fex |= ((1 << 4) | 0); } else { SR_s = SB_s; (SR_f = SB_f); } } else { if ((SB_f == 0)) { SR_s = SA_s; (SR_f = SA_f); } else { do { (SA_f >>= 3); (SB_f >>= 3); do { if (((SB_f) & ((unsigned long) 1 << (24 -2))) && !((SA_f) & ((unsigned long) 1 << (24 -2)))) { SR_s = SA_s; (SR_f = SA_f); } else { SR_s = SB_s; (SR_f = SB_f); } SR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); } while (0); } } goto sub_done; } } SR_e = SA_e; (SR_f = SA_f - SB_f); SR_s = SA_s; if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f = SB_f - SA_f); SR_s = SB_s; } else if ((SR_f == 0)) { SR_e = 0; SR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } goto norm; } sub3: if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { int _FP_ADD_INTERNAL_diff; (SR_f) &= ((unsigned long) 1 << (24 -1+3)) - 1; norm: do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (SR_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (SR_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (SR_f); else return 0; } while (0); _FP_ADD_INTERNAL_diff -= (64 - (3 + 24)); do { if (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1) SR_f += SR_f; else SR_f <<= (_FP_ADD_INTERNAL_diff); } while (0); if (SR_e <= _FP_ADD_INTERNAL_diff) { _FP_ADD_INTERNAL_diff = _FP_ADD_INTERNAL_diff - SR_e + 1; (SR_f = (SR_f >> ((_FP_ADD_INTERNAL_diff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_diff)) && ((_FP_ADD_INTERNAL_diff)) == 1 ? SR_f & 1 : (SR_f << (64 - ((_FP_ADD_INTERNAL_diff)))) != 0))); SR_e = 0; } else { SR_e -= _FP_ADD_INTERNAL_diff; (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); } } sub_done: ; } } while (0); } while (0); break;
  case 0x046: do { if (!(DB_e == 2047 && !(DB_f == 0))) DB_s ^= 1; do { do { if (0 && DA_e == 0 && !(DA_f == 0)) { (DA_f = 0); _fex |= (0); } } while (0); do { if (0 && DB_e == 0 && !(DB_f == 0)) { (DB_f = 0); _fex |= (0); } } while (0); if (DA_s == DB_s) { __label__ add1, add2, add3, add_done; DR_s = DA_s; int _FP_ADD_INTERNAL_ediff = DA_e - DB_e; if (_FP_ADD_INTERNAL_ediff > 0) { DR_e = DA_e; if (DB_e == 0) { if ((DB_f == 0)) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DA_f + DB_f); goto add3; } if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto add_done; } goto add1; } } else if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto add_done; } (DB_f) |= ((unsigned long) 1 << (53 -1+3) % 64); add1: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DB_f = (DB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DB_f & 1 : (DB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DB_f == 0)) (DB_f = 1); (DR_f = DA_f + DB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; DR_e = DB_e; if (DA_e == 0) { if ((DA_f == 0)) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DB_f + DA_f); goto add3; } if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto add_done; } goto add2; } } else if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto add_done; } (DA_f) |= ((unsigned long) 1 << (53 -1+3) % 64); add2: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DA_f = (DA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DA_f & 1 : (DA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DA_f == 0)) (DA_f = 1); (DR_f = DB_f + DA_f); } else { if (!(((DA_e + 1) & 2047) > 1)) { if (DA_e == 0) { DR_e = 0; if ((DA_f == 0)) { if (!(DB_f == 0)) _fex |= (0); (DR_f = DB_f); goto add_done; } else if ((DB_f == 0)) { _fex |= (0); (DR_f = DA_f); goto add_done; } else { _fex |= (0); (DR_f = DA_f + DB_f); if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); DR_e = 1; } goto add_done; } } else { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); DR_e = 2047; if ((DA_f == 0)) (DR_f = DB_f); else if ((DB_f == 0)) (DR_f = DA_f); else do { (DA_f >>= 3); (DB_f >>= 3); do { if (((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) && !((DA_f) & ((unsigned long) 1 << (53 -2) % 64))) { DR_s = DA_s; (DR_f = DA_f); } else { DR_s = DB_s; (DR_f = DB_f); } DR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); } while (0); goto add_done; } } (DR_f = DA_f + DB_f); DR_e = DA_e + 1; (DR_f = (DR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? DR_f & 1 : (DR_f << (64 - ((1)))) != 0))); if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto add_done; } add3: if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); DR_e++; (DR_f = (DR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? DR_f & 1 : (DR_f << (64 - ((1)))) != 0))); if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } add_done: ; } else { __label__ sub1, sub2, sub3, norm, sub_done; int _FP_ADD_INTERNAL_ediff = DA_e - DB_e; if (_FP_ADD_INTERNAL_ediff > 0) { DR_e = DA_e; DR_s = DA_s; if (DB_e == 0) { if ((DB_f == 0)) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DA_f - DB_f); goto sub3; } if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto sub_done; } goto sub1; } } else if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto sub_done; } (DB_f) |= ((unsigned long) 1 << (53 -1+3) % 64); sub1: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DB_f = (DB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DB_f & 1 : (DB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DB_f == 0)) (DB_f = 1); (DR_f = DA_f - DB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; DR_e = DB_e; DR_s = DB_s; if (DA_e == 0) { if ((DA_f == 0)) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DB_f - DA_f); goto sub3; } if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto sub_done; } goto sub2; } } else if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto sub_done; } (DA_f) |= ((unsigned long) 1 << (53 -1+3) % 64); sub2: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DA_f = (DA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DA_f & 1 : (DA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DA_f == 0)) (DA_f = 1); (DR_f = DB_f - DA_f); } else { if (!(((DA_e + 1) & 2047) > 1)) { if (DA_e == 0) { DR_e = 0; if ((DA_f == 0)) { (DR_f = DB_f); if ((DB_f == 0)) DR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); else { _fex |= (0); DR_s = DB_s; } goto sub_done; } else if ((DB_f == 0)) { _fex |= (0); (DR_f = DA_f); DR_s = DA_s; goto sub_done; } else { _fex |= (0); (DR_f = DA_f - DB_f); DR_s = DA_s; if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f = DB_f - DA_f); DR_s = DB_s; } else if ((DR_f == 0)) DR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } } else { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); DR_e = 2047; if ((DA_f == 0)) { if ((DB_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); _fex |= ((1 << 4) | 0); } else { DR_s = DB_s; (DR_f = DB_f); } } else { if ((DB_f == 0)) { DR_s = DA_s; (DR_f = DA_f); } else { do { (DA_f >>= 3); (DB_f >>= 3); do { if (((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) && !((DA_f) & ((unsigned long) 1 << (53 -2) % 64))) { DR_s = DA_s; (DR_f = DA_f); } else { DR_s = DB_s; (DR_f = DB_f); } DR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); } while (0); } } goto sub_done; } } DR_e = DA_e; (DR_f = DA_f - DB_f); DR_s = DA_s; if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f = DB_f - DA_f); DR_s = DB_s; } else if ((DR_f == 0)) { DR_e = 0; DR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } goto norm; } sub3: if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { int _FP_ADD_INTERNAL_diff; (DR_f) &= ((unsigned long) 1 << (53 -1+3) % 64) - 1; norm: do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (DR_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (DR_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (DR_f); else return 0; } while (0); _FP_ADD_INTERNAL_diff -= (64 - (3 + 53)); do { if (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1) DR_f += DR_f; else DR_f <<= (_FP_ADD_INTERNAL_diff); } while (0); if (DR_e <= _FP_ADD_INTERNAL_diff) { _FP_ADD_INTERNAL_diff = _FP_ADD_INTERNAL_diff - DR_e + 1; (DR_f = (DR_f >> ((_FP_ADD_INTERNAL_diff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_diff)) && ((_FP_ADD_INTERNAL_diff)) == 1 ? DR_f & 1 : (DR_f << (64 - ((_FP_ADD_INTERNAL_diff)))) != 0))); DR_e = 0; } else { DR_e -= _FP_ADD_INTERNAL_diff; (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); } } sub_done: ; } } while (0); } while (0); break;
  case 0x047: do { if (!(QB_e == 32767 && !((QB_f1 | QB_f0) == 0))) QB_s ^= 1; do { do { if (0 && QA_e == 0 && !((QA_f1 | QA_f0) == 0)) { (QA_f0 = 0, QA_f1 = 0); _fex |= (0); } } while (0); do { if (0 && QB_e == 0 && !((QB_f1 | QB_f0) == 0)) { (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } } while (0); if (QA_s == QB_s) { __label__ add1, add2, add3, add_done; QR_s = QA_s; int _FP_ADD_INTERNAL_ediff = QA_e - QB_e; if (_FP_ADD_INTERNAL_ediff > 0) { QR_e = QA_e; if (QB_e == 0) { if (((QB_f1 | QB_f0) == 0)) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); goto add3; } if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } goto add1; } } else if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } (QB_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); add1: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QB_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QB_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QB_f0 = (QB_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QB_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QB_f0) != 0)); QB_f1 = 0; })); else if (!((QB_f1 | QB_f0) == 0)) (QB_f0 = 1, QB_f1 = 0); __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; QR_e = QB_e; if (QA_e == 0) { if (((QA_f1 | QA_f0) == 0)) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); goto add3; } if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } goto add2; } } else if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } (QA_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); add2: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QA_f0 = (QA_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QA_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QA_f0 & 1 : (QA_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QA_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QA_f0 = (QA_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QA_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QA_f0) != 0)); QA_f1 = 0; })); else if (!((QA_f1 | QA_f0) == 0)) (QA_f0 = 1, QA_f1 = 0); __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); } else { if (!(((QA_e + 1) & 32767) > 1)) { if (QA_e == 0) { QR_e = 0; if (((QA_f1 | QA_f0) == 0)) { if (!((QB_f1 | QB_f0) == 0)) _fex |= (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } else if (((QB_f1 | QB_f0) == 0)) { _fex |= (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } else { _fex |= (0); __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); QR_e = 1; } goto add_done; } } else { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); QR_e = 32767; if (((QA_f1 | QA_f0) == 0)) (QR_f0 = QB_f0, QR_f1 = QB_f1); else if (((QB_f1 | QB_f0) == 0)) (QR_f0 = QA_f0, QR_f1 = QA_f1); else do { (void) (((3) < 64) ? ({ QA_f0 = QA_f0 >> (3) | QA_f1 << (64 - (3)); QA_f1 >>= (3); }) : ({ QA_f0 = QA_f1 >> ((3) - 64); QA_f1 = 0; })); (void) (((3) < 64) ? ({ QB_f0 = QB_f0 >> (3) | QB_f1 << (64 - (3)); QB_f1 >>= (3); }) : ({ QB_f0 = QB_f1 >> ((3) - 64); QB_f1 = 0; })); do { if (((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) && !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64))) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } QR_c = 3; } while (0); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (3) | QR_f0 >> (64 - (3)); QR_f0 <<= (3); } 0; }) : ({ QR_f1 = QR_f0 << ((3) - 64); QR_f0 = 0; })); } while (0); goto add_done; } } __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); QR_e = QA_e + 1; (void) (((1) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (1)) | QR_f0 >> (1) | (__builtin_constant_p (1) && (1) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (1))) != 0)); QR_f1 >>= (1); }) : ({ QR_f0 = (QR_f1 >> ((1) - 64) | ((((1) == 64 ? 0 : (QR_f1 << (2*64 - (1)))) | QR_f0) != 0)); QR_f1 = 0; })); if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto add_done; } add3: if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); QR_e++; (void) (((1) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (1)) | QR_f0 >> (1) | (__builtin_constant_p (1) && (1) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (1))) != 0)); QR_f1 >>= (1); }) : ({ QR_f0 = (QR_f1 >> ((1) - 64) | ((((1) == 64 ? 0 : (QR_f1 << (2*64 - (1)))) | QR_f0) != 0)); QR_f1 = 0; })); if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } add_done: ; } else { __label__ sub1, sub2, sub3, norm, sub_done; int _FP_ADD_INTERNAL_ediff = QA_e - QB_e; if (_FP_ADD_INTERNAL_ediff > 0) { QR_e = QA_e; QR_s = QA_s; if (QB_e == 0) { if (((QB_f1 | QB_f0) == 0)) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); goto sub3; } if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto sub_done; } goto sub1; } } else if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto sub_done; } (QB_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); sub1: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QB_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QB_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QB_f0 = (QB_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QB_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QB_f0) != 0)); QB_f1 = 0; })); else if (!((QB_f1 | QB_f0) == 0)) (QB_f0 = 1, QB_f1 = 0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; QR_e = QB_e; QR_s = QB_s; if (QA_e == 0) { if (((QA_f1 | QA_f0) == 0)) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); goto sub3; } if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto sub_done; } goto sub2; } } else if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto sub_done; } (QA_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); sub2: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QA_f0 = (QA_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QA_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QA_f0 & 1 : (QA_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QA_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QA_f0 = (QA_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QA_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QA_f0) != 0)); QA_f1 = 0; })); else if (!((QA_f1 | QA_f0) == 0)) (QA_f0 = 1, QA_f1 = 0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); } else { if (!(((QA_e + 1) & 32767) > 1)) { if (QA_e == 0) { QR_e = 0; if (((QA_f1 | QA_f0) == 0)) { (QR_f0 = QB_f0, QR_f1 = QB_f1); if (((QB_f1 | QB_f0) == 0)) QR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); else { _fex |= (0); QR_s = QB_s; } goto sub_done; } else if (((QB_f1 | QB_f0) == 0)) { _fex |= (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); QR_s = QA_s; goto sub_done; } else { _fex |= (0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); QR_s = QA_s; if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); QR_s = QB_s; } else if (((QR_f1 | QR_f0) == 0)) QR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } } else { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); QR_e = 32767; if (((QA_f1 | QA_f0) == 0)) { if (((QB_f1 | QB_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (3) | QR_f0 >> (64 - (3)); QR_f0 <<= (3); } 0; }) : ({ QR_f1 = QR_f0 << ((3) - 64); QR_f0 = 0; })); _fex |= ((1 << 4) | 0); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } } else { if (((QB_f1 | QB_f0) == 0)) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { do { (void) (((3) < 64) ? ({ QA_f0 = QA_f0 >> (3) | QA_f1 << (64 - (3)); QA_f1 >>= (3); }) : ({ QA_f0 = QA_f1 >> ((3) - 64); QA_f1 = 0; })); (void) (((3) < 64) ? ({ QB_f0 = QB_f0 >> (3) | QB_f1 << (64 - (3)); QB_f1 >>= (3); }) : ({ QB_f0 = QB_f1 >> ((3) - 64); QB_f1 = 0; })); do { if (((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) && !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64))) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } QR_c = 3; } while (0); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (3) | QR_f0 >> (64 - (3)); QR_f0 <<= (3); } 0; }) : ({ QR_f1 = QR_f0 << ((3) - 64); QR_f0 = 0; })); } while (0); } } goto sub_done; } } QR_e = QA_e; __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); QR_s = QA_s; if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); QR_s = QB_s; } else if (((QR_f1 | QR_f0) == 0)) { QR_e = 0; QR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } goto norm; } sub3: if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { int _FP_ADD_INTERNAL_diff; (QR_f1) &= ((unsigned long) 1 << (113 -1+3) % 64) - 1; norm: do { if (QR_f1) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (QR_f1); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (QR_f1); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (QR_f1); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (QR_f0); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (QR_f0); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (QR_f0); else return 0; } while (0); (_FP_ADD_INTERNAL_diff) += 64; } } while (0); _FP_ADD_INTERNAL_diff -= ((2*64) - (3 + 113)); (void) (((_FP_ADD_INTERNAL_diff) < 64) ? ({ if (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (_FP_ADD_INTERNAL_diff) | QR_f0 >> (64 - (_FP_ADD_INTERNAL_diff)); QR_f0 <<= (_FP_ADD_INTERNAL_diff); } 0; }) : ({ QR_f1 = QR_f0 << ((_FP_ADD_INTERNAL_diff) - 64); QR_f0 = 0; })); if (QR_e <= _FP_ADD_INTERNAL_diff) { _FP_ADD_INTERNAL_diff = _FP_ADD_INTERNAL_diff - QR_e + 1; (void) (((_FP_ADD_INTERNAL_diff) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (_FP_ADD_INTERNAL_diff)) | QR_f0 >> (_FP_ADD_INTERNAL_diff) | (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (_FP_ADD_INTERNAL_diff))) != 0)); QR_f1 >>= (_FP_ADD_INTERNAL_diff); }) : ({ QR_f0 = (QR_f1 >> ((_FP_ADD_INTERNAL_diff) - 64) | ((((_FP_ADD_INTERNAL_diff) == 64 ? 0 : (QR_f1 << (2*64 - (_FP_ADD_INTERNAL_diff)))) | QR_f0) != 0)); QR_f1 = 0; })); QR_e = 0; } else { QR_e -= _FP_ADD_INTERNAL_diff; (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); } } sub_done: ; } } while (0); } while (0); break;

  case 0x049: do { SR_s = SA_s ^ SB_s; SR_e = SA_e + SB_e + 1; switch ((((SA_c) << 2) | (SB_c))) { case (((0) << 2) | (0)): SR_c = 0; do { do { SR_f = SA_f * SB_f; } while (0); (SR_f = (SR_f >> ((((3 + 24))-1)) | (__builtin_constant_p ((((3 + 24))-1)) && ((((3 + 24))-1)) == 1 ? SR_f & 1 : (SR_f << (64 - ((((3 + 24))-1)))) != 0))); } while (0); if ((SR_f & ((unsigned long) 1 << ((3 + 24))))) (SR_f = (SR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? SR_f & 1 : (SR_f << (64 - ((1)))) != 0))); else SR_e--; break; case (((3) << 2) | (3)): do { if (((SB_f) & ((unsigned long) 1 << (24 -2))) && !((SA_f) & ((unsigned long) 1 << (24 -2)))) { SR_s = SA_s; (SR_f = SA_f); } else { SR_s = SB_s; (SR_f = SB_f); } SR_c = 3; } while (0); break; case (((3) << 2) | (0)): case (((3) << 2) | (2)): case (((3) << 2) | (1)): SR_s = SA_s; case (((2) << 2) | (2)): case (((2) << 2) | (0)): case (((1) << 2) | (0)): case (((1) << 2) | (1)): (SR_f = SA_f); SR_c = SA_c; break; case (((0) << 2) | (3)): case (((2) << 2) | (3)): case (((1) << 2) | (3)): SR_s = SB_s; case (((0) << 2) | (2)): case (((0) << 2) | (1)): (SR_f = SB_f); SR_c = SB_c; break; case (((2) << 2) | (1)): case (((1) << 2) | (2)): SR_s = 0; SR_c = 3; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); _fex |= ((1 << 4) | 0); break; default: return 0; } } while (0); break;
  case 0x069: do { if (53 < 24 || (2047 - 1023 < 255 - 127) || (1023 < 127 + 24 - 1 && 1023 != 127)) return 0; DA_s = SA_s; (DA_f = SA_f); if ((((SA_e + 1) & 255) > 1)) { DA_e = SA_e + 1023 - 127; do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DA_f += DA_f; else DA_f <<= ((53 - 24)); } while (0); } else { if (SA_e == 0) { do { if (0 && SA_e == 0 && !(SA_f == 0)) { (SA_f = 0); _fex |= (0); } } while (0); if ((SA_f == 0)) DA_e = 0; else if (1023 < 127 + 24 - 1) { _fex |= (0); do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DA_f += DA_f; else DA_f <<= ((53 - 24)); } while (0); DA_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (SA_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (SA_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (SA_f); else return 0; } while (0); do { if (__builtin_constant_p (FP_EXTEND_lz + 53 - 64) && (FP_EXTEND_lz + 53 - 64) == 1) DA_f += DA_f; else DA_f <<= (FP_EXTEND_lz + 53 - 64); } while (0); DA_e = (1023 - 127 + 1 + (64 - 24) - FP_EXTEND_lz); } } else { DA_e = 2047; if (!(SA_f == 0)) { if (1 && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2))) : !((SA_f) & ((unsigned long) 1 << (24 -2))))) _fex |= ((1 << 4) | 0); do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DA_f += DA_f; else DA_f <<= ((53 - 24)); } while (0); if (1) do { if (0) { (DA_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DA_f == 0)) { DA_s = 0; (DA_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DA_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); } } } } while (0);
        do { switch (DA_e) { default: (DA_f) |= ((unsigned long) 1 << (53 -1) % 64); do { if (__builtin_constant_p (3) && (3) == 1) DA_f += DA_f; else DA_f <<= (3); } while (0); DA_e -= 1023; DA_c = 0; break; case 0: if ((DA_f == 0)) DA_c = 1; else if (0) { DA_c = 1; (DA_f = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (DA_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (DA_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (DA_f); else return 0; } while (0); _FP_UNPACK_CANONICAL_shift -= (64 - 53); do { if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) DA_f += DA_f; else DA_f <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } while (0); DA_e -= (1023 - 1 + _FP_UNPACK_CANONICAL_shift); DA_c = 0; _fex |= (0); } break; case 2047: if ((DA_f == 0)) DA_c = 2; else { DA_c = 3; if (((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0);
        do { if (53 < 24 || (2047 - 1023 < 255 - 127) || (1023 < 127 + 24 - 1 && 1023 != 127)) return 0; DB_s = SB_s; (DB_f = SB_f); if ((((SB_e + 1) & 255) > 1)) { DB_e = SB_e + 1023 - 127; do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DB_f += DB_f; else DB_f <<= ((53 - 24)); } while (0); } else { if (SB_e == 0) { do { if (0 && SB_e == 0 && !(SB_f == 0)) { (SB_f = 0); _fex |= (0); } } while (0); if ((SB_f == 0)) DB_e = 0; else if (1023 < 127 + 24 - 1) { _fex |= (0); do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DB_f += DB_f; else DB_f <<= ((53 - 24)); } while (0); DB_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (SB_f); else return 0; } while (0); do { if (__builtin_constant_p (FP_EXTEND_lz + 53 - 64) && (FP_EXTEND_lz + 53 - 64) == 1) DB_f += DB_f; else DB_f <<= (FP_EXTEND_lz + 53 - 64); } while (0); DB_e = (1023 - 127 + 1 + (64 - 24) - FP_EXTEND_lz); } } else { DB_e = 2047; if (!(SB_f == 0)) { if (1 && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _fex |= ((1 << 4) | 0); do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DB_f += DB_f; else DB_f <<= ((53 - 24)); } while (0); if (1) do { if (0) { (DB_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DB_f == 0)) { DB_s = 0; (DB_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DB_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); } } } } while (0);
        do { switch (DB_e) { default: (DB_f) |= ((unsigned long) 1 << (53 -1) % 64); do { if (__builtin_constant_p (3) && (3) == 1) DB_f += DB_f; else DB_f <<= (3); } while (0); DB_e -= 1023; DB_c = 0; break; case 0: if ((DB_f == 0)) DB_c = 1; else if (0) { DB_c = 1; (DB_f = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (DB_f); else return 0; } while (0); _FP_UNPACK_CANONICAL_shift -= (64 - 53); do { if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) DB_f += DB_f; else DB_f <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } while (0); DB_e -= (1023 - 1 + _FP_UNPACK_CANONICAL_shift); DB_c = 0; _fex |= (0); } break; case 2047: if ((DB_f == 0)) DB_c = 2; else { DB_c = 3; if (((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0);
  case 0x04a: do { DR_s = DA_s ^ DB_s; DR_e = DA_e + DB_e + 1; switch ((((DA_c) << 2) | (DB_c))) { case (((0) << 2) | (0)): DR_c = 0; do { unsigned long _FP_MUL_MEAT_1_wide_Z_f0 = 0, _FP_MUL_MEAT_1_wide_Z_f1 = 0; do { do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" (_FP_MUL_MEAT_1_wide_Z_f1), "=&r" (_FP_MUL_MEAT_1_wide_Z_f0), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(DA_f)), "r" ((UDItype)(DB_f)) : "cc"); } while (0); } while (0); (void) (((((3 + 53))-1) < 64) ? ({ _FP_MUL_MEAT_1_wide_Z_f0 = (_FP_MUL_MEAT_1_wide_Z_f1 << (64 - (((3 + 53))-1)) | _FP_MUL_MEAT_1_wide_Z_f0 >> (((3 + 53))-1) | (__builtin_constant_p (((3 + 53))-1) && (((3 + 53))-1) == 1 ? _FP_MUL_MEAT_1_wide_Z_f0 & 1 : (_FP_MUL_MEAT_1_wide_Z_f0 << (64 - (((3 + 53))-1))) != 0)); _FP_MUL_MEAT_1_wide_Z_f1 >>= (((3 + 53))-1); }) : ({ _FP_MUL_MEAT_1_wide_Z_f0 = (_FP_MUL_MEAT_1_wide_Z_f1 >> ((((3 + 53))-1) - 64) | ((((((3 + 53))-1) == 64 ? 0 : (_FP_MUL_MEAT_1_wide_Z_f1 << (2*64 - (((3 + 53))-1)))) | _FP_MUL_MEAT_1_wide_Z_f0) != 0)); _FP_MUL_MEAT_1_wide_Z_f1 = 0; })); DR_f = _FP_MUL_MEAT_1_wide_Z_f0; } while (0); if ((DR_f & ((unsigned long) 1 << (3 + 53) % 64))) (DR_f = (DR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? DR_f & 1 : (DR_f << (64 - ((1)))) != 0))); else DR_e--; break; case (((3) << 2) | (3)): do { if (((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) && !((DA_f) & ((unsigned long) 1 << (53 -2) % 64))) { DR_s = DA_s; (DR_f = DA_f); } else { DR_s = DB_s; (DR_f = DB_f); } DR_c = 3; } while (0); break; case (((3) << 2) | (0)): case (((3) << 2) | (2)): case (((3) << 2) | (1)): DR_s = DA_s; case (((2) << 2) | (2)): case (((2) << 2) | (0)): case (((1) << 2) | (0)): case (((1) << 2) | (1)): (DR_f = DA_f); DR_c = DA_c; break; case (((0) << 2) | (3)): case (((2) << 2) | (3)): case (((1) << 2) | (3)): DR_s = DB_s; case (((0) << 2) | (2)): case (((0) << 2) | (1)): (DR_f = DB_f); DR_c = DB_c; break; case (((2) << 2) | (1)): case (((1) << 2) | (2)): DR_s = 0; DR_c = 3; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | 0); break; default: return 0; } } while (0); break;
  case 0x06e: do { if (113 < 53 || (32767 - 16383 < 2047 - 1023) || (16383 < 1023 + 53 - 1 && 16383 != 1023)) return 0; QA_s = DA_s; ((QA_f0 = DA_f), (QA_f1 = 0)); if ((((DA_e + 1) & 2047) > 1)) { QA_e = DA_e + 16383 - 1023; (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << ((113 - 53)) | QA_f0 >> (64 - ((113 - 53))); QA_f0 <<= ((113 - 53)); } 0; }) : ({ QA_f1 = QA_f0 << (((113 - 53)) - 64); QA_f0 = 0; })); } else { if (DA_e == 0) { do { if (0 && DA_e == 0 && !(DA_f == 0)) { (DA_f = 0); _fex |= (0); } } while (0); if ((DA_f == 0)) QA_e = 0; else if (16383 < 1023 + 53 - 1) { _fex |= (0); (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << ((113 - 53)) | QA_f0 >> (64 - ((113 - 53))); QA_f0 <<= ((113 - 53)); } 0; }) : ({ QA_f1 = QA_f0 << (((113 - 53)) - 64); QA_f0 = 0; })); QA_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (DA_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (DA_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (DA_f); else return 0; } while (0); (void) (((FP_EXTEND_lz + 113 - 64) < 64) ? ({ if (__builtin_constant_p (FP_EXTEND_lz + 113 - 64) && (FP_EXTEND_lz + 113 - 64) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << (FP_EXTEND_lz + 113 - 64) | QA_f0 >> (64 - (FP_EXTEND_lz + 113 - 64)); QA_f0 <<= (FP_EXTEND_lz + 113 - 64); } 0; }) : ({ QA_f1 = QA_f0 << ((FP_EXTEND_lz + 113 - 64) - 64); QA_f0 = 0; })); QA_e = (16383 - 1023 + 1 + (64 - 53) - FP_EXTEND_lz); } } else { QA_e = 32767; if (!(DA_f == 0)) { if (1 && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << ((113 - 53)) | QA_f0 >> (64 - ((113 - 53))); QA_f0 <<= ((113 - 53)); } 0; }) : ({ QA_f1 = QA_f0 << (((113 - 53)) - 64); QA_f0 = 0; })); if (1) do { if (0) { (QA_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QA_f1 | QA_f0) == 0)) { QA_s = 0; (QA_f0 = -1, QA_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QA_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } } } while (0);
        do { switch (QA_e) { default: (QA_f1) |= ((unsigned long) 1 << (113 -1) % 64); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << (3) | QA_f0 >> (64 - (3)); QA_f0 <<= (3); } 0; }) : ({ QA_f1 = QA_f0 << ((3) - 64); QA_f0 = 0; })); QA_e -= 16383; QA_c = 0; break; case 0: if (((QA_f1 | QA_f0) == 0)) QA_c = 1; else if (0) { QA_c = 1; (QA_f0 = 0, QA_f1 = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (QA_f1) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QA_f1); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QA_f1); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QA_f1); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QA_f0); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QA_f0); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QA_f0); else return 0; } while (0); (_FP_UNPACK_CANONICAL_shift) += 64; } } while (0); _FP_UNPACK_CANONICAL_shift -= ((2*64) - 113); (void) ((((_FP_UNPACK_CANONICAL_shift + 3)) < 64) ? ({ if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << ((_FP_UNPACK_CANONICAL_shift + 3)) | QA_f0 >> (64 - ((_FP_UNPACK_CANONICAL_shift + 3))); QA_f0 <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } 0; }) : ({ QA_f1 = QA_f0 << (((_FP_UNPACK_CANONICAL_shift + 3)) - 64); QA_f0 = 0; })); QA_e -= (16383 - 1 + _FP_UNPACK_CANONICAL_shift); QA_c = 0; _fex |= (0); } break; case 32767: if (((QA_f1 | QA_f0) == 0)) QA_c = 2; else { QA_c = 3; if (((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0);
        do { if (113 < 53 || (32767 - 16383 < 2047 - 1023) || (16383 < 1023 + 53 - 1 && 16383 != 1023)) return 0; QB_s = DB_s; ((QB_f0 = DB_f), (QB_f1 = 0)); if ((((DB_e + 1) & 2047) > 1)) { QB_e = DB_e + 16383 - 1023; (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << ((113 - 53)) | QB_f0 >> (64 - ((113 - 53))); QB_f0 <<= ((113 - 53)); } 0; }) : ({ QB_f1 = QB_f0 << (((113 - 53)) - 64); QB_f0 = 0; })); } else { if (DB_e == 0) { do { if (0 && DB_e == 0 && !(DB_f == 0)) { (DB_f = 0); _fex |= (0); } } while (0); if ((DB_f == 0)) QB_e = 0; else if (16383 < 1023 + 53 - 1) { _fex |= (0); (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << ((113 - 53)) | QB_f0 >> (64 - ((113 - 53))); QB_f0 <<= ((113 - 53)); } 0; }) : ({ QB_f1 = QB_f0 << (((113 - 53)) - 64); QB_f0 = 0; })); QB_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (DB_f); else return 0; } while (0); (void) (((FP_EXTEND_lz + 113 - 64) < 64) ? ({ if (__builtin_constant_p (FP_EXTEND_lz + 113 - 64) && (FP_EXTEND_lz + 113 - 64) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (FP_EXTEND_lz + 113 - 64) | QB_f0 >> (64 - (FP_EXTEND_lz + 113 - 64)); QB_f0 <<= (FP_EXTEND_lz + 113 - 64); } 0; }) : ({ QB_f1 = QB_f0 << ((FP_EXTEND_lz + 113 - 64) - 64); QB_f0 = 0; })); QB_e = (16383 - 1023 + 1 + (64 - 53) - FP_EXTEND_lz); } } else { QB_e = 32767; if (!(DB_f == 0)) { if (1 && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << ((113 - 53)) | QB_f0 >> (64 - ((113 - 53))); QB_f0 <<= ((113 - 53)); } 0; }) : ({ QB_f1 = QB_f0 << (((113 - 53)) - 64); QB_f0 = 0; })); if (1) do { if (0) { (QB_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QB_f1 | QB_f0) == 0)) { QB_s = 0; (QB_f0 = -1, QB_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QB_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } } } while (0);
        do { switch (QB_e) { default: (QB_f1) |= ((unsigned long) 1 << (113 -1) % 64); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (3) | QB_f0 >> (64 - (3)); QB_f0 <<= (3); } 0; }) : ({ QB_f1 = QB_f0 << ((3) - 64); QB_f0 = 0; })); QB_e -= 16383; QB_c = 0; break; case 0: if (((QB_f1 | QB_f0) == 0)) QB_c = 1; else if (0) { QB_c = 1; (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (QB_f1) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QB_f1); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QB_f1); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QB_f1); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QB_f0); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QB_f0); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QB_f0); else return 0; } while (0); (_FP_UNPACK_CANONICAL_shift) += 64; } } while (0); _FP_UNPACK_CANONICAL_shift -= ((2*64) - 113); (void) ((((_FP_UNPACK_CANONICAL_shift + 3)) < 64) ? ({ if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << ((_FP_UNPACK_CANONICAL_shift + 3)) | QB_f0 >> (64 - ((_FP_UNPACK_CANONICAL_shift + 3))); QB_f0 <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } 0; }) : ({ QB_f1 = QB_f0 << (((_FP_UNPACK_CANONICAL_shift + 3)) - 64); QB_f0 = 0; })); QB_e -= (16383 - 1 + _FP_UNPACK_CANONICAL_shift); QB_c = 0; _fex |= (0); } break; case 32767: if (((QB_f1 | QB_f0) == 0)) QB_c = 2; else { QB_c = 3; if (((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0);
  case 0x04b: do { QR_s = QA_s ^ QB_s; QR_e = QA_e + QB_e + 1; switch ((((QA_c) << 2) | (QB_c))) { case (((0) << 2) | (0)): QR_c = 0; do { unsigned long _FP_MUL_MEAT_2_wide_z_f[4]; do { unsigned long _FP_MUL_MEAT_DW_2_wide_b_f0 = 0, _FP_MUL_MEAT_DW_2_wide_b_f1 = 0; unsigned long _FP_MUL_MEAT_DW_2_wide_c_f0 = 0, _FP_MUL_MEAT_DW_2_wide_c_f1 = 0; do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" ((_FP_MUL_MEAT_2_wide_z_f[1])), "=&r" ((_FP_MUL_MEAT_2_wide_z_f[0])), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); } while (0); do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" (_FP_MUL_MEAT_DW_2_wide_b_f1), "=&r" (_FP_MUL_MEAT_DW_2_wide_b_f0), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f1)) : "cc"); } while (0); do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" (_FP_MUL_MEAT_DW_2_wide_c_f1), "=&r" (_FP_MUL_MEAT_DW_2_wide_c_f0), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)) : "cc"); } while (0); do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" ((_FP_MUL_MEAT_2_wide_z_f[3])), "=&r" ((_FP_MUL_MEAT_2_wide_z_f[2])), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)) : "cc"); } while (0); do { unsigned long __FP_FRAC_ADD_3_c1, __FP_FRAC_ADD_3_c2; (_FP_MUL_MEAT_2_wide_z_f[1]) = _FP_MUL_MEAT_DW_2_wide_b_f0 + (_FP_MUL_MEAT_2_wide_z_f[1]); __FP_FRAC_ADD_3_c1 = (_FP_MUL_MEAT_2_wide_z_f[1]) < _FP_MUL_MEAT_DW_2_wide_b_f0; (_FP_MUL_MEAT_2_wide_z_f[2]) = _FP_MUL_MEAT_DW_2_wide_b_f1 + (_FP_MUL_MEAT_2_wide_z_f[2]); __FP_FRAC_ADD_3_c2 = (_FP_MUL_MEAT_2_wide_z_f[2]) < _FP_MUL_MEAT_DW_2_wide_b_f1; (_FP_MUL_MEAT_2_wide_z_f[2]) += __FP_FRAC_ADD_3_c1; __FP_FRAC_ADD_3_c2 |= (_FP_MUL_MEAT_2_wide_z_f[2]) < __FP_FRAC_ADD_3_c1; (_FP_MUL_MEAT_2_wide_z_f[3]) = 0 + (_FP_MUL_MEAT_2_wide_z_f[3]) + __FP_FRAC_ADD_3_c2; } while (0); do { unsigned long __FP_FRAC_ADD_3_c1, __FP_FRAC_ADD_3_c2; (_FP_MUL_MEAT_2_wide_z_f[1]) = _FP_MUL_MEAT_DW_2_wide_c_f0 + (_FP_MUL_MEAT_2_wide_z_f[1]); __FP_FRAC_ADD_3_c1 = (_FP_MUL_MEAT_2_wide_z_f[1]) < _FP_MUL_MEAT_DW_2_wide_c_f0; (_FP_MUL_MEAT_2_wide_z_f[2]) = _FP_MUL_MEAT_DW_2_wide_c_f1 + (_FP_MUL_MEAT_2_wide_z_f[2]); __FP_FRAC_ADD_3_c2 = (_FP_MUL_MEAT_2_wide_z_f[2]) < _FP_MUL_MEAT_DW_2_wide_c_f1; (_FP_MUL_MEAT_2_wide_z_f[2]) += __FP_FRAC_ADD_3_c1; __FP_FRAC_ADD_3_c2 |= (_FP_MUL_MEAT_2_wide_z_f[2]) < __FP_FRAC_ADD_3_c1; (_FP_MUL_MEAT_2_wide_z_f[3]) = 0 + (_FP_MUL_MEAT_2_wide_z_f[3]) + __FP_FRAC_ADD_3_c2; } while (0); } while (0); do { int _FP_FRAC_SRS_4_sticky; do { long _FP_FRAC_SRST_4_up, _FP_FRAC_SRST_4_down; long _FP_FRAC_SRST_4_skip, _FP_FRAC_SRST_4_i; unsigned long _FP_FRAC_SRST_4_s; _FP_FRAC_SRST_4_skip = ((((3 + 113))-1)) / 64; _FP_FRAC_SRST_4_down = ((((3 + 113))-1)) % 64; _FP_FRAC_SRST_4_up = 64 - _FP_FRAC_SRST_4_down; for (_FP_FRAC_SRST_4_s = _FP_FRAC_SRST_4_i = 0; _FP_FRAC_SRST_4_i < _FP_FRAC_SRST_4_skip; ++_FP_FRAC_SRST_4_i) _FP_FRAC_SRST_4_s |= _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i]; if (!_FP_FRAC_SRST_4_down) for (_FP_FRAC_SRST_4_i = 0; _FP_FRAC_SRST_4_i <= 3-_FP_FRAC_SRST_4_skip; ++_FP_FRAC_SRST_4_i) _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i] = _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip]; else { _FP_FRAC_SRST_4_s |= _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i] << _FP_FRAC_SRST_4_up; for (_FP_FRAC_SRST_4_i = 0; _FP_FRAC_SRST_4_i < 3-_FP_FRAC_SRST_4_skip; ++_FP_FRAC_SRST_4_i) _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i] = ((_FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip] >> _FP_FRAC_SRST_4_down) | (_FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip+1] << _FP_FRAC_SRST_4_up)); _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i++] = _FP_MUL_MEAT_2_wide_z_f[3] >> _FP_FRAC_SRST_4_down; } for (; _FP_FRAC_SRST_4_i < 4; ++_FP_FRAC_SRST_4_i) _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i] = 0; _FP_FRAC_SRS_4_sticky = (_FP_FRAC_SRST_4_s != 0); } while (0); _FP_MUL_MEAT_2_wide_z_f[0] |= _FP_FRAC_SRS_4_sticky; } while (0); QR_f0 = (_FP_MUL_MEAT_2_wide_z_f[0]); QR_f1 = (_FP_MUL_MEAT_2_wide_z_f[1]); } while (0); if (((QR_f1) & ((unsigned long) 1 << ((3 + 113) % 64)))) (void) (((1) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (1)) | QR_f0 >> (1) | (__builtin_constant_p (1) && (1) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (1))) != 0)); QR_f1 >>= (1); }) : ({ QR_f0 = (QR_f1 >> ((1) - 64) | ((((1) == 64 ? 0 : (QR_f1 << (2*64 - (1)))) | QR_f0) != 0)); QR_f1 = 0; })); else QR_e--; break; case (((3) << 2) | (3)): do { if (((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) && !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64))) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } QR_c = 3; } while (0); break; case (((3) << 2) | (0)): case (((3) << 2) | (2)): case (((3) << 2) | (1)): QR_s = QA_s; case (((2) << 2) | (2)): case (((2) << 2) | (0)): case (((1) << 2) | (0)): case (((1) << 2) | (1)): (QR_f0 = QA_f0, QR_f1 = QA_f1); QR_c = QA_c; break; case (((0) << 2) | (3)): case (((2) << 2) | (3)): case (((1) << 2) | (3)): QR_s = QB_s; case (((0) << 2) | (2)): case (((0) << 2) | (1)): (QR_f0 = QB_f0, QR_f1 = QB_f1); QR_c = QB_c; break; case (((2) << 2) | (1)): case (((1) << 2) | (2)): QR_s = 0; QR_c = 3; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | 0); break; default: return 0; } } while (0); break;

  case 0x04d: do { SR_s = SA_s ^ SB_s; SR_e = SA_e - SB_e; switch ((((SA_c) << 2) | (SB_c))) { case (((0) << 2) | (0)): SR_c = 0; do { unsigned long _FP_DIV_MEAT_1_imm_q, _FP_DIV_MEAT_1_imm_r; SA_f <<= (SA_f < SB_f ? SR_e--, (3 + 24) : (3 + 24) - 1); do { (_FP_DIV_MEAT_1_imm_q) = (SA_f) / (SB_f), (_FP_DIV_MEAT_1_imm_r) = (SA_f) % (SB_f); } while (0); SR_f = _FP_DIV_MEAT_1_imm_q | (_FP_DIV_MEAT_1_imm_r != 0); } while (0); break; case (((3) << 2) | (3)): do { if (((SB_f) & ((unsigned long) 1 << (24 -2))) && !((SA_f) & ((unsigned long) 1 << (24 -2)))) { SR_s = SA_s; (SR_f = SA_f); } else { SR_s = SB_s; (SR_f = SB_f); } SR_c = 3; } while (0); break; case (((3) << 2) | (0)): case (((3) << 2) | (2)): case (((3) << 2) | (1)): SR_s = SA_s; (SR_f = SA_f); SR_c = SA_c; break; case (((0) << 2) | (3)): case (((2) << 2) | (3)): case (((1) << 2) | (3)): SR_s = SB_s; (SR_f = SB_f); SR_c = SB_c; break; case (((0) << 2) | (2)): case (((1) << 2) | (2)): case (((1) << 2) | (0)): SR_c = 1; break; case (((0) << 2) | (1)): _fex |= ((1 << 1)); case (((2) << 2) | (1)): case (((2) << 2) | (0)): SR_c = 2; break; case (((2) << 2) | (2)): case (((1) << 2) | (1)): SR_s = 0; SR_c = 3; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); _fex |= ((1 << 4) | (SA_c == 2 ? 0 : 0)); break; default: return 0; } } while (0); break;
  case 0x04e: do { DR_s = DA_s ^ DB_s; DR_e = DA_e - DB_e; switch ((((DA_c) << 2) | (DB_c))) { case (((0) << 2) | (0)): DR_c = 0; do { unsigned long _FP_DIV_MEAT_1_udiv_norm_nh; unsigned long _FP_DIV_MEAT_1_udiv_norm_nl; unsigned long _FP_DIV_MEAT_1_udiv_norm_q; unsigned long _FP_DIV_MEAT_1_udiv_norm_r; unsigned long _FP_DIV_MEAT_1_udiv_norm_y; _FP_DIV_MEAT_1_udiv_norm_y = DB_f << (64 - (3 + 53)); if (DA_f < DB_f) { DR_e--; _FP_DIV_MEAT_1_udiv_norm_nl = 0; _FP_DIV_MEAT_1_udiv_norm_nh = DA_f; } else { _FP_DIV_MEAT_1_udiv_norm_nl = DA_f << (64 - 1); _FP_DIV_MEAT_1_udiv_norm_nh = DA_f >> 1; } do { unsigned long __d1, __d0, __q1, __q0, __r1, __r0, __m; __d1 = (_FP_DIV_MEAT_1_udiv_norm_y >> 32); __d0 = (USItype)_FP_DIV_MEAT_1_udiv_norm_y; __r1 = (_FP_DIV_MEAT_1_udiv_norm_nh) % __d1; __q1 = (_FP_DIV_MEAT_1_udiv_norm_nh) / __d1; __m = (unsigned long) __q1 * __d0; __r1 = (__r1 << 32) | (_FP_DIV_MEAT_1_udiv_norm_nl >> 32); if (__r1 < __m) { __q1--, __r1 += (_FP_DIV_MEAT_1_udiv_norm_y); if (__r1 >= (_FP_DIV_MEAT_1_udiv_norm_y)) if (__r1 < __m) __q1--, __r1 += (_FP_DIV_MEAT_1_udiv_norm_y); } __r1 -= __m; __r0 = __r1 % __d1; __q0 = __r1 / __d1; __m = (unsigned long) __q0 * __d0; __r0 = (__r0 << 32) | ((USItype)_FP_DIV_MEAT_1_udiv_norm_nl); if (__r0 < __m) { __q0--, __r0 += (_FP_DIV_MEAT_1_udiv_norm_y); if (__r0 >= (_FP_DIV_MEAT_1_udiv_norm_y)) if (__r0 < __m) __q0--, __r0 += (_FP_DIV_MEAT_1_udiv_norm_y); } __r0 -= __m; (_FP_DIV_MEAT_1_udiv_norm_q) = (unsigned long) (__q1 << 32) | __q0; (_FP_DIV_MEAT_1_udiv_norm_r) = __r0; } while (0); DR_f = (_FP_DIV_MEAT_1_udiv_norm_q | (_FP_DIV_MEAT_1_udiv_norm_r != 0)); } while (0); break; case (((3) << 2) | (3)): do { if (((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) && !((DA_f) & ((unsigned long) 1 << (53 -2) % 64))) { DR_s = DA_s; (DR_f = DA_f); } else { DR_s = DB_s; (DR_f = DB_f); } DR_c = 3; } while (0); break; case (((3) << 2) | (0)): case (((3) << 2) | (2)): case (((3) << 2) | (1)): DR_s = DA_s; (DR_f = DA_f); DR_c = DA_c; break; case (((0) << 2) | (3)): case (((2) << 2) | (3)): case (((1) << 2) | (3)): DR_s = DB_s; (DR_f = DB_f); DR_c = DB_c; break; case (((0) << 2) | (2)): case (((1) << 2) | (2)): case (((1) << 2) | (0)): DR_c = 1; break; case (((0) << 2) | (1)): _fex |= ((1 << 1)); case (((2) << 2) | (1)): case (((2) << 2) | (0)): DR_c = 2; break; case (((2) << 2) | (2)): case (((1) << 2) | (1)): DR_s = 0; DR_c = 3; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | (DA_c == 2 ? 0 : 0)); break; default: return 0; } } while (0); break;
  case 0x04f: do { QR_s = QA_s ^ QB_s; QR_e = QA_e - QB_e; switch ((((QA_c) << 2) | (QB_c))) { case (((0) << 2) | (0)): QR_c = 0; do { unsigned long _FP_DIV_MEAT_2_udiv_n_f2; unsigned long _FP_DIV_MEAT_2_udiv_n_f1; unsigned long _FP_DIV_MEAT_2_udiv_n_f0; unsigned long _FP_DIV_MEAT_2_udiv_r_f1; unsigned long _FP_DIV_MEAT_2_udiv_r_f0; unsigned long _FP_DIV_MEAT_2_udiv_m_f1; unsigned long _FP_DIV_MEAT_2_udiv_m_f0; if ((QA_f1 > QB_f1 || (QA_f1 == QB_f1 && QA_f0 >= QB_f0))) { _FP_DIV_MEAT_2_udiv_n_f2 = QA_f1 >> 1; _FP_DIV_MEAT_2_udiv_n_f1 = QA_f1 << (64 - 1) | QA_f0 >> 1; _FP_DIV_MEAT_2_udiv_n_f0 = QA_f0 << (64 - 1); } else { QR_e--; _FP_DIV_MEAT_2_udiv_n_f2 = QA_f1; _FP_DIV_MEAT_2_udiv_n_f1 = QA_f0; _FP_DIV_MEAT_2_udiv_n_f0 = 0; } (void) (((((2*64) - (3 + 113))) < 64) ? ({ if (__builtin_constant_p (((2*64) - (3 + 113))) && (((2*64) - (3 + 113))) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (((2*64) - (3 + 113))) | QB_f0 >> (64 - (((2*64) - (3 + 113)))); QB_f0 <<= (((2*64) - (3 + 113))); } 0; }) : ({ QB_f1 = QB_f0 << ((((2*64) - (3 + 113))) - 64); QB_f0 = 0; })); do { unsigned long __d1, __d0, __q1, __q0, __r1, __r0, __m; __d1 = (QB_f1 >> 32); __d0 = (USItype)QB_f1; __r1 = (_FP_DIV_MEAT_2_udiv_n_f2) % __d1; __q1 = (_FP_DIV_MEAT_2_udiv_n_f2) / __d1; __m = (unsigned long) __q1 * __d0; __r1 = (__r1 << 32) | (_FP_DIV_MEAT_2_udiv_n_f1 >> 32); if (__r1 < __m) { __q1--, __r1 += (QB_f1); if (__r1 >= (QB_f1)) if (__r1 < __m) __q1--, __r1 += (QB_f1); } __r1 -= __m; __r0 = __r1 % __d1; __q0 = __r1 / __d1; __m = (unsigned long) __q0 * __d0; __r0 = (__r0 << 32) | ((USItype)_FP_DIV_MEAT_2_udiv_n_f1); if (__r0 < __m) { __q0--, __r0 += (QB_f1); if (__r0 >= (QB_f1)) if (__r0 < __m) __q0--, __r0 += (QB_f1); } __r0 -= __m; (QR_f1) = (unsigned long) (__q1 << 32) | __q0; (_FP_DIV_MEAT_2_udiv_r_f1) = __r0; } while (0); do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" (_FP_DIV_MEAT_2_udiv_m_f1), "=&r" (_FP_DIV_MEAT_2_udiv_m_f0), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(QB_f0)) : "cc"); } while (0); _FP_DIV_MEAT_2_udiv_r_f0 = _FP_DIV_MEAT_2_udiv_n_f0; if ((_FP_DIV_MEAT_2_udiv_m_f1 > _FP_DIV_MEAT_2_udiv_r_f1 || (_FP_DIV_MEAT_2_udiv_m_f1 == _FP_DIV_MEAT_2_udiv_r_f1 && _FP_DIV_MEAT_2_udiv_m_f0 > _FP_DIV_MEAT_2_udiv_r_f0))) { QR_f1--; __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_DIV_MEAT_2_udiv_r_f1), "=&r" (_FP_DIV_MEAT_2_udiv_r_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f0)) : "cc"); if ((_FP_DIV_MEAT_2_udiv_r_f1 > QB_f1 || (_FP_DIV_MEAT_2_udiv_r_f1 == QB_f1 && _FP_DIV_MEAT_2_udiv_r_f0 >= QB_f0)) && (_FP_DIV_MEAT_2_udiv_m_f1 > _FP_DIV_MEAT_2_udiv_r_f1 || (_FP_DIV_MEAT_2_udiv_m_f1 == _FP_DIV_MEAT_2_udiv_r_f1 && _FP_DIV_MEAT_2_udiv_m_f0 > _FP_DIV_MEAT_2_udiv_r_f0))) { QR_f1--; __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_DIV_MEAT_2_udiv_r_f1), "=&r" (_FP_DIV_MEAT_2_udiv_r_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f0)) : "cc"); } } __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (_FP_DIV_MEAT_2_udiv_r_f1), "=&r" (_FP_DIV_MEAT_2_udiv_r_f0) : "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f1)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_m_f1)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f0)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_m_f0)) : "cc"); if (_FP_DIV_MEAT_2_udiv_r_f1 == QB_f1) { QR_f0 = -1; } else { do { unsigned long __d1, __d0, __q1, __q0, __r1, __r0, __m; __d1 = (QB_f1 >> 32); __d0 = (USItype)QB_f1; __r1 = (_FP_DIV_MEAT_2_udiv_r_f1) % __d1; __q1 = (_FP_DIV_MEAT_2_udiv_r_f1) / __d1; __m = (unsigned long) __q1 * __d0; __r1 = (__r1 << 32) | (_FP_DIV_MEAT_2_udiv_r_f0 >> 32); if (__r1 < __m) { __q1--, __r1 += (QB_f1); if (__r1 >= (QB_f1)) if (__r1 < __m) __q1--, __r1 += (QB_f1); } __r1 -= __m; __r0 = __r1 % __d1; __q0 = __r1 / __d1; __m = (unsigned long) __q0 * __d0; __r0 = (__r0 << 32) | ((USItype)_FP_DIV_MEAT_2_udiv_r_f0); if (__r0 < __m) { __q0--, __r0 += (QB_f1); if (__r0 >= (QB_f1)) if (__r0 < __m) __q0--, __r0 += (QB_f1); } __r0 -= __m; (QR_f0) = (unsigned long) (__q1 << 32) | __q0; (_FP_DIV_MEAT_2_udiv_r_f1) = __r0; } while (0); do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" (_FP_DIV_MEAT_2_udiv_m_f1), "=&r" (_FP_DIV_MEAT_2_udiv_m_f0), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(QR_f0)), "r" ((UDItype)(QB_f0)) : "cc"); } while (0); _FP_DIV_MEAT_2_udiv_r_f0 = 0; if ((_FP_DIV_MEAT_2_udiv_m_f1 > _FP_DIV_MEAT_2_udiv_r_f1 || (_FP_DIV_MEAT_2_udiv_m_f1 == _FP_DIV_MEAT_2_udiv_r_f1 && _FP_DIV_MEAT_2_udiv_m_f0 > _FP_DIV_MEAT_2_udiv_r_f0))) { QR_f0--; __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_DIV_MEAT_2_udiv_r_f1), "=&r" (_FP_DIV_MEAT_2_udiv_r_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f0)) : "cc"); if ((_FP_DIV_MEAT_2_udiv_r_f1 > QB_f1 || (_FP_DIV_MEAT_2_udiv_r_f1 == QB_f1 && _FP_DIV_MEAT_2_udiv_r_f0 >= QB_f0)) && (_FP_DIV_MEAT_2_udiv_m_f1 > _FP_DIV_MEAT_2_udiv_r_f1 || (_FP_DIV_MEAT_2_udiv_m_f1 == _FP_DIV_MEAT_2_udiv_r_f1 && _FP_DIV_MEAT_2_udiv_m_f0 > _FP_DIV_MEAT_2_udiv_r_f0))) { QR_f0--; __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_DIV_MEAT_2_udiv_r_f1), "=&r" (_FP_DIV_MEAT_2_udiv_r_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f0)) : "cc"); } } if (!(_FP_DIV_MEAT_2_udiv_r_f1 == _FP_DIV_MEAT_2_udiv_m_f1 && _FP_DIV_MEAT_2_udiv_r_f0 == _FP_DIV_MEAT_2_udiv_m_f0)) QR_f0 |= ((unsigned long) 1 << 0); } } while (0); break; case (((3) << 2) | (3)): do { if (((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) && !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64))) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } QR_c = 3; } while (0); break; case (((3) << 2) | (0)): case (((3) << 2) | (2)): case (((3) << 2) | (1)): QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); QR_c = QA_c; break; case (((0) << 2) | (3)): case (((2) << 2) | (3)): case (((1) << 2) | (3)): QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); QR_c = QB_c; break; case (((0) << 2) | (2)): case (((1) << 2) | (2)): case (((1) << 2) | (0)): QR_c = 1; break; case (((0) << 2) | (1)): _fex |= ((1 << 1)); case (((2) << 2) | (1)): case (((2) << 2) | (0)): QR_c = 2; break; case (((2) << 2) | (2)): case (((1) << 2) | (1)): QR_s = 0; QR_c = 3; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | (QA_c == 2 ? 0 : 0)); break; default: return 0; } } while (0); break;

  case 0x029: do { unsigned long _FP_SQRT_T_f = 0; unsigned long _FP_SQRT_S_f = 0; unsigned long _FP_SQRT_q; switch (SB_c) { case 3: (SR_f = SB_f); SR_s = SB_s; SR_c = 3; break; case 2: if (SB_s) { SR_s = 0; SR_c = 3; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); _fex |= ((1 << 4) | 0); } else { SR_s = 0; SR_c = 2; } break; case 1: SR_s = SB_s; SR_c = 1; break; case 0: SR_s = 0; if (SB_s) { SR_c = 3; SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); _fex |= ((1 << 4) | 0); break; } SR_c = 0; if (SB_e & 1) do { if (__builtin_constant_p (1) && (1) == 1) SB_f += SB_f; else SB_f <<= (1); } while (0); SR_e = SB_e >> 1; (_FP_SQRT_S_f = 0); (SR_f = 0); _FP_SQRT_q = ((unsigned long) 1 << ((3 + 24))) >> 1; do { while ((_FP_SQRT_q) != ((unsigned long) 1 << 2)) { _FP_SQRT_T_f = _FP_SQRT_S_f + (_FP_SQRT_q); if (_FP_SQRT_T_f <= SB_f) { _FP_SQRT_S_f = _FP_SQRT_T_f + (_FP_SQRT_q); SB_f -= _FP_SQRT_T_f; SR_f += (_FP_SQRT_q); } do { if (__builtin_constant_p (1) && (1) == 1) SB_f += SB_f; else SB_f <<= (1); } while (0); (_FP_SQRT_q) >>= 1; } if (SB_f) { if (_FP_SQRT_S_f < SB_f) SR_f |= ((unsigned long) 1 << 2); SR_f |= ((unsigned long) 1 << 0); } } while (0); } } while (0); break;
  case 0x02a: do { unsigned long _FP_SQRT_T_f = 0; unsigned long _FP_SQRT_S_f = 0; unsigned long _FP_SQRT_q; switch (DB_c) { case 3: (DR_f = DB_f); DR_s = DB_s; DR_c = 3; break; case 2: if (DB_s) { DR_s = 0; DR_c = 3; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | 0); } else { DR_s = 0; DR_c = 2; } break; case 1: DR_s = DB_s; DR_c = 1; break; case 0: DR_s = 0; if (DB_s) { DR_c = 3; DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | 0); break; } DR_c = 0; if (DB_e & 1) do { if (__builtin_constant_p (1) && (1) == 1) DB_f += DB_f; else DB_f <<= (1); } while (0); DR_e = DB_e >> 1; (_FP_SQRT_S_f = 0); (DR_f = 0); _FP_SQRT_q = ((unsigned long) 1 << (3 + 53) % 64) >> 1; do { while ((_FP_SQRT_q) != ((unsigned long) 1 << 2)) { _FP_SQRT_T_f = _FP_SQRT_S_f + (_FP_SQRT_q); if (_FP_SQRT_T_f <= DB_f) { _FP_SQRT_S_f = _FP_SQRT_T_f + (_FP_SQRT_q); DB_f -= _FP_SQRT_T_f; DR_f += (_FP_SQRT_q); } do { if (__builtin_constant_p (1) && (1) == 1) DB_f += DB_f; else DB_f <<= (1); } while (0); (_FP_SQRT_q) >>= 1; } if (DB_f) { if (_FP_SQRT_S_f < DB_f) DR_f |= ((unsigned long) 1 << 2); DR_f |= ((unsigned long) 1 << 0); } } while (0); } } while (0); break;
  case 0x02b: do { unsigned long _FP_SQRT_T_f0 = 0, _FP_SQRT_T_f1 = 0; unsigned long _FP_SQRT_S_f0 = 0, _FP_SQRT_S_f1 = 0; unsigned long _FP_SQRT_q; switch (QB_c) { case 3: (QR_f0 = QB_f0, QR_f1 = QB_f1); QR_s = QB_s; QR_c = 3; break; case 2: if (QB_s) { QR_s = 0; QR_c = 3; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | 0); } else { QR_s = 0; QR_c = 2; } break; case 1: QR_s = QB_s; QR_c = 1; break; case 0: QR_s = 0; if (QB_s) { QR_c = 3; QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | 0); break; } QR_c = 0; if (QB_e & 1) (void) (((1) < 64) ? ({ if (__builtin_constant_p (1) && (1) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (1) | QB_f0 >> (64 - (1)); QB_f0 <<= (1); } 0; }) : ({ QB_f1 = QB_f0 << ((1) - 64); QB_f0 = 0; })); QR_e = QB_e >> 1; (_FP_SQRT_S_f0 = 0, _FP_SQRT_S_f1 = 0); (QR_f0 = 0, QR_f1 = 0); _FP_SQRT_q = ((unsigned long) 1 << ((3 + 113) % 64)) >> 1; do { while (_FP_SQRT_q) { _FP_SQRT_T_f1 = _FP_SQRT_S_f1 + (_FP_SQRT_q); if (_FP_SQRT_T_f1 <= QB_f1) { _FP_SQRT_S_f1 = _FP_SQRT_T_f1 + (_FP_SQRT_q); QB_f1 -= _FP_SQRT_T_f1; QR_f1 += (_FP_SQRT_q); } (void) (((1) < 64) ? ({ if (__builtin_constant_p (1) && (1) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (1) | QB_f0 >> (64 - (1)); QB_f0 <<= (1); } 0; }) : ({ QB_f1 = QB_f0 << ((1) - 64); QB_f0 = 0; })); (_FP_SQRT_q) >>= 1; } (_FP_SQRT_q) = (unsigned long) 1 << (64 - 1); while ((_FP_SQRT_q) != ((unsigned long) 1 << 2)) { _FP_SQRT_T_f0 = _FP_SQRT_S_f0 + (_FP_SQRT_q); _FP_SQRT_T_f1 = _FP_SQRT_S_f1; if (_FP_SQRT_T_f1 < QB_f1 || (_FP_SQRT_T_f1 == QB_f1 && _FP_SQRT_T_f0 <= QB_f0)) { _FP_SQRT_S_f0 = _FP_SQRT_T_f0 + (_FP_SQRT_q); _FP_SQRT_S_f1 += (_FP_SQRT_T_f0 > _FP_SQRT_S_f0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QB_f1), "=&r" (QB_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(_FP_SQRT_T_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(_FP_SQRT_T_f0)) : "cc"); QR_f0 += (_FP_SQRT_q); } (void) (((1) < 64) ? ({ if (__builtin_constant_p (1) && (1) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (1) | QB_f0 >> (64 - (1)); QB_f0 <<= (1); } 0; }) : ({ QB_f1 = QB_f0 << ((1) - 64); QB_f0 = 0; })); (_FP_SQRT_q) >>= 1; } if (QB_f0 | QB_f1) { if (_FP_SQRT_S_f1 < QB_f1 || (_FP_SQRT_S_f1 == QB_f1 && _FP_SQRT_S_f0 < QB_f0)) QR_f0 |= ((unsigned long) 1 << 2); QR_f0 |= ((unsigned long) 1 << 0); } } while (0); } } while (0); break;

  case 0x003: rd->q[0] = rs2->q[0]; rd->q[1] = rs2->q[1]; break;
  case 0x00b: rd->q[0] = rs2->q[0] & 0x7fffffffffffffffUL; rd->q[1] = rs2->q[1]; break;
  case 0x007: rd->q[0] = rs2->q[0] ^ 0x8000000000000000UL; rd->q[1] = rs2->q[1]; break;

  case 0x0d1: do { if (SB_e < 127) { ((UIR)) = 0; if (SB_e == 0) { if (!(SB_f == 0)) { if (!0) _fex |= ((1 << 0)); _fex |= (0); } } else _fex |= ((1 << 0)); } else if (((1)) == 2 && (SB_e >= ((255 < 127 + 24 + ((32)) - 1) ? 255 : 127 + 24 + ((32)) - 1))) { ((UIR)) = 0; _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (SB_e == 255) { if (!(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else if (((1)) != 2 && (SB_e >= (255 < 127 + ((32)) ? 255 : (127 + ((32)) - (((1)) > 0 || SB_s))) || (!((1)) && SB_s))) { if ((1)) { ((UIR)) = 1; ((UIR)) <<= ((32)) - 1; ((UIR)) -= 1 - SB_s; } else { ((UIR)) = 0; if (!SB_s) ((UIR)) = ~((UIR)); } if (127 + ((32)) - 1 < 255 && ((1)) && SB_s && SB_e == 127 + ((32)) - 1) { int _FP_TO_INT_inexact = 0; (void) ((24 > ((32))) ? ({ do { _FP_TO_INT_inexact = (__builtin_constant_p ((24 - ((32)))) && ((24 - ((32)))) == 1 ? SB_f & 1 : (SB_f << (64 - ((24 - ((32)))))) != 0); SB_f = SB_f >> ((24 - ((32)))); } while (0); 0; }) : 0); if (!(SB_f == 0)) _fex |= ((1 << 4) | 0); else if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } else _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (SB_e == 255) { if (!(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else { int _FP_TO_INT_inexact = 0; (SB_f) |= ((unsigned long) 1 << (24 -1)); if (SB_e >= 127 + 24 - 1) { ((((UIR))) = SB_f); ((UIR)) <<= SB_e - 127 - 24 + 1; } else { do { _FP_TO_INT_inexact = (__builtin_constant_p (((24 + 127 - 1 - SB_e))) && (((24 + 127 - 1 - SB_e))) == 1 ? SB_f & 1 : (SB_f << (64 - (((24 + 127 - 1 - SB_e))))) != 0); SB_f = SB_f >> (((24 + 127 - 1 - SB_e))); } while (0); ((((UIR))) = SB_f); } if (((1)) && SB_s) ((UIR)) = -((UIR)); if (((1)) == 2 && SB_e >= 127 + ((32)) - 1) { if (SB_e > 127 + ((32)) - 1 || !SB_s || ((UIR)) != (((typeof ((UIR))) 1) << (((32)) - 1))) { _FP_TO_INT_inexact = 0; _fex |= ((1 << 4) | 0); } } if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } } while (0); IR = UIR; break;
  case 0x0d2: do { if (DB_e < 1023) { ((UIR)) = 0; if (DB_e == 0) { if (!(DB_f == 0)) { if (!0) _fex |= ((1 << 0)); _fex |= (0); } } else _fex |= ((1 << 0)); } else if (((1)) == 2 && (DB_e >= ((2047 < 1023 + 53 + ((32)) - 1) ? 2047 : 1023 + 53 + ((32)) - 1))) { ((UIR)) = 0; _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (DB_e == 2047) { if (!(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else if (((1)) != 2 && (DB_e >= (2047 < 1023 + ((32)) ? 2047 : (1023 + ((32)) - (((1)) > 0 || DB_s))) || (!((1)) && DB_s))) { if ((1)) { ((UIR)) = 1; ((UIR)) <<= ((32)) - 1; ((UIR)) -= 1 - DB_s; } else { ((UIR)) = 0; if (!DB_s) ((UIR)) = ~((UIR)); } if (1023 + ((32)) - 1 < 2047 && ((1)) && DB_s && DB_e == 1023 + ((32)) - 1) { int _FP_TO_INT_inexact = 0; (void) ((53 > ((32))) ? ({ do { _FP_TO_INT_inexact = (__builtin_constant_p ((53 - ((32)))) && ((53 - ((32)))) == 1 ? DB_f & 1 : (DB_f << (64 - ((53 - ((32)))))) != 0); DB_f = DB_f >> ((53 - ((32)))); } while (0); 0; }) : 0); if (!(DB_f == 0)) _fex |= ((1 << 4) | 0); else if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } else _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (DB_e == 2047) { if (!(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else { int _FP_TO_INT_inexact = 0; (DB_f) |= ((unsigned long) 1 << (53 -1) % 64); if (DB_e >= 1023 + 53 - 1) { ((((UIR))) = DB_f); ((UIR)) <<= DB_e - 1023 - 53 + 1; } else { do { _FP_TO_INT_inexact = (__builtin_constant_p (((53 + 1023 - 1 - DB_e))) && (((53 + 1023 - 1 - DB_e))) == 1 ? DB_f & 1 : (DB_f << (64 - (((53 + 1023 - 1 - DB_e))))) != 0); DB_f = DB_f >> (((53 + 1023 - 1 - DB_e))); } while (0); ((((UIR))) = DB_f); } if (((1)) && DB_s) ((UIR)) = -((UIR)); if (((1)) == 2 && DB_e >= 1023 + ((32)) - 1) { if (DB_e > 1023 + ((32)) - 1 || !DB_s || ((UIR)) != (((typeof ((UIR))) 1) << (((32)) - 1))) { _FP_TO_INT_inexact = 0; _fex |= ((1 << 4) | 0); } } if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } } while (0); IR = UIR; break;
  case 0x0d3: do { if (QB_e < 16383) { ((UIR)) = 0; if (QB_e == 0) { if (!((QB_f1 | QB_f0) == 0)) { if (!0) _fex |= ((1 << 0)); _fex |= (0); } } else _fex |= ((1 << 0)); } else if (((1)) == 2 && (QB_e >= ((32767 < 16383 + 113 + ((32)) - 1) ? 32767 : 16383 + 113 + ((32)) - 1))) { ((UIR)) = 0; _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (QB_e == 32767) { if (!((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else if (((1)) != 2 && (QB_e >= (32767 < 16383 + ((32)) ? 32767 : (16383 + ((32)) - (((1)) > 0 || QB_s))) || (!((1)) && QB_s))) { if ((1)) { ((UIR)) = 1; ((UIR)) <<= ((32)) - 1; ((UIR)) -= 1 - QB_s; } else { ((UIR)) = 0; if (!QB_s) ((UIR)) = ~((UIR)); } if (16383 + ((32)) - 1 < 32767 && ((1)) && QB_s && QB_e == 16383 + ((32)) - 1) { int _FP_TO_INT_inexact = 0; (void) ((113 > ((32))) ? ({ (void) (((113 - ((32))) < 64) ? ({ _FP_TO_INT_inexact = (__builtin_constant_p (113 - ((32))) && (113 - ((32))) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (113 - ((32))))) != 0); QB_f0 = (QB_f1 << (64 - (113 - ((32)))) | QB_f0 >> (113 - ((32)))); QB_f1 >>= (113 - ((32))); }) : ({ _FP_TO_INT_inexact = ((((113 - ((32))) == 64 ? 0 : (QB_f1 << (2*64 - (113 - ((32)))))) | QB_f0) != 0); QB_f0 = (QB_f1 >> ((113 - ((32))) - 64)); QB_f1 = 0; })); 0; }) : 0); if (!((QB_f1 | QB_f0) == 0)) _fex |= ((1 << 4) | 0); else if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } else _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (QB_e == 32767) { if (!((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else { int _FP_TO_INT_inexact = 0; (QB_f1) |= ((unsigned long) 1 << (113 -1) % 64); if (QB_e >= 16383 + 113 - 1) { (void) (((((32))) <= 64) ? ({ (((UIR))) = QB_f0; }) : ({ (((UIR))) = QB_f1; (((UIR))) <<= 64; (((UIR))) += QB_f0; })); ((UIR)) <<= QB_e - 16383 - 113 + 1; } else { (void) ((((113 + 16383 - 1 - QB_e)) < 64) ? ({ _FP_TO_INT_inexact = (__builtin_constant_p ((113 + 16383 - 1 - QB_e)) && ((113 + 16383 - 1 - QB_e)) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - ((113 + 16383 - 1 - QB_e)))) != 0); QB_f0 = (QB_f1 << (64 - ((113 + 16383 - 1 - QB_e))) | QB_f0 >> ((113 + 16383 - 1 - QB_e))); QB_f1 >>= ((113 + 16383 - 1 - QB_e)); }) : ({ _FP_TO_INT_inexact = (((((113 + 16383 - 1 - QB_e)) == 64 ? 0 : (QB_f1 << (2*64 - ((113 + 16383 - 1 - QB_e))))) | QB_f0) != 0); QB_f0 = (QB_f1 >> (((113 + 16383 - 1 - QB_e)) - 64)); QB_f1 = 0; })); (void) (((((32))) <= 64) ? ({ (((UIR))) = QB_f0; }) : ({ (((UIR))) = QB_f1; (((UIR))) <<= 64; (((UIR))) += QB_f0; })); } if (((1)) && QB_s) ((UIR)) = -((UIR)); if (((1)) == 2 && QB_e >= 16383 + ((32)) - 1) { if (QB_e > 16383 + ((32)) - 1 || !QB_s || ((UIR)) != (((typeof ((UIR))) 1) << (((32)) - 1))) { _FP_TO_INT_inexact = 0; _fex |= ((1 << 4) | 0); } } if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } } while (0); IR = UIR; break;
  case 0x081: do { if (SB_e < 127) { ((UXR)) = 0; if (SB_e == 0) { if (!(SB_f == 0)) { if (!0) _fex |= ((1 << 0)); _fex |= (0); } } else _fex |= ((1 << 0)); } else if (((1)) == 2 && (SB_e >= ((255 < 127 + 24 + ((64)) - 1) ? 255 : 127 + 24 + ((64)) - 1))) { ((UXR)) = 0; _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (SB_e == 255) { if (!(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else if (((1)) != 2 && (SB_e >= (255 < 127 + ((64)) ? 255 : (127 + ((64)) - (((1)) > 0 || SB_s))) || (!((1)) && SB_s))) { if ((1)) { ((UXR)) = 1; ((UXR)) <<= ((64)) - 1; ((UXR)) -= 1 - SB_s; } else { ((UXR)) = 0; if (!SB_s) ((UXR)) = ~((UXR)); } if (127 + ((64)) - 1 < 255 && ((1)) && SB_s && SB_e == 127 + ((64)) - 1) { int _FP_TO_INT_inexact = 0; (void) ((24 > ((64))) ? ({ do { _FP_TO_INT_inexact = (__builtin_constant_p ((24 - ((64)))) && ((24 - ((64)))) == 1 ? SB_f & 1 : (SB_f << (64 - ((24 - ((64)))))) != 0); SB_f = SB_f >> ((24 - ((64)))); } while (0); 0; }) : 0); if (!(SB_f == 0)) _fex |= ((1 << 4) | 0); else if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } else _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (SB_e == 255) { if (!(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else { int _FP_TO_INT_inexact = 0; (SB_f) |= ((unsigned long) 1 << (24 -1)); if (SB_e >= 127 + 24 - 1) { ((((UXR))) = SB_f); ((UXR)) <<= SB_e - 127 - 24 + 1; } else { do { _FP_TO_INT_inexact = (__builtin_constant_p (((24 + 127 - 1 - SB_e))) && (((24 + 127 - 1 - SB_e))) == 1 ? SB_f & 1 : (SB_f << (64 - (((24 + 127 - 1 - SB_e))))) != 0); SB_f = SB_f >> (((24 + 127 - 1 - SB_e))); } while (0); ((((UXR))) = SB_f); } if (((1)) && SB_s) ((UXR)) = -((UXR)); if (((1)) == 2 && SB_e >= 127 + ((64)) - 1) { if (SB_e > 127 + ((64)) - 1 || !SB_s || ((UXR)) != (((typeof ((UXR))) 1) << (((64)) - 1))) { _FP_TO_INT_inexact = 0; _fex |= ((1 << 4) | 0); } } if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } } while (0); XR = UXR; break;
  case 0x082: do { if (DB_e < 1023) { ((UXR)) = 0; if (DB_e == 0) { if (!(DB_f == 0)) { if (!0) _fex |= ((1 << 0)); _fex |= (0); } } else _fex |= ((1 << 0)); } else if (((1)) == 2 && (DB_e >= ((2047 < 1023 + 53 + ((64)) - 1) ? 2047 : 1023 + 53 + ((64)) - 1))) { ((UXR)) = 0; _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (DB_e == 2047) { if (!(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else if (((1)) != 2 && (DB_e >= (2047 < 1023 + ((64)) ? 2047 : (1023 + ((64)) - (((1)) > 0 || DB_s))) || (!((1)) && DB_s))) { if ((1)) { ((UXR)) = 1; ((UXR)) <<= ((64)) - 1; ((UXR)) -= 1 - DB_s; } else { ((UXR)) = 0; if (!DB_s) ((UXR)) = ~((UXR)); } if (1023 + ((64)) - 1 < 2047 && ((1)) && DB_s && DB_e == 1023 + ((64)) - 1) { int _FP_TO_INT_inexact = 0; (void) ((53 > ((64))) ? ({ do { _FP_TO_INT_inexact = (__builtin_constant_p ((53 - ((64)))) && ((53 - ((64)))) == 1 ? DB_f & 1 : (DB_f << (64 - ((53 - ((64)))))) != 0); DB_f = DB_f >> ((53 - ((64)))); } while (0); 0; }) : 0); if (!(DB_f == 0)) _fex |= ((1 << 4) | 0); else if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } else _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (DB_e == 2047) { if (!(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else { int _FP_TO_INT_inexact = 0; (DB_f) |= ((unsigned long) 1 << (53 -1) % 64); if (DB_e >= 1023 + 53 - 1) { ((((UXR))) = DB_f); ((UXR)) <<= DB_e - 1023 - 53 + 1; } else { do { _FP_TO_INT_inexact = (__builtin_constant_p (((53 + 1023 - 1 - DB_e))) && (((53 + 1023 - 1 - DB_e))) == 1 ? DB_f & 1 : (DB_f << (64 - (((53 + 1023 - 1 - DB_e))))) != 0); DB_f = DB_f >> (((53 + 1023 - 1 - DB_e))); } while (0); ((((UXR))) = DB_f); } if (((1)) && DB_s) ((UXR)) = -((UXR)); if (((1)) == 2 && DB_e >= 1023 + ((64)) - 1) { if (DB_e > 1023 + ((64)) - 1 || !DB_s || ((UXR)) != (((typeof ((UXR))) 1) << (((64)) - 1))) { _FP_TO_INT_inexact = 0; _fex |= ((1 << 4) | 0); } } if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } } while (0); XR = UXR; break;
  case 0x083: do { if (QB_e < 16383) { ((UXR)) = 0; if (QB_e == 0) { if (!((QB_f1 | QB_f0) == 0)) { if (!0) _fex |= ((1 << 0)); _fex |= (0); } } else _fex |= ((1 << 0)); } else if (((1)) == 2 && (QB_e >= ((32767 < 16383 + 113 + ((64)) - 1) ? 32767 : 16383 + 113 + ((64)) - 1))) { ((UXR)) = 0; _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (QB_e == 32767) { if (!((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else if (((1)) != 2 && (QB_e >= (32767 < 16383 + ((64)) ? 32767 : (16383 + ((64)) - (((1)) > 0 || QB_s))) || (!((1)) && QB_s))) { if ((1)) { ((UXR)) = 1; ((UXR)) <<= ((64)) - 1; ((UXR)) -= 1 - QB_s; } else { ((UXR)) = 0; if (!QB_s) ((UXR)) = ~((UXR)); } if (16383 + ((64)) - 1 < 32767 && ((1)) && QB_s && QB_e == 16383 + ((64)) - 1) { int _FP_TO_INT_inexact = 0; (void) ((113 > ((64))) ? ({ (void) (((113 - ((64))) < 64) ? ({ _FP_TO_INT_inexact = (__builtin_constant_p (113 - ((64))) && (113 - ((64))) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (113 - ((64))))) != 0); QB_f0 = (QB_f1 << (64 - (113 - ((64)))) | QB_f0 >> (113 - ((64)))); QB_f1 >>= (113 - ((64))); }) : ({ _FP_TO_INT_inexact = ((((113 - ((64))) == 64 ? 0 : (QB_f1 << (2*64 - (113 - ((64)))))) | QB_f0) != 0); QB_f0 = (QB_f1 >> ((113 - ((64))) - 64)); QB_f1 = 0; })); 0; }) : 0); if (!((QB_f1 | QB_f0) == 0)) _fex |= ((1 << 4) | 0); else if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } else _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (QB_e == 32767) { if (!((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else { int _FP_TO_INT_inexact = 0; (QB_f1) |= ((unsigned long) 1 << (113 -1) % 64); if (QB_e >= 16383 + 113 - 1) { (void) (((((64))) <= 64) ? ({ (((UXR))) = QB_f0; }) : ({ (((UXR))) = QB_f1; (((UXR))) <<= 64; (((UXR))) += QB_f0; })); ((UXR)) <<= QB_e - 16383 - 113 + 1; } else { (void) ((((113 + 16383 - 1 - QB_e)) < 64) ? ({ _FP_TO_INT_inexact = (__builtin_constant_p ((113 + 16383 - 1 - QB_e)) && ((113 + 16383 - 1 - QB_e)) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - ((113 + 16383 - 1 - QB_e)))) != 0); QB_f0 = (QB_f1 << (64 - ((113 + 16383 - 1 - QB_e))) | QB_f0 >> ((113 + 16383 - 1 - QB_e))); QB_f1 >>= ((113 + 16383 - 1 - QB_e)); }) : ({ _FP_TO_INT_inexact = (((((113 + 16383 - 1 - QB_e)) == 64 ? 0 : (QB_f1 << (2*64 - ((113 + 16383 - 1 - QB_e))))) | QB_f0) != 0); QB_f0 = (QB_f1 >> (((113 + 16383 - 1 - QB_e)) - 64)); QB_f1 = 0; })); (void) (((((64))) <= 64) ? ({ (((UXR))) = QB_f0; }) : ({ (((UXR))) = QB_f1; (((UXR))) <<= 64; (((UXR))) += QB_f0; })); } if (((1)) && QB_s) ((UXR)) = -((UXR)); if (((1)) == 2 && QB_e >= 16383 + ((64)) - 1) { if (QB_e > 16383 + ((64)) - 1 || !QB_s || ((UXR)) != (((typeof ((UXR))) 1) << (((64)) - 1))) { _FP_TO_INT_inexact = 0; _fex |= ((1 << 4) | 0); } } if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } } while (0); XR = UXR; break;

  case 0x0cc: IR = rs2->s; do { __label__ pack_semiraw; if ((IR)) { unsigned int _FP_FROM_INT_ur; if ((QR_s = (((IR)) < 0))) ((IR)) = -(unsigned int) ((IR)); _FP_FROM_INT_ur = (unsigned int) ((IR)); (void) ((((32)) <= 64) ? ({ int _FP_FROM_INT_lz; do { if (sizeof (unsigned long) == sizeof (unsigned int)) (_FP_FROM_INT_lz) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) (_FP_FROM_INT_lz) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) (_FP_FROM_INT_lz) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); QR_e = (16383 + 64 - 1 - _FP_FROM_INT_lz); }) : ((((32)) <= 2 * 64) ? ({ int _FP_FROM_INT_lz; do { if ((unsigned long) (_FP_FROM_INT_ur >> 64)) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) (_FP_FROM_INT_ur >> 64)); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); (_FP_FROM_INT_lz) += 64; } } while (0); QR_e = (16383 + 2 * 64 - 1 - _FP_FROM_INT_lz); }) : (return 0, 0))); if (((32)) - 1 + 16383 >= 32767 && QR_e >= 32767) { do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto pack_semiraw; } if (((32)) <= 113 || QR_e < 16383 + 113) { do { QR_f0 = (_FP_FROM_INT_ur); QR_f1 = ((((32))) <= 64 ? 0 : (_FP_FROM_INT_ur) >> 64); } while (0); if (16383 + 113 - 1 - QR_e > 0) (void) ((((16383 + 113 - 1 - QR_e)) < 64) ? ({ if (__builtin_constant_p ((16383 + 113 - 1 - QR_e)) && ((16383 + 113 - 1 - QR_e)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((16383 + 113 - 1 - QR_e)) | QR_f0 >> (64 - ((16383 + 113 - 1 - QR_e))); QR_f0 <<= ((16383 + 113 - 1 - QR_e)); } 0; }) : ({ QR_f1 = QR_f0 << (((16383 + 113 - 1 - QR_e)) - 64); QR_f0 = 0; })); } else { if (16383 + (3 + 113) - 1 < QR_e) _FP_FROM_INT_ur = ((_FP_FROM_INT_ur >> (QR_e - 16383 - (3 + 113) + 1)) | ((_FP_FROM_INT_ur << (((32)) - (QR_e - 16383 - (3 + 113) + 1))) != 0)); do { QR_f0 = (_FP_FROM_INT_ur); QR_f1 = ((((32))) <= 64 ? 0 : (_FP_FROM_INT_ur) >> 64); } while (0); if ((16383 + (3 + 113) - 1 - QR_e) > 0) (void) ((((16383 + (3 + 113) - 1 - QR_e)) < 64) ? ({ if (__builtin_constant_p ((16383 + (3 + 113) - 1 - QR_e)) && ((16383 + (3 + 113) - 1 - QR_e)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((16383 + (3 + 113) - 1 - QR_e)) | QR_f0 >> (64 - ((16383 + (3 + 113) - 1 - QR_e))); QR_f0 <<= ((16383 + (3 + 113) - 1 - QR_e)); } 0; }) : ({ QR_f1 = QR_f0 << (((16383 + (3 + 113) - 1 - QR_e)) - 64); QR_f0 = 0; })); (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); pack_semiraw: do { int _FP_PACK_SEMIRAW_is_tiny = QR_e == 0 && !((QR_f1 | QR_f0) == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f0 = 0, _FP_PACK_SEMIRAW_T_f1 = 0; (_FP_PACK_SEMIRAW_T_f0 = QR_f0, _FP_PACK_SEMIRAW_T_f1 = QR_f1); _FP_PACK_SEMIRAW_T_s = QR_s; _FP_PACK_SEMIRAW_T_e = QR_e; (void) (((1) < 64) ? ({ if (__builtin_constant_p (1) && (1) == 1) { _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f1 + _FP_PACK_SEMIRAW_T_f1 + (((signed long) (_FP_PACK_SEMIRAW_T_f0)) < 0); _FP_PACK_SEMIRAW_T_f0 += _FP_PACK_SEMIRAW_T_f0; } else { _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f1 << (1) | _FP_PACK_SEMIRAW_T_f0 >> (64 - (1)); _FP_PACK_SEMIRAW_T_f0 <<= (1); } 0; }) : ({ _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f0 << ((1) - 64); _FP_PACK_SEMIRAW_T_f0 = 0; })); do { if ((_FP_PACK_SEMIRAW_T_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (((_FP_PACK_SEMIRAW_T_f1) & ((unsigned long) 1 << ((3 + 113) % 64)))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((QR_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((QR_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((QR_f1) & (((unsigned long) 1 << ((3 + 113) % 64)) >> 1)) { (QR_f1) &= ~(((unsigned long) 1 << ((3 + 113) % 64)) >> 1); QR_e++; if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (void) (((3) < 64) ? ({ QR_f0 = QR_f0 >> (3) | QR_f1 << (64 - (3)); QR_f1 >>= (3); }) : ({ QR_f0 = QR_f1 >> ((3) - 64); QR_f1 = 0; })); if (QR_e == 32767 && !((QR_f1 | QR_f0) == 0)) { if (!1) { (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); QR_s = 0; } else do { if (0) { (QR_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QR_f1 | QR_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QR_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } while (0); } } else { QR_s = 0; QR_e = 0; (QR_f0 = 0, QR_f1 = 0); } } while (0); break;
  case 0x08c: XR = rs2->d; do { __label__ pack_semiraw; if ((XR)) { unsigned long _FP_FROM_INT_ur; if ((QR_s = (((XR)) < 0))) ((XR)) = -(unsigned long) ((XR)); _FP_FROM_INT_ur = (unsigned long) ((XR)); (void) ((((64)) <= 64) ? ({ int _FP_FROM_INT_lz; do { if (sizeof (unsigned long) == sizeof (unsigned int)) (_FP_FROM_INT_lz) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) (_FP_FROM_INT_lz) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) (_FP_FROM_INT_lz) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); QR_e = (16383 + 64 - 1 - _FP_FROM_INT_lz); }) : ((((64)) <= 2 * 64) ? ({ int _FP_FROM_INT_lz; do { if ((unsigned long) (_FP_FROM_INT_ur >> 64)) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) (_FP_FROM_INT_ur >> 64)); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); (_FP_FROM_INT_lz) += 64; } } while (0); QR_e = (16383 + 2 * 64 - 1 - _FP_FROM_INT_lz); }) : (return 0, 0))); if (((64)) - 1 + 16383 >= 32767 && QR_e >= 32767) { do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto pack_semiraw; } if (((64)) <= 113 || QR_e < 16383 + 113) { do { QR_f0 = (_FP_FROM_INT_ur); QR_f1 = ((((64))) <= 64 ? 0 : (_FP_FROM_INT_ur) >> 64); } while (0); if (16383 + 113 - 1 - QR_e > 0) (void) ((((16383 + 113 - 1 - QR_e)) < 64) ? ({ if (__builtin_constant_p ((16383 + 113 - 1 - QR_e)) && ((16383 + 113 - 1 - QR_e)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((16383 + 113 - 1 - QR_e)) | QR_f0 >> (64 - ((16383 + 113 - 1 - QR_e))); QR_f0 <<= ((16383 + 113 - 1 - QR_e)); } 0; }) : ({ QR_f1 = QR_f0 << (((16383 + 113 - 1 - QR_e)) - 64); QR_f0 = 0; })); } else { if (16383 + (3 + 113) - 1 < QR_e) _FP_FROM_INT_ur = ((_FP_FROM_INT_ur >> (QR_e - 16383 - (3 + 113) + 1)) | ((_FP_FROM_INT_ur << (((64)) - (QR_e - 16383 - (3 + 113) + 1))) != 0)); do { QR_f0 = (_FP_FROM_INT_ur); QR_f1 = ((((64))) <= 64 ? 0 : (_FP_FROM_INT_ur) >> 64); } while (0); if ((16383 + (3 + 113) - 1 - QR_e) > 0) (void) ((((16383 + (3 + 113) - 1 - QR_e)) < 64) ? ({ if (__builtin_constant_p ((16383 + (3 + 113) - 1 - QR_e)) && ((16383 + (3 + 113) - 1 - QR_e)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((16383 + (3 + 113) - 1 - QR_e)) | QR_f0 >> (64 - ((16383 + (3 + 113) - 1 - QR_e))); QR_f0 <<= ((16383 + (3 + 113) - 1 - QR_e)); } 0; }) : ({ QR_f1 = QR_f0 << (((16383 + (3 + 113) - 1 - QR_e)) - 64); QR_f0 = 0; })); (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); pack_semiraw: do { int _FP_PACK_SEMIRAW_is_tiny = QR_e == 0 && !((QR_f1 | QR_f0) == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f0 = 0, _FP_PACK_SEMIRAW_T_f1 = 0; (_FP_PACK_SEMIRAW_T_f0 = QR_f0, _FP_PACK_SEMIRAW_T_f1 = QR_f1); _FP_PACK_SEMIRAW_T_s = QR_s; _FP_PACK_SEMIRAW_T_e = QR_e; (void) (((1) < 64) ? ({ if (__builtin_constant_p (1) && (1) == 1) { _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f1 + _FP_PACK_SEMIRAW_T_f1 + (((signed long) (_FP_PACK_SEMIRAW_T_f0)) < 0); _FP_PACK_SEMIRAW_T_f0 += _FP_PACK_SEMIRAW_T_f0; } else { _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f1 << (1) | _FP_PACK_SEMIRAW_T_f0 >> (64 - (1)); _FP_PACK_SEMIRAW_T_f0 <<= (1); } 0; }) : ({ _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f0 << ((1) - 64); _FP_PACK_SEMIRAW_T_f0 = 0; })); do { if ((_FP_PACK_SEMIRAW_T_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (((_FP_PACK_SEMIRAW_T_f1) & ((unsigned long) 1 << ((3 + 113) % 64)))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((QR_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((QR_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((QR_f1) & (((unsigned long) 1 << ((3 + 113) % 64)) >> 1)) { (QR_f1) &= ~(((unsigned long) 1 << ((3 + 113) % 64)) >> 1); QR_e++; if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (void) (((3) < 64) ? ({ QR_f0 = QR_f0 >> (3) | QR_f1 << (64 - (3)); QR_f1 >>= (3); }) : ({ QR_f0 = QR_f1 >> ((3) - 64); QR_f1 = 0; })); if (QR_e == 32767 && !((QR_f1 | QR_f0) == 0)) { if (!1) { (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); QR_s = 0; } else do { if (0) { (QR_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QR_f1 | QR_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QR_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } while (0); } } else { QR_s = 0; QR_e = 0; (QR_f0 = 0, QR_f1 = 0); } } while (0); break;

  case 0x084: XR = rs2->d; do { __label__ pack_semiraw; if ((XR)) { unsigned long _FP_FROM_INT_ur; if ((SR_s = (((XR)) < 0))) ((XR)) = -(unsigned long) ((XR)); _FP_FROM_INT_ur = (unsigned long) ((XR)); (void) ((((64)) <= 64) ? ({ int _FP_FROM_INT_lz; do { if (sizeof (unsigned long) == sizeof (unsigned int)) (_FP_FROM_INT_lz) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) (_FP_FROM_INT_lz) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) (_FP_FROM_INT_lz) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); SR_e = (127 + 64 - 1 - _FP_FROM_INT_lz); }) : ((((64)) <= 2 * 64) ? ({ int _FP_FROM_INT_lz; do { if ((unsigned long) (_FP_FROM_INT_ur >> 64)) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) (_FP_FROM_INT_ur >> 64)); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); (_FP_FROM_INT_lz) += 64; } } while (0); SR_e = (127 + 2 * 64 - 1 - _FP_FROM_INT_lz); }) : (return 0, 0))); if (((64)) - 1 + 127 >= 255 && SR_e >= 255) { do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto pack_semiraw; } if (((64)) <= 24 || SR_e < 127 + 24) { (SR_f = (_FP_FROM_INT_ur)); if (127 + 24 - 1 - SR_e > 0) do { if (__builtin_constant_p ((127 + 24 - 1 - SR_e)) && ((127 + 24 - 1 - SR_e)) == 1) SR_f += SR_f; else SR_f <<= ((127 + 24 - 1 - SR_e)); } while (0); } else { if (127 + (3 + 24) - 1 < SR_e) _FP_FROM_INT_ur = ((_FP_FROM_INT_ur >> (SR_e - 127 - (3 + 24) + 1)) | ((_FP_FROM_INT_ur << (((64)) - (SR_e - 127 - (3 + 24) + 1))) != 0)); (SR_f = (_FP_FROM_INT_ur)); if ((127 + (3 + 24) - 1 - SR_e) > 0) do { if (__builtin_constant_p ((127 + (3 + 24) - 1 - SR_e)) && ((127 + (3 + 24) - 1 - SR_e)) == 1) SR_f += SR_f; else SR_f <<= ((127 + (3 + 24) - 1 - SR_e)); } while (0); (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); pack_semiraw: do { int _FP_PACK_SEMIRAW_is_tiny = SR_e == 0 && !(SR_f == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f = 0; (_FP_PACK_SEMIRAW_T_f = SR_f); _FP_PACK_SEMIRAW_T_s = SR_s; _FP_PACK_SEMIRAW_T_e = SR_e; do { if (__builtin_constant_p (1) && (1) == 1) _FP_PACK_SEMIRAW_T_f += _FP_PACK_SEMIRAW_T_f; else _FP_PACK_SEMIRAW_T_f <<= (1); } while (0); do { if ((_FP_PACK_SEMIRAW_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_SEMIRAW_T_f & ((unsigned long) 1 << ((3 + 24))))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((SR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((SR_f) & 15) != ((unsigned long) 1 << 2)) (SR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((SR_f) & (((unsigned long) 1 << ((3 + 24))) >> 1)) { (SR_f) &= ~(((unsigned long) 1 << ((3 + 24))) >> 1); SR_e++; if (SR_e == 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (SR_f >>= 3); if (SR_e == 255 && !(SR_f == 0)) { if (!1) { (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); SR_s = 0; } else do { if (0) { (SR_f) &= ((unsigned long) 1 << (24 -2)) - 1; if ((SR_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); } } else (SR_f) |= ((unsigned long) 1 << (24 -2)); } while (0); } } while (0); } } else { SR_s = 0; SR_e = 0; (SR_f = 0); } } while (0); break;
  case 0x088: XR = rs2->d; do { __label__ pack_semiraw; if ((XR)) { unsigned long _FP_FROM_INT_ur; if ((DR_s = (((XR)) < 0))) ((XR)) = -(unsigned long) ((XR)); _FP_FROM_INT_ur = (unsigned long) ((XR)); (void) ((((64)) <= 64) ? ({ int _FP_FROM_INT_lz; do { if (sizeof (unsigned long) == sizeof (unsigned int)) (_FP_FROM_INT_lz) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) (_FP_FROM_INT_lz) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) (_FP_FROM_INT_lz) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); DR_e = (1023 + 64 - 1 - _FP_FROM_INT_lz); }) : ((((64)) <= 2 * 64) ? ({ int _FP_FROM_INT_lz; do { if ((unsigned long) (_FP_FROM_INT_ur >> 64)) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) (_FP_FROM_INT_ur >> 64)); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); (_FP_FROM_INT_lz) += 64; } } while (0); DR_e = (1023 + 2 * 64 - 1 - _FP_FROM_INT_lz); }) : (return 0, 0))); if (((64)) - 1 + 1023 >= 2047 && DR_e >= 2047) { do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto pack_semiraw; } if (((64)) <= 53 || DR_e < 1023 + 53) { (DR_f = (_FP_FROM_INT_ur)); if (1023 + 53 - 1 - DR_e > 0) do { if (__builtin_constant_p ((1023 + 53 - 1 - DR_e)) && ((1023 + 53 - 1 - DR_e)) == 1) DR_f += DR_f; else DR_f <<= ((1023 + 53 - 1 - DR_e)); } while (0); } else { if (1023 + (3 + 53) - 1 < DR_e) _FP_FROM_INT_ur = ((_FP_FROM_INT_ur >> (DR_e - 1023 - (3 + 53) + 1)) | ((_FP_FROM_INT_ur << (((64)) - (DR_e - 1023 - (3 + 53) + 1))) != 0)); (DR_f = (_FP_FROM_INT_ur)); if ((1023 + (3 + 53) - 1 - DR_e) > 0) do { if (__builtin_constant_p ((1023 + (3 + 53) - 1 - DR_e)) && ((1023 + (3 + 53) - 1 - DR_e)) == 1) DR_f += DR_f; else DR_f <<= ((1023 + (3 + 53) - 1 - DR_e)); } while (0); (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); pack_semiraw: do { int _FP_PACK_SEMIRAW_is_tiny = DR_e == 0 && !(DR_f == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f = 0; (_FP_PACK_SEMIRAW_T_f = DR_f); _FP_PACK_SEMIRAW_T_s = DR_s; _FP_PACK_SEMIRAW_T_e = DR_e; do { if (__builtin_constant_p (1) && (1) == 1) _FP_PACK_SEMIRAW_T_f += _FP_PACK_SEMIRAW_T_f; else _FP_PACK_SEMIRAW_T_f <<= (1); } while (0); do { if ((_FP_PACK_SEMIRAW_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_SEMIRAW_T_f & ((unsigned long) 1 << (3 + 53) % 64))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((DR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((DR_f) & 15) != ((unsigned long) 1 << 2)) (DR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((DR_f) & (((unsigned long) 1 << (3 + 53) % 64) >> 1)) { (DR_f) &= ~(((unsigned long) 1 << (3 + 53) % 64) >> 1); DR_e++; if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (DR_f >>= 3); if (DR_e == 2047 && !(DR_f == 0)) { if (!1) { (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); DR_s = 0; } else do { if (0) { (DR_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DR_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DR_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); } } while (0); } } else { DR_s = 0; DR_e = 0; (DR_f = 0); } } while (0); break;



  case 0x0c8: IR = rs2->s; do { __label__ pack_semiraw; if ((IR)) { unsigned int _FP_FROM_INT_ur; if ((DR_s = (((IR)) < 0))) ((IR)) = -(unsigned int) ((IR)); _FP_FROM_INT_ur = (unsigned int) ((IR)); (void) ((((32)) <= 64) ? ({ int _FP_FROM_INT_lz; do { if (sizeof (unsigned long) == sizeof (unsigned int)) (_FP_FROM_INT_lz) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) (_FP_FROM_INT_lz) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) (_FP_FROM_INT_lz) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); DR_e = (1023 + 64 - 1 - _FP_FROM_INT_lz); }) : ((((32)) <= 2 * 64) ? ({ int _FP_FROM_INT_lz; do { if ((unsigned long) (_FP_FROM_INT_ur >> 64)) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) (_FP_FROM_INT_ur >> 64)); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); (_FP_FROM_INT_lz) += 64; } } while (0); DR_e = (1023 + 2 * 64 - 1 - _FP_FROM_INT_lz); }) : (return 0, 0))); if (((32)) - 1 + 1023 >= 2047 && DR_e >= 2047) { do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto pack_semiraw; } if (((32)) <= 53 || DR_e < 1023 + 53) { (DR_f = (_FP_FROM_INT_ur)); if (1023 + 53 - 1 - DR_e > 0) do { if (__builtin_constant_p ((1023 + 53 - 1 - DR_e)) && ((1023 + 53 - 1 - DR_e)) == 1) DR_f += DR_f; else DR_f <<= ((1023 + 53 - 1 - DR_e)); } while (0); } else { if (1023 + (3 + 53) - 1 < DR_e) _FP_FROM_INT_ur = ((_FP_FROM_INT_ur >> (DR_e - 1023 - (3 + 53) + 1)) | ((_FP_FROM_INT_ur << (((32)) - (DR_e - 1023 - (3 + 53) + 1))) != 0)); (DR_f = (_FP_FROM_INT_ur)); if ((1023 + (3 + 53) - 1 - DR_e) > 0) do { if (__builtin_constant_p ((1023 + (3 + 53) - 1 - DR_e)) && ((1023 + (3 + 53) - 1 - DR_e)) == 1) DR_f += DR_f; else DR_f <<= ((1023 + (3 + 53) - 1 - DR_e)); } while (0); (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); pack_semiraw: do { int _FP_PACK_SEMIRAW_is_tiny = DR_e == 0 && !(DR_f == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f = 0; (_FP_PACK_SEMIRAW_T_f = DR_f); _FP_PACK_SEMIRAW_T_s = DR_s; _FP_PACK_SEMIRAW_T_e = DR_e; do { if (__builtin_constant_p (1) && (1) == 1) _FP_PACK_SEMIRAW_T_f += _FP_PACK_SEMIRAW_T_f; else _FP_PACK_SEMIRAW_T_f <<= (1); } while (0); do { if ((_FP_PACK_SEMIRAW_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_SEMIRAW_T_f & ((unsigned long) 1 << (3 + 53) % 64))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((DR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((DR_f) & 15) != ((unsigned long) 1 << 2)) (DR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((DR_f) & (((unsigned long) 1 << (3 + 53) % 64) >> 1)) { (DR_f) &= ~(((unsigned long) 1 << (3 + 53) % 64) >> 1); DR_e++; if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (DR_f >>= 3); if (DR_e == 2047 && !(DR_f == 0)) { if (!1) { (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); DR_s = 0; } else do { if (0) { (DR_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DR_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DR_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); } } while (0); } } else { DR_s = 0; DR_e = 0; (DR_f = 0); } } while (0); break;

  case 0x0c9: do { if (53 < 24 || (2047 - 1023 < 255 - 127) || (1023 < 127 + 24 - 1 && 1023 != 127)) return 0; DR_s = SB_s; (DR_f = SB_f); if ((((SB_e + 1) & 255) > 1)) { DR_e = SB_e + 1023 - 127; do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DR_f += DR_f; else DR_f <<= ((53 - 24)); } while (0); } else { if (SB_e == 0) { do { if (0 && SB_e == 0 && !(SB_f == 0)) { (SB_f = 0); _fex |= (0); } } while (0); if ((SB_f == 0)) DR_e = 0; else if (1023 < 127 + 24 - 1) { _fex |= (0); do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DR_f += DR_f; else DR_f <<= ((53 - 24)); } while (0); DR_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (SB_f); else return 0; } while (0); do { if (__builtin_constant_p (FP_EXTEND_lz + 53 - 64) && (FP_EXTEND_lz + 53 - 64) == 1) DR_f += DR_f; else DR_f <<= (FP_EXTEND_lz + 53 - 64); } while (0); DR_e = (1023 - 127 + 1 + (64 - 24) - FP_EXTEND_lz); } } else { DR_e = 2047; if (!(SB_f == 0)) { if (1 && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _fex |= ((1 << 4) | 0); do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DR_f += DR_f; else DR_f <<= ((53 - 24)); } while (0); if (1) do { if (0) { (DR_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DR_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DR_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); } } } } while (0); break;
  case 0x0cd: do { if (113 < 24 || (32767 - 16383 < 255 - 127) || (16383 < 127 + 24 - 1 && 16383 != 127)) return 0; QR_s = SB_s; ((QR_f0 = SB_f), (QR_f1 = 0)); if ((((SB_e + 1) & 255) > 1)) { QR_e = SB_e + 16383 - 127; (void) ((((113 - 24)) < 64) ? ({ if (__builtin_constant_p ((113 - 24)) && ((113 - 24)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((113 - 24)) | QR_f0 >> (64 - ((113 - 24))); QR_f0 <<= ((113 - 24)); } 0; }) : ({ QR_f1 = QR_f0 << (((113 - 24)) - 64); QR_f0 = 0; })); } else { if (SB_e == 0) { do { if (0 && SB_e == 0 && !(SB_f == 0)) { (SB_f = 0); _fex |= (0); } } while (0); if ((SB_f == 0)) QR_e = 0; else if (16383 < 127 + 24 - 1) { _fex |= (0); (void) ((((113 - 24)) < 64) ? ({ if (__builtin_constant_p ((113 - 24)) && ((113 - 24)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((113 - 24)) | QR_f0 >> (64 - ((113 - 24))); QR_f0 <<= ((113 - 24)); } 0; }) : ({ QR_f1 = QR_f0 << (((113 - 24)) - 64); QR_f0 = 0; })); QR_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (SB_f); else return 0; } while (0); (void) (((FP_EXTEND_lz + 113 - 64) < 64) ? ({ if (__builtin_constant_p (FP_EXTEND_lz + 113 - 64) && (FP_EXTEND_lz + 113 - 64) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (FP_EXTEND_lz + 113 - 64) | QR_f0 >> (64 - (FP_EXTEND_lz + 113 - 64)); QR_f0 <<= (FP_EXTEND_lz + 113 - 64); } 0; }) : ({ QR_f1 = QR_f0 << ((FP_EXTEND_lz + 113 - 64) - 64); QR_f0 = 0; })); QR_e = (16383 - 127 + 1 + (64 - 24) - FP_EXTEND_lz); } } else { QR_e = 32767; if (!(SB_f == 0)) { if (1 && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _fex |= ((1 << 4) | 0); (void) ((((113 - 24)) < 64) ? ({ if (__builtin_constant_p ((113 - 24)) && ((113 - 24)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((113 - 24)) | QR_f0 >> (64 - ((113 - 24))); QR_f0 <<= ((113 - 24)); } 0; }) : ({ QR_f1 = QR_f0 << (((113 - 24)) - 64); QR_f0 = 0; })); if (1) do { if (0) { (QR_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QR_f1 | QR_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QR_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } } } while (0); break;
  case 0x0ce: do { if (113 < 53 || (32767 - 16383 < 2047 - 1023) || (16383 < 1023 + 53 - 1 && 16383 != 1023)) return 0; QR_s = DB_s; ((QR_f0 = DB_f), (QR_f1 = 0)); if ((((DB_e + 1) & 2047) > 1)) { QR_e = DB_e + 16383 - 1023; (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((113 - 53)) | QR_f0 >> (64 - ((113 - 53))); QR_f0 <<= ((113 - 53)); } 0; }) : ({ QR_f1 = QR_f0 << (((113 - 53)) - 64); QR_f0 = 0; })); } else { if (DB_e == 0) { do { if (0 && DB_e == 0 && !(DB_f == 0)) { (DB_f = 0); _fex |= (0); } } while (0); if ((DB_f == 0)) QR_e = 0; else if (16383 < 1023 + 53 - 1) { _fex |= (0); (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((113 - 53)) | QR_f0 >> (64 - ((113 - 53))); QR_f0 <<= ((113 - 53)); } 0; }) : ({ QR_f1 = QR_f0 << (((113 - 53)) - 64); QR_f0 = 0; })); QR_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (DB_f); else return 0; } while (0); (void) (((FP_EXTEND_lz + 113 - 64) < 64) ? ({ if (__builtin_constant_p (FP_EXTEND_lz + 113 - 64) && (FP_EXTEND_lz + 113 - 64) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (FP_EXTEND_lz + 113 - 64) | QR_f0 >> (64 - (FP_EXTEND_lz + 113 - 64)); QR_f0 <<= (FP_EXTEND_lz + 113 - 64); } 0; }) : ({ QR_f1 = QR_f0 << ((FP_EXTEND_lz + 113 - 64) - 64); QR_f0 = 0; })); QR_e = (16383 - 1023 + 1 + (64 - 53) - FP_EXTEND_lz); } } else { QR_e = 32767; if (!(DB_f == 0)) { if (1 && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((113 - 53)) | QR_f0 >> (64 - ((113 - 53))); QR_f0 <<= ((113 - 53)); } 0; }) : ({ QR_f1 = QR_f0 << (((113 - 53)) - 64); QR_f0 = 0; })); if (1) do { if (0) { (QR_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QR_f1 | QR_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QR_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } } } while (0); break;
  case 0x0c6: do { if (53 < 24 || (1023 < 127 + 24 - 1 && 1023 != 127)) return 0; SR_s = DB_s; if ((((DB_e + 1) & 2047) > 1)) { SR_e = DB_e + 127 - 1023; if (SR_e >= 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); else { if (SR_e <= 0) { if (SR_e < 1 - 24) { (DB_f = 0); (DB_f) |= 1; } else { (DB_f) |= ((unsigned long) 1 << (53 -1+3) % 64); (DB_f = (DB_f >> ((((3 + 53) - (3 + 24) + 1 - SR_e))) | (__builtin_constant_p ((((3 + 53) - (3 + 24) + 1 - SR_e))) && ((((3 + 53) - (3 + 24) + 1 - SR_e))) == 1 ? DB_f & 1 : (DB_f << (64 - ((((3 + 53) - (3 + 24) + 1 - SR_e))))) != 0))); } SR_e = 0; } else (DB_f = (DB_f >> ((((3 + 53) - (3 + 24)))) | (__builtin_constant_p ((((3 + 53) - (3 + 24)))) && ((((3 + 53) - (3 + 24)))) == 1 ? DB_f & 1 : (DB_f << (64 - ((((3 + 53) - (3 + 24)))))) != 0))); (SR_f = DB_f); } } else { if (DB_e == 0) { do { if (0 && DB_e == 0 && !(DB_f == 0)) { (DB_f = 0); _fex |= (0); } } while (0); SR_e = 0; if ((DB_f == 0)) (SR_f = 0); else { _fex |= (0); if (1023 < 127 + 24 - 1) { (DB_f = (DB_f >> ((((3 + 53) - (3 + 24)))) | (__builtin_constant_p ((((3 + 53) - (3 + 24)))) && ((((3 + 53) - (3 + 24)))) == 1 ? DB_f & 1 : (DB_f << (64 - ((((3 + 53) - (3 + 24)))))) != 0))); (SR_f = DB_f); } else { (SR_f = 0); (SR_f) |= 1; } } } else { SR_e = 255; if ((DB_f == 0)) (SR_f = 0); else { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DB_f >>= ((3 + 53) - (3 + 24))); (SR_f = DB_f); (SR_f) &= ~(unsigned long) ((1 << 3) - 1); do { if (0) { (SR_f) &= ((unsigned long) 1 << (24 -2+3)) - 1; if ((SR_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); } } else (SR_f) |= ((unsigned long) 1 << (24 -2+3)); } while (0); } } } } while (0); break;
  case 0x0c7: do { if (113 < 24 || (16383 < 127 + 24 - 1 && 16383 != 127)) return 0; SR_s = QB_s; if ((((QB_e + 1) & 32767) > 1)) { SR_e = QB_e + 127 - 16383; if (SR_e >= 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); else { if (SR_e <= 0) { if (SR_e < 1 - 24) { (QB_f0 = 0, QB_f1 = 0); (QB_f0) |= 1; } else { (QB_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); (void) (((((3 + 113) - (3 + 24) + 1 - SR_e)) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (((3 + 113) - (3 + 24) + 1 - SR_e))) | QB_f0 >> (((3 + 113) - (3 + 24) + 1 - SR_e)) | (__builtin_constant_p (((3 + 113) - (3 + 24) + 1 - SR_e)) && (((3 + 113) - (3 + 24) + 1 - SR_e)) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (((3 + 113) - (3 + 24) + 1 - SR_e)))) != 0)); QB_f1 >>= (((3 + 113) - (3 + 24) + 1 - SR_e)); }) : ({ QB_f0 = (QB_f1 >> ((((3 + 113) - (3 + 24) + 1 - SR_e)) - 64) | ((((((3 + 113) - (3 + 24) + 1 - SR_e)) == 64 ? 0 : (QB_f1 << (2*64 - (((3 + 113) - (3 + 24) + 1 - SR_e))))) | QB_f0) != 0)); QB_f1 = 0; })); } SR_e = 0; } else (void) (((((3 + 113) - (3 + 24))) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (((3 + 113) - (3 + 24)))) | QB_f0 >> (((3 + 113) - (3 + 24))) | (__builtin_constant_p (((3 + 113) - (3 + 24))) && (((3 + 113) - (3 + 24))) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (((3 + 113) - (3 + 24))))) != 0)); QB_f1 >>= (((3 + 113) - (3 + 24))); }) : ({ QB_f0 = (QB_f1 >> ((((3 + 113) - (3 + 24))) - 64) | ((((((3 + 113) - (3 + 24))) == 64 ? 0 : (QB_f1 << (2*64 - (((3 + 113) - (3 + 24)))))) | QB_f0) != 0)); QB_f1 = 0; })); (SR_f = QB_f0); } } else { if (QB_e == 0) { do { if (0 && QB_e == 0 && !((QB_f1 | QB_f0) == 0)) { (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } } while (0); SR_e = 0; if (((QB_f1 | QB_f0) == 0)) (SR_f = 0); else { _fex |= (0); if (16383 < 127 + 24 - 1) { (void) (((((3 + 113) - (3 + 24))) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (((3 + 113) - (3 + 24)))) | QB_f0 >> (((3 + 113) - (3 + 24))) | (__builtin_constant_p (((3 + 113) - (3 + 24))) && (((3 + 113) - (3 + 24))) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (((3 + 113) - (3 + 24))))) != 0)); QB_f1 >>= (((3 + 113) - (3 + 24))); }) : ({ QB_f0 = (QB_f1 >> ((((3 + 113) - (3 + 24))) - 64) | ((((((3 + 113) - (3 + 24))) == 64 ? 0 : (QB_f1 << (2*64 - (((3 + 113) - (3 + 24)))))) | QB_f0) != 0)); QB_f1 = 0; })); (SR_f = QB_f0); } else { (SR_f = 0); (SR_f) |= 1; } } } else { SR_e = 255; if (((QB_f1 | QB_f0) == 0)) (SR_f = 0); else { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (void) (((((3 + 113) - (3 + 24))) < 64) ? ({ QB_f0 = QB_f0 >> (((3 + 113) - (3 + 24))) | QB_f1 << (64 - (((3 + 113) - (3 + 24)))); QB_f1 >>= (((3 + 113) - (3 + 24))); }) : ({ QB_f0 = QB_f1 >> ((((3 + 113) - (3 + 24))) - 64); QB_f1 = 0; })); (SR_f = QB_f0); (SR_f) &= ~(unsigned long) ((1 << 3) - 1); do { if (0) { (SR_f) &= ((unsigned long) 1 << (24 -2+3)) - 1; if ((SR_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); } } else (SR_f) |= ((unsigned long) 1 << (24 -2+3)); } while (0); } } } } while (0); break;
  case 0x0cb: do { if (113 < 53 || (16383 < 1023 + 53 - 1 && 16383 != 1023)) return 0; DR_s = QB_s; if ((((QB_e + 1) & 32767) > 1)) { DR_e = QB_e + 1023 - 16383; if (DR_e >= 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); else { if (DR_e <= 0) { if (DR_e < 1 - 53) { (QB_f0 = 0, QB_f1 = 0); (QB_f0) |= 1; } else { (QB_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); (void) (((((3 + 113) - (3 + 53) + 1 - DR_e)) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (((3 + 113) - (3 + 53) + 1 - DR_e))) | QB_f0 >> (((3 + 113) - (3 + 53) + 1 - DR_e)) | (__builtin_constant_p (((3 + 113) - (3 + 53) + 1 - DR_e)) && (((3 + 113) - (3 + 53) + 1 - DR_e)) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (((3 + 113) - (3 + 53) + 1 - DR_e)))) != 0)); QB_f1 >>= (((3 + 113) - (3 + 53) + 1 - DR_e)); }) : ({ QB_f0 = (QB_f1 >> ((((3 + 113) - (3 + 53) + 1 - DR_e)) - 64) | ((((((3 + 113) - (3 + 53) + 1 - DR_e)) == 64 ? 0 : (QB_f1 << (2*64 - (((3 + 113) - (3 + 53) + 1 - DR_e))))) | QB_f0) != 0)); QB_f1 = 0; })); } DR_e = 0; } else (void) (((((3 + 113) - (3 + 53))) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (((3 + 113) - (3 + 53)))) | QB_f0 >> (((3 + 113) - (3 + 53))) | (__builtin_constant_p (((3 + 113) - (3 + 53))) && (((3 + 113) - (3 + 53))) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (((3 + 113) - (3 + 53))))) != 0)); QB_f1 >>= (((3 + 113) - (3 + 53))); }) : ({ QB_f0 = (QB_f1 >> ((((3 + 113) - (3 + 53))) - 64) | ((((((3 + 113) - (3 + 53))) == 64 ? 0 : (QB_f1 << (2*64 - (((3 + 113) - (3 + 53)))))) | QB_f0) != 0)); QB_f1 = 0; })); (DR_f = QB_f0); } } else { if (QB_e == 0) { do { if (0 && QB_e == 0 && !((QB_f1 | QB_f0) == 0)) { (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } } while (0); DR_e = 0; if (((QB_f1 | QB_f0) == 0)) (DR_f = 0); else { _fex |= (0); if (16383 < 1023 + 53 - 1) { (void) (((((3 + 113) - (3 + 53))) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (((3 + 113) - (3 + 53)))) | QB_f0 >> (((3 + 113) - (3 + 53))) | (__builtin_constant_p (((3 + 113) - (3 + 53))) && (((3 + 113) - (3 + 53))) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (((3 + 113) - (3 + 53))))) != 0)); QB_f1 >>= (((3 + 113) - (3 + 53))); }) : ({ QB_f0 = (QB_f1 >> ((((3 + 113) - (3 + 53))) - 64) | ((((((3 + 113) - (3 + 53))) == 64 ? 0 : (QB_f1 << (2*64 - (((3 + 113) - (3 + 53)))))) | QB_f0) != 0)); QB_f1 = 0; })); (DR_f = QB_f0); } else { (DR_f = 0); (DR_f) |= 1; } } } else { DR_e = 2047; if (((QB_f1 | QB_f0) == 0)) (DR_f = 0); else { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (void) (((((3 + 113) - (3 + 53))) < 64) ? ({ QB_f0 = QB_f0 >> (((3 + 113) - (3 + 53))) | QB_f1 << (64 - (((3 + 113) - (3 + 53)))); QB_f1 >>= (((3 + 113) - (3 + 53))); }) : ({ QB_f0 = QB_f1 >> ((((3 + 113) - (3 + 53))) - 64); QB_f1 = 0; })); (DR_f = QB_f0); (DR_f) &= ~(unsigned long) ((1 << 3) - 1); do { if (0) { (DR_f) &= ((unsigned long) 1 << (53 -2+3) % 64) - 1; if ((DR_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); } } else (DR_f) |= ((unsigned long) 1 << (53 -2+3) % 64); } while (0); } } } } while (0); break;

  case 0x053:
  case 0x057:
   do { do { if (0 != 0) { if (0) { do { if (0 &&
 QB_e
# 506 "arch/sparc/math-emu/math_64.c"
   == 0 && !
 ((QB_f1 | QB_f0) == 0)) { (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } } while (0); do { if (0 && QA_e == 0 && !((QA_f1 | QA_f0) == 0)) { (QA_f0 = 0, QA_f1 = 0); _fex |= (0); } } while (0); } else { if ((QB_e == 0 && !((QB_f1 | QB_f0) == 0)) || (QA_e == 0 && !((QA_f1 | QA_f0) == 0))) _fex |= (0); } } } while (0); if ((QB_e == 32767 && !((QB_f1 | QB_f0) == 0)) || (QA_e == 32767 && !((QA_f1 | QA_f0) == 0))) { ((XR)) = ((3)); do { if (((((insn >> 5) & 0x1ff) == 0x057 ? 2 : 1))) { if (0 || 0) { if ((((((insn >> 5) & 0x1ff) == 0x057 ? 2 : 1))) == 2) _fex |= ((1 << 4) | 0); if (({ int _FP_ISSIGNAN_ret = 0; if (QB_e == 32767) { if (!((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; }) || ({ int _FP_ISSIGNAN_ret = 0; if (QA_e == 32767) { if (!((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) _fex |= ((1 << 4) | 0); } else if ((((((insn >> 5) & 0x1ff) == 0x057 ? 2 : 1))) == 2 || ({ int _FP_ISSIGNAN_ret = 0; if (QB_e == 32767) { if (!((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; }) || ({ int _FP_ISSIGNAN_ret = 0; if (QA_e == 32767) { if (!((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) _fex |= ((1 << 4)); } } while (0); } else { int _FP_CMP_is_zero_x; int _FP_CMP_is_zero_y; do { if (0 == 0) { do { if (0 && QB_e == 0 && !((QB_f1 | QB_f0) == 0)) { (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } } while (0); do { if (0 && QA_e == 0 && !((QA_f1 | QA_f0) == 0)) { (QA_f0 = 0, QA_f1 = 0); _fex |= (0); } } while (0); } } while (0); _FP_CMP_is_zero_x = (!QB_e && ((QB_f1 | QB_f0) == 0)) ? 1 : 0; _FP_CMP_is_zero_y = (!QA_e && ((QA_f1 | QA_f0) == 0)) ? 1 : 0; if (_FP_CMP_is_zero_x && _FP_CMP_is_zero_y) ((XR)) = 0; else if (_FP_CMP_is_zero_x) ((XR)) = QA_s ? 1 : -1; else if (_FP_CMP_is_zero_y) ((XR)) = QB_s ? -1 : 1; else if (QB_s != QA_s) ((XR)) = QB_s ? -1 : 1; else if (QB_e > QA_e) ((XR)) = QB_s ? -1 : 1; else if (QB_e < QA_e) ((XR)) = QB_s ? 1 : -1; else if ((QB_f1 > QA_f1 || (QB_f1 == QA_f1 && QB_f0 > QA_f0))) ((XR)) = QB_s ? -1 : 1; else if ((QA_f1 > QB_f1 || (QA_f1 == QB_f1 && QA_f0 > QB_f0))) ((XR)) = QB_s ? 1 : -1; else ((XR)) = 0; } } while (0);
  }
  if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) {
   switch ((type >> 8) & 0xf) {
   case 0: xfsr = (current_thread_info_reg)->xfsr[0];
    if (XR == -1) XR = 2;
    switch (freg & 3) {

    case 0: xfsr &= ~0xc00; xfsr |= (XR << 10); break;
    case 1: xfsr &= ~0x300000000UL; xfsr |= (XR << 32); break;
    case 2: xfsr &= ~0xc00000000UL; xfsr |= (XR << 34); break;
    case 3: xfsr &= ~0x3000000000UL; xfsr |= (XR << 36); break;
    }
    (current_thread_info_reg)->xfsr[0] = xfsr;
    break;
   case 1: rd->s = IR; break;
   case 2: rd->d = XR; break;
   case 5: do { if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_S *_FP_PACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rd)); _FP_PACK_RAW_1_P_flo->bits.frac = SR_f; _FP_PACK_RAW_1_P_flo->bits.exp = SR_e; _FP_PACK_RAW_1_P_flo->bits.sign = SR_s; } while (0); } while (0); break;
   case 6: do { if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_D *_FP_PACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rd)); _FP_PACK_RAW_1_P_flo->bits.frac = DR_f; _FP_PACK_RAW_1_P_flo->bits.exp = DR_e; _FP_PACK_RAW_1_P_flo->bits.sign = DR_s; } while (0); } while (0); break;
   case 7: do { if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_Q *_FP_PACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rd)); _FP_PACK_RAW_2_P_flo->bits.frac0 = QR_f0; _FP_PACK_RAW_2_P_flo->bits.frac1 = QR_f1; _FP_PACK_RAW_2_P_flo->bits.exp = QR_e; _FP_PACK_RAW_2_P_flo->bits.sign = QR_s; } while (0); } while (0); break;
   case 9: do { do { int _FP_PACK_SEMIRAW_is_tiny = SR_e == 0 && !(SR_f == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f = 0; (_FP_PACK_SEMIRAW_T_f = SR_f); _FP_PACK_SEMIRAW_T_s = SR_s; _FP_PACK_SEMIRAW_T_e = SR_e; do { if (__builtin_constant_p (1) && (1) == 1) _FP_PACK_SEMIRAW_T_f += _FP_PACK_SEMIRAW_T_f; else _FP_PACK_SEMIRAW_T_f <<= (1); } while (0); do { if ((_FP_PACK_SEMIRAW_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_SEMIRAW_T_f & ((unsigned long) 1 << ((3 + 24))))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((SR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((SR_f) & 15) != ((unsigned long) 1 << 2)) (SR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((SR_f) & (((unsigned long) 1 << ((3 + 24))) >> 1)) { (SR_f) &= ~(((unsigned long) 1 << ((3 + 24))) >> 1); SR_e++; if (SR_e == 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (SR_f >>= 3); if (SR_e == 255 && !(SR_f == 0)) { if (!1) { (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); SR_s = 0; } else do { if (0) { (SR_f) &= ((unsigned long) 1 << (24 -2)) - 1; if ((SR_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); } } else (SR_f) |= ((unsigned long) 1 << (24 -2)); } while (0); } } while (0); if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_S *_FP_PACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rd)); _FP_PACK_RAW_1_P_flo->bits.frac = SR_f; _FP_PACK_RAW_1_P_flo->bits.exp = SR_e; _FP_PACK_RAW_1_P_flo->bits.sign = SR_s; } while (0); } while (0); break;
   case 10: do { do { int _FP_PACK_SEMIRAW_is_tiny = DR_e == 0 && !(DR_f == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f = 0; (_FP_PACK_SEMIRAW_T_f = DR_f); _FP_PACK_SEMIRAW_T_s = DR_s; _FP_PACK_SEMIRAW_T_e = DR_e; do { if (__builtin_constant_p (1) && (1) == 1) _FP_PACK_SEMIRAW_T_f += _FP_PACK_SEMIRAW_T_f; else _FP_PACK_SEMIRAW_T_f <<= (1); } while (0); do { if ((_FP_PACK_SEMIRAW_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_SEMIRAW_T_f & ((unsigned long) 1 << (3 + 53) % 64))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((DR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((DR_f) & 15) != ((unsigned long) 1 << 2)) (DR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((DR_f) & (((unsigned long) 1 << (3 + 53) % 64) >> 1)) { (DR_f) &= ~(((unsigned long) 1 << (3 + 53) % 64) >> 1); DR_e++; if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (DR_f >>= 3); if (DR_e == 2047 && !(DR_f == 0)) { if (!1) { (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); DR_s = 0; } else do { if (0) { (DR_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DR_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DR_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); } } while (0); if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_D *_FP_PACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rd)); _FP_PACK_RAW_1_P_flo->bits.frac = DR_f; _FP_PACK_RAW_1_P_flo->bits.exp = DR_e; _FP_PACK_RAW_1_P_flo->bits.sign = DR_s; } while (0); } while (0); break;
   case 11: do { do { int _FP_PACK_SEMIRAW_is_tiny = QR_e == 0 && !((QR_f1 | QR_f0) == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f0 = 0, _FP_PACK_SEMIRAW_T_f1 = 0; (_FP_PACK_SEMIRAW_T_f0 = QR_f0, _FP_PACK_SEMIRAW_T_f1 = QR_f1); _FP_PACK_SEMIRAW_T_s = QR_s; _FP_PACK_SEMIRAW_T_e = QR_e; (void) (((1) < 64) ? ({ if (__builtin_constant_p (1) && (1) == 1) { _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f1 + _FP_PACK_SEMIRAW_T_f1 + (((signed long) (_FP_PACK_SEMIRAW_T_f0)) < 0); _FP_PACK_SEMIRAW_T_f0 += _FP_PACK_SEMIRAW_T_f0; } else { _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f1 << (1) | _FP_PACK_SEMIRAW_T_f0 >> (64 - (1)); _FP_PACK_SEMIRAW_T_f0 <<= (1); } 0; }) : ({ _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f0 << ((1) - 64); _FP_PACK_SEMIRAW_T_f0 = 0; })); do { if ((_FP_PACK_SEMIRAW_T_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (((_FP_PACK_SEMIRAW_T_f1) & ((unsigned long) 1 << ((3 + 113) % 64)))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((QR_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((QR_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((QR_f1) & (((unsigned long) 1 << ((3 + 113) % 64)) >> 1)) { (QR_f1) &= ~(((unsigned long) 1 << ((3 + 113) % 64)) >> 1); QR_e++; if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (void) (((3) < 64) ? ({ QR_f0 = QR_f0 >> (3) | QR_f1 << (64 - (3)); QR_f1 >>= (3); }) : ({ QR_f0 = QR_f1 >> ((3) - 64); QR_f1 = 0; })); if (QR_e == 32767 && !((QR_f1 | QR_f0) == 0)) { if (!1) { (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); QR_s = 0; } else do { if (0) { (QR_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QR_f1 | QR_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QR_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } while (0); if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_Q *_FP_PACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rd)); _FP_PACK_RAW_2_P_flo->bits.frac0 = QR_f0; _FP_PACK_RAW_2_P_flo->bits.frac1 = QR_f1; _FP_PACK_RAW_2_P_flo->bits.exp = QR_e; _FP_PACK_RAW_2_P_flo->bits.sign = QR_s; } while (0); } while (0); break;
   case 13: do { do { switch (SR_c) { case 0: SR_e += 127; if (SR_e > 0) { do { if ((SR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((SR_f) & 15) != ((unsigned long) 1 << 2)) (SR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((SR_f & ((unsigned long) 1 << ((3 + 24))))) { (SR_f &= ~((unsigned long) 1 << ((3 + 24)))); SR_e++; } (SR_f >>= 3); if (SR_e >= 255) { switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: SR_c = 2; break; case 2: if (!SR_s) SR_c = 2; break; case 3: if (SR_s) SR_c = 2; break; } if (SR_c == 2) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 3)); _fex |= ((1 << 0)); } } else { int _FP_PACK_CANONICAL_is_tiny = 1; if (0 && SR_e == 0) { long _FP_PACK_CANONICAL_T_c __attribute__ ((unused)) = 0; long _FP_PACK_CANONICAL_T_s __attribute__ ((unused)) = 0; long _FP_PACK_CANONICAL_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_CANONICAL_T_f = 0; (_FP_PACK_CANONICAL_T_f = SR_f); _FP_PACK_CANONICAL_T_s = SR_s; _FP_PACK_CANONICAL_T_e = SR_e; do { if ((_FP_PACK_CANONICAL_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_CANONICAL_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_CANONICAL_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_CANONICAL_T_s && ((_FP_PACK_CANONICAL_T_f) & 7)) (_FP_PACK_CANONICAL_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_CANONICAL_T_s && ((_FP_PACK_CANONICAL_T_f) & 7)) (_FP_PACK_CANONICAL_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_CANONICAL_T_f & ((unsigned long) 1 << ((3 + 24))))) _FP_PACK_CANONICAL_is_tiny = 0; } SR_e = -SR_e + 1; if (SR_e <= (3 + 24)) { (SR_f = (SR_f >> ((SR_e)) | (__builtin_constant_p ((SR_e)) && ((SR_e)) == 1 ? SR_f & 1 : (SR_f << (64 - ((SR_e)))) != 0))); do { if ((SR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((SR_f) & 15) != ((unsigned long) 1 << 2)) (SR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((SR_f) & (((unsigned long) 1 << ((3 + 24))) >> 1)) { SR_e = 1; (SR_f = 0); _fex |= ((1 << 0)); } else { SR_e = 0; (SR_f >>= 3); } if (_FP_PACK_CANONICAL_is_tiny && (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)))) _fex |= ((1 << 2)); } else { SR_e = 0; if (!(SR_f == 0)) { (SR_f = 1); do { if ((SR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((SR_f) & 15) != ((unsigned long) 1 << 2)) (SR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); (SR_f) >>= (3); } _fex |= ((1 << 2)); } } break; case 1: SR_e = 0; (SR_f = 0); break; case 2: SR_e = 255; (SR_f = 0); break; case 3: SR_e = 255; if (!1) { (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); SR_s = 0; } else do { if (0) { (SR_f) &= ((unsigned long) 1 << (24 -2)) - 1; if ((SR_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); } } else (SR_f) |= ((unsigned long) 1 << (24 -2)); } while (0); break; } } while (0); if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_S *_FP_PACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rd)); _FP_PACK_RAW_1_P_flo->bits.frac = SR_f; _FP_PACK_RAW_1_P_flo->bits.exp = SR_e; _FP_PACK_RAW_1_P_flo->bits.sign = SR_s; } while (0); } while (0); break;
   case 14: do { do { switch (DR_c) { case 0: DR_e += 1023; if (DR_e > 0) { do { if ((DR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((DR_f) & 15) != ((unsigned long) 1 << 2)) (DR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((DR_f & ((unsigned long) 1 << (3 + 53) % 64))) { (DR_f &= ~((unsigned long) 1 << (3 + 53) % 64)); DR_e++; } (DR_f >>= 3); if (DR_e >= 2047) { switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: DR_c = 2; break; case 2: if (!DR_s) DR_c = 2; break; case 3: if (DR_s) DR_c = 2; break; } if (DR_c == 2) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 3)); _fex |= ((1 << 0)); } } else { int _FP_PACK_CANONICAL_is_tiny = 1; if (0 && DR_e == 0) { long _FP_PACK_CANONICAL_T_c __attribute__ ((unused)) = 0; long _FP_PACK_CANONICAL_T_s __attribute__ ((unused)) = 0; long _FP_PACK_CANONICAL_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_CANONICAL_T_f = 0; (_FP_PACK_CANONICAL_T_f = DR_f); _FP_PACK_CANONICAL_T_s = DR_s; _FP_PACK_CANONICAL_T_e = DR_e; do { if ((_FP_PACK_CANONICAL_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_CANONICAL_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_CANONICAL_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_CANONICAL_T_s && ((_FP_PACK_CANONICAL_T_f) & 7)) (_FP_PACK_CANONICAL_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_CANONICAL_T_s && ((_FP_PACK_CANONICAL_T_f) & 7)) (_FP_PACK_CANONICAL_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_CANONICAL_T_f & ((unsigned long) 1 << (3 + 53) % 64))) _FP_PACK_CANONICAL_is_tiny = 0; } DR_e = -DR_e + 1; if (DR_e <= (3 + 53)) { (DR_f = (DR_f >> ((DR_e)) | (__builtin_constant_p ((DR_e)) && ((DR_e)) == 1 ? DR_f & 1 : (DR_f << (64 - ((DR_e)))) != 0))); do { if ((DR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((DR_f) & 15) != ((unsigned long) 1 << 2)) (DR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((DR_f) & (((unsigned long) 1 << (3 + 53) % 64) >> 1)) { DR_e = 1; (DR_f = 0); _fex |= ((1 << 0)); } else { DR_e = 0; (DR_f >>= 3); } if (_FP_PACK_CANONICAL_is_tiny && (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)))) _fex |= ((1 << 2)); } else { DR_e = 0; if (!(DR_f == 0)) { (DR_f = 1); do { if ((DR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((DR_f) & 15) != ((unsigned long) 1 << 2)) (DR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); (DR_f) >>= (3); } _fex |= ((1 << 2)); } } break; case 1: DR_e = 0; (DR_f = 0); break; case 2: DR_e = 2047; (DR_f = 0); break; case 3: DR_e = 2047; if (!1) { (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); DR_s = 0; } else do { if (0) { (DR_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DR_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DR_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); break; } } while (0); if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_D *_FP_PACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rd)); _FP_PACK_RAW_1_P_flo->bits.frac = DR_f; _FP_PACK_RAW_1_P_flo->bits.exp = DR_e; _FP_PACK_RAW_1_P_flo->bits.sign = DR_s; } while (0); } while (0); break;
   case 15: do { do { switch (QR_c) { case 0: QR_e += 16383; if (QR_e > 0) { do { if ((QR_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((QR_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (((QR_f1) & ((unsigned long) 1 << ((3 + 113) % 64)))) { ((QR_f1) &= ~((unsigned long) 1 << ((3 + 113) % 64))); QR_e++; } (void) (((3) < 64) ? ({ QR_f0 = QR_f0 >> (3) | QR_f1 << (64 - (3)); QR_f1 >>= (3); }) : ({ QR_f0 = QR_f1 >> ((3) - 64); QR_f1 = 0; })); if (QR_e >= 32767) { switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: QR_c = 2; break; case 2: if (!QR_s) QR_c = 2; break; case 3: if (QR_s) QR_c = 2; break; } if (QR_c == 2) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 3)); _fex |= ((1 << 0)); } } else { int _FP_PACK_CANONICAL_is_tiny = 1; if (0 && QR_e == 0) { long _FP_PACK_CANONICAL_T_c __attribute__ ((unused)) = 0; long _FP_PACK_CANONICAL_T_s __attribute__ ((unused)) = 0; long _FP_PACK_CANONICAL_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_CANONICAL_T_f0 = 0, _FP_PACK_CANONICAL_T_f1 = 0; (_FP_PACK_CANONICAL_T_f0 = QR_f0, _FP_PACK_CANONICAL_T_f1 = QR_f1); _FP_PACK_CANONICAL_T_s = QR_s; _FP_PACK_CANONICAL_T_e = QR_e; do { if ((_FP_PACK_CANONICAL_T_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_CANONICAL_T_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_CANONICAL_T_f1), "=&r" (_FP_PACK_CANONICAL_T_f0) : "r" ((UDItype)(_FP_PACK_CANONICAL_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_CANONICAL_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_CANONICAL_T_s && ((_FP_PACK_CANONICAL_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_CANONICAL_T_f1), "=&r" (_FP_PACK_CANONICAL_T_f0) : "r" ((UDItype)(_FP_PACK_CANONICAL_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_CANONICAL_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (_FP_PACK_CANONICAL_T_s && ((_FP_PACK_CANONICAL_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_CANONICAL_T_f1), "=&r" (_FP_PACK_CANONICAL_T_f0) : "r" ((UDItype)(_FP_PACK_CANONICAL_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_CANONICAL_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (((_FP_PACK_CANONICAL_T_f1) & ((unsigned long) 1 << ((3 + 113) % 64)))) _FP_PACK_CANONICAL_is_tiny = 0; } QR_e = -QR_e + 1; if (QR_e <= (3 + 113)) { (void) (((QR_e) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (QR_e)) | QR_f0 >> (QR_e) | (__builtin_constant_p (QR_e) && (QR_e) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (QR_e))) != 0)); QR_f1 >>= (QR_e); }) : ({ QR_f0 = (QR_f1 >> ((QR_e) - 64) | ((((QR_e) == 64 ? 0 : (QR_f1 << (2*64 - (QR_e)))) | QR_f0) != 0)); QR_f1 = 0; })); do { if ((QR_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((QR_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if ((QR_f1) & (((unsigned long) 1 << ((3 + 113) % 64)) >> 1)) { QR_e = 1; (QR_f0 = 0, QR_f1 = 0); _fex |= ((1 << 0)); } else { QR_e = 0; (void) (((3) < 64) ? ({ QR_f0 = QR_f0 >> (3) | QR_f1 << (64 - (3)); QR_f1 >>= (3); }) : ({ QR_f0 = QR_f1 >> ((3) - 64); QR_f1 = 0; })); } if (_FP_PACK_CANONICAL_is_tiny && (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)))) _fex |= ((1 << 2)); } else { QR_e = 0; if (!((QR_f1 | QR_f0) == 0)) { (QR_f0 = 1, QR_f1 = 0); do { if ((QR_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((QR_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); (QR_f0) >>= (3); } _fex |= ((1 << 2)); } } break; case 1: QR_e = 0; (QR_f0 = 0, QR_f1 = 0); break; case 2: QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); break; case 3: QR_e = 32767; if (!1) { (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); QR_s = 0; } else do { if (0) { (QR_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QR_f1 | QR_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QR_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); break; } } while (0); if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_Q *_FP_PACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rd)); _FP_PACK_RAW_2_P_flo->bits.frac0 = QR_f0; _FP_PACK_RAW_2_P_flo->bits.frac1 = QR_f1; _FP_PACK_RAW_2_P_flo->bits.exp = QR_e; _FP_PACK_RAW_2_P_flo->bits.sign = QR_s; } while (0); } while (0); break;
   }
  }

  if(_fex != 0)
   return record_exception(regs, _fex);


  (current_thread_info_reg)->xfsr[0] &= ~((0x1fUL << 0UL));
  regs->tpc = regs->tnpc;
  regs->tnpc += 4;
  return 1;
 }
err: return 0;
}

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-19 18:21   ` David Miller
  0 siblings, 0 replies; 20+ messages in thread
From: David Miller @ 2015-02-19 18:21 UTC (permalink / raw)
  To: joseph
  Cc: linux-s390, linux-sh, linux-kernel, linux-alpha, sparclinux,
	linuxppc-dev

[-- Attachment #1: Type: Text/Plain, Size: 812 bytes --]

From: Joseph Myers <joseph@codesourcery.com>
Date: Fri, 6 Feb 2015 17:25:29 +0000

> * On SPARC, comparisons now use raw unpacking (this should not in fact
>   change how the emulation behaves, just make it more efficient).

I did a sparc64 test build and it failed like so:

arch/sparc/math-emu/math_64.c: In function ‘do_mathemu’:
arch/sparc/math-emu/math_64.c:487:1: error: expected expression before ‘return’
arch/sparc/math-emu/math_64.c:488:1: error: expected expression before ‘return’
arch/sparc/math-emu/math_64.c:490:1: error: expected expression before ‘return’
arch/sparc/math-emu/math_64.c:491:1: error: expected expression before ‘return’
arch/sparc/math-emu/math_64.c:495:1: error: expected expression before ‘return’

I'm attaching a CPP processed math_64.c for your convenience:

[-- Attachment #2: math_64.i --]
[-- Type: Application/Octet-Stream, Size: 1117818 bytes --]

# 1 "arch/sparc/math-emu/math_64.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "././include/linux/kconfig.h" 1



# 1 "include/generated/autoconf.h" 1
# 5 "././include/linux/kconfig.h" 2
# 1 "<command-line>" 2
# 1 "arch/sparc/math-emu/math_64.c"
# 11 "arch/sparc/math-emu/math_64.c"
# 1 "include/linux/types.h" 1




# 1 "include/uapi/linux/types.h" 1



# 1 "arch/sparc/include/generated/asm/types.h" 1
# 1 "./include/uapi/asm-generic/types.h" 1





# 1 "include/asm-generic/int-ll64.h" 1
# 10 "include/asm-generic/int-ll64.h"
# 1 "include/uapi/asm-generic/int-ll64.h" 1
# 11 "include/uapi/asm-generic/int-ll64.h"
# 1 "./arch/sparc/include/uapi/asm/bitsperlong.h" 1
# 10 "./arch/sparc/include/uapi/asm/bitsperlong.h"
# 1 "include/asm-generic/bitsperlong.h" 1



# 1 "include/uapi/asm-generic/bitsperlong.h" 1
# 5 "include/asm-generic/bitsperlong.h" 2
# 11 "./arch/sparc/include/uapi/asm/bitsperlong.h" 2
# 12 "include/uapi/asm-generic/int-ll64.h" 2







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 11 "include/asm-generic/int-ll64.h" 2




typedef signed char s8;
typedef unsigned char u8;

typedef signed short s16;
typedef unsigned short u16;

typedef signed int s32;
typedef unsigned int u32;

typedef signed long long s64;
typedef unsigned long long u64;
# 7 "./include/uapi/asm-generic/types.h" 2
# 1 "arch/sparc/include/generated/asm/types.h" 2
# 5 "include/uapi/linux/types.h" 2
# 13 "include/uapi/linux/types.h"
# 1 "./include/uapi/linux/posix_types.h" 1



# 1 "include/linux/stddef.h" 1



# 1 "include/uapi/linux/stddef.h" 1
# 1 "include/linux/compiler.h" 1
# 54 "include/linux/compiler.h"
# 1 "include/linux/compiler-gcc.h" 1
# 107 "include/linux/compiler-gcc.h"
# 1 "include/linux/compiler-gcc4.h" 1
# 108 "include/linux/compiler-gcc.h" 2
# 55 "include/linux/compiler.h" 2
# 83 "include/linux/compiler.h"
struct ftrace_branch_data {
 const char *func;
 const char *file;
 unsigned line;
 union {
  struct {
   unsigned long correct;
   unsigned long incorrect;
  };
  struct {
   unsigned long miss;
   unsigned long hit;
  };
  unsigned long miss_hit[2];
 };
};
# 193 "include/linux/compiler.h"
# 1 "include/uapi/linux/types.h" 1
# 194 "include/linux/compiler.h" 2

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void data_access_exceeds_word_size(void)

__attribute__((warning("data access exceeds word size and won't be atomic")))

;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void data_access_exceeds_word_size(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __read_once_size(volatile void *p, void *res, int size)
{
 switch (size) {
 case 1: *(__u8 *)res = *(volatile __u8 *)p; break;
 case 2: *(__u16 *)res = *(volatile __u16 *)p; break;
 case 4: *(__u32 *)res = *(volatile __u32 *)p; break;

 case 8: *(__u64 *)res = *(volatile __u64 *)p; break;

 default:
  __asm__ __volatile__("": : :"memory");
  __builtin_memcpy((void *)res, (const void *)p, size);
  data_access_exceeds_word_size();
  __asm__ __volatile__("": : :"memory");
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __write_once_size(volatile void *p, void *res, int size)
{
 switch (size) {
 case 1: *(volatile __u8 *)p = *(__u8 *)res; break;
 case 2: *(volatile __u16 *)p = *(__u16 *)res; break;
 case 4: *(volatile __u32 *)p = *(__u32 *)res; break;

 case 8: *(volatile __u64 *)p = *(__u64 *)res; break;

 default:
  __asm__ __volatile__("": : :"memory");
  __builtin_memcpy((void *)p, (const void *)res, size);
  data_access_exceeds_word_size();
  __asm__ __volatile__("": : :"memory");
 }
}
# 1 "include/uapi/linux/stddef.h" 2
# 5 "include/linux/stddef.h" 2





enum {
 false = 0,
 true = 1
};
# 5 "./include/uapi/linux/posix_types.h" 2
# 24 "./include/uapi/linux/posix_types.h"
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "./arch/sparc/include/uapi/asm/posix_types.h" 1
# 13 "./arch/sparc/include/uapi/asm/posix_types.h"
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;



typedef int __kernel_suseconds_t;
# 47 "./arch/sparc/include/uapi/asm/posix_types.h"
# 1 "./include/uapi/asm-generic/posix_types.h" 1
# 14 "./include/uapi/asm-generic/posix_types.h"
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;







typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 58 "./include/uapi/asm-generic/posix_types.h"
typedef unsigned int __kernel_old_dev_t;
# 71 "./include/uapi/asm-generic/posix_types.h"
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_time_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 48 "./arch/sparc/include/uapi/asm/posix_types.h" 2
# 36 "./include/uapi/linux/posix_types.h" 2
# 14 "include/uapi/linux/types.h" 2
# 32 "include/uapi/linux/types.h"
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 6 "include/linux/types.h" 2






typedef __u32 __kernel_dev_t;

typedef __kernel_fd_set fd_set;
typedef __kernel_dev_t dev_t;
typedef __kernel_ino_t ino_t;
typedef __kernel_mode_t mode_t;
typedef unsigned short umode_t;
typedef __u32 nlink_t;
typedef __kernel_off_t off_t;
typedef __kernel_pid_t pid_t;
typedef __kernel_daddr_t daddr_t;
typedef __kernel_key_t key_t;
typedef __kernel_suseconds_t suseconds_t;
typedef __kernel_timer_t timer_t;
typedef __kernel_clockid_t clockid_t;
typedef __kernel_mqd_t mqd_t;

typedef _Bool bool;

typedef __kernel_uid32_t uid_t;
typedef __kernel_gid32_t gid_t;
typedef __kernel_uid16_t uid16_t;
typedef __kernel_gid16_t gid16_t;

typedef unsigned long uintptr_t;



typedef __kernel_old_uid_t old_uid_t;
typedef __kernel_old_gid_t old_gid_t;



typedef __kernel_loff_t loff_t;
# 54 "include/linux/types.h"
typedef __kernel_size_t size_t;




typedef __kernel_ssize_t ssize_t;




typedef __kernel_ptrdiff_t ptrdiff_t;




typedef __kernel_time_t time_t;




typedef __kernel_clock_t clock_t;




typedef __kernel_caddr_t caddr_t;



typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;


typedef unsigned char unchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;




typedef __u8 u_int8_t;
typedef __s8 int8_t;
typedef __u16 u_int16_t;
typedef __s16 int16_t;
typedef __u32 u_int32_t;
typedef __s32 int32_t;



typedef __u8 uint8_t;
typedef __u16 uint16_t;
typedef __u32 uint32_t;


typedef __u64 uint64_t;
typedef __u64 u_int64_t;
typedef __s64 int64_t;
# 133 "include/linux/types.h"
typedef unsigned long sector_t;
typedef unsigned long blkcnt_t;
# 146 "include/linux/types.h"
typedef u32 dma_addr_t;
# 155 "include/linux/types.h"
typedef unsigned gfp_t;
typedef unsigned fmode_t;
typedef unsigned oom_flags_t;


typedef u64 phys_addr_t;




typedef phys_addr_t resource_size_t;





typedef unsigned long irq_hw_number_t;

typedef struct {
 int counter;
} atomic_t;


typedef struct {
 long counter;
} atomic64_t;


struct list_head {
 struct list_head *next, *prev;
};

struct hlist_head {
 struct hlist_node *first;
};

struct hlist_node {
 struct hlist_node *next, **pprev;
};

struct ustat {
 __kernel_daddr_t f_tfree;
 __kernel_ino_t f_tinode;
 char f_fname[6];
 char f_fpack[6];
};






struct callback_head {
 struct callback_head *next;
 void (*func)(struct callback_head *head);
};



typedef u64 cycle_t;
# 12 "arch/sparc/math-emu/math_64.c" 2
# 1 "include/linux/sched.h" 1



# 1 "include/uapi/linux/sched.h" 1
# 5 "include/linux/sched.h" 2

# 1 "include/linux/sched/prio.h" 1
# 47 "include/linux/sched/prio.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long nice_to_rlimit(long nice)
{
 return (19 - nice + 1);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long rlimit_to_nice(long prio)
{
 return (19 - prio + 1);
}
# 7 "include/linux/sched.h" 2


struct sched_param {
 int sched_priority;
};

# 1 "./arch/sparc/include/uapi/asm/param.h" 1




# 1 "include/asm-generic/param.h" 1



# 1 "include/uapi/asm-generic/param.h" 1
# 5 "include/asm-generic/param.h" 2
# 6 "./arch/sparc/include/uapi/asm/param.h" 2
# 14 "include/linux/sched.h" 2

# 1 "include/linux/capability.h" 1
# 15 "include/linux/capability.h"
# 1 "include/uapi/linux/capability.h" 1
# 18 "include/uapi/linux/capability.h"
struct task_struct;
# 40 "include/uapi/linux/capability.h"
typedef struct __user_cap_header_struct {
 __u32 version;
 int pid;
} *cap_user_header_t;

typedef struct __user_cap_data_struct {
        __u32 effective;
        __u32 permitted;
        __u32 inheritable;
} *cap_user_data_t;
# 69 "include/uapi/linux/capability.h"
struct vfs_cap_data {
 __le32 magic_etc;
 struct {
  __le32 permitted;
  __le32 inheritable;
 } data[2];
};
# 16 "include/linux/capability.h" 2





extern int file_caps_enabled;

typedef struct kernel_cap_struct {
 __u32 cap[2];
} kernel_cap_t;


struct cpu_vfs_cap_data {
 __u32 magic_etc;
 kernel_cap_t permitted;
 kernel_cap_t inheritable;
};





struct file;
struct inode;
struct dentry;
struct user_namespace;

struct user_namespace *current_user_ns(void);

extern const kernel_cap_t __cap_empty_set;
extern const kernel_cap_t __cap_init_eff_set;
# 117 "include/linux/capability.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_combine(const kernel_cap_t a,
           const kernel_cap_t b)
{
 kernel_cap_t dest;
 do { unsigned __capi; for (__capi = 0; __capi < 2; ++__capi) { dest.cap[__capi] = a.cap[__capi] | b.cap[__capi]; } } while (0);
 return dest;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_intersect(const kernel_cap_t a,
      const kernel_cap_t b)
{
 kernel_cap_t dest;
 do { unsigned __capi; for (__capi = 0; __capi < 2; ++__capi) { dest.cap[__capi] = a.cap[__capi] & b.cap[__capi]; } } while (0);
 return dest;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_drop(const kernel_cap_t a,
        const kernel_cap_t drop)
{
 kernel_cap_t dest;
 do { unsigned __capi; for (__capi = 0; __capi < 2; ++__capi) { dest.cap[__capi] = a.cap[__capi] &~ drop.cap[__capi]; } } while (0);
 return dest;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_invert(const kernel_cap_t c)
{
 kernel_cap_t dest;
 do { unsigned __capi; for (__capi = 0; __capi < 2; ++__capi) { dest.cap[__capi] = ~ c.cap[__capi]; } } while (0);
 return dest;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cap_isclear(const kernel_cap_t a)
{
 unsigned __capi;
 for (__capi = 0; __capi < 2; ++__capi) {
  if (a.cap[__capi] != 0)
   return 0;
 }
 return 1;
}
# 165 "include/linux/capability.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cap_issubset(const kernel_cap_t a, const kernel_cap_t set)
{
 kernel_cap_t dest;
 dest = cap_drop(a, set);
 return cap_isclear(dest);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cap_is_fs_cap(int cap)
{
 const kernel_cap_t __cap_fs_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((9) & 31)), ((1 << ((32) & 31))) } });
 return !!((1 << ((cap) & 31)) & __cap_fs_set.cap[((cap) >> 5)]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_drop_fs_set(const kernel_cap_t a)
{
 const kernel_cap_t __cap_fs_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((9) & 31)), ((1 << ((32) & 31))) } });
 return cap_drop(a, __cap_fs_set);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_raise_fs_set(const kernel_cap_t a,
         const kernel_cap_t permitted)
{
 const kernel_cap_t __cap_fs_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((9) & 31)), ((1 << ((32) & 31))) } });
 return cap_combine(a,
      cap_intersect(permitted, __cap_fs_set));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_drop_nfsd_set(const kernel_cap_t a)
{
 const kernel_cap_t __cap_fs_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((24) & 31)), ((1 << ((32) & 31))) } });
 return cap_drop(a, __cap_fs_set);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_raise_nfsd_set(const kernel_cap_t a,
           const kernel_cap_t permitted)
{
 const kernel_cap_t __cap_nfsd_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((24) & 31)), ((1 << ((32) & 31))) } });
 return cap_combine(a,
      cap_intersect(permitted, __cap_nfsd_set));
}

extern bool has_capability(struct task_struct *t, int cap);
extern bool has_ns_capability(struct task_struct *t,
         struct user_namespace *ns, int cap);
extern bool has_capability_noaudit(struct task_struct *t, int cap);
extern bool has_ns_capability_noaudit(struct task_struct *t,
          struct user_namespace *ns, int cap);
extern bool capable(int cap);
extern bool ns_capable(struct user_namespace *ns, int cap);
extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);


extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
# 16 "include/linux/sched.h" 2
# 1 "include/linux/threads.h" 1
# 17 "include/linux/sched.h" 2
# 1 "include/linux/kernel.h" 1




# 1 "/usr/lib/gcc/sparc-linux-gnu/4.6/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/sparc-linux-gnu/4.6/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 102 "/usr/lib/gcc/sparc-linux-gnu/4.6/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 6 "include/linux/kernel.h" 2
# 1 "include/linux/linkage.h" 1




# 1 "include/linux/stringify.h" 1
# 6 "include/linux/linkage.h" 2
# 1 "include/linux/export.h" 1
# 26 "include/linux/export.h"
struct kernel_symbol
{
 unsigned long value;
 const char *name;
};
# 7 "include/linux/linkage.h" 2
# 1 "arch/sparc/include/generated/asm/linkage.h" 1
# 1 "include/asm-generic/linkage.h" 1
# 1 "arch/sparc/include/generated/asm/linkage.h" 2
# 8 "include/linux/linkage.h" 2
# 7 "include/linux/kernel.h" 2



# 1 "include/linux/bitops.h" 1


# 1 "arch/sparc/include/generated/asm/types.h" 1
# 4 "include/linux/bitops.h" 2
# 27 "include/linux/bitops.h"
extern unsigned int __sw_hweight8(unsigned int w);
extern unsigned int __sw_hweight16(unsigned int w);
extern unsigned int __sw_hweight32(unsigned int w);
extern unsigned long __sw_hweight64(__u64 w);





# 1 "./arch/sparc/include/asm/bitops.h" 1



# 1 "./arch/sparc/include/asm/bitops_64.h" 1
# 15 "./arch/sparc/include/asm/bitops_64.h"
# 1 "./arch/sparc/include/uapi/asm/byteorder.h" 1



# 1 "include/linux/byteorder/big_endian.h" 1



# 1 "include/uapi/linux/byteorder/big_endian.h" 1
# 12 "include/uapi/linux/byteorder/big_endian.h"
# 1 "include/linux/swab.h" 1



# 1 "include/uapi/linux/swab.h" 1





# 1 "./arch/sparc/include/uapi/asm/swab.h" 1




# 1 "./arch/sparc/include/uapi/asm/asi.h" 1
# 6 "./arch/sparc/include/uapi/asm/swab.h" 2


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 __arch_swab16p(const __u16 *addr)
{
 __u16 ret;

 __asm__ __volatile__ ("lduha [%2] %3, %0"
         : "=r" (ret)
         : "m" (*addr), "r" (addr), "i" (0x88));
 return ret;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __arch_swab32p(const __u32 *addr)
{
 __u32 ret;

 __asm__ __volatile__ ("lduwa [%2] %3, %0"
         : "=r" (ret)
         : "m" (*addr), "r" (addr), "i" (0x88));
 return ret;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 __arch_swab64p(const __u64 *addr)
{
 __u64 ret;

 __asm__ __volatile__ ("ldxa [%2] %3, %0"
         : "=r" (ret)
         : "m" (*addr), "r" (addr), "i" (0x88));
 return ret;
}
# 7 "include/uapi/linux/swab.h" 2
# 46 "include/uapi/linux/swab.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u16 __fswab16(__u16 val)
{





 return ((__u16)( (((__u16)(val) & (__u16)0x00ffU) << 8) | (((__u16)(val) & (__u16)0xff00U) >> 8)));

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u32 __fswab32(__u32 val)
{





 return ((__u32)( (((__u32)(val) & (__u32)0x000000ffUL) << 24) | (((__u32)(val) & (__u32)0x0000ff00UL) << 8) | (((__u32)(val) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(val) & (__u32)0xff000000UL) >> 24)));

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u64 __fswab64(__u64 val)
{
# 79 "include/uapi/linux/swab.h"
 return ((__u64)( (((__u64)(val) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(val) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(val) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(val) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(val) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(val) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(val) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(val) & (__u64)0xff00000000000000ULL) >> 56)));

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u32 __fswahw32(__u32 val)
{



 return ((__u32)( (((__u32)(val) & (__u32)0x0000ffffUL) << 16) | (((__u32)(val) & (__u32)0xffff0000UL) >> 16)));

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u32 __fswahb32(__u32 val)
{



 return ((__u32)( (((__u32)(val) & (__u32)0x00ff00ffUL) << 8) | (((__u32)(val) & (__u32)0xff00ff00UL) >> 8)));

}
# 154 "include/uapi/linux/swab.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 __swab16p(const __u16 *p)
{

 return __arch_swab16p(p);



}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __swab32p(const __u32 *p)
{

 return __arch_swab32p(p);



}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 __swab64p(const __u64 *p)
{

 return __arch_swab64p(p);



}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __swahw32p(const __u32 *p)
{



 return (__builtin_constant_p((__u32)(*p)) ? ((__u32)( (((__u32)(*p) & (__u32)0x0000ffffUL) << 16) | (((__u32)(*p) & (__u32)0xffff0000UL) >> 16))) : __fswahw32(*p));

}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __swahb32p(const __u32 *p)
{



 return (__builtin_constant_p((__u32)(*p)) ? ((__u32)( (((__u32)(*p) & (__u32)0x00ff00ffUL) << 8) | (((__u32)(*p) & (__u32)0xff00ff00UL) >> 8))) : __fswahb32(*p));

}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swab16s(__u16 *p)
{



 *p = __swab16p(p);

}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swab32s(__u32 *p)
{



 *p = __swab32p(p);

}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swab64s(__u64 *p)
{



 *p = __swab64p(p);

}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swahw32s(__u32 *p)
{



 *p = __swahw32p(p);

}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swahb32s(__u32 *p)
{



 *p = __swahb32p(p);

}
# 5 "include/linux/swab.h" 2
# 13 "include/uapi/linux/byteorder/big_endian.h" 2
# 43 "include/uapi/linux/byteorder/big_endian.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __le64 __cpu_to_le64p(const __u64 *p)
{
 return ( __le64)__swab64p(p);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 __le64_to_cpup(const __le64 *p)
{
 return __swab64p((__u64 *)p);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __le32 __cpu_to_le32p(const __u32 *p)
{
 return ( __le32)__swab32p(p);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __le32_to_cpup(const __le32 *p)
{
 return __swab32p((__u32 *)p);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __le16 __cpu_to_le16p(const __u16 *p)
{
 return ( __le16)__swab16p(p);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 __le16_to_cpup(const __le16 *p)
{
 return __swab16p((__u16 *)p);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be64 __cpu_to_be64p(const __u64 *p)
{
 return ( __be64)*p;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 __be64_to_cpup(const __be64 *p)
{
 return ( __u64)*p;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be32 __cpu_to_be32p(const __u32 *p)
{
 return ( __be32)*p;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __be32_to_cpup(const __be32 *p)
{
 return ( __u32)*p;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be16 __cpu_to_be16p(const __u16 *p)
{
 return ( __be16)*p;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 __be16_to_cpup(const __be16 *p)
{
 return ( __u16)*p;
}
# 5 "include/linux/byteorder/big_endian.h" 2

# 1 "include/linux/byteorder/generic.h" 1
# 143 "include/linux/byteorder/generic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void le16_add_cpu(__le16 *var, u16 val)
{
 *var = (( __le16)(__builtin_constant_p((__u16)(((__builtin_constant_p((__u16)(( __u16)(__le16)(*var))) ? ((__u16)( (((__u16)(( __u16)(__le16)(*var)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__le16)(*var)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__le16)(*var))) + val))) ? ((__u16)( (((__u16)(((__builtin_constant_p((__u16)(( __u16)(__le16)(*var))) ? ((__u16)( (((__u16)(( __u16)(__le16)(*var)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__le16)(*var)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__le16)(*var))) + val)) & (__u16)0x00ffU) << 8) | (((__u16)(((__builtin_constant_p((__u16)(( __u16)(__le16)(*var))) ? ((__u16)( (((__u16)(( __u16)(__le16)(*var)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__le16)(*var)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__le16)(*var))) + val)) & (__u16)0xff00U) >> 8))) : __fswab16(((__builtin_constant_p((__u16)(( __u16)(__le16)(*var))) ? ((__u16)( (((__u16)(( __u16)(__le16)(*var)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__le16)(*var)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__le16)(*var))) + val))));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void le32_add_cpu(__le32 *var, u32 val)
{
 *var = (( __le32)(__builtin_constant_p((__u32)(((__builtin_constant_p((__u32)(( __u32)(__le32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__le32)(*var))) + val))) ? ((__u32)( (((__u32)(((__builtin_constant_p((__u32)(( __u32)(__le32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__le32)(*var))) + val)) & (__u32)0x000000ffUL) << 24) | (((__u32)(((__builtin_constant_p((__u32)(( __u32)(__le32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__le32)(*var))) + val)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(((__builtin_constant_p((__u32)(( __u32)(__le32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__le32)(*var))) + val)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(((__builtin_constant_p((__u32)(( __u32)(__le32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__le32)(*var))) + val)) & (__u32)0xff000000UL) >> 24))) : __fswab32(((__builtin_constant_p((__u32)(( __u32)(__le32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__le32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__le32)(*var))) + val))));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void le64_add_cpu(__le64 *var, u64 val)
{
 *var = (( __le64)(__builtin_constant_p((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val))) ? ((__u64)( (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(((__builtin_constant_p((__u64)(( __u64)(__le64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__le64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__le64)(*var))) + val))));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void be16_add_cpu(__be16 *var, u16 val)
{
 *var = (( __be16)(__u16)((( __u16)(__be16)(*var)) + val));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void be32_add_cpu(__be32 *var, u32 val)
{
 *var = (( __be32)(__u32)((( __u32)(__be32)(*var)) + val));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void be64_add_cpu(__be64 *var, u64 val)
{
 *var = (( __be64)(__u64)((( __u64)(__be64)(*var)) + val));
}
# 7 "include/linux/byteorder/big_endian.h" 2
# 5 "./arch/sparc/include/uapi/asm/byteorder.h" 2
# 16 "./arch/sparc/include/asm/bitops_64.h" 2
# 1 "./arch/sparc/include/asm/barrier.h" 1



# 1 "./arch/sparc/include/asm/barrier_64.h" 1
# 5 "./arch/sparc/include/asm/barrier.h" 2
# 17 "./arch/sparc/include/asm/bitops_64.h" 2

int test_and_set_bit(unsigned long nr, volatile unsigned long *addr);
int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr);
int test_and_change_bit(unsigned long nr, volatile unsigned long *addr);
void set_bit(unsigned long nr, volatile unsigned long *addr);
void clear_bit(unsigned long nr, volatile unsigned long *addr);
void change_bit(unsigned long nr, volatile unsigned long *addr);

# 1 "include/asm-generic/bitops/non-atomic.h" 1



# 1 "arch/sparc/include/generated/asm/types.h" 1
# 5 "include/asm-generic/bitops/non-atomic.h" 2
# 15 "include/asm-generic/bitops/non-atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __set_bit(int nr, volatile unsigned long *addr)
{
 unsigned long mask = (1UL << ((nr) % 64));
 unsigned long *p = ((unsigned long *)addr) + ((nr) / 64);

 *p |= mask;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __clear_bit(int nr, volatile unsigned long *addr)
{
 unsigned long mask = (1UL << ((nr) % 64));
 unsigned long *p = ((unsigned long *)addr) + ((nr) / 64);

 *p &= ~mask;
}
# 40 "include/asm-generic/bitops/non-atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __change_bit(int nr, volatile unsigned long *addr)
{
 unsigned long mask = (1UL << ((nr) % 64));
 unsigned long *p = ((unsigned long *)addr) + ((nr) / 64);

 *p ^= mask;
}
# 57 "include/asm-generic/bitops/non-atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_set_bit(int nr, volatile unsigned long *addr)
{
 unsigned long mask = (1UL << ((nr) % 64));
 unsigned long *p = ((unsigned long *)addr) + ((nr) / 64);
 unsigned long old = *p;

 *p = old | mask;
 return (old & mask) != 0;
}
# 76 "include/asm-generic/bitops/non-atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_clear_bit(int nr, volatile unsigned long *addr)
{
 unsigned long mask = (1UL << ((nr) % 64));
 unsigned long *p = ((unsigned long *)addr) + ((nr) / 64);
 unsigned long old = *p;

 *p = old & ~mask;
 return (old & mask) != 0;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_change_bit(int nr,
         volatile unsigned long *addr)
{
 unsigned long mask = (1UL << ((nr) % 64));
 unsigned long *p = ((unsigned long *)addr) + ((nr) / 64);
 unsigned long old = *p;

 *p = old ^ mask;
 return (old & mask) != 0;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_bit(int nr, const volatile unsigned long *addr)
{
 return 1UL & (addr[((nr) / 64)] >> (nr & (64 -1)));
}
# 26 "./arch/sparc/include/asm/bitops_64.h" 2

# 1 "include/asm-generic/bitops/fls.h" 1
# 12 "include/asm-generic/bitops/fls.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int fls(int x)
{
 int r = 32;

 if (!x)
  return 0;
 if (!(x & 0xffff0000u)) {
  x <<= 16;
  r -= 16;
 }
 if (!(x & 0xff000000u)) {
  x <<= 8;
  r -= 8;
 }
 if (!(x & 0xf0000000u)) {
  x <<= 4;
  r -= 4;
 }
 if (!(x & 0xc0000000u)) {
  x <<= 2;
  r -= 2;
 }
 if (!(x & 0x80000000u)) {
  x <<= 1;
  r -= 1;
 }
 return r;
}
# 28 "./arch/sparc/include/asm/bitops_64.h" 2
# 1 "include/asm-generic/bitops/__fls.h" 1



# 1 "arch/sparc/include/generated/asm/types.h" 1
# 5 "include/asm-generic/bitops/__fls.h" 2







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) unsigned long __fls(unsigned long word)
{
 int num = 64 - 1;


 if (!(word & (~0ul << 32))) {
  num -= 32;
  word <<= 32;
 }

 if (!(word & (~0ul << (64 -16)))) {
  num -= 16;
  word <<= 16;
 }
 if (!(word & (~0ul << (64 -8)))) {
  num -= 8;
  word <<= 8;
 }
 if (!(word & (~0ul << (64 -4)))) {
  num -= 4;
  word <<= 4;
 }
 if (!(word & (~0ul << (64 -2)))) {
  num -= 2;
  word <<= 2;
 }
 if (!(word & (~0ul << (64 -1))))
  num -= 1;
 return num;
}
# 29 "./arch/sparc/include/asm/bitops_64.h" 2
# 1 "include/asm-generic/bitops/fls64.h" 1



# 1 "arch/sparc/include/generated/asm/types.h" 1
# 5 "include/asm-generic/bitops/fls64.h" 2
# 26 "include/asm-generic/bitops/fls64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int fls64(__u64 x)
{
 if (x == 0)
  return 0;
 return __fls(x) + 1;
}
# 30 "./arch/sparc/include/asm/bitops_64.h" 2



int ffs(int x);
unsigned long __ffs(unsigned long);

# 1 "include/asm-generic/bitops/ffz.h" 1
# 37 "./arch/sparc/include/asm/bitops_64.h" 2
# 1 "include/asm-generic/bitops/sched.h" 1




# 1 "arch/sparc/include/generated/asm/types.h" 1
# 6 "include/asm-generic/bitops/sched.h" 2






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sched_find_first_bit(const unsigned long *b)
{

 if (b[0])
  return __ffs(b[0]);
 return __ffs(b[1]) + 64;
# 29 "include/asm-generic/bitops/sched.h"
}
# 38 "./arch/sparc/include/asm/bitops_64.h" 2






unsigned long __arch_hweight64(__u64 w);
unsigned int __arch_hweight32(unsigned int w);
unsigned int __arch_hweight16(unsigned int w);
unsigned int __arch_hweight8(unsigned int w);

# 1 "include/asm-generic/bitops/const_hweight.h" 1
# 50 "./arch/sparc/include/asm/bitops_64.h" 2
# 1 "include/asm-generic/bitops/lock.h" 1
# 51 "./arch/sparc/include/asm/bitops_64.h" 2


# 1 "include/asm-generic/bitops/find.h" 1
# 14 "include/asm-generic/bitops/find.h"
extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
  size, unsigned long offset);
# 28 "include/asm-generic/bitops/find.h"
extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
  long size, unsigned long offset);
# 54 "./arch/sparc/include/asm/bitops_64.h" 2



# 1 "include/asm-generic/bitops/le.h" 1



# 1 "arch/sparc/include/generated/asm/types.h" 1
# 5 "include/asm-generic/bitops/le.h" 2
# 34 "include/asm-generic/bitops/le.h"
extern unsigned long find_next_zero_bit_le(const void *addr,
  unsigned long size, unsigned long offset);



extern unsigned long find_next_bit_le(const void *addr,
  unsigned long size, unsigned long offset);
# 52 "include/asm-generic/bitops/le.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_bit_le(int nr, const void *addr)
{
 return test_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_bit_le(int nr, void *addr)
{
 set_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_bit_le(int nr, void *addr)
{
 clear_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __set_bit_le(int nr, void *addr)
{
 __set_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __clear_bit_le(int nr, void *addr)
{
 __clear_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_set_bit_le(int nr, void *addr)
{
 return test_and_set_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_clear_bit_le(int nr, void *addr)
{
 return test_and_clear_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_set_bit_le(int nr, void *addr)
{
 return __test_and_set_bit(nr ^ ((64 -1) & ~0x7), addr);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_clear_bit_le(int nr, void *addr)
{
 return __test_and_clear_bit(nr ^ ((64 -1) & ~0x7), addr);
}
# 58 "./arch/sparc/include/asm/bitops_64.h" 2

# 1 "include/asm-generic/bitops/ext2-atomic-setbit.h" 1
# 60 "./arch/sparc/include/asm/bitops_64.h" 2
# 5 "./arch/sparc/include/asm/bitops.h" 2
# 37 "include/linux/bitops.h" 2
# 60 "include/linux/bitops.h"
static __inline__ __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_bitmask_order(unsigned int count)
{
 int order;

 order = fls(count);
 return order;
}

static __inline__ __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_count_order(unsigned int count)
{
 int order;

 order = fls(count) - 1;
 if (count & (count - 1))
  order++;
 return order;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long hweight_long(unsigned long w)
{
 return sizeof(w) == 4 ? (__builtin_constant_p(w) ? ((((unsigned int) ((!!((w) & (1ULL << 0))) + (!!((w) & (1ULL << 1))) + (!!((w) & (1ULL << 2))) + (!!((w) & (1ULL << 3))) + (!!((w) & (1ULL << 4))) + (!!((w) & (1ULL << 5))) + (!!((w) & (1ULL << 6))) + (!!((w) & (1ULL << 7))))) + ((unsigned int) ((!!(((w) >> 8) & (1ULL << 0))) + (!!(((w) >> 8) & (1ULL << 1))) + (!!(((w) >> 8) & (1ULL << 2))) + (!!(((w) >> 8) & (1ULL << 3))) + (!!(((w) >> 8) & (1ULL << 4))) + (!!(((w) >> 8) & (1ULL << 5))) + (!!(((w) >> 8) & (1ULL << 6))) + (!!(((w) >> 8) & (1ULL << 7)))))) + (((unsigned int) ((!!(((w) >> 16) & (1ULL << 0))) + (!!(((w) >> 16) & (1ULL << 1))) + (!!(((w) >> 16) & (1ULL << 2))) + (!!(((w) >> 16) & (1ULL << 3))) + (!!(((w) >> 16) & (1ULL << 4))) + (!!(((w) >> 16) & (1ULL << 5))) + (!!(((w) >> 16) & (1ULL << 6))) + (!!(((w) >> 16) & (1ULL << 7))))) + ((unsigned int) ((!!((((w) >> 16) >> 8) & (1ULL << 0))) + (!!((((w) >> 16) >> 8) & (1ULL << 1))) + (!!((((w) >> 16) >> 8) & (1ULL << 2))) + (!!((((w) >> 16) >> 8) & (1ULL << 3))) + (!!((((w) >> 16) >> 8) & (1ULL << 4))) + (!!((((w) >> 16) >> 8) & (1ULL << 5))) + (!!((((w) >> 16) >> 8) & (1ULL << 6))) + (!!((((w) >> 16) >> 8) & (1ULL << 7))))))) : __arch_hweight32(w)) : (__builtin_constant_p(w) ? (((((unsigned int) ((!!((w) & (1ULL << 0))) + (!!((w) & (1ULL << 1))) + (!!((w) & (1ULL << 2))) + (!!((w) & (1ULL << 3))) + (!!((w) & (1ULL << 4))) + (!!((w) & (1ULL << 5))) + (!!((w) & (1ULL << 6))) + (!!((w) & (1ULL << 7))))) + ((unsigned int) ((!!(((w) >> 8) & (1ULL << 0))) + (!!(((w) >> 8) & (1ULL << 1))) + (!!(((w) >> 8) & (1ULL << 2))) + (!!(((w) >> 8) & (1ULL << 3))) + (!!(((w) >> 8) & (1ULL << 4))) + (!!(((w) >> 8) & (1ULL << 5))) + (!!(((w) >> 8) & (1ULL << 6))) + (!!(((w) >> 8) & (1ULL << 7)))))) + (((unsigned int) ((!!(((w) >> 16) & (1ULL << 0))) + (!!(((w) >> 16) & (1ULL << 1))) + (!!(((w) >> 16) & (1ULL << 2))) + (!!(((w) >> 16) & (1ULL << 3))) + (!!(((w) >> 16) & (1ULL << 4))) + (!!(((w) >> 16) & (1ULL << 5))) + (!!(((w) >> 16) & (1ULL << 6))) + (!!(((w) >> 16) & (1ULL << 7))))) + ((unsigned int) ((!!((((w) >> 16) >> 8) & (1ULL << 0))) + (!!((((w) >> 16) >> 8) & (1ULL << 1))) + (!!((((w) >> 16) >> 8) & (1ULL << 2))) + (!!((((w) >> 16) >> 8) & (1ULL << 3))) + (!!((((w) >> 16) >> 8) & (1ULL << 4))) + (!!((((w) >> 16) >> 8) & (1ULL << 5))) + (!!((((w) >> 16) >> 8) & (1ULL << 6))) + (!!((((w) >> 16) >> 8) & (1ULL << 7))))))) + ((((unsigned int) ((!!(((w) >> 32) & (1ULL << 0))) + (!!(((w) >> 32) & (1ULL << 1))) + (!!(((w) >> 32) & (1ULL << 2))) + (!!(((w) >> 32) & (1ULL << 3))) + (!!(((w) >> 32) & (1ULL << 4))) + (!!(((w) >> 32) & (1ULL << 5))) + (!!(((w) >> 32) & (1ULL << 6))) + (!!(((w) >> 32) & (1ULL << 7))))) + ((unsigned int) ((!!((((w) >> 32) >> 8) & (1ULL << 0))) + (!!((((w) >> 32) >> 8) & (1ULL << 1))) + (!!((((w) >> 32) >> 8) & (1ULL << 2))) + (!!((((w) >> 32) >> 8) & (1ULL << 3))) + (!!((((w) >> 32) >> 8) & (1ULL << 4))) + (!!((((w) >> 32) >> 8) & (1ULL << 5))) + (!!((((w) >> 32) >> 8) & (1ULL << 6))) + (!!((((w) >> 32) >> 8) & (1ULL << 7)))))) + (((unsigned int) ((!!((((w) >> 32) >> 16) & (1ULL << 0))) + (!!((((w) >> 32) >> 16) & (1ULL << 1))) + (!!((((w) >> 32) >> 16) & (1ULL << 2))) + (!!((((w) >> 32) >> 16) & (1ULL << 3))) + (!!((((w) >> 32) >> 16) & (1ULL << 4))) + (!!((((w) >> 32) >> 16) & (1ULL << 5))) + (!!((((w) >> 32) >> 16) & (1ULL << 6))) + (!!((((w) >> 32) >> 16) & (1ULL << 7))))) + ((unsigned int) ((!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 0))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 1))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 2))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 3))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 4))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 5))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 6))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 7)))))))) : __arch_hweight64(w));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 rol64(__u64 word, unsigned int shift)
{
 return (word << shift) | (word >> (64 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 ror64(__u64 word, unsigned int shift)
{
 return (word >> shift) | (word << (64 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 rol32(__u32 word, unsigned int shift)
{
 return (word << shift) | (word >> (32 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 ror32(__u32 word, unsigned int shift)
{
 return (word >> shift) | (word << (32 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 rol16(__u16 word, unsigned int shift)
{
 return (word << shift) | (word >> (16 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 ror16(__u16 word, unsigned int shift)
{
 return (word >> shift) | (word << (16 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u8 rol8(__u8 word, unsigned int shift)
{
 return (word << shift) | (word >> (8 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u8 ror8(__u8 word, unsigned int shift)
{
 return (word >> shift) | (word << (8 - shift));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __s32 sign_extend32(__u32 value, int index)
{
 __u8 shift = 31 - index;
 return (__s32)(value << shift) >> shift;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned fls_long(unsigned long l)
{
 if (sizeof(l) == 4)
  return fls(l);
 return fls64(l);
}
# 189 "include/linux/bitops.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __ffs64(u64 word)
{






 return __ffs((unsigned long)word);
}
# 225 "include/linux/bitops.h"
extern unsigned long find_last_bit(const unsigned long *addr,
       unsigned long size);
# 11 "include/linux/kernel.h" 2
# 1 "include/linux/log2.h" 1
# 21 "include/linux/log2.h"
extern __attribute__((const, noreturn))
int ____ilog2_NaN(void);
# 31 "include/linux/log2.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
int __ilog2_u32(u32 n)
{
 return fls(n) - 1;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
int __ilog2_u64(u64 n)
{
 return fls64(n) - 1;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
bool is_power_of_2(unsigned long n)
{
 return (n != 0 && ((n & (n - 1)) == 0));
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
unsigned long __roundup_pow_of_two(unsigned long n)
{
 return 1UL << fls_long(n - 1);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
unsigned long __rounddown_pow_of_two(unsigned long n)
{
 return 1UL << (fls_long(n) - 1);
}
# 12 "include/linux/kernel.h" 2
# 1 "include/linux/typecheck.h" 1
# 13 "include/linux/kernel.h" 2
# 1 "include/linux/printk.h" 1




# 1 "include/linux/init.h" 1
# 135 "include/linux/init.h"
typedef int (*initcall_t)(void);
typedef void (*exitcall_t)(void);

extern initcall_t __con_initcall_start[], __con_initcall_end[];
extern initcall_t __security_initcall_start[], __security_initcall_end[];


typedef void (*ctor_fn_t)(void);


extern int do_one_initcall(initcall_t fn);
extern char __attribute__ ((__section__(".init.data"))) boot_command_line[];
extern char *saved_command_line;
extern unsigned int reset_devices;


void setup_arch(char **);
void prepare_namespace(void);
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) load_default_modules(void);
int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) init_rootfs(void);

extern void (*late_time_init)(void);

extern bool initcall_debug;
# 243 "include/linux/init.h"
struct obs_kernel_param {
 const char *str;
 int (*setup_func)(char *);
 int early;
};
# 272 "include/linux/init.h"
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) parse_early_param(void);
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) parse_early_options(char *cmdline);
# 6 "include/linux/printk.h" 2
# 1 "include/linux/kern_levels.h" 1
# 7 "include/linux/printk.h" 2

# 1 "include/linux/cache.h" 1



# 1 "include/uapi/linux/kernel.h" 1



# 1 "./include/uapi/linux/sysinfo.h" 1






struct sysinfo {
 __kernel_long_t uptime;
 __kernel_ulong_t loads[3];
 __kernel_ulong_t totalram;
 __kernel_ulong_t freeram;
 __kernel_ulong_t sharedram;
 __kernel_ulong_t bufferram;
 __kernel_ulong_t totalswap;
 __kernel_ulong_t freeswap;
 __u16 procs;
 __u16 pad;
 __kernel_ulong_t totalhigh;
 __kernel_ulong_t freehigh;
 __u32 mem_unit;
 char _f[20-2*sizeof(__kernel_ulong_t)-sizeof(__u32)];
};
# 5 "include/uapi/linux/kernel.h" 2
# 5 "include/linux/cache.h" 2
# 1 "./arch/sparc/include/asm/cache.h" 1
# 6 "include/linux/cache.h" 2
# 9 "include/linux/printk.h" 2

extern const char linux_banner[];
extern const char linux_proc_banner[];

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int printk_get_level(const char *buffer)
{
 if (buffer[0] == '\001' && buffer[1]) {
  switch (buffer[1]) {
  case '0' ... '7':
  case 'd':
   return buffer[1];
  }
 }
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *printk_skip_level(const char *buffer)
{
 if (printk_get_level(buffer))
  return buffer + 2;

 return buffer;
}
# 44 "include/linux/printk.h"
extern int console_printk[];






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void console_silent(void)
{
 (console_printk[0]) = 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void console_verbose(void)
{
 if ((console_printk[0]))
  (console_printk[0]) = 15;
}

struct va_format {
 const char *fmt;
 va_list *va;
};
# 109 "include/linux/printk.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((format(printf, 1, 2)))
int no_printk(const char *fmt, ...)
{
 return 0;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((format(printf, 1, 2))) __attribute__((__cold__))
void early_printk(const char *s, ...) { }


typedef int(*printk_func_t)(const char *fmt, va_list args);


 __attribute__((format(printf, 5, 0)))
int vprintk_emit(int facility, int level,
   const char *dict, size_t dictlen,
   const char *fmt, va_list args);

 __attribute__((format(printf, 1, 0)))
int vprintk(const char *fmt, va_list args);

 __attribute__((format(printf, 5, 6))) __attribute__((__cold__))
int printk_emit(int facility, int level,
  const char *dict, size_t dictlen,
  const char *fmt, ...);

 __attribute__((format(printf, 1, 2))) __attribute__((__cold__))
int printk(const char *fmt, ...);




__attribute__((format(printf, 1, 2))) __attribute__((__cold__)) int printk_deferred(const char *fmt, ...);






extern int __printk_ratelimit(const char *func);

extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
       unsigned int interval_msec);

extern int printk_delay_msec;
extern int dmesg_restrict;
extern int kptr_restrict;

extern void wake_up_klogd(void);

char *log_buf_addr_get(void);
u32 log_buf_len_get(void);
void log_buf_kexec_setup(void);
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) setup_log_buf(int early);
void dump_stack_set_arch_desc(const char *fmt, ...);
void dump_stack_print_info(const char *log_lvl);
void show_regs_print_info(const char *log_lvl);
# 231 "include/linux/printk.h"
extern void dump_stack(void) __attribute__((__cold__));
# 270 "include/linux/printk.h"
# 1 "include/linux/dynamic_debug.h" 1
# 9 "include/linux/dynamic_debug.h"
struct _ddebug {




 const char *modname;
 const char *function;
 const char *filename;
 const char *format;
 unsigned int lineno:18;
# 35 "include/linux/dynamic_debug.h"
 unsigned int flags:8;
} __attribute__((aligned(8)));


int ddebug_add_module(struct _ddebug *tab, unsigned int n,
    const char *modname);
# 111 "include/linux/dynamic_debug.h"
# 1 "include/linux/string.h" 1
# 9 "include/linux/string.h"
# 1 "include/uapi/linux/string.h" 1
# 10 "include/linux/string.h" 2

extern char *strndup_user(const char *, long);
extern void *memdup_user(const void *, size_t);




# 1 "./arch/sparc/include/asm/string.h" 1



# 1 "./arch/sparc/include/asm/string_64.h" 1
# 22 "./arch/sparc/include/asm/string_64.h"
void *memmove(void *, const void *, __kernel_size_t);
# 49 "./arch/sparc/include/asm/string_64.h"
int memcmp(const void *,const void *,__kernel_size_t);



__kernel_size_t strlen(const char *);


int strncmp(const char *, const char *, __kernel_size_t);
# 5 "./arch/sparc/include/asm/string.h" 2
# 18 "include/linux/string.h" 2


extern char * strcpy(char *,const char *);


extern char * strncpy(char *,const char *, __kernel_size_t);


size_t strlcpy(char *, const char *, size_t);


extern char * strcat(char *, const char *);


extern char * strncat(char *, const char *, __kernel_size_t);


extern size_t strlcat(char *, const char *, __kernel_size_t);


extern int strcmp(const char *,const char *);





extern int strcasecmp(const char *s1, const char *s2);


extern int strncasecmp(const char *s1, const char *s2, size_t n);


extern char * strchr(const char *,int);


extern char * strchrnul(const char *,int);


extern char * strnchr(const char *, size_t, int);


extern char * strrchr(const char *,int);

extern char * __attribute__((warn_unused_result)) skip_spaces(const char *);

extern char *strim(char *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((warn_unused_result)) char *strstrip(char *str)
{
 return strim(str);
}


extern char * strstr(const char *, const char *);


extern char * strnstr(const char *, const char *, size_t);





extern __kernel_size_t strnlen(const char *,__kernel_size_t);


extern char * strpbrk(const char *,const char *);


extern char * strsep(char **,const char *);


extern __kernel_size_t strspn(const char *,const char *);


extern __kernel_size_t strcspn(const char *,const char *);
# 111 "include/linux/string.h"
extern void * memchr(const void *,int,__kernel_size_t);

void *memchr_inv(const void *s, int c, size_t n);

extern void kfree_const(const void *x);

extern char *kstrdup(const char *s, gfp_t gfp);
extern const char *kstrdup_const(const char *s, gfp_t gfp);
extern char *kstrndup(const char *s, size_t len, gfp_t gfp);
extern void *kmemdup(const void *src, size_t len, gfp_t gfp);

extern char **argv_split(gfp_t gfp, const char *str, int *argcp);
extern void argv_free(char **argv);

extern bool sysfs_streq(const char *s1, const char *s2);
extern int strtobool(const char *s, bool *res);


int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args);
int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf);
int bprintf(u32 *bin_buf, size_t size, const char *fmt, ...) __attribute__((format(printf, 3, 4)));


extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
           const void *from, size_t available);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool strstarts(const char *str, const char *prefix)
{
 return strncmp(str, prefix, strlen(prefix)) == 0;
}

size_t memweight(const void *ptr, size_t bytes);
void memzero_explicit(void *s, size_t count);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *kbasename(const char *path)
{
 const char *tail = strrchr(path, '/');
 return tail ? tail + 1 : path;
}
# 112 "include/linux/dynamic_debug.h" 2
# 1 "include/linux/errno.h" 1



# 1 "include/uapi/linux/errno.h" 1
# 1 "./arch/sparc/include/uapi/asm/errno.h" 1





# 1 "./include/uapi/asm-generic/errno-base.h" 1
# 7 "./arch/sparc/include/uapi/asm/errno.h" 2
# 1 "include/uapi/linux/errno.h" 2
# 5 "include/linux/errno.h" 2
# 113 "include/linux/dynamic_debug.h" 2

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ddebug_remove_module(const char *mod)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ddebug_dyndbg_module_param_cb(char *param, char *val,
      const char *modname)
{
 if (strstr(param, "dyndbg")) {

  printk("\001" "4" "dyndbg param is supported only in "
   "CONFIG_DYNAMIC_DEBUG builds\n");
  return 0;
 }
 return -22;
}
# 271 "include/linux/printk.h" 2
# 413 "include/linux/printk.h"
extern const struct file_operations kmsg_fops;

enum {
 DUMP_PREFIX_NONE,
 DUMP_PREFIX_ADDRESS,
 DUMP_PREFIX_OFFSET
};
extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize,
         int groupsize, char *linebuf, size_t linebuflen,
         bool ascii);

extern void print_hex_dump(const char *level, const char *prefix_str,
      int prefix_type, int rowsize, int groupsize,
      const void *buf, size_t len, bool ascii);




extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
     const void *buf, size_t len);
# 14 "include/linux/kernel.h" 2
# 153 "include/linux/kernel.h"
struct completion;
struct pt_regs;
struct user;


extern int _cond_resched(void);
# 181 "include/linux/kernel.h"
  static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ___might_sleep(const char *file, int line,
       int preempt_offset) { }
  static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __might_sleep(const char *file, int line,
       int preempt_offset) { }
# 228 "include/linux/kernel.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 reciprocal_scale(u32 val, u32 ep_ro)
{
 return (u32)(((u64) val * ep_ro) >> 32);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void might_fault(void) { }


extern struct atomic_notifier_head panic_notifier_list;
extern long (*panic_blink)(int state);
__attribute__((format(printf, 1, 2)))
void panic(const char *fmt, ...)
 __attribute__((noreturn)) __attribute__((__cold__));
extern void oops_enter(void);
extern void oops_exit(void);
void print_oops_end_marker(void);
extern int oops_may_print(void);
void do_exit(long error_code)
 __attribute__((noreturn));
void complete_and_exit(struct completion *, long)
 __attribute__((noreturn));


int __attribute__((warn_unused_result)) _kstrtoul(const char *s, unsigned int base, unsigned long *res);
int __attribute__((warn_unused_result)) _kstrtol(const char *s, unsigned int base, long *res);

int __attribute__((warn_unused_result)) kstrtoull(const char *s, unsigned int base, unsigned long long *res);
int __attribute__((warn_unused_result)) kstrtoll(const char *s, unsigned int base, long long *res);
# 277 "include/linux/kernel.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtoul(const char *s, unsigned int base, unsigned long *res)
{




 if (sizeof(unsigned long) == sizeof(unsigned long long) &&
     __alignof__(unsigned long) == __alignof__(unsigned long long))
  return kstrtoull(s, base, (unsigned long long *)res);
 else
  return _kstrtoul(s, base, res);
}
# 306 "include/linux/kernel.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtol(const char *s, unsigned int base, long *res)
{




 if (sizeof(long) == sizeof(long long) &&
     __alignof__(long) == __alignof__(long long))
  return kstrtoll(s, base, (long long *)res);
 else
  return _kstrtol(s, base, res);
}

int __attribute__((warn_unused_result)) kstrtouint(const char *s, unsigned int base, unsigned int *res);
int __attribute__((warn_unused_result)) kstrtoint(const char *s, unsigned int base, int *res);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtou64(const char *s, unsigned int base, u64 *res)
{
 return kstrtoull(s, base, res);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtos64(const char *s, unsigned int base, s64 *res)
{
 return kstrtoll(s, base, res);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtou32(const char *s, unsigned int base, u32 *res)
{
 return kstrtouint(s, base, res);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtos32(const char *s, unsigned int base, s32 *res)
{
 return kstrtoint(s, base, res);
}

int __attribute__((warn_unused_result)) kstrtou16(const char *s, unsigned int base, u16 *res);
int __attribute__((warn_unused_result)) kstrtos16(const char *s, unsigned int base, s16 *res);
int __attribute__((warn_unused_result)) kstrtou8(const char *s, unsigned int base, u8 *res);
int __attribute__((warn_unused_result)) kstrtos8(const char *s, unsigned int base, s8 *res);

int __attribute__((warn_unused_result)) kstrtoull_from_user(const char *s, size_t count, unsigned int base, unsigned long long *res);
int __attribute__((warn_unused_result)) kstrtoll_from_user(const char *s, size_t count, unsigned int base, long long *res);
int __attribute__((warn_unused_result)) kstrtoul_from_user(const char *s, size_t count, unsigned int base, unsigned long *res);
int __attribute__((warn_unused_result)) kstrtol_from_user(const char *s, size_t count, unsigned int base, long *res);
int __attribute__((warn_unused_result)) kstrtouint_from_user(const char *s, size_t count, unsigned int base, unsigned int *res);
int __attribute__((warn_unused_result)) kstrtoint_from_user(const char *s, size_t count, unsigned int base, int *res);
int __attribute__((warn_unused_result)) kstrtou16_from_user(const char *s, size_t count, unsigned int base, u16 *res);
int __attribute__((warn_unused_result)) kstrtos16_from_user(const char *s, size_t count, unsigned int base, s16 *res);
int __attribute__((warn_unused_result)) kstrtou8_from_user(const char *s, size_t count, unsigned int base, u8 *res);
int __attribute__((warn_unused_result)) kstrtos8_from_user(const char *s, size_t count, unsigned int base, s8 *res);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtou64_from_user(const char *s, size_t count, unsigned int base, u64 *res)
{
 return kstrtoull_from_user(s, count, base, res);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtos64_from_user(const char *s, size_t count, unsigned int base, s64 *res)
{
 return kstrtoll_from_user(s, count, base, res);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtou32_from_user(const char *s, size_t count, unsigned int base, u32 *res)
{
 return kstrtouint_from_user(s, count, base, res);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtos32_from_user(const char *s, size_t count, unsigned int base, s32 *res)
{
 return kstrtoint_from_user(s, count, base, res);
}



extern unsigned long simple_strtoul(const char *,char **,unsigned int);
extern long simple_strtol(const char *,char **,unsigned int);
extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
extern long long simple_strtoll(const char *,char **,unsigned int);

extern int num_to_str(char *buf, int size, unsigned long long num);



extern __attribute__((format(printf, 2, 3))) int sprintf(char *buf, const char * fmt, ...);
extern __attribute__((format(printf, 2, 0))) int vsprintf(char *buf, const char *, va_list);
extern __attribute__((format(printf, 3, 4)))
int snprintf(char *buf, size_t size, const char *fmt, ...);
extern __attribute__((format(printf, 3, 0)))
int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
extern __attribute__((format(printf, 3, 4)))
int scnprintf(char *buf, size_t size, const char *fmt, ...);
extern __attribute__((format(printf, 3, 0)))
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
extern __attribute__((format(printf, 2, 3)))
char *kasprintf(gfp_t gfp, const char *fmt, ...);
extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args);

extern __attribute__((format(scanf, 2, 3)))
int sscanf(const char *, const char *, ...);
extern __attribute__((format(scanf, 2, 0)))
int vsscanf(const char *, const char *, va_list);

extern int get_option(char **str, int *pint);
extern char *get_options(const char *str, int nints, int *ints);
extern unsigned long long memparse(const char *ptr, char **retptr);
extern bool parse_option_str(const char *str, const char *option);

extern int core_kernel_text(unsigned long addr);
extern int core_kernel_data(unsigned long addr);
extern int __kernel_text_address(unsigned long addr);
extern int kernel_text_address(unsigned long addr);
extern int func_ptr_is_kernel_text(void *ptr);

unsigned long int_sqrt(unsigned long);

extern void bust_spinlocks(int yes);
extern int oops_in_progress;
extern int panic_timeout;
extern int panic_on_oops;
extern int panic_on_unrecovered_nmi;
extern int panic_on_io_nmi;
extern int panic_on_warn;
extern int sysctl_panic_on_stackoverflow;




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_arch_panic_timeout(int timeout, int arch_default_timeout)
{
 if (panic_timeout == arch_default_timeout)
  panic_timeout = timeout;
}
extern const char *print_tainted(void);
enum lockdep_ok {
 LOCKDEP_STILL_OK,
 LOCKDEP_NOW_UNRELIABLE
};
extern void add_taint(unsigned flag, enum lockdep_ok);
extern int test_taint(unsigned flag);
extern unsigned long get_taint(void);
extern int root_mountflags;

extern bool early_boot_irqs_disabled;


extern enum system_states {
 SYSTEM_BOOTING,
 SYSTEM_RUNNING,
 SYSTEM_HALT,
 SYSTEM_POWER_OFF,
 SYSTEM_RESTART,
} system_state;
# 476 "include/linux/kernel.h"
extern const char hex_asc[];



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) char *hex_byte_pack(char *buf, u8 byte)
{
 *buf++ = hex_asc[((byte) & 0xf0) >> 4];
 *buf++ = hex_asc[((byte) & 0x0f)];
 return buf;
}

extern const char hex_asc_upper[];



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) char *hex_byte_pack_upper(char *buf, u8 byte)
{
 *buf++ = hex_asc_upper[((byte) & 0xf0) >> 4];
 *buf++ = hex_asc_upper[((byte) & 0x0f)];
 return buf;
}

extern int hex_to_bin(char ch);
extern int __attribute__((warn_unused_result)) hex2bin(u8 *dst, const char *src, size_t count);
extern char *bin2hex(char *dst, const void *src, size_t count);

bool mac_pton(const char *s, u8 *mac);
# 525 "include/linux/kernel.h"
void tracing_off_permanent(void);




enum ftrace_dump_mode {
 DUMP_NONE,
 DUMP_ALL,
 DUMP_ORIG,
};


void tracing_on(void);
void tracing_off(void);
int tracing_is_on(void);
void tracing_snapshot(void);
void tracing_snapshot_alloc(void);

extern void tracing_start(void);
extern void tracing_stop(void);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((format(printf, 1, 2)))
void ____trace_printk_check_format(const char *fmt, ...)
{
}
# 609 "include/linux/kernel.h"
extern __attribute__((format(printf, 2, 3)))
int __trace_bprintk(unsigned long ip, const char *fmt, ...);

extern __attribute__((format(printf, 2, 3)))
int __trace_printk(unsigned long ip, const char *fmt, ...);
# 650 "include/linux/kernel.h"
extern int __trace_bputs(unsigned long ip, const char *str);
extern int __trace_puts(unsigned long ip, const char *str, int size);

extern void trace_dump_stack(int skip);
# 672 "include/linux/kernel.h"
extern int
__ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap);

extern int
__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);

extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
# 18 "include/linux/sched.h" 2

# 1 "include/linux/timex.h" 1
# 56 "include/linux/timex.h"
# 1 "include/uapi/linux/timex.h" 1
# 56 "include/uapi/linux/timex.h"
# 1 "include/linux/time.h" 1




# 1 "include/linux/seqlock.h" 1
# 35 "include/linux/seqlock.h"
# 1 "include/linux/spinlock.h" 1
# 50 "include/linux/spinlock.h"
# 1 "include/linux/preempt.h" 1
# 10 "include/linux/preempt.h"
# 1 "include/linux/list.h" 1





# 1 "include/linux/poison.h" 1
# 7 "include/linux/list.h" 2
# 1 "./include/uapi/linux/const.h" 1
# 8 "include/linux/list.h" 2
# 25 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void INIT_LIST_HEAD(struct list_head *list)
{
 list->next = list;
 list->prev = list;
}
# 38 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_add(struct list_head *new,
         struct list_head *prev,
         struct list_head *next)
{
 next->prev = new;
 new->next = next;
 new->prev = prev;
 prev->next = new;
}
# 61 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_add(struct list_head *new, struct list_head *head)
{
 __list_add(new, head, head->next);
}
# 75 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_add_tail(struct list_head *new, struct list_head *head)
{
 __list_add(new, head->prev, head);
}
# 87 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_del(struct list_head * prev, struct list_head * next)
{
 next->prev = prev;
 prev->next = next;
}
# 100 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_del_entry(struct list_head *entry)
{
 __list_del(entry->prev, entry->next);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_del(struct list_head *entry)
{
 __list_del(entry->prev, entry->next);
 entry->next = ((void *) 0x00100100 + 0);
 entry->prev = ((void *) 0x00200200 + 0);
}
# 123 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_replace(struct list_head *old,
    struct list_head *new)
{
 new->next = old->next;
 new->next->prev = new;
 new->prev = old->prev;
 new->prev->next = new;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_replace_init(struct list_head *old,
     struct list_head *new)
{
 list_replace(old, new);
 INIT_LIST_HEAD(old);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_del_init(struct list_head *entry)
{
 __list_del_entry(entry);
 INIT_LIST_HEAD(entry);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_move(struct list_head *list, struct list_head *head)
{
 __list_del_entry(list);
 list_add(list, head);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_move_tail(struct list_head *list,
      struct list_head *head)
{
 __list_del_entry(list);
 list_add_tail(list, head);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int list_is_last(const struct list_head *list,
    const struct list_head *head)
{
 return list->next == head;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int list_empty(const struct list_head *head)
{
 return head->next == head;
}
# 205 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int list_empty_careful(const struct list_head *head)
{
 struct list_head *next = head->next;
 return (next == head) && (next == head->prev);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_rotate_left(struct list_head *head)
{
 struct list_head *first;

 if (!list_empty(head)) {
  first = head->next;
  list_move_tail(first, head);
 }
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int list_is_singular(const struct list_head *head)
{
 return !list_empty(head) && (head->next == head->prev);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_cut_position(struct list_head *list,
  struct list_head *head, struct list_head *entry)
{
 struct list_head *new_first = entry->next;
 list->next = head->next;
 list->next->prev = list;
 list->prev = entry;
 entry->next = list;
 head->next = new_first;
 new_first->prev = head;
}
# 260 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_cut_position(struct list_head *list,
  struct list_head *head, struct list_head *entry)
{
 if (list_empty(head))
  return;
 if (list_is_singular(head) &&
  (head->next != entry && head != entry))
  return;
 if (entry == head)
  INIT_LIST_HEAD(list);
 else
  __list_cut_position(list, head, entry);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_splice(const struct list_head *list,
     struct list_head *prev,
     struct list_head *next)
{
 struct list_head *first = list->next;
 struct list_head *last = list->prev;

 first->prev = prev;
 prev->next = first;

 last->next = next;
 next->prev = last;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice(const struct list_head *list,
    struct list_head *head)
{
 if (!list_empty(list))
  __list_splice(list, head, head->next);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice_tail(struct list_head *list,
    struct list_head *head)
{
 if (!list_empty(list))
  __list_splice(list, head->prev, head);
}
# 319 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice_init(struct list_head *list,
        struct list_head *head)
{
 if (!list_empty(list)) {
  __list_splice(list, head, head->next);
  INIT_LIST_HEAD(list);
 }
}
# 336 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice_tail_init(struct list_head *list,
      struct list_head *head)
{
 if (!list_empty(list)) {
  __list_splice(list, head->prev, head);
  INIT_LIST_HEAD(list);
 }
}
# 598 "include/linux/list.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void INIT_HLIST_NODE(struct hlist_node *h)
{
 h->next = ((void *)0);
 h->pprev = ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_unhashed(const struct hlist_node *h)
{
 return !h->pprev;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_empty(const struct hlist_head *h)
{
 return !h->first;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __hlist_del(struct hlist_node *n)
{
 struct hlist_node *next = n->next;
 struct hlist_node **pprev = n->pprev;
 *pprev = next;
 if (next)
  next->pprev = pprev;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_del(struct hlist_node *n)
{
 __hlist_del(n);
 n->next = ((void *) 0x00100100 + 0);
 n->pprev = ((void *) 0x00200200 + 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_del_init(struct hlist_node *n)
{
 if (!hlist_unhashed(n)) {
  __hlist_del(n);
  INIT_HLIST_NODE(n);
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
{
 struct hlist_node *first = h->first;
 n->next = first;
 if (first)
  first->pprev = &n->next;
 h->first = n;
 n->pprev = &h->first;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_before(struct hlist_node *n,
     struct hlist_node *next)
{
 n->pprev = next->pprev;
 n->next = next;
 next->pprev = &n->next;
 *(n->pprev) = n;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_behind(struct hlist_node *n,
        struct hlist_node *prev)
{
 n->next = prev->next;
 prev->next = n;
 n->pprev = &prev->next;

 if (n->next)
  n->next->pprev = &n->next;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_fake(struct hlist_node *n)
{
 n->pprev = &n->next;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_move_list(struct hlist_head *old,
       struct hlist_head *new)
{
 new->first = old->first;
 if (new->first)
  new->first->pprev = &new->first;
 old->first = ((void *)0);
}
# 11 "include/linux/preempt.h" 2







# 1 "arch/sparc/include/generated/asm/preempt.h" 1
# 1 "include/asm-generic/preempt.h" 1



# 1 "include/linux/thread_info.h" 1
# 11 "include/linux/thread_info.h"
# 1 "include/linux/bug.h" 1



# 1 "./arch/sparc/include/asm/bug.h" 1







void do_BUG(const char *file, int line);
# 20 "./arch/sparc/include/asm/bug.h"
# 1 "include/asm-generic/bug.h" 1
# 65 "include/asm-generic/bug.h"
extern __attribute__((format(printf, 3, 4)))
void warn_slowpath_fmt(const char *file, const int line,
         const char *fmt, ...);
extern __attribute__((format(printf, 4, 5)))
void warn_slowpath_fmt_taint(const char *file, const int line, unsigned taint,
        const char *fmt, ...);
extern void warn_slowpath_null(const char *file, const int line);
# 21 "./arch/sparc/include/asm/bug.h" 2

struct pt_regs;
void __attribute__((noreturn)) die_if_kernel(char *str, struct pt_regs *regs);
# 5 "include/linux/bug.h" 2


enum bug_trap_type {
 BUG_TRAP_TYPE_NONE = 0,
 BUG_TRAP_TYPE_WARN = 1,
 BUG_TRAP_TYPE_BUG = 2,
};

struct pt_regs;
# 105 "include/linux/bug.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum bug_trap_type report_bug(unsigned long bug_addr,
         struct pt_regs *regs)
{
 return BUG_TRAP_TYPE_BUG;
}
# 12 "include/linux/thread_info.h" 2

struct timespec;
struct compat_timespec;




struct restart_block {
 long (*fn)(struct restart_block *);
 union {

  struct {
   u32 *uaddr;
   u32 val;
   u32 flags;
   u32 bitset;
   u64 time;
   u32 *uaddr2;
  } futex;

  struct {
   clockid_t clockid;
   struct timespec *rmtp;

   struct compat_timespec *compat_rmtp;

   u64 expires;
  } nanosleep;

  struct {
   struct pollfd *ufds;
   int nfds;
   int has_timeout;
   unsigned long tv_sec;
   unsigned long tv_nsec;
  } poll;
 };
};

extern long do_no_restart_syscall(struct restart_block *parm);


# 1 "./arch/sparc/include/asm/thread_info.h" 1



# 1 "./arch/sparc/include/asm/thread_info_64.h" 1
# 26 "./arch/sparc/include/asm/thread_info_64.h"
# 1 "./arch/sparc/include/asm/page.h" 1






# 1 "./arch/sparc/include/asm/page_64.h" 1
# 33 "./arch/sparc/include/asm/page_64.h"
struct pt_regs;
void hugetlb_setup(struct pt_regs *regs);




void _clear_page(void *page);

struct page;
void clear_user_page(void *addr, unsigned long vaddr, struct page *page);

void copy_user_page(void *to, void *from, unsigned long vaddr, struct page *topage);
# 57 "./arch/sparc/include/asm/page_64.h"
typedef struct { unsigned long pte; } pte_t;
typedef struct { unsigned long iopte; } iopte_t;
typedef struct { unsigned long pmd; } pmd_t;
typedef struct { unsigned long pud; } pud_t;
typedef struct { unsigned long pgd; } pgd_t;
typedef struct { unsigned long pgprot; } pgprot_t;
# 103 "./arch/sparc/include/asm/page_64.h"
typedef pte_t *pgtable_t;

extern unsigned long sparc64_va_hole_top;
extern unsigned long sparc64_va_hole_bottom;
# 118 "./arch/sparc/include/asm/page_64.h"
# 1 "include/asm-generic/memory_model.h" 1
# 119 "./arch/sparc/include/asm/page_64.h" 2

extern unsigned long PAGE_OFFSET;
# 152 "./arch/sparc/include/asm/page_64.h"
# 1 "include/asm-generic/getorder.h" 1
# 12 "include/asm-generic/getorder.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__))
int __get_order(unsigned long size)
{
 int order;

 size--;
 size >>= 13;



 order = fls64(size);

 return order;
}
# 153 "./arch/sparc/include/asm/page_64.h" 2
# 8 "./arch/sparc/include/asm/page.h" 2
# 27 "./arch/sparc/include/asm/thread_info_64.h" 2



# 1 "./arch/sparc/include/asm/ptrace.h" 1



# 1 "./arch/sparc/include/uapi/asm/ptrace.h" 1





# 1 "./arch/sparc/include/uapi/asm/pstate.h" 1
# 7 "./arch/sparc/include/uapi/asm/ptrace.h" 2
# 21 "./arch/sparc/include/uapi/asm/ptrace.h"
struct pt_regs {
 unsigned long u_regs[16];
 unsigned long tstate;
 unsigned long tpc;
 unsigned long tnpc;
 unsigned int y;
# 39 "./arch/sparc/include/uapi/asm/ptrace.h"
 unsigned int magic;
};

struct pt_regs32 {
 unsigned int psr;
 unsigned int pc;
 unsigned int npc;
 unsigned int y;
 unsigned int u_regs[16];
};


struct reg_window {
 unsigned long locals[8];
 unsigned long ins[8];
};


struct reg_window32 {
 unsigned int locals[8];
 unsigned int ins[8];
};


struct sparc_stackf {
 unsigned long locals[8];
        unsigned long ins[6];
 struct sparc_stackf *fp;
 unsigned long callers_pc;
 char *structptr;
 unsigned long xargs[6];
 unsigned long xxargs[1];
};


struct sparc_stackf32 {
 unsigned int locals[8];
        unsigned int ins[6];
 unsigned int fp;
 unsigned int callers_pc;
 unsigned int structptr;
 unsigned int xargs[6];
 unsigned int xxargs[1];
};

struct sparc_trapf {
 unsigned long locals[8];
 unsigned long ins[8];
 unsigned long _unused;
 struct pt_regs *regs;
};
# 5 "./arch/sparc/include/asm/ptrace.h" 2





# 1 "./arch/sparc/include/asm/switch_to.h" 1



# 1 "./arch/sparc/include/asm/switch_to_64.h" 1



# 1 "./arch/sparc/include/asm/visasm.h" 1
# 10 "./arch/sparc/include/asm/visasm.h"
# 1 "./arch/sparc/include/asm/ptrace.h" 1
# 11 "./arch/sparc/include/asm/visasm.h" 2
# 54 "./arch/sparc/include/asm/visasm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void save_and_clear_fpu(void) {
 __asm__ __volatile__ (
"		rd %%fprs, %%o5\n"
"		andcc %%o5, %0, %%g0\n"
"		be,pt %%icc, 299f\n"
"		 sethi %%hi(298f), %%g7\n"
"		sethi %%hi(VISenter), %%g1\n"
"		jmpl %%g1 + %%lo(VISenter), %%g0\n"
"		 or %%g7, %%lo(298f), %%g7\n"
"	298:	wr %%g0, 0, %%fprs\n"
"	299:\n"
"		" : : "i" ((0x0000000000000004UL)|(0x0000000000000002UL)) :
  "o5", "g1", "g2", "g3", "g7", "cc");
}

int vis_emul(struct pt_regs *, unsigned int);
# 5 "./arch/sparc/include/asm/switch_to_64.h" 2
# 68 "./arch/sparc/include/asm/switch_to_64.h"
void synchronize_user_stack(void);
void fault_in_user_windows(void);
# 5 "./arch/sparc/include/asm/switch_to.h" 2
# 11 "./arch/sparc/include/asm/ptrace.h" 2

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pt_regs_trap_type(struct pt_regs *regs)
{
 return regs->magic & 0x1ff;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pt_regs_is_syscall(struct pt_regs *regs)
{
 return (regs->tstate & (0x0000000000000020UL));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pt_regs_clear_syscall(struct pt_regs *regs)
{
 return (regs->tstate &= ~(0x0000000000000020UL));
}
# 38 "./arch/sparc/include/asm/ptrace.h"
struct global_reg_snapshot {
 unsigned long tstate;
 unsigned long tpc;
 unsigned long tnpc;
 unsigned long o7;
 unsigned long i7;
 unsigned long rpc;
 struct thread_info *thread;
 unsigned long pad1;
};

struct global_pmu_snapshot {
 unsigned long pcr[4];
 unsigned long pic[4];
};

union global_cpu_snapshot {
 struct global_reg_snapshot reg;
 struct global_pmu_snapshot pmu;
};

extern union global_cpu_snapshot global_cpu_snapshot[128];






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_syscall_success(struct pt_regs *regs)
{
 return !(regs->tstate & ((0x0000001000000000UL) | (0x0000000100000000UL)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long regs_return_value(struct pt_regs *regs)
{
 return regs->u_regs[8];
}

unsigned long profile_pc(struct pt_regs *);
# 31 "./arch/sparc/include/asm/thread_info_64.h" 2
# 1 "arch/sparc/include/generated/asm/types.h" 1
# 32 "./arch/sparc/include/asm/thread_info_64.h" 2

struct task_struct;
struct exec_domain;

struct thread_info {

 struct task_struct *task;
 unsigned long flags;
 __u8 fpsaved[7];
 __u8 status;
 unsigned long ksp;


 unsigned long fault_address;
 struct pt_regs *kregs;
 struct exec_domain *exec_domain;
 int preempt_count;
 __u8 new_child;
 __u8 current_ds;
 __u16 cpu;

 unsigned long *utraps;

 struct reg_window reg_window[7];
 unsigned long rwbuf_stkptrs[7];

 unsigned long gsr[7];
 unsigned long xfsr[7];

 struct pt_regs *kern_una_regs;
 unsigned int kern_una_insn;

 unsigned long fpregs[(7 * 256) / sizeof(unsigned long)]
  __attribute__ ((aligned(64)));
};
# 130 "./arch/sparc/include/asm/thread_info_64.h"
register struct thread_info *current_thread_info_reg asm("g6");
# 233 "./arch/sparc/include/asm/thread_info_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_restore_sigmask(void)
{
 struct thread_info *ti = (current_thread_info_reg);
 ti->status |= 0x0001;
 ({ int __ret_warn_on = !!(!test_bit(2, &ti->flags)); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("./arch/sparc/include/asm/thread_info_64.h", 237); __builtin_expect(!!(__ret_warn_on), 0); });
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_restore_sigmask(void)
{
 (current_thread_info_reg)->status &= ~0x0001;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool test_restore_sigmask(void)
{
 return (current_thread_info_reg)->status & 0x0001;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool test_and_clear_restore_sigmask(void)
{
 struct thread_info *ti = (current_thread_info_reg);
 if (!(ti->status & 0x0001))
  return false;
 ti->status &= ~0x0001;
 return true;
}
# 5 "./arch/sparc/include/asm/thread_info.h" 2
# 55 "include/linux/thread_info.h" 2
# 69 "include/linux/thread_info.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_ti_thread_flag(struct thread_info *ti, int flag)
{
 set_bit(flag, (unsigned long *)&ti->flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_ti_thread_flag(struct thread_info *ti, int flag)
{
 clear_bit(flag, (unsigned long *)&ti->flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_set_ti_thread_flag(struct thread_info *ti, int flag)
{
 return test_and_set_bit(flag, (unsigned long *)&ti->flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag)
{
 return test_and_clear_bit(flag, (unsigned long *)&ti->flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_ti_thread_flag(struct thread_info *ti, int flag)
{
 return test_bit(flag, (unsigned long *)&ti->flags);
}
# 5 "include/asm-generic/preempt.h" 2



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int preempt_count(void)
{
 return (current_thread_info_reg)->preempt_count;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int *preempt_count_ptr(void)
{
 return &(current_thread_info_reg)->preempt_count;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void preempt_count_set(int pc)
{
 *preempt_count_ptr() = pc;
}
# 34 "include/asm-generic/preempt.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void set_preempt_need_resched(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void clear_preempt_need_resched(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool test_preempt_need_resched(void)
{
 return false;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __preempt_count_add(int val)
{
 *preempt_count_ptr() += val;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __preempt_count_sub(int val)
{
 *preempt_count_ptr() -= val;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool __preempt_count_dec_and_test(void)
{





 return !--*preempt_count_ptr() && test_ti_thread_flag((current_thread_info_reg), 3);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool should_resched(void)
{
 return __builtin_expect(!!(!preempt_count() && test_ti_thread_flag((current_thread_info_reg), 3)), 0);
}
# 1 "arch/sparc/include/generated/asm/preempt.h" 2
# 19 "include/linux/preempt.h" 2
# 51 "include/linux/spinlock.h" 2


# 1 "include/linux/irqflags.h" 1
# 15 "include/linux/irqflags.h"
# 1 "./arch/sparc/include/asm/irqflags.h" 1



# 1 "./arch/sparc/include/asm/irqflags_64.h" 1
# 13 "./arch/sparc/include/asm/irqflags_64.h"
# 1 "./arch/sparc/include/asm/pil.h" 1
# 14 "./arch/sparc/include/asm/irqflags_64.h" 2



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) unsigned long arch_local_save_flags(void)
{
 unsigned long flags;

 __asm__ __volatile__(
  "rdpr	%%pil, %0"
  : "=r" (flags)
 );

 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) void arch_local_irq_restore(unsigned long flags)
{
 __asm__ __volatile__(
  "wrpr	%0, %%pil"
  :
  : "r" (flags)
  : "memory"
 );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) void arch_local_irq_disable(void)
{
 __asm__ __volatile__(
  "wrpr	%0, %%pil"
  :
  : "i" (14)
  : "memory"
 );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) void arch_local_irq_enable(void)
{
 __asm__ __volatile__(
  "wrpr	0, %%pil"
  :
  :
  : "memory"
 );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) int arch_irqs_disabled_flags(unsigned long flags)
{
 return (flags > 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) int arch_irqs_disabled(void)
{
 return arch_irqs_disabled_flags(arch_local_save_flags());
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) unsigned long arch_local_irq_save(void)
{
 unsigned long flags, tmp;
# 83 "./arch/sparc/include/asm/irqflags_64.h"
 __asm__ __volatile__(
  "rdpr	%%pil, %0\n\t"
  "or	%0, %2, %1\n\t"
  "wrpr	%1, 0x0, %%pil"
  : "=r" (flags), "=r" (tmp)
  : "i" (14)
  : "memory"
 );

 return flags;
}
# 5 "./arch/sparc/include/asm/irqflags.h" 2
# 16 "include/linux/irqflags.h" 2
# 54 "include/linux/spinlock.h" 2



# 1 "include/linux/bottom_half.h" 1




# 1 "include/linux/preempt_mask.h" 1
# 6 "include/linux/bottom_half.h" 2




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
{
 __preempt_count_add(cnt);
 __asm__ __volatile__("": : :"memory");
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void local_bh_disable(void)
{
 __local_bh_disable_ip(({ __label__ __here; __here: (unsigned long)&&__here; }), (2 * (1UL << (0 + 8))));
}

extern void _local_bh_enable(void);
extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void local_bh_enable_ip(unsigned long ip)
{
 __local_bh_enable_ip(ip, (2 * (1UL << (0 + 8))));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void local_bh_enable(void)
{
 __local_bh_enable_ip(({ __label__ __here; __here: (unsigned long)&&__here; }), (2 * (1UL << (0 + 8))));
}
# 58 "include/linux/spinlock.h" 2
# 81 "include/linux/spinlock.h"
# 1 "include/linux/spinlock_types.h" 1
# 13 "include/linux/spinlock_types.h"
# 1 "./arch/sparc/include/asm/spinlock_types.h" 1







typedef struct {
 volatile unsigned char lock;
} arch_spinlock_t;



typedef struct {
 volatile unsigned int lock;
} arch_rwlock_t;
# 14 "include/linux/spinlock_types.h" 2




# 1 "include/linux/lockdep.h" 1
# 12 "include/linux/lockdep.h"
struct task_struct;
struct lockdep_map;


extern int prove_locking;
extern int lock_stat;
# 373 "include/linux/lockdep.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void lockdep_off(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void lockdep_on(void)
{
}
# 414 "include/linux/lockdep.h"
struct lock_class_key { };
# 469 "include/linux/lockdep.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void print_irqtrace_events(struct task_struct *curr)
{
}
# 19 "include/linux/spinlock_types.h" 2

typedef struct raw_spinlock {
 arch_spinlock_t raw_lock;
# 32 "include/linux/spinlock_types.h"
} raw_spinlock_t;
# 64 "include/linux/spinlock_types.h"
typedef struct spinlock {
 union {
  struct raw_spinlock rlock;
# 75 "include/linux/spinlock_types.h"
 };
} spinlock_t;
# 86 "include/linux/spinlock_types.h"
# 1 "include/linux/rwlock_types.h" 1
# 11 "include/linux/rwlock_types.h"
typedef struct {
 arch_rwlock_t raw_lock;
# 23 "include/linux/rwlock_types.h"
} rwlock_t;
# 87 "include/linux/spinlock_types.h" 2
# 82 "include/linux/spinlock.h" 2





# 1 "./arch/sparc/include/asm/spinlock.h" 1



# 1 "./arch/sparc/include/asm/spinlock_64.h" 1
# 30 "./arch/sparc/include/asm/spinlock_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_spin_lock(arch_spinlock_t *lock)
{
 unsigned long tmp;

 __asm__ __volatile__(
"1:	ldstub		[%1], %0\n"
"	brnz,pn		%0, 2f\n"
"	 nop\n"
"	.subsection	2\n"
"2:	ldub		[%1], %0\n"
"	brnz,pt		%0, 2b\n"
"	 nop\n"
"	ba,a,pt		%%xcc, 1b\n"
"	.previous"
 : "=&r" (tmp)
 : "r" (lock)
 : "memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_spin_trylock(arch_spinlock_t *lock)
{
 unsigned long result;

 __asm__ __volatile__(
"	ldstub		[%1], %0\n"
 : "=r" (result)
 : "r" (lock)
 : "memory");

 return (result == 0UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_spin_unlock(arch_spinlock_t *lock)
{
 __asm__ __volatile__(
"	stb		%%g0, [%0]"
 :
 : "r" (lock)
 : "memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags)
{
 unsigned long tmp1, tmp2;

 __asm__ __volatile__(
"1:	ldstub		[%2], %0\n"
"	brnz,pn		%0, 2f\n"
"	 nop\n"
"	.subsection	2\n"
"2:	rdpr		%%pil, %1\n"
"	wrpr		%3, %%pil\n"
"3:	ldub		[%2], %0\n"
"	brnz,pt		%0, 3b\n"
"	 nop\n"
"	ba,pt		%%xcc, 1b\n"
"	 wrpr		%1, %%pil\n"
"	.previous"
 : "=&r" (tmp1), "=&r" (tmp2)
 : "r"(lock), "r"(flags)
 : "memory");
}



static void inline __attribute__((always_inline)) __attribute__((no_instrument_function)) arch_read_lock(arch_rwlock_t *lock)
{
 unsigned long tmp1, tmp2;

 __asm__ __volatile__ (
"1:	ldsw		[%2], %0\n"
"	brlz,pn		%0, 2f\n"
"4:	 add		%0, 1, %1\n"
"	cas		[%2], %0, %1\n"
"	cmp		%0, %1\n"
"	bne,pn		%%icc, 1b\n"
"	 nop\n"
"	.subsection	2\n"
"2:	ldsw		[%2], %0\n"
"	brlz,pt		%0, 2b\n"
"	 nop\n"
"	ba,a,pt		%%xcc, 4b\n"
"	.previous"
 : "=&r" (tmp1), "=&r" (tmp2)
 : "r" (lock)
 : "memory");
}

static int inline __attribute__((always_inline)) __attribute__((no_instrument_function)) arch_read_trylock(arch_rwlock_t *lock)
{
 int tmp1, tmp2;

 __asm__ __volatile__ (
"1:	ldsw		[%2], %0\n"
"	brlz,a,pn	%0, 2f\n"
"	 mov		0, %0\n"
"	add		%0, 1, %1\n"
"	cas		[%2], %0, %1\n"
"	cmp		%0, %1\n"
"	bne,pn		%%icc, 1b\n"
"	 mov		1, %0\n"
"2:"
 : "=&r" (tmp1), "=&r" (tmp2)
 : "r" (lock)
 : "memory");

 return tmp1;
}

static void inline __attribute__((always_inline)) __attribute__((no_instrument_function)) arch_read_unlock(arch_rwlock_t *lock)
{
 unsigned long tmp1, tmp2;

 __asm__ __volatile__(
"1:	lduw	[%2], %0\n"
"	sub	%0, 1, %1\n"
"	cas	[%2], %0, %1\n"
"	cmp	%0, %1\n"
"	bne,pn	%%xcc, 1b\n"
"	 nop"
 : "=&r" (tmp1), "=&r" (tmp2)
 : "r" (lock)
 : "memory");
}

static void inline __attribute__((always_inline)) __attribute__((no_instrument_function)) arch_write_lock(arch_rwlock_t *lock)
{
 unsigned long mask, tmp1, tmp2;

 mask = 0x80000000UL;

 __asm__ __volatile__(
"1:	lduw		[%2], %0\n"
"	brnz,pn		%0, 2f\n"
"4:	 or		%0, %3, %1\n"
"	cas		[%2], %0, %1\n"
"	cmp		%0, %1\n"
"	bne,pn		%%icc, 1b\n"
"	 nop\n"
"	.subsection	2\n"
"2:	lduw		[%2], %0\n"
"	brnz,pt		%0, 2b\n"
"	 nop\n"
"	ba,a,pt		%%xcc, 4b\n"
"	.previous"
 : "=&r" (tmp1), "=&r" (tmp2)
 : "r" (lock), "r" (mask)
 : "memory");
}

static void inline __attribute__((always_inline)) __attribute__((no_instrument_function)) arch_write_unlock(arch_rwlock_t *lock)
{
 __asm__ __volatile__(
"	stw		%%g0, [%0]"
 :
 : "r" (lock)
 : "memory");
}

static int inline __attribute__((always_inline)) __attribute__((no_instrument_function)) arch_write_trylock(arch_rwlock_t *lock)
{
 unsigned long mask, tmp1, tmp2, result;

 mask = 0x80000000UL;

 __asm__ __volatile__(
"	mov		0, %2\n"
"1:	lduw		[%3], %0\n"
"	brnz,pn		%0, 2f\n"
"	 or		%0, %4, %1\n"
"	cas		[%3], %0, %1\n"
"	cmp		%0, %1\n"
"	bne,pn		%%icc, 1b\n"
"	 nop\n"
"	mov		1, %2\n"
"2:"
 : "=&r" (tmp1), "=&r" (tmp2), "=&r" (result)
 : "r" (lock), "r" (mask)
 : "memory");

 return result;
}
# 5 "./arch/sparc/include/asm/spinlock.h" 2
# 88 "include/linux/spinlock.h" 2
# 155 "include/linux/spinlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void do_raw_spin_lock(raw_spinlock_t *lock)
{
 (void)0;
 arch_spin_lock(&lock->raw_lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
do_raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long *flags)
{
 (void)0;
 arch_spin_lock_flags(&lock->raw_lock, *flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int do_raw_spin_trylock(raw_spinlock_t *lock)
{
 return arch_spin_trylock(&(lock)->raw_lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void do_raw_spin_unlock(raw_spinlock_t *lock)
{
 arch_spin_unlock(&lock->raw_lock);
 (void)0;
}
# 284 "include/linux/spinlock.h"
# 1 "include/linux/rwlock.h" 1
# 285 "include/linux/spinlock.h" 2





# 1 "include/linux/spinlock_api_smp.h" 1
# 18 "include/linux/spinlock_api_smp.h"
int in_lock_functions(unsigned long addr);



void __attribute__((section(".spinlock.text"))) _raw_spin_lock(raw_spinlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass)
        ;
void __attribute__((section(".spinlock.text"))) _raw_spin_lock_bh_nested(raw_spinlock_t *lock, int subclass)
        ;
void __attribute__((section(".spinlock.text")))
_raw_spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map)
        ;
void __attribute__((section(".spinlock.text"))) _raw_spin_lock_bh(raw_spinlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_spin_lock_irq(raw_spinlock_t *lock)
        ;

unsigned long __attribute__((section(".spinlock.text"))) _raw_spin_lock_irqsave(raw_spinlock_t *lock)
        ;
unsigned long __attribute__((section(".spinlock.text")))
_raw_spin_lock_irqsave_nested(raw_spinlock_t *lock, int subclass)
        ;
int __attribute__((section(".spinlock.text"))) _raw_spin_trylock(raw_spinlock_t *lock);
int __attribute__((section(".spinlock.text"))) _raw_spin_trylock_bh(raw_spinlock_t *lock);
void __attribute__((section(".spinlock.text"))) _raw_spin_unlock(raw_spinlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_spin_unlock_bh(raw_spinlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_spin_unlock_irq(raw_spinlock_t *lock) ;
void __attribute__((section(".spinlock.text")))
_raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags)
        ;
# 88 "include/linux/spinlock_api_smp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __raw_spin_trylock(raw_spinlock_t *lock)
{
 __asm__ __volatile__("": : :"memory");
 if (do_raw_spin_trylock(lock)) {
  do { } while (0);
  return 1;
 }
 __asm__ __volatile__("": : :"memory");
 return 0;
}
# 106 "include/linux/spinlock_api_smp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __raw_spin_lock_irqsave(raw_spinlock_t *lock)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); do { } while (0); } while (0);
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
# 121 "include/linux/spinlock_api_smp.h"
 do_raw_spin_lock_flags(lock, &flags);

 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_lock_irq(raw_spinlock_t *lock)
{
 do { arch_local_irq_disable(); do { } while (0); } while (0);
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do_raw_spin_lock(lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_lock_bh(raw_spinlock_t *lock)
{
 __local_bh_disable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
 do { } while (0);
 do_raw_spin_lock(lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_lock(raw_spinlock_t *lock)
{
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do_raw_spin_lock(lock);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_unlock(raw_spinlock_t *lock)
{
 do { } while (0);
 do_raw_spin_unlock(lock);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_unlock_irqrestore(raw_spinlock_t *lock,
         unsigned long flags)
{
 do { } while (0);
 do_raw_spin_unlock(lock);
 do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_unlock_irq(raw_spinlock_t *lock)
{
 do { } while (0);
 do_raw_spin_unlock(lock);
 do { do { } while (0); arch_local_irq_enable(); } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_unlock_bh(raw_spinlock_t *lock)
{
 do { } while (0);
 do_raw_spin_unlock(lock);
 __local_bh_enable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __raw_spin_trylock_bh(raw_spinlock_t *lock)
{
 __local_bh_disable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
 if (do_raw_spin_trylock(lock)) {
  do { } while (0);
  return 1;
 }
 __local_bh_enable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
 return 0;
}

# 1 "include/linux/rwlock_api_smp.h" 1
# 18 "include/linux/rwlock_api_smp.h"
void __attribute__((section(".spinlock.text"))) _raw_read_lock(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_write_lock(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_read_lock_bh(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_write_lock_bh(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_read_lock_irq(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_write_lock_irq(rwlock_t *lock) ;
unsigned long __attribute__((section(".spinlock.text"))) _raw_read_lock_irqsave(rwlock_t *lock)
       ;
unsigned long __attribute__((section(".spinlock.text"))) _raw_write_lock_irqsave(rwlock_t *lock)
       ;
int __attribute__((section(".spinlock.text"))) _raw_read_trylock(rwlock_t *lock);
int __attribute__((section(".spinlock.text"))) _raw_write_trylock(rwlock_t *lock);
void __attribute__((section(".spinlock.text"))) _raw_read_unlock(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_write_unlock(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_read_unlock_bh(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_write_unlock_bh(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_read_unlock_irq(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text"))) _raw_write_unlock_irq(rwlock_t *lock) ;
void __attribute__((section(".spinlock.text")))
_raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
       ;
void __attribute__((section(".spinlock.text")))
_raw_write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
       ;
# 117 "include/linux/rwlock_api_smp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __raw_read_trylock(rwlock_t *lock)
{
 __asm__ __volatile__("": : :"memory");
 if (arch_read_trylock(&(lock)->raw_lock)) {
  do { } while (0);
  return 1;
 }
 __asm__ __volatile__("": : :"memory");
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __raw_write_trylock(rwlock_t *lock)
{
 __asm__ __volatile__("": : :"memory");
 if (arch_write_trylock(&(lock)->raw_lock)) {
  do { } while (0);
  return 1;
 }
 __asm__ __volatile__("": : :"memory");
 return 0;
}
# 146 "include/linux/rwlock_api_smp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_lock(rwlock_t *lock)
{
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do {(void)0; arch_read_lock(&(lock)->raw_lock); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __raw_read_lock_irqsave(rwlock_t *lock)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); do { } while (0); } while (0);
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do {(void)0; arch_read_lock(&((lock))->raw_lock); } while (0)
                                       ;
 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_lock_irq(rwlock_t *lock)
{
 do { arch_local_irq_disable(); do { } while (0); } while (0);
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do {(void)0; arch_read_lock(&(lock)->raw_lock); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_lock_bh(rwlock_t *lock)
{
 __local_bh_disable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
 do { } while (0);
 do {(void)0; arch_read_lock(&(lock)->raw_lock); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __raw_write_lock_irqsave(rwlock_t *lock)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); do { } while (0); } while (0);
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do {(void)0; arch_write_lock(&((lock))->raw_lock); } while (0)
                                        ;
 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_lock_irq(rwlock_t *lock)
{
 do { arch_local_irq_disable(); do { } while (0); } while (0);
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do {(void)0; arch_write_lock(&(lock)->raw_lock); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_lock_bh(rwlock_t *lock)
{
 __local_bh_disable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
 do { } while (0);
 do {(void)0; arch_write_lock(&(lock)->raw_lock); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_lock(rwlock_t *lock)
{
 __asm__ __volatile__("": : :"memory");
 do { } while (0);
 do {(void)0; arch_write_lock(&(lock)->raw_lock); } while (0);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_unlock(rwlock_t *lock)
{
 do { } while (0);
 do {arch_write_unlock(&(lock)->raw_lock); (void)0; } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_unlock(rwlock_t *lock)
{
 do { } while (0);
 do {arch_read_unlock(&(lock)->raw_lock); (void)0; } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
__raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
{
 do { } while (0);
 do {arch_read_unlock(&(lock)->raw_lock); (void)0; } while (0);
 do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_unlock_irq(rwlock_t *lock)
{
 do { } while (0);
 do {arch_read_unlock(&(lock)->raw_lock); (void)0; } while (0);
 do { do { } while (0); arch_local_irq_enable(); } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_unlock_bh(rwlock_t *lock)
{
 do { } while (0);
 do {arch_read_unlock(&(lock)->raw_lock); (void)0; } while (0);
 __local_bh_enable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_unlock_irqrestore(rwlock_t *lock,
          unsigned long flags)
{
 do { } while (0);
 do {arch_write_unlock(&(lock)->raw_lock); (void)0; } while (0);
 do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_unlock_irq(rwlock_t *lock)
{
 do { } while (0);
 do {arch_write_unlock(&(lock)->raw_lock); (void)0; } while (0);
 do { do { } while (0); arch_local_irq_enable(); } while (0);
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_unlock_bh(rwlock_t *lock)
{
 do { } while (0);
 do {arch_write_unlock(&(lock)->raw_lock); (void)0; } while (0);
 __local_bh_enable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
}
# 193 "include/linux/spinlock_api_smp.h" 2
# 291 "include/linux/spinlock.h" 2
# 299 "include/linux/spinlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) raw_spinlock_t *spinlock_check(spinlock_t *lock)
{
 return &lock->rlock;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_lock(spinlock_t *lock)
{
 _raw_spin_lock(&lock->rlock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_lock_bh(spinlock_t *lock)
{
 _raw_spin_lock_bh(&lock->rlock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_trylock(spinlock_t *lock)
{
 return (_raw_spin_trylock(&lock->rlock));
}
# 340 "include/linux/spinlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_lock_irq(spinlock_t *lock)
{
 _raw_spin_lock_irq(&lock->rlock);
}
# 355 "include/linux/spinlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_unlock(spinlock_t *lock)
{
 __raw_spin_unlock(&lock->rlock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_unlock_bh(spinlock_t *lock)
{
 _raw_spin_unlock_bh(&lock->rlock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_unlock_irq(spinlock_t *lock)
{
 __raw_spin_unlock_irq(&lock->rlock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
{
 do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); _raw_spin_unlock_irqrestore(&lock->rlock, flags); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_trylock_bh(spinlock_t *lock)
{
 return (_raw_spin_trylock_bh(&lock->rlock));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_trylock_irq(spinlock_t *lock)
{
 return ({ do { arch_local_irq_disable(); do { } while (0); } while (0); (_raw_spin_trylock(&lock->rlock)) ? 1 : ({ do { do { } while (0); arch_local_irq_enable(); } while (0); 0; }); });
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spin_unlock_wait(spinlock_t *lock)
{
 do { __asm__ __volatile__("":::"memory"); } while((&(&lock->rlock)->raw_lock)->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_is_locked(spinlock_t *lock)
{
 return ((&(&lock->rlock)->raw_lock)->lock != 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_is_contended(spinlock_t *lock)
{
 return (((void)(&lock->rlock), 0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_can_lock(spinlock_t *lock)
{
 return (!((&(&lock->rlock)->raw_lock)->lock != 0));
}







# 1 "include/linux/atomic.h" 1



# 1 "./arch/sparc/include/asm/atomic.h" 1



# 1 "./arch/sparc/include/asm/atomic_64.h" 1
# 11 "./arch/sparc/include/asm/atomic_64.h"
# 1 "./arch/sparc/include/asm/cmpxchg.h" 1



# 1 "./arch/sparc/include/asm/cmpxchg_64.h" 1
# 9 "./arch/sparc/include/asm/cmpxchg_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val)
{
 unsigned long tmp1, tmp2;

 __asm__ __volatile__(
"	mov		%0, %1\n"
"1:	lduw		[%4], %2\n"
"	cas		[%4], %2, %0\n"
"	cmp		%2, %0\n"
"	bne,a,pn	%%icc, 1b\n"
"	 mov		%1, %0\n"
 : "=&r" (val), "=&r" (tmp1), "=&r" (tmp2)
 : "0" (val), "r" (m)
 : "cc", "memory");
 return val;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long xchg64(__volatile__ unsigned long *m, unsigned long val)
{
 unsigned long tmp1, tmp2;

 __asm__ __volatile__(
"	mov		%0, %1\n"
"1:	ldx		[%4], %2\n"
"	casx		[%4], %2, %0\n"
"	cmp		%2, %0\n"
"	bne,a,pn	%%xcc, 1b\n"
"	 mov		%1, %0\n"
 : "=&r" (val), "=&r" (tmp1), "=&r" (tmp2)
 : "0" (val), "r" (m)
 : "cc", "memory");
 return val;
}



void __xchg_called_with_bad_pointer(void);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __xchg(unsigned long x, __volatile__ void * ptr,
           int size)
{
 switch (size) {
 case 4:
  return xchg32(ptr, x);
 case 8:
  return xchg64(ptr, x);
 }
 __xchg_called_with_bad_pointer();
 return x;
}







# 1 "include/asm-generic/cmpxchg-local.h" 1






extern unsigned long wrong_size_cmpxchg(volatile void *ptr)
 __attribute__((noreturn));





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __cmpxchg_local_generic(volatile void *ptr,
  unsigned long old, unsigned long new, int size)
{
 unsigned long flags, prev;




 if (size == 8 && sizeof(unsigned long) != 8)
  wrong_size_cmpxchg(ptr);

 do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0);
 switch (size) {
 case 1: prev = *(u8 *)ptr;
  if (prev == old)
   *(u8 *)ptr = (u8)new;
  break;
 case 2: prev = *(u16 *)ptr;
  if (prev == old)
   *(u16 *)ptr = (u16)new;
  break;
 case 4: prev = *(u32 *)ptr;
  if (prev == old)
   *(u32 *)ptr = (u32)new;
  break;
 case 8: prev = *(u64 *)ptr;
  if (prev == old)
   *(u64 *)ptr = (u64)new;
  break;
 default:
  wrong_size_cmpxchg(ptr);
 }
 do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0);
 return prev;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 __cmpxchg64_local_generic(volatile void *ptr,
  u64 old, u64 new)
{
 u64 prev;
 unsigned long flags;

 do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0);
 prev = *(u64 *)ptr;
 if (prev == old)
  *(u64 *)ptr = new;
 do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0);
 return prev;
}
# 67 "./arch/sparc/include/asm/cmpxchg_64.h" 2



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
__cmpxchg_u32(volatile int *m, int old, int new)
{
 __asm__ __volatile__("cas [%2], %3, %0"
        : "=&r" (new)
        : "0" (new), "r" (m), "r" (old)
        : "memory");

 return new;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
{
 __asm__ __volatile__("casx [%2], %3, %0"
        : "=&r" (new)
        : "0" (new), "r" (m), "r" (old)
        : "memory");

 return new;
}



void __cmpxchg_called_with_bad_pointer(void);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
{
 switch (size) {
  case 4:
   return __cmpxchg_u32(ptr, old, new);
  case 8:
   return __cmpxchg_u64(ptr, old, new);
 }
 __cmpxchg_called_with_bad_pointer();
 return old;
}
# 122 "./arch/sparc/include/asm/cmpxchg_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __cmpxchg_local(volatile void *ptr,
          unsigned long old,
          unsigned long new, int size)
{
 switch (size) {
 case 4:
 case 8: return __cmpxchg(ptr, old, new, size);
 default:
  return __cmpxchg_local_generic(ptr, old, new, size);
 }

 return old;
}
# 5 "./arch/sparc/include/asm/cmpxchg.h" 2
# 12 "./arch/sparc/include/asm/atomic_64.h" 2
# 33 "./arch/sparc/include/asm/atomic_64.h"
void atomic_add(int, atomic_t *); void atomic64_add(long, atomic64_t *); int atomic_add_return(int, atomic_t *); long atomic64_add_return(long, atomic64_t *);
void atomic_sub(int, atomic_t *); void atomic64_sub(long, atomic64_t *); int atomic_sub_return(int, atomic_t *); long atomic64_sub_return(long, atomic64_t *);
# 75 "./arch/sparc/include/asm/atomic_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __atomic_add_unless(atomic_t *v, int a, int u)
{
 int c, old;
 c = (*({ __attribute__((unused)) typeof((v)->counter) __var = ( typeof((v)->counter)) 0; (volatile typeof((v)->counter) *)&((v)->counter); }));
 for (;;) {
  if (__builtin_expect(!!(c == (u)), 0))
   break;
  old = (({ __typeof__(*(&(((v))->counter))) _o_ = ((c)); __typeof__(*(&(((v))->counter))) _n_ = ((c + (a))); (__typeof__(*(&(((v))->counter)))) __cmpxchg((&(((v))->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&(((v))->counter)))); }));
  if (__builtin_expect(!!(old == c), 1))
   break;
  c = old;
 }
 return c;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic64_add_unless(atomic64_t *v, long a, long u)
{
 long c, old;
 c = (*({ __attribute__((unused)) typeof((v)->counter) __var = ( typeof((v)->counter)) 0; (volatile typeof((v)->counter) *)&((v)->counter); }));
 for (;;) {
  if (__builtin_expect(!!(c == (u)), 0))
   break;
  old = ((__typeof__(((v))->counter))({ __typeof__(*(&(((v))->counter))) _o_ = ((c)); __typeof__(*(&(((v))->counter))) _n_ = ((c + (a))); (__typeof__(*(&(((v))->counter)))) __cmpxchg((&(((v))->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&(((v))->counter)))); }));
  if (__builtin_expect(!!(old == c), 1))
   break;
  c = old;
 }
 return c != (u);
}



long atomic64_dec_if_positive(atomic64_t *v);
# 5 "./arch/sparc/include/asm/atomic.h" 2
# 5 "include/linux/atomic.h" 2
# 15 "include/linux/atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_add_unless(atomic_t *v, int a, int u)
{
 return __atomic_add_unless(v, a, u) != u;
}
# 44 "include/linux/atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_inc_not_zero_hint(atomic_t *v, int hint)
{
 int val, c = hint;


 if (!hint)
  return atomic_add_unless((v), 1, 0);

 do {
  val = (({ __typeof__(*(&((v)->counter))) _o_ = ((c)); __typeof__(*(&((v)->counter))) _n_ = ((c + 1)); (__typeof__(*(&((v)->counter)))) __cmpxchg((&((v)->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&((v)->counter)))); }));
  if (val == c)
   return 1;
  c = val;
 } while (c);

 return 0;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_inc_unless_negative(atomic_t *p)
{
 int v, v1;
 for (v = 0; v >= 0; v = v1) {
  v1 = (({ __typeof__(*(&((p)->counter))) _o_ = ((v)); __typeof__(*(&((p)->counter))) _n_ = ((v + 1)); (__typeof__(*(&((p)->counter)))) __cmpxchg((&((p)->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&((p)->counter)))); }));
  if (__builtin_expect(!!(v1 == v), 1))
   return 1;
 }
 return 0;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_dec_unless_positive(atomic_t *p)
{
 int v, v1;
 for (v = 0; v <= 0; v = v1) {
  v1 = (({ __typeof__(*(&((p)->counter))) _o_ = ((v)); __typeof__(*(&((p)->counter))) _n_ = ((v - 1)); (__typeof__(*(&((p)->counter)))) __cmpxchg((&((p)->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&((p)->counter)))); }));
  if (__builtin_expect(!!(v1 == v), 1))
   return 1;
 }
 return 0;
}
# 97 "include/linux/atomic.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_dec_if_positive(atomic_t *v)
{
 int c, old, dec;
 c = (*({ __attribute__((unused)) typeof((v)->counter) __var = ( typeof((v)->counter)) 0; (volatile typeof((v)->counter) *)&((v)->counter); }));
 for (;;) {
  dec = c - 1;
  if (__builtin_expect(!!(dec < 0), 0))
   break;
  old = (({ __typeof__(*(&(((v))->counter))) _o_ = ((c)); __typeof__(*(&(((v))->counter))) _n_ = ((dec)); (__typeof__(*(&(((v))->counter)))) __cmpxchg((&(((v))->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&(((v))->counter)))); }));
  if (__builtin_expect(!!(old == c), 1))
   break;
  c = old;
 }
 return dec;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_or(int i, atomic_t *v)
{
 int old;
 int new;

 do {
  old = (*({ __attribute__((unused)) typeof((v)->counter) __var = ( typeof((v)->counter)) 0; (volatile typeof((v)->counter) *)&((v)->counter); }));
  new = old | i;
 } while ((({ __typeof__(*(&((v)->counter))) _o_ = ((old)); __typeof__(*(&((v)->counter))) _n_ = ((new)); (__typeof__(*(&((v)->counter)))) __cmpxchg((&((v)->counter)), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&((v)->counter)))); })) != old);
}


# 1 "include/asm-generic/atomic-long.h" 1
# 11 "include/asm-generic/atomic-long.h"
# 1 "arch/sparc/include/generated/asm/types.h" 1
# 12 "include/asm-generic/atomic-long.h" 2
# 23 "include/asm-generic/atomic-long.h"
typedef atomic64_t atomic_long_t;



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_read(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (long)(*({ __attribute__((unused)) typeof((v)->counter) __var = ( typeof((v)->counter)) 0; (volatile typeof((v)->counter) *)&((v)->counter); }));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_set(atomic_long_t *l, long i)
{
 atomic64_t *v = (atomic64_t *)l;

 (((v)->counter) = i);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_inc(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 atomic64_add(1, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_dec(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 atomic64_sub(1, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_add(long i, atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 atomic64_add(i, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_sub(long i, atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 atomic64_sub(i, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_long_sub_and_test(long i, atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (atomic64_sub_return(i, v) == 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_long_dec_and_test(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (atomic64_sub_return(1, v) == 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_long_inc_and_test(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (atomic64_add_return(1, v) == 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_long_add_negative(long i, atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (atomic64_add_return(i, v) < 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_add_return(long i, atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (long)atomic64_add_return(i, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_sub_return(long i, atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (long)atomic64_sub_return(i, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_inc_return(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (long)atomic64_add_return(1, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_dec_return(atomic_long_t *l)
{
 atomic64_t *v = (atomic64_t *)l;

 return (long)atomic64_sub_return(1, v);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_add_unless(atomic_long_t *l, long a, long u)
{
 atomic64_t *v = (atomic64_t *)l;

 return (long)atomic64_add_unless(v, a, u);
}
# 128 "include/linux/atomic.h" 2
# 417 "include/linux/spinlock.h" 2
# 425 "include/linux/spinlock.h"
extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock);
# 36 "include/linux/seqlock.h" 2


# 1 "./arch/sparc/include/asm/processor.h" 1



# 1 "./arch/sparc/include/asm/processor_64.h" 1
# 59 "./arch/sparc/include/asm/processor_64.h"
typedef struct {
 unsigned char seg;
} mm_segment_t;



struct thread_struct {
# 74 "./arch/sparc/include/asm/processor_64.h"
 int dummy;

};
# 94 "./arch/sparc/include/asm/processor_64.h"
# 1 "./arch/sparc/include/asm/fpumacro.h" 1
# 13 "./arch/sparc/include/asm/fpumacro.h"
struct fpustate {
 u32 regs[64];
};



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long fprs_read(void)
{
 unsigned long retval;

 __asm__ __volatile__("rd %%fprs, %0" : "=r" (retval));

 return retval;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void fprs_write(unsigned long val)
{
 __asm__ __volatile__("wr %0, 0x0, %%fprs" : : "r" (val));
}
# 95 "./arch/sparc/include/asm/processor_64.h" 2


struct task_struct;
unsigned long thread_saved_pc(struct task_struct *);
# 197 "./arch/sparc/include/asm/processor_64.h"
unsigned long get_wchan(struct task_struct *task);
# 229 "./arch/sparc/include/asm/processor_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void prefetch(const void *x)
{






 __asm__ __volatile__("prefetch [%0], #one_write"
        :
        : "r" (x));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void prefetchw(const void *x)
{




 __asm__ __volatile__("prefetch [%0], #n_writes"
        :
        : "r" (x));
}





int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap);
# 5 "./arch/sparc/include/asm/processor.h" 2
# 39 "include/linux/seqlock.h" 2







typedef struct seqcount {
 unsigned sequence;



} seqcount_t;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __seqcount_init(seqcount_t *s, const char *name,
       struct lock_class_key *key)
{



 do { (void)(name); (void)(key); } while (0);
 s->sequence = 0;
}
# 106 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned __read_seqcount_begin(const seqcount_t *s)
{
 unsigned ret;

repeat:
 ret = (*({ __attribute__((unused)) typeof(s->sequence) __var = ( typeof(s->sequence)) 0; (volatile typeof(s->sequence) *)&(s->sequence); }));
 if (__builtin_expect(!!(ret & 1), 0)) {
  asm volatile("\n99:\n\t" "rd	%%ccr, %%g0\n\t" "rd	%%ccr, %%g0\n\t" "rd	%%ccr, %%g0\n\t" ".section	.pause_3insn_patch,\"ax\"\n\t" ".word	99b\n\t" "wr	%%g0, 128, %%asr27\n\t" "nop\n\t" "nop\n\t" ".previous" ::: "memory");
  goto repeat;
 }
 return ret;
}
# 128 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned raw_read_seqcount(const seqcount_t *s)
{
 unsigned ret = (*({ __attribute__((unused)) typeof(s->sequence) __var = ( typeof(s->sequence)) 0; (volatile typeof(s->sequence) *)&(s->sequence); }));
 __asm__ __volatile__("":::"memory");
 return ret;
}
# 144 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned raw_read_seqcount_begin(const seqcount_t *s)
{
 unsigned ret = __read_seqcount_begin(s);
 __asm__ __volatile__("":::"memory");
 return ret;
}
# 160 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned read_seqcount_begin(const seqcount_t *s)
{
 ;
 return raw_read_seqcount_begin(s);
}
# 180 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned raw_seqcount_begin(const seqcount_t *s)
{
 unsigned ret = (*({ __attribute__((unused)) typeof(s->sequence) __var = ( typeof(s->sequence)) 0; (volatile typeof(s->sequence) *)&(s->sequence); }));
 __asm__ __volatile__("":::"memory");
 return ret & ~1;
}
# 201 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __read_seqcount_retry(const seqcount_t *s, unsigned start)
{
 return __builtin_expect(!!(s->sequence != start), 0);
}
# 216 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int read_seqcount_retry(const seqcount_t *s, unsigned start)
{
 __asm__ __volatile__("":::"memory");
 return __read_seqcount_retry(s, start);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void raw_write_seqcount_begin(seqcount_t *s)
{
 s->sequence++;
 __asm__ __volatile__("":::"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void raw_write_seqcount_end(seqcount_t *s)
{
 __asm__ __volatile__("":::"memory");
 s->sequence++;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void raw_write_seqcount_latch(seqcount_t *s)
{
       __asm__ __volatile__("":::"memory");
       s->sequence++;
       __asm__ __volatile__("":::"memory");
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqcount_begin_nested(seqcount_t *s, int subclass)
{
 raw_write_seqcount_begin(s);
 do { } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqcount_begin(seqcount_t *s)
{
 write_seqcount_begin_nested(s, 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqcount_end(seqcount_t *s)
{
 do { } while (0);
 raw_write_seqcount_end(s);
}
# 275 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqcount_barrier(seqcount_t *s)
{
 __asm__ __volatile__("":::"memory");
 s->sequence+=2;
}

typedef struct {
 struct seqcount seqcount;
 spinlock_t lock;
} seqlock_t;
# 308 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned read_seqbegin(const seqlock_t *sl)
{
 return read_seqcount_begin(&sl->seqcount);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned read_seqretry(const seqlock_t *sl, unsigned start)
{
 return read_seqcount_retry(&sl->seqcount, start);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqlock(seqlock_t *sl)
{
 spin_lock(&sl->lock);
 write_seqcount_begin(&sl->seqcount);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_sequnlock(seqlock_t *sl)
{
 write_seqcount_end(&sl->seqcount);
 spin_unlock(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqlock_bh(seqlock_t *sl)
{
 spin_lock_bh(&sl->lock);
 write_seqcount_begin(&sl->seqcount);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_sequnlock_bh(seqlock_t *sl)
{
 write_seqcount_end(&sl->seqcount);
 spin_unlock_bh(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqlock_irq(seqlock_t *sl)
{
 spin_lock_irq(&sl->lock);
 write_seqcount_begin(&sl->seqcount);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_sequnlock_irq(seqlock_t *sl)
{
 write_seqcount_end(&sl->seqcount);
 spin_unlock_irq(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __write_seqlock_irqsave(seqlock_t *sl)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(&sl->lock)); } while (0); } while (0);
 write_seqcount_begin(&sl->seqcount);
 return flags;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
write_sequnlock_irqrestore(seqlock_t *sl, unsigned long flags)
{
 write_seqcount_end(&sl->seqcount);
 spin_unlock_irqrestore(&sl->lock, flags);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_seqlock_excl(seqlock_t *sl)
{
 spin_lock(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_sequnlock_excl(seqlock_t *sl)
{
 spin_unlock(&sl->lock);
}
# 403 "include/linux/seqlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_seqbegin_or_lock(seqlock_t *lock, int *seq)
{
 if (!(*seq & 1))
  *seq = read_seqbegin(lock);
 else
  read_seqlock_excl(lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int need_seqretry(seqlock_t *lock, int seq)
{
 return !(seq & 1) && read_seqretry(lock, seq);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void done_seqretry(seqlock_t *lock, int seq)
{
 if (seq & 1)
  read_sequnlock_excl(lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_seqlock_excl_bh(seqlock_t *sl)
{
 spin_lock_bh(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_sequnlock_excl_bh(seqlock_t *sl)
{
 spin_unlock_bh(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_seqlock_excl_irq(seqlock_t *sl)
{
 spin_lock_irq(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_sequnlock_excl_irq(seqlock_t *sl)
{
 spin_unlock_irq(&sl->lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __read_seqlock_excl_irqsave(seqlock_t *sl)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(&sl->lock)); } while (0); } while (0);
 return flags;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
read_sequnlock_excl_irqrestore(seqlock_t *sl, unsigned long flags)
{
 spin_unlock_irqrestore(&sl->lock, flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
read_seqbegin_or_lock_irqsave(seqlock_t *lock, int *seq)
{
 unsigned long flags = 0;

 if (!(*seq & 1))
  *seq = read_seqbegin(lock);
 else
  do { flags = __read_seqlock_excl_irqsave(lock); } while (0);

 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
done_seqretry_irqrestore(seqlock_t *lock, int seq, unsigned long flags)
{
 if (seq & 1)
  read_sequnlock_excl_irqrestore(lock, flags);
}
# 6 "include/linux/time.h" 2
# 1 "include/linux/math64.h" 1




# 1 "arch/sparc/include/generated/asm/div64.h" 1
# 1 "include/asm-generic/div64.h" 1
# 1 "arch/sparc/include/generated/asm/div64.h" 2
# 6 "include/linux/math64.h" 2
# 18 "include/linux/math64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
{
 *remainder = dividend % divisor;
 return dividend / divisor;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder)
{
 *remainder = dividend % divisor;
 return dividend / divisor;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder)
{
 *remainder = dividend % divisor;
 return dividend / divisor;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 div64_u64(u64 dividend, u64 divisor)
{
 return dividend / divisor;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 div64_s64(s64 dividend, s64 divisor)
{
 return dividend / divisor;
}
# 97 "include/linux/math64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 div_u64(u64 dividend, u32 divisor)
{
 u32 remainder;
 return div_u64_rem(dividend, divisor, &remainder);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 div_s64(s64 dividend, s32 divisor)
{
 s32 remainder;
 return div_s64_rem(dividend, divisor, &remainder);
}


u32 iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) u32
__iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder)
{
 u32 ret = 0;

 while (dividend >= divisor) {


  asm("" : "+rm"(dividend));

  dividend -= divisor;
  ret++;
 }

 *remainder = dividend;

 return ret;
}
# 148 "include/linux/math64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift)
{
 u32 ah, al;
 u64 ret;

 al = a;
 ah = a >> 32;

 ret = ((u64)al * mul) >> shift;
 if (ah)
  ret += ((u64)ah * mul) << (32 - shift);

 return ret;
}
# 7 "include/linux/time.h" 2
# 1 "include/linux/time64.h" 1



# 1 "include/uapi/linux/time.h" 1
# 9 "include/uapi/linux/time.h"
struct timespec {
 __kernel_time_t tv_sec;
 long tv_nsec;
};


struct timeval {
 __kernel_time_t tv_sec;
 __kernel_suseconds_t tv_usec;
};

struct timezone {
 int tz_minuteswest;
 int tz_dsttime;
};
# 34 "include/uapi/linux/time.h"
struct itimerspec {
 struct timespec it_interval;
 struct timespec it_value;
};

struct itimerval {
 struct timeval it_interval;
 struct timeval it_value;
};
# 5 "include/linux/time64.h" 2

typedef __s64 time64_t;
# 36 "include/linux/time64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec timespec64_to_timespec(const struct timespec ts64)
{
 return ts64;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec timespec_to_timespec64(const struct timespec ts)
{
 return ts;
}
# 8 "include/linux/time.h" 2

extern struct timezone sys_tz;



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timespec_equal(const struct timespec *a,
                                 const struct timespec *b)
{
 return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timespec_compare(const struct timespec *lhs, const struct timespec *rhs)
{
 if (lhs->tv_sec < rhs->tv_sec)
  return -1;
 if (lhs->tv_sec > rhs->tv_sec)
  return 1;
 return lhs->tv_nsec - rhs->tv_nsec;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timeval_compare(const struct timeval *lhs, const struct timeval *rhs)
{
 if (lhs->tv_sec < rhs->tv_sec)
  return -1;
 if (lhs->tv_sec > rhs->tv_sec)
  return 1;
 return lhs->tv_usec - rhs->tv_usec;
}

extern time64_t mktime64(const unsigned int year, const unsigned int mon,
   const unsigned int day, const unsigned int hour,
   const unsigned int min, const unsigned int sec);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long mktime(const unsigned int year,
   const unsigned int mon, const unsigned int day,
   const unsigned int hour, const unsigned int min,
   const unsigned int sec)
{
 return mktime64(year, mon, day, hour, min, sec);
}

extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec);






extern struct timespec timespec_add_safe(const struct timespec lhs,
      const struct timespec rhs);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec timespec_add(struct timespec lhs,
      struct timespec rhs)
{
 struct timespec ts_delta;
 set_normalized_timespec(&ts_delta, lhs.tv_sec + rhs.tv_sec,
    lhs.tv_nsec + rhs.tv_nsec);
 return ts_delta;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec timespec_sub(struct timespec lhs,
      struct timespec rhs)
{
 struct timespec ts_delta;
 set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec,
    lhs.tv_nsec - rhs.tv_nsec);
 return ts_delta;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool timespec_valid(const struct timespec *ts)
{

 if (ts->tv_sec < 0)
  return false;

 if ((unsigned long)ts->tv_nsec >= 1000000000L)
  return false;
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool timespec_valid_strict(const struct timespec *ts)
{
 if (!timespec_valid(ts))
  return false;

 if ((unsigned long long)ts->tv_sec >= (((s64)~((u64)1 << 63)) / 1000000000L))
  return false;
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool timeval_valid(const struct timeval *tv)
{

 if (tv->tv_sec < 0)
  return false;


 if (tv->tv_usec < 0 || tv->tv_usec >= 1000000L)
  return false;

 return true;
}

extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
# 144 "include/linux/time.h"
struct itimerval;
extern int do_setitimer(int which, struct itimerval *value,
   struct itimerval *ovalue);
extern int do_getitimer(int which, struct itimerval *value);

extern unsigned int alarm_setitimer(unsigned int seconds);

extern long do_utimes(int dfd, const char *filename, struct timespec *times, int flags);

struct tms;
extern void do_sys_times(struct tms *);





struct tm {




 int tm_sec;

 int tm_min;

 int tm_hour;

 int tm_mday;

 int tm_mon;

 long tm_year;

 int tm_wday;

 int tm_yday;
};

void time_to_tm(time_t totalsecs, int offset, struct tm *result);
# 191 "include/linux/time.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 timespec_to_ns(const struct timespec *ts)
{
 return ((s64) ts->tv_sec * 1000000000L) + ts->tv_nsec;
}
# 203 "include/linux/time.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 timeval_to_ns(const struct timeval *tv)
{
 return ((s64) tv->tv_sec * 1000000000L) +
  tv->tv_usec * 1000L;
}







extern struct timespec ns_to_timespec(const s64 nsec);







extern struct timeval ns_to_timeval(const s64 nsec);
# 233 "include/linux/time.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void timespec_add_ns(struct timespec *a, u64 ns)
{
 a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, 1000000000L, &ns);
 a->tv_nsec = ns;
}
# 57 "include/uapi/linux/timex.h" 2







struct timex {
 unsigned int modes;
 __kernel_long_t offset;
 __kernel_long_t freq;
 __kernel_long_t maxerror;
 __kernel_long_t esterror;
 int status;
 __kernel_long_t constant;
 __kernel_long_t precision;
 __kernel_long_t tolerance;


 struct timeval time;
 __kernel_long_t tick;

 __kernel_long_t ppsfreq;
 __kernel_long_t jitter;
 int shift;
 __kernel_long_t stabil;
 __kernel_long_t jitcnt;
 __kernel_long_t calcnt;
 __kernel_long_t errcnt;
 __kernel_long_t stbcnt;

 int tai;

 int :32; int :32; int :32; int :32;
 int :32; int :32; int :32; int :32;
 int :32; int :32; int :32;
};
# 57 "include/linux/timex.h" 2






# 1 "./include/uapi/linux/param.h" 1
# 64 "include/linux/timex.h" 2

# 1 "./arch/sparc/include/asm/timex.h" 1



# 1 "./arch/sparc/include/asm/timex_64.h" 1
# 9 "./arch/sparc/include/asm/timex_64.h"
# 1 "./arch/sparc/include/asm/timer.h" 1



# 1 "./arch/sparc/include/asm/timer_64.h" 1
# 12 "./arch/sparc/include/asm/timer_64.h"
struct sparc64_tick_ops {
 unsigned long long (*get_tick)(void);
 int (*add_compare)(unsigned long);
 unsigned long softint_mask;
 void (*disable_irq)(void);

 void (*init_tick)(void);
 unsigned long (*add_tick)(unsigned long);

 char *name;
};

extern struct sparc64_tick_ops *tick_ops;

unsigned long sparc64_get_clock_tick(unsigned int cpu);
void setup_sparc64_timer(void);
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) time_init(void);
# 5 "./arch/sparc/include/asm/timer.h" 2
# 10 "./arch/sparc/include/asm/timex_64.h" 2




typedef unsigned long cycles_t;
# 5 "./arch/sparc/include/asm/timex.h" 2
# 66 "include/linux/timex.h" 2
# 139 "include/linux/timex.h"
extern unsigned long tick_usec;
extern unsigned long tick_nsec;
# 154 "include/linux/timex.h"
extern int do_adjtimex(struct timex *);
extern void hardpps(const struct timespec *, const struct timespec *);

int read_current_timer(unsigned long *timer_val);
void ntp_notify_cmos_timer(void);
# 20 "include/linux/sched.h" 2
# 1 "include/linux/jiffies.h" 1
# 57 "include/linux/jiffies.h"
extern int register_refined_jiffies(long clock_tick_rate);
# 76 "include/linux/jiffies.h"
extern u64 __attribute__((section(".data"))) jiffies_64;
extern unsigned long volatile __attribute__((section(".data"))) jiffies;




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 get_jiffies_64(void)
{
 return (u64)jiffies;
}
# 182 "include/linux/jiffies.h"
extern unsigned long preset_lpj;
# 283 "include/linux/jiffies.h"
extern unsigned int jiffies_to_msecs(const unsigned long j);
extern unsigned int jiffies_to_usecs(const unsigned long j);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 jiffies_to_nsecs(const unsigned long j)
{
 return (u64)jiffies_to_usecs(j) * 1000L;
}

extern unsigned long msecs_to_jiffies(const unsigned int m);
extern unsigned long usecs_to_jiffies(const unsigned int u);
extern unsigned long timespec_to_jiffies(const struct timespec *value);
extern void jiffies_to_timespec(const unsigned long jiffies,
    struct timespec *value);
extern unsigned long timeval_to_jiffies(const struct timeval *value);
extern void jiffies_to_timeval(const unsigned long jiffies,
          struct timeval *value);

extern clock_t jiffies_to_clock_t(unsigned long x);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) clock_t jiffies_delta_to_clock_t(long delta)
{
 return jiffies_to_clock_t(({ typeof(0L) _max1 = (0L); typeof(delta) _max2 = (delta); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; }));
}

extern unsigned long clock_t_to_jiffies(unsigned long x);
extern u64 jiffies_64_to_clock_t(u64 x);
extern u64 nsec_to_clock_t(u64 x);
extern u64 nsecs_to_jiffies64(u64 n);
extern unsigned long nsecs_to_jiffies(u64 n);
# 21 "include/linux/sched.h" 2
# 1 "include/linux/plist.h" 1
# 81 "include/linux/plist.h"
struct plist_head {
 struct list_head node_list;
};

struct plist_node {
 int prio;
 struct list_head prio_list;
 struct list_head node_list;
};
# 123 "include/linux/plist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
plist_head_init(struct plist_head *head)
{
 INIT_LIST_HEAD(&head->node_list);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void plist_node_init(struct plist_node *node, int prio)
{
 node->prio = prio;
 INIT_LIST_HEAD(&node->prio_list);
 INIT_LIST_HEAD(&node->node_list);
}

extern void plist_add(struct plist_node *node, struct plist_head *head);
extern void plist_del(struct plist_node *node, struct plist_head *head);

extern void plist_requeue(struct plist_node *node, struct plist_head *head);
# 212 "include/linux/plist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int plist_head_empty(const struct plist_head *head)
{
 return list_empty(&head->node_list);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int plist_node_empty(const struct plist_node *node)
{
 return list_empty(&node->node_list);
}
# 282 "include/linux/plist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct plist_node *plist_first(const struct plist_head *head)
{
 return ({ const typeof( ((struct plist_node *)0)->node_list ) *__mptr = (head->node_list.next); (struct plist_node *)( (char *)__mptr - __builtin_offsetof(struct plist_node,node_list) );})
                                  ;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct plist_node *plist_last(const struct plist_head *head)
{
 return ({ const typeof( ((struct plist_node *)0)->node_list ) *__mptr = (head->node_list.prev); (struct plist_node *)( (char *)__mptr - __builtin_offsetof(struct plist_node,node_list) );})
                                  ;
}
# 22 "include/linux/sched.h" 2
# 1 "include/linux/rbtree.h" 1
# 35 "include/linux/rbtree.h"
struct rb_node {
 unsigned long __rb_parent_color;
 struct rb_node *rb_right;
 struct rb_node *rb_left;
} __attribute__((aligned(sizeof(long))));


struct rb_root {
 struct rb_node *rb_node;
};
# 61 "include/linux/rbtree.h"
extern void rb_insert_color(struct rb_node *, struct rb_root *);
extern void rb_erase(struct rb_node *, struct rb_root *);



extern struct rb_node *rb_next(const struct rb_node *);
extern struct rb_node *rb_prev(const struct rb_node *);
extern struct rb_node *rb_first(const struct rb_root *);
extern struct rb_node *rb_last(const struct rb_root *);


extern struct rb_node *rb_first_postorder(const struct rb_root *);
extern struct rb_node *rb_next_postorder(const struct rb_node *);


extern void rb_replace_node(struct rb_node *victim, struct rb_node *new,
       struct rb_root *root);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rb_link_node(struct rb_node * node, struct rb_node * parent,
    struct rb_node ** rb_link)
{
 node->__rb_parent_color = (unsigned long)parent;
 node->rb_left = node->rb_right = ((void *)0);

 *rb_link = node;
}
# 23 "include/linux/sched.h" 2

# 1 "include/linux/cpumask.h" 1
# 11 "include/linux/cpumask.h"
# 1 "include/linux/bitmap.h" 1
# 90 "include/linux/bitmap.h"
extern int __bitmap_empty(const unsigned long *bitmap, unsigned int nbits);
extern int __bitmap_full(const unsigned long *bitmap, unsigned int nbits);
extern int __bitmap_equal(const unsigned long *bitmap1,
     const unsigned long *bitmap2, unsigned int nbits);
extern void __bitmap_complement(unsigned long *dst, const unsigned long *src,
   unsigned int nbits);
extern void __bitmap_shift_right(unsigned long *dst, const unsigned long *src,
    unsigned int shift, unsigned int nbits);
extern void __bitmap_shift_left(unsigned long *dst, const unsigned long *src,
    unsigned int shift, unsigned int nbits);
extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
   const unsigned long *bitmap2, unsigned int nbits);
extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
   const unsigned long *bitmap2, unsigned int nbits);
extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1,
   const unsigned long *bitmap2, unsigned int nbits);
extern int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,
   const unsigned long *bitmap2, unsigned int nbits);
extern int __bitmap_intersects(const unsigned long *bitmap1,
   const unsigned long *bitmap2, unsigned int nbits);
extern int __bitmap_subset(const unsigned long *bitmap1,
   const unsigned long *bitmap2, unsigned int nbits);
extern int __bitmap_weight(const unsigned long *bitmap, unsigned int nbits);

extern void bitmap_set(unsigned long *map, unsigned int start, int len);
extern void bitmap_clear(unsigned long *map, unsigned int start, int len);

extern unsigned long bitmap_find_next_zero_area_off(unsigned long *map,
          unsigned long size,
          unsigned long start,
          unsigned int nr,
          unsigned long align_mask,
          unsigned long align_offset);
# 136 "include/linux/bitmap.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
bitmap_find_next_zero_area(unsigned long *map,
      unsigned long size,
      unsigned long start,
      unsigned int nr,
      unsigned long align_mask)
{
 return bitmap_find_next_zero_area_off(map, size, start, nr,
           align_mask, 0);
}

extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user,
   unsigned long *dst, int nbits);
extern int bitmap_parse_user(const char *ubuf, unsigned int ulen,
   unsigned long *dst, int nbits);
extern int bitmap_parselist(const char *buf, unsigned long *maskp,
   int nmaskbits);
extern int bitmap_parselist_user(const char *ubuf, unsigned int ulen,
   unsigned long *dst, int nbits);
extern void bitmap_remap(unsigned long *dst, const unsigned long *src,
  const unsigned long *old, const unsigned long *new, unsigned int nbits);
extern int bitmap_bitremap(int oldbit,
  const unsigned long *old, const unsigned long *new, int bits);
extern void bitmap_onto(unsigned long *dst, const unsigned long *orig,
  const unsigned long *relmap, unsigned int bits);
extern void bitmap_fold(unsigned long *dst, const unsigned long *orig,
  unsigned int sz, unsigned int nbits);
extern int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order);
extern void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order);
extern int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order);

extern void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits);



extern unsigned int bitmap_ord_to_pos(const unsigned long *bitmap, unsigned int ord, unsigned int nbits);
extern int bitmap_print_to_pagebuf(bool list, char *buf,
       const unsigned long *maskp, int nmaskbits);
# 185 "include/linux/bitmap.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_zero(unsigned long *dst, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = 0UL;
 else {
  unsigned int len = (((nbits) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))) * sizeof(unsigned long);
  __builtin_memset(dst, 0, len);
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_fill(unsigned long *dst, unsigned int nbits)
{
 unsigned int nlongs = (((nbits) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)));
 if (!(__builtin_constant_p(nbits) && (nbits) <= 64)) {
  unsigned int len = (nlongs - 1) * sizeof(unsigned long);
  __builtin_memset(dst, 0xff, len);
 }
 dst[nlongs - 1] = ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_copy(unsigned long *dst, const unsigned long *src,
   unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = *src;
 else {
  unsigned int len = (((nbits) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))) * sizeof(unsigned long);
  __builtin_memcpy(dst, src, len);
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_and(unsigned long *dst, const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return (*dst = *src1 & *src2 & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL )) != 0;
 return __bitmap_and(dst, src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_or(unsigned long *dst, const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = *src1 | *src2;
 else
  __bitmap_or(dst, src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_xor(unsigned long *dst, const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = *src1 ^ *src2;
 else
  __bitmap_xor(dst, src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_andnot(unsigned long *dst, const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return (*dst = *src1 & ~(*src2) & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL )) != 0;
 return __bitmap_andnot(dst, src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_complement(unsigned long *dst, const unsigned long *src,
   unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = ~(*src);
 else
  __bitmap_complement(dst, src, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_equal(const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return ! ((*src1 ^ *src2) & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL ));
 else
  return __bitmap_equal(src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_intersects(const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return ((*src1 & *src2) & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL )) != 0;
 else
  return __bitmap_intersects(src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_subset(const unsigned long *src1,
   const unsigned long *src2, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return ! ((*src1 & ~(*src2)) & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL ));
 else
  return __bitmap_subset(src1, src2, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_empty(const unsigned long *src, unsigned nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return ! (*src & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL ));
 else
  return __bitmap_empty(src, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_full(const unsigned long *src, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return ! (~(*src) & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL ));
 else
  return __bitmap_full(src, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_weight(const unsigned long *src, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  return hweight_long(*src & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL ));
 return __bitmap_weight(src, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_shift_right(unsigned long *dst, const unsigned long *src,
    unsigned int shift, int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = (*src & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL )) >> shift;
 else
  __bitmap_shift_right(dst, src, shift, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_shift_left(unsigned long *dst, const unsigned long *src,
    unsigned int shift, unsigned int nbits)
{
 if ((__builtin_constant_p(nbits) && (nbits) <= 64))
  *dst = (*src << shift) & ( ((nbits) % 64) ? (1UL<<((nbits) % 64))-1 : ~0UL );
 else
  __bitmap_shift_left(dst, src, shift, nbits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_parse(const char *buf, unsigned int buflen,
   unsigned long *maskp, int nmaskbits)
{
 return __bitmap_parse(buf, buflen, 0, maskp, nmaskbits);
}
# 12 "include/linux/cpumask.h" 2


typedef struct cpumask { unsigned long bits[(((128) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))]; } cpumask_t;
# 36 "include/linux/cpumask.h"
extern int nr_cpu_ids;
# 87 "include/linux/cpumask.h"
extern const struct cpumask *const cpu_possible_mask;
extern const struct cpumask *const cpu_online_mask;
extern const struct cpumask *const cpu_present_mask;
extern const struct cpumask *const cpu_active_mask;
# 113 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_check(unsigned int cpu)
{



 return cpu;
}
# 173 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_first(const struct cpumask *srcp)
{
 return find_next_bit((((srcp)->bits)), (128), 0);
}
# 185 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_next(int n, const struct cpumask *srcp)
{

 if (n != -1)
  cpumask_check(n);
 return find_next_bit(((srcp)->bits), 128, n+1);
}
# 200 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_next_zero(int n, const struct cpumask *srcp)
{

 if (n != -1)
  cpumask_check(n);
 return find_next_zero_bit(((srcp)->bits), 128, n+1);
}

int cpumask_next_and(int n, const struct cpumask *, const struct cpumask *);
int cpumask_any_but(const struct cpumask *mask, unsigned int cpu);
int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp);
# 271 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
{
 set_bit(cpumask_check(cpu), ((dstp)->bits));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
{
 clear_bit(cpumask_check(cpu), ((dstp)->bits));
}
# 307 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
{
 return test_and_set_bit(cpumask_check(cpu), ((cpumask)->bits));
}
# 321 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask)
{
 return test_and_clear_bit(cpumask_check(cpu), ((cpumask)->bits));
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_setall(struct cpumask *dstp)
{
 bitmap_fill(((dstp)->bits), 128);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_clear(struct cpumask *dstp)
{
 bitmap_zero(((dstp)->bits), 128);
}
# 352 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_and(struct cpumask *dstp,
          const struct cpumask *src1p,
          const struct cpumask *src2p)
{
 return bitmap_and(((dstp)->bits), ((src1p)->bits),
           ((src2p)->bits), 128);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_or(struct cpumask *dstp, const struct cpumask *src1p,
         const struct cpumask *src2p)
{
 bitmap_or(((dstp)->bits), ((src1p)->bits),
          ((src2p)->bits), 128);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_xor(struct cpumask *dstp,
          const struct cpumask *src1p,
          const struct cpumask *src2p)
{
 bitmap_xor(((dstp)->bits), ((src1p)->bits),
           ((src2p)->bits), 128);
}
# 395 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_andnot(struct cpumask *dstp,
      const struct cpumask *src1p,
      const struct cpumask *src2p)
{
 return bitmap_andnot(((dstp)->bits), ((src1p)->bits),
       ((src2p)->bits), 128);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_complement(struct cpumask *dstp,
          const struct cpumask *srcp)
{
 bitmap_complement(((dstp)->bits), ((srcp)->bits),
           128);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpumask_equal(const struct cpumask *src1p,
    const struct cpumask *src2p)
{
 return bitmap_equal(((src1p)->bits), ((src2p)->bits),
       128);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpumask_intersects(const struct cpumask *src1p,
         const struct cpumask *src2p)
{
 return bitmap_intersects(((src1p)->bits), ((src2p)->bits),
            128);
}
# 446 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_subset(const struct cpumask *src1p,
     const struct cpumask *src2p)
{
 return bitmap_subset(((src1p)->bits), ((src2p)->bits),
        128);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpumask_empty(const struct cpumask *srcp)
{
 return bitmap_empty(((srcp)->bits), 128);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpumask_full(const struct cpumask *srcp)
{
 return bitmap_full(((srcp)->bits), 128);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_weight(const struct cpumask *srcp)
{
 return bitmap_weight(((srcp)->bits), 128);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_shift_right(struct cpumask *dstp,
           const struct cpumask *srcp, int n)
{
 bitmap_shift_right(((dstp)->bits), ((srcp)->bits), n,
            128);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_shift_left(struct cpumask *dstp,
          const struct cpumask *srcp, int n)
{
 bitmap_shift_left(((dstp)->bits), ((srcp)->bits), n,
           128);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_copy(struct cpumask *dstp,
    const struct cpumask *srcp)
{
 bitmap_copy(((dstp)->bits), ((srcp)->bits), 128);
}
# 557 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_parse_user(const char *buf, int len,
         struct cpumask *dstp)
{
 return bitmap_parse_user(buf, len, ((dstp)->bits), nr_cpu_ids);
}
# 571 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_parselist_user(const char *buf, int len,
         struct cpumask *dstp)
{
 return bitmap_parselist_user(buf, len, ((dstp)->bits),
         nr_cpu_ids);
}
# 585 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_parse(const char *buf, struct cpumask *dstp)
{
 char *nl = strchr(buf, '\n');
 unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf);

 return bitmap_parse(buf, len, ((dstp)->bits), nr_cpu_ids);
}
# 600 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpulist_parse(const char *buf, struct cpumask *dstp)
{
 return bitmap_parselist(buf, ((dstp)->bits), nr_cpu_ids);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) size_t cpumask_size(void)
{


 return (((128) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))) * sizeof(long);
}
# 668 "include/linux/cpumask.h"
typedef struct cpumask cpumask_var_t[1];



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
{
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags,
       int node)
{
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
{
 cpumask_clear(*mask);
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zalloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags,
       int node)
{
 cpumask_clear(*mask);
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void alloc_bootmem_cpumask_var(cpumask_var_t *mask)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void free_cpumask_var(cpumask_var_t mask)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void free_bootmem_cpumask_var(cpumask_var_t mask)
{
}




extern const unsigned long cpu_all_bits[(((128) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))];
# 722 "include/linux/cpumask.h"
void set_cpu_possible(unsigned int cpu, bool possible);
void set_cpu_present(unsigned int cpu, bool present);
void set_cpu_online(unsigned int cpu, bool online);
void set_cpu_active(unsigned int cpu, bool active);
void init_cpu_present(const struct cpumask *src);
void init_cpu_possible(const struct cpumask *src);
void init_cpu_online(const struct cpumask *src);
# 744 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __check_is_bitmap(const unsigned long *bitmap)
{
 return 1;
}
# 756 "include/linux/cpumask.h"
extern const unsigned long
 cpu_bit_bitmap[64 +1][(((128) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))];

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cpumask *get_cpu_mask(unsigned int cpu)
{
 const unsigned long *p = cpu_bit_bitmap[1 + cpu % 64];
 p -= cpu / 64;
 return ((struct cpumask *)(1 ? (p) : (void *)sizeof(__check_is_bitmap(p))));
}
# 793 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ssize_t
cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask)
{
 return bitmap_print_to_pagebuf(list, buf, ((mask)->bits),
          nr_cpu_ids);
}
# 844 "include/linux/cpumask.h"
int __first_cpu(const cpumask_t *srcp);
int __next_cpu(int n, const cpumask_t *srcp);
# 862 "include/linux/cpumask.h"
int __next_cpu_nr(int n, const cpumask_t *srcp);
# 873 "include/linux/cpumask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpu_set(int cpu, volatile cpumask_t *dstp)
{
 set_bit(cpu, dstp->bits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpu_clear(int cpu, volatile cpumask_t *dstp)
{
 clear_bit(cpu, dstp->bits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpus_setall(cpumask_t *dstp, unsigned int nbits)
{
 bitmap_fill(dstp->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpus_clear(cpumask_t *dstp, unsigned int nbits)
{
 bitmap_zero(dstp->bits, nbits);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpu_test_and_set(int cpu, cpumask_t *addr)
{
 return test_and_set_bit(cpu, addr->bits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_equal(const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 return bitmap_equal(src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_intersects(const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 return bitmap_intersects(src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_subset(const cpumask_t *src1p,
     const cpumask_t *src2p, unsigned int nbits)
{
 return bitmap_subset(src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_empty(const cpumask_t *srcp, unsigned int nbits)
{
 return bitmap_empty(srcp->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __cpus_weight(const cpumask_t *srcp, unsigned int nbits)
{
 return bitmap_weight(srcp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __cpus_shift_left(cpumask_t *dstp,
     const cpumask_t *srcp, int n, int nbits)
{
 bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
}
# 25 "include/linux/sched.h" 2

# 1 "include/linux/nodemask.h" 1
# 93 "include/linux/nodemask.h"
# 1 "include/linux/numa.h" 1
# 94 "include/linux/nodemask.h" 2

typedef struct { unsigned long bits[((((1 << 4)) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))]; } nodemask_t;
extern nodemask_t _unused_nodemask_arg_;
# 116 "include/linux/nodemask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __node_set(int node, volatile nodemask_t *dstp)
{
 set_bit(node, dstp->bits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __node_clear(int node, volatile nodemask_t *dstp)
{
 clear_bit(node, dstp->bits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_setall(nodemask_t *dstp, unsigned int nbits)
{
 bitmap_fill(dstp->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_clear(nodemask_t *dstp, unsigned int nbits)
{
 bitmap_zero(dstp->bits, nbits);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __node_test_and_set(int node, nodemask_t *addr)
{
 return test_and_set_bit(node, addr->bits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_and(nodemask_t *dstp, const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_or(nodemask_t *dstp, const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_xor(nodemask_t *dstp, const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_andnot(nodemask_t *dstp, const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_complement(nodemask_t *dstp,
     const nodemask_t *srcp, unsigned int nbits)
{
 bitmap_complement(dstp->bits, srcp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_equal(const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 return bitmap_equal(src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_intersects(const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 return bitmap_intersects(src1p->bits, src2p->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_subset(const nodemask_t *src1p,
     const nodemask_t *src2p, unsigned int nbits)
{
 return bitmap_subset(src1p->bits, src2p->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_empty(const nodemask_t *srcp, unsigned int nbits)
{
 return bitmap_empty(srcp->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_full(const nodemask_t *srcp, unsigned int nbits)
{
 return bitmap_full(srcp->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_weight(const nodemask_t *srcp, unsigned int nbits)
{
 return bitmap_weight(srcp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_shift_right(nodemask_t *dstp,
     const nodemask_t *srcp, int n, int nbits)
{
 bitmap_shift_right(dstp->bits, srcp->bits, n, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_shift_left(nodemask_t *dstp,
     const nodemask_t *srcp, int n, int nbits)
{
 bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __first_node(const nodemask_t *srcp)
{
 return ({ int __min1 = ((1 << 4)); int __min2 = (find_next_bit((srcp->bits), ((1 << 4)), 0)); __min1 < __min2 ? __min1: __min2; });
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __next_node(int n, const nodemask_t *srcp)
{
 return ({ int __min1 = ((1 << 4)); int __min2 = (find_next_bit(srcp->bits, (1 << 4), n+1)); __min1 < __min2 ? __min1: __min2; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_nodemask_of_node(nodemask_t *mask, int node)
{
 __nodes_clear(&(*mask), (1 << 4));
 __node_set((node), &(*mask));
}
# 280 "include/linux/nodemask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __first_unset_node(const nodemask_t *maskp)
{
 return ({ int __min1 = ((1 << 4)); int __min2 = (find_next_zero_bit((maskp->bits), ((1 << 4)), 0)); __min1 < __min2 ? __min1: __min2; })
                                                  ;
}
# 314 "include/linux/nodemask.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodemask_parse_user(const char *buf, int len,
     nodemask_t *dstp, int nbits)
{
 return bitmap_parse_user(buf, len, dstp->bits, nbits);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodelist_parse(const char *buf, nodemask_t *dstp, int nbits)
{
 return bitmap_parselist(buf, dstp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __node_remap(int oldbit,
  const nodemask_t *oldp, const nodemask_t *newp, int nbits)
{
 return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_remap(nodemask_t *dstp, const nodemask_t *srcp,
  const nodemask_t *oldp, const nodemask_t *newp, int nbits)
{
 bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_onto(nodemask_t *dstp, const nodemask_t *origp,
  const nodemask_t *relmapp, int nbits)
{
 bitmap_onto(dstp->bits, origp->bits, relmapp->bits, nbits);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_fold(nodemask_t *dstp, const nodemask_t *origp,
  int sz, int nbits)
{
 bitmap_fold(dstp->bits, origp->bits, sz, nbits);
}
# 372 "include/linux/nodemask.h"
enum node_states {
 N_POSSIBLE,
 N_ONLINE,
 N_NORMAL_MEMORY,



 N_HIGH_MEMORY = N_NORMAL_MEMORY,




 N_MEMORY = N_HIGH_MEMORY,

 N_CPU,
 NR_NODE_STATES
};






extern nodemask_t node_states[NR_NODE_STATES];


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int node_state(int node, enum node_states state)
{
 return test_bit((node), (node_states[state]).bits);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void node_set_state(int node, enum node_states state)
{
 __node_set(node, &node_states[state]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void node_clear_state(int node, enum node_states state)
{
 __node_clear(node, &node_states[state]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int num_node_state(enum node_states state)
{
 return __nodes_weight(&(node_states[state]), (1 << 4));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int next_online_node(int nid)
{
 return __next_node((nid), &(node_states[N_ONLINE]));
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int next_memory_node(int nid)
{
 return __next_node((nid), &(node_states[N_MEMORY]));
}

extern int nr_node_ids;
extern int nr_online_nodes;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void node_set_online(int nid)
{
 node_set_state(nid, N_ONLINE);
 nr_online_nodes = num_node_state(N_ONLINE);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void node_set_offline(int nid)
{
 node_clear_state(nid, N_ONLINE);
 nr_online_nodes = num_node_state(N_ONLINE);
}
# 482 "include/linux/nodemask.h"
extern int node_random(const nodemask_t *maskp);
# 516 "include/linux/nodemask.h"
struct nodemask_scratch {
 nodemask_t mask1;
 nodemask_t mask2;
};
# 27 "include/linux/sched.h" 2
# 1 "include/linux/mm_types.h" 1



# 1 "include/linux/auxvec.h" 1



# 1 "include/uapi/linux/auxvec.h" 1



# 1 "./arch/sparc/include/uapi/asm/auxvec.h" 1
# 5 "include/uapi/linux/auxvec.h" 2
# 5 "include/linux/auxvec.h" 2
# 5 "include/linux/mm_types.h" 2





# 1 "include/linux/rwsem.h" 1
# 18 "include/linux/rwsem.h"
# 1 "include/linux/osq_lock.h" 1







struct optimistic_spin_node {
 struct optimistic_spin_node *next, *prev;
 int locked;
 int cpu;
};

struct optimistic_spin_queue {




 atomic_t tail;
};






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void osq_lock_init(struct optimistic_spin_queue *lock)
{
 (((&lock->tail)->counter) = (0));
}

extern bool osq_lock(struct optimistic_spin_queue *lock);
extern void osq_unlock(struct optimistic_spin_queue *lock);
# 19 "include/linux/rwsem.h" 2


struct rw_semaphore;





struct rw_semaphore {
 long count;
 struct list_head wait_list;
 raw_spinlock_t wait_lock;

 struct optimistic_spin_queue osq;




 struct task_struct *owner;




};

extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem);
extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *);
extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);


# 1 "./arch/sparc/include/asm/rwsem.h" 1
# 26 "./arch/sparc/include/asm/rwsem.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __down_read(struct rw_semaphore *sem)
{
 if (__builtin_expect(!!(atomic64_add_return(1, (atomic64_t *)(&sem->count)) <= 0L), 0))
  rwsem_down_read_failed(sem);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __down_read_trylock(struct rw_semaphore *sem)
{
 long tmp;

 while ((tmp = sem->count) >= 0L) {
  if (tmp == ({ __typeof__(*(&sem->count)) _o_ = (tmp); __typeof__(*(&sem->count)) _n_ = (tmp + 0x00000001L); (__typeof__(*(&sem->count))) __cmpxchg((&sem->count), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&sem->count))); })
                                    ) {
   return 1;
  }
 }
 return 0;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __down_write_nested(struct rw_semaphore *sem, int subclass)
{
 long tmp;

 tmp = atomic64_add_return(((-0xffffffffL -1) + 0x00000001L),
      (atomic64_t *)(&sem->count));
 if (__builtin_expect(!!(tmp != ((-0xffffffffL -1) + 0x00000001L)), 0))
  rwsem_down_write_failed(sem);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __down_write(struct rw_semaphore *sem)
{
 __down_write_nested(sem, 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __down_write_trylock(struct rw_semaphore *sem)
{
 long tmp;

 tmp = ({ __typeof__(*(&sem->count)) _o_ = (0x00000000L); __typeof__(*(&sem->count)) _n_ = (((-0xffffffffL -1) + 0x00000001L)); (__typeof__(*(&sem->count))) __cmpxchg((&sem->count), (unsigned long)_o_, (unsigned long)_n_, sizeof(*(&sem->count))); })
                                ;
 return tmp == 0x00000000L;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __up_read(struct rw_semaphore *sem)
{
 long tmp;

 tmp = atomic64_sub_return(1, (atomic64_t *)(&sem->count));
 if (__builtin_expect(!!(tmp < -1L && (tmp & 0xffffffffL) == 0L), 0))
  rwsem_wake(sem);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __up_write(struct rw_semaphore *sem)
{
 if (__builtin_expect(!!(atomic64_sub_return(((-0xffffffffL -1) + 0x00000001L), (atomic64_t *)(&sem->count)) < 0L), 0)
                                        )
  rwsem_wake(sem);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
{
 atomic64_add(delta, (atomic64_t *)(&sem->count));
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __downgrade_write(struct rw_semaphore *sem)
{
 long tmp;

 tmp = atomic64_add_return(-(-0xffffffffL -1), (atomic64_t *)(&sem->count));
 if (tmp < 0L)
  rwsem_downgrade_wake(sem);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
{
 return atomic64_add_return(delta, (atomic64_t *)(&sem->count));
}
# 51 "include/linux/rwsem.h" 2


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rwsem_is_locked(struct rw_semaphore *sem)
{
 return sem->count != 0;
}
# 84 "include/linux/rwsem.h"
extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
    struct lock_class_key *key);
# 100 "include/linux/rwsem.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rwsem_is_contended(struct rw_semaphore *sem)
{
 return !list_empty(&sem->wait_list);
}




extern void down_read(struct rw_semaphore *sem);




extern int down_read_trylock(struct rw_semaphore *sem);




extern void down_write(struct rw_semaphore *sem);




extern int down_write_trylock(struct rw_semaphore *sem);




extern void up_read(struct rw_semaphore *sem);




extern void up_write(struct rw_semaphore *sem);




extern void downgrade_write(struct rw_semaphore *sem);
# 11 "include/linux/mm_types.h" 2
# 1 "include/linux/completion.h" 1
# 11 "include/linux/completion.h"
# 1 "include/linux/wait.h" 1
# 9 "include/linux/wait.h"
# 1 "./arch/sparc/include/asm/current.h" 1
# 17 "./arch/sparc/include/asm/current.h"
register struct task_struct *current asm("g4");
# 10 "include/linux/wait.h" 2
# 1 "include/uapi/linux/wait.h" 1
# 11 "include/linux/wait.h" 2

typedef struct __wait_queue wait_queue_t;
typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key);
int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key);





struct __wait_queue {
 unsigned int flags;
 void *private;
 wait_queue_func_t func;
 struct list_head task_list;
};

struct wait_bit_key {
 void *flags;
 int bit_nr;

 unsigned long timeout;
};

struct wait_bit_queue {
 struct wait_bit_key key;
 wait_queue_t wait;
};

struct __wait_queue_head {
 spinlock_t lock;
 struct list_head task_list;
};
typedef struct __wait_queue_head wait_queue_head_t;

struct task_struct;
# 72 "include/linux/wait.h"
extern void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *);
# 90 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p)
{
 q->flags = 0;
 q->private = p;
 q->func = default_wake_function;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
init_waitqueue_func_entry(wait_queue_t *q, wait_queue_func_t func)
{
 q->flags = 0;
 q->private = ((void *)0);
 q->func = func;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int waitqueue_active(wait_queue_head_t *q)
{
 return !list_empty(&q->task_list);
}

extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait);
extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait);
extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
{
 list_add(&new->task_list, &head->task_list);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
__add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait)
{
 wait->flags |= 0x01;
 __add_wait_queue(q, wait);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __add_wait_queue_tail(wait_queue_head_t *head,
      wait_queue_t *new)
{
 list_add_tail(&new->task_list, &head->task_list);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
__add_wait_queue_tail_exclusive(wait_queue_head_t *q, wait_queue_t *wait)
{
 wait->flags |= 0x01;
 __add_wait_queue_tail(q, wait);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
__remove_wait_queue(wait_queue_head_t *head, wait_queue_t *old)
{
 list_del(&old->task_list);
}

typedef int wait_bit_action_f(struct wait_bit_key *);
void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key);
void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
void __wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr);
void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr);
void __wake_up_bit(wait_queue_head_t *, void *, int);
int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, wait_bit_action_f *, unsigned);
int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, wait_bit_action_f *, unsigned);
void wake_up_bit(void *, int);
void wake_up_atomic_t(atomic_t *);
int out_of_line_wait_on_bit(void *, int, wait_bit_action_f *, unsigned);
int out_of_line_wait_on_bit_timeout(void *, int, wait_bit_action_f *, unsigned, unsigned long);
int out_of_line_wait_on_bit_lock(void *, int, wait_bit_action_f *, unsigned);
int out_of_line_wait_on_atomic_t(atomic_t *, int (*)(atomic_t *), unsigned);
wait_queue_head_t *bit_waitqueue(void *, int);
# 911 "include/linux/wait.h"
void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state);
void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state);
long prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state);
void finish_wait(wait_queue_head_t *q, wait_queue_t *wait);
void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, unsigned int mode, void *key);
long wait_woken(wait_queue_t *wait, unsigned mode, long timeout);
int woken_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
# 950 "include/linux/wait.h"
extern int bit_wait(struct wait_bit_key *);
extern int bit_wait_io(struct wait_bit_key *);
extern int bit_wait_timeout(struct wait_bit_key *);
extern int bit_wait_io_timeout(struct wait_bit_key *);
# 971 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit(void *word, int bit, unsigned mode)
{
 do { _cond_resched(); } while (0);
 if (!test_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit(word, bit,
           bit_wait,
           mode);
}
# 996 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit_io(void *word, int bit, unsigned mode)
{
 do { _cond_resched(); } while (0);
 if (!test_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit(word, bit,
           bit_wait_io,
           mode);
}
# 1022 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit_timeout(void *word, int bit, unsigned mode, unsigned long timeout)
{
 do { _cond_resched(); } while (0);
 if (!test_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit_timeout(word, bit,
            bit_wait_timeout,
            mode, timeout);
}
# 1049 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit_action(void *word, int bit, wait_bit_action_f *action, unsigned mode)
{
 do { _cond_resched(); } while (0);
 if (!test_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit(word, bit, action, mode);
}
# 1077 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit_lock(void *word, int bit, unsigned mode)
{
 do { _cond_resched(); } while (0);
 if (!test_and_set_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit_lock(word, bit, bit_wait, mode);
}
# 1101 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit_lock_io(void *word, int bit, unsigned mode)
{
 do { _cond_resched(); } while (0);
 if (!test_and_set_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit_lock(word, bit, bit_wait_io, mode);
}
# 1127 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
wait_on_bit_lock_action(void *word, int bit, wait_bit_action_f *action, unsigned mode)
{
 do { _cond_resched(); } while (0);
 if (!test_and_set_bit(bit, word))
  return 0;
 return out_of_line_wait_on_bit_lock(word, bit, action, mode);
}
# 1146 "include/linux/wait.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode)
{
 do { _cond_resched(); } while (0);
 if ((*({ __attribute__((unused)) typeof((val)->counter) __var = ( typeof((val)->counter)) 0; (volatile typeof((val)->counter) *)&((val)->counter); })) == 0)
  return 0;
 return out_of_line_wait_on_atomic_t(val, action, mode);
}
# 12 "include/linux/completion.h" 2
# 25 "include/linux/completion.h"
struct completion {
 unsigned int done;
 wait_queue_head_t wait;
};
# 73 "include/linux/completion.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_completion(struct completion *x)
{
 x->done = 0;
 do { static struct lock_class_key __key; __init_waitqueue_head((&x->wait), "&x->wait", &__key); } while (0);
}
# 86 "include/linux/completion.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void reinit_completion(struct completion *x)
{
 x->done = 0;
}

extern void wait_for_completion(struct completion *);
extern void wait_for_completion_io(struct completion *);
extern int wait_for_completion_interruptible(struct completion *x);
extern int wait_for_completion_killable(struct completion *x);
extern unsigned long wait_for_completion_timeout(struct completion *x,
         unsigned long timeout);
extern unsigned long wait_for_completion_io_timeout(struct completion *x,
          unsigned long timeout);
extern long wait_for_completion_interruptible_timeout(
 struct completion *x, unsigned long timeout);
extern long wait_for_completion_killable_timeout(
 struct completion *x, unsigned long timeout);
extern bool try_wait_for_completion(struct completion *x);
extern bool completion_done(struct completion *x);

extern void complete(struct completion *);
extern void complete_all(struct completion *);
# 12 "include/linux/mm_types.h" 2

# 1 "include/linux/uprobes.h" 1
# 31 "include/linux/uprobes.h"
struct vm_area_struct;
struct mm_struct;
struct inode;
struct notifier_block;
struct page;






enum uprobe_filter_ctx {
 UPROBE_FILTER_REGISTER,
 UPROBE_FILTER_UNREGISTER,
 UPROBE_FILTER_MMAP,
};

struct uprobe_consumer {
 int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs);
 int (*ret_handler)(struct uprobe_consumer *self,
    unsigned long func,
    struct pt_regs *regs);
 bool (*filter)(struct uprobe_consumer *self,
    enum uprobe_filter_ctx ctx,
    struct mm_struct *mm);

 struct uprobe_consumer *next;
};
# 135 "include/linux/uprobes.h"
struct uprobes_state {
};



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc)
{
 return -90;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool add)
{
 return -90;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int uprobe_mmap(struct vm_area_struct *vma)
{
 return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_start_dup_mmap(void)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_end_dup_mmap(void)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_notify_resume(struct pt_regs *regs)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uprobe_deny_signal(void)
{
 return false;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_free_utask(struct task_struct *t)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_copy_process(struct task_struct *t, unsigned long flags)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_clear_state(struct mm_struct *mm)
{
}
# 14 "include/linux/mm_types.h" 2
# 1 "include/linux/page-flags-layout.h" 1




# 1 "include/generated/bounds.h" 1
# 6 "include/linux/page-flags-layout.h" 2
# 25 "include/linux/page-flags-layout.h"
# 1 "./arch/sparc/include/asm/sparsemem.h" 1
# 26 "include/linux/page-flags-layout.h" 2
# 15 "include/linux/mm_types.h" 2

# 1 "./arch/sparc/include/asm/mmu.h" 1



# 1 "./arch/sparc/include/asm/mmu_64.h" 1





# 1 "./arch/sparc/include/asm/hypervisor.h" 1
# 101 "./arch/sparc/include/asm/hypervisor.h"
void sun4v_mach_exit(unsigned long exit_code);
# 130 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_mach_desc(unsigned long buffer_pa,
         unsigned long buf_len,
         unsigned long *real_buf_len);
# 151 "./arch/sparc/include/asm/hypervisor.h"
void sun4v_mach_sir(void);
# 207 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_mach_set_watchdog(unsigned long timeout,
          unsigned long *orig_timeout);
# 253 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_cpu_start(unsigned long cpuid,
         unsigned long pc,
         unsigned long rtba,
         unsigned long arg0);
# 281 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_cpu_stop(unsigned long cpuid);
# 298 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_cpu_yield(void);
# 344 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_cpu_qconf(unsigned long type,
         unsigned long queue_paddr,
         unsigned long num_queue_entries);
# 397 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_cpu_mondo_send(unsigned long cpu_count,
       unsigned long cpu_list_pa,
       unsigned long mondo_block_pa);
# 430 "./arch/sparc/include/asm/hypervisor.h"
long sun4v_cpu_state(unsigned long cpuid);
# 466 "./arch/sparc/include/asm/hypervisor.h"
struct hv_tsb_descr {
 unsigned short pgsz_idx;
 unsigned short assoc;
 unsigned int num_ttes;
 unsigned int ctx_idx;
 unsigned int pgsz_mask;
 unsigned long tsb_base;
 unsigned long resv;
};
# 517 "./arch/sparc/include/asm/hypervisor.h"
struct hv_fault_status {
 unsigned long i_fault_type;
 unsigned long i_fault_addr;
 unsigned long i_fault_ctx;
 unsigned long i_reserved[5];
 unsigned long d_fault_type;
 unsigned long d_fault_addr;
 unsigned long d_fault_ctx;
 unsigned long d_reserved[5];
};
# 630 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_mmu_tsb_ctx0(unsigned long num_descriptions,
     unsigned long tsb_desc_ra);
# 715 "./arch/sparc/include/asm/hypervisor.h"
void sun4v_mmu_demap_all(void);
# 745 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_mmu_map_perm_addr(unsigned long vaddr,
          unsigned long set_to_zero,
          unsigned long tte,
          unsigned long flags);
# 950 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_tod_get(unsigned long *time);
# 967 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_tod_set(unsigned long time);
# 1043 "./arch/sparc/include/asm/hypervisor.h"
long sun4v_con_getchar(long *status);
long sun4v_con_putchar(long c);
long sun4v_con_read(unsigned long buffer,
      unsigned long size,
      unsigned long *bytes_read);
unsigned long sun4v_con_write(unsigned long buffer,
         unsigned long size,
         unsigned long *bytes_written);
# 1085 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_mach_set_soft_state(unsigned long soft_state,
            unsigned long msg_string_ra);
# 1164 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_svc_send(unsigned long svc_id,
        unsigned long buffer,
        unsigned long buffer_size,
        unsigned long *sent_bytes);
unsigned long sun4v_svc_recv(unsigned long svc_id,
        unsigned long buffer,
        unsigned long buffer_size,
        unsigned long *recv_bytes);
unsigned long sun4v_svc_getstatus(unsigned long svc_id,
      unsigned long *status_bits);
unsigned long sun4v_svc_setstatus(unsigned long svc_id,
      unsigned long status_bits);
unsigned long sun4v_svc_clrstatus(unsigned long svc_id,
      unsigned long status_bits);
# 1194 "./arch/sparc/include/asm/hypervisor.h"
struct hv_trap_trace_control {
 unsigned long head_offset;
 unsigned long tail_offset;
 unsigned long __reserved[0x30 / sizeof(unsigned long)];
};
# 1213 "./arch/sparc/include/asm/hypervisor.h"
struct hv_trap_trace_entry {
 unsigned char type;
 unsigned char hpstate;
 unsigned char tl;
 unsigned char gl;
 unsigned short tt;
 unsigned short tag;
 unsigned long tstate;
 unsigned long tick;
 unsigned long tpc;
 unsigned long f1;
 unsigned long f2;
 unsigned long f3;
 unsigned long f4;
};
# 1463 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_devino_to_sysino(unsigned long devhandle,
         unsigned long devino);
# 1481 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_intr_getenabled(unsigned long sysino);
# 1497 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_intr_setenabled(unsigned long sysino,
        unsigned long intr_enabled);
# 1514 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_intr_getstate(unsigned long sysino);
# 1534 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_intr_setstate(unsigned long sysino, unsigned long intr_state);
# 1552 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_intr_gettarget(unsigned long sysino);
# 1569 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cpuid);
# 1653 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_vintr_get_cookie(unsigned long dev_handle,
         unsigned long dev_ino,
         unsigned long *cookie);
unsigned long sun4v_vintr_set_cookie(unsigned long dev_handle,
         unsigned long dev_ino,
         unsigned long cookie);
unsigned long sun4v_vintr_get_valid(unsigned long dev_handle,
        unsigned long dev_ino,
        unsigned long *valid);
unsigned long sun4v_vintr_set_valid(unsigned long dev_handle,
        unsigned long dev_ino,
        unsigned long valid);
unsigned long sun4v_vintr_get_state(unsigned long dev_handle,
        unsigned long dev_ino,
        unsigned long *state);
unsigned long sun4v_vintr_set_state(unsigned long dev_handle,
        unsigned long dev_ino,
        unsigned long state);
unsigned long sun4v_vintr_get_target(unsigned long dev_handle,
         unsigned long dev_ino,
         unsigned long *cpuid);
unsigned long sun4v_vintr_set_target(unsigned long dev_handle,
         unsigned long dev_ino,
         unsigned long cpuid);
# 2550 "./arch/sparc/include/asm/hypervisor.h"
struct ldc_mtable_entry {
 unsigned long mte;
 unsigned long cookie;
};
# 2633 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_ldc_tx_qconf(unsigned long channel,
     unsigned long ra,
     unsigned long num_entries);
unsigned long sun4v_ldc_tx_qinfo(unsigned long channel,
     unsigned long *ra,
     unsigned long *num_entries);
unsigned long sun4v_ldc_tx_get_state(unsigned long channel,
         unsigned long *head_off,
         unsigned long *tail_off,
         unsigned long *chan_state);
unsigned long sun4v_ldc_tx_set_qtail(unsigned long channel,
         unsigned long tail_off);
unsigned long sun4v_ldc_rx_qconf(unsigned long channel,
     unsigned long ra,
     unsigned long num_entries);
unsigned long sun4v_ldc_rx_qinfo(unsigned long channel,
     unsigned long *ra,
     unsigned long *num_entries);
unsigned long sun4v_ldc_rx_get_state(unsigned long channel,
         unsigned long *head_off,
         unsigned long *tail_off,
         unsigned long *chan_state);
unsigned long sun4v_ldc_rx_set_qhead(unsigned long channel,
         unsigned long head_off);
unsigned long sun4v_ldc_set_map_table(unsigned long channel,
          unsigned long ra,
          unsigned long num_entries);
unsigned long sun4v_ldc_get_map_table(unsigned long channel,
          unsigned long *ra,
          unsigned long *num_entries);
unsigned long sun4v_ldc_copy(unsigned long channel,
        unsigned long dir_code,
        unsigned long tgt_raddr,
        unsigned long lcl_raddr,
        unsigned long len,
        unsigned long *actual_len);
unsigned long sun4v_ldc_mapin(unsigned long channel,
         unsigned long cookie,
         unsigned long *ra,
         unsigned long *perm);
unsigned long sun4v_ldc_unmap(unsigned long ra);
unsigned long sun4v_ldc_revoke(unsigned long channel,
          unsigned long cookie,
          unsigned long mte_cookie);
# 2733 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_niagara_getperf(unsigned long reg,
        unsigned long *val);
unsigned long sun4v_niagara_setperf(unsigned long reg,
        unsigned long val);
unsigned long sun4v_niagara2_getperf(unsigned long reg,
         unsigned long *val);
unsigned long sun4v_niagara2_setperf(unsigned long reg,
         unsigned long val);
# 2750 "./arch/sparc/include/asm/hypervisor.h"
struct hv_mmu_statistics {
 unsigned long immu_tsb_hits_ctx0_8k_tte;
 unsigned long immu_tsb_ticks_ctx0_8k_tte;
 unsigned long immu_tsb_hits_ctx0_64k_tte;
 unsigned long immu_tsb_ticks_ctx0_64k_tte;
 unsigned long __reserved1[2];
 unsigned long immu_tsb_hits_ctx0_4mb_tte;
 unsigned long immu_tsb_ticks_ctx0_4mb_tte;
 unsigned long __reserved2[2];
 unsigned long immu_tsb_hits_ctx0_256mb_tte;
 unsigned long immu_tsb_ticks_ctx0_256mb_tte;
 unsigned long __reserved3[4];
 unsigned long immu_tsb_hits_ctxnon0_8k_tte;
 unsigned long immu_tsb_ticks_ctxnon0_8k_tte;
 unsigned long immu_tsb_hits_ctxnon0_64k_tte;
 unsigned long immu_tsb_ticks_ctxnon0_64k_tte;
 unsigned long __reserved4[2];
 unsigned long immu_tsb_hits_ctxnon0_4mb_tte;
 unsigned long immu_tsb_ticks_ctxnon0_4mb_tte;
 unsigned long __reserved5[2];
 unsigned long immu_tsb_hits_ctxnon0_256mb_tte;
 unsigned long immu_tsb_ticks_ctxnon0_256mb_tte;
 unsigned long __reserved6[4];
 unsigned long dmmu_tsb_hits_ctx0_8k_tte;
 unsigned long dmmu_tsb_ticks_ctx0_8k_tte;
 unsigned long dmmu_tsb_hits_ctx0_64k_tte;
 unsigned long dmmu_tsb_ticks_ctx0_64k_tte;
 unsigned long __reserved7[2];
 unsigned long dmmu_tsb_hits_ctx0_4mb_tte;
 unsigned long dmmu_tsb_ticks_ctx0_4mb_tte;
 unsigned long __reserved8[2];
 unsigned long dmmu_tsb_hits_ctx0_256mb_tte;
 unsigned long dmmu_tsb_ticks_ctx0_256mb_tte;
 unsigned long __reserved9[4];
 unsigned long dmmu_tsb_hits_ctxnon0_8k_tte;
 unsigned long dmmu_tsb_ticks_ctxnon0_8k_tte;
 unsigned long dmmu_tsb_hits_ctxnon0_64k_tte;
 unsigned long dmmu_tsb_ticks_ctxnon0_64k_tte;
 unsigned long __reserved10[2];
 unsigned long dmmu_tsb_hits_ctxnon0_4mb_tte;
 unsigned long dmmu_tsb_ticks_ctxnon0_4mb_tte;
 unsigned long __reserved11[2];
 unsigned long dmmu_tsb_hits_ctxnon0_256mb_tte;
 unsigned long dmmu_tsb_ticks_ctxnon0_256mb_tte;
 unsigned long __reserved12[4];
};
# 2835 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_mmustat_conf(unsigned long ra, unsigned long *orig_ra);
unsigned long sun4v_mmustat_info(unsigned long *ra);
# 2846 "./arch/sparc/include/asm/hypervisor.h"
struct hv_ncs_queue_entry {

 unsigned long mau_control;
# 2866 "./arch/sparc/include/asm/hypervisor.h"
 unsigned long mau_mpa;


 unsigned long mau_ma;


 unsigned long mau_np;
};

struct hv_ncs_qconf_arg {
 unsigned long mid;
 unsigned long base;
 unsigned long end;
 unsigned long num_ents;
};

struct hv_ncs_qtail_update_arg {
 unsigned long mid;
 unsigned long tail;
 unsigned long syncflag;


};
# 2925 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_ncs_request(unsigned long request,
           unsigned long arg_ra,
           unsigned long arg_size);
# 2936 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_reboot_data_set(unsigned long ra,
        unsigned long len);






unsigned long sun4v_vt_get_perfreg(unsigned long reg_num,
       unsigned long *reg_val);
unsigned long sun4v_vt_set_perfreg(unsigned long reg_num,
       unsigned long reg_val);






unsigned long sun4v_t5_get_perfreg(unsigned long reg_num,
       unsigned long *reg_val);
unsigned long sun4v_t5_set_perfreg(unsigned long reg_num,
       unsigned long reg_val);
# 2995 "./arch/sparc/include/asm/hypervisor.h"
unsigned long sun4v_get_version(unsigned long group,
           unsigned long *major,
           unsigned long *minor);
unsigned long sun4v_set_version(unsigned long group,
           unsigned long major,
           unsigned long minor,
           unsigned long *actual_minor);

int sun4v_hvapi_register(unsigned long group, unsigned long major,
    unsigned long *minor);
void sun4v_hvapi_unregister(unsigned long group);
int sun4v_hvapi_get(unsigned long group,
      unsigned long *major,
      unsigned long *minor);
void sun4v_hvapi_init(void);
# 7 "./arch/sparc/include/asm/mmu_64.h" 2
# 65 "./arch/sparc/include/asm/mmu_64.h"
struct tsb {
 unsigned long tag;
 unsigned long pte;
} __attribute__((aligned(16)));

void __tsb_insert(unsigned long ent, unsigned long tag, unsigned long pte);
void tsb_flush(unsigned long ent, unsigned long tag);
void tsb_init(struct tsb *tsb, unsigned long size);

struct tsb_config {
 struct tsb *tsb;
 unsigned long tsb_rss_limit;
 unsigned long tsb_nentries;
 unsigned long tsb_reg_val;
 unsigned long tsb_map_vaddr;
 unsigned long tsb_map_pte;
};
# 92 "./arch/sparc/include/asm/mmu_64.h"
typedef struct {
 spinlock_t lock;
 unsigned long sparc64_ctx_val;
 unsigned long huge_pte_count;
 struct tsb_config tsb_block[2];
 struct hv_tsb_descr tsb_descr[2];
} mm_context_t;
# 5 "./arch/sparc/include/asm/mmu.h" 2
# 17 "include/linux/mm_types.h" 2






struct address_space;
struct mem_cgroup;






typedef void compound_page_dtor(struct page *);
# 46 "include/linux/mm_types.h"
struct page {

 unsigned long flags;

 union {
  struct address_space *mapping;






  void *s_mem;
 };


 struct {
  union {
   unsigned long index;
   void *freelist;
   bool pfmemalloc;
# 75 "include/linux/mm_types.h"
  };

  union {
# 88 "include/linux/mm_types.h"
   unsigned counters;


   struct {

    union {
# 110 "include/linux/mm_types.h"
     atomic_t _mapcount;

     struct {
      unsigned inuse:16;
      unsigned objects:15;
      unsigned frozen:1;
     };
     int units;
    };
    atomic_t _count;
   };
   unsigned int active;
  };
 };


 union {
  struct list_head lru;




  struct {
   struct page *next;

   int pages;
   int pobjects;




  };

  struct slab *slab_page;
  struct callback_head callback_head;



  struct {
   compound_page_dtor *compound_dtor;
   unsigned long compound_order;
  };




 };


 union {
  unsigned long private;
# 171 "include/linux/mm_types.h"
  spinlock_t ptl;


  struct kmem_cache *slab_cache;
  struct page *first_page;
 };
# 193 "include/linux/mm_types.h"
 void *virtual;
# 208 "include/linux/mm_types.h"
}







;

struct page_frag {
 struct page *page;

 __u32 offset;
 __u32 size;




};

typedef unsigned long vm_flags_t;






struct vm_region {
 struct rb_node vm_rb;
 vm_flags_t vm_flags;
 unsigned long vm_start;
 unsigned long vm_end;
 unsigned long vm_top;
 unsigned long vm_pgoff;
 struct file *vm_file;

 int vm_usage;
 bool vm_icache_flushed : 1;

};







struct vm_area_struct {


 unsigned long vm_start;
 unsigned long vm_end;



 struct vm_area_struct *vm_next, *vm_prev;

 struct rb_node vm_rb;







 unsigned long rb_subtree_gap;



 struct mm_struct *vm_mm;
 pgprot_t vm_page_prot;
 unsigned long vm_flags;





 struct {
  struct rb_node rb;
  unsigned long rb_subtree_last;
 } shared;







 struct list_head anon_vma_chain;

 struct anon_vma *anon_vma;


 const struct vm_operations_struct *vm_ops;


 unsigned long vm_pgoff;

 struct file * vm_file;
 void * vm_private_data;





 struct mempolicy *vm_policy;

};

struct core_thread {
 struct task_struct *task;
 struct core_thread *next;
};

struct core_state {
 atomic_t nr_threads;
 struct core_thread dumper;
 struct completion startup;
};

enum {
 MM_FILEPAGES,
 MM_ANONPAGES,
 MM_SWAPENTS,
 NR_MM_COUNTERS
};




struct task_rss_stat {
 int events;
 int count[NR_MM_COUNTERS];
};


struct mm_rss_stat {
 atomic_long_t count[NR_MM_COUNTERS];
};

struct kioctx_table;
struct mm_struct {
 struct vm_area_struct *mmap;
 struct rb_root mm_rb;
 u32 vmacache_seqnum;

 unsigned long (*get_unmapped_area) (struct file *filp,
    unsigned long addr, unsigned long len,
    unsigned long pgoff, unsigned long flags);

 unsigned long mmap_base;
 unsigned long mmap_legacy_base;
 unsigned long task_size;
 unsigned long highest_vm_end;
 pgd_t * pgd;
 atomic_t mm_users;
 atomic_t mm_count;
 atomic_long_t nr_ptes;
 atomic_long_t nr_pmds;
 int map_count;

 spinlock_t page_table_lock;
 struct rw_semaphore mmap_sem;

 struct list_head mmlist;





 unsigned long hiwater_rss;
 unsigned long hiwater_vm;

 unsigned long total_vm;
 unsigned long locked_vm;
 unsigned long pinned_vm;
 unsigned long shared_vm;
 unsigned long exec_vm;
 unsigned long stack_vm;
 unsigned long def_flags;
 unsigned long start_code, end_code, start_data, end_data;
 unsigned long start_brk, brk, start_stack;
 unsigned long arg_start, arg_end, env_start, env_end;

 unsigned long saved_auxv[(2*(0 + 20 + 1))];





 struct mm_rss_stat rss_stat;

 struct linux_binfmt *binfmt;

 cpumask_var_t cpu_vm_mask_var;


 mm_context_t context;

 unsigned long flags;

 struct core_state *core_state;

 spinlock_t ioctx_lock;
 struct kioctx_table *ioctx_table;
# 430 "include/linux/mm_types.h"
 struct file *exe_file;




 pgtable_t pmd_huge_pte;
# 460 "include/linux/mm_types.h"
 bool tlb_flush_pending;

 struct uprobes_state uprobes_state;




};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_init_cpumask(struct mm_struct *mm)
{



 cpumask_clear(mm->cpu_vm_mask_var);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) cpumask_t *mm_cpumask(struct mm_struct *mm)
{
 return mm->cpu_vm_mask_var;
}
# 490 "include/linux/mm_types.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool mm_tlb_flush_pending(struct mm_struct *mm)
{
 __asm__ __volatile__("": : :"memory");
 return mm->tlb_flush_pending;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_tlb_flush_pending(struct mm_struct *mm)
{
 mm->tlb_flush_pending = true;





 __asm__ __volatile__("":::"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_tlb_flush_pending(struct mm_struct *mm)
{
 __asm__ __volatile__("": : :"memory");
 mm->tlb_flush_pending = false;
}
# 524 "include/linux/mm_types.h"
struct vm_special_mapping
{
 const char *name;
 struct page **pages;
};

enum tlb_flush_reason {
 TLB_FLUSH_ON_TASK_SWITCH,
 TLB_REMOTE_SHOOTDOWN,
 TLB_LOCAL_SHOOTDOWN,
 TLB_LOCAL_MM_SHOOTDOWN,
 NR_TLB_FLUSH_REASONS,
};





typedef struct {
 unsigned long val;
} swp_entry_t;
# 28 "include/linux/sched.h" 2




# 1 "include/linux/cputime.h" 1



# 1 "arch/sparc/include/generated/asm/cputime.h" 1
# 1 "include/asm-generic/cputime.h" 1







# 1 "include/asm-generic/cputime_jiffies.h" 1



typedef unsigned long cputime_t;
# 13 "include/asm-generic/cputime_jiffies.h"
typedef u64 cputime64_t;
# 9 "include/asm-generic/cputime.h" 2
# 1 "arch/sparc/include/generated/asm/cputime.h" 2
# 5 "include/linux/cputime.h" 2
# 33 "include/linux/sched.h" 2

# 1 "include/linux/smp.h" 1
# 14 "include/linux/smp.h"
# 1 "include/linux/llist.h" 1
# 61 "include/linux/llist.h"
struct llist_head {
 struct llist_node *first;
};

struct llist_node {
 struct llist_node *next;
};
# 76 "include/linux/llist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_llist_head(struct llist_head *list)
{
 list->first = ((void *)0);
}
# 158 "include/linux/llist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool llist_empty(const struct llist_head *head)
{
 return (*({ __attribute__((unused)) typeof(head->first) __var = ( typeof(head->first)) 0; (volatile typeof(head->first) *)&(head->first); })) == ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct llist_node *llist_next(struct llist_node *node)
{
 return node->next;
}

extern bool llist_add_batch(struct llist_node *new_first,
       struct llist_node *new_last,
       struct llist_head *head);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool llist_add(struct llist_node *new, struct llist_head *head)
{
 return llist_add_batch(new, new, head);
}
# 191 "include/linux/llist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct llist_node *llist_del_all(struct llist_head *head)
{
 return ((__typeof__(*(&head->first)))__xchg((unsigned long)(((void *)0)),(&head->first),sizeof(*(&head->first))));
}

extern struct llist_node *llist_del_first(struct llist_head *head);

struct llist_node *llist_reverse_order(struct llist_node *head);
# 15 "include/linux/smp.h" 2

typedef void (*smp_call_func_t)(void *info);
struct call_single_data {
 struct llist_node llist;
 smp_call_func_t func;
 void *info;
 u16 flags;
};


extern unsigned int total_cpus;

int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
        int wait);




int on_each_cpu(smp_call_func_t func, void *info, int wait);





void on_each_cpu_mask(const struct cpumask *mask, smp_call_func_t func,
  void *info, bool wait);






void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info),
  smp_call_func_t func, void *info, bool wait,
  gfp_t gfp_flags);

int smp_call_function_single_async(int cpu, struct call_single_data *csd);







# 1 "./arch/sparc/include/asm/smp.h" 1



# 1 "./arch/sparc/include/asm/smp_64.h" 1
# 11 "./arch/sparc/include/asm/smp_64.h"
# 1 "./arch/sparc/include/asm/starfire.h" 1
# 12 "./arch/sparc/include/asm/starfire.h"
extern int this_is_starfire;

void check_if_starfire(void);
int starfire_hard_smp_processor_id(void);
void starfire_hookup(int);
unsigned int starfire_translate(unsigned long imap, unsigned int upaid);
# 12 "./arch/sparc/include/asm/smp_64.h" 2
# 1 "./arch/sparc/include/asm/spitfire.h" 1
# 55 "./arch/sparc/include/asm/spitfire.h"
enum ultra_tlb_layout {
 spitfire = 0,
 cheetah = 1,
 cheetah_plus = 2,
 hypervisor = 3,
};

extern enum ultra_tlb_layout tlb_type;

extern int sun4v_chip_type;

extern int cheetah_pcache_forced_on;
void cheetah_enable_pcache(void);






extern int num_kernel_image_mappings;




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spitfire_put_dcache_tag(unsigned long addr, unsigned long tag)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (tag), "r" (addr), "i" (0x47));
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spitfire_put_icache_tag(unsigned long addr, unsigned long tag)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (tag), "r" (addr), "i" (0x67));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long spitfire_get_dtlb_data(int entry)
{
 unsigned long data;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (data)
        : "r" (entry << 3), "i" (0x5d));


 data &= ~0x0003fe0000000000UL;

 return data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long spitfire_get_dtlb_tag(int entry)
{
 unsigned long tag;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (tag)
        : "r" (entry << 3), "i" (0x5e));
 return tag;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spitfire_put_dtlb_data(int entry, unsigned long data)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (data), "r" (entry << 3),
          "i" (0x5d));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long spitfire_get_itlb_data(int entry)
{
 unsigned long data;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (data)
        : "r" (entry << 3), "i" (0x55));


 data &= ~0x0003fe0000000000UL;

 return data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long spitfire_get_itlb_tag(int entry)
{
 unsigned long tag;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (tag)
        : "r" (entry << 3), "i" (0x56));
 return tag;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spitfire_put_itlb_data(int entry, unsigned long data)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (data), "r" (entry << 3),
          "i" (0x55));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spitfire_flush_dtlb_nucleus_page(unsigned long page)
{
 __asm__ __volatile__("stxa	%%g0, [%0] %1\n\t"
        "membar	#Sync"
        :
        : "r" (page | 0x20), "i" (0x5f));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void spitfire_flush_itlb_nucleus_page(unsigned long page)
{
 __asm__ __volatile__("stxa	%%g0, [%0] %1\n\t"
        "membar	#Sync"
        :
        : "r" (page | 0x20), "i" (0x57));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cheetah_flush_dtlb_all(void)
{
 __asm__ __volatile__("stxa	%%g0, [%0] %1\n\t"
        "membar	#Sync"
        :
        : "r" (0x80), "i" (0x5f));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cheetah_flush_itlb_all(void)
{
 __asm__ __volatile__("stxa	%%g0, [%0] %1\n\t"
        "membar	#Sync"
        :
        : "r" (0x80), "i" (0x57));
}
# 214 "./arch/sparc/include/asm/spitfire.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_ldtlb_data(int entry)
{
 unsigned long data;

 __asm__ __volatile__("ldxa	[%1] %2, %%g0\n\t"
        "ldxa	[%1] %2, %0"
        : "=r" (data)
        : "r" ((0 << 16) | (entry << 3)),
        "i" (0x5d));

 return data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_litlb_data(int entry)
{
 unsigned long data;

 __asm__ __volatile__("ldxa	[%1] %2, %%g0\n\t"
        "ldxa	[%1] %2, %0"
        : "=r" (data)
        : "r" ((0 << 16) | (entry << 3)),
        "i" (0x55));

 return data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_ldtlb_tag(int entry)
{
 unsigned long tag;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (tag)
        : "r" ((0 << 16) | (entry << 3)),
        "i" (0x5e));

 return tag;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_litlb_tag(int entry)
{
 unsigned long tag;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (tag)
        : "r" ((0 << 16) | (entry << 3)),
        "i" (0x56));

 return tag;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cheetah_put_ldtlb_data(int entry, unsigned long data)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (data),
          "r" ((0 << 16) | (entry << 3)),
          "i" (0x5d));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cheetah_put_litlb_data(int entry, unsigned long data)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (data),
          "r" ((0 << 16) | (entry << 3)),
          "i" (0x55));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_dtlb_data(int entry, int tlb)
{
 unsigned long data;

 __asm__ __volatile__("ldxa	[%1] %2, %%g0\n\t"
        "ldxa	[%1] %2, %0"
        : "=r" (data)
        : "r" ((tlb << 16) | (entry << 3)), "i" (0x5d));

 return data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_dtlb_tag(int entry, int tlb)
{
 unsigned long tag;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (tag)
        : "r" ((tlb << 16) | (entry << 3)), "i" (0x5e));
 return tag;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cheetah_put_dtlb_data(int entry, unsigned long data, int tlb)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (data),
          "r" ((tlb << 16) | (entry << 3)),
          "i" (0x5d));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_itlb_data(int entry)
{
 unsigned long data;

 __asm__ __volatile__("ldxa	[%1] %2, %%g0\n\t"
        "ldxa	[%1] %2, %0"
        : "=r" (data)
        : "r" ((2 << 16) | (entry << 3)),
                               "i" (0x55));

 return data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long cheetah_get_itlb_tag(int entry)
{
 unsigned long tag;

 __asm__ __volatile__("ldxa	[%1] %2, %0"
        : "=r" (tag)
        : "r" ((2 << 16) | (entry << 3)), "i" (0x56));
 return tag;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cheetah_put_itlb_data(int entry, unsigned long data)
{
 __asm__ __volatile__("stxa	%0, [%1] %2\n\t"
        "membar	#Sync"
        :
        : "r" (data), "r" ((2 << 16) | (entry << 3)),
          "i" (0x55));
}
# 13 "./arch/sparc/include/asm/smp_64.h" 2
# 31 "./arch/sparc/include/asm/smp_64.h"
# 1 "./arch/sparc/include/asm/percpu.h" 1



# 1 "./arch/sparc/include/asm/percpu_64.h" 1





register unsigned long __local_per_cpu_offset asm("g5");



# 1 "./arch/sparc/include/asm/trap_block.h" 1
# 22 "./arch/sparc/include/asm/trap_block.h"
struct thread_info;
struct trap_per_cpu {

 struct thread_info *thread;
 unsigned long pgd_paddr;
 unsigned long cpu_mondo_pa;
 unsigned long dev_mondo_pa;


 unsigned long resum_mondo_pa;
 unsigned long resum_kernel_buf_pa;
 unsigned long nonresum_mondo_pa;
 unsigned long nonresum_kernel_buf_pa;


 struct hv_fault_status fault_info;


 unsigned long cpu_mondo_block_pa;
 unsigned long cpu_list_pa;
 unsigned long tsb_huge;
 unsigned long tsb_huge_temp;


 unsigned long irq_worklist_pa;
 unsigned int cpu_mondo_qmask;
 unsigned int dev_mondo_qmask;
 unsigned int resum_qmask;
 unsigned int nonresum_qmask;
 unsigned long __per_cpu_base;
} __attribute__((aligned(64)));
extern struct trap_per_cpu trap_block[128];
void init_cur_cpu_trap(struct thread_info *);
void setup_tba(void);
extern int ncpus_probed;

unsigned long real_hard_smp_processor_id(void);

struct cpuid_patch_entry {
 unsigned int addr;
 unsigned int cheetah_safari[4];
 unsigned int cheetah_jbus[4];
 unsigned int starfire[4];
 unsigned int sun4v[4];
};
extern struct cpuid_patch_entry __cpuid_patch, __cpuid_patch_end;

struct sun4v_1insn_patch_entry {
 unsigned int addr;
 unsigned int insn;
};
extern struct sun4v_1insn_patch_entry __sun4v_1insn_patch,
 __sun4v_1insn_patch_end;

struct sun4v_2insn_patch_entry {
 unsigned int addr;
 unsigned int insns[2];
};
extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
 __sun4v_2insn_patch_end;
# 108 "./arch/sparc/include/asm/trap_block.h"
# 1 "./arch/sparc/include/asm/scratchpad.h" 1
# 109 "./arch/sparc/include/asm/trap_block.h" 2
# 11 "./arch/sparc/include/asm/percpu_64.h" 2
# 22 "./arch/sparc/include/asm/percpu_64.h"
# 1 "include/asm-generic/percpu.h" 1





# 1 "include/linux/percpu-defs.h" 1
# 295 "include/linux/percpu-defs.h"
extern void __bad_size_call_parameter(void);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __this_cpu_preempt_check(const char *op) { }
# 7 "include/asm-generic/percpu.h" 2
# 47 "include/asm-generic/percpu.h"
extern void setup_per_cpu_areas(void);
# 23 "./arch/sparc/include/asm/percpu_64.h" 2
# 5 "./arch/sparc/include/asm/percpu.h" 2
# 32 "./arch/sparc/include/asm/smp_64.h" 2

extern __attribute__((section(".data..percpu" ""))) __typeof__(cpumask_t) cpu_sibling_map;
extern cpumask_t cpu_core_map[128];

void arch_send_call_function_single_ipi(int cpu);
void arch_send_call_function_ipi_mask(const struct cpumask *mask);





int hard_smp_processor_id(void);


void smp_fill_in_sib_core_maps(void);
void cpu_play_dead(void);

void smp_fetch_global_regs(void);
void smp_fetch_global_pmu(void);

struct seq_file;
void smp_bogo(struct seq_file *);
void smp_info(struct seq_file *);

void smp_callin(void);
void cpu_panic(void);
void smp_synchronize_tick_client(void);
void smp_capture(void);
void smp_release(void);


int __cpu_disable(void);
void __cpu_die(unsigned int cpu);
# 5 "./arch/sparc/include/asm/smp.h" 2
# 60 "include/linux/smp.h" 2
# 69 "include/linux/smp.h"
extern void smp_send_stop(void);




extern void smp_send_reschedule(int cpu);





extern void smp_prepare_cpus(unsigned int max_cpus);




extern int __cpu_up(unsigned int cpunum, struct task_struct *tidle);




extern void smp_cpus_done(unsigned int max_cpus);




int smp_call_function(smp_call_func_t func, void *info, int wait);
void smp_call_function_many(const struct cpumask *mask,
       smp_call_func_t func, void *info, bool wait);

int smp_call_function_any(const struct cpumask *mask,
     smp_call_func_t func, void *info, int wait);

void kick_all_cpus_sync(void);
void wake_up_all_idle_cpus(void);




void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) call_function_init(void);
void generic_smp_call_function_single_interrupt(void);







void smp_prepare_boot_cpu(void);

extern unsigned int setup_max_cpus;
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) setup_nr_cpu_ids(void);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) smp_init(void);
# 192 "include/linux/smp.h"
extern void arch_disable_smp_support(void);

extern void arch_enable_nonboot_cpus_begin(void);
extern void arch_enable_nonboot_cpus_end(void);

void smp_setup_processor_id(void);
# 35 "include/linux/sched.h" 2
# 1 "include/linux/sem.h" 1




# 1 "include/linux/rcupdate.h" 1
# 44 "include/linux/rcupdate.h"
# 1 "include/linux/debugobjects.h" 1






enum debug_obj_state {
 ODEBUG_STATE_NONE,
 ODEBUG_STATE_INIT,
 ODEBUG_STATE_INACTIVE,
 ODEBUG_STATE_ACTIVE,
 ODEBUG_STATE_DESTROYED,
 ODEBUG_STATE_NOTAVAILABLE,
 ODEBUG_STATE_MAX,
};

struct debug_obj_descr;
# 27 "include/linux/debugobjects.h"
struct debug_obj {
 struct hlist_node node;
 enum debug_obj_state state;
 unsigned int astate;
 void *object;
 struct debug_obj_descr *descr;
};
# 52 "include/linux/debugobjects.h"
struct debug_obj_descr {
 const char *name;
 void *(*debug_hint) (void *addr);
 int (*fixup_init) (void *addr, enum debug_obj_state state);
 int (*fixup_activate) (void *addr, enum debug_obj_state state);
 int (*fixup_destroy) (void *addr, enum debug_obj_state state);
 int (*fixup_free) (void *addr, enum debug_obj_state state);
 int (*fixup_assert_init)(void *addr, enum debug_obj_state state);
};
# 84 "include/linux/debugobjects.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_object_init (void *addr, struct debug_obj_descr *descr) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
debug_object_activate (void *addr, struct debug_obj_descr *descr) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_object_deactivate(void *addr, struct debug_obj_descr *descr) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_object_destroy (void *addr, struct debug_obj_descr *descr) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_object_free (void *addr, struct debug_obj_descr *descr) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_object_assert_init(void *addr, struct debug_obj_descr *descr) { }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_objects_early_init(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_objects_mem_init(void) { }





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_check_no_obj_freed(const void *address, unsigned long size) { }
# 45 "include/linux/rcupdate.h" 2




extern int rcu_expedited;

enum rcutorture_type {
 RCU_FLAVOR,
 RCU_BH_FLAVOR,
 RCU_SCHED_FLAVOR,
 RCU_TASKS_FLAVOR,
 SRCU_FLAVOR,
 INVALID_RCU_FLAVOR
};


void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
       unsigned long *gpnum, unsigned long *completed);
void rcutorture_record_test_transition(void);
void rcutorture_record_progress(unsigned long vernum);
void do_trace_rcu_torture_read(const char *rcutorturename,
          struct callback_head *rhp,
          unsigned long secs,
          unsigned long c_old,
          unsigned long c);
# 171 "include/linux/rcupdate.h"
void call_rcu_bh(struct callback_head *head,
   void (*func)(struct callback_head *head));
# 193 "include/linux/rcupdate.h"
void call_rcu_sched(struct callback_head *head,
      void (*func)(struct callback_head *rcu));

void synchronize_sched(void);
# 216 "include/linux/rcupdate.h"
void call_rcu_tasks(struct callback_head *head, void (*func)(struct callback_head *head));
void synchronize_rcu_tasks(void);
void rcu_barrier_tasks(void);
# 237 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __rcu_read_lock(void)
{
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __rcu_read_unlock(void)
{
 __asm__ __volatile__("": : :"memory");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void synchronize_rcu(void)
{
 synchronize_sched();
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rcu_preempt_depth(void)
{
 return 0;
}




void rcu_init(void);
void rcu_sched_qs(void);
void rcu_bh_qs(void);
void rcu_check_callbacks(int user);
struct notifier_block;
void rcu_idle_enter(void);
void rcu_idle_exit(void);
void rcu_irq_enter(void);
void rcu_irq_exit(void);


void rcu_sysrq_start(void);
void rcu_sysrq_end(void);
# 286 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_user_enter(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_user_exit(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_user_hooks_switch(struct task_struct *prev,
      struct task_struct *next) { }





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_init_nohz(void)
{
}
# 357 "include/linux/rcupdate.h"
bool __rcu_is_watching(void);







typedef void call_rcu_func_t(struct callback_head *head,
        void (*func)(struct callback_head *head));
void wait_rcu_gp(call_rcu_func_t crf);


# 1 "include/linux/rcutree.h" 1
# 33 "include/linux/rcutree.h"
void rcu_note_context_switch(void);

int rcu_needs_cpu(unsigned long *delta_jiffies);

void rcu_cpu_stall_reset(void);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_virt_note_context_switch(int cpu)
{
 rcu_note_context_switch();
}

void synchronize_rcu_bh(void);
void synchronize_sched_expedited(void);
void synchronize_rcu_expedited(void);

void kfree_call_rcu(struct callback_head *head, void (*func)(struct callback_head *rcu));
# 71 "include/linux/rcutree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void synchronize_rcu_bh_expedited(void)
{
 synchronize_sched_expedited();
}

void rcu_barrier(void);
void rcu_barrier_bh(void);
void rcu_barrier_sched(void);
unsigned long get_state_synchronize_rcu(void);
void cond_synchronize_rcu(unsigned long oldstate);

extern unsigned long rcutorture_testseq;
extern unsigned long rcutorture_vernum;
unsigned long rcu_batches_started(void);
unsigned long rcu_batches_started_bh(void);
unsigned long rcu_batches_started_sched(void);
unsigned long rcu_batches_completed(void);
unsigned long rcu_batches_completed_bh(void);
unsigned long rcu_batches_completed_sched(void);
void show_rcu_gp_kthreads(void);

void rcu_force_quiescent_state(void);
void rcu_bh_force_quiescent_state(void);
void rcu_sched_force_quiescent_state(void);

void exit_rcu(void);

void rcu_scheduler_starting(void);
extern int rcu_scheduler_active __attribute__((__section__(".data..read_mostly")));

bool rcu_is_watching(void);

void rcu_all_qs(void);
# 371 "include/linux/rcupdate.h" 2
# 389 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_rcu_head(struct callback_head *head)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_rcu_head(struct callback_head *head)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_rcu_head_on_stack(struct callback_head *head)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_rcu_head_on_stack(struct callback_head *head)
{
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool rcu_lockdep_current_cpu_online(void)
{
 return true;
}
# 494 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rcu_read_lock_held(void)
{
 return 1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rcu_read_lock_bh_held(void)
{
 return 1;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rcu_read_lock_sched_held(void)
{
 return 1;
}
# 878 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_lock(void)
{
 __rcu_read_lock();
 (void)0;
 do { } while (0);
 do { } while (0)
                                                  ;
}
# 932 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_unlock(void)
{
 do { } while (0)
                                                    ;
 do { } while (0);
 (void)0;
 __rcu_read_unlock();
}
# 958 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_lock_bh(void)
{
 local_bh_disable();
 (void)0;
 do { } while (0);
 do { } while (0)
                                                     ;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_unlock_bh(void)
{
 do { } while (0)
                                                       ;
 do { } while (0);
 (void)0;
 local_bh_enable();
}
# 994 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_lock_sched(void)
{
 __asm__ __volatile__("": : :"memory");
 (void)0;
 do { } while (0);
 do { } while (0)
                                                        ;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) void rcu_read_lock_sched_notrace(void)
{
 __asm__ __volatile__("": : :"memory");
 (void)0;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_unlock_sched(void)
{
 do { } while (0)
                                                          ;
 do { } while (0);
 (void)0;
 __asm__ __volatile__("": : :"memory");
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) void rcu_read_unlock_sched_notrace(void)
{
 (void)0;
 __asm__ __volatile__("": : :"memory");
}
# 1137 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool rcu_is_nocb_cpu(int cpu) { return false; }
# 1147 "include/linux/rcupdate.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool rcu_sys_is_idle(void)
{
 return false;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_sysidle_force_exit(void)
{
}
# 6 "include/linux/sem.h" 2

# 1 "include/uapi/linux/sem.h" 1



# 1 "include/linux/ipc.h" 1




# 1 "include/linux/uidgid.h" 1
# 15 "include/linux/uidgid.h"
# 1 "include/linux/highuid.h" 1
# 34 "include/linux/highuid.h"
extern int overflowuid;
extern int overflowgid;

extern void __bad_uid(void);
extern void __bad_gid(void);
# 81 "include/linux/highuid.h"
extern int fs_overflowuid;
extern int fs_overflowgid;
# 16 "include/linux/uidgid.h" 2

struct user_namespace;
extern struct user_namespace init_user_ns;

typedef struct {
 uid_t val;
} kuid_t;


typedef struct {
 gid_t val;
} kgid_t;




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) uid_t __kuid_val(kuid_t uid)
{
 return uid.val;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gid_t __kgid_val(kgid_t gid)
{
 return gid.val;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_eq(kuid_t left, kuid_t right)
{
 return __kuid_val(left) == __kuid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_eq(kgid_t left, kgid_t right)
{
 return __kgid_val(left) == __kgid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_gt(kuid_t left, kuid_t right)
{
 return __kuid_val(left) > __kuid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_gt(kgid_t left, kgid_t right)
{
 return __kgid_val(left) > __kgid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_gte(kuid_t left, kuid_t right)
{
 return __kuid_val(left) >= __kuid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_gte(kgid_t left, kgid_t right)
{
 return __kgid_val(left) >= __kgid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_lt(kuid_t left, kuid_t right)
{
 return __kuid_val(left) < __kuid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_lt(kgid_t left, kgid_t right)
{
 return __kgid_val(left) < __kgid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_lte(kuid_t left, kuid_t right)
{
 return __kuid_val(left) <= __kuid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_lte(kgid_t left, kgid_t right)
{
 return __kgid_val(left) <= __kgid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_valid(kuid_t uid)
{
 return !uid_eq(uid, (kuid_t){ -1 });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_valid(kgid_t gid)
{
 return !gid_eq(gid, (kgid_t){ -1 });
}
# 130 "include/linux/uidgid.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kuid_t make_kuid(struct user_namespace *from, uid_t uid)
{
 return (kuid_t){ uid };
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kgid_t make_kgid(struct user_namespace *from, gid_t gid)
{
 return (kgid_t){ gid };
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) uid_t from_kuid(struct user_namespace *to, kuid_t kuid)
{
 return __kuid_val(kuid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gid_t from_kgid(struct user_namespace *to, kgid_t kgid)
{
 return __kgid_val(kgid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) uid_t from_kuid_munged(struct user_namespace *to, kuid_t kuid)
{
 uid_t uid = from_kuid(to, kuid);
 if (uid == (uid_t)-1)
  uid = overflowuid;
 return uid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gid_t from_kgid_munged(struct user_namespace *to, kgid_t kgid)
{
 gid_t gid = from_kgid(to, kgid);
 if (gid == (gid_t)-1)
  gid = overflowgid;
 return gid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kuid_has_mapping(struct user_namespace *ns, kuid_t uid)
{
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kgid_has_mapping(struct user_namespace *ns, kgid_t gid)
{
 return true;
}
# 6 "include/linux/ipc.h" 2
# 1 "include/uapi/linux/ipc.h" 1
# 9 "include/uapi/linux/ipc.h"
struct ipc_perm
{
 __kernel_key_t key;
 __kernel_uid_t uid;
 __kernel_gid_t gid;
 __kernel_uid_t cuid;
 __kernel_gid_t cgid;
 __kernel_mode_t mode;
 unsigned short seq;
};


# 1 "./arch/sparc/include/uapi/asm/ipcbuf.h" 1
# 15 "./arch/sparc/include/uapi/asm/ipcbuf.h"
struct ipc64_perm
{
 __kernel_key_t key;
 __kernel_uid_t uid;
 __kernel_gid_t gid;
 __kernel_uid_t cuid;
 __kernel_gid_t cgid;



 __kernel_mode_t mode;
 unsigned short __pad1;
 unsigned short seq;
 unsigned long long __unused1;
 unsigned long long __unused2;
};
# 22 "include/uapi/linux/ipc.h" 2
# 57 "include/uapi/linux/ipc.h"
struct ipc_kludge {
 struct msgbuf *msgp;
 long msgtyp;
};
# 7 "include/linux/ipc.h" 2




struct kern_ipc_perm
{
 spinlock_t lock;
 bool deleted;
 int id;
 key_t key;
 kuid_t uid;
 kgid_t gid;
 kuid_t cuid;
 kgid_t cgid;
 umode_t mode;
 unsigned long seq;
 void *security;
};
# 5 "include/uapi/linux/sem.h" 2
# 23 "include/uapi/linux/sem.h"
struct semid_ds {
 struct ipc_perm sem_perm;
 __kernel_time_t sem_otime;
 __kernel_time_t sem_ctime;
 struct sem *sem_base;
 struct sem_queue *sem_pending;
 struct sem_queue **sem_pending_last;
 struct sem_undo *undo;
 unsigned short sem_nsems;
};


# 1 "./arch/sparc/include/uapi/asm/sembuf.h" 1
# 19 "./arch/sparc/include/uapi/asm/sembuf.h"
struct semid64_ds {
 struct ipc64_perm sem_perm;

 __kernel_time_t sem_otime;

 __kernel_time_t sem_ctime;
 unsigned long sem_nsems;
 unsigned long __unused1;
 unsigned long __unused2;
};
# 36 "include/uapi/linux/sem.h" 2


struct sembuf {
 unsigned short sem_num;
 short sem_op;
 short sem_flg;
};


union semun {
 int val;
 struct semid_ds *buf;
 unsigned short *array;
 struct seminfo *__buf;
 void *__pad;
};

struct seminfo {
 int semmap;
 int semmni;
 int semmns;
 int semmnu;
 int semmsl;
 int semopm;
 int semume;
 int semusz;
 int semvmx;
 int semaem;
};
# 8 "include/linux/sem.h" 2

struct task_struct;


struct sem_array {
 struct kern_ipc_perm __attribute__((__aligned__((1 << 6))))
    sem_perm;
 time_t sem_ctime;
 struct sem *sem_base;
 struct list_head pending_alter;

 struct list_head pending_const;

 struct list_head list_id;
 int sem_nsems;
 int complex_count;
};



struct sysv_sem {
 struct sem_undo_list *undo_list;
};

extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
extern void exit_sem(struct task_struct *tsk);
# 36 "include/linux/sched.h" 2
# 1 "include/linux/shm.h" 1





# 1 "include/uapi/linux/shm.h" 1
# 26 "include/uapi/linux/shm.h"
struct shmid_ds {
 struct ipc_perm shm_perm;
 int shm_segsz;
 __kernel_time_t shm_atime;
 __kernel_time_t shm_dtime;
 __kernel_time_t shm_ctime;
 __kernel_ipc_pid_t shm_cpid;
 __kernel_ipc_pid_t shm_lpid;
 unsigned short shm_nattch;
 unsigned short shm_unused;
 void *shm_unused2;
 void *shm_unused3;
};


# 1 "./arch/sparc/include/uapi/asm/shmbuf.h" 1
# 20 "./arch/sparc/include/uapi/asm/shmbuf.h"
struct shmid64_ds {
 struct ipc64_perm shm_perm;

 __kernel_time_t shm_atime;

 __kernel_time_t shm_dtime;

 __kernel_time_t shm_ctime;
 size_t shm_segsz;
 __kernel_pid_t shm_cpid;
 __kernel_pid_t shm_lpid;
 unsigned long shm_nattch;
 unsigned long __unused1;
 unsigned long __unused2;
};

struct shminfo64 {
 unsigned long shmmax;
 unsigned long shmmin;
 unsigned long shmmni;
 unsigned long shmseg;
 unsigned long shmall;
 unsigned long __unused1;
 unsigned long __unused2;
 unsigned long __unused3;
 unsigned long __unused4;
};
# 42 "include/uapi/linux/shm.h" 2
# 62 "include/uapi/linux/shm.h"
struct shminfo {
 int shmmax;
 int shmmin;
 int shmmni;
 int shmseg;
 int shmall;
};

struct shm_info {
 int used_ids;
 __kernel_ulong_t shm_tot;
 __kernel_ulong_t shm_rss;
 __kernel_ulong_t shm_swp;
 __kernel_ulong_t swap_attempts;
 __kernel_ulong_t swap_successes;
};
# 7 "include/linux/shm.h" 2
# 1 "./arch/sparc/include/asm/shmparam.h" 1



# 1 "./arch/sparc/include/asm/shmparam_64.h" 1
# 5 "./arch/sparc/include/asm/shmparam.h" 2
# 8 "include/linux/shm.h" 2

struct shmid_kernel
{
 struct kern_ipc_perm shm_perm;
 struct file *shm_file;
 unsigned long shm_nattch;
 unsigned long shm_segsz;
 time_t shm_atim;
 time_t shm_dtim;
 time_t shm_ctim;
 pid_t shm_cprid;
 pid_t shm_lprid;
 struct user_struct *mlock_user;


 struct task_struct *shm_creator;
 struct list_head shm_clist;
};
# 49 "include/linux/shm.h"
struct sysv_shm {
 struct list_head shm_clist;
};

long do_shmat(int shmid, char *shmaddr, int shmflg, unsigned long *addr,
       unsigned long shmlba);
int is_file_shm_hugepages(struct file *file);
void exit_shm(struct task_struct *task);
# 37 "include/linux/sched.h" 2
# 1 "include/linux/signal.h" 1





# 1 "include/uapi/linux/signal.h" 1



# 1 "./arch/sparc/include/asm/signal.h" 1




# 1 "include/linux/personality.h" 1



# 1 "include/uapi/linux/personality.h" 1
# 10 "include/uapi/linux/personality.h"
enum {
 UNAME26 = 0x0020000,
 ADDR_NO_RANDOMIZE = 0x0040000,
 FDPIC_FUNCPTRS = 0x0080000,


 MMAP_PAGE_ZERO = 0x0100000,
 ADDR_COMPAT_LAYOUT = 0x0200000,
 READ_IMPLIES_EXEC = 0x0400000,
 ADDR_LIMIT_32BIT = 0x0800000,
 SHORT_INODE = 0x1000000,
 WHOLE_SECONDS = 0x2000000,
 STICKY_TIMEOUTS = 0x4000000,
 ADDR_LIMIT_3GB = 0x8000000,
};
# 41 "include/uapi/linux/personality.h"
enum {
 PER_LINUX = 0x0000,
 PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
 PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
 PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
 PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
 PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS |
      WHOLE_SECONDS | SHORT_INODE,
 PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
 PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
 PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
 PER_BSD = 0x0006,
 PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
 PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
 PER_LINUX32 = 0x0008,
 PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
 PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,
 PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,
 PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,
 PER_RISCOS = 0x000c,
 PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
 PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
 PER_OSF4 = 0x000f,
 PER_HPUX = 0x0010,
 PER_MASK = 0x00ff,
};
# 5 "include/linux/personality.h" 2






struct exec_domain;
struct pt_regs;

extern int register_exec_domain(struct exec_domain *);
extern int unregister_exec_domain(struct exec_domain *);
extern int __set_personality(unsigned int);
# 25 "include/linux/personality.h"
typedef void (*handler_t)(int, struct pt_regs *);

struct exec_domain {
 const char *name;
 handler_t handler;
 unsigned char pers_low;
 unsigned char pers_high;
 unsigned long *signal_map;
 unsigned long *signal_invmap;
 struct map_segment *err_map;
 struct map_segment *socktype_map;
 struct map_segment *sockopt_map;
 struct map_segment *af_map;
 struct module *module;
 struct exec_domain *next;
};
# 6 "./arch/sparc/include/asm/signal.h" 2


# 1 "./arch/sparc/include/uapi/asm/signal.h" 1



# 1 "./arch/sparc/include/asm/sigcontext.h" 1




# 1 "./arch/sparc/include/uapi/asm/sigcontext.h" 1
# 6 "./arch/sparc/include/asm/sigcontext.h" 2






struct sigcontext32 {
 int sigc_onstack;
 int sigc_mask;
 int sigc_sp;
 int sigc_pc;
 int sigc_npc;
 int sigc_psr;
 int sigc_g1;
 int sigc_o0;




 int sigc_oswins;


 unsigned sigc_spbuf[31];


 struct reg_window32 sigc_wbuf[31];
};




typedef struct {
 struct {
  unsigned int psr;
  unsigned int pc;
  unsigned int npc;
  unsigned int y;
  unsigned int u_regs[16];
 } si_regs;
 int si_mask;
} __siginfo32_t;



typedef struct {
 unsigned long locals[8];
 unsigned long ins[8];
} __siginfo_reg_window;

typedef struct {
 int wsaved;
 __siginfo_reg_window reg_window[7];
 unsigned long rwbuf_stkptrs[7];
} __siginfo_rwin_t;


typedef struct {
 unsigned int si_float_regs [64];
 unsigned long si_fsr;
 unsigned long si_gsr;
 unsigned long si_fprs;
} __siginfo_fpu_t;



struct sigcontext {

 char sigc_info[128];
 struct {
  unsigned long u_regs[16];
  unsigned long tstate;
  unsigned long tpc;
  unsigned long tnpc;
  unsigned int y;
  unsigned int fprs;
 } sigc_regs;
 __siginfo_fpu_t * sigc_fpu_save;
 struct {
  void * ss_sp;
  int ss_flags;
  unsigned long ss_size;
 } sigc_stack;
 unsigned long sigc_mask;
 __siginfo_rwin_t * sigc_rwin_save;
};
# 5 "./arch/sparc/include/uapi/asm/signal.h" 2
# 109 "./arch/sparc/include/uapi/asm/signal.h"
typedef unsigned long old_sigset_t;

typedef struct {
       unsigned long sig[(64 / 64)];
} sigset_t;


struct sigstack {

 char *the_stack;
 int cur_status;
};
# 154 "./arch/sparc/include/uapi/asm/signal.h"
# 1 "./include/uapi/asm-generic/signal-defs.h" 1
# 17 "./include/uapi/asm-generic/signal-defs.h"
typedef void __signalfn_t(int);
typedef __signalfn_t *__sighandler_t;

typedef void __restorefn_t(void);
typedef __restorefn_t *__sigrestore_t;
# 155 "./arch/sparc/include/uapi/asm/signal.h" 2
# 172 "./arch/sparc/include/uapi/asm/signal.h"
typedef struct sigaltstack {
 void *ss_sp;
 int ss_flags;
 size_t ss_size;
} stack_t;
# 9 "./arch/sparc/include/asm/signal.h" 2
# 5 "include/uapi/linux/signal.h" 2
# 1 "./arch/sparc/include/asm/siginfo.h" 1



# 1 "./arch/sparc/include/uapi/asm/siginfo.h" 1
# 14 "./arch/sparc/include/uapi/asm/siginfo.h"
# 1 "include/asm-generic/siginfo.h" 1



# 1 "include/uapi/asm-generic/siginfo.h" 1






typedef union sigval {
 int sival_int;
 void *sival_ptr;
} sigval_t;
# 48 "include/uapi/asm-generic/siginfo.h"
typedef struct siginfo {
 int si_signo;
 int si_errno;
 int si_code;

 union {
  int _pad[((128 - (4 * sizeof(int))) / sizeof(int))];


  struct {
   __kernel_pid_t _pid;
   __kernel_uid32_t _uid;
  } _kill;


  struct {
   __kernel_timer_t _tid;
   int _overrun;
   char _pad[sizeof( __kernel_uid32_t) - sizeof(int)];
   sigval_t _sigval;
   int _sys_private;
  } _timer;


  struct {
   __kernel_pid_t _pid;
   __kernel_uid32_t _uid;
   sigval_t _sigval;
  } _rt;


  struct {
   __kernel_pid_t _pid;
   __kernel_uid32_t _uid;
   int _status;
   __kernel_clock_t _utime;
   __kernel_clock_t _stime;
  } _sigchld;


  struct {
   void *_addr;

   int _trapno;

   short _addr_lsb;
   struct {
    void *_lower;
    void *_upper;
   } _addr_bnd;
  } _sigfault;


  struct {
   int _band;
   int _fd;
  } _sigpoll;


  struct {
   void *_call_addr;
   int _syscall;
   unsigned int _arch;
  } _sigsys;
 } _sifields;
} siginfo_t;
# 285 "include/uapi/asm-generic/siginfo.h"
typedef struct sigevent {
 sigval_t sigev_value;
 int sigev_signo;
 int sigev_notify;
 union {
  int _pad[((64 - (sizeof(int) * 2 + sizeof(sigval_t))) / sizeof(int))];
   int _tid;

  struct {
   void (*_function)(sigval_t);
   void *_attribute;
  } _sigev_thread;
 } _sigev_un;
} sigevent_t;
# 5 "include/asm-generic/siginfo.h" 2
# 17 "include/asm-generic/siginfo.h"
struct siginfo;
void do_schedule_next_timer(struct siginfo *info);





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void copy_siginfo(struct siginfo *to, struct siginfo *from)
{
 if (from->si_code < 0)
  __builtin_memcpy(to, from, sizeof(*to));
 else

  __builtin_memcpy(to, from, (4 * sizeof(int)) + sizeof(from->_sifields._sigchld));
}



extern int copy_siginfo_to_user(struct siginfo *to, const struct siginfo *from);
# 15 "./arch/sparc/include/uapi/asm/siginfo.h" 2
# 5 "./arch/sparc/include/asm/siginfo.h" 2




struct compat_siginfo;
# 6 "include/uapi/linux/signal.h" 2
# 7 "include/linux/signal.h" 2

struct task_struct;


extern int print_fatal_signals;




struct sigqueue {
 struct list_head list;
 int flags;
 siginfo_t info;
 struct user_struct *user;
};




struct sigpending {
 struct list_head list;
 sigset_t signal;
};
# 40 "include/linux/signal.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigaddset(sigset_t *set, int _sig)
{
 unsigned long sig = _sig - 1;
 if ((64 / 64) == 1)
  set->sig[0] |= 1UL << sig;
 else
  set->sig[sig / 64] |= 1UL << (sig % 64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigdelset(sigset_t *set, int _sig)
{
 unsigned long sig = _sig - 1;
 if ((64 / 64) == 1)
  set->sig[0] &= ~(1UL << sig);
 else
  set->sig[sig / 64] &= ~(1UL << (sig % 64));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sigismember(sigset_t *set, int _sig)
{
 unsigned long sig = _sig - 1;
 if ((64 / 64) == 1)
  return 1 & (set->sig[0] >> sig);
 else
  return 1 & (set->sig[sig / 64] >> (sig % 64));
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sigisemptyset(sigset_t *set)
{
 switch ((64 / 64)) {
 case 4:
  return (set->sig[3] | set->sig[2] |
   set->sig[1] | set->sig[0]) == 0;
 case 2:
  return (set->sig[1] | set->sig[0]) == 0;
 case 1:
  return set->sig[0] == 0;
 default:
  do { bool __cond = !(!(1)); extern void __compiletime_assert_80(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_80(); do { } while (0); } while (0);
  return 0;
 }
}
# 114 "include/linux/signal.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigorsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 64)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) | (b3)); r->sig[2] = ((a2) | (b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) | (b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) | (b0)); break; default: do { bool __cond = !(!(1)); extern void __compiletime_assert_114(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_114(); do { } while (0); } while (0); } }


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigandsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 64)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) & (b3)); r->sig[2] = ((a2) & (b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) & (b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) & (b0)); break; default: do { bool __cond = !(!(1)); extern void __compiletime_assert_117(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_117(); do { } while (0); } while (0); } }


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigandnsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 64)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) & ~(b3)); r->sig[2] = ((a2) & ~(b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) & ~(b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) & ~(b0)); break; default: do { bool __cond = !(!(1)); extern void __compiletime_assert_120(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_120(); do { } while (0); } while (0); } }
# 142 "include/linux/signal.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void signotset(sigset_t *set) { switch ((64 / 64)) { case 4: set->sig[3] = (~(set->sig[3])); set->sig[2] = (~(set->sig[2])); case 2: set->sig[1] = (~(set->sig[1])); case 1: set->sig[0] = (~(set->sig[0])); break; default: do { bool __cond = !(!(1)); extern void __compiletime_assert_142(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_142(); do { } while (0); } while (0); } }




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigemptyset(sigset_t *set)
{
 switch ((64 / 64)) {
 default:
  __builtin_memset(set, 0, sizeof(sigset_t));
  break;
 case 2: set->sig[1] = 0;
 case 1: set->sig[0] = 0;
  break;
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigfillset(sigset_t *set)
{
 switch ((64 / 64)) {
 default:
  __builtin_memset(set, -1, sizeof(sigset_t));
  break;
 case 2: set->sig[1] = -1;
 case 1: set->sig[0] = -1;
  break;
 }
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigaddsetmask(sigset_t *set, unsigned long mask)
{
 set->sig[0] |= mask;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigdelsetmask(sigset_t *set, unsigned long mask)
{
 set->sig[0] &= ~mask;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sigtestsetmask(sigset_t *set, unsigned long mask)
{
 return (set->sig[0] & mask) != 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void siginitset(sigset_t *set, unsigned long mask)
{
 set->sig[0] = mask;
 switch ((64 / 64)) {
 default:
  __builtin_memset(&set->sig[1], 0, sizeof(long)*((64 / 64)-1));
  break;
 case 2: set->sig[1] = 0;
 case 1: ;
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void siginitsetinv(sigset_t *set, unsigned long mask)
{
 set->sig[0] = ~mask;
 switch ((64 / 64)) {
 default:
  __builtin_memset(&set->sig[1], -1, sizeof(long)*((64 / 64)-1));
  break;
 case 2: set->sig[1] = -1;
 case 1: ;
 }
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_sigpending(struct sigpending *sig)
{
 sigemptyset(&sig->signal);
 INIT_LIST_HEAD(&sig->list);
}

extern void flush_sigqueue(struct sigpending *queue);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int valid_signal(unsigned long sig)
{
 return sig <= 64 ? 1 : 0;
}

struct timespec;
struct pt_regs;

extern int next_signal(struct sigpending *pending, sigset_t *mask);
extern int do_send_sig_info(int sig, struct siginfo *info,
    struct task_struct *p, bool group);
extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p);
extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *);
extern int do_sigtimedwait(const sigset_t *, siginfo_t *,
    const struct timespec *);
extern int sigprocmask(int, sigset_t *, sigset_t *);
extern void set_current_blocked(sigset_t *);
extern void __set_current_blocked(const sigset_t *);
extern int show_unhandled_signals;
extern int sigsuspend(sigset_t *);

struct sigaction {

 __sighandler_t sa_handler;
 unsigned long sa_flags;





 __sigrestore_t sa_restorer;

 sigset_t sa_mask;
};

struct k_sigaction {
 struct sigaction sa;

 __sigrestore_t ka_restorer;

};
# 274 "include/linux/signal.h"
struct ksignal {
 struct k_sigaction ka;
 siginfo_t info;
 int sig;
};

extern int get_signal(struct ksignal *ksig);
extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping);
extern void exit_signals(struct task_struct *tsk);
extern void kernel_sigaction(int, __sighandler_t);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void allow_signal(int sig)
{





 kernel_sigaction(sig, ( __sighandler_t)2);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void disallow_signal(int sig)
{
 kernel_sigaction(sig, (( __sighandler_t)1));
}

extern struct kmem_cache *sighand_cachep;

int unhandled_signal(struct task_struct *tsk, int sig);
# 427 "include/linux/signal.h"
void signals_init(void);

int restore_altstack(const stack_t *);
int __save_altstack(stack_t *, unsigned long);
# 441 "include/linux/signal.h"
struct seq_file;
extern void render_sigset_t(struct seq_file *, const char *, sigset_t *);
# 38 "include/linux/sched.h" 2


# 1 "include/linux/pid.h" 1





enum pid_type
{
 PIDTYPE_PID,
 PIDTYPE_PGID,
 PIDTYPE_SID,
 PIDTYPE_MAX
};
# 50 "include/linux/pid.h"
struct upid {

 int nr;
 struct pid_namespace *ns;
 struct hlist_node pid_chain;
};

struct pid
{
 atomic_t count;
 unsigned int level;

 struct hlist_head tasks[PIDTYPE_MAX];
 struct callback_head rcu;
 struct upid numbers[1];
};

extern struct pid init_struct_pid;

struct pid_link
{
 struct hlist_node node;
 struct pid *pid;
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *get_pid(struct pid *pid)
{
 if (pid)
  atomic_add(1, &pid->count);
 return pid;
}

extern void put_pid(struct pid *pid);
extern struct task_struct *pid_task(struct pid *pid, enum pid_type);
extern struct task_struct *get_pid_task(struct pid *pid, enum pid_type);

extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type);




extern void attach_pid(struct task_struct *task, enum pid_type);
extern void detach_pid(struct task_struct *task, enum pid_type);
extern void change_pid(struct task_struct *task, enum pid_type,
   struct pid *pid);
extern void transfer_pid(struct task_struct *old, struct task_struct *new,
    enum pid_type);

struct pid_namespace;
extern struct pid_namespace init_pid_ns;
# 110 "include/linux/pid.h"
extern struct pid *find_pid_ns(int nr, struct pid_namespace *ns);
extern struct pid *find_vpid(int nr);




extern struct pid *find_get_pid(int nr);
extern struct pid *find_ge_pid(int nr, struct pid_namespace *);
int next_pidmap(struct pid_namespace *pid_ns, unsigned int last);

extern struct pid *alloc_pid(struct pid_namespace *ns);
extern void free_pid(struct pid *pid);
extern void disable_pid_allocation(struct pid_namespace *ns);
# 134 "include/linux/pid.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid_namespace *ns_of_pid(struct pid *pid)
{
 struct pid_namespace *ns = ((void *)0);
 if (pid)
  ns = pid->numbers[pid->level].ns;
 return ns;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_child_reaper(struct pid *pid)
{
 return pid->numbers[pid->level].nr == 1;
}
# 164 "include/linux/pid.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t pid_nr(struct pid *pid)
{
 pid_t nr = 0;
 if (pid)
  nr = pid->numbers[0].nr;
 return nr;
}

pid_t pid_nr_ns(struct pid *pid, struct pid_namespace *ns);
pid_t pid_vnr(struct pid *pid);
# 41 "include/linux/sched.h" 2
# 1 "include/linux/percpu.h" 1



# 1 "include/linux/mmdebug.h" 1





struct page;
struct vm_area_struct;
struct mm_struct;

extern void dump_page(struct page *page, const char *reason);
extern void dump_page_badflags(struct page *page, const char *reason,
          unsigned long badflags);
void dump_vma(const struct vm_area_struct *vma);
void dump_mm(const struct mm_struct *mm);
# 5 "include/linux/percpu.h" 2




# 1 "include/linux/pfn.h" 1
# 10 "include/linux/percpu.h" 2
# 57 "include/linux/percpu.h"
extern void *pcpu_base_addr;
extern const unsigned long *pcpu_unit_offsets;

struct pcpu_group_info {
 int nr_units;
 unsigned long base_offset;
 unsigned int *cpu_map;

};

struct pcpu_alloc_info {
 size_t static_size;
 size_t reserved_size;
 size_t dyn_size;
 size_t unit_size;
 size_t atom_size;
 size_t alloc_size;
 size_t __ai_size;
 int nr_groups;
 struct pcpu_group_info groups[];
};

enum pcpu_fc {
 PCPU_FC_AUTO,
 PCPU_FC_EMBED,
 PCPU_FC_PAGE,

 PCPU_FC_NR,
};
extern const char * const pcpu_fc_names[PCPU_FC_NR];

extern enum pcpu_fc pcpu_chosen_fc;

typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int cpu, size_t size,
         size_t align);
typedef void (*pcpu_fc_free_fn_t)(void *ptr, size_t size);
typedef void (*pcpu_fc_populate_pte_fn_t)(unsigned long addr);
typedef int (pcpu_fc_cpu_distance_fn_t)(unsigned int from, unsigned int to);

extern struct pcpu_alloc_info * __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) pcpu_alloc_alloc_info(int nr_groups,
            int nr_units);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) pcpu_free_alloc_info(struct pcpu_alloc_info *ai);

extern int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
      void *base_addr);


extern int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size,
    size_t atom_size,
    pcpu_fc_cpu_distance_fn_t cpu_distance_fn,
    pcpu_fc_alloc_fn_t alloc_fn,
    pcpu_fc_free_fn_t free_fn);



extern int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) pcpu_page_first_chunk(size_t reserved_size,
    pcpu_fc_alloc_fn_t alloc_fn,
    pcpu_fc_free_fn_t free_fn,
    pcpu_fc_populate_pte_fn_t populate_pte_fn);


extern void *__alloc_reserved_percpu(size_t size, size_t align);
extern bool is_kernel_percpu_address(unsigned long addr);




extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) percpu_init_late(void);

extern void *__alloc_percpu_gfp(size_t size, size_t align, gfp_t gfp);
extern void *__alloc_percpu(size_t size, size_t align);
extern void free_percpu(void *__pdata);
extern phys_addr_t per_cpu_ptr_to_phys(void *addr);
# 139 "include/linux/percpu.h"
extern __attribute__((section(".data..percpu" ""))) __typeof__(printk_func_t) printk_func;
# 42 "include/linux/sched.h" 2
# 1 "include/linux/topology.h" 1
# 32 "include/linux/topology.h"
# 1 "include/linux/mmzone.h" 1
# 17 "include/linux/mmzone.h"
# 1 "include/linux/pageblock-flags.h" 1
# 29 "include/linux/pageblock-flags.h"
enum pageblock_bits {
 PB_migrate,
 PB_migrate_end = PB_migrate + 3 - 1,

 PB_migrate_skip,





 NR_PAGEBLOCK_BITS
};
# 66 "include/linux/pageblock-flags.h"
struct page;

unsigned long get_pfnblock_flags_mask(struct page *page,
    unsigned long pfn,
    unsigned long end_bitidx,
    unsigned long mask);

void set_pfnblock_flags_mask(struct page *page,
    unsigned long flags,
    unsigned long pfn,
    unsigned long end_bitidx,
    unsigned long mask);
# 18 "include/linux/mmzone.h" 2
# 38 "include/linux/mmzone.h"
enum {
 MIGRATE_UNMOVABLE,
 MIGRATE_RECLAIMABLE,
 MIGRATE_MOVABLE,
 MIGRATE_PCPTYPES,
 MIGRATE_RESERVE = MIGRATE_PCPTYPES,
# 63 "include/linux/mmzone.h"
 MIGRATE_TYPES
};
# 76 "include/linux/mmzone.h"
extern int page_group_by_mobility_disabled;
# 85 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_pfnblock_migratetype(struct page *page, unsigned long pfn)
{
 do { bool __cond = !(!(PB_migrate_end - PB_migrate != 2)); extern void __compiletime_assert_87(void) __attribute__((error("BUILD_BUG_ON failed: " "PB_migrate_end - PB_migrate != 2"))); if (__cond) __compiletime_assert_87(); do { } while (0); } while (0);
 return get_pfnblock_flags_mask(page, pfn, PB_migrate_end,
     ((1UL << (PB_migrate_end - PB_migrate + 1)) - 1));
}

struct free_area {
 struct list_head free_list[MIGRATE_TYPES];
 unsigned long nr_free;
};

struct pglist_data;
# 106 "include/linux/mmzone.h"
struct zone_padding {
 char x[0];
} __attribute__((__aligned__(1 << (5))));





enum zone_stat_item {

 NR_FREE_PAGES,
 NR_ALLOC_BATCH,
 NR_LRU_BASE,
 NR_INACTIVE_ANON = NR_LRU_BASE,
 NR_ACTIVE_ANON,
 NR_INACTIVE_FILE,
 NR_ACTIVE_FILE,
 NR_UNEVICTABLE,
 NR_MLOCK,
 NR_ANON_PAGES,
 NR_FILE_MAPPED,

 NR_FILE_PAGES,
 NR_FILE_DIRTY,
 NR_WRITEBACK,
 NR_SLAB_RECLAIMABLE,
 NR_SLAB_UNRECLAIMABLE,
 NR_PAGETABLE,
 NR_KERNEL_STACK,

 NR_UNSTABLE_NFS,
 NR_BOUNCE,
 NR_VMSCAN_WRITE,
 NR_VMSCAN_IMMEDIATE,
 NR_WRITEBACK_TEMP,
 NR_ISOLATED_ANON,
 NR_ISOLATED_FILE,
 NR_SHMEM,
 NR_DIRTIED,
 NR_WRITTEN,
 NR_PAGES_SCANNED,

 NUMA_HIT,
 NUMA_MISS,
 NUMA_FOREIGN,
 NUMA_INTERLEAVE_HIT,
 NUMA_LOCAL,
 NUMA_OTHER,

 WORKINGSET_REFAULT,
 WORKINGSET_ACTIVATE,
 WORKINGSET_NODERECLAIM,
 NR_ANON_TRANSPARENT_HUGEPAGES,
 NR_FREE_CMA_PAGES,
 NR_VM_ZONE_STAT_ITEMS };
# 175 "include/linux/mmzone.h"
enum lru_list {
 LRU_INACTIVE_ANON = 0,
 LRU_ACTIVE_ANON = 0 + 1,
 LRU_INACTIVE_FILE = 0 + 2,
 LRU_ACTIVE_FILE = 0 + 2 + 1,
 LRU_UNEVICTABLE,
 NR_LRU_LISTS
};





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_file_lru(enum lru_list lru)
{
 return (lru == LRU_INACTIVE_FILE || lru == LRU_ACTIVE_FILE);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_active_lru(enum lru_list lru)
{
 return (lru == LRU_ACTIVE_ANON || lru == LRU_ACTIVE_FILE);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_unevictable_lru(enum lru_list lru)
{
 return (lru == LRU_UNEVICTABLE);
}

struct zone_reclaim_stat {
# 212 "include/linux/mmzone.h"
 unsigned long recent_rotated[2];
 unsigned long recent_scanned[2];
};

struct lruvec {
 struct list_head lists[NR_LRU_LISTS];
 struct zone_reclaim_stat reclaim_stat;



};
# 239 "include/linux/mmzone.h"
typedef unsigned isolate_mode_t;

enum zone_watermarks {
 WMARK_MIN,
 WMARK_LOW,
 WMARK_HIGH,
 NR_WMARK
};





struct per_cpu_pages {
 int count;
 int high;
 int batch;


 struct list_head lists[MIGRATE_PCPTYPES];
};

struct per_cpu_pageset {
 struct per_cpu_pages pcp;

 s8 expire;


 s8 stat_threshold;
 s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS];

};



enum zone_type {
# 309 "include/linux/mmzone.h"
 ZONE_NORMAL,
# 321 "include/linux/mmzone.h"
 ZONE_MOVABLE,
 __MAX_NR_ZONES
};



struct zone {



 unsigned long watermark[NR_WMARK];
# 341 "include/linux/mmzone.h"
 long lowmem_reserve[2];


 int node;






 unsigned int inactive_ratio;

 struct pglist_data *zone_pgdat;
 struct per_cpu_pageset *pageset;





 unsigned long dirty_balance_reserve;
# 374 "include/linux/mmzone.h"
 unsigned long min_unmapped_pages;
 unsigned long min_slab_pages;



 unsigned long zone_start_pfn;
# 422 "include/linux/mmzone.h"
 unsigned long managed_pages;
 unsigned long spanned_pages;
 unsigned long present_pages;

 const char *name;





 int nr_migrate_reserve_block;
# 472 "include/linux/mmzone.h"
 wait_queue_head_t *wait_table;
 unsigned long wait_table_hash_nr_entries;
 unsigned long wait_table_bits;

 struct zone_padding _pad1_;


 spinlock_t lock;


 struct free_area free_area[11];


 unsigned long flags;

 struct zone_padding _pad2_;




 spinlock_t lru_lock;
 struct lruvec lruvec;


 atomic_long_t inactive_age;






 unsigned long percpu_drift_mark;



 unsigned long compact_cached_free_pfn;

 unsigned long compact_cached_migrate_pfn[2];
# 518 "include/linux/mmzone.h"
 unsigned int compact_considered;
 unsigned int compact_defer_shift;
 int compact_order_failed;




 bool compact_blockskip_flush;


 struct zone_padding _pad3_;

 atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
} __attribute__((__aligned__(1 << (5))));

enum zone_flags {
 ZONE_RECLAIM_LOCKED,
 ZONE_OOM_LOCKED,
 ZONE_CONGESTED,


 ZONE_DIRTY,



 ZONE_WRITEBACK,


 ZONE_FAIR_DEPLETED,
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long zone_end_pfn(const struct zone *zone)
{
 return zone->zone_start_pfn + zone->spanned_pages;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zone_spans_pfn(const struct zone *zone, unsigned long pfn)
{
 return zone->zone_start_pfn <= pfn && pfn < zone_end_pfn(zone);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zone_is_initialized(struct zone *zone)
{
 return !!zone->wait_table;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zone_is_empty(struct zone *zone)
{
 return zone->spanned_pages == 0;
}
# 650 "include/linux/mmzone.h"
struct zonelist_cache {
 unsigned short z_to_n[((1 << 4) * 2)];
 unsigned long fullzones[(((((1 << 4) * 2)) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))];
 unsigned long last_full_zap;
};
# 664 "include/linux/mmzone.h"
struct zoneref {
 struct zone *zone;
 int zone_idx;
};
# 686 "include/linux/mmzone.h"
struct zonelist {
 struct zonelist_cache *zlcache_ptr;
 struct zoneref _zonerefs[((1 << 4) * 2) + 1];

 struct zonelist_cache zlcache;

};


struct node_active_region {
 unsigned long start_pfn;
 unsigned long end_pfn;
 int nid;
};




extern struct page *mem_map;
# 718 "include/linux/mmzone.h"
struct bootmem_data;
typedef struct pglist_data {
 struct zone node_zones[2];
 struct zonelist node_zonelists[2];
 int nr_zones;
# 745 "include/linux/mmzone.h"
 unsigned long node_start_pfn;
 unsigned long node_present_pages;
 unsigned long node_spanned_pages;

 int node_id;
 wait_queue_head_t kswapd_wait;
 wait_queue_head_t pfmemalloc_wait;
 struct task_struct *kswapd;

 int kswapd_max_order;
 enum zone_type classzone_idx;
# 766 "include/linux/mmzone.h"
} pg_data_t;
# 780 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pgdat_end_pfn(pg_data_t *pgdat)
{
 return pgdat->node_start_pfn + pgdat->node_spanned_pages;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pgdat_is_empty(pg_data_t *pgdat)
{
 return !pgdat->node_start_pfn && !pgdat->node_spanned_pages;
}

# 1 "include/linux/memory_hotplug.h" 1



# 1 "include/linux/mmzone.h" 1
# 5 "include/linux/memory_hotplug.h" 2

# 1 "include/linux/notifier.h" 1
# 13 "include/linux/notifier.h"
# 1 "include/linux/mutex.h" 1
# 50 "include/linux/mutex.h"
struct mutex {

 atomic_t count;
 spinlock_t wait_lock;
 struct list_head wait_list;

 struct task_struct *owner;


 struct optimistic_spin_queue osq;







};





struct mutex_waiter {
 struct list_head list;
 struct task_struct *task;



};
# 99 "include/linux/mutex.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mutex_destroy(struct mutex *lock) {}
# 119 "include/linux/mutex.h"
extern void __mutex_init(struct mutex *lock, const char *name,
    struct lock_class_key *key);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mutex_is_locked(struct mutex *lock)
{
 return (*({ __attribute__((unused)) typeof((&lock->count)->counter) __var = ( typeof((&lock->count)->counter)) 0; (volatile typeof((&lock->count)->counter) *)&((&lock->count)->counter); })) != 1;
}
# 157 "include/linux/mutex.h"
extern void mutex_lock(struct mutex *lock);
extern int __attribute__((warn_unused_result)) mutex_lock_interruptible(struct mutex *lock);
extern int __attribute__((warn_unused_result)) mutex_lock_killable(struct mutex *lock);
# 173 "include/linux/mutex.h"
extern int mutex_trylock(struct mutex *lock);
extern void mutex_unlock(struct mutex *lock);

extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
# 14 "include/linux/notifier.h" 2

# 1 "include/linux/srcu.h" 1
# 34 "include/linux/srcu.h"
# 1 "include/linux/workqueue.h" 1







# 1 "include/linux/timer.h" 1




# 1 "include/linux/ktime.h" 1
# 37 "include/linux/ktime.h"
union ktime {
 s64 tv64;
};

typedef union ktime ktime_t;
# 50 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_set(const s64 secs, const unsigned long nsecs)
{
 if (__builtin_expect(!!(secs >= (((s64)~((u64)1 << 63)) / 1000000000L)), 0))
  return (ktime_t){ .tv64 = ((s64)~((u64)1 << 63)) };

 return (ktime_t) { .tv64 = secs * 1000000000L + (s64)nsecs };
}
# 81 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t timespec_to_ktime(struct timespec ts)
{
 return ktime_set(ts.tv_sec, ts.tv_nsec);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t timespec64_to_ktime(struct timespec ts)
{
 return ktime_set(ts.tv_sec, ts.tv_nsec);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t timeval_to_ktime(struct timeval tv)
{
 return ktime_set(tv.tv_sec, tv.tv_usec * 1000L);
}
# 120 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
{
 return cmp1.tv64 == cmp2.tv64;
}
# 135 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ktime_compare(const ktime_t cmp1, const ktime_t cmp2)
{
 if (cmp1.tv64 < cmp2.tv64)
  return -1;
 if (cmp1.tv64 > cmp2.tv64)
  return 1;
 return 0;
}
# 151 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ktime_after(const ktime_t cmp1, const ktime_t cmp2)
{
 return ktime_compare(cmp1, cmp2) > 0;
}
# 163 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ktime_before(const ktime_t cmp1, const ktime_t cmp2)
{
 return ktime_compare(cmp1, cmp2) < 0;
}
# 184 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 ktime_to_us(const ktime_t kt)
{
 return (u64)((kt).tv64 / (1000L));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 ktime_to_ms(const ktime_t kt)
{
 return (u64)((kt).tv64 / (1000000L));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 ktime_us_delta(const ktime_t later, const ktime_t earlier)
{
       return ktime_to_us(({ (ktime_t){ .tv64 = (later).tv64 - (earlier).tv64 }; }));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 ktime_ms_delta(const ktime_t later, const ktime_t earlier)
{
 return ktime_to_ms(({ (ktime_t){ .tv64 = (later).tv64 - (earlier).tv64 }; }));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_add_us(const ktime_t kt, const u64 usec)
{
 return ({ (ktime_t){ .tv64 = (kt).tv64 + (usec * 1000L) }; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_add_ms(const ktime_t kt, const u64 msec)
{
 return ({ (ktime_t){ .tv64 = (kt).tv64 + (msec * 1000000L) }; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_sub_us(const ktime_t kt, const u64 usec)
{
 return ({ (ktime_t){ .tv64 = (kt).tv64 - (usec * 1000L) }; });
}

extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
# 229 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((warn_unused_result)) bool ktime_to_timespec_cond(const ktime_t kt,
             struct timespec *ts)
{
 if (kt.tv64) {
  *ts = ns_to_timespec((kt).tv64);
  return true;
 } else {
  return false;
 }
}
# 248 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((warn_unused_result)) bool ktime_to_timespec64_cond(const ktime_t kt,
             struct timespec *ts)
{
 if (kt.tv64) {
  *ts = ns_to_timespec((kt).tv64);
  return true;
 } else {
  return false;
 }
}
# 268 "include/linux/ktime.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ns_to_ktime(u64 ns)
{
 static const ktime_t ktime_zero = { .tv64 = 0 };

 return ({ (ktime_t){ .tv64 = (ktime_zero).tv64 + (ns) }; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ms_to_ktime(u64 ms)
{
 static const ktime_t ktime_zero = { .tv64 = 0 };

 return ktime_add_ms(ktime_zero, ms);
}

# 1 "include/linux/timekeeping.h" 1





void timekeeping_init(void);
extern int timekeeping_suspended;




extern void do_gettimeofday(struct timeval *tv);
extern int do_settimeofday64(const struct timespec *ts);
extern int do_sys_settimeofday(const struct timespec *tv,
          const struct timezone *tz);




unsigned long get_seconds(void);
struct timespec current_kernel_time(void);

struct timespec __current_kernel_time(void);




struct timespec get_monotonic_coarse64(void);
extern void getrawmonotonic64(struct timespec *ts);
extern void ktime_get_ts64(struct timespec *ts);
extern time64_t ktime_get_seconds(void);
extern time64_t ktime_get_real_seconds(void);

extern int __getnstimeofday64(struct timespec *tv);
extern void getnstimeofday64(struct timespec *tv);
extern void getboottime64(struct timespec *ts);





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int do_settimeofday(const struct timespec *ts)
{
 return do_settimeofday64(ts);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __getnstimeofday(struct timespec *ts)
{
 return __getnstimeofday64(ts);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void getnstimeofday(struct timespec *ts)
{
 getnstimeofday64(ts);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ktime_get_ts(struct timespec *ts)
{
 ktime_get_ts64(ts);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ktime_get_real_ts(struct timespec *ts)
{
 getnstimeofday64(ts);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void getrawmonotonic(struct timespec *ts)
{
 getrawmonotonic64(ts);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec get_monotonic_coarse(void)
{
 return get_monotonic_coarse64();
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void getboottime(struct timespec *ts)
{
 return getboottime64(ts);
}
# 155 "include/linux/timekeeping.h"
enum tk_offsets {
 TK_OFFS_REAL,
 TK_OFFS_BOOT,
 TK_OFFS_TAI,
 TK_OFFS_MAX,
};

extern ktime_t ktime_get(void);
extern ktime_t ktime_get_with_offset(enum tk_offsets offs);
extern ktime_t ktime_mono_to_any(ktime_t tmono, enum tk_offsets offs);
extern ktime_t ktime_get_raw(void);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_get_real(void)
{
 return ktime_get_with_offset(TK_OFFS_REAL);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_get_boottime(void)
{
 return ktime_get_with_offset(TK_OFFS_BOOT);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_get_clocktai(void)
{
 return ktime_get_with_offset(TK_OFFS_TAI);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_mono_to_real(ktime_t mono)
{
 return ktime_mono_to_any(mono, TK_OFFS_REAL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 ktime_get_ns(void)
{
 return ((ktime_get()).tv64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 ktime_get_real_ns(void)
{
 return ((ktime_get_real()).tv64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 ktime_get_boot_ns(void)
{
 return ((ktime_get_boottime()).tv64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 ktime_get_raw_ns(void)
{
 return ((ktime_get_raw()).tv64);
}

extern u64 ktime_get_mono_fast_ns(void);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_monotonic_boottime(struct timespec *ts)
{
 *ts = ns_to_timespec((ktime_get_boottime()).tv64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_monotonic_boottime64(struct timespec *ts)
{
 *ts = ns_to_timespec((ktime_get_boottime()).tv64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timekeeping_clocktai(struct timespec *ts)
{
 *ts = ns_to_timespec((ktime_get_clocktai()).tv64);
}




extern void timekeeping_inject_sleeptime64(struct timespec *delta);




extern void getnstime_raw_and_real(struct timespec *ts_raw,
       struct timespec *ts_real);




extern bool persistent_clock_exist;
extern int persistent_clock_is_local;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool has_persistent_clock(void)
{
 return persistent_clock_exist;
}

extern void read_persistent_clock(struct timespec *ts);
extern void read_boot_clock(struct timespec *ts);
extern int update_persistent_clock(struct timespec now);
# 283 "include/linux/ktime.h" 2
# 6 "include/linux/timer.h" 2




struct tvec_base;

struct timer_list {




 struct list_head entry;
 unsigned long expires;
 struct tvec_base *base;

 void (*function)(unsigned long);
 unsigned long data;

 int slack;
# 34 "include/linux/timer.h"
};

extern struct tvec_base boot_tvec_bases;
# 94 "include/linux/timer.h"
void init_timer_key(struct timer_list *timer, unsigned int flags,
      const char *name, struct lock_class_key *key);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_timer_on_stack(struct timer_list *timer) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_timer_on_stack_key(struct timer_list *timer,
        unsigned int flags, const char *name,
        struct lock_class_key *key)
{
 init_timer_key(timer, flags, name, key);
}
# 169 "include/linux/timer.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timer_pending(const struct timer_list * timer)
{
 return timer->entry.next != ((void *)0);
}

extern void add_timer_on(struct timer_list *timer, int cpu);
extern int del_timer(struct timer_list * timer);
extern int mod_timer(struct timer_list *timer, unsigned long expires);
extern int mod_timer_pending(struct timer_list *timer, unsigned long expires);
extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires);

extern void set_timer_slack(struct timer_list *time, int slack_hz);
# 195 "include/linux/timer.h"
extern unsigned long get_next_timer_interrupt(unsigned long now);
# 227 "include/linux/timer.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_timer_stats(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timer_stats_timer_set_start_info(struct timer_list *timer)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timer_stats_timer_clear_start_info(struct timer_list *timer)
{
}


extern void add_timer(struct timer_list *timer);

extern int try_to_del_timer_sync(struct timer_list *timer);


  extern int del_timer_sync(struct timer_list *timer);






extern void init_timers(void);
extern void run_local_timers(void);
struct hrtimer;
extern enum hrtimer_restart it_real_fn(struct hrtimer *);

unsigned long __round_jiffies(unsigned long j, int cpu);
unsigned long __round_jiffies_relative(unsigned long j, int cpu);
unsigned long round_jiffies(unsigned long j);
unsigned long round_jiffies_relative(unsigned long j);

unsigned long __round_jiffies_up(unsigned long j, int cpu);
unsigned long __round_jiffies_up_relative(unsigned long j, int cpu);
unsigned long round_jiffies_up(unsigned long j);
unsigned long round_jiffies_up_relative(unsigned long j);
# 9 "include/linux/workqueue.h" 2







struct workqueue_struct;

struct work_struct;
typedef void (*work_func_t)(struct work_struct *work);
void delayed_work_timer_fn(unsigned long __data);







enum {
 WORK_STRUCT_PENDING_BIT = 0,
 WORK_STRUCT_DELAYED_BIT = 1,
 WORK_STRUCT_PWQ_BIT = 2,
 WORK_STRUCT_LINKED_BIT = 3,




 WORK_STRUCT_COLOR_SHIFT = 4,


 WORK_STRUCT_COLOR_BITS = 4,

 WORK_STRUCT_PENDING = 1 << WORK_STRUCT_PENDING_BIT,
 WORK_STRUCT_DELAYED = 1 << WORK_STRUCT_DELAYED_BIT,
 WORK_STRUCT_PWQ = 1 << WORK_STRUCT_PWQ_BIT,
 WORK_STRUCT_LINKED = 1 << WORK_STRUCT_LINKED_BIT,



 WORK_STRUCT_STATIC = 0,






 WORK_NR_COLORS = (1 << WORK_STRUCT_COLOR_BITS) - 1,
 WORK_NO_COLOR = WORK_NR_COLORS,


 WORK_CPU_UNBOUND = 128,






 WORK_STRUCT_FLAG_BITS = WORK_STRUCT_COLOR_SHIFT +
      WORK_STRUCT_COLOR_BITS,


 WORK_OFFQ_FLAG_BASE = WORK_STRUCT_COLOR_SHIFT,

 WORK_OFFQ_CANCELING = (1 << WORK_OFFQ_FLAG_BASE),






 WORK_OFFQ_FLAG_BITS = 1,
 WORK_OFFQ_POOL_SHIFT = WORK_OFFQ_FLAG_BASE + WORK_OFFQ_FLAG_BITS,
 WORK_OFFQ_LEFT = 64 - WORK_OFFQ_POOL_SHIFT,
 WORK_OFFQ_POOL_BITS = WORK_OFFQ_LEFT <= 31 ? WORK_OFFQ_LEFT : 31,
 WORK_OFFQ_POOL_NONE = (1LU << WORK_OFFQ_POOL_BITS) - 1,


 WORK_STRUCT_FLAG_MASK = (1UL << WORK_STRUCT_FLAG_BITS) - 1,
 WORK_STRUCT_WQ_DATA_MASK = ~WORK_STRUCT_FLAG_MASK,
 WORK_STRUCT_NO_POOL = (unsigned long)WORK_OFFQ_POOL_NONE << WORK_OFFQ_POOL_SHIFT,


 WORK_BUSY_PENDING = 1 << 0,
 WORK_BUSY_RUNNING = 1 << 1,


 WORKER_DESC_LEN = 24,
};

struct work_struct {
 atomic_long_t data;
 struct list_head entry;
 work_func_t func;



};





struct delayed_work {
 struct work_struct work;
 struct timer_list timer;


 struct workqueue_struct *wq;
 int cpu;
};
# 129 "include/linux/workqueue.h"
struct workqueue_attrs {
 int nice;
 cpumask_var_t cpumask;
 bool no_numa;
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct delayed_work *to_delayed_work(struct work_struct *work)
{
 return ({ const typeof( ((struct delayed_work *)0)->work ) *__mptr = (work); (struct delayed_work *)( (char *)__mptr - __builtin_offsetof(struct delayed_work,work) );});
}

struct execute_work {
 struct work_struct work;
};
# 188 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __init_work(struct work_struct *work, int onstack) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_work_on_stack(struct work_struct *work) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_delayed_work_on_stack(struct delayed_work *work) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int work_static(struct work_struct *work) { return 0; }
# 276 "include/linux/workqueue.h"
enum {
 WQ_UNBOUND = 1 << 1,
 WQ_FREEZABLE = 1 << 2,
 WQ_MEM_RECLAIM = 1 << 3,
 WQ_HIGHPRI = 1 << 4,
 WQ_CPU_INTENSIVE = 1 << 5,
 WQ_SYSFS = 1 << 6,
# 309 "include/linux/workqueue.h"
 WQ_POWER_EFFICIENT = 1 << 7,

 __WQ_DRAINING = 1 << 16,
 __WQ_ORDERED = 1 << 17,

 WQ_MAX_ACTIVE = 512,
 WQ_MAX_UNBOUND_PER_CPU = 4,
 WQ_DFL_ACTIVE = WQ_MAX_ACTIVE / 2,
};
# 351 "include/linux/workqueue.h"
extern struct workqueue_struct *system_wq;
extern struct workqueue_struct *system_highpri_wq;
extern struct workqueue_struct *system_long_wq;
extern struct workqueue_struct *system_unbound_wq;
extern struct workqueue_struct *system_freezable_wq;
extern struct workqueue_struct *system_power_efficient_wq;
extern struct workqueue_struct *system_freezable_power_efficient_wq;

extern struct workqueue_struct *
__alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,
 struct lock_class_key *key, const char *lock_name, ...) __attribute__((format(printf, 1, 6)));
# 420 "include/linux/workqueue.h"
extern void destroy_workqueue(struct workqueue_struct *wq);

struct workqueue_attrs *alloc_workqueue_attrs(gfp_t gfp_mask);
void free_workqueue_attrs(struct workqueue_attrs *attrs);
int apply_workqueue_attrs(struct workqueue_struct *wq,
     const struct workqueue_attrs *attrs);

extern bool queue_work_on(int cpu, struct workqueue_struct *wq,
   struct work_struct *work);
extern bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
   struct delayed_work *work, unsigned long delay);
extern bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq,
   struct delayed_work *dwork, unsigned long delay);

extern void flush_workqueue(struct workqueue_struct *wq);
extern void drain_workqueue(struct workqueue_struct *wq);
extern void flush_scheduled_work(void);

extern int schedule_on_each_cpu(work_func_t func);

int execute_in_process_context(work_func_t fn, struct execute_work *);

extern bool flush_work(struct work_struct *work);
extern bool cancel_work_sync(struct work_struct *work);

extern bool flush_delayed_work(struct delayed_work *dwork);
extern bool cancel_delayed_work(struct delayed_work *dwork);
extern bool cancel_delayed_work_sync(struct delayed_work *dwork);

extern void workqueue_set_max_active(struct workqueue_struct *wq,
         int max_active);
extern bool current_is_workqueue_rescuer(void);
extern bool workqueue_congested(int cpu, struct workqueue_struct *wq);
extern unsigned int work_busy(struct work_struct *work);
extern __attribute__((format(printf, 1, 2))) void set_worker_desc(const char *fmt, ...);
extern void print_worker_info(const char *log_lvl, struct task_struct *task);
# 467 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool queue_work(struct workqueue_struct *wq,
         struct work_struct *work)
{
 return queue_work_on(WORK_CPU_UNBOUND, wq, work);
}
# 481 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool queue_delayed_work(struct workqueue_struct *wq,
          struct delayed_work *dwork,
          unsigned long delay)
{
 return queue_delayed_work_on(WORK_CPU_UNBOUND, wq, dwork, delay);
}
# 496 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool mod_delayed_work(struct workqueue_struct *wq,
        struct delayed_work *dwork,
        unsigned long delay)
{
 return mod_delayed_work_on(WORK_CPU_UNBOUND, wq, dwork, delay);
}
# 510 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool schedule_work_on(int cpu, struct work_struct *work)
{
 return queue_work_on(cpu, system_wq, work);
}
# 526 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool schedule_work(struct work_struct *work)
{
 return queue_work(system_wq, work);
}
# 540 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool schedule_delayed_work_on(int cpu, struct delayed_work *dwork,
         unsigned long delay)
{
 return queue_delayed_work_on(cpu, system_wq, dwork, delay);
}
# 554 "include/linux/workqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool schedule_delayed_work(struct delayed_work *dwork,
      unsigned long delay)
{
 return queue_delayed_work(system_wq, dwork, delay);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool keventd_up(void)
{
 return system_wq != ((void *)0);
}







long work_on_cpu(int cpu, long (*fn)(void *), void *arg);
# 584 "include/linux/workqueue.h"
int workqueue_sysfs_register(struct workqueue_struct *wq);
# 35 "include/linux/srcu.h" 2

struct srcu_struct_array {
 unsigned long c[2];
 unsigned long seq[2];
};

struct rcu_batch {
 struct callback_head *head, **tail;
};



struct srcu_struct {
 unsigned long completed;
 struct srcu_struct_array *per_cpu_ref;
 spinlock_t queue_lock;
 bool running;

 struct rcu_batch batch_queue;

 struct rcu_batch batch_check0;

 struct rcu_batch batch_check1;
 struct rcu_batch batch_done;
 struct delayed_work work;



};
# 80 "include/linux/srcu.h"
int init_srcu_struct(struct srcu_struct *sp);




void process_srcu(struct work_struct *work);
# 128 "include/linux/srcu.h"
void call_srcu(struct srcu_struct *sp, struct callback_head *head,
  void (*func)(struct callback_head *head));

void cleanup_srcu_struct(struct srcu_struct *sp);
int __srcu_read_lock(struct srcu_struct *sp) ;
void __srcu_read_unlock(struct srcu_struct *sp, int idx) ;
void synchronize_srcu(struct srcu_struct *sp);
void synchronize_srcu_expedited(struct srcu_struct *sp);
unsigned long srcu_batches_completed(struct srcu_struct *sp);
void srcu_barrier(struct srcu_struct *sp);
# 165 "include/linux/srcu.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int srcu_read_lock_held(struct srcu_struct *sp)
{
 return 1;
}
# 216 "include/linux/srcu.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int srcu_read_lock(struct srcu_struct *sp)
{
 int retval = __srcu_read_lock(sp);

 do { } while (0);
 return retval;
}
# 231 "include/linux/srcu.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void srcu_read_unlock(struct srcu_struct *sp, int idx)

{
 do { } while (0);
 __srcu_read_unlock(sp, idx);
}
# 247 "include/linux/srcu.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void smp_mb__after_srcu_read_unlock(void)
{

}
# 16 "include/linux/notifier.h" 2
# 50 "include/linux/notifier.h"
typedef int (*notifier_fn_t)(struct notifier_block *nb,
   unsigned long action, void *data);

struct notifier_block {
 notifier_fn_t notifier_call;
 struct notifier_block *next;
 int priority;
};

struct atomic_notifier_head {
 spinlock_t lock;
 struct notifier_block *head;
};

struct blocking_notifier_head {
 struct rw_semaphore rwsem;
 struct notifier_block *head;
};

struct raw_notifier_head {
 struct notifier_block *head;
};

struct srcu_notifier_head {
 struct mutex mutex;
 struct srcu_struct srcu;
 struct notifier_block *head;
};
# 92 "include/linux/notifier.h"
extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
# 118 "include/linux/notifier.h"
extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh,
  struct notifier_block *nb);
extern int blocking_notifier_chain_register(struct blocking_notifier_head *nh,
  struct notifier_block *nb);
extern int raw_notifier_chain_register(struct raw_notifier_head *nh,
  struct notifier_block *nb);
extern int srcu_notifier_chain_register(struct srcu_notifier_head *nh,
  struct notifier_block *nb);

extern int blocking_notifier_chain_cond_register(
  struct blocking_notifier_head *nh,
  struct notifier_block *nb);

extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh,
  struct notifier_block *nb);
extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh,
  struct notifier_block *nb);
extern int raw_notifier_chain_unregister(struct raw_notifier_head *nh,
  struct notifier_block *nb);
extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *nh,
  struct notifier_block *nb);

extern int atomic_notifier_call_chain(struct atomic_notifier_head *nh,
  unsigned long val, void *v);
extern int __atomic_notifier_call_chain(struct atomic_notifier_head *nh,
 unsigned long val, void *v, int nr_to_call, int *nr_calls);
extern int blocking_notifier_call_chain(struct blocking_notifier_head *nh,
  unsigned long val, void *v);
extern int __blocking_notifier_call_chain(struct blocking_notifier_head *nh,
 unsigned long val, void *v, int nr_to_call, int *nr_calls);
extern int raw_notifier_call_chain(struct raw_notifier_head *nh,
  unsigned long val, void *v);
extern int __raw_notifier_call_chain(struct raw_notifier_head *nh,
 unsigned long val, void *v, int nr_to_call, int *nr_calls);
extern int srcu_notifier_call_chain(struct srcu_notifier_head *nh,
  unsigned long val, void *v);
extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
 unsigned long val, void *v, int nr_to_call, int *nr_calls);
# 168 "include/linux/notifier.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int notifier_from_errno(int err)
{
 if (err)
  return 0x8000 | (0x0001 - err);

 return 0x0001;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int notifier_to_errno(int ret)
{
 ret &= ~0x8000;
 return ret > 0x0001 ? 0x0001 - ret : 0;
}
# 212 "include/linux/notifier.h"
extern struct blocking_notifier_head reboot_notifier_list;
# 7 "include/linux/memory_hotplug.h" 2


struct page;
struct zone;
struct pglist_data;
struct mem_section;
struct memory_block;
# 199 "include/linux/memory_hotplug.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgdat_resize_lock(struct pglist_data *p, unsigned long *f) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgdat_resize_unlock(struct pglist_data *p, unsigned long *f) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgdat_resize_init(struct pglist_data *pgdat) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned zone_span_seqbegin(struct zone *zone)
{
 return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zone_span_seqretry(struct zone *zone, unsigned iv)
{
 return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void zone_span_writelock(struct zone *zone) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void zone_span_writeunlock(struct zone *zone) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void zone_seqlock_init(struct zone *zone) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mhp_notimplemented(const char *func)
{
 printk("\001" "4" "%s() called, with CONFIG_MEMORY_HOTPLUG disabled\n", func);
 dump_stack();
 return -90;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void register_page_bootmem_info_node(struct pglist_data *pgdat)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int try_online_node(int nid)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_online_mems(void) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_online_mems(void) {}
# 244 "include/linux/memory_hotplug.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_mem_section_removable(unsigned long pfn,
     unsigned long nr_pages)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void try_offline_node(int nid) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int offline_pages(unsigned long start_pfn, unsigned long nr_pages)
{
 return -22;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void remove_memory(int nid, u64 start, u64 size) {}


extern int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn,
  void *arg, int (*func)(struct memory_block *, void *));
extern int add_memory(int nid, u64 start, u64 size);
extern int zone_for_memory(int nid, u64 start, u64 size, int zone_default);
extern int arch_add_memory(int nid, u64 start, u64 size);
extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages);
extern bool is_memblock_offlined(struct memory_block *mem);
extern void remove_memory(int nid, u64 start, u64 size);
extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn);
extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms);
extern struct page *sparse_decode_mem_map(unsigned long coded_mem_map,
       unsigned long pnum);
# 791 "include/linux/mmzone.h" 2

extern struct mutex zonelists_mutex;
void build_all_zonelists(pg_data_t *pgdat, struct zone *zone);
void wakeup_kswapd(struct zone *zone, int order, enum zone_type classzone_idx);
bool zone_watermark_ok(struct zone *z, unsigned int order,
  unsigned long mark, int classzone_idx, int alloc_flags);
bool zone_watermark_ok_safe(struct zone *z, unsigned int order,
  unsigned long mark, int classzone_idx, int alloc_flags);
enum memmap_context {
 MEMMAP_EARLY,
 MEMMAP_HOTPLUG,
};
extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
         unsigned long size,
         enum memmap_context context);

extern void lruvec_init(struct lruvec *lruvec);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zone *lruvec_zone(struct lruvec *lruvec)
{



 return ({ const typeof( ((struct zone *)0)->lruvec ) *__mptr = (lruvec); (struct zone *)( (char *)__mptr - __builtin_offsetof(struct zone,lruvec) );});

}


void memory_present(int nid, unsigned long start, unsigned long end);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int local_memory_node(int node_id) { return node_id; };
# 839 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int populated_zone(struct zone *zone)
{
 return (!!zone->present_pages);
}

extern int movable_zone;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zone_movable_is_highmem(void)
{





 return 0;

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_highmem_idx(enum zone_type idx)
{




 return 0;

}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_highmem(struct zone *zone)
{






 return 0;

}


struct ctl_table;
int min_free_kbytes_sysctl_handler(struct ctl_table *, int,
     void *, size_t *, loff_t *);
extern int sysctl_lowmem_reserve_ratio[2 -1];
int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int,
     void *, size_t *, loff_t *);
int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int,
     void *, size_t *, loff_t *);
int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int,
   void *, size_t *, loff_t *);
int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int,
   void *, size_t *, loff_t *);

extern int numa_zonelist_order_handler(struct ctl_table *, int,
   void *, size_t *, loff_t *);
extern char numa_zonelist_order[];
# 912 "include/linux/mmzone.h"
# 1 "./arch/sparc/include/asm/mmzone.h" 1







extern struct pglist_data *node_data[];



extern int numa_cpu_lookup_table[];
extern cpumask_t numa_cpumask_lookup_table[];
# 913 "include/linux/mmzone.h" 2



extern struct pglist_data *first_online_pgdat(void);
extern struct pglist_data *next_online_pgdat(struct pglist_data *pgdat);
extern struct zone *next_zone(struct zone *zone);
# 948 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zone *zonelist_zone(struct zoneref *zoneref)
{
 return zoneref->zone;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zonelist_zone_idx(struct zoneref *zoneref)
{
 return zoneref->zone_idx;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zonelist_node_idx(struct zoneref *zoneref)
{


 return zoneref->zone->node;



}
# 980 "include/linux/mmzone.h"
struct zoneref *next_zones_zonelist(struct zoneref *z,
     enum zone_type highest_zoneidx,
     nodemask_t *nodes);
# 996 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zoneref *first_zones_zonelist(struct zonelist *zonelist,
     enum zone_type highest_zoneidx,
     nodemask_t *nodes,
     struct zone **zone)
{
 struct zoneref *z = next_zones_zonelist(zonelist->_zonerefs,
       highest_zoneidx, nodes);
 *zone = zonelist_zone(z);
 return z;
}
# 1081 "include/linux/mmzone.h"
struct page;
struct page_ext;
struct mem_section {
# 1096 "include/linux/mmzone.h"
 unsigned long section_mem_map;


 unsigned long *pageblock_flags;
# 1112 "include/linux/mmzone.h"
};
# 1125 "include/linux/mmzone.h"
extern struct mem_section *mem_section[((((1UL << (53 - 30))) + ((((1UL) << 13) / sizeof (struct mem_section))) - 1) / ((((1UL) << 13) / sizeof (struct mem_section))))];




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct mem_section *__nr_to_section(unsigned long nr)
{
 if (!mem_section[((nr) / (((1UL) << 13) / sizeof (struct mem_section)))])
  return ((void *)0);
 return &mem_section[((nr) / (((1UL) << 13) / sizeof (struct mem_section)))][nr & ((((1UL) << 13) / sizeof (struct mem_section)) - 1)];
}
extern int __section_nr(struct mem_section* ms);
extern unsigned long usemap_size(void);
# 1150 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *__section_mem_map_addr(struct mem_section *section)
{
 unsigned long map = section->section_mem_map;
 map &= (~((1UL<<2)-1));
 return (struct page *)map;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int present_section(struct mem_section *section)
{
 return (section && (section->section_mem_map & (1UL<<0)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int present_section_nr(unsigned long nr)
{
 return present_section(__nr_to_section(nr));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int valid_section(struct mem_section *section)
{
 return (section && (section->section_mem_map & (1UL<<1)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int valid_section_nr(unsigned long nr)
{
 return valid_section(__nr_to_section(nr));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct mem_section *__pfn_to_section(unsigned long pfn)
{
 return __nr_to_section(((pfn) >> (30 - 13)));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pfn_valid(unsigned long pfn)
{
 if (((pfn) >> (30 - 13)) >= (1UL << (53 - 30)))
  return 0;
 return valid_section(__nr_to_section(((pfn) >> (30 - 13))));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pfn_present(unsigned long pfn)
{
 if (((pfn) >> (30 - 13)) >= (1UL << (53 - 30)))
  return 0;
 return present_section(__nr_to_section(((pfn) >> (30 - 13))));
}
# 1214 "include/linux/mmzone.h"
void sparse_init(void);






bool early_pfn_in_nid(unsigned long pfn, int nid);
# 1230 "include/linux/mmzone.h"
void memory_present(int nid, unsigned long start, unsigned long end);
unsigned long __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) node_memmap_size_bytes(int, unsigned long, unsigned long);
# 1264 "include/linux/mmzone.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int memmap_valid_within(unsigned long pfn,
     struct page *page, struct zone *zone)
{
 return 1;
}
# 33 "include/linux/topology.h" 2


# 1 "./arch/sparc/include/asm/topology.h" 1



# 1 "./arch/sparc/include/asm/topology_64.h" 1







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_to_node(int cpu)
{
 return numa_cpu_lookup_table[cpu];
}







struct pci_bus;

int pcibus_to_node(struct pci_bus *pbus);
# 47 "./arch/sparc/include/asm/topology_64.h"
extern cpumask_t cpu_core_map[128];
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cpumask *cpu_coregroup_mask(int cpu)
{
        return &cpu_core_map[cpu];
}
# 5 "./arch/sparc/include/asm/topology.h" 2
# 36 "include/linux/topology.h" 2
# 49 "include/linux/topology.h"
int arch_update_cpu_topology(void);
# 106 "include/linux/topology.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int numa_node_id(void)
{
 return cpu_to_node(((current_thread_info_reg)->cpu));
}
# 166 "include/linux/topology.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int numa_mem_id(void)
{
 return numa_node_id();
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int node_to_mem_node(int node)
{
 return node;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_to_mem(int cpu)
{
 return cpu_to_node(cpu);
}
# 202 "include/linux/topology.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cpumask *cpu_smt_mask(int cpu)
{
 return (&(*({ do { const void *__vpp_verify = (typeof((&(cpu_sibling_map)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*((&(cpu_sibling_map)))) *)((&(cpu_sibling_map))))); (typeof((typeof(*((&(cpu_sibling_map)))) *)((&(cpu_sibling_map))))) (__ptr + ((((trap_block[((cpu))].__per_cpu_base))))); }); })));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cpumask *cpu_cpu_mask(int cpu)
{
 return ((cpu_to_node(cpu)) == -1 ? ((struct cpumask *)(1 ? (cpu_all_bits) : (void *)sizeof(__check_is_bitmap(cpu_all_bits)))) : &numa_cpumask_lookup_table[cpu_to_node(cpu)]);
}
# 43 "include/linux/sched.h" 2
# 1 "include/linux/proportions.h" 1
# 12 "include/linux/proportions.h"
# 1 "include/linux/percpu_counter.h" 1
# 15 "include/linux/percpu_counter.h"
# 1 "include/linux/gfp.h" 1
# 10 "include/linux/gfp.h"
struct vm_area_struct;
# 156 "include/linux/gfp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int gfpflags_to_migratetype(const gfp_t gfp_flags)
{
 ({ int __ret_warn_on = !!((gfp_flags & ((( gfp_t)0x80000u)|(( gfp_t)0x08u))) == ((( gfp_t)0x80000u)|(( gfp_t)0x08u))); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/gfp.h", 158); __builtin_expect(!!(__ret_warn_on), 0); });

 if (__builtin_expect(!!(page_group_by_mobility_disabled), 0))
  return MIGRATE_UNMOVABLE;


 return (((gfp_flags & (( gfp_t)0x08u)) != 0) << 1) |
  ((gfp_flags & (( gfp_t)0x80000u)) != 0);
}
# 251 "include/linux/gfp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum zone_type gfp_zone(gfp_t flags)
{
 enum zone_type z;
 int bit = ( int) (flags & ((( gfp_t)0x01u)|(( gfp_t)0x02u)|(( gfp_t)0x04u)|(( gfp_t)0x08u)));

 z = (( (ZONE_NORMAL << 0 * 1) | (ZONE_NORMAL << 0x01u * 1) | (ZONE_NORMAL << 0x02u * 1) | (ZONE_NORMAL << 0x04u * 1) | (ZONE_NORMAL << 0x08u * 1) | (ZONE_NORMAL << (0x08u | 0x01u) * 1) | (ZONE_MOVABLE << (0x08u | 0x02u) * 1) | (ZONE_NORMAL << (0x08u | 0x04u) * 1) ) >> (bit * 1)) &
      ((1 << 1) - 1);
 ((void)(sizeof(( long)((( 1 << (0x01u | 0x02u) | 1 << (0x01u | 0x04u) | 1 << (0x04u | 0x02u) | 1 << (0x01u | 0x04u | 0x02u) | 1 << (0x08u | 0x02u | 0x01u) | 1 << (0x08u | 0x04u | 0x01u) | 1 << (0x08u | 0x04u | 0x02u) | 1 << (0x08u | 0x04u | 0x01u | 0x02u) ) >> bit) & 1))));
 return z;
}
# 269 "include/linux/gfp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int gfp_zonelist(gfp_t flags)
{
 if ((1 || 0) && __builtin_expect(!!(flags & (( gfp_t)0x40000u)), 0))
  return 1;

 return 0;
}
# 286 "include/linux/gfp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zonelist *node_zonelist(int nid, gfp_t flags)
{
 return (node_data[nid])->node_zonelists + gfp_zonelist(flags);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_free_page(struct page *page, int order) { }


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_alloc_page(struct page *page, int order) { }


struct page *
__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
         struct zonelist *zonelist, nodemask_t *nodemask);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *
__alloc_pages(gfp_t gfp_mask, unsigned int order,
  struct zonelist *zonelist)
{
 return __alloc_pages_nodemask(gfp_mask, order, zonelist, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
      unsigned int order)
{

 if (nid < 0)
  nid = numa_node_id();

 return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *alloc_pages_exact_node(int nid, gfp_t gfp_mask,
      unsigned int order)
{
 ((void)(sizeof(( long)(nid < 0 || nid >= (1 << 4) || !node_state((nid), N_ONLINE)))));

 return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask));
}


extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *
alloc_pages(gfp_t gfp_mask, unsigned int order)
{
 return alloc_pages_current(gfp_mask, order);
}
extern struct page *alloc_pages_vma(gfp_t gfp_mask, int order,
   struct vm_area_struct *vma, unsigned long addr,
   int node, bool hugepage);
# 354 "include/linux/gfp.h"
extern struct page *alloc_kmem_pages(gfp_t gfp_mask, unsigned int order);
extern struct page *alloc_kmem_pages_node(int nid, gfp_t gfp_mask,
       unsigned int order);

extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order);
extern unsigned long get_zeroed_page(gfp_t gfp_mask);

void *alloc_pages_exact(size_t size, gfp_t gfp_mask);
void free_pages_exact(void *virt, size_t size);

void * __attribute__ ((__section__(".meminit.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask);







extern void __free_pages(struct page *page, unsigned int order);
extern void free_pages(unsigned long addr, unsigned int order);
extern void free_hot_cold_page(struct page *page, bool cold);
extern void free_hot_cold_page_list(struct list_head *list, bool cold);

extern void __free_kmem_pages(struct page *page, unsigned int order);
extern void free_kmem_pages(unsigned long addr, unsigned int order);




void page_alloc_init(void);
void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
void drain_all_pages(struct zone *zone);
void drain_local_pages(struct zone *zone);
# 395 "include/linux/gfp.h"
extern gfp_t gfp_allowed_mask;


bool gfp_pfmemalloc_allowed(gfp_t gfp_mask);

extern void pm_restrict_gfp_mask(void);
extern void pm_restore_gfp_mask(void);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pm_suspended_storage(void)
{
 return false;
}
# 16 "include/linux/percpu_counter.h" 2



struct percpu_counter {
 raw_spinlock_t lock;
 s64 count;

 struct list_head list;

 s32 *counters;
};

extern int percpu_counter_batch;

int __percpu_counter_init(struct percpu_counter *fbc, s64 amount, gfp_t gfp,
     struct lock_class_key *key);
# 40 "include/linux/percpu_counter.h"
void percpu_counter_destroy(struct percpu_counter *fbc);
void percpu_counter_set(struct percpu_counter *fbc, s64 amount);
void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch);
s64 __percpu_counter_sum(struct percpu_counter *fbc);
int percpu_counter_compare(struct percpu_counter *fbc, s64 rhs);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_counter_add(struct percpu_counter *fbc, s64 amount)
{
 __percpu_counter_add(fbc, amount, percpu_counter_batch);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 percpu_counter_sum_positive(struct percpu_counter *fbc)
{
 s64 ret = __percpu_counter_sum(fbc);
 return ret < 0 ? 0 : ret;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 percpu_counter_sum(struct percpu_counter *fbc)
{
 return __percpu_counter_sum(fbc);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 percpu_counter_read(struct percpu_counter *fbc)
{
 return fbc->count;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 percpu_counter_read_positive(struct percpu_counter *fbc)
{
 s64 ret = fbc->count;

 __asm__ __volatile__("": : :"memory");
 if (ret >= 0)
  return ret;
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int percpu_counter_initialized(struct percpu_counter *fbc)
{
 return (fbc->counters != ((void *)0));
}
# 164 "include/linux/percpu_counter.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_counter_inc(struct percpu_counter *fbc)
{
 percpu_counter_add(fbc, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_counter_dec(struct percpu_counter *fbc)
{
 percpu_counter_add(fbc, -1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_counter_sub(struct percpu_counter *fbc, s64 amount)
{
 percpu_counter_add(fbc, -amount);
}
# 13 "include/linux/proportions.h" 2




struct prop_global {





 int shift;






 struct percpu_counter events;
};






struct prop_descriptor {
 int index;
 struct prop_global pg[2];
 struct mutex mutex;
};

int prop_descriptor_init(struct prop_descriptor *pd, int shift, gfp_t gfp);
void prop_change_shift(struct prop_descriptor *pd, int new_shift);





struct prop_local_percpu {



 struct percpu_counter events;




 int shift;
 unsigned long period;
 raw_spinlock_t lock;
};

int prop_local_init_percpu(struct prop_local_percpu *pl, gfp_t gfp);
void prop_local_destroy_percpu(struct prop_local_percpu *pl);
void __prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl);
void prop_fraction_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl,
  long *numerator, long *denominator);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
void prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); do { } while (0); } while (0);
 __prop_inc_percpu(pd, pl);
 do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);
}
# 94 "include/linux/proportions.h"
void __prop_inc_percpu_max(struct prop_descriptor *pd,
      struct prop_local_percpu *pl, long frac);






struct prop_local_single {



 unsigned long events;





 unsigned long period;
 int shift;
 raw_spinlock_t lock;
};





int prop_local_init_single(struct prop_local_single *pl);
void prop_local_destroy_single(struct prop_local_single *pl);
void __prop_inc_single(struct prop_descriptor *pd, struct prop_local_single *pl);
void prop_fraction_single(struct prop_descriptor *pd, struct prop_local_single *pl,
  long *numerator, long *denominator);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
void prop_inc_single(struct prop_descriptor *pd, struct prop_local_single *pl)
{
 unsigned long flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); do { } while (0); } while (0);
 __prop_inc_single(pd, pl);
 do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);
}
# 44 "include/linux/sched.h" 2
# 1 "include/linux/seccomp.h" 1



# 1 "include/uapi/linux/seccomp.h" 1
# 47 "include/uapi/linux/seccomp.h"
struct seccomp_data {
 int nr;
 __u32 arch;
 __u64 instruction_pointer;
 __u64 args[6];
};
# 5 "include/linux/seccomp.h" 2






# 1 "./arch/sparc/include/asm/seccomp.h" 1


# 1 "./include/uapi/linux/unistd.h" 1






# 1 "./arch/sparc/include/asm/unistd.h" 1
# 17 "./arch/sparc/include/asm/unistd.h"
# 1 "./arch/sparc/include/uapi/asm/unistd.h" 1
# 18 "./arch/sparc/include/asm/unistd.h" 2
# 8 "./include/uapi/linux/unistd.h" 2
# 4 "./arch/sparc/include/asm/seccomp.h" 2
# 12 "include/linux/seccomp.h" 2

struct seccomp_filter;
# 25 "include/linux/seccomp.h"
struct seccomp {
 int mode;
 struct seccomp_filter *filter;
};
# 45 "include/linux/seccomp.h"
extern void secure_computing_strict(int this_syscall);


extern long prctl_get_seccomp(void);
extern long prctl_set_seccomp(unsigned long, char *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int seccomp_mode(struct seccomp *s)
{
 return s->mode;
}
# 89 "include/linux/seccomp.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_seccomp_filter(struct task_struct *tsk)
{
 return;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_seccomp_filter(struct task_struct *tsk)
{
 return;
}
# 45 "include/linux/sched.h" 2

# 1 "include/linux/rculist.h" 1
# 30 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void INIT_LIST_HEAD_RCU(struct list_head *list)
{
 (*({ __attribute__((unused)) typeof(list->next) __var = ( typeof(list->next)) 0; (volatile typeof(list->next) *)&(list->next); })) = list;
 (*({ __attribute__((unused)) typeof(list->prev) __var = ( typeof(list->prev)) 0; (volatile typeof(list->prev) *)&(list->prev); })) = list;
}
# 49 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_add_rcu(struct list_head *new,
  struct list_head *prev, struct list_head *next)
{
 new->next = next;
 new->prev = prev;
 do { do { bool __cond = !((sizeof(*&(*((struct list_head **)(&(prev)->next)))) == sizeof(char) || sizeof(*&(*((struct list_head **)(&(prev)->next)))) == sizeof(short) || sizeof(*&(*((struct list_head **)(&(prev)->next)))) == sizeof(int) || sizeof(*&(*((struct list_head **)(&(prev)->next)))) == sizeof(long))); extern void __compiletime_assert_54(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_54(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&(*((struct list_head **)(&(prev)->next)))) __var = ( typeof(*&(*((struct list_head **)(&(prev)->next))))) 0; (volatile typeof(*&(*((struct list_head **)(&(prev)->next)))) *)&(*&(*((struct list_head **)(&(prev)->next)))); })) = ((typeof(*(new)) *)(new)); } while (0);
 next->prev = new;
}
# 78 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_add_rcu(struct list_head *new, struct list_head *head)
{
 __list_add_rcu(new, head, head->next);
}
# 99 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_add_tail_rcu(struct list_head *new,
     struct list_head *head)
{
 __list_add_rcu(new, head->prev, head);
}
# 129 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_del_rcu(struct list_head *entry)
{
 __list_del_entry(entry);
 entry->prev = ((void *) 0x00200200 + 0);
}
# 155 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_del_init_rcu(struct hlist_node *n)
{
 if (!hlist_unhashed(n)) {
  __hlist_del(n);
  n->pprev = ((void *)0);
 }
}
# 171 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_replace_rcu(struct list_head *old,
    struct list_head *new)
{
 new->next = old->next;
 new->prev = old->prev;
 do { do { bool __cond = !((sizeof(*&(*((struct list_head **)(&(new->prev)->next)))) == sizeof(char) || sizeof(*&(*((struct list_head **)(&(new->prev)->next)))) == sizeof(short) || sizeof(*&(*((struct list_head **)(&(new->prev)->next)))) == sizeof(int) || sizeof(*&(*((struct list_head **)(&(new->prev)->next)))) == sizeof(long))); extern void __compiletime_assert_176(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_176(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&(*((struct list_head **)(&(new->prev)->next)))) __var = ( typeof(*&(*((struct list_head **)(&(new->prev)->next))))) 0; (volatile typeof(*&(*((struct list_head **)(&(new->prev)->next)))) *)&(*&(*((struct list_head **)(&(new->prev)->next)))); })) = ((typeof(*(new)) *)(new)); } while (0);
 new->next->prev = new;
 old->prev = ((void *) 0x00200200 + 0);
}
# 198 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice_init_rcu(struct list_head *list,
     struct list_head *head,
     void (*sync)(void))
{
 struct list_head *first = list->next;
 struct list_head *last = list->prev;
 struct list_head *at = head->next;

 if (list_empty(list))
  return;







 INIT_LIST_HEAD_RCU(list);
# 224 "include/linux/rculist.h"
 sync();
# 234 "include/linux/rculist.h"
 last->next = at;
 do { do { bool __cond = !((sizeof(*&(*((struct list_head **)(&(head)->next)))) == sizeof(char) || sizeof(*&(*((struct list_head **)(&(head)->next)))) == sizeof(short) || sizeof(*&(*((struct list_head **)(&(head)->next)))) == sizeof(int) || sizeof(*&(*((struct list_head **)(&(head)->next)))) == sizeof(long))); extern void __compiletime_assert_235(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_235(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&(*((struct list_head **)(&(head)->next)))) __var = ( typeof(*&(*((struct list_head **)(&(head)->next))))) 0; (volatile typeof(*&(*((struct list_head **)(&(head)->next)))) *)&(*&(*((struct list_head **)(&(head)->next)))); })) = ((typeof(*(first)) *)(first)); } while (0);
 first->prev = head;
 at->prev = last;
}
# 343 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_del_rcu(struct hlist_node *n)
{
 __hlist_del(n);
 n->pprev = ((void *) 0x00200200 + 0);
}
# 356 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_replace_rcu(struct hlist_node *old,
     struct hlist_node *new)
{
 struct hlist_node *next = old->next;

 new->next = next;
 new->pprev = old->pprev;
 do { do { bool __cond = !((sizeof(*&*(struct hlist_node **)new->pprev) == sizeof(char) || sizeof(*&*(struct hlist_node **)new->pprev) == sizeof(short) || sizeof(*&*(struct hlist_node **)new->pprev) == sizeof(int) || sizeof(*&*(struct hlist_node **)new->pprev) == sizeof(long))); extern void __compiletime_assert_363(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_363(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&*(struct hlist_node **)new->pprev) __var = ( typeof(*&*(struct hlist_node **)new->pprev)) 0; (volatile typeof(*&*(struct hlist_node **)new->pprev) *)&(*&*(struct hlist_node **)new->pprev); })) = ((typeof(*(new)) *)(new)); } while (0);
 if (next)
  new->next->pprev = &new->next;
 old->pprev = ((void *) 0x00200200 + 0);
}
# 395 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_head_rcu(struct hlist_node *n,
     struct hlist_head *h)
{
 struct hlist_node *first = h->first;

 n->next = first;
 n->pprev = &h->first;
 do { do { bool __cond = !((sizeof(*&(*((struct hlist_node **)(&(h)->first)))) == sizeof(char) || sizeof(*&(*((struct hlist_node **)(&(h)->first)))) == sizeof(short) || sizeof(*&(*((struct hlist_node **)(&(h)->first)))) == sizeof(int) || sizeof(*&(*((struct hlist_node **)(&(h)->first)))) == sizeof(long))); extern void __compiletime_assert_402(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_402(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&(*((struct hlist_node **)(&(h)->first)))) __var = ( typeof(*&(*((struct hlist_node **)(&(h)->first))))) 0; (volatile typeof(*&(*((struct hlist_node **)(&(h)->first)))) *)&(*&(*((struct hlist_node **)(&(h)->first)))); })) = ((typeof(*(n)) *)(n)); } while (0);
 if (first)
  first->pprev = &n->next;
}
# 425 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_before_rcu(struct hlist_node *n,
     struct hlist_node *next)
{
 n->pprev = next->pprev;
 n->next = next;
 do { do { bool __cond = !((sizeof(*&(*((struct hlist_node **)((n)->pprev)))) == sizeof(char) || sizeof(*&(*((struct hlist_node **)((n)->pprev)))) == sizeof(short) || sizeof(*&(*((struct hlist_node **)((n)->pprev)))) == sizeof(int) || sizeof(*&(*((struct hlist_node **)((n)->pprev)))) == sizeof(long))); extern void __compiletime_assert_430(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_430(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&(*((struct hlist_node **)((n)->pprev)))) __var = ( typeof(*&(*((struct hlist_node **)((n)->pprev))))) 0; (volatile typeof(*&(*((struct hlist_node **)((n)->pprev)))) *)&(*&(*((struct hlist_node **)((n)->pprev)))); })) = ((typeof(*(n)) *)(n)); } while (0);
 next->pprev = &n->next;
}
# 452 "include/linux/rculist.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_behind_rcu(struct hlist_node *n,
     struct hlist_node *prev)
{
 n->next = prev->next;
 n->pprev = &prev->next;
 do { do { bool __cond = !((sizeof(*&(*((struct hlist_node **)(&(prev)->next)))) == sizeof(char) || sizeof(*&(*((struct hlist_node **)(&(prev)->next)))) == sizeof(short) || sizeof(*&(*((struct hlist_node **)(&(prev)->next)))) == sizeof(int) || sizeof(*&(*((struct hlist_node **)(&(prev)->next)))) == sizeof(long))); extern void __compiletime_assert_457(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_457(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&(*((struct hlist_node **)(&(prev)->next)))) __var = ( typeof(*&(*((struct hlist_node **)(&(prev)->next))))) 0; (volatile typeof(*&(*((struct hlist_node **)(&(prev)->next)))) *)&(*&(*((struct hlist_node **)(&(prev)->next)))); })) = ((typeof(*(n)) *)(n)); } while (0);
 if (n->next)
  n->next->pprev = &n->next;
}
# 47 "include/linux/sched.h" 2
# 1 "include/linux/rtmutex.h" 1
# 19 "include/linux/rtmutex.h"
extern int max_lock_depth;
# 29 "include/linux/rtmutex.h"
struct rt_mutex {
 raw_spinlock_t wait_lock;
 struct rb_root waiters;
 struct rb_node *waiters_leftmost;
 struct task_struct *owner;






};

struct rt_mutex_waiter;
struct hrtimer_sleeper;






 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rt_mutex_debug_check_no_locks_freed(const void *from,
             unsigned long len)
 {
 return 0;
 }
# 84 "include/linux/rtmutex.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rt_mutex_is_locked(struct rt_mutex *lock)
{
 return lock->owner != ((void *)0);
}

extern void __rt_mutex_init(struct rt_mutex *lock, const char *name);
extern void rt_mutex_destroy(struct rt_mutex *lock);

extern void rt_mutex_lock(struct rt_mutex *lock);
extern int rt_mutex_lock_interruptible(struct rt_mutex *lock);
extern int rt_mutex_timed_lock(struct rt_mutex *lock,
          struct hrtimer_sleeper *timeout);

extern int rt_mutex_trylock(struct rt_mutex *lock);

extern void rt_mutex_unlock(struct rt_mutex *lock);
# 48 "include/linux/sched.h" 2



# 1 "include/linux/resource.h" 1



# 1 "include/uapi/linux/resource.h" 1
# 23 "include/uapi/linux/resource.h"
struct rusage {
 struct timeval ru_utime;
 struct timeval ru_stime;
 __kernel_long_t ru_maxrss;
 __kernel_long_t ru_ixrss;
 __kernel_long_t ru_idrss;
 __kernel_long_t ru_isrss;
 __kernel_long_t ru_minflt;
 __kernel_long_t ru_majflt;
 __kernel_long_t ru_nswap;
 __kernel_long_t ru_inblock;
 __kernel_long_t ru_oublock;
 __kernel_long_t ru_msgsnd;
 __kernel_long_t ru_msgrcv;
 __kernel_long_t ru_nsignals;
 __kernel_long_t ru_nvcsw;
 __kernel_long_t ru_nivcsw;
};

struct rlimit {
 __kernel_ulong_t rlim_cur;
 __kernel_ulong_t rlim_max;
};



struct rlimit64 {
 __u64 rlim_cur;
 __u64 rlim_max;
};
# 77 "include/uapi/linux/resource.h"
# 1 "./arch/sparc/include/uapi/asm/resource.h" 1
# 28 "./arch/sparc/include/uapi/asm/resource.h"
# 1 "include/asm-generic/resource.h" 1



# 1 "include/uapi/asm-generic/resource.h" 1
# 5 "include/asm-generic/resource.h" 2
# 29 "./arch/sparc/include/uapi/asm/resource.h" 2
# 78 "include/uapi/linux/resource.h" 2
# 5 "include/linux/resource.h" 2


struct task_struct;

int getrusage(struct task_struct *p, int who, struct rusage *ru);
int do_prlimit(struct task_struct *tsk, unsigned int resource,
  struct rlimit *new_rlim, struct rlimit *old_rlim);
# 52 "include/linux/sched.h" 2

# 1 "include/linux/hrtimer.h" 1
# 25 "include/linux/hrtimer.h"
# 1 "include/linux/timerqueue.h" 1







struct timerqueue_node {
 struct rb_node node;
 ktime_t expires;
};

struct timerqueue_head {
 struct rb_root head;
 struct timerqueue_node *next;
};


extern void timerqueue_add(struct timerqueue_head *head,
    struct timerqueue_node *node);
extern void timerqueue_del(struct timerqueue_head *head,
    struct timerqueue_node *node);
extern struct timerqueue_node *timerqueue_iterate_next(
      struct timerqueue_node *node);
# 34 "include/linux/timerqueue.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head)
{
 return head->next;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timerqueue_init(struct timerqueue_node *node)
{
 ((&node->node)->__rb_parent_color = (unsigned long)(&node->node));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timerqueue_init_head(struct timerqueue_head *head)
{
 head->head = (struct rb_root) { ((void *)0), };
 head->next = ((void *)0);
}
# 26 "include/linux/hrtimer.h" 2

struct hrtimer_clock_base;
struct hrtimer_cpu_base;




enum hrtimer_mode {
 HRTIMER_MODE_ABS = 0x0,
 HRTIMER_MODE_REL = 0x1,
 HRTIMER_MODE_PINNED = 0x02,
 HRTIMER_MODE_ABS_PINNED = 0x02,
 HRTIMER_MODE_REL_PINNED = 0x03,
};




enum hrtimer_restart {
 HRTIMER_NORESTART,
 HRTIMER_RESTART,
};
# 108 "include/linux/hrtimer.h"
struct hrtimer {
 struct timerqueue_node node;
 ktime_t _softexpires;
 enum hrtimer_restart (*function)(struct hrtimer *);
 struct hrtimer_clock_base *base;
 unsigned long state;





};
# 128 "include/linux/hrtimer.h"
struct hrtimer_sleeper {
 struct hrtimer timer;
 struct task_struct *task;
};
# 145 "include/linux/hrtimer.h"
struct hrtimer_clock_base {
 struct hrtimer_cpu_base *cpu_base;
 int index;
 clockid_t clockid;
 struct timerqueue_head active;
 ktime_t resolution;
 ktime_t (*get_time)(void);
 ktime_t softirq_time;
 ktime_t offset;
};

enum hrtimer_base_type {
 HRTIMER_BASE_MONOTONIC,
 HRTIMER_BASE_REALTIME,
 HRTIMER_BASE_BOOTTIME,
 HRTIMER_BASE_TAI,
 HRTIMER_MAX_CLOCK_BASES,
};
# 182 "include/linux/hrtimer.h"
struct hrtimer_cpu_base {
 raw_spinlock_t lock;
 unsigned int cpu;
 unsigned int active_bases;
 unsigned int clock_was_set;

 ktime_t expires_next;
 int in_hrtirq;
 int hres_active;
 int hang_detected;
 unsigned long nr_events;
 unsigned long nr_retries;
 unsigned long nr_hangs;
 ktime_t max_hang_time;

 struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES];
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_set_expires(struct hrtimer *timer, ktime_t time)
{
 timer->node.expires = time;
 timer->_softexpires = time;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta)
{
 timer->_softexpires = time;
 timer->node.expires = ktime_add_safe(time, delta);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, unsigned long delta)
{
 timer->_softexpires = time;
 timer->node.expires = ktime_add_safe(time, ns_to_ktime(delta));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64)
{
 timer->node.expires.tv64 = tv64;
 timer->_softexpires.tv64 = tv64;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_add_expires(struct hrtimer *timer, ktime_t time)
{
 timer->node.expires = ktime_add_safe(timer->node.expires, time);
 timer->_softexpires = ktime_add_safe(timer->_softexpires, time);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_add_expires_ns(struct hrtimer *timer, u64 ns)
{
 timer->node.expires = ({ (ktime_t){ .tv64 = (timer->node.expires).tv64 + (ns) }; });
 timer->_softexpires = ({ (ktime_t){ .tv64 = (timer->_softexpires).tv64 + (ns) }; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t hrtimer_get_expires(const struct hrtimer *timer)
{
 return timer->node.expires;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t hrtimer_get_softexpires(const struct hrtimer *timer)
{
 return timer->_softexpires;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 hrtimer_get_expires_tv64(const struct hrtimer *timer)
{
 return timer->node.expires.tv64;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer)
{
 return timer->_softexpires.tv64;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 hrtimer_get_expires_ns(const struct hrtimer *timer)
{
 return ((timer->node.expires).tv64);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t hrtimer_expires_remaining(const struct hrtimer *timer)
{
 return ({ (ktime_t){ .tv64 = (timer->node.expires).tv64 - (timer->base->get_time()).tv64 }; });
}


struct clock_event_device;

extern void hrtimer_interrupt(struct clock_event_device *dev);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t hrtimer_cb_get_time(struct hrtimer *timer)
{
 return timer->base->get_time();
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_is_hres_active(struct hrtimer *timer)
{
 return timer->base->cpu_base->hres_active;
}

extern void hrtimer_peek_ahead_timers(void);
# 296 "include/linux/hrtimer.h"
extern void clock_was_set_delayed(void);
# 323 "include/linux/hrtimer.h"
extern void clock_was_set(void);

extern void timerfd_clock_was_set(void);



extern void hrtimers_resume(void);

extern __attribute__((section(".data..percpu" ""))) __typeof__(struct tick_device) tick_cpu_device;





extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock,
    enum hrtimer_mode mode);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_init_on_stack(struct hrtimer *timer,
      clockid_t which_clock,
      enum hrtimer_mode mode)
{
 hrtimer_init(timer, which_clock, mode);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_hrtimer_on_stack(struct hrtimer *timer) { }



extern int hrtimer_start(struct hrtimer *timer, ktime_t tim,
    const enum hrtimer_mode mode);
extern int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
   unsigned long range_ns, const enum hrtimer_mode mode);
extern int
__hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
    unsigned long delta_ns,
    const enum hrtimer_mode mode, int wakeup);

extern int hrtimer_cancel(struct hrtimer *timer);
extern int hrtimer_try_to_cancel(struct hrtimer *timer);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_start_expires(struct hrtimer *timer,
      enum hrtimer_mode mode)
{
 unsigned long delta;
 ktime_t soft, hard;
 soft = hrtimer_get_softexpires(timer);
 hard = hrtimer_get_expires(timer);
 delta = ((({ (ktime_t){ .tv64 = (hard).tv64 - (soft).tv64 }; })).tv64);
 return hrtimer_start_range_ns(timer, soft, delta, mode);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_restart(struct hrtimer *timer)
{
 return hrtimer_start_expires(timer, HRTIMER_MODE_ABS);
}


extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer);
extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp);

extern ktime_t hrtimer_get_next_event(void);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_active(const struct hrtimer *timer)
{
 return timer->state != 0x00;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_is_queued(struct hrtimer *timer)
{
 return timer->state & 0x01;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_callback_running(struct hrtimer *timer)
{
 return timer->state & 0x02;
}


extern u64
hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 hrtimer_forward_now(struct hrtimer *timer,
          ktime_t interval)
{
 return hrtimer_forward(timer, timer->base->get_time(), interval);
}


extern long hrtimer_nanosleep(struct timespec *rqtp,
         struct timespec *rmtp,
         const enum hrtimer_mode mode,
         const clockid_t clockid);
extern long hrtimer_nanosleep_restart(struct restart_block *restart_block);

extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
     struct task_struct *tsk);

extern int schedule_hrtimeout_range(ktime_t *expires, unsigned long delta,
      const enum hrtimer_mode mode);
extern int schedule_hrtimeout_range_clock(ktime_t *expires,
  unsigned long delta, const enum hrtimer_mode mode, int clock);
extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode);


extern void hrtimer_run_queues(void);
extern void hrtimer_run_pending(void);


extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) hrtimers_init(void);


extern void sysrq_timer_list_show(void);
# 54 "include/linux/sched.h" 2
# 1 "include/linux/task_io_accounting.h" 1
# 11 "include/linux/task_io_accounting.h"
struct task_io_accounting {
# 45 "include/linux/task_io_accounting.h"
};
# 55 "include/linux/sched.h" 2
# 1 "include/linux/latencytop.h" 1
# 13 "include/linux/latencytop.h"
struct task_struct;
# 42 "include/linux/latencytop.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
account_scheduler_latency(struct task_struct *task, int usecs, int inter)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_all_latency_tracing(struct task_struct *p)
{
}
# 56 "include/linux/sched.h" 2
# 1 "include/linux/cred.h" 1
# 17 "include/linux/cred.h"
# 1 "include/linux/key.h" 1
# 22 "include/linux/key.h"
# 1 "include/linux/sysctl.h" 1
# 28 "include/linux/sysctl.h"
# 1 "include/uapi/linux/sysctl.h" 1
# 29 "include/uapi/linux/sysctl.h"
struct completion;






struct __sysctl_args {
 int *name;
 int nlen;
 void *oldval;
 size_t *oldlenp;
 void *newval;
 size_t newlen;
 unsigned long __unused[4];
};





enum
{
 CTL_KERN=1,
 CTL_VM=2,
 CTL_NET=3,
 CTL_PROC=4,
 CTL_FS=5,
 CTL_DEBUG=6,
 CTL_DEV=7,
 CTL_BUS=8,
 CTL_ABI=9,
 CTL_CPU=10,
 CTL_ARLAN=254,
 CTL_S390DBF=5677,
 CTL_SUNRPC=7249,
 CTL_PM=9899,
 CTL_FRV=9898,
};


enum
{
 CTL_BUS_ISA=1
};


enum
{
 INOTIFY_MAX_USER_INSTANCES=1,
 INOTIFY_MAX_USER_WATCHES=2,
 INOTIFY_MAX_QUEUED_EVENTS=3
};


enum
{
 KERN_OSTYPE=1,
 KERN_OSRELEASE=2,
 KERN_OSREV=3,
 KERN_VERSION=4,
 KERN_SECUREMASK=5,
 KERN_PROF=6,
 KERN_NODENAME=7,
 KERN_DOMAINNAME=8,

 KERN_PANIC=15,
 KERN_REALROOTDEV=16,

 KERN_SPARC_REBOOT=21,
 KERN_CTLALTDEL=22,
 KERN_PRINTK=23,
 KERN_NAMETRANS=24,
 KERN_PPC_HTABRECLAIM=25,
 KERN_PPC_ZEROPAGED=26,
 KERN_PPC_POWERSAVE_NAP=27,
 KERN_MODPROBE=28,
 KERN_SG_BIG_BUFF=29,
 KERN_ACCT=30,
 KERN_PPC_L2CR=31,

 KERN_RTSIGNR=32,
 KERN_RTSIGMAX=33,

 KERN_SHMMAX=34,
 KERN_MSGMAX=35,
 KERN_MSGMNB=36,
 KERN_MSGPOOL=37,
 KERN_SYSRQ=38,
 KERN_MAX_THREADS=39,
  KERN_RANDOM=40,
  KERN_SHMALL=41,
  KERN_MSGMNI=42,
  KERN_SEM=43,
  KERN_SPARC_STOP_A=44,
  KERN_SHMMNI=45,
 KERN_OVERFLOWUID=46,
 KERN_OVERFLOWGID=47,
 KERN_SHMPATH=48,
 KERN_HOTPLUG=49,
 KERN_IEEE_EMULATION_WARNINGS=50,
 KERN_S390_USER_DEBUG_LOGGING=51,
 KERN_CORE_USES_PID=52,
 KERN_TAINTED=53,
 KERN_CADPID=54,
 KERN_PIDMAX=55,
   KERN_CORE_PATTERN=56,
 KERN_PANIC_ON_OOPS=57,
 KERN_HPPA_PWRSW=58,
 KERN_HPPA_UNALIGNED=59,
 KERN_PRINTK_RATELIMIT=60,
 KERN_PRINTK_RATELIMIT_BURST=61,
 KERN_PTY=62,
 KERN_NGROUPS_MAX=63,
 KERN_SPARC_SCONS_PWROFF=64,
 KERN_HZ_TIMER=65,
 KERN_UNKNOWN_NMI_PANIC=66,
 KERN_BOOTLOADER_TYPE=67,
 KERN_RANDOMIZE=68,
 KERN_SETUID_DUMPABLE=69,
 KERN_SPIN_RETRY=70,
 KERN_ACPI_VIDEO_FLAGS=71,
 KERN_IA64_UNALIGNED=72,
 KERN_COMPAT_LOG=73,
 KERN_MAX_LOCK_DEPTH=74,
 KERN_NMI_WATCHDOG=75,
 KERN_PANIC_ON_NMI=76,
 KERN_PANIC_ON_WARN=77,
};




enum
{
 VM_UNUSED1=1,
 VM_UNUSED2=2,
 VM_UNUSED3=3,
 VM_UNUSED4=4,
 VM_OVERCOMMIT_MEMORY=5,
 VM_UNUSED5=6,
 VM_UNUSED7=7,
 VM_UNUSED8=8,
 VM_UNUSED9=9,
 VM_PAGE_CLUSTER=10,
 VM_DIRTY_BACKGROUND=11,
 VM_DIRTY_RATIO=12,
 VM_DIRTY_WB_CS=13,
 VM_DIRTY_EXPIRE_CS=14,
 VM_NR_PDFLUSH_THREADS=15,
 VM_OVERCOMMIT_RATIO=16,
 VM_PAGEBUF=17,
 VM_HUGETLB_PAGES=18,
 VM_SWAPPINESS=19,
 VM_LOWMEM_RESERVE_RATIO=20,
 VM_MIN_FREE_KBYTES=21,
 VM_MAX_MAP_COUNT=22,
 VM_LAPTOP_MODE=23,
 VM_BLOCK_DUMP=24,
 VM_HUGETLB_GROUP=25,
 VM_VFS_CACHE_PRESSURE=26,
 VM_LEGACY_VA_LAYOUT=27,
 VM_SWAP_TOKEN_TIMEOUT=28,
 VM_DROP_PAGECACHE=29,
 VM_PERCPU_PAGELIST_FRACTION=30,
 VM_ZONE_RECLAIM_MODE=31,
 VM_MIN_UNMAPPED=32,
 VM_PANIC_ON_OOM=33,
 VM_VDSO_ENABLED=34,
 VM_MIN_SLAB=35,
};



enum
{
 NET_CORE=1,
 NET_ETHER=2,
 NET_802=3,
 NET_UNIX=4,
 NET_IPV4=5,
 NET_IPX=6,
 NET_ATALK=7,
 NET_NETROM=8,
 NET_AX25=9,
 NET_BRIDGE=10,
 NET_ROSE=11,
 NET_IPV6=12,
 NET_X25=13,
 NET_TR=14,
 NET_DECNET=15,
 NET_ECONET=16,
 NET_SCTP=17,
 NET_LLC=18,
 NET_NETFILTER=19,
 NET_DCCP=20,
 NET_IRDA=412,
};


enum
{
 RANDOM_POOLSIZE=1,
 RANDOM_ENTROPY_COUNT=2,
 RANDOM_READ_THRESH=3,
 RANDOM_WRITE_THRESH=4,
 RANDOM_BOOT_ID=5,
 RANDOM_UUID=6
};


enum
{
 PTY_MAX=1,
 PTY_NR=2
};


enum
{
 BUS_ISA_MEM_BASE=1,
 BUS_ISA_PORT_BASE=2,
 BUS_ISA_PORT_SHIFT=3
};


enum
{
 NET_CORE_WMEM_MAX=1,
 NET_CORE_RMEM_MAX=2,
 NET_CORE_WMEM_DEFAULT=3,
 NET_CORE_RMEM_DEFAULT=4,

 NET_CORE_MAX_BACKLOG=6,
 NET_CORE_FASTROUTE=7,
 NET_CORE_MSG_COST=8,
 NET_CORE_MSG_BURST=9,
 NET_CORE_OPTMEM_MAX=10,
 NET_CORE_HOT_LIST_LENGTH=11,
 NET_CORE_DIVERT_VERSION=12,
 NET_CORE_NO_CONG_THRESH=13,
 NET_CORE_NO_CONG=14,
 NET_CORE_LO_CONG=15,
 NET_CORE_MOD_CONG=16,
 NET_CORE_DEV_WEIGHT=17,
 NET_CORE_SOMAXCONN=18,
 NET_CORE_BUDGET=19,
 NET_CORE_AEVENT_ETIME=20,
 NET_CORE_AEVENT_RSEQTH=21,
 NET_CORE_WARNINGS=22,
};







enum
{
 NET_UNIX_DESTROY_DELAY=1,
 NET_UNIX_DELETE_DELAY=2,
 NET_UNIX_MAX_DGRAM_QLEN=3,
};


enum
{
 NET_NF_CONNTRACK_MAX=1,
 NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
 NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
 NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
 NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
 NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
 NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
 NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
 NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
 NET_NF_CONNTRACK_UDP_TIMEOUT=10,
 NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
 NET_NF_CONNTRACK_ICMP_TIMEOUT=12,
 NET_NF_CONNTRACK_GENERIC_TIMEOUT=13,
 NET_NF_CONNTRACK_BUCKETS=14,
 NET_NF_CONNTRACK_LOG_INVALID=15,
 NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
 NET_NF_CONNTRACK_TCP_LOOSE=17,
 NET_NF_CONNTRACK_TCP_BE_LIBERAL=18,
 NET_NF_CONNTRACK_TCP_MAX_RETRANS=19,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
 NET_NF_CONNTRACK_COUNT=27,
 NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28,
 NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
 NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
 NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
 NET_NF_CONNTRACK_CHECKSUM=32,
};


enum
{

 NET_IPV4_FORWARD=8,
 NET_IPV4_DYNADDR=9,

 NET_IPV4_CONF=16,
 NET_IPV4_NEIGH=17,
 NET_IPV4_ROUTE=18,
 NET_IPV4_FIB_HASH=19,
 NET_IPV4_NETFILTER=20,

 NET_IPV4_TCP_TIMESTAMPS=33,
 NET_IPV4_TCP_WINDOW_SCALING=34,
 NET_IPV4_TCP_SACK=35,
 NET_IPV4_TCP_RETRANS_COLLAPSE=36,
 NET_IPV4_DEFAULT_TTL=37,
 NET_IPV4_AUTOCONFIG=38,
 NET_IPV4_NO_PMTU_DISC=39,
 NET_IPV4_TCP_SYN_RETRIES=40,
 NET_IPV4_IPFRAG_HIGH_THRESH=41,
 NET_IPV4_IPFRAG_LOW_THRESH=42,
 NET_IPV4_IPFRAG_TIME=43,
 NET_IPV4_TCP_MAX_KA_PROBES=44,
 NET_IPV4_TCP_KEEPALIVE_TIME=45,
 NET_IPV4_TCP_KEEPALIVE_PROBES=46,
 NET_IPV4_TCP_RETRIES1=47,
 NET_IPV4_TCP_RETRIES2=48,
 NET_IPV4_TCP_FIN_TIMEOUT=49,
 NET_IPV4_IP_MASQ_DEBUG=50,
 NET_TCP_SYNCOOKIES=51,
 NET_TCP_STDURG=52,
 NET_TCP_RFC1337=53,
 NET_TCP_SYN_TAILDROP=54,
 NET_TCP_MAX_SYN_BACKLOG=55,
 NET_IPV4_LOCAL_PORT_RANGE=56,
 NET_IPV4_ICMP_ECHO_IGNORE_ALL=57,
 NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS=58,
 NET_IPV4_ICMP_SOURCEQUENCH_RATE=59,
 NET_IPV4_ICMP_DESTUNREACH_RATE=60,
 NET_IPV4_ICMP_TIMEEXCEED_RATE=61,
 NET_IPV4_ICMP_PARAMPROB_RATE=62,
 NET_IPV4_ICMP_ECHOREPLY_RATE=63,
 NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64,
 NET_IPV4_IGMP_MAX_MEMBERSHIPS=65,
 NET_TCP_TW_RECYCLE=66,
 NET_IPV4_ALWAYS_DEFRAG=67,
 NET_IPV4_TCP_KEEPALIVE_INTVL=68,
 NET_IPV4_INET_PEER_THRESHOLD=69,
 NET_IPV4_INET_PEER_MINTTL=70,
 NET_IPV4_INET_PEER_MAXTTL=71,
 NET_IPV4_INET_PEER_GC_MINTIME=72,
 NET_IPV4_INET_PEER_GC_MAXTIME=73,
 NET_TCP_ORPHAN_RETRIES=74,
 NET_TCP_ABORT_ON_OVERFLOW=75,
 NET_TCP_SYNACK_RETRIES=76,
 NET_TCP_MAX_ORPHANS=77,
 NET_TCP_MAX_TW_BUCKETS=78,
 NET_TCP_FACK=79,
 NET_TCP_REORDERING=80,
 NET_TCP_ECN=81,
 NET_TCP_DSACK=82,
 NET_TCP_MEM=83,
 NET_TCP_WMEM=84,
 NET_TCP_RMEM=85,
 NET_TCP_APP_WIN=86,
 NET_TCP_ADV_WIN_SCALE=87,
 NET_IPV4_NONLOCAL_BIND=88,
 NET_IPV4_ICMP_RATELIMIT=89,
 NET_IPV4_ICMP_RATEMASK=90,
 NET_TCP_TW_REUSE=91,
 NET_TCP_FRTO=92,
 NET_TCP_LOW_LATENCY=93,
 NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
 NET_IPV4_IGMP_MAX_MSF=96,
 NET_TCP_NO_METRICS_SAVE=97,
 NET_TCP_DEFAULT_WIN_SCALE=105,
 NET_TCP_MODERATE_RCVBUF=106,
 NET_TCP_TSO_WIN_DIVISOR=107,
 NET_TCP_BIC_BETA=108,
 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
 NET_TCP_CONG_CONTROL=110,
 NET_TCP_ABC=111,
 NET_IPV4_IPFRAG_MAX_DIST=112,
  NET_TCP_MTU_PROBING=113,
 NET_TCP_BASE_MSS=114,
 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
 NET_TCP_DMA_COPYBREAK=116,
 NET_TCP_SLOW_START_AFTER_IDLE=117,
 NET_CIPSOV4_CACHE_ENABLE=118,
 NET_CIPSOV4_CACHE_BUCKET_SIZE=119,
 NET_CIPSOV4_RBM_OPTFMT=120,
 NET_CIPSOV4_RBM_STRICTVALID=121,
 NET_TCP_AVAIL_CONG_CONTROL=122,
 NET_TCP_ALLOWED_CONG_CONTROL=123,
 NET_TCP_MAX_SSTHRESH=124,
 NET_TCP_FRTO_RESPONSE=125,
};

enum {
 NET_IPV4_ROUTE_FLUSH=1,
 NET_IPV4_ROUTE_MIN_DELAY=2,
 NET_IPV4_ROUTE_MAX_DELAY=3,
 NET_IPV4_ROUTE_GC_THRESH=4,
 NET_IPV4_ROUTE_MAX_SIZE=5,
 NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
 NET_IPV4_ROUTE_GC_TIMEOUT=7,
 NET_IPV4_ROUTE_GC_INTERVAL=8,
 NET_IPV4_ROUTE_REDIRECT_LOAD=9,
 NET_IPV4_ROUTE_REDIRECT_NUMBER=10,
 NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
 NET_IPV4_ROUTE_ERROR_COST=12,
 NET_IPV4_ROUTE_ERROR_BURST=13,
 NET_IPV4_ROUTE_GC_ELASTICITY=14,
 NET_IPV4_ROUTE_MTU_EXPIRES=15,
 NET_IPV4_ROUTE_MIN_PMTU=16,
 NET_IPV4_ROUTE_MIN_ADVMSS=17,
 NET_IPV4_ROUTE_SECRET_INTERVAL=18,
 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19,
};

enum
{
 NET_PROTO_CONF_ALL=-2,
 NET_PROTO_CONF_DEFAULT=-3


};

enum
{
 NET_IPV4_CONF_FORWARDING=1,
 NET_IPV4_CONF_MC_FORWARDING=2,
 NET_IPV4_CONF_PROXY_ARP=3,
 NET_IPV4_CONF_ACCEPT_REDIRECTS=4,
 NET_IPV4_CONF_SECURE_REDIRECTS=5,
 NET_IPV4_CONF_SEND_REDIRECTS=6,
 NET_IPV4_CONF_SHARED_MEDIA=7,
 NET_IPV4_CONF_RP_FILTER=8,
 NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE=9,
 NET_IPV4_CONF_BOOTP_RELAY=10,
 NET_IPV4_CONF_LOG_MARTIANS=11,
 NET_IPV4_CONF_TAG=12,
 NET_IPV4_CONF_ARPFILTER=13,
 NET_IPV4_CONF_MEDIUM_ID=14,
 NET_IPV4_CONF_NOXFRM=15,
 NET_IPV4_CONF_NOPOLICY=16,
 NET_IPV4_CONF_FORCE_IGMP_VERSION=17,
 NET_IPV4_CONF_ARP_ANNOUNCE=18,
 NET_IPV4_CONF_ARP_IGNORE=19,
 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
 NET_IPV4_CONF_ARP_ACCEPT=21,
 NET_IPV4_CONF_ARP_NOTIFY=22,
};


enum
{
 NET_IPV4_NF_CONNTRACK_MAX=1,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
 NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10,
 NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
 NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12,
 NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13,
 NET_IPV4_NF_CONNTRACK_BUCKETS=14,
 NET_IPV4_NF_CONNTRACK_LOG_INVALID=15,
 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
 NET_IPV4_NF_CONNTRACK_TCP_LOOSE=17,
 NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL=18,
 NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS=19,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
  NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
 NET_IPV4_NF_CONNTRACK_COUNT=27,
 NET_IPV4_NF_CONNTRACK_CHECKSUM=28,
};


enum {
 NET_IPV6_CONF=16,
 NET_IPV6_NEIGH=17,
 NET_IPV6_ROUTE=18,
 NET_IPV6_ICMP=19,
 NET_IPV6_BINDV6ONLY=20,
 NET_IPV6_IP6FRAG_HIGH_THRESH=21,
 NET_IPV6_IP6FRAG_LOW_THRESH=22,
 NET_IPV6_IP6FRAG_TIME=23,
 NET_IPV6_IP6FRAG_SECRET_INTERVAL=24,
 NET_IPV6_MLD_MAX_MSF=25,
};

enum {
 NET_IPV6_ROUTE_FLUSH=1,
 NET_IPV6_ROUTE_GC_THRESH=2,
 NET_IPV6_ROUTE_MAX_SIZE=3,
 NET_IPV6_ROUTE_GC_MIN_INTERVAL=4,
 NET_IPV6_ROUTE_GC_TIMEOUT=5,
 NET_IPV6_ROUTE_GC_INTERVAL=6,
 NET_IPV6_ROUTE_GC_ELASTICITY=7,
 NET_IPV6_ROUTE_MTU_EXPIRES=8,
 NET_IPV6_ROUTE_MIN_ADVMSS=9,
 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS=10
};

enum {
 NET_IPV6_FORWARDING=1,
 NET_IPV6_HOP_LIMIT=2,
 NET_IPV6_MTU=3,
 NET_IPV6_ACCEPT_RA=4,
 NET_IPV6_ACCEPT_REDIRECTS=5,
 NET_IPV6_AUTOCONF=6,
 NET_IPV6_DAD_TRANSMITS=7,
 NET_IPV6_RTR_SOLICITS=8,
 NET_IPV6_RTR_SOLICIT_INTERVAL=9,
 NET_IPV6_RTR_SOLICIT_DELAY=10,
 NET_IPV6_USE_TEMPADDR=11,
 NET_IPV6_TEMP_VALID_LFT=12,
 NET_IPV6_TEMP_PREFERED_LFT=13,
 NET_IPV6_REGEN_MAX_RETRY=14,
 NET_IPV6_MAX_DESYNC_FACTOR=15,
 NET_IPV6_MAX_ADDRESSES=16,
 NET_IPV6_FORCE_MLD_VERSION=17,
 NET_IPV6_ACCEPT_RA_DEFRTR=18,
 NET_IPV6_ACCEPT_RA_PINFO=19,
 NET_IPV6_ACCEPT_RA_RTR_PREF=20,
 NET_IPV6_RTR_PROBE_INTERVAL=21,
 NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22,
 NET_IPV6_PROXY_NDP=23,
 NET_IPV6_ACCEPT_SOURCE_ROUTE=25,
 NET_IPV6_ACCEPT_RA_FROM_LOCAL=26,
 __NET_IPV6_MAX
};


enum {
 NET_IPV6_ICMP_RATELIMIT=1
};


enum {
 NET_NEIGH_MCAST_SOLICIT=1,
 NET_NEIGH_UCAST_SOLICIT=2,
 NET_NEIGH_APP_SOLICIT=3,
 NET_NEIGH_RETRANS_TIME=4,
 NET_NEIGH_REACHABLE_TIME=5,
 NET_NEIGH_DELAY_PROBE_TIME=6,
 NET_NEIGH_GC_STALE_TIME=7,
 NET_NEIGH_UNRES_QLEN=8,
 NET_NEIGH_PROXY_QLEN=9,
 NET_NEIGH_ANYCAST_DELAY=10,
 NET_NEIGH_PROXY_DELAY=11,
 NET_NEIGH_LOCKTIME=12,
 NET_NEIGH_GC_INTERVAL=13,
 NET_NEIGH_GC_THRESH1=14,
 NET_NEIGH_GC_THRESH2=15,
 NET_NEIGH_GC_THRESH3=16,
 NET_NEIGH_RETRANS_TIME_MS=17,
 NET_NEIGH_REACHABLE_TIME_MS=18,
};


enum {
 NET_DCCP_DEFAULT=1,
};


enum {
 NET_IPX_PPROP_BROADCASTING=1,
 NET_IPX_FORWARDING=2
};


enum {
 NET_LLC2=1,
 NET_LLC_STATION=2,
};


enum {
 NET_LLC2_TIMEOUT=1,
};


enum {
 NET_LLC_STATION_ACK_TIMEOUT=1,
};


enum {
 NET_LLC2_ACK_TIMEOUT=1,
 NET_LLC2_P_TIMEOUT=2,
 NET_LLC2_REJ_TIMEOUT=3,
 NET_LLC2_BUSY_TIMEOUT=4,
};


enum {
 NET_ATALK_AARP_EXPIRY_TIME=1,
 NET_ATALK_AARP_TICK_TIME=2,
 NET_ATALK_AARP_RETRANSMIT_LIMIT=3,
 NET_ATALK_AARP_RESOLVE_TIME=4
};



enum {
 NET_NETROM_DEFAULT_PATH_QUALITY=1,
 NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER=2,
 NET_NETROM_NETWORK_TTL_INITIALISER=3,
 NET_NETROM_TRANSPORT_TIMEOUT=4,
 NET_NETROM_TRANSPORT_MAXIMUM_TRIES=5,
 NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY=6,
 NET_NETROM_TRANSPORT_BUSY_DELAY=7,
 NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8,
 NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9,
 NET_NETROM_ROUTING_CONTROL=10,
 NET_NETROM_LINK_FAILS_COUNT=11,
 NET_NETROM_RESET=12
};


enum {
 NET_AX25_IP_DEFAULT_MODE=1,
 NET_AX25_DEFAULT_MODE=2,
 NET_AX25_BACKOFF_TYPE=3,
 NET_AX25_CONNECT_MODE=4,
 NET_AX25_STANDARD_WINDOW=5,
 NET_AX25_EXTENDED_WINDOW=6,
 NET_AX25_T1_TIMEOUT=7,
 NET_AX25_T2_TIMEOUT=8,
 NET_AX25_T3_TIMEOUT=9,
 NET_AX25_IDLE_TIMEOUT=10,
 NET_AX25_N2=11,
 NET_AX25_PACLEN=12,
 NET_AX25_PROTOCOL=13,
 NET_AX25_DAMA_SLAVE_TIMEOUT=14
};


enum {
 NET_ROSE_RESTART_REQUEST_TIMEOUT=1,
 NET_ROSE_CALL_REQUEST_TIMEOUT=2,
 NET_ROSE_RESET_REQUEST_TIMEOUT=3,
 NET_ROSE_CLEAR_REQUEST_TIMEOUT=4,
 NET_ROSE_ACK_HOLD_BACK_TIMEOUT=5,
 NET_ROSE_ROUTING_CONTROL=6,
 NET_ROSE_LINK_FAIL_TIMEOUT=7,
 NET_ROSE_MAX_VCS=8,
 NET_ROSE_WINDOW_SIZE=9,
 NET_ROSE_NO_ACTIVITY_TIMEOUT=10
};


enum {
 NET_X25_RESTART_REQUEST_TIMEOUT=1,
 NET_X25_CALL_REQUEST_TIMEOUT=2,
 NET_X25_RESET_REQUEST_TIMEOUT=3,
 NET_X25_CLEAR_REQUEST_TIMEOUT=4,
 NET_X25_ACK_HOLD_BACK_TIMEOUT=5,
 NET_X25_FORWARD=6
};


enum
{
 NET_TR_RIF_TIMEOUT=1
};


enum {
 NET_DECNET_NODE_TYPE = 1,
 NET_DECNET_NODE_ADDRESS = 2,
 NET_DECNET_NODE_NAME = 3,
 NET_DECNET_DEFAULT_DEVICE = 4,
 NET_DECNET_TIME_WAIT = 5,
 NET_DECNET_DN_COUNT = 6,
 NET_DECNET_DI_COUNT = 7,
 NET_DECNET_DR_COUNT = 8,
 NET_DECNET_DST_GC_INTERVAL = 9,
 NET_DECNET_CONF = 10,
 NET_DECNET_NO_FC_MAX_CWND = 11,
 NET_DECNET_MEM = 12,
 NET_DECNET_RMEM = 13,
 NET_DECNET_WMEM = 14,
 NET_DECNET_DEBUG_LEVEL = 255
};


enum {
 NET_DECNET_CONF_LOOPBACK = -2,
 NET_DECNET_CONF_DDCMP = -3,
 NET_DECNET_CONF_PPP = -4,
 NET_DECNET_CONF_X25 = -5,
 NET_DECNET_CONF_GRE = -6,
 NET_DECNET_CONF_ETHER = -7


};


enum {
 NET_DECNET_CONF_DEV_PRIORITY = 1,
 NET_DECNET_CONF_DEV_T1 = 2,
 NET_DECNET_CONF_DEV_T2 = 3,
 NET_DECNET_CONF_DEV_T3 = 4,
 NET_DECNET_CONF_DEV_FORWARDING = 5,
 NET_DECNET_CONF_DEV_BLKSIZE = 6,
 NET_DECNET_CONF_DEV_STATE = 7
};


enum {
 NET_SCTP_RTO_INITIAL = 1,
 NET_SCTP_RTO_MIN = 2,
 NET_SCTP_RTO_MAX = 3,
 NET_SCTP_RTO_ALPHA = 4,
 NET_SCTP_RTO_BETA = 5,
 NET_SCTP_VALID_COOKIE_LIFE = 6,
 NET_SCTP_ASSOCIATION_MAX_RETRANS = 7,
 NET_SCTP_PATH_MAX_RETRANS = 8,
 NET_SCTP_MAX_INIT_RETRANSMITS = 9,
 NET_SCTP_HB_INTERVAL = 10,
 NET_SCTP_PRESERVE_ENABLE = 11,
 NET_SCTP_MAX_BURST = 12,
 NET_SCTP_ADDIP_ENABLE = 13,
 NET_SCTP_PRSCTP_ENABLE = 14,
 NET_SCTP_SNDBUF_POLICY = 15,
 NET_SCTP_SACK_TIMEOUT = 16,
 NET_SCTP_RCVBUF_POLICY = 17,
};


enum {
 NET_BRIDGE_NF_CALL_ARPTABLES = 1,
 NET_BRIDGE_NF_CALL_IPTABLES = 2,
 NET_BRIDGE_NF_CALL_IP6TABLES = 3,
 NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
 NET_BRIDGE_NF_FILTER_PPPOE_TAGGED = 5,
};


enum {
 NET_IRDA_DISCOVERY=1,
 NET_IRDA_DEVNAME=2,
 NET_IRDA_DEBUG=3,
 NET_IRDA_FAST_POLL=4,
 NET_IRDA_DISCOVERY_SLOTS=5,
 NET_IRDA_DISCOVERY_TIMEOUT=6,
 NET_IRDA_SLOT_TIMEOUT=7,
 NET_IRDA_MAX_BAUD_RATE=8,
 NET_IRDA_MIN_TX_TURN_TIME=9,
 NET_IRDA_MAX_TX_DATA_SIZE=10,
 NET_IRDA_MAX_TX_WINDOW=11,
 NET_IRDA_MAX_NOREPLY_TIME=12,
 NET_IRDA_WARN_NOREPLY_TIME=13,
 NET_IRDA_LAP_KEEPALIVE_TIME=14,
};



enum
{
 FS_NRINODE=1,
 FS_STATINODE=2,
 FS_MAXINODE=3,
 FS_NRDQUOT=4,
 FS_MAXDQUOT=5,
 FS_NRFILE=6,
 FS_MAXFILE=7,
 FS_DENTRY=8,
 FS_NRSUPER=9,
 FS_MAXSUPER=10,
 FS_OVERFLOWUID=11,
 FS_OVERFLOWGID=12,
 FS_LEASES=13,
 FS_DIR_NOTIFY=14,
 FS_LEASE_TIME=15,
 FS_DQSTATS=16,
 FS_XFS=17,
 FS_AIO_NR=18,
 FS_AIO_MAX_NR=19,
 FS_INOTIFY=20,
 FS_OCFS2=988,
};


enum {
 FS_DQ_LOOKUPS = 1,
 FS_DQ_DROPS = 2,
 FS_DQ_READS = 3,
 FS_DQ_WRITES = 4,
 FS_DQ_CACHE_HITS = 5,
 FS_DQ_ALLOCATED = 6,
 FS_DQ_FREE = 7,
 FS_DQ_SYNCS = 8,
 FS_DQ_WARNINGS = 9,
};




enum {
 DEV_CDROM=1,
 DEV_HWMON=2,
 DEV_PARPORT=3,
 DEV_RAID=4,
 DEV_MAC_HID=5,
 DEV_SCSI=6,
 DEV_IPMI=7,
};


enum {
 DEV_CDROM_INFO=1,
 DEV_CDROM_AUTOCLOSE=2,
 DEV_CDROM_AUTOEJECT=3,
 DEV_CDROM_DEBUG=4,
 DEV_CDROM_LOCK=5,
 DEV_CDROM_CHECK_MEDIA=6
};


enum {
 DEV_PARPORT_DEFAULT=-3
};


enum {
 DEV_RAID_SPEED_LIMIT_MIN=1,
 DEV_RAID_SPEED_LIMIT_MAX=2
};


enum {
 DEV_PARPORT_DEFAULT_TIMESLICE=1,
 DEV_PARPORT_DEFAULT_SPINTIME=2
};


enum {
 DEV_PARPORT_SPINTIME=1,
 DEV_PARPORT_BASE_ADDR=2,
 DEV_PARPORT_IRQ=3,
 DEV_PARPORT_DMA=4,
 DEV_PARPORT_MODES=5,
 DEV_PARPORT_DEVICES=6,
 DEV_PARPORT_AUTOPROBE=16
};


enum {
 DEV_PARPORT_DEVICES_ACTIVE=-3,
};


enum {
 DEV_PARPORT_DEVICE_TIMESLICE=1,
};


enum {
 DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1,
 DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2,
 DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3,
 DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4,
 DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5,
 DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6
};


enum {
 DEV_SCSI_LOGGING_LEVEL=1,
};


enum {
 DEV_IPMI_POWEROFF_POWERCYCLE=1,
};


enum
{
 ABI_DEFHANDLER_COFF=1,
 ABI_DEFHANDLER_ELF=2,
 ABI_DEFHANDLER_LCALL7=3,
 ABI_DEFHANDLER_LIBCSO=4,
 ABI_TRACE=5,
 ABI_FAKE_UTSNAME=6,
};
# 29 "include/linux/sysctl.h" 2


struct ctl_table;
struct nsproxy;
struct ctl_table_root;
struct ctl_table_header;
struct ctl_dir;

typedef int proc_handler (struct ctl_table *ctl, int write,
     void *buffer, size_t *lenp, loff_t *ppos);

extern int proc_dostring(struct ctl_table *, int,
    void *, size_t *, loff_t *);
extern int proc_dointvec(struct ctl_table *, int,
    void *, size_t *, loff_t *);
extern int proc_dointvec_minmax(struct ctl_table *, int,
    void *, size_t *, loff_t *);
extern int proc_dointvec_jiffies(struct ctl_table *, int,
     void *, size_t *, loff_t *);
extern int proc_dointvec_userhz_jiffies(struct ctl_table *, int,
     void *, size_t *, loff_t *);
extern int proc_dointvec_ms_jiffies(struct ctl_table *, int,
        void *, size_t *, loff_t *);
extern int proc_doulongvec_minmax(struct ctl_table *, int,
      void *, size_t *, loff_t *);
extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int,
          void *, size_t *, loff_t *);
extern int proc_do_large_bitmap(struct ctl_table *, int,
    void *, size_t *, loff_t *);
# 87 "include/linux/sysctl.h"
struct ctl_table_poll {
 atomic_t event;
 wait_queue_head_t wait;
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *proc_sys_poll_event(struct ctl_table_poll *poll)
{
 return (void *)(unsigned long)(*({ __attribute__((unused)) typeof((&poll->event)->counter) __var = ( typeof((&poll->event)->counter)) 0; (volatile typeof((&poll->event)->counter) *)&((&poll->event)->counter); }));
}
# 105 "include/linux/sysctl.h"
struct ctl_table
{
 const char *procname;
 void *data;
 int maxlen;
 umode_t mode;
 struct ctl_table *child;
 proc_handler *proc_handler;
 struct ctl_table_poll *poll;
 void *extra1;
 void *extra2;
};

struct ctl_node {
 struct rb_node node;
 struct ctl_table_header *header;
};



struct ctl_table_header
{
 union {
  struct {
   struct ctl_table *ctl_table;
   int used;
   int count;
   int nreg;
  };
  struct callback_head rcu;
 };
 struct completion *unregistering;
 struct ctl_table *ctl_table_arg;
 struct ctl_table_root *root;
 struct ctl_table_set *set;
 struct ctl_dir *parent;
 struct ctl_node *node;
};

struct ctl_dir {

 struct ctl_table_header header;
 struct rb_root root;
};

struct ctl_table_set {
 int (*is_seen)(struct ctl_table_set *);
 struct ctl_dir dir;
};

struct ctl_table_root {
 struct ctl_table_set default_set;
 struct ctl_table_set *(*lookup)(struct ctl_table_root *root,
        struct nsproxy *namespaces);
 int (*permissions)(struct ctl_table_header *head, struct ctl_table *table);
};


struct ctl_path {
 const char *procname;
};



void proc_sys_poll_notify(struct ctl_table_poll *poll);

extern void setup_sysctl_set(struct ctl_table_set *p,
 struct ctl_table_root *root,
 int (*is_seen)(struct ctl_table_set *));
extern void retire_sysctl_set(struct ctl_table_set *set);

void register_sysctl_root(struct ctl_table_root *root);
struct ctl_table_header *__register_sysctl_table(
 struct ctl_table_set *set,
 const char *path, struct ctl_table *table);
struct ctl_table_header *__register_sysctl_paths(
 struct ctl_table_set *set,
 const struct ctl_path *path, struct ctl_table *table);
struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table);
struct ctl_table_header *register_sysctl_table(struct ctl_table * table);
struct ctl_table_header *register_sysctl_paths(const struct ctl_path *path,
      struct ctl_table *table);

void unregister_sysctl_table(struct ctl_table_header * table);

extern int sysctl_init(void);
# 23 "include/linux/key.h" 2


# 1 "include/linux/assoc_array.h" 1
# 26 "include/linux/assoc_array.h"
struct assoc_array {
 struct assoc_array_ptr *root;
 unsigned long nr_leaves_on_tree;
};




struct assoc_array_ops {

 unsigned long (*get_key_chunk)(const void *index_key, int level);


 unsigned long (*get_object_key_chunk)(const void *object, int level);


 bool (*compare_object)(const void *object, const void *index_key);




 int (*diff_objects)(const void *object, const void *index_key);


 void (*free_object)(void *object);
};




struct assoc_array_edit;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void assoc_array_init(struct assoc_array *array)
{
 array->root = ((void *)0);
 array->nr_leaves_on_tree = 0;
}

extern int assoc_array_iterate(const struct assoc_array *array,
          int (*iterator)(const void *object,
            void *iterator_data),
          void *iterator_data);
extern void *assoc_array_find(const struct assoc_array *array,
         const struct assoc_array_ops *ops,
         const void *index_key);
extern void assoc_array_destroy(struct assoc_array *array,
    const struct assoc_array_ops *ops);
extern struct assoc_array_edit *assoc_array_insert(struct assoc_array *array,
         const struct assoc_array_ops *ops,
         const void *index_key,
         void *object);
extern void assoc_array_insert_set_object(struct assoc_array_edit *edit,
       void *object);
extern struct assoc_array_edit *assoc_array_delete(struct assoc_array *array,
         const struct assoc_array_ops *ops,
         const void *index_key);
extern struct assoc_array_edit *assoc_array_clear(struct assoc_array *array,
        const struct assoc_array_ops *ops);
extern void assoc_array_apply_edit(struct assoc_array_edit *edit);
extern void assoc_array_cancel_edit(struct assoc_array_edit *edit);
extern int assoc_array_gc(struct assoc_array *array,
     const struct assoc_array_ops *ops,
     bool (*iterator)(void *object, void *iterator_data),
     void *iterator_data);
# 26 "include/linux/key.h" 2





typedef int32_t key_serial_t;


typedef uint32_t key_perm_t;

struct key;
# 76 "include/linux/key.h"
struct seq_file;
struct user_struct;
struct signal_struct;
struct cred;

struct key_type;
struct key_owner;
struct keyring_list;
struct keyring_name;

struct keyring_index_key {
 struct key_type *type;
 const char *description;
 size_t desc_len;
};
# 106 "include/linux/key.h"
typedef struct __key_reference_with_attributes *key_ref_t;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) key_ref_t make_key_ref(const struct key *key,
         bool possession)
{
 return (key_ref_t) ((unsigned long) key | possession);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct key *key_ref_to_ptr(const key_ref_t key_ref)
{
 return (struct key *) ((unsigned long) key_ref & ~1UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_key_possessed(const key_ref_t key_ref)
{
 return (unsigned long) key_ref & 1UL;
}
# 132 "include/linux/key.h"
struct key {
 atomic_t usage;
 key_serial_t serial;
 union {
  struct list_head graveyard_link;
  struct rb_node serial_node;
 };
 struct rw_semaphore sem;
 struct key_user *user;
 void *security;
 union {
  time_t expiry;
  time_t revoked_at;
 };
 time_t last_used_at;
 kuid_t uid;
 kgid_t gid;
 key_perm_t perm;
 unsigned short quotalen;
 unsigned short datalen;
# 162 "include/linux/key.h"
 unsigned long flags;
# 181 "include/linux/key.h"
 union {
  struct keyring_index_key index_key;
  struct {
   struct key_type *type;
   char *description;
  };
 };




 union {
  struct list_head link;
  unsigned long x[2];
  void *p[2];
  int reject_error;
 } type_data;





 union {
  union {
   unsigned long value;
   void *rcudata;
   void *data;
   void *data2[2];
  } payload;
  struct assoc_array keys;
 };
};

extern struct key *key_alloc(struct key_type *type,
        const char *desc,
        kuid_t uid, kgid_t gid,
        const struct cred *cred,
        key_perm_t perm,
        unsigned long flags);







extern void key_revoke(struct key *key);
extern void key_invalidate(struct key *key);
extern void key_put(struct key *key);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct key *__key_get(struct key *key)
{
 atomic_add(1, &key->usage);
 return key;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct key *key_get(struct key *key)
{
 return key ? __key_get(key) : key;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void key_ref_put(key_ref_t key_ref)
{
 key_put(key_ref_to_ptr(key_ref));
}

extern struct key *request_key(struct key_type *type,
          const char *description,
          const char *callout_info);

extern struct key *request_key_with_auxdata(struct key_type *type,
         const char *description,
         const void *callout_info,
         size_t callout_len,
         void *aux);

extern struct key *request_key_async(struct key_type *type,
         const char *description,
         const void *callout_info,
         size_t callout_len);

extern struct key *request_key_async_with_auxdata(struct key_type *type,
        const char *description,
        const void *callout_info,
        size_t callout_len,
        void *aux);

extern int wait_for_key_construction(struct key *key, bool intr);

extern int key_validate(const struct key *key);

extern key_ref_t key_create_or_update(key_ref_t keyring,
          const char *type,
          const char *description,
          const void *payload,
          size_t plen,
          key_perm_t perm,
          unsigned long flags);

extern int key_update(key_ref_t key,
        const void *payload,
        size_t plen);

extern int key_link(struct key *keyring,
      struct key *key);

extern int key_unlink(struct key *keyring,
        struct key *key);

extern struct key *keyring_alloc(const char *description, kuid_t uid, kgid_t gid,
     const struct cred *cred,
     key_perm_t perm,
     unsigned long flags,
     struct key *dest);

extern int keyring_clear(struct key *keyring);

extern key_ref_t keyring_search(key_ref_t keyring,
    struct key_type *type,
    const char *description);

extern int keyring_add_key(struct key *keyring,
      struct key *key);

extern struct key *key_lookup(key_serial_t id);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) key_serial_t key_serial(const struct key *key)
{
 return key ? key->serial : 0;
}

extern void key_set_timeout(struct key *, unsigned);
# 332 "include/linux/key.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool key_is_instantiated(const struct key *key)
{
 return test_bit(0, &key->flags) &&
  !test_bit(5, &key->flags);
}
# 348 "include/linux/key.h"
extern struct ctl_table key_sysctls[];




extern int install_thread_keyring_to_cred(struct cred *cred);
extern void key_fsuid_changed(struct task_struct *tsk);
extern void key_fsgid_changed(struct task_struct *tsk);
extern void key_init(void);
# 18 "include/linux/cred.h" 2
# 1 "include/linux/selinux.h" 1
# 17 "include/linux/selinux.h"
struct selinux_audit_rule;
struct audit_context;
struct kern_ipc_perm;
# 29 "include/linux/selinux.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool selinux_is_enabled(void)
{
 return false;
}
# 19 "include/linux/cred.h" 2



struct user_struct;
struct cred;
struct inode;







struct group_info {
 atomic_t usage;
 int ngroups;
 int nblocks;
 kgid_t small_block[32];
 kgid_t *blocks[0];
};
# 49 "include/linux/cred.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct group_info *get_group_info(struct group_info *gi)
{
 atomic_add(1, &gi->usage);
 return gi;
}
# 65 "include/linux/cred.h"
extern struct group_info *groups_alloc(int);
extern struct group_info init_groups;
extern void groups_free(struct group_info *);
extern int set_current_groups(struct group_info *);
extern void set_groups(struct cred *, struct group_info *);
extern int groups_search(const struct group_info *, kgid_t);
extern bool may_setgroups(void);





extern int in_group_p(kgid_t);
extern int in_egroup_p(kgid_t);
# 103 "include/linux/cred.h"
struct cred {
 atomic_t usage;







 kuid_t uid;
 kgid_t gid;
 kuid_t suid;
 kgid_t sgid;
 kuid_t euid;
 kgid_t egid;
 kuid_t fsuid;
 kgid_t fsgid;
 unsigned securebits;
 kernel_cap_t cap_inheritable;
 kernel_cap_t cap_permitted;
 kernel_cap_t cap_effective;
 kernel_cap_t cap_bset;

 unsigned char jit_keyring;

 struct key *session_keyring;
 struct key *process_keyring;
 struct key *thread_keyring;
 struct key *request_key_auth;




 struct user_struct *user;
 struct user_namespace *user_ns;
 struct group_info *group_info;
 struct callback_head rcu;
};

extern void __put_cred(struct cred *);
extern void exit_creds(struct task_struct *);
extern int copy_creds(struct task_struct *, unsigned long);
extern const struct cred *get_task_cred(struct task_struct *);
extern struct cred *cred_alloc_blank(void);
extern struct cred *prepare_creds(void);
extern struct cred *prepare_exec_creds(void);
extern int commit_creds(struct cred *);
extern void abort_creds(struct cred *);
extern const struct cred *override_creds(const struct cred *);
extern void revert_creds(const struct cred *);
extern struct cred *prepare_kernel_cred(struct task_struct *);
extern int change_create_files_as(struct cred *, struct inode *);
extern int set_security_override(struct cred *, u32);
extern int set_security_override_from_ctx(struct cred *, const char *);
extern int set_create_files_as(struct cred *, struct inode *);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) cred_init(void);
# 189 "include/linux/cred.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void validate_creds(const struct cred *cred)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void validate_creds_for_do_exit(struct task_struct *tsk)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void validate_process_creds(void)
{
}
# 207 "include/linux/cred.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cred *get_new_cred(struct cred *cred)
{
 atomic_add(1, &cred->usage);
 return cred;
}
# 226 "include/linux/cred.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cred *get_cred(const struct cred *cred)
{
 struct cred *nonconst_cred = (struct cred *) cred;
 validate_creds(cred);
 return get_new_cred(nonconst_cred);
}
# 244 "include/linux/cred.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_cred(const struct cred *_cred)
{
 struct cred *cred = (struct cred *) _cred;

 validate_creds(cred);
 if ((atomic_sub_return(1, &(cred)->usage) == 0))
  __put_cred(cred);
}
# 353 "include/linux/cred.h"
extern struct user_namespace init_user_ns;
# 57 "include/linux/sched.h" 2



# 1 "./include/uapi/linux/magic.h" 1
# 61 "include/linux/sched.h" 2
# 110 "include/linux/sched.h"
struct sched_attr {
 u32 size;

 u32 sched_policy;
 u64 sched_flags;


 s32 sched_nice;


 u32 sched_priority;


 u64 sched_runtime;
 u64 sched_deadline;
 u64 sched_period;
};

struct exec_domain;
struct futex_pi_state;
struct robust_list_head;
struct bio_list;
struct fs_struct;
struct perf_event_context;
struct blk_plug;
struct filename;
# 151 "include/linux/sched.h"
extern unsigned long avenrun[];
extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift);
# 166 "include/linux/sched.h"
extern unsigned long total_forks;
extern int nr_threads;
extern __attribute__((section(".data..percpu" ""))) __typeof__(unsigned long) process_counts;
extern int nr_processes(void);
extern unsigned long nr_running(void);
extern bool single_task_running(void);
extern unsigned long nr_iowait(void);
extern unsigned long nr_iowait_cpu(int cpu);
extern void get_iowait_load(unsigned long *nr_waiters, unsigned long *load);

extern void calc_global_load(unsigned long ticks);
extern void update_cpu_load_nohz(void);

extern unsigned long get_parent_ip(unsigned long addr);

extern void dump_cpu_task(int cpu);

struct seq_file;
struct cfs_rq;
struct task_group;
# 221 "include/linux/sched.h"
extern char ___assert_task_state[1 - 2*!!(
  sizeof("RSDTtXZxKWP")-1 != ( __builtin_constant_p(1024) ? ( (1024) < 1 ? ____ilog2_NaN() : (1024) & (1ULL << 63) ? 63 : (1024) & (1ULL << 62) ? 62 : (1024) & (1ULL << 61) ? 61 : (1024) & (1ULL << 60) ? 60 : (1024) & (1ULL << 59) ? 59 : (1024) & (1ULL << 58) ? 58 : (1024) & (1ULL << 57) ? 57 : (1024) & (1ULL << 56) ? 56 : (1024) & (1ULL << 55) ? 55 : (1024) & (1ULL << 54) ? 54 : (1024) & (1ULL << 53) ? 53 : (1024) & (1ULL << 52) ? 52 : (1024) & (1ULL << 51) ? 51 : (1024) & (1ULL << 50) ? 50 : (1024) & (1ULL << 49) ? 49 : (1024) & (1ULL << 48) ? 48 : (1024) & (1ULL << 47) ? 47 : (1024) & (1ULL << 46) ? 46 : (1024) & (1ULL << 45) ? 45 : (1024) & (1ULL << 44) ? 44 : (1024) & (1ULL << 43) ? 43 : (1024) & (1ULL << 42) ? 42 : (1024) & (1ULL << 41) ? 41 : (1024) & (1ULL << 40) ? 40 : (1024) & (1ULL << 39) ? 39 : (1024) & (1ULL << 38) ? 38 : (1024) & (1ULL << 37) ? 37 : (1024) & (1ULL << 36) ? 36 : (1024) & (1ULL << 35) ? 35 : (1024) & (1ULL << 34) ? 34 : (1024) & (1ULL << 33) ? 33 : (1024) & (1ULL << 32) ? 32 : (1024) & (1ULL << 31) ? 31 : (1024) & (1ULL << 30) ? 30 : (1024) & (1ULL << 29) ? 29 : (1024) & (1ULL << 28) ? 28 : (1024) & (1ULL << 27) ? 27 : (1024) & (1ULL << 26) ? 26 : (1024) & (1ULL << 25) ? 25 : (1024) & (1ULL << 24) ? 24 : (1024) & (1ULL << 23) ? 23 : (1024) & (1ULL << 22) ? 22 : (1024) & (1ULL << 21) ? 21 : (1024) & (1ULL << 20) ? 20 : (1024) & (1ULL << 19) ? 19 : (1024) & (1ULL << 18) ? 18 : (1024) & (1ULL << 17) ? 17 : (1024) & (1ULL << 16) ? 16 : (1024) & (1ULL << 15) ? 15 : (1024) & (1ULL << 14) ? 14 : (1024) & (1ULL << 13) ? 13 : (1024) & (1ULL << 12) ? 12 : (1024) & (1ULL << 11) ? 11 : (1024) & (1ULL << 10) ? 10 : (1024) & (1ULL << 9) ? 9 : (1024) & (1ULL << 8) ? 8 : (1024) & (1ULL << 7) ? 7 : (1024) & (1ULL << 6) ? 6 : (1024) & (1ULL << 5) ? 5 : (1024) & (1ULL << 4) ? 4 : (1024) & (1ULL << 3) ? 3 : (1024) & (1ULL << 2) ? 2 : (1024) & (1ULL << 1) ? 1 : (1024) & (1ULL << 0) ? 0 : ____ilog2_NaN() ) : (sizeof(1024) <= 4) ? __ilog2_u32(1024) : __ilog2_u64(1024) )+1)];
# 317 "include/linux/sched.h"
extern rwlock_t tasklist_lock;
extern spinlock_t mmlist_lock;

struct task_struct;





extern void sched_init(void);
extern void sched_init_smp(void);
extern void schedule_tail(struct task_struct *prev);
extern void init_idle(struct task_struct *idle, int cpu);
extern void init_idle_bootup_task(struct task_struct *idle);

extern int runqueue_is_locked(int cpu);


extern void nohz_balance_enter_idle(int cpu);
extern void set_cpu_sd_state_idle(void);
extern int get_nohz_timer_target(int pinned);
# 350 "include/linux/sched.h"
extern void show_state_filter(unsigned long state_filter);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void show_state(void)
{
 show_state_filter(0);
}

extern void show_regs(struct pt_regs *);






extern void show_stack(struct task_struct *task, unsigned long *sp);

void io_schedule(void);
long io_schedule_timeout(long timeout);

extern void cpu_init (void);
extern void trap_init(void);
extern void update_process_times(int user);
extern void scheduler_tick(void);

extern void sched_show_task(struct task_struct *p);


extern void touch_softlockup_watchdog(void);
extern void touch_softlockup_watchdog_sync(void);
extern void touch_all_softlockup_watchdogs(void);
extern int proc_dowatchdog_thresh(struct ctl_table *table, int write,
      void *buffer,
      size_t *lenp, loff_t *ppos);
extern unsigned int softlockup_panic;
void lockup_detector_init(void);
# 401 "include/linux/sched.h"
void reset_hung_task_detector(void);
# 412 "include/linux/sched.h"
extern char __sched_text_start[], __sched_text_end[];


extern int in_sched_functions(unsigned long addr);


extern signed long schedule_timeout(signed long timeout);
extern signed long schedule_timeout_interruptible(signed long timeout);
extern signed long schedule_timeout_killable(signed long timeout);
extern signed long schedule_timeout_uninterruptible(signed long timeout);
 void schedule(void);
extern void schedule_preempt_disabled(void);

struct nsproxy;
struct user_namespace;


extern void arch_pick_mmap_layout(struct mm_struct *mm);
extern unsigned long
arch_get_unmapped_area(struct file *, unsigned long, unsigned long,
         unsigned long, unsigned long);
extern unsigned long
arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
     unsigned long len, unsigned long pgoff,
     unsigned long flags);
# 451 "include/linux/sched.h"
extern void set_dumpable(struct mm_struct *mm, int value);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __get_dumpable(unsigned long mm_flags)
{
 return mm_flags & ((1 << 2) - 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_dumpable(struct mm_struct *mm)
{
 return __get_dumpable(mm->flags);
}
# 500 "include/linux/sched.h"
struct sighand_struct {
 atomic_t count;
 struct k_sigaction action[64];
 spinlock_t siglock;
 wait_queue_head_t signalfd_wqh;
};

struct pacct_struct {
 int ac_flag;
 long ac_exitcode;
 unsigned long ac_mem;
 cputime_t ac_utime, ac_stime;
 unsigned long ac_minflt, ac_majflt;
};

struct cpu_itimer {
 cputime_t expires;
 cputime_t incr;
 u32 error;
 u32 incr_error;
};
# 529 "include/linux/sched.h"
struct cputime {
 cputime_t utime;
 cputime_t stime;
};
# 548 "include/linux/sched.h"
struct task_cputime {
 cputime_t utime;
 cputime_t stime;
 unsigned long long sum_exec_runtime;
};
# 590 "include/linux/sched.h"
struct thread_group_cputimer {
 struct task_cputime cputime;
 int running;
 raw_spinlock_t lock;
};


struct autogroup;
# 606 "include/linux/sched.h"
struct signal_struct {
 atomic_t sigcnt;
 atomic_t live;
 int nr_threads;
 struct list_head thread_head;

 wait_queue_head_t wait_chldexit;


 struct task_struct *curr_target;


 struct sigpending shared_pending;


 int group_exit_code;





 int notify_count;
 struct task_struct *group_exit_task;


 int group_stop_count;
 unsigned int flags;
# 643 "include/linux/sched.h"
 unsigned int is_child_subreaper:1;
 unsigned int has_child_subreaper:1;


 int posix_timer_id;
 struct list_head posix_timers;


 struct hrtimer real_timer;
 struct pid *leader_pid;
 ktime_t it_real_incr;






 struct cpu_itimer it[2];





 struct thread_group_cputimer cputimer;


 struct task_cputime cputime_expires;

 struct list_head cpu_timers[3];

 struct pid *tty_old_pgrp;


 int leader;

 struct tty_struct *tty;
# 689 "include/linux/sched.h"
 seqlock_t stats_lock;
 cputime_t utime, stime, cutime, cstime;
 cputime_t gtime;
 cputime_t cgtime;

 struct cputime prev_cputime;

 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
 unsigned long inblock, oublock, cinblock, coublock;
 unsigned long maxrss, cmaxrss;
 struct task_io_accounting ioac;







 unsigned long long sum_sched_runtime;
# 719 "include/linux/sched.h"
 struct rlimit rlim[16];
# 745 "include/linux/sched.h"
 oom_flags_t oom_flags;
 short oom_score_adj;
 short oom_score_adj_min;


 struct mutex cred_guard_mutex;


};
# 772 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int signal_group_exit(const struct signal_struct *sig)
{
 return (sig->flags & 0x00000004) ||
  (sig->group_exit_task != ((void *)0));
}




struct user_struct {
 atomic_t __count;
 atomic_t processes;
 atomic_t sigpending;

 atomic_t inotify_watches;
 atomic_t inotify_devs;





 atomic_long_t epoll_watches;



 unsigned long mq_bytes;

 unsigned long locked_shm;


 struct key *uid_keyring;
 struct key *session_keyring;



 struct hlist_node uidhash_node;
 kuid_t uid;


 atomic_long_t locked_vm;

};

extern int uids_sysfs_init(void);

extern struct user_struct *find_user(kuid_t);

extern struct user_struct root_user;



struct backing_dev_info;
struct reclaim_state;


struct sched_info {

 unsigned long pcount;
 unsigned long long run_delay;


 unsigned long long last_arrival,
      last_queued;
};
# 872 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sched_info_on(void)
{

 return 1;






}

enum cpu_idle_type {
 CPU_IDLE,
 CPU_NOT_IDLE,
 CPU_NEWLY_IDLE,
 CPU_MAX_IDLE_TYPES
};
# 917 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_smt_flags(void)
{
 return 0x0080 | 0x0200;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_core_flags(void)
{
 return 0x0200;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_numa_flags(void)
{
 return 0x4000;
}


struct sched_domain_attr {
 int relax_domain_level;
};





extern int sched_domain_level_max;

struct sched_group;

struct sched_domain {

 struct sched_domain *parent;
 struct sched_domain *child;
 struct sched_group *groups;
 unsigned long min_interval;
 unsigned long max_interval;
 unsigned int busy_factor;
 unsigned int imbalance_pct;
 unsigned int cache_nice_tries;
 unsigned int busy_idx;
 unsigned int idle_idx;
 unsigned int newidle_idx;
 unsigned int wake_idx;
 unsigned int forkexec_idx;
 unsigned int smt_gain;

 int nohz_idle;
 int flags;
 int level;


 unsigned long last_balance;
 unsigned int balance_interval;
 unsigned int nr_balance_failed;


 u64 max_newidle_lb_cost;
 unsigned long next_decay_max_lb_cost;



 unsigned int lb_count[CPU_MAX_IDLE_TYPES];
 unsigned int lb_failed[CPU_MAX_IDLE_TYPES];
 unsigned int lb_balanced[CPU_MAX_IDLE_TYPES];
 unsigned int lb_imbalance[CPU_MAX_IDLE_TYPES];
 unsigned int lb_gained[CPU_MAX_IDLE_TYPES];
 unsigned int lb_hot_gained[CPU_MAX_IDLE_TYPES];
 unsigned int lb_nobusyg[CPU_MAX_IDLE_TYPES];
 unsigned int lb_nobusyq[CPU_MAX_IDLE_TYPES];


 unsigned int alb_count;
 unsigned int alb_failed;
 unsigned int alb_pushed;


 unsigned int sbe_count;
 unsigned int sbe_balanced;
 unsigned int sbe_pushed;


 unsigned int sbf_count;
 unsigned int sbf_balanced;
 unsigned int sbf_pushed;


 unsigned int ttwu_wake_remote;
 unsigned int ttwu_move_affine;
 unsigned int ttwu_move_balance;




 union {
  void *private;
  struct callback_head rcu;
 };

 unsigned int span_weight;







 unsigned long span[0];
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cpumask *sched_domain_span(struct sched_domain *sd)
{
 return ((struct cpumask *)(1 ? (sd->span) : (void *)sizeof(__check_is_bitmap(sd->span))));
}

extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
        struct sched_domain_attr *dattr_new);


cpumask_var_t *alloc_sched_domains(unsigned int ndoms);
void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms);

bool cpus_share_cache(int this_cpu, int that_cpu);

typedef const struct cpumask *(*sched_domain_mask_f)(int cpu);
typedef int (*sched_domain_flags_f)(void);



struct sd_data {
 struct sched_domain ** sd;
 struct sched_group ** sg;
 struct sched_group_capacity ** sgc;
};

struct sched_domain_topology_level {
 sched_domain_mask_f mask;
 sched_domain_flags_f sd_flags;
 int flags;
 int numa_level;
 struct sd_data data;



};

extern struct sched_domain_topology_level *sched_domain_topology;

extern void set_sched_topology(struct sched_domain_topology_level *tl);
extern void wake_up_if_idle(int cpu);
# 1094 "include/linux/sched.h"
struct io_context;





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void prefetch_stack(struct task_struct *t) { }


struct audit_context;
struct mempolicy;
struct pipe_inode_info;
struct uts_namespace;

struct load_weight {
 unsigned long weight;
 u32 inv_weight;
};

struct sched_avg {





 u32 runnable_avg_sum, runnable_avg_period;
 u64 last_runnable_update;
 s64 decay_count;
 unsigned long load_avg_contrib;
};


struct sched_statistics {
 u64 wait_start;
 u64 wait_max;
 u64 wait_count;
 u64 wait_sum;
 u64 iowait_count;
 u64 iowait_sum;

 u64 sleep_start;
 u64 sleep_max;
 s64 sum_sleep_runtime;

 u64 block_start;
 u64 block_max;
 u64 exec_max;
 u64 slice_max;

 u64 nr_migrations_cold;
 u64 nr_failed_migrations_affine;
 u64 nr_failed_migrations_running;
 u64 nr_failed_migrations_hot;
 u64 nr_forced_migrations;

 u64 nr_wakeups;
 u64 nr_wakeups_sync;
 u64 nr_wakeups_migrate;
 u64 nr_wakeups_local;
 u64 nr_wakeups_remote;
 u64 nr_wakeups_affine;
 u64 nr_wakeups_affine_attempts;
 u64 nr_wakeups_passive;
 u64 nr_wakeups_idle;
};


struct sched_entity {
 struct load_weight load;
 struct rb_node run_node;
 struct list_head group_node;
 unsigned int on_rq;

 u64 exec_start;
 u64 sum_exec_runtime;
 u64 vruntime;
 u64 prev_sum_exec_runtime;

 u64 nr_migrations;


 struct sched_statistics statistics;
# 1189 "include/linux/sched.h"
 struct sched_avg avg;

};

struct sched_rt_entity {
 struct list_head run_list;
 unsigned long timeout;
 unsigned long watchdog_stamp;
 unsigned int time_slice;

 struct sched_rt_entity *back;







};

struct sched_dl_entity {
 struct rb_node rb_node;






 u64 dl_runtime;
 u64 dl_deadline;
 u64 dl_period;
 u64 dl_bw;






 s64 runtime;
 u64 deadline;
 unsigned int flags;
# 1249 "include/linux/sched.h"
 int dl_throttled, dl_new, dl_boosted, dl_yielded;





 struct hrtimer dl_timer;
};

union rcu_special {
 struct {
  bool blocked;
  bool need_qs;
 } b;
 short s;
};
struct rcu_node;

enum perf_event_task_context {
 perf_invalid_context = -1,
 perf_hw_context = 0,
 perf_sw_context,
 perf_nr_task_contexts,
};

struct task_struct {
 volatile long state;
 void *stack;
 atomic_t usage;
 unsigned int flags;
 unsigned int ptrace;


 struct llist_node wake_entry;
 int on_cpu;
 struct task_struct *last_wakee;
 unsigned long wakee_flips;
 unsigned long wakee_flip_decay_ts;

 int wake_cpu;

 int on_rq;

 int prio, static_prio, normal_prio;
 unsigned int rt_priority;
 const struct sched_class *sched_class;
 struct sched_entity se;
 struct sched_rt_entity rt;



 struct sched_dl_entity dl;







 unsigned int btrace_seq;


 unsigned int policy;
 int nr_cpus_allowed;
 cpumask_t cpus_allowed;
# 1331 "include/linux/sched.h"
 struct sched_info sched_info;


 struct list_head tasks;

 struct plist_node pushable_tasks;
 struct rb_node pushable_dl_tasks;


 struct mm_struct *mm, *active_mm;




 u32 vmacache_seqnum;
 struct vm_area_struct *vmacache[(1U << 2)];

 struct task_rss_stat rss_stat;


 int exit_state;
 int exit_code, exit_signal;
 int pdeath_signal;
 unsigned int jobctl;


 unsigned int personality;

 unsigned in_execve:1;

 unsigned in_iowait:1;


 unsigned sched_reset_on_fork:1;
 unsigned sched_contributes_to_load:1;





 unsigned long atomic_flags;

 struct restart_block restart_block;

 pid_t pid;
 pid_t tgid;
# 1387 "include/linux/sched.h"
 struct task_struct *real_parent;
 struct task_struct *parent;



 struct list_head children;
 struct list_head sibling;
 struct task_struct *group_leader;






 struct list_head ptraced;
 struct list_head ptrace_entry;


 struct pid_link pids[PIDTYPE_MAX];
 struct list_head thread_group;
 struct list_head thread_node;

 struct completion *vfork_done;
 int *set_child_tid;
 int *clear_child_tid;

 cputime_t utime, stime, utimescaled, stimescaled;
 cputime_t gtime;

 struct cputime prev_cputime;
# 1427 "include/linux/sched.h"
 unsigned long nvcsw, nivcsw;
 u64 start_time;
 u64 real_start_time;

 unsigned long min_flt, maj_flt;

 struct task_cputime cputime_expires;
 struct list_head cpu_timers[3];


 const struct cred *real_cred;

 const struct cred *cred;

 char comm[16];




 int link_count, total_link_count;


 struct sysv_sem sysvsem;
 struct sysv_shm sysvshm;



 unsigned long last_switch_count;


 struct thread_struct thread;

 struct fs_struct *fs;

 struct files_struct *files;

 struct nsproxy *nsproxy;

 struct signal_struct *signal;
 struct sighand_struct *sighand;

 sigset_t blocked, real_blocked;
 sigset_t saved_sigmask;
 struct sigpending pending;

 unsigned long sas_ss_sp;
 size_t sas_ss_size;
 int (*notifier)(void *priv);
 void *notifier_data;
 sigset_t *notifier_mask;
 struct callback_head *task_works;

 struct audit_context *audit_context;




 struct seccomp seccomp;


    u32 parent_exec_id;
    u32 self_exec_id;


 spinlock_t alloc_lock;


 raw_spinlock_t pi_lock;



 struct rb_root pi_waiters;
 struct rb_node *pi_waiters_leftmost;

 struct rt_mutex_waiter *pi_blocked_on;
# 1533 "include/linux/sched.h"
 void *journal_info;


 struct bio_list *bio_list;



 struct blk_plug *plug;



 struct reclaim_state *reclaim_state;

 struct backing_dev_info *backing_dev_info;

 struct io_context *io_context;

 unsigned long ptrace_message;
 siginfo_t *last_siginfo;
 struct task_io_accounting ioac;
# 1571 "include/linux/sched.h"
 struct robust_list_head *robust_list;

 struct compat_robust_list_head *compat_robust_list;

 struct list_head pi_state_list;
 struct futex_pi_state *pi_state_cache;


 struct perf_event_context *perf_event_ctxp[perf_nr_task_contexts];
 struct mutex perf_event_mutex;
 struct list_head perf_event_list;





 struct mempolicy *mempolicy;
 short il_next;
 short pref_node_fork;
# 1633 "include/linux/sched.h"
 struct callback_head rcu;




 struct pipe_inode_info *splice_pipe;

 struct page_frag task_frag;
# 1652 "include/linux/sched.h"
 int nr_dirtied;
 int nr_dirtied_pause;
 unsigned long dirty_paused_when;
# 1664 "include/linux/sched.h"
 unsigned long timer_slack_ns;
 unsigned long default_timer_slack_ns;
# 1687 "include/linux/sched.h"
 unsigned long trace;

 unsigned long trace_recursion;
# 1709 "include/linux/sched.h"
};
# 1727 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_numa_fault(int last_node, int node, int pages,
       int flags)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_numa_group_id(struct task_struct *p)
{
 return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_numabalancing_state(bool enabled)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_numa_free(struct task_struct *p)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool should_numa_migrate_memory(struct task_struct *p,
    struct page *page, int src_nid, int dst_cpu)
{
 return true;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *task_pid(struct task_struct *task)
{
 return task->pids[PIDTYPE_PID].pid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *task_tgid(struct task_struct *task)
{
 return task->group_leader->pids[PIDTYPE_PID].pid;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *task_pgrp(struct task_struct *task)
{
 return task->group_leader->pids[PIDTYPE_PGID].pid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *task_session(struct task_struct *task)
{
 return task->group_leader->pids[PIDTYPE_SID].pid;
}

struct pid_namespace;
# 1788 "include/linux/sched.h"
pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type,
   struct pid_namespace *ns);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pid_nr(struct task_struct *tsk)
{
 return tsk->pid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pid_nr_ns(struct task_struct *tsk,
     struct pid_namespace *ns)
{
 return __task_pid_nr_ns(tsk, PIDTYPE_PID, ns);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pid_vnr(struct task_struct *tsk)
{
 return __task_pid_nr_ns(tsk, PIDTYPE_PID, ((void *)0));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_tgid_nr(struct task_struct *tsk)
{
 return tsk->tgid;
}

pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_tgid_vnr(struct task_struct *tsk)
{
 return pid_vnr(task_tgid(tsk));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pid_alive(const struct task_struct *p);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns)
{
 pid_t pid = 0;

 rcu_read_lock();
 if (pid_alive(tsk))
  pid = task_tgid_nr_ns(({ typeof(*(tsk->real_parent)) *________p1 = (typeof(*(tsk->real_parent)) *)({ typeof((tsk->real_parent)) _________p1 = (*({ __attribute__((unused)) typeof((tsk->real_parent)) __var = ( typeof((tsk->real_parent))) 0; (volatile typeof((tsk->real_parent)) *)&((tsk->real_parent)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(tsk->real_parent)) *)(________p1)); }), ns);
 rcu_read_unlock();

 return pid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_ppid_nr(const struct task_struct *tsk)
{
 return task_ppid_nr_ns(tsk, &init_pid_ns);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pgrp_nr_ns(struct task_struct *tsk,
     struct pid_namespace *ns)
{
 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, ns);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pgrp_vnr(struct task_struct *tsk)
{
 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, ((void *)0));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_session_nr_ns(struct task_struct *tsk,
     struct pid_namespace *ns)
{
 return __task_pid_nr_ns(tsk, PIDTYPE_SID, ns);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_session_vnr(struct task_struct *tsk)
{
 return __task_pid_nr_ns(tsk, PIDTYPE_SID, ((void *)0));
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pgrp_nr(struct task_struct *tsk)
{
 return task_pgrp_nr_ns(tsk, &init_pid_ns);
}
# 1878 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pid_alive(const struct task_struct *p)
{
 return p->pids[PIDTYPE_PID].pid != ((void *)0);
}
# 1891 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_global_init(struct task_struct *tsk)
{
 return tsk->pid == 1;
}

extern struct pid *cad_pid;

extern void free_task(struct task_struct *tsk);


extern void __put_task_struct(struct task_struct *t);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_task_struct(struct task_struct *t)
{
 if ((atomic_sub_return(1, &t->usage) == 0))
  __put_task_struct(t);
}
# 1916 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_cputime(struct task_struct *t,
    cputime_t *utime, cputime_t *stime)
{
 if (utime)
  *utime = t->utime;
 if (stime)
  *stime = t->stime;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_cputime_scaled(struct task_struct *t,
           cputime_t *utimescaled,
           cputime_t *stimescaled)
{
 if (utimescaled)
  *utimescaled = t->utimescaled;
 if (stimescaled)
  *stimescaled = t->stimescaled;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) cputime_t task_gtime(struct task_struct *t)
{
 return t->gtime;
}

extern void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
# 2002 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gfp_t memalloc_noio_flags(gfp_t flags)
{
 if (__builtin_expect(!!(current->flags & 0x00080000), 0))
  flags &= ~((( gfp_t)0x40u) | (( gfp_t)0x80u));
 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int memalloc_noio_save(void)
{
 unsigned int flags = current->flags & 0x00080000;
 current->flags |= 0x00080000;
 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void memalloc_noio_restore(unsigned int flags)
{
 current->flags = (current->flags & ~0x00080000) | flags;
}
# 2037 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool task_no_new_privs(struct task_struct *p) { return test_bit(0, &p->atomic_flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_set_no_new_privs(struct task_struct *p) { set_bit(0, &p->atomic_flags); }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool task_spread_page(struct task_struct *p) { return test_bit(1, &p->atomic_flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_set_spread_page(struct task_struct *p) { set_bit(1, &p->atomic_flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_clear_spread_page(struct task_struct *p) { clear_bit(1, &p->atomic_flags); }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool task_spread_slab(struct task_struct *p) { return test_bit(2, &p->atomic_flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_set_spread_slab(struct task_struct *p) { set_bit(2, &p->atomic_flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_clear_spread_slab(struct task_struct *p) { clear_bit(2, &p->atomic_flags); }
# 2072 "include/linux/sched.h"
extern bool task_set_jobctl_pending(struct task_struct *task,
        unsigned int mask);
extern void task_clear_jobctl_trapping(struct task_struct *task);
extern void task_clear_jobctl_pending(struct task_struct *task,
          unsigned int mask);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_copy_process(struct task_struct *p)
{
# 2091 "include/linux/sched.h"
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tsk_restore_flags(struct task_struct *task,
    unsigned long orig_flags, unsigned long flags)
{
 task->flags &= ~flags;
 task->flags |= orig_flags & flags;
}

extern int cpuset_cpumask_can_shrink(const struct cpumask *cur,
         const struct cpumask *trial);
extern int task_can_attach(struct task_struct *p,
      const struct cpumask *cs_cpus_allowed);

extern void do_set_cpus_allowed(struct task_struct *p,
          const struct cpumask *new_mask);

extern int set_cpus_allowed_ptr(struct task_struct *p,
    const struct cpumask *new_mask);
# 2125 "include/linux/sched.h"
void calc_load_enter_idle(void);
void calc_load_exit_idle(void);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
{
 return set_cpus_allowed_ptr(p, &new_mask);
}
# 2147 "include/linux/sched.h"
extern unsigned long long __attribute__((no_instrument_function)) sched_clock(void);



extern u64 cpu_clock(int cpu);
extern u64 local_clock(void);
extern u64 running_clock(void);
extern u64 sched_clock_cpu(int cpu);


extern void sched_clock_init(void);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_clock_tick(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_clock_idle_sleep_event(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_clock_idle_wakeup_event(u64 delta_ns)
{
}
# 2196 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void enable_sched_clock_irqtime(void) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void disable_sched_clock_irqtime(void) {}


extern unsigned long long
task_sched_runtime(struct task_struct *task);



extern void sched_exec(void);




extern void sched_clock_idle_sleep_event(void);
extern void sched_clock_idle_wakeup_event(u64 delta_ns);


extern void idle_task_exit(void);





extern void wake_up_nohz_cpu(int cpu);
# 2229 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sched_can_stop_tick(void) { return false; }
# 2242 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_autogroup_create_attach(struct task_struct *p) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_autogroup_detach(struct task_struct *p) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_autogroup_fork(struct signal_struct *sig) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_autogroup_exit(struct signal_struct *sig) { }


extern int yield_to(struct task_struct *p, bool preempt);
extern void set_user_nice(struct task_struct *p, long nice);
extern int task_prio(const struct task_struct *p);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int task_nice(const struct task_struct *p)
{
 return (((p)->static_prio) - (100 + (19 - -20 + 1) / 2));
}
extern int can_nice(const struct task_struct *p, const int nice);
extern int task_curr(const struct task_struct *p);
extern int idle_cpu(int cpu);
extern int sched_setscheduler(struct task_struct *, int,
         const struct sched_param *);
extern int sched_setscheduler_nocheck(struct task_struct *, int,
          const struct sched_param *);
extern int sched_setattr(struct task_struct *,
    const struct sched_attr *);
extern struct task_struct *idle_task(int cpu);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_idle_task(const struct task_struct *p)
{
 return p->pid == 0;
}
extern struct task_struct *curr_task(int cpu);
extern void set_curr_task(int cpu, struct task_struct *p);

void yield(void);




extern struct exec_domain default_exec_domain;

union thread_union {
 struct thread_info thread_info;
 unsigned long stack[(2*((1UL) << 13))/sizeof(long)];
};


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kstack_end(void *addr)
{



 return !(((unsigned long)addr+sizeof(void*)-1) & ((2*((1UL) << 13))-sizeof(void*)));
}


extern union thread_union init_thread_union;
extern struct task_struct init_task;

extern struct mm_struct init_mm;

extern struct pid_namespace init_pid_ns;
# 2324 "include/linux/sched.h"
extern struct task_struct *find_task_by_vpid(pid_t nr);
extern struct task_struct *find_task_by_pid_ns(pid_t nr,
  struct pid_namespace *ns);


extern struct user_struct * alloc_uid(kuid_t);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct user_struct *get_uid(struct user_struct *u)
{
 atomic_add(1, &u->__count);
 return u;
}
extern void free_uid(struct user_struct *);



extern void xtime_update(unsigned long ticks);

extern int wake_up_state(struct task_struct *tsk, unsigned int state);
extern int wake_up_process(struct task_struct *tsk);
extern void wake_up_new_task(struct task_struct *tsk);

 extern void kick_process(struct task_struct *tsk);



extern int sched_fork(unsigned long clone_flags, struct task_struct *p);
extern void sched_dead(struct task_struct *p);

extern void proc_caches_init(void);
extern void flush_signals(struct task_struct *);
extern void __flush_signals(struct task_struct *);
extern void ignore_signals(struct task_struct *);
extern void flush_signal_handlers(struct task_struct *, int force_default);
extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dequeue_signal_lock(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
{
 unsigned long flags;
 int ret;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(&tsk->sighand->siglock)); } while (0); } while (0);
 ret = dequeue_signal(tsk, mask, info);
 spin_unlock_irqrestore(&tsk->sighand->siglock, flags);

 return ret;
}

extern void block_all_signals(int (*notifier)(void *priv), void *priv,
         sigset_t *mask);
extern void unblock_all_signals(void);
extern void release_task(struct task_struct * p);
extern int send_sig_info(int, struct siginfo *, struct task_struct *);
extern int force_sigsegv(int, struct task_struct *);
extern int force_sig_info(int, struct siginfo *, struct task_struct *);
extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp);
extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid);
extern int kill_pid_info_as_cred(int, struct siginfo *, struct pid *,
    const struct cred *, u32);
extern int kill_pgrp(struct pid *pid, int sig, int priv);
extern int kill_pid(struct pid *pid, int sig, int priv);
extern int kill_proc_info(int, struct siginfo *, pid_t);
extern __attribute__((warn_unused_result)) bool do_notify_parent(struct task_struct *, int);
extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
extern void force_sig(int, struct task_struct *);
extern int send_sig(int, struct task_struct *, int);
extern int zap_other_threads(struct task_struct *p);
extern struct sigqueue *sigqueue_alloc(void);
extern void sigqueue_free(struct sigqueue *);
extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group);
extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void restore_saved_sigmask(void)
{
 if (test_and_clear_restore_sigmask())
  __set_current_blocked(&current->saved_sigmask);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) sigset_t *sigmask_to_save(void)
{
 sigset_t *res = &current->blocked;
 if (__builtin_expect(!!(test_restore_sigmask()), 0))
  res = &current->saved_sigmask;
 return res;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kill_cad_pid(int sig, int priv)
{
 return kill_pid(cad_pid, sig, priv);
}
# 2422 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int on_sig_stack(unsigned long sp)
{




 return sp > current->sas_ss_sp &&
  sp - current->sas_ss_sp <= current->sas_ss_size;

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sas_ss_flags(unsigned long sp)
{
 if (!current->sas_ss_size)
  return 2;

 return on_sig_stack(sp) ? 1 : 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long sigsp(unsigned long sp, struct ksignal *ksig)
{
 if (__builtin_expect(!!((ksig->ka.sa.sa_flags & 1u)), 0) && ! sas_ss_flags(sp))



  return current->sas_ss_sp + current->sas_ss_size;

 return sp;
}




extern struct mm_struct * mm_alloc(void);


extern void __mmdrop(struct mm_struct *);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mmdrop(struct mm_struct * mm)
{
 if (__builtin_expect(!!((atomic_sub_return(1, &mm->mm_count) == 0)), 0))
  __mmdrop(mm);
}


extern void mmput(struct mm_struct *);

extern struct mm_struct *get_task_mm(struct task_struct *task);





extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode);

extern void mm_release(struct task_struct *, struct mm_struct *);

extern int copy_thread(unsigned long, unsigned long, unsigned long,
   struct task_struct *);
extern void flush_thread(void);
extern void exit_thread(void);

extern void exit_files(struct task_struct *);
extern void __cleanup_sighand(struct sighand_struct *);

extern void exit_itimers(struct signal_struct *);
extern void flush_itimer_signals(void);

extern void do_group_exit(int);

extern int do_execve(struct filename *,
       const char * const *,
       const char * const *);
extern int do_execveat(int, struct filename *,
         const char * const *,
         const char * const *,
         int);
extern long do_fork(unsigned long, unsigned long, unsigned long, int *, int *);
struct task_struct *fork_idle(int);
extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);

extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_task_comm(struct task_struct *tsk, const char *from)
{
 __set_task_comm(tsk, from, false);
}
extern char *get_task_comm(char *to, struct task_struct *tsk);


void scheduler_ipi(void);
extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
# 2527 "include/linux/sched.h"
extern bool current_is_single_threaded(void);
# 2549 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_nr_threads(struct task_struct *tsk)
{
 return tsk->signal->nr_threads;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool thread_group_leader(struct task_struct *p)
{
 return p->exit_signal >= 0;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool has_group_leader_pid(struct task_struct *p)
{
 return task_pid(p) == p->signal->leader_pid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
bool same_thread_group(struct task_struct *p1, struct task_struct *p2)
{
 return p1->signal == p2->signal;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct task_struct *next_thread(const struct task_struct *p)
{
 return ({ typeof(*p->thread_group.next) *__ptr = (typeof(*p->thread_group.next) *)p->thread_group.next; ({ const typeof( ((struct task_struct *)0)->thread_group ) *__mptr = ((typeof(p->thread_group.next))({ typeof(*(__ptr)) *________p1 = (typeof(*(__ptr)) *)({ typeof((__ptr)) _________p1 = (*({ __attribute__((unused)) typeof((__ptr)) __var = ( typeof((__ptr))) 0; (volatile typeof((__ptr)) *)&((__ptr)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(__ptr)) *)(________p1)); })); (struct task_struct *)( (char *)__mptr - __builtin_offsetof(struct task_struct,thread_group) );}); })
                                          ;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int thread_group_empty(struct task_struct *p)
{
 return list_empty(&p->thread_group);
}
# 2600 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_lock(struct task_struct *p)
{
 spin_lock(&p->alloc_lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_unlock(struct task_struct *p)
{
 spin_unlock(&p->alloc_lock);
}

extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
       unsigned long *flags);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sighand_struct *lock_task_sighand(struct task_struct *tsk,
             unsigned long *flags)
{
 struct sighand_struct *ret;

 ret = __lock_task_sighand(tsk, flags);
 (void)(ret);
 return ret;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unlock_task_sighand(struct task_struct *tsk,
      unsigned long *flags)
{
 spin_unlock_irqrestore(&tsk->sighand->siglock, *flags);
}
# 2671 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void threadgroup_change_begin(struct task_struct *tsk) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void threadgroup_change_end(struct task_struct *tsk) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void threadgroup_lock(struct task_struct *tsk) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void threadgroup_unlock(struct task_struct *tsk) {}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void setup_thread_stack(struct task_struct *p, struct task_struct *org)
{
 *((struct thread_info *)(p)->stack) = *((struct thread_info *)(org)->stack);
 ((struct thread_info *)(p)->stack)->task = p;
}
# 2697 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long *end_of_stack(struct task_struct *p)
{



 return (unsigned long *)(((struct thread_info *)(p)->stack) + 1);

}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int object_is_on_stack(void *obj)
{
 void *stack = ((current)->stack);

 return (obj >= stack) && (obj < (stack + (2*((1UL) << 13))));
}

extern void thread_info_cache_init(void);
# 2731 "include/linux/sched.h"
extern void set_task_stack_end_magic(struct task_struct *tsk);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_tsk_thread_flag(struct task_struct *tsk, int flag)
{
 set_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_tsk_thread_flag(struct task_struct *tsk, int flag)
{
 clear_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag)
{
 return test_and_set_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag)
{
 return test_and_clear_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_tsk_thread_flag(struct task_struct *tsk, int flag)
{
 return test_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_tsk_need_resched(struct task_struct *tsk)
{
 set_tsk_thread_flag(tsk,3);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_tsk_need_resched(struct task_struct *tsk)
{
 clear_tsk_thread_flag(tsk,3);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_tsk_need_resched(struct task_struct *tsk)
{
 return __builtin_expect(!!(test_tsk_thread_flag(tsk,3)), 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int restart_syscall(void)
{
 set_tsk_thread_flag(current, 2);
 return -513;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int signal_pending(struct task_struct *p)
{
 return __builtin_expect(!!(test_tsk_thread_flag(p,2)), 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __fatal_signal_pending(struct task_struct *p)
{
 return __builtin_expect(!!(sigismember(&p->pending.signal, 9)), 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fatal_signal_pending(struct task_struct *p)
{
 return signal_pending(p) && __fatal_signal_pending(p);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int signal_pending_state(long state, struct task_struct *p)
{
 if (!(state & (1 | 128)))
  return 0;
 if (!signal_pending(p))
  return 0;

 return (state & 1) || __fatal_signal_pending(p);
}
# 2814 "include/linux/sched.h"
extern int _cond_resched(void);






extern int __cond_resched_lock(spinlock_t *lock);
# 2834 "include/linux/sched.h"
extern int __cond_resched_softirq(void);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cond_resched_rcu(void)
{

 rcu_read_unlock();
 ({ ___might_sleep("include/linux/sched.h", 2845, 0); _cond_resched(); });
 rcu_read_lock();

}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_needbreak(spinlock_t *lock)
{



 return 0;

}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int tsk_is_polling(struct task_struct *p)
{
 return test_tsk_thread_flag(p, 14);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __current_set_polling(void)
{
 set_ti_thread_flag((current_thread_info_reg), 14);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __attribute__((warn_unused_result)) current_set_polling_and_test(void)
{
 __current_set_polling();





 __asm__ __volatile__("": : :"memory");

 return __builtin_expect(!!(test_ti_thread_flag((current_thread_info_reg), 3)), 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __current_clr_polling(void)
{
 clear_ti_thread_flag((current_thread_info_reg), 14);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __attribute__((warn_unused_result)) current_clr_polling_and_test(void)
{
 __current_clr_polling();





 __asm__ __volatile__("": : :"memory");

 return __builtin_expect(!!(test_ti_thread_flag((current_thread_info_reg), 3)), 0);
}
# 2925 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void current_clr_polling(void)
{
 __current_clr_polling();







 do { __asm__ __volatile__("ba,pt	%%xcc, 1f\n\t" " membar	" "#StoreLoad" "\n" "1:\n" : : : "memory"); } while (0);

 do { if (test_ti_thread_flag((current_thread_info_reg), 3)) set_preempt_need_resched(); } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool need_resched(void)
{
 return __builtin_expect(!!(test_ti_thread_flag((current_thread_info_reg), 3)), 0);
}




void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);
void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void thread_group_cputime_init(struct signal_struct *sig)
{
 do { *(&sig->cputimer.lock) = (raw_spinlock_t) { .raw_lock = { 0 }, }; } while (0);
}







extern void recalc_sigpending_and_wake(struct task_struct *t);
extern void recalc_sigpending(void);

extern void signal_wake_up_state(struct task_struct *t, unsigned int state);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void signal_wake_up(struct task_struct *t, bool resume)
{
 signal_wake_up_state(t, resume ? 128 : 0);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptrace_signal_wake_up(struct task_struct *t, bool resume)
{
 signal_wake_up_state(t, resume ? 8 : 0);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int task_cpu(const struct task_struct *p)
{
 return ((struct thread_info *)(p)->stack)->cpu;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int task_node(const struct task_struct *p)
{
 return cpu_to_node(task_cpu(p));
}

extern void set_task_cpu(struct task_struct *p, unsigned int cpu);
# 3006 "include/linux/sched.h"
extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
extern long sched_getaffinity(pid_t pid, struct cpumask *mask);





extern int task_can_switch_user(struct user_struct *up,
     struct task_struct *tsk);
# 3037 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void add_rchar(struct task_struct *tsk, ssize_t amt)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void add_wchar(struct task_struct *tsk, ssize_t amt)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inc_syscr(struct task_struct *tsk)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inc_syscw(struct task_struct *tsk)
{
}
# 3061 "include/linux/sched.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_update_next_owner(struct mm_struct *mm)
{
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long task_rlimit(const struct task_struct *tsk,
  unsigned int limit)
{
 return (*({ __attribute__((unused)) typeof(tsk->signal->rlim[limit].rlim_cur) __var = ( typeof(tsk->signal->rlim[limit].rlim_cur)) 0; (volatile typeof(tsk->signal->rlim[limit].rlim_cur) *)&(tsk->signal->rlim[limit].rlim_cur); }));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long task_rlimit_max(const struct task_struct *tsk,
  unsigned int limit)
{
 return (*({ __attribute__((unused)) typeof(tsk->signal->rlim[limit].rlim_max) __var = ( typeof(tsk->signal->rlim[limit].rlim_max)) 0; (volatile typeof(tsk->signal->rlim[limit].rlim_max) *)&(tsk->signal->rlim[limit].rlim_max); }));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long rlimit(unsigned int limit)
{
 return task_rlimit(current, limit);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long rlimit_max(unsigned int limit)
{
 return task_rlimit_max(current, limit);
}
# 13 "arch/sparc/math-emu/math_64.c" 2

# 1 "include/linux/perf_event.h" 1
# 17 "include/linux/perf_event.h"
# 1 "include/uapi/linux/perf_event.h" 1
# 18 "include/uapi/linux/perf_event.h"
# 1 "./include/uapi/linux/ioctl.h" 1



# 1 "./arch/sparc/include/uapi/asm/ioctl.h" 1
# 5 "./include/uapi/linux/ioctl.h" 2
# 19 "include/uapi/linux/perf_event.h" 2
# 28 "include/uapi/linux/perf_event.h"
enum perf_type_id {
 PERF_TYPE_HARDWARE = 0,
 PERF_TYPE_SOFTWARE = 1,
 PERF_TYPE_TRACEPOINT = 2,
 PERF_TYPE_HW_CACHE = 3,
 PERF_TYPE_RAW = 4,
 PERF_TYPE_BREAKPOINT = 5,

 PERF_TYPE_MAX,
};






enum perf_hw_id {



 PERF_COUNT_HW_CPU_CYCLES = 0,
 PERF_COUNT_HW_INSTRUCTIONS = 1,
 PERF_COUNT_HW_CACHE_REFERENCES = 2,
 PERF_COUNT_HW_CACHE_MISSES = 3,
 PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4,
 PERF_COUNT_HW_BRANCH_MISSES = 5,
 PERF_COUNT_HW_BUS_CYCLES = 6,
 PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 7,
 PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 8,
 PERF_COUNT_HW_REF_CPU_CYCLES = 9,

 PERF_COUNT_HW_MAX,
};
# 69 "include/uapi/linux/perf_event.h"
enum perf_hw_cache_id {
 PERF_COUNT_HW_CACHE_L1D = 0,
 PERF_COUNT_HW_CACHE_L1I = 1,
 PERF_COUNT_HW_CACHE_LL = 2,
 PERF_COUNT_HW_CACHE_DTLB = 3,
 PERF_COUNT_HW_CACHE_ITLB = 4,
 PERF_COUNT_HW_CACHE_BPU = 5,
 PERF_COUNT_HW_CACHE_NODE = 6,

 PERF_COUNT_HW_CACHE_MAX,
};

enum perf_hw_cache_op_id {
 PERF_COUNT_HW_CACHE_OP_READ = 0,
 PERF_COUNT_HW_CACHE_OP_WRITE = 1,
 PERF_COUNT_HW_CACHE_OP_PREFETCH = 2,

 PERF_COUNT_HW_CACHE_OP_MAX,
};

enum perf_hw_cache_op_result_id {
 PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0,
 PERF_COUNT_HW_CACHE_RESULT_MISS = 1,

 PERF_COUNT_HW_CACHE_RESULT_MAX,
};







enum perf_sw_ids {
 PERF_COUNT_SW_CPU_CLOCK = 0,
 PERF_COUNT_SW_TASK_CLOCK = 1,
 PERF_COUNT_SW_PAGE_FAULTS = 2,
 PERF_COUNT_SW_CONTEXT_SWITCHES = 3,
 PERF_COUNT_SW_CPU_MIGRATIONS = 4,
 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5,
 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
 PERF_COUNT_SW_EMULATION_FAULTS = 8,
 PERF_COUNT_SW_DUMMY = 9,

 PERF_COUNT_SW_MAX,
};





enum perf_event_sample_format {
 PERF_SAMPLE_IP = 1U << 0,
 PERF_SAMPLE_TID = 1U << 1,
 PERF_SAMPLE_TIME = 1U << 2,
 PERF_SAMPLE_ADDR = 1U << 3,
 PERF_SAMPLE_READ = 1U << 4,
 PERF_SAMPLE_CALLCHAIN = 1U << 5,
 PERF_SAMPLE_ID = 1U << 6,
 PERF_SAMPLE_CPU = 1U << 7,
 PERF_SAMPLE_PERIOD = 1U << 8,
 PERF_SAMPLE_STREAM_ID = 1U << 9,
 PERF_SAMPLE_RAW = 1U << 10,
 PERF_SAMPLE_BRANCH_STACK = 1U << 11,
 PERF_SAMPLE_REGS_USER = 1U << 12,
 PERF_SAMPLE_STACK_USER = 1U << 13,
 PERF_SAMPLE_WEIGHT = 1U << 14,
 PERF_SAMPLE_DATA_SRC = 1U << 15,
 PERF_SAMPLE_IDENTIFIER = 1U << 16,
 PERF_SAMPLE_TRANSACTION = 1U << 17,
 PERF_SAMPLE_REGS_INTR = 1U << 18,

 PERF_SAMPLE_MAX = 1U << 19,
};
# 155 "include/uapi/linux/perf_event.h"
enum perf_branch_sample_type {
 PERF_SAMPLE_BRANCH_USER = 1U << 0,
 PERF_SAMPLE_BRANCH_KERNEL = 1U << 1,
 PERF_SAMPLE_BRANCH_HV = 1U << 2,

 PERF_SAMPLE_BRANCH_ANY = 1U << 3,
 PERF_SAMPLE_BRANCH_ANY_CALL = 1U << 4,
 PERF_SAMPLE_BRANCH_ANY_RETURN = 1U << 5,
 PERF_SAMPLE_BRANCH_IND_CALL = 1U << 6,
 PERF_SAMPLE_BRANCH_ABORT_TX = 1U << 7,
 PERF_SAMPLE_BRANCH_IN_TX = 1U << 8,
 PERF_SAMPLE_BRANCH_NO_TX = 1U << 9,
 PERF_SAMPLE_BRANCH_COND = 1U << 10,

 PERF_SAMPLE_BRANCH_MAX = 1U << 11,
};
# 180 "include/uapi/linux/perf_event.h"
enum perf_sample_regs_abi {
 PERF_SAMPLE_REGS_ABI_NONE = 0,
 PERF_SAMPLE_REGS_ABI_32 = 1,
 PERF_SAMPLE_REGS_ABI_64 = 2,
};





enum {
 PERF_TXN_ELISION = (1 << 0),
 PERF_TXN_TRANSACTION = (1 << 1),
 PERF_TXN_SYNC = (1 << 2),
 PERF_TXN_ASYNC = (1 << 3),
 PERF_TXN_RETRY = (1 << 4),
 PERF_TXN_CONFLICT = (1 << 5),
 PERF_TXN_CAPACITY_WRITE = (1 << 6),
 PERF_TXN_CAPACITY_READ = (1 << 7),

 PERF_TXN_MAX = (1 << 8),



 PERF_TXN_ABORT_MASK = (0xffffffffULL << 32),
 PERF_TXN_ABORT_SHIFT = 32,
};
# 228 "include/uapi/linux/perf_event.h"
enum perf_event_read_format {
 PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
 PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
 PERF_FORMAT_ID = 1U << 2,
 PERF_FORMAT_GROUP = 1U << 3,

 PERF_FORMAT_MAX = 1U << 4,
};
# 247 "include/uapi/linux/perf_event.h"
struct perf_event_attr {




 __u32 type;




 __u32 size;




 __u64 config;

 union {
  __u64 sample_period;
  __u64 sample_freq;
 };

 __u64 sample_type;
 __u64 read_format;

 __u64 disabled : 1,
    inherit : 1,
    pinned : 1,
    exclusive : 1,
    exclude_user : 1,
    exclude_kernel : 1,
    exclude_hv : 1,
    exclude_idle : 1,
    mmap : 1,
    comm : 1,
    freq : 1,
    inherit_stat : 1,
    enable_on_exec : 1,
    task : 1,
    watermark : 1,
# 297 "include/uapi/linux/perf_event.h"
    precise_ip : 2,
    mmap_data : 1,
    sample_id_all : 1,

    exclude_host : 1,
    exclude_guest : 1,

    exclude_callchain_kernel : 1,
    exclude_callchain_user : 1,
    mmap2 : 1,
    comm_exec : 1,
    __reserved_1 : 39;

 union {
  __u32 wakeup_events;
  __u32 wakeup_watermark;
 };

 __u32 bp_type;
 union {
  __u64 bp_addr;
  __u64 config1;
 };
 union {
  __u64 bp_len;
  __u64 config2;
 };
 __u64 branch_sample_type;





 __u64 sample_regs_user;




 __u32 sample_stack_user;


 __u32 __reserved_2;
# 347 "include/uapi/linux/perf_event.h"
 __u64 sample_regs_intr;
};
# 364 "include/uapi/linux/perf_event.h"
enum perf_event_ioc_flags {
 PERF_IOC_FLAG_GROUP = 1U << 0,
};




struct perf_event_mmap_page {
 __u32 version;
 __u32 compat_version;
# 410 "include/uapi/linux/perf_event.h"
 __u32 lock;
 __u32 index;
 __s64 offset;
 __u64 time_enabled;
 __u64 time_running;
 union {
  __u64 capabilities;
  struct {
   __u64 cap_bit0 : 1,
    cap_bit0_is_deprecated : 1,

    cap_user_rdpmc : 1,
    cap_user_time : 1,
    cap_user_time_zero : 1,
    cap_____res : 59;
  };
 };
# 437 "include/uapi/linux/perf_event.h"
 __u16 pmc_width;
# 463 "include/uapi/linux/perf_event.h"
 __u16 time_shift;
 __u32 time_mult;
 __u64 time_offset;
# 482 "include/uapi/linux/perf_event.h"
 __u64 time_zero;
 __u32 size;





 __u8 __reserved[118*8+4];
# 504 "include/uapi/linux/perf_event.h"
 __u64 data_head;
 __u64 data_tail;
};
# 533 "include/uapi/linux/perf_event.h"
struct perf_event_header {
 __u32 type;
 __u16 misc;
 __u16 size;
};

enum perf_event_type {
# 580 "include/uapi/linux/perf_event.h"
 PERF_RECORD_MMAP = 1,
# 590 "include/uapi/linux/perf_event.h"
 PERF_RECORD_LOST = 2,
# 601 "include/uapi/linux/perf_event.h"
 PERF_RECORD_COMM = 3,
# 612 "include/uapi/linux/perf_event.h"
 PERF_RECORD_EXIT = 4,
# 623 "include/uapi/linux/perf_event.h"
 PERF_RECORD_THROTTLE = 5,
 PERF_RECORD_UNTHROTTLE = 6,
# 635 "include/uapi/linux/perf_event.h"
 PERF_RECORD_FORK = 7,
# 646 "include/uapi/linux/perf_event.h"
 PERF_RECORD_READ = 8,
# 704 "include/uapi/linux/perf_event.h"
 PERF_RECORD_SAMPLE = 9,
# 726 "include/uapi/linux/perf_event.h"
 PERF_RECORD_MMAP2 = 10,

 PERF_RECORD_MAX,
};



enum perf_callchain_context {
 PERF_CONTEXT_HV = (__u64)-32,
 PERF_CONTEXT_KERNEL = (__u64)-128,
 PERF_CONTEXT_USER = (__u64)-512,

 PERF_CONTEXT_GUEST = (__u64)-2048,
 PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176,
 PERF_CONTEXT_GUEST_USER = (__u64)-2560,

 PERF_CONTEXT_MAX = (__u64)-4095,
};






union perf_mem_data_src {
 __u64 val;
 struct {
  __u64 mem_op:5,
   mem_lvl:14,
   mem_snoop:5,
   mem_lock:2,
   mem_dtlb:7,
   mem_rsvd:31;
 };
};
# 827 "include/uapi/linux/perf_event.h"
struct perf_branch_entry {
 __u64 from;
 __u64 to;
 __u64 mispred:1,
  predicted:1,
  in_tx:1,
  abort:1,
  reserved:60;
};
# 18 "include/linux/perf_event.h" 2






# 1 "./arch/sparc/include/asm/perf_event.h" 1
# 25 "include/linux/perf_event.h" 2
# 1 "arch/sparc/include/generated/asm/local64.h" 1
# 1 "include/asm-generic/local64.h" 1




# 1 "arch/sparc/include/generated/asm/types.h" 1
# 6 "include/asm-generic/local64.h" 2
# 21 "include/asm-generic/local64.h"
# 1 "arch/sparc/include/generated/asm/local.h" 1
# 1 "include/asm-generic/local.h" 1





# 1 "arch/sparc/include/generated/asm/types.h" 1
# 7 "include/asm-generic/local.h" 2
# 21 "include/asm-generic/local.h"
typedef struct
{
 atomic_long_t a;
} local_t;
# 1 "arch/sparc/include/generated/asm/local.h" 2
# 22 "include/asm-generic/local64.h" 2

typedef struct {
 local_t a;
} local64_t;
# 1 "arch/sparc/include/generated/asm/local64.h" 2
# 26 "include/linux/perf_event.h" 2


struct perf_guest_info_callbacks {
 int (*is_in_guest)(void);
 int (*is_user_mode)(void);
 unsigned long (*get_guest_ip)(void);
};
# 44 "include/linux/perf_event.h"
# 1 "include/linux/fs.h" 1






# 1 "include/linux/kdev_t.h" 1



# 1 "include/uapi/linux/kdev_t.h" 1
# 5 "include/linux/kdev_t.h" 2
# 23 "include/linux/kdev_t.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int old_valid_dev(dev_t dev)
{
 return ((unsigned int) ((dev) >> 20)) < 256 && ((unsigned int) ((dev) & ((1U << 20) - 1))) < 256;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 old_encode_dev(dev_t dev)
{
 return (((unsigned int) ((dev) >> 20)) << 8) | ((unsigned int) ((dev) & ((1U << 20) - 1)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dev_t old_decode_dev(u16 val)
{
 return ((((val >> 8) & 255) << 20) | (val & 255));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int new_valid_dev(dev_t dev)
{
 return 1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 new_encode_dev(dev_t dev)
{
 unsigned major = ((unsigned int) ((dev) >> 20));
 unsigned minor = ((unsigned int) ((dev) & ((1U << 20) - 1)));
 return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dev_t new_decode_dev(u32 dev)
{
 unsigned major = (dev & 0xfff00) >> 8;
 unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00);
 return (((major) << 20) | (minor));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int huge_valid_dev(dev_t dev)
{
 return 1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 huge_encode_dev(dev_t dev)
{
 return new_encode_dev(dev);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dev_t huge_decode_dev(u64 dev)
{
 return new_decode_dev(dev);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sysv_valid_dev(dev_t dev)
{
 return ((unsigned int) ((dev) >> 20)) < (1<<14) && ((unsigned int) ((dev) & ((1U << 20) - 1))) < (1<<18);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 sysv_encode_dev(dev_t dev)
{
 return ((unsigned int) ((dev) & ((1U << 20) - 1))) | (((unsigned int) ((dev) >> 20)) << 18);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned sysv_major(u32 dev)
{
 return (dev >> 18) & 0x3fff;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned sysv_minor(u32 dev)
{
 return dev & 0x3ffff;
}
# 8 "include/linux/fs.h" 2
# 1 "include/linux/dcache.h" 1






# 1 "include/linux/rculist_bl.h" 1






# 1 "include/linux/list_bl.h" 1




# 1 "include/linux/bit_spinlock.h" 1
# 15 "include/linux/bit_spinlock.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bit_spin_lock(int bitnum, unsigned long *addr)
{







 __asm__ __volatile__("": : :"memory");

 while (__builtin_expect(!!(test_and_set_bit(bitnum, addr)), 0)) {
  __asm__ __volatile__("": : :"memory");
  do {
   asm volatile("\n99:\n\t" "rd	%%ccr, %%g0\n\t" "rd	%%ccr, %%g0\n\t" "rd	%%ccr, %%g0\n\t" ".section	.pause_3insn_patch,\"ax\"\n\t" ".word	99b\n\t" "wr	%%g0, 128, %%asr27\n\t" "nop\n\t" "nop\n\t" ".previous" ::: "memory");
  } while (test_bit(bitnum, addr));
  __asm__ __volatile__("": : :"memory");
 }

 (void)0;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bit_spin_trylock(int bitnum, unsigned long *addr)
{
 __asm__ __volatile__("": : :"memory");

 if (__builtin_expect(!!(test_and_set_bit(bitnum, addr)), 0)) {
  __asm__ __volatile__("": : :"memory");
  return 0;
 }

 (void)0;
 return 1;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bit_spin_unlock(int bitnum, unsigned long *addr)
{




 do { __asm__ __volatile__("": : :"memory"); clear_bit(bitnum, addr); } while (0);

 __asm__ __volatile__("": : :"memory");
 (void)0;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __bit_spin_unlock(int bitnum, unsigned long *addr)
{




 do { do { __asm__ __volatile__("ba,pt	%%xcc, 1f\n\t" " membar	" "#StoreLoad" "\n" "1:\n" : : : "memory"); } while (0); __clear_bit(bitnum, addr); } while (0);

 __asm__ __volatile__("": : :"memory");
 (void)0;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bit_spin_is_locked(int bitnum, unsigned long *addr)
{

 return test_bit(bitnum, addr);





}
# 6 "include/linux/list_bl.h" 2
# 33 "include/linux/list_bl.h"
struct hlist_bl_head {
 struct hlist_bl_node *first;
};

struct hlist_bl_node {
 struct hlist_bl_node *next, **pprev;
};



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void INIT_HLIST_BL_NODE(struct hlist_bl_node *h)
{
 h->next = ((void *)0);
 h->pprev = ((void *)0);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_bl_unhashed(const struct hlist_bl_node *h)
{
 return !h->pprev;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct hlist_bl_node *hlist_bl_first(struct hlist_bl_head *h)
{
 return (struct hlist_bl_node *)
  ((unsigned long)h->first & ~1UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_set_first(struct hlist_bl_head *h,
     struct hlist_bl_node *n)
{
 ;

                        ;
 h->first = (struct hlist_bl_node *)((unsigned long)n | 1UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_bl_empty(const struct hlist_bl_head *h)
{
 return !((unsigned long)h->first & ~1UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_add_head(struct hlist_bl_node *n,
     struct hlist_bl_head *h)
{
 struct hlist_bl_node *first = hlist_bl_first(h);

 n->next = first;
 if (first)
  first->pprev = &n->next;
 n->pprev = &h->first;
 hlist_bl_set_first(h, n);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __hlist_bl_del(struct hlist_bl_node *n)
{
 struct hlist_bl_node *next = n->next;
 struct hlist_bl_node **pprev = n->pprev;

 ;


 *pprev = (struct hlist_bl_node *)
   ((unsigned long)next |
    ((unsigned long)*pprev & 1UL));
 if (next)
  next->pprev = pprev;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_del(struct hlist_bl_node *n)
{
 __hlist_bl_del(n);
 n->next = ((void *) 0x00100100 + 0);
 n->pprev = ((void *) 0x00200200 + 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_del_init(struct hlist_bl_node *n)
{
 if (!hlist_bl_unhashed(n)) {
  __hlist_bl_del(n);
  INIT_HLIST_BL_NODE(n);
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_lock(struct hlist_bl_head *b)
{
 bit_spin_lock(0, (unsigned long *)b);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_unlock(struct hlist_bl_head *b)
{
 __bit_spin_unlock(0, (unsigned long *)b);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool hlist_bl_is_locked(struct hlist_bl_head *b)
{
 return bit_spin_is_locked(0, (unsigned long *)b);
}
# 8 "include/linux/rculist_bl.h" 2


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_set_first_rcu(struct hlist_bl_head *h,
     struct hlist_bl_node *n)
{
 ;

                        ;
 do { do { bool __cond = !((sizeof(*&h->first) == sizeof(char) || sizeof(*&h->first) == sizeof(short) || sizeof(*&h->first) == sizeof(int) || sizeof(*&h->first) == sizeof(long))); extern void
 __compiletime_assert_17
# 16 "include/linux/rculist_bl.h"
 (void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond)
 __compiletime_assert_17
# 16 "include/linux/rculist_bl.h"
 (); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&h->first) __var = ( typeof(*&h->first)) 0; (volatile typeof(*&h->first) *)&(*&h->first); })) = ((typeof(*((struct hlist_bl_node *)((unsigned long)n | 1UL))) *)((struct hlist_bl_node *)((unsigned long)n | 1UL))); } while (0)
                                                                ;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct hlist_bl_node *hlist_bl_first_rcu(struct hlist_bl_head *h)
{
 return (struct hlist_bl_node *)
  ((unsigned long)({ typeof(*(h->first)) *________p1 = (typeof(*(h->first)) *)({ typeof((h->first)) _________p1 = (*({ __attribute__((unused)) typeof((h->first)) __var = ( typeof((h->first))) 0; (volatile typeof((h->first)) *)&((h->first)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(h->first)) *)(________p1)); }) & ~1UL);
}
# 46 "include/linux/rculist_bl.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_del_init_rcu(struct hlist_bl_node *n)
{
 if (!hlist_bl_unhashed(n)) {
  __hlist_bl_del(n);
  n->pprev = ((void *)0);
 }
}
# 73 "include/linux/rculist_bl.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_del_rcu(struct hlist_bl_node *n)
{
 __hlist_bl_del(n);
 n->pprev = ((void *) 0x00200200 + 0);
}
# 98 "include/linux/rculist_bl.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_add_head_rcu(struct hlist_bl_node *n,
     struct hlist_bl_head *h)
{
 struct hlist_bl_node *first;


 first = hlist_bl_first(h);

 n->next = first;
 if (first)
  first->pprev = &n->next;
 n->pprev = &h->first;


 hlist_bl_set_first_rcu(h, n);
}
# 8 "include/linux/dcache.h" 2




# 1 "include/linux/lockref.h" 1
# 24 "include/linux/lockref.h"
struct lockref {
 union {



  struct {
   spinlock_t lock;
   int count;
  };
 };
};

extern void lockref_get(struct lockref *);
extern int lockref_put_return(struct lockref *);
extern int lockref_get_not_zero(struct lockref *);
extern int lockref_get_or_lock(struct lockref *);
extern int lockref_put_or_lock(struct lockref *);

extern void lockref_mark_dead(struct lockref *);
extern int lockref_get_not_dead(struct lockref *);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __lockref_is_dead(const struct lockref *l)
{
 return ((int)l->count < 0);
}
# 13 "include/linux/dcache.h" 2

struct path;
struct vfsmount;
# 44 "include/linux/dcache.h"
struct qstr {
 union {
  struct {
   u32 len; u32 hash;;
  };
  u64 hash_len;
 };
 const unsigned char *name;
};






struct dentry_stat_t {
 long nr_dentry;
 long nr_unused;
 long age_limit;
 long want_pages;
 long dummy[2];
};
extern struct dentry_stat_t dentry_stat;






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
partial_name_hash(unsigned long c, unsigned long prevhash)
{
 return (prevhash + (c << 4) + (c >> 4)) * 11;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long end_name_hash(unsigned long hash)
{
 return (unsigned int) hash;
}


extern unsigned int full_name_hash(const unsigned char *, unsigned int);
# 108 "include/linux/dcache.h"
struct dentry {

 unsigned int d_flags;
 seqcount_t d_seq;
 struct hlist_bl_node d_hash;
 struct dentry *d_parent;
 struct qstr d_name;
 struct inode *d_inode;

 unsigned char d_iname[32];


 struct lockref d_lockref;
 const struct dentry_operations *d_op;
 struct super_block *d_sb;
 unsigned long d_time;
 void *d_fsdata;

 struct list_head d_lru;
 struct list_head d_child;
 struct list_head d_subdirs;



 union {
  struct hlist_node d_alias;
   struct callback_head d_rcu;
 } d_u;
};







enum dentry_d_lock_class
{
 DENTRY_D_LOCK_NORMAL,
 DENTRY_D_LOCK_NESTED
};

struct dentry_operations {
 int (*d_revalidate)(struct dentry *, unsigned int);
 int (*d_weak_revalidate)(struct dentry *, unsigned int);
 int (*d_hash)(const struct dentry *, struct qstr *);
 int (*d_compare)(const struct dentry *, const struct dentry *,
   unsigned int, const char *, const struct qstr *);
 int (*d_delete)(const struct dentry *);
 void (*d_release)(struct dentry *);
 void (*d_prune)(struct dentry *);
 void (*d_iput)(struct dentry *, struct inode *);
 char *(*d_dname)(struct dentry *, char *, int);
 struct vfsmount *(*d_automount)(struct path *);
 int (*d_manage)(struct dentry *, bool);
} __attribute__((__aligned__((1 << 6))));
# 226 "include/linux/dcache.h"
extern seqlock_t rename_lock;




extern void d_instantiate(struct dentry *, struct inode *);
extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *);
extern int d_instantiate_no_diralias(struct dentry *, struct inode *);
extern void __d_drop(struct dentry *dentry);
extern void d_drop(struct dentry *dentry);
extern void d_delete(struct dentry *);
extern void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op);


extern struct dentry * d_alloc(struct dentry *, const struct qstr *);
extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *);
extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *);
extern struct dentry *d_find_any_alias(struct inode *inode);
extern struct dentry * d_obtain_alias(struct inode *);
extern struct dentry * d_obtain_root(struct inode *);
extern void shrink_dcache_sb(struct super_block *);
extern void shrink_dcache_parent(struct dentry *);
extern void shrink_dcache_for_umount(struct super_block *);
extern void d_invalidate(struct dentry *);


extern struct dentry * d_make_root(struct inode *);


extern void d_genocide(struct dentry *);

extern void d_tmpfile(struct dentry *, struct inode *);

extern struct dentry *d_find_alias(struct inode *);
extern void d_prune_aliases(struct inode *);


extern int have_submounts(struct dentry *);




extern void d_rehash(struct dentry *);
# 280 "include/linux/dcache.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void d_add(struct dentry *entry, struct inode *inode)
{
 d_instantiate(entry, inode);
 d_rehash(entry);
}
# 294 "include/linux/dcache.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *d_add_unique(struct dentry *entry, struct inode *inode)
{
 struct dentry *res;

 res = d_instantiate_unique(entry, inode);
 d_rehash(res != ((void *)0) ? res : entry);
 return res;
}

extern void dentry_update_name_case(struct dentry *, struct qstr *);


extern void d_move(struct dentry *, struct dentry *);
extern void d_exchange(struct dentry *, struct dentry *);
extern struct dentry *d_ancestor(struct dentry *, struct dentry *);


extern struct dentry *d_lookup(const struct dentry *, const struct qstr *);
extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *);
extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *);
extern struct dentry *__d_lookup_rcu(const struct dentry *parent,
    const struct qstr *name, unsigned *seq);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned d_count(const struct dentry *dentry)
{
 return dentry->d_lockref.count;
}




extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
extern char *simple_dname(struct dentry *, char *, int);

extern char *__d_path(const struct path *, const struct path *, char *, int);
extern char *d_absolute_path(const struct path *, char *, int);
extern char *d_path(const struct path *, char *, int);
extern char *dentry_path_raw(struct dentry *, char *, int);
extern char *dentry_path(struct dentry *, char *, int);
# 344 "include/linux/dcache.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *dget_dlock(struct dentry *dentry)
{
 if (dentry)
  dentry->d_lockref.count++;
 return dentry;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *dget(struct dentry *dentry)
{
 if (dentry)
  lockref_get(&dentry->d_lockref);
 return dentry;
}

extern struct dentry *dget_parent(struct dentry *dentry);
# 367 "include/linux/dcache.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int d_unhashed(const struct dentry *dentry)
{
 return hlist_bl_unhashed(&dentry->d_hash);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int d_unlinked(const struct dentry *dentry)
{
 return d_unhashed(dentry) && !((dentry) == (dentry)->d_parent);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cant_mount(const struct dentry *dentry)
{
 return (dentry->d_flags & 0x00000100);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dont_mount(struct dentry *dentry)
{
 spin_lock(&dentry->d_lockref.lock);
 dentry->d_flags |= 0x00000100;
 spin_unlock(&dentry->d_lockref.lock);
}

extern void dput(struct dentry *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_managed(const struct dentry *dentry)
{
 return dentry->d_flags & (0x00010000|0x00020000|0x00040000);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_mountpoint(const struct dentry *dentry)
{
 return dentry->d_flags & 0x00010000;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __d_set_type(struct dentry *dentry, unsigned type)
{
 dentry->d_flags = (dentry->d_flags & ~0x00700000) | type;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __d_clear_type(struct dentry *dentry)
{
 __d_set_type(dentry, 0x00000000);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void d_set_type(struct dentry *dentry, unsigned type)
{
 spin_lock(&dentry->d_lockref.lock);
 __d_set_type(dentry, type);
 spin_unlock(&dentry->d_lockref.lock);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned __d_entry_type(const struct dentry *dentry)
{
 return dentry->d_flags & 0x00700000;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_can_lookup(const struct dentry *dentry)
{
 return __d_entry_type(dentry) == 0x00100000;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_autodir(const struct dentry *dentry)
{
 return __d_entry_type(dentry) == 0x00200000;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_dir(const struct dentry *dentry)
{
 return d_can_lookup(dentry) || d_is_autodir(dentry);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_symlink(const struct dentry *dentry)
{
 return __d_entry_type(dentry) == 0x00300000;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_file(const struct dentry *dentry)
{
 return __d_entry_type(dentry) == 0x00400000;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_negative(const struct dentry *dentry)
{
 return __d_entry_type(dentry) == 0x00000000;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_positive(const struct dentry *dentry)
{
 return !d_is_negative(dentry);
}

extern int sysctl_vfs_cache_pressure;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long vfs_pressure_ratio(unsigned long val)
{
 return ( { typeof(val) quot = (val) / (100); typeof(val) rem = (val) % (100); (quot * (sysctl_vfs_cache_pressure)) + ((rem * (sysctl_vfs_cache_pressure)) / (100)); } );
}
# 9 "include/linux/fs.h" 2
# 1 "include/linux/path.h" 1



struct dentry;
struct vfsmount;

struct path {
 struct vfsmount *mnt;
 struct dentry *dentry;
};

extern void path_get(const struct path *);
extern void path_put(const struct path *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int path_equal(const struct path *path1, const struct path *path2)
{
 return path1->mnt == path2->mnt && path1->dentry == path2->dentry;
}
# 10 "include/linux/fs.h" 2
# 1 "include/linux/stat.h" 1




# 1 "./arch/sparc/include/uapi/asm/stat.h" 1







struct stat {
 unsigned st_dev;
 ino_t st_ino;
 mode_t st_mode;
 short st_nlink;
 uid_t st_uid;
 gid_t st_gid;
 unsigned st_rdev;
 off_t st_size;
 time_t st_atime;
 time_t st_mtime;
 time_t st_ctime;
 off_t st_blksize;
 off_t st_blocks;
 unsigned long __unused4[2];
};

struct stat64 {
 unsigned long st_dev;
 unsigned long st_ino;
 unsigned long st_nlink;

 unsigned int st_mode;
 unsigned int st_uid;
 unsigned int st_gid;
 unsigned int __pad0;

 unsigned long st_rdev;
 long st_size;
 long st_blksize;
 long st_blocks;

 unsigned long st_atime;
 unsigned long st_atime_nsec;
 unsigned long st_mtime;
 unsigned long st_mtime_nsec;
 unsigned long st_ctime;
 unsigned long st_ctime_nsec;
 long __unused[3];
};
# 6 "include/linux/stat.h" 2
# 1 "include/uapi/linux/stat.h" 1
# 7 "include/linux/stat.h" 2
# 21 "include/linux/stat.h"
struct kstat {
 u64 ino;
 dev_t dev;
 umode_t mode;
 unsigned int nlink;
 kuid_t uid;
 kgid_t gid;
 dev_t rdev;
 loff_t size;
 struct timespec atime;
 struct timespec mtime;
 struct timespec ctime;
 unsigned long blksize;
 unsigned long long blocks;
};
# 11 "include/linux/fs.h" 2


# 1 "include/linux/list_lru.h" 1
# 12 "include/linux/list_lru.h"
# 1 "include/linux/shrinker.h" 1
# 11 "include/linux/shrinker.h"
struct shrink_control {
 gfp_t gfp_mask;






 unsigned long nr_to_scan;


 int nid;


 struct mem_cgroup *memcg;
};
# 49 "include/linux/shrinker.h"
struct shrinker {
 unsigned long (*count_objects)(struct shrinker *,
           struct shrink_control *sc);
 unsigned long (*scan_objects)(struct shrinker *,
          struct shrink_control *sc);

 int seeks;
 long batch;
 unsigned long flags;


 struct list_head list;

 atomic_long_t *nr_deferred;
};






extern int register_shrinker(struct shrinker *);
extern void unregister_shrinker(struct shrinker *);
# 13 "include/linux/list_lru.h" 2

struct mem_cgroup;


enum lru_status {
 LRU_REMOVED,
 LRU_REMOVED_RETRY,

 LRU_ROTATE,
 LRU_SKIP,
 LRU_RETRY,

};

struct list_lru_one {
 struct list_head list;

 long nr_items;
};

struct list_lru_memcg {

 struct list_lru_one *lru[0];
};

struct list_lru_node {

 spinlock_t lock;

 struct list_lru_one lru;




} __attribute__((__aligned__((1 << 6))));

struct list_lru {
 struct list_lru_node *node;



};

void list_lru_destroy(struct list_lru *lru);
int __list_lru_init(struct list_lru *lru, bool memcg_aware,
      struct lock_class_key *key);





int memcg_update_all_list_lrus(int num_memcgs);
void memcg_drain_all_list_lrus(int src_idx, int dst_idx);
# 83 "include/linux/list_lru.h"
bool list_lru_add(struct list_lru *lru, struct list_head *item);
# 96 "include/linux/list_lru.h"
bool list_lru_del(struct list_lru *lru, struct list_head *item);
# 108 "include/linux/list_lru.h"
unsigned long list_lru_count_one(struct list_lru *lru,
     int nid, struct mem_cgroup *memcg);
unsigned long list_lru_count_node(struct list_lru *lru, int nid);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long list_lru_shrink_count(struct list_lru *lru,
        struct shrink_control *sc)
{
 return list_lru_count_one(lru, sc->nid, sc->memcg);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long list_lru_count(struct list_lru *lru)
{
 long count = 0;
 int nid;

 for (((nid)) = __first_node(&(node_states[N_NORMAL_MEMORY])); ((nid)) < (1 << 4); ((nid)) = __next_node((((nid))), &((node_states[N_NORMAL_MEMORY]))))
  count += list_lru_count_node(lru, nid);

 return count;
}

void list_lru_isolate(struct list_lru_one *list, struct list_head *item);
void list_lru_isolate_move(struct list_lru_one *list, struct list_head *item,
      struct list_head *head);

typedef enum lru_status (*list_lru_walk_cb)(struct list_head *item,
  struct list_lru_one *list, spinlock_t *lock, void *cb_arg);
# 158 "include/linux/list_lru.h"
unsigned long list_lru_walk_one(struct list_lru *lru,
    int nid, struct mem_cgroup *memcg,
    list_lru_walk_cb isolate, void *cb_arg,
    unsigned long *nr_to_walk);
unsigned long list_lru_walk_node(struct list_lru *lru, int nid,
     list_lru_walk_cb isolate, void *cb_arg,
     unsigned long *nr_to_walk);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
list_lru_shrink_walk(struct list_lru *lru, struct shrink_control *sc,
       list_lru_walk_cb isolate, void *cb_arg)
{
 return list_lru_walk_one(lru, sc->nid, sc->memcg, isolate, cb_arg,
     &sc->nr_to_scan);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
list_lru_walk(struct list_lru *lru, list_lru_walk_cb isolate,
       void *cb_arg, unsigned long nr_to_walk)
{
 long isolated = 0;
 int nid;

 for (((nid)) = __first_node(&(node_states[N_NORMAL_MEMORY])); ((nid)) < (1 << 4); ((nid)) = __next_node((((nid))), &((node_states[N_NORMAL_MEMORY])))) {
  isolated += list_lru_walk_node(lru, nid, isolate,
            cb_arg, &nr_to_walk);
  if (nr_to_walk <= 0)
   break;
 }
 return isolated;
}
# 14 "include/linux/fs.h" 2

# 1 "include/linux/radix-tree.h" 1
# 54 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int radix_tree_is_indirect_ptr(void *ptr)
{
 return (int)((unsigned long)ptr & 1);
}
# 87 "include/linux/radix-tree.h"
struct radix_tree_node {
 unsigned int path;
 unsigned int count;
 union {
  struct {

   struct radix_tree_node *parent;

   void *private_data;
  };

  struct callback_head callback_head;
 };

 struct list_head private_list;
 void *slots[(1UL << (0 ? 4 : 6))];
 unsigned long tags[3][(((1UL << (0 ? 4 : 6)) + 64 - 1) / 64)];
};


struct radix_tree_root {
 unsigned int height;
 gfp_t gfp_mask;
 struct radix_tree_node *rnode;
};
# 194 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *radix_tree_deref_slot(void **pslot)
{
 return ({ typeof(*(*pslot)) *________p1 = (typeof(*(*pslot)) *)({ typeof((*pslot)) _________p1 = (*({ __attribute__((unused)) typeof((*pslot)) __var = ( typeof((*pslot))) 0; (volatile typeof((*pslot)) *)&((*pslot)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(*pslot)) *)(________p1)); });
}
# 209 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *radix_tree_deref_slot_protected(void **pslot,
       spinlock_t *treelock)
{
 return ({ do { } while (0); ; ((typeof(*(*pslot)) *)((*pslot))); });
}
# 222 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int radix_tree_deref_retry(void *arg)
{
 return __builtin_expect(!!((unsigned long)arg & 1), 0);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int radix_tree_exceptional_entry(void *arg)
{

 return (unsigned long)arg & 2;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int radix_tree_exception(void *arg)
{
 return __builtin_expect(!!((unsigned long)arg & (1 | 2)), 0)
                                                           ;
}
# 257 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void radix_tree_replace_slot(void **pslot, void *item)
{
 do { if (__builtin_expect(!!(radix_tree_is_indirect_ptr(item)), 0)) do { do_BUG("include/linux/radix-tree.h", 259); __builtin_trap(); } while (0); } while (0);
 do { do { bool __cond = !((sizeof(*&*pslot) == sizeof(char) || sizeof(*&*pslot) == sizeof(short) || sizeof(*&*pslot) == sizeof(int) || sizeof(*&*pslot) == sizeof(long))); extern void __compiletime_assert_260(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_260(); do { } while (0); } while (0); __asm__ __volatile__("": : :"memory"); (*({ __attribute__((unused)) typeof(*&*pslot) __var = ( typeof(*&*pslot)) 0; (volatile typeof(*&*pslot) *)&(*&*pslot); })) = ((typeof(*(item)) *)(item)); } while (0);
}

int __radix_tree_create(struct radix_tree_root *root, unsigned long index,
   struct radix_tree_node **nodep, void ***slotp);
int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
void *__radix_tree_lookup(struct radix_tree_root *root, unsigned long index,
     struct radix_tree_node **nodep, void ***slotp);
void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long);
bool __radix_tree_delete_node(struct radix_tree_root *root,
         struct radix_tree_node *node);
void *radix_tree_delete_item(struct radix_tree_root *, unsigned long, void *);
void *radix_tree_delete(struct radix_tree_root *, unsigned long);
unsigned int
radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
   unsigned long first_index, unsigned int max_items);
unsigned int radix_tree_gang_lookup_slot(struct radix_tree_root *root,
   void ***results, unsigned long *indices,
   unsigned long first_index, unsigned int max_items);
int radix_tree_preload(gfp_t gfp_mask);
int radix_tree_maybe_preload(gfp_t gfp_mask);
void radix_tree_init(void);
void *radix_tree_tag_set(struct radix_tree_root *root,
   unsigned long index, unsigned int tag);
void *radix_tree_tag_clear(struct radix_tree_root *root,
   unsigned long index, unsigned int tag);
int radix_tree_tag_get(struct radix_tree_root *root,
   unsigned long index, unsigned int tag);
unsigned int
radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results,
  unsigned long first_index, unsigned int max_items,
  unsigned int tag);
unsigned int
radix_tree_gang_lookup_tag_slot(struct radix_tree_root *root, void ***results,
  unsigned long first_index, unsigned int max_items,
  unsigned int tag);
unsigned long radix_tree_range_tag_if_tagged(struct radix_tree_root *root,
  unsigned long *first_indexp, unsigned long last_index,
  unsigned long nr_to_tag,
  unsigned int fromtag, unsigned int totag);
int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag);
unsigned long radix_tree_locate_item(struct radix_tree_root *root, void *item);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void radix_tree_preload_end(void)
{
 __asm__ __volatile__("": : :"memory");
}
# 323 "include/linux/radix-tree.h"
struct radix_tree_iter {
 unsigned long index;
 unsigned long next_index;
 unsigned long tags;
};
# 340 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void **
radix_tree_iter_init(struct radix_tree_iter *iter, unsigned long start)
{
# 351 "include/linux/radix-tree.h"
 iter->index = 0;
 iter->next_index = start;
 return ((void *)0);
}
# 369 "include/linux/radix-tree.h"
void **radix_tree_next_chunk(struct radix_tree_root *root,
        struct radix_tree_iter *iter, unsigned flags);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) unsigned
radix_tree_chunk_size(struct radix_tree_iter *iter)
{
 return iter->next_index - iter->index;
}
# 395 "include/linux/radix-tree.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void **
radix_tree_next_slot(void **slot, struct radix_tree_iter *iter, unsigned flags)
{
 if (flags & 0x0100) {
  iter->tags >>= 1;
  if (__builtin_expect(!!(iter->tags & 1ul), 1)) {
   iter->index++;
   return slot + 1;
  }
  if (!(flags & 0x0200) && __builtin_expect(!!(iter->tags), 1)) {
   unsigned offset = __ffs(iter->tags);

   iter->tags >>= offset;
   iter->index += offset + 1;
   return slot + offset + 1;
  }
 } else {
  unsigned size = radix_tree_chunk_size(iter) - 1;

  while (size--) {
   slot++;
   iter->index++;
   if (__builtin_expect(!!(*slot), 1))
    return slot;
   if (flags & 0x0200) {

    iter->next_index = 0;
    break;
   }
  }
 }
 return ((void *)0);
}
# 16 "include/linux/fs.h" 2







# 1 "include/linux/semaphore.h" 1
# 16 "include/linux/semaphore.h"
struct semaphore {
 raw_spinlock_t lock;
 unsigned int count;
 struct list_head wait_list;
};
# 32 "include/linux/semaphore.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sema_init(struct semaphore *sem, int val)
{
 static struct lock_class_key __key;
 *sem = (struct semaphore) { .lock = (raw_spinlock_t) { .raw_lock = { 0 }, }, .count = val, .wait_list = { &((*sem).wait_list), &((*sem).wait_list) }, };
 do { (void)("semaphore->lock"); (void)(&__key); } while (0);
}

extern void down(struct semaphore *sem);
extern int __attribute__((warn_unused_result)) down_interruptible(struct semaphore *sem);
extern int __attribute__((warn_unused_result)) down_killable(struct semaphore *sem);
extern int __attribute__((warn_unused_result)) down_trylock(struct semaphore *sem);
extern int __attribute__((warn_unused_result)) down_timeout(struct semaphore *sem, long jiffies);
extern void up(struct semaphore *sem);
# 24 "include/linux/fs.h" 2
# 1 "./include/uapi/linux/fiemap.h" 1
# 16 "./include/uapi/linux/fiemap.h"
struct fiemap_extent {
 __u64 fe_logical;

 __u64 fe_physical;

 __u64 fe_length;
 __u64 fe_reserved64[2];
 __u32 fe_flags;
 __u32 fe_reserved[3];
};

struct fiemap {
 __u64 fm_start;

 __u64 fm_length;

 __u32 fm_flags;
 __u32 fm_mapped_extents;
 __u32 fm_extent_count;
 __u32 fm_reserved;
 struct fiemap_extent fm_extents[0];
};
# 25 "include/linux/fs.h" 2



# 1 "include/linux/migrate_mode.h" 1
# 10 "include/linux/migrate_mode.h"
enum migrate_mode {
 MIGRATE_ASYNC,
 MIGRATE_SYNC_LIGHT,
 MIGRATE_SYNC,
};
# 29 "include/linux/fs.h" 2


# 1 "include/linux/percpu-rwsem.h" 1
# 10 "include/linux/percpu-rwsem.h"
struct percpu_rw_semaphore {
 unsigned int *fast_read_ctr;
 atomic_t write_ctr;
 struct rw_semaphore rw_sem;
 atomic_t slow_read_ctr;
 wait_queue_head_t write_waitq;
};

extern void percpu_down_read(struct percpu_rw_semaphore *);
extern void percpu_up_read(struct percpu_rw_semaphore *);

extern void percpu_down_write(struct percpu_rw_semaphore *);
extern void percpu_up_write(struct percpu_rw_semaphore *);

extern int __percpu_init_rwsem(struct percpu_rw_semaphore *,
    const char *, struct lock_class_key *);
extern void percpu_free_rwsem(struct percpu_rw_semaphore *);
# 32 "include/linux/fs.h" 2
# 1 "include/linux/blk_types.h" 1
# 10 "include/linux/blk_types.h"
struct bio_set;
struct bio;
struct bio_integrity_payload;
struct page;
struct block_device;
struct io_context;
struct cgroup_subsys_state;
typedef void (bio_end_io_t) (struct bio *, int);
typedef void (bio_destructor_t) (struct bio *);




struct bio_vec {
 struct page *bv_page;
 unsigned int bv_len;
 unsigned int bv_offset;
};



struct bvec_iter {
 sector_t bi_sector;

 unsigned int bi_size;

 unsigned int bi_idx;

 unsigned int bi_bvec_done;

};





struct bio {
 struct bio *bi_next;
 struct block_device *bi_bdev;
 unsigned long bi_flags;
 unsigned long bi_rw;



 struct bvec_iter bi_iter;




 unsigned int bi_phys_segments;





 unsigned int bi_seg_front_size;
 unsigned int bi_seg_back_size;

 atomic_t bi_remaining;

 bio_end_io_t *bi_end_io;

 void *bi_private;
# 81 "include/linux/blk_types.h"
 union {



 };

 unsigned short bi_vcnt;





 unsigned short bi_max_vecs;

 atomic_t bi_cnt;

 struct bio_vec *bi_io_vec;

 struct bio_set *bi_pool;






 struct bio_vec bi_inline_vecs[0];
};
# 150 "include/linux/blk_types.h"
enum rq_flag_bits {

 __REQ_WRITE,
 __REQ_FAILFAST_DEV,
 __REQ_FAILFAST_TRANSPORT,
 __REQ_FAILFAST_DRIVER,

 __REQ_SYNC,
 __REQ_META,
 __REQ_PRIO,
 __REQ_DISCARD,
 __REQ_SECURE,
 __REQ_WRITE_SAME,

 __REQ_NOIDLE,
 __REQ_INTEGRITY,
 __REQ_FUA,
 __REQ_FLUSH,


 __REQ_RAHEAD,
 __REQ_THROTTLED,



 __REQ_SORTED,
 __REQ_SOFTBARRIER,
 __REQ_NOMERGE,
 __REQ_STARTED,
 __REQ_DONTPREP,
 __REQ_QUEUED,
 __REQ_ELVPRIV,
 __REQ_FAILED,
 __REQ_QUIET,
 __REQ_PREEMPT,
 __REQ_ALLOCED,
 __REQ_COPY_USER,
 __REQ_FLUSH_SEQ,
 __REQ_IO_STAT,
 __REQ_MIXED_MERGE,
 __REQ_PM,
 __REQ_HASHED,
 __REQ_MQ_INFLIGHT,
 __REQ_NO_TIMEOUT,
 __REQ_NR_BITS,
};
# 33 "include/linux/fs.h" 2


# 1 "include/uapi/linux/fs.h" 1
# 9 "include/uapi/linux/fs.h"
# 1 "./include/uapi/linux/limits.h" 1
# 10 "include/uapi/linux/fs.h" 2
# 42 "include/uapi/linux/fs.h"
struct fstrim_range {
 __u64 start;
 __u64 len;
 __u64 minlen;
};


struct files_stat_struct {
 unsigned long nr_files;
 unsigned long nr_free_files;
 unsigned long max_files;
};

struct inodes_stat_t {
 long nr_inodes;
 long nr_unused;
 long dummy[5];
};
# 36 "include/linux/fs.h" 2

struct backing_dev_info;
struct export_operations;
struct hd_geometry;
struct iovec;
struct nameidata;
struct kiocb;
struct kobject;
struct pipe_inode_info;
struct poll_table_struct;
struct kstatfs;
struct vm_area_struct;
struct vfsmount;
struct cred;
struct swap_info_struct;
struct seq_file;
struct workqueue_struct;
struct iov_iter;
struct vm_fault;

extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) inode_init(void);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) inode_init_early(void);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) files_init(unsigned long);

extern struct files_stat_struct files_stat;
extern unsigned long get_max_files(void);
extern int sysctl_nr_open;
extern struct inodes_stat_t inodes_stat;
extern int leases_enable, lease_break_time;
extern int sysctl_protected_symlinks;
extern int sysctl_protected_hardlinks;

struct buffer_head;
typedef int (get_block_t)(struct inode *inode, sector_t iblock,
   struct buffer_head *bh_result, int create);
typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
   ssize_t bytes, void *private);
# 244 "include/linux/fs.h"
struct iattr {
 unsigned int ia_valid;
 umode_t ia_mode;
 kuid_t ia_uid;
 kgid_t ia_gid;
 loff_t ia_size;
 struct timespec ia_atime;
 struct timespec ia_mtime;
 struct timespec ia_ctime;






 struct file *ia_file;
};




# 1 "include/linux/quota.h" 1
# 42 "include/linux/quota.h"
# 1 "./include/uapi/linux/dqblk_xfs.h" 1
# 51 "./include/uapi/linux/dqblk_xfs.h"
typedef struct fs_disk_quota {
 __s8 d_version;
 __s8 d_flags;
 __u16 d_fieldmask;
 __u32 d_id;
 __u64 d_blk_hardlimit;
 __u64 d_blk_softlimit;
 __u64 d_ino_hardlimit;
 __u64 d_ino_softlimit;
 __u64 d_bcount;
 __u64 d_icount;
 __s32 d_itimer;

 __s32 d_btimer;
 __u16 d_iwarns;
 __u16 d_bwarns;
 __s32 d_padding2;
 __u64 d_rtb_hardlimit;
 __u64 d_rtb_softlimit;
 __u64 d_rtbcount;
 __s32 d_rtbtimer;
 __u16 d_rtbwarns;
 __s16 d_padding3;
 char d_padding4[8];
} fs_disk_quota_t;
# 147 "./include/uapi/linux/dqblk_xfs.h"
typedef struct fs_qfilestat {
 __u64 qfs_ino;
 __u64 qfs_nblks;
 __u32 qfs_nextents;
} fs_qfilestat_t;

typedef struct fs_quota_stat {
 __s8 qs_version;
 __u16 qs_flags;
 __s8 qs_pad;
 fs_qfilestat_t qs_uquota;
 fs_qfilestat_t qs_gquota;
 __u32 qs_incoredqs;
 __s32 qs_btimelimit;
 __s32 qs_itimelimit;
 __s32 qs_rtbtimelimit;
 __u16 qs_bwarnlimit;
 __u16 qs_iwarnlimit;
} fs_quota_stat_t;
# 190 "./include/uapi/linux/dqblk_xfs.h"
struct fs_qfilestatv {
 __u64 qfs_ino;
 __u64 qfs_nblks;
 __u32 qfs_nextents;
 __u32 qfs_pad;
};

struct fs_quota_statv {
 __s8 qs_version;
 __u8 qs_pad1;
 __u16 qs_flags;
 __u32 qs_incoredqs;
 struct fs_qfilestatv qs_uquota;
 struct fs_qfilestatv qs_gquota;
 struct fs_qfilestatv qs_pquota;
 __s32 qs_btimelimit;
 __s32 qs_itimelimit;
 __s32 qs_rtbtimelimit;
 __u16 qs_bwarnlimit;
 __u16 qs_iwarnlimit;
 __u64 qs_pad2[8];
};
# 43 "include/linux/quota.h" 2
# 1 "include/linux/dqblk_v1.h" 1
# 44 "include/linux/quota.h" 2
# 1 "include/linux/dqblk_v2.h" 1







# 1 "include/linux/dqblk_qtree.h" 1
# 17 "include/linux/dqblk_qtree.h"
struct dquot;


struct qtree_fmt_operations {
 void (*mem2disk_dqblk)(void *disk, struct dquot *dquot);
 void (*disk2mem_dqblk)(struct dquot *dquot, void *disk);
 int (*is_id)(void *disk, struct dquot *dquot);
};


struct qtree_mem_dqinfo {
 struct super_block *dqi_sb;
 int dqi_type;
 unsigned int dqi_blocks;
 unsigned int dqi_free_blk;
 unsigned int dqi_free_entry;
 unsigned int dqi_blocksize_bits;
 unsigned int dqi_entry_size;
 unsigned int dqi_usable_bs;
 unsigned int dqi_qtree_depth;
 struct qtree_fmt_operations *dqi_ops;
};

int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
int qtree_entry_unused(struct qtree_mem_dqinfo *info, char *disk);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int qtree_depth(struct qtree_mem_dqinfo *info)
{
 unsigned int epb = info->dqi_usable_bs >> 2;
 unsigned long long entries = epb;
 int i;

 for (i = 1; entries < (1ULL << 32); i++)
  entries *= epb;
 return i;
}
# 9 "include/linux/dqblk_v2.h" 2
# 45 "include/linux/quota.h" 2



# 1 "include/linux/projid.h" 1
# 16 "include/linux/projid.h"
struct user_namespace;
extern struct user_namespace init_user_ns;

typedef __kernel_uid32_t projid_t;

typedef struct {
 projid_t val;
} kprojid_t;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) projid_t __kprojid_val(kprojid_t projid)
{
 return projid.val;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool projid_eq(kprojid_t left, kprojid_t right)
{
 return __kprojid_val(left) == __kprojid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool projid_lt(kprojid_t left, kprojid_t right)
{
 return __kprojid_val(left) < __kprojid_val(right);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool projid_valid(kprojid_t projid)
{
 return !projid_eq(projid, (kprojid_t){ -1 });
}
# 64 "include/linux/projid.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kprojid_t make_kprojid(struct user_namespace *from, projid_t projid)
{
 return (kprojid_t){ projid };
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) projid_t from_kprojid(struct user_namespace *to, kprojid_t kprojid)
{
 return __kprojid_val(kprojid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) projid_t from_kprojid_munged(struct user_namespace *to, kprojid_t kprojid)
{
 projid_t projid = from_kprojid(to, kprojid);
 if (projid == (projid_t)-1)
  projid = 65534;
 return projid;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kprojid_has_mapping(struct user_namespace *ns, kprojid_t projid)
{
 return true;
}
# 49 "include/linux/quota.h" 2
# 1 "include/uapi/linux/quota.h" 1
# 88 "include/uapi/linux/quota.h"
enum {
 QIF_BLIMITS_B = 0,
 QIF_SPACE_B,
 QIF_ILIMITS_B,
 QIF_INODES_B,
 QIF_BTIME_B,
 QIF_ITIME_B,
};
# 108 "include/uapi/linux/quota.h"
struct if_dqblk {
 __u64 dqb_bhardlimit;
 __u64 dqb_bsoftlimit;
 __u64 dqb_curspace;
 __u64 dqb_ihardlimit;
 __u64 dqb_isoftlimit;
 __u64 dqb_curinodes;
 __u64 dqb_btime;
 __u64 dqb_itime;
 __u32 dqb_valid;
};
# 129 "include/uapi/linux/quota.h"
enum {
 DQF_ROOT_SQUASH_B = 0,
 DQF_SYS_FILE_B = 16,

 DQF_PRIVATE
};






struct if_dqinfo {
 __u64 dqi_bgrace;
 __u64 dqi_igrace;
 __u32 dqi_flags;
 __u32 dqi_valid;
};
# 163 "include/uapi/linux/quota.h"
enum {
 QUOTA_NL_C_UNSPEC,
 QUOTA_NL_C_WARNING,
 __QUOTA_NL_C_MAX,
};


enum {
 QUOTA_NL_A_UNSPEC,
 QUOTA_NL_A_QTYPE,
 QUOTA_NL_A_EXCESS_ID,
 QUOTA_NL_A_WARNING,
 QUOTA_NL_A_DEV_MAJOR,
 QUOTA_NL_A_DEV_MINOR,
 QUOTA_NL_A_CAUSED_ID,
 __QUOTA_NL_A_MAX,
};
# 50 "include/linux/quota.h" 2



enum quota_type {
 USRQUOTA = 0,
 GRPQUOTA = 1,
 PRJQUOTA = 2,
};






typedef __kernel_uid32_t qid_t;
typedef long long qsize_t;

struct kqid {
 union {
  kuid_t uid;
  kgid_t gid;
  kprojid_t projid;
 };
 enum quota_type type;
};

extern bool qid_eq(struct kqid left, struct kqid right);
extern bool qid_lt(struct kqid left, struct kqid right);
extern qid_t from_kqid(struct user_namespace *to, struct kqid qid);
extern qid_t from_kqid_munged(struct user_namespace *to, struct kqid qid);
extern bool qid_valid(struct kqid qid);
# 96 "include/linux/quota.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid(struct user_namespace *from,
        enum quota_type type, qid_t qid)
{
 struct kqid kqid;

 kqid.type = type;
 switch (type) {
 case USRQUOTA:
  kqid.uid = make_kuid(from, qid);
  break;
 case GRPQUOTA:
  kqid.gid = make_kgid(from, qid);
  break;
 case PRJQUOTA:
  kqid.projid = make_kprojid(from, qid);
  break;
 default:
  do { do_BUG("include/linux/quota.h", 113); __builtin_trap(); } while (0);
 }
 return kqid;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid_invalid(enum quota_type type)
{
 struct kqid kqid;

 kqid.type = type;
 switch (type) {
 case USRQUOTA:
  kqid.uid = (kuid_t){ -1 };
  break;
 case GRPQUOTA:
  kqid.gid = (kgid_t){ -1 };
  break;
 case PRJQUOTA:
  kqid.projid = (kprojid_t){ -1 };
  break;
 default:
  do { do_BUG("include/linux/quota.h", 140); __builtin_trap(); } while (0);
 }
 return kqid;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid_uid(kuid_t uid)
{
 struct kqid kqid;
 kqid.type = USRQUOTA;
 kqid.uid = uid;
 return kqid;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid_gid(kgid_t gid)
{
 struct kqid kqid;
 kqid.type = GRPQUOTA;
 kqid.gid = gid;
 return kqid;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid_projid(kprojid_t projid)
{
 struct kqid kqid;
 kqid.type = PRJQUOTA;
 kqid.projid = projid;
 return kqid;
}


extern spinlock_t dq_data_lock;
# 194 "include/linux/quota.h"
struct mem_dqblk {
 qsize_t dqb_bhardlimit;
 qsize_t dqb_bsoftlimit;
 qsize_t dqb_curspace;
 qsize_t dqb_rsvspace;
 qsize_t dqb_ihardlimit;
 qsize_t dqb_isoftlimit;
 qsize_t dqb_curinodes;
 time_t dqb_btime;
 time_t dqb_itime;
};




struct quota_format_type;

struct mem_dqinfo {
 struct quota_format_type *dqi_format;
 int dqi_fmt_id;

 struct list_head dqi_dirty_list;
 unsigned long dqi_flags;
 unsigned int dqi_bgrace;
 unsigned int dqi_igrace;
 qsize_t dqi_max_spc_limit;
 qsize_t dqi_max_ino_limit;
 void *dqi_priv;
};

struct super_block;






enum {
 DQF_INFO_DIRTY_B = DQF_PRIVATE,
};


extern void mark_info_dirty(struct super_block *sb, int type);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int info_dirty(struct mem_dqinfo *info)
{
 return test_bit(DQF_INFO_DIRTY_B, &info->dqi_flags);
}

enum {
 DQST_LOOKUPS,
 DQST_DROPS,
 DQST_READS,
 DQST_WRITES,
 DQST_CACHE_HITS,
 DQST_ALLOC_DQUOTS,
 DQST_FREE_DQUOTS,
 DQST_SYNCS,
 _DQST_DQSTAT_LAST
};

struct dqstats {
 int stat[_DQST_DQSTAT_LAST];
 struct percpu_counter counter[_DQST_DQSTAT_LAST];
};

extern struct dqstats *dqstats_pcpu;
extern struct dqstats dqstats;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dqstats_inc(unsigned int type)
{
 percpu_counter_inc(&dqstats.counter[type]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dqstats_dec(unsigned int type)
{
 percpu_counter_dec(&dqstats.counter[type]);
}
# 284 "include/linux/quota.h"
struct dquot {
 struct hlist_node dq_hash;
 struct list_head dq_inuse;
 struct list_head dq_free;
 struct list_head dq_dirty;
 struct mutex dq_lock;
 atomic_t dq_count;
 wait_queue_head_t dq_wait_unused;
 struct super_block *dq_sb;
 struct kqid dq_id;
 loff_t dq_off;
 unsigned long dq_flags;
 struct mem_dqblk dq_dqb;
};


struct quota_format_ops {
 int (*check_quota_file)(struct super_block *sb, int type);
 int (*read_file_info)(struct super_block *sb, int type);
 int (*write_file_info)(struct super_block *sb, int type);
 int (*free_file_info)(struct super_block *sb, int type);
 int (*read_dqblk)(struct dquot *dquot);
 int (*commit_dqblk)(struct dquot *dquot);
 int (*release_dqblk)(struct dquot *dquot);
};


struct dquot_operations {
 int (*write_dquot) (struct dquot *);
 struct dquot *(*alloc_dquot)(struct super_block *, int);
 void (*destroy_dquot)(struct dquot *);
 int (*acquire_dquot) (struct dquot *);
 int (*release_dquot) (struct dquot *);
 int (*mark_dirty) (struct dquot *);
 int (*write_info) (struct super_block *, int);


 qsize_t *(*get_reserved_space) (struct inode *);
};

struct path;


struct qc_dqblk {
 int d_fieldmask;
 u64 d_spc_hardlimit;
 u64 d_spc_softlimit;
 u64 d_ino_hardlimit;
 u64 d_ino_softlimit;
 u64 d_space;
 u64 d_ino_count;
 s64 d_ino_timer;

 s64 d_spc_timer;
 int d_ino_warns;
 int d_spc_warns;
 u64 d_rt_spc_hardlimit;
 u64 d_rt_spc_softlimit;
 u64 d_rt_space;
 s64 d_rt_spc_timer;
 int d_rt_spc_warns;
};
# 370 "include/linux/quota.h"
struct quotactl_ops {
 int (*quota_on)(struct super_block *, int, int, struct path *);
 int (*quota_off)(struct super_block *, int);
 int (*quota_enable)(struct super_block *, unsigned int);
 int (*quota_disable)(struct super_block *, unsigned int);
 int (*quota_sync)(struct super_block *, int);
 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
 int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *);
 int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *);
 int (*get_xstate)(struct super_block *, struct fs_quota_stat *);
 int (*get_xstatev)(struct super_block *, struct fs_quota_statv *);
 int (*rm_xquota)(struct super_block *, unsigned int);
};

struct quota_format_type {
 int qf_fmt_id;
 const struct quota_format_ops *qf_ops;
 struct module *qf_owner;
 struct quota_format_type *qf_next;
};


enum {
 _DQUOT_USAGE_ENABLED = 0,
 _DQUOT_LIMITS_ENABLED,
 _DQUOT_SUSPENDED,


 _DQUOT_STATE_FLAGS
};
# 418 "include/linux/quota.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int dquot_state_flag(unsigned int flags, int type)
{
 return flags << _DQUOT_STATE_FLAGS * type;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int dquot_generic_flag(unsigned int flags, int type)
{
 return (flags >> _DQUOT_STATE_FLAGS * type) & ((1 << _DQUOT_USAGE_ENABLED) | (1 << _DQUOT_LIMITS_ENABLED) | (1 << _DQUOT_SUSPENDED));
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void quota_send_warning(struct kqid qid, dev_t dev,
          const char warntype)
{
 return;
}


struct quota_info {
 unsigned int flags;
 struct mutex dqio_mutex;
 struct mutex dqonoff_mutex;
 struct inode *files[2];
 struct mem_dqinfo info[2];
 const struct quota_format_ops *ops[2];
};

int register_quota_format(struct quota_format_type *fmt);
void unregister_quota_format(struct quota_format_type *fmt);

struct quota_module_name {
 int qm_fmt_id;
 char *qm_mod_name;
};
# 266 "include/linux/fs.h" 2
# 299 "include/linux/fs.h"
enum positive_aop_returns {
 AOP_WRITEPAGE_ACTIVATE = 0x80000,
 AOP_TRUNCATED_PAGE = 0x80001,
};
# 313 "include/linux/fs.h"
struct page;
struct address_space;
struct writeback_control;
# 326 "include/linux/fs.h"
typedef struct {
 size_t written;
 size_t count;
 union {
  char *buf;
  void *data;
 } arg;
 int error;
} read_descriptor_t;

typedef int (*read_actor_t)(read_descriptor_t *, struct page *,
  unsigned long, unsigned long);

struct address_space_operations {
 int (*writepage)(struct page *page, struct writeback_control *wbc);
 int (*readpage)(struct file *, struct page *);


 int (*writepages)(struct address_space *, struct writeback_control *);


 int (*set_page_dirty)(struct page *page);

 int (*readpages)(struct file *filp, struct address_space *mapping,
   struct list_head *pages, unsigned nr_pages);

 int (*write_begin)(struct file *, struct address_space *mapping,
    loff_t pos, unsigned len, unsigned flags,
    struct page **pagep, void **fsdata);
 int (*write_end)(struct file *, struct address_space *mapping,
    loff_t pos, unsigned len, unsigned copied,
    struct page *page, void *fsdata);


 sector_t (*bmap)(struct address_space *, sector_t);
 void (*invalidatepage) (struct page *, unsigned int, unsigned int);
 int (*releasepage) (struct page *, gfp_t);
 void (*freepage)(struct page *);
 ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset);




 int (*migratepage) (struct address_space *,
   struct page *, struct page *, enum migrate_mode);
 int (*launder_page) (struct page *);
 int (*is_partially_uptodate) (struct page *, unsigned long,
     unsigned long);
 void (*is_dirty_writeback) (struct page *, bool *, bool *);
 int (*error_remove_page)(struct address_space *, struct page *);


 int (*swap_activate)(struct swap_info_struct *sis, struct file *file,
    sector_t *span);
 void (*swap_deactivate)(struct file *file);
};

extern const struct address_space_operations empty_aops;





int pagecache_write_begin(struct file *, struct address_space *mapping,
    loff_t pos, unsigned len, unsigned flags,
    struct page **pagep, void **fsdata);

int pagecache_write_end(struct file *, struct address_space *mapping,
    loff_t pos, unsigned len, unsigned copied,
    struct page *page, void *fsdata);

struct address_space {
 struct inode *host;
 struct radix_tree_root page_tree;
 spinlock_t tree_lock;
 atomic_t i_mmap_writable;
 struct rb_root i_mmap;
 struct rw_semaphore i_mmap_rwsem;

 unsigned long nrpages;
 unsigned long nrshadows;
 unsigned long writeback_index;
 const struct address_space_operations *a_ops;
 unsigned long flags;
 spinlock_t private_lock;
 struct list_head private_list;
 void *private_data;
} __attribute__((aligned(sizeof(long))));





struct request_queue;

struct block_device {
 dev_t bd_dev;
 int bd_openers;
 struct inode * bd_inode;
 struct super_block * bd_super;
 struct mutex bd_mutex;
 struct list_head bd_inodes;
 void * bd_claiming;
 void * bd_holder;
 int bd_holders;
 bool bd_write_holder;

 struct list_head bd_holder_disks;

 struct block_device * bd_contains;
 unsigned bd_block_size;
 struct hd_struct * bd_part;

 unsigned bd_part_count;
 int bd_invalidated;
 struct gendisk * bd_disk;
 struct request_queue * bd_queue;
 struct list_head bd_list;






 unsigned long bd_private;


 int bd_fsfreeze_count;

 struct mutex bd_fsfreeze_mutex;
};
# 466 "include/linux/fs.h"
int mapping_tagged(struct address_space *mapping, int tag);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_mmap_lock_write(struct address_space *mapping)
{
 down_write(&mapping->i_mmap_rwsem);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_mmap_unlock_write(struct address_space *mapping)
{
 up_write(&mapping->i_mmap_rwsem);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_mmap_lock_read(struct address_space *mapping)
{
 down_read(&mapping->i_mmap_rwsem);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_mmap_unlock_read(struct address_space *mapping)
{
 up_read(&mapping->i_mmap_rwsem);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mapping_mapped(struct address_space *mapping)
{
 return !((&mapping->i_mmap)->rb_node == ((void *)0));
}
# 505 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mapping_writably_mapped(struct address_space *mapping)
{
 return (*({ __attribute__((unused)) typeof((&mapping->i_mmap_writable)->counter) __var = ( typeof((&mapping->i_mmap_writable)->counter)) 0; (volatile typeof((&mapping->i_mmap_writable)->counter) *)&((&mapping->i_mmap_writable)->counter); })) > 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mapping_map_writable(struct address_space *mapping)
{
 return atomic_inc_unless_negative(&mapping->i_mmap_writable) ?
  0 : -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mapping_unmap_writable(struct address_space *mapping)
{
 atomic_sub(1, &mapping->i_mmap_writable);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mapping_deny_writable(struct address_space *mapping)
{
 return atomic_dec_unless_positive(&mapping->i_mmap_writable) ?
  0 : -16;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mapping_allow_writable(struct address_space *mapping)
{
 atomic_add(1, &mapping->i_mmap_writable);
}
# 543 "include/linux/fs.h"
struct posix_acl;
# 555 "include/linux/fs.h"
struct inode {
 umode_t i_mode;
 unsigned short i_opflags;
 kuid_t i_uid;
 kgid_t i_gid;
 unsigned int i_flags;


 struct posix_acl *i_acl;
 struct posix_acl *i_default_acl;


 const struct inode_operations *i_op;
 struct super_block *i_sb;
 struct address_space *i_mapping;






 unsigned long i_ino;







 union {
  const unsigned int i_nlink;
  unsigned int __i_nlink;
 };
 dev_t i_rdev;
 loff_t i_size;
 struct timespec i_atime;
 struct timespec i_mtime;
 struct timespec i_ctime;
 spinlock_t i_lock;
 unsigned short i_bytes;
 unsigned int i_blkbits;
 blkcnt_t i_blocks;






 unsigned long i_state;
 struct mutex i_mutex;

 unsigned long dirtied_when;

 struct hlist_node i_hash;
 struct list_head i_wb_list;
 struct list_head i_lru;
 struct list_head i_sb_list;
 union {
  struct hlist_head i_dentry;
  struct callback_head i_rcu;
 };
 u64 i_version;
 atomic_t i_count;
 atomic_t i_dio_count;
 atomic_t i_writecount;



 const struct file_operations *i_fop;
 struct file_lock_context *i_flctx;
 struct address_space i_data;
 struct list_head i_devices;
 union {
  struct pipe_inode_info *i_pipe;
  struct block_device *i_bdev;
  struct cdev *i_cdev;
 };

 __u32 i_generation;


 __u32 i_fsnotify_mask;
 struct hlist_head i_fsnotify_marks;


 void *i_private;
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inode_unhashed(struct inode *inode)
{
 return hlist_unhashed(&inode->i_hash);
}
# 664 "include/linux/fs.h"
enum inode_i_mutex_lock_class
{
 I_MUTEX_NORMAL,
 I_MUTEX_PARENT,
 I_MUTEX_CHILD,
 I_MUTEX_XATTR,
 I_MUTEX_NONDIR2,
 I_MUTEX_PARENT2,
};

void lock_two_nondirectories(struct inode *, struct inode*);
void unlock_two_nondirectories(struct inode *, struct inode*);
# 687 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) loff_t i_size_read(const struct inode *inode)
{
# 706 "include/linux/fs.h"
 return inode->i_size;

}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_size_write(struct inode *inode, loff_t i_size)
{
# 728 "include/linux/fs.h"
 inode->i_size = i_size;

}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) uid_t i_uid_read(const struct inode *inode)
{
 return from_kuid(&init_user_ns, inode->i_uid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gid_t i_gid_read(const struct inode *inode)
{
 return from_kgid(&init_user_ns, inode->i_gid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_uid_write(struct inode *inode, uid_t uid)
{
 inode->i_uid = make_kuid(&init_user_ns, uid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_gid_write(struct inode *inode, gid_t gid)
{
 inode->i_gid = make_kgid(&init_user_ns, gid);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned iminor(const struct inode *inode)
{
 return ((unsigned int) ((inode->i_rdev) & ((1U << 20) - 1)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned imajor(const struct inode *inode)
{
 return ((unsigned int) ((inode->i_rdev) >> 20));
}

extern struct block_device *I_BDEV(struct inode *inode);

struct fown_struct {
 rwlock_t lock;
 struct pid *pid;
 enum pid_type pid_type;
 kuid_t uid, euid;
 int signum;
};




struct file_ra_state {
 unsigned long start;
 unsigned int size;
 unsigned int async_size;


 unsigned int ra_pages;
 unsigned int mmap_miss;
 loff_t prev_pos;
};




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ra_has_index(struct file_ra_state *ra, unsigned long index)
{
 return (index >= ra->start &&
  index < ra->start + ra->size);
}

struct file {
 union {
  struct llist_node fu_llist;
  struct callback_head fu_rcuhead;
 } f_u;
 struct path f_path;
 struct inode *f_inode;
 const struct file_operations *f_op;





 spinlock_t f_lock;
 atomic_long_t f_count;
 unsigned int f_flags;
 fmode_t f_mode;
 struct mutex f_pos_lock;
 loff_t f_pos;
 struct fown_struct f_owner;
 const struct cred *f_cred;
 struct file_ra_state f_ra;

 u64 f_version;




 void *private_data;



 struct list_head f_ep_links;
 struct list_head f_tfile_llink;

 struct address_space *f_mapping;
} __attribute__((aligned(4)));

struct file_handle {
 __u32 handle_bytes;
 int handle_type;

 unsigned char f_handle[0];
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct file *get_file(struct file *f)
{
 atomic_long_inc(&f->f_count);
 return f;
}
# 883 "include/linux/fs.h"
typedef void *fl_owner_t;

struct file_lock;

struct file_lock_operations {
 void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
 void (*fl_release_private)(struct file_lock *);
};

struct lock_manager_operations {
 int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
 unsigned long (*lm_owner_key)(struct file_lock *);
 void (*lm_get_owner)(struct file_lock *, struct file_lock *);
 void (*lm_put_owner)(struct file_lock *);
 void (*lm_notify)(struct file_lock *);
 int (*lm_grant)(struct file_lock *, int);
 bool (*lm_break)(struct file_lock *);
 int (*lm_change)(struct file_lock *, int, struct list_head *);
 void (*lm_setup)(struct file_lock *, void **);
};

struct lock_manager {
 struct list_head list;
};

struct net;
void locks_start_grace(struct net *, struct lock_manager *);
void locks_end_grace(struct lock_manager *);
int locks_in_grace(struct net *);


# 1 "include/linux/nfs_fs_i.h" 1



struct nlm_lockowner;




struct nfs_lock_info {
 u32 state;
 struct nlm_lockowner *owner;
 struct list_head list;
};

struct nfs4_lock_state;
struct nfs4_lock_info {
 struct nfs4_lock_state *owner;
};
# 915 "include/linux/fs.h" 2
# 933 "include/linux/fs.h"
struct file_lock {
 struct file_lock *fl_next;
 struct list_head fl_list;
 struct hlist_node fl_link;
 struct list_head fl_block;
 fl_owner_t fl_owner;
 unsigned int fl_flags;
 unsigned char fl_type;
 unsigned int fl_pid;
 int fl_link_cpu;
 struct pid *fl_nspid;
 wait_queue_head_t fl_wait;
 struct file *fl_file;
 loff_t fl_start;
 loff_t fl_end;

 struct fasync_struct * fl_fasync;

 unsigned long fl_break_time;
 unsigned long fl_downgrade_time;

 const struct file_lock_operations *fl_ops;
 const struct lock_manager_operations *fl_lmops;
 union {
  struct nfs_lock_info nfs_fl;
  struct nfs4_lock_info nfs4_fl;
  struct {
   struct list_head link;
   int state;
  } afs;
 } fl_u;
};

struct file_lock_context {
 spinlock_t flc_lock;
 struct list_head flc_flock;
 struct list_head flc_posix;
 struct list_head flc_lease;
};
# 980 "include/linux/fs.h"
# 1 "include/linux/fcntl.h" 1



# 1 "include/uapi/linux/fcntl.h" 1



# 1 "./arch/sparc/include/uapi/asm/fcntl.h" 1
# 54 "./arch/sparc/include/uapi/asm/fcntl.h"
# 1 "./include/uapi/asm-generic/fcntl.h" 1
# 155 "./include/uapi/asm-generic/fcntl.h"
struct f_owner_ex {
 int type;
 __kernel_pid_t pid;
};
# 195 "./include/uapi/asm-generic/fcntl.h"
struct flock {
 short l_type;
 short l_whence;
 __kernel_off_t l_start;
 __kernel_off_t l_len;
 __kernel_pid_t l_pid;
 short __unused;
};







struct flock64 {
 short l_type;
 short l_whence;
 __kernel_loff_t l_start;
 __kernel_loff_t l_len;
 __kernel_pid_t l_pid;
 short __unused;
};
# 55 "./arch/sparc/include/uapi/asm/fcntl.h" 2
# 5 "include/uapi/linux/fcntl.h" 2
# 5 "include/linux/fcntl.h" 2
# 981 "include/linux/fs.h" 2

extern void send_sigio(struct fown_struct *fown, int fd, int band);


extern int fcntl_getlk(struct file *, unsigned int, struct flock *);
extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
   struct flock *);







extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
extern int fcntl_getlease(struct file *filp);


void locks_free_lock_context(struct file_lock_context *ctx);
void locks_free_lock(struct file_lock *fl);
extern void locks_init_lock(struct file_lock *);
extern struct file_lock * locks_alloc_lock(void);
extern void locks_copy_lock(struct file_lock *, struct file_lock *);
extern void locks_copy_conflock(struct file_lock *, struct file_lock *);
extern void locks_remove_posix(struct file *, fl_owner_t);
extern void locks_remove_file(struct file *);
extern void locks_release_private(struct file_lock *);
extern void posix_test_lock(struct file *, struct file_lock *);
extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
extern int posix_lock_file_wait(struct file *, struct file_lock *);
extern int posix_unblock_lock(struct file_lock *);
extern int vfs_test_lock(struct file *, struct file_lock *);
extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type);
extern void lease_get_mtime(struct inode *, struct timespec *time);
extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
extern int lease_modify(struct file_lock *, int, struct list_head *);
# 1160 "include/linux/fs.h"
struct fasync_struct {
 spinlock_t fa_lock;
 int magic;
 int fa_fd;
 struct fasync_struct *fa_next;
 struct file *fa_file;
 struct callback_head fa_rcu;
};




extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struct fasync_struct *);
extern int fasync_remove_entry(struct file *, struct fasync_struct **);
extern struct fasync_struct *fasync_alloc(void);
extern void fasync_free(struct fasync_struct *);


extern void kill_fasync(struct fasync_struct **, int, int);

extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
extern void f_setown(struct file *filp, unsigned long arg, int force);
extern void f_delown(struct file *filp);
extern pid_t f_getown(struct file *filp);
extern int send_sigurg(struct fown_struct *fown);

struct mm_struct;
# 1201 "include/linux/fs.h"
enum {
 SB_UNFROZEN = 0,
 SB_FREEZE_WRITE = 1,
 SB_FREEZE_PAGEFAULT = 2,
 SB_FREEZE_FS = 3,

 SB_FREEZE_COMPLETE = 4,
};



struct sb_writers {

 struct percpu_counter counter[(SB_FREEZE_COMPLETE - 1)];
 wait_queue_head_t wait;

 int frozen;
 wait_queue_head_t wait_unfrozen;




};

struct super_block {
 struct list_head s_list;
 dev_t s_dev;
 unsigned char s_blocksize_bits;
 unsigned long s_blocksize;
 loff_t s_maxbytes;
 struct file_system_type *s_type;
 const struct super_operations *s_op;
 const struct dquot_operations *dq_op;
 const struct quotactl_ops *s_qcop;
 const struct export_operations *s_export_op;
 unsigned long s_flags;
 unsigned long s_magic;
 struct dentry *s_root;
 struct rw_semaphore s_umount;
 int s_count;
 atomic_t s_active;



 const struct xattr_handler **s_xattr;

 struct list_head s_inodes;
 struct hlist_bl_head s_anon;
 struct list_head s_mounts;
 struct block_device *s_bdev;
 struct backing_dev_info *s_bdi;
 struct mtd_info *s_mtd;
 struct hlist_node s_instances;
 unsigned int s_quota_types;
 struct quota_info s_dquot;

 struct sb_writers s_writers;

 char s_id[32];
 u8 s_uuid[16];

 void *s_fs_info;
 unsigned int s_max_links;
 fmode_t s_mode;



 u32 s_time_gran;





 struct mutex s_vfs_rename_mutex;





 char *s_subtype;





 char *s_options;
 const struct dentry_operations *s_d_op;




 int cleancache_poolid;

 struct shrinker s_shrink;


 atomic_long_t s_remove_count;


 int s_readonly_remount;


 struct workqueue_struct *s_dio_done_wq;
 struct hlist_head s_pins;





 struct list_lru s_dentry_lru __attribute__((__aligned__((1 << 6))));
 struct list_lru s_inode_lru __attribute__((__aligned__((1 << 6))));
 struct callback_head rcu;




 int s_stack_depth;
};

extern struct timespec current_fs_time(struct super_block *sb);





void __sb_end_write(struct super_block *sb, int level);
int __sb_start_write(struct super_block *sb, int level, bool wait);
# 1336 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_end_write(struct super_block *sb)
{
 __sb_end_write(sb, SB_FREEZE_WRITE);
}
# 1348 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_end_pagefault(struct super_block *sb)
{
 __sb_end_write(sb, SB_FREEZE_PAGEFAULT);
}
# 1360 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_end_intwrite(struct super_block *sb)
{
 __sb_end_write(sb, SB_FREEZE_FS);
}
# 1384 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_start_write(struct super_block *sb)
{
 __sb_start_write(sb, SB_FREEZE_WRITE, true);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sb_start_write_trylock(struct super_block *sb)
{
 return __sb_start_write(sb, SB_FREEZE_WRITE, false);
}
# 1413 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_start_pagefault(struct super_block *sb)
{
 __sb_start_write(sb, SB_FREEZE_PAGEFAULT, true);
}
# 1431 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_start_intwrite(struct super_block *sb)
{
 __sb_start_write(sb, SB_FREEZE_FS, true);
}


extern bool inode_owner_or_capable(const struct inode *inode);




extern int vfs_create(struct inode *, struct dentry *, umode_t, bool);
extern int vfs_mkdir(struct inode *, struct dentry *, umode_t);
extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t);
extern int vfs_symlink(struct inode *, struct dentry *, const char *);
extern int vfs_link(struct dentry *, struct inode *, struct dentry *, struct inode **);
extern int vfs_rmdir(struct inode *, struct dentry *);
extern int vfs_unlink(struct inode *, struct dentry *, struct inode **);
extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *, struct inode **, unsigned int);
extern int vfs_whiteout(struct inode *, struct dentry *);




extern void dentry_unhash(struct dentry *dentry);




extern void inode_init_owner(struct inode *inode, const struct inode *dir,
   umode_t mode);



struct fiemap_extent_info {
 unsigned int fi_flags;
 unsigned int fi_extents_mapped;
 unsigned int fi_extents_max;
 struct fiemap_extent *fi_extents_start;

};
int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical,
       u64 phys, u64 len, u32 flags);
int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
# 1498 "include/linux/fs.h"
struct dir_context;
typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64,
    unsigned);

struct dir_context {
 const filldir_t actor;
 loff_t pos;
};

struct block_device_operations;
# 1535 "include/linux/fs.h"
struct iov_iter;

struct file_operations {
 struct module *owner;
 loff_t (*llseek) (struct file *, loff_t, int);
 ssize_t (*read) (struct file *, char *, size_t, loff_t *);
 ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
 ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
 ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
 ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
 int (*iterate) (struct file *, struct dir_context *);
 unsigned int (*poll) (struct file *, struct poll_table_struct *);
 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
 int (*mmap) (struct file *, struct vm_area_struct *);
 void (*mremap)(struct file *, struct vm_area_struct *);
 int (*open) (struct inode *, struct file *);
 int (*flush) (struct file *, fl_owner_t id);
 int (*release) (struct inode *, struct file *);
 int (*fsync) (struct file *, loff_t, loff_t, int datasync);
 int (*aio_fsync) (struct kiocb *, int datasync);
 int (*fasync) (int, struct file *, int);
 int (*lock) (struct file *, int, struct file_lock *);
 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
 int (*check_flags)(int);
 int (*flock) (struct file *, int, struct file_lock *);
 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
 int (*setlease)(struct file *, long, struct file_lock **, void **);
 long (*fallocate)(struct file *file, int mode, loff_t offset,
     loff_t len);
 void (*show_fdinfo)(struct seq_file *m, struct file *f);



};

struct inode_operations {
 struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
 void * (*follow_link) (struct dentry *, struct nameidata *);
 int (*permission) (struct inode *, int);
 struct posix_acl * (*get_acl)(struct inode *, int);

 int (*readlink) (struct dentry *, char *,int);
 void (*put_link) (struct dentry *, struct nameidata *, void *);

 int (*create) (struct inode *,struct dentry *, umode_t, bool);
 int (*link) (struct dentry *,struct inode *,struct dentry *);
 int (*unlink) (struct inode *,struct dentry *);
 int (*symlink) (struct inode *,struct dentry *,const char *);
 int (*mkdir) (struct inode *,struct dentry *,umode_t);
 int (*rmdir) (struct inode *,struct dentry *);
 int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
 int (*rename) (struct inode *, struct dentry *,
   struct inode *, struct dentry *);
 int (*rename2) (struct inode *, struct dentry *,
   struct inode *, struct dentry *, unsigned int);
 int (*setattr) (struct dentry *, struct iattr *);
 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
 ssize_t (*listxattr) (struct dentry *, char *, size_t);
 int (*removexattr) (struct dentry *, const char *);
 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
        u64 len);
 int (*update_time)(struct inode *, struct timespec *, int);
 int (*atomic_open)(struct inode *, struct dentry *,
      struct file *, unsigned open_flag,
      umode_t create_mode, int *opened);
 int (*tmpfile) (struct inode *, struct dentry *, umode_t);
 int (*set_acl)(struct inode *, struct posix_acl *, int);


 int (*dentry_open)(struct dentry *, struct file *, const struct cred *);
} __attribute__((__aligned__((1 << 6))));

ssize_t rw_copy_check_uvector(int type, const struct iovec * uvector,
         unsigned long nr_segs, unsigned long fast_segs,
         struct iovec *fast_pointer,
         struct iovec **ret_pointer);

extern ssize_t __vfs_read(struct file *, char *, size_t, loff_t *);
extern ssize_t vfs_read(struct file *, char *, size_t, loff_t *);
extern ssize_t vfs_write(struct file *, const char *, size_t, loff_t *);
extern ssize_t vfs_readv(struct file *, const struct iovec *,
  unsigned long, loff_t *);
extern ssize_t vfs_writev(struct file *, const struct iovec *,
  unsigned long, loff_t *);

struct super_operations {
    struct inode *(*alloc_inode)(struct super_block *sb);
 void (*destroy_inode)(struct inode *);

    void (*dirty_inode) (struct inode *, int flags);
 int (*write_inode) (struct inode *, struct writeback_control *wbc);
 int (*drop_inode) (struct inode *);
 void (*evict_inode) (struct inode *);
 void (*put_super) (struct super_block *);
 int (*sync_fs)(struct super_block *sb, int wait);
 int (*freeze_super) (struct super_block *);
 int (*freeze_fs) (struct super_block *);
 int (*thaw_super) (struct super_block *);
 int (*unfreeze_fs) (struct super_block *);
 int (*statfs) (struct dentry *, struct kstatfs *);
 int (*remount_fs) (struct super_block *, int *, char *);
 void (*umount_begin) (struct super_block *);

 int (*show_options)(struct seq_file *, struct dentry *);
 int (*show_devname)(struct seq_file *, struct dentry *);
 int (*show_path)(struct seq_file *, struct dentry *);
 int (*show_stats)(struct seq_file *, struct dentry *);





 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
 long (*nr_cached_objects)(struct super_block *,
      struct shrink_control *);
 long (*free_cached_objects)(struct super_block *,
        struct shrink_control *);
};
# 1797 "include/linux/fs.h"
extern void __mark_inode_dirty(struct inode *, int);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mark_inode_dirty(struct inode *inode)
{
 __mark_inode_dirty(inode, ((1 << 0) | (1 << 1) | (1 << 2)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mark_inode_dirty_sync(struct inode *inode)
{
 __mark_inode_dirty(inode, (1 << 0));
}

extern void inc_nlink(struct inode *inode);
extern void drop_nlink(struct inode *inode);
extern void clear_nlink(struct inode *inode);
extern void set_nlink(struct inode *inode, unsigned int nlink);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_inc_link_count(struct inode *inode)
{
 inc_nlink(inode);
 mark_inode_dirty(inode);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_dec_link_count(struct inode *inode)
{
 drop_nlink(inode);
 mark_inode_dirty(inode);
}
# 1833 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_inc_iversion(struct inode *inode)
{
       spin_lock(&inode->i_lock);
       inode->i_version++;
       spin_unlock(&inode->i_lock);
}

enum file_time_flags {
 S_ATIME = 1,
 S_MTIME = 2,
 S_CTIME = 4,
 S_VERSION = 8,
};

extern void touch_atime(const struct path *);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void file_accessed(struct file *file)
{
 if (!(file->f_flags & 0x200000))
  touch_atime(&file->f_path);
}

int sync_inode(struct inode *inode, struct writeback_control *wbc);
int sync_inode_metadata(struct inode *inode, int wait);

struct file_system_type {
 const char *name;
 int fs_flags;






 struct dentry *(*mount) (struct file_system_type *, int,
         const char *, void *);
 void (*kill_sb) (struct super_block *);
 struct module *owner;
 struct file_system_type * next;
 struct hlist_head fs_supers;

 struct lock_class_key s_lock_key;
 struct lock_class_key s_umount_key;
 struct lock_class_key s_vfs_rename_key;
 struct lock_class_key s_writers_key[(SB_FREEZE_COMPLETE - 1)];

 struct lock_class_key i_lock_key;
 struct lock_class_key i_mutex_key;
 struct lock_class_key i_mutex_dir_key;
};



extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
 void *data, int (*fill_super)(struct super_block *, void *, int));
extern struct dentry *mount_bdev(struct file_system_type *fs_type,
 int flags, const char *dev_name, void *data,
 int (*fill_super)(struct super_block *, void *, int));
extern struct dentry *mount_single(struct file_system_type *fs_type,
 int flags, void *data,
 int (*fill_super)(struct super_block *, void *, int));
extern struct dentry *mount_nodev(struct file_system_type *fs_type,
 int flags, void *data,
 int (*fill_super)(struct super_block *, void *, int));
extern struct dentry *mount_subtree(struct vfsmount *mnt, const char *path);
void generic_shutdown_super(struct super_block *sb);
void kill_block_super(struct super_block *sb);
void kill_anon_super(struct super_block *sb);
void kill_litter_super(struct super_block *sb);
void deactivate_super(struct super_block *sb);
void deactivate_locked_super(struct super_block *sb);
int set_anon_super(struct super_block *s, void *data);
int get_anon_bdev(dev_t *);
void free_anon_bdev(dev_t);
struct super_block *sget(struct file_system_type *type,
   int (*test)(struct super_block *,void *),
   int (*set)(struct super_block *,void *),
   int flags, void *data);
extern struct dentry *mount_pseudo(struct file_system_type *, char *,
 const struct super_operations *ops,
 const struct dentry_operations *dops,
 unsigned long);
# 1932 "include/linux/fs.h"
extern int register_filesystem(struct file_system_type *);
extern int unregister_filesystem(struct file_system_type *);
extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data);

extern void kern_unmount(struct vfsmount *mnt);
extern int may_umount_tree(struct vfsmount *);
extern int may_umount(struct vfsmount *);
extern long do_mount(const char *, const char *,
       const char *, unsigned long, void *);
extern struct vfsmount *collect_mounts(struct path *);
extern void drop_collected_mounts(struct vfsmount *);
extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,
     struct vfsmount *);
extern int vfs_statfs(struct path *, struct kstatfs *);
extern int user_statfs(const char *, struct kstatfs *);
extern int fd_statfs(int, struct kstatfs *);
extern int vfs_ustat(dev_t, struct kstatfs *);
extern int freeze_super(struct super_block *super);
extern int thaw_super(struct super_block *super);
extern bool our_mnt(struct vfsmount *mnt);
extern bool fs_fully_visible(struct file_system_type *);

extern int current_umask(void);

extern void ihold(struct inode * inode);
extern void iput(struct inode *);
extern int generic_update_time(struct inode *, struct timespec *, int);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inode *file_inode(const struct file *f)
{
 return f->f_inode;
}


extern struct kobject *fs_kobj;







extern int locks_mandatory_locked(struct file *);
extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __mandatory_lock(struct inode *ino)
{
 return (ino->i_mode & (0002000 | 00010)) == 0002000;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mandatory_lock(struct inode *ino)
{
 return ((ino)->i_sb->s_flags & (64)) && __mandatory_lock(ino);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int locks_verify_locked(struct file *file)
{
 if (mandatory_lock(file_inode(file)))
  return locks_mandatory_locked(file);
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int locks_verify_truncate(struct inode *inode,
        struct file *filp,
        loff_t size)
{
 if (inode->i_flctx && mandatory_lock(inode))
  return locks_mandatory_area(
   2, inode, filp,
   size < inode->i_size ? size : inode->i_size,
   (size < inode->i_size ? inode->i_size - size
    : size - inode->i_size)
  );
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int break_lease(struct inode *inode, unsigned int mode)
{






 do { __asm__ __volatile__("ba,pt	%%xcc, 1f\n\t" " membar	" "#StoreLoad" "\n" "1:\n" : : : "memory"); } while (0);
 if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))
  return __break_lease(inode, mode, 32);
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int break_deleg(struct inode *inode, unsigned int mode)
{






 do { __asm__ __volatile__("ba,pt	%%xcc, 1f\n\t" " membar	" "#StoreLoad" "\n" "1:\n" : : : "memory"); } while (0);
 if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))
  return __break_lease(inode, mode, 4);
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int try_break_deleg(struct inode *inode, struct inode **delegated_inode)
{
 int ret;

 ret = break_deleg(inode, 00000001|0x4000);
 if (ret == -11 && delegated_inode) {
  *delegated_inode = inode;
  ihold(inode);
 }
 return ret;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int break_deleg_wait(struct inode **delegated_inode)
{
 int ret;

 ret = break_deleg(*delegated_inode, 00000001);
 iput(*delegated_inode);
 *delegated_inode = ((void *)0);
 return ret;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int break_layout(struct inode *inode, bool wait)
{
 do { __asm__ __volatile__("ba,pt	%%xcc, 1f\n\t" " membar	" "#StoreLoad" "\n" "1:\n" : : : "memory"); } while (0);
 if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))
  return __break_lease(inode,
    wait ? 00000001 : 00000001 | 0x4000,
    2048);
 return 0;
}
# 2141 "include/linux/fs.h"
struct audit_names;
struct filename {
 const char *name;
 const char *uptr;
 struct audit_names *aname;
 int refcnt;
 bool separate;
};

extern long vfs_truncate(struct path *, loff_t);
extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
         struct file *filp);
extern int vfs_fallocate(struct file *file, int mode, loff_t offset,
   loff_t len);
extern long do_sys_open(int dfd, const char *filename, int flags,
   umode_t mode);
extern struct file *file_open_name(struct filename *, int, umode_t);
extern struct file *filp_open(const char *, int, umode_t);
extern struct file *file_open_root(struct dentry *, struct vfsmount *,
       const char *, int);
extern int vfs_open(const struct path *, struct file *, const struct cred *);
extern struct file * dentry_open(const struct path *, int, const struct cred *);
extern int filp_close(struct file *, fl_owner_t id);

extern struct filename *getname_flags(const char *, int, int *);
extern struct filename *getname(const char *);
extern struct filename *getname_kernel(const char *);
extern void putname(struct filename *name);

enum {
 FILE_CREATED = 1,
 FILE_OPENED = 2
};
extern int finish_open(struct file *file, struct dentry *dentry,
   int (*open)(struct inode *, struct file *),
   int *opened);
extern int finish_no_open(struct file *file, struct dentry *dentry);



extern int ioctl_preallocate(struct file *filp, void *argp);


extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) vfs_caches_init_early(void);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) vfs_caches_init(unsigned long);

extern struct kmem_cache *names_cachep;





extern int register_blkdev(unsigned int, const char *);
extern void unregister_blkdev(unsigned int, const char *);
extern struct block_device *bdget(dev_t);
extern struct block_device *bdgrab(struct block_device *bdev);
extern void bd_set_size(struct block_device *, loff_t size);
extern void bd_forget(struct inode *inode);
extern void bdput(struct block_device *);
extern void invalidate_bdev(struct block_device *);
extern void iterate_bdevs(void (*)(struct block_device *, void *), void *);
extern int sync_blockdev(struct block_device *bdev);
extern void kill_bdev(struct block_device *);
extern struct super_block *freeze_bdev(struct block_device *);
extern void emergency_thaw_all(void);
extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
extern int fsync_bdev(struct block_device *);
extern int sb_is_blkdev_sb(struct super_block *sb);
# 2234 "include/linux/fs.h"
extern int sync_filesystem(struct super_block *);
extern const struct file_operations def_blk_fops;
extern const struct file_operations def_chr_fops;

extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long);
extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
extern int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder);
extern struct block_device *blkdev_get_by_path(const char *path, fmode_t mode,
            void *holder);
extern struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode,
           void *holder);
extern void blkdev_put(struct block_device *bdev, fmode_t mode);

extern int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk);
extern void bd_unlink_disk_holder(struct block_device *bdev,
      struct gendisk *disk);
# 2266 "include/linux/fs.h"
extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
extern int register_chrdev_region(dev_t, unsigned, const char *);
extern int __register_chrdev(unsigned int major, unsigned int baseminor,
        unsigned int count, const char *name,
        const struct file_operations *fops);
extern void __unregister_chrdev(unsigned int major, unsigned int baseminor,
    unsigned int count, const char *name);
extern void unregister_chrdev_region(dev_t, unsigned);
extern void chrdev_show(struct seq_file *,off_t);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int register_chrdev(unsigned int major, const char *name,
      const struct file_operations *fops)
{
 return __register_chrdev(major, 0, 256, name, fops);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unregister_chrdev(unsigned int major, const char *name)
{
 __unregister_chrdev(major, 0, 256, name);
}







extern const char *__bdevname(dev_t, char *buffer);
extern const char *bdevname(struct block_device *bdev, char *buffer);
extern struct block_device *lookup_bdev(const char *);
extern void blkdev_show(struct seq_file *,off_t);





extern void init_special_inode(struct inode *, umode_t, dev_t);


extern void make_bad_inode(struct inode *);
extern int is_bad_inode(struct inode *);
# 2319 "include/linux/fs.h"
extern void check_disk_size_change(struct gendisk *disk,
       struct block_device *bdev);
extern int revalidate_disk(struct gendisk *);
extern int check_disk_change(struct block_device *);
extern int __invalidate_device(struct block_device *, bool);
extern int invalidate_partition(struct gendisk *, int);

unsigned long invalidate_mapping_pages(struct address_space *mapping,
     unsigned long start, unsigned long end);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void invalidate_remote_inode(struct inode *inode)
{
 if ((((inode->i_mode) & 00170000) == 0100000) || (((inode->i_mode) & 00170000) == 0040000) ||
     (((inode->i_mode) & 00170000) == 0120000))
  invalidate_mapping_pages(inode->i_mapping, 0, -1);
}
extern int invalidate_inode_pages2(struct address_space *mapping);
extern int invalidate_inode_pages2_range(struct address_space *mapping,
      unsigned long start, unsigned long end);
extern int write_inode_now(struct inode *, int);
extern int filemap_fdatawrite(struct address_space *);
extern int filemap_flush(struct address_space *);
extern int filemap_fdatawait(struct address_space *);
extern int filemap_fdatawait_range(struct address_space *, loff_t lstart,
       loff_t lend);
extern int filemap_write_and_wait(struct address_space *mapping);
extern int filemap_write_and_wait_range(struct address_space *mapping,
            loff_t lstart, loff_t lend);
extern int __filemap_fdatawrite_range(struct address_space *mapping,
    loff_t start, loff_t end, int sync_mode);
extern int filemap_fdatawrite_range(struct address_space *mapping,
    loff_t start, loff_t end);

extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
      int datasync);
extern int vfs_fsync(struct file *file, int datasync);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int generic_write_sync(struct file *file, loff_t pos, loff_t count)
{
 if (!(file->f_flags & 0x2000) && !(((file->f_mapping->host)->i_sb->s_flags & (16)) || ((file->f_mapping->host)->i_flags & 1)))
  return 0;
 return vfs_fsync_range(file, pos, pos + count - 1,
          (file->f_flags & 0x800000) ? 0 : 1);
}
extern void emergency_sync(void);
extern void emergency_remount(void);

extern sector_t bmap(struct inode *, sector_t);

extern int notify_change(struct dentry *, struct iattr *, struct inode **);
extern int inode_permission(struct inode *, int);
extern int __inode_permission(struct inode *, int);
extern int generic_permission(struct inode *, int);
extern int __check_sticky(struct inode *dir, struct inode *inode);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool execute_ok(struct inode *inode)
{
 return (inode->i_mode & (00100|00010|00001)) || (((inode->i_mode) & 00170000) == 0040000);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void file_start_write(struct file *file)
{
 if (!(((file_inode(file)->i_mode) & 00170000) == 0100000))
  return;
 __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool file_start_write_trylock(struct file *file)
{
 if (!(((file_inode(file)->i_mode) & 00170000) == 0100000))
  return true;
 return __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, false);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void file_end_write(struct file *file)
{
 if (!(((file_inode(file)->i_mode) & 00170000) == 0100000))
  return;
 __sb_end_write(file_inode(file)->i_sb, SB_FREEZE_WRITE);
}
# 2415 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_write_access(struct inode *inode)
{
 return atomic_inc_unless_negative(&inode->i_writecount) ? 0 : -26;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int deny_write_access(struct file *file)
{
 struct inode *inode = file_inode(file);
 return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -26;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_write_access(struct inode * inode)
{
 atomic_sub(1, &inode->i_writecount);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void allow_write_access(struct file *file)
{
 if (file)
  atomic_add(1, &file_inode(file)->i_writecount);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool inode_is_open_for_write(const struct inode *inode)
{
 return (*({ __attribute__((unused)) typeof((&inode->i_writecount)->counter) __var = ( typeof((&inode->i_writecount)->counter)) 0; (volatile typeof((&inode->i_writecount)->counter) *)&((&inode->i_writecount)->counter); })) > 0;
}
# 2449 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_readcount_dec(struct inode *inode)
{
 return;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_readcount_inc(struct inode *inode)
{
 return;
}

extern int do_pipe_flags(int *, int);

extern int kernel_read(struct file *, loff_t, char *, unsigned long);
extern ssize_t kernel_write(struct file *, const char *, size_t, loff_t);
extern ssize_t __kernel_write(struct file *, const char *, size_t, loff_t *);
extern struct file * open_exec(const char *);


extern int is_subdir(struct dentry *, struct dentry *);
extern int path_is_under(struct path *, struct path *);

# 1 "include/linux/err.h" 1
# 23 "include/linux/err.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void * __attribute__((warn_unused_result)) ERR_PTR(long error)
{
 return (void *) error;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long __attribute__((warn_unused_result)) PTR_ERR( const void *ptr)
{
 return (long) ptr;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __attribute__((warn_unused_result)) IS_ERR( const void *ptr)
{
 return __builtin_expect(!!(((unsigned long)ptr) >= (unsigned long)-4095), 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __attribute__((warn_unused_result)) IS_ERR_OR_NULL( const void *ptr)
{
 return !ptr || __builtin_expect(!!(((unsigned long)ptr) >= (unsigned long)-4095), 0);
}
# 50 "include/linux/err.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void * __attribute__((warn_unused_result)) ERR_CAST( const void *ptr)
{

 return (void *) ptr;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) PTR_ERR_OR_ZERO( const void *ptr)
{
 if (IS_ERR(ptr))
  return PTR_ERR(ptr);
 else
  return 0;
}
# 2470 "include/linux/fs.h" 2


extern loff_t default_llseek(struct file *file, loff_t offset, int whence);

extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence);

extern int inode_init_always(struct super_block *, struct inode *);
extern void inode_init_once(struct inode *);
extern void address_space_init_once(struct address_space *mapping);
extern struct inode * igrab(struct inode *);
extern ino_t iunique(struct super_block *, ino_t);
extern int inode_needs_sync(struct inode *inode);
extern int generic_delete_inode(struct inode *inode);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int generic_drop_inode(struct inode *inode)
{
 return !inode->i_nlink || inode_unhashed(inode);
}

extern struct inode *ilookup5_nowait(struct super_block *sb,
  unsigned long hashval, int (*test)(struct inode *, void *),
  void *data);
extern struct inode *ilookup5(struct super_block *sb, unsigned long hashval,
  int (*test)(struct inode *, void *), void *data);
extern struct inode *ilookup(struct super_block *sb, unsigned long ino);

extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *);
extern struct inode * iget_locked(struct super_block *, unsigned long);
extern struct inode *find_inode_nowait(struct super_block *,
           unsigned long,
           int (*match)(struct inode *,
          unsigned long, void *),
           void *data);
extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
extern int insert_inode_locked(struct inode *);



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void lockdep_annotate_inode_mutex_key(struct inode *inode) { };

extern void unlock_new_inode(struct inode *);
extern unsigned int get_next_ino(void);

extern void __iget(struct inode * inode);
extern void iget_failed(struct inode *);
extern void clear_inode(struct inode *);
extern void __destroy_inode(struct inode *);
extern struct inode *new_inode_pseudo(struct super_block *sb);
extern struct inode *new_inode(struct super_block *sb);
extern void free_inode_nonrcu(struct inode *inode);
extern int should_remove_suid(struct dentry *);
extern int file_remove_suid(struct file *);

extern void __insert_inode_hash(struct inode *, unsigned long hashval);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void insert_inode_hash(struct inode *inode)
{
 __insert_inode_hash(inode, inode->i_ino);
}

extern void __remove_inode_hash(struct inode *);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void remove_inode_hash(struct inode *inode)
{
 if (!inode_unhashed(inode))
  __remove_inode_hash(inode);
}

extern void inode_sb_list_add(struct inode *inode);


extern void submit_bio(int, struct bio *);
extern int bdev_read_only(struct block_device *);

extern int set_blocksize(struct block_device *, int);
extern int sb_set_blocksize(struct super_block *, int);
extern int sb_min_blocksize(struct super_block *, int);

extern int generic_file_mmap(struct file *, struct vm_area_struct *);
extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
extern ssize_t generic_file_read_iter(struct kiocb *, struct iov_iter *);
extern ssize_t __generic_file_write_iter(struct kiocb *, struct iov_iter *);
extern ssize_t generic_file_write_iter(struct kiocb *, struct iov_iter *);
extern ssize_t generic_file_direct_write(struct kiocb *, struct iov_iter *, loff_t);
extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t);
extern ssize_t do_sync_read(struct file *filp, char *buf, size_t len, loff_t *ppos);
extern ssize_t do_sync_write(struct file *filp, const char *buf, size_t len, loff_t *ppos);
extern ssize_t new_sync_read(struct file *filp, char *buf, size_t len, loff_t *ppos);
extern ssize_t new_sync_write(struct file *filp, const char *buf, size_t len, loff_t *ppos);

ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos);
ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos);


extern ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to);
extern ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from);
extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
   int datasync);
extern void block_sync_page(struct page *page);


extern ssize_t generic_file_splice_read(struct file *, loff_t *,
  struct pipe_inode_info *, size_t, unsigned int);
extern ssize_t default_file_splice_read(struct file *, loff_t *,
  struct pipe_inode_info *, size_t, unsigned int);
extern ssize_t iter_file_splice_write(struct pipe_inode_info *,
  struct file *, loff_t *, size_t, unsigned int);
extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe,
  struct file *out, loff_t *, size_t len, unsigned int flags);
extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
  loff_t *opos, size_t len, unsigned int flags);


extern void
file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
extern loff_t noop_llseek(struct file *file, loff_t offset, int whence);
extern loff_t no_llseek(struct file *file, loff_t offset, int whence);
extern loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize);
extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence);
extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
  int whence, loff_t maxsize, loff_t eof);
extern loff_t fixed_size_llseek(struct file *file, loff_t offset,
  int whence, loff_t size);
extern int generic_file_open(struct inode * inode, struct file * filp);
extern int nonseekable_open(struct inode * inode, struct file * filp);

ssize_t dax_do_io(int rw, struct kiocb *, struct inode *, struct iov_iter *,
  loff_t, get_block_t, dio_iodone_t, int flags);
int dax_clear_blocks(struct inode *, sector_t block, long size);
int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t);
int dax_truncate_page(struct inode *, loff_t from, get_block_t);
int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t);



typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode,
       loff_t file_offset);

enum {

 DIO_LOCKING = 0x01,


 DIO_SKIP_HOLES = 0x02,


 DIO_ASYNC_EXTEND = 0x04,
};

void dio_end_io(struct bio *bio, int error);

ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
 struct block_device *bdev, struct iov_iter *iter, loff_t offset,
 get_block_t get_block, dio_iodone_t end_io,
 dio_submit_t submit_io, int flags);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
  struct inode *inode, struct iov_iter *iter, loff_t offset,
  get_block_t get_block)
{
 return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iter,
        offset, get_block, ((void *)0), ((void *)0),
        DIO_LOCKING | DIO_SKIP_HOLES);
}


void inode_dio_wait(struct inode *inode);
void inode_dio_done(struct inode *inode);

extern void inode_set_flags(struct inode *inode, unsigned int flags,
       unsigned int mask);

extern const struct file_operations generic_ro_fops;



extern int readlink_copy(char *, int, const char *);
extern int page_readlink(struct dentry *, char *, int);
extern void *page_follow_link_light(struct dentry *, struct nameidata *);
extern void page_put_link(struct dentry *, struct nameidata *, void *);
extern int __page_symlink(struct inode *inode, const char *symname, int len,
  int nofs);
extern int page_symlink(struct inode *inode, const char *symname, int len);
extern const struct inode_operations page_symlink_inode_operations;
extern void kfree_put_link(struct dentry *, struct nameidata *, void *);
extern int generic_readlink(struct dentry *, char *, int);
extern void generic_fillattr(struct inode *, struct kstat *);
int vfs_getattr_nosec(struct path *path, struct kstat *stat);
extern int vfs_getattr(struct path *, struct kstat *);
void __inode_add_bytes(struct inode *inode, loff_t bytes);
void inode_add_bytes(struct inode *inode, loff_t bytes);
void __inode_sub_bytes(struct inode *inode, loff_t bytes);
void inode_sub_bytes(struct inode *inode, loff_t bytes);
loff_t inode_get_bytes(struct inode *inode);
void inode_set_bytes(struct inode *inode, loff_t bytes);

extern int vfs_readdir(struct file *, filldir_t, void *);
extern int iterate_dir(struct file *, struct dir_context *);

extern int vfs_stat(const char *, struct kstat *);
extern int vfs_lstat(const char *, struct kstat *);
extern int vfs_fstat(unsigned int, struct kstat *);
extern int vfs_fstatat(int , const char *, struct kstat *, int);

extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
      unsigned long arg);
extern int __generic_block_fiemap(struct inode *inode,
      struct fiemap_extent_info *fieinfo,
      loff_t start, loff_t len,
      get_block_t *get_block);
extern int generic_block_fiemap(struct inode *inode,
    struct fiemap_extent_info *fieinfo, u64 start,
    u64 len, get_block_t *get_block);

extern void get_filesystem(struct file_system_type *fs);
extern void put_filesystem(struct file_system_type *fs);
extern struct file_system_type *get_fs_type(const char *name);
extern struct super_block *get_super(struct block_device *);
extern struct super_block *get_super_thawed(struct block_device *);
extern struct super_block *get_active_super(struct block_device *bdev);
extern void drop_super(struct super_block *sb);
extern void iterate_supers(void (*)(struct super_block *, void *), void *);
extern void iterate_supers_type(struct file_system_type *,
           void (*)(struct super_block *, void *), void *);

extern int dcache_dir_open(struct inode *, struct file *);
extern int dcache_dir_close(struct inode *, struct file *);
extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
extern int dcache_readdir(struct file *, struct dir_context *);
extern int simple_setattr(struct dentry *, struct iattr *);
extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
extern int simple_statfs(struct dentry *, struct kstatfs *);
extern int simple_open(struct inode *inode, struct file *file);
extern int simple_link(struct dentry *, struct inode *, struct dentry *);
extern int simple_unlink(struct inode *, struct dentry *);
extern int simple_rmdir(struct inode *, struct dentry *);
extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
extern int noop_fsync(struct file *, loff_t, loff_t, int);
extern int simple_empty(struct dentry *);
extern int simple_readpage(struct file *file, struct page *page);
extern int simple_write_begin(struct file *file, struct address_space *mapping,
   loff_t pos, unsigned len, unsigned flags,
   struct page **pagep, void **fsdata);
extern int simple_write_end(struct file *file, struct address_space *mapping,
   loff_t pos, unsigned len, unsigned copied,
   struct page *page, void *fsdata);
extern int always_delete_dentry(const struct dentry *);
extern struct inode *alloc_anon_inode(struct super_block *);
extern int simple_nosetlease(struct file *, long, struct file_lock **, void **);
extern const struct dentry_operations simple_dentry_operations;

extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags);
extern ssize_t generic_read_dir(struct file *, char *, size_t, loff_t *);
extern const struct file_operations simple_dir_operations;
extern const struct inode_operations simple_dir_inode_operations;
struct tree_descr { char *name; const struct file_operations *ops; int mode; };
struct dentry *d_alloc_name(struct dentry *, const char *);
extern int simple_fill_super(struct super_block *, unsigned long, struct tree_descr *);
extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
extern void simple_release_fs(struct vfsmount **mount, int *count);

extern ssize_t simple_read_from_buffer(void *to, size_t count,
   loff_t *ppos, const void *from, size_t available);
extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
  const void *from, size_t count);

extern int __generic_file_fsync(struct file *, loff_t, loff_t, int);
extern int generic_file_fsync(struct file *, loff_t, loff_t, int);

extern int generic_check_addressable(unsigned, u64);


extern int buffer_migrate_page(struct address_space *,
    struct page *, struct page *,
    enum migrate_mode);




extern int inode_change_ok(const struct inode *, struct iattr *);
extern int inode_newsize_ok(const struct inode *, loff_t offset);
extern void setattr_copy(struct inode *inode, const struct iattr *attr);

extern int file_update_time(struct file *file);

extern int generic_show_options(struct seq_file *m, struct dentry *root);
extern void save_mount_options(struct super_block *sb, char *options);
extern void replace_mount_options(struct super_block *sb, char *options);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool io_is_direct(struct file *filp)
{
 return (filp->f_flags & 0x100000) || ((file_inode(filp))->i_flags & 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ino_t parent_ino(struct dentry *dentry)
{
 ino_t res;





 spin_lock(&dentry->d_lockref.lock);
 res = dentry->d_parent->d_inode->i_ino;
 spin_unlock(&dentry->d_lockref.lock);
 return res;
}







struct simple_transaction_argresp {
 ssize_t size;
 char data[0];
};



char *simple_transaction_get(struct file *file, const char *buf,
    size_t size);
ssize_t simple_transaction_read(struct file *file, char *buf,
    size_t size, loff_t *pos);
int simple_transaction_release(struct inode *inode, struct file *file);

void simple_transaction_set(struct file *file, size_t n);
# 2828 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((format(printf, 1, 2)))
void __simple_attr_check_format(const char *fmt, ...)
{

}

int simple_attr_open(struct inode *inode, struct file *file,
       int (*get)(void *, u64 *), int (*set)(void *, u64),
       const char *fmt);
int simple_attr_release(struct inode *inode, struct file *file);
ssize_t simple_attr_read(struct file *file, char *buf,
    size_t len, loff_t *ppos);
ssize_t simple_attr_write(struct file *file, const char *buf,
     size_t len, loff_t *ppos);

struct ctl_table;
int proc_nr_files(struct ctl_table *table, int write,
    void *buffer, size_t *lenp, loff_t *ppos);
int proc_nr_dentry(struct ctl_table *table, int write,
    void *buffer, size_t *lenp, loff_t *ppos);
int proc_nr_inodes(struct ctl_table *table, int write,
     void *buffer, size_t *lenp, loff_t *ppos);
int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) get_filesystem_list(char *buf);
# 2859 "include/linux/fs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_sxid(umode_t mode)
{
 return (mode & 0004000) || ((mode & 0002000) && (mode & 00010));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int check_sticky(struct inode *dir, struct inode *inode)
{
 if (!(dir->i_mode & 0001000))
  return 0;

 return __check_sticky(dir, inode);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_has_no_xattr(struct inode *inode)
{
 if (!is_sxid(inode->i_mode) && (inode->i_sb->s_flags & (1<<28)))
  inode->i_flags |= 4096;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_root_inode(struct inode *inode)
{
 return inode == inode->i_sb->s_root->d_inode;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_emit(struct dir_context *ctx,
       const char *name, int namelen,
       u64 ino, unsigned type)
{
 return ctx->actor(ctx, name, namelen, ctx->pos, ino, type) == 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_emit_dot(struct file *file, struct dir_context *ctx)
{
 return ctx->actor(ctx, ".", 1, ctx->pos,
     file->f_path.dentry->d_inode->i_ino, 4) == 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_emit_dotdot(struct file *file, struct dir_context *ctx)
{
 return ctx->actor(ctx, "..", 2, ctx->pos,
     parent_ino(file->f_path.dentry), 4) == 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_emit_dots(struct file *file, struct dir_context *ctx)
{
 if (ctx->pos == 0) {
  if (!dir_emit_dot(file, ctx))
   return false;
  ctx->pos = 1;
 }
 if (ctx->pos == 1) {
  if (!dir_emit_dotdot(file, ctx))
   return false;
  ctx->pos = 2;
 }
 return true;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_relax(struct inode *inode)
{
 mutex_unlock(&inode->i_mutex);
 mutex_lock(&inode->i_mutex);
 return !((inode)->i_flags & 16);
}
# 45 "include/linux/perf_event.h" 2
# 1 "include/linux/pid_namespace.h" 1





# 1 "include/linux/mm.h" 1
# 15 "include/linux/mm.h"
# 1 "include/linux/debug_locks.h" 1







struct task_struct;

extern int debug_locks;
extern int debug_locks_silent;


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __debug_locks_off(void)
{
 return ((__typeof__(*(&debug_locks)))__xchg((unsigned long)(0),(&debug_locks),sizeof(*(&debug_locks))));
}




extern int debug_locks_off(void);
# 48 "include/linux/debug_locks.h"
struct task_struct;







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_show_all_locks(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_show_held_locks(struct task_struct *task)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_check_no_locks_freed(const void *from, unsigned long len)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
debug_check_no_locks_held(void)
{
}
# 16 "include/linux/mm.h" 2

# 1 "include/linux/range.h" 1



struct range {
 u64 start;
 u64 end;
};

int add_range(struct range *range, int az, int nr_range,
  u64 start, u64 end);


int add_range_with_merge(struct range *range, int az, int nr_range,
    u64 start, u64 end);

void subtract_range(struct range *range, int az, u64 start, u64 end);

int clean_sort_range(struct range *range, int az);

void sort_range(struct range *range, int nr_range);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) resource_size_t cap_resource(u64 val)
{
 if (val > ((resource_size_t)~0))
  return ((resource_size_t)~0);

 return val;
}
# 18 "include/linux/mm.h" 2




# 1 "include/linux/page_ext.h" 1




# 1 "include/linux/stacktrace.h" 1





struct task_struct;
struct pt_regs;


struct task_struct;

struct stack_trace {
 unsigned int nr_entries, max_entries;
 unsigned long *entries;
 int skip;
};

extern void save_stack_trace(struct stack_trace *trace);
extern void save_stack_trace_regs(struct pt_regs *regs,
      struct stack_trace *trace);
extern void save_stack_trace_tsk(struct task_struct *tsk,
    struct stack_trace *trace);

extern void print_stack_trace(struct stack_trace *trace, int spaces);
extern int snprint_stack_trace(char *buf, size_t size,
   struct stack_trace *trace, int spaces);
# 6 "include/linux/page_ext.h" 2

struct pglist_data;
struct page_ext_operations {
 bool (*need)(void);
 void (*init)(void);
};
# 65 "include/linux/page_ext.h"
struct page_ext;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgdat_page_ext_init(struct pglist_data *pgdat)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page_ext *lookup_page_ext(struct page *page)
{
 return ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_ext_init(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_ext_init_flatmem(void)
{
}
# 23 "include/linux/mm.h" 2

struct mempolicy;
struct anon_vma;
struct anon_vma_chain;
struct file_ra_state;
struct user_struct;
struct writeback_control;
# 39 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_max_mapnr(unsigned long limit) { }


extern unsigned long totalram_pages;
extern void * high_memory;
extern int page_cluster;


extern int sysctl_legacy_va_layout;





# 1 "./arch/sparc/include/asm/pgtable.h" 1



# 1 "./arch/sparc/include/asm/pgtable_64.h" 1
# 17 "./arch/sparc/include/asm/pgtable_64.h"
# 1 "arch/sparc/include/generated/asm/types.h" 1
# 18 "./arch/sparc/include/asm/pgtable_64.h" 2
# 81 "./arch/sparc/include/asm/pgtable_64.h"
extern unsigned long VMALLOC_END;





bool kern_addr_valid(unsigned long addr);
# 212 "./arch/sparc/include/asm/pgtable_64.h"
pte_t mk_pte_io(unsigned long, pgprot_t, int, unsigned long);

unsigned long pte_sz_bits(unsigned long size);

extern pgprot_t PAGE_KERNEL;
extern pgprot_t PAGE_KERNEL_LOCKED;
extern pgprot_t PAGE_COPY;
extern pgprot_t PAGE_SHARED;


extern unsigned long _PAGE_IE;
extern unsigned long _PAGE_E;
extern unsigned long _PAGE_CACHE;

extern unsigned long pg_iobits;
extern unsigned long _PAGE_ALL_SZ_BITS;

extern struct page *mem_map_zero;







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pfn_pte(unsigned long pfn, pgprot_t prot)
{
 unsigned long paddr = pfn << 13;

 do { bool __cond = !(!((0x0000000000000000UL) != 0UL || (0x0000000000000000UL) != 0UL)); extern void __compiletime_assert_241(void) __attribute__((error("BUILD_BUG_ON failed: " "_PAGE_SZBITS_4U != 0UL || _PAGE_SZBITS_4V != 0UL"))); if (__cond) __compiletime_assert_241(); do { } while (0); } while (0);
 return ((pte_t) { (paddr | ((prot).pgprot)) } );
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)
{
 pte_t pte = pfn_pte(page_nr, pgprot);

 return ((pmd_t) { (((pte).pte)) } );
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_pfn(pte_t pte)
{
 unsigned long ret;

 __asm__ __volatile__(
 "\n661:	sllx		%1, %2, %0\n"
 "	srlx		%0, %3, %0\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sllx		%1, %4, %0\n"
 "	srlx		%0, %5, %0\n"
 "	.previous\n"
 : "=r" (ret)
 : "r" (((pte).pte)),
   "i" (21), "i" (21 + 13),
   "i" (8), "i" (8 + 13));

 return ret;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_modify(pte_t pte, pgprot_t prot)
{
 unsigned long mask, tmp;
# 292 "./arch/sparc/include/asm/pgtable_64.h"
 do { bool __cond = !(!((0x0000000000000000UL) != 0UL || (0x0000000000000000UL) != 0UL)); extern void __compiletime_assert_292(void) __attribute__((error("BUILD_BUG_ON failed: " "_PAGE_SZBITS_4U != 0UL || _PAGE_SZBITS_4V != 0UL"))); if (__cond) __compiletime_assert_292(); do { } while (0); } while (0);
 __asm__ __volatile__(
 "\n661:	sethi		%%uhi(%2), %1\n"
 "	sethi		%%hi(%2), %0\n"
 "\n662:	or		%1, %%ulo(%2), %1\n"
 "	or		%0, %%lo(%2), %0\n"
 "\n663:	sllx		%1, 32, %1\n"
 "	or		%0, %1, %0\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%3), %1\n"
 "	sethi		%%hi(%3), %0\n"
 "	.word		662b\n"
 "	or		%1, %%ulo(%3), %1\n"
 "	or		%0, %%lo(%3), %0\n"
 "	.word		663b\n"
 "	sllx		%1, 32, %1\n"
 "	or		%0, %1, %0\n"
 "	.previous\n"
 : "=r" (mask), "=r" (tmp)
 : "i" ((0x000007FFFFFFE000UL) | (0x0000000000000800UL) | (0x0000000000000400UL) |
        (0x0000000000000020UL) | (0x0000000000000010UL) | (0x0000000000000008UL) |
        (0x0200000000000000UL) | (0x0100000000000000UL) | (0x6001000000000000UL)),
   "i" ((0x00FFFFFFFFFFE000UL) | (0x2000000000000000UL) | (0x1000000000000000UL) |
        (0x0000000000000400UL) | (0x0000000000000200UL) | (0x0000000000000800UL) |
        (0x0200000000000000UL) | (0x0100000000000000UL) | (0x0000000000000007UL)));

 return ((pte_t) { ((((pte).pte) & mask) | (((prot).pgprot) & ~mask)) } );
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_modify(pte, newprot);

 return ((pmd_t) { (((pte).pte)) } );
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pgprot_t pgprot_noncached(pgprot_t prot)
{
 unsigned long val = ((prot).pgprot);

 __asm__ __volatile__(
 "\n661:	andn		%0, %2, %0\n"
 "	or		%0, %3, %0\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	andn		%0, %4, %0\n"
 "	or		%0, %5, %0\n"
 "	.previous\n"
 : "=r" (val)
 : "0" (val), "i" ((0x0000000000000020UL) | (0x0000000000000010UL)), "i" ((0x0000000000000008UL)),
              "i" ((0x0000000000000400UL) | (0x0000000000000200UL)), "i" ((0x0000000000000800UL)));

 return ((pgprot_t) { (val) } );
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkhuge(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	sethi		%%uhi(%1), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	mov		%2, %0\n"
 "	nop\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x6000000000000000UL)), "i" ((0x0000000000000003UL)));

 return ((pte_t) { (((pte).pte) | mask) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mkhuge(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_mkhuge(pte);
 ((pte).pte) |= (0x0100000000000000UL);

 return ((pmd_t) { (((pte).pte)) } );
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkdirty(pte_t pte)
{
 unsigned long val = ((pte).pte), tmp;

 __asm__ __volatile__(
 "\n661:	or		%0, %3, %0\n"
 "	nop\n"
 "\n662:	nop\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%4), %1\n"
 "	sllx		%1, 32, %1\n"
 "	.word		662b\n"
 "	or		%1, %%lo(%4), %1\n"
 "	or		%0, %1, %0\n"
 "	.previous\n"
 : "=r" (val), "=r" (tmp)
 : "0" (val), "i" ((0x0000000000000800UL) | (0x0000000000000002UL)),
   "i" ((0x2000000000000000UL) | (0x0000000000000040UL)));

 return ((pte_t) { (val) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkclean(pte_t pte)
{
 unsigned long val = ((pte).pte), tmp;

 __asm__ __volatile__(
 "\n661:	andn		%0, %3, %0\n"
 "	nop\n"
 "\n662:	nop\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%4), %1\n"
 "	sllx		%1, 32, %1\n"
 "	.word		662b\n"
 "	or		%1, %%lo(%4), %1\n"
 "	andn		%0, %1, %0\n"
 "	.previous\n"
 : "=r" (val), "=r" (tmp)
 : "0" (val), "i" ((0x0000000000000800UL) | (0x0000000000000002UL)),
   "i" ((0x2000000000000000UL) | (0x0000000000000040UL)));

 return ((pte_t) { (val) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkwrite(pte_t pte)
{
 unsigned long val = ((pte).pte), mask;

 __asm__ __volatile__(
 "\n661:	mov		%1, %0\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%2), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000000100UL)), "i" ((0x0400000000000000UL)));

 return ((pte_t) { (val | mask) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_wrprotect(pte_t pte)
{
 unsigned long val = ((pte).pte), tmp;

 __asm__ __volatile__(
 "\n661:	andn		%0, %3, %0\n"
 "	nop\n"
 "\n662:	nop\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%4), %1\n"
 "	sllx		%1, 32, %1\n"
 "	.word		662b\n"
 "	or		%1, %%lo(%4), %1\n"
 "	andn		%0, %1, %0\n"
 "	.previous\n"
 : "=r" (val), "=r" (tmp)
 : "0" (val), "i" ((0x0000000000000100UL) | (0x0000000000000002UL)),
   "i" ((0x0400000000000000UL) | (0x0000000000000040UL)));

 return ((pte_t) { (val) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkold(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	mov		%1, %0\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%2), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000000400UL)), "i" ((0x1000000000000000UL)));

 mask |= (0x8000000000000000UL);

 return ((pte_t) { (((pte).pte) & ~mask) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkyoung(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	mov		%1, %0\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%2), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000000400UL)), "i" ((0x1000000000000000UL)));

 mask |= (0x8000000000000000UL);

 return ((pte_t) { (((pte).pte) | mask) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkspecial(pte_t pte)
{
 ((pte).pte) |= (0x0200000000000000UL);
 return pte;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_young(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	mov		%1, %0\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%2), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000000400UL)), "i" ((0x1000000000000000UL)));

 return (((pte).pte) & mask);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_dirty(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	mov		%1, %0\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%2), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000000800UL)), "i" ((0x2000000000000000UL)));

 return (((pte).pte) & mask);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_write(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	mov		%1, %0\n"
 "	nop\n"
 "	.section	.sun4v_2insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	sethi		%%uhi(%2), %0\n"
 "	sllx		%0, 32, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000000100UL)), "i" ((0x0400000000000000UL)));

 return (((pte).pte) & mask);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_exec(pte_t pte)
{
 unsigned long mask;

 __asm__ __volatile__(
 "\n661:	sethi		%%hi(%1), %0\n"
 "	.section	.sun4v_1insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	mov		%2, %0\n"
 "	.previous\n"
 : "=r" (mask)
 : "i" ((0x0000000000001000UL)), "i" ((0x0000000000000080UL)));

 return (((pte).pte) & mask);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_present(pte_t pte)
{
 unsigned long val = ((pte).pte);

 __asm__ __volatile__(
 "\n661:	and		%0, %2, %0\n"
 "	.section	.sun4v_1insn_patch, \"ax\"\n"
 "	.word		661b\n"
 "	and		%0, %3, %0\n"
 "	.previous\n"
 : "=r" (val)
 : "0" (val), "i" ((0x0000000000000080UL)), "i" ((0x0000000000000010UL)));

 return val;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_accessible(struct mm_struct *mm, pte_t a)
{
 return ((a).pte) & (0x8000000000000000UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pte_special(pte_t pte)
{
 return ((pte).pte) & (0x0200000000000000UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_large(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return ((pte).pte) & (0x0100000000000000UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_pfn(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return pte_pfn(pte);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_dirty(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return pte_dirty(pte);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_young(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return pte_young(pte);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_write(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return pte_write(pte);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_trans_huge(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return ((pte).pte) & (0x0100000000000000UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pmd_trans_splitting(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 return pmd_trans_huge(pmd) && pte_special(pte);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mkold(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_mkold(pte);

 return ((pmd_t) { (((pte).pte)) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_wrprotect(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_wrprotect(pte);

 return ((pmd_t) { (((pte).pte)) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mkdirty(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_mkdirty(pte);

 return ((pmd_t) { (((pte).pte)) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mkyoung(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_mkyoung(pte);

 return ((pmd_t) { (((pte).pte)) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mkwrite(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_mkwrite(pte);

 return ((pmd_t) { (((pte).pte)) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mksplitting(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );

 pte = pte_mkspecial(pte);

 return ((pmd_t) { (((pte).pte)) } );
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pgprot_t pmd_pgprot(pmd_t entry)
{
 unsigned long val = ((entry).pmd);

 return ((pgprot_t) { (val) } );
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_present(pmd_t pmd)
{
 return ((pmd).pmd) != 0UL;
}
# 759 "./arch/sparc/include/asm/pgtable_64.h"
void set_pmd_at(struct mm_struct *mm, unsigned long addr,
  pmd_t *pmdp, pmd_t pmd);
# 769 "./arch/sparc/include/asm/pgtable_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pmd_set(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
{
 unsigned long val = ((unsigned long)((unsigned long) (ptep)) - PAGE_OFFSET);

 ((*pmdp).pmd) = val;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __pmd_page(pmd_t pmd)
{
 pte_t pte = ((pte_t) { (((pmd).pmd)) } );
 unsigned long pfn;

 pfn = pte_pfn(pte);

 return ((unsigned long) ((void *)((unsigned long) (pfn << 13) + PAGE_OFFSET)));
}
# 799 "./arch/sparc/include/asm/pgtable_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pud_large(pud_t pud)
{
 pte_t pte = ((pte_t) { (((pud).pud)) } );

 return ((pte).pte) & (0x0100000000000000UL);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pud_pfn(pud_t pud)
{
 pte_t pte = ((pte_t) { (((pud).pud)) } );

 return pte_pfn(pte);
}
# 845 "./arch/sparc/include/asm/pgtable_64.h"
void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr,
     pte_t *ptep, pte_t orig, int fullmm);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmdp_get_and_clear(struct mm_struct *mm,
           unsigned long addr,
           pmd_t *pmdp)
{
 pmd_t pmd = *pmdp;
 set_pmd_at(mm, addr, pmdp, ((pmd_t) { (0UL) } ));
 return pmd;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __set_pte_at(struct mm_struct *mm, unsigned long addr,
        pte_t *ptep, pte_t pte, int fullmm)
{
 pte_t orig = *ptep;

 *ptep = pte;







 if (__builtin_expect(!!(mm != &init_mm), 1) && pte_accessible(mm, orig))
  tlb_batch_add(mm, addr, ptep, orig, fullmm);
}
# 902 "./arch/sparc/include/asm/pgtable_64.h"
extern pgd_t swapper_pg_dir[(1UL << (13 - 3))];

void paging_init(void);
unsigned long find_ecache_flush_span(unsigned long size);

struct seq_file;
void mmu_info(struct seq_file *);

struct vm_area_struct;
void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);

void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
     pmd_t *pmd);


extern void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
       pmd_t *pmdp);


void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp,
    pgtable_t pgtable);


pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp);
# 940 "./arch/sparc/include/asm/pgtable_64.h"
int page_in_phys_avail(unsigned long paddr);
# 950 "./arch/sparc/include/asm/pgtable_64.h"
int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long,
      unsigned long, pgprot_t);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int io_remap_pfn_range(struct vm_area_struct *vma,
         unsigned long from, unsigned long pfn,
         unsigned long size, pgprot_t prot)
{
 unsigned long offset = (pfn & 0x0fffffffffffffffUL) << 13;
 int space = (pfn >> (64 - 4));
 unsigned long phys_base;

 phys_base = offset | (((unsigned long) space) << 32UL);

 return remap_pfn_range(vma, from, phys_base >> 13, size, prot);
}


# 1 "./arch/sparc/include/asm/tlbflush.h" 1



# 1 "./arch/sparc/include/asm/tlbflush_64.h" 1



# 1 "./arch/sparc/include/asm/mmu_context.h" 1



# 1 "./arch/sparc/include/asm/mmu_context_64.h" 1
# 10 "./arch/sparc/include/asm/mmu_context_64.h"
# 1 "include/asm-generic/mm_hooks.h" 1
# 9 "include/asm-generic/mm_hooks.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_dup_mmap(struct mm_struct *oldmm,
     struct mm_struct *mm)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_exit_mmap(struct mm_struct *mm)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_unmap(struct mm_struct *mm,
   struct vm_area_struct *vma,
   unsigned long start, unsigned long end)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_bprm_mm_init(struct mm_struct *mm,
         struct vm_area_struct *vma)
{
}
# 11 "./arch/sparc/include/asm/mmu_context_64.h" 2

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}

extern spinlock_t ctx_alloc_lock;
extern unsigned long tlb_context_cache;
extern unsigned long mmu_context_bmap[];

void get_new_mmu_context(struct mm_struct *mm);

void smp_new_mmu_context_version(void);




int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
void destroy_context(struct mm_struct *mm);

void __tsb_context_switch(unsigned long pgd_pa,
     struct tsb_config *tsb_base,
     struct tsb_config *tsb_huge,
     unsigned long tsb_descr_pa);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tsb_context_switch(struct mm_struct *mm)
{
 __tsb_context_switch(((unsigned long)(mm->pgd) - PAGE_OFFSET),
        &mm->context.tsb_block[0],

        (mm->context.tsb_block[1].tsb ?
         &mm->context.tsb_block[1] :
         ((void *)0))



        , ((unsigned long)(&mm->context.tsb_descr[0]) - PAGE_OFFSET));
}

void tsb_grow(struct mm_struct *mm,
       unsigned long tsb_index,
       unsigned long mm_rss);

void smp_tsb_sync(struct mm_struct *mm);
# 71 "./arch/sparc/include/asm/mmu_context_64.h"
void __flush_tlb_mm(unsigned long, unsigned long);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, struct task_struct *tsk)
{
 unsigned long ctx_valid, flags;
 int cpu;

 if (__builtin_expect(!!(mm == &init_mm), 0))
  return;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(&mm->context.lock)); } while (0); } while (0);
 ctx_valid = (!(((mm->context.sparc64_ctx_val) ^ tlb_context_cache) & ((~0UL) << 22)));
 if (!ctx_valid)
  get_new_mmu_context(mm);
# 117 "./arch/sparc/include/asm/mmu_context_64.h"
 __asm__ __volatile__( "\n661:	stxa		%0, [%1] %2\n" "	.section	.sun4v_1insn_patch, \"ax\"\n" "	.word		661b\n" "	stxa		%0, [%1] %3\n" "	.previous\n" "	flush		%%g6\n" : : "r" ((((mm)->context.sparc64_ctx_val) & ((((1UL) << 13) - (1UL)) | (((0x7UL) << 16) | ((0x7UL) << 19))))), "r" (0x0000000000000010), "i" (0x58), "i" (0x21));
 tsb_context_switch(mm);





 cpu = ((current_thread_info_reg)->cpu);
 if (!ctx_valid || !test_bit(cpumask_check(cpu), (((mm_cpumask(mm)))->bits))) {
  cpumask_set_cpu(cpu, mm_cpumask(mm));
  __flush_tlb_mm(((mm->context.sparc64_ctx_val) & ((((1UL) << 13) - (1UL)) | (((0x7UL) << 16) | ((0x7UL) << 19)))),
          0x0000000000000010);
 }
 spin_unlock_irqrestore(&mm->context.lock, flags);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void activate_mm(struct mm_struct *active_mm, struct mm_struct *mm)
{
 unsigned long flags;
 int cpu;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(&mm->context.lock)); } while (0); } while (0);
 if (!(!(((mm->context.sparc64_ctx_val) ^ tlb_context_cache) & ((~0UL) << 22))))
  get_new_mmu_context(mm);
 cpu = ((current_thread_info_reg)->cpu);
 if (!test_bit(cpumask_check(cpu), (((mm_cpumask(mm)))->bits)))
  cpumask_set_cpu(cpu, mm_cpumask(mm));

 __asm__ __volatile__( "\n661:	stxa		%0, [%1] %2\n" "	.section	.sun4v_1insn_patch, \"ax\"\n" "	.word		661b\n" "	stxa		%0, [%1] %3\n" "	.previous\n" "	flush		%%g6\n" : : "r" ((((mm)->context.sparc64_ctx_val) & ((((1UL) << 13) - (1UL)) | (((0x7UL) << 16) | ((0x7UL) << 19))))), "r" (0x0000000000000010), "i" (0x58), "i" (0x21));
 __flush_tlb_mm(((mm->context.sparc64_ctx_val) & ((((1UL) << 13) - (1UL)) | (((0x7UL) << 16) | ((0x7UL) << 19)))), 0x0000000000000010);
 tsb_context_switch(mm);
 spin_unlock_irqrestore(&mm->context.lock, flags);
}
# 5 "./arch/sparc/include/asm/mmu_context.h" 2
# 5 "./arch/sparc/include/asm/tlbflush_64.h" 2





struct tlb_batch {
 struct mm_struct *mm;
 unsigned long tlb_nr;
 unsigned long active;
 unsigned long vaddrs[192];
};

void flush_tsb_kernel_range(unsigned long start, unsigned long end);
void flush_tsb_user(struct tlb_batch *tb);
void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr);



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flush_tlb_mm(struct mm_struct *mm)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flush_tlb_page(struct vm_area_struct *vma,
      unsigned long vmaddr)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flush_tlb_range(struct vm_area_struct *vma,
       unsigned long start, unsigned long end)
{
}

void flush_tlb_kernel_range(unsigned long start, unsigned long end);



void flush_tlb_pending(void);
void arch_enter_lazy_mmu_mode(void);
void arch_leave_lazy_mmu_mode(void);



void __flush_tlb_all(void);
void __flush_tlb_page(unsigned long context, unsigned long vaddr);
void __flush_tlb_kernel_range(unsigned long start, unsigned long end);
# 60 "./arch/sparc/include/asm/tlbflush_64.h"
void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end);
void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr);
# 5 "./arch/sparc/include/asm/tlbflush.h" 2
# 968 "./arch/sparc/include/asm/pgtable_64.h" 2
# 1 "include/asm-generic/pgtable.h" 1
# 21 "include/asm-generic/pgtable.h"
extern int ptep_set_access_flags(struct vm_area_struct *vma,
     unsigned long address, pte_t *ptep,
     pte_t entry, int dirty);



extern int pmdp_set_access_flags(struct vm_area_struct *vma,
     unsigned long address, pmd_t *pmdp,
     pmd_t entry, int dirty);



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ptep_test_and_clear_young(struct vm_area_struct *vma,
         unsigned long address,
         pte_t *ptep)
{
 pte_t pte = *ptep;
 int r = 1;
 if (!pte_young(pte))
  r = 0;
 else
  __set_pte_at((vma->vm_mm), (address), (ptep), (pte_mkold(pte)), 0);
 return r;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmdp_test_and_clear_young(struct vm_area_struct *vma,
         unsigned long address,
         pmd_t *pmdp)
{
 pmd_t pmd = *pmdp;
 int r = 1;
 if (!pmd_young(pmd))
  r = 0;
 else
  set_pmd_at(vma->vm_mm, address, pmdp, pmd_mkold(pmd));
 return r;
}
# 73 "include/asm-generic/pgtable.h"
int ptep_clear_flush_young(struct vm_area_struct *vma,
      unsigned long address, pte_t *ptep);



int pmdp_clear_flush_young(struct vm_area_struct *vma,
      unsigned long address, pmd_t *pmdp);



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t ptep_get_and_clear(struct mm_struct *mm,
           unsigned long address,
           pte_t *ptep)
{
 pte_t pte = *ptep;
 __set_pte_at(((mm)), ((address)), ((ptep)), (((pte_t) { (0UL) } )), 0);
 return pte;
}
# 108 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmdp_get_and_clear_full(struct mm_struct *mm,
         unsigned long address, pmd_t *pmdp,
         int full)
{
 return pmdp_get_and_clear(mm, address, pmdp);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t ptep_get_and_clear_full(struct mm_struct *mm,
         unsigned long address, pte_t *ptep,
         int full)
{
 pte_t pte;
 pte = ptep_get_and_clear(mm, address, ptep);
 return pte;
}
# 144 "include/asm-generic/pgtable.h"
extern pte_t ptep_clear_flush(struct vm_area_struct *vma,
         unsigned long address,
         pte_t *ptep);



extern pmd_t pmdp_clear_flush(struct vm_area_struct *vma,
         unsigned long address,
         pmd_t *pmdp);



struct mm_struct;
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep)
{
 pte_t old_pte = *ptep;
 __set_pte_at((mm), (address), (ptep), (pte_wrprotect(old_pte)), 0);
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pmdp_set_wrprotect(struct mm_struct *mm,
          unsigned long address, pmd_t *pmdp)
{
 pmd_t old_pmd = *pmdp;
 set_pmd_at(mm, address, pmdp, pmd_wrprotect(old_pmd));
}
# 182 "include/asm-generic/pgtable.h"
extern void pmdp_splitting_flush(struct vm_area_struct *vma,
     unsigned long address, pmd_t *pmdp);
# 201 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_same(pte_t pte_a, pte_t pte_b)
{
 return ((pte_a).pte) == ((pte_b).pte);
}
# 214 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_unused(pte_t pte)
{
 return 0;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
{
 return ((pmd_a).pmd) == ((pmd_b).pmd);
}
# 265 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
{
 if (((oldprot).pgprot) == ((pgprot_noncached(oldprot)).pgprot))
  newprot = pgprot_noncached(newprot);
 if (((oldprot).pgprot) == ((pgprot_noncached(oldprot)).pgprot))
  newprot = pgprot_noncached(newprot);
 if (((oldprot).pgprot) == ((pgprot_noncached(oldprot)).pgprot))
  newprot = pgprot_noncached(newprot);
 return newprot;
}
# 307 "include/asm-generic/pgtable.h"
void pgd_clear_bad(pgd_t *);
void pud_clear_bad(pud_t *);
void pmd_clear_bad(pmd_t *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pgd_none_or_clear_bad(pgd_t *pgd)
{
 if ((!((*pgd).pgd)))
  return 1;
 if (__builtin_expect(!!((((*pgd).pgd) & ~(~(((1UL) << 13)-1)))), 0)) {
  pgd_clear_bad(pgd);
  return 1;
 }
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pud_none_or_clear_bad(pud_t *pud)
{
 if ((!((*pud).pud)))
  return 1;
 if (__builtin_expect(!!((((*pud).pud) & ~(~(((1UL) << 13)-1)))), 0)) {
  pud_clear_bad(pud);
  return 1;
 }
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_none_or_clear_bad(pmd_t *pmd)
{
 if ((!((*pmd).pmd)))
  return 1;
 if (__builtin_expect(!!((((*pmd).pmd) & ~(~(((1UL) << 13)-1)))), 0)) {
  pmd_clear_bad(pmd);
  return 1;
 }
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t __ptep_modify_prot_start(struct mm_struct *mm,
          unsigned long addr,
          pte_t *ptep)
{





 return ptep_get_and_clear(mm, addr, ptep);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ptep_modify_prot_commit(struct mm_struct *mm,
          unsigned long addr,
          pte_t *ptep, pte_t pte)
{




 __set_pte_at((mm), (addr), (ptep), (pte), 0);
}
# 382 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t ptep_modify_prot_start(struct mm_struct *mm,
        unsigned long addr,
        pte_t *ptep)
{
 return __ptep_modify_prot_start(mm, addr, ptep);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptep_modify_prot_commit(struct mm_struct *mm,
        unsigned long addr,
        pte_t *ptep, pte_t pte)
{
 __ptep_modify_prot_commit(mm, addr, ptep, pte);
}
# 439 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_soft_dirty(pte_t pte)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_soft_dirty(pmd_t pmd)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mksoft_dirty(pte_t pte)
{
 return pte;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mksoft_dirty(pmd_t pmd)
{
 return pmd;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_swp_mksoft_dirty(pte_t pte)
{
 return pte;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_swp_soft_dirty(pte_t pte)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_swp_clear_soft_dirty(pte_t pte)
{
 return pte;
}
# 486 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int track_pfn_remap(struct vm_area_struct *vma, pgprot_t *prot,
      unsigned long pfn, unsigned long addr,
      unsigned long size)
{
 return 0;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
       unsigned long pfn)
{
 return 0;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int track_pfn_copy(struct vm_area_struct *vma)
{
 return 0;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void untrack_pfn(struct vm_area_struct *vma,
          unsigned long pfn, unsigned long size)
{
}
# 543 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_zero_pfn(unsigned long pfn)
{
 extern unsigned long zero_pfn;
 return pfn == zero_pfn;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long my_zero_pfn(unsigned long addr)
{
 extern unsigned long zero_pfn;
 return zero_pfn;
}
# 577 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_read_atomic(pmd_t *pmdp)
{





 return *pmdp;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
      spinlock_t *old_pmd_ptl)
{




 return new_pmd_ptl != old_pmd_ptl;
}
# 621 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd)
{
 pmd_t pmdval = pmd_read_atomic(pmd);
# 639 "include/asm-generic/pgtable.h"
 __asm__ __volatile__("": : :"memory");

 if ((!((pmdval).pmd)) || pmd_trans_huge(pmdval))
  return 1;
 if (__builtin_expect(!!((((pmdval).pmd) & ~(~(((1UL) << 13)-1)))), 0)) {
  pmd_clear_bad(pmd);
  return 1;
 }
 return 0;
}
# 663 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_trans_unstable(pmd_t *pmd)
{

 return pmd_none_or_trans_huge_or_clear_bad(pmd);



}
# 681 "include/asm-generic/pgtable.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_protnone(pte_t pte)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_protnone(pmd_t pmd)
{
 return 0;
}
# 969 "./arch/sparc/include/asm/pgtable_64.h" 2
# 979 "./arch/sparc/include/asm/pgtable_64.h"
unsigned long get_fb_unmapped_area(struct file *filp, unsigned long,
       unsigned long, unsigned long,
       unsigned long);


void pgtable_cache_init(void);
void sun4v_register_fault_status(void);
void sun4v_ktsb_register(void);
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) cheetah_ecache_flush_init(void);
void sun4v_patch_tlb_handlers(void);

extern unsigned long cmdline_memory_size;

 void do_sparc64_fault(struct pt_regs *regs);
# 5 "./arch/sparc/include/asm/pgtable.h" 2
# 54 "include/linux/mm.h" 2
# 71 "include/linux/mm.h"
extern unsigned long sysctl_user_reserve_kbytes;
extern unsigned long sysctl_admin_reserve_kbytes;

extern int sysctl_overcommit_memory;
extern int sysctl_overcommit_ratio;
extern unsigned long sysctl_overcommit_kbytes;

extern int overcommit_ratio_handler(struct ctl_table *, int, void *,
        size_t *, loff_t *);
extern int overcommit_kbytes_handler(struct ctl_table *, int, void *,
        size_t *, loff_t *);
# 100 "include/linux/mm.h"
extern struct kmem_cache *vm_area_cachep;
# 205 "include/linux/mm.h"
extern pgprot_t protection_map[16];
# 222 "include/linux/mm.h"
struct vm_fault {
 unsigned int flags;
 unsigned long pgoff;
 void *virtual_address;

 struct page *cow_page;
 struct page *page;





 unsigned long max_pgoff;

 pte_t *pte;
};






struct vm_operations_struct {
 void (*open)(struct vm_area_struct * area);
 void (*close)(struct vm_area_struct * area);
 int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf);
 void (*map_pages)(struct vm_area_struct *vma, struct vm_fault *vmf);



 int (*page_mkwrite)(struct vm_area_struct *vma, struct vm_fault *vmf);




 int (*access)(struct vm_area_struct *vma, unsigned long addr,
        void *buf, int len, int write);




 const char *(*name)(struct vm_area_struct *vma);
# 273 "include/linux/mm.h"
 int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new);
# 285 "include/linux/mm.h"
 struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
     unsigned long addr);






 struct page *(*find_special_page)(struct vm_area_struct *vma,
       unsigned long addr);
};

struct mmu_gather;
struct inode;





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_freepage_migratetype(struct page *page, int migratetype)
{
 page->index = migratetype;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_freepage_migratetype(struct page *page)
{
 return page->index;
}





# 1 "include/linux/page-flags.h" 1
# 74 "include/linux/page-flags.h"
enum pageflags {
 PG_locked,
 PG_error,
 PG_referenced,
 PG_uptodate,
 PG_dirty,
 PG_lru,
 PG_active,
 PG_slab,
 PG_owner_priv_1,
 PG_arch_1,
 PG_reserved,
 PG_private,
 PG_private_2,
 PG_writeback,

 PG_head,
 PG_tail,



 PG_swapcache,
 PG_mappedtodisk,
 PG_reclaim,
 PG_swapbacked,
 PG_unevictable,

 PG_mlocked,
# 110 "include/linux/page-flags.h"
 PG_compound_lock,

 __NR_PAGEFLAGS,


 PG_checked = PG_owner_priv_1,





 PG_fscache = PG_private_2,



 PG_pinned = PG_owner_priv_1,

 PG_savepinned = PG_dirty,

 PG_foreign = PG_owner_priv_1,


 PG_slob_free = PG_private,
};
# 208 "include/linux/page-flags.h"
struct page;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageLocked(const struct page *page) { return test_bit(PG_locked, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageError(const struct page *page) { return test_bit(PG_error, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageError(struct page *page) { set_bit(PG_error, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageError(struct page *page) { clear_bit(PG_error, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageError(struct page *page) { return test_and_clear_bit(PG_error, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageReferenced(const struct page *page) { return test_bit(PG_referenced, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageReferenced(struct page *page) { set_bit(PG_referenced, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageReferenced(struct page *page) { clear_bit(PG_referenced, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageReferenced(struct page *page) { return test_and_clear_bit(PG_referenced, &page->flags); }
 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageReferenced(struct page *page) { __set_bit(PG_referenced, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageDirty(const struct page *page) { return test_bit(PG_dirty, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageDirty(struct page *page) { set_bit(PG_dirty, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageDirty(struct page *page) { clear_bit(PG_dirty, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPageDirty(struct page *page) { return test_and_set_bit(PG_dirty, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageDirty(struct page *page) { return test_and_clear_bit(PG_dirty, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageDirty(struct page *page) { __clear_bit(PG_dirty, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageLRU(const struct page *page) { return test_bit(PG_lru, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageLRU(struct page *page) { set_bit(PG_lru, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageLRU(struct page *page) { clear_bit(PG_lru, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageLRU(struct page *page) { __clear_bit(PG_lru, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageActive(const struct page *page) { return test_bit(PG_active, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageActive(struct page *page) { set_bit(PG_active, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageActive(struct page *page) { clear_bit(PG_active, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageActive(struct page *page) { __clear_bit(PG_active, &page->flags); }
 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageActive(struct page *page) { return test_and_clear_bit(PG_active, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSlab(const struct page *page) { return test_bit(PG_slab, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageSlab(struct page *page) { __set_bit(PG_slab, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageSlab(struct page *page) { __clear_bit(PG_slab, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageChecked(const struct page *page) { return test_bit(PG_checked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageChecked(struct page *page) { set_bit(PG_checked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageChecked(struct page *page) { clear_bit(PG_checked, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PagePinned(const struct page *page) { return test_bit(PG_pinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPagePinned(struct page *page) { set_bit(PG_pinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPagePinned(struct page *page) { clear_bit(PG_pinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPagePinned(struct page *page) { return test_and_set_bit(PG_pinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPagePinned(struct page *page) { return test_and_clear_bit(PG_pinned, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSavePinned(const struct page *page) { return test_bit(PG_savepinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageSavePinned(struct page *page) { set_bit(PG_savepinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageSavePinned(struct page *page) { clear_bit(PG_savepinned, &page->flags); };
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageForeign(const struct page *page) { return test_bit(PG_foreign, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageForeign(struct page *page) { set_bit(PG_foreign, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageForeign(struct page *page) { clear_bit(PG_foreign, &page->flags); };
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageReserved(const struct page *page) { return test_bit(PG_reserved, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageReserved(struct page *page) { set_bit(PG_reserved, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageReserved(struct page *page) { clear_bit(PG_reserved, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageReserved(struct page *page) { __clear_bit(PG_reserved, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSwapBacked(const struct page *page) { return test_bit(PG_swapbacked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageSwapBacked(struct page *page) { set_bit(PG_swapbacked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageSwapBacked(struct page *page) { clear_bit(PG_swapbacked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageSwapBacked(struct page *page) { __clear_bit(PG_swapbacked, &page->flags); }
 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageSwapBacked(struct page *page) { __set_bit(PG_swapbacked, &page->flags); }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSlobFree(const struct page *page) { return test_bit(PG_slob_free, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageSlobFree(struct page *page) { __set_bit(PG_slob_free, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageSlobFree(struct page *page) { __clear_bit(PG_slob_free, &page->flags); }






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PagePrivate(const struct page *page) { return test_bit(PG_private, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPagePrivate(struct page *page) { set_bit(PG_private, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPagePrivate(struct page *page) { clear_bit(PG_private, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPagePrivate(struct page *page) { __set_bit(PG_private, &page->flags); }
 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPagePrivate(struct page *page) { __clear_bit(PG_private, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PagePrivate2(const struct page *page) { return test_bit(PG_private_2, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPagePrivate2(struct page *page) { set_bit(PG_private_2, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPagePrivate2(struct page *page) { clear_bit(PG_private_2, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPagePrivate2(struct page *page) { return test_and_set_bit(PG_private_2, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPagePrivate2(struct page *page) { return test_and_clear_bit(PG_private_2, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageOwnerPriv1(const struct page *page) { return test_bit(PG_owner_priv_1, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageOwnerPriv1(struct page *page) { set_bit(PG_owner_priv_1, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageOwnerPriv1(struct page *page) { clear_bit(PG_owner_priv_1, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageOwnerPriv1(struct page *page) { return test_and_clear_bit(PG_owner_priv_1, &page->flags); }





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageWriteback(const struct page *page) { return test_bit(PG_writeback, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPageWriteback(struct page *page) { return test_and_set_bit(PG_writeback, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageWriteback(struct page *page) { return test_and_clear_bit(PG_writeback, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageMappedToDisk(const struct page *page) { return test_bit(PG_mappedtodisk, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageMappedToDisk(struct page *page) { set_bit(PG_mappedtodisk, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageMappedToDisk(struct page *page) { clear_bit(PG_mappedtodisk, &page->flags); }


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageReclaim(const struct page *page) { return test_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageReclaim(struct page *page) { set_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageReclaim(struct page *page) { clear_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageReclaim(struct page *page) { return test_and_clear_bit(PG_reclaim, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageReadahead(const struct page *page) { return test_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageReadahead(struct page *page) { set_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageReadahead(struct page *page) { clear_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageReadahead(struct page *page) { return test_and_clear_bit(PG_reclaim, &page->flags); }
# 257 "include/linux/page-flags.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageHighMem(const struct page *page) { return 0; } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageHighMem(struct page *page) { } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageHighMem(struct page *page) { }



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSwapCache(const struct page *page) { return test_bit(PG_swapcache, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageSwapCache(struct page *page) { set_bit(PG_swapcache, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageSwapCache(struct page *page) { clear_bit(PG_swapcache, &page->flags); }




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageUnevictable(const struct page *page) { return test_bit(PG_unevictable, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageUnevictable(struct page *page) { set_bit(PG_unevictable, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageUnevictable(struct page *page) { clear_bit(PG_unevictable, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageUnevictable(struct page *page) { __clear_bit(PG_unevictable, &page->flags); }
 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageUnevictable(struct page *page) { return test_and_clear_bit(PG_unevictable, &page->flags); }


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageMlocked(const struct page *page) { return test_bit(PG_mlocked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageMlocked(struct page *page) { set_bit(PG_mlocked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageMlocked(struct page *page) { clear_bit(PG_mlocked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageMlocked(struct page *page) { __clear_bit(PG_mlocked, &page->flags); }
 static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPageMlocked(struct page *page) { return test_and_set_bit(PG_mlocked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageMlocked(struct page *page) { return test_and_clear_bit(PG_mlocked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __TestClearPageMlocked(struct page *page) { return __test_and_clear_bit(PG_mlocked, &page->flags); }
# 280 "include/linux/page-flags.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageUncached(const struct page *page) { return 0; } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageUncached(struct page *page) { } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageUncached(struct page *page) { }







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageHWPoison(const struct page *page) { return 0; } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageHWPoison(struct page *page) { } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageHWPoison(struct page *page) { }



u64 stable_page_flags(struct page *page);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageUptodate(struct page *page)
{
 int ret = test_bit(PG_uptodate, &(page)->flags);
# 306 "include/linux/page-flags.h"
 if (ret)
  __asm__ __volatile__("":::"memory");

 return ret;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageUptodate(struct page *page)
{
 __asm__ __volatile__("":::"memory");
 __set_bit(PG_uptodate, &(page)->flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageUptodate(struct page *page)
{





 __asm__ __volatile__("":::"memory");
 set_bit(PG_uptodate, &(page)->flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageUptodate(struct page *page) { clear_bit(PG_uptodate, &page->flags); }

extern void cancel_dirty_page(struct page *page, unsigned int account_size);

int test_clear_page_writeback(struct page *page);
int __test_set_page_writeback(struct page *page, bool keep_write);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_writeback(struct page *page)
{
 __test_set_page_writeback(page, false);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_writeback_keepwrite(struct page *page)
{
 __test_set_page_writeback(page, true);
}
# 360 "include/linux/page-flags.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageHead(const struct page *page) { return test_bit(PG_head, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageHead(struct page *page) { __set_bit(PG_head, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageHead(struct page *page) { __clear_bit(PG_head, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageHead(struct page *page) { clear_bit(PG_head, &page->flags); }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageTail(const struct page *page) { return test_bit(PG_tail, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageTail(struct page *page) { __set_bit(PG_tail, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageTail(struct page *page) { __clear_bit(PG_tail, &page->flags); }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageCompound(struct page *page)
{
 return page->flags & ((1L << PG_head) | (1L << PG_tail));

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageCompound(struct page *page)
{
 do { if (__builtin_expect(!!(!PageHead(page)), 0)) do { do_BUG("include/linux/page-flags.h", 371); __builtin_trap(); } while (0); } while (0);
 ClearPageHead(page);
}
# 440 "include/linux/page-flags.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageTransHuge(struct page *page)
{
 ((void)(sizeof(( long)(PageTail(page)))));
 return PageHead(page);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageTransCompound(struct page *page)
{
 return PageCompound(page);
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageTransTail(struct page *page)
{
 return PageTail(page);
}
# 488 "include/linux/page-flags.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSlabPfmemalloc(struct page *page)
{
 ((void)(sizeof(( long)(!PageSlab(page)))));
 return PageActive(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageSlabPfmemalloc(struct page *page)
{
 ((void)(sizeof(( long)(!PageSlab(page)))));
 SetPageActive(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageSlabPfmemalloc(struct page *page)
{
 ((void)(sizeof(( long)(!PageSlab(page)))));
 __ClearPageActive(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageSlabPfmemalloc(struct page *page)
{
 ((void)(sizeof(( long)(!PageSlab(page)))));
 ClearPageActive(page);
}
# 552 "include/linux/page-flags.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_has_private(struct page *page)
{
 return !!(page->flags & (1 << PG_private | 1 << PG_private_2));
}
# 320 "include/linux/mm.h" 2
# 1 "include/linux/huge_mm.h" 1



extern int do_huge_pmd_anonymous_page(struct mm_struct *mm,
          struct vm_area_struct *vma,
          unsigned long address, pmd_t *pmd,
          unsigned int flags);
extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm,
    pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr,
    struct vm_area_struct *vma);
extern void huge_pmd_set_accessed(struct mm_struct *mm,
      struct vm_area_struct *vma,
      unsigned long address, pmd_t *pmd,
      pmd_t orig_pmd, int dirty);
extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
          unsigned long address, pmd_t *pmd,
          pmd_t orig_pmd);
extern struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
       unsigned long addr,
       pmd_t *pmd,
       unsigned int flags);
extern int zap_huge_pmd(struct mmu_gather *tlb,
   struct vm_area_struct *vma,
   pmd_t *pmd, unsigned long addr);
extern int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
   unsigned long addr, unsigned long end,
   unsigned char *vec);
extern int move_huge_pmd(struct vm_area_struct *vma,
    struct vm_area_struct *new_vma,
    unsigned long old_addr,
    unsigned long new_addr, unsigned long old_end,
    pmd_t *old_pmd, pmd_t *new_pmd);
extern int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
   unsigned long addr, pgprot_t newprot,
   int prot_numa);

enum transparent_hugepage_flag {
 TRANSPARENT_HUGEPAGE_FLAG,
 TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,
 TRANSPARENT_HUGEPAGE_DEFRAG_FLAG,
 TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG,
 TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG,
 TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG,



};

enum page_check_address_pmd_flag {
 PAGE_CHECK_ADDRESS_PMD_FLAG,
 PAGE_CHECK_ADDRESS_PMD_NOTSPLITTING_FLAG,
 PAGE_CHECK_ADDRESS_PMD_SPLITTING_FLAG,
};
extern pmd_t *page_check_address_pmd(struct page *page,
         struct mm_struct *mm,
         unsigned long address,
         enum page_check_address_pmd_flag flag,
         spinlock_t **ptl);
# 68 "include/linux/huge_mm.h"
extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
# 95 "include/linux/huge_mm.h"
extern unsigned long transparent_hugepage_flags;
extern int split_huge_page_to_list(struct page *page, struct list_head *list);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int split_huge_page(struct page *page)
{
 return split_huge_page_to_list(page, ((void *)0));
}
extern void __split_huge_page_pmd(struct vm_area_struct *vma,
  unsigned long address, pmd_t *pmd);
# 118 "include/linux/huge_mm.h"
extern void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address,
  pmd_t *pmd);



extern int hugepage_madvise(struct vm_area_struct *vma,
       unsigned long *vm_flags, int advice);
extern void __vma_adjust_trans_huge(struct vm_area_struct *vma,
        unsigned long start,
        unsigned long end,
        long adjust_next);
extern int __pmd_trans_huge_lock(pmd_t *pmd, struct vm_area_struct *vma,
  spinlock_t **ptl);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_trans_huge_lock(pmd_t *pmd, struct vm_area_struct *vma,
  spinlock_t **ptl)
{
 ((void)(sizeof(( long)(!rwsem_is_locked(&vma->vm_mm->mmap_sem)))));
 if (pmd_trans_huge(*pmd))
  return __pmd_trans_huge_lock(pmd, vma, ptl);
 else
  return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vma_adjust_trans_huge(struct vm_area_struct *vma,
      unsigned long start,
      unsigned long end,
      long adjust_next)
{
 if (!vma->anon_vma || vma->vm_ops)
  return;
 __vma_adjust_trans_huge(vma, start, end, adjust_next);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hpage_nr_pages(struct page *page)
{
 if (__builtin_expect(!!(PageTransHuge(page)), 0))
  return (1<<((13 + (13 -3))-13));
 return 1;
}

extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
    unsigned long addr, pmd_t pmd, pmd_t *pmdp);

extern struct page *huge_zero_page;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_huge_zero_page(struct page *page)
{
 return (*({ __attribute__((unused)) typeof(huge_zero_page) __var = ( typeof(huge_zero_page)) 0; (volatile typeof(huge_zero_page) *)&(huge_zero_page); })) == page;
}
# 321 "include/linux/mm.h" 2
# 338 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int put_page_testzero(struct page *page)
{
 ((void)(sizeof(( long)((*({ __attribute__((unused)) typeof((&page->_count)->counter) __var = ( typeof((&page->_count)->counter)) 0; (volatile typeof((&page->_count)->counter) *)&((&page->_count)->counter); })) == 0))));
 return (atomic_sub_return(1, &page->_count) == 0);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_page_unless_zero(struct page *page)
{
 return atomic_add_unless((&page->_count), 1, 0);
}
# 362 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int put_page_unless_one(struct page *page)
{
 return atomic_add_unless(&page->_count, -1, 1);
}

extern int page_is_ram(unsigned long pfn);
extern int region_is_ram(resource_size_t phys_addr, unsigned long size);


struct page *vmalloc_to_page(const void *addr);
unsigned long vmalloc_to_pfn(const void *addr);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_vmalloc_addr(const void *x)
{

 unsigned long addr = (unsigned long)x;

 return addr >= (0x0000000100000000UL) && addr < VMALLOC_END;



}

extern int is_vmalloc_or_module_addr(const void *x);







extern void kvfree(const void *addr);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void compound_lock(struct page *page)
{

 ((void)(sizeof(( long)(PageSlab(page)))));
 bit_spin_lock(PG_compound_lock, &page->flags);

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void compound_unlock(struct page *page)
{

 ((void)(sizeof(( long)(PageSlab(page)))));
 bit_spin_unlock(PG_compound_lock, &page->flags);

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long compound_lock_irqsave(struct page *page)
{
 unsigned long flags = flags;

 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); do { } while (0); } while (0);
 compound_lock(page);

 return flags;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void compound_unlock_irqrestore(struct page *page,
           unsigned long flags)
{

 compound_unlock(page);
 do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *compound_head_by_tail(struct page *tail)
{
 struct page *head = tail->first_page;






 __asm__ __volatile__("":::"memory");
 if (__builtin_expect(!!(PageTail(tail)), 1))
  return head;
 return tail;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *compound_head(struct page *page)
{
 if (__builtin_expect(!!(PageTail(page)), 0))
  return compound_head_by_tail(page);
 return page;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *compound_head_fast(struct page *page)
{
 if (__builtin_expect(!!(PageTail(page)), 0))
  return page->first_page;
 return page;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_mapcount_reset(struct page *page)
{
 (((&(page)->_mapcount)->counter) = -1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_mapcount(struct page *page)
{
 ((void)(sizeof(( long)(PageSlab(page)))));
 return (*({ __attribute__((unused)) typeof((&page->_mapcount)->counter) __var = ( typeof((&page->_mapcount)->counter)) 0; (volatile typeof((&page->_mapcount)->counter) *)&((&page->_mapcount)->counter); })) + 1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_count(struct page *page)
{
 return (*({ __attribute__((unused)) typeof((&compound_head(page)->_count)->counter) __var = ( typeof((&compound_head(page)->_count)->counter)) 0; (volatile typeof((&compound_head(page)->_count)->counter) *)&((&compound_head(page)->_count)->counter); }));
}


extern int PageHeadHuge(struct page *page_head);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __compound_tail_refcounted(struct page *page)
{
 return !PageSlab(page) && !PageHeadHuge(page);
}
# 519 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool compound_tail_refcounted(struct page *page)
{
 ((void)(sizeof(( long)(!PageHead(page)))));
 return __compound_tail_refcounted(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_huge_page_tail(struct page *page)
{



 ((void)(sizeof(( long)(!PageTail(page)))));
 ((void)(sizeof(( long)(page_mapcount(page) < 0))));
 ((void)(sizeof(( long)((*({ __attribute__((unused)) typeof((&page->_count)->counter) __var = ( typeof((&page->_count)->counter)) 0; (volatile typeof((&page->_count)->counter) *)&((&page->_count)->counter); })) != 0))));
 if (compound_tail_refcounted(page->first_page))
  atomic_add(1, &page->_mapcount);
}

extern bool __get_page_tail(struct page *page);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_page(struct page *page)
{
 if (__builtin_expect(!!(PageTail(page)), 0))
  if (__builtin_expect(!!(__get_page_tail(page)), 1))
   return;




 ((void)(sizeof(( long)((*({ __attribute__((unused)) typeof((&page->_count)->counter) __var = ( typeof((&page->_count)->counter)) 0; (volatile typeof((&page->_count)->counter) *)&((&page->_count)->counter); })) <= 0))));
 atomic_add(1, &page->_count);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *virt_to_head_page(const void *x)
{
 struct page *page = (((struct page *)VMALLOC_END) + (((unsigned long)(x) - PAGE_OFFSET)>>13));







 return compound_head_fast(page);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_page_count(struct page *page)
{
 (((&page->_count)->counter) = 1);
}
# 585 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageBuddy(struct page *page)
{
 return (*({ __attribute__((unused)) typeof((&page->_mapcount)->counter) __var = ( typeof((&page->_mapcount)->counter)) 0; (volatile typeof((&page->_mapcount)->counter) *)&((&page->_mapcount)->counter); })) == (-128);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageBuddy(struct page *page)
{
 ((void)(sizeof(( long)((*({ __attribute__((unused)) typeof((&page->_mapcount)->counter) __var = ( typeof((&page->_mapcount)->counter)) 0; (volatile typeof((&page->_mapcount)->counter) *)&((&page->_mapcount)->counter); })) != -1))));
 (((&page->_mapcount)->counter) = (-128));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageBuddy(struct page *page)
{
 ((void)(sizeof(( long)(!PageBuddy(page)))));
 (((&page->_mapcount)->counter) = -1);
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageBalloon(struct page *page)
{
 return (*({ __attribute__((unused)) typeof((&page->_mapcount)->counter) __var = ( typeof((&page->_mapcount)->counter)) 0; (volatile typeof((&page->_mapcount)->counter) *)&((&page->_mapcount)->counter); })) == (-256);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageBalloon(struct page *page)
{
 ((void)(sizeof(( long)((*({ __attribute__((unused)) typeof((&page->_mapcount)->counter) __var = ( typeof((&page->_mapcount)->counter)) 0; (volatile typeof((&page->_mapcount)->counter) *)&((&page->_mapcount)->counter); })) != -1))));
 (((&page->_mapcount)->counter) = (-256));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageBalloon(struct page *page)
{
 ((void)(sizeof(( long)(!PageBalloon(page)))));
 (((&page->_mapcount)->counter) = -1);
}

void put_page(struct page *page);
void put_pages_list(struct list_head *pages);

void split_page(struct page *page, unsigned int order);
int split_free_page(struct page *page);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_compound_page_dtor(struct page *page,
      compound_page_dtor *dtor)
{
 page[1].compound_dtor = dtor;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) compound_page_dtor *get_compound_page_dtor(struct page *page)
{
 return page[1].compound_dtor;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int compound_order(struct page *page)
{
 if (!PageHead(page))
  return 0;
 return page[1].compound_order;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_compound_order(struct page *page, unsigned long order)
{
 page[1].compound_order = order;
}
# 663 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
{
 if (__builtin_expect(!!(vma->vm_flags & 0x00000002), 1))
  pte = pte_mkwrite(pte);
 return pte;
}

void do_set_pte(struct vm_area_struct *vma, unsigned long address,
  struct page *page, pte_t *pte, bool write, bool anon);
# 778 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum zone_type page_zonenum(const struct page *page)
{
 return (page->flags >> (((((sizeof(unsigned long)*8) - 0) - 4) - 1) * (1 != 0))) & ((1UL << 1) - 1);
}
# 795 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_zone_id(struct page *page)
{
 return (page->flags >> ((((((sizeof(unsigned long)*8) - 0) - 4) < ((((sizeof(unsigned long)*8) - 0) - 4) - 1))? (((sizeof(unsigned long)*8) - 0) - 4) : ((((sizeof(unsigned long)*8) - 0) - 4) - 1)) * ((4 + 1) != 0))) & ((1UL << (4 + 1)) - 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zone_to_nid(struct zone *zone)
{

 return zone->node;



}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_to_nid(const struct page *page)
{
 return (page->flags >> ((((sizeof(unsigned long)*8) - 0) - 4) * (4 != 0))) & ((1UL << 4) - 1);
}
# 886 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_cpupid_xchg_last(struct page *page, int cpupid)
{
 return page_to_nid(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_cpupid_last(struct page *page)
{
 return page_to_nid(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpupid_to_nid(int cpupid)
{
 return -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpupid_to_pid(int cpupid)
{
 return -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpupid_to_cpu(int cpupid)
{
 return -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_pid_to_cpupid(int nid, int pid)
{
 return -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpupid_pid_unset(int cpupid)
{
 return 1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_cpupid_reset_last(struct page *page)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpupid_match_pid(struct task_struct *task, int cpupid)
{
 return false;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zone *page_zone(const struct page *page)
{
 return &(node_data[page_to_nid(page)])->node_zones[page_zonenum(page)];
}
# 949 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_zone(struct page *page, enum zone_type zone)
{
 page->flags &= ~(((1UL << 1) - 1) << (((((sizeof(unsigned long)*8) - 0) - 4) - 1) * (1 != 0)));
 page->flags |= (zone & ((1UL << 1) - 1)) << (((((sizeof(unsigned long)*8) - 0) - 4) - 1) * (1 != 0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_node(struct page *page, unsigned long node)
{
 page->flags &= ~(((1UL << 4) - 1) << ((((sizeof(unsigned long)*8) - 0) - 4) * (4 != 0)));
 page->flags |= (node & ((1UL << 4) - 1)) << ((((sizeof(unsigned long)*8) - 0) - 4) * (4 != 0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_links(struct page *page, enum zone_type zone,
 unsigned long node, unsigned long pfn)
{
 set_page_zone(page, zone);
 set_page_node(page, node);



}




# 1 "include/linux/vmstat.h" 1





# 1 "include/linux/mm.h" 1
# 7 "include/linux/vmstat.h" 2

# 1 "include/linux/vm_event_item.h" 1
# 24 "include/linux/vm_event_item.h"
enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
  PGALLOC_NORMAL , PGALLOC_MOVABLE,
  PGFREE, PGACTIVATE, PGDEACTIVATE,
  PGFAULT, PGMAJFAULT,
  PGREFILL_NORMAL , PGREFILL_MOVABLE,
  PGSTEAL_KSWAPD_NORMAL , PGSTEAL_KSWAPD_MOVABLE,
  PGSTEAL_DIRECT_NORMAL , PGSTEAL_DIRECT_MOVABLE,
  PGSCAN_KSWAPD_NORMAL , PGSCAN_KSWAPD_MOVABLE,
  PGSCAN_DIRECT_NORMAL , PGSCAN_DIRECT_MOVABLE,
  PGSCAN_DIRECT_THROTTLE,

  PGSCAN_ZONE_RECLAIM_FAILED,

  PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL,
  KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY,
  PAGEOUTRUN, ALLOCSTALL, PGROTATED,
  DROP_PAGECACHE, DROP_SLAB,
# 49 "include/linux/vm_event_item.h"
  PGMIGRATE_SUCCESS, PGMIGRATE_FAIL,


  COMPACTMIGRATE_SCANNED, COMPACTFREE_SCANNED,
  COMPACTISOLATED,
  COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS,


  HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL,

  UNEVICTABLE_PGCULLED,
  UNEVICTABLE_PGSCANNED,
  UNEVICTABLE_PGRESCUED,
  UNEVICTABLE_PGMLOCKED,
  UNEVICTABLE_PGMUNLOCKED,
  UNEVICTABLE_PGCLEARED,
  UNEVICTABLE_PGSTRANDED,

  THP_FAULT_ALLOC,
  THP_FAULT_FALLBACK,
  THP_COLLAPSE_ALLOC,
  THP_COLLAPSE_ALLOC_FAILED,
  THP_SPLIT,
  THP_ZERO_PAGE_ALLOC,
  THP_ZERO_PAGE_ALLOC_FAILED,
# 95 "include/linux/vm_event_item.h"
  NR_VM_EVENT_ITEMS
};
# 9 "include/linux/vmstat.h" 2


extern int sysctl_stat_interval;
# 24 "include/linux/vmstat.h"
struct vm_event_state {
 unsigned long event[NR_VM_EVENT_ITEMS];
};

extern __attribute__((section(".data..percpu" ""))) __typeof__(struct vm_event_state) vm_event_states;





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __count_vm_event(enum vm_event_item item)
{
 do { do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(vm_event_states.event[item])) { case 1: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; } while (0);break; case 2: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; } while (0);break; case 4: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; } while (0);break; case 8: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void count_vm_event(enum vm_event_item item)
{
 do { do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(vm_event_states.event[item])) { case 1: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 2: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 4: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 8: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __count_vm_events(enum vm_event_item item, long delta)
{
 do { do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(vm_event_states.event[item])) { case 1: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; } while (0);break; case 2: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; } while (0);break; case 4: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; } while (0);break; case 8: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void count_vm_events(enum vm_event_item item, long delta)
{
 do { do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(vm_event_states.event[item])) { case 1: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 2: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 4: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 8: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__local_per_cpu_offset))); }); }) += delta; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
}

extern void all_vm_events(unsigned long *);

extern void vm_events_fold_cpu(int cpu);
# 111 "include/linux/vmstat.h"
extern atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void zone_page_state_add(long x, struct zone *zone,
     enum zone_stat_item item)
{
 atomic_long_add(x, &zone->vm_stat[item]);
 atomic_long_add(x, &vm_stat[item]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long global_page_state(enum zone_stat_item item)
{
 long x = atomic_long_read(&vm_stat[item]);

 if (x < 0)
  x = 0;

 return x;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long zone_page_state(struct zone *zone,
     enum zone_stat_item item)
{
 long x = atomic_long_read(&zone->vm_stat[item]);

 if (x < 0)
  x = 0;

 return x;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long zone_page_state_snapshot(struct zone *zone,
     enum zone_stat_item item)
{
 long x = atomic_long_read(&zone->vm_stat[item]);


 int cpu;
 for (((cpu)) = -1; ((cpu)) = cpumask_next(((cpu)), (cpu_online_mask)), ((cpu)) < nr_cpu_ids;)
  x += ({ do { const void *__vpp_verify = (typeof((zone->pageset) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*((zone->pageset))) *)((zone->pageset)))); (typeof((typeof(*((zone->pageset))) *)((zone->pageset)))) (__ptr + ((((trap_block[((cpu))].__per_cpu_base))))); }); })->vm_stat_diff[item];

 if (x < 0)
  x = 0;

 return x;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long node_page_state(int node,
     enum zone_stat_item item)
{
 struct zone *zones = (node_data[node])->node_zones;

 return
# 184 "include/linux/vmstat.h"
  zone_page_state(&zones[ZONE_NORMAL], item) +
  zone_page_state(&zones[ZONE_MOVABLE], item);
}

extern void zone_statistics(struct zone *, struct zone *, gfp_t gfp);
# 201 "include/linux/vmstat.h"
void __mod_zone_page_state(struct zone *, enum zone_stat_item item, int);
void __inc_zone_page_state(struct page *, enum zone_stat_item);
void __dec_zone_page_state(struct page *, enum zone_stat_item);

void mod_zone_page_state(struct zone *, enum zone_stat_item, int);
void inc_zone_page_state(struct page *, enum zone_stat_item);
void dec_zone_page_state(struct page *, enum zone_stat_item);

extern void inc_zone_state(struct zone *, enum zone_stat_item);
extern void __inc_zone_state(struct zone *, enum zone_stat_item);
extern void dec_zone_state(struct zone *, enum zone_stat_item);
extern void __dec_zone_state(struct zone *, enum zone_stat_item);

void cpu_vm_stats_fold(int cpu);
void refresh_zone_stat_thresholds(void);

void drain_zonestat(struct zone *zone, struct per_cpu_pageset *);

int calculate_pressure_threshold(struct zone *zone);
int calculate_normal_threshold(struct zone *zone);
void set_pgdat_percpu_threshold(pg_data_t *pgdat,
    int (*calculate_pressure)(struct zone *));
# 280 "include/linux/vmstat.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __mod_zone_freepage_state(struct zone *zone, int nr_pages,
          int migratetype)
{
 __mod_zone_page_state(zone, NR_FREE_PAGES, nr_pages);
 if (false)
  __mod_zone_page_state(zone, NR_FREE_CMA_PAGES, nr_pages);
}

extern const char * const vmstat_text[];
# 975 "include/linux/mm.h" 2

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void *lowmem_page_address(const struct page *page)
{
 return ((void *)((unsigned long) (((phys_addr_t)((unsigned long)((page) - ((struct page *)VMALLOC_END))) << 13)) + PAGE_OFFSET));
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *page_address(const struct page *page)
{
 return page->virtual;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_address(struct page *page, void *address)
{
 page->virtual = address;
}
# 1029 "include/linux/mm.h"
extern struct address_space *page_mapping(struct page *page);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *page_rmapping(struct page *page)
{
 return (void *)((unsigned long)page->mapping & ~(1 | 2));
}

extern struct address_space *__page_file_mapping(struct page *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
struct address_space *page_file_mapping(struct page *page)
{
 if (__builtin_expect(!!(PageSwapCache(page)), 0))
  return __page_file_mapping(page);

 return page->mapping;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageAnon(struct page *page)
{
 return ((unsigned long)page->mapping & 1) != 0;
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long page_index(struct page *page)
{
 if (__builtin_expect(!!(PageSwapCache(page)), 0))
  return ((page)->private);
 return page->index;
}

extern unsigned long __page_file_index(struct page *page);





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long page_file_index(struct page *page)
{
 if (__builtin_expect(!!(PageSwapCache(page)), 0))
  return __page_file_index(page);

 return page->index;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_mapped(struct page *page)
{
 return (*({ __attribute__((unused)) typeof((&(page)->_mapcount)->counter) __var = ( typeof((&(page)->_mapcount)->counter)) 0; (volatile typeof((&(page)->_mapcount)->counter) *)&((&(page)->_mapcount)->counter); })) >= 0;
}
# 1120 "include/linux/mm.h"
extern void pagefault_out_of_memory(void);
# 1130 "include/linux/mm.h"
extern void show_free_areas(unsigned int flags);
extern bool skip_free_areas_node(unsigned int flags, int nid);

int shmem_zero_setup(struct vm_area_struct *);

bool shmem_mapping(struct address_space *mapping);







extern int can_do_mlock(void);
extern int user_shm_lock(size_t, struct user_struct *);
extern void user_shm_unlock(size_t, struct user_struct *);




struct zap_details {
 struct address_space *check_mapping;
 unsigned long first_index;
 unsigned long last_index;
};

struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr,
  pte_t pte);

int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,
  unsigned long size);
void zap_page_range(struct vm_area_struct *vma, unsigned long address,
  unsigned long size, struct zap_details *);
void unmap_vmas(struct mmu_gather *tlb, struct vm_area_struct *start_vma,
  unsigned long start, unsigned long end);
# 1186 "include/linux/mm.h"
struct mm_walk {
 int (*pmd_entry)(pmd_t *pmd, unsigned long addr,
    unsigned long next, struct mm_walk *walk);
 int (*pte_entry)(pte_t *pte, unsigned long addr,
    unsigned long next, struct mm_walk *walk);
 int (*pte_hole)(unsigned long addr, unsigned long next,
   struct mm_walk *walk);
 int (*hugetlb_entry)(pte_t *pte, unsigned long hmask,
        unsigned long addr, unsigned long next,
        struct mm_walk *walk);
 int (*test_walk)(unsigned long addr, unsigned long next,
   struct mm_walk *walk);
 struct mm_struct *mm;
 struct vm_area_struct *vma;
 void *private;
};

int walk_page_range(unsigned long addr, unsigned long end,
  struct mm_walk *walk);
int walk_page_vma(struct vm_area_struct *vma, struct mm_walk *walk);
void free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
  unsigned long end, unsigned long floor, unsigned long ceiling);
int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
   struct vm_area_struct *vma);
void unmap_mapping_range(struct address_space *mapping,
  loff_t const holebegin, loff_t const holelen, int even_cows);
int follow_pfn(struct vm_area_struct *vma, unsigned long address,
 unsigned long *pfn);
int follow_phys(struct vm_area_struct *vma, unsigned long address,
  unsigned int flags, unsigned long *prot, resource_size_t *phys);
int generic_access_phys(struct vm_area_struct *vma, unsigned long addr,
   void *buf, int len, int write);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unmap_shared_mapping_range(struct address_space *mapping,
  loff_t const holebegin, loff_t const holelen)
{
 unmap_mapping_range(mapping, holebegin, holelen, 0);
}

extern void truncate_pagecache(struct inode *inode, loff_t new);
extern void truncate_setsize(struct inode *inode, loff_t newsize);
void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to);
void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end);
int truncate_inode_page(struct address_space *mapping, struct page *page);
int generic_error_remove_page(struct address_space *mapping, struct page *page);
int invalidate_inode_page(struct page *page);


extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
   unsigned long address, unsigned int flags);
extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
       unsigned long address, unsigned int fault_flags);
# 1257 "include/linux/mm.h"
extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
extern int access_remote_vm(struct mm_struct *mm, unsigned long addr,
  void *buf, int len, int write);

long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
        unsigned long start, unsigned long nr_pages,
        unsigned int foll_flags, struct page **pages,
        struct vm_area_struct **vmas, int *nonblocking);
long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
      unsigned long start, unsigned long nr_pages,
      int write, int force, struct page **pages,
      struct vm_area_struct **vmas);
long get_user_pages_locked(struct task_struct *tsk, struct mm_struct *mm,
      unsigned long start, unsigned long nr_pages,
      int write, int force, struct page **pages,
      int *locked);
long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm,
          unsigned long start, unsigned long nr_pages,
          int write, int force, struct page **pages,
          unsigned int gup_flags);
long get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm,
      unsigned long start, unsigned long nr_pages,
      int write, int force, struct page **pages);
int get_user_pages_fast(unsigned long start, int nr_pages, int write,
   struct page **pages);
struct kvec;
int get_kernel_pages(const struct kvec *iov, int nr_pages, int write,
   struct page **pages);
int get_kernel_page(unsigned long start, int write, struct page **pages);
struct page *get_dump_page(unsigned long addr);

extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
extern void do_invalidatepage(struct page *page, unsigned int offset,
         unsigned int length);

int __set_page_dirty_nobuffers(struct page *page);
int __set_page_dirty_no_writeback(struct page *page);
int redirty_page_for_writepage(struct writeback_control *wbc,
    struct page *page);
void account_page_dirtied(struct page *page, struct address_space *mapping);
int set_page_dirty(struct page *page);
int set_page_dirty_lock(struct page *page);
int clear_page_dirty_for_io(struct page *page);
int get_cmdline(struct task_struct *task, char *buffer, int buflen);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int vma_growsdown(struct vm_area_struct *vma, unsigned long addr)
{
 return vma && (vma->vm_end == addr) && (vma->vm_flags & 0x00000100);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int stack_guard_page_start(struct vm_area_struct *vma,
          unsigned long addr)
{
 return (vma->vm_flags & 0x00000100) &&
  (vma->vm_start == addr) &&
  !vma_growsdown(vma->vm_prev, addr);
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int vma_growsup(struct vm_area_struct *vma, unsigned long addr)
{
 return vma && (vma->vm_start == addr) && (vma->vm_flags & 0x00000000);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int stack_guard_page_end(struct vm_area_struct *vma,
        unsigned long addr)
{
 return (vma->vm_flags & 0x00000000) &&
  (vma->vm_end == addr) &&
  !vma_growsup(vma->vm_next, addr);
}

extern struct task_struct *task_of_stack(struct task_struct *task,
    struct vm_area_struct *vma, bool in_group);

extern unsigned long move_page_tables(struct vm_area_struct *vma,
  unsigned long old_addr, struct vm_area_struct *new_vma,
  unsigned long new_addr, unsigned long len,
  bool need_rmap_locks);
extern unsigned long change_protection(struct vm_area_struct *vma, unsigned long start,
         unsigned long end, pgprot_t newprot,
         int dirty_accountable, int prot_numa);
extern int mprotect_fixup(struct vm_area_struct *vma,
     struct vm_area_struct **pprev, unsigned long start,
     unsigned long end, unsigned long newflags);




int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
     struct page **pages);



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_mm_counter(struct mm_struct *mm, int member)
{
 long val = atomic_long_read(&mm->rss_stat.count[member]);






 if (val < 0)
  val = 0;

 return (unsigned long)val;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void add_mm_counter(struct mm_struct *mm, int member, long value)
{
 atomic_long_add(value, &mm->rss_stat.count[member]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inc_mm_counter(struct mm_struct *mm, int member)
{
 atomic_long_inc(&mm->rss_stat.count[member]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dec_mm_counter(struct mm_struct *mm, int member)
{
 atomic_long_dec(&mm->rss_stat.count[member]);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_mm_rss(struct mm_struct *mm)
{
 return get_mm_counter(mm, MM_FILEPAGES) +
  get_mm_counter(mm, MM_ANONPAGES);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_mm_hiwater_rss(struct mm_struct *mm)
{
 return ({ typeof(mm->hiwater_rss) _max1 = (mm->hiwater_rss); typeof(get_mm_rss(mm)) _max2 = (get_mm_rss(mm)); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_mm_hiwater_vm(struct mm_struct *mm)
{
 return ({ typeof(mm->hiwater_vm) _max1 = (mm->hiwater_vm); typeof(mm->total_vm) _max2 = (mm->total_vm); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; });
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void update_hiwater_rss(struct mm_struct *mm)
{
 unsigned long _rss = get_mm_rss(mm);

 if ((mm)->hiwater_rss < _rss)
  (mm)->hiwater_rss = _rss;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void update_hiwater_vm(struct mm_struct *mm)
{
 if (mm->hiwater_vm < mm->total_vm)
  mm->hiwater_vm = mm->total_vm;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void reset_mm_hiwater_rss(struct mm_struct *mm)
{
 mm->hiwater_rss = get_mm_rss(mm);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void setmax_mm_hiwater_rss(unsigned long *maxrss,
      struct mm_struct *mm)
{
 unsigned long hiwater_rss = get_mm_hiwater_rss(mm);

 if (*maxrss < hiwater_rss)
  *maxrss = hiwater_rss;
}


void sync_mm_rss(struct mm_struct *mm);






int vma_wants_writenotify(struct vm_area_struct *vma);

extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
          spinlock_t **ptl);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr,
        spinlock_t **ptl)
{
 pte_t *ptep;
 (ptep = __get_locked_pte(mm, addr, ptl));
 return ptep;
}
# 1453 "include/linux/mm.h"
int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address);
# 1474 "include/linux/mm.h"
int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_nr_pmds_init(struct mm_struct *mm)
{
 atomic_long_set(&mm->nr_pmds, 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long mm_nr_pmds(struct mm_struct *mm)
{
 return atomic_long_read(&mm->nr_pmds);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_inc_nr_pmds(struct mm_struct *mm)
{
 atomic_long_inc(&mm->nr_pmds);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_dec_nr_pmds(struct mm_struct *mm)
{
 atomic_long_dec(&mm->nr_pmds);
}


int __pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
  pmd_t *pmd, unsigned long address);
int __pte_alloc_kernel(pmd_t *pmd, unsigned long address);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
{
 return (__builtin_expect(!!((!((*pgd).pgd))), 0) && __pud_alloc(mm, pgd, address))?
  ((void *)0): ((pud_t *) ((unsigned long) ((void *)((unsigned long) (((*(pgd)).pgd)) + PAGE_OFFSET))) + (((address) >> ((13 + (13 -3)) + (13 - 3))) & ((1UL << (13 - 3)) - 1)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
{
 return (__builtin_expect(!!((!((*pud).pud))), 0) && __pmd_alloc(mm, pud, address))?
  ((void *)0): ((pmd_t *) ((unsigned long) ((void *)((unsigned long) (((*(pud)).pud)) + PAGE_OFFSET))) + (((address) >> (13 + (13 -3))) & ((1UL << (13 - 3))-1)));
}
# 1530 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptlock_cache_init(void)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ptlock_alloc(struct page *page)
{
 return true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptlock_free(struct page *page)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *ptlock_ptr(struct page *page)
{
 return &page->ptl;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
{
 return ptlock_ptr((((struct page *)VMALLOC_END) + (((unsigned long)((void *)__pmd_page(*pmd)) - PAGE_OFFSET)>>13)));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ptlock_init(struct page *page)
{
# 1564 "include/linux/mm.h"
 ((void)(sizeof(( long)(*(unsigned long *)&page->ptl))));
 if (!ptlock_alloc(page))
  return false;
 do { spinlock_check(ptlock_ptr(page)); do { *(&(ptlock_ptr(page))->rlock) = (raw_spinlock_t) { .raw_lock = { 0 }, }; } while (0); } while (0);
 return true;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pte_lock_deinit(struct page *page)
{
 page->mapping = ((void *)0);
 ptlock_free(page);
}
# 1591 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgtable_init(void)
{
 ptlock_cache_init();
 pgtable_cache_init();
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pgtable_page_ctor(struct page *page)
{
 inc_zone_page_state(page, NR_PAGETABLE);
 return ptlock_init(page);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgtable_page_dtor(struct page *page)
{
 pte_lock_deinit(page);
 dec_zone_page_state(page, NR_PAGETABLE);
}
# 1670 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
{
 return &mm->page_table_lock;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pgtable_pmd_page_ctor(struct page *page) { return true; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgtable_pmd_page_dtor(struct page *page) {}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *pmd_lock(struct mm_struct *mm, pmd_t *pmd)
{
 spinlock_t *ptl = pmd_lockptr(mm, pmd);
 spin_lock(ptl);
 return ptl;
}

extern void free_area_init(unsigned long * zones_size);
extern void free_area_init_node(int nid, unsigned long * zones_size,
  unsigned long zone_start_pfn, unsigned long *zholes_size);
extern void free_initmem(void);







extern unsigned long free_reserved_area(void *start, void *end,
     int poison, char *s);
# 1711 "include/linux/mm.h"
extern void adjust_managed_page_count(struct page *page, long count);
extern void mem_init_print_info(const char *str);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __free_reserved_page(struct page *page)
{
 ClearPageReserved(page);
 init_page_count(page);
 __free_pages((page), 0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void free_reserved_page(struct page *page)
{
 __free_reserved_page(page);
 adjust_managed_page_count(page, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mark_page_reserved(struct page *page)
{
 SetPageReserved(page);
 adjust_managed_page_count(page, -1);
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long free_initmem_default(int poison)
{
 extern char __init_begin[], __init_end[];

 return free_reserved_area(&__init_begin, &__init_end,
      poison, "unused kernel");
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_num_physpages(void)
{
 int nid;
 unsigned long phys_pages = 0;

 for (((nid)) = __first_node(&(node_states[N_ONLINE])); ((nid)) < (1 << 4); ((nid)) = __next_node((((nid))), &((node_states[N_ONLINE]))))
  phys_pages += ((node_data[nid])->node_present_pages);

 return phys_pages;
}
# 1786 "include/linux/mm.h"
extern void free_area_init_nodes(unsigned long *max_zone_pfn);
unsigned long node_map_pfn_alignment(void);
unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn,
      unsigned long end_pfn);
extern unsigned long absent_pages_in_range(unsigned long start_pfn,
      unsigned long end_pfn);
extern void get_pfn_range_for_nid(unsigned int nid,
   unsigned long *start_pfn, unsigned long *end_pfn);
extern unsigned long find_min_pfn_with_active_regions(void);
extern void free_bootmem_with_active_regions(int nid,
      unsigned long max_low_pfn);
extern void sparse_memory_present_with_active_regions(int nid);
# 1809 "include/linux/mm.h"
extern int __attribute__ ((__section__(".meminit.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) early_pfn_to_nid(unsigned long pfn);

extern int __attribute__ ((__section__(".meminit.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) __early_pfn_to_nid(unsigned long pfn);


extern void set_dma_reserve(unsigned long new_dma_reserve);
extern void memmap_init_zone(unsigned long, int, unsigned long,
    unsigned long, enum memmap_context);
extern void setup_per_zone_wmarks(void);
extern int __attribute__ ((__section__(".meminit.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) init_per_zone_wmark_min(void);
extern void mem_init(void);
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) mmap_init(void);
extern void show_mem(unsigned int flags);
extern void si_meminfo(struct sysinfo * val);
extern void si_meminfo_node(struct sysinfo *val, int nid);

extern __attribute__((format(printf, 3, 4)))
void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...);

extern void setup_per_cpu_pageset(void);

extern void zone_pcp_update(struct zone *zone);
extern void zone_pcp_reset(struct zone *zone);


extern int min_free_kbytes;


extern atomic_long_t mmap_pages_allocated;
extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t);


void vma_interval_tree_insert(struct vm_area_struct *node,
         struct rb_root *root);
void vma_interval_tree_insert_after(struct vm_area_struct *node,
        struct vm_area_struct *prev,
        struct rb_root *root);
void vma_interval_tree_remove(struct vm_area_struct *node,
         struct rb_root *root);
struct vm_area_struct *vma_interval_tree_iter_first(struct rb_root *root,
    unsigned long start, unsigned long last);
struct vm_area_struct *vma_interval_tree_iter_next(struct vm_area_struct *node,
    unsigned long start, unsigned long last);





void anon_vma_interval_tree_insert(struct anon_vma_chain *node,
       struct rb_root *root);
void anon_vma_interval_tree_remove(struct anon_vma_chain *node,
       struct rb_root *root);
struct anon_vma_chain *anon_vma_interval_tree_iter_first(
 struct rb_root *root, unsigned long start, unsigned long last);
struct anon_vma_chain *anon_vma_interval_tree_iter_next(
 struct anon_vma_chain *node, unsigned long start, unsigned long last);
# 1874 "include/linux/mm.h"
extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin);
extern int vma_adjust(struct vm_area_struct *vma, unsigned long start,
 unsigned long end, unsigned long pgoff, struct vm_area_struct *insert);
extern struct vm_area_struct *vma_merge(struct mm_struct *,
 struct vm_area_struct *prev, unsigned long addr, unsigned long end,
 unsigned long vm_flags, struct anon_vma *, struct file *, unsigned long,
 struct mempolicy *);
extern struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *);
extern int split_vma(struct mm_struct *,
 struct vm_area_struct *, unsigned long addr, int new_below);
extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *,
 struct rb_node **, struct rb_node *);
extern void unlink_file_vma(struct vm_area_struct *);
extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
 unsigned long addr, unsigned long len, unsigned long pgoff,
 bool *need_rmap_locks);
extern void exit_mmap(struct mm_struct *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int check_data_rlimit(unsigned long rlim,
        unsigned long new,
        unsigned long start,
        unsigned long end_data,
        unsigned long start_data)
{
 if (rlim < (~0UL)) {
  if (((new - start) + (end_data - start_data)) > rlim)
   return -28;
 }

 return 0;
}

extern int mm_take_all_locks(struct mm_struct *mm);
extern void mm_drop_all_locks(struct mm_struct *mm);

extern void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file);
extern struct file *get_mm_exe_file(struct mm_struct *mm);

extern int may_expand_vm(struct mm_struct *mm, unsigned long npages);
extern struct vm_area_struct *_install_special_mapping(struct mm_struct *mm,
       unsigned long addr, unsigned long len,
       unsigned long flags,
       const struct vm_special_mapping *spec);

extern int install_special_mapping(struct mm_struct *mm,
       unsigned long addr, unsigned long len,
       unsigned long flags, struct page **pages);

extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);

extern unsigned long mmap_region(struct file *file, unsigned long addr,
 unsigned long len, vm_flags_t vm_flags, unsigned long pgoff);
extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
 unsigned long len, unsigned long prot, unsigned long flags,
 unsigned long pgoff, unsigned long *populate);
extern int do_munmap(struct mm_struct *, unsigned long, size_t);


extern int __mm_populate(unsigned long addr, unsigned long len,
    int ignore_errors);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_populate(unsigned long addr, unsigned long len)
{

 (void) __mm_populate(addr, len, 1);
}





extern unsigned long vm_brk(unsigned long, unsigned long);
extern int vm_munmap(unsigned long, size_t);
extern unsigned long vm_mmap(struct file *, unsigned long,
        unsigned long, unsigned long,
        unsigned long, unsigned long);

struct vm_unmapped_area_info {

 unsigned long flags;
 unsigned long length;
 unsigned long low_limit;
 unsigned long high_limit;
 unsigned long align_mask;
 unsigned long align_offset;
};

extern unsigned long unmapped_area(struct vm_unmapped_area_info *info);
extern unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info);
# 1973 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
vm_unmapped_area(struct vm_unmapped_area_info *info)
{
 if (!(info->flags & 1))
  return unmapped_area(info);
 else
  return unmapped_area_topdown(info);
}


extern void truncate_inode_pages(struct address_space *, loff_t);
extern void truncate_inode_pages_range(struct address_space *,
           loff_t lstart, loff_t lend);
extern void truncate_inode_pages_final(struct address_space *);


extern int filemap_fault(struct vm_area_struct *, struct vm_fault *);
extern void filemap_map_pages(struct vm_area_struct *vma, struct vm_fault *vmf);
extern int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);


int write_one_page(struct page *page, int wait);
void task_dirty_inc(struct task_struct *tsk);





int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
   unsigned long offset, unsigned long nr_to_read);

void page_cache_sync_readahead(struct address_space *mapping,
          struct file_ra_state *ra,
          struct file *filp,
          unsigned long offset,
          unsigned long size);

void page_cache_async_readahead(struct address_space *mapping,
    struct file_ra_state *ra,
    struct file *filp,
    struct page *pg,
    unsigned long offset,
    unsigned long size);

unsigned long max_sane_readahead(unsigned long nr);


extern int expand_stack(struct vm_area_struct *vma, unsigned long address);


extern int expand_downwards(struct vm_area_struct *vma,
  unsigned long address);







extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr);
extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr,
          struct vm_area_struct **pprev);



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct vm_area_struct * find_vma_intersection(struct mm_struct * mm, unsigned long start_addr, unsigned long end_addr)
{
 struct vm_area_struct * vma = find_vma(mm,start_addr);

 if (vma && end_addr <= vma->vm_start)
  vma = ((void *)0);
 return vma;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long vma_pages(struct vm_area_struct *vma)
{
 return (vma->vm_end - vma->vm_start) >> 13;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct vm_area_struct *find_exact_vma(struct mm_struct *mm,
    unsigned long vm_start, unsigned long vm_end)
{
 struct vm_area_struct *vma = find_vma(mm, vm_start);

 if (vma && (vma->vm_start != vm_start || vma->vm_end != vm_end))
  vma = ((void *)0);

 return vma;
}


pgprot_t vm_get_page_prot(unsigned long vm_flags);
void vma_set_page_prot(struct vm_area_struct *vma);
# 2083 "include/linux/mm.h"
struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr);
int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
   unsigned long pfn, unsigned long size, pgprot_t);
int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *);
int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
   unsigned long pfn);
int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
   unsigned long pfn);
int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len);


struct page *follow_page_mask(struct vm_area_struct *vma,
         unsigned long address, unsigned int foll_flags,
         unsigned int *page_mask);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *follow_page(struct vm_area_struct *vma,
  unsigned long address, unsigned int foll_flags)
{
 unsigned int unused_page_mask;
 return follow_page_mask(vma, address, foll_flags, &unused_page_mask);
}
# 2119 "include/linux/mm.h"
typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
   void *data);
extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
          unsigned long size, pte_fn_t fn, void *data);


void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
# 2155 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
kernel_map_pages(struct page *page, int numpages, int enable) {}
# 2167 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
{
 return ((void *)0);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int in_gate_area_no_mm(unsigned long addr) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int in_gate_area(struct mm_struct *mm, unsigned long addr)
{
 return 0;
}



extern int sysctl_drop_caches;
int drop_caches_sysctl_handler(struct ctl_table *, int,
     void *, size_t *, loff_t *);


void drop_slab(void);
void drop_slab_node(int nid);




extern int randomize_va_space;


const char * arch_vma_name(struct vm_area_struct *vma);
void print_vma_addr(char *prefix, unsigned long rip);

void sparse_mem_maps_populate_node(struct page **map_map,
       unsigned long pnum_begin,
       unsigned long pnum_end,
       unsigned long map_count,
       int nodeid);

struct page *sparse_mem_map_populate(unsigned long pnum, int nid);
pgd_t *vmemmap_pgd_populate(unsigned long addr, int node);
pud_t *vmemmap_pud_populate(pgd_t *pgd, unsigned long addr, int node);
pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node);
pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node);
void *vmemmap_alloc_block(unsigned long size, int node);
void *vmemmap_alloc_block_buf(unsigned long size, int node);
void vmemmap_verify(pte_t *, int, unsigned long, unsigned long);
int vmemmap_populate_basepages(unsigned long start, unsigned long end,
          int node);
int vmemmap_populate(unsigned long start, unsigned long end, int node);
void vmemmap_populate_print_last(void);



void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
      unsigned long size);

enum mf_flags {
 MF_COUNT_INCREASED = 1 << 0,
 MF_ACTION_REQUIRED = 1 << 1,
 MF_MUST_KILL = 1 << 2,
 MF_SOFT_OFFLINE = 1 << 3,
};
extern int memory_failure(unsigned long pfn, int trapno, int flags);
extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
extern int unpoison_memory(unsigned long pfn);
extern int sysctl_memory_failure_early_kill;
extern int sysctl_memory_failure_recovery;
extern void shake_page(struct page *p, int access);
extern atomic_long_t num_poisoned_pages;
extern int soft_offline_page(struct page *page, int flags);


extern void clear_huge_page(struct page *page,
       unsigned long addr,
       unsigned int pages_per_huge_page);
extern void copy_user_huge_page(struct page *dst, struct page *src,
    unsigned long addr, struct vm_area_struct *vma,
    unsigned int pages_per_huge_page);


extern struct page_ext_operations debug_guardpage_ops;
extern struct page_ext_operations page_poisoning_ops;
# 2272 "include/linux/mm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int debug_guardpage_minorder(void) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool debug_guardpage_enabled(void) { return false; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool page_is_guard(struct page *page) { return false; }



void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) setup_nr_node_ids(void);
# 7 "include/linux/pid_namespace.h" 2


# 1 "include/linux/nsproxy.h" 1






struct mnt_namespace;
struct uts_namespace;
struct ipc_namespace;
struct pid_namespace;
struct fs_struct;
# 29 "include/linux/nsproxy.h"
struct nsproxy {
 atomic_t count;
 struct uts_namespace *uts_ns;
 struct ipc_namespace *ipc_ns;
 struct mnt_namespace *mnt_ns;
 struct pid_namespace *pid_ns_for_children;
 struct net *net_ns;
};
extern struct nsproxy init_nsproxy;
# 65 "include/linux/nsproxy.h"
int copy_namespaces(unsigned long flags, struct task_struct *tsk);
void exit_task_namespaces(struct task_struct *tsk);
void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new);
void free_nsproxy(struct nsproxy *ns);
int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
 struct cred *, struct fs_struct *);
int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) nsproxy_cache_init(void);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_nsproxy(struct nsproxy *ns)
{
 if ((atomic_sub_return(1, &ns->count) == 0)) {
  free_nsproxy(ns);
 }
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_nsproxy(struct nsproxy *ns)
{
 atomic_add(1, &ns->count);
}
# 10 "include/linux/pid_namespace.h" 2
# 1 "include/linux/kref.h" 1
# 24 "include/linux/kref.h"
struct kref {
 atomic_t refcount;
};





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kref_init(struct kref *kref)
{
 (((&kref->refcount)->counter) = 1);
}





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kref_get(struct kref *kref)
{




 ({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(atomic_add_return(1, &kref->refcount) < 2); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kref.h", 47); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); });
}
# 68 "include/linux/kref.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kref_sub(struct kref *kref, unsigned int count,
      void (*release)(struct kref *kref))
{
 ({ int __ret_warn_on = !!(release == ((void *)0)); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kref.h", 71); __builtin_expect(!!(__ret_warn_on), 0); });

 if ((atomic_sub_return((int) count, &kref->refcount) == 0)) {
  release(kref);
  return 1;
 }
 return 0;
}
# 97 "include/linux/kref.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kref_put(struct kref *kref, void (*release)(struct kref *kref))
{
 return kref_sub(kref, 1, release);
}
# 115 "include/linux/kref.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kref_put_spinlock_irqsave(struct kref *kref,
  void (*release)(struct kref *kref),
  spinlock_t *lock)
{
 unsigned long flags;

 ({ int __ret_warn_on = !!(release == ((void *)0)); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kref.h", 121); __builtin_expect(!!(__ret_warn_on), 0); });
 if (atomic_add_unless(&kref->refcount, -1, 1))
  return 0;
 do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(lock)); } while (0); } while (0);
 if ((atomic_sub_return(1, &kref->refcount) == 0)) {
  release(kref);
  do { if (({ ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(flags); })) { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); do { } while (0); } else { do { } while (0); do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } } while (0);
  return 1;
 }
 spin_unlock_irqrestore(lock, flags);
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kref_put_mutex(struct kref *kref,
     void (*release)(struct kref *kref),
     struct mutex *lock)
{
 ({ int __ret_warn_on = !!(release == ((void *)0)); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kref.h", 138); __builtin_expect(!!(__ret_warn_on), 0); });
 if (__builtin_expect(!!(!atomic_add_unless(&kref->refcount, -1, 1)), 0)) {
  mutex_lock(lock);
  if (__builtin_expect(!!(!(atomic_sub_return(1, &kref->refcount) == 0)), 0)) {
   mutex_unlock(lock);
   return 0;
  }
  release(kref);
  return 1;
 }
 return 0;
}
# 167 "include/linux/kref.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kref_get_unless_zero(struct kref *kref)
{
 return atomic_add_unless(&kref->refcount, 1, 0);
}
# 11 "include/linux/pid_namespace.h" 2
# 1 "include/linux/ns_common.h" 1



struct proc_ns_operations;

struct ns_common {
 atomic_long_t stashed;
 const struct proc_ns_operations *ops;
 unsigned int inum;
};
# 12 "include/linux/pid_namespace.h" 2

struct pidmap {
       atomic_t nr_free;
       void *page;
};





struct fs_pin;

struct pid_namespace {
 struct kref kref;
 struct pidmap pidmap[(((0 ? ((1UL) << 13) * 8 : (sizeof(long) > 4 ? 4 * 1024 * 1024 : (0 ? 0x1000 : 0x8000)))+(((1UL) << 13) * 8)-1)/(((1UL) << 13) * 8))];
 struct callback_head rcu;
 int last_pid;
 unsigned int nr_hashed;
 struct task_struct *child_reaper;
 struct kmem_cache *pid_cachep;
 unsigned int level;
 struct pid_namespace *parent;

 struct vfsmount *proc_mnt;
 struct dentry *proc_self;
 struct dentry *proc_thread_self;




 struct user_namespace *user_ns;
 struct work_struct proc_work;
 kgid_t pid_gid;
 int hide_pid;
 int reboot;
 struct ns_common ns;
};

extern struct pid_namespace init_pid_ns;




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid_namespace *get_pid_ns(struct pid_namespace *ns)
{
 if (ns != &init_pid_ns)
  kref_get(&ns->kref);
 return ns;
}

extern struct pid_namespace *copy_pid_ns(unsigned long flags,
 struct user_namespace *user_ns, struct pid_namespace *ns);
extern void zap_pid_ns_processes(struct pid_namespace *pid_ns);
extern int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd);
extern void put_pid_ns(struct pid_namespace *ns);
# 99 "include/linux/pid_namespace.h"
extern struct pid_namespace *task_active_pid_ns(struct task_struct *tsk);
void pidhash_init(void);
void pidmap_init(void);
# 46 "include/linux/perf_event.h" 2

# 1 "include/linux/ftrace.h" 1
# 9 "include/linux/ftrace.h"
# 1 "include/linux/trace_clock.h" 1
# 15 "include/linux/trace_clock.h"
# 1 "arch/sparc/include/generated/asm/trace_clock.h" 1
# 1 "include/asm-generic/trace_clock.h" 1
# 1 "arch/sparc/include/generated/asm/trace_clock.h" 2
# 16 "include/linux/trace_clock.h" 2

extern u64 __attribute__((no_instrument_function)) trace_clock_local(void);
extern u64 __attribute__((no_instrument_function)) trace_clock(void);
extern u64 __attribute__((no_instrument_function)) trace_clock_jiffies(void);
extern u64 __attribute__((no_instrument_function)) trace_clock_global(void);
extern u64 __attribute__((no_instrument_function)) trace_clock_counter(void);
# 10 "include/linux/ftrace.h" 2
# 1 "include/linux/kallsyms.h" 1
# 16 "include/linux/kallsyms.h"
struct module;



unsigned long kallsyms_lookup_name(const char *name);


int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
          unsigned long),
       void *data);

extern int kallsyms_lookup_size_offset(unsigned long addr,
      unsigned long *symbolsize,
      unsigned long *offset);


const char *kallsyms_lookup(unsigned long addr,
       unsigned long *symbolsize,
       unsigned long *offset,
       char **modname, char *namebuf);


extern int sprint_symbol(char *buffer, unsigned long address);
extern int sprint_symbol_no_offset(char *buffer, unsigned long address);
extern int sprint_backtrace(char *buffer, unsigned long address);


extern void __print_symbol(const char *fmt, unsigned long address);

int lookup_symbol_name(unsigned long addr, char *symname);
int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
# 111 "include/linux/kallsyms.h"
static __attribute__((format(printf, 1, 2)))
void __check_printsym_format(const char *fmt, ...)
{
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void print_symbol(const char *fmt, unsigned long addr)
{
 __check_printsym_format(fmt, "");
 __print_symbol(fmt, (unsigned long)
         __builtin_extract_return_addr((void *)addr));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void print_ip_sym(unsigned long ip)
{
 printk("[<%p>] %pS\n", (void *) ip, (void *) ip);
}
# 11 "include/linux/ftrace.h" 2


# 1 "include/linux/ptrace.h" 1
# 9 "include/linux/ptrace.h"
# 1 "include/uapi/linux/ptrace.h" 1
# 58 "include/uapi/linux/ptrace.h"
struct ptrace_peeksiginfo_args {
 __u64 off;
 __u32 flags;
 __s32 nr;
};
# 10 "include/linux/ptrace.h" 2
# 44 "include/linux/ptrace.h"
extern long arch_ptrace(struct task_struct *child, long request,
   unsigned long addr, unsigned long data);
extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int len);
extern int ptrace_writedata(struct task_struct *tsk, char *src, unsigned long dst, int len);
extern void ptrace_disable(struct task_struct *);
extern int ptrace_request(struct task_struct *child, long request,
     unsigned long addr, unsigned long data);
extern void ptrace_notify(int exit_code);
extern void __ptrace_link(struct task_struct *child,
     struct task_struct *new_parent);
extern void __ptrace_unlink(struct task_struct *child);
extern void exit_ptrace(struct task_struct *tracer, struct list_head *dead);




extern bool ptrace_may_access(struct task_struct *task, unsigned int mode);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ptrace_reparented(struct task_struct *child)
{
 return !same_thread_group(child->real_parent, child->parent);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptrace_unlink(struct task_struct *child)
{
 if (__builtin_expect(!!(child->ptrace), 0))
  __ptrace_unlink(child);
}

int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr,
       unsigned long data);
int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
       unsigned long data);
# 89 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct task_struct *ptrace_parent(struct task_struct *task)
{
 if (__builtin_expect(!!(task->ptrace), 0))
  return ({ typeof(*(task->parent)) *________p1 = (typeof(*(task->parent)) *)({ typeof((task->parent)) _________p1 = (*({ __attribute__((unused)) typeof((task->parent)) __var = ( typeof((task->parent))) 0; (volatile typeof((task->parent)) *)&((task->parent)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(task->parent)) *)(________p1)); });
 return ((void *)0);
}
# 105 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ptrace_event_enabled(struct task_struct *task, int event)
{
 return task->ptrace & (1 << (3 + (event)));
}
# 120 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptrace_event(int event, unsigned long message)
{
 if (__builtin_expect(!!(ptrace_event_enabled(current, event)), 0)) {
  current->ptrace_message = message;
  ptrace_notify((event << 8) | 5);
 } else if (event == 4) {

  if ((current->ptrace & (0x00000001|0x00010000)) == 0x00000001)
   send_sig(5, current, 0);
 }
}
# 143 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptrace_event_pid(int event, struct pid *pid)
{






 unsigned long message = 0;
 struct pid_namespace *ns;

 rcu_read_lock();
 ns = task_active_pid_ns(({ typeof(*(current->parent)) *________p1 = (typeof(*(current->parent)) *)({ typeof((current->parent)) _________p1 = (*({ __attribute__((unused)) typeof((current->parent)) __var = ( typeof((current->parent))) 0; (volatile typeof((current->parent)) *)&((current->parent)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(current->parent)) *)(________p1)); }));
 if (ns)
  message = pid_nr_ns(pid, ns);
 rcu_read_unlock();

 ptrace_event(event, message);
}
# 173 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptrace_init_task(struct task_struct *child, bool ptrace)
{
 INIT_LIST_HEAD(&child->ptrace_entry);
 INIT_LIST_HEAD(&child->ptraced);
 child->jobctl = 0;
 child->ptrace = 0;
 child->parent = child->real_parent;

 if (__builtin_expect(!!(ptrace), 0) && current->ptrace) {
  child->ptrace = current->ptrace;
  __ptrace_link(child, current->parent);

  if (child->ptrace & 0x00010000)
   task_set_jobctl_pending(child, (1 << 19));
  else
   sigaddset(&child->pending.signal, 17);

  set_tsk_thread_flag(child, 2);
 }
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptrace_release_task(struct task_struct *task)
{
 do { if (__builtin_expect(!!(!list_empty(&task->ptraced)), 0)) do { do_BUG("include/linux/ptrace.h", 202); __builtin_trap(); } while (0); } while (0);
 ptrace_unlink(task);
 do { if (__builtin_expect(!!(!list_empty(&task->ptrace_entry)), 0)) do { do_BUG("include/linux/ptrace.h", 204); __builtin_trap(); } while (0); } while (0);
}
# 260 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void user_enable_single_step(struct task_struct *task)
{
 do { do_BUG("include/linux/ptrace.h", 262); __builtin_trap(); } while (0);
}
# 274 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void user_disable_single_step(struct task_struct *task)
{
}
# 303 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void user_enable_block_step(struct task_struct *task)
{
 do { do_BUG("include/linux/ptrace.h", 305); __builtin_trap(); } while (0);
}
# 315 "include/linux/ptrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void user_single_step_siginfo(struct task_struct *tsk,
    struct pt_regs *regs, siginfo_t *info)
{
 __builtin_memset(info, 0, sizeof(*info));
 info->si_signo = 5;
}
# 382 "include/linux/ptrace.h"
extern int task_current_syscall(struct task_struct *target, long *callno,
    unsigned long args[6], unsigned int maxargs,
    unsigned long *sp, unsigned long *pc);
# 14 "include/linux/ftrace.h" 2






# 1 "./arch/sparc/include/asm/ftrace.h" 1
# 25 "./arch/sparc/include/asm/ftrace.h"
unsigned long prepare_ftrace_return(unsigned long parent,
        unsigned long self_addr,
        unsigned long frame_pointer);
# 21 "include/linux/ftrace.h" 2
# 44 "include/linux/ftrace.h"
void trace_init(void);




struct module;
struct ftrace_hash;
# 254 "include/linux/ftrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ftrace_nr_registered_ops(void)
{
 return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_ftrace_function(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_kill(void) { }
# 270 "include/linux/ftrace.h"
struct ftrace_func_command {
 struct list_head list;
 char *name;
 int (*func)(struct ftrace_hash *hash,
     char *func, char *cmd,
     char *params, int enable);
};
# 579 "include/linux/ftrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skip_trace(unsigned long ip) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ftrace_force_update(void) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_disable_daemon(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_enable_daemon(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_release_mod(struct module *mod) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_module_init(struct module *mod) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) int register_ftrace_command(struct ftrace_func_command *cmd)
{
 return -22;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) int unregister_ftrace_command(char *cmd_name)
{
 return -22;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ftrace_text_reserved(const void *start, const void *end)
{
 return 0;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long ftrace_location(unsigned long ip)
{
 return 0;
}
# 614 "include/linux/ftrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ssize_t ftrace_filter_write(struct file *file, const char *ubuf,
       size_t cnt, loff_t *ppos) { return -19; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ssize_t ftrace_notrace_write(struct file *file, const char *ubuf,
        size_t cnt, loff_t *ppos) { return -19; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
ftrace_regex_release(struct inode *inode, struct file *file) { return -19; }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_ftrace_trampoline(unsigned long addr)
{
 return false;
}



void ftrace_kill(void);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tracer_disable(void)
{



}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __ftrace_enabled_save(void)
{





 return 0;

}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ftrace_enabled_restore(int enabled)
{



}
# 686 "include/linux/ftrace.h"
  static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void time_hardirqs_on(unsigned long a0, unsigned long a1) { }
  static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void time_hardirqs_off(unsigned long a0, unsigned long a1) { }
# 705 "include/linux/ftrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_init(void) { }





struct ftrace_graph_ent {
 unsigned long func;
 int depth;
};




struct ftrace_graph_ret {
 unsigned long func;
 unsigned long long calltime;
 unsigned long long rettime;

 unsigned long overrun;
 int depth;
};


typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *);
typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *);
# 817 "include/linux/ftrace.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_graph_init_task(struct task_struct *t) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_graph_exit_task(struct task_struct *t) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_graph_init_idle_task(struct task_struct *t, int cpu) { }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int register_ftrace_graph(trace_func_graph_ret_t retfunc,
     trace_func_graph_ent_t entryfunc)
{
 return -1;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unregister_ftrace_graph(void) { }

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int task_curr_ret_stack(struct task_struct *tsk)
{
 return -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pause_graph_tracing(void) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unpause_graph_tracing(void) { }





enum {
 TSK_TRACE_FL_TRACE_BIT = 0,
 TSK_TRACE_FL_GRAPH_BIT = 1,
};
enum {
 TSK_TRACE_FL_TRACE = 1 << TSK_TRACE_FL_TRACE_BIT,
 TSK_TRACE_FL_GRAPH = 1 << TSK_TRACE_FL_GRAPH_BIT,
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_tsk_trace_trace(struct task_struct *tsk)
{
 set_bit(TSK_TRACE_FL_TRACE_BIT, &tsk->trace);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_tsk_trace_trace(struct task_struct *tsk)
{
 clear_bit(TSK_TRACE_FL_TRACE_BIT, &tsk->trace);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_tsk_trace_trace(struct task_struct *tsk)
{
 return tsk->trace & TSK_TRACE_FL_TRACE;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_tsk_trace_graph(struct task_struct *tsk)
{
 set_bit(TSK_TRACE_FL_GRAPH_BIT, &tsk->trace);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_tsk_trace_graph(struct task_struct *tsk)
{
 clear_bit(TSK_TRACE_FL_GRAPH_BIT, &tsk->trace);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_tsk_trace_graph(struct task_struct *tsk)
{
 return tsk->trace & TSK_TRACE_FL_GRAPH;
}

enum ftrace_dump_mode;

extern enum ftrace_dump_mode ftrace_dump_on_oops;
extern int tracepoint_printk;

extern void disable_trace_on_warning(void);
extern int __disable_trace_on_warning;
# 48 "include/linux/perf_event.h" 2
# 1 "include/linux/cpu.h" 1
# 16 "include/linux/cpu.h"
# 1 "include/linux/node.h" 1
# 17 "include/linux/node.h"
# 1 "include/linux/device.h" 1
# 16 "include/linux/device.h"
# 1 "include/linux/ioport.h" 1
# 18 "include/linux/ioport.h"
struct resource {
 resource_size_t start;
 resource_size_t end;
 const char *name;
 unsigned long flags;
 struct resource *parent, *sibling, *child;
};
# 138 "include/linux/ioport.h"
extern struct resource ioport_resource;
extern struct resource iomem_resource;

extern struct resource *request_resource_conflict(struct resource *root, struct resource *new);
extern int request_resource(struct resource *root, struct resource *new);
extern int release_resource(struct resource *new);
void release_child_resources(struct resource *new);
extern void reserve_region_with_split(struct resource *root,
        resource_size_t start, resource_size_t end,
        const char *name);
extern struct resource *insert_resource_conflict(struct resource *parent, struct resource *new);
extern int insert_resource(struct resource *parent, struct resource *new);
extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new);
extern void arch_remove_reservations(struct resource *avail);
extern int allocate_resource(struct resource *root, struct resource *new,
        resource_size_t size, resource_size_t min,
        resource_size_t max, resource_size_t align,
        resource_size_t (*alignf)(void *,
             const struct resource *,
             resource_size_t,
             resource_size_t),
        void *alignf_data);
struct resource *lookup_resource(struct resource *root, resource_size_t start);
int adjust_resource(struct resource *res, resource_size_t start,
      resource_size_t size);
resource_size_t resource_alignment(struct resource *res);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) resource_size_t resource_size(const struct resource *res)
{
 return res->end - res->start + 1;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long resource_type(const struct resource *res)
{
 return res->flags & 0x00001f00;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool resource_contains(struct resource *r1, struct resource *r2)
{
 if (resource_type(r1) != resource_type(r2))
  return false;
 if (r1->flags & 0x20000000 || r2->flags & 0x20000000)
  return false;
 return r1->start <= r2->start && r1->end >= r2->end;
}
# 192 "include/linux/ioport.h"
extern struct resource * __request_region(struct resource *,
     resource_size_t start,
     resource_size_t n,
     const char *name, int flags);






extern int __check_region(struct resource *, resource_size_t, resource_size_t);
extern void __release_region(struct resource *, resource_size_t,
    resource_size_t);





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int check_region(resource_size_t s,
      resource_size_t n)
{
 return __check_region(&ioport_resource, s, n);
}


struct device;

extern int devm_request_resource(struct device *dev, struct resource *root,
     struct resource *new);
extern void devm_release_resource(struct device *dev, struct resource *new);






extern struct resource * __devm_request_region(struct device *dev,
    struct resource *parent, resource_size_t start,
    resource_size_t n, const char *name);






extern void __devm_release_region(struct device *dev, struct resource *parent,
      resource_size_t start, resource_size_t n);
extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size);
extern int iomem_is_exclusive(u64 addr);

extern int
walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
  void *arg, int (*func)(unsigned long, unsigned long, void *));
extern int
walk_system_ram_res(u64 start, u64 end, void *arg,
      int (*func)(u64, u64, void *));
extern int
walk_iomem_res(char *name, unsigned long flags, u64 start, u64 end, void *arg,
        int (*func)(u64, u64, void *));


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool resource_overlaps(struct resource *r1, struct resource *r2)
{
       return (r1->start <= r2->end && r1->end >= r2->start);
}
# 17 "include/linux/device.h" 2
# 1 "include/linux/kobject.h" 1
# 21 "include/linux/kobject.h"
# 1 "include/linux/sysfs.h" 1
# 15 "include/linux/sysfs.h"
# 1 "include/linux/kernfs.h" 1
# 14 "include/linux/kernfs.h"
# 1 "include/linux/idr.h" 1
# 30 "include/linux/idr.h"
struct idr_layer {
 int prefix;
 int layer;
 struct idr_layer *ary[1<<8];
 int count;
 union {

  unsigned long bitmap[((((1 << 8)) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))];
  struct callback_head callback_head;
 };
};

struct idr {
 struct idr_layer *hint;
 struct idr_layer *top;
 int layers;
 int cur;
 spinlock_t lock;
 int id_free_cnt;
 struct idr_layer *id_free;
};
# 79 "include/linux/idr.h"
void *idr_find_slowpath(struct idr *idp, int id);
void idr_preload(gfp_t gfp_mask);
int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask);
int idr_alloc_cyclic(struct idr *idr, void *ptr, int start, int end, gfp_t gfp_mask);
int idr_for_each(struct idr *idp,
   int (*fn)(int id, void *p, void *data), void *data);
void *idr_get_next(struct idr *idp, int *nextid);
void *idr_replace(struct idr *idp, void *ptr, int id);
void idr_remove(struct idr *idp, int id);
void idr_destroy(struct idr *idp);
void idr_init(struct idr *idp);
bool idr_is_empty(struct idr *idp);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void idr_preload_end(void)
{
 __asm__ __volatile__("": : :"memory");
}
# 115 "include/linux/idr.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *idr_find(struct idr *idr, int id)
{
 struct idr_layer *hint = ({ typeof(*(idr->hint)) *________p1 = (typeof(*(idr->hint)) *)({ typeof((idr->hint)) _________p1 = (*({ __attribute__((unused)) typeof((idr->hint)) __var = ( typeof((idr->hint))) 0; (volatile typeof((idr->hint)) *)&((idr->hint)); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(idr->hint)) *)(________p1)); });

 if (hint && (id & ~((1 << 8)-1)) == hint->prefix)
  return ({ typeof(*(hint->ary[id & ((1 << 8)-1)])) *________p1 = (typeof(*(hint->ary[id & ((1 << 8)-1)])) *)({ typeof((hint->ary[id & ((1 << 8)-1)])) _________p1 = (*({ __attribute__((unused)) typeof((hint->ary[id & ((1 << 8)-1)])) __var = ( typeof((hint->ary[id & ((1 << 8)-1)]))) 0; (volatile typeof((hint->ary[id & ((1 << 8)-1)])) *)&((hint->ary[id & ((1 << 8)-1)])); })); do { } while (0); (_________p1); }); do { } while (0); ; ((typeof(*(hint->ary[id & ((1 << 8)-1)])) *)(________p1)); });

 return idr_find_slowpath(idr, id);
}
# 149 "include/linux/idr.h"
struct ida_bitmap {
 long nr_busy;
 unsigned long bitmap[(128 / sizeof(long) - 1)];
};

struct ida {
 struct idr idr;
 struct ida_bitmap *free_bitmap;
};




int ida_pre_get(struct ida *ida, gfp_t gfp_mask);
int ida_get_new_above(struct ida *ida, int starting_id, int *p_id);
void ida_remove(struct ida *ida, int id);
void ida_destroy(struct ida *ida);
void ida_init(struct ida *ida);

int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
     gfp_t gfp_mask);
void ida_simple_remove(struct ida *ida, unsigned int id);
# 179 "include/linux/idr.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ida_get_new(struct ida *ida, int *p_id)
{
 return ida_get_new_above(ida, 0, p_id);
}

void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) idr_init_cache(void);
# 15 "include/linux/kernfs.h" 2





struct file;
struct dentry;
struct iattr;
struct seq_file;
struct vm_area_struct;
struct super_block;
struct file_system_type;

struct kernfs_open_node;
struct kernfs_iattrs;

enum kernfs_node_type {
 KERNFS_DIR = 0x0001,
 KERNFS_FILE = 0x0002,
 KERNFS_LINK = 0x0004,
};




enum kernfs_node_flag {
 KERNFS_ACTIVATED = 0x0010,
 KERNFS_NS = 0x0020,
 KERNFS_HAS_SEQ_SHOW = 0x0040,
 KERNFS_HAS_MMAP = 0x0080,
 KERNFS_LOCKDEP = 0x0100,
 KERNFS_SUICIDAL = 0x0400,
 KERNFS_SUICIDED = 0x0800,
};


enum kernfs_root_flag {






 KERNFS_ROOT_CREATE_DEACTIVATED = 0x0001,
# 69 "include/linux/kernfs.h"
 KERNFS_ROOT_EXTRA_OPEN_PERM_CHECK = 0x0002,
};


struct kernfs_elem_dir {
 unsigned long subdirs;

 struct rb_root children;





 struct kernfs_root *root;
};

struct kernfs_elem_symlink {
 struct kernfs_node *target_kn;
};

struct kernfs_elem_attr {
 const struct kernfs_ops *ops;
 struct kernfs_open_node *open;
 loff_t size;
 struct kernfs_node *notify_next;
};
# 105 "include/linux/kernfs.h"
struct kernfs_node {
 atomic_t count;
 atomic_t active;
# 117 "include/linux/kernfs.h"
 struct kernfs_node *parent;
 const char *name;

 struct rb_node rb;

 const void *ns;
 unsigned int hash;
 union {
  struct kernfs_elem_dir dir;
  struct kernfs_elem_symlink symlink;
  struct kernfs_elem_attr attr;
 };

 void *priv;

 unsigned short flags;
 umode_t mode;
 unsigned int ino;
 struct kernfs_iattrs *iattr;
};
# 145 "include/linux/kernfs.h"
struct kernfs_syscall_ops {
 int (*remount_fs)(struct kernfs_root *root, int *flags, char *data);
 int (*show_options)(struct seq_file *sf, struct kernfs_root *root);

 int (*mkdir)(struct kernfs_node *parent, const char *name,
       umode_t mode);
 int (*rmdir)(struct kernfs_node *kn);
 int (*rename)(struct kernfs_node *kn, struct kernfs_node *new_parent,
        const char *new_name);
};

struct kernfs_root {

 struct kernfs_node *kn;
 unsigned int flags;


 struct ida ino_ida;
 struct kernfs_syscall_ops *syscall_ops;


 struct list_head supers;

 wait_queue_head_t deactivate_waitq;
};

struct kernfs_open_file {

 struct kernfs_node *kn;
 struct file *file;
 void *priv;


 struct mutex mutex;
 int event;
 struct list_head list;
 char *prealloc_buf;

 size_t atomic_write_len;
 bool mmapped;
 const struct vm_operations_struct *vm_ops;
};

struct kernfs_ops {
# 200 "include/linux/kernfs.h"
 int (*seq_show)(struct seq_file *sf, void *v);

 void *(*seq_start)(struct seq_file *sf, loff_t *ppos);
 void *(*seq_next)(struct seq_file *sf, void *v, loff_t *ppos);
 void (*seq_stop)(struct seq_file *sf, void *v);

 ssize_t (*read)(struct kernfs_open_file *of, char *buf, size_t bytes,
   loff_t off);
# 216 "include/linux/kernfs.h"
 size_t atomic_write_len;






 bool prealloc;
 ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t bytes,
    loff_t off);

 int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma);




};



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
{
 return kn->flags & 0x000f;
}
# 249 "include/linux/kernfs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kernfs_enable_ns(struct kernfs_node *kn)
{
 ({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(kernfs_type(kn) != KERNFS_DIR); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kernfs.h", 251); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); });
 ({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(!((&kn->dir.children)->rb_node == ((void *)0))); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kernfs.h", 252); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); });
 kn->flags |= KERNFS_NS;
}







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kernfs_ns_enabled(struct kernfs_node *kn)
{
 return kn->flags & KERNFS_NS;
}

int kernfs_name(struct kernfs_node *kn, char *buf, size_t buflen);
char * __attribute__((warn_unused_result)) kernfs_path(struct kernfs_node *kn, char *buf,
    size_t buflen);
void pr_cont_kernfs_name(struct kernfs_node *kn);
void pr_cont_kernfs_path(struct kernfs_node *kn);
struct kernfs_node *kernfs_get_parent(struct kernfs_node *kn);
struct kernfs_node *kernfs_find_and_get_ns(struct kernfs_node *parent,
        const char *name, const void *ns);
void kernfs_get(struct kernfs_node *kn);
void kernfs_put(struct kernfs_node *kn);

struct kernfs_node *kernfs_node_from_dentry(struct dentry *dentry);
struct kernfs_root *kernfs_root_from_sb(struct super_block *sb);

struct kernfs_root *kernfs_create_root(struct kernfs_syscall_ops *scops,
           unsigned int flags, void *priv);
void kernfs_destroy_root(struct kernfs_root *root);

struct kernfs_node *kernfs_create_dir_ns(struct kernfs_node *parent,
      const char *name, umode_t mode,
      void *priv, const void *ns);
struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
      const char *name,
      umode_t mode, loff_t size,
      const struct kernfs_ops *ops,
      void *priv, const void *ns,
      struct lock_class_key *key);
struct kernfs_node *kernfs_create_link(struct kernfs_node *parent,
           const char *name,
           struct kernfs_node *target);
void kernfs_activate(struct kernfs_node *kn);
void kernfs_remove(struct kernfs_node *kn);
void kernfs_break_active_protection(struct kernfs_node *kn);
void kernfs_unbreak_active_protection(struct kernfs_node *kn);
bool kernfs_remove_self(struct kernfs_node *kn);
int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name,
        const void *ns);
int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent,
       const char *new_name, const void *new_ns);
int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr);
void kernfs_notify(struct kernfs_node *kn);

const void *kernfs_super_ns(struct super_block *sb);
struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags,
          struct kernfs_root *root, unsigned long magic,
          bool *new_sb_created, const void *ns);
void kernfs_kill_sb(struct super_block *sb);
struct super_block *kernfs_pin_sb(struct kernfs_root *root, const void *ns);

void kernfs_init(void);
# 415 "include/linux/kernfs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *
kernfs_find_and_get(struct kernfs_node *kn, const char *name)
{
 return kernfs_find_and_get_ns(kn, name, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *
kernfs_create_dir(struct kernfs_node *parent, const char *name, umode_t mode,
    void *priv)
{
 return kernfs_create_dir_ns(parent, name, mode, priv, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *
kernfs_create_file_ns(struct kernfs_node *parent, const char *name,
        umode_t mode, loff_t size, const struct kernfs_ops *ops,
        void *priv, const void *ns)
{
 struct lock_class_key *key = ((void *)0);




 return __kernfs_create_file(parent, name, mode, size, ops, priv, ns,
        key);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *
kernfs_create_file(struct kernfs_node *parent, const char *name, umode_t mode,
     loff_t size, const struct kernfs_ops *ops, void *priv)
{
 return kernfs_create_file_ns(parent, name, mode, size, ops, priv, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kernfs_remove_by_name(struct kernfs_node *parent,
     const char *name)
{
 return kernfs_remove_by_name_ns(parent, name, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kernfs_rename(struct kernfs_node *kn,
    struct kernfs_node *new_parent,
    const char *new_name)
{
 return kernfs_rename_ns(kn, new_parent, new_name, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *
kernfs_mount(struct file_system_type *fs_type, int flags,
  struct kernfs_root *root, unsigned long magic,
  bool *new_sb_created)
{
 return kernfs_mount_ns(fs_type, flags, root,
    magic, new_sb_created, ((void *)0));
}
# 16 "include/linux/sysfs.h" 2




# 1 "include/linux/kobject_ns.h" 1
# 20 "include/linux/kobject_ns.h"
struct sock;
struct kobject;





enum kobj_ns_type {
 KOBJ_NS_TYPE_NONE = 0,
 KOBJ_NS_TYPE_NET,
 KOBJ_NS_TYPES
};
# 40 "include/linux/kobject_ns.h"
struct kobj_ns_type_operations {
 enum kobj_ns_type type;
 bool (*current_may_mount)(void);
 void *(*grab_current_ns)(void);
 const void *(*netlink_ns)(struct sock *sk);
 const void *(*initial_ns)(void);
 void (*drop_ns)(void *);
};

int kobj_ns_type_register(const struct kobj_ns_type_operations *ops);
int kobj_ns_type_registered(enum kobj_ns_type type);
const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent);
const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj);

bool kobj_ns_current_may_mount(enum kobj_ns_type type);
void *kobj_ns_grab_current(enum kobj_ns_type type);
const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk);
const void *kobj_ns_initial(enum kobj_ns_type type);
void kobj_ns_drop(enum kobj_ns_type type, void *ns);
# 21 "include/linux/sysfs.h" 2



struct kobject;
struct module;
struct bin_attribute;
enum kobj_ns_type;

struct attribute {
 const char *name;
 umode_t mode;





};
# 60 "include/linux/sysfs.h"
struct attribute_group {
 const char *name;
 umode_t (*is_visible)(struct kobject *,
           struct attribute *, int);
 struct attribute **attrs;
 struct bin_attribute **bin_attrs;
};
# 127 "include/linux/sysfs.h"
struct file;
struct vm_area_struct;

struct bin_attribute {
 struct attribute attr;
 size_t size;
 void *private;
 ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *,
   char *, loff_t, size_t);
 ssize_t (*write)(struct file *, struct kobject *, struct bin_attribute *,
    char *, loff_t, size_t);
 int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr,
      struct vm_area_struct *vma);
};
# 184 "include/linux/sysfs.h"
struct sysfs_ops {
 ssize_t (*show)(struct kobject *, struct attribute *, char *);
 ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t);
};



int __attribute__((warn_unused_result)) sysfs_create_dir_ns(struct kobject *kobj, const void *ns);
void sysfs_remove_dir(struct kobject *kobj);
int __attribute__((warn_unused_result)) sysfs_rename_dir_ns(struct kobject *kobj, const char *new_name,
         const void *new_ns);
int __attribute__((warn_unused_result)) sysfs_move_dir_ns(struct kobject *kobj,
       struct kobject *new_parent_kobj,
       const void *new_ns);

int __attribute__((warn_unused_result)) sysfs_create_file_ns(struct kobject *kobj,
          const struct attribute *attr,
          const void *ns);
int __attribute__((warn_unused_result)) sysfs_create_files(struct kobject *kobj,
       const struct attribute **attr);
int __attribute__((warn_unused_result)) sysfs_chmod_file(struct kobject *kobj,
      const struct attribute *attr, umode_t mode);
void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr,
     const void *ns);
bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr);
void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr);

int __attribute__((warn_unused_result)) sysfs_create_bin_file(struct kobject *kobj,
           const struct bin_attribute *attr);
void sysfs_remove_bin_file(struct kobject *kobj,
      const struct bin_attribute *attr);

int __attribute__((warn_unused_result)) sysfs_create_link(struct kobject *kobj, struct kobject *target,
       const char *name);
int __attribute__((warn_unused_result)) sysfs_create_link_nowarn(struct kobject *kobj,
       struct kobject *target,
       const char *name);
void sysfs_remove_link(struct kobject *kobj, const char *name);

int sysfs_rename_link_ns(struct kobject *kobj, struct kobject *target,
    const char *old_name, const char *new_name,
    const void *new_ns);

void sysfs_delete_link(struct kobject *dir, struct kobject *targ,
   const char *name);

int __attribute__((warn_unused_result)) sysfs_create_group(struct kobject *kobj,
        const struct attribute_group *grp);
int __attribute__((warn_unused_result)) sysfs_create_groups(struct kobject *kobj,
         const struct attribute_group **groups);
int sysfs_update_group(struct kobject *kobj,
         const struct attribute_group *grp);
void sysfs_remove_group(struct kobject *kobj,
   const struct attribute_group *grp);
void sysfs_remove_groups(struct kobject *kobj,
    const struct attribute_group **groups);
int sysfs_add_file_to_group(struct kobject *kobj,
   const struct attribute *attr, const char *group);
void sysfs_remove_file_from_group(struct kobject *kobj,
   const struct attribute *attr, const char *group);
int sysfs_merge_group(struct kobject *kobj,
         const struct attribute_group *grp);
void sysfs_unmerge_group(struct kobject *kobj,
         const struct attribute_group *grp);
int sysfs_add_link_to_group(struct kobject *kobj, const char *group_name,
       struct kobject *target, const char *link_name);
void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name,
      const char *link_name);

void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr);

int __attribute__((warn_unused_result)) sysfs_init(void);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sysfs_enable_ns(struct kernfs_node *kn)
{
 return kernfs_enable_ns(kn);
}
# 440 "include/linux/sysfs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) sysfs_create_file(struct kobject *kobj,
       const struct attribute *attr)
{
 return sysfs_create_file_ns(kobj, attr, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sysfs_remove_file(struct kobject *kobj,
         const struct attribute *attr)
{
 sysfs_remove_file_ns(kobj, attr, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sysfs_rename_link(struct kobject *kobj, struct kobject *target,
        const char *old_name, const char *new_name)
{
 return sysfs_rename_link_ns(kobj, target, old_name, new_name, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sysfs_notify_dirent(struct kernfs_node *kn)
{
 kernfs_notify(kn);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *sysfs_get_dirent(struct kernfs_node *parent,
         const unsigned char *name)
{
 return kernfs_find_and_get(parent, name);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *sysfs_get(struct kernfs_node *kn)
{
 kernfs_get(kn);
 return kn;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sysfs_put(struct kernfs_node *kn)
{
 kernfs_put(kn);
}
# 22 "include/linux/kobject.h" 2
# 37 "include/linux/kobject.h"
extern char uevent_helper[];



extern u64 uevent_seqnum;
# 53 "include/linux/kobject.h"
enum kobject_action {
 KOBJ_ADD,
 KOBJ_REMOVE,
 KOBJ_CHANGE,
 KOBJ_MOVE,
 KOBJ_ONLINE,
 KOBJ_OFFLINE,
 KOBJ_MAX
};

struct kobject {
 const char *name;
 struct list_head entry;
 struct kobject *parent;
 struct kset *kset;
 struct kobj_type *ktype;
 struct kernfs_node *sd;
 struct kref kref;



 unsigned int state_initialized:1;
 unsigned int state_in_sysfs:1;
 unsigned int state_add_uevent_sent:1;
 unsigned int state_remove_uevent_sent:1;
 unsigned int uevent_suppress:1;
};

extern __attribute__((format(printf, 2, 3)))
int kobject_set_name(struct kobject *kobj, const char *name, ...);
extern int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
      va_list vargs);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *kobject_name(const struct kobject *kobj)
{
 return kobj->name;
}

extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype);
extern __attribute__((format(printf, 3, 4))) __attribute__((warn_unused_result))
int kobject_add(struct kobject *kobj, struct kobject *parent,
  const char *fmt, ...);
extern __attribute__((format(printf, 4, 5))) __attribute__((warn_unused_result))
int kobject_init_and_add(struct kobject *kobj,
    struct kobj_type *ktype, struct kobject *parent,
    const char *fmt, ...);

extern void kobject_del(struct kobject *kobj);

extern struct kobject * __attribute__((warn_unused_result)) kobject_create(void);
extern struct kobject * __attribute__((warn_unused_result)) kobject_create_and_add(const char *name,
      struct kobject *parent);

extern int __attribute__((warn_unused_result)) kobject_rename(struct kobject *, const char *new_name);
extern int __attribute__((warn_unused_result)) kobject_move(struct kobject *, struct kobject *);

extern struct kobject *kobject_get(struct kobject *kobj);
extern void kobject_put(struct kobject *kobj);

extern const void *kobject_namespace(struct kobject *kobj);
extern char *kobject_get_path(struct kobject *kobj, gfp_t flag);

struct kobj_type {
 void (*release)(struct kobject *kobj);
 const struct sysfs_ops *sysfs_ops;
 struct attribute **default_attrs;
 const struct kobj_ns_type_operations *(*child_ns_type)(struct kobject *kobj);
 const void *(*namespace)(struct kobject *kobj);
};

struct kobj_uevent_env {
 char *argv[3];
 char *envp[32];
 int envp_idx;
 char buf[2048];
 int buflen;
};

struct kset_uevent_ops {
 int (* const filter)(struct kset *kset, struct kobject *kobj);
 const char *(* const name)(struct kset *kset, struct kobject *kobj);
 int (* const uevent)(struct kset *kset, struct kobject *kobj,
        struct kobj_uevent_env *env);
};

struct kobj_attribute {
 struct attribute attr;
 ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr,
   char *buf);
 ssize_t (*store)(struct kobject *kobj, struct kobj_attribute *attr,
    const char *buf, size_t count);
};

extern const struct sysfs_ops kobj_sysfs_ops;

struct sock;
# 167 "include/linux/kobject.h"
struct kset {
 struct list_head list;
 spinlock_t list_lock;
 struct kobject kobj;
 const struct kset_uevent_ops *uevent_ops;
};

extern void kset_init(struct kset *kset);
extern int __attribute__((warn_unused_result)) kset_register(struct kset *kset);
extern void kset_unregister(struct kset *kset);
extern struct kset * __attribute__((warn_unused_result)) kset_create_and_add(const char *name,
      const struct kset_uevent_ops *u,
      struct kobject *parent_kobj);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kset *to_kset(struct kobject *kobj)
{
 return kobj ? ({ const typeof( ((struct kset *)0)->kobj ) *__mptr = (kobj); (struct kset *)( (char *)__mptr - __builtin_offsetof(struct kset,kobj) );}) : ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kset *kset_get(struct kset *k)
{
 return k ? to_kset(kobject_get(&k->kobj)) : ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kset_put(struct kset *k)
{
 kobject_put(&k->kobj);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kobj_type *get_ktype(struct kobject *kobj)
{
 return kobj->ktype;
}

extern struct kobject *kset_find_obj(struct kset *, const char *);


extern struct kobject *kernel_kobj;

extern struct kobject *mm_kobj;

extern struct kobject *hypervisor_kobj;

extern struct kobject *power_kobj;

extern struct kobject *firmware_kobj;

int kobject_uevent(struct kobject *kobj, enum kobject_action action);
int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
   char *envp[]);

__attribute__((format(printf, 2, 3)))
int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...);

int kobject_action_type(const char *buf, size_t count,
   enum kobject_action *type);
# 18 "include/linux/device.h" 2
# 1 "include/linux/klist.h" 1
# 19 "include/linux/klist.h"
struct klist_node;
struct klist {
 spinlock_t k_lock;
 struct list_head k_list;
 void (*get)(struct klist_node *);
 void (*put)(struct klist_node *);
} __attribute__ ((aligned (sizeof(void *))));
# 36 "include/linux/klist.h"
extern void klist_init(struct klist *k, void (*get)(struct klist_node *),
         void (*put)(struct klist_node *));

struct klist_node {
 void *n_klist;
 struct list_head n_node;
 struct kref n_ref;
};

extern void klist_add_tail(struct klist_node *n, struct klist *k);
extern void klist_add_head(struct klist_node *n, struct klist *k);
extern void klist_add_behind(struct klist_node *n, struct klist_node *pos);
extern void klist_add_before(struct klist_node *n, struct klist_node *pos);

extern void klist_del(struct klist_node *n);
extern void klist_remove(struct klist_node *n);

extern int klist_node_attached(struct klist_node *n);


struct klist_iter {
 struct klist *i_klist;
 struct klist_node *i_cur;
};


extern void klist_iter_init(struct klist *k, struct klist_iter *i);
extern void klist_iter_init_node(struct klist *k, struct klist_iter *i,
     struct klist_node *n);
extern void klist_iter_exit(struct klist_iter *i);
extern struct klist_node *klist_next(struct klist_iter *i);
# 19 "include/linux/device.h" 2





# 1 "include/linux/pinctrl/devinfo.h" 1
# 43 "include/linux/pinctrl/devinfo.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pinctrl_bind_pins(struct device *dev)
{
 return 0;
}
# 25 "include/linux/device.h" 2
# 1 "include/linux/pm.h" 1
# 34 "include/linux/pm.h"
extern void (*pm_power_off)(void);
extern void (*pm_power_off_prepare)(void);

struct device;




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_vt_switch_required(struct device *dev, bool required)
{
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_vt_switch_unregister(struct device *dev)
{
}






struct device;







typedef struct pm_message {
 int event;
} pm_message_t;
# 295 "include/linux/pm.h"
struct dev_pm_ops {
 int (*prepare)(struct device *dev);
 void (*complete)(struct device *dev);
 int (*suspend)(struct device *dev);
 int (*resume)(struct device *dev);
 int (*freeze)(struct device *dev);
 int (*thaw)(struct device *dev);
 int (*poweroff)(struct device *dev);
 int (*restore)(struct device *dev);
 int (*suspend_late)(struct device *dev);
 int (*resume_early)(struct device *dev);
 int (*freeze_late)(struct device *dev);
 int (*thaw_early)(struct device *dev);
 int (*poweroff_late)(struct device *dev);
 int (*restore_early)(struct device *dev);
 int (*suspend_noirq)(struct device *dev);
 int (*resume_noirq)(struct device *dev);
 int (*freeze_noirq)(struct device *dev);
 int (*thaw_noirq)(struct device *dev);
 int (*poweroff_noirq)(struct device *dev);
 int (*restore_noirq)(struct device *dev);
 int (*runtime_suspend)(struct device *dev);
 int (*runtime_resume)(struct device *dev);
 int (*runtime_idle)(struct device *dev);
};
# 501 "include/linux/pm.h"
enum rpm_status {
 RPM_ACTIVE = 0,
 RPM_RESUMING,
 RPM_SUSPENDED,
 RPM_SUSPENDING,
};
# 523 "include/linux/pm.h"
enum rpm_request {
 RPM_REQ_NONE = 0,
 RPM_REQ_IDLE,
 RPM_REQ_SUSPEND,
 RPM_REQ_AUTOSUSPEND,
 RPM_REQ_RESUME,
};

struct wakeup_source;
struct pm_domain_data;

struct pm_subsys_data {
 spinlock_t lock;
 unsigned int refcount;






};

struct dev_pm_info {
 pm_message_t power_state;
 unsigned int can_wakeup:1;
 unsigned int async_suspend:1;
 bool is_prepared:1;
 bool is_suspended:1;
 bool is_noirq_suspended:1;
 bool is_late_suspended:1;
 bool ignore_children:1;
 bool early_init:1;
 bool direct_complete:1;
 spinlock_t lock;







 unsigned int should_wakeup:1;
# 593 "include/linux/pm.h"
 struct pm_subsys_data *subsys_data;
 void (*set_latency_tolerance)(struct device *, s32);
 struct dev_pm_qos *qos;
};

extern void update_pm_runtime_accounting(struct device *dev);
extern int dev_pm_get_subsys_data(struct device *dev);
extern void dev_pm_put_subsys_data(struct device *dev);






struct dev_pm_domain {
 struct dev_pm_ops ops;
 void (*detach)(struct device *dev, bool power_off);
};
# 719 "include/linux/pm.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dpm_suspend_start(pm_message_t state)
{
 return 0;
}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_pm_wait_for_dev(struct device *a, struct device *b)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *))
{
}
# 758 "include/linux/pm.h"
enum dpm_order {
 DPM_ORDER_NONE,
 DPM_ORDER_DEV_AFTER_PARENT,
 DPM_ORDER_PARENT_BEFORE_DEV,
 DPM_ORDER_DEV_LAST,
};
# 26 "include/linux/device.h" 2

# 1 "include/linux/ratelimit.h" 1
# 10 "include/linux/ratelimit.h"
struct ratelimit_state {
 raw_spinlock_t lock;

 int interval;
 int burst;
 int printed;
 int missed;
 unsigned long begin;
};
# 34 "include/linux/ratelimit.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ratelimit_state_init(struct ratelimit_state *rs,
     int interval, int burst)
{
 do { *(&rs->lock) = (raw_spinlock_t) { .raw_lock = { 0 }, }; } while (0);
 rs->interval = interval;
 rs->burst = burst;
 rs->printed = 0;
 rs->missed = 0;
 rs->begin = 0;
}

extern struct ratelimit_state printk_ratelimit_state;

extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
# 28 "include/linux/device.h" 2


# 1 "./arch/sparc/include/asm/device.h" 1
# 9 "./arch/sparc/include/asm/device.h"
# 1 "./arch/sparc/include/asm/openprom.h" 1
# 14 "./arch/sparc/include/asm/openprom.h"
# 1 "include/linux/of.h" 1
# 22 "include/linux/of.h"
# 1 "include/linux/mod_devicetable.h" 1
# 12 "include/linux/mod_devicetable.h"
# 1 "include/linux/uuid.h" 1
# 23 "include/linux/uuid.h"
# 1 "include/uapi/linux/uuid.h" 1
# 27 "include/uapi/linux/uuid.h"
typedef struct {
 __u8 b[16];
} uuid_le;

typedef struct {
 __u8 b[16];
} uuid_be;
# 24 "include/linux/uuid.h" 2


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int uuid_le_cmp(const uuid_le u1, const uuid_le u2)
{
 return memcmp(&u1, &u2, sizeof(uuid_le));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int uuid_be_cmp(const uuid_be u1, const uuid_be u2)
{
 return memcmp(&u1, &u2, sizeof(uuid_be));
}

extern void uuid_le_gen(uuid_le *u);
extern void uuid_be_gen(uuid_be *u);
# 13 "include/linux/mod_devicetable.h" 2
typedef unsigned long kernel_ulong_t;




struct pci_device_id {
 __u32 vendor, device;
 __u32 subvendor, subdevice;
 __u32 class, class_mask;
 kernel_ulong_t driver_data;
};







struct ieee1394_device_id {
 __u32 match_flags;
 __u32 vendor_id;
 __u32 model_id;
 __u32 specifier_id;
 __u32 version;
 kernel_ulong_t driver_data;
};
# 101 "include/linux/mod_devicetable.h"
struct usb_device_id {

 __u16 match_flags;


 __u16 idVendor;
 __u16 idProduct;
 __u16 bcdDevice_lo;
 __u16 bcdDevice_hi;


 __u8 bDeviceClass;
 __u8 bDeviceSubClass;
 __u8 bDeviceProtocol;


 __u8 bInterfaceClass;
 __u8 bInterfaceSubClass;
 __u8 bInterfaceProtocol;


 __u8 bInterfaceNumber;


 kernel_ulong_t driver_info
  __attribute__((aligned(sizeof(kernel_ulong_t))));
};
# 146 "include/linux/mod_devicetable.h"
struct hid_device_id {
 __u16 bus;
 __u16 group;
 __u32 vendor;
 __u32 product;
 kernel_ulong_t driver_data;
};


struct ccw_device_id {
 __u16 match_flags;

 __u16 cu_type;
 __u16 dev_type;
 __u8 cu_model;
 __u8 dev_model;

 kernel_ulong_t driver_info;
};







struct ap_device_id {
 __u16 match_flags;
 __u8 dev_type;
 kernel_ulong_t driver_info;
};




struct css_device_id {
 __u8 match_flags;
 __u8 type;
 kernel_ulong_t driver_data;
};



struct acpi_device_id {
 __u8 id[9];
 kernel_ulong_t driver_data;
};




struct pnp_device_id {
 __u8 id[8];
 kernel_ulong_t driver_data;
};

struct pnp_card_device_id {
 __u8 id[8];
 kernel_ulong_t driver_data;
 struct {
  __u8 id[8];
 } devs[8];
};




struct serio_device_id {
 __u8 type;
 __u8 extra;
 __u8 id;
 __u8 proto;
};




struct of_device_id {
 char name[32];
 char type[32];
 char compatible[128];
 const void *data;
};


struct vio_device_id {
 char type[32];
 char compat[32];
};



struct pcmcia_device_id {
 __u16 match_flags;

 __u16 manf_id;
 __u16 card_id;

 __u8 func_id;


 __u8 function;


 __u8 device_no;

 __u32 prod_id_hash[4];


 const char * prod_id[4];


 kernel_ulong_t driver_info;
 char * cisfile;
};
# 301 "include/linux/mod_devicetable.h"
struct input_device_id {

 kernel_ulong_t flags;

 __u16 bustype;
 __u16 vendor;
 __u16 product;
 __u16 version;

 kernel_ulong_t evbit[0x1f / 64 + 1];
 kernel_ulong_t keybit[0x2ff / 64 + 1];
 kernel_ulong_t relbit[0x0f / 64 + 1];
 kernel_ulong_t absbit[0x3f / 64 + 1];
 kernel_ulong_t mscbit[0x07 / 64 + 1];
 kernel_ulong_t ledbit[0x0f / 64 + 1];
 kernel_ulong_t sndbit[0x07 / 64 + 1];
 kernel_ulong_t ffbit[0x7f / 64 + 1];
 kernel_ulong_t swbit[0x0f / 64 + 1];

 kernel_ulong_t driver_info;
};






struct eisa_device_id {
 char sig[8];
 kernel_ulong_t driver_data;
};



struct parisc_device_id {
 __u8 hw_type;
 __u8 hversion_rev;
 __u16 hversion;
 __u32 sversion;
};
# 351 "include/linux/mod_devicetable.h"
struct sdio_device_id {
 __u8 class;
 __u16 vendor;
 __u16 device;
 kernel_ulong_t driver_data;
};


struct ssb_device_id {
 __u16 vendor;
 __u16 coreid;
 __u8 revision;
 __u8 __pad;
} __attribute__((packed, aligned(2)));
# 373 "include/linux/mod_devicetable.h"
struct bcma_device_id {
 __u16 manuf;
 __u16 id;
 __u8 rev;
 __u8 class;
} __attribute__((packed,aligned(2)));
# 387 "include/linux/mod_devicetable.h"
struct virtio_device_id {
 __u32 device;
 __u32 vendor;
};





struct hv_vmbus_device_id {
 __u8 guid[16];
 kernel_ulong_t driver_data;
};






struct rpmsg_device_id {
 char name[32];
};






struct i2c_device_id {
 char name[20];
 kernel_ulong_t driver_data;
};






struct spi_device_id {
 char name[32];
 kernel_ulong_t driver_data;
};




struct spmi_device_id {
 char name[32];
 kernel_ulong_t driver_data;
};


enum dmi_field {
 DMI_NONE,
 DMI_BIOS_VENDOR,
 DMI_BIOS_VERSION,
 DMI_BIOS_DATE,
 DMI_SYS_VENDOR,
 DMI_PRODUCT_NAME,
 DMI_PRODUCT_VERSION,
 DMI_PRODUCT_SERIAL,
 DMI_PRODUCT_UUID,
 DMI_BOARD_VENDOR,
 DMI_BOARD_NAME,
 DMI_BOARD_VERSION,
 DMI_BOARD_SERIAL,
 DMI_BOARD_ASSET_TAG,
 DMI_CHASSIS_VENDOR,
 DMI_CHASSIS_TYPE,
 DMI_CHASSIS_VERSION,
 DMI_CHASSIS_SERIAL,
 DMI_CHASSIS_ASSET_TAG,
 DMI_STRING_MAX,
};

struct dmi_strmatch {
 unsigned char slot:7;
 unsigned char exact_match:1;
 char substr[79];
};

struct dmi_system_id {
 int (*callback)(const struct dmi_system_id *);
 const char *ident;
 struct dmi_strmatch matches[4];
 void *driver_data;
};
# 488 "include/linux/mod_devicetable.h"
struct platform_device_id {
 char name[20];
 kernel_ulong_t driver_data;
};
# 514 "include/linux/mod_devicetable.h"
struct mdio_device_id {
 __u32 phy_id;
 __u32 phy_id_mask;
};

struct zorro_device_id {
 __u32 id;
 kernel_ulong_t driver_data;
};






struct isapnp_device_id {
 unsigned short card_vendor, card_device;
 unsigned short vendor, function;
 kernel_ulong_t driver_data;
};
# 543 "include/linux/mod_devicetable.h"
struct amba_id {
 unsigned int id;
 unsigned int mask;
 void *data;
};
# 559 "include/linux/mod_devicetable.h"
struct x86_cpu_id {
 __u16 vendor;
 __u16 family;
 __u16 model;
 __u16 feature;
 kernel_ulong_t driver_data;
};
# 580 "include/linux/mod_devicetable.h"
struct cpu_feature {
 __u16 feature;
};



struct ipack_device_id {
 __u8 format;
 __u32 vendor;
 __u32 device;
};




struct mei_cl_device_id {
 char name[32];
 kernel_ulong_t driver_info;
};
# 614 "include/linux/mod_devicetable.h"
struct rio_device_id {
 __u16 did, vid;
 __u16 asm_did, asm_vid;
};

struct mcb_device_id {
 __u16 device;
 kernel_ulong_t driver_data;
};
# 23 "include/linux/of.h" 2



# 1 "include/linux/property.h" 1
# 18 "include/linux/property.h"
struct device;

enum dev_prop_type {
 DEV_PROP_U8,
 DEV_PROP_U16,
 DEV_PROP_U32,
 DEV_PROP_U64,
 DEV_PROP_STRING,
 DEV_PROP_MAX,
};

bool device_property_present(struct device *dev, const char *propname);
int device_property_read_u8_array(struct device *dev, const char *propname,
      u8 *val, size_t nval);
int device_property_read_u16_array(struct device *dev, const char *propname,
       u16 *val, size_t nval);
int device_property_read_u32_array(struct device *dev, const char *propname,
       u32 *val, size_t nval);
int device_property_read_u64_array(struct device *dev, const char *propname,
       u64 *val, size_t nval);
int device_property_read_string_array(struct device *dev, const char *propname,
          const char **val, size_t nval);
int device_property_read_string(struct device *dev, const char *propname,
    const char **val);

enum fwnode_type {
 FWNODE_INVALID = 0,
 FWNODE_OF,
 FWNODE_ACPI,
};

struct fwnode_handle {
 enum fwnode_type type;
};

bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname);
int fwnode_property_read_u8_array(struct fwnode_handle *fwnode,
      const char *propname, u8 *val,
      size_t nval);
int fwnode_property_read_u16_array(struct fwnode_handle *fwnode,
       const char *propname, u16 *val,
       size_t nval);
int fwnode_property_read_u32_array(struct fwnode_handle *fwnode,
       const char *propname, u32 *val,
       size_t nval);
int fwnode_property_read_u64_array(struct fwnode_handle *fwnode,
       const char *propname, u64 *val,
       size_t nval);
int fwnode_property_read_string_array(struct fwnode_handle *fwnode,
          const char *propname, const char **val,
          size_t nval);
int fwnode_property_read_string(struct fwnode_handle *fwnode,
    const char *propname, const char **val);

struct fwnode_handle *device_get_next_child_node(struct device *dev,
       struct fwnode_handle *child);





void fwnode_handle_put(struct fwnode_handle *fwnode);

unsigned int device_get_child_node_count(struct device *dev);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_property_read_bool(struct device *dev,
          const char *propname)
{
 return device_property_present(dev, propname);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_property_read_u8(struct device *dev,
       const char *propname, u8 *val)
{
 return device_property_read_u8_array(dev, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_property_read_u16(struct device *dev,
        const char *propname, u16 *val)
{
 return device_property_read_u16_array(dev, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_property_read_u32(struct device *dev,
        const char *propname, u32 *val)
{
 return device_property_read_u32_array(dev, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_property_read_u64(struct device *dev,
        const char *propname, u64 *val)
{
 return device_property_read_u64_array(dev, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool fwnode_property_read_bool(struct fwnode_handle *fwnode,
          const char *propname)
{
 return fwnode_property_present(fwnode, propname);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fwnode_property_read_u8(struct fwnode_handle *fwnode,
       const char *propname, u8 *val)
{
 return fwnode_property_read_u8_array(fwnode, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fwnode_property_read_u16(struct fwnode_handle *fwnode,
        const char *propname, u16 *val)
{
 return fwnode_property_read_u16_array(fwnode, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fwnode_property_read_u32(struct fwnode_handle *fwnode,
        const char *propname, u32 *val)
{
 return fwnode_property_read_u32_array(fwnode, propname, val, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fwnode_property_read_u64(struct fwnode_handle *fwnode,
        const char *propname, u64 *val)
{
 return fwnode_property_read_u64_array(fwnode, propname, val, 1);
}
# 27 "include/linux/of.h" 2





typedef u32 phandle;
typedef u32 ihandle;

struct property {
 char *name;
 int length;
 void *value;
 struct property *next;
 unsigned long _flags;
 unsigned int unique_id;
 struct bin_attribute attr;
};


struct of_irq_controller;


struct device_node {
 const char *name;
 const char *type;
 phandle phandle;
 const char *full_name;
 struct fwnode_handle fwnode;

 struct property *properties;
 struct property *deadprops;
 struct device_node *parent;
 struct device_node *child;
 struct device_node *sibling;
 struct kobject kobj;
 unsigned long _flags;
 void *data;

 const char *path_component_name;
 unsigned int unique_id;
 struct of_irq_controller *irq_trans;

};


struct of_phandle_args {
 struct device_node *np;
 int args_count;
 uint32_t args[16];
};

struct of_reconfig_data {
 struct device_node *dn;
 struct property *prop;
 struct property *old_prop;
};


extern struct kobj_type of_node_ktype;
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_node_init(struct device_node *node)
{
 kobject_init(&node->kobj, &of_node_ktype);
 node->fwnode.type = FWNODE_OF;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_node_is_initialized(struct device_node *node)
{
 return node && node->kobj.state_initialized;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_node_is_attached(struct device_node *node)
{
 return node && node->kobj.state_in_sysfs;
}






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *of_node_get(struct device_node *node)
{
 return node;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_node_put(struct device_node *node) { }



extern struct device_node *of_root;
extern struct device_node *of_chosen;
extern struct device_node *of_aliases;
extern struct device_node *of_stdout;
extern raw_spinlock_t devtree_lock;


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_of_node(struct fwnode_handle *fwnode)
{
 return fwnode && fwnode->type == FWNODE_OF;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *of_node(struct fwnode_handle *fwnode)
{
 return fwnode ? ({ const typeof( ((struct device_node *)0)->fwnode ) *__mptr = (fwnode); (struct device_node *)( (char *)__mptr - __builtin_offsetof(struct device_node,fwnode) );}) : ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool of_have_populated_dt(void)
{
 return of_root != ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool of_node_is_root(const struct device_node *node)
{
 return node && (node->parent == ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_node_check_flag(struct device_node *n, unsigned long flag)
{
 return test_bit(flag, &n->_flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_node_test_and_set_flag(struct device_node *n,
         unsigned long flag)
{
 return test_and_set_bit(flag, &n->_flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_node_set_flag(struct device_node *n, unsigned long flag)
{
 set_bit(flag, &n->_flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_node_clear_flag(struct device_node *n, unsigned long flag)
{
 clear_bit(flag, &n->_flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_check_flag(struct property *p, unsigned long flag)
{
 return test_bit(flag, &p->_flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_property_set_flag(struct property *p, unsigned long flag)
{
 set_bit(flag, &p->_flags);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_property_clear_flag(struct property *p, unsigned long flag)
{
 clear_bit(flag, &p->_flags);
}

extern struct device_node *__of_find_all_nodes(struct device_node *prev);
extern struct device_node *of_find_all_nodes(struct device_node *prev);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 of_read_number(const __be32 *cell, int size)
{
 u64 r = 0;
 while (size--)
  r = (r << 32) | (( __u32)(__be32)(*(cell++)));
 return r;
}


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long of_read_ulong(const __be32 *cell, int size)
{

 return of_read_number(cell, size);
}


# 1 "./arch/sparc/include/asm/prom.h" 1
# 1 "include/linux/of.h" 1
# 2 "./arch/sparc/include/asm/prom.h" 2
# 21 "./arch/sparc/include/asm/prom.h"
# 1 "include/linux/of_pdt.h" 1
# 17 "include/linux/of_pdt.h"
struct of_pdt_ops {




 int (*nextprop)(phandle node, char *prev, char *buf);


 int (*getproplen)(phandle node, const char *prop);
 int (*getproperty)(phandle node, const char *prop, char *buf,
   int bufsize);


 phandle (*getchild)(phandle parent);
 phandle (*getsibling)(phandle node);


 int (*pkg2path)(phandle node, char *buf, const int buflen, int *len);
};

extern void *prom_early_alloc(unsigned long size);


extern void of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops);

extern void (*of_pdt_build_more)(struct device_node *dp);
# 22 "./arch/sparc/include/asm/prom.h" 2
# 1 "include/linux/proc_fs.h" 1
# 10 "include/linux/proc_fs.h"
struct proc_dir_entry;



extern void proc_root_init(void);
extern void proc_flush_task(struct task_struct *);

extern struct proc_dir_entry *proc_symlink(const char *,
  struct proc_dir_entry *, const char *);
extern struct proc_dir_entry *proc_mkdir(const char *, struct proc_dir_entry *);
extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t,
           struct proc_dir_entry *, void *);
extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t,
           struct proc_dir_entry *);

extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
            struct proc_dir_entry *,
            const struct file_operations *,
            void *);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct proc_dir_entry *proc_create(
 const char *name, umode_t mode, struct proc_dir_entry *parent,
 const struct file_operations *proc_fops)
{
 return proc_create_data(name, mode, parent, proc_fops, ((void *)0));
}

extern void proc_set_size(struct proc_dir_entry *, loff_t);
extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
extern void *PDE_DATA(const struct inode *);
extern void *proc_get_parent_data(const struct inode *);
extern void proc_remove(struct proc_dir_entry *);
extern void remove_proc_entry(const char *, struct proc_dir_entry *);
extern int remove_proc_subtree(const char *, struct proc_dir_entry *);
# 77 "include/linux/proc_fs.h"
struct net;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct proc_dir_entry *proc_net_mkdir(
 struct net *net, const char *name, struct proc_dir_entry *parent)
{
 return proc_mkdir_data(name, 0, parent, net);
}
# 23 "./arch/sparc/include/asm/prom.h" 2


# 1 "include/linux/irqdomain.h" 1
# 36 "include/linux/irqdomain.h"
# 1 "include/linux/irqhandler.h" 1
# 9 "include/linux/irqhandler.h"
struct irq_desc;
struct irq_data;
typedef void (*irq_flow_handler_t)(unsigned int irq, struct irq_desc *desc);
typedef void (*irq_preflow_handler_t)(struct irq_data *data);
# 37 "include/linux/irqdomain.h" 2


struct device_node;
struct irq_domain;
struct of_device_id;
struct irq_chip;
struct irq_data;
# 63 "include/linux/irqdomain.h"
struct irq_domain_ops {
 int (*match)(struct irq_domain *d, struct device_node *node);
 int (*map)(struct irq_domain *d, unsigned int virq, irq_hw_number_t hw);
 void (*unmap)(struct irq_domain *d, unsigned int virq);
 int (*xlate)(struct irq_domain *d, struct device_node *node,
       const u32 *intspec, unsigned int intsize,
       unsigned long *out_hwirq, unsigned int *out_type);
# 80 "include/linux/irqdomain.h"
};

extern struct irq_domain_ops irq_generic_chip_ops;

struct irq_domain_chip_generic;
# 110 "include/linux/irqdomain.h"
struct irq_domain {
 struct list_head link;
 const char *name;
 const struct irq_domain_ops *ops;
 void *host_data;
 unsigned int flags;


 struct device_node *of_node;
 struct irq_domain_chip_generic *gc;





 irq_hw_number_t hwirq_max;
 unsigned int revmap_direct_max_irq;
 unsigned int revmap_size;
 struct radix_tree_root revmap_tree;
 unsigned int linear_revmap[];
};


enum {

 IRQ_DOMAIN_FLAG_HIERARCHY = (1 << 0),


 IRQ_DOMAIN_FLAG_AUTO_RECURSIVE = (1 << 1),






 IRQ_DOMAIN_FLAG_NONCORE = (1 << 16),
};
# 323 "include/linux/irqdomain.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void irq_dispose_mapping(unsigned int virq) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void irq_domain_activate_irq(struct irq_data *data) { }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void irq_domain_deactivate_irq(struct irq_data *data) { }
# 26 "./arch/sparc/include/asm/prom.h" 2
# 34 "./arch/sparc/include/asm/prom.h"
struct of_irq_controller {
 unsigned int (*irq_build)(struct device_node *, unsigned int, void *);
 void *data;
};

struct device_node *of_find_node_by_cpuid(int cpuid);
int of_set_property(struct device_node *node, const char *name, void *val, int len);
extern struct mutex of_set_property_mutex;
int of_getintprop_default(struct device_node *np,
     const char *name,
     int def);
int of_find_in_proplist(const char *list, const char *match, int len);

void prom_build_devicetree(void);
void of_populate_present_mask(void);
void of_fill_in_cpu_data(void);

struct resource;
void *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
void of_iounmap(struct resource *res, void *base, unsigned long size);

extern struct device_node *of_console_device;
extern char *of_console_path;
extern char *of_console_options;

void irq_trans_init(struct device_node *dp);
char *build_path_component(struct device_node *dp);
# 205 "include/linux/of.h" 2
# 231 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *of_node_full_name(const struct device_node *np)
{
 return np ? np->full_name : "<no-node>";
}




extern struct device_node *of_find_node_by_name(struct device_node *from,
 const char *name);
extern struct device_node *of_find_node_by_type(struct device_node *from,
 const char *type);
extern struct device_node *of_find_compatible_node(struct device_node *from,
 const char *type, const char *compat);
extern struct device_node *of_find_matching_node_and_match(
 struct device_node *from,
 const struct of_device_id *matches,
 const struct of_device_id **match);

extern struct device_node *of_find_node_opts_by_path(const char *path,
 const char **opts);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *of_find_node_by_path(const char *path)
{
 return of_find_node_opts_by_path(path, ((void *)0));
}

extern struct device_node *of_find_node_by_phandle(phandle handle);
extern struct device_node *of_get_parent(const struct device_node *node);
extern struct device_node *of_get_next_parent(struct device_node *node);
extern struct device_node *of_get_next_child(const struct device_node *node,
          struct device_node *prev);
extern struct device_node *of_get_next_available_child(
 const struct device_node *node, struct device_node *prev);

extern struct device_node *of_get_child_by_name(const struct device_node *node,
     const char *name);


extern struct device_node *of_find_next_cache_node(const struct device_node *);
extern struct device_node *of_find_node_with_property(
 struct device_node *from, const char *prop_name);

extern struct property *of_find_property(const struct device_node *np,
      const char *name,
      int *lenp);
extern int of_property_count_elems_of_size(const struct device_node *np,
    const char *propname, int elem_size);
extern int of_property_read_u32_index(const struct device_node *np,
           const char *propname,
           u32 index, u32 *out_value);
extern int of_property_read_u8_array(const struct device_node *np,
   const char *propname, u8 *out_values, size_t sz);
extern int of_property_read_u16_array(const struct device_node *np,
   const char *propname, u16 *out_values, size_t sz);
extern int of_property_read_u32_array(const struct device_node *np,
          const char *propname,
          u32 *out_values,
          size_t sz);
extern int of_property_read_u64(const struct device_node *np,
    const char *propname, u64 *out_value);
extern int of_property_read_u64_array(const struct device_node *np,
          const char *propname,
          u64 *out_values,
          size_t sz);

extern int of_property_read_string(struct device_node *np,
       const char *propname,
       const char **out_string);
extern int of_property_match_string(struct device_node *np,
        const char *propname,
        const char *string);
extern int of_property_read_string_helper(struct device_node *np,
           const char *propname,
           const char **out_strs, size_t sz, int index);
extern int of_device_is_compatible(const struct device_node *device,
       const char *);
extern bool of_device_is_available(const struct device_node *device);
extern const void *of_get_property(const struct device_node *node,
    const char *name,
    int *lenp);
extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);



extern int of_n_addr_cells(struct device_node *np);
extern int of_n_size_cells(struct device_node *np);
extern const struct of_device_id *of_match_node(
 const struct of_device_id *matches, const struct device_node *node);
extern int of_modalias_node(struct device_node *node, char *modalias, int len);
extern void of_print_phandle_args(const char *msg, const struct of_phandle_args *args);
extern struct device_node *of_parse_phandle(const struct device_node *np,
         const char *phandle_name,
         int index);
extern int of_parse_phandle_with_args(const struct device_node *np,
 const char *list_name, const char *cells_name, int index,
 struct of_phandle_args *out_args);
extern int of_parse_phandle_with_fixed_args(const struct device_node *np,
 const char *list_name, int cells_count, int index,
 struct of_phandle_args *out_args);
extern int of_count_phandle_with_args(const struct device_node *np,
 const char *list_name, const char *cells_name);

extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align));
extern int of_alias_get_id(struct device_node *np, const char *stem);

extern int of_machine_is_compatible(const char *compat);

extern int of_add_property(struct device_node *np, struct property *prop);
extern int of_remove_property(struct device_node *np, struct property *prop);
extern int of_update_property(struct device_node *np, struct property *newprop);
# 349 "include/linux/of.h"
extern int of_attach_node(struct device_node *);
extern int of_detach_node(struct device_node *);
# 362 "include/linux/of.h"
const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur,
          u32 *pu);







const char *of_prop_next_string(struct property *prop, const char *cur);

bool of_console_check(struct device_node *dn, char *name, int index);
# 624 "include/linux/of.h"
extern int of_node_to_nid(struct device_node *np);




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *of_find_matching_node(
 struct device_node *from,
 const struct of_device_id *matches)
{
 return of_find_matching_node_and_match(from, matches, ((void *)0));
}
# 647 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_u8_elems(const struct device_node *np,
    const char *propname)
{
 return of_property_count_elems_of_size(np, propname, sizeof(u8));
}
# 664 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_u16_elems(const struct device_node *np,
    const char *propname)
{
 return of_property_count_elems_of_size(np, propname, sizeof(u16));
}
# 681 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_u32_elems(const struct device_node *np,
    const char *propname)
{
 return of_property_count_elems_of_size(np, propname, sizeof(u32));
}
# 698 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_u64_elems(const struct device_node *np,
    const char *propname)
{
 return of_property_count_elems_of_size(np, propname, sizeof(u64));
}
# 717 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_string_array(struct device_node *np,
      const char *propname, const char **out_strs,
      size_t sz)
{
 return of_property_read_string_helper(np, propname, out_strs, sz, 0);
}
# 736 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_strings(struct device_node *np,
         const char *propname)
{
 return of_property_read_string_helper(np, propname, ((void *)0), 0, 0);
}
# 760 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_string_index(struct device_node *np,
      const char *propname,
      int index, const char **output)
{
 int rc = of_property_read_string_helper(np, propname, output, 1, index);
 return rc < 0 ? rc : 0;
}
# 776 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool of_property_read_bool(const struct device_node *np,
      const char *propname)
{
 struct property *prop = of_find_property(np, propname, ((void *)0));

 return prop ? true : false;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_u8(const struct device_node *np,
           const char *propname,
           u8 *out_value)
{
 return of_property_read_u8_array(np, propname, out_value, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_u16(const struct device_node *np,
           const char *propname,
           u16 *out_value)
{
 return of_property_read_u16_array(np, propname, out_value, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_u32(const struct device_node *np,
           const char *propname,
           u32 *out_value)
{
 return of_property_read_u32_array(np, propname, out_value, 1);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_s32(const struct device_node *np,
           const char *propname,
           s32 *out_value)
{
 return of_property_read_u32(np, propname, (u32*) out_value);
}
# 851 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_get_child_count(const struct device_node *np)
{
 struct device_node *child;
 int num = 0;

 for (child = of_get_next_child(np, ((void *)0)); child != ((void *)0); child = of_get_next_child(np, child))
  num++;

 return num;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_get_available_child_count(const struct device_node *np)
{
 struct device_node *child;
 int num = 0;

 for (child = of_get_next_available_child(np, ((void *)0)); child != ((void *)0); child = of_get_next_available_child(np, child))
  num++;

 return num;
}
# 887 "include/linux/of.h"
typedef int (*of_init_fn_2)(struct device_node *, struct device_node *);
typedef void (*of_init_fn_1)(struct device_node *);
# 909 "include/linux/of.h"
struct of_changeset_entry {
 struct list_head node;
 unsigned long action;
 struct device_node *np;
 struct property *prop;
 struct property *old_prop;
};
# 927 "include/linux/of.h"
struct of_changeset {
 struct list_head entries;
};

enum of_reconfig_change {
 OF_RECONFIG_NO_CHANGE = 0,
 OF_RECONFIG_CHANGE_ADD,
 OF_RECONFIG_CHANGE_REMOVE,
};
# 982 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_reconfig_notifier_register(struct notifier_block *nb)
{
 return -22;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_reconfig_notifier_unregister(struct notifier_block *nb)
{
 return -22;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_reconfig_notify(unsigned long action,
         struct of_reconfig_data *arg)
{
 return -22;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_reconfig_get_state_change(unsigned long action,
      struct of_reconfig_data *arg)
{
 return -22;
}



extern int of_resolve_phandles(struct device_node *tree);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool of_device_is_system_power_controller(const struct device_node *np)
{
 return of_property_read_bool(np, "system-power-controller");
}
# 1029 "include/linux/of.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_overlay_create(struct device_node *tree)
{
 return -524;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_overlay_destroy(int id)
{
 return -524;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_overlay_destroy_all(void)
{
 return -524;
}
# 15 "./arch/sparc/include/asm/openprom.h" 2


struct linux_dev_v0_funcs {
 int (*v0_devopen)(char *device_str);
 int (*v0_devclose)(int dev_desc);
 int (*v0_rdblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
 int (*v0_wrblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
 int (*v0_wrnetdev)(int dev_desc, int num_bytes, char *buf);
 int (*v0_rdnetdev)(int dev_desc, int num_bytes, char *buf);
 int (*v0_rdchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
 int (*v0_wrchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
 int (*v0_seekdev)(int dev_desc, long logical_offst, int from);
};


struct linux_dev_v2_funcs {
 phandle (*v2_inst2pkg)(int d);
 char * (*v2_dumb_mem_alloc)(char *va, unsigned sz);
 void (*v2_dumb_mem_free)(char *va, unsigned sz);


 char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned paddr, unsigned sz);
 void (*v2_dumb_munmap)(char *virta, unsigned size);

 int (*v2_dev_open)(char *devpath);
 void (*v2_dev_close)(int d);
 int (*v2_dev_read)(int d, char *buf, int nbytes);
 int (*v2_dev_write)(int d, const char *buf, int nbytes);
 int (*v2_dev_seek)(int d, int hi, int lo);


 void (*v2_wheee2)(void);
 void (*v2_wheee3)(void);
};

struct linux_mlist_v0 {
 struct linux_mlist_v0 *theres_more;
 unsigned int start_adr;
 unsigned num_bytes;
};

struct linux_mem_v0 {
 struct linux_mlist_v0 **v0_totphys;
 struct linux_mlist_v0 **v0_prommap;
 struct linux_mlist_v0 **v0_available;
};


struct linux_arguments_v0 {
 char *argv[8];
 char args[100];
 char boot_dev[2];
 int boot_dev_ctrl;
 int boot_dev_unit;
 int dev_partition;
 char *kernel_file_name;
 void *aieee1;
};


struct linux_bootargs_v2 {
 char **bootpath;
 char **bootargs;
 int *fd_stdin;
 int *fd_stdout;
};


struct linux_romvec {

 unsigned int pv_magic_cookie;
 unsigned int pv_romvers;
 unsigned int pv_plugin_revision;
 unsigned int pv_printrev;


 struct linux_mem_v0 pv_v0mem;


 struct linux_nodeops *pv_nodeops;

 char **pv_bootstr;
 struct linux_dev_v0_funcs pv_v0devops;

 char *pv_stdin;
 char *pv_stdout;






 int (*pv_getchar)(void);
 void (*pv_putchar)(int ch);


 int (*pv_nbgetchar)(void);
 int (*pv_nbputchar)(int ch);

 void (*pv_putstr)(char *str, int len);


 void (*pv_reboot)(char *bootstr);
 void (*pv_printf)(__const__ char *fmt, ...);
 void (*pv_abort)(void);
 __volatile__ int *pv_ticks;
 void (*pv_halt)(void);
 void (**pv_synchook)(void);


 union {
  void (*v0_eval)(int len, char *str);
  void (*v2_eval)(char *str);
 } pv_fortheval;

 struct linux_arguments_v0 **pv_v0bootargs;


 unsigned int (*pv_enaddr)(int d, char *enaddr);

 struct linux_bootargs_v2 pv_v2bootargs;
 struct linux_dev_v2_funcs pv_v2devops;

 int filler[15];


 void (*pv_setctxt)(int ctxt, char *va, int pmeg);
# 151 "./arch/sparc/include/asm/openprom.h"
 int (*v3_cpustart)(unsigned int whichcpu, int ctxtbl_ptr,
      int thiscontext, char *prog_counter);




 int (*v3_cpustop)(unsigned int whichcpu);




 int (*v3_cpuidle)(unsigned int whichcpu);





 int (*v3_cpuresume)(unsigned int whichcpu);
};


struct linux_nodeops {
 phandle (*no_nextnode)(phandle node);
 phandle (*no_child)(phandle node);
 int (*no_proplen)(phandle node, const char *name);
 int (*no_getprop)(phandle node, const char *name, char *val);
 int (*no_setprop)(phandle node, const char *name, char *val, int len);
 char * (*no_nextprop)(phandle node, char *name);
};
# 192 "./arch/sparc/include/asm/openprom.h"
struct linux_prom_registers {
 unsigned int which_io;
 unsigned int phys_addr;
 unsigned int reg_size;
};

struct linux_prom64_registers {
 unsigned long phys_addr;
 unsigned long reg_size;
};

struct linux_prom_irqs {
 int pri;
 int vector;
};


struct linux_prom_ranges {
 unsigned int ot_child_space;
 unsigned int ot_child_base;
 unsigned int ot_parent_space;
 unsigned int ot_parent_base;
 unsigned int or_size;
};





struct linux_prom_pci_registers {
 unsigned int phys_hi;
 unsigned int phys_mid;
 unsigned int phys_lo;

 unsigned int size_hi;
 unsigned int size_lo;
};
# 247 "./arch/sparc/include/asm/openprom.h"
struct linux_prom_pci_ranges {
 unsigned int child_phys_hi;
 unsigned int child_phys_mid;
 unsigned int child_phys_lo;

 unsigned int parent_phys_hi;
 unsigned int parent_phys_lo;

 unsigned int size_hi;
 unsigned int size_lo;
};

struct linux_prom_pci_intmap {
 unsigned int phys_hi;
 unsigned int phys_mid;
 unsigned int phys_lo;

 unsigned int interrupt;

 int cnode;
 unsigned int cinterrupt;
};

struct linux_prom_pci_intmask {
 unsigned int phys_hi;
 unsigned int phys_mid;
 unsigned int phys_lo;
 unsigned int interrupt;
};
# 10 "./arch/sparc/include/asm/device.h" 2

struct device_node;
struct platform_device;

struct dev_archdata {
 void *iommu;
 void *stc;
 void *host_controller;
 struct platform_device *op;
 int numa_node;
};

void of_propagate_archdata(struct platform_device *bus);

struct pdev_archdata {
 struct resource resource[24];
 unsigned int irqs[32];
 int num_irqs;
};
# 31 "include/linux/device.h" 2

struct device;
struct device_private;
struct device_driver;
struct driver_private;
struct module;
struct class;
struct subsys_private;
struct bus_type;
struct device_node;
struct iommu_ops;
struct iommu_group;

struct bus_attribute {
 struct attribute attr;
 ssize_t (*show)(struct bus_type *bus, char *buf);
 ssize_t (*store)(struct bus_type *bus, const char *buf, size_t count);
};
# 57 "include/linux/device.h"
extern int __attribute__((warn_unused_result)) bus_create_file(struct bus_type *,
     struct bus_attribute *);
extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
# 104 "include/linux/device.h"
struct bus_type {
 const char *name;
 const char *dev_name;
 struct device *dev_root;
 struct device_attribute *dev_attrs;
 const struct attribute_group **bus_groups;
 const struct attribute_group **dev_groups;
 const struct attribute_group **drv_groups;

 int (*match)(struct device *dev, struct device_driver *drv);
 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
 int (*probe)(struct device *dev);
 int (*remove)(struct device *dev);
 void (*shutdown)(struct device *dev);

 int (*online)(struct device *dev);
 int (*offline)(struct device *dev);

 int (*suspend)(struct device *dev, pm_message_t state);
 int (*resume)(struct device *dev);

 const struct dev_pm_ops *pm;

 const struct iommu_ops *iommu_ops;

 struct subsys_private *p;
 struct lock_class_key lock_key;
};

extern int __attribute__((warn_unused_result)) bus_register(struct bus_type *bus);

extern void bus_unregister(struct bus_type *bus);

extern int __attribute__((warn_unused_result)) bus_rescan_devices(struct bus_type *bus);


struct subsys_dev_iter {
 struct klist_iter ki;
 const struct device_type *type;
};
void subsys_dev_iter_init(struct subsys_dev_iter *iter,
    struct bus_type *subsys,
    struct device *start,
    const struct device_type *type);
struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter);
void subsys_dev_iter_exit(struct subsys_dev_iter *iter);

int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
       int (*fn)(struct device *dev, void *data));
struct device *bus_find_device(struct bus_type *bus, struct device *start,
          void *data,
          int (*match)(struct device *dev, void *data));
struct device *bus_find_device_by_name(struct bus_type *bus,
           struct device *start,
           const char *name);
struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id,
     struct device *hint);
int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
       void *data, int (*fn)(struct device_driver *, void *));
void bus_sort_breadthfirst(struct bus_type *bus,
      int (*compare)(const struct device *a,
       const struct device *b));






struct notifier_block;

extern int bus_register_notifier(struct bus_type *bus,
     struct notifier_block *nb);
extern int bus_unregister_notifier(struct bus_type *bus,
       struct notifier_block *nb);
# 194 "include/linux/device.h"
extern struct kset *bus_get_kset(struct bus_type *bus);
extern struct klist *bus_get_device_klist(struct bus_type *bus);
# 229 "include/linux/device.h"
struct device_driver {
 const char *name;
 struct bus_type *bus;

 struct module *owner;
 const char *mod_name;

 bool suppress_bind_attrs;

 const struct of_device_id *of_match_table;
 const struct acpi_device_id *acpi_match_table;

 int (*probe) (struct device *dev);
 int (*remove) (struct device *dev);
 void (*shutdown) (struct device *dev);
 int (*suspend) (struct device *dev, pm_message_t state);
 int (*resume) (struct device *dev);
 const struct attribute_group **groups;

 const struct dev_pm_ops *pm;

 struct driver_private *p;
};


extern int __attribute__((warn_unused_result)) driver_register(struct device_driver *drv);
extern void driver_unregister(struct device_driver *drv);

extern struct device_driver *driver_find(const char *name,
      struct bus_type *bus);
extern int driver_probe_done(void);
extern void wait_for_device_probe(void);




struct driver_attribute {
 struct attribute attr;
 ssize_t (*show)(struct device_driver *driver, char *buf);
 ssize_t (*store)(struct device_driver *driver, const char *buf,
    size_t count);
};
# 281 "include/linux/device.h"
extern int __attribute__((warn_unused_result)) driver_create_file(struct device_driver *driver,
     const struct driver_attribute *attr);
extern void driver_remove_file(struct device_driver *driver,
          const struct driver_attribute *attr);

extern int __attribute__((warn_unused_result)) driver_for_each_device(struct device_driver *drv,
            struct device *start,
            void *data,
            int (*fn)(struct device *dev,
        void *));
struct device *driver_find_device(struct device_driver *drv,
      struct device *start, void *data,
      int (*match)(struct device *dev, void *data));
# 308 "include/linux/device.h"
struct subsys_interface {
 const char *name;
 struct bus_type *subsys;
 struct list_head node;
 int (*add_dev)(struct device *dev, struct subsys_interface *sif);
 int (*remove_dev)(struct device *dev, struct subsys_interface *sif);
};

int subsys_interface_register(struct subsys_interface *sif);
void subsys_interface_unregister(struct subsys_interface *sif);

int subsys_system_register(struct bus_type *subsys,
      const struct attribute_group **groups);
int subsys_virtual_register(struct bus_type *subsys,
       const struct attribute_group **groups);
# 352 "include/linux/device.h"
struct class {
 const char *name;
 struct module *owner;

 struct class_attribute *class_attrs;
 const struct attribute_group **dev_groups;
 struct kobject *dev_kobj;

 int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);
 char *(*devnode)(struct device *dev, umode_t *mode);

 void (*class_release)(struct class *class);
 void (*dev_release)(struct device *dev);

 int (*suspend)(struct device *dev, pm_message_t state);
 int (*resume)(struct device *dev);

 const struct kobj_ns_type_operations *ns_type;
 const void *(*namespace)(struct device *dev);

 const struct dev_pm_ops *pm;

 struct subsys_private *p;
};

struct class_dev_iter {
 struct klist_iter ki;
 const struct device_type *type;
};

extern struct kobject *sysfs_dev_block_kobj;
extern struct kobject *sysfs_dev_char_kobj;
extern int __attribute__((warn_unused_result)) __class_register(struct class *class,
      struct lock_class_key *key);
extern void class_unregister(struct class *class);
# 396 "include/linux/device.h"
struct class_compat;
struct class_compat *class_compat_register(const char *name);
void class_compat_unregister(struct class_compat *cls);
int class_compat_create_link(struct class_compat *cls, struct device *dev,
        struct device *device_link);
void class_compat_remove_link(struct class_compat *cls, struct device *dev,
         struct device *device_link);

extern void class_dev_iter_init(struct class_dev_iter *iter,
    struct class *class,
    struct device *start,
    const struct device_type *type);
extern struct device *class_dev_iter_next(struct class_dev_iter *iter);
extern void class_dev_iter_exit(struct class_dev_iter *iter);

extern int class_for_each_device(struct class *class, struct device *start,
     void *data,
     int (*fn)(struct device *dev, void *data));
extern struct device *class_find_device(struct class *class,
     struct device *start, const void *data,
     int (*match)(struct device *, const void *));

struct class_attribute {
 struct attribute attr;
 ssize_t (*show)(struct class *class, struct class_attribute *attr,
   char *buf);
 ssize_t (*store)(struct class *class, struct class_attribute *attr,
   const char *buf, size_t count);
};
# 433 "include/linux/device.h"
extern int __attribute__((warn_unused_result)) class_create_file_ns(struct class *class,
          const struct class_attribute *attr,
          const void *ns);
extern void class_remove_file_ns(struct class *class,
     const struct class_attribute *attr,
     const void *ns);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) class_create_file(struct class *class,
     const struct class_attribute *attr)
{
 return class_create_file_ns(class, attr, ((void *)0));
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void class_remove_file(struct class *class,
         const struct class_attribute *attr)
{
 return class_remove_file_ns(class, attr, ((void *)0));
}


struct class_attribute_string {
 struct class_attribute attr;
 char *str;
};
# 465 "include/linux/device.h"
extern ssize_t show_class_attr_string(struct class *class, struct class_attribute *attr,
                        char *buf);

struct class_interface {
 struct list_head node;
 struct class *class;

 int (*add_dev) (struct device *, struct class_interface *);
 void (*remove_dev) (struct device *, struct class_interface *);
};

extern int __attribute__((warn_unused_result)) class_interface_register(struct class_interface *);
extern void class_interface_unregister(struct class_interface *);

extern struct class * __attribute__((warn_unused_result)) __class_create(struct module *owner,
        const char *name,
        struct lock_class_key *key);
extern void class_destroy(struct class *cls);
# 501 "include/linux/device.h"
struct device_type {
 const char *name;
 const struct attribute_group **groups;
 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
 char *(*devnode)(struct device *dev, umode_t *mode,
    kuid_t *uid, kgid_t *gid);
 void (*release)(struct device *dev);

 const struct dev_pm_ops *pm;
};


struct device_attribute {
 struct attribute attr;
 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
   char *buf);
 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
    const char *buf, size_t count);
};

struct dev_ext_attribute {
 struct device_attribute attr;
 void *var;
};

ssize_t device_show_ulong(struct device *dev, struct device_attribute *attr,
     char *buf);
ssize_t device_store_ulong(struct device *dev, struct device_attribute *attr,
      const char *buf, size_t count);
ssize_t device_show_int(struct device *dev, struct device_attribute *attr,
   char *buf);
ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
    const char *buf, size_t count);
ssize_t device_show_bool(struct device *dev, struct device_attribute *attr,
   char *buf);
ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
    const char *buf, size_t count);
# 560 "include/linux/device.h"
extern int device_create_file(struct device *device,
         const struct device_attribute *entry);
extern void device_remove_file(struct device *dev,
          const struct device_attribute *attr);
extern bool device_remove_file_self(struct device *dev,
        const struct device_attribute *attr);
extern int __attribute__((warn_unused_result)) device_create_bin_file(struct device *dev,
     const struct bin_attribute *attr);
extern void device_remove_bin_file(struct device *dev,
       const struct bin_attribute *attr);


typedef void (*dr_release_t)(struct device *dev, void *res);
typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);







extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp);

extern void devres_for_each_res(struct device *dev, dr_release_t release,
    dr_match_t match, void *match_data,
    void (*fn)(struct device *, void *, void *),
    void *data);
extern void devres_free(void *res);
extern void devres_add(struct device *dev, void *res);
extern void *devres_find(struct device *dev, dr_release_t release,
    dr_match_t match, void *match_data);
extern void *devres_get(struct device *dev, void *new_res,
   dr_match_t match, void *match_data);
extern void *devres_remove(struct device *dev, dr_release_t release,
      dr_match_t match, void *match_data);
extern int devres_destroy(struct device *dev, dr_release_t release,
     dr_match_t match, void *match_data);
extern int devres_release(struct device *dev, dr_release_t release,
     dr_match_t match, void *match_data);


extern void * __attribute__((warn_unused_result)) devres_open_group(struct device *dev, void *id,
          gfp_t gfp);
extern void devres_close_group(struct device *dev, void *id);
extern void devres_remove_group(struct device *dev, void *id);
extern int devres_release_group(struct device *dev, void *id);


extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp);
extern char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt,
        va_list ap);
extern __attribute__((format(printf, 3, 4)))
char *devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp)
{
 return devm_kmalloc(dev, size, gfp | (( gfp_t)0x8000u));
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *devm_kmalloc_array(struct device *dev,
           size_t n, size_t size, gfp_t flags)
{
 if (size != 0 && n > (~(size_t)0) / size)
  return ((void *)0);
 return devm_kmalloc(dev, n * size, flags);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *devm_kcalloc(struct device *dev,
     size_t n, size_t size, gfp_t flags)
{
 return devm_kmalloc_array(dev, n, size, flags | (( gfp_t)0x8000u));
}
extern void devm_kfree(struct device *dev, void *p);
extern char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp);
extern void *devm_kmemdup(struct device *dev, const void *src, size_t len,
     gfp_t gfp);

extern unsigned long devm_get_free_pages(struct device *dev,
      gfp_t gfp_mask, unsigned int order);
extern void devm_free_pages(struct device *dev, unsigned long addr);

void *devm_ioremap_resource(struct device *dev, struct resource *res);


int devm_add_action(struct device *dev, void (*action)(void *), void *data);
void devm_remove_action(struct device *dev, void (*action)(void *), void *data);

struct device_dma_parameters {




 unsigned int max_segment_size;
 unsigned long segment_boundary_mask;
};

struct acpi_device;

struct acpi_dev_node {



};
# 730 "include/linux/device.h"
struct device {
 struct device *parent;

 struct device_private *p;

 struct kobject kobj;
 const char *init_name;
 const struct device_type *type;

 struct mutex mutex;



 struct bus_type *bus;
 struct device_driver *driver;

 void *platform_data;

 void *driver_data;

 struct dev_pm_info power;
 struct dev_pm_domain *pm_domain;






 int numa_node;

 u64 *dma_mask;
 u64 coherent_dma_mask;




 unsigned long dma_pfn_offset;

 struct device_dma_parameters *dma_parms;

 struct list_head dma_pools;

 struct dma_coherent_mem *dma_mem;






 struct dev_archdata archdata;

 struct device_node *of_node;
 struct acpi_dev_node acpi_node;

 dev_t devt;
 u32 id;

 spinlock_t devres_lock;
 struct list_head devres_head;

 struct klist_node knode_class;
 struct class *class;
 const struct attribute_group **groups;

 void (*release)(struct device *dev);
 struct iommu_group *iommu_group;

 bool offline_disabled:1;
 bool offline:1;
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device *kobj_to_dev(struct kobject *kobj)
{
 return ({ const typeof( ((struct device *)0)->kobj ) *__mptr = (kobj); (struct device *)( (char *)__mptr - __builtin_offsetof(struct device,kobj) );});
}


# 1 "include/linux/pm_wakeup.h" 1
# 46 "include/linux/pm_wakeup.h"
struct wakeup_source {
 const char *name;
 struct list_head entry;
 spinlock_t lock;
 struct timer_list timer;
 unsigned long timer_expires;
 ktime_t total_time;
 ktime_t max_time;
 ktime_t last_time;
 ktime_t start_prevent_time;
 ktime_t prevent_sleep_time;
 unsigned long event_count;
 unsigned long active_count;
 unsigned long relax_count;
 unsigned long expire_count;
 unsigned long wakeup_count;
 bool active:1;
 bool autosleep_enabled:1;
};
# 105 "include/linux/pm_wakeup.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_set_wakeup_capable(struct device *dev, bool capable)
{
 dev->power.can_wakeup = capable;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_can_wakeup(struct device *dev)
{
 return dev->power.can_wakeup;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_prepare(struct wakeup_source *ws,
      const char *name) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct wakeup_source *wakeup_source_create(const char *name)
{
 return ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_drop(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_destroy(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_add(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_remove(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct wakeup_source *wakeup_source_register(const char *name)
{
 return ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_unregister(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_wakeup_enable(struct device *dev)
{
 dev->power.should_wakeup = true;
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_wakeup_disable(struct device *dev)
{
 dev->power.should_wakeup = false;
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_set_wakeup_enable(struct device *dev, bool enable)
{
 dev->power.should_wakeup = enable;
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_init_wakeup(struct device *dev, bool val)
{
 device_set_wakeup_capable(dev, val);
 device_set_wakeup_enable(dev, val);
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_may_wakeup(struct device *dev)
{
 return dev->power.can_wakeup && dev->power.should_wakeup;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __pm_stay_awake(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_stay_awake(struct device *dev) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __pm_relax(struct wakeup_source *ws) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_relax(struct device *dev) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_wakeup_event(struct device *dev, unsigned int msec) {}



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_init(struct wakeup_source *ws,
          const char *name)
{
 wakeup_source_prepare(ws, name);
 wakeup_source_add(ws);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_trash(struct wakeup_source *ws)
{
 wakeup_source_remove(ws);
 wakeup_source_drop(ws);
}
# 808 "include/linux/device.h" 2

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *dev_name(const struct device *dev)
{

 if (dev->init_name)
  return dev->init_name;

 return kobject_name(&dev->kobj);
}

extern __attribute__((format(printf, 2, 3)))
int dev_set_name(struct device *dev, const char *name, ...);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dev_to_node(struct device *dev)
{
 return dev->numa_node;
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_dev_node(struct device *dev, int node)
{
 dev->numa_node = node;
}
# 840 "include/linux/device.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *dev_get_drvdata(const struct device *dev)
{
 return dev->driver_data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_set_drvdata(struct device *dev, void *data)
{
 dev->driver_data = data;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pm_subsys_data *dev_to_psd(struct device *dev)
{
 return dev ? dev->power.subsys_data : ((void *)0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int dev_get_uevent_suppress(const struct device *dev)
{
 return dev->kobj.uevent_suppress;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_set_uevent_suppress(struct device *dev, int val)
{
 dev->kobj.uevent_suppress = val;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_is_registered(struct device *dev)
{
 return dev->kobj.state_in_sysfs;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_enable_async_suspend(struct device *dev)
{
 if (!dev->power.is_prepared)
  dev->power.async_suspend = true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_disable_async_suspend(struct device *dev)
{
 if (!dev->power.is_prepared)
  dev->power.async_suspend = false;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_async_suspend_enabled(struct device *dev)
{
 return !!dev->power.async_suspend;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_suspend_ignore_children(struct device *dev, bool enable)
{
 dev->power.ignore_children = enable;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_pm_syscore_device(struct device *dev, bool val)
{



}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_lock(struct device *dev)
{
 mutex_lock(&dev->mutex);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_trylock(struct device *dev)
{
 return mutex_trylock(&dev->mutex);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_unlock(struct device *dev)
{
 mutex_unlock(&dev->mutex);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_lock_assert(struct device *dev)
{
 do { (void)(&dev->mutex); } while (0);
}

void driver_init(void);




extern int __attribute__((warn_unused_result)) device_register(struct device *dev);
extern void device_unregister(struct device *dev);
extern void device_initialize(struct device *dev);
extern int __attribute__((warn_unused_result)) device_add(struct device *dev);
extern void device_del(struct device *dev);
extern int device_for_each_child(struct device *dev, void *data,
       int (*fn)(struct device *dev, void *data));
extern struct device *device_find_child(struct device *dev, void *data,
    int (*match)(struct device *dev, void *data));
extern int device_rename(struct device *dev, const char *new_name);
extern int device_move(struct device *dev, struct device *new_parent,
         enum dpm_order dpm_order);
extern const char *device_get_devnode(struct device *dev,
          umode_t *mode, kuid_t *uid, kgid_t *gid,
          const char **tmp);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_supports_offline(struct device *dev)
{
 return dev->bus && dev->bus->offline && dev->bus->online;
}

extern void lock_device_hotplug(void);
extern void unlock_device_hotplug(void);
extern int lock_device_hotplug_sysfs(void);
extern int device_offline(struct device *dev);
extern int device_online(struct device *dev);



extern struct device *__root_device_register(const char *name,
          struct module *owner);





extern void root_device_unregister(struct device *root);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *dev_get_platdata(const struct device *dev)
{
 return dev->platform_data;
}





extern int __attribute__((warn_unused_result)) device_bind_driver(struct device *dev);
extern void device_release_driver(struct device *dev);
extern int __attribute__((warn_unused_result)) device_attach(struct device *dev);
extern int __attribute__((warn_unused_result)) driver_attach(struct device_driver *drv);
extern int __attribute__((warn_unused_result)) device_reprobe(struct device *dev);




extern struct device *device_create_vargs(struct class *cls,
       struct device *parent,
       dev_t devt,
       void *drvdata,
       const char *fmt,
       va_list vargs);
extern __attribute__((format(printf, 5, 6)))
struct device *device_create(struct class *cls, struct device *parent,
        dev_t devt, void *drvdata,
        const char *fmt, ...);
extern __attribute__((format(printf, 6, 7)))
struct device *device_create_with_groups(struct class *cls,
        struct device *parent, dev_t devt, void *drvdata,
        const struct attribute_group **groups,
        const char *fmt, ...);
extern void device_destroy(struct class *cls, dev_t devt);







extern int (*platform_notify)(struct device *dev);

extern int (*platform_notify_remove)(struct device *dev);






extern struct device *get_device(struct device *dev);
extern void put_device(struct device *dev);






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int devtmpfs_create_node(struct device *dev) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int devtmpfs_delete_node(struct device *dev) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int devtmpfs_mount(const char *mountpoint) { return 0; }



extern void device_shutdown(void);


extern const char *dev_driver_string(const struct device *dev);




extern __attribute__((format(printf, 3, 0)))
int dev_vprintk_emit(int level, const struct device *dev,
       const char *fmt, va_list args);
extern __attribute__((format(printf, 3, 4)))
int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...);

extern __attribute__((format(printf, 3, 4)))
void dev_printk(const char *level, const struct device *dev,
  const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void dev_emerg(const struct device *dev, const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void dev_alert(const struct device *dev, const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void dev_crit(const struct device *dev, const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void dev_err(const struct device *dev, const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void dev_warn(const struct device *dev, const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void dev_notice(const struct device *dev, const char *fmt, ...);
extern __attribute__((format(printf, 2, 3)))
void _dev_info(const struct device *dev, const char *fmt, ...);
# 18 "include/linux/node.h" 2



struct node {
 struct device dev;




};

struct memory_block;
extern struct node *node_devices[];
typedef void (*node_registration_func_t)(struct node *);

extern void unregister_node(struct node *node);

extern int register_one_node(int nid);
extern void unregister_one_node(int nid);
extern int register_cpu_under_node(unsigned int cpu, unsigned int nid);
extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid);
extern int register_mem_sect_under_node(struct memory_block *mem_blk,
      int nid);
extern int unregister_mem_sect_under_nodes(struct memory_block *mem_blk,
        unsigned long phys_index);


extern void register_hugetlbfs_with_node(node_registration_func_t doregister,
      node_registration_func_t unregister);
# 17 "include/linux/cpu.h" 2



struct device;
struct device_node;
struct attribute_group;

struct cpu {
 int node_id;
 int hotpluggable;
 struct device dev;
};

extern int register_cpu(struct cpu *cpu, int num);
extern struct device *get_cpu_device(unsigned cpu);
extern bool cpu_is_hotpluggable(unsigned cpu);
extern bool arch_match_cpu_phys_id(int cpu, u64 phys_id);
extern bool arch_find_n_match_cpu_physical_id(struct device_node *cpun,
           int cpu, unsigned int *thread);

extern int cpu_add_dev_attr(struct device_attribute *attr);
extern void cpu_remove_dev_attr(struct device_attribute *attr);

extern int cpu_add_dev_attr_group(struct attribute_group *attrs);
extern void cpu_remove_dev_attr_group(struct attribute_group *attrs);

extern struct device *cpu_device_create(struct device *parent, void *drvdata,
     const struct attribute_group **groups,
     const char *fmt, ...);

extern void unregister_cpu(struct cpu *cpu);
extern ssize_t arch_cpu_probe(const char *, size_t);
extern ssize_t arch_cpu_release(const char *, size_t);

struct notifier_block;




enum {
# 68 "include/linux/cpu.h"
 CPU_PRI_SCHED_ACTIVE = ((int)(~0U>>1)),
 CPU_PRI_CPUSET_ACTIVE = ((int)(~0U>>1)) - 1,
 CPU_PRI_SCHED_INACTIVE = (-((int)(~0U>>1)) - 1) + 1,
 CPU_PRI_CPUSET_INACTIVE = (-((int)(~0U>>1)) - 1),


 CPU_PRI_PERF = 20,
 CPU_PRI_MIGRATION = 10,

 CPU_PRI_WORKQUEUE_UP = 5,
 CPU_PRI_WORKQUEUE_DOWN = -5,
};
# 134 "include/linux/cpu.h"
extern int register_cpu_notifier(struct notifier_block *nb);
extern int __register_cpu_notifier(struct notifier_block *nb);
extern void unregister_cpu_notifier(struct notifier_block *nb);
extern void __unregister_cpu_notifier(struct notifier_block *nb);
# 164 "include/linux/cpu.h"
int cpu_up(unsigned int cpu);
void notify_cpu_starting(unsigned int cpu);
extern void cpu_maps_update_begin(void);
extern void cpu_maps_update_done(void);
# 212 "include/linux/cpu.h"
extern struct bus_type cpu_subsys;




extern void cpu_hotplug_begin(void);
extern void cpu_hotplug_done(void);
extern void get_online_cpus(void);
extern bool try_get_online_cpus(void);
extern void put_online_cpus(void);
extern void cpu_hotplug_disable(void);
extern void cpu_hotplug_enable(void);






void clear_tasks_mm_cpumask(int cpu);
int cpu_down(unsigned int cpu);
# 255 "include/linux/cpu.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int disable_nonboot_cpus(void) { return 0; }
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void enable_nonboot_cpus(void) {}


enum cpuhp_state {
 CPUHP_OFFLINE,
 CPUHP_ONLINE,
};

void cpu_startup_entry(enum cpuhp_state state);

void cpu_idle_poll_ctrl(bool enable);

void arch_cpu_idle(void);
void arch_cpu_idle_prepare(void);
void arch_cpu_idle_enter(void);
void arch_cpu_idle_exit(void);
void arch_cpu_idle_dead(void);
# 49 "include/linux/perf_event.h" 2
# 1 "include/linux/irq_work.h" 1
# 20 "include/linux/irq_work.h"
struct irq_work {
 unsigned long flags;
 struct llist_node llnode;
 void (*func)(struct irq_work *);
};

static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *))
{
 work->flags = 0;
 work->func = func;
}



bool irq_work_queue(struct irq_work *work);


bool irq_work_queue_on(struct irq_work *work, int cpu);


void irq_work_run(void);
void irq_work_tick(void);
void irq_work_sync(struct irq_work *work);


# 1 "arch/sparc/include/generated/asm/irq_work.h" 1
# 1 "include/asm-generic/irq_work.h" 1



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool arch_irq_work_has_interrupt(void)
{
 return false;
}
# 1 "arch/sparc/include/generated/asm/irq_work.h" 2
# 47 "include/linux/irq_work.h" 2

bool irq_work_needs_cpu(void);
# 50 "include/linux/perf_event.h" 2
# 1 "include/linux/static_key.h" 1
# 1 "include/linux/jump_label.h" 1
# 52 "include/linux/jump_label.h"
extern bool static_key_initialized;
# 72 "include/linux/jump_label.h"
struct static_key {
 atomic_t enabled;
};


enum jump_label_type {
 JUMP_LABEL_DISABLE = 0,
 JUMP_LABEL_ENABLE,
};

struct module;



static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int static_key_count(struct static_key *key)
{
 return (*({ __attribute__((unused)) typeof((&key->enabled)->counter) __var = ( typeof((&key->enabled)->counter)) 0; (volatile typeof((&key->enabled)->counter) *)&((&key->enabled)->counter); }));
}
# 146 "include/linux/jump_label.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void jump_label_init(void)
{
 static_key_initialized = true;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool static_key_false(struct static_key *key)
{
 if (__builtin_expect(!!(static_key_count(key) > 0), 0))
  return true;
 return false;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool static_key_true(struct static_key *key)
{
 if (__builtin_expect(!!(static_key_count(key) > 0), 1))
  return true;
 return false;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void static_key_slow_inc(struct static_key *key)
{
 ({ int __ret_warn_on = !!(!static_key_initialized); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_fmt("include/linux/jump_label.h", 167, "%s used before call to jump_label_init", __func__); __builtin_expect(!!(__ret_warn_on), 0); });
 atomic_add(1, &key->enabled);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void static_key_slow_dec(struct static_key *key)
{
 ({ int __ret_warn_on = !!(!static_key_initialized); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_fmt("include/linux/jump_label.h", 173, "%s used before call to jump_label_init", __func__); __builtin_expect(!!(__ret_warn_on), 0); });
 atomic_sub(1, &key->enabled);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int jump_label_text_reserved(void *start, void *end)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void jump_label_lock(void) {}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void jump_label_unlock(void) {}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int jump_label_apply_nops(struct module *mod)
{
 return 0;
}
# 200 "include/linux/jump_label.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool static_key_enabled(struct static_key *key)
{
 return static_key_count(key) > 0;
}
# 1 "include/linux/static_key.h" 2
# 51 "include/linux/perf_event.h" 2
# 1 "include/linux/jump_label_ratelimit.h" 1
# 21 "include/linux/jump_label_ratelimit.h"
struct static_key_deferred {
 struct static_key key;
};
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void static_key_slow_dec_deferred(struct static_key_deferred *key)
{
 ({ int __ret_warn_on = !!(!static_key_initialized); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_fmt("include/linux/jump_label_ratelimit.h", 26, "%s used before call to jump_label_init", __func__); __builtin_expect(!!(__ret_warn_on), 0); });
 static_key_slow_dec(&key->key);
}
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
jump_label_rate_limit(struct static_key_deferred *key,
  unsigned long rl)
{
 ({ int __ret_warn_on = !!(!static_key_initialized); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_fmt("include/linux/jump_label_ratelimit.h", 33, "%s used before call to jump_label_init", __func__); __builtin_expect(!!(__ret_warn_on), 0); });
}
# 52 "include/linux/perf_event.h" 2


# 1 "include/linux/perf_regs.h" 1



struct perf_regs {
 __u64 abi;
 struct pt_regs *regs;
};
# 18 "include/linux/perf_regs.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 perf_reg_value(struct pt_regs *regs, int idx)
{
 return 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int perf_reg_validate(u64 mask)
{
 return mask ? -90 : 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 perf_reg_abi(struct task_struct *task)
{
 return PERF_SAMPLE_REGS_ABI_NONE;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_get_regs_user(struct perf_regs *regs_user,
          struct pt_regs *regs,
          struct pt_regs *regs_user_copy)
{
 regs_user->regs = (((struct thread_info *)(current)->stack)->kregs);
 regs_user->abi = perf_reg_abi(current);
}
# 55 "include/linux/perf_event.h" 2

# 1 "arch/sparc/include/generated/asm/local.h" 1
# 57 "include/linux/perf_event.h" 2

struct perf_callchain_entry {
 __u64 nr;
 __u64 ip[127];
};

struct perf_raw_record {
 u32 size;
 void *data;
};
# 77 "include/linux/perf_event.h"
struct perf_branch_stack {
 __u64 nr;
 struct perf_branch_entry entries[0];
};

struct task_struct;




struct hw_perf_event_extra {
 u64 config;
 unsigned int reg;
 int alloc;
 int idx;
};

struct event_constraint;




struct hw_perf_event {

 union {
  struct {
   u64 config;
   u64 last_tag;
   unsigned long config_base;
   unsigned long event_base;
   int event_base_rdpmc;
   int idx;
   int last_cpu;
   int flags;

   struct hw_perf_event_extra extra_reg;
   struct hw_perf_event_extra branch_reg;

   struct event_constraint *constraint;
  };
  struct {
   struct hrtimer hrtimer;
  };
  struct {
   struct task_struct *tp_target;

   struct list_head tp_list;
  };
# 137 "include/linux/perf_event.h"
 };
 int state;
 local64_t prev_count;
 u64 sample_period;
 u64 last_period;
 local64_t period_left;
 u64 interrupts_seq;
 u64 interrupts;

 u64 freq_time_stamp;
 u64 freq_count_stamp;

};
# 158 "include/linux/perf_event.h"
struct perf_event;
# 173 "include/linux/perf_event.h"
struct pmu {
 struct list_head entry;

 struct module *module;
 struct device *dev;
 const struct attribute_group **attr_groups;
 const char *name;
 int type;




 int capabilities;

 int * pmu_disable_count;
 struct perf_cpu_context * pmu_cpu_context;
 int task_ctx_nr;
 int hrtimer_interval_ms;





 void (*pmu_enable) (struct pmu *pmu);
 void (*pmu_disable) (struct pmu *pmu);





 int (*event_init) (struct perf_event *event);





 void (*event_mapped) (struct perf_event *event);
 void (*event_unmapped) (struct perf_event *event);
# 220 "include/linux/perf_event.h"
 int (*add) (struct perf_event *event, int flags);
 void (*del) (struct perf_event *event, int flags);






 void (*start) (struct perf_event *event, int flags);
 void (*stop) (struct perf_event *event, int flags);




 void (*read) (struct perf_event *event);
# 244 "include/linux/perf_event.h"
 void (*start_txn) (struct pmu *pmu);






 int (*commit_txn) (struct pmu *pmu);




 void (*cancel_txn) (struct pmu *pmu);





 int (*event_idx) (struct perf_event *event);




 void (*flush_branch_stack) (void);
};




enum perf_event_active_state {
 PERF_EVENT_STATE_EXIT = -3,
 PERF_EVENT_STATE_ERROR = -2,
 PERF_EVENT_STATE_OFF = -1,
 PERF_EVENT_STATE_INACTIVE = 0,
 PERF_EVENT_STATE_ACTIVE = 1,
};

struct file;
struct perf_sample_data;

typedef void (*perf_overflow_handler_t)(struct perf_event *,
     struct perf_sample_data *,
     struct pt_regs *regs);

enum perf_group_flag {
 PERF_GROUP_SOFTWARE = 0x1,
};




struct swevent_hlist {
 struct hlist_head heads[(1 << 8)];
 struct callback_head callback_head;
};





struct perf_cgroup;
struct ring_buffer;




struct perf_event {






 struct list_head event_entry;
# 327 "include/linux/perf_event.h"
 struct list_head group_entry;
 struct list_head sibling_list;






 struct list_head migrate_entry;

 struct hlist_node hlist_entry;
 struct list_head active_entry;
 int nr_siblings;
 int group_flags;
 struct perf_event *group_leader;
 struct pmu *pmu;

 enum perf_event_active_state state;
 unsigned int attach_state;
 local64_t count;
 atomic64_t child_count;
# 358 "include/linux/perf_event.h"
 u64 total_time_enabled;
 u64 total_time_running;
# 371 "include/linux/perf_event.h"
 u64 tstamp_enabled;
 u64 tstamp_running;
 u64 tstamp_stopped;
# 383 "include/linux/perf_event.h"
 u64 shadow_ctx_time;

 struct perf_event_attr attr;
 u16 header_size;
 u16 id_header_size;
 u16 read_size;
 struct hw_perf_event hw;

 struct perf_event_context *ctx;
 atomic_long_t refcount;





 atomic64_t child_total_time_enabled;
 atomic64_t child_total_time_running;




 struct mutex child_mutex;
 struct list_head child_list;
 struct perf_event *parent;

 int oncpu;
 int cpu;

 struct list_head owner_entry;
 struct task_struct *owner;


 struct mutex mmap_mutex;
 atomic_t mmap_count;

 struct ring_buffer *rb;
 struct list_head rb_entry;
 unsigned long rcu_batches;
 int rcu_pending;


 wait_queue_head_t waitq;
 struct fasync_struct *fasync;


 int pending_wakeup;
 int pending_kill;
 int pending_disable;
 struct irq_work pending;

 atomic_t event_limit;

 void (*destroy)(struct perf_event *);
 struct callback_head callback_head;

 struct pid_namespace *ns;
 u64 id;

 perf_overflow_handler_t overflow_handler;
 void *overflow_handler_context;


 struct ftrace_event_call *tp_event;
 struct event_filter *filter;
# 458 "include/linux/perf_event.h"
};






struct perf_event_context {
 struct pmu *pmu;




 raw_spinlock_t lock;





 struct mutex mutex;

 struct list_head active_ctx_list;
 struct list_head pinned_groups;
 struct list_head flexible_groups;
 struct list_head event_list;
 int nr_events;
 int nr_active;
 int is_active;
 int nr_stat;
 int nr_freq;
 int rotate_disable;
 atomic_t refcount;
 struct task_struct *task;




 u64 time;
 u64 timestamp;





 struct perf_event_context *parent_ctx;
 u64 parent_gen;
 u64 generation;
 int pin_count;
 int nr_cgroups;
 int nr_branch_stack;
 struct callback_head callback_head;

 struct delayed_work orphans_remove;
 bool orphans_remove_sched;
};
# 523 "include/linux/perf_event.h"
struct perf_cpu_context {
 struct perf_event_context ctx;
 struct perf_event_context *task_ctx;
 int active_oncpu;
 int exclusive;
 struct hrtimer hrtimer;
 ktime_t hrtimer_interval;
 struct pmu *unique_pmu;
 struct perf_cgroup *cgrp;
};

struct perf_output_handle {
 struct perf_event *event;
 struct ring_buffer *rb;
 unsigned long wakeup;
 unsigned long size;
 void *addr;
 int page;
};



extern int perf_pmu_register(struct pmu *pmu, const char *name, int type);
extern void perf_pmu_unregister(struct pmu *pmu);

extern int perf_num_counters(void);
extern const char *perf_pmu_name(void);
extern void __perf_event_task_sched_in(struct task_struct *prev,
           struct task_struct *task);
extern void __perf_event_task_sched_out(struct task_struct *prev,
     struct task_struct *next);
extern int perf_event_init_task(struct task_struct *child);
extern void perf_event_exit_task(struct task_struct *child);
extern void perf_event_free_task(struct task_struct *task);
extern void perf_event_delayed_put(struct task_struct *task);
extern void perf_event_print_debug(void);
extern void perf_pmu_disable(struct pmu *pmu);
extern void perf_pmu_enable(struct pmu *pmu);
extern int perf_event_task_disable(void);
extern int perf_event_task_enable(void);
extern int perf_event_refresh(struct perf_event *event, int refresh);
extern void perf_event_update_userpage(struct perf_event *event);
extern int perf_event_release_kernel(struct perf_event *event);
extern struct perf_event *
perf_event_create_kernel_counter(struct perf_event_attr *attr,
    int cpu,
    struct task_struct *task,
    perf_overflow_handler_t callback,
    void *context);
extern void perf_pmu_migrate_context(struct pmu *pmu,
    int src_cpu, int dst_cpu);
extern u64 perf_event_read_value(struct perf_event *event,
     u64 *enabled, u64 *running);


struct perf_sample_data {




 u64 addr;
 struct perf_raw_record *raw;
 struct perf_branch_stack *br_stack;
 u64 period;
 u64 weight;
 u64 txn;
 union perf_mem_data_src data_src;





 u64 type;
 u64 ip;
 struct {
  u32 pid;
  u32 tid;
 } tid_entry;
 u64 time;
 u64 id;
 u64 stream_id;
 struct {
  u32 cpu;
  u32 reserved;
 } cpu_entry;
 struct perf_callchain_entry *callchain;





 struct perf_regs regs_user;
 struct pt_regs regs_user_copy;

 struct perf_regs regs_intr;
 u64 stack_user_size;
} __attribute__((__aligned__((1 << 6))));
# 628 "include/linux/perf_event.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_sample_data_init(struct perf_sample_data *data,
      u64 addr, u64 period)
{

 data->addr = addr;
 data->raw = ((void *)0);
 data->br_stack = ((void *)0);
 data->period = period;
 data->weight = 0;
 data->data_src.val = ((((__u64)0x01) << 0) | (((__u64)0x01) << 5) | (((__u64)0x01) << 19) | (((__u64)0x01) << 24) | (((__u64)0x01) << 26));
 data->txn = 0;
}

extern void perf_output_sample(struct perf_output_handle *handle,
          struct perf_event_header *header,
          struct perf_sample_data *data,
          struct perf_event *event);
extern void perf_prepare_sample(struct perf_event_header *header,
    struct perf_sample_data *data,
    struct perf_event *event,
    struct pt_regs *regs);

extern int perf_event_overflow(struct perf_event *event,
     struct perf_sample_data *data,
     struct pt_regs *regs);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_sampling_event(struct perf_event *event)
{
 return event->attr.sample_period != 0;
}




static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_software_event(struct perf_event *event)
{
 return event->pmu->task_ctx_nr == perf_sw_context;
}

extern struct static_key perf_swevent_enabled[PERF_COUNT_SW_MAX];

extern void ___perf_sw_event(u32, u64, struct pt_regs *, u64);
extern void __perf_sw_event(u32, u64, struct pt_regs *, u64);
# 684 "include/linux/perf_event.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_fetch_caller_regs(struct pt_regs *regs)
{
 __builtin_memset(regs, 0, sizeof(*regs));

 do { unsigned long _pstate, _asi, _pil, _i7, _fp; __asm__ __volatile__("rdpr %%pstate, %0\n\t" "rd %%asi, %1\n\t" "rdpr %%pil, %2\n\t" "mov %%i7, %3\n\t" "mov %%i6, %4\n\t" : "=r" (_pstate), "=r" (_asi), "=r" (_pil), "=r" (_i7), "=r" (_fp)); (regs)->tstate = (_pstate << 8) | (_asi << 24) | (_pil << 20); (regs)->tpc = (((unsigned long)__builtin_return_address(0))); (regs)->tnpc = (regs)->tpc + 4; (regs)->u_regs[14] = _fp; (regs)->u_regs[15] = _i7; } while (0);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void
perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)
{
 if (static_key_false(&perf_swevent_enabled[event_id]))
  __perf_sw_event(event_id, nr, regs, addr);
}

extern __attribute__((section(".data..percpu" ""))) __typeof__(struct pt_regs) __perf_regs[4];






static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void
perf_sw_event_sched(u32 event_id, u64 nr, u64 addr)
{
 if (static_key_false(&perf_swevent_enabled[event_id])) {
  struct pt_regs *regs = ({ do { const void *__vpp_verify = (typeof((&__perf_regs[0]) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&__perf_regs[0])) *)(&__perf_regs[0]))); (typeof((typeof(*(&__perf_regs[0])) *)(&__perf_regs[0]))) (__ptr + ((__local_per_cpu_offset))); }); });

  perf_fetch_caller_regs(regs);
  ___perf_sw_event(event_id, nr, regs, addr);
 }
}

extern struct static_key_deferred perf_sched_events;

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_event_task_sched_in(struct task_struct *prev,
         struct task_struct *task)
{
 if (static_key_false(&perf_sched_events.key))
  __perf_event_task_sched_in(prev, task);
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_event_task_sched_out(struct task_struct *prev,
          struct task_struct *next)
{
 perf_sw_event_sched(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 0);

 if (static_key_false(&perf_sched_events.key))
  __perf_event_task_sched_out(prev, next);
}

extern void perf_event_mmap(struct vm_area_struct *vma);
extern struct perf_guest_info_callbacks *perf_guest_cbs;
extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);
extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);

extern void perf_event_exec(void);
extern void perf_event_comm(struct task_struct *tsk, bool exec);
extern void perf_event_fork(struct task_struct *tsk);


extern __attribute__((section(".data..percpu" ""))) __typeof__(struct perf_callchain_entry) perf_callchain_entry;

extern void perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs);
extern void perf_callchain_kernel(struct perf_callchain_entry *entry, struct pt_regs *regs);

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_callchain_store(struct perf_callchain_entry *entry, u64 ip)
{
 if (entry->nr < 127)
  entry->ip[entry->nr++] = ip;
}

extern int sysctl_perf_event_paranoid;
extern int sysctl_perf_event_mlock;
extern int sysctl_perf_event_sample_rate;
extern int sysctl_perf_cpu_time_max_percent;

extern void perf_sample_event_took(u64 sample_len_ns);

extern int perf_proc_update_handler(struct ctl_table *table, int write,
  void *buffer, size_t *lenp,
  loff_t *ppos);
extern int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write,
  void *buffer, size_t *lenp,
  loff_t *ppos);


static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool perf_paranoid_tracepoint_raw(void)
{
 return sysctl_perf_event_paranoid > -1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool perf_paranoid_cpu(void)
{
 return sysctl_perf_event_paranoid > 0;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool perf_paranoid_kernel(void)
{
 return sysctl_perf_event_paranoid > 1;
}

extern void perf_event_init(void);
extern void perf_tp_event(u64 addr, u64 count, void *record,
     int entry_size, struct pt_regs *regs,
     struct hlist_head *head, int rctx,
     struct task_struct *task);
extern void perf_bp_event(struct perf_event *event, void *data);







static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool has_branch_stack(struct perf_event *event)
{
 return event->attr.sample_type & PERF_SAMPLE_BRANCH_STACK;
}

extern int perf_output_begin(struct perf_output_handle *handle,
        struct perf_event *event, unsigned int size);
extern void perf_output_end(struct perf_output_handle *handle);
extern unsigned int perf_output_copy(struct perf_output_handle *handle,
        const void *buf, unsigned int len);
extern unsigned int perf_output_skip(struct perf_output_handle *handle,
         unsigned int len);
extern int perf_swevent_get_recursion_context(void);
extern void perf_swevent_put_recursion_context(int rctx);
extern u64 perf_swevent_set_period(struct perf_event *event);
extern void perf_event_enable(struct perf_event *event);
extern void perf_event_disable(struct perf_event *event);
extern int __perf_event_disable(void *info);
extern void perf_event_task_tick(void);
# 865 "include/linux/perf_event.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool perf_event_can_stop_tick(void) { return true; }





static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void perf_restore_debug_store(void) { }
# 911 "include/linux/perf_event.h"
struct perf_pmu_events_attr {
 struct device_attribute attr;
 u64 id;
 const char *event_str;
};

ssize_t perf_event_sysfs_show(struct device *dev, struct device_attribute *attr,
         char *page);
# 15 "arch/sparc/math-emu/math_64.c" 2



# 1 "./arch/sparc/include/asm/uaccess.h" 1



# 1 "./arch/sparc/include/asm/uaccess_64.h" 1
# 15 "./arch/sparc/include/asm/uaccess_64.h"
# 1 "include/asm-generic/uaccess-unaligned.h" 1
# 16 "./arch/sparc/include/asm/uaccess_64.h" 2
# 52 "./arch/sparc/include/asm/uaccess_64.h"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __access_ok(const void * addr, unsigned long size)
{
 return 1;
}

static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int access_ok(int type, const void * addr, unsigned long size)
{
 return 1;
}
# 75 "./arch/sparc/include/asm/uaccess_64.h"
struct exception_table_entry {
        unsigned int insn, fixup;
};

void __ret_efault(void);
void __retl_efault(void);
# 106 "./arch/sparc/include/asm/uaccess_64.h"
struct __large_struct { unsigned long buf[100]; };
# 141 "./arch/sparc/include/asm/uaccess_64.h"
int __put_user_bad(void);
# 221 "./arch/sparc/include/asm/uaccess_64.h"
int __get_user_bad(void);

unsigned long __attribute__((warn_unused_result)) ___copy_from_user(void *to,
          const void *from,
          unsigned long size);
unsigned long copy_from_user_fixup(void *to, const void *from,
       unsigned long size);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __attribute__((warn_unused_result))
copy_from_user(void *to, const void *from, unsigned long size)
{
 unsigned long ret = ___copy_from_user(to, from, size);

 if (__builtin_expect(!!(ret), 0))
  ret = copy_from_user_fixup(to, from, size);

 return ret;
}


unsigned long __attribute__((warn_unused_result)) ___copy_to_user(void *to,
        const void *from,
        unsigned long size);
unsigned long copy_to_user_fixup(void *to, const void *from,
     unsigned long size);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __attribute__((warn_unused_result))
copy_to_user(void *to, const void *from, unsigned long size)
{
 unsigned long ret = ___copy_to_user(to, from, size);

 if (__builtin_expect(!!(ret), 0))
  ret = copy_to_user_fixup(to, from, size);
 return ret;
}


unsigned long __attribute__((warn_unused_result)) ___copy_in_user(void *to,
        const void *from,
        unsigned long size);
unsigned long copy_in_user_fixup(void *to, void *from,
     unsigned long size);
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __attribute__((warn_unused_result))
copy_in_user(void *to, void *from, unsigned long size)
{
 unsigned long ret = ___copy_in_user(to, from, size);

 if (__builtin_expect(!!(ret), 0))
  ret = copy_in_user_fixup(to, from, size);
 return ret;
}


unsigned long __attribute__((warn_unused_result)) __clear_user(void *, unsigned long);



__attribute__((warn_unused_result)) long strlen_user(const char *str);
__attribute__((warn_unused_result)) long strnlen_user(const char *str, long n);




struct pt_regs;
unsigned long compute_effective_address(struct pt_regs *,
     unsigned int insn,
     unsigned int rd);
# 5 "./arch/sparc/include/asm/uaccess.h" 2







long strncpy_from_user(char *dest, const char *src, long count);
# 19 "arch/sparc/math-emu/math_64.c" 2
# 1 "./arch/sparc/include/asm/cacheflush.h" 1







# 1 "./arch/sparc/include/asm/cacheflush_64.h" 1
# 13 "./arch/sparc/include/asm/cacheflush_64.h"
void __flushw_user(void);
# 33 "./arch/sparc/include/asm/cacheflush_64.h"
void flush_icache_range(unsigned long start, unsigned long end);
void __flush_icache_page(unsigned long);

void __flush_dcache_page(void *addr, int flush_icache);
void flush_dcache_page_impl(struct page *page);

void smp_flush_dcache_page_impl(struct page *page, int cpu);
void flush_dcache_page_all(struct mm_struct *mm, struct page *page);





void __flush_dcache_range(unsigned long start, unsigned long end);

void flush_dcache_page(struct page *page);




void flush_ptrace_access(struct vm_area_struct *, struct page *,
    unsigned long uaddr, void *kaddr,
    unsigned long len, int write);
# 9 "./arch/sparc/include/asm/cacheflush.h" 2
# 20 "arch/sparc/math-emu/math_64.c" 2

# 1 "arch/sparc/math-emu/sfp-util_64.h" 1
# 22 "arch/sparc/math-emu/math_64.c" 2
# 1 "include/math-emu/soft-fp.h" 1
# 38 "include/math-emu/soft-fp.h"
# 1 "./arch/sparc/include/asm/sfp-machine.h" 1



# 1 "./arch/sparc/include/asm/sfp-machine_64.h" 1
# 5 "./arch/sparc/include/asm/sfp-machine.h" 2
# 39 "include/math-emu/soft-fp.h" 2
# 285 "include/math-emu/soft-fp.h"
# 1 "include/math-emu/op-1.h" 1
# 286 "include/math-emu/soft-fp.h" 2
# 1 "include/math-emu/op-2.h" 1
# 287 "include/math-emu/soft-fp.h" 2
# 1 "include/math-emu/op-4.h" 1
# 288 "include/math-emu/soft-fp.h" 2
# 1 "include/math-emu/op-8.h" 1
# 289 "include/math-emu/soft-fp.h" 2
# 1 "include/math-emu/op-common.h" 1
# 290 "include/math-emu/soft-fp.h" 2
# 302 "include/math-emu/soft-fp.h"
typedef int QItype __attribute__ ((mode (QI)));
typedef int SItype __attribute__ ((mode (SI)));
typedef int DItype __attribute__ ((mode (DI)));
typedef unsigned int UQItype __attribute__ ((mode (QI)));
typedef unsigned int USItype __attribute__ ((mode (SI)));
typedef unsigned int UDItype __attribute__ ((mode (DI)));



typedef USItype UHWtype;
# 23 "arch/sparc/math-emu/math_64.c" 2
# 1 "include/math-emu/single.h" 1
# 69 "include/math-emu/single.h"
typedef float SFtype __attribute__ ((mode (SF)));

union _FP_UNION_S
{
  SFtype flt;
  struct
  {

    unsigned sign : 1;
    unsigned exp : 8;
    unsigned frac : 24 - (((unsigned long) 1 << (24 -1)) != 0);





  } bits __attribute__ ((packed));
};
# 24 "arch/sparc/math-emu/math_64.c" 2
# 1 "include/math-emu/double.h" 1
# 72 "include/math-emu/double.h"
typedef float DFtype __attribute__ ((mode (DF)));
# 199 "include/math-emu/double.h"
union _FP_UNION_D
{
  DFtype flt;
  struct
  {

    unsigned sign : 1;
    unsigned exp : 11;
    unsigned long frac : 53 - (((unsigned long) 1 << (53 -1) % 64) != 0);





  } bits __attribute__ ((packed));
};
# 25 "arch/sparc/math-emu/math_64.c" 2
# 1 "include/math-emu/quad.h" 1
# 72 "include/math-emu/quad.h"
typedef float TFtype __attribute__ ((mode (TF)));
# 203 "include/math-emu/quad.h"
union _FP_UNION_Q
{
  TFtype flt ;
  struct
  {
    unsigned long a, b;
  } longs;
  struct
  {

    unsigned sign : 1;
    unsigned exp : 15;
    unsigned long frac1 : 113 - (((unsigned long) 1 << (113 -1) % 64) != 0) - 64;
    unsigned long frac0 : 64;






  } bits;
};
# 26 "arch/sparc/math-emu/math_64.c" 2
# 100 "arch/sparc/math-emu/math_64.c"
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int record_exception(struct pt_regs *regs, int eflag)
{
 u64 fsr = (current_thread_info_reg)->xfsr[0];
 int would_trap;


 would_trap = (fsr & ((long)eflag << 23UL)) != 0UL;


 if(would_trap != 0) {
  eflag &= ((fsr & (0x1fUL << 23UL)) >> 23UL);
  if((eflag & (eflag - 1)) != 0) {
   if(eflag & (1 << 4))
    eflag = (1 << 4);
   else if(eflag & (1 << 3))
    eflag = (1 << 3);
   else if(eflag & (1 << 2))
    eflag = (1 << 2);
   else if(eflag & (1 << 1))
    eflag = (1 << 1);
   else if(eflag & (1 << 0))
    eflag = (1 << 0);
  }
 }







 fsr &= ~((0x1fUL << 0UL));
 fsr |= ((long)eflag << 0UL);







 if(would_trap == 0)
  fsr |= ((long)eflag << 5UL);


 if(would_trap != 0)
  fsr |= (1UL << 14);

 (current_thread_info_reg)->xfsr[0] = fsr;




 if(would_trap == 0) {
  regs->tpc = regs->tnpc;
  regs->tnpc += 4;
 }

 return (would_trap ? 0 : 1);
}

typedef union {
 u32 s;
 u64 d;
 u64 q[2];
} *argp;

int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
{
 unsigned long pc = regs->tpc;
 unsigned long tstate = regs->tstate;
 u32 insn = 0;
 int type = 0;






 int freg;
 static u64 zero[2] = { 0L, 0L };
 int flags;
 int _fex = 0;
 long SA_c __attribute__ ((unused)) = 0; long SA_s __attribute__ ((unused)) = 0; long SA_e __attribute__ ((unused)) = 0; unsigned long SA_f = 0; long SB_c __attribute__ ((unused)) = 0; long SB_s __attribute__ ((unused)) = 0; long SB_e __attribute__ ((unused)) = 0; unsigned long SB_f = 0; long SR_c __attribute__ ((unused)) = 0; long SR_s __attribute__ ((unused)) = 0; long SR_e __attribute__ ((unused)) = 0; unsigned long SR_f = 0;
 long DA_c __attribute__ ((unused)) = 0; long DA_s __attribute__ ((unused)) = 0; long DA_e __attribute__ ((unused)) = 0; unsigned long DA_f = 0; long DB_c __attribute__ ((unused)) = 0; long DB_s __attribute__ ((unused)) = 0; long DB_e __attribute__ ((unused)) = 0; unsigned long DB_f = 0; long DR_c __attribute__ ((unused)) = 0; long DR_s __attribute__ ((unused)) = 0; long DR_e __attribute__ ((unused)) = 0; unsigned long DR_f = 0;
 long QA_c __attribute__ ((unused)) = 0; long QA_s __attribute__ ((unused)) = 0; long QA_e __attribute__ ((unused)) = 0; unsigned long QA_f0 = 0, QA_f1 = 0; long QB_c __attribute__ ((unused)) = 0; long QB_s __attribute__ ((unused)) = 0; long QB_e __attribute__ ((unused)) = 0; unsigned long QB_f0 = 0, QB_f1 = 0; long QR_c __attribute__ ((unused)) = 0; long QR_s __attribute__ ((unused)) = 0; long QR_e __attribute__ ((unused)) = 0; unsigned long QR_f0 = 0, QR_f1 = 0;
 int IR;
 unsigned int UIR;
 long XR, xfsr;
 unsigned long UXR;

 if (tstate & (0x0000000000000400UL))
  die_if_kernel("unfinished/unimplemented FPop from kernel", regs);
 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);
 if (test_ti_thread_flag((current_thread_info_reg), 7))
  pc = (u32)pc;
 if (({ unsigned long __gu_addr = (unsigned long)((u32 *) pc); (void)0; ({ register int __gu_ret; register unsigned long __gu_val; switch (sizeof(*((u32 *) pc))) { case 1: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""ub" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 2: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""uh" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 4: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""uw" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 8: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""x" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; default: __gu_val = 0; __gu_ret = __get_user_bad(); break; } (insn) = ( __typeof__(*((u32 *) pc))) __gu_val; __gu_ret; });}) != -14) {
  if ((insn & 0xc1f80000) == 0x81a00000) {
   switch ((insn >> 5) & 0x1ff) {

   case 0x003:
   case 0x007:
   case 0x00b: type = (0 << 2) | (0 << 0) | (0 << 6) | (3 << 4) | (0 << 10) | (3 << 8) | (3 << 12); break;
   case 0x02b: type = (0 << 2) | (0 << 0) | (3 << 6) | (3 << 4) | (3 << 10) | (3 << 8) | (3 << 12); break;
   case 0x043:
   case 0x047: type = (2 << 2) | (3 << 0) | (2 << 6) | (3 << 4) | (2 << 10) | (3 << 8) | (3 << 12); break;
   case 0x04b:
   case 0x04f: type = (3 << 2) | (3 << 0) | (3 << 6) | (3 << 4) | (3 << 10) | (3 << 8) | (3 << 12); break;
   case 0x06e: type = (1 << 2) | (2 << 0) | (1 << 6) | (2 << 4) | (3 << 10) | (3 << 8) | (3 << 12); break;
   case 0x083: type = (0 << 2) | (0 << 0) | (1 << 6) | (3 << 4) | (0 << 10) | (2 << 8) | (3 << 12); break;
   case 0x08c: type = (0 << 2) | (0 << 0) | (0 << 6) | (2 << 4) | (1 << 10) | (3 << 8) | (3 << 12); break;
   case 0x0c7: type = (0 << 2) | (0 << 0) | (2 << 6) | (3 << 4) | (2 << 10) | (1 << 8) | (3 << 12); break;
   case 0x0cb: type = (0 << 2) | (0 << 0) | (2 << 6) | (3 << 4) | (2 << 10) | (2 << 8) | (3 << 12); break;
   case 0x0cc: type = (0 << 2) | (0 << 0) | (0 << 6) | (1 << 4) | (1 << 10) | (3 << 8) | (3 << 12); break;
   case 0x0cd: type = (0 << 2) | (0 << 0) | (1 << 6) | (1 << 4) | (1 << 10) | (3 << 8) | (3 << 12); break;
   case 0x0ce: type = (0 << 2) | (0 << 0) | (1 << 6) | (2 << 4) | (1 << 10) | (3 << 8) | (3 << 12); break;
   case 0x0d3: type = (0 << 2) | (0 << 0) | (1 << 6) | (3 << 4) | (0 << 10) | (1 << 8) | (3 << 12); break;






   case 0x029: {
    unsigned long x = (current_thread_info_reg)->xfsr[0];

    x = (x >> 14) & 0x7;
    type = (0 << 2) | (0 << 0) | (3 << 6) | (1 << 4) | (3 << 10) | (1 << 8) | (x << 12);
    break;
   }

   case 0x02a: {
    unsigned long x = (current_thread_info_reg)->xfsr[0];

    x = (x >> 14) & 0x7;
    type = (0 << 2) | (0 << 0) | (3 << 6) | (2 << 4) | (3 << 10) | (2 << 8) | (x << 12);
    break;
   }


   case 0x042:
   case 0x046: type = (2 << 2) | (2 << 0) | (2 << 6) | (2 << 4) | (2 << 10) | (2 << 8) | (2 << 12); break;
   case 0x04a:
   case 0x04e: type = (3 << 2) | (2 << 0) | (3 << 6) | (2 << 4) | (3 << 10) | (2 << 8) | (2 << 12); break;
   case 0x041:
   case 0x045: type = (2 << 2) | (1 << 0) | (2 << 6) | (1 << 4) | (2 << 10) | (1 << 8) | (2 << 12); break;
   case 0x049:
   case 0x04d: type = (3 << 2) | (1 << 0) | (3 << 6) | (1 << 4) | (3 << 10) | (1 << 8) | (2 << 12); break;
   case 0x069: type = (1 << 2) | (1 << 0) | (1 << 6) | (1 << 4) | (3 << 10) | (2 << 8) | (2 << 12); break;
   case 0x081: type = (0 << 2) | (0 << 0) | (1 << 6) | (1 << 4) | (0 << 10) | (2 << 8) | (2 << 12); break;
   case 0x082: type = (0 << 2) | (0 << 0) | (1 << 6) | (2 << 4) | (0 << 10) | (2 << 8) | (2 << 12); break;
   case 0x0c6: type = (0 << 2) | (0 << 0) | (2 << 6) | (2 << 4) | (2 << 10) | (1 << 8) | (2 << 12); break;
   case 0x0c9: type = (0 << 2) | (0 << 0) | (1 << 6) | (1 << 4) | (1 << 10) | (2 << 8) | (2 << 12); break;
   case 0x0d1: type = (0 << 2) | (0 << 0) | (1 << 6) | (1 << 4) | (0 << 10) | (1 << 8) | (2 << 12); break;
   case 0x0d2: type = (0 << 2) | (0 << 0) | (1 << 6) | (2 << 4) | (0 << 10) | (1 << 8) | (2 << 12); break;


   case 0x084: type = (0 << 2) | (0 << 0) | (0 << 6) | (2 << 4) | (1 << 10) | (1 << 8) | (2 << 12); break;
   case 0x088: type = (0 << 2) | (0 << 0) | (0 << 6) | (2 << 4) | (1 << 10) | (2 << 8) | (2 << 12); break;



   case 0x0c8: type = (0 << 2) | (0 << 0) | (0 << 6) | (1 << 4) | (1 << 10) | (2 << 8) | (2 << 12); break;
   }
  }
  else if ((insn & 0xc1f80000) == 0x81a80000) {
   IR = 2;
   switch ((insn >> 5) & 0x1ff) {
   case 0x053: type = (1 << 2) | (3 << 0) | (1 << 6) | (3 << 4) | (0 << 10) | (0 << 8) | (3 << 12); break;
   case 0x057: type = (1 << 2) | (3 << 0) | (1 << 6) | (3 << 4) | (0 << 10) | (0 << 8) | (3 << 12); break;

   case 0x003:
   case 0x043:
   case 0x083:
   case 0x0c3:

    if (!((insn >> 11) & 3))
     XR = (current_thread_info_reg)->xfsr[0] >> 10;
    else
     XR = (current_thread_info_reg)->xfsr[0] >> (30 + ((insn >> 10) & 0x6));
    XR &= 3;
    IR = 0;
    switch ((insn >> 14) & 0x7) {

    case 1: if (XR) IR = 1; break;
    case 2: if (XR == 1 || XR == 2) IR = 1; break;
    case 3: if (XR & 1) IR = 1; break;
    case 4: if (XR == 1) IR = 1; break;
    case 5: if (XR & 2) IR = 1; break;
    case 6: if (XR == 2) IR = 1; break;
    case 7: if (XR == 3) IR = 1; break;
    }
    if ((insn >> 14) & 8)
     IR ^= 1;
    break;
   case 0x103:
   case 0x183:

    XR = regs->tstate >> 32;
    if ((insn >> 5) & 0x80)
     XR >>= 4;
    XR &= 0xf;
    IR = 0;
    freg = ((XR >> 2) ^ XR) & 2;
    switch ((insn >> 14) & 0x7) {

    case 1: if (XR & 4) IR = 1; break;
    case 2: if ((XR & 4) || freg) IR = 1; break;
    case 3: if (freg) IR = 1; break;
    case 4: if (XR & 5) IR = 1; break;
    case 5: if (XR & 1) IR = 1; break;
    case 6: if (XR & 8) IR = 1; break;
    case 7: if (XR & 2) IR = 1; break;
    }
    if ((insn >> 14) & 8)
     IR ^= 1;
    break;
   case 0x027:
   case 0x047:
   case 0x067:
   case 0x0a7:
   case 0x0c7:
   case 0x0e7:
    freg = (insn >> 14) & 0x1f;
    if (!freg)
     XR = 0;
    else if (freg < 16)
     XR = regs->u_regs[freg];
    else if (!((test_ti_thread_flag((current_thread_info_reg), 7) && !(((regs->u_regs[14]) & 0x1) != 0)) ? false : true)) {
     struct reg_window32 *win32;
     __flushw_user();
     win32 = (struct reg_window32 *)((unsigned long)((u32)regs->u_regs[14]));
     ({ unsigned long __gu_addr = (unsigned long)(&win32->locals[freg - 16]); (void)0; ({ register int __gu_ret; register unsigned long __gu_val; switch (sizeof(*(&win32->locals[freg - 16]))) { case 1: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""ub" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 2: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""uh" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 4: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""uw" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 8: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""x" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; default: __gu_val = 0; __gu_ret = __get_user_bad(); break; } (XR) = ( __typeof__(*(&win32->locals[freg - 16]))) __gu_val; __gu_ret; });});
    } else {
     struct reg_window *win;
     __flushw_user();
     win = (struct reg_window *)(regs->u_regs[14] + 2047);
     ({ unsigned long __gu_addr = (unsigned long)(&win->locals[freg - 16]); (void)0; ({ register int __gu_ret; register unsigned long __gu_val; switch (sizeof(*(&win->locals[freg - 16]))) { case 1: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""ub" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 2: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""uh" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 4: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""uw" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; case 8: __asm__ __volatile__( "/* Get user asm, inline. */\n" "1:\t" "ld""x" "a [%2] %%asi, %1\n\t" "clr	%0\n" "2:\n\n\t" ".section .fixup,#alloc,#execinstr\n\t" ".align	4\n" "3:\n\t" "sethi	%%hi(2b), %0\n\t" "clr	%1\n\t" "jmpl	%0 + %%lo(2b), %%g0\n\t" " mov	%3, %0\n\n\t" ".previous\n\t" ".section __ex_table,\"a\"\n\t" ".align	4\n\t" ".word	1b, 3b\n\n\t" ".previous\n\t" : "=r" (__gu_ret), "=r" (__gu_val) : "r" (((struct __large_struct *)(__gu_addr))), "i" (-14)); break; default: __gu_val = 0; __gu_ret = __get_user_bad(); break; } (XR) = ( __typeof__(*(&win->locals[freg - 16]))) __gu_val; __gu_ret; });});
    }
    IR = 0;
    switch ((insn >> 10) & 3) {
    case 1: if (!XR) IR = 1; break;
    case 2: if (XR <= 0) IR = 1; break;
    case 3: if (XR < 0) IR = 1; break;
    }
    if ((insn >> 10) & 4)
     IR ^= 1;
    break;
   }
   if (IR == 0) {

    (current_thread_info_reg)->xfsr[0] &= ~((0x1fUL << 0UL));
    regs->tpc = regs->tnpc;
    regs->tnpc += 4;
    return 1;
   } else if (IR == 1) {

    insn = (insn & 0x3e00001f) | 0x81a00060;
    type = (0 << 2) | (0 << 0) | (0 << 6) | (3 << 4) | (0 << 10) | (3 << 8) | (3 << 12);
   }
  }
 }
 if (type) {
  argp rs1 = ((void *)0), rs2 = ((void *)0), rd = ((void *)0);







  if (!illegal_insn_trap) {
   int ftt = ((current_thread_info_reg)->xfsr[0] >> 14) & 0x7;
   if (ftt != (type >> 12))
    goto err;
  }
  (current_thread_info_reg)->xfsr[0] &= ~0x1c000;
  freg = ((insn >> 14) & 0x1f);
  switch (type & 0x3) {
  case 3: if (freg & 2) {
    (current_thread_info_reg)->xfsr[0] |= (6 << 14) ;
    goto err;
   }
  case 2: freg = ((freg & 1) << 5) | (freg & 0x1e);
  case 1: rs1 = (argp)&f->regs[freg];
   flags = (freg < 32) ? (0x0000000000000001UL) : (0x0000000000000002UL);
   if (!((current_thread_info_reg)->fpsaved[0] & flags))
    rs1 = (argp)&zero;
   break;
  }
  switch (type & 0xf) {
  case 7: do { union _FP_UNION_Q *_FP_UNPACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rs1)); QA_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0; QA_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1; QA_e = _FP_UNPACK_RAW_2_P_flo->bits.exp; QA_s = _FP_UNPACK_RAW_2_P_flo->bits.sign; } while (0); break;
  case 6: do { union _FP_UNION_D *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rs1)); DA_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; DA_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; DA_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); break;
  case 5: do { union _FP_UNION_S *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rs1)); SA_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; SA_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; SA_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); break;
  case 11: do { do { union _FP_UNION_Q *_FP_UNPACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rs1)); QA_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0; QA_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1; QA_e = _FP_UNPACK_RAW_2_P_flo->bits.exp; QA_s = _FP_UNPACK_RAW_2_P_flo->bits.sign; } while (0); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << (3) | QA_f0 >> (64 - (3)); QA_f0 <<= (3); } 0; }) : ({ QA_f1 = QA_f0 << ((3) - 64); QA_f0 = 0; })); } while (0); break;
  case 10: do { do { union _FP_UNION_D *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rs1)); DA_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; DA_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; DA_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) DA_f += DA_f; else DA_f <<= (3); } while (0); } while (0); break;
  case 9: do { do { union _FP_UNION_S *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rs1)); SA_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; SA_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; SA_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) SA_f += SA_f; else SA_f <<= (3); } while (0); } while (0); break;
  case 15: do { do { union _FP_UNION_Q *_FP_UNPACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rs1)); QA_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0; QA_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1; QA_e = _FP_UNPACK_RAW_2_P_flo->bits.exp; QA_s = _FP_UNPACK_RAW_2_P_flo->bits.sign; } while (0); do { switch (QA_e) { default: (QA_f1) |= ((unsigned long) 1 << (113 -1) % 64); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << (3) | QA_f0 >> (64 - (3)); QA_f0 <<= (3); } 0; }) : ({ QA_f1 = QA_f0 << ((3) - 64); QA_f0 = 0; })); QA_e -= 16383; QA_c = 0; break; case 0: if (((QA_f1 | QA_f0) == 0)) QA_c = 1; else if (0) { QA_c = 1; (QA_f0 = 0, QA_f1 = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (QA_f1) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QA_f1); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QA_f1); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QA_f1); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QA_f0); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QA_f0); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QA_f0); else return 0; } while (0); (_FP_UNPACK_CANONICAL_shift) += 64; } } while (0); _FP_UNPACK_CANONICAL_shift -= ((2*64) - 113); (void) ((((_FP_UNPACK_CANONICAL_shift + 3)) < 64) ? ({ if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << ((_FP_UNPACK_CANONICAL_shift + 3)) | QA_f0 >> (64 - ((_FP_UNPACK_CANONICAL_shift + 3))); QA_f0 <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } 0; }) : ({ QA_f1 = QA_f0 << (((_FP_UNPACK_CANONICAL_shift + 3)) - 64); QA_f0 = 0; })); QA_e -= (16383 - 1 + _FP_UNPACK_CANONICAL_shift); QA_c = 0; _fex |= (0); } break; case 32767: if (((QA_f1 | QA_f0) == 0)) QA_c = 2; else { QA_c = 3; if (((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0); } while (0); break;
  case 14: do { do { union _FP_UNION_D *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rs1)); DA_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; DA_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; DA_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { switch (DA_e) { default: (DA_f) |= ((unsigned long) 1 << (53 -1) % 64); do { if (__builtin_constant_p (3) && (3) == 1) DA_f += DA_f; else DA_f <<= (3); } while (0); DA_e -= 1023; DA_c = 0; break; case 0: if ((DA_f == 0)) DA_c = 1; else if (0) { DA_c = 1; (DA_f = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (DA_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (DA_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (DA_f); else return 0; } while (0); _FP_UNPACK_CANONICAL_shift -= (64 - 53); do { if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) DA_f += DA_f; else DA_f <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } while (0); DA_e -= (1023 - 1 + _FP_UNPACK_CANONICAL_shift); DA_c = 0; _fex |= (0); } break; case 2047: if ((DA_f == 0)) DA_c = 2; else { DA_c = 3; if (((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0); } while (0); break;
  case 13: do { do { union _FP_UNION_S *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rs1)); SA_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; SA_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; SA_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { switch (SA_e) { default: (SA_f) |= ((unsigned long) 1 << (24 -1)); do { if (__builtin_constant_p (3) && (3) == 1) SA_f += SA_f; else SA_f <<= (3); } while (0); SA_e -= 127; SA_c = 0; break; case 0: if ((SA_f == 0)) SA_c = 1; else if (0) { SA_c = 1; (SA_f = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (SA_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (SA_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (SA_f); else return 0; } while (0); _FP_UNPACK_CANONICAL_shift -= (64 - 24); do { if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) SA_f += SA_f; else SA_f <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } while (0); SA_e -= (127 - 1 + _FP_UNPACK_CANONICAL_shift); SA_c = 0; _fex |= (0); } break; case 255: if ((SA_f == 0)) SA_c = 2; else { SA_c = 3; if (((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2))) : !((SA_f) & ((unsigned long) 1 << (24 -2))))) _fex |= ((1 << 4) | 0); } break; } } while (0); } while (0); break;
  }
  freg = (insn & 0x1f);
  switch ((type >> 4) & 0x3) {
  case 3: if (freg & 2) {
    (current_thread_info_reg)->xfsr[0] |= (6 << 14) ;
    goto err;
   }
  case 2: freg = ((freg & 1) << 5) | (freg & 0x1e);
  case 1: rs2 = (argp)&f->regs[freg];
   flags = (freg < 32) ? (0x0000000000000001UL) : (0x0000000000000002UL);
   if (!((current_thread_info_reg)->fpsaved[0] & flags))
    rs2 = (argp)&zero;
   break;
  }
  switch ((type >> 4) & 0xf) {
  case 7: do { union _FP_UNION_Q *_FP_UNPACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rs2)); QB_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0; QB_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1; QB_e = _FP_UNPACK_RAW_2_P_flo->bits.exp; QB_s = _FP_UNPACK_RAW_2_P_flo->bits.sign; } while (0); break;
  case 6: do { union _FP_UNION_D *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rs2)); DB_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; DB_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; DB_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); break;
  case 5: do { union _FP_UNION_S *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rs2)); SB_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; SB_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; SB_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); break;
  case 11: do { do { union _FP_UNION_Q *_FP_UNPACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rs2)); QB_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0; QB_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1; QB_e = _FP_UNPACK_RAW_2_P_flo->bits.exp; QB_s = _FP_UNPACK_RAW_2_P_flo->bits.sign; } while (0); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (3) | QB_f0 >> (64 - (3)); QB_f0 <<= (3); } 0; }) : ({ QB_f1 = QB_f0 << ((3) - 64); QB_f0 = 0; })); } while (0); break;
  case 10: do { do { union _FP_UNION_D *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rs2)); DB_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; DB_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; DB_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) DB_f += DB_f; else DB_f <<= (3); } while (0); } while (0); break;
  case 9: do { do { union _FP_UNION_S *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rs2)); SB_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; SB_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; SB_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) SB_f += SB_f; else SB_f <<= (3); } while (0); } while (0); break;
  case 15: do { do { union _FP_UNION_Q *_FP_UNPACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rs2)); QB_f0 = _FP_UNPACK_RAW_2_P_flo->bits.frac0; QB_f1 = _FP_UNPACK_RAW_2_P_flo->bits.frac1; QB_e = _FP_UNPACK_RAW_2_P_flo->bits.exp; QB_s = _FP_UNPACK_RAW_2_P_flo->bits.sign; } while (0); do { switch (QB_e) { default: (QB_f1) |= ((unsigned long) 1 << (113 -1) % 64); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (3) | QB_f0 >> (64 - (3)); QB_f0 <<= (3); } 0; }) : ({ QB_f1 = QB_f0 << ((3) - 64); QB_f0 = 0; })); QB_e -= 16383; QB_c = 0; break; case 0: if (((QB_f1 | QB_f0) == 0)) QB_c = 1; else if (0) { QB_c = 1; (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (QB_f1) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QB_f1); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QB_f1); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QB_f1); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QB_f0); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QB_f0); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QB_f0); else return 0; } while (0); (_FP_UNPACK_CANONICAL_shift) += 64; } } while (0); _FP_UNPACK_CANONICAL_shift -= ((2*64) - 113); (void) ((((_FP_UNPACK_CANONICAL_shift + 3)) < 64) ? ({ if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << ((_FP_UNPACK_CANONICAL_shift + 3)) | QB_f0 >> (64 - ((_FP_UNPACK_CANONICAL_shift + 3))); QB_f0 <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } 0; }) : ({ QB_f1 = QB_f0 << (((_FP_UNPACK_CANONICAL_shift + 3)) - 64); QB_f0 = 0; })); QB_e -= (16383 - 1 + _FP_UNPACK_CANONICAL_shift); QB_c = 0; _fex |= (0); } break; case 32767: if (((QB_f1 | QB_f0) == 0)) QB_c = 2; else { QB_c = 3; if (((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0); } while (0); break;
  case 14: do { do { union _FP_UNION_D *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rs2)); DB_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; DB_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; DB_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { switch (DB_e) { default: (DB_f) |= ((unsigned long) 1 << (53 -1) % 64); do { if (__builtin_constant_p (3) && (3) == 1) DB_f += DB_f; else DB_f <<= (3); } while (0); DB_e -= 1023; DB_c = 0; break; case 0: if ((DB_f == 0)) DB_c = 1; else if (0) { DB_c = 1; (DB_f = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (DB_f); else return 0; } while (0); _FP_UNPACK_CANONICAL_shift -= (64 - 53); do { if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) DB_f += DB_f; else DB_f <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } while (0); DB_e -= (1023 - 1 + _FP_UNPACK_CANONICAL_shift); DB_c = 0; _fex |= (0); } break; case 2047: if ((DB_f == 0)) DB_c = 2; else { DB_c = 3; if (((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0); } while (0); break;
  case 13: do { do { union _FP_UNION_S *_FP_UNPACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rs2)); SB_f = _FP_UNPACK_RAW_1_P_flo->bits.frac; SB_e = _FP_UNPACK_RAW_1_P_flo->bits.exp; SB_s = _FP_UNPACK_RAW_1_P_flo->bits.sign; } while (0); do { switch (SB_e) { default: (SB_f) |= ((unsigned long) 1 << (24 -1)); do { if (__builtin_constant_p (3) && (3) == 1) SB_f += SB_f; else SB_f <<= (3); } while (0); SB_e -= 127; SB_c = 0; break; case 0: if ((SB_f == 0)) SB_c = 1; else if (0) { SB_c = 1; (SB_f = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (SB_f); else return 0; } while (0); _FP_UNPACK_CANONICAL_shift -= (64 - 24); do { if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) SB_f += SB_f; else SB_f <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } while (0); SB_e -= (127 - 1 + _FP_UNPACK_CANONICAL_shift); SB_c = 0; _fex |= (0); } break; case 255: if ((SB_f == 0)) SB_c = 2; else { SB_c = 3; if (((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _fex |= ((1 << 4) | 0); } break; } } while (0); } while (0); break;
  }
  freg = ((insn >> 25) & 0x1f);
  switch ((type >> 8) & 0x3) {
  case 3: if (freg & 2) {
    (current_thread_info_reg)->xfsr[0] |= (6 << 14) ;
    goto err;
   }
  case 2: freg = ((freg & 1) << 5) | (freg & 0x1e);
  case 1: rd = (argp)&f->regs[freg];
   flags = (freg < 32) ? (0x0000000000000001UL) : (0x0000000000000002UL);
   if (!((current_thread_info_reg)->fpsaved[0] & (0x0000000000000004UL))) {
    (current_thread_info_reg)->fpsaved[0] = (0x0000000000000004UL);
    (current_thread_info_reg)->gsr[0] = 0;
   }
   if (!((current_thread_info_reg)->fpsaved[0] & flags)) {
    if (freg < 32)
     __builtin_memset(f->regs, 0, 32*sizeof(u32));
    else
     __builtin_memset(f->regs+32, 0, 32*sizeof(u32));
   }
   (current_thread_info_reg)->fpsaved[0] |= flags;
   break;
  }
  switch ((insn >> 5) & 0x1ff) {

  case 0x041: do { do { if (0 && SA_e == 0 && !(SA_f == 0)) { (SA_f = 0); _fex |= (0); } } while (0); do { if (0 && SB_e == 0 && !(SB_f == 0)) { (SB_f = 0); _fex |= (0); } } while (0); if (SA_s == SB_s) { __label__ add1, add2, add3, add_done; SR_s = SA_s; int _FP_ADD_INTERNAL_ediff = SA_e - SB_e; if (_FP_ADD_INTERNAL_ediff > 0) { SR_e = SA_e; if (SB_e == 0) { if ((SB_f == 0)) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SA_f + SB_f); goto add3; } if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto add_done; } goto add1; } } else if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto add_done; } (SB_f) |= ((unsigned long) 1 << (24 -1+3)); add1: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SB_f = (SB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SB_f & 1 : (SB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SB_f == 0)) (SB_f = 1); (SR_f = SA_f + SB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; SR_e = SB_e; if (SA_e == 0) { if ((SA_f == 0)) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SB_f + SA_f); goto add3; } if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto add_done; } goto add2; } } else if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto add_done; } (SA_f) |= ((unsigned long) 1 << (24 -1+3)); add2: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SA_f = (SA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SA_f & 1 : (SA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SA_f == 0)) (SA_f = 1); (SR_f = SB_f + SA_f); } else { if (!(((SA_e + 1) & 255) > 1)) { if (SA_e == 0) { SR_e = 0; if ((SA_f == 0)) { if (!(SB_f == 0)) _fex |= (0); (SR_f = SB_f); goto add_done; } else if ((SB_f == 0)) { _fex |= (0); (SR_f = SA_f); goto add_done; } else { _fex |= (0); (SR_f = SA_f + SB_f); if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); SR_e = 1; } goto add_done; } } else { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); SR_e = 255; if ((SA_f == 0)) (SR_f = SB_f); else if ((SB_f == 0)) (SR_f = SA_f); else do { (SA_f >>= 3); (SB_f >>= 3); do { if (((SB_f) & ((unsigned long) 1 << (24 -2))) && !((SA_f) & ((unsigned long) 1 << (24 -2)))) { SR_s = SA_s; (SR_f = SA_f); } else { SR_s = SB_s; (SR_f = SB_f); } SR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); } while (0); goto add_done; } } (SR_f = SA_f + SB_f); SR_e = SA_e + 1; (SR_f = (SR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? SR_f & 1 : (SR_f << (64 - ((1)))) != 0))); if (SR_e == 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto add_done; } add3: if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); SR_e++; (SR_f = (SR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? SR_f & 1 : (SR_f << (64 - ((1)))) != 0))); if (SR_e == 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } add_done: ; } else { __label__ sub1, sub2, sub3, norm, sub_done; int _FP_ADD_INTERNAL_ediff = SA_e - SB_e; if (_FP_ADD_INTERNAL_ediff > 0) { SR_e = SA_e; SR_s = SA_s; if (SB_e == 0) { if ((SB_f == 0)) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SA_f - SB_f); goto sub3; } if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto sub_done; } goto sub1; } } else if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto sub_done; } (SB_f) |= ((unsigned long) 1 << (24 -1+3)); sub1: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SB_f = (SB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SB_f & 1 : (SB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SB_f == 0)) (SB_f = 1); (SR_f = SA_f - SB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; SR_e = SB_e; SR_s = SB_s; if (SA_e == 0) { if ((SA_f == 0)) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SB_f - SA_f); goto sub3; } if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto sub_done; } goto sub2; } } else if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto sub_done; } (SA_f) |= ((unsigned long) 1 << (24 -1+3)); sub2: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SA_f = (SA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SA_f & 1 : (SA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SA_f == 0)) (SA_f = 1); (SR_f = SB_f - SA_f); } else { if (!(((SA_e + 1) & 255) > 1)) { if (SA_e == 0) { SR_e = 0; if ((SA_f == 0)) { (SR_f = SB_f); if ((SB_f == 0)) SR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); else { _fex |= (0); SR_s = SB_s; } goto sub_done; } else if ((SB_f == 0)) { _fex |= (0); (SR_f = SA_f); SR_s = SA_s; goto sub_done; } else { _fex |= (0); (SR_f = SA_f - SB_f); SR_s = SA_s; if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f = SB_f - SA_f); SR_s = SB_s; } else if ((SR_f == 0)) SR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } } else { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); SR_e = 255; if ((SA_f == 0)) { if ((SB_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); _fex |= ((1 << 4) | 0); } else { SR_s = SB_s; (SR_f = SB_f); } } else { if ((SB_f == 0)) { SR_s = SA_s; (SR_f = SA_f); } else { do { (SA_f >>= 3); (SB_f >>= 3); do { if (((SB_f) & ((unsigned long) 1 << (24 -2))) && !((SA_f) & ((unsigned long) 1 << (24 -2)))) { SR_s = SA_s; (SR_f = SA_f); } else { SR_s = SB_s; (SR_f = SB_f); } SR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); } while (0); } } goto sub_done; } } SR_e = SA_e; (SR_f = SA_f - SB_f); SR_s = SA_s; if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f = SB_f - SA_f); SR_s = SB_s; } else if ((SR_f == 0)) { SR_e = 0; SR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } goto norm; } sub3: if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { int _FP_ADD_INTERNAL_diff; (SR_f) &= ((unsigned long) 1 << (24 -1+3)) - 1; norm: do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (SR_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (SR_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (SR_f); else return 0; } while (0); _FP_ADD_INTERNAL_diff -= (64 - (3 + 24)); do { if (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1) SR_f += SR_f; else SR_f <<= (_FP_ADD_INTERNAL_diff); } while (0); if (SR_e <= _FP_ADD_INTERNAL_diff) { _FP_ADD_INTERNAL_diff = _FP_ADD_INTERNAL_diff - SR_e + 1; (SR_f = (SR_f >> ((_FP_ADD_INTERNAL_diff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_diff)) && ((_FP_ADD_INTERNAL_diff)) == 1 ? SR_f & 1 : (SR_f << (64 - ((_FP_ADD_INTERNAL_diff)))) != 0))); SR_e = 0; } else { SR_e -= _FP_ADD_INTERNAL_diff; (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); } } sub_done: ; } } while (0); break;
  case 0x042: do { do { if (0 && DA_e == 0 && !(DA_f == 0)) { (DA_f = 0); _fex |= (0); } } while (0); do { if (0 && DB_e == 0 && !(DB_f == 0)) { (DB_f = 0); _fex |= (0); } } while (0); if (DA_s == DB_s) { __label__ add1, add2, add3, add_done; DR_s = DA_s; int _FP_ADD_INTERNAL_ediff = DA_e - DB_e; if (_FP_ADD_INTERNAL_ediff > 0) { DR_e = DA_e; if (DB_e == 0) { if ((DB_f == 0)) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DA_f + DB_f); goto add3; } if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto add_done; } goto add1; } } else if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto add_done; } (DB_f) |= ((unsigned long) 1 << (53 -1+3) % 64); add1: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DB_f = (DB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DB_f & 1 : (DB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DB_f == 0)) (DB_f = 1); (DR_f = DA_f + DB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; DR_e = DB_e; if (DA_e == 0) { if ((DA_f == 0)) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DB_f + DA_f); goto add3; } if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto add_done; } goto add2; } } else if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto add_done; } (DA_f) |= ((unsigned long) 1 << (53 -1+3) % 64); add2: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DA_f = (DA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DA_f & 1 : (DA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DA_f == 0)) (DA_f = 1); (DR_f = DB_f + DA_f); } else { if (!(((DA_e + 1) & 2047) > 1)) { if (DA_e == 0) { DR_e = 0; if ((DA_f == 0)) { if (!(DB_f == 0)) _fex |= (0); (DR_f = DB_f); goto add_done; } else if ((DB_f == 0)) { _fex |= (0); (DR_f = DA_f); goto add_done; } else { _fex |= (0); (DR_f = DA_f + DB_f); if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); DR_e = 1; } goto add_done; } } else { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); DR_e = 2047; if ((DA_f == 0)) (DR_f = DB_f); else if ((DB_f == 0)) (DR_f = DA_f); else do { (DA_f >>= 3); (DB_f >>= 3); do { if (((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) && !((DA_f) & ((unsigned long) 1 << (53 -2) % 64))) { DR_s = DA_s; (DR_f = DA_f); } else { DR_s = DB_s; (DR_f = DB_f); } DR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); } while (0); goto add_done; } } (DR_f = DA_f + DB_f); DR_e = DA_e + 1; (DR_f = (DR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? DR_f & 1 : (DR_f << (64 - ((1)))) != 0))); if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto add_done; } add3: if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); DR_e++; (DR_f = (DR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? DR_f & 1 : (DR_f << (64 - ((1)))) != 0))); if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } add_done: ; } else { __label__ sub1, sub2, sub3, norm, sub_done; int _FP_ADD_INTERNAL_ediff = DA_e - DB_e; if (_FP_ADD_INTERNAL_ediff > 0) { DR_e = DA_e; DR_s = DA_s; if (DB_e == 0) { if ((DB_f == 0)) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DA_f - DB_f); goto sub3; } if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto sub_done; } goto sub1; } } else if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto sub_done; } (DB_f) |= ((unsigned long) 1 << (53 -1+3) % 64); sub1: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DB_f = (DB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DB_f & 1 : (DB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DB_f == 0)) (DB_f = 1); (DR_f = DA_f - DB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; DR_e = DB_e; DR_s = DB_s; if (DA_e == 0) { if ((DA_f == 0)) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DB_f - DA_f); goto sub3; } if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto sub_done; } goto sub2; } } else if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto sub_done; } (DA_f) |= ((unsigned long) 1 << (53 -1+3) % 64); sub2: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DA_f = (DA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DA_f & 1 : (DA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DA_f == 0)) (DA_f = 1); (DR_f = DB_f - DA_f); } else { if (!(((DA_e + 1) & 2047) > 1)) { if (DA_e == 0) { DR_e = 0; if ((DA_f == 0)) { (DR_f = DB_f); if ((DB_f == 0)) DR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); else { _fex |= (0); DR_s = DB_s; } goto sub_done; } else if ((DB_f == 0)) { _fex |= (0); (DR_f = DA_f); DR_s = DA_s; goto sub_done; } else { _fex |= (0); (DR_f = DA_f - DB_f); DR_s = DA_s; if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f = DB_f - DA_f); DR_s = DB_s; } else if ((DR_f == 0)) DR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } } else { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); DR_e = 2047; if ((DA_f == 0)) { if ((DB_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); _fex |= ((1 << 4) | 0); } else { DR_s = DB_s; (DR_f = DB_f); } } else { if ((DB_f == 0)) { DR_s = DA_s; (DR_f = DA_f); } else { do { (DA_f >>= 3); (DB_f >>= 3); do { if (((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) && !((DA_f) & ((unsigned long) 1 << (53 -2) % 64))) { DR_s = DA_s; (DR_f = DA_f); } else { DR_s = DB_s; (DR_f = DB_f); } DR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); } while (0); } } goto sub_done; } } DR_e = DA_e; (DR_f = DA_f - DB_f); DR_s = DA_s; if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f = DB_f - DA_f); DR_s = DB_s; } else if ((DR_f == 0)) { DR_e = 0; DR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } goto norm; } sub3: if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { int _FP_ADD_INTERNAL_diff; (DR_f) &= ((unsigned long) 1 << (53 -1+3) % 64) - 1; norm: do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (DR_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (DR_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (DR_f); else return 0; } while (0); _FP_ADD_INTERNAL_diff -= (64 - (3 + 53)); do { if (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1) DR_f += DR_f; else DR_f <<= (_FP_ADD_INTERNAL_diff); } while (0); if (DR_e <= _FP_ADD_INTERNAL_diff) { _FP_ADD_INTERNAL_diff = _FP_ADD_INTERNAL_diff - DR_e + 1; (DR_f = (DR_f >> ((_FP_ADD_INTERNAL_diff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_diff)) && ((_FP_ADD_INTERNAL_diff)) == 1 ? DR_f & 1 : (DR_f << (64 - ((_FP_ADD_INTERNAL_diff)))) != 0))); DR_e = 0; } else { DR_e -= _FP_ADD_INTERNAL_diff; (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); } } sub_done: ; } } while (0); break;
  case 0x043: do { do { if (0 && QA_e == 0 && !((QA_f1 | QA_f0) == 0)) { (QA_f0 = 0, QA_f1 = 0); _fex |= (0); } } while (0); do { if (0 && QB_e == 0 && !((QB_f1 | QB_f0) == 0)) { (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } } while (0); if (QA_s == QB_s) { __label__ add1, add2, add3, add_done; QR_s = QA_s; int _FP_ADD_INTERNAL_ediff = QA_e - QB_e; if (_FP_ADD_INTERNAL_ediff > 0) { QR_e = QA_e; if (QB_e == 0) { if (((QB_f1 | QB_f0) == 0)) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); goto add3; } if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } goto add1; } } else if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } (QB_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); add1: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QB_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QB_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QB_f0 = (QB_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QB_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QB_f0) != 0)); QB_f1 = 0; })); else if (!((QB_f1 | QB_f0) == 0)) (QB_f0 = 1, QB_f1 = 0); __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; QR_e = QB_e; if (QA_e == 0) { if (((QA_f1 | QA_f0) == 0)) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); goto add3; } if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } goto add2; } } else if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } (QA_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); add2: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QA_f0 = (QA_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QA_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QA_f0 & 1 : (QA_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QA_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QA_f0 = (QA_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QA_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QA_f0) != 0)); QA_f1 = 0; })); else if (!((QA_f1 | QA_f0) == 0)) (QA_f0 = 1, QA_f1 = 0); __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); } else { if (!(((QA_e + 1) & 32767) > 1)) { if (QA_e == 0) { QR_e = 0; if (((QA_f1 | QA_f0) == 0)) { if (!((QB_f1 | QB_f0) == 0)) _fex |= (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } else if (((QB_f1 | QB_f0) == 0)) { _fex |= (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } else { _fex |= (0); __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); QR_e = 1; } goto add_done; } } else { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); QR_e = 32767; if (((QA_f1 | QA_f0) == 0)) (QR_f0 = QB_f0, QR_f1 = QB_f1); else if (((QB_f1 | QB_f0) == 0)) (QR_f0 = QA_f0, QR_f1 = QA_f1); else do { (void) (((3) < 64) ? ({ QA_f0 = QA_f0 >> (3) | QA_f1 << (64 - (3)); QA_f1 >>= (3); }) : ({ QA_f0 = QA_f1 >> ((3) - 64); QA_f1 = 0; })); (void) (((3) < 64) ? ({ QB_f0 = QB_f0 >> (3) | QB_f1 << (64 - (3)); QB_f1 >>= (3); }) : ({ QB_f0 = QB_f1 >> ((3) - 64); QB_f1 = 0; })); do { if (((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) && !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64))) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } QR_c = 3; } while (0); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (3) | QR_f0 >> (64 - (3)); QR_f0 <<= (3); } 0; }) : ({ QR_f1 = QR_f0 << ((3) - 64); QR_f0 = 0; })); } while (0); goto add_done; } } __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); QR_e = QA_e + 1; (void) (((1) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (1)) | QR_f0 >> (1) | (__builtin_constant_p (1) && (1) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (1))) != 0)); QR_f1 >>= (1); }) : ({ QR_f0 = (QR_f1 >> ((1) - 64) | ((((1) == 64 ? 0 : (QR_f1 << (2*64 - (1)))) | QR_f0) != 0)); QR_f1 = 0; })); if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto add_done; } add3: if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); QR_e++; (void) (((1) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (1)) | QR_f0 >> (1) | (__builtin_constant_p (1) && (1) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (1))) != 0)); QR_f1 >>= (1); }) : ({ QR_f0 = (QR_f1 >> ((1) - 64) | ((((1) == 64 ? 0 : (QR_f1 << (2*64 - (1)))) | QR_f0) != 0)); QR_f1 = 0; })); if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } add_done: ; } else { __label__ sub1, sub2, sub3, norm, sub_done; int _FP_ADD_INTERNAL_ediff = QA_e - QB_e; if (_FP_ADD_INTERNAL_ediff > 0) { QR_e = QA_e; QR_s = QA_s; if (QB_e == 0) { if (((QB_f1 | QB_f0) == 0)) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); goto sub3; } if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto sub_done; } goto sub1; } } else if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto sub_done; } (QB_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); sub1: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QB_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QB_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QB_f0 = (QB_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QB_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QB_f0) != 0)); QB_f1 = 0; })); else if (!((QB_f1 | QB_f0) == 0)) (QB_f0 = 1, QB_f1 = 0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; QR_e = QB_e; QR_s = QB_s; if (QA_e == 0) { if (((QA_f1 | QA_f0) == 0)) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); goto sub3; } if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto sub_done; } goto sub2; } } else if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto sub_done; } (QA_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); sub2: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QA_f0 = (QA_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QA_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QA_f0 & 1 : (QA_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QA_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QA_f0 = (QA_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QA_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QA_f0) != 0)); QA_f1 = 0; })); else if (!((QA_f1 | QA_f0) == 0)) (QA_f0 = 1, QA_f1 = 0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); } else { if (!(((QA_e + 1) & 32767) > 1)) { if (QA_e == 0) { QR_e = 0; if (((QA_f1 | QA_f0) == 0)) { (QR_f0 = QB_f0, QR_f1 = QB_f1); if (((QB_f1 | QB_f0) == 0)) QR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); else { _fex |= (0); QR_s = QB_s; } goto sub_done; } else if (((QB_f1 | QB_f0) == 0)) { _fex |= (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); QR_s = QA_s; goto sub_done; } else { _fex |= (0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); QR_s = QA_s; if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); QR_s = QB_s; } else if (((QR_f1 | QR_f0) == 0)) QR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } } else { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); QR_e = 32767; if (((QA_f1 | QA_f0) == 0)) { if (((QB_f1 | QB_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (3) | QR_f0 >> (64 - (3)); QR_f0 <<= (3); } 0; }) : ({ QR_f1 = QR_f0 << ((3) - 64); QR_f0 = 0; })); _fex |= ((1 << 4) | 0); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } } else { if (((QB_f1 | QB_f0) == 0)) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { do { (void) (((3) < 64) ? ({ QA_f0 = QA_f0 >> (3) | QA_f1 << (64 - (3)); QA_f1 >>= (3); }) : ({ QA_f0 = QA_f1 >> ((3) - 64); QA_f1 = 0; })); (void) (((3) < 64) ? ({ QB_f0 = QB_f0 >> (3) | QB_f1 << (64 - (3)); QB_f1 >>= (3); }) : ({ QB_f0 = QB_f1 >> ((3) - 64); QB_f1 = 0; })); do { if (((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) && !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64))) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } QR_c = 3; } while (0); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (3) | QR_f0 >> (64 - (3)); QR_f0 <<= (3); } 0; }) : ({ QR_f1 = QR_f0 << ((3) - 64); QR_f0 = 0; })); } while (0); } } goto sub_done; } } QR_e = QA_e; __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); QR_s = QA_s; if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); QR_s = QB_s; } else if (((QR_f1 | QR_f0) == 0)) { QR_e = 0; QR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } goto norm; } sub3: if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { int _FP_ADD_INTERNAL_diff; (QR_f1) &= ((unsigned long) 1 << (113 -1+3) % 64) - 1; norm: do { if (QR_f1) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (QR_f1); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (QR_f1); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (QR_f1); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (QR_f0); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (QR_f0); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (QR_f0); else return 0; } while (0); (_FP_ADD_INTERNAL_diff) += 64; } } while (0); _FP_ADD_INTERNAL_diff -= ((2*64) - (3 + 113)); (void) (((_FP_ADD_INTERNAL_diff) < 64) ? ({ if (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (_FP_ADD_INTERNAL_diff) | QR_f0 >> (64 - (_FP_ADD_INTERNAL_diff)); QR_f0 <<= (_FP_ADD_INTERNAL_diff); } 0; }) : ({ QR_f1 = QR_f0 << ((_FP_ADD_INTERNAL_diff) - 64); QR_f0 = 0; })); if (QR_e <= _FP_ADD_INTERNAL_diff) { _FP_ADD_INTERNAL_diff = _FP_ADD_INTERNAL_diff - QR_e + 1; (void) (((_FP_ADD_INTERNAL_diff) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (_FP_ADD_INTERNAL_diff)) | QR_f0 >> (_FP_ADD_INTERNAL_diff) | (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (_FP_ADD_INTERNAL_diff))) != 0)); QR_f1 >>= (_FP_ADD_INTERNAL_diff); }) : ({ QR_f0 = (QR_f1 >> ((_FP_ADD_INTERNAL_diff) - 64) | ((((_FP_ADD_INTERNAL_diff) == 64 ? 0 : (QR_f1 << (2*64 - (_FP_ADD_INTERNAL_diff)))) | QR_f0) != 0)); QR_f1 = 0; })); QR_e = 0; } else { QR_e -= _FP_ADD_INTERNAL_diff; (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); } } sub_done: ; } } while (0); break;

  case 0x045: do { if (!(SB_e == 255 && !(SB_f == 0))) SB_s ^= 1; do { do { if (0 && SA_e == 0 && !(SA_f == 0)) { (SA_f = 0); _fex |= (0); } } while (0); do { if (0 && SB_e == 0 && !(SB_f == 0)) { (SB_f = 0); _fex |= (0); } } while (0); if (SA_s == SB_s) { __label__ add1, add2, add3, add_done; SR_s = SA_s; int _FP_ADD_INTERNAL_ediff = SA_e - SB_e; if (_FP_ADD_INTERNAL_ediff > 0) { SR_e = SA_e; if (SB_e == 0) { if ((SB_f == 0)) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SA_f + SB_f); goto add3; } if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto add_done; } goto add1; } } else if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto add_done; } (SB_f) |= ((unsigned long) 1 << (24 -1+3)); add1: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SB_f = (SB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SB_f & 1 : (SB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SB_f == 0)) (SB_f = 1); (SR_f = SA_f + SB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; SR_e = SB_e; if (SA_e == 0) { if ((SA_f == 0)) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SB_f + SA_f); goto add3; } if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto add_done; } goto add2; } } else if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto add_done; } (SA_f) |= ((unsigned long) 1 << (24 -1+3)); add2: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SA_f = (SA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SA_f & 1 : (SA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SA_f == 0)) (SA_f = 1); (SR_f = SB_f + SA_f); } else { if (!(((SA_e + 1) & 255) > 1)) { if (SA_e == 0) { SR_e = 0; if ((SA_f == 0)) { if (!(SB_f == 0)) _fex |= (0); (SR_f = SB_f); goto add_done; } else if ((SB_f == 0)) { _fex |= (0); (SR_f = SA_f); goto add_done; } else { _fex |= (0); (SR_f = SA_f + SB_f); if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); SR_e = 1; } goto add_done; } } else { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); SR_e = 255; if ((SA_f == 0)) (SR_f = SB_f); else if ((SB_f == 0)) (SR_f = SA_f); else do { (SA_f >>= 3); (SB_f >>= 3); do { if (((SB_f) & ((unsigned long) 1 << (24 -2))) && !((SA_f) & ((unsigned long) 1 << (24 -2)))) { SR_s = SA_s; (SR_f = SA_f); } else { SR_s = SB_s; (SR_f = SB_f); } SR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); } while (0); goto add_done; } } (SR_f = SA_f + SB_f); SR_e = SA_e + 1; (SR_f = (SR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? SR_f & 1 : (SR_f << (64 - ((1)))) != 0))); if (SR_e == 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto add_done; } add3: if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); SR_e++; (SR_f = (SR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? SR_f & 1 : (SR_f << (64 - ((1)))) != 0))); if (SR_e == 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } add_done: ; } else { __label__ sub1, sub2, sub3, norm, sub_done; int _FP_ADD_INTERNAL_ediff = SA_e - SB_e; if (_FP_ADD_INTERNAL_ediff > 0) { SR_e = SA_e; SR_s = SA_s; if (SB_e == 0) { if ((SB_f == 0)) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SA_f - SB_f); goto sub3; } if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto sub_done; } goto sub1; } } else if (SA_e == 255) { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SA_f); goto sub_done; } (SB_f) |= ((unsigned long) 1 << (24 -1+3)); sub1: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SB_f = (SB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SB_f & 1 : (SB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SB_f == 0)) (SB_f = 1); (SR_f = SA_f - SB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; SR_e = SB_e; SR_s = SB_s; if (SA_e == 0) { if ((SA_f == 0)) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (SR_f = SB_f - SA_f); goto sub3; } if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto sub_done; } goto sub2; } } else if (SB_e == 255) { do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); (SR_f = SB_f); goto sub_done; } (SA_f) |= ((unsigned long) 1 << (24 -1+3)); sub2: if (_FP_ADD_INTERNAL_ediff <= (3 + 24)) (SA_f = (SA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? SA_f & 1 : (SA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(SA_f == 0)) (SA_f = 1); (SR_f = SB_f - SA_f); } else { if (!(((SA_e + 1) & 255) > 1)) { if (SA_e == 0) { SR_e = 0; if ((SA_f == 0)) { (SR_f = SB_f); if ((SB_f == 0)) SR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); else { _fex |= (0); SR_s = SB_s; } goto sub_done; } else if ((SB_f == 0)) { _fex |= (0); (SR_f = SA_f); SR_s = SA_s; goto sub_done; } else { _fex |= (0); (SR_f = SA_f - SB_f); SR_s = SA_s; if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f = SB_f - SA_f); SR_s = SB_s; } else if ((SR_f == 0)) SR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } } else { do { if (SA_e == 255 && !(SA_f == 0) && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2+3))) : !((SA_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); do { if (SB_e == 255 && !(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2+3))) : !((SB_f) & ((unsigned long) 1 << (24 -2+3))))) _fex |= ((1 << 4) | 0); } while (0); SR_e = 255; if ((SA_f == 0)) { if ((SB_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); _fex |= ((1 << 4) | 0); } else { SR_s = SB_s; (SR_f = SB_f); } } else { if ((SB_f == 0)) { SR_s = SA_s; (SR_f = SA_f); } else { do { (SA_f >>= 3); (SB_f >>= 3); do { if (((SB_f) & ((unsigned long) 1 << (24 -2))) && !((SA_f) & ((unsigned long) 1 << (24 -2)))) { SR_s = SA_s; (SR_f = SA_f); } else { SR_s = SB_s; (SR_f = SB_f); } SR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); } while (0); } } goto sub_done; } } SR_e = SA_e; (SR_f = SA_f - SB_f); SR_s = SA_s; if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { (SR_f = SB_f - SA_f); SR_s = SB_s; } else if ((SR_f == 0)) { SR_e = 0; SR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } goto norm; } sub3: if ((SR_f) & ((unsigned long) 1 << (24 -1+3))) { int _FP_ADD_INTERNAL_diff; (SR_f) &= ((unsigned long) 1 << (24 -1+3)) - 1; norm: do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (SR_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (SR_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (SR_f); else return 0; } while (0); _FP_ADD_INTERNAL_diff -= (64 - (3 + 24)); do { if (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1) SR_f += SR_f; else SR_f <<= (_FP_ADD_INTERNAL_diff); } while (0); if (SR_e <= _FP_ADD_INTERNAL_diff) { _FP_ADD_INTERNAL_diff = _FP_ADD_INTERNAL_diff - SR_e + 1; (SR_f = (SR_f >> ((_FP_ADD_INTERNAL_diff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_diff)) && ((_FP_ADD_INTERNAL_diff)) == 1 ? SR_f & 1 : (SR_f << (64 - ((_FP_ADD_INTERNAL_diff)))) != 0))); SR_e = 0; } else { SR_e -= _FP_ADD_INTERNAL_diff; (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); } } sub_done: ; } } while (0); } while (0); break;
  case 0x046: do { if (!(DB_e == 2047 && !(DB_f == 0))) DB_s ^= 1; do { do { if (0 && DA_e == 0 && !(DA_f == 0)) { (DA_f = 0); _fex |= (0); } } while (0); do { if (0 && DB_e == 0 && !(DB_f == 0)) { (DB_f = 0); _fex |= (0); } } while (0); if (DA_s == DB_s) { __label__ add1, add2, add3, add_done; DR_s = DA_s; int _FP_ADD_INTERNAL_ediff = DA_e - DB_e; if (_FP_ADD_INTERNAL_ediff > 0) { DR_e = DA_e; if (DB_e == 0) { if ((DB_f == 0)) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DA_f + DB_f); goto add3; } if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto add_done; } goto add1; } } else if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto add_done; } (DB_f) |= ((unsigned long) 1 << (53 -1+3) % 64); add1: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DB_f = (DB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DB_f & 1 : (DB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DB_f == 0)) (DB_f = 1); (DR_f = DA_f + DB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; DR_e = DB_e; if (DA_e == 0) { if ((DA_f == 0)) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DB_f + DA_f); goto add3; } if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto add_done; } goto add2; } } else if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto add_done; } (DA_f) |= ((unsigned long) 1 << (53 -1+3) % 64); add2: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DA_f = (DA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DA_f & 1 : (DA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DA_f == 0)) (DA_f = 1); (DR_f = DB_f + DA_f); } else { if (!(((DA_e + 1) & 2047) > 1)) { if (DA_e == 0) { DR_e = 0; if ((DA_f == 0)) { if (!(DB_f == 0)) _fex |= (0); (DR_f = DB_f); goto add_done; } else if ((DB_f == 0)) { _fex |= (0); (DR_f = DA_f); goto add_done; } else { _fex |= (0); (DR_f = DA_f + DB_f); if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); DR_e = 1; } goto add_done; } } else { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); DR_e = 2047; if ((DA_f == 0)) (DR_f = DB_f); else if ((DB_f == 0)) (DR_f = DA_f); else do { (DA_f >>= 3); (DB_f >>= 3); do { if (((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) && !((DA_f) & ((unsigned long) 1 << (53 -2) % 64))) { DR_s = DA_s; (DR_f = DA_f); } else { DR_s = DB_s; (DR_f = DB_f); } DR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); } while (0); goto add_done; } } (DR_f = DA_f + DB_f); DR_e = DA_e + 1; (DR_f = (DR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? DR_f & 1 : (DR_f << (64 - ((1)))) != 0))); if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto add_done; } add3: if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); DR_e++; (DR_f = (DR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? DR_f & 1 : (DR_f << (64 - ((1)))) != 0))); if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } add_done: ; } else { __label__ sub1, sub2, sub3, norm, sub_done; int _FP_ADD_INTERNAL_ediff = DA_e - DB_e; if (_FP_ADD_INTERNAL_ediff > 0) { DR_e = DA_e; DR_s = DA_s; if (DB_e == 0) { if ((DB_f == 0)) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DA_f - DB_f); goto sub3; } if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto sub_done; } goto sub1; } } else if (DA_e == 2047) { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DA_f); goto sub_done; } (DB_f) |= ((unsigned long) 1 << (53 -1+3) % 64); sub1: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DB_f = (DB_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DB_f & 1 : (DB_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DB_f == 0)) (DB_f = 1); (DR_f = DA_f - DB_f); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; DR_e = DB_e; DR_s = DB_s; if (DA_e == 0) { if ((DA_f == 0)) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { (DR_f = DB_f - DA_f); goto sub3; } if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto sub_done; } goto sub2; } } else if (DB_e == 2047) { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DR_f = DB_f); goto sub_done; } (DA_f) |= ((unsigned long) 1 << (53 -1+3) % 64); sub2: if (_FP_ADD_INTERNAL_ediff <= (3 + 53)) (DA_f = (DA_f >> ((_FP_ADD_INTERNAL_ediff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_ediff)) && ((_FP_ADD_INTERNAL_ediff)) == 1 ? DA_f & 1 : (DA_f << (64 - ((_FP_ADD_INTERNAL_ediff)))) != 0))); else if (!(DA_f == 0)) (DA_f = 1); (DR_f = DB_f - DA_f); } else { if (!(((DA_e + 1) & 2047) > 1)) { if (DA_e == 0) { DR_e = 0; if ((DA_f == 0)) { (DR_f = DB_f); if ((DB_f == 0)) DR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); else { _fex |= (0); DR_s = DB_s; } goto sub_done; } else if ((DB_f == 0)) { _fex |= (0); (DR_f = DA_f); DR_s = DA_s; goto sub_done; } else { _fex |= (0); (DR_f = DA_f - DB_f); DR_s = DA_s; if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f = DB_f - DA_f); DR_s = DB_s; } else if ((DR_f == 0)) DR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } } else { do { if (DA_e == 2047 && !(DA_f == 0) && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); DR_e = 2047; if ((DA_f == 0)) { if ((DB_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); _fex |= ((1 << 4) | 0); } else { DR_s = DB_s; (DR_f = DB_f); } } else { if ((DB_f == 0)) { DR_s = DA_s; (DR_f = DA_f); } else { do { (DA_f >>= 3); (DB_f >>= 3); do { if (((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) && !((DA_f) & ((unsigned long) 1 << (53 -2) % 64))) { DR_s = DA_s; (DR_f = DA_f); } else { DR_s = DB_s; (DR_f = DB_f); } DR_c = 3; } while (0); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); } while (0); } } goto sub_done; } } DR_e = DA_e; (DR_f = DA_f - DB_f); DR_s = DA_s; if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { (DR_f = DB_f - DA_f); DR_s = DB_s; } else if ((DR_f == 0)) { DR_e = 0; DR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } goto norm; } sub3: if ((DR_f) & ((unsigned long) 1 << (53 -1+3) % 64)) { int _FP_ADD_INTERNAL_diff; (DR_f) &= ((unsigned long) 1 << (53 -1+3) % 64) - 1; norm: do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (DR_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (DR_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (DR_f); else return 0; } while (0); _FP_ADD_INTERNAL_diff -= (64 - (3 + 53)); do { if (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1) DR_f += DR_f; else DR_f <<= (_FP_ADD_INTERNAL_diff); } while (0); if (DR_e <= _FP_ADD_INTERNAL_diff) { _FP_ADD_INTERNAL_diff = _FP_ADD_INTERNAL_diff - DR_e + 1; (DR_f = (DR_f >> ((_FP_ADD_INTERNAL_diff)) | (__builtin_constant_p ((_FP_ADD_INTERNAL_diff)) && ((_FP_ADD_INTERNAL_diff)) == 1 ? DR_f & 1 : (DR_f << (64 - ((_FP_ADD_INTERNAL_diff)))) != 0))); DR_e = 0; } else { DR_e -= _FP_ADD_INTERNAL_diff; (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); } } sub_done: ; } } while (0); } while (0); break;
  case 0x047: do { if (!(QB_e == 32767 && !((QB_f1 | QB_f0) == 0))) QB_s ^= 1; do { do { if (0 && QA_e == 0 && !((QA_f1 | QA_f0) == 0)) { (QA_f0 = 0, QA_f1 = 0); _fex |= (0); } } while (0); do { if (0 && QB_e == 0 && !((QB_f1 | QB_f0) == 0)) { (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } } while (0); if (QA_s == QB_s) { __label__ add1, add2, add3, add_done; QR_s = QA_s; int _FP_ADD_INTERNAL_ediff = QA_e - QB_e; if (_FP_ADD_INTERNAL_ediff > 0) { QR_e = QA_e; if (QB_e == 0) { if (((QB_f1 | QB_f0) == 0)) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); goto add3; } if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } goto add1; } } else if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } (QB_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); add1: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QB_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QB_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QB_f0 = (QB_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QB_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QB_f0) != 0)); QB_f1 = 0; })); else if (!((QB_f1 | QB_f0) == 0)) (QB_f0 = 1, QB_f1 = 0); __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; QR_e = QB_e; if (QA_e == 0) { if (((QA_f1 | QA_f0) == 0)) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); goto add3; } if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } goto add2; } } else if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } (QA_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); add2: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QA_f0 = (QA_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QA_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QA_f0 & 1 : (QA_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QA_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QA_f0 = (QA_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QA_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QA_f0) != 0)); QA_f1 = 0; })); else if (!((QA_f1 | QA_f0) == 0)) (QA_f0 = 1, QA_f1 = 0); __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); } else { if (!(((QA_e + 1) & 32767) > 1)) { if (QA_e == 0) { QR_e = 0; if (((QA_f1 | QA_f0) == 0)) { if (!((QB_f1 | QB_f0) == 0)) _fex |= (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto add_done; } else if (((QB_f1 | QB_f0) == 0)) { _fex |= (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto add_done; } else { _fex |= (0); __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); QR_e = 1; } goto add_done; } } else { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); QR_e = 32767; if (((QA_f1 | QA_f0) == 0)) (QR_f0 = QB_f0, QR_f1 = QB_f1); else if (((QB_f1 | QB_f0) == 0)) (QR_f0 = QA_f0, QR_f1 = QA_f1); else do { (void) (((3) < 64) ? ({ QA_f0 = QA_f0 >> (3) | QA_f1 << (64 - (3)); QA_f1 >>= (3); }) : ({ QA_f0 = QA_f1 >> ((3) - 64); QA_f1 = 0; })); (void) (((3) < 64) ? ({ QB_f0 = QB_f0 >> (3) | QB_f1 << (64 - (3)); QB_f1 >>= (3); }) : ({ QB_f0 = QB_f1 >> ((3) - 64); QB_f1 = 0; })); do { if (((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) && !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64))) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } QR_c = 3; } while (0); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (3) | QR_f0 >> (64 - (3)); QR_f0 <<= (3); } 0; }) : ({ QR_f1 = QR_f0 << ((3) - 64); QR_f0 = 0; })); } while (0); goto add_done; } } __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); QR_e = QA_e + 1; (void) (((1) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (1)) | QR_f0 >> (1) | (__builtin_constant_p (1) && (1) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (1))) != 0)); QR_f1 >>= (1); }) : ({ QR_f0 = (QR_f1 >> ((1) - 64) | ((((1) == 64 ? 0 : (QR_f1 << (2*64 - (1)))) | QR_f0) != 0)); QR_f1 = 0; })); if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto add_done; } add3: if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); QR_e++; (void) (((1) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (1)) | QR_f0 >> (1) | (__builtin_constant_p (1) && (1) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (1))) != 0)); QR_f1 >>= (1); }) : ({ QR_f0 = (QR_f1 >> ((1) - 64) | ((((1) == 64 ? 0 : (QR_f1 << (2*64 - (1)))) | QR_f0) != 0)); QR_f1 = 0; })); if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } add_done: ; } else { __label__ sub1, sub2, sub3, norm, sub_done; int _FP_ADD_INTERNAL_ediff = QA_e - QB_e; if (_FP_ADD_INTERNAL_ediff > 0) { QR_e = QA_e; QR_s = QA_s; if (QB_e == 0) { if (((QB_f1 | QB_f0) == 0)) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); goto sub3; } if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto sub_done; } goto sub1; } } else if (QA_e == 32767) { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); goto sub_done; } (QB_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); sub1: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QB_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QB_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QB_f0 = (QB_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QB_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QB_f0) != 0)); QB_f1 = 0; })); else if (!((QB_f1 | QB_f0) == 0)) (QB_f0 = 1, QB_f1 = 0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); } else if (_FP_ADD_INTERNAL_ediff < 0) { _FP_ADD_INTERNAL_ediff = -_FP_ADD_INTERNAL_ediff; QR_e = QB_e; QR_s = QB_s; if (QA_e == 0) { if (((QA_f1 | QA_f0) == 0)) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto sub_done; } else { _fex |= (0); _FP_ADD_INTERNAL_ediff--; if (_FP_ADD_INTERNAL_ediff == 0) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); goto sub3; } if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto sub_done; } goto sub2; } } else if (QB_e == 32767) { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (QR_f0 = QB_f0, QR_f1 = QB_f1); goto sub_done; } (QA_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); sub2: if (_FP_ADD_INTERNAL_ediff <= (3 + 113)) (void) (((_FP_ADD_INTERNAL_ediff) < 64) ? ({ QA_f0 = (QA_f1 << (64 - (_FP_ADD_INTERNAL_ediff)) | QA_f0 >> (_FP_ADD_INTERNAL_ediff) | (__builtin_constant_p (_FP_ADD_INTERNAL_ediff) && (_FP_ADD_INTERNAL_ediff) == 1 ? QA_f0 & 1 : (QA_f0 << (64 - (_FP_ADD_INTERNAL_ediff))) != 0)); QA_f1 >>= (_FP_ADD_INTERNAL_ediff); }) : ({ QA_f0 = (QA_f1 >> ((_FP_ADD_INTERNAL_ediff) - 64) | ((((_FP_ADD_INTERNAL_ediff) == 64 ? 0 : (QA_f1 << (2*64 - (_FP_ADD_INTERNAL_ediff)))) | QA_f0) != 0)); QA_f1 = 0; })); else if (!((QA_f1 | QA_f0) == 0)) (QA_f0 = 1, QA_f1 = 0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); } else { if (!(((QA_e + 1) & 32767) > 1)) { if (QA_e == 0) { QR_e = 0; if (((QA_f1 | QA_f0) == 0)) { (QR_f0 = QB_f0, QR_f1 = QB_f1); if (((QB_f1 | QB_f0) == 0)) QR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); else { _fex |= (0); QR_s = QB_s; } goto sub_done; } else if (((QB_f1 | QB_f0) == 0)) { _fex |= (0); (QR_f0 = QA_f0, QR_f1 = QA_f1); QR_s = QA_s; goto sub_done; } else { _fex |= (0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); QR_s = QA_s; if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); QR_s = QB_s; } else if (((QR_f1 | QR_f0) == 0)) QR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } } else { do { if (QA_e == 32767 && !((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); QR_e = 32767; if (((QA_f1 | QA_f0) == 0)) { if (((QB_f1 | QB_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (3) | QR_f0 >> (64 - (3)); QR_f0 <<= (3); } 0; }) : ({ QR_f1 = QR_f0 << ((3) - 64); QR_f0 = 0; })); _fex |= ((1 << 4) | 0); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } } else { if (((QB_f1 | QB_f0) == 0)) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { do { (void) (((3) < 64) ? ({ QA_f0 = QA_f0 >> (3) | QA_f1 << (64 - (3)); QA_f1 >>= (3); }) : ({ QA_f0 = QA_f1 >> ((3) - 64); QA_f1 = 0; })); (void) (((3) < 64) ? ({ QB_f0 = QB_f0 >> (3) | QB_f1 << (64 - (3)); QB_f1 >>= (3); }) : ({ QB_f0 = QB_f1 >> ((3) - 64); QB_f1 = 0; })); do { if (((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) && !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64))) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } QR_c = 3; } while (0); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (3) | QR_f0 >> (64 - (3)); QR_f0 <<= (3); } 0; }) : ({ QR_f1 = QR_f0 << ((3) - 64); QR_f0 = 0; })); } while (0); } } goto sub_done; } } QR_e = QA_e; __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); QR_s = QA_s; if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(QA_f0)) : "cc"); QR_s = QB_s; } else if (((QR_f1 | QR_f0) == 0)) { QR_e = 0; QR_s = ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3); goto sub_done; } goto norm; } sub3: if ((QR_f1) & ((unsigned long) 1 << (113 -1+3) % 64)) { int _FP_ADD_INTERNAL_diff; (QR_f1) &= ((unsigned long) 1 << (113 -1+3) % 64) - 1; norm: do { if (QR_f1) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (QR_f1); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (QR_f1); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (QR_f1); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clz (QR_f0); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzl (QR_f0); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_ADD_INTERNAL_diff)) = __builtin_clzll (QR_f0); else return 0; } while (0); (_FP_ADD_INTERNAL_diff) += 64; } } while (0); _FP_ADD_INTERNAL_diff -= ((2*64) - (3 + 113)); (void) (((_FP_ADD_INTERNAL_diff) < 64) ? ({ if (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (_FP_ADD_INTERNAL_diff) | QR_f0 >> (64 - (_FP_ADD_INTERNAL_diff)); QR_f0 <<= (_FP_ADD_INTERNAL_diff); } 0; }) : ({ QR_f1 = QR_f0 << ((_FP_ADD_INTERNAL_diff) - 64); QR_f0 = 0; })); if (QR_e <= _FP_ADD_INTERNAL_diff) { _FP_ADD_INTERNAL_diff = _FP_ADD_INTERNAL_diff - QR_e + 1; (void) (((_FP_ADD_INTERNAL_diff) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (_FP_ADD_INTERNAL_diff)) | QR_f0 >> (_FP_ADD_INTERNAL_diff) | (__builtin_constant_p (_FP_ADD_INTERNAL_diff) && (_FP_ADD_INTERNAL_diff) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (_FP_ADD_INTERNAL_diff))) != 0)); QR_f1 >>= (_FP_ADD_INTERNAL_diff); }) : ({ QR_f0 = (QR_f1 >> ((_FP_ADD_INTERNAL_diff) - 64) | ((((_FP_ADD_INTERNAL_diff) == 64 ? 0 : (QR_f1 << (2*64 - (_FP_ADD_INTERNAL_diff)))) | QR_f0) != 0)); QR_f1 = 0; })); QR_e = 0; } else { QR_e -= _FP_ADD_INTERNAL_diff; (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); } } sub_done: ; } } while (0); } while (0); break;

  case 0x049: do { SR_s = SA_s ^ SB_s; SR_e = SA_e + SB_e + 1; switch ((((SA_c) << 2) | (SB_c))) { case (((0) << 2) | (0)): SR_c = 0; do { do { SR_f = SA_f * SB_f; } while (0); (SR_f = (SR_f >> ((((3 + 24))-1)) | (__builtin_constant_p ((((3 + 24))-1)) && ((((3 + 24))-1)) == 1 ? SR_f & 1 : (SR_f << (64 - ((((3 + 24))-1)))) != 0))); } while (0); if ((SR_f & ((unsigned long) 1 << ((3 + 24))))) (SR_f = (SR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? SR_f & 1 : (SR_f << (64 - ((1)))) != 0))); else SR_e--; break; case (((3) << 2) | (3)): do { if (((SB_f) & ((unsigned long) 1 << (24 -2))) && !((SA_f) & ((unsigned long) 1 << (24 -2)))) { SR_s = SA_s; (SR_f = SA_f); } else { SR_s = SB_s; (SR_f = SB_f); } SR_c = 3; } while (0); break; case (((3) << 2) | (0)): case (((3) << 2) | (2)): case (((3) << 2) | (1)): SR_s = SA_s; case (((2) << 2) | (2)): case (((2) << 2) | (0)): case (((1) << 2) | (0)): case (((1) << 2) | (1)): (SR_f = SA_f); SR_c = SA_c; break; case (((0) << 2) | (3)): case (((2) << 2) | (3)): case (((1) << 2) | (3)): SR_s = SB_s; case (((0) << 2) | (2)): case (((0) << 2) | (1)): (SR_f = SB_f); SR_c = SB_c; break; case (((2) << 2) | (1)): case (((1) << 2) | (2)): SR_s = 0; SR_c = 3; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); _fex |= ((1 << 4) | 0); break; default: return 0; } } while (0); break;
  case 0x069: do { if (53 < 24 || (2047 - 1023 < 255 - 127) || (1023 < 127 + 24 - 1 && 1023 != 127)) return 0; DA_s = SA_s; (DA_f = SA_f); if ((((SA_e + 1) & 255) > 1)) { DA_e = SA_e + 1023 - 127; do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DA_f += DA_f; else DA_f <<= ((53 - 24)); } while (0); } else { if (SA_e == 0) { do { if (0 && SA_e == 0 && !(SA_f == 0)) { (SA_f = 0); _fex |= (0); } } while (0); if ((SA_f == 0)) DA_e = 0; else if (1023 < 127 + 24 - 1) { _fex |= (0); do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DA_f += DA_f; else DA_f <<= ((53 - 24)); } while (0); DA_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (SA_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (SA_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (SA_f); else return 0; } while (0); do { if (__builtin_constant_p (FP_EXTEND_lz + 53 - 64) && (FP_EXTEND_lz + 53 - 64) == 1) DA_f += DA_f; else DA_f <<= (FP_EXTEND_lz + 53 - 64); } while (0); DA_e = (1023 - 127 + 1 + (64 - 24) - FP_EXTEND_lz); } } else { DA_e = 2047; if (!(SA_f == 0)) { if (1 && ((0) ? ((SA_f) & ((unsigned long) 1 << (24 -2))) : !((SA_f) & ((unsigned long) 1 << (24 -2))))) _fex |= ((1 << 4) | 0); do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DA_f += DA_f; else DA_f <<= ((53 - 24)); } while (0); if (1) do { if (0) { (DA_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DA_f == 0)) { DA_s = 0; (DA_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DA_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); } } } } while (0);
        do { switch (DA_e) { default: (DA_f) |= ((unsigned long) 1 << (53 -1) % 64); do { if (__builtin_constant_p (3) && (3) == 1) DA_f += DA_f; else DA_f <<= (3); } while (0); DA_e -= 1023; DA_c = 0; break; case 0: if ((DA_f == 0)) DA_c = 1; else if (0) { DA_c = 1; (DA_f = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (DA_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (DA_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (DA_f); else return 0; } while (0); _FP_UNPACK_CANONICAL_shift -= (64 - 53); do { if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) DA_f += DA_f; else DA_f <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } while (0); DA_e -= (1023 - 1 + _FP_UNPACK_CANONICAL_shift); DA_c = 0; _fex |= (0); } break; case 2047: if ((DA_f == 0)) DA_c = 2; else { DA_c = 3; if (((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0);
        do { if (53 < 24 || (2047 - 1023 < 255 - 127) || (1023 < 127 + 24 - 1 && 1023 != 127)) return 0; DB_s = SB_s; (DB_f = SB_f); if ((((SB_e + 1) & 255) > 1)) { DB_e = SB_e + 1023 - 127; do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DB_f += DB_f; else DB_f <<= ((53 - 24)); } while (0); } else { if (SB_e == 0) { do { if (0 && SB_e == 0 && !(SB_f == 0)) { (SB_f = 0); _fex |= (0); } } while (0); if ((SB_f == 0)) DB_e = 0; else if (1023 < 127 + 24 - 1) { _fex |= (0); do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DB_f += DB_f; else DB_f <<= ((53 - 24)); } while (0); DB_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (SB_f); else return 0; } while (0); do { if (__builtin_constant_p (FP_EXTEND_lz + 53 - 64) && (FP_EXTEND_lz + 53 - 64) == 1) DB_f += DB_f; else DB_f <<= (FP_EXTEND_lz + 53 - 64); } while (0); DB_e = (1023 - 127 + 1 + (64 - 24) - FP_EXTEND_lz); } } else { DB_e = 2047; if (!(SB_f == 0)) { if (1 && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _fex |= ((1 << 4) | 0); do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DB_f += DB_f; else DB_f <<= ((53 - 24)); } while (0); if (1) do { if (0) { (DB_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DB_f == 0)) { DB_s = 0; (DB_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DB_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); } } } } while (0);
        do { switch (DB_e) { default: (DB_f) |= ((unsigned long) 1 << (53 -1) % 64); do { if (__builtin_constant_p (3) && (3) == 1) DB_f += DB_f; else DB_f <<= (3); } while (0); DB_e -= 1023; DB_c = 0; break; case 0: if ((DB_f == 0)) DB_c = 1; else if (0) { DB_c = 1; (DB_f = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (DB_f); else return 0; } while (0); _FP_UNPACK_CANONICAL_shift -= (64 - 53); do { if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) DB_f += DB_f; else DB_f <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } while (0); DB_e -= (1023 - 1 + _FP_UNPACK_CANONICAL_shift); DB_c = 0; _fex |= (0); } break; case 2047: if ((DB_f == 0)) DB_c = 2; else { DB_c = 3; if (((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0);
  case 0x04a: do { DR_s = DA_s ^ DB_s; DR_e = DA_e + DB_e + 1; switch ((((DA_c) << 2) | (DB_c))) { case (((0) << 2) | (0)): DR_c = 0; do { unsigned long _FP_MUL_MEAT_1_wide_Z_f0 = 0, _FP_MUL_MEAT_1_wide_Z_f1 = 0; do { do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" (_FP_MUL_MEAT_1_wide_Z_f1), "=&r" (_FP_MUL_MEAT_1_wide_Z_f0), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(DA_f)), "r" ((UDItype)(DB_f)) : "cc"); } while (0); } while (0); (void) (((((3 + 53))-1) < 64) ? ({ _FP_MUL_MEAT_1_wide_Z_f0 = (_FP_MUL_MEAT_1_wide_Z_f1 << (64 - (((3 + 53))-1)) | _FP_MUL_MEAT_1_wide_Z_f0 >> (((3 + 53))-1) | (__builtin_constant_p (((3 + 53))-1) && (((3 + 53))-1) == 1 ? _FP_MUL_MEAT_1_wide_Z_f0 & 1 : (_FP_MUL_MEAT_1_wide_Z_f0 << (64 - (((3 + 53))-1))) != 0)); _FP_MUL_MEAT_1_wide_Z_f1 >>= (((3 + 53))-1); }) : ({ _FP_MUL_MEAT_1_wide_Z_f0 = (_FP_MUL_MEAT_1_wide_Z_f1 >> ((((3 + 53))-1) - 64) | ((((((3 + 53))-1) == 64 ? 0 : (_FP_MUL_MEAT_1_wide_Z_f1 << (2*64 - (((3 + 53))-1)))) | _FP_MUL_MEAT_1_wide_Z_f0) != 0)); _FP_MUL_MEAT_1_wide_Z_f1 = 0; })); DR_f = _FP_MUL_MEAT_1_wide_Z_f0; } while (0); if ((DR_f & ((unsigned long) 1 << (3 + 53) % 64))) (DR_f = (DR_f >> ((1)) | (__builtin_constant_p ((1)) && ((1)) == 1 ? DR_f & 1 : (DR_f << (64 - ((1)))) != 0))); else DR_e--; break; case (((3) << 2) | (3)): do { if (((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) && !((DA_f) & ((unsigned long) 1 << (53 -2) % 64))) { DR_s = DA_s; (DR_f = DA_f); } else { DR_s = DB_s; (DR_f = DB_f); } DR_c = 3; } while (0); break; case (((3) << 2) | (0)): case (((3) << 2) | (2)): case (((3) << 2) | (1)): DR_s = DA_s; case (((2) << 2) | (2)): case (((2) << 2) | (0)): case (((1) << 2) | (0)): case (((1) << 2) | (1)): (DR_f = DA_f); DR_c = DA_c; break; case (((0) << 2) | (3)): case (((2) << 2) | (3)): case (((1) << 2) | (3)): DR_s = DB_s; case (((0) << 2) | (2)): case (((0) << 2) | (1)): (DR_f = DB_f); DR_c = DB_c; break; case (((2) << 2) | (1)): case (((1) << 2) | (2)): DR_s = 0; DR_c = 3; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | 0); break; default: return 0; } } while (0); break;
  case 0x06e: do { if (113 < 53 || (32767 - 16383 < 2047 - 1023) || (16383 < 1023 + 53 - 1 && 16383 != 1023)) return 0; QA_s = DA_s; ((QA_f0 = DA_f), (QA_f1 = 0)); if ((((DA_e + 1) & 2047) > 1)) { QA_e = DA_e + 16383 - 1023; (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << ((113 - 53)) | QA_f0 >> (64 - ((113 - 53))); QA_f0 <<= ((113 - 53)); } 0; }) : ({ QA_f1 = QA_f0 << (((113 - 53)) - 64); QA_f0 = 0; })); } else { if (DA_e == 0) { do { if (0 && DA_e == 0 && !(DA_f == 0)) { (DA_f = 0); _fex |= (0); } } while (0); if ((DA_f == 0)) QA_e = 0; else if (16383 < 1023 + 53 - 1) { _fex |= (0); (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << ((113 - 53)) | QA_f0 >> (64 - ((113 - 53))); QA_f0 <<= ((113 - 53)); } 0; }) : ({ QA_f1 = QA_f0 << (((113 - 53)) - 64); QA_f0 = 0; })); QA_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (DA_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (DA_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (DA_f); else return 0; } while (0); (void) (((FP_EXTEND_lz + 113 - 64) < 64) ? ({ if (__builtin_constant_p (FP_EXTEND_lz + 113 - 64) && (FP_EXTEND_lz + 113 - 64) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << (FP_EXTEND_lz + 113 - 64) | QA_f0 >> (64 - (FP_EXTEND_lz + 113 - 64)); QA_f0 <<= (FP_EXTEND_lz + 113 - 64); } 0; }) : ({ QA_f1 = QA_f0 << ((FP_EXTEND_lz + 113 - 64) - 64); QA_f0 = 0; })); QA_e = (16383 - 1023 + 1 + (64 - 53) - FP_EXTEND_lz); } } else { QA_e = 32767; if (!(DA_f == 0)) { if (1 && ((0) ? ((DA_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DA_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << ((113 - 53)) | QA_f0 >> (64 - ((113 - 53))); QA_f0 <<= ((113 - 53)); } 0; }) : ({ QA_f1 = QA_f0 << (((113 - 53)) - 64); QA_f0 = 0; })); if (1) do { if (0) { (QA_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QA_f1 | QA_f0) == 0)) { QA_s = 0; (QA_f0 = -1, QA_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QA_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } } } while (0);
        do { switch (QA_e) { default: (QA_f1) |= ((unsigned long) 1 << (113 -1) % 64); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << (3) | QA_f0 >> (64 - (3)); QA_f0 <<= (3); } 0; }) : ({ QA_f1 = QA_f0 << ((3) - 64); QA_f0 = 0; })); QA_e -= 16383; QA_c = 0; break; case 0: if (((QA_f1 | QA_f0) == 0)) QA_c = 1; else if (0) { QA_c = 1; (QA_f0 = 0, QA_f1 = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (QA_f1) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QA_f1); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QA_f1); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QA_f1); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QA_f0); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QA_f0); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QA_f0); else return 0; } while (0); (_FP_UNPACK_CANONICAL_shift) += 64; } } while (0); _FP_UNPACK_CANONICAL_shift -= ((2*64) - 113); (void) ((((_FP_UNPACK_CANONICAL_shift + 3)) < 64) ? ({ if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) { QA_f1 = QA_f1 + QA_f1 + (((signed long) (QA_f0)) < 0); QA_f0 += QA_f0; } else { QA_f1 = QA_f1 << ((_FP_UNPACK_CANONICAL_shift + 3)) | QA_f0 >> (64 - ((_FP_UNPACK_CANONICAL_shift + 3))); QA_f0 <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } 0; }) : ({ QA_f1 = QA_f0 << (((_FP_UNPACK_CANONICAL_shift + 3)) - 64); QA_f0 = 0; })); QA_e -= (16383 - 1 + _FP_UNPACK_CANONICAL_shift); QA_c = 0; _fex |= (0); } break; case 32767: if (((QA_f1 | QA_f0) == 0)) QA_c = 2; else { QA_c = 3; if (((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0);
        do { if (113 < 53 || (32767 - 16383 < 2047 - 1023) || (16383 < 1023 + 53 - 1 && 16383 != 1023)) return 0; QB_s = DB_s; ((QB_f0 = DB_f), (QB_f1 = 0)); if ((((DB_e + 1) & 2047) > 1)) { QB_e = DB_e + 16383 - 1023; (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << ((113 - 53)) | QB_f0 >> (64 - ((113 - 53))); QB_f0 <<= ((113 - 53)); } 0; }) : ({ QB_f1 = QB_f0 << (((113 - 53)) - 64); QB_f0 = 0; })); } else { if (DB_e == 0) { do { if (0 && DB_e == 0 && !(DB_f == 0)) { (DB_f = 0); _fex |= (0); } } while (0); if ((DB_f == 0)) QB_e = 0; else if (16383 < 1023 + 53 - 1) { _fex |= (0); (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << ((113 - 53)) | QB_f0 >> (64 - ((113 - 53))); QB_f0 <<= ((113 - 53)); } 0; }) : ({ QB_f1 = QB_f0 << (((113 - 53)) - 64); QB_f0 = 0; })); QB_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (DB_f); else return 0; } while (0); (void) (((FP_EXTEND_lz + 113 - 64) < 64) ? ({ if (__builtin_constant_p (FP_EXTEND_lz + 113 - 64) && (FP_EXTEND_lz + 113 - 64) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (FP_EXTEND_lz + 113 - 64) | QB_f0 >> (64 - (FP_EXTEND_lz + 113 - 64)); QB_f0 <<= (FP_EXTEND_lz + 113 - 64); } 0; }) : ({ QB_f1 = QB_f0 << ((FP_EXTEND_lz + 113 - 64) - 64); QB_f0 = 0; })); QB_e = (16383 - 1023 + 1 + (64 - 53) - FP_EXTEND_lz); } } else { QB_e = 32767; if (!(DB_f == 0)) { if (1 && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << ((113 - 53)) | QB_f0 >> (64 - ((113 - 53))); QB_f0 <<= ((113 - 53)); } 0; }) : ({ QB_f1 = QB_f0 << (((113 - 53)) - 64); QB_f0 = 0; })); if (1) do { if (0) { (QB_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QB_f1 | QB_f0) == 0)) { QB_s = 0; (QB_f0 = -1, QB_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QB_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } } } while (0);
        do { switch (QB_e) { default: (QB_f1) |= ((unsigned long) 1 << (113 -1) % 64); (void) (((3) < 64) ? ({ if (__builtin_constant_p (3) && (3) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (3) | QB_f0 >> (64 - (3)); QB_f0 <<= (3); } 0; }) : ({ QB_f1 = QB_f0 << ((3) - 64); QB_f0 = 0; })); QB_e -= 16383; QB_c = 0; break; case 0: if (((QB_f1 | QB_f0) == 0)) QB_c = 1; else if (0) { QB_c = 1; (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } else { long _FP_UNPACK_CANONICAL_shift; do { if (QB_f1) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QB_f1); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QB_f1); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QB_f1); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clz (QB_f0); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzl (QB_f0); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_UNPACK_CANONICAL_shift)) = __builtin_clzll (QB_f0); else return 0; } while (0); (_FP_UNPACK_CANONICAL_shift) += 64; } } while (0); _FP_UNPACK_CANONICAL_shift -= ((2*64) - 113); (void) ((((_FP_UNPACK_CANONICAL_shift + 3)) < 64) ? ({ if (__builtin_constant_p ((_FP_UNPACK_CANONICAL_shift + 3)) && ((_FP_UNPACK_CANONICAL_shift + 3)) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << ((_FP_UNPACK_CANONICAL_shift + 3)) | QB_f0 >> (64 - ((_FP_UNPACK_CANONICAL_shift + 3))); QB_f0 <<= ((_FP_UNPACK_CANONICAL_shift + 3)); } 0; }) : ({ QB_f1 = QB_f0 << (((_FP_UNPACK_CANONICAL_shift + 3)) - 64); QB_f0 = 0; })); QB_e -= (16383 - 1 + _FP_UNPACK_CANONICAL_shift); QB_c = 0; _fex |= (0); } break; case 32767: if (((QB_f1 | QB_f0) == 0)) QB_c = 2; else { QB_c = 3; if (((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _fex |= ((1 << 4) | 0); } break; } } while (0);
  case 0x04b: do { QR_s = QA_s ^ QB_s; QR_e = QA_e + QB_e + 1; switch ((((QA_c) << 2) | (QB_c))) { case (((0) << 2) | (0)): QR_c = 0; do { unsigned long _FP_MUL_MEAT_2_wide_z_f[4]; do { unsigned long _FP_MUL_MEAT_DW_2_wide_b_f0 = 0, _FP_MUL_MEAT_DW_2_wide_b_f1 = 0; unsigned long _FP_MUL_MEAT_DW_2_wide_c_f0 = 0, _FP_MUL_MEAT_DW_2_wide_c_f1 = 0; do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" ((_FP_MUL_MEAT_2_wide_z_f[1])), "=&r" ((_FP_MUL_MEAT_2_wide_z_f[0])), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f0)) : "cc"); } while (0); do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" (_FP_MUL_MEAT_DW_2_wide_b_f1), "=&r" (_FP_MUL_MEAT_DW_2_wide_b_f0), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(QA_f0)), "r" ((UDItype)(QB_f1)) : "cc"); } while (0); do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" (_FP_MUL_MEAT_DW_2_wide_c_f1), "=&r" (_FP_MUL_MEAT_DW_2_wide_c_f0), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f0)) : "cc"); } while (0); do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" ((_FP_MUL_MEAT_2_wide_z_f[3])), "=&r" ((_FP_MUL_MEAT_2_wide_z_f[2])), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(QA_f1)), "r" ((UDItype)(QB_f1)) : "cc"); } while (0); do { unsigned long __FP_FRAC_ADD_3_c1, __FP_FRAC_ADD_3_c2; (_FP_MUL_MEAT_2_wide_z_f[1]) = _FP_MUL_MEAT_DW_2_wide_b_f0 + (_FP_MUL_MEAT_2_wide_z_f[1]); __FP_FRAC_ADD_3_c1 = (_FP_MUL_MEAT_2_wide_z_f[1]) < _FP_MUL_MEAT_DW_2_wide_b_f0; (_FP_MUL_MEAT_2_wide_z_f[2]) = _FP_MUL_MEAT_DW_2_wide_b_f1 + (_FP_MUL_MEAT_2_wide_z_f[2]); __FP_FRAC_ADD_3_c2 = (_FP_MUL_MEAT_2_wide_z_f[2]) < _FP_MUL_MEAT_DW_2_wide_b_f1; (_FP_MUL_MEAT_2_wide_z_f[2]) += __FP_FRAC_ADD_3_c1; __FP_FRAC_ADD_3_c2 |= (_FP_MUL_MEAT_2_wide_z_f[2]) < __FP_FRAC_ADD_3_c1; (_FP_MUL_MEAT_2_wide_z_f[3]) = 0 + (_FP_MUL_MEAT_2_wide_z_f[3]) + __FP_FRAC_ADD_3_c2; } while (0); do { unsigned long __FP_FRAC_ADD_3_c1, __FP_FRAC_ADD_3_c2; (_FP_MUL_MEAT_2_wide_z_f[1]) = _FP_MUL_MEAT_DW_2_wide_c_f0 + (_FP_MUL_MEAT_2_wide_z_f[1]); __FP_FRAC_ADD_3_c1 = (_FP_MUL_MEAT_2_wide_z_f[1]) < _FP_MUL_MEAT_DW_2_wide_c_f0; (_FP_MUL_MEAT_2_wide_z_f[2]) = _FP_MUL_MEAT_DW_2_wide_c_f1 + (_FP_MUL_MEAT_2_wide_z_f[2]); __FP_FRAC_ADD_3_c2 = (_FP_MUL_MEAT_2_wide_z_f[2]) < _FP_MUL_MEAT_DW_2_wide_c_f1; (_FP_MUL_MEAT_2_wide_z_f[2]) += __FP_FRAC_ADD_3_c1; __FP_FRAC_ADD_3_c2 |= (_FP_MUL_MEAT_2_wide_z_f[2]) < __FP_FRAC_ADD_3_c1; (_FP_MUL_MEAT_2_wide_z_f[3]) = 0 + (_FP_MUL_MEAT_2_wide_z_f[3]) + __FP_FRAC_ADD_3_c2; } while (0); } while (0); do { int _FP_FRAC_SRS_4_sticky; do { long _FP_FRAC_SRST_4_up, _FP_FRAC_SRST_4_down; long _FP_FRAC_SRST_4_skip, _FP_FRAC_SRST_4_i; unsigned long _FP_FRAC_SRST_4_s; _FP_FRAC_SRST_4_skip = ((((3 + 113))-1)) / 64; _FP_FRAC_SRST_4_down = ((((3 + 113))-1)) % 64; _FP_FRAC_SRST_4_up = 64 - _FP_FRAC_SRST_4_down; for (_FP_FRAC_SRST_4_s = _FP_FRAC_SRST_4_i = 0; _FP_FRAC_SRST_4_i < _FP_FRAC_SRST_4_skip; ++_FP_FRAC_SRST_4_i) _FP_FRAC_SRST_4_s |= _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i]; if (!_FP_FRAC_SRST_4_down) for (_FP_FRAC_SRST_4_i = 0; _FP_FRAC_SRST_4_i <= 3-_FP_FRAC_SRST_4_skip; ++_FP_FRAC_SRST_4_i) _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i] = _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip]; else { _FP_FRAC_SRST_4_s |= _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i] << _FP_FRAC_SRST_4_up; for (_FP_FRAC_SRST_4_i = 0; _FP_FRAC_SRST_4_i < 3-_FP_FRAC_SRST_4_skip; ++_FP_FRAC_SRST_4_i) _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i] = ((_FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip] >> _FP_FRAC_SRST_4_down) | (_FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i+_FP_FRAC_SRST_4_skip+1] << _FP_FRAC_SRST_4_up)); _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i++] = _FP_MUL_MEAT_2_wide_z_f[3] >> _FP_FRAC_SRST_4_down; } for (; _FP_FRAC_SRST_4_i < 4; ++_FP_FRAC_SRST_4_i) _FP_MUL_MEAT_2_wide_z_f[_FP_FRAC_SRST_4_i] = 0; _FP_FRAC_SRS_4_sticky = (_FP_FRAC_SRST_4_s != 0); } while (0); _FP_MUL_MEAT_2_wide_z_f[0] |= _FP_FRAC_SRS_4_sticky; } while (0); QR_f0 = (_FP_MUL_MEAT_2_wide_z_f[0]); QR_f1 = (_FP_MUL_MEAT_2_wide_z_f[1]); } while (0); if (((QR_f1) & ((unsigned long) 1 << ((3 + 113) % 64)))) (void) (((1) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (1)) | QR_f0 >> (1) | (__builtin_constant_p (1) && (1) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (1))) != 0)); QR_f1 >>= (1); }) : ({ QR_f0 = (QR_f1 >> ((1) - 64) | ((((1) == 64 ? 0 : (QR_f1 << (2*64 - (1)))) | QR_f0) != 0)); QR_f1 = 0; })); else QR_e--; break; case (((3) << 2) | (3)): do { if (((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) && !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64))) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } QR_c = 3; } while (0); break; case (((3) << 2) | (0)): case (((3) << 2) | (2)): case (((3) << 2) | (1)): QR_s = QA_s; case (((2) << 2) | (2)): case (((2) << 2) | (0)): case (((1) << 2) | (0)): case (((1) << 2) | (1)): (QR_f0 = QA_f0, QR_f1 = QA_f1); QR_c = QA_c; break; case (((0) << 2) | (3)): case (((2) << 2) | (3)): case (((1) << 2) | (3)): QR_s = QB_s; case (((0) << 2) | (2)): case (((0) << 2) | (1)): (QR_f0 = QB_f0, QR_f1 = QB_f1); QR_c = QB_c; break; case (((2) << 2) | (1)): case (((1) << 2) | (2)): QR_s = 0; QR_c = 3; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | 0); break; default: return 0; } } while (0); break;

  case 0x04d: do { SR_s = SA_s ^ SB_s; SR_e = SA_e - SB_e; switch ((((SA_c) << 2) | (SB_c))) { case (((0) << 2) | (0)): SR_c = 0; do { unsigned long _FP_DIV_MEAT_1_imm_q, _FP_DIV_MEAT_1_imm_r; SA_f <<= (SA_f < SB_f ? SR_e--, (3 + 24) : (3 + 24) - 1); do { (_FP_DIV_MEAT_1_imm_q) = (SA_f) / (SB_f), (_FP_DIV_MEAT_1_imm_r) = (SA_f) % (SB_f); } while (0); SR_f = _FP_DIV_MEAT_1_imm_q | (_FP_DIV_MEAT_1_imm_r != 0); } while (0); break; case (((3) << 2) | (3)): do { if (((SB_f) & ((unsigned long) 1 << (24 -2))) && !((SA_f) & ((unsigned long) 1 << (24 -2)))) { SR_s = SA_s; (SR_f = SA_f); } else { SR_s = SB_s; (SR_f = SB_f); } SR_c = 3; } while (0); break; case (((3) << 2) | (0)): case (((3) << 2) | (2)): case (((3) << 2) | (1)): SR_s = SA_s; (SR_f = SA_f); SR_c = SA_c; break; case (((0) << 2) | (3)): case (((2) << 2) | (3)): case (((1) << 2) | (3)): SR_s = SB_s; (SR_f = SB_f); SR_c = SB_c; break; case (((0) << 2) | (2)): case (((1) << 2) | (2)): case (((1) << 2) | (0)): SR_c = 1; break; case (((0) << 2) | (1)): _fex |= ((1 << 1)); case (((2) << 2) | (1)): case (((2) << 2) | (0)): SR_c = 2; break; case (((2) << 2) | (2)): case (((1) << 2) | (1)): SR_s = 0; SR_c = 3; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); _fex |= ((1 << 4) | (SA_c == 2 ? 0 : 0)); break; default: return 0; } } while (0); break;
  case 0x04e: do { DR_s = DA_s ^ DB_s; DR_e = DA_e - DB_e; switch ((((DA_c) << 2) | (DB_c))) { case (((0) << 2) | (0)): DR_c = 0; do { unsigned long _FP_DIV_MEAT_1_udiv_norm_nh; unsigned long _FP_DIV_MEAT_1_udiv_norm_nl; unsigned long _FP_DIV_MEAT_1_udiv_norm_q; unsigned long _FP_DIV_MEAT_1_udiv_norm_r; unsigned long _FP_DIV_MEAT_1_udiv_norm_y; _FP_DIV_MEAT_1_udiv_norm_y = DB_f << (64 - (3 + 53)); if (DA_f < DB_f) { DR_e--; _FP_DIV_MEAT_1_udiv_norm_nl = 0; _FP_DIV_MEAT_1_udiv_norm_nh = DA_f; } else { _FP_DIV_MEAT_1_udiv_norm_nl = DA_f << (64 - 1); _FP_DIV_MEAT_1_udiv_norm_nh = DA_f >> 1; } do { unsigned long __d1, __d0, __q1, __q0, __r1, __r0, __m; __d1 = (_FP_DIV_MEAT_1_udiv_norm_y >> 32); __d0 = (USItype)_FP_DIV_MEAT_1_udiv_norm_y; __r1 = (_FP_DIV_MEAT_1_udiv_norm_nh) % __d1; __q1 = (_FP_DIV_MEAT_1_udiv_norm_nh) / __d1; __m = (unsigned long) __q1 * __d0; __r1 = (__r1 << 32) | (_FP_DIV_MEAT_1_udiv_norm_nl >> 32); if (__r1 < __m) { __q1--, __r1 += (_FP_DIV_MEAT_1_udiv_norm_y); if (__r1 >= (_FP_DIV_MEAT_1_udiv_norm_y)) if (__r1 < __m) __q1--, __r1 += (_FP_DIV_MEAT_1_udiv_norm_y); } __r1 -= __m; __r0 = __r1 % __d1; __q0 = __r1 / __d1; __m = (unsigned long) __q0 * __d0; __r0 = (__r0 << 32) | ((USItype)_FP_DIV_MEAT_1_udiv_norm_nl); if (__r0 < __m) { __q0--, __r0 += (_FP_DIV_MEAT_1_udiv_norm_y); if (__r0 >= (_FP_DIV_MEAT_1_udiv_norm_y)) if (__r0 < __m) __q0--, __r0 += (_FP_DIV_MEAT_1_udiv_norm_y); } __r0 -= __m; (_FP_DIV_MEAT_1_udiv_norm_q) = (unsigned long) (__q1 << 32) | __q0; (_FP_DIV_MEAT_1_udiv_norm_r) = __r0; } while (0); DR_f = (_FP_DIV_MEAT_1_udiv_norm_q | (_FP_DIV_MEAT_1_udiv_norm_r != 0)); } while (0); break; case (((3) << 2) | (3)): do { if (((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) && !((DA_f) & ((unsigned long) 1 << (53 -2) % 64))) { DR_s = DA_s; (DR_f = DA_f); } else { DR_s = DB_s; (DR_f = DB_f); } DR_c = 3; } while (0); break; case (((3) << 2) | (0)): case (((3) << 2) | (2)): case (((3) << 2) | (1)): DR_s = DA_s; (DR_f = DA_f); DR_c = DA_c; break; case (((0) << 2) | (3)): case (((2) << 2) | (3)): case (((1) << 2) | (3)): DR_s = DB_s; (DR_f = DB_f); DR_c = DB_c; break; case (((0) << 2) | (2)): case (((1) << 2) | (2)): case (((1) << 2) | (0)): DR_c = 1; break; case (((0) << 2) | (1)): _fex |= ((1 << 1)); case (((2) << 2) | (1)): case (((2) << 2) | (0)): DR_c = 2; break; case (((2) << 2) | (2)): case (((1) << 2) | (1)): DR_s = 0; DR_c = 3; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | (DA_c == 2 ? 0 : 0)); break; default: return 0; } } while (0); break;
  case 0x04f: do { QR_s = QA_s ^ QB_s; QR_e = QA_e - QB_e; switch ((((QA_c) << 2) | (QB_c))) { case (((0) << 2) | (0)): QR_c = 0; do { unsigned long _FP_DIV_MEAT_2_udiv_n_f2; unsigned long _FP_DIV_MEAT_2_udiv_n_f1; unsigned long _FP_DIV_MEAT_2_udiv_n_f0; unsigned long _FP_DIV_MEAT_2_udiv_r_f1; unsigned long _FP_DIV_MEAT_2_udiv_r_f0; unsigned long _FP_DIV_MEAT_2_udiv_m_f1; unsigned long _FP_DIV_MEAT_2_udiv_m_f0; if ((QA_f1 > QB_f1 || (QA_f1 == QB_f1 && QA_f0 >= QB_f0))) { _FP_DIV_MEAT_2_udiv_n_f2 = QA_f1 >> 1; _FP_DIV_MEAT_2_udiv_n_f1 = QA_f1 << (64 - 1) | QA_f0 >> 1; _FP_DIV_MEAT_2_udiv_n_f0 = QA_f0 << (64 - 1); } else { QR_e--; _FP_DIV_MEAT_2_udiv_n_f2 = QA_f1; _FP_DIV_MEAT_2_udiv_n_f1 = QA_f0; _FP_DIV_MEAT_2_udiv_n_f0 = 0; } (void) (((((2*64) - (3 + 113))) < 64) ? ({ if (__builtin_constant_p (((2*64) - (3 + 113))) && (((2*64) - (3 + 113))) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (((2*64) - (3 + 113))) | QB_f0 >> (64 - (((2*64) - (3 + 113)))); QB_f0 <<= (((2*64) - (3 + 113))); } 0; }) : ({ QB_f1 = QB_f0 << ((((2*64) - (3 + 113))) - 64); QB_f0 = 0; })); do { unsigned long __d1, __d0, __q1, __q0, __r1, __r0, __m; __d1 = (QB_f1 >> 32); __d0 = (USItype)QB_f1; __r1 = (_FP_DIV_MEAT_2_udiv_n_f2) % __d1; __q1 = (_FP_DIV_MEAT_2_udiv_n_f2) / __d1; __m = (unsigned long) __q1 * __d0; __r1 = (__r1 << 32) | (_FP_DIV_MEAT_2_udiv_n_f1 >> 32); if (__r1 < __m) { __q1--, __r1 += (QB_f1); if (__r1 >= (QB_f1)) if (__r1 < __m) __q1--, __r1 += (QB_f1); } __r1 -= __m; __r0 = __r1 % __d1; __q0 = __r1 / __d1; __m = (unsigned long) __q0 * __d0; __r0 = (__r0 << 32) | ((USItype)_FP_DIV_MEAT_2_udiv_n_f1); if (__r0 < __m) { __q0--, __r0 += (QB_f1); if (__r0 >= (QB_f1)) if (__r0 < __m) __q0--, __r0 += (QB_f1); } __r0 -= __m; (QR_f1) = (unsigned long) (__q1 << 32) | __q0; (_FP_DIV_MEAT_2_udiv_r_f1) = __r0; } while (0); do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" (_FP_DIV_MEAT_2_udiv_m_f1), "=&r" (_FP_DIV_MEAT_2_udiv_m_f0), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(QB_f0)) : "cc"); } while (0); _FP_DIV_MEAT_2_udiv_r_f0 = _FP_DIV_MEAT_2_udiv_n_f0; if ((_FP_DIV_MEAT_2_udiv_m_f1 > _FP_DIV_MEAT_2_udiv_r_f1 || (_FP_DIV_MEAT_2_udiv_m_f1 == _FP_DIV_MEAT_2_udiv_r_f1 && _FP_DIV_MEAT_2_udiv_m_f0 > _FP_DIV_MEAT_2_udiv_r_f0))) { QR_f1--; __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_DIV_MEAT_2_udiv_r_f1), "=&r" (_FP_DIV_MEAT_2_udiv_r_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f0)) : "cc"); if ((_FP_DIV_MEAT_2_udiv_r_f1 > QB_f1 || (_FP_DIV_MEAT_2_udiv_r_f1 == QB_f1 && _FP_DIV_MEAT_2_udiv_r_f0 >= QB_f0)) && (_FP_DIV_MEAT_2_udiv_m_f1 > _FP_DIV_MEAT_2_udiv_r_f1 || (_FP_DIV_MEAT_2_udiv_m_f1 == _FP_DIV_MEAT_2_udiv_r_f1 && _FP_DIV_MEAT_2_udiv_m_f0 > _FP_DIV_MEAT_2_udiv_r_f0))) { QR_f1--; __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_DIV_MEAT_2_udiv_r_f1), "=&r" (_FP_DIV_MEAT_2_udiv_r_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f0)) : "cc"); } } __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (_FP_DIV_MEAT_2_udiv_r_f1), "=&r" (_FP_DIV_MEAT_2_udiv_r_f0) : "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f1)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_m_f1)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f0)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_m_f0)) : "cc"); if (_FP_DIV_MEAT_2_udiv_r_f1 == QB_f1) { QR_f0 = -1; } else { do { unsigned long __d1, __d0, __q1, __q0, __r1, __r0, __m; __d1 = (QB_f1 >> 32); __d0 = (USItype)QB_f1; __r1 = (_FP_DIV_MEAT_2_udiv_r_f1) % __d1; __q1 = (_FP_DIV_MEAT_2_udiv_r_f1) / __d1; __m = (unsigned long) __q1 * __d0; __r1 = (__r1 << 32) | (_FP_DIV_MEAT_2_udiv_r_f0 >> 32); if (__r1 < __m) { __q1--, __r1 += (QB_f1); if (__r1 >= (QB_f1)) if (__r1 < __m) __q1--, __r1 += (QB_f1); } __r1 -= __m; __r0 = __r1 % __d1; __q0 = __r1 / __d1; __m = (unsigned long) __q0 * __d0; __r0 = (__r0 << 32) | ((USItype)_FP_DIV_MEAT_2_udiv_r_f0); if (__r0 < __m) { __q0--, __r0 += (QB_f1); if (__r0 >= (QB_f1)) if (__r0 < __m) __q0--, __r0 += (QB_f1); } __r0 -= __m; (QR_f0) = (unsigned long) (__q1 << 32) | __q0; (_FP_DIV_MEAT_2_udiv_r_f1) = __r0; } while (0); do { UDItype tmp1, tmp2, tmp3, tmp4; __asm__ __volatile__ ( "srl %7,0,%3\n\t" "mulx %3,%6,%1\n\t" "srlx %6,32,%2\n\t" "mulx %2,%3,%4\n\t" "sllx %4,32,%5\n\t" "srl %6,0,%3\n\t" "sub %1,%5,%5\n\t" "srlx %5,32,%5\n\t" "addcc %4,%5,%4\n\t" "srlx %7,32,%5\n\t" "mulx %3,%5,%3\n\t" "mulx %2,%5,%5\n\t" "sethi %%hi(0x80000000),%2\n\t" "addcc %4,%3,%4\n\t" "srlx %4,32,%4\n\t" "add %2,%2,%2\n\t" "movcc %%xcc,%%g0,%2\n\t" "addcc %5,%4,%5\n\t" "sllx %3,32,%3\n\t" "add %1,%3,%1\n\t" "add %5,%2,%0" : "=r" (_FP_DIV_MEAT_2_udiv_m_f1), "=&r" (_FP_DIV_MEAT_2_udiv_m_f0), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) : "r" ((UDItype)(QR_f0)), "r" ((UDItype)(QB_f0)) : "cc"); } while (0); _FP_DIV_MEAT_2_udiv_r_f0 = 0; if ((_FP_DIV_MEAT_2_udiv_m_f1 > _FP_DIV_MEAT_2_udiv_r_f1 || (_FP_DIV_MEAT_2_udiv_m_f1 == _FP_DIV_MEAT_2_udiv_r_f1 && _FP_DIV_MEAT_2_udiv_m_f0 > _FP_DIV_MEAT_2_udiv_r_f0))) { QR_f0--; __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_DIV_MEAT_2_udiv_r_f1), "=&r" (_FP_DIV_MEAT_2_udiv_r_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f0)) : "cc"); if ((_FP_DIV_MEAT_2_udiv_r_f1 > QB_f1 || (_FP_DIV_MEAT_2_udiv_r_f1 == QB_f1 && _FP_DIV_MEAT_2_udiv_r_f0 >= QB_f0)) && (_FP_DIV_MEAT_2_udiv_m_f1 > _FP_DIV_MEAT_2_udiv_r_f1 || (_FP_DIV_MEAT_2_udiv_m_f1 == _FP_DIV_MEAT_2_udiv_r_f1 && _FP_DIV_MEAT_2_udiv_m_f0 > _FP_DIV_MEAT_2_udiv_r_f0))) { QR_f0--; __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_DIV_MEAT_2_udiv_r_f1), "=&r" (_FP_DIV_MEAT_2_udiv_r_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(_FP_DIV_MEAT_2_udiv_r_f0)) : "cc"); } } if (!(_FP_DIV_MEAT_2_udiv_r_f1 == _FP_DIV_MEAT_2_udiv_m_f1 && _FP_DIV_MEAT_2_udiv_r_f0 == _FP_DIV_MEAT_2_udiv_m_f0)) QR_f0 |= ((unsigned long) 1 << 0); } } while (0); break; case (((3) << 2) | (3)): do { if (((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) && !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64))) { QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); } else { QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); } QR_c = 3; } while (0); break; case (((3) << 2) | (0)): case (((3) << 2) | (2)): case (((3) << 2) | (1)): QR_s = QA_s; (QR_f0 = QA_f0, QR_f1 = QA_f1); QR_c = QA_c; break; case (((0) << 2) | (3)): case (((2) << 2) | (3)): case (((1) << 2) | (3)): QR_s = QB_s; (QR_f0 = QB_f0, QR_f1 = QB_f1); QR_c = QB_c; break; case (((0) << 2) | (2)): case (((1) << 2) | (2)): case (((1) << 2) | (0)): QR_c = 1; break; case (((0) << 2) | (1)): _fex |= ((1 << 1)); case (((2) << 2) | (1)): case (((2) << 2) | (0)): QR_c = 2; break; case (((2) << 2) | (2)): case (((1) << 2) | (1)): QR_s = 0; QR_c = 3; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | (QA_c == 2 ? 0 : 0)); break; default: return 0; } } while (0); break;

  case 0x029: do { unsigned long _FP_SQRT_T_f = 0; unsigned long _FP_SQRT_S_f = 0; unsigned long _FP_SQRT_q; switch (SB_c) { case 3: (SR_f = SB_f); SR_s = SB_s; SR_c = 3; break; case 2: if (SB_s) { SR_s = 0; SR_c = 3; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); _fex |= ((1 << 4) | 0); } else { SR_s = 0; SR_c = 2; } break; case 1: SR_s = SB_s; SR_c = 1; break; case 0: SR_s = 0; if (SB_s) { SR_c = 3; SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); _fex |= ((1 << 4) | 0); break; } SR_c = 0; if (SB_e & 1) do { if (__builtin_constant_p (1) && (1) == 1) SB_f += SB_f; else SB_f <<= (1); } while (0); SR_e = SB_e >> 1; (_FP_SQRT_S_f = 0); (SR_f = 0); _FP_SQRT_q = ((unsigned long) 1 << ((3 + 24))) >> 1; do { while ((_FP_SQRT_q) != ((unsigned long) 1 << 2)) { _FP_SQRT_T_f = _FP_SQRT_S_f + (_FP_SQRT_q); if (_FP_SQRT_T_f <= SB_f) { _FP_SQRT_S_f = _FP_SQRT_T_f + (_FP_SQRT_q); SB_f -= _FP_SQRT_T_f; SR_f += (_FP_SQRT_q); } do { if (__builtin_constant_p (1) && (1) == 1) SB_f += SB_f; else SB_f <<= (1); } while (0); (_FP_SQRT_q) >>= 1; } if (SB_f) { if (_FP_SQRT_S_f < SB_f) SR_f |= ((unsigned long) 1 << 2); SR_f |= ((unsigned long) 1 << 0); } } while (0); } } while (0); break;
  case 0x02a: do { unsigned long _FP_SQRT_T_f = 0; unsigned long _FP_SQRT_S_f = 0; unsigned long _FP_SQRT_q; switch (DB_c) { case 3: (DR_f = DB_f); DR_s = DB_s; DR_c = 3; break; case 2: if (DB_s) { DR_s = 0; DR_c = 3; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | 0); } else { DR_s = 0; DR_c = 2; } break; case 1: DR_s = DB_s; DR_c = 1; break; case 0: DR_s = 0; if (DB_s) { DR_c = 3; DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | 0); break; } DR_c = 0; if (DB_e & 1) do { if (__builtin_constant_p (1) && (1) == 1) DB_f += DB_f; else DB_f <<= (1); } while (0); DR_e = DB_e >> 1; (_FP_SQRT_S_f = 0); (DR_f = 0); _FP_SQRT_q = ((unsigned long) 1 << (3 + 53) % 64) >> 1; do { while ((_FP_SQRT_q) != ((unsigned long) 1 << 2)) { _FP_SQRT_T_f = _FP_SQRT_S_f + (_FP_SQRT_q); if (_FP_SQRT_T_f <= DB_f) { _FP_SQRT_S_f = _FP_SQRT_T_f + (_FP_SQRT_q); DB_f -= _FP_SQRT_T_f; DR_f += (_FP_SQRT_q); } do { if (__builtin_constant_p (1) && (1) == 1) DB_f += DB_f; else DB_f <<= (1); } while (0); (_FP_SQRT_q) >>= 1; } if (DB_f) { if (_FP_SQRT_S_f < DB_f) DR_f |= ((unsigned long) 1 << 2); DR_f |= ((unsigned long) 1 << 0); } } while (0); } } while (0); break;
  case 0x02b: do { unsigned long _FP_SQRT_T_f0 = 0, _FP_SQRT_T_f1 = 0; unsigned long _FP_SQRT_S_f0 = 0, _FP_SQRT_S_f1 = 0; unsigned long _FP_SQRT_q; switch (QB_c) { case 3: (QR_f0 = QB_f0, QR_f1 = QB_f1); QR_s = QB_s; QR_c = 3; break; case 2: if (QB_s) { QR_s = 0; QR_c = 3; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | 0); } else { QR_s = 0; QR_c = 2; } break; case 1: QR_s = QB_s; QR_c = 1; break; case 0: QR_s = 0; if (QB_s) { QR_c = 3; QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); _fex |= ((1 << 4) | 0); break; } QR_c = 0; if (QB_e & 1) (void) (((1) < 64) ? ({ if (__builtin_constant_p (1) && (1) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (1) | QB_f0 >> (64 - (1)); QB_f0 <<= (1); } 0; }) : ({ QB_f1 = QB_f0 << ((1) - 64); QB_f0 = 0; })); QR_e = QB_e >> 1; (_FP_SQRT_S_f0 = 0, _FP_SQRT_S_f1 = 0); (QR_f0 = 0, QR_f1 = 0); _FP_SQRT_q = ((unsigned long) 1 << ((3 + 113) % 64)) >> 1; do { while (_FP_SQRT_q) { _FP_SQRT_T_f1 = _FP_SQRT_S_f1 + (_FP_SQRT_q); if (_FP_SQRT_T_f1 <= QB_f1) { _FP_SQRT_S_f1 = _FP_SQRT_T_f1 + (_FP_SQRT_q); QB_f1 -= _FP_SQRT_T_f1; QR_f1 += (_FP_SQRT_q); } (void) (((1) < 64) ? ({ if (__builtin_constant_p (1) && (1) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (1) | QB_f0 >> (64 - (1)); QB_f0 <<= (1); } 0; }) : ({ QB_f1 = QB_f0 << ((1) - 64); QB_f0 = 0; })); (_FP_SQRT_q) >>= 1; } (_FP_SQRT_q) = (unsigned long) 1 << (64 - 1); while ((_FP_SQRT_q) != ((unsigned long) 1 << 2)) { _FP_SQRT_T_f0 = _FP_SQRT_S_f0 + (_FP_SQRT_q); _FP_SQRT_T_f1 = _FP_SQRT_S_f1; if (_FP_SQRT_T_f1 < QB_f1 || (_FP_SQRT_T_f1 == QB_f1 && _FP_SQRT_T_f0 <= QB_f0)) { _FP_SQRT_S_f0 = _FP_SQRT_T_f0 + (_FP_SQRT_q); _FP_SQRT_S_f1 += (_FP_SQRT_T_f0 > _FP_SQRT_S_f0); __asm__ ("subcc %4,%5,%1\n\t" "sub %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "sub %0, 1, %0\n" "1:" : "=r" (QB_f1), "=&r" (QB_f0) : "r" ((UDItype)(QB_f1)), "r" ((UDItype)(_FP_SQRT_T_f1)), "r" ((UDItype)(QB_f0)), "r" ((UDItype)(_FP_SQRT_T_f0)) : "cc"); QR_f0 += (_FP_SQRT_q); } (void) (((1) < 64) ? ({ if (__builtin_constant_p (1) && (1) == 1) { QB_f1 = QB_f1 + QB_f1 + (((signed long) (QB_f0)) < 0); QB_f0 += QB_f0; } else { QB_f1 = QB_f1 << (1) | QB_f0 >> (64 - (1)); QB_f0 <<= (1); } 0; }) : ({ QB_f1 = QB_f0 << ((1) - 64); QB_f0 = 0; })); (_FP_SQRT_q) >>= 1; } if (QB_f0 | QB_f1) { if (_FP_SQRT_S_f1 < QB_f1 || (_FP_SQRT_S_f1 == QB_f1 && _FP_SQRT_S_f0 < QB_f0)) QR_f0 |= ((unsigned long) 1 << 2); QR_f0 |= ((unsigned long) 1 << 0); } } while (0); } } while (0); break;

  case 0x003: rd->q[0] = rs2->q[0]; rd->q[1] = rs2->q[1]; break;
  case 0x00b: rd->q[0] = rs2->q[0] & 0x7fffffffffffffffUL; rd->q[1] = rs2->q[1]; break;
  case 0x007: rd->q[0] = rs2->q[0] ^ 0x8000000000000000UL; rd->q[1] = rs2->q[1]; break;

  case 0x0d1: do { if (SB_e < 127) { ((UIR)) = 0; if (SB_e == 0) { if (!(SB_f == 0)) { if (!0) _fex |= ((1 << 0)); _fex |= (0); } } else _fex |= ((1 << 0)); } else if (((1)) == 2 && (SB_e >= ((255 < 127 + 24 + ((32)) - 1) ? 255 : 127 + 24 + ((32)) - 1))) { ((UIR)) = 0; _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (SB_e == 255) { if (!(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else if (((1)) != 2 && (SB_e >= (255 < 127 + ((32)) ? 255 : (127 + ((32)) - (((1)) > 0 || SB_s))) || (!((1)) && SB_s))) { if ((1)) { ((UIR)) = 1; ((UIR)) <<= ((32)) - 1; ((UIR)) -= 1 - SB_s; } else { ((UIR)) = 0; if (!SB_s) ((UIR)) = ~((UIR)); } if (127 + ((32)) - 1 < 255 && ((1)) && SB_s && SB_e == 127 + ((32)) - 1) { int _FP_TO_INT_inexact = 0; (void) ((24 > ((32))) ? ({ do { _FP_TO_INT_inexact = (__builtin_constant_p ((24 - ((32)))) && ((24 - ((32)))) == 1 ? SB_f & 1 : (SB_f << (64 - ((24 - ((32)))))) != 0); SB_f = SB_f >> ((24 - ((32)))); } while (0); 0; }) : 0); if (!(SB_f == 0)) _fex |= ((1 << 4) | 0); else if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } else _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (SB_e == 255) { if (!(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else { int _FP_TO_INT_inexact = 0; (SB_f) |= ((unsigned long) 1 << (24 -1)); if (SB_e >= 127 + 24 - 1) { ((((UIR))) = SB_f); ((UIR)) <<= SB_e - 127 - 24 + 1; } else { do { _FP_TO_INT_inexact = (__builtin_constant_p (((24 + 127 - 1 - SB_e))) && (((24 + 127 - 1 - SB_e))) == 1 ? SB_f & 1 : (SB_f << (64 - (((24 + 127 - 1 - SB_e))))) != 0); SB_f = SB_f >> (((24 + 127 - 1 - SB_e))); } while (0); ((((UIR))) = SB_f); } if (((1)) && SB_s) ((UIR)) = -((UIR)); if (((1)) == 2 && SB_e >= 127 + ((32)) - 1) { if (SB_e > 127 + ((32)) - 1 || !SB_s || ((UIR)) != (((typeof ((UIR))) 1) << (((32)) - 1))) { _FP_TO_INT_inexact = 0; _fex |= ((1 << 4) | 0); } } if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } } while (0); IR = UIR; break;
  case 0x0d2: do { if (DB_e < 1023) { ((UIR)) = 0; if (DB_e == 0) { if (!(DB_f == 0)) { if (!0) _fex |= ((1 << 0)); _fex |= (0); } } else _fex |= ((1 << 0)); } else if (((1)) == 2 && (DB_e >= ((2047 < 1023 + 53 + ((32)) - 1) ? 2047 : 1023 + 53 + ((32)) - 1))) { ((UIR)) = 0; _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (DB_e == 2047) { if (!(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else if (((1)) != 2 && (DB_e >= (2047 < 1023 + ((32)) ? 2047 : (1023 + ((32)) - (((1)) > 0 || DB_s))) || (!((1)) && DB_s))) { if ((1)) { ((UIR)) = 1; ((UIR)) <<= ((32)) - 1; ((UIR)) -= 1 - DB_s; } else { ((UIR)) = 0; if (!DB_s) ((UIR)) = ~((UIR)); } if (1023 + ((32)) - 1 < 2047 && ((1)) && DB_s && DB_e == 1023 + ((32)) - 1) { int _FP_TO_INT_inexact = 0; (void) ((53 > ((32))) ? ({ do { _FP_TO_INT_inexact = (__builtin_constant_p ((53 - ((32)))) && ((53 - ((32)))) == 1 ? DB_f & 1 : (DB_f << (64 - ((53 - ((32)))))) != 0); DB_f = DB_f >> ((53 - ((32)))); } while (0); 0; }) : 0); if (!(DB_f == 0)) _fex |= ((1 << 4) | 0); else if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } else _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (DB_e == 2047) { if (!(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else { int _FP_TO_INT_inexact = 0; (DB_f) |= ((unsigned long) 1 << (53 -1) % 64); if (DB_e >= 1023 + 53 - 1) { ((((UIR))) = DB_f); ((UIR)) <<= DB_e - 1023 - 53 + 1; } else { do { _FP_TO_INT_inexact = (__builtin_constant_p (((53 + 1023 - 1 - DB_e))) && (((53 + 1023 - 1 - DB_e))) == 1 ? DB_f & 1 : (DB_f << (64 - (((53 + 1023 - 1 - DB_e))))) != 0); DB_f = DB_f >> (((53 + 1023 - 1 - DB_e))); } while (0); ((((UIR))) = DB_f); } if (((1)) && DB_s) ((UIR)) = -((UIR)); if (((1)) == 2 && DB_e >= 1023 + ((32)) - 1) { if (DB_e > 1023 + ((32)) - 1 || !DB_s || ((UIR)) != (((typeof ((UIR))) 1) << (((32)) - 1))) { _FP_TO_INT_inexact = 0; _fex |= ((1 << 4) | 0); } } if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } } while (0); IR = UIR; break;
  case 0x0d3: do { if (QB_e < 16383) { ((UIR)) = 0; if (QB_e == 0) { if (!((QB_f1 | QB_f0) == 0)) { if (!0) _fex |= ((1 << 0)); _fex |= (0); } } else _fex |= ((1 << 0)); } else if (((1)) == 2 && (QB_e >= ((32767 < 16383 + 113 + ((32)) - 1) ? 32767 : 16383 + 113 + ((32)) - 1))) { ((UIR)) = 0; _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (QB_e == 32767) { if (!((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else if (((1)) != 2 && (QB_e >= (32767 < 16383 + ((32)) ? 32767 : (16383 + ((32)) - (((1)) > 0 || QB_s))) || (!((1)) && QB_s))) { if ((1)) { ((UIR)) = 1; ((UIR)) <<= ((32)) - 1; ((UIR)) -= 1 - QB_s; } else { ((UIR)) = 0; if (!QB_s) ((UIR)) = ~((UIR)); } if (16383 + ((32)) - 1 < 32767 && ((1)) && QB_s && QB_e == 16383 + ((32)) - 1) { int _FP_TO_INT_inexact = 0; (void) ((113 > ((32))) ? ({ (void) (((113 - ((32))) < 64) ? ({ _FP_TO_INT_inexact = (__builtin_constant_p (113 - ((32))) && (113 - ((32))) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (113 - ((32))))) != 0); QB_f0 = (QB_f1 << (64 - (113 - ((32)))) | QB_f0 >> (113 - ((32)))); QB_f1 >>= (113 - ((32))); }) : ({ _FP_TO_INT_inexact = ((((113 - ((32))) == 64 ? 0 : (QB_f1 << (2*64 - (113 - ((32)))))) | QB_f0) != 0); QB_f0 = (QB_f1 >> ((113 - ((32))) - 64)); QB_f1 = 0; })); 0; }) : 0); if (!((QB_f1 | QB_f0) == 0)) _fex |= ((1 << 4) | 0); else if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } else _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (QB_e == 32767) { if (!((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else { int _FP_TO_INT_inexact = 0; (QB_f1) |= ((unsigned long) 1 << (113 -1) % 64); if (QB_e >= 16383 + 113 - 1) { (void) (((((32))) <= 64) ? ({ (((UIR))) = QB_f0; }) : ({ (((UIR))) = QB_f1; (((UIR))) <<= 64; (((UIR))) += QB_f0; })); ((UIR)) <<= QB_e - 16383 - 113 + 1; } else { (void) ((((113 + 16383 - 1 - QB_e)) < 64) ? ({ _FP_TO_INT_inexact = (__builtin_constant_p ((113 + 16383 - 1 - QB_e)) && ((113 + 16383 - 1 - QB_e)) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - ((113 + 16383 - 1 - QB_e)))) != 0); QB_f0 = (QB_f1 << (64 - ((113 + 16383 - 1 - QB_e))) | QB_f0 >> ((113 + 16383 - 1 - QB_e))); QB_f1 >>= ((113 + 16383 - 1 - QB_e)); }) : ({ _FP_TO_INT_inexact = (((((113 + 16383 - 1 - QB_e)) == 64 ? 0 : (QB_f1 << (2*64 - ((113 + 16383 - 1 - QB_e))))) | QB_f0) != 0); QB_f0 = (QB_f1 >> (((113 + 16383 - 1 - QB_e)) - 64)); QB_f1 = 0; })); (void) (((((32))) <= 64) ? ({ (((UIR))) = QB_f0; }) : ({ (((UIR))) = QB_f1; (((UIR))) <<= 64; (((UIR))) += QB_f0; })); } if (((1)) && QB_s) ((UIR)) = -((UIR)); if (((1)) == 2 && QB_e >= 16383 + ((32)) - 1) { if (QB_e > 16383 + ((32)) - 1 || !QB_s || ((UIR)) != (((typeof ((UIR))) 1) << (((32)) - 1))) { _FP_TO_INT_inexact = 0; _fex |= ((1 << 4) | 0); } } if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } } while (0); IR = UIR; break;
  case 0x081: do { if (SB_e < 127) { ((UXR)) = 0; if (SB_e == 0) { if (!(SB_f == 0)) { if (!0) _fex |= ((1 << 0)); _fex |= (0); } } else _fex |= ((1 << 0)); } else if (((1)) == 2 && (SB_e >= ((255 < 127 + 24 + ((64)) - 1) ? 255 : 127 + 24 + ((64)) - 1))) { ((UXR)) = 0; _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (SB_e == 255) { if (!(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else if (((1)) != 2 && (SB_e >= (255 < 127 + ((64)) ? 255 : (127 + ((64)) - (((1)) > 0 || SB_s))) || (!((1)) && SB_s))) { if ((1)) { ((UXR)) = 1; ((UXR)) <<= ((64)) - 1; ((UXR)) -= 1 - SB_s; } else { ((UXR)) = 0; if (!SB_s) ((UXR)) = ~((UXR)); } if (127 + ((64)) - 1 < 255 && ((1)) && SB_s && SB_e == 127 + ((64)) - 1) { int _FP_TO_INT_inexact = 0; (void) ((24 > ((64))) ? ({ do { _FP_TO_INT_inexact = (__builtin_constant_p ((24 - ((64)))) && ((24 - ((64)))) == 1 ? SB_f & 1 : (SB_f << (64 - ((24 - ((64)))))) != 0); SB_f = SB_f >> ((24 - ((64)))); } while (0); 0; }) : 0); if (!(SB_f == 0)) _fex |= ((1 << 4) | 0); else if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } else _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (SB_e == 255) { if (!(SB_f == 0) && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else { int _FP_TO_INT_inexact = 0; (SB_f) |= ((unsigned long) 1 << (24 -1)); if (SB_e >= 127 + 24 - 1) { ((((UXR))) = SB_f); ((UXR)) <<= SB_e - 127 - 24 + 1; } else { do { _FP_TO_INT_inexact = (__builtin_constant_p (((24 + 127 - 1 - SB_e))) && (((24 + 127 - 1 - SB_e))) == 1 ? SB_f & 1 : (SB_f << (64 - (((24 + 127 - 1 - SB_e))))) != 0); SB_f = SB_f >> (((24 + 127 - 1 - SB_e))); } while (0); ((((UXR))) = SB_f); } if (((1)) && SB_s) ((UXR)) = -((UXR)); if (((1)) == 2 && SB_e >= 127 + ((64)) - 1) { if (SB_e > 127 + ((64)) - 1 || !SB_s || ((UXR)) != (((typeof ((UXR))) 1) << (((64)) - 1))) { _FP_TO_INT_inexact = 0; _fex |= ((1 << 4) | 0); } } if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } } while (0); XR = UXR; break;
  case 0x082: do { if (DB_e < 1023) { ((UXR)) = 0; if (DB_e == 0) { if (!(DB_f == 0)) { if (!0) _fex |= ((1 << 0)); _fex |= (0); } } else _fex |= ((1 << 0)); } else if (((1)) == 2 && (DB_e >= ((2047 < 1023 + 53 + ((64)) - 1) ? 2047 : 1023 + 53 + ((64)) - 1))) { ((UXR)) = 0; _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (DB_e == 2047) { if (!(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else if (((1)) != 2 && (DB_e >= (2047 < 1023 + ((64)) ? 2047 : (1023 + ((64)) - (((1)) > 0 || DB_s))) || (!((1)) && DB_s))) { if ((1)) { ((UXR)) = 1; ((UXR)) <<= ((64)) - 1; ((UXR)) -= 1 - DB_s; } else { ((UXR)) = 0; if (!DB_s) ((UXR)) = ~((UXR)); } if (1023 + ((64)) - 1 < 2047 && ((1)) && DB_s && DB_e == 1023 + ((64)) - 1) { int _FP_TO_INT_inexact = 0; (void) ((53 > ((64))) ? ({ do { _FP_TO_INT_inexact = (__builtin_constant_p ((53 - ((64)))) && ((53 - ((64)))) == 1 ? DB_f & 1 : (DB_f << (64 - ((53 - ((64)))))) != 0); DB_f = DB_f >> ((53 - ((64)))); } while (0); 0; }) : 0); if (!(DB_f == 0)) _fex |= ((1 << 4) | 0); else if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } else _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (DB_e == 2047) { if (!(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else { int _FP_TO_INT_inexact = 0; (DB_f) |= ((unsigned long) 1 << (53 -1) % 64); if (DB_e >= 1023 + 53 - 1) { ((((UXR))) = DB_f); ((UXR)) <<= DB_e - 1023 - 53 + 1; } else { do { _FP_TO_INT_inexact = (__builtin_constant_p (((53 + 1023 - 1 - DB_e))) && (((53 + 1023 - 1 - DB_e))) == 1 ? DB_f & 1 : (DB_f << (64 - (((53 + 1023 - 1 - DB_e))))) != 0); DB_f = DB_f >> (((53 + 1023 - 1 - DB_e))); } while (0); ((((UXR))) = DB_f); } if (((1)) && DB_s) ((UXR)) = -((UXR)); if (((1)) == 2 && DB_e >= 1023 + ((64)) - 1) { if (DB_e > 1023 + ((64)) - 1 || !DB_s || ((UXR)) != (((typeof ((UXR))) 1) << (((64)) - 1))) { _FP_TO_INT_inexact = 0; _fex |= ((1 << 4) | 0); } } if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } } while (0); XR = UXR; break;
  case 0x083: do { if (QB_e < 16383) { ((UXR)) = 0; if (QB_e == 0) { if (!((QB_f1 | QB_f0) == 0)) { if (!0) _fex |= ((1 << 0)); _fex |= (0); } } else _fex |= ((1 << 0)); } else if (((1)) == 2 && (QB_e >= ((32767 < 16383 + 113 + ((64)) - 1) ? 32767 : 16383 + 113 + ((64)) - 1))) { ((UXR)) = 0; _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (QB_e == 32767) { if (!((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else if (((1)) != 2 && (QB_e >= (32767 < 16383 + ((64)) ? 32767 : (16383 + ((64)) - (((1)) > 0 || QB_s))) || (!((1)) && QB_s))) { if ((1)) { ((UXR)) = 1; ((UXR)) <<= ((64)) - 1; ((UXR)) -= 1 - QB_s; } else { ((UXR)) = 0; if (!QB_s) ((UXR)) = ~((UXR)); } if (16383 + ((64)) - 1 < 32767 && ((1)) && QB_s && QB_e == 16383 + ((64)) - 1) { int _FP_TO_INT_inexact = 0; (void) ((113 > ((64))) ? ({ (void) (((113 - ((64))) < 64) ? ({ _FP_TO_INT_inexact = (__builtin_constant_p (113 - ((64))) && (113 - ((64))) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (113 - ((64))))) != 0); QB_f0 = (QB_f1 << (64 - (113 - ((64)))) | QB_f0 >> (113 - ((64)))); QB_f1 >>= (113 - ((64))); }) : ({ _FP_TO_INT_inexact = ((((113 - ((64))) == 64 ? 0 : (QB_f1 << (2*64 - (113 - ((64)))))) | QB_f0) != 0); QB_f0 = (QB_f1 >> ((113 - ((64))) - 64)); QB_f1 = 0; })); 0; }) : 0); if (!((QB_f1 | QB_f0) == 0)) _fex |= ((1 << 4) | 0); else if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } else _fex |= ((1 << 4) | 0 | ((0 && ({ int _FP_ISSIGNAN_ret = 0; if (QB_e == 32767) { if (!((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) ? 0 : 0)); } else { int _FP_TO_INT_inexact = 0; (QB_f1) |= ((unsigned long) 1 << (113 -1) % 64); if (QB_e >= 16383 + 113 - 1) { (void) (((((64))) <= 64) ? ({ (((UXR))) = QB_f0; }) : ({ (((UXR))) = QB_f1; (((UXR))) <<= 64; (((UXR))) += QB_f0; })); ((UXR)) <<= QB_e - 16383 - 113 + 1; } else { (void) ((((113 + 16383 - 1 - QB_e)) < 64) ? ({ _FP_TO_INT_inexact = (__builtin_constant_p ((113 + 16383 - 1 - QB_e)) && ((113 + 16383 - 1 - QB_e)) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - ((113 + 16383 - 1 - QB_e)))) != 0); QB_f0 = (QB_f1 << (64 - ((113 + 16383 - 1 - QB_e))) | QB_f0 >> ((113 + 16383 - 1 - QB_e))); QB_f1 >>= ((113 + 16383 - 1 - QB_e)); }) : ({ _FP_TO_INT_inexact = (((((113 + 16383 - 1 - QB_e)) == 64 ? 0 : (QB_f1 << (2*64 - ((113 + 16383 - 1 - QB_e))))) | QB_f0) != 0); QB_f0 = (QB_f1 >> (((113 + 16383 - 1 - QB_e)) - 64)); QB_f1 = 0; })); (void) (((((64))) <= 64) ? ({ (((UXR))) = QB_f0; }) : ({ (((UXR))) = QB_f1; (((UXR))) <<= 64; (((UXR))) += QB_f0; })); } if (((1)) && QB_s) ((UXR)) = -((UXR)); if (((1)) == 2 && QB_e >= 16383 + ((64)) - 1) { if (QB_e > 16383 + ((64)) - 1 || !QB_s || ((UXR)) != (((typeof ((UXR))) 1) << (((64)) - 1))) { _FP_TO_INT_inexact = 0; _fex |= ((1 << 4) | 0); } } if (_FP_TO_INT_inexact) _fex |= ((1 << 0)); } } while (0); XR = UXR; break;

  case 0x0cc: IR = rs2->s; do { __label__ pack_semiraw; if ((IR)) { unsigned int _FP_FROM_INT_ur; if ((QR_s = (((IR)) < 0))) ((IR)) = -(unsigned int) ((IR)); _FP_FROM_INT_ur = (unsigned int) ((IR)); (void) ((((32)) <= 64) ? ({ int _FP_FROM_INT_lz; do { if (sizeof (unsigned long) == sizeof (unsigned int)) (_FP_FROM_INT_lz) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) (_FP_FROM_INT_lz) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) (_FP_FROM_INT_lz) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); QR_e = (16383 + 64 - 1 - _FP_FROM_INT_lz); }) : ((((32)) <= 2 * 64) ? ({ int _FP_FROM_INT_lz; do { if ((unsigned long) (_FP_FROM_INT_ur >> 64)) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) (_FP_FROM_INT_ur >> 64)); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); (_FP_FROM_INT_lz) += 64; } } while (0); QR_e = (16383 + 2 * 64 - 1 - _FP_FROM_INT_lz); }) : (return 0, 0))); if (((32)) - 1 + 16383 >= 32767 && QR_e >= 32767) { do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto pack_semiraw; } if (((32)) <= 113 || QR_e < 16383 + 113) { do { QR_f0 = (_FP_FROM_INT_ur); QR_f1 = ((((32))) <= 64 ? 0 : (_FP_FROM_INT_ur) >> 64); } while (0); if (16383 + 113 - 1 - QR_e > 0) (void) ((((16383 + 113 - 1 - QR_e)) < 64) ? ({ if (__builtin_constant_p ((16383 + 113 - 1 - QR_e)) && ((16383 + 113 - 1 - QR_e)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((16383 + 113 - 1 - QR_e)) | QR_f0 >> (64 - ((16383 + 113 - 1 - QR_e))); QR_f0 <<= ((16383 + 113 - 1 - QR_e)); } 0; }) : ({ QR_f1 = QR_f0 << (((16383 + 113 - 1 - QR_e)) - 64); QR_f0 = 0; })); } else { if (16383 + (3 + 113) - 1 < QR_e) _FP_FROM_INT_ur = ((_FP_FROM_INT_ur >> (QR_e - 16383 - (3 + 113) + 1)) | ((_FP_FROM_INT_ur << (((32)) - (QR_e - 16383 - (3 + 113) + 1))) != 0)); do { QR_f0 = (_FP_FROM_INT_ur); QR_f1 = ((((32))) <= 64 ? 0 : (_FP_FROM_INT_ur) >> 64); } while (0); if ((16383 + (3 + 113) - 1 - QR_e) > 0) (void) ((((16383 + (3 + 113) - 1 - QR_e)) < 64) ? ({ if (__builtin_constant_p ((16383 + (3 + 113) - 1 - QR_e)) && ((16383 + (3 + 113) - 1 - QR_e)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((16383 + (3 + 113) - 1 - QR_e)) | QR_f0 >> (64 - ((16383 + (3 + 113) - 1 - QR_e))); QR_f0 <<= ((16383 + (3 + 113) - 1 - QR_e)); } 0; }) : ({ QR_f1 = QR_f0 << (((16383 + (3 + 113) - 1 - QR_e)) - 64); QR_f0 = 0; })); (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); pack_semiraw: do { int _FP_PACK_SEMIRAW_is_tiny = QR_e == 0 && !((QR_f1 | QR_f0) == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f0 = 0, _FP_PACK_SEMIRAW_T_f1 = 0; (_FP_PACK_SEMIRAW_T_f0 = QR_f0, _FP_PACK_SEMIRAW_T_f1 = QR_f1); _FP_PACK_SEMIRAW_T_s = QR_s; _FP_PACK_SEMIRAW_T_e = QR_e; (void) (((1) < 64) ? ({ if (__builtin_constant_p (1) && (1) == 1) { _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f1 + _FP_PACK_SEMIRAW_T_f1 + (((signed long) (_FP_PACK_SEMIRAW_T_f0)) < 0); _FP_PACK_SEMIRAW_T_f0 += _FP_PACK_SEMIRAW_T_f0; } else { _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f1 << (1) | _FP_PACK_SEMIRAW_T_f0 >> (64 - (1)); _FP_PACK_SEMIRAW_T_f0 <<= (1); } 0; }) : ({ _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f0 << ((1) - 64); _FP_PACK_SEMIRAW_T_f0 = 0; })); do { if ((_FP_PACK_SEMIRAW_T_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (((_FP_PACK_SEMIRAW_T_f1) & ((unsigned long) 1 << ((3 + 113) % 64)))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((QR_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((QR_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((QR_f1) & (((unsigned long) 1 << ((3 + 113) % 64)) >> 1)) { (QR_f1) &= ~(((unsigned long) 1 << ((3 + 113) % 64)) >> 1); QR_e++; if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (void) (((3) < 64) ? ({ QR_f0 = QR_f0 >> (3) | QR_f1 << (64 - (3)); QR_f1 >>= (3); }) : ({ QR_f0 = QR_f1 >> ((3) - 64); QR_f1 = 0; })); if (QR_e == 32767 && !((QR_f1 | QR_f0) == 0)) { if (!1) { (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); QR_s = 0; } else do { if (0) { (QR_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QR_f1 | QR_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QR_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } while (0); } } else { QR_s = 0; QR_e = 0; (QR_f0 = 0, QR_f1 = 0); } } while (0); break;
  case 0x08c: XR = rs2->d; do { __label__ pack_semiraw; if ((XR)) { unsigned long _FP_FROM_INT_ur; if ((QR_s = (((XR)) < 0))) ((XR)) = -(unsigned long) ((XR)); _FP_FROM_INT_ur = (unsigned long) ((XR)); (void) ((((64)) <= 64) ? ({ int _FP_FROM_INT_lz; do { if (sizeof (unsigned long) == sizeof (unsigned int)) (_FP_FROM_INT_lz) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) (_FP_FROM_INT_lz) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) (_FP_FROM_INT_lz) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); QR_e = (16383 + 64 - 1 - _FP_FROM_INT_lz); }) : ((((64)) <= 2 * 64) ? ({ int _FP_FROM_INT_lz; do { if ((unsigned long) (_FP_FROM_INT_ur >> 64)) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) (_FP_FROM_INT_ur >> 64)); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); (_FP_FROM_INT_lz) += 64; } } while (0); QR_e = (16383 + 2 * 64 - 1 - _FP_FROM_INT_lz); }) : (return 0, 0))); if (((64)) - 1 + 16383 >= 32767 && QR_e >= 32767) { do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto pack_semiraw; } if (((64)) <= 113 || QR_e < 16383 + 113) { do { QR_f0 = (_FP_FROM_INT_ur); QR_f1 = ((((64))) <= 64 ? 0 : (_FP_FROM_INT_ur) >> 64); } while (0); if (16383 + 113 - 1 - QR_e > 0) (void) ((((16383 + 113 - 1 - QR_e)) < 64) ? ({ if (__builtin_constant_p ((16383 + 113 - 1 - QR_e)) && ((16383 + 113 - 1 - QR_e)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((16383 + 113 - 1 - QR_e)) | QR_f0 >> (64 - ((16383 + 113 - 1 - QR_e))); QR_f0 <<= ((16383 + 113 - 1 - QR_e)); } 0; }) : ({ QR_f1 = QR_f0 << (((16383 + 113 - 1 - QR_e)) - 64); QR_f0 = 0; })); } else { if (16383 + (3 + 113) - 1 < QR_e) _FP_FROM_INT_ur = ((_FP_FROM_INT_ur >> (QR_e - 16383 - (3 + 113) + 1)) | ((_FP_FROM_INT_ur << (((64)) - (QR_e - 16383 - (3 + 113) + 1))) != 0)); do { QR_f0 = (_FP_FROM_INT_ur); QR_f1 = ((((64))) <= 64 ? 0 : (_FP_FROM_INT_ur) >> 64); } while (0); if ((16383 + (3 + 113) - 1 - QR_e) > 0) (void) ((((16383 + (3 + 113) - 1 - QR_e)) < 64) ? ({ if (__builtin_constant_p ((16383 + (3 + 113) - 1 - QR_e)) && ((16383 + (3 + 113) - 1 - QR_e)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((16383 + (3 + 113) - 1 - QR_e)) | QR_f0 >> (64 - ((16383 + (3 + 113) - 1 - QR_e))); QR_f0 <<= ((16383 + (3 + 113) - 1 - QR_e)); } 0; }) : ({ QR_f1 = QR_f0 << (((16383 + (3 + 113) - 1 - QR_e)) - 64); QR_f0 = 0; })); (QR_f1) &= ~(unsigned long) ((unsigned long) 1 << (113 -1+3) % 64); pack_semiraw: do { int _FP_PACK_SEMIRAW_is_tiny = QR_e == 0 && !((QR_f1 | QR_f0) == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f0 = 0, _FP_PACK_SEMIRAW_T_f1 = 0; (_FP_PACK_SEMIRAW_T_f0 = QR_f0, _FP_PACK_SEMIRAW_T_f1 = QR_f1); _FP_PACK_SEMIRAW_T_s = QR_s; _FP_PACK_SEMIRAW_T_e = QR_e; (void) (((1) < 64) ? ({ if (__builtin_constant_p (1) && (1) == 1) { _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f1 + _FP_PACK_SEMIRAW_T_f1 + (((signed long) (_FP_PACK_SEMIRAW_T_f0)) < 0); _FP_PACK_SEMIRAW_T_f0 += _FP_PACK_SEMIRAW_T_f0; } else { _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f1 << (1) | _FP_PACK_SEMIRAW_T_f0 >> (64 - (1)); _FP_PACK_SEMIRAW_T_f0 <<= (1); } 0; }) : ({ _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f0 << ((1) - 64); _FP_PACK_SEMIRAW_T_f0 = 0; })); do { if ((_FP_PACK_SEMIRAW_T_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (((_FP_PACK_SEMIRAW_T_f1) & ((unsigned long) 1 << ((3 + 113) % 64)))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((QR_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((QR_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((QR_f1) & (((unsigned long) 1 << ((3 + 113) % 64)) >> 1)) { (QR_f1) &= ~(((unsigned long) 1 << ((3 + 113) % 64)) >> 1); QR_e++; if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (void) (((3) < 64) ? ({ QR_f0 = QR_f0 >> (3) | QR_f1 << (64 - (3)); QR_f1 >>= (3); }) : ({ QR_f0 = QR_f1 >> ((3) - 64); QR_f1 = 0; })); if (QR_e == 32767 && !((QR_f1 | QR_f0) == 0)) { if (!1) { (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); QR_s = 0; } else do { if (0) { (QR_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QR_f1 | QR_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QR_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } while (0); } } else { QR_s = 0; QR_e = 0; (QR_f0 = 0, QR_f1 = 0); } } while (0); break;

  case 0x084: XR = rs2->d; do { __label__ pack_semiraw; if ((XR)) { unsigned long _FP_FROM_INT_ur; if ((SR_s = (((XR)) < 0))) ((XR)) = -(unsigned long) ((XR)); _FP_FROM_INT_ur = (unsigned long) ((XR)); (void) ((((64)) <= 64) ? ({ int _FP_FROM_INT_lz; do { if (sizeof (unsigned long) == sizeof (unsigned int)) (_FP_FROM_INT_lz) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) (_FP_FROM_INT_lz) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) (_FP_FROM_INT_lz) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); SR_e = (127 + 64 - 1 - _FP_FROM_INT_lz); }) : ((((64)) <= 2 * 64) ? ({ int _FP_FROM_INT_lz; do { if ((unsigned long) (_FP_FROM_INT_ur >> 64)) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) (_FP_FROM_INT_ur >> 64)); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); (_FP_FROM_INT_lz) += 64; } } while (0); SR_e = (127 + 2 * 64 - 1 - _FP_FROM_INT_lz); }) : (return 0, 0))); if (((64)) - 1 + 127 >= 255 && SR_e >= 255) { do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto pack_semiraw; } if (((64)) <= 24 || SR_e < 127 + 24) { (SR_f = (_FP_FROM_INT_ur)); if (127 + 24 - 1 - SR_e > 0) do { if (__builtin_constant_p ((127 + 24 - 1 - SR_e)) && ((127 + 24 - 1 - SR_e)) == 1) SR_f += SR_f; else SR_f <<= ((127 + 24 - 1 - SR_e)); } while (0); } else { if (127 + (3 + 24) - 1 < SR_e) _FP_FROM_INT_ur = ((_FP_FROM_INT_ur >> (SR_e - 127 - (3 + 24) + 1)) | ((_FP_FROM_INT_ur << (((64)) - (SR_e - 127 - (3 + 24) + 1))) != 0)); (SR_f = (_FP_FROM_INT_ur)); if ((127 + (3 + 24) - 1 - SR_e) > 0) do { if (__builtin_constant_p ((127 + (3 + 24) - 1 - SR_e)) && ((127 + (3 + 24) - 1 - SR_e)) == 1) SR_f += SR_f; else SR_f <<= ((127 + (3 + 24) - 1 - SR_e)); } while (0); (SR_f) &= ~(unsigned long) ((unsigned long) 1 << (24 -1+3)); pack_semiraw: do { int _FP_PACK_SEMIRAW_is_tiny = SR_e == 0 && !(SR_f == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f = 0; (_FP_PACK_SEMIRAW_T_f = SR_f); _FP_PACK_SEMIRAW_T_s = SR_s; _FP_PACK_SEMIRAW_T_e = SR_e; do { if (__builtin_constant_p (1) && (1) == 1) _FP_PACK_SEMIRAW_T_f += _FP_PACK_SEMIRAW_T_f; else _FP_PACK_SEMIRAW_T_f <<= (1); } while (0); do { if ((_FP_PACK_SEMIRAW_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_SEMIRAW_T_f & ((unsigned long) 1 << ((3 + 24))))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((SR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((SR_f) & 15) != ((unsigned long) 1 << 2)) (SR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((SR_f) & (((unsigned long) 1 << ((3 + 24))) >> 1)) { (SR_f) &= ~(((unsigned long) 1 << ((3 + 24))) >> 1); SR_e++; if (SR_e == 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (SR_f >>= 3); if (SR_e == 255 && !(SR_f == 0)) { if (!1) { (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); SR_s = 0; } else do { if (0) { (SR_f) &= ((unsigned long) 1 << (24 -2)) - 1; if ((SR_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); } } else (SR_f) |= ((unsigned long) 1 << (24 -2)); } while (0); } } while (0); } } else { SR_s = 0; SR_e = 0; (SR_f = 0); } } while (0); break;
  case 0x088: XR = rs2->d; do { __label__ pack_semiraw; if ((XR)) { unsigned long _FP_FROM_INT_ur; if ((DR_s = (((XR)) < 0))) ((XR)) = -(unsigned long) ((XR)); _FP_FROM_INT_ur = (unsigned long) ((XR)); (void) ((((64)) <= 64) ? ({ int _FP_FROM_INT_lz; do { if (sizeof (unsigned long) == sizeof (unsigned int)) (_FP_FROM_INT_lz) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) (_FP_FROM_INT_lz) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) (_FP_FROM_INT_lz) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); DR_e = (1023 + 64 - 1 - _FP_FROM_INT_lz); }) : ((((64)) <= 2 * 64) ? ({ int _FP_FROM_INT_lz; do { if ((unsigned long) (_FP_FROM_INT_ur >> 64)) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) (_FP_FROM_INT_ur >> 64)); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); (_FP_FROM_INT_lz) += 64; } } while (0); DR_e = (1023 + 2 * 64 - 1 - _FP_FROM_INT_lz); }) : (return 0, 0))); if (((64)) - 1 + 1023 >= 2047 && DR_e >= 2047) { do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto pack_semiraw; } if (((64)) <= 53 || DR_e < 1023 + 53) { (DR_f = (_FP_FROM_INT_ur)); if (1023 + 53 - 1 - DR_e > 0) do { if (__builtin_constant_p ((1023 + 53 - 1 - DR_e)) && ((1023 + 53 - 1 - DR_e)) == 1) DR_f += DR_f; else DR_f <<= ((1023 + 53 - 1 - DR_e)); } while (0); } else { if (1023 + (3 + 53) - 1 < DR_e) _FP_FROM_INT_ur = ((_FP_FROM_INT_ur >> (DR_e - 1023 - (3 + 53) + 1)) | ((_FP_FROM_INT_ur << (((64)) - (DR_e - 1023 - (3 + 53) + 1))) != 0)); (DR_f = (_FP_FROM_INT_ur)); if ((1023 + (3 + 53) - 1 - DR_e) > 0) do { if (__builtin_constant_p ((1023 + (3 + 53) - 1 - DR_e)) && ((1023 + (3 + 53) - 1 - DR_e)) == 1) DR_f += DR_f; else DR_f <<= ((1023 + (3 + 53) - 1 - DR_e)); } while (0); (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); pack_semiraw: do { int _FP_PACK_SEMIRAW_is_tiny = DR_e == 0 && !(DR_f == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f = 0; (_FP_PACK_SEMIRAW_T_f = DR_f); _FP_PACK_SEMIRAW_T_s = DR_s; _FP_PACK_SEMIRAW_T_e = DR_e; do { if (__builtin_constant_p (1) && (1) == 1) _FP_PACK_SEMIRAW_T_f += _FP_PACK_SEMIRAW_T_f; else _FP_PACK_SEMIRAW_T_f <<= (1); } while (0); do { if ((_FP_PACK_SEMIRAW_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_SEMIRAW_T_f & ((unsigned long) 1 << (3 + 53) % 64))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((DR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((DR_f) & 15) != ((unsigned long) 1 << 2)) (DR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((DR_f) & (((unsigned long) 1 << (3 + 53) % 64) >> 1)) { (DR_f) &= ~(((unsigned long) 1 << (3 + 53) % 64) >> 1); DR_e++; if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (DR_f >>= 3); if (DR_e == 2047 && !(DR_f == 0)) { if (!1) { (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); DR_s = 0; } else do { if (0) { (DR_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DR_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DR_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); } } while (0); } } else { DR_s = 0; DR_e = 0; (DR_f = 0); } } while (0); break;



  case 0x0c8: IR = rs2->s; do { __label__ pack_semiraw; if ((IR)) { unsigned int _FP_FROM_INT_ur; if ((DR_s = (((IR)) < 0))) ((IR)) = -(unsigned int) ((IR)); _FP_FROM_INT_ur = (unsigned int) ((IR)); (void) ((((32)) <= 64) ? ({ int _FP_FROM_INT_lz; do { if (sizeof (unsigned long) == sizeof (unsigned int)) (_FP_FROM_INT_lz) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) (_FP_FROM_INT_lz) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) (_FP_FROM_INT_lz) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); DR_e = (1023 + 64 - 1 - _FP_FROM_INT_lz); }) : ((((32)) <= 2 * 64) ? ({ int _FP_FROM_INT_lz; do { if ((unsigned long) (_FP_FROM_INT_ur >> 64)) do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) (_FP_FROM_INT_ur >> 64)); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) (_FP_FROM_INT_ur >> 64)); else return 0; } while (0); else { do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((_FP_FROM_INT_lz)) = __builtin_clz ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((_FP_FROM_INT_lz)) = __builtin_clzl ((unsigned long) _FP_FROM_INT_ur); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((_FP_FROM_INT_lz)) = __builtin_clzll ((unsigned long) _FP_FROM_INT_ur); else return 0; } while (0); (_FP_FROM_INT_lz) += 64; } } while (0); DR_e = (1023 + 2 * 64 - 1 - _FP_FROM_INT_lz); }) : (return 0, 0))); if (((32)) - 1 + 1023 >= 2047 && DR_e >= 2047) { do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); goto pack_semiraw; } if (((32)) <= 53 || DR_e < 1023 + 53) { (DR_f = (_FP_FROM_INT_ur)); if (1023 + 53 - 1 - DR_e > 0) do { if (__builtin_constant_p ((1023 + 53 - 1 - DR_e)) && ((1023 + 53 - 1 - DR_e)) == 1) DR_f += DR_f; else DR_f <<= ((1023 + 53 - 1 - DR_e)); } while (0); } else { if (1023 + (3 + 53) - 1 < DR_e) _FP_FROM_INT_ur = ((_FP_FROM_INT_ur >> (DR_e - 1023 - (3 + 53) + 1)) | ((_FP_FROM_INT_ur << (((32)) - (DR_e - 1023 - (3 + 53) + 1))) != 0)); (DR_f = (_FP_FROM_INT_ur)); if ((1023 + (3 + 53) - 1 - DR_e) > 0) do { if (__builtin_constant_p ((1023 + (3 + 53) - 1 - DR_e)) && ((1023 + (3 + 53) - 1 - DR_e)) == 1) DR_f += DR_f; else DR_f <<= ((1023 + (3 + 53) - 1 - DR_e)); } while (0); (DR_f) &= ~(unsigned long) ((unsigned long) 1 << (53 -1+3) % 64); pack_semiraw: do { int _FP_PACK_SEMIRAW_is_tiny = DR_e == 0 && !(DR_f == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f = 0; (_FP_PACK_SEMIRAW_T_f = DR_f); _FP_PACK_SEMIRAW_T_s = DR_s; _FP_PACK_SEMIRAW_T_e = DR_e; do { if (__builtin_constant_p (1) && (1) == 1) _FP_PACK_SEMIRAW_T_f += _FP_PACK_SEMIRAW_T_f; else _FP_PACK_SEMIRAW_T_f <<= (1); } while (0); do { if ((_FP_PACK_SEMIRAW_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_SEMIRAW_T_f & ((unsigned long) 1 << (3 + 53) % 64))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((DR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((DR_f) & 15) != ((unsigned long) 1 << 2)) (DR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((DR_f) & (((unsigned long) 1 << (3 + 53) % 64) >> 1)) { (DR_f) &= ~(((unsigned long) 1 << (3 + 53) % 64) >> 1); DR_e++; if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (DR_f >>= 3); if (DR_e == 2047 && !(DR_f == 0)) { if (!1) { (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); DR_s = 0; } else do { if (0) { (DR_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DR_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DR_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); } } while (0); } } else { DR_s = 0; DR_e = 0; (DR_f = 0); } } while (0); break;

  case 0x0c9: do { if (53 < 24 || (2047 - 1023 < 255 - 127) || (1023 < 127 + 24 - 1 && 1023 != 127)) return 0; DR_s = SB_s; (DR_f = SB_f); if ((((SB_e + 1) & 255) > 1)) { DR_e = SB_e + 1023 - 127; do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DR_f += DR_f; else DR_f <<= ((53 - 24)); } while (0); } else { if (SB_e == 0) { do { if (0 && SB_e == 0 && !(SB_f == 0)) { (SB_f = 0); _fex |= (0); } } while (0); if ((SB_f == 0)) DR_e = 0; else if (1023 < 127 + 24 - 1) { _fex |= (0); do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DR_f += DR_f; else DR_f <<= ((53 - 24)); } while (0); DR_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (SB_f); else return 0; } while (0); do { if (__builtin_constant_p (FP_EXTEND_lz + 53 - 64) && (FP_EXTEND_lz + 53 - 64) == 1) DR_f += DR_f; else DR_f <<= (FP_EXTEND_lz + 53 - 64); } while (0); DR_e = (1023 - 127 + 1 + (64 - 24) - FP_EXTEND_lz); } } else { DR_e = 2047; if (!(SB_f == 0)) { if (1 && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _fex |= ((1 << 4) | 0); do { if (__builtin_constant_p ((53 - 24)) && ((53 - 24)) == 1) DR_f += DR_f; else DR_f <<= ((53 - 24)); } while (0); if (1) do { if (0) { (DR_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DR_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DR_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); } } } } while (0); break;
  case 0x0cd: do { if (113 < 24 || (32767 - 16383 < 255 - 127) || (16383 < 127 + 24 - 1 && 16383 != 127)) return 0; QR_s = SB_s; ((QR_f0 = SB_f), (QR_f1 = 0)); if ((((SB_e + 1) & 255) > 1)) { QR_e = SB_e + 16383 - 127; (void) ((((113 - 24)) < 64) ? ({ if (__builtin_constant_p ((113 - 24)) && ((113 - 24)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((113 - 24)) | QR_f0 >> (64 - ((113 - 24))); QR_f0 <<= ((113 - 24)); } 0; }) : ({ QR_f1 = QR_f0 << (((113 - 24)) - 64); QR_f0 = 0; })); } else { if (SB_e == 0) { do { if (0 && SB_e == 0 && !(SB_f == 0)) { (SB_f = 0); _fex |= (0); } } while (0); if ((SB_f == 0)) QR_e = 0; else if (16383 < 127 + 24 - 1) { _fex |= (0); (void) ((((113 - 24)) < 64) ? ({ if (__builtin_constant_p ((113 - 24)) && ((113 - 24)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((113 - 24)) | QR_f0 >> (64 - ((113 - 24))); QR_f0 <<= ((113 - 24)); } 0; }) : ({ QR_f1 = QR_f0 << (((113 - 24)) - 64); QR_f0 = 0; })); QR_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (SB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (SB_f); else return 0; } while (0); (void) (((FP_EXTEND_lz + 113 - 64) < 64) ? ({ if (__builtin_constant_p (FP_EXTEND_lz + 113 - 64) && (FP_EXTEND_lz + 113 - 64) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (FP_EXTEND_lz + 113 - 64) | QR_f0 >> (64 - (FP_EXTEND_lz + 113 - 64)); QR_f0 <<= (FP_EXTEND_lz + 113 - 64); } 0; }) : ({ QR_f1 = QR_f0 << ((FP_EXTEND_lz + 113 - 64) - 64); QR_f0 = 0; })); QR_e = (16383 - 127 + 1 + (64 - 24) - FP_EXTEND_lz); } } else { QR_e = 32767; if (!(SB_f == 0)) { if (1 && ((0) ? ((SB_f) & ((unsigned long) 1 << (24 -2))) : !((SB_f) & ((unsigned long) 1 << (24 -2))))) _fex |= ((1 << 4) | 0); (void) ((((113 - 24)) < 64) ? ({ if (__builtin_constant_p ((113 - 24)) && ((113 - 24)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((113 - 24)) | QR_f0 >> (64 - ((113 - 24))); QR_f0 <<= ((113 - 24)); } 0; }) : ({ QR_f1 = QR_f0 << (((113 - 24)) - 64); QR_f0 = 0; })); if (1) do { if (0) { (QR_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QR_f1 | QR_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QR_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } } } while (0); break;
  case 0x0ce: do { if (113 < 53 || (32767 - 16383 < 2047 - 1023) || (16383 < 1023 + 53 - 1 && 16383 != 1023)) return 0; QR_s = DB_s; ((QR_f0 = DB_f), (QR_f1 = 0)); if ((((DB_e + 1) & 2047) > 1)) { QR_e = DB_e + 16383 - 1023; (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((113 - 53)) | QR_f0 >> (64 - ((113 - 53))); QR_f0 <<= ((113 - 53)); } 0; }) : ({ QR_f1 = QR_f0 << (((113 - 53)) - 64); QR_f0 = 0; })); } else { if (DB_e == 0) { do { if (0 && DB_e == 0 && !(DB_f == 0)) { (DB_f = 0); _fex |= (0); } } while (0); if ((DB_f == 0)) QR_e = 0; else if (16383 < 1023 + 53 - 1) { _fex |= (0); (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((113 - 53)) | QR_f0 >> (64 - ((113 - 53))); QR_f0 <<= ((113 - 53)); } 0; }) : ({ QR_f1 = QR_f0 << (((113 - 53)) - 64); QR_f0 = 0; })); QR_e = 0; if ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)) _fex |= ((1 << 2)); } else { int FP_EXTEND_lz; _fex |= (0); do { if (sizeof (unsigned long) == sizeof (unsigned int)) ((FP_EXTEND_lz)) = __builtin_clz (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long)) ((FP_EXTEND_lz)) = __builtin_clzl (DB_f); else if (sizeof (unsigned long) == sizeof (unsigned long long)) ((FP_EXTEND_lz)) = __builtin_clzll (DB_f); else return 0; } while (0); (void) (((FP_EXTEND_lz + 113 - 64) < 64) ? ({ if (__builtin_constant_p (FP_EXTEND_lz + 113 - 64) && (FP_EXTEND_lz + 113 - 64) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << (FP_EXTEND_lz + 113 - 64) | QR_f0 >> (64 - (FP_EXTEND_lz + 113 - 64)); QR_f0 <<= (FP_EXTEND_lz + 113 - 64); } 0; }) : ({ QR_f1 = QR_f0 << ((FP_EXTEND_lz + 113 - 64) - 64); QR_f0 = 0; })); QR_e = (16383 - 1023 + 1 + (64 - 53) - FP_EXTEND_lz); } } else { QR_e = 32767; if (!(DB_f == 0)) { if (1 && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2) % 64)))) _fex |= ((1 << 4) | 0); (void) ((((113 - 53)) < 64) ? ({ if (__builtin_constant_p ((113 - 53)) && ((113 - 53)) == 1) { QR_f1 = QR_f1 + QR_f1 + (((signed long) (QR_f0)) < 0); QR_f0 += QR_f0; } else { QR_f1 = QR_f1 << ((113 - 53)) | QR_f0 >> (64 - ((113 - 53))); QR_f0 <<= ((113 - 53)); } 0; }) : ({ QR_f1 = QR_f0 << (((113 - 53)) - 64); QR_f0 = 0; })); if (1) do { if (0) { (QR_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QR_f1 | QR_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QR_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } } } while (0); break;
  case 0x0c6: do { if (53 < 24 || (1023 < 127 + 24 - 1 && 1023 != 127)) return 0; SR_s = DB_s; if ((((DB_e + 1) & 2047) > 1)) { SR_e = DB_e + 127 - 1023; if (SR_e >= 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); else { if (SR_e <= 0) { if (SR_e < 1 - 24) { (DB_f = 0); (DB_f) |= 1; } else { (DB_f) |= ((unsigned long) 1 << (53 -1+3) % 64); (DB_f = (DB_f >> ((((3 + 53) - (3 + 24) + 1 - SR_e))) | (__builtin_constant_p ((((3 + 53) - (3 + 24) + 1 - SR_e))) && ((((3 + 53) - (3 + 24) + 1 - SR_e))) == 1 ? DB_f & 1 : (DB_f << (64 - ((((3 + 53) - (3 + 24) + 1 - SR_e))))) != 0))); } SR_e = 0; } else (DB_f = (DB_f >> ((((3 + 53) - (3 + 24)))) | (__builtin_constant_p ((((3 + 53) - (3 + 24)))) && ((((3 + 53) - (3 + 24)))) == 1 ? DB_f & 1 : (DB_f << (64 - ((((3 + 53) - (3 + 24)))))) != 0))); (SR_f = DB_f); } } else { if (DB_e == 0) { do { if (0 && DB_e == 0 && !(DB_f == 0)) { (DB_f = 0); _fex |= (0); } } while (0); SR_e = 0; if ((DB_f == 0)) (SR_f = 0); else { _fex |= (0); if (1023 < 127 + 24 - 1) { (DB_f = (DB_f >> ((((3 + 53) - (3 + 24)))) | (__builtin_constant_p ((((3 + 53) - (3 + 24)))) && ((((3 + 53) - (3 + 24)))) == 1 ? DB_f & 1 : (DB_f << (64 - ((((3 + 53) - (3 + 24)))))) != 0))); (SR_f = DB_f); } else { (SR_f = 0); (SR_f) |= 1; } } } else { SR_e = 255; if ((DB_f == 0)) (SR_f = 0); else { do { if (DB_e == 2047 && !(DB_f == 0) && ((0) ? ((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)) : !((DB_f) & ((unsigned long) 1 << (53 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (DB_f >>= ((3 + 53) - (3 + 24))); (SR_f = DB_f); (SR_f) &= ~(unsigned long) ((1 << 3) - 1); do { if (0) { (SR_f) &= ((unsigned long) 1 << (24 -2+3)) - 1; if ((SR_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); } } else (SR_f) |= ((unsigned long) 1 << (24 -2+3)); } while (0); } } } } while (0); break;
  case 0x0c7: do { if (113 < 24 || (16383 < 127 + 24 - 1 && 16383 != 127)) return 0; SR_s = QB_s; if ((((QB_e + 1) & 32767) > 1)) { SR_e = QB_e + 127 - 16383; if (SR_e >= 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); else { if (SR_e <= 0) { if (SR_e < 1 - 24) { (QB_f0 = 0, QB_f1 = 0); (QB_f0) |= 1; } else { (QB_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); (void) (((((3 + 113) - (3 + 24) + 1 - SR_e)) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (((3 + 113) - (3 + 24) + 1 - SR_e))) | QB_f0 >> (((3 + 113) - (3 + 24) + 1 - SR_e)) | (__builtin_constant_p (((3 + 113) - (3 + 24) + 1 - SR_e)) && (((3 + 113) - (3 + 24) + 1 - SR_e)) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (((3 + 113) - (3 + 24) + 1 - SR_e)))) != 0)); QB_f1 >>= (((3 + 113) - (3 + 24) + 1 - SR_e)); }) : ({ QB_f0 = (QB_f1 >> ((((3 + 113) - (3 + 24) + 1 - SR_e)) - 64) | ((((((3 + 113) - (3 + 24) + 1 - SR_e)) == 64 ? 0 : (QB_f1 << (2*64 - (((3 + 113) - (3 + 24) + 1 - SR_e))))) | QB_f0) != 0)); QB_f1 = 0; })); } SR_e = 0; } else (void) (((((3 + 113) - (3 + 24))) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (((3 + 113) - (3 + 24)))) | QB_f0 >> (((3 + 113) - (3 + 24))) | (__builtin_constant_p (((3 + 113) - (3 + 24))) && (((3 + 113) - (3 + 24))) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (((3 + 113) - (3 + 24))))) != 0)); QB_f1 >>= (((3 + 113) - (3 + 24))); }) : ({ QB_f0 = (QB_f1 >> ((((3 + 113) - (3 + 24))) - 64) | ((((((3 + 113) - (3 + 24))) == 64 ? 0 : (QB_f1 << (2*64 - (((3 + 113) - (3 + 24)))))) | QB_f0) != 0)); QB_f1 = 0; })); (SR_f = QB_f0); } } else { if (QB_e == 0) { do { if (0 && QB_e == 0 && !((QB_f1 | QB_f0) == 0)) { (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } } while (0); SR_e = 0; if (((QB_f1 | QB_f0) == 0)) (SR_f = 0); else { _fex |= (0); if (16383 < 127 + 24 - 1) { (void) (((((3 + 113) - (3 + 24))) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (((3 + 113) - (3 + 24)))) | QB_f0 >> (((3 + 113) - (3 + 24))) | (__builtin_constant_p (((3 + 113) - (3 + 24))) && (((3 + 113) - (3 + 24))) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (((3 + 113) - (3 + 24))))) != 0)); QB_f1 >>= (((3 + 113) - (3 + 24))); }) : ({ QB_f0 = (QB_f1 >> ((((3 + 113) - (3 + 24))) - 64) | ((((((3 + 113) - (3 + 24))) == 64 ? 0 : (QB_f1 << (2*64 - (((3 + 113) - (3 + 24)))))) | QB_f0) != 0)); QB_f1 = 0; })); (SR_f = QB_f0); } else { (SR_f = 0); (SR_f) |= 1; } } } else { SR_e = 255; if (((QB_f1 | QB_f0) == 0)) (SR_f = 0); else { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (void) (((((3 + 113) - (3 + 24))) < 64) ? ({ QB_f0 = QB_f0 >> (((3 + 113) - (3 + 24))) | QB_f1 << (64 - (((3 + 113) - (3 + 24)))); QB_f1 >>= (((3 + 113) - (3 + 24))); }) : ({ QB_f0 = QB_f1 >> ((((3 + 113) - (3 + 24))) - 64); QB_f1 = 0; })); (SR_f = QB_f0); (SR_f) &= ~(unsigned long) ((1 << 3) - 1); do { if (0) { (SR_f) &= ((unsigned long) 1 << (24 -2+3)) - 1; if ((SR_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) SR_f += SR_f; else SR_f <<= (3); } while (0); } } else (SR_f) |= ((unsigned long) 1 << (24 -2+3)); } while (0); } } } } while (0); break;
  case 0x0cb: do { if (113 < 53 || (16383 < 1023 + 53 - 1 && 16383 != 1023)) return 0; DR_s = QB_s; if ((((QB_e + 1) & 32767) > 1)) { DR_e = QB_e + 1023 - 16383; if (DR_e >= 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); else { if (DR_e <= 0) { if (DR_e < 1 - 53) { (QB_f0 = 0, QB_f1 = 0); (QB_f0) |= 1; } else { (QB_f1) |= ((unsigned long) 1 << (113 -1+3) % 64); (void) (((((3 + 113) - (3 + 53) + 1 - DR_e)) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (((3 + 113) - (3 + 53) + 1 - DR_e))) | QB_f0 >> (((3 + 113) - (3 + 53) + 1 - DR_e)) | (__builtin_constant_p (((3 + 113) - (3 + 53) + 1 - DR_e)) && (((3 + 113) - (3 + 53) + 1 - DR_e)) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (((3 + 113) - (3 + 53) + 1 - DR_e)))) != 0)); QB_f1 >>= (((3 + 113) - (3 + 53) + 1 - DR_e)); }) : ({ QB_f0 = (QB_f1 >> ((((3 + 113) - (3 + 53) + 1 - DR_e)) - 64) | ((((((3 + 113) - (3 + 53) + 1 - DR_e)) == 64 ? 0 : (QB_f1 << (2*64 - (((3 + 113) - (3 + 53) + 1 - DR_e))))) | QB_f0) != 0)); QB_f1 = 0; })); } DR_e = 0; } else (void) (((((3 + 113) - (3 + 53))) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (((3 + 113) - (3 + 53)))) | QB_f0 >> (((3 + 113) - (3 + 53))) | (__builtin_constant_p (((3 + 113) - (3 + 53))) && (((3 + 113) - (3 + 53))) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (((3 + 113) - (3 + 53))))) != 0)); QB_f1 >>= (((3 + 113) - (3 + 53))); }) : ({ QB_f0 = (QB_f1 >> ((((3 + 113) - (3 + 53))) - 64) | ((((((3 + 113) - (3 + 53))) == 64 ? 0 : (QB_f1 << (2*64 - (((3 + 113) - (3 + 53)))))) | QB_f0) != 0)); QB_f1 = 0; })); (DR_f = QB_f0); } } else { if (QB_e == 0) { do { if (0 && QB_e == 0 && !((QB_f1 | QB_f0) == 0)) { (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } } while (0); DR_e = 0; if (((QB_f1 | QB_f0) == 0)) (DR_f = 0); else { _fex |= (0); if (16383 < 1023 + 53 - 1) { (void) (((((3 + 113) - (3 + 53))) < 64) ? ({ QB_f0 = (QB_f1 << (64 - (((3 + 113) - (3 + 53)))) | QB_f0 >> (((3 + 113) - (3 + 53))) | (__builtin_constant_p (((3 + 113) - (3 + 53))) && (((3 + 113) - (3 + 53))) == 1 ? QB_f0 & 1 : (QB_f0 << (64 - (((3 + 113) - (3 + 53))))) != 0)); QB_f1 >>= (((3 + 113) - (3 + 53))); }) : ({ QB_f0 = (QB_f1 >> ((((3 + 113) - (3 + 53))) - 64) | ((((((3 + 113) - (3 + 53))) == 64 ? 0 : (QB_f1 << (2*64 - (((3 + 113) - (3 + 53)))))) | QB_f0) != 0)); QB_f1 = 0; })); (DR_f = QB_f0); } else { (DR_f = 0); (DR_f) |= 1; } } } else { DR_e = 2047; if (((QB_f1 | QB_f0) == 0)) (DR_f = 0); else { do { if (QB_e == 32767 && !((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2+3) % 64)))) _fex |= ((1 << 4) | 0); } while (0); (void) (((((3 + 113) - (3 + 53))) < 64) ? ({ QB_f0 = QB_f0 >> (((3 + 113) - (3 + 53))) | QB_f1 << (64 - (((3 + 113) - (3 + 53)))); QB_f1 >>= (((3 + 113) - (3 + 53))); }) : ({ QB_f0 = QB_f1 >> ((((3 + 113) - (3 + 53))) - 64); QB_f1 = 0; })); (DR_f = QB_f0); (DR_f) &= ~(unsigned long) ((1 << 3) - 1); do { if (0) { (DR_f) &= ((unsigned long) 1 << (53 -2+3) % 64) - 1; if ((DR_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); do { if (__builtin_constant_p (3) && (3) == 1) DR_f += DR_f; else DR_f <<= (3); } while (0); } } else (DR_f) |= ((unsigned long) 1 << (53 -2+3) % 64); } while (0); } } } } while (0); break;

  case 0x053:
  case 0x057:
   do { do { if (0 != 0) { if (0) { do { if (0 &&
 QB_e
# 506 "arch/sparc/math-emu/math_64.c"
   == 0 && !
 ((QB_f1 | QB_f0) == 0)) { (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } } while (0); do { if (0 && QA_e == 0 && !((QA_f1 | QA_f0) == 0)) { (QA_f0 = 0, QA_f1 = 0); _fex |= (0); } } while (0); } else { if ((QB_e == 0 && !((QB_f1 | QB_f0) == 0)) || (QA_e == 0 && !((QA_f1 | QA_f0) == 0))) _fex |= (0); } } } while (0); if ((QB_e == 32767 && !((QB_f1 | QB_f0) == 0)) || (QA_e == 32767 && !((QA_f1 | QA_f0) == 0))) { ((XR)) = ((3)); do { if (((((insn >> 5) & 0x1ff) == 0x057 ? 2 : 1))) { if (0 || 0) { if ((((((insn >> 5) & 0x1ff) == 0x057 ? 2 : 1))) == 2) _fex |= ((1 << 4) | 0); if (({ int _FP_ISSIGNAN_ret = 0; if (QB_e == 32767) { if (!((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; }) || ({ int _FP_ISSIGNAN_ret = 0; if (QA_e == 32767) { if (!((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) _fex |= ((1 << 4) | 0); } else if ((((((insn >> 5) & 0x1ff) == 0x057 ? 2 : 1))) == 2 || ({ int _FP_ISSIGNAN_ret = 0; if (QB_e == 32767) { if (!((QB_f1 | QB_f0) == 0) && ((0) ? ((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QB_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; }) || ({ int _FP_ISSIGNAN_ret = 0; if (QA_e == 32767) { if (!((QA_f1 | QA_f0) == 0) && ((0) ? ((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)) : !((QA_f1) & ((unsigned long) 1 << (113 -2) % 64)))) _FP_ISSIGNAN_ret = 1; } _FP_ISSIGNAN_ret; })) _fex |= ((1 << 4)); } } while (0); } else { int _FP_CMP_is_zero_x; int _FP_CMP_is_zero_y; do { if (0 == 0) { do { if (0 && QB_e == 0 && !((QB_f1 | QB_f0) == 0)) { (QB_f0 = 0, QB_f1 = 0); _fex |= (0); } } while (0); do { if (0 && QA_e == 0 && !((QA_f1 | QA_f0) == 0)) { (QA_f0 = 0, QA_f1 = 0); _fex |= (0); } } while (0); } } while (0); _FP_CMP_is_zero_x = (!QB_e && ((QB_f1 | QB_f0) == 0)) ? 1 : 0; _FP_CMP_is_zero_y = (!QA_e && ((QA_f1 | QA_f0) == 0)) ? 1 : 0; if (_FP_CMP_is_zero_x && _FP_CMP_is_zero_y) ((XR)) = 0; else if (_FP_CMP_is_zero_x) ((XR)) = QA_s ? 1 : -1; else if (_FP_CMP_is_zero_y) ((XR)) = QB_s ? -1 : 1; else if (QB_s != QA_s) ((XR)) = QB_s ? -1 : 1; else if (QB_e > QA_e) ((XR)) = QB_s ? -1 : 1; else if (QB_e < QA_e) ((XR)) = QB_s ? 1 : -1; else if ((QB_f1 > QA_f1 || (QB_f1 == QA_f1 && QB_f0 > QA_f0))) ((XR)) = QB_s ? -1 : 1; else if ((QA_f1 > QB_f1 || (QA_f1 == QB_f1 && QA_f0 > QB_f0))) ((XR)) = QB_s ? 1 : -1; else ((XR)) = 0; } } while (0);
  }
  if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) {
   switch ((type >> 8) & 0xf) {
   case 0: xfsr = (current_thread_info_reg)->xfsr[0];
    if (XR == -1) XR = 2;
    switch (freg & 3) {

    case 0: xfsr &= ~0xc00; xfsr |= (XR << 10); break;
    case 1: xfsr &= ~0x300000000UL; xfsr |= (XR << 32); break;
    case 2: xfsr &= ~0xc00000000UL; xfsr |= (XR << 34); break;
    case 3: xfsr &= ~0x3000000000UL; xfsr |= (XR << 36); break;
    }
    (current_thread_info_reg)->xfsr[0] = xfsr;
    break;
   case 1: rd->s = IR; break;
   case 2: rd->d = XR; break;
   case 5: do { if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_S *_FP_PACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rd)); _FP_PACK_RAW_1_P_flo->bits.frac = SR_f; _FP_PACK_RAW_1_P_flo->bits.exp = SR_e; _FP_PACK_RAW_1_P_flo->bits.sign = SR_s; } while (0); } while (0); break;
   case 6: do { if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_D *_FP_PACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rd)); _FP_PACK_RAW_1_P_flo->bits.frac = DR_f; _FP_PACK_RAW_1_P_flo->bits.exp = DR_e; _FP_PACK_RAW_1_P_flo->bits.sign = DR_s; } while (0); } while (0); break;
   case 7: do { if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_Q *_FP_PACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rd)); _FP_PACK_RAW_2_P_flo->bits.frac0 = QR_f0; _FP_PACK_RAW_2_P_flo->bits.frac1 = QR_f1; _FP_PACK_RAW_2_P_flo->bits.exp = QR_e; _FP_PACK_RAW_2_P_flo->bits.sign = QR_s; } while (0); } while (0); break;
   case 9: do { do { int _FP_PACK_SEMIRAW_is_tiny = SR_e == 0 && !(SR_f == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f = 0; (_FP_PACK_SEMIRAW_T_f = SR_f); _FP_PACK_SEMIRAW_T_s = SR_s; _FP_PACK_SEMIRAW_T_e = SR_e; do { if (__builtin_constant_p (1) && (1) == 1) _FP_PACK_SEMIRAW_T_f += _FP_PACK_SEMIRAW_T_f; else _FP_PACK_SEMIRAW_T_f <<= (1); } while (0); do { if ((_FP_PACK_SEMIRAW_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_SEMIRAW_T_f & ((unsigned long) 1 << ((3 + 24))))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((SR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((SR_f) & 15) != ((unsigned long) 1 << 2)) (SR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((SR_f) & (((unsigned long) 1 << ((3 + 24))) >> 1)) { (SR_f) &= ~(((unsigned long) 1 << ((3 + 24))) >> 1); SR_e++; if (SR_e == 255) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !SR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && SR_s)) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (SR_f >>= 3); if (SR_e == 255 && !(SR_f == 0)) { if (!1) { (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); SR_s = 0; } else do { if (0) { (SR_f) &= ((unsigned long) 1 << (24 -2)) - 1; if ((SR_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); } } else (SR_f) |= ((unsigned long) 1 << (24 -2)); } while (0); } } while (0); if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_S *_FP_PACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rd)); _FP_PACK_RAW_1_P_flo->bits.frac = SR_f; _FP_PACK_RAW_1_P_flo->bits.exp = SR_e; _FP_PACK_RAW_1_P_flo->bits.sign = SR_s; } while (0); } while (0); break;
   case 10: do { do { int _FP_PACK_SEMIRAW_is_tiny = DR_e == 0 && !(DR_f == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f = 0; (_FP_PACK_SEMIRAW_T_f = DR_f); _FP_PACK_SEMIRAW_T_s = DR_s; _FP_PACK_SEMIRAW_T_e = DR_e; do { if (__builtin_constant_p (1) && (1) == 1) _FP_PACK_SEMIRAW_T_f += _FP_PACK_SEMIRAW_T_f; else _FP_PACK_SEMIRAW_T_f <<= (1); } while (0); do { if ((_FP_PACK_SEMIRAW_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f) & 7)) (_FP_PACK_SEMIRAW_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_SEMIRAW_T_f & ((unsigned long) 1 << (3 + 53) % 64))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((DR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((DR_f) & 15) != ((unsigned long) 1 << 2)) (DR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((DR_f) & (((unsigned long) 1 << (3 + 53) % 64) >> 1)) { (DR_f) &= ~(((unsigned long) 1 << (3 + 53) % 64) >> 1); DR_e++; if (DR_e == 2047) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !DR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && DR_s)) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (DR_f >>= 3); if (DR_e == 2047 && !(DR_f == 0)) { if (!1) { (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); DR_s = 0; } else do { if (0) { (DR_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DR_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DR_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); } } while (0); if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_D *_FP_PACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rd)); _FP_PACK_RAW_1_P_flo->bits.frac = DR_f; _FP_PACK_RAW_1_P_flo->bits.exp = DR_e; _FP_PACK_RAW_1_P_flo->bits.sign = DR_s; } while (0); } while (0); break;
   case 11: do { do { int _FP_PACK_SEMIRAW_is_tiny = QR_e == 0 && !((QR_f1 | QR_f0) == 0); if (0 && _FP_PACK_SEMIRAW_is_tiny) { long _FP_PACK_SEMIRAW_T_c __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_s __attribute__ ((unused)) = 0; long _FP_PACK_SEMIRAW_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_SEMIRAW_T_f0 = 0, _FP_PACK_SEMIRAW_T_f1 = 0; (_FP_PACK_SEMIRAW_T_f0 = QR_f0, _FP_PACK_SEMIRAW_T_f1 = QR_f1); _FP_PACK_SEMIRAW_T_s = QR_s; _FP_PACK_SEMIRAW_T_e = QR_e; (void) (((1) < 64) ? ({ if (__builtin_constant_p (1) && (1) == 1) { _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f1 + _FP_PACK_SEMIRAW_T_f1 + (((signed long) (_FP_PACK_SEMIRAW_T_f0)) < 0); _FP_PACK_SEMIRAW_T_f0 += _FP_PACK_SEMIRAW_T_f0; } else { _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f1 << (1) | _FP_PACK_SEMIRAW_T_f0 >> (64 - (1)); _FP_PACK_SEMIRAW_T_f0 <<= (1); } 0; }) : ({ _FP_PACK_SEMIRAW_T_f1 = _FP_PACK_SEMIRAW_T_f0 << ((1) - 64); _FP_PACK_SEMIRAW_T_f0 = 0; })); do { if ((_FP_PACK_SEMIRAW_T_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_SEMIRAW_T_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (_FP_PACK_SEMIRAW_T_s && ((_FP_PACK_SEMIRAW_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_SEMIRAW_T_f1), "=&r" (_FP_PACK_SEMIRAW_T_f0) : "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_SEMIRAW_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (((_FP_PACK_SEMIRAW_T_f1) & ((unsigned long) 1 << ((3 + 113) % 64)))) _FP_PACK_SEMIRAW_is_tiny = 0; } do { if ((QR_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((QR_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (_FP_PACK_SEMIRAW_is_tiny) { if (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2))) _fex |= ((1 << 2)); } if ((QR_f1) & (((unsigned long) 1 << ((3 + 113) % 64)) >> 1)) { (QR_f1) &= ~(((unsigned long) 1 << ((3 + 113) % 64)) >> 1); QR_e++; if (QR_e == 32767) do { if ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 0 || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 2 && !QR_s) || ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3) == 3 && QR_s)) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 0)); _fex |= ((1 << 3)); } while (0); } (void) (((3) < 64) ? ({ QR_f0 = QR_f0 >> (3) | QR_f1 << (64 - (3)); QR_f1 >>= (3); }) : ({ QR_f0 = QR_f1 >> ((3) - 64); QR_f1 = 0; })); if (QR_e == 32767 && !((QR_f1 | QR_f0) == 0)) { if (!1) { (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); QR_s = 0; } else do { if (0) { (QR_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QR_f1 | QR_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QR_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); } } while (0); if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_Q *_FP_PACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rd)); _FP_PACK_RAW_2_P_flo->bits.frac0 = QR_f0; _FP_PACK_RAW_2_P_flo->bits.frac1 = QR_f1; _FP_PACK_RAW_2_P_flo->bits.exp = QR_e; _FP_PACK_RAW_2_P_flo->bits.sign = QR_s; } while (0); } while (0); break;
   case 13: do { do { switch (SR_c) { case 0: SR_e += 127; if (SR_e > 0) { do { if ((SR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((SR_f) & 15) != ((unsigned long) 1 << 2)) (SR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((SR_f & ((unsigned long) 1 << ((3 + 24))))) { (SR_f &= ~((unsigned long) 1 << ((3 + 24)))); SR_e++; } (SR_f >>= 3); if (SR_e >= 255) { switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: SR_c = 2; break; case 2: if (!SR_s) SR_c = 2; break; case 3: if (SR_s) SR_c = 2; break; } if (SR_c == 2) { SR_e = 255; (SR_f = 0); } else { SR_e = 255 - 1; (SR_f = (~(signed long) 0)); } _fex |= ((1 << 3)); _fex |= ((1 << 0)); } } else { int _FP_PACK_CANONICAL_is_tiny = 1; if (0 && SR_e == 0) { long _FP_PACK_CANONICAL_T_c __attribute__ ((unused)) = 0; long _FP_PACK_CANONICAL_T_s __attribute__ ((unused)) = 0; long _FP_PACK_CANONICAL_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_CANONICAL_T_f = 0; (_FP_PACK_CANONICAL_T_f = SR_f); _FP_PACK_CANONICAL_T_s = SR_s; _FP_PACK_CANONICAL_T_e = SR_e; do { if ((_FP_PACK_CANONICAL_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_CANONICAL_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_CANONICAL_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_CANONICAL_T_s && ((_FP_PACK_CANONICAL_T_f) & 7)) (_FP_PACK_CANONICAL_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_CANONICAL_T_s && ((_FP_PACK_CANONICAL_T_f) & 7)) (_FP_PACK_CANONICAL_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_CANONICAL_T_f & ((unsigned long) 1 << ((3 + 24))))) _FP_PACK_CANONICAL_is_tiny = 0; } SR_e = -SR_e + 1; if (SR_e <= (3 + 24)) { (SR_f = (SR_f >> ((SR_e)) | (__builtin_constant_p ((SR_e)) && ((SR_e)) == 1 ? SR_f & 1 : (SR_f << (64 - ((SR_e)))) != 0))); do { if ((SR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((SR_f) & 15) != ((unsigned long) 1 << 2)) (SR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((SR_f) & (((unsigned long) 1 << ((3 + 24))) >> 1)) { SR_e = 1; (SR_f = 0); _fex |= ((1 << 0)); } else { SR_e = 0; (SR_f >>= 3); } if (_FP_PACK_CANONICAL_is_tiny && (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)))) _fex |= ((1 << 2)); } else { SR_e = 0; if (!(SR_f == 0)) { (SR_f = 1); do { if ((SR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((SR_f) & 15) != ((unsigned long) 1 << 2)) (SR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (SR_s && ((SR_f) & 7)) (SR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); (SR_f) >>= (3); } _fex |= ((1 << 2)); } } break; case 1: SR_e = 0; (SR_f = 0); break; case 2: SR_e = 255; (SR_f = 0); break; case 3: SR_e = 255; if (!1) { (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); SR_s = 0; } else do { if (0) { (SR_f) &= ((unsigned long) 1 << (24 -2)) - 1; if ((SR_f == 0)) { SR_s = 0; (SR_f = ((((unsigned long) 1 << (24 -2)) << 1) - 1)); } } else (SR_f) |= ((unsigned long) 1 << (24 -2)); } while (0); break; } } while (0); if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_S *_FP_PACK_RAW_1_P_flo = (union _FP_UNION_S *) ((rd)); _FP_PACK_RAW_1_P_flo->bits.frac = SR_f; _FP_PACK_RAW_1_P_flo->bits.exp = SR_e; _FP_PACK_RAW_1_P_flo->bits.sign = SR_s; } while (0); } while (0); break;
   case 14: do { do { switch (DR_c) { case 0: DR_e += 1023; if (DR_e > 0) { do { if ((DR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((DR_f) & 15) != ((unsigned long) 1 << 2)) (DR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((DR_f & ((unsigned long) 1 << (3 + 53) % 64))) { (DR_f &= ~((unsigned long) 1 << (3 + 53) % 64)); DR_e++; } (DR_f >>= 3); if (DR_e >= 2047) { switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: DR_c = 2; break; case 2: if (!DR_s) DR_c = 2; break; case 3: if (DR_s) DR_c = 2; break; } if (DR_c == 2) { DR_e = 2047; (DR_f = 0); } else { DR_e = 2047 - 1; (DR_f = (~(signed long) 0)); } _fex |= ((1 << 3)); _fex |= ((1 << 0)); } } else { int _FP_PACK_CANONICAL_is_tiny = 1; if (0 && DR_e == 0) { long _FP_PACK_CANONICAL_T_c __attribute__ ((unused)) = 0; long _FP_PACK_CANONICAL_T_s __attribute__ ((unused)) = 0; long _FP_PACK_CANONICAL_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_CANONICAL_T_f = 0; (_FP_PACK_CANONICAL_T_f = DR_f); _FP_PACK_CANONICAL_T_s = DR_s; _FP_PACK_CANONICAL_T_e = DR_e; do { if ((_FP_PACK_CANONICAL_T_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_CANONICAL_T_f) & 15) != ((unsigned long) 1 << 2)) (_FP_PACK_CANONICAL_T_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_CANONICAL_T_s && ((_FP_PACK_CANONICAL_T_f) & 7)) (_FP_PACK_CANONICAL_T_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (_FP_PACK_CANONICAL_T_s && ((_FP_PACK_CANONICAL_T_f) & 7)) (_FP_PACK_CANONICAL_T_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((_FP_PACK_CANONICAL_T_f & ((unsigned long) 1 << (3 + 53) % 64))) _FP_PACK_CANONICAL_is_tiny = 0; } DR_e = -DR_e + 1; if (DR_e <= (3 + 53)) { (DR_f = (DR_f >> ((DR_e)) | (__builtin_constant_p ((DR_e)) && ((DR_e)) == 1 ? DR_f & 1 : (DR_f << (64 - ((DR_e)))) != 0))); do { if ((DR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((DR_f) & 15) != ((unsigned long) 1 << 2)) (DR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); if ((DR_f) & (((unsigned long) 1 << (3 + 53) % 64) >> 1)) { DR_e = 1; (DR_f = 0); _fex |= ((1 << 0)); } else { DR_e = 0; (DR_f >>= 3); } if (_FP_PACK_CANONICAL_is_tiny && (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)))) _fex |= ((1 << 2)); } else { DR_e = 0; if (!(DR_f == 0)) { (DR_f = 1); do { if ((DR_f) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((DR_f) & 15) != ((unsigned long) 1 << 2)) (DR_f += ((unsigned long) 1 << 2)); } while (0); break; case 1: (void) 0; break; case 2: do { if (!DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; case 3: do { if (DR_s && ((DR_f) & 7)) (DR_f += ((unsigned long) 1 << 3)); } while (0); break; } } } while (0); (DR_f) >>= (3); } _fex |= ((1 << 2)); } } break; case 1: DR_e = 0; (DR_f = 0); break; case 2: DR_e = 2047; (DR_f = 0); break; case 3: DR_e = 2047; if (!1) { (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); DR_s = 0; } else do { if (0) { (DR_f) &= ((unsigned long) 1 << (53 -2) % 64) - 1; if ((DR_f == 0)) { DR_s = 0; (DR_f = ((((unsigned long) 1 << (53 -2) % 64) << 1) - 1)); } } else (DR_f) |= ((unsigned long) 1 << (53 -2) % 64); } while (0); break; } } while (0); if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_D *_FP_PACK_RAW_1_P_flo = (union _FP_UNION_D *) ((rd)); _FP_PACK_RAW_1_P_flo->bits.frac = DR_f; _FP_PACK_RAW_1_P_flo->bits.exp = DR_e; _FP_PACK_RAW_1_P_flo->bits.sign = DR_s; } while (0); } while (0); break;
   case 15: do { do { switch (QR_c) { case 0: QR_e += 16383; if (QR_e > 0) { do { if ((QR_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((QR_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (((QR_f1) & ((unsigned long) 1 << ((3 + 113) % 64)))) { ((QR_f1) &= ~((unsigned long) 1 << ((3 + 113) % 64))); QR_e++; } (void) (((3) < 64) ? ({ QR_f0 = QR_f0 >> (3) | QR_f1 << (64 - (3)); QR_f1 >>= (3); }) : ({ QR_f0 = QR_f1 >> ((3) - 64); QR_f1 = 0; })); if (QR_e >= 32767) { switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: QR_c = 2; break; case 2: if (!QR_s) QR_c = 2; break; case 3: if (QR_s) QR_c = 2; break; } if (QR_c == 2) { QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); } else { QR_e = 32767 - 1; (QR_f0 = (~(signed long) 0), QR_f1 = (~(signed long) 0)); } _fex |= ((1 << 3)); _fex |= ((1 << 0)); } } else { int _FP_PACK_CANONICAL_is_tiny = 1; if (0 && QR_e == 0) { long _FP_PACK_CANONICAL_T_c __attribute__ ((unused)) = 0; long _FP_PACK_CANONICAL_T_s __attribute__ ((unused)) = 0; long _FP_PACK_CANONICAL_T_e __attribute__ ((unused)) = 0; unsigned long _FP_PACK_CANONICAL_T_f0 = 0, _FP_PACK_CANONICAL_T_f1 = 0; (_FP_PACK_CANONICAL_T_f0 = QR_f0, _FP_PACK_CANONICAL_T_f1 = QR_f1); _FP_PACK_CANONICAL_T_s = QR_s; _FP_PACK_CANONICAL_T_e = QR_e; do { if ((_FP_PACK_CANONICAL_T_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((_FP_PACK_CANONICAL_T_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_CANONICAL_T_f1), "=&r" (_FP_PACK_CANONICAL_T_f0) : "r" ((UDItype)(_FP_PACK_CANONICAL_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_CANONICAL_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!_FP_PACK_CANONICAL_T_s && ((_FP_PACK_CANONICAL_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_CANONICAL_T_f1), "=&r" (_FP_PACK_CANONICAL_T_f0) : "r" ((UDItype)(_FP_PACK_CANONICAL_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_CANONICAL_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (_FP_PACK_CANONICAL_T_s && ((_FP_PACK_CANONICAL_T_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (_FP_PACK_CANONICAL_T_f1), "=&r" (_FP_PACK_CANONICAL_T_f0) : "r" ((UDItype)(_FP_PACK_CANONICAL_T_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(_FP_PACK_CANONICAL_T_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if (((_FP_PACK_CANONICAL_T_f1) & ((unsigned long) 1 << ((3 + 113) % 64)))) _FP_PACK_CANONICAL_is_tiny = 0; } QR_e = -QR_e + 1; if (QR_e <= (3 + 113)) { (void) (((QR_e) < 64) ? ({ QR_f0 = (QR_f1 << (64 - (QR_e)) | QR_f0 >> (QR_e) | (__builtin_constant_p (QR_e) && (QR_e) == 1 ? QR_f0 & 1 : (QR_f0 << (64 - (QR_e))) != 0)); QR_f1 >>= (QR_e); }) : ({ QR_f0 = (QR_f1 >> ((QR_e) - 64) | ((((QR_e) == 64 ? 0 : (QR_f1 << (2*64 - (QR_e)))) | QR_f0) != 0)); QR_f1 = 0; })); do { if ((QR_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((QR_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); if ((QR_f1) & (((unsigned long) 1 << ((3 + 113) % 64)) >> 1)) { QR_e = 1; (QR_f0 = 0, QR_f1 = 0); _fex |= ((1 << 0)); } else { QR_e = 0; (void) (((3) < 64) ? ({ QR_f0 = QR_f0 >> (3) | QR_f1 << (64 - (3)); QR_f1 >>= (3); }) : ({ QR_f0 = QR_f1 >> ((3) - 64); QR_f1 = 0; })); } if (_FP_PACK_CANONICAL_is_tiny && (((_fex) & (1 << 0)) || ((((current_thread_info_reg)->xfsr[0] >> 23) & 0x1f) & (1 << 2)))) _fex |= ((1 << 2)); } else { QR_e = 0; if (!((QR_f1 | QR_f0) == 0)) { (QR_f0 = 1, QR_f1 = 0); do { if ((QR_f0) & 7) { _fex |= ((1 << 0)); switch ((((current_thread_info_reg)->xfsr[0] >> 30) & 0x3)) { case 0: do { if (((QR_f0) & 15) != ((unsigned long) 1 << 2)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 2))) : "cc"); } while (0); break; case 1: (void) 0; break; case 2: do { if (!QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; case 3: do { if (QR_s && ((QR_f0) & 7)) __asm__ ("addcc %4,%5,%1\n\t" "add %2,%3,%0\n\t" "bcs,a,pn %%xcc, 1f\n\t" "add %0, 1, %0\n" "1:" : "=r" (QR_f1), "=&r" (QR_f0) : "r" ((UDItype)(QR_f1)), "r" ((UDItype)(0)), "r" ((UDItype)(QR_f0)), "r" ((UDItype)(((unsigned long) 1 << 3))) : "cc"); } while (0); break; } } } while (0); (QR_f0) >>= (3); } _fex |= ((1 << 2)); } } break; case 1: QR_e = 0; (QR_f0 = 0, QR_f1 = 0); break; case 2: QR_e = 32767; (QR_f0 = 0, QR_f1 = 0); break; case 3: QR_e = 32767; if (!1) { (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); QR_s = 0; } else do { if (0) { (QR_f1) &= ((unsigned long) 1 << (113 -2) % 64) - 1; if (((QR_f1 | QR_f0) == 0)) { QR_s = 0; (QR_f0 = -1, QR_f1 = ((((unsigned long) 1 << (113 -2) % 64) << 1) - 1)); } } else (QR_f1) |= ((unsigned long) 1 << (113 -2) % 64); } while (0); break; } } while (0); if (!(((current_thread_info_reg)->xfsr[0] >> 23) & _fex)) do { union _FP_UNION_Q *_FP_PACK_RAW_2_P_flo = (union _FP_UNION_Q *) ((rd)); _FP_PACK_RAW_2_P_flo->bits.frac0 = QR_f0; _FP_PACK_RAW_2_P_flo->bits.frac1 = QR_f1; _FP_PACK_RAW_2_P_flo->bits.exp = QR_e; _FP_PACK_RAW_2_P_flo->bits.sign = QR_s; } while (0); } while (0); break;
   }
  }

  if(_fex != 0)
   return record_exception(regs, _fex);


  (current_thread_info_reg)->xfsr[0] &= ~((0x1fUL << 0UL));
  regs->tpc = regs->tnpc;
  regs->tnpc += 4;
  return 1;
 }
err: return 0;
}

[-- Attachment #3: Type: text/plain, Size: 150 bytes --]

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
  2015-02-19 18:21   ` David Miller
  (?)
@ 2015-02-19 18:40     ` Joseph Myers
  -1 siblings, 0 replies; 20+ messages in thread
From: Joseph Myers @ 2015-02-19 18:40 UTC (permalink / raw)
  To: David Miller
  Cc: linux-s390, linux-sh, linux-kernel, linux-alpha, sparclinux,
	linuxppc-dev, kkojima

[-- Attachment #1: Type: text/plain, Size: 1794 bytes --]

On Thu, 19 Feb 2015, David Miller wrote:

> From: Joseph Myers <joseph@codesourcery.com>
> Date: Fri, 6 Feb 2015 17:25:29 +0000
> 
> > * On SPARC, comparisons now use raw unpacking (this should not in fact
> >   change how the emulation behaves, just make it more efficient).
> 
> I did a sparc64 test build and it failed like so:
> 
> arch/sparc/math-emu/math_64.c: In function ‘do_mathemu’:
> arch/sparc/math-emu/math_64.c:487:1: error: expected expression before ‘return’
> arch/sparc/math-emu/math_64.c:488:1: error: expected expression before ‘return’
> arch/sparc/math-emu/math_64.c:490:1: error: expected expression before ‘return’
> arch/sparc/math-emu/math_64.c:491:1: error: expected expression before ‘return’
> arch/sparc/math-emu/math_64.c:495:1: error: expected expression before ‘return’
> 
> I'm attaching a CPP processed math_64.c for your convenience:

Please try this patch on top of the previous one.  The way abort is 
redefined in the kernel code doesn't work for one place using it in an 
expression; this patch changes a comma expression to a statement 
expression.  This didn't appear in my powerpc testing because the powerpc 
emulation never uses FP_FROM_INT; I'm not sure how Kaz's sh testing 
avoided the problem appearing there.

diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index b9f5e1a..8c059c3 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -1818,7 +1818,7 @@
 			 X##_e = (_FP_EXPBIAS_##fs + 2 * _FP_W_TYPE_SIZE - 1 \
 				  - _FP_FROM_INT_lz);			\
 		       })						\
-		     : (abort (), 0)));					\
+		     : ({ abort (); 0; })));				\
 									\
 	  if ((rsize) - 1 + _FP_EXPBIAS_##fs >= _FP_EXPMAX_##fs		\
 	      && X##_e >= _FP_EXPMAX_##fs)				\

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-19 18:40     ` Joseph Myers
  0 siblings, 0 replies; 20+ messages in thread
From: Joseph Myers @ 2015-02-19 18:40 UTC (permalink / raw)
  To: David Miller
  Cc: linux-kernel, linux-alpha, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, kkojima

[-- Attachment #1: Type: text/plain, Size: 1794 bytes --]

On Thu, 19 Feb 2015, David Miller wrote:

> From: Joseph Myers <joseph@codesourcery.com>
> Date: Fri, 6 Feb 2015 17:25:29 +0000
> 
> > * On SPARC, comparisons now use raw unpacking (this should not in fact
> >   change how the emulation behaves, just make it more efficient).
> 
> I did a sparc64 test build and it failed like so:
> 
> arch/sparc/math-emu/math_64.c: In function ‘do_mathemu’:
> arch/sparc/math-emu/math_64.c:487:1: error: expected expression before ‘return’
> arch/sparc/math-emu/math_64.c:488:1: error: expected expression before ‘return’
> arch/sparc/math-emu/math_64.c:490:1: error: expected expression before ‘return’
> arch/sparc/math-emu/math_64.c:491:1: error: expected expression before ‘return’
> arch/sparc/math-emu/math_64.c:495:1: error: expected expression before ‘return’
> 
> I'm attaching a CPP processed math_64.c for your convenience:

Please try this patch on top of the previous one.  The way abort is 
redefined in the kernel code doesn't work for one place using it in an 
expression; this patch changes a comma expression to a statement 
expression.  This didn't appear in my powerpc testing because the powerpc 
emulation never uses FP_FROM_INT; I'm not sure how Kaz's sh testing 
avoided the problem appearing there.

diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index b9f5e1a..8c059c3 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -1818,7 +1818,7 @@
 			 X##_e = (_FP_EXPBIAS_##fs + 2 * _FP_W_TYPE_SIZE - 1 \
 				  - _FP_FROM_INT_lz);			\
 		       })						\
-		     : (abort (), 0)));					\
+		     : ({ abort (); 0; })));				\
 									\
 	  if ((rsize) - 1 + _FP_EXPBIAS_##fs >= _FP_EXPMAX_##fs		\
 	      && X##_e >= _FP_EXPMAX_##fs)				\

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-19 18:40     ` Joseph Myers
  0 siblings, 0 replies; 20+ messages in thread
From: Joseph Myers @ 2015-02-19 18:40 UTC (permalink / raw)
  To: David Miller
  Cc: linux-kernel, linux-alpha, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, kkojima

[-- Attachment #1: Type: text/plain, Size: 1794 bytes --]

On Thu, 19 Feb 2015, David Miller wrote:

> From: Joseph Myers <joseph@codesourcery.com>
> Date: Fri, 6 Feb 2015 17:25:29 +0000
> 
> > * On SPARC, comparisons now use raw unpacking (this should not in fact
> >   change how the emulation behaves, just make it more efficient).
> 
> I did a sparc64 test build and it failed like so:
> 
> arch/sparc/math-emu/math_64.c: In function ‘do_mathemu’:
> arch/sparc/math-emu/math_64.c:487:1: error: expected expression before ‘return’
> arch/sparc/math-emu/math_64.c:488:1: error: expected expression before ‘return’
> arch/sparc/math-emu/math_64.c:490:1: error: expected expression before ‘return’
> arch/sparc/math-emu/math_64.c:491:1: error: expected expression before ‘return’
> arch/sparc/math-emu/math_64.c:495:1: error: expected expression before ‘return’
> 
> I'm attaching a CPP processed math_64.c for your convenience:

Please try this patch on top of the previous one.  The way abort is 
redefined in the kernel code doesn't work for one place using it in an 
expression; this patch changes a comma expression to a statement 
expression.  This didn't appear in my powerpc testing because the powerpc 
emulation never uses FP_FROM_INT; I'm not sure how Kaz's sh testing 
avoided the problem appearing there.

diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index b9f5e1a..8c059c3 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -1818,7 +1818,7 @@
 			 X##_e = (_FP_EXPBIAS_##fs + 2 * _FP_W_TYPE_SIZE - 1 \
 				  - _FP_FROM_INT_lz);			\
 		       })						\
-		     : (abort (), 0)));					\
+		     : ({ abort (); 0; })));				\
 									\
 	  if ((rsize) - 1 + _FP_EXPBIAS_##fs >= _FP_EXPMAX_##fs		\
 	      && X##_e >= _FP_EXPMAX_##fs)				\

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
  2015-02-19 18:40     ` Joseph Myers
  (?)
@ 2015-02-19 19:10       ` David Miller
  -1 siblings, 0 replies; 20+ messages in thread
From: David Miller @ 2015-02-19 19:10 UTC (permalink / raw)
  To: joseph
  Cc: linux-s390, linux-sh, linux-kernel, linux-alpha, sparclinux,
	linuxppc-dev, kkojima

From: Joseph Myers <joseph@codesourcery.com>
Date: Thu, 19 Feb 2015 18:40:34 +0000

> On Thu, 19 Feb 2015, David Miller wrote:
> 
>> From: Joseph Myers <joseph@codesourcery.com>
>> Date: Fri, 6 Feb 2015 17:25:29 +0000
>> 
>> > * On SPARC, comparisons now use raw unpacking (this should not in fact
>> >   change how the emulation behaves, just make it more efficient).
>> 
>> I did a sparc64 test build and it failed like so:
 ...
> Please try this patch on top of the previous one.  The way abort is 
> redefined in the kernel code doesn't work for one place using it in an 
> expression; this patch changes a comma expression to a statement 
> expression.  This didn't appear in my powerpc testing because the powerpc 
> emulation never uses FP_FROM_INT; I'm not sure how Kaz's sh testing 
> avoided the problem appearing there.
> 
> diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
> index b9f5e1a..8c059c3 100644
> --- a/include/math-emu/op-common.h
> +++ b/include/math-emu/op-common.h

That fixes the build for 64-bit sparc, thanks Joseph.

I'll try to do some functional testing now.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-19 19:10       ` David Miller
  0 siblings, 0 replies; 20+ messages in thread
From: David Miller @ 2015-02-19 19:10 UTC (permalink / raw)
  To: joseph
  Cc: linux-kernel, linux-alpha, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, kkojima

From: Joseph Myers <joseph@codesourcery.com>
Date: Thu, 19 Feb 2015 18:40:34 +0000

> On Thu, 19 Feb 2015, David Miller wrote:
> 
>> From: Joseph Myers <joseph@codesourcery.com>
>> Date: Fri, 6 Feb 2015 17:25:29 +0000
>> 
>> > * On SPARC, comparisons now use raw unpacking (this should not in fact
>> >   change how the emulation behaves, just make it more efficient).
>> 
>> I did a sparc64 test build and it failed like so:
 ...
> Please try this patch on top of the previous one.  The way abort is 
> redefined in the kernel code doesn't work for one place using it in an 
> expression; this patch changes a comma expression to a statement 
> expression.  This didn't appear in my powerpc testing because the powerpc 
> emulation never uses FP_FROM_INT; I'm not sure how Kaz's sh testing 
> avoided the problem appearing there.
> 
> diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
> index b9f5e1a..8c059c3 100644
> --- a/include/math-emu/op-common.h
> +++ b/include/math-emu/op-common.h

That fixes the build for 64-bit sparc, thanks Joseph.

I'll try to do some functional testing now.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-19 19:10       ` David Miller
  0 siblings, 0 replies; 20+ messages in thread
From: David Miller @ 2015-02-19 19:10 UTC (permalink / raw)
  To: joseph
  Cc: linux-s390, linux-sh, linux-kernel, linux-alpha, sparclinux,
	linuxppc-dev, kkojima

From: Joseph Myers <joseph@codesourcery.com>
Date: Thu, 19 Feb 2015 18:40:34 +0000

> On Thu, 19 Feb 2015, David Miller wrote:
> 
>> From: Joseph Myers <joseph@codesourcery.com>
>> Date: Fri, 6 Feb 2015 17:25:29 +0000
>> 
>> > * On SPARC, comparisons now use raw unpacking (this should not in fact
>> >   change how the emulation behaves, just make it more efficient).
>> 
>> I did a sparc64 test build and it failed like so:
 ...
> Please try this patch on top of the previous one.  The way abort is 
> redefined in the kernel code doesn't work for one place using it in an 
> expression; this patch changes a comma expression to a statement 
> expression.  This didn't appear in my powerpc testing because the powerpc 
> emulation never uses FP_FROM_INT; I'm not sure how Kaz's sh testing 
> avoided the problem appearing there.
> 
> diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
> index b9f5e1a..8c059c3 100644
> --- a/include/math-emu/op-common.h
> +++ b/include/math-emu/op-common.h

That fixes the build for 64-bit sparc, thanks Joseph.

I'll try to do some functional testing now.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
  2015-02-19 18:40     ` Joseph Myers
  (?)
@ 2015-02-20  2:52       ` Kaz Kojima
  -1 siblings, 0 replies; 20+ messages in thread
From: Kaz Kojima @ 2015-02-20  2:52 UTC (permalink / raw)
  To: joseph
  Cc: linux-s390, linux-sh, linux-kernel, linux-alpha, sparclinux,
	linuxppc-dev

Joseph Myers <joseph@codesourcery.com> wrote:
> Please try this patch on top of the previous one.  The way abort is 
> redefined in the kernel code doesn't work for one place using it in an 
> expression; this patch changes a comma expression to a statement 
> expression.  This didn't appear in my powerpc testing because the powerpc 
> emulation never uses FP_FROM_INT; I'm not sure how Kaz's sh testing 
> avoided the problem appearing there.

My bad.  It turned out that I've configured the kernel wrongly and
CONFIG_SH_FPU_EMU isn't enabled.  With the proper configuration,
the build got the similar error with sparc64 during compiling
arch/sh/math.c and your patch for op-common.h fixes it.

Regards,
	kaz

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-20  2:52       ` Kaz Kojima
  0 siblings, 0 replies; 20+ messages in thread
From: Kaz Kojima @ 2015-02-20  2:52 UTC (permalink / raw)
  To: joseph
  Cc: linux-kernel, linux-alpha, linuxppc-dev, linux-s390, linux-sh,
	sparclinux

Joseph Myers <joseph@codesourcery.com> wrote:
> Please try this patch on top of the previous one.  The way abort is 
> redefined in the kernel code doesn't work for one place using it in an 
> expression; this patch changes a comma expression to a statement 
> expression.  This didn't appear in my powerpc testing because the powerpc 
> emulation never uses FP_FROM_INT; I'm not sure how Kaz's sh testing 
> avoided the problem appearing there.

My bad.  It turned out that I've configured the kernel wrongly and
CONFIG_SH_FPU_EMU isn't enabled.  With the proper configuration,
the build got the similar error with sparc64 during compiling
arch/sh/math.c and your patch for op-common.h fixes it.

Regards,
	kaz

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
@ 2015-02-20  2:52       ` Kaz Kojima
  0 siblings, 0 replies; 20+ messages in thread
From: Kaz Kojima @ 2015-02-20  2:52 UTC (permalink / raw)
  To: joseph
  Cc: linux-s390, linux-sh, linux-kernel, linux-alpha, sparclinux,
	linuxppc-dev

Joseph Myers <joseph@codesourcery.com> wrote:
> Please try this patch on top of the previous one.  The way abort is 
> redefined in the kernel code doesn't work for one place using it in an 
> expression; this patch changes a comma expression to a statement 
> expression.  This didn't appear in my powerpc testing because the powerpc 
> emulation never uses FP_FROM_INT; I'm not sure how Kaz's sh testing 
> avoided the problem appearing there.

My bad.  It turned out that I've configured the kernel wrongly and
CONFIG_SH_FPU_EMU isn't enabled.  With the proper configuration,
the build got the similar error with sparc64 during compiling
arch/sh/math.c and your patch for op-common.h fixes it.

Regards,
	kaz

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2015-02-20  3:23 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-06 17:25 [PATCH RFC] Update kernel math-emu code from current glibc soft-fp Joseph Myers
2015-02-06 17:25 ` Joseph Myers
2015-02-06 17:25 ` Joseph Myers
2015-02-06 17:41 ` Randy Dunlap
2015-02-06 17:41   ` Randy Dunlap
2015-02-06 18:03   ` Joseph Myers
2015-02-06 18:03     ` Joseph Myers
2015-02-06 18:03     ` Joseph Myers
2015-02-06 18:03     ` Joseph Myers
2015-02-19 18:21 ` David Miller
2015-02-19 18:21   ` David Miller
2015-02-19 18:40   ` Joseph Myers
2015-02-19 18:40     ` Joseph Myers
2015-02-19 18:40     ` Joseph Myers
2015-02-19 19:10     ` David Miller
2015-02-19 19:10       ` David Miller
2015-02-19 19:10       ` David Miller
2015-02-20  2:52     ` Kaz Kojima
2015-02-20  2:52       ` Kaz Kojima
2015-02-20  2:52       ` Kaz Kojima

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.