LinuxPPC-Dev Archive on
 help / color / Atom feed
From: Randy Dunlap <>
Cc: kernel test robot <>,
	Randy Dunlap <>,
Subject: [PATCH 2/2] powerpc: add ALTIVEC support to lib/ when PPC_FPU not set
Date: Sun, 18 Apr 2021 13:17:26 -0700
Message-ID: <> (raw)
In-Reply-To: <>

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

../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 <>
that reported a different build issue (for pmac32-cpufreq.c).

Signed-off-by: Randy Dunlap <>
Cc: Michael Ellerman <>
Cc: Christophe Leroy <>
Cc: Segher Boessenkool <>
 arch/powerpc/lib/Makefile |    1 +
 arch/powerpc/lib/sstep.c  |    5 +++++
 2 files changed, 6 insertions(+)

--- 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);
+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

  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-18 20:17 [PATCH 1/2] powerpc: add enable_kernel_fp() stub for ALTIVEC without PPC_FPU Randy Dunlap
2021-04-18 20:17 ` Randy Dunlap [this message]
2021-04-19 13:32   ` [PATCH 2/2] powerpc: add ALTIVEC support to lib/ when PPC_FPU not set Segher Boessenkool
2021-04-19 13:38     ` Christophe Leroy
2021-04-19 13:57       ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LinuxPPC-Dev Archive on

Archives are clonable:
	git clone --mirror linuxppc-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linuxppc-dev linuxppc-dev/ \
	public-inbox-index linuxppc-dev

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone