Hello,
Maybe I am missing something here but thought that the new Pi 4 could do 64 bit OS but the only ones I see for download are all 32 bit... what am I missing here ?
-
- Posts: 1
- Joined: Sun Sep 06, 2020 2:46 am
Re: Thought 64 bit. Why only 32?
The standard OS is 32-bit to retain full compatibility across the product line from the original Pi to the Zero to the latest 4B. If you download a 64-bit OS, then you can use the 4B in 64-bit mode.
I've had pretty good luck with Gentoo Linux and the beta release of 64-bit Raspberry Pi OS 64. I think many people like Ubuntu as well. I expect others will have further recommendations.
I've had pretty good luck with Gentoo Linux and the beta release of 64-bit Raspberry Pi OS 64. I think many people like Ubuntu as well. I expect others will have further recommendations.
-
- Posts: 13944
- Joined: Fri Mar 09, 2012 7:36 pm
- Location: Vallejo, CA (US)
Re: Thought 64 bit. Why only 32?
The Pi2Bv1.2, Pi3B, Pi3B+ and Pi3A+ can all do 64-bit. 64-bit capability isn't new with the Pi4B...though enough memory to make effective use of is. The prior Pis are limited 1GB, and the Pi3A+ has only 512MB.
Re: Thought 64 bit. Why only 32?
64 bit is still beta, work in progress.RasUser1873 wrote: ↑Sun Sep 06, 2020 2:49 amHello,
Maybe I am missing something here but thought that the new Pi 4 could do 64 bit OS but the only ones I see for download are all 32 bit... what am I missing here ?
viewtopic.php?f=117&t=275370
64bit lite version.
https://downloads.raspberrypi.org/raspi ... 020-08-24/
Re: Thought 64 bit. Why only 32?
In your opinions, do the added capabilities of 64-bit (instructions, register set...) compensate
for the higher memory consumption vs. 32-bit Linux on the R-Pi-4B used as a "desktop" PC ?
Will your answers be different across the range of RAM sizes : 1 , 2, 4, 8, ( 16 ?) gigabytes ?
for the higher memory consumption vs. 32-bit Linux on the R-Pi-4B used as a "desktop" PC ?
Will your answers be different across the range of RAM sizes : 1 , 2, 4, 8, ( 16 ?) gigabytes ?
-
- Posts: 25138
- Joined: Tue Mar 25, 2014 12:40 pm
- Location: Delightful Dorset
Re: Thought 64 bit. Why only 32?
RasUser1873 wrote: ↑Sun Sep 06, 2020 2:49 amHello,
Maybe I am missing something here but thought that the new Pi 4 could do 64 bit OS but the only ones I see for download are all 32 bit... what am I missing here ?
What model of 4B ? if 1GB or 2GB you may not notice much difference between ARMHF or ARM64 Operating Systems.
Also you do not state where you only find ARMHF 32bit Operating Systems suitable for your 4B !
The information is out there....you just have to let it in.
Re: Thought 64 bit. Why only 32?
You will get a range of different answers.NimbUx wrote: ↑Sun Sep 06, 2020 9:56 amIn your opinions, do the added capabilities of 64-bit (instructions, register set...) compensate
for the higher memory consumption vs. 32-bit Linux on the R-Pi-4B used as a "desktop" PC ?
Will your answers be different across the range of RAM sizes : 1 , 2, 4, 8, ( 16 ?) gigabytes ?
These 64-bit OS's are free and only take a few minutes to install.
So why not try Raspberry Pi OS 64-bit (beta), Gentoo64, and Ubuntu, say, on a spare SD card and see what you think. Measure the memory usage (if you can) for your work loads.
I would start with the Raspberry Pi OS personally. There is a new Lite version here by the way:
https://downloads.raspberrypi.org/raspi ... 64/images/
Code I write in C uses the exact width data types, so that only pointers take more memory in 64-bit mode.
The code itself tends to be more compact. Having twice the number of registers (31 general purpose integer registers and 32 128 bit SIMD registers in NEON (floating-point)) means a lot less memory references (more often functions don't need to spill registers to the stack for example. Temporary values may be saved in registers to be re-used later etc etc).
YMMV

The 64-bit instruction set is more modern and is streamlined for the new out-of-order, speculative execution, register renaming, CPU's (like the Pi4's Cortex-A72). The legacy 32-bit mode has all sorts of slow instructions that don't work well with these recent CPU's.
Pi4 8GB and Pi4 4GB running Raspberry Pi OS 64-bit
Re: Thought 64 bit. Why only 32?
Interesting points ! The question then turns into : do the standard compilers make a good job using these more modern capabilities of the 64-bit ARM binary programming interface ? Are the apps in the standard repository, and the Raspi-OS-64 itself, optimised for the instruction set - or do you need hand crafted ASM in your own programmes to gain the benefits you mentionned above ?jahboater wrote: ↑Sun Sep 06, 2020 10:41 amCode I write in C uses the exact width data types, so that only pointers take more memory in 64-bit mode.
The code itself tends to be more compact. Having twice the number of registers (31 general purpose integer registers and 32 128 bit SIMD registers in NEON (floating-point)) means a lot less memory references (more often functions don't need to spill registers to the stack for example. Temporary values may be saved in registers to be re-used later etc etc).
YMMV
The 64-bit instruction set is more modern and is streamlined for the new out-of-order, speculative execution, register renaming, CPU's (like the Pi4's Cortex-A72). The legacy 32-bit mode has all sorts of slow instructions that don't work well with these recent CPU's.
Re: Thought 64 bit. Why only 32?
I'm very sure that GCC and Clang are doing a good job of generating optimal code for 64 bit ARM now a days. They have been at it for a while.
It seems very unlikely the guys building Raspi-OS-64 would not be using the relevant compiler options to produce the best code for the 64 bit Raspi SoC.
It's all but impossible to produce better code by hand in assembler than the compiler optimizers do now a days.
It seems very unlikely the guys building Raspi-OS-64 would not be using the relevant compiler options to produce the best code for the 64 bit Raspi SoC.
It's all but impossible to produce better code by hand in assembler than the compiler optimizers do now a days.
Memory in C++ is a leaky abstraction .
-
- Posts: 25138
- Joined: Tue Mar 25, 2014 12:40 pm
- Location: Delightful Dorset
Re: Thought 64 bit. Why only 32?
NimbUx wrote: ↑Sun Sep 06, 2020 1:10 pmInteresting points ! The question then turns into : do the standard compilers make a good job using these more modern capabilities of the 64-bit ARM binary programming interface ? Are the apps in the standard repository, and the Raspi-OS-64 itself, optimised for the instruction set - or do you need hand crafted ASM in your own programmes to gain the benefits you mentionned above ?jahboater wrote: ↑Sun Sep 06, 2020 10:41 amCode I write in C uses the exact width data types, so that only pointers take more memory in 64-bit mode.
The code itself tends to be more compact. Having twice the number of registers (31 general purpose integer registers and 32 128 bit SIMD registers in NEON (floating-point)) means a lot less memory references (more often functions don't need to spill registers to the stack for example. Temporary values may be saved in registers to be re-used later etc etc).
YMMV
The 64-bit instruction set is more modern and is streamlined for the new out-of-order, speculative execution, register renaming, CPU's (like the Pi4's Cortex-A72). The legacy 32-bit mode has all sorts of slow instructions that don't work well with these recent CPU's.
RaspiOS64 is Debian ARM64 base which has had a decade of development:
https://wiki.debian.org/Arm64Port
The information is out there....you just have to let it in.
Re: Thought 64 bit. Why only 32?
Yes of course. They have been supporting Aarch64 for many years now.
Study some code produced by the compiler using these options:
Code: Select all
gcc program.c -S -fverbose-asm -Os -march=armv8-a -mcpu=cortex-a72 -mtune=cortex-a72 -o program.s
Use GCC 10.2 for the best performance at the time of writing.
Pi4 8GB and Pi4 4GB running Raspberry Pi OS 64-bit
Re: Thought 64 bit. Why only 32?
-march=armv8-a+crcjahboater wrote: ↑Sun Sep 06, 2020 2:46 pmStudy some code produced by the compiler using these options:Code: Select all
gcc program.c -S -fverbose-asm -Os -march=armv8-a -mcpu=cortex-a72 -mtune=cortex-a72 -o program.s
Re: Thought 64 bit. Why only 32?
Do you have an example when those crc instructions are generated while building a standards-compliant C or C++ code?Kendek wrote: ↑Sun Sep 06, 2020 3:03 pm-march=armv8-a+crcjahboater wrote: ↑Sun Sep 06, 2020 2:46 pmStudy some code produced by the compiler using these options:Code: Select all
gcc program.c -S -fverbose-asm -Os -march=armv8-a -mcpu=cortex-a72 -mtune=cortex-a72 -o program.s
Re: Thought 64 bit. Why only 32?
ARMv8.1 enables +crc extension by default, but the Pi4 is only ARMv8 with hardware CRC32. So the +crc is necessary if we want to be precise. But I'm sorry, I don't know a good example source code that you could analyze.ejolson wrote: ↑Sun Sep 06, 2020 3:50 pmDo you have an example when those crc instructions are generated while building a standards-compliant C or C++ code?Kendek wrote: ↑Sun Sep 06, 2020 3:03 pm-march=armv8-a+crcjahboater wrote: ↑Sun Sep 06, 2020 2:46 pmStudy some code produced by the compiler using these options:Code: Select all
gcc program.c -S -fverbose-asm -Os -march=armv8-a -mcpu=cortex-a72 -mtune=cortex-a72 -o program.s
Re: Thought 64 bit. Why only 32?
I would be surprised if the compiler recognized the CRC code in the C/C++ source using that exact polynomial (0x04C11DB7) and emitted one the CRC32 instructions. Its very specific.
Pi4 8GB and Pi4 4GB running Raspberry Pi OS 64-bit