* [PATCH] math-emu: Fix compiler warnings
@ 2008-08-21 12:50 Kumar Gala
2008-08-21 12:50 ` [PATCH] math-emu: Add support for reporting exact invalid exception Kumar Gala
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Kumar Gala @ 2008-08-21 12:50 UTC (permalink / raw)
To: linux-kernel; +Cc: linuxppc-dev, davem
Fix warnings of the form:
arch/powerpc/math-emu/fsubs.c:15: warning: 'R_f1' may be used uninitialized in this function
arch/powerpc/math-emu/fsubs.c:15: warning: 'R_f0' may be used uninitialized in this function
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
I intend these patches to go via the powerpc.git tree if no one has issues.
- k
include/math-emu/op-2.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/math-emu/op-2.h b/include/math-emu/op-2.h
index e193fb0..4f26ecc 100644
--- a/include/math-emu/op-2.h
+++ b/include/math-emu/op-2.h
@@ -25,7 +25,7 @@
#ifndef __MATH_EMU_OP_2_H__
#define __MATH_EMU_OP_2_H__
-#define _FP_FRAC_DECL_2(X) _FP_W_TYPE X##_f0, X##_f1
+#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_HIGH_2(X) (X##_f1)
--
1.5.5.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] math-emu: Add support for reporting exact invalid exception
2008-08-21 12:50 [PATCH] math-emu: Fix compiler warnings Kumar Gala
@ 2008-08-21 12:50 ` Kumar Gala
2008-08-21 21:05 ` David Miller
2008-08-21 13:49 ` [PATCH] math-emu: Fix compiler warnings Stephen Rothwell
2008-08-21 21:03 ` David Miller
2 siblings, 1 reply; 7+ messages in thread
From: Kumar Gala @ 2008-08-21 12:50 UTC (permalink / raw)
To: linux-kernel; +Cc: linuxppc-dev, davem
Some architectures (like powerpc) provide status information on the exact
type of invalid exception. This is pretty straight forward as we already
report invalid exceptions via FP_SET_EXCEPTION.
We add new flags (FP_EX_INVALID_*) the architecture code can define if it
wants the exact invalid exception reported.
We had to split out the INF/INF and 0/0 cases for divide to allow reporting
the two invalid forms properly.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
I intend these patches to go via the powerpc.git tree if no one has issues.
- k
include/math-emu/op-common.h | 12 ++++++++----
include/math-emu/soft-fp.h | 19 +++++++++++++++++++
2 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index bb46e76..cc1ec39 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -73,7 +73,7 @@ do { \
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_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_SNAN); \
} \
break; \
} \
@@ -324,7 +324,7 @@ do { \
_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_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_ISI); \
break; \
} \
/* FALLTHRU */ \
@@ -431,7 +431,7 @@ do { \
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_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IMZ);\
break; \
\
default: \
@@ -490,11 +490,15 @@ do { \
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);\
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_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_ZDZ);\
break; \
\
default: \
diff --git a/include/math-emu/soft-fp.h b/include/math-emu/soft-fp.h
index a6f873b..3f284bc 100644
--- a/include/math-emu/soft-fp.h
+++ b/include/math-emu/soft-fp.h
@@ -51,6 +51,25 @@
#ifndef FP_EX_INVALID
#define FP_EX_INVALID 0
#endif
+#ifndef FP_EX_INVALID_SNAN
+#define FP_EX_INVALID_SNAN 0
+#endif
+/* inf - inf */
+#ifndef FP_EX_INVALID_ISI
+#define FP_EX_INVALID_ISI 0
+#endif
+/* inf / inf */
+#ifndef FP_EX_INVALID_IDI
+#define FP_EX_INVALID_IDI 0
+#endif
+/* 0 / 0 */
+#ifndef FP_EX_INVALID_ZDZ
+#define FP_EX_INVALID_ZDZ 0
+#endif
+/* inf * 0 */
+#ifndef FP_EX_INVALID_IMZ
+#define FP_EX_INVALID_IMZ 0
+#endif
#ifndef FP_EX_OVERFLOW
#define FP_EX_OVERFLOW 0
#endif
--
1.5.5.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] math-emu: Fix compiler warnings
2008-08-21 12:50 [PATCH] math-emu: Fix compiler warnings Kumar Gala
2008-08-21 12:50 ` [PATCH] math-emu: Add support for reporting exact invalid exception Kumar Gala
@ 2008-08-21 13:49 ` Stephen Rothwell
2008-08-21 14:20 ` Kumar Gala
2008-08-21 21:03 ` David Miller
2 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2008-08-21 13:49 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, linux-kernel, davem
[-- Attachment #1: Type: text/plain, Size: 754 bytes --]
Hi Kumar,
On Thu, 21 Aug 2008 07:50:20 -0500 Kumar Gala <galak@kernel.crashing.org> wrote:
>
> Fix warnings of the form:
> arch/powerpc/math-emu/fsubs.c:15: warning: 'R_f1' may be used uninitialized in this function
> arch/powerpc/math-emu/fsubs.c:15: warning: 'R_f0' may be used uninitialized in this function
>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
>
> I intend these patches to go via the powerpc.git tree if no one has issues.
>
> - k
>
> include/math-emu/op-2.h | 2 +-
Are you modifying the right file here? There is also
arch/powerpc/math-emu/op-2.h which contains the same construct.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] math-emu: Fix compiler warnings
2008-08-21 13:49 ` [PATCH] math-emu: Fix compiler warnings Stephen Rothwell
@ 2008-08-21 14:20 ` Kumar Gala
0 siblings, 0 replies; 7+ messages in thread
From: Kumar Gala @ 2008-08-21 14:20 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev, linux-kernel, davem
On Aug 21, 2008, at 8:49 AM, Stephen Rothwell wrote:
> Hi Kumar,
>
> On Thu, 21 Aug 2008 07:50:20 -0500 Kumar Gala <galak@kernel.crashing.org
> > wrote:
>>
>> Fix warnings of the form:
>> arch/powerpc/math-emu/fsubs.c:15: warning: 'R_f1' may be used
>> uninitialized in this function
>> arch/powerpc/math-emu/fsubs.c:15: warning: 'R_f0' may be used
>> uninitialized in this function
>>
>> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>> ---
>>
>> I intend these patches to go via the powerpc.git tree if no one has
>> issues.
>>
>> - k
>>
>> include/math-emu/op-2.h | 2 +-
>
> Are you modifying the right file here? There is also
> arch/powerpc/math-emu/op-2.h which contains the same construct.
I forgot to mention this is a precursor to moving arch/powerpc to
using the generic math-emu code in include/math-emu/
I don't see any reason to fixup the old code.
- k
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] math-emu: Fix compiler warnings
2008-08-21 12:50 [PATCH] math-emu: Fix compiler warnings Kumar Gala
2008-08-21 12:50 ` [PATCH] math-emu: Add support for reporting exact invalid exception Kumar Gala
2008-08-21 13:49 ` [PATCH] math-emu: Fix compiler warnings Stephen Rothwell
@ 2008-08-21 21:03 ` David Miller
2008-08-21 21:59 ` Kumar Gala
2 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2008-08-21 21:03 UTC (permalink / raw)
To: galak; +Cc: linuxppc-dev, linux-kernel
From: Kumar Gala <galak@kernel.crashing.org>
Date: Thu, 21 Aug 2008 07:50:20 -0500
> Fix warnings of the form:
> arch/powerpc/math-emu/fsubs.c:15: warning: 'R_f1' may be used uninitialized in this function
> arch/powerpc/math-emu/fsubs.c:15: warning: 'R_f0' may be used uninitialized in this function
>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
You should look at the compiler options we use on sparc to build this
stuff :-)
EXTRA_CFLAGS = -Iinclude/math-emu -w
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] math-emu: Add support for reporting exact invalid exception
2008-08-21 12:50 ` [PATCH] math-emu: Add support for reporting exact invalid exception Kumar Gala
@ 2008-08-21 21:05 ` David Miller
0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2008-08-21 21:05 UTC (permalink / raw)
To: galak; +Cc: linuxppc-dev, linux-kernel
From: Kumar Gala <galak@kernel.crashing.org>
Date: Thu, 21 Aug 2008 07:50:21 -0500
> Some architectures (like powerpc) provide status information on the exact
> type of invalid exception. This is pretty straight forward as we already
> report invalid exceptions via FP_SET_EXCEPTION.
>
> We add new flags (FP_EX_INVALID_*) the architecture code can define if it
> wants the exact invalid exception reported.
>
> We had to split out the INF/INF and 0/0 cases for divide to allow reporting
> the two invalid forms properly.
>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] math-emu: Fix compiler warnings
2008-08-21 21:03 ` David Miller
@ 2008-08-21 21:59 ` Kumar Gala
0 siblings, 0 replies; 7+ messages in thread
From: Kumar Gala @ 2008-08-21 21:59 UTC (permalink / raw)
To: David Miller; +Cc: linuxppc-dev, linux-kernel
On Aug 21, 2008, at 4:03 PM, David Miller wrote:
> From: Kumar Gala <galak@kernel.crashing.org>
> Date: Thu, 21 Aug 2008 07:50:20 -0500
>
>> Fix warnings of the form:
>> arch/powerpc/math-emu/fsubs.c:15: warning: 'R_f1' may be used
>> uninitialized in this function
>> arch/powerpc/math-emu/fsubs.c:15: warning: 'R_f0' may be used
>> uninitialized in this function
>>
>> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>
> You should look at the compiler options we use on sparc to build this
> stuff :-)
>
> EXTRA_CFLAGS = -Iinclude/math-emu -w
Yeah, I plan on doing that on PPC once I move over the global include/
math-emu files.
- k
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-08-21 21:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-21 12:50 [PATCH] math-emu: Fix compiler warnings Kumar Gala
2008-08-21 12:50 ` [PATCH] math-emu: Add support for reporting exact invalid exception Kumar Gala
2008-08-21 21:05 ` David Miller
2008-08-21 13:49 ` [PATCH] math-emu: Fix compiler warnings Stephen Rothwell
2008-08-21 14:20 ` Kumar Gala
2008-08-21 21:03 ` David Miller
2008-08-21 21:59 ` Kumar Gala
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).