public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MPILIB: disable usage of floating point registers on parisc
@ 2013-05-05 22:08 Helge Deller
  2013-05-31 14:43 ` Dmitry Kasatkin
  0 siblings, 1 reply; 2+ messages in thread
From: Helge Deller @ 2013-05-05 22:08 UTC (permalink / raw)
  To: Dmitry Kasatkin, Linux Kernel Development, linux-parisc

The umul_ppmm() macro for parisc uses the xmpyu assembler statement
which does calculation via a floating point register.

But usage of floating point registers inside the Linux kernel are not
allowed and gcc will stop compilation due to the -mdisable-fpregs
compiler option.

Fix this by disabling the umul_ppmm() and udiv_qrnnd() macros. The
mpilib will then use the generic built-in implementations instead.

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
index 095ab15..d411355 100644
--- a/lib/mpi/longlong.h
+++ b/lib/mpi/longlong.h
@@ -318,7 +318,8 @@ extern UDItype __udiv_qrnnd();
 	     "rM" ((USItype)(bh)), \
 	     "rM" ((USItype)(al)), \
 	     "rM" ((USItype)(bl)))
-#if defined(_PA_RISC1_1)
+#if 0 && defined(_PA_RISC1_1)
+/* xmpyu uses floating point register which is not allowed in Linux kernel. */
 #define umul_ppmm(wh, wl, u, v) \
 do { \
 	union {UDItype __ll; \
@@ -337,7 +338,7 @@ do { \
 #define UMUL_TIME 40
 #define UDIV_TIME 80
 #endif
-#ifndef LONGLONG_STANDALONE
+#if 0 /* #ifndef LONGLONG_STANDALONE */
 #define udiv_qrnnd(q, r, n1, n0, d) \
 do { USItype __r; \
 	(q) = __udiv_qrnnd(&__r, (n1), (n0), (d)); \

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MPILIB: disable usage of floating point registers on parisc
  2013-05-05 22:08 [PATCH] MPILIB: disable usage of floating point registers on parisc Helge Deller
@ 2013-05-31 14:43 ` Dmitry Kasatkin
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Kasatkin @ 2013-05-31 14:43 UTC (permalink / raw)
  To: Helge Deller; +Cc: Dmitry Kasatkin, Linux Kernel Development, linux-parisc

Sorry. I am not at @intel.com any more. Did not see it.
Will handle.

- Dmitry


On Mon, May 6, 2013 at 1:08 AM, Helge Deller <deller@gmx.de> wrote:
> The umul_ppmm() macro for parisc uses the xmpyu assembler statement
> which does calculation via a floating point register.
>
> But usage of floating point registers inside the Linux kernel are not
> allowed and gcc will stop compilation due to the -mdisable-fpregs
> compiler option.
>
> Fix this by disabling the umul_ppmm() and udiv_qrnnd() macros. The
> mpilib will then use the generic built-in implementations instead.
>
> Signed-off-by: Helge Deller <deller@gmx.de>
>
> diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
> index 095ab15..d411355 100644
> --- a/lib/mpi/longlong.h
> +++ b/lib/mpi/longlong.h
> @@ -318,7 +318,8 @@ extern UDItype __udiv_qrnnd();
>              "rM" ((USItype)(bh)), \
>              "rM" ((USItype)(al)), \
>              "rM" ((USItype)(bl)))
> -#if defined(_PA_RISC1_1)
> +#if 0 && defined(_PA_RISC1_1)
> +/* xmpyu uses floating point register which is not allowed in Linux kernel. */
>  #define umul_ppmm(wh, wl, u, v) \
>  do { \
>         union {UDItype __ll; \
> @@ -337,7 +338,7 @@ do { \
>  #define UMUL_TIME 40
>  #define UDIV_TIME 80
>  #endif
> -#ifndef LONGLONG_STANDALONE
> +#if 0 /* #ifndef LONGLONG_STANDALONE */
>  #define udiv_qrnnd(q, r, n1, n0, d) \
>  do { USItype __r; \
>         (q) = __udiv_qrnnd(&__r, (n1), (n0), (d)); \
> --
> 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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-31 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-05 22:08 [PATCH] MPILIB: disable usage of floating point registers on parisc Helge Deller
2013-05-31 14:43 ` Dmitry Kasatkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox