Landing: 8535b42901bd

Project / Subsystem

gcc / loongarch

Date

2026-05-02

Author

Xi Ruoyao

Commit

8535b42901bd772896fe4989efe5741ba5fc4bb9

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
loongarch
patch_id
commit_hash
8535b42901bd772896fe4989efe5741ba5fc4bb9
source_type
github
headline
LoongArch: Add spaceship expanders.
tldr
GCC now supports the spaceship operator for LoongArch, enabling better code generation for nested ternary operations.
author
Xi Ruoyao
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • loongarch
  • spaceship operator
  • code generation
  • optimization
discussion_id_link
bugzilla_pr
date
2026-05-02T00:00:00.000Z

GCC now supports the spaceship operator (<=> in C++) for the LoongArch architecture. This addition helps optimize nested ternary operations that produce -1, 0, or 1 by translating them into slt[u]-slt[u]-sub instructions. This optimization can improve code efficiency for comparisons and conditional assignments.