linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Hijacking CPU_FTR_VSX for BGQ QPX
@ 2012-11-09 17:43 Jimi Xenidis
  2012-11-09 19:57 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Jimi Xenidis @ 2012-11-09 17:43 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Michael Neuling; +Cc: linuxppc-dev

The CPU_FTR_* values are pretty tight (a few bits left) yes I need to =
save and restore the QPX registers.
There are 32 QPX registers, each 32 bytes in size, it is otherwise =
managed by the FPSCR and MSR[FP]

I was thinking that I could hijack the VSX, since there is no plan to =
add it to embedded yet.
I could be explicit or create an alieas fo the same bit, but the basic =
effect (after increasing the save area size) would be something like the =
diff below.
Thoughts?
-jx


diff --git a/arch/powerpc/kernel/fpu.S b/arch/powerpc/kernel/fpu.S
index de36955..adb08af 100644
--- a/arch/powerpc/kernel/fpu.S
+++ b/arch/powerpc/kernel/fpu.S
@@ -25,14 +25,24 @@
 #include <asm/asm-offsets.h>
 #include <asm/ptrace.h>
=20
-#ifdef CONFIG_VSX
+#if defined (CONFIG_VSX) && defined(CONFIG_BGQ)
+# error "This code depends on CONFIG_VSX and CONFIG_BGQ being exclusive
+#elif defined (CONFIG_VSX)
+# define _REST_32VSRS(n,c,base) REST_32VSRS(n,c,base)
+# define _SAVE_32VSRS(n,c,base) SAVE_32VSRS(n,c,base)
+#elif defined(CONFIG_BGQ)
+# define _REST_32VSRS(n,c,base) REST_32QRS(n,c,base)
+# define _SAVE_32VSRS(n,c,base) SAVE_32QRS(n,c,base)
+#endif
+
+#if defined (CONFIG_VSX) || defined(CONFIG_BGQ)
 #define REST_32FPVSRS(n,c,base)						=
\
 BEGIN_FTR_SECTION							=
\
 	b	2f;							=
\
 END_FTR_SECTION_IFSET(CPU_FTR_VSX);					=
\
 	REST_32FPRS(n,base);						=
\
 	b	3f;							=
\
-2:	REST_32VSRS(n,c,base);						=
\
+2:	_REST_32VSRS(n,c,base);						=
\
 3:
=20
 #define SAVE_32FPVSRS(n,c,base)						=
\
@@ -41,7 +51,7 @@ BEGIN_FTR_SECTION						=
	\
 END_FTR_SECTION_IFSET(CPU_FTR_VSX);					=
\
 	SAVE_32FPRS(n,base);						=
\
 	b	3f;							=
\
-2:	SAVE_32VSRS(n,c,base);						=
\
+2:	_SAVE_32VSRS(n,c,base);						=
\
 3:
 #else
 #define REST_32FPVSRS(n,b,base)	REST_32FPRS(n, base)

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

end of thread, other threads:[~2012-12-06  2:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-09 17:43 Hijacking CPU_FTR_VSX for BGQ QPX Jimi Xenidis
2012-11-09 19:57 ` Benjamin Herrenschmidt
2012-11-10  4:33   ` Michael Neuling
2012-12-05 15:44     ` Jimi Xenidis
2012-12-06  2:00       ` Michael Neuling

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