Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkgutils: add mtune optimization for rpi3 CFLAGS #1

Open
sepen opened this issue Dec 5, 2024 · 0 comments
Open

pkgutils: add mtune optimization for rpi3 CFLAGS #1

sepen opened this issue Dec 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@sepen
Copy link
Member

sepen commented Dec 5, 2024

Currently in the pkgutils port, we have the following CFLAGS in pkgmk.conf for the rpi3

export CFLAGS="-O2 -pipe -march=armv8-a+crc -mabi=lp64 -mlittle-endian"

I think -mlittle-endian can be omitted in the flags:

  • on ARMv7 or earlier, specifying endianness might be more relevant, as some older ARM implementations could be big-endian but for ARMv8, little-endian is the standard
  • you would only need to specify it if you’re working with specific hardware that uses a non-standard endianness, like big-endian, which is rare for ARMv8 (this is not the case for rpi3)

On the other hand I would add -mtune=cortex-a53 since it could provide some optimizations so we can maximize performance. From the GCC docs: -mtune helps the compiler generate more efficient code by optimizing for the characteristics of that particular architecture.

I can't verify this on a rpi3b+ but at least on my rpi3b (v1.2) I haven't had any problems using these flags.

Comments? (cc @pitill0)


Flags that I'm using

export CFLAGS="-O2 -pipe -march=armv8-a+crc -mabi=lp64 -mtune=cortex-a53"

Output for arminfo.sh

HOSTNAME   rpi3b
MODEL      unknown
FEATURES   fp asimd evtstrm crc32
MACHTYPE   aarch64-unknown-linux-gnu
CFLAGS     -march=armv8-a+crc -mabi=lp64 -mtune=cortex-a53
MAKEFLAGS  -j4

Output for lscpu on rpi3b

Architecture:            aarch64
  CPU op-mode(s):        32-bit, 64-bit
  Byte Order:            Little Endian
CPU(s):                  4
  On-line CPU(s) list:   0-3
Vendor ID:               ARM
  Model name:            Cortex-A53
    Model:               4
    Thread(s) per core:  1
    Core(s) per cluster: 4
    Socket(s):           -
    Cluster(s):          1
    Stepping:            r0p4
    CPU(s) scaling MHz:  50%
    CPU max MHz:         1200.0000
    CPU min MHz:         600.0000
    BogoMIPS:            38.40
    Flags:               fp asimd evtstrm crc32
@sepen sepen added the enhancement New feature or request label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant