ARM NEON version for Raspberry


Message boards : Unix/Linux : ARM NEON version for Raspberry

Message board moderation

To post messages, you must log in.
AuthorMessage
gentleman74

Send message
Joined: 25 Oct 19
Posts: 2
Credit: 960
RAC: 0
Message 6408 - Posted: 26 Nov 2019, 21:57:21 UTC
Is it possible to compile ARM NEON version for Raspberry? In case of Raspberry Pi4 :
gcc -march=armv8-a+simd+crc -mtune=cortex-a72
ID: 6408 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
gentleman74

Send message
Joined: 25 Oct 19
Posts: 2
Credit: 960
RAC: 0
Message 6411 - Posted: 8 Dec 2019, 17:52:42 UTC
I can compile it myself but source code is needed. Unfortunately existing source code is quite useless - definitely not used for boinc client compilation. Raspberry Pi4 is quite promising, allowing overclocking from standard 1,5GHz to 2,1GHz (for 45 USD 2GB version + 11 USD cooler and 7 USD power supply) and Boinc benchmark calculate around 80 000 MIPS (Dhrystone) and 2 9000 MIPS (Whetstone). All modern ARM CPUs (ARMv8 and beyond) support NEON instruction set and GCC 9.x fully support it.
ID: 6411 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
ahorek's team
Volunteer developer
Volunteer tester

Send message
Joined: 1 Jan 13
Posts: 59
Credit: 6,722,197
RAC: 5,141
Message 8236 - Posted: 23 Jan 2024, 23:21:04 UTC
Hello gentleman74,
the current rpi version is compiled with march=armv8-a

+simd option - is already enabled by default, see https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html
+crc - these instructions aren't used by the app, so enabling this option will have no effect

unlike x86 apps, we don't have handwritten optimizations for ARMs, so NEON optimizations depend on the compiler's auto vectorization capabilities.

unfortunately playing with these compiler flags without code changes and manual optimizations won't make a difference. It's not that easy, but if you're interested in development I can give you a link to the recent source code (PM me).
ID: 8236 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Dirk Broer

Send message
Joined: 11 Sep 12
Posts: 21
Credit: 5,938,097
RAC: 1,518
Message 8265 - Posted: 9 Feb 2024, 21:08:15 UTC - in response to Message 6408.  

Last modified: 9 Feb 2024, 21:09:53 UTC
Is it possible to compile ARM NEON version for Raspberry? In case of Raspberry Pi4 :
gcc -march=armv8-a+simd+crc -mtune=cortex-a72

You are aware that NEON is a 32-bit instruction, so only useful on Raspberries that run a 32-bit OS?
For a Pi4 (or higher) better use the 64-bit instructions set. The equivalent of NEON is SIMD there.

ID: 8265 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Dirk Broer

Send message
Joined: 11 Sep 12
Posts: 21
Credit: 5,938,097
RAC: 1,518
Message 8266 - Posted: 10 Feb 2024, 0:43:35 UTC
You can actually see the supported instruction set features in the log of the BOINC manager when booting up. For a 64-bit OS running PI 4 this is as follows
9			2/10/2024 12:20:07 AM	Processor: 4 ARM BCM2835 [Impl 0x41 Arch 8 Variant 0x0 Part 0xd08 Rev 3]	
10			2/10/2024 12:20:07 AM	Processor features: fp asimd evtstrm crc32 cpuid	
11			2/10/2024 12:20:07 AM	OS: Linux Debian: Debian GNU/Linux 11 (bullseye) [6.1.47-v8+|libc 2.31 (Debian GLIBC 2.31-13+rpt2+rpi1+deb11u7)]


So fp, asimd, evtstrm, crc32 and cpuid (all 64-bit instructions) are mentioned, no NEON.

If you want to see NEON, start an original Rapsberry Pi with an ARM11 CPU, or a Raspberry Pi 2 or 3 , running a 32-bit OS
to see
10			2/10/2024 12:20:07 AM	Processor features:  swp, half, thumb, fastmult, VFP, edsp, thumbEE, NEON, VFPv3, tls

which are all 32-bit instructions.

ID: 8266 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
ahorek's team
Volunteer developer
Volunteer tester

Send message
Joined: 1 Jan 13
Posts: 59
Credit: 6,722,197
RAC: 5,141
Message 8362 - Posted: 11 May 2024, 0:00:48 UTC
version 102.20 has been released. It includes new hand-written optimizations for asimd instruction set, that should give a substantial performance boost on supported 64-bit ARM v8 processors like Apple Mx and RPis.
ID: 8362 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote

Message boards : Unix/Linux : ARM NEON version for Raspberry