libc: the Cyberpunk placeholders libcCyberUnknown02/08 are abs and __powidf2; fix branch ready #3161
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-10T23:39:04Z.
In libc (Export.cpp) two Cyberpunk 2077 (PPSA04029) imports are still placeholder stubs:
libcCyberUnknown02(NIDYe20uNnlglA) andlibcCyberUnknown08(NIDH+8UBOwfScI).tools/nid_names.pycomputes those NIDs fromabsand__powidf2, and its database reports both asrename-ready; the imports are listed in #266 and #2010. No run has stopped on them yet.Fix branch ready:
screamm:feat/libc-abs-powidf2(28422739, one commit onmaind2f43cb8). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is. Earlier attempts (#1097, #2158, #2316, #2465, #2604) were closed by intake or for lack of a title; this one is a rewrite on currentmain.abs_nid_postfixand__powidf2_nid_postfixthe way #2301 renamed their siblings, and implemented insrc/Math.cpp:abs(int)negates throughunsignedsoabs(INT_MIN)returnsINT_MINas FreeBSD'sabs.cdoes (ISO C leaves it undefined);__powidf2(double, int)is a line-for-line port of LLVM compiler-rtpowidf2.c(square-and-multiply, reciprocal for a negative exponent), at llvm-project0ee439b7, byte-identical on current main.INT_MINchoice, the zero result wherepowwould give a subnormal, and that compiler-rt is assumed because the SDK compiler is Clang; none of it is checked against the console's libc.guest_mathgainsabsover negative, zero, positive andINT_MIN;__powidf2with positive, zero and negative exponents (including 0, -0, inf and NaN bases,INT_MIN/INT_MAX), the pinned rounding of 1.1^4, 1.1^5 and 1.1^-4, a sweep of exponents -40 to 40 for four bases againststd::powwithin 64 ulp, and reciprocal underflow to 0. Swapping the implementation forstd::powmakes the test fail.Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build includinglibs:guest_math3/3;ctest -j8 -E "^agc_driver_|^video_out_flip"475/475; withmain'sMath.cppthe extended test fails;tools/check_conventions.py --base mainandgit diff --checkpass. Not run on Linux. The branch touchesExport.cpplines next to the ones #3079 edited, so it may need a trivial rebase.Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
Imported from boykopovar/AnyPS5. Originally posted by danzaio on 2026-10-11T01:58:48Z.
Windows validation for this branch, which lists no Windows run.
Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Ninja, Release, BUILD_TESTING=ON, branch 28422739: guest_math passes 1/1, covering the abs and __powidf2 cases.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T09:52:57Z.
Independent verification on Linux (the gap noted in the report): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON.28422739onto currentmain(the branch was 638 commits behind; the report anticipated a trivial rebase next to #3079's edits):Export.cppno longer needed the branch's stale_Mtx_*/_Cnd_*stub block (main implements the family for real now),GuestMath.cppneeded main's newer rounding declarations and checks kept alongside this branch'sCheckAbsoluteValue/CheckIntegerPower, and oneTechnicalDebt.mdentry was unioned.tools/check_conventions.py --base origin/mainandgit diff --checkpass.guest_mathpasses (including the pinned1.1^4/1.1^5/1.1^-4rounding and the ±40 exponent sweep).ctest -j8 -E "^agc_driver_|^video_out_flip"): 520/520 passed.The rebased branch is available at
blawesom:verify/3161for anyone carrying — the commit is otherwise unchanged.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T20:14:18Z.
Both placeholders are implemented on
mainnow (checked ata0f5916a2), so this can be closed:abs(Ye20uNnlglA): #3314__powidf2(H+8UBOwfScI): #5174Both are in
core/libs/prx/libc/src/Math.cpp.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T00:09:09Z.
Closing: both are on main,
absfrom #3314 and__powidf2from #5174 (libc/src/Math.cpp). If a title still stops on either, comment here with the title ID and the log line.