Vladimir SerbinenkoandCodex 9863d6937a Implement and use generic mips libco (#155)
* libco mips

* Add VFP saving and restore

* libco/mips: Optimize storage for 32-bit CPUs

* Clarify license status

* Increase sp alignment to 16 bytes for safety

* libco/mips: preserve registers according to the target ISA and ABI

Distinguish MIPS32 from 64-bit GPR ISAs, and sign-extend 32-bit ABI pointers when initializing 64-bit context slots. Save full double-precision FP state, including the n64 odd callee-saved registers, and omit FP instructions for soft-float builds. Reserve aligned, non-overlapping FP and VFPU areas.

* libco/mips: initialize t9 when entering a coroutine

PIC entry functions use t9 to establish their global pointer. Set it to the restored entry address before jumping, and keep the handwritten context-switch assembly in its own text section with explicit delay-slot scheduling.

* libco/mips: reject overflowing stack allocations

Reject sizes that overflow when context overhead and alignment are added. Also check the documented nonzero error return from posix_memalign.

* libco/mips: add coroutine and floating-point regression coverage

---------

Co-authored-by: Codex <[email protected]>
2026-10-11 13:29:21 +02:00
2026-10-10 21:23:55 +02:00
2026-10-10 21:23:55 +02:00
2026-09-17 20:14:05 +02:00
2014-10-25 06:53:28 +02:00
2026-10-03 01:11:06 +02:00
2026-09-04 05:13:35 +02:00
2026-10-10 21:23:55 +02:00
2026-09-17 20:14:05 +02:00
2026-09-19 10:45:34 +02:00
2026-10-10 21:23:55 +02:00
2026-10-10 21:23:55 +02:00
2026-10-11 12:49:10 +02:00
2026-09-27 17:30:48 +02:00
2026-08-10 15:15:24 +02:00
2026-10-10 21:23:55 +02:00
2026-10-11 12:49:10 +02:00
2026-10-10 21:23:55 +02:00
2026-10-10 21:23:55 +02:00
2026-10-10 21:23:55 +02:00
2026-10-10 21:23:55 +02:00
2026-10-10 21:23:55 +02:00
2026-10-10 21:23:55 +02:00
2026-09-21 18:59:01 +02:00
2026-10-11 12:49:10 +02:00
2026-10-06 03:38:08 +02:00
2026-10-10 21:23:55 +02:00
2026-10-03 01:11:06 +02:00
2026-10-03 01:11:06 +02:00
2026-10-03 01:11:06 +02:00
2026-09-21 18:59:01 +02:00
2026-08-23 04:13:03 +02:00
2026-10-10 21:23:55 +02:00
2025-11-17 21:28:40 +01:00
2026-08-10 20:15:14 +02:00
2026-10-05 16:56:14 +02:00
S
Description
Reusable coding blocks useful for libretro core and frontend development, written primarily in C. Permissively licensed.
20 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 95.2%
C++ 3.8%
Python 0.4%
SourcePawn 0.3%
Objective-C 0.1%
Other 0.1%