diff mbox

[RFC] Update kernel math-emu code from current glibc soft-fp

Message ID alpine.DEB.2.10.1502191835490.22905@digraph.polyomino.org.uk
State RFC
Delegated to: David Miller
Headers show

Commit Message

Joseph Myers Feb. 19, 2015, 6:40 p.m. UTC
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.

Comments

David Miller Feb. 19, 2015, 7:10 p.m. UTC | #1
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.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kaz Kojima Feb. 20, 2015, 2:52 a.m. UTC | #2
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
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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)				\