Skip to content

Lower the instruction-set baseline for LoongArch devices #4726

@ziyao233

Description

@ziyao233

Currently our loongarch64 packages are built with -march=la4641, which means both LSX and LASX are necessary. At the time of starting the port, all LoongArch desktop devices satisfied the requirement, and LLVM didn't support -march=la64v1.0 yet, thus it's a reasonable decision.

Now Loongson has started to release some desktop chips without LASX support, for example, the upcoming 3B6000M2. It will be nice to lower the baseline and get these devices supported. Additionally, there're already some loongarch64 LSX-only SoCs targeting embedded market, and with the change, eweOS will be able to run on them, too.

Advantages

  • Wider device support (of course)
  • Reduce the possibility of miscompilation: during the days of packaging, we've observed many cases of LLVM miscompilation when LASX is used. For example, the blake2b algorithm in libgcrypt. Disabling LASX will reduce our maintenance burden a little.

Disadvantages

  • Performance regression (of course)
  • eweOS will lose the possibility to seek upstream LASX-related bugs
  • Requires rebuild of the world

Steps of the Change

  • Modify the default makepkg.conf, replace -march=la464 with -march=la64v1.0
  • Rebuild all packages to apply the change

Note that the second step could be done along with the compiler-rt rebuild3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions