Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1268524

[PATCH 2/8] MIPS: Define the legacy-NaN and 2008-NaN features

From "Maciej W. Rozycki" <macro@imgtec.com>
Newsgroups linux.kernel
Subject [PATCH 2/8] MIPS: Define the legacy-NaN and 2008-NaN features
Date 2015-11-13 01:50 +0100
Message-ID <quaIX-7Mk-37@gated-at.bofh.it> (permalink)
References <quaIV-7Mk-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Allocate CPU option bits and define macros for the legacy-NaN and 
2008-NaN IEEE Std 754 MIPS architecture features.  Unconditionally mark 
the legacy-NaN feature as present across hardware and emulated 
floating-point configurations.

Signed-off-by: Maciej W. Rozycki <macro@imgtec.com>
---
linux-mips-nan-legacy.diff
Index: linux-sfr-test/arch/mips/include/asm/cpu-features.h
===================================================================
--- linux-sfr-test.orig/arch/mips/include/asm/cpu-features.h	2015-10-07 19:33:20.000000000 +0100
+++ linux-sfr-test/arch/mips/include/asm/cpu-features.h	2015-10-07 20:48:14.828556000 +0100
@@ -414,4 +414,11 @@
 # define cpu_has_small_pages	(cpu_data[0].options & MIPS_CPU_SP)
 #endif
 
+#ifndef cpu_has_nan_legacy
+#define cpu_has_nan_legacy	(cpu_data[0].options & MIPS_CPU_NAN_LEGACY)
+#endif
+#ifndef cpu_has_nan_2008
+#define cpu_has_nan_2008	(cpu_data[0].options & MIPS_CPU_NAN_2008)
+#endif
+
 #endif /* __ASM_CPU_FEATURES_H */
Index: linux-sfr-test/arch/mips/include/asm/cpu.h
===================================================================
--- linux-sfr-test.orig/arch/mips/include/asm/cpu.h	2015-10-07 19:33:20.000000000 +0100
+++ linux-sfr-test/arch/mips/include/asm/cpu.h	2015-10-07 20:48:14.831542000 +0100
@@ -386,6 +386,8 @@ enum cpu_type_enum {
 #define MIPS_CPU_BP_GHIST	0x8000000000ull /* R12K+ Branch Prediction Global History */
 #define MIPS_CPU_SP		0x10000000000ull /* Small (1KB) page support */
 #define MIPS_CPU_FTLB		0x20000000000ull /* CPU has Fixed-page-size TLB */
+#define MIPS_CPU_NAN_LEGACY	0x40000000000ull /* Legacy NaN implemented */
+#define MIPS_CPU_NAN_2008	0x80000000000ull /* 2008 NaN implemented */
 
 /*
  * CPU ASE encodings
Index: linux-sfr-test/arch/mips/kernel/cpu-probe.c
===================================================================
--- linux-sfr-test.orig/arch/mips/kernel/cpu-probe.c	2015-10-07 19:33:20.000000000 +0100
+++ linux-sfr-test/arch/mips/kernel/cpu-probe.c	2015-10-07 20:48:14.836528000 +0100
@@ -137,6 +137,7 @@ static void cpu_set_fpu_opts(struct cpui
 	}
 
 	cpu_set_fpu_fcsr_mask(c);
+	c->options |= MIPS_CPU_NAN_LEGACY;
 }
 
 /*
@@ -147,6 +148,7 @@ static void cpu_set_nofpu_opts(struct cp
 	c->options &= ~MIPS_CPU_FPU;
 	c->fpu_msk31 = mips_nofpu_msk31;
 
+	c->options |= MIPS_CPU_NAN_LEGACY;
 	cpu_set_nofpu_id(c);
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/(8+2)] MIPS: IEEE Std 754-2008 features "Maciej W. Rozycki" <macro@imgtec.com> - 2015-11-13 01:50 +0100
  [PATCH 4/8] MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding  emulation "Maciej W. Rozycki" <macro@imgtec.com> - 2015-11-13 01:50 +0100
  [PATCH 2/8] MIPS: Define the legacy-NaN and 2008-NaN features "Maciej W. Rozycki" <macro@imgtec.com> - 2015-11-13 01:50 +0100
  [PATCH 7/8] MIPS: Determine the presence of IEEE Std 754-2008  features "Maciej W. Rozycki" <macro@imgtec.com> - 2015-11-13 01:50 +0100
  [PATCH] MIPS: math-emu: Always propagate sNaN payload in quieting "Maciej W. Rozycki" <macro@imgtec.com> - 2015-11-13 01:50 +0100
  [PATCH 6/8] MIPS: ELF: Interpret the NAN2008 file header flag "Maciej W. Rozycki" <macro@imgtec.com> - 2015-11-13 01:50 +0100

csiph-web