[RFC PATCH 0/3] MIPS: Allegrex VFPU and PSP target support (trunk)
Yaroslav Solodovnyk
dublikunt@gmail.com
Fri Nov 6 07:09:57 GMT 2026
Hello,
This RFC adds Allegrex VFPU assembler/disassembler support and PSP linker
support, together with regression checks for the load-immediate macros.
It is rebased onto current Binutils trunk as fetched on 2026-11-05:
2364e17098e63e0af17c5329dec1ca8cd82c6cbb
ld: Couple of fixes for Win32 section of linker manual
Upstream already recognizes scalar Allegrex. The VFPU instruction parsing,
encoding, disassembly and PSP linker implementation are ported from the
pspdev/binutils-gdb downstream tree:
a8b53fe2b5825fa86337623c743d21a19aeb0daf (allegrex-v2.44)
The port preserves imported copyright/license notices, adapts the current
operand initialization and bool API, and retains upstream's Allegrex ELF
machine flag 0x00840000 and Loongson GS464 support. It does not carry the
older PSP fork's reassignment of the GS464 value.
During validation I also fixed the downstream lvi/lvhi macros: inconsistent
macro IDs and missing operand handling could abort GAS. The new expansion
handles all six forms and valid row/column lane offsets. Decimal lvi
operands represent binary32 values; explicit hexadecimal operands are raw
32-bit patterns. lvhi packs binary16 pairs, low half first. Half immediates
now use GAS's IEEE binary16 parser, and half-subnormal disassembly is fixed.
The config.sub PSP canonicalization change is supplied separately to
config-patches@gnu.org, in accordance with binutils/MAINTAINERS. That change
is needed when configuring this port with the short --target=psp alias.
It maps that alias to mipsallegrexel-psp-elf. The Binutils patches here do
not modify config.sub.
A further regression check found that the imported VFPU prefix instruction
masks accepted reserved bits. The third patch restricts source prefixes to
20 immediate bits and destination prefixes to 12, so encodings such as
0xdc820000 are no longer misidentified as vpfxs. This restores the existing
Allegrex ISA-override GAS test and adds reserved-encoding checks.
The regression checks can be run against installed tools with Python 3.9+:
python3 contrib/allegrex-vfpu/check-pseudo.py \
--tool-prefix /path/to/install/bin/psp-
This is a first RFC on the complete downstream port, rather than an
isolated lvi/lvhi fix: those pseudoinstructions are not present in upstream
without the VFPU implementation. The exported emails were also applied with git am to a pristine
checkout of the trunk base above and the resulting tree matched this
branch exactly. The complete GAS/LD regression suites have not been run.
The imported implementation still needs GNU-style cleanup, and the
standalone checks should be integrated into the GAS DejaGNU testsuite.
Feedback on splitting the assembler/disassembler and PSP linker portions
into smaller upstream changes would be welcome.
Physical validation was then performed on physical PSP through using this
trunk Binutils build and project GCC 17 revision cf560a0c1f35f1a3fe45a676907a6e11dcd70ab5.
This exercise also found separate SDK/pthread/GCC mutex-lifetime issues.
The native harness uses those runtime cleanup fixes; their patches and
exact manifests are included with the validation artifacts, not in this
Binutils series.
Physical vfim.s flushes binary16 subnormal immediates to signed zero.
The hardware check distinguishes that behavior from raw lvhi lane bits
and GAS's binary16 encoding. The latter preserve subnormal bit patterns.
The native tests cover 30 lvi/lvhi lane patterns and eight vfim values.
Thank you,
Yaroslav Solodovnyk
Yaroslav Solodovnyk (3):
MIPS: Add Allegrex VFPU assembler and disassembler support and PSP
linking
contrib: Add Allegrex VFPU immediate macro regression checks
MIPS: Reject reserved VFPU prefix instruction bits when disassembling
base-commit: 2364e17098e63e0af17c5329dec1ca8cd82c6cbb
prerequisite-patch-id: fb6941b39d920ee9f419fbee78d0024e020344aa
--
2.56.0
More information about the Binutils
mailing list