diff mbox series

[2/2] powerpc: add ALTIVEC support to lib/ when PPC_FPU not set

Message ID 20210418201726.32130-2-rdunlap@infradead.org (mailing list archive)
State Changes Requested
Headers show
Series [1/2] powerpc: add enable_kernel_fp() stub for ALTIVEC without PPC_FPU | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch powerpc/merge (e4361a664ee985c1f54ddecf80b93159750d93d3)
snowpatch_ozlabs/build-ppc64le success Build succeeded
snowpatch_ozlabs/build-ppc64be success Build succeeded
snowpatch_ozlabs/build-ppc64e success Build succeeded
snowpatch_ozlabs/build-pmac32 success Build succeeded
snowpatch_ozlabs/checkpatch warning total: 0 errors, 1 warnings, 1 checks, 18 lines checked
snowpatch_ozlabs/needsstable success Patch has no Fixes tags

Commit Message

Randy Dunlap April 18, 2021, 8:17 p.m. UTC
When PPC_FPU is not set and ALTIVEC=y, arch/powerpc/lib/ldstfp.c is not
being built, but it is also needed when ALTIVEC=y for get_vr() and
put_vr().

../arch/powerpc/lib/sstep.c: In function 'do_vec_load':
../arch/powerpc/lib/sstep.c:637:3: error: implicit declaration of function 'put_vr' [-Werror=implicit-function-declaration]
  637 |   put_vr(rn, &u.v);
      |   ^~~~~~
../arch/powerpc/lib/sstep.c: In function 'do_vec_store':
../arch/powerpc/lib/sstep.c:660:3: error: implicit declaration of function 'get_vr'; did you mean 'get_oc'? [-Werror=implicit-function-declaration]
  660 |   get_vr(rn, &u.v);
      |   ^~~~~~


Add ldstfp.o to the Makefile for CONFIG_ALTIVEC and add
externs for get_vr() and put_vr() in lib/sstep.c to fix the
build errors.

This was seen in a kernel config from kernel test robot <lkp@intel.com>
that reported a different build issue (for pmac32-cpufreq.c).

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Cc: lkp@intel.com
---
 arch/powerpc/lib/Makefile |    1 +
 arch/powerpc/lib/sstep.c  |    5 +++++
 2 files changed, 6 insertions(+)

Comments

Segher Boessenkool April 19, 2021, 1:32 p.m. UTC | #1
Hi!

On Sun, Apr 18, 2021 at 01:17:26PM -0700, Randy Dunlap wrote:
> Add ldstfp.o to the Makefile for CONFIG_ALTIVEC and add
> externs for get_vr() and put_vr() in lib/sstep.c to fix the
> build errors.

>  obj-$(CONFIG_PPC_FPU)	+= ldstfp.o
> +obj-$(CONFIG_ALTIVEC)	+= ldstfp.o

It is probably a good idea to split ldstfp.S into two, one for each of
the two configuration options?


Segher
Christophe Leroy April 19, 2021, 1:38 p.m. UTC | #2
Le 19/04/2021 à 15:32, Segher Boessenkool a écrit :
> Hi!
> 
> On Sun, Apr 18, 2021 at 01:17:26PM -0700, Randy Dunlap wrote:
>> Add ldstfp.o to the Makefile for CONFIG_ALTIVEC and add
>> externs for get_vr() and put_vr() in lib/sstep.c to fix the
>> build errors.
> 
>>   obj-$(CONFIG_PPC_FPU)	+= ldstfp.o
>> +obj-$(CONFIG_ALTIVEC)	+= ldstfp.o
> 
> It is probably a good idea to split ldstfp.S into two, one for each of
> the two configuration options?
> 

Or we can build it all the time and #ifdef the FPU part.

Because it contains FPU, ALTIVEC and VSX stuff.

Christophe
Segher Boessenkool April 19, 2021, 1:57 p.m. UTC | #3
On Mon, Apr 19, 2021 at 03:38:02PM +0200, Christophe Leroy wrote:
> Le 19/04/2021 à 15:32, Segher Boessenkool a écrit :
> >On Sun, Apr 18, 2021 at 01:17:26PM -0700, Randy Dunlap wrote:
> >>Add ldstfp.o to the Makefile for CONFIG_ALTIVEC and add
> >>externs for get_vr() and put_vr() in lib/sstep.c to fix the
> >>build errors.
> >
> >>  obj-$(CONFIG_PPC_FPU)	+= ldstfp.o
> >>+obj-$(CONFIG_ALTIVEC)	+= ldstfp.o
> >
> >It is probably a good idea to split ldstfp.S into two, one for each of
> >the two configuration options?
> >
> 
> Or we can build it all the time and #ifdef the FPU part.
> 
> Because it contains FPU, ALTIVEC and VSX stuff.

So it becomes an empty object file if none of the options are selected?
Good idea :-)


Segher
diff mbox series

Patch

--- linux-next-20210416.orig/arch/powerpc/lib/Makefile
+++ linux-next-20210416/arch/powerpc/lib/Makefile
@@ -54,6 +54,7 @@  obj-y			+= checksum_$(BITS).o checksum_w
 
 obj-y			+= sstep.o
 obj-$(CONFIG_PPC_FPU)	+= ldstfp.o
+obj-$(CONFIG_ALTIVEC)	+= ldstfp.o
 obj64-y			+= quad.o
 
 obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
--- linux-next-20210416.orig/arch/powerpc/lib/sstep.c
+++ linux-next-20210416/arch/powerpc/lib/sstep.c
@@ -50,6 +50,11 @@  extern void conv_sp_to_dp(const float *s
 extern void conv_dp_to_sp(const double *dp, float *sp);
 #endif
 
+#ifdef CONFIG_ALTIVEC
+extern void get_vr(int rn, __vector128 *p);
+extern void put_vr(int rn, __vector128 *p);
+#endif /* CONFIG_ALTIVEC */
+
 #ifdef __powerpc64__
 /*
  * Functions in quad.S