Skip to contentSkip to conversation

binutils-2.27: backport patch to enable CRC instructions on supported ARMv8-A CPUs

PATCH New Peter Seiderer 3 participants 8 messages Jul 15, 2017 – Jul 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 binutils-2.27: backport patch to enable CRC instructions on supported ARMv8-A CPUs

---
 ...ly-enable-CRC-instructions-on-supported-A.patch | 88 ++++++++++++++++++++++
 1 file changed, 88 insertions(+)
 create mode 100644 package/binutils/2.27/0907-Automatically-enable-CRC-instructions-on-supported-A.patch
package/binutils/2.27/0907-Automatically-enable-CRC-instructions-on-supported-A.patch new file +88 -0
new file mode 100644
index 0000000000..3b7fcfc959
@@ -0,0 +1,88 @@
+From 29a4659015ca7044c2d425d32a0b828e0fbb5ac1 Mon Sep 17 00:00:00 2001
+From: Richard Earnshaw <[email protected]>
+Date: Wed, 7 Sep 2016 17:14:54 +0100
+Subject: [PATCH] Automatically enable CRC instructions on supported ARMv8-A
+ CPUs.
+
+2016-09-07  Richard Earnshaw  <[email protected]>
+
+	* opcode/arm.h (ARM_ARCH_V8A_CRC): New architecture.
+
+2016-09-07  Richard Earnshaw  <[email protected]>
+
+	* config/tc-arm.c ((arm_cpus): Use ARM_ARCH_V8A_CRC for all
+	ARMv8-A CPUs except xgene1.
+
+Upstream: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=patch;h=27e5a270962fb92c07e7d476966ba380fa3bb68e
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ gas/config/tc-arm.c  | 18 +++++++++---------
+ include/opcode/arm.h |  2 ++
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
+index 73d05316..7c86184d 100644
+--- a/gas/config/tc-arm.c
++++ b/gas/config/tc-arm.c
+@@ -25332,17 +25332,17 @@ static const struct arm_cpu_option_table arm_cpus[] =
+ 								  "Cortex-A15"),
+   ARM_CPU_OPT ("cortex-a17",	ARM_ARCH_V7VE,   FPU_ARCH_NEON_VFP_V4,
+ 								  "Cortex-A17"),
+-  ARM_CPU_OPT ("cortex-a32",    ARM_ARCH_V8A,    FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
++  ARM_CPU_OPT ("cortex-a32",    ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
+ 								  "Cortex-A32"),
+-  ARM_CPU_OPT ("cortex-a35",    ARM_ARCH_V8A,    FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
++  ARM_CPU_OPT ("cortex-a35",    ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
+ 								  "Cortex-A35"),
+-  ARM_CPU_OPT ("cortex-a53",    ARM_ARCH_V8A,    FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
++  ARM_CPU_OPT ("cortex-a53",    ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
+ 								  "Cortex-A53"),
+-  ARM_CPU_OPT ("cortex-a57",    ARM_ARCH_V8A,    FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
++  ARM_CPU_OPT ("cortex-a57",    ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
+ 								  "Cortex-A57"),
+-  ARM_CPU_OPT ("cortex-a72",    ARM_ARCH_V8A,    FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
++  ARM_CPU_OPT ("cortex-a72",    ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
+ 								  "Cortex-A72"),
+-  ARM_CPU_OPT ("cortex-a73",    ARM_ARCH_V8A,    FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
++  ARM_CPU_OPT ("cortex-a73",    ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
+ 								  "Cortex-A73"),
+   ARM_CPU_OPT ("cortex-r4",	ARM_ARCH_V7R,	 FPU_NONE,	  "Cortex-R4"),
+   ARM_CPU_OPT ("cortex-r4f",	ARM_ARCH_V7R,	 FPU_ARCH_VFP_V3D16,
+@@ -25361,10 +25361,10 @@ static const struct arm_cpu_option_table arm_cpus[] =
+   ARM_CPU_OPT ("cortex-m1",	ARM_ARCH_V6SM,	 FPU_NONE,	  "Cortex-M1"),
+   ARM_CPU_OPT ("cortex-m0",	ARM_ARCH_V6SM,	 FPU_NONE,	  "Cortex-M0"),
+   ARM_CPU_OPT ("cortex-m0plus",	ARM_ARCH_V6SM,	 FPU_NONE,	  "Cortex-M0+"),
+-  ARM_CPU_OPT ("exynos-m1",	ARM_ARCH_V8A,	 FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
++  ARM_CPU_OPT ("exynos-m1",	ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
+ 								  "Samsung " \
+ 								  "Exynos M1"),
+-  ARM_CPU_OPT ("qdf24xx",	ARM_ARCH_V8A,	 FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
++  ARM_CPU_OPT ("qdf24xx",	ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
+ 								  "Qualcomm "
+ 								  "QDF24XX"),
+ 
+@@ -25389,7 +25389,7 @@ static const struct arm_cpu_option_table arm_cpus[] =
+   /* APM X-Gene family.  */
+   ARM_CPU_OPT ("xgene1",        ARM_ARCH_V8A,    FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
+ 	                                                          "APM X-Gene 1"),
+-  ARM_CPU_OPT ("xgene2",        ARM_ARCH_V8A,    FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
++  ARM_CPU_OPT ("xgene2",        ARM_ARCH_V8A_CRC, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
+ 	                                                          "APM X-Gene 2"),
+ 
+   { NULL, 0, ARM_ARCH_NONE, ARM_ARCH_NONE, NULL }
+diff --git a/include/opcode/arm.h b/include/opcode/arm.h
+index 60715cf8..feace5cd 100644
+--- a/include/opcode/arm.h
++++ b/include/opcode/arm.h
+@@ -263,6 +263,8 @@
+ #define ARM_ARCH_V7M	ARM_FEATURE_CORE (ARM_AEXT_V7M, ARM_EXT2_V6T2_V8M)
+ #define ARM_ARCH_V7EM	ARM_FEATURE_CORE (ARM_AEXT_V7EM, ARM_EXT2_V6T2_V8M)
+ #define ARM_ARCH_V8A	ARM_FEATURE_CORE (ARM_AEXT_V8A, ARM_AEXT2_V8A)
++#define ARM_ARCH_V8A_CRC ARM_FEATURE (ARM_AEXT_V8A, ARM_AEXT2_V8A, \
++				      CRC_EXT_ARMV8)
+ #define ARM_ARCH_V8_1A	ARM_FEATURE (ARM_AEXT_V8A, ARM_AEXT2_V8_1A,	\
+ 				     CRC_EXT_ARMV8 | FPU_NEON_EXT_RDMA)
+ #define ARM_ARCH_V8_2A	ARM_FEATURE (ARM_AEXT_V8A, ARM_AEXT2_V8_2A,	\
+-- 
+2.11.0
+
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 qt5base: fix qthash error attribute(target("+crc")) is unknown

Add patch 0005-Fix-error-attribute-target-crc-is-unknown.patch.

Upstream: https://codereview.qt-project.org/200171

Fixes buildroot Bug 9916 ([1]).

[1] https://bugs.busybox.net/show_bug.cgi?id=9916

---
 ...Fix-error-attribute-target-crc-is-unknown.patch | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 package/qt5/qt5base/5.8.0/0005-Fix-error-attribute-target-crc-is-unknown.patch
package/qt5/qt5base/5.8.0/0005-Fix-error-attribute-target-crc-is-unknown.patch new file +44 -0
new file mode 100644
index 0000000000..92d93a800b
@@ -0,0 +1,44 @@
+From f0c02fb22bc277e2015a18e562b551ec7b3eed9e Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Sun, 16 Jul 2017 00:05:44 +0200
+Subject: [PATCH] Fix error attribute(target("+crc")) is unknown
+
+Task-number: QTBUG-61975
+Change-Id: I0b1b55c0737dad485b5ace8e6eb7cb842589453d
+---
+ src/corelib/tools/qhash.cpp | 2 ++
+ src/corelib/tools/qsimd_p.h | 3 +++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
+index 1f9c05c..bbf6efb 100644
+--- a/src/corelib/tools/qhash.cpp
++++ b/src/corelib/tools/qhash.cpp
+@@ -144,7 +144,9 @@ static inline bool hasFastCrc32()
+ }
+ 
+ template <typename Char>
++#if defined(__aarch64__)
+ QT_FUNCTION_TARGET(CRC32)
++#endif
+ static uint crc32(const Char *ptr, size_t len, uint h)
+ {
+     // The crc32[whbd] instructions on Aarch64/Aarch32 calculate a 32-bit CRC32 checksum
+diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
+index 023a4b0..a85d572 100644
+--- a/src/corelib/tools/qsimd_p.h
++++ b/src/corelib/tools/qsimd_p.h
+@@ -326,7 +326,10 @@
+ #endif
+ // AArch64/ARM64
+ #if defined(Q_PROCESSOR_ARM_V8) && defined(__ARM_FEATURE_CRC32)
++#if defined(__aarch64__)
++// only available on aarch64
+ #define QT_FUNCTION_TARGET_STRING_CRC32      "+crc"
++#endif
+ #  include <arm_acle.h>
+ #endif
+ 
+-- 
+2.7.4
+
Signature · 1 line
2.11.0
#2 lore raw

PATCH 1/1 qt5base: fix qthash error attribute(target("+crc")) is unknown

package/qt5/qt5base/5.8.0/0005-Fix-error-attribute-target-crc-is-unknown.patch line 7

Quoted 7 lines · Peter Seiderer
package/qt5/qt5base/5.8.0/0005-Fix-error-attribute-target-crc-is-unknown.patch new file +7 -0
+From f0c02fb22bc277e2015a18e562b551ec7b3eed9e Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Sun, 16 Jul 2017 00:05:44 +0200
+Subject: [PATCH] Fix error attribute(target("+crc")) is unknown
+
+Task-number: QTBUG-61975
+Change-Id: I0b1b55c0737dad485b5ace8e6eb7cb842589453d

You forgot your Sob. Care to send a follow-up patch to fix?

Regards,
Arnout

Quoted 1 line

+---

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH 1/1 qt5base: fix qthash error attribute(target("+crc")) is unknown

Hello Arnout,

Quoted 13 lines · Arnout Vandecappelle

package/qt5/qt5base/5.8.0/0005-Fix-error-attribute-target-crc-is-unknown.patch line 7

Quoted 7 lines · Peter Seiderer
package/qt5/qt5base/5.8.0/0005-Fix-error-attribute-target-crc-is-unknown.patch new file +7 -0
+From f0c02fb22bc277e2015a18e562b551ec7b3eed9e Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Sun, 16 Jul 2017 00:05:44 +0200
+Subject: [PATCH] Fix error attribute(target("+crc")) is unknown
+
+Task-number: QTBUG-61975
+Change-Id: I0b1b55c0737dad485b5ace8e6eb7cb842589453d

You forgot your Sob. Care to send a follow-up patch to fix?

Thanks for review, follow-up patch is on the way....

Regards,
Peter

Quoted 5 lines

Regards,
Arnout

Quoted 1 line

+---

#4 lore raw

PATCH 1/1 binutils-2.27: backport patch to enable CRC instructions on supported ARMv8-A CPUs

In reply to Peter Seiderer

Hello,

Quoted 5 lines · Peter Seiderer
---
 ...ly-enable-CRC-instructions-on-supported-A.patch | 88 ++++++++++++++++++++++
 1 file changed, 88 insertions(+)
 create mode 100644 package/binutils/2.27/0907-Automatically-enable-CRC-instructions-on-supported-A.patch

Thanks for this patch. You're adding it to binutils 2.27, what about binutils 2.26.1 ? The bug doesn't exist ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#5 lore raw

PATCH 1/1 binutils-2.27: backport patch to enable CRC instructions on supported ARMv8-A CPUs

Hello Thomas,

Quoted 11 lines · Thomas Petazzoni

Hello,

Quoted 5 lines · Peter Seiderer
---
 ...ly-enable-CRC-instructions-on-supported-A.patch | 88 ++++++++++++++++++++++
 1 file changed, 88 insertions(+)
 create mode 100644 package/binutils/2.27/0907-Automatically-enable-CRC-instructions-on-supported-A.patch

Thanks for this patch. You're adding it to binutils 2.27, what about binutils 2.26.1 ? The bug doesn't exist ?

Bug exists with binutils 2.26.1 but the simple approach to backport (only) the same patch did not work:

./../include/opcode/arm.h:253:53: error: ?ARM_AEXT2_V8A? undeclared here (not in a function)

Seems more patches are missing...

Regards,
Peter

Quoted 2 lines

Thomas

#6 lore raw

PATCH 1/1 binutils-2.27: backport patch to enable CRC instructions on supported ARMv8-A CPUs

Hello,

Quoted 9 lines · Peter Seiderer
Quoted 2 lines

Thanks for this patch. You're adding it to binutils 2.27, what about binutils 2.26.1 ? The bug doesn't exist ?

Bug exists with binutils 2.26.1 but the simple approach to backport (only) the same patch did not work:

./../include/opcode/arm.h:253:53: error: ?ARM_AEXT2_V8A? undeclared here (not in a function)

Seems more patches are missing...

Argh, ok. I honestly don't think it's really worth the effort trying to fix this specific problem on the older binutils 2.26, so let's leave things as-is, the problem will disappear by itself once we bump to binutils 2.29, and remove binutils 2.26.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#7 lore raw

PATCH 1/1 binutils-2.27: backport patch to enable CRC instructions on supported ARMv8-A CPUs

In reply to Peter Seiderer

Hello,

Quoted 5 lines · Peter Seiderer
---
 ...ly-enable-CRC-instructions-on-supported-A.patch | 88 ++++++++++++++++++++++
 1 file changed, 88 insertions(+)
 create mode 100644 package/binutils/2.27/0907-Automatically-enable-CRC-instructions-on-supported-A.patch

Thanks, I've applied both patches, but please don't forget the binutils 2.26 case (a follow-up patch can be sent if needed).

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com