* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
[not found] <alpine.DEB.2.10.1502061719210.27832@digraph.polyomino.org.uk>
@ 2015-02-06 17:41 ` Randy Dunlap
2015-02-06 18:03 ` Joseph Myers
[not found] ` <20150219.132122.204795202277130266.davem@davemloft.net>
1 sibling, 1 reply; 5+ 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] 5+ messages in thread
* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
2015-02-06 17:41 ` [PATCH RFC] Update kernel math-emu code from current glibc soft-fp Randy Dunlap
@ 2015-02-06 18:03 ` Joseph Myers
0 siblings, 0 replies; 5+ 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] 5+ messages in thread
* Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp
[not found] ` <20150219.132122.204795202277130266.davem@davemloft.net>
@ 2015-02-19 18:40 ` Joseph Myers
2015-02-19 19:10 ` David Miller
2015-02-20 2:52 ` Kaz Kojima
0 siblings, 2 replies; 5+ 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] 5+ 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
2015-02-20 2:52 ` Kaz Kojima
1 sibling, 0 replies; 5+ 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] 5+ 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
@ 2015-02-20 2:52 ` Kaz Kojima
1 sibling, 0 replies; 5+ 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] 5+ messages in thread
end of thread, other threads:[~2015-02-20 2:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <alpine.DEB.2.10.1502061719210.27832@digraph.polyomino.org.uk>
2015-02-06 17:41 ` [PATCH RFC] Update kernel math-emu code from current glibc soft-fp Randy Dunlap
2015-02-06 18:03 ` Joseph Myers
[not found] ` <20150219.132122.204795202277130266.davem@davemloft.net>
2015-02-19 18:40 ` Joseph Myers
2015-02-19 19:10 ` David Miller
2015-02-20 2:52 ` Kaz Kojima
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox