[PATCH 5/9] powerpc: Introduce VSX thread_struct and CONFIG_VSX

Kumar Gala galak at kernel.crashing.org
Fri Jun 20 16:44:38 EST 2008


> Index: linux-2.6-ozlabs/include/asm-powerpc/processor.h
> ===================================================================
> --- linux-2.6-ozlabs.orig/include/asm-powerpc/processor.h
> +++ linux-2.6-ozlabs/include/asm-powerpc/processor.h
> @@ -78,6 +78,7 @@ extern long kernel_thread(int (*fn)(void
> /* Lazy FPU handling on uni-processor */
> extern struct task_struct *last_task_used_math;
> extern struct task_struct *last_task_used_altivec;
> +extern struct task_struct *last_task_used_vsx;
> extern struct task_struct *last_task_used_spe;
>
> #ifdef CONFIG_PPC32
> @@ -136,8 +137,13 @@ typedef struct {
> 	unsigned long seg;
> } mm_segment_t;
>
> +#ifdef CONFIG_VSX
> +#define TS_FPR(i) fpvsr[i].fpr.fp
> +#define TS_FPRSTART fpvsr
> +#else
> #define TS_FPR(i) fpr[i]
> #define TS_FPRSTART fpr
> +#endif
>
> struct thread_struct {
> 	unsigned long	ksp;		/* Kernel stack pointer */
> @@ -155,8 +161,19 @@ struct thread_struct {
> 	unsigned long	dbcr0;		/* debug control register values */
> 	unsigned long	dbcr1;
> #endif
> +#ifdef CONFIG_VSX
> +	/* First 32 VSX registers (overlap with fpr[32]) */
> +	union {
> +		struct {
> +			double fp;

s/fp/fpr

> +			double vsrlow;
> +		} fpr;
> +		vector128	vsr;
> +	} fpvsr[32];
> +#else
> 	double		fpr[32];	/* Complete floating point set */
> -	struct {			/* fpr ... fpscr must be contiguous */
> +#endif
> +	struct {
>
> 		unsigned int pad;
> 		unsigned int val;	/* Floating point status */

So if I search correctly I count 2 uses of .vsr.  Seems like we could  
easily make those two cases use .fp and drop the union.

- k



More information about the Linuxppc-dev mailing list