[clang] [lld] [llvm] [clang][llvm] Add SPARC and MIPS release notes (PR #246931)

via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 3 14:57:04 PST 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lld

Author: Brad Smith (brad0)

<details>
<summary>Changes</summary>

Add release notes for the SPARC and MIPS changes so far: the new
-m(no-)app-regs flags, SPARC constrained floating point, the MIPS and
SPARC predefined macro and atomics changes, the SPARC CPU list from
the TargetParser, the MIPS and SPARC backend fixes and improvements,
and llvm-objdump inferring SPARC features from the ELF header.

---
Full diff: https://github.com/llvm/llvm-project/pull/246931.diff


3 Files Affected:

- (modified) clang/docs/ReleaseNotes.md (+51) 
- (modified) lld/docs/ReleaseNotes.md (+4) 
- (modified) llvm/docs/ReleaseNotes.md (+68) 


``````````diff
diff --git a/clang/docs/ReleaseNotes.md b/clang/docs/ReleaseNotes.md
index 2c1e0b45e9daec..a77c2606bb4a95 100644
--- a/clang/docs/ReleaseNotes.md
+++ b/clang/docs/ReleaseNotes.md
@@ -484,6 +484,11 @@ documentation](CIR/index.md) for more information regarding ClangIR's status and
   plugin named `<plugin>`, as `opt -plugin-arg=<plugin>,<arg>` does. It reaches
   plugins loaded with `-fpass-plugin=` and statically linked ones such as Polly.
 
+- Added `-mapp-regs` and `-mno-app-regs` for SPARC, matching GCC.
+  `-mno-app-regs` reserves the application registers `%g2`, `%g3` and `%g4`,
+  like `-ffixed-g2 -ffixed-g3 -ffixed-g4`. `-mapp-regs` is the default.
+  (#GH18525)
+
 ### Deprecated Compiler Flags
 
 ### Modified Compiler Flags
@@ -1587,6 +1592,23 @@ documentation](CIR/index.md) for more information regarding ClangIR's status and
   directly instead of through `gcc`, and host include directories are no
   longer searched.
 
+#### MIPS Support
+
+- `__mips` and `_MIPS_ISA` are now set from the ISA level, matching GCC. For
+  `-march=mips1` to `-march=mips5`, `__mips` is now 1 to 5 instead of 32 or 64,
+  and `_MIPS_ISA` follows it. `__mips_isa_rev` is now only defined for MIPS32,
+  MIPS64 and later. `__mips64` is still based on the ABI. `_MIPS_SPFPSET` is
+  now 16 before MIPS32 with 32-bit FPRs.
+
+- MIPS I and the R5900, which have no `ll` and `sc`, no longer report any
+  atomics as lock-free, so atomic operations on them become library calls.
+  The `__GCC_HAVE_SYNC_COMPARE_AND_SWAP_*` macros are now only defined when
+  `ll` and `sc` are available.
+
+- On big-endian MIPS, `va_arg` of a vector smaller than an argument slot now
+  reads it from the start of the slot, where it is passed, matching GCC.
+  (#GH247461)
+
 #### RISC-V Support
 
 - Added CodeGen support for the ACLIC v0.20 `preemptible` and `push-pop`
@@ -1607,6 +1629,30 @@ documentation](CIR/index.md) for more information regarding ClangIR's status and
 
 - The handling of __int128 arguments with the LP64E ABI now matches gcc.
 
+#### SPARC Support
+
+- With `-msoft-float`, Clang now defines `_SOFT_FLOAT` instead of
+  `SOFT_FLOAT`, matching GCC.
+
+- On 32-bit SPARC, 64-bit atomics are now lock-free for V9 CPUs in V8+ mode,
+  matching GCC. Plain V8 CPUs without the CASA instruction no longer report
+  any atomics as lock-free, so atomic operations on them become library calls.
+  The LEON and Myriad 2 CPUs with CASA keep lock-free atomics up to 32 bits.
+  `__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8` is now only defined in V8+ mode, and the
+  1, 2 and 4 byte variants are now also defined for the LEON and Myriad 2 CPUs
+  with CASA. (#GH81711)
+
+- Clang now takes the list of SPARC CPUs and their default features from the
+  backend. This adds the `generic`, `v7`, `myriad2`, `myriad2.1`, `myriad2.2`
+  and `myriad2.3` CPUs. The Myriad 2 CPUs now define `__leon__`, and `v7` does
+  not define the V8 macros, matching GCC.
+
+- The `-A` flag passed to an external assembler is now picked from the CPU's
+  features, matching GCC. `ultrasparc` now gets `-Av9a` or `-Av8plusa`,
+  `ultrasparc3` gets `-Av9b` or `-Av8plusb`, `niagara4` gets `-Asparc4`, `v7`
+  gets `-Av7` and `myriad2` gets `-Aleon`. `-mvis*` and `-mv8plus` now also
+  change it.
+
 #### CUDA/HIP Language Changes
 
 - HIP compilations now add the `include/libhipcxx` directory from the selected
@@ -1689,6 +1735,11 @@ documentation](CIR/index.md) for more information regarding ClangIR's status and
   for a domain error (`math_errhandling & MATH_ERRNO` is zero, as with
   `-fno-math-errno`).
 
+- SPARC now supports constrained floating point. `-frounding-math` and
+  `-ffp-exception-behavior=strict` are honored instead of being overridden
+  with a warning, and floating-point operations are no longer constant folded
+  under them. (#GH225927)
+
 ### Fixed Point Support in Clang
 
 ### AST Matchers
diff --git a/lld/docs/ReleaseNotes.md b/lld/docs/ReleaseNotes.md
index e45870fac646e2..9d5deef9160346 100644
--- a/lld/docs/ReleaseNotes.md
+++ b/lld/docs/ReleaseNotes.md
@@ -32,6 +32,10 @@ from the [LLVM releases web site](https://llvm.org/releases/).
 * Added `--pass-plugin-arg=<plugin>,<arg>`, which passes `<arg>` to the pass plugin named `<plugin>`.
 * `--mmap-output-file` and `--no-mmap-output-file` were swapped in LLVM 21 and 22.
   They now mean what they say again; the default behavior is unchanged.
+* SPARC: calls using `R_SPARC_WDISP30` now go through the PLT like
+  `R_SPARC_WPLT30`, so non-PIC calls to functions in shared objects and
+  `-shared` links work. `-z rel` and `--check-dynamic-relocations` no longer
+  fail on SPARC dynamic relocations with an implicit addend.
 
 ### Breaking changes
 
diff --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md
index 16677e4fee4ca3..f58e041926cec7 100644
--- a/llvm/docs/ReleaseNotes.md
+++ b/llvm/docs/ReleaseNotes.md
@@ -418,6 +418,37 @@ Makes programs 10x faster by doing Special New Thing.
 
 ### Changes to the MIPS Backend
 
+* Many fixes for MIPS I and other CPUs before MIPS32, covering f64 loads,
+  stores and spills, FP to integer conversions, `sqrt`, use of odd FPRs for
+  single precision, and the load delay slot, FPU delay slot and HI/LO hazards.
+  The assembler also accepts more of the GNU as instruction forms and macros
+  for these CPUs, and the `.l` rounding instructions now require MIPS III or
+  MIPS32r2.
+* In `.set reorder` mode, the integrated assembler now inserts the nops that
+  load delay slots, coprocessor moves, FP compares and HI/LO hazards need
+  before MIPS32, as GNU as does. This also applies to inline assembly.
+* O32 now defaults to 32-bit FPRs before MIPS32r2, as GCC does. With
+  `-mcpu=mips3`, `mips4` or `mips64`, O32 code previously used 64-bit FPRs.
+* Inline `memcpy` and `memset` now use 64-bit loads and stores on MIPS III
+  and MIPS IV with N32 and N64.
+* Improved support for constrained floating point, including compares,
+  conversions, and arithmetic on microMIPS, MIPS16 and R5900.
+  `llvm.get.rounding` and `llvm.set.rounding` are now supported. Constrained
+  operations without a matching instruction are no longer turned into
+  non-strict ones.
+* FP compares on MIPS R6 now produce 0/1 booleans like integer compares,
+  fixing wrong results from inverted compares.
+* `-mips-compact-branches=never` (Clang's `-mcompact-branches=never`) is now
+  honored for calls on R6.
+* In PIC code, the integrated assembler now uses the local GOT sequence for
+  `la` and `jal` of a local symbol defined later in the file, as GNU as does.
+* Fixed miscompiles and crashes in atomic min/max before MIPS IV, double-word
+  shifts, O32 f32 stack arguments, MSA constant splats on big-endian, inline
+  asm operands bound to `$0`-`$31`, `fneg` in legacy abs mode, branch
+  expansion, microMIPS tail call delay slots, `llvm.is.fpclass` on microMIPS
+  R6, the `%a` inline asm modifier on a register, MSA selects with a constant
+  arm, and the `li.d` constant after a `li.s`.
+
 ### Changes to the PowerPC Backend
 
 ### Changes to the RISC-V Backend
@@ -448,6 +479,35 @@ Makes programs 10x faster by doing Special New Thing.
   processor, with a scheduling model.
 * The behavior of i128 arguments with the LP64E ABI now matches gcc.
 
+### Changes to the SPARC Backend
+
+* Added support for constrained floating point, with FSR use and FP
+  exceptions modeled on FP instructions.
+* Added 64-bit atomics for 32-bit V9 code in V8+ mode, matching GCC.
+* On V8, there are now three instructions between a write to `%y` and the
+  next instruction that reads it, as GCC does.
+* Inline asm operands and clobbers of `%f32`-`%f62` now work. They are
+  rejected on V8.
+* PIC code now uses GOTDATA_OP relocations for address loads, as GCC does.
+  This fixes glibc's `ld.so` built with Clang on Linux sparc64.
+* The DWARF location of thread-local variables now uses a DTP-relative
+  offset, so gdb can read them.
+* Fixed miscompiles in 32-bit returns of values demoted to sret (such as
+  fp128), underaligned i64 loads and stores, leaf procedure CFI and live-ins,
+  unsigned to FP conversions of 0 when rounding down, and strict fp128
+  compares.
+* The assembler now emits relocations for symbolic immediates instead of
+  crashing. Register names are now case-sensitive like GNU as, out-of-range
+  `%rN` names are rejected, and bad register names get clearer errors. On V8,
+  the V9-only register names and the `%fcc` forms of the FP compares are now
+  rejected, as GNU as does. Added the `%r_disp8`, `%r_disp16`, `%r_disp64`,
+  `%r_plt32`, `%r_plt64`, `%h34` and `%l34` relocation specifiers.
+  `.register` now emits `STT_REGISTER` symbols, as GNU as does. Trap
+  numbers are now printed in full, and the immediates of `movr` and `movcc`
+  are now disassembled as signed.
+* The CPU and feature tables are now generated from TableGen into a SPARC
+  TargetParser, which Clang also uses.
+
 ### Changes to the WebAssembly Backend
 
 * Added support for emitting common symbols (.comm) using the WASM_SYMBOL_BINDING_COMMON
@@ -638,6 +698,14 @@ Makes programs 10x faster by doing Special New Thing.
   memory-backed files rather than shm_open. This means subprocess mode now
   requires Linux 3.17 or newer.
 
+* `llvm-objdump` now infers V9 and VIS features from the SPARC ELF header, so
+  it can disassemble those instructions in 32-bit objects without `--mcpu` or
+  `--mattr`. It likewise infers the R5900 feature from the MIPS ELF header, and
+  no longer aborts on MIPS objects with `e_flags` values it does not know.
+
+* `llvm-readobj` and `llvm-readelf` now print the SPARC `STT_REGISTER` symbol
+  type and name the `R_SPARC_JMP_IREL` relocation.
+
 ### Changes to LLDB
 
 * `platform.plugin.wasm.runtime-args` now precede the port argument on the Wasm

``````````

</details>


https://github.com/llvm/llvm-project/pull/246931


More information about the cfe-commits mailing list