jr.sh now asserts the recorded M3 baseline (882-byte .text, 14 JR branches,
2 zero-displacement absolute branches), checks that every JR is one word and
in range, and probes symbolic JRUC with disp 0, disp -128 (widen) and disp
-127 (stay short) through the MC relaxation path.
dis-roundtrip.sh pins the condition code per function again (_sumto LT and
EQ, _max2 GT, _lt LT) instead of the broken ${op#j[ra]} strip, keeping the
global at-least-one-JR check.
native-link.c's far conditional branch now spans ~279 words instead of ~151,
so a small codegen shrink cannot turn it back into a JR.
Add scripts/tests/m5/jr.sh: the M3 branch.c loop must use JR forms, llc's
asm and object .text must match, a symbolic out-of-range JRUC must relax to
JAUC, the M3 MAME markers must be unchanged, and the linked .text size must
show the saving against the all-JA baseline.
Update the M3 dis34 gate and the native-link gate for the new encoding: the
compiled branches are relative, so accept JR/JA condition codes and keep a
far conditional JA<cc> relocation in native-link.c.
Build the pinned termtris branch (be5b323) with this compiler, assemble
and link it with the TI 1987 GSPA/GSPLNK and RTS.LIB, and run the proven
play_keys board/move/panels/quit paths in MAME with the M4 loader. Add
the contiguous-stack varargs MAME probe and the switch-to-lookup driver
regression check. The termtris build found the i8/i16 argument, i1/
anyext load, nested-data, MULHS and late-GEP gaps fixed in the compiler.
Add the fnptr C callback test (direct symbol, volatile local pointer and
global pointer), its GSPA entry and marker script, and scripts/tests/m4/
fnptr.sh. The gate compiles at the default -O2 pipeline, requires all four
markers to be 42 in MAME, and checks the linked assembly: _apply calls through
an A register (CALL, never CALLA) after the argument push, while _fnptr_test
keeps the direct CALLA and materialises inc with MOVI. It also pins the GSPA
0x0920 encoding and requires dis34 to decode the call as 'call aN'.
The full-width marker called the signed mul helper with a constant whose
product overflows int, which is UB and made the assertion rely on wrap-around.
Add mulu(unsigned, unsigned) for marker 10; the low-32 product and MPYS
selection are unchanged. Check the optimized IR has no nsw on mulu.
Add runtime markers for a full-width 32x32 multiply (0x12345678 * 0x9abcdef0
= 0x242d2080) and for a wide-dividend remainder, so a 16-bit-truncated MPYS or
a wrong FS1 cannot still produce the expected small results. Compute the 16x16
unsigned product in unsigned arithmetic to remove the signed-overflow
annotation, and reject a regressed nuw nsw multiply in the optimized IR.
Add a runtime marker test for 32x32 multiply, the 16x16 MPYU path, signed and
unsigned divide/remainder, and for sumto/squares compiled through the ordinary
tms-clang -O2 driver. The linked assembly is also checked for MPYS/MPYU/
DIVS/DIVU and for a surviving sumto loop.
Scripts/tms-clang runs the generic opt pipeline without a target machine, so
the target cannot veto IndVarSimplify's exit-value replacement through TTI.
That rewrite turns sumto's closed form into an i33 multiply, which llc cannot
select. Disable only that rewrite with -replexitval=never and document why.
Preserve the dis34 output on a failed round-trip instead of claiming a
deleted temp file is kept, require GSPA "No Warnings" in addition to
"No Errors", and correct the six-function and M1 pipeline comments.