summaryrefslogtreecommitdiffstats
path: root/recipes-extended/testfloat/files/TestFloat-powerpc-E500v2-SPE-1.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/testfloat/files/TestFloat-powerpc-E500v2-SPE-1.patch')
-rw-r--r--recipes-extended/testfloat/files/TestFloat-powerpc-E500v2-SPE-1.patch1644
1 files changed, 1644 insertions, 0 deletions
diff --git a/recipes-extended/testfloat/files/TestFloat-powerpc-E500v2-SPE-1.patch b/recipes-extended/testfloat/files/TestFloat-powerpc-E500v2-SPE-1.patch
new file mode 100644
index 0000000..c34421c
--- /dev/null
+++ b/recipes-extended/testfloat/files/TestFloat-powerpc-E500v2-SPE-1.patch
@@ -0,0 +1,1644 @@
1This patch adds PowerPC E500v2 SPE support in TestFloat.
2And it disables the testing for hardware that can not trigger SPE interrupt.
3
4Signed-off-by: Ebony Zhu <ebony.zhu@freescale.com>
5Signed-off-by: Liu Yu <Yu.Liu@freescale.com>
6---
7 processors/POWERPC-gcc.h | 99 +++++
8 testfloat/powerpc-linux-gcc/Makefile | 83 +++++
9 testfloat/powerpc-linux-gcc/milieu.h | 71 ++++
10 testfloat/powerpc-linux-gcc/systflags.c | 107 ++++++
11 testfloat/powerpc-linux-gcc/systfloat.c | 595 +++++++++++++++++++++++++++++++
12 testfloat/powerpc-linux-gcc/systmodes.c | 67 ++++
13 testfloat/templates/Makefile | 18 +-
14 testfloat/templates/milieu.h | 2 +-
15 testfloat/testFunction.h | 2 +-
16 testfloat/testLoops.c | 216 +++++++++++
17 10 files changed, 1252 insertions(+), 8 deletions(-)
18 create mode 100644 processors/POWERPC-gcc.h
19 create mode 100644 testfloat/powerpc-linux-gcc/Makefile
20 create mode 100644 testfloat/powerpc-linux-gcc/milieu.h
21 create mode 100644 testfloat/powerpc-linux-gcc/systflags.c
22 create mode 100644 testfloat/powerpc-linux-gcc/systfloat.c
23 create mode 100644 testfloat/powerpc-linux-gcc/systmodes.c
24
25diff --git a/processors/POWERPC-gcc.h b/processors/POWERPC-gcc.h
26new file mode 100644
27index 0000000..4201faa
28--- /dev/null
29+++ b/processors/POWERPC-gcc.h
30@@ -0,0 +1,99 @@
31+/*
32+ * This file is derived from processors/i386-GCC.h,
33+ * the copyright for that material belongs to the original owners.
34+ *
35+ * Additional material and changes where applicable is:
36+ * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved.
37+ *
38+ * Author: Ebony Zhu, <ebony.zhu@freescale.com>
39+ * Yu Liu, <yu.liu@freescale.com>
40+ *
41+ * THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
42+ * been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
43+ * RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
44+ * AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
45+ * COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
46+ * EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
47+ * INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
48+ * OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
49+ */
50+
51+/*
52+-------------------------------------------------------------------------------
53+One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
54+-------------------------------------------------------------------------------
55+*/
56+#define BIGENDIAN
57+
58+/*
59+-------------------------------------------------------------------------------
60+The macro `BITS64' can be defined to indicate that 64-bit integer types are
61+supported by the compiler.
62+-------------------------------------------------------------------------------
63+*/
64+#undef BITS64
65+
66+/*
67+-------------------------------------------------------------------------------
68+Each of the following `typedef's defines the most convenient type that holds
69+integers of at least as many bits as specified. For example, `uint8' should
70+be the most convenient type that can hold unsigned integers of as many as
71+8 bits. The `flag' type must be able to hold either a 0 or 1. For most
72+implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
73+to the same as `int'.
74+-------------------------------------------------------------------------------
75+*/
76+typedef int flag;
77+typedef int uint8;
78+typedef int int8;
79+typedef int uint16;
80+typedef int int16;
81+typedef unsigned int uint32;
82+typedef signed int int32;
83+#ifdef BITS64
84+typedef unsigned long long int uint64;
85+typedef signed long long int int64;
86+#endif
87+
88+/*
89+-------------------------------------------------------------------------------
90+Each of the following `typedef's defines a type that holds integers
91+of _exactly_ the number of bits specified. For instance, for most
92+implementation of C, `bits16' and `sbits16' should be `typedef'ed to
93+`unsigned short int' and `signed short int' (or `short int'), respectively.
94+-------------------------------------------------------------------------------
95+*/
96+typedef unsigned char bits8;
97+typedef signed char sbits8;
98+typedef unsigned short int bits16;
99+typedef signed short int sbits16;
100+typedef unsigned int bits32;
101+typedef signed int sbits32;
102+#ifdef BITS64
103+typedef unsigned long long int bits64;
104+typedef signed long long int sbits64;
105+#endif
106+
107+#ifdef BITS64
108+/*
109+-------------------------------------------------------------------------------
110+The `LIT64' macro takes as its argument a textual integer literal and
111+if necessary ``marks'' the literal as having a 64-bit integer type.
112+For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
113+appended with the letters `LL' standing for `long long', which is `gcc's
114+name for the 64-bit integer type. Some compilers may allow `LIT64' to be
115+defined as the identity macro: `#define LIT64( a ) a'.
116+-------------------------------------------------------------------------------
117+*/
118+#define LIT64( a ) a##LL
119+#endif
120+
121+/*
122+-------------------------------------------------------------------------------
123+The macro `INLINE' can be used before functions that should be inlined. If
124+a compiler does not support explicit inlining, this macro should be defined
125+to be `static'.
126+-------------------------------------------------------------------------------
127+*/
128+#define INLINE extern inline
129+
130diff --git a/testfloat/powerpc-linux-gcc/Makefile b/testfloat/powerpc-linux-gcc/Makefile
131new file mode 100644
132index 0000000..de50aad
133--- /dev/null
134+++ b/testfloat/powerpc-linux-gcc/Makefile
135@@ -0,0 +1,83 @@
136+
137+PROCESSOR_H = ../../processors/POWERPC-gcc.h
138+SOFTFLOAT_VERSION = bits32
139+TARGET = powerpc-GCC
140+SOFTFLOAT_DIR = ../../SoftFloat-2b/softfloat/$(SOFTFLOAT_VERSION)/$(TARGET)
141+
142+OBJ = .o
143+EXE =
144+INCLUDES = -I. -I.. -I$(SOFTFLOAT_DIR)
145+
146+COMPILE_C = $(COMPILE_PREFIX)gcc -c -o $@ $(INCLUDES) -I- -O $(EXTRA_CFLAGS)
147+
148+COMPILE_C_HARD = $(COMPILE_PREFIX)gcc -c -te500v2 -o $@ $(INCLUDES)
149+
150+COMPILE_SLOWFLOAT_C = $(COMPILE_PREFIX)gcc -c -o $@ $(INCLUDES) -I- -O
151+
152+LINK = $(COMPILE_PREFIX)gcc -lm -o $@
153+
154+SOFTFLOAT_H = $(SOFTFLOAT_DIR)/softfloat.h
155+SOFTFLOAT_OBJ = $(SOFTFLOAT_DIR)/softfloat$(OBJ)
156+
157+ALL: testsoftfloat$(EXE) testfloat$(EXE)
158+
159+systmodes$(OBJ): milieu.h systmodes.c
160+ $(COMPILE_C) systmodes.c
161+
162+systflags$(OBJ): milieu.h ../systflags.h systflags.c
163+ $(COMPILE_C) systflags.c
164+
165+systfloat$(OBJ): milieu.h $(SOFTFLOAT_H) ../systfloat.h systfloat.c
166+ $(COMPILE_C_HARD) systfloat.c
167+
168+#------------------------------------------------------------------------------
169+# Probably O.K. below here.
170+#------------------------------------------------------------------------------
171+
172+milieu.h: $(PROCESSOR_H)
173+ touch milieu.h
174+
175+fail$(OBJ): milieu.h ../fail.h
176+ $(COMPILE_C) ../fail.c
177+
178+random$(OBJ): milieu.h ../random.h
179+ $(COMPILE_C) ../random.c
180+
181+testCases$(OBJ): milieu.h ../fail.h ../random.h $(SOFTFLOAT_H) ../testCases.h ../testCases.c
182+ $(COMPILE_C) ../testCases.c
183+
184+writeHex$(OBJ): milieu.h $(SOFTFLOAT_H) ../writeHex.h ../writeHex.c
185+ $(COMPILE_C) ../writeHex.c
186+
187+testLoops$(OBJ): milieu.h $(SOFTFLOAT_H) ../testCases.h ../writeHex.h ../testLoops.h ../testLoops.c
188+ $(COMPILE_C) ../testLoops.c
189+
190+slowfloat$(OBJ): milieu.h $(SOFTFLOAT_H) ../slowfloat.h ../slowfloat-32.c ../slowfloat-64.c ../slowfloat.c
191+ $(COMPILE_SLOWFLOAT_C) ../slowfloat.c
192+
193+testsoftfloat$(OBJ): milieu.h ../fail.h $(SOFTFLOAT_H) ../testCases.h ../testLoops.h ../slowfloat.h ../testsoftfloat.c
194+ $(COMPILE_C) ../testsoftfloat.c
195+
196+testsoftfloat$(EXE): fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) slowfloat$(OBJ) testsoftfloat$(OBJ) systflags$(OBJ) systmodes$(OBJ)
197+ $(LINK) fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) slowfloat$(OBJ) testsoftfloat$(OBJ) systflags$(OBJ) systmodes$(OBJ)
198+
199+testFunction$(OBJ): milieu.h $(SOFTFLOAT_H) ../testCases.h ../testLoops.h ../systmodes.h ../systflags.h ../systfloat.h ../testFunction.h ../testFunction.c
200+ $(COMPILE_C) ../testFunction.c
201+
202+testfloat$(OBJ): milieu.h ../fail.h $(SOFTFLOAT_H) ../testCases.h ../testLoops.h ../systflags.h ../testFunction.h ../testfloat.c
203+ $(COMPILE_C) ../testfloat.c
204+
205+testfloat$(EXE): fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) systmodes$(OBJ) systflags$(OBJ) systfloat$(OBJ) testFunction$(OBJ) testfloat$(OBJ)
206+ $(LINK) fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) systmodes$(OBJ) systflags$(OBJ) systfloat$(OBJ) testFunction$(OBJ) testfloat$(OBJ)
207+
208+$(SOFTFLOAT_OBJ):
209+ make -C $(SOFTFLOAT_DIR)
210+
211+cp: ALL
212+ cp testsoftfloat$(EXE) ../../test_softfloat$(EXE)
213+ cp testfloat$(EXE) ../../test_float$(EXE)
214+
215+clean:
216+ make -C $(SOFTFLOAT_DIR) clean
217+ rm -f *.o testfloat$(EXE) testsoftfloat$(EXE)
218+ rm -f ../../test_softfloat$(EXE) ../../test_float$(EXE)
219diff --git a/testfloat/powerpc-linux-gcc/milieu.h b/testfloat/powerpc-linux-gcc/milieu.h
220new file mode 100644
221index 0000000..29d2b18
222--- /dev/null
223+++ b/testfloat/powerpc-linux-gcc/milieu.h
224@@ -0,0 +1,71 @@
225+/*
226+ * This file is derived from testfloat/386-Win32-gcc/milieu.h,
227+ * the copyright for that material belongs to the original owners.
228+ *
229+ * Additional material and changes where applicable is:
230+ * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved.
231+ *
232+ * Author: Ebony Zhu, <ebony.zhu@freescale.com>
233+ * Yu Liu, <yu.liu@freescale.com>
234+ */
235+
236+/*
237+===============================================================================
238+
239+This C header file is part of TestFloat, Release 2a, a package of programs
240+for testing the correctness of floating-point arithmetic complying to the
241+IEC/IEEE Standard for Floating-Point.
242+
243+Written by John R. Hauser. More information is available through the Web
244+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
245+
246+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
247+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
248+TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
249+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
250+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
251+
252+Derivative works are acceptable, even for commercial purposes, so long as
253+(1) they include prominent notice that the work is derivative, and (2) they
254+include prominent notice akin to these four paragraphs for those parts of
255+this code that are retained.
256+
257+===============================================================================
258+*/
259+
260+/*
261+-------------------------------------------------------------------------------
262+Include common integer types and flags.
263+-------------------------------------------------------------------------------
264+*/
265+#include "../../processors/POWERPC-gcc.h"
266+/*
267+-------------------------------------------------------------------------------
268+If the `BITS64' macro is defined by the processor header file but the
269+version of SoftFloat being used/tested is the 32-bit one (`bits32'), the
270+`BITS64' macro must be undefined here.
271+-------------------------------------------------------------------------------
272+*/
273+
274+#undef BITS64
275+/*
276+-------------------------------------------------------------------------------
277+The macro `LONG_DOUBLE_IS_FLOATX80' can be defined to indicate that the
278+C compiler supports the type `long double' as an extended double-precision
279+format. Alternatively, the macro `LONG_DOUBLE_IS_FLOAT128' can be defined
280+to indicate that `long double' is a quadruple-precision format. If neither
281+of these macros is defined, `long double' will be ignored.
282+-------------------------------------------------------------------------------
283+#define LONG_DOUBLE_IS_FLOATX80
284+*/
285+
286+/*
287+-------------------------------------------------------------------------------
288+Symbolic Boolean literals.
289+-------------------------------------------------------------------------------
290+*/
291+enum {
292+ FALSE = 0,
293+ TRUE = 1
294+};
295+
296diff --git a/testfloat/powerpc-linux-gcc/systflags.c b/testfloat/powerpc-linux-gcc/systflags.c
297new file mode 100644
298index 0000000..c382442
299--- /dev/null
300+++ b/testfloat/powerpc-linux-gcc/systflags.c
301@@ -0,0 +1,107 @@
302+/*
303+ * This file is derived from testfloat/386-Win32-gcc/systflags.c,
304+ * the copyright for that material belongs to the original owners.
305+ *
306+ * Additional material and changes where applicable is:
307+ * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved.
308+ *
309+ * Author: Ebony Zhu, <ebony.zhu@freescale.com>
310+ * Yu Liu, <yu.liu@freescale.com>
311+ */
312+
313+/*
314+===============================================================================
315+
316+This C source file is part of TestFloat, Release 2a, a package of programs
317+for testing the correctness of floating-point arithmetic complying to the
318+IEC/IEEE Standard for Floating-Point.
319+
320+Written by John R. Hauser. More information is available through the Web
321+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
322+
323+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
324+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
325+TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
326+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
327+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
328+
329+Derivative works are acceptable, even for commercial purposes, so long as
330+(1) they include prominent notice that the work is derivative, and (2) they
331+include prominent notice akin to these four paragraphs for those parts of
332+this code that are retained.
333+
334+===============================================================================
335+*/
336+
337+#include "milieu.h"
338+#include "systflags.h"
339+#include <fenv.h>
340+#include <stdio.h>
341+#include <math.h>
342+#include <bits/nan.h>
343+#include <bits/inf.h>
344+
345+#ifdef __SPE__
346+
347+#include <spe.h>
348+
349+
350+#define SPE_FINV_ENABLE (1UL << 5)
351+#define SPE_FDBZ_ENABLE (1UL << 4)
352+#define SPE_FUNF_ENABLE (1UL << 3)
353+#define SPE_FOVF_ENABLE (1UL << 2)
354+
355+#define SPE_FG (1UL << 13)
356+#define SPE_FX (1UL << 12)
357+#define SPE_FINV (1UL << 11)
358+#define SPE_FDBZ (1UL << 10)
359+#define SPE_FUNF (1UL << 9)
360+#define SPE_FOVF (1UL << 8)
361+
362+#define SPE_FG_H (1UL << 29)
363+#define SPE_FX_H (1UL << 28)
364+#define SPE_FINV_H (1UL << 27)
365+#define SPE_FDBZ_H (1UL << 26)
366+#define SPE_FUNF_H (1UL << 25)
367+#define SPE_FOVF_H (1UL << 24)
368+
369+static int is_soft_emu = 0;
370+
371+#endif
372+/*
373+-------------------------------------------------------------------------------
374+Clears the system's IEC/IEEE floating-point exception flags. Returns the
375+previous value of the flags.
376+-------------------------------------------------------------------------------
377+*/
378+extern int rounding;
379+unsigned int spefscr = 0;
380+
381+int8 syst_float_flags_clear( void )
382+{
383+#ifdef TEST_KERNEL_EMU
384+ if( (spefscr & (SPE_FINV | SPE_FINV_H))
385+ || (spefscr & (SPE_FDBZ | SPE_FDBZ_H))
386+ || (spefscr & (SPE_FUNF | SPE_FUNF_H))
387+ || (spefscr & (SPE_FOVF | SPE_FOVF_H))
388+ || (spefscr & (SPE_FX | SPE_FG | SPE_FX_H | SPE_FG_H))){
389+ is_soft_emu = 1;
390+ } else {
391+ is_soft_emu = 0;
392+ }
393+#endif
394+ __builtin_spe_mtspefscr(0x3c|(rounding & 0x3));
395+
396+ return ((spefscr>>17) & 0x1f);
397+}
398+
399+int syst_float_is_soft_emu(void)
400+{
401+ int ret = 0;
402+#ifdef TEST_KERNEL_EMU
403+ ret = is_soft_emu;
404+#endif
405+ return ret;
406+}
407+
408+
409diff --git a/testfloat/powerpc-linux-gcc/systfloat.c b/testfloat/powerpc-linux-gcc/systfloat.c
410new file mode 100644
411index 0000000..8d06f9f
412--- /dev/null
413+++ b/testfloat/powerpc-linux-gcc/systfloat.c
414@@ -0,0 +1,595 @@
415+/*
416+ * This file is derived from testfloat/systfloat.c,
417+ * the copyright for that material belongs to the original owners.
418+ *
419+ * Additional material and changes where applicable is:
420+ * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved.
421+ *
422+ * Author: Ebony Zhu, <ebony.zhu@freescale.com>
423+ * Yu Liu, <yu.liu@freescale.com>
424+ */
425+
426+/*
427+===============================================================================
428+
429+This C source file is part of TestFloat, Release 2a, a package of programs
430+for testing the correctness of floating-point arithmetic complying to the
431+IEC/IEEE Standard for Floating-Point.
432+
433+Written by John R. Hauser. More information is available through the Web
434+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
435+
436+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
437+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
438+TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
439+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
440+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
441+
442+Derivative works are acceptable, even for commercial purposes, so long as
443+(1) they include prominent notice that the work is derivative, and (2) they
444+include prominent notice akin to these four paragraphs for those parts of
445+this code that are retained.
446+
447+===============================================================================
448+*/
449+
450+#include <math.h>
451+#include "milieu.h"
452+#include "softfloat.h"
453+#include "systfloat.h"
454+
455+extern unsigned int spefscr;
456+
457+float32 syst_int32_to_float32( int32 a )
458+{
459+ float32 z;
460+
461+ *( (float *) &z ) = a;
462+ spefscr = __builtin_spe_mfspefscr();
463+ return z;
464+
465+}
466+
467+float64 syst_int32_to_float64( int32 a )
468+{
469+ float64 z;
470+
471+ *( (double *) &z ) = a;
472+ spefscr = __builtin_spe_mfspefscr();
473+ return z;
474+
475+}
476+
477+#if defined( FLOATX80 ) && defined( LONG_DOUBLE_IS_FLOATX80 )
478+
479+floatx80 syst_int32_to_floatx80( int32 a )
480+{
481+ floatx80 z;
482+
483+ *( (long double *) &z ) = a;
484+ return z;
485+
486+}
487+
488+#endif
489+
490+#if defined( FLOAT128 ) && defined( LONG_DOUBLE_IS_FLOAT128 )
491+
492+float128 syst_int32_to_float128( int32 a )
493+{
494+ float128 z;
495+
496+ *( (long double *) &z ) = a;
497+ return z;
498+
499+}
500+
501+#endif
502+
503+#ifdef BITS64
504+
505+float32 syst_int64_to_float32( int64 a )
506+{
507+ float32 z;
508+
509+ *( (float *) &z ) = a;
510+ spefscr = __builtin_spe_mfspefscr();
511+ return z;
512+
513+}
514+
515+float64 syst_int64_to_float64( int64 a )
516+{
517+ float64 z;
518+
519+ *( (double *) &z ) = a;
520+ spefscr = __builtin_spe_mfspefscr();
521+ return z;
522+
523+}
524+
525+#if defined( FLOATX80 ) && defined( LONG_DOUBLE_IS_FLOATX80 )
526+
527+floatx80 syst_int64_to_floatx80( int64 a )
528+{
529+ floatx80 z;
530+
531+ *( (long double *) &z ) = a;
532+ return z;
533+
534+}
535+
536+#endif
537+
538+#if defined( FLOAT128 ) && defined( LONG_DOUBLE_IS_FLOAT128 )
539+
540+float128 syst_int64_to_float128( int64 a )
541+{
542+ float128 z;
543+
544+ *( (long double *) &z ) = a;
545+ return z;
546+
547+}
548+
549+#endif
550+
551+#endif
552+
553+int32 syst_float32_to_int32_round_to_zero( float32 a )
554+{
555+ int32 z = *( (float *) &a );
556+ spefscr = __builtin_spe_mfspefscr();
557+
558+ return z;
559+
560+}
561+
562+#ifdef BITS64
563+
564+int64 syst_float32_to_int64_round_to_zero( float32 a )
565+{
566+ int64 z = *( (float *) &a );
567+ spefscr = __builtin_spe_mfspefscr();
568+ return z;
569+
570+}
571+
572+#endif
573+
574+float64 syst_float32_to_float64( float32 a )
575+{
576+ float64 z;
577+
578+ *( (double *) &z ) = *( (float *) &a );
579+ spefscr = __builtin_spe_mfspefscr();
580+ return z;
581+
582+}
583+
584+#if defined( FLOATX80 ) && defined( LONG_DOUBLE_IS_FLOATX80 )
585+
586+floatx80 syst_float32_to_floatx80( float32 a )
587+{
588+ floatx80 z;
589+
590+ *( (long double *) &z ) = *( (float *) &a );
591+ return z;
592+
593+}
594+
595+#endif
596+
597+#if defined( FLOAT128 ) && defined( LONG_DOUBLE_IS_FLOAT128 )
598+
599+float128 syst_float32_to_float128( float32 a )
600+{
601+ float128 z;
602+
603+ *( (long double *) &z ) = *( (float *) &a );
604+ return z;
605+
606+}
607+
608+#endif
609+
610+float32 syst_float32_add( float32 a, float32 b )
611+{
612+ float32 z;
613+
614+ *( (float *) &z ) = *( (float *) &a ) + *( (float *) &b );
615+ spefscr = __builtin_spe_mfspefscr();
616+ return z;
617+
618+}
619+
620+float32 syst_float32_sub( float32 a, float32 b )
621+{
622+ float32 z;
623+
624+ *( (float *) &z ) = *( (float *) &a ) - *( (float *) &b );
625+ spefscr = __builtin_spe_mfspefscr();
626+ return z;
627+
628+}
629+
630+float32 syst_float32_mul( float32 a, float32 b )
631+{
632+ float32 z;
633+
634+ *( (float *) &z ) = *( (float *) &a ) * *( (float *) &b );
635+ spefscr = __builtin_spe_mfspefscr();
636+ return z;
637+
638+}
639+
640+float32 syst_float32_div( float32 a, float32 b )
641+{
642+ float32 z;
643+
644+ *( (float *) &z ) = *( (float *) &a ) / *( (float *) &b );
645+ spefscr = __builtin_spe_mfspefscr();
646+ return z;
647+
648+}
649+
650+flag syst_float32_eq( float32 a, float32 b )
651+{
652+ flag f = ( *( (float *) &a ) == *( (float *) &b ) );
653+ spefscr = __builtin_spe_mfspefscr();
654+ return f;
655+
656+}
657+
658+flag syst_float32_le( float32 a, float32 b )
659+{
660+ flag f = ( *( (float *) &a ) <= *( (float *) &b ) );
661+ spefscr = __builtin_spe_mfspefscr();
662+ return f;
663+
664+}
665+
666+flag syst_float32_lt( float32 a, float32 b )
667+{
668+ flag f = ( *( (float *) &a ) < *( (float *) &b ) );
669+ spefscr = __builtin_spe_mfspefscr();
670+ return f;
671+
672+}
673+
674+int32 syst_float64_to_int32_round_to_zero( float64 a )
675+{
676+ int32 z = *( (double *) &a );
677+ spefscr = __builtin_spe_mfspefscr();
678+ return z;
679+
680+}
681+
682+#ifdef BITS64
683+
684+int64 syst_float64_to_int64_round_to_zero( float64 a )
685+{
686+ int64 z = *( (double *) &a );
687+ spefscr = __builtin_spe_mfspefscr();
688+ return z;
689+
690+}
691+
692+#endif
693+
694+float32 syst_float64_to_float32( float64 a )
695+{
696+ float32 z;
697+
698+ *( (float *) &z ) = *( (double *) &a );
699+ spefscr = __builtin_spe_mfspefscr();
700+ return z;
701+
702+}
703+
704+#if defined( FLOATX80 ) && defined( LONG_DOUBLE_IS_FLOATX80 )
705+
706+floatx80 syst_float64_to_floatx80( float64 a )
707+{
708+ floatx80 z;
709+
710+ *( (long double *) &z ) = *( (double *) &a );
711+ return z;
712+
713+}
714+
715+#endif
716+
717+#if defined( FLOAT128 ) && defined( LONG_DOUBLE_IS_FLOAT128 )
718+
719+float128 syst_float64_to_float128( float64 a )
720+{
721+ float128 z;
722+
723+ *( (long double *) &z ) = *( (double *) &a );
724+ return z;
725+
726+}
727+
728+#endif
729+
730+float64 syst_float64_add( float64 a, float64 b )
731+{
732+ float64 z;
733+
734+ *( (double *) &z ) = *( (double *) &a ) + *( (double *) &b );
735+ spefscr = __builtin_spe_mfspefscr();
736+ return z;
737+
738+}
739+
740+float64 syst_float64_sub( float64 a, float64 b )
741+{
742+ float64 z;
743+
744+ *( (double *) &z ) = *( (double *) &a ) - *( (double *) &b );
745+ spefscr = __builtin_spe_mfspefscr();
746+ return z;
747+
748+}
749+
750+float64 syst_float64_mul( float64 a, float64 b )
751+{
752+ float64 z;
753+
754+ *( (double *) &z ) = *( (double *) &a ) * *( (double *) &b );
755+ spefscr = __builtin_spe_mfspefscr();
756+ return z;
757+
758+}
759+
760+float64 syst_float64_div( float64 a, float64 b )
761+{
762+ float64 z;
763+
764+ *( (double *) &z ) = *( (double *) &a ) / *( (double *) &b );
765+ spefscr = __builtin_spe_mfspefscr();
766+ return z;
767+
768+}
769+
770+float64 syst_float64_sqrt( float64 a )
771+{
772+ /* Ebony
773+ float64 z;
774+
775+ *( (double *) &z ) = sqrt( *( (double *) &a ) );
776+ spefscr = __builtin_spe_mfspefscr();
777+ return z;
778+ */
779+
780+}
781+
782+flag syst_float64_eq( float64 a, float64 b )
783+{
784+ flag f = ( *( (double *) &a ) == *( (double *) &b ) );
785+ spefscr = __builtin_spe_mfspefscr();
786+ return f;
787+
788+}
789+
790+flag syst_float64_le( float64 a, float64 b )
791+{
792+ flag f = ( *( (double *) &a ) <= *( (double *) &b ) );
793+ spefscr = __builtin_spe_mfspefscr();
794+ return f;
795+
796+}
797+
798+flag syst_float64_lt( float64 a, float64 b )
799+{
800+ flag f = ( *( (double *) &a ) < *( (double *) &b ) );
801+ spefscr = __builtin_spe_mfspefscr();
802+ return f;
803+
804+}
805+
806+#if defined( FLOATX80 ) && defined( LONG_DOUBLE_IS_FLOATX80 )
807+
808+int32 syst_floatx80_to_int32_round_to_zero( floatx80 a )
809+{
810+
811+ return *( (long double *) &a );
812+
813+}
814+
815+#ifdef BITS64
816+
817+int64 syst_floatx80_to_int64_round_to_zero( floatx80 a )
818+{
819+
820+ return *( (long double *) &a );
821+
822+}
823+
824+#endif
825+
826+float32 syst_floatx80_to_float32( floatx80 a )
827+{
828+ float32 z;
829+
830+ *( (float *) &z ) = *( (long double *) &a );
831+ return z;
832+
833+}
834+
835+float64 syst_floatx80_to_float64( floatx80 a )
836+{
837+ float64 z;
838+
839+ *( (double *) &z ) = *( (long double *) &a );
840+ return z;
841+
842+}
843+
844+floatx80 syst_floatx80_add( floatx80 a, floatx80 b )
845+{
846+ floatx80 z;
847+
848+ *( (long double *) &z ) =
849+ *( (long double *) &a ) + *( (long double *) &b );
850+ return z;
851+
852+}
853+
854+floatx80 syst_floatx80_sub( floatx80 a, floatx80 b )
855+{
856+ floatx80 z;
857+
858+ *( (long double *) &z ) =
859+ *( (long double *) &a ) - *( (long double *) &b );
860+ return z;
861+
862+}
863+
864+floatx80 syst_floatx80_mul( floatx80 a, floatx80 b )
865+{
866+ floatx80 z;
867+
868+ *( (long double *) &z ) =
869+ *( (long double *) &a ) * *( (long double *) &b );
870+ return z;
871+
872+}
873+
874+floatx80 syst_floatx80_div( floatx80 a, floatx80 b )
875+{
876+ floatx80 z;
877+
878+ *( (long double *) &z ) =
879+ *( (long double *) &a ) / *( (long double *) &b );
880+ spefscr = __builtin_spe_mfspefscr();
881+ return z;
882+
883+}
884+
885+flag syst_floatx80_eq( floatx80 a, floatx80 b )
886+{
887+
888+ return ( *( (long double *) &a ) == *( (long double *) &b ) );
889+
890+}
891+
892+flag syst_floatx80_le( floatx80 a, floatx80 b )
893+{
894+
895+ return ( *( (long double *) &a ) <= *( (long double *) &b ) );
896+
897+}
898+
899+flag syst_floatx80_lt( floatx80 a, floatx80 b )
900+{
901+
902+ return ( *( (long double *) &a ) < *( (long double *) &b ) );
903+
904+}
905+
906+#endif
907+
908+#if defined( FLOAT128 ) && defined( LONG_DOUBLE_IS_FLOAT128 )
909+
910+int32 syst_float128_to_int32_round_to_zero( float128 a )
911+{
912+
913+ return *( (long double *) &a );
914+
915+}
916+
917+#ifdef BITS64
918+
919+int64 syst_float128_to_int64_round_to_zero( float128 a )
920+{
921+
922+ return *( (long double *) &a );
923+
924+}
925+
926+#endif
927+
928+float32 syst_float128_to_float32( float128 a )
929+{
930+ float32 z;
931+
932+ *( (float *) &z ) = *( (long double *) &a );
933+ return z;
934+
935+}
936+
937+float64 syst_float128_to_float64( float128 a )
938+{
939+ float64 z;
940+
941+ *( (double *) &z ) = *( (long double *) &a );
942+ return z;
943+
944+}
945+
946+float128 syst_float128_add( float128 a, float128 b )
947+{
948+ float128 z;
949+
950+ *( (long double *) &z ) =
951+ *( (long double *) &a ) + *( (long double *) &b );
952+ return z;
953+
954+}
955+
956+float128 syst_float128_sub( float128 a, float128 b )
957+{
958+ float128 z;
959+
960+ *( (long double *) &z ) =
961+ *( (long double *) &a ) - *( (long double *) &b );
962+ return z;
963+
964+}
965+
966+float128 syst_float128_mul( float128 a, float128 b )
967+{
968+ float128 z;
969+
970+ *( (long double *) &z ) =
971+ *( (long double *) &a ) * *( (long double *) &b );
972+ return z;
973+
974+}
975+
976+float128 syst_float128_div( float128 a, float128 b )
977+{
978+ float128 z;
979+
980+ *( (long double *) &z ) =
981+ *( (long double *) &a ) / *( (long double *) &b );
982+ spefscr = __builtin_spe_mfspefscr();
983+ return z;
984+
985+}
986+
987+flag syst_float128_eq( float128 a, float128 b )
988+{
989+
990+ return ( *( (long double *) &a ) == *( (long double *) &b ) );
991+
992+}
993+
994+flag syst_float128_le( float128 a, float128 b )
995+{
996+
997+ return ( *( (long double *) &a ) <= *( (long double *) &b ) );
998+
999+}
1000+
1001+flag syst_float128_lt( float128 a, float128 b )
1002+{
1003+
1004+ return ( *( (long double *) &a ) < *( (long double *) &b ) );
1005+
1006+}
1007+
1008+#endif
1009+
1010diff --git a/testfloat/powerpc-linux-gcc/systmodes.c b/testfloat/powerpc-linux-gcc/systmodes.c
1011new file mode 100644
1012index 0000000..143cdea
1013--- /dev/null
1014+++ b/testfloat/powerpc-linux-gcc/systmodes.c
1015@@ -0,0 +1,67 @@
1016+/*
1017+ * This file is derived from testfloat/386-Win32-gcc/systmodes.S,
1018+ * the copyright for that material belongs to the original owners.
1019+ *
1020+ * Additional material and changes where applicable is:
1021+ * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved.
1022+ *
1023+ * Author: Ebony Zhu, <ebony.zhu@freescale.com>
1024+ * Yu Liu, <yu.liu@freescale.com>
1025+ */
1026+
1027+/*
1028+===============================================================================
1029+
1030+This C source file is part of TestFloat, Release 2a, a package of programs
1031+for testing the correctness of floating-point arithmetic complying to the
1032+IEC/IEEE Standard for Floating-Point.
1033+
1034+Written by John R. Hauser. More information is available through the Web
1035+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
1036+
1037+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
1038+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
1039+TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
1040+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
1041+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
1042+
1043+Derivative works are acceptable, even for commercial purposes, so long as
1044+(1) they include prominent notice that the work is derivative, and (2) they
1045+include prominent notice akin to these four paragraphs for those parts of
1046+this code that are retained.
1047+
1048+===============================================================================
1049+*/
1050+
1051+#include <fenv.h>
1052+#include "milieu.h"
1053+#include "systmodes.h"
1054+/*
1055+-------------------------------------------------------------------------------
1056+Sets the system's IEC/IEEE floating-point rounding mode. Also disables all
1057+system exception traps.
1058+-------------------------------------------------------------------------------
1059+*/
1060+int rounding;
1061+
1062+void syst_float_set_rounding_mode( int8 roundingMode )
1063+{
1064+ (void) fesetround ( roundingMode );
1065+ rounding = roundingMode;
1066+}
1067+
1068+/*
1069+-------------------------------------------------------------------------------
1070+Sets the rounding precision of subsequent extended double-precision
1071+operations. The `precision' argument should be one of 0, 32, 64, or 80.
1072+If `precision' is 32, the rounding precision is set equivalent to single
1073+precision; else if `precision' is 64, the rounding precision is set
1074+equivalent to double precision; else the rounding precision is set to full
1075+extended double precision.
1076+-------------------------------------------------------------------------------
1077+*/
1078+void syst_float_set_rounding_precision( int8 precision )
1079+{
1080+
1081+}
1082+
1083diff --git a/testfloat/templates/Makefile b/testfloat/templates/Makefile
1084index f5f3cde..18cffe0 100644
1085--- a/testfloat/templates/Makefile
1086+++ b/testfloat/templates/Makefile
1087@@ -1,15 +1,21 @@
1088
1089-PROCESSOR_H = ../../processors/!!!processor.h
1090+#PROCESSOR_H = ../../processors/!!!processor.h
1091+PROCESSOR_H = ../../processors/POWERPC-gcc.h
1092 SOFTFLOAT_VERSION = bits64
1093-TARGET = !!!target
1094-SOFTFLOAT_DIR = ../../softfloat/$(SOFTFLOAT_VERSION)/$(TARGET)
1095+
1096+#TARGET = !!!target
1097+TARGET = powerpc-GCC
1098+SOFTFLOAT_DIR = ../../../SoftFloat-2b/softfloat/$(SOFTFLOAT_VERSION)/$(TARGET)
1099
1100 OBJ = .o
1101 EXE =
1102 INCLUDES = -I. -I.. -I$(SOFTFLOAT_DIR)
1103-COMPILE_C = gcc -c -o $@ $(INCLUDES) -I- -O2
1104-COMPILE_SLOWFLOAT_C = gcc -c -o $@ $(INCLUDES) -I- -O3
1105-LINK = gcc -o $@
1106+#COMPILE_C = gcc -c -o $@ $(INCLUDES) -I- -O2
1107+#COMPILE_SLOWFLOAT_C = gcc -c -o $@ $(INCLUDES) -I- -O3
1108+#LINK = gcc -o $@
1109+COMPILE_C = /opt/mtwk/usr/local/gcc-3_4-e500-glibc-2.3.4-dp/powerpc-linux-gnuspe/bin/powerpc-linux-gnuspe-gcc -c -o $@ $(INCLUDES) -I- -O2
1110+COMPILE_SLOWFLOAT_C = /opt/mtwk/usr/local/gcc-3_4-e500-glibc-2.3.4-dp/powerpc-linux-gnuspe/bin/powerpc-linux-gnuspe-gcc -c -o $@ $(INCLUDES) -I- -O3
1111+LINK = /opt/mtwk/usr/local/gcc-3_4-e500-glibc-2.3.4-dp/powerpc-linux-gnuspe/bin/powerpc-linux-gnuspe-gcc -o $@
1112
1113 SOFTFLOAT_H = $(SOFTFLOAT_DIR)/softfloat.h
1114 SOFTFLOAT_OBJ = $(SOFTFLOAT_DIR)/softfloat$(OBJ)
1115diff --git a/testfloat/templates/milieu.h b/testfloat/templates/milieu.h
1116index 56d3ac4..3214ca8 100644
1117--- a/testfloat/templates/milieu.h
1118+++ b/testfloat/templates/milieu.h
1119@@ -28,7 +28,7 @@ this code that are retained.
1120 Include common integer types and flags.
1121 -------------------------------------------------------------------------------
1122 */
1123-#include "../../processors/!!!processor.h"
1124+#include "../../processors/SPARC-gcc.h"
1125
1126 /*
1127 -------------------------------------------------------------------------------
1128diff --git a/testfloat/testFunction.h b/testfloat/testFunction.h
1129index 04bf856..00139a7 100644
1130--- a/testfloat/testFunction.h
1131+++ b/testfloat/testFunction.h
1132@@ -126,8 +126,8 @@ extern const flag functionExists[ NUM_FUNCTIONS ];
1133 enum {
1134 ROUND_NEAREST_EVEN = 1,
1135 ROUND_TO_ZERO,
1136- ROUND_DOWN,
1137 ROUND_UP,
1138+ ROUND_DOWN,
1139 NUM_ROUNDINGMODES
1140 };
1141
1142diff --git a/testfloat/testLoops.c b/testfloat/testLoops.c
1143index 8ba92f3..ba05548 100644
1144--- a/testfloat/testLoops.c
1145+++ b/testfloat/testLoops.c
1146@@ -488,6 +488,11 @@ void
1147 (void) testFlagsFunctionPtr();
1148 testZ = testFunction( testCases_a_int32 );
1149 testFlags = testFlagsFunctionPtr();
1150+#ifdef TEST_KERNEL_EMU
1151+ if (! syst_float_is_soft_emu()){
1152+ continue;
1153+ }
1154+#endif
1155 --count;
1156 if ( count == 0 ) {
1157 checkEarlyExit();
1158@@ -539,6 +544,11 @@ void
1159 (void) testFlagsFunctionPtr();
1160 testZ = testFunction( testCases_a_int32 );
1161 testFlags = testFlagsFunctionPtr();
1162+#ifdef TEST_KERNEL_EMU
1163+ if (! syst_float_is_soft_emu()){
1164+ continue;
1165+ }
1166+#endif
1167 --count;
1168 if ( count == 0 ) {
1169 checkEarlyExit();
1170@@ -592,6 +602,11 @@ void
1171 (void) testFlagsFunctionPtr();
1172 testZ = testFunction( testCases_a_int32 );
1173 testFlags = testFlagsFunctionPtr();
1174+#ifdef TEST_KERNEL_EMU
1175+ if (! syst_float_is_soft_emu()){
1176+ continue;
1177+ }
1178+#endif
1179 --count;
1180 if ( count == 0 ) {
1181 checkEarlyExit();
1182@@ -647,6 +662,11 @@ void
1183 (void) testFlagsFunctionPtr();
1184 testZ = testFunction( testCases_a_int32 );
1185 testFlags = testFlagsFunctionPtr();
1186+#ifdef TEST_KERNEL_EMU
1187+ if (! syst_float_is_soft_emu()){
1188+ continue;
1189+ }
1190+#endif
1191 --count;
1192 if ( count == 0 ) {
1193 checkEarlyExit();
1194@@ -702,6 +722,11 @@ void
1195 (void) testFlagsFunctionPtr();
1196 testZ = testFunction( testCases_a_int64 );
1197 testFlags = testFlagsFunctionPtr();
1198+#ifdef TEST_KERNEL_EMU
1199+ if (! syst_float_is_soft_emu()){
1200+ continue;
1201+ }
1202+#endif
1203 --count;
1204 if ( count == 0 ) {
1205 checkEarlyExit();
1206@@ -753,6 +778,11 @@ void
1207 (void) testFlagsFunctionPtr();
1208 testZ = testFunction( testCases_a_int64 );
1209 testFlags = testFlagsFunctionPtr();
1210+#ifdef TEST_KERNEL_EMU
1211+ if (! syst_float_is_soft_emu()){
1212+ continue;
1213+ }
1214+#endif
1215 --count;
1216 if ( count == 0 ) {
1217 checkEarlyExit();
1218@@ -806,6 +836,11 @@ void
1219 (void) testFlagsFunctionPtr();
1220 testZ = testFunction( testCases_a_int64 );
1221 testFlags = testFlagsFunctionPtr();
1222+#ifdef TEST_KERNEL_EMU
1223+ if (! syst_float_is_soft_emu()){
1224+ continue;
1225+ }
1226+#endif
1227 --count;
1228 if ( count == 0 ) {
1229 checkEarlyExit();
1230@@ -861,6 +896,11 @@ void
1231 (void) testFlagsFunctionPtr();
1232 testZ = testFunction( testCases_a_int64 );
1233 testFlags = testFlagsFunctionPtr();
1234+#ifdef TEST_KERNEL_EMU
1235+ if (! syst_float_is_soft_emu()){
1236+ continue;
1237+ }
1238+#endif
1239 --count;
1240 if ( count == 0 ) {
1241 checkEarlyExit();
1242@@ -916,6 +956,11 @@ void
1243 (void) testFlagsFunctionPtr();
1244 testZ = testFunction( testCases_a_float32 );
1245 testFlags = testFlagsFunctionPtr();
1246+#ifdef TEST_KERNEL_EMU
1247+ if (! syst_float_is_soft_emu()){
1248+ continue;
1249+ }
1250+#endif
1251 --count;
1252 if ( count == 0 ) {
1253 checkEarlyExit();
1254@@ -973,6 +1018,11 @@ void
1255 (void) testFlagsFunctionPtr();
1256 testZ = testFunction( testCases_a_float32 );
1257 testFlags = testFlagsFunctionPtr();
1258+#ifdef TEST_KERNEL_EMU
1259+ if (! syst_float_is_soft_emu()){
1260+ continue;
1261+ }
1262+#endif
1263 --count;
1264 if ( count == 0 ) {
1265 checkEarlyExit();
1266@@ -1030,6 +1080,11 @@ void
1267 (void) testFlagsFunctionPtr();
1268 testZ = testFunction( testCases_a_float32 );
1269 testFlags = testFlagsFunctionPtr();
1270+#ifdef TEST_KERNEL_EMU
1271+ if (! syst_float_is_soft_emu()){
1272+ continue;
1273+ }
1274+#endif
1275 --count;
1276 if ( count == 0 ) {
1277 checkEarlyExit();
1278@@ -1087,6 +1142,11 @@ void
1279 (void) testFlagsFunctionPtr();
1280 testZ = testFunction( testCases_a_float32 );
1281 testFlags = testFlagsFunctionPtr();
1282+#ifdef TEST_KERNEL_EMU
1283+ if (! syst_float_is_soft_emu()){
1284+ continue;
1285+ }
1286+#endif
1287 --count;
1288 if ( count == 0 ) {
1289 checkEarlyExit();
1290@@ -1146,6 +1206,11 @@ void
1291 (void) testFlagsFunctionPtr();
1292 testZ = testFunction( testCases_a_float32 );
1293 testFlags = testFlagsFunctionPtr();
1294+#ifdef TEST_KERNEL_EMU
1295+ if (! syst_float_is_soft_emu()){
1296+ continue;
1297+ }
1298+#endif
1299 --count;
1300 if ( count == 0 ) {
1301 checkEarlyExit();
1302@@ -1203,6 +1268,11 @@ void
1303 (void) testFlagsFunctionPtr();
1304 testZ = testFunction( testCases_a_float32 );
1305 testFlags = testFlagsFunctionPtr();
1306+#ifdef TEST_KERNEL_EMU
1307+ if (! syst_float_is_soft_emu()){
1308+ continue;
1309+ }
1310+#endif
1311 --count;
1312 if ( count == 0 ) {
1313 checkEarlyExit();
1314@@ -1260,6 +1330,11 @@ void
1315 (void) testFlagsFunctionPtr();
1316 testZ = testFunction( testCases_a_float32, testCases_b_float32 );
1317 testFlags = testFlagsFunctionPtr();
1318+#ifdef TEST_KERNEL_EMU
1319+ if (! syst_float_is_soft_emu()){
1320+ continue;
1321+ }
1322+#endif
1323 --count;
1324 if ( count == 0 ) {
1325 checkEarlyExit();
1326@@ -1312,6 +1387,25 @@ void
1327 (void) testFlagsFunctionPtr();
1328 testZ = testFunction( testCases_a_float32, testCases_b_float32 );
1329 testFlags = testFlagsFunctionPtr();
1330+
1331+if(testCases_a_float32 == 0x7ffffe && testCases_b_float32 == 0x3f7ffffe)
1332+{
1333+
1334+ writeErrorFound( 10000 - count );
1335+ writeInputs_ab_float32();
1336+ fputs( " ", stdout );
1337+ writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
1338+ fflush( stdout );
1339+ if (! syst_float_is_soft_emu()){
1340+ exit(-1);
1341+ }
1342+}
1343+#ifdef TEST_KERNEL_EMU
1344+ if (! syst_float_is_soft_emu()){
1345+ continue;
1346+ }
1347+#endif
1348+
1349 --count;
1350 if ( count == 0 ) {
1351 checkEarlyExit();
1352@@ -1370,6 +1464,11 @@ void
1353 (void) testFlagsFunctionPtr();
1354 testZ = testFunction( testCases_a_float64 );
1355 testFlags = testFlagsFunctionPtr();
1356+#ifdef TEST_KERNEL_EMU
1357+ if (! syst_float_is_soft_emu()){
1358+ continue;
1359+ }
1360+#endif
1361 --count;
1362 if ( count == 0 ) {
1363 checkEarlyExit();
1364@@ -1427,6 +1526,11 @@ void
1365 (void) testFlagsFunctionPtr();
1366 testZ = testFunction( testCases_a_float64 );
1367 testFlags = testFlagsFunctionPtr();
1368+#ifdef TEST_KERNEL_EMU
1369+ if (! syst_float_is_soft_emu()){
1370+ continue;
1371+ }
1372+#endif
1373 --count;
1374 if ( count == 0 ) {
1375 checkEarlyExit();
1376@@ -1484,6 +1588,11 @@ void
1377 (void) testFlagsFunctionPtr();
1378 testZ = testFunction( testCases_a_float64 );
1379 testFlags = testFlagsFunctionPtr();
1380+#ifdef TEST_KERNEL_EMU
1381+ if (! syst_float_is_soft_emu()){
1382+ continue;
1383+ }
1384+#endif
1385 --count;
1386 if ( count == 0 ) {
1387 checkEarlyExit();
1388@@ -1541,6 +1650,11 @@ void
1389 (void) testFlagsFunctionPtr();
1390 testZ = testFunction( testCases_a_float64 );
1391 testFlags = testFlagsFunctionPtr();
1392+#ifdef TEST_KERNEL_EMU
1393+ if (! syst_float_is_soft_emu()){
1394+ continue;
1395+ }
1396+#endif
1397 --count;
1398 if ( count == 0 ) {
1399 checkEarlyExit();
1400@@ -1600,6 +1714,11 @@ void
1401 (void) testFlagsFunctionPtr();
1402 testZ = testFunction( testCases_a_float64 );
1403 testFlags = testFlagsFunctionPtr();
1404+#ifdef TEST_KERNEL_EMU
1405+ if (! syst_float_is_soft_emu()){
1406+ continue;
1407+ }
1408+#endif
1409 --count;
1410 if ( count == 0 ) {
1411 checkEarlyExit();
1412@@ -1657,6 +1776,11 @@ void
1413 (void) testFlagsFunctionPtr();
1414 testZ = testFunction( testCases_a_float64 );
1415 testFlags = testFlagsFunctionPtr();
1416+#ifdef TEST_KERNEL_EMU
1417+ if (! syst_float_is_soft_emu()){
1418+ continue;
1419+ }
1420+#endif
1421 --count;
1422 if ( count == 0 ) {
1423 checkEarlyExit();
1424@@ -1714,6 +1838,11 @@ void
1425 (void) testFlagsFunctionPtr();
1426 testZ = testFunction( testCases_a_float64, testCases_b_float64 );
1427 testFlags = testFlagsFunctionPtr();
1428+#ifdef TEST_KERNEL_EMU
1429+ if (! syst_float_is_soft_emu()){
1430+ continue;
1431+ }
1432+#endif
1433 --count;
1434 if ( count == 0 ) {
1435 checkEarlyExit();
1436@@ -1766,6 +1895,13 @@ void
1437 (void) testFlagsFunctionPtr();
1438 testZ = testFunction( testCases_a_float64, testCases_b_float64 );
1439 testFlags = testFlagsFunctionPtr();
1440+
1441+#ifdef TEST_KERNEL_EMU
1442+ if (! syst_float_is_soft_emu()){
1443+ continue;
1444+ }
1445+#endif
1446+
1447 --count;
1448 if ( count == 0 ) {
1449 checkEarlyExit();
1450@@ -1826,6 +1962,11 @@ void
1451 (void) testFlagsFunctionPtr();
1452 testZ = testFunction( testCases_a_floatx80 );
1453 testFlags = testFlagsFunctionPtr();
1454+#ifdef TEST_KERNEL_EMU
1455+ if (! syst_float_is_soft_emu()){
1456+ continue;
1457+ }
1458+#endif
1459 --count;
1460 if ( count == 0 ) {
1461 checkEarlyExit();
1462@@ -1883,6 +2024,11 @@ void
1463 (void) testFlagsFunctionPtr();
1464 testZ = testFunction( testCases_a_floatx80 );
1465 testFlags = testFlagsFunctionPtr();
1466+#ifdef TEST_KERNEL_EMU
1467+ if (! syst_float_is_soft_emu()){
1468+ continue;
1469+ }
1470+#endif
1471 --count;
1472 if ( count == 0 ) {
1473 checkEarlyExit();
1474@@ -1940,6 +2086,11 @@ void
1475 (void) testFlagsFunctionPtr();
1476 testZ = testFunction( testCases_a_floatx80 );
1477 testFlags = testFlagsFunctionPtr();
1478+#ifdef TEST_KERNEL_EMU
1479+ if (! syst_float_is_soft_emu()){
1480+ continue;
1481+ }
1482+#endif
1483 --count;
1484 if ( count == 0 ) {
1485 checkEarlyExit();
1486@@ -1995,6 +2146,11 @@ void
1487 (void) testFlagsFunctionPtr();
1488 testZ = testFunction( testCases_a_floatx80 );
1489 testFlags = testFlagsFunctionPtr();
1490+#ifdef TEST_KERNEL_EMU
1491+ if (! syst_float_is_soft_emu()){
1492+ continue;
1493+ }
1494+#endif
1495 --count;
1496 if ( count == 0 ) {
1497 checkEarlyExit();
1498@@ -2052,6 +2208,11 @@ void
1499 (void) testFlagsFunctionPtr();
1500 testZ = testFunction( testCases_a_floatx80 );
1501 testFlags = testFlagsFunctionPtr();
1502+#ifdef TEST_KERNEL_EMU
1503+ if (! syst_float_is_soft_emu()){
1504+ continue;
1505+ }
1506+#endif
1507 --count;
1508 if ( count == 0 ) {
1509 checkEarlyExit();
1510@@ -2109,6 +2270,11 @@ void
1511 (void) testFlagsFunctionPtr();
1512 testZ = testFunction( testCases_a_floatx80 );
1513 testFlags = testFlagsFunctionPtr();
1514+#ifdef TEST_KERNEL_EMU
1515+ if (! syst_float_is_soft_emu()){
1516+ continue;
1517+ }
1518+#endif
1519 --count;
1520 if ( count == 0 ) {
1521 checkEarlyExit();
1522@@ -2166,6 +2332,11 @@ void
1523 (void) testFlagsFunctionPtr();
1524 testZ = testFunction( testCases_a_floatx80, testCases_b_floatx80 );
1525 testFlags = testFlagsFunctionPtr();
1526+#ifdef TEST_KERNEL_EMU
1527+ if (! syst_float_is_soft_emu()){
1528+ continue;
1529+ }
1530+#endif
1531 --count;
1532 if ( count == 0 ) {
1533 checkEarlyExit();
1534@@ -2218,6 +2389,11 @@ void
1535 (void) testFlagsFunctionPtr();
1536 testZ = testFunction( testCases_a_floatx80, testCases_b_floatx80 );
1537 testFlags = testFlagsFunctionPtr();
1538+#ifdef TEST_KERNEL_EMU
1539+ if (! syst_float_is_soft_emu()){
1540+ continue;
1541+ }
1542+#endif
1543 --count;
1544 if ( count == 0 ) {
1545 checkEarlyExit();
1546@@ -2280,6 +2456,11 @@ void
1547 (void) testFlagsFunctionPtr();
1548 testZ = testFunction( testCases_a_float128 );
1549 testFlags = testFlagsFunctionPtr();
1550+#ifdef TEST_KERNEL_EMU
1551+ if (! syst_float_is_soft_emu()){
1552+ continue;
1553+ }
1554+#endif
1555 --count;
1556 if ( count == 0 ) {
1557 checkEarlyExit();
1558@@ -2337,6 +2518,11 @@ void
1559 (void) testFlagsFunctionPtr();
1560 testZ = testFunction( testCases_a_float128 );
1561 testFlags = testFlagsFunctionPtr();
1562+#ifdef TEST_KERNEL_EMU
1563+ if (! syst_float_is_soft_emu()){
1564+ continue;
1565+ }
1566+#endif
1567 --count;
1568 if ( count == 0 ) {
1569 checkEarlyExit();
1570@@ -2394,6 +2580,11 @@ void
1571 (void) testFlagsFunctionPtr();
1572 testZ = testFunction( testCases_a_float128 );
1573 testFlags = testFlagsFunctionPtr();
1574+#ifdef TEST_KERNEL_EMU
1575+ if (! syst_float_is_soft_emu()){
1576+ continue;
1577+ }
1578+#endif
1579 --count;
1580 if ( count == 0 ) {
1581 checkEarlyExit();
1582@@ -2449,6 +2640,11 @@ void
1583 (void) testFlagsFunctionPtr();
1584 testZ = testFunction( testCases_a_float128 );
1585 testFlags = testFlagsFunctionPtr();
1586+#ifdef TEST_KERNEL_EMU
1587+ if (! syst_float_is_soft_emu()){
1588+ continue;
1589+ }
1590+#endif
1591 --count;
1592 if ( count == 0 ) {
1593 checkEarlyExit();
1594@@ -2506,6 +2702,11 @@ void
1595 (void) testFlagsFunctionPtr();
1596 testZ = testFunction( testCases_a_float128 );
1597 testFlags = testFlagsFunctionPtr();
1598+#ifdef TEST_KERNEL_EMU
1599+ if (! syst_float_is_soft_emu()){
1600+ continue;
1601+ }
1602+#endif
1603 --count;
1604 if ( count == 0 ) {
1605 checkEarlyExit();
1606@@ -2563,6 +2764,11 @@ void
1607 (void) testFlagsFunctionPtr();
1608 testZ = testFunction( testCases_a_float128 );
1609 testFlags = testFlagsFunctionPtr();
1610+#ifdef TEST_KERNEL_EMU
1611+ if (! syst_float_is_soft_emu()){
1612+ continue;
1613+ }
1614+#endif
1615 --count;
1616 if ( count == 0 ) {
1617 checkEarlyExit();
1618@@ -2620,6 +2826,11 @@ void
1619 (void) testFlagsFunctionPtr();
1620 testZ = testFunction( testCases_a_float128, testCases_b_float128 );
1621 testFlags = testFlagsFunctionPtr();
1622+#ifdef TEST_KERNEL_EMU
1623+ if (! syst_float_is_soft_emu()){
1624+ continue;
1625+ }
1626+#endif
1627 --count;
1628 if ( count == 0 ) {
1629 checkEarlyExit();
1630@@ -2672,6 +2883,11 @@ void
1631 (void) testFlagsFunctionPtr();
1632 testZ = testFunction( testCases_a_float128, testCases_b_float128 );
1633 testFlags = testFlagsFunctionPtr();
1634+#ifdef TEST_KERNEL_EMU
1635+ if (! syst_float_is_soft_emu()){
1636+ continue;
1637+ }
1638+#endif
1639 --count;
1640 if ( count == 0 ) {
1641 checkEarlyExit();
1642--
16431.5.4
1644