From 6b51ba0d9274e6c0b52d5ea1bc3a6439b1e48ade2771aa91cfa3972141b9ab03 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 22 Aug 2023 11:56:23 +0000 Subject: [PATCH] - Add gmp-6.3.0-s390x-fix.patch to fix s390x optimized code on z13. OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/gmp?expand=0&rev=95 --- gmp-6.3.0-s390x-fix.patch | 83 +++++++++++++++++++++++++++++++++++++++ gmp.changes | 5 +++ gmp.spec | 2 + 3 files changed, 90 insertions(+) create mode 100644 gmp-6.3.0-s390x-fix.patch diff --git a/gmp-6.3.0-s390x-fix.patch b/gmp-6.3.0-s390x-fix.patch new file mode 100644 index 0000000..5f5e295 --- /dev/null +++ b/gmp-6.3.0-s390x-fix.patch @@ -0,0 +1,83 @@ +From stli@linux.ibm.com Thu Aug 3 13:46:44 2023 +Date: Thu, 3 Aug 2023 15:46:27 +0200 +From: Stefan Liebler +To: gmp-devel@gmplib.org +Subject: [PATCH] Revert "Move popcount and hamdist back from z14 to z13 after needed edits." + +This reverts commit d4f5fca6a1e8ceb3bda243e5a7afcc8762025f84. + +Unfortunately not only the extended mnemonics are not available with z13, +but also vpopct M3=1-3 is reserved. Thus you'll get an illegal-instruction +if run on z13 as vector enhancement facility 1 (introduced with z14) is +not available. + +This is recognized with test-fails if run on z13: +FAIL: t-bin +FAIL: t-fac_ui +FAIL: t-mfac_uiui +FAIL: t-primorial_ui +FAIL: t-hamdist +FAIL: t-popcount +FAIL: t-nextprime +--- + mpn/s390_64/{z13 => z14}/hamdist.asm | 4 ++-- + mpn/s390_64/{z13 => z14}/popcount.asm | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + rename mpn/s390_64/{z13 => z14}/hamdist.asm (97%) + rename mpn/s390_64/{z13 => z14}/popcount.asm (97%) + +diff --git a/mpn/s390_64/z13/hamdist.asm b/mpn/s390_64/z14/hamdist.asm +similarity index 97% +rename from a/mpn/s390_64/z13/hamdist.asm +rename to b/mpn/s390_64/z14/hamdist.asm +index 81c5174b4..be134ff4d 100644 +--- a/mpn/s390_64/z13/hamdist.asm ++++ b/mpn/s390_64/z14/hamdist.asm +@@ -55,7 +55,7 @@ PROLOGUE(mpn_hamdist) + L(odd): vllezg %v16, 0(ap) + vllezg %v17, 0(bp) + vx %v16, %v16, %v17 +- vpopct %v30, %v16, 3 ++ vpopctg %v30, %v16 + la ap, 8(ap) + la bp, 8(bp) + clgije n, 0, L(end) +@@ -63,7 +63,7 @@ L(odd): vllezg %v16, 0(ap) + L(top): vl %v16, 0(ap), 3 + vl %v17, 0(bp), 3 + vx %v16, %v16, %v17 +- vpopct %v20, %v16, 3 ++ vpopctg %v20, %v16 + vag %v30, %v30, %v20 + la ap, 16(ap) + la bp, 16(bp) +diff --git a/mpn/s390_64/z13/popcount.asm b/mpn/s390_64/z14/popcount.asm +similarity index 97% +rename from a/mpn/s390_64/z13/popcount.asm +rename to b/mpn/s390_64/z14/popcount.asm +index 35b1fc4da..38b24479a 100644 +--- a/mpn/s390_64/z13/popcount.asm ++++ b/mpn/s390_64/z14/popcount.asm +@@ -52,12 +52,12 @@ PROLOGUE(mpn_popcount) + je L(top) + + L(odd): vllezg %v16, 0(ap) +- vpopct %v30, %v16, 3 ++ vpopctg %v30, %v16 + la ap, 8(ap) + clgije n, 0, L(end) + + L(top): vl %v16, 0(ap), 3 +- vpopct %v20, %v16, 3 ++ vpopctg %v20, %v16 + vag %v30, %v30, %v20 + la ap, 16(ap) + brctg n, L(top) +-- +2.41.0 + +_______________________________________________ +gmp-devel mailing list +gmp-devel@gmplib.org +https://gmplib.org/mailman/listinfo/gmp-devel + diff --git a/gmp.changes b/gmp.changes index 45d7b9f..f0006ed 100644 --- a/gmp.changes +++ b/gmp.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Aug 22 11:51:01 UTC 2023 - Richard Biener + +- Add gmp-6.3.0-s390x-fix.patch to fix s390x optimized code on z13. + ------------------------------------------------------------------- Fri Aug 4 08:09:53 UTC 2023 - Richard Biener diff --git a/gmp.spec b/gmp.spec index 14e7196..4f75719 100644 --- a/gmp.spec +++ b/gmp.spec @@ -30,6 +30,7 @@ Source2: %{name}.keyring Source3: baselibs.conf # revert change causing bsc#1179751 Patch1: gmp-6.2.1-arm64-invert_limb.patch +Patch2: gmp-6.3.0-s390x-fix.patch BuildRequires: fipscheck BuildRequires: gcc-c++ BuildRequires: m4 @@ -78,6 +79,7 @@ huge numbers (integer and floating point). %prep %setup -q %patch1 +%patch2 -p1 %build export CFLAGS="%{optflags} -fexceptions"