https://github.com/brad0 created https://github.com/llvm/llvm-project/pull/246931
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. >From f6e114728ba2669b962b6c623750cef373675083 Mon Sep 17 00:00:00 2001 From: Brad Smith <[email protected]> Date: Sun, 29 Nov 2026 00:24:05 -0500 Subject: [PATCH] [clang][llvm] Add SPARC and MIPS release notes 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. Co-Authored-By: Claude Opus 5.5 <[email protected]> --- clang/docs/ReleaseNotes.md | 35 +++++++++++++++++++++++++++++++ llvm/docs/ReleaseNotes.md | 43 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/clang/docs/ReleaseNotes.md b/clang/docs/ReleaseNotes.md index 6bbc910d86b5aa..d68036691a30a1 100644 --- a/clang/docs/ReleaseNotes.md +++ b/clang/docs/ReleaseNotes.md @@ -468,6 +468,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 @@ -1548,6 +1553,13 @@ 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. + #### RISC-V Support - Added CodeGen support for the ACLIC v0.20 `preemptible` and `push-pop` @@ -1568,6 +1580,24 @@ 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. + #### CUDA/HIP Language Changes - HIP compilations now add the `include/libhipcxx` directory from the selected @@ -1650,6 +1680,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/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md index 573029314a7d8b..bb290f0d41d7b3 100644 --- a/llvm/docs/ReleaseNotes.md +++ b/llvm/docs/ReleaseNotes.md @@ -418,6 +418,25 @@ 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. +* 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. +* 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, and branch + expansion. + ### Changes to the PowerPC Backend ### Changes to the RISC-V Backend @@ -448,6 +467,26 @@ 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. +* 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. Trap + numbers are now printed in full. +* 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 @@ -616,6 +655,10 @@ Makes programs 10x faster by doing Special New Thing. section. Previously, other data merged into `.pdata` was decoded as unwind entries, which could cause a fatal error. +* `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`. + ### Changes to LLDB * `platform.plugin.wasm.runtime-args` now precede the port argument on the Wasm _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
