From 8274aaaaa1948c50c661aa32e21b3db27a5c0eab Mon Sep 17 00:00:00 2001
From: Rich Felker <dalias@aerifal.cx>
Date: Mon, 29 Nov 2021 17:41:43 -0500
Subject: fix hwcap access in powerpc-sf setjmp/longjmp

commit 7be59733d71ada3a32a98622507399253f1d5e48 introduced the
hwcap-based branches to support the SPE FPU, but wrongly coded them as
bitwise tests on the computed address of __hwcap, not a value loaded
from that address. replace the add with indexed load to fix it.
---
 src/setjmp/powerpc/longjmp.S | 2 +-
 src/setjmp/powerpc/setjmp.S  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/setjmp')

diff --git a/src/setjmp/powerpc/longjmp.S b/src/setjmp/powerpc/longjmp.S
index 34aecb4c..611389fe 100644
--- a/src/setjmp/powerpc/longjmp.S
+++ b/src/setjmp/powerpc/longjmp.S
@@ -44,7 +44,7 @@ longjmp:
 	.long __hwcap-.
 1:	mflr 4
 	lwz 5, 0(4)
-	add 4, 4, 5
+	lwzx 4, 4, 5
 	andis. 4, 4, 0x80
 	beq 1f
 	.long 0x11c35b01 /* evldd 14,88(3) */
diff --git a/src/setjmp/powerpc/setjmp.S b/src/setjmp/powerpc/setjmp.S
index 413e6a81..f1fcce33 100644
--- a/src/setjmp/powerpc/setjmp.S
+++ b/src/setjmp/powerpc/setjmp.S
@@ -44,7 +44,7 @@ setjmp:
 	.long __hwcap-.
 1:	mflr 4
 	lwz 5, 0(4)
-	add 4, 4, 5
+	lwzx 4, 4, 5
 	andis. 4, 4, 0x80
 	beq 1f
 	.long 0x11c35b21 /* evstdd 14,88(3) */
-- 
cgit v1.2.3-70-g09d2