model-writtenrun 9346 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- YunQiang Su reported that unconditional .set mips2 selects obsolete LL/SC encodings on MIPS r6 and supplied an inline patch that suppresses the directive on r6, while suggesting outright removal as another possibility #1.
- Tom Lane questioned compiler portability and whether runtime detection was necessary; Su explained that r6 has a separate operating-system port and that GCC and LLVM provide the proposed architecture macro #4 #6.
- Lane explored removing .set mips2, but found that older toolchains still needed it; Su corrected the Debian assumptions, while Lane confirmed that NetBSD's compiler defaulted to MIPS-I and accepted the instructions with -march=mips2 #5 #8 #9 #10.
- Su argued that architecture selection belongs to users and distributions, and Lane proposed probing LL/SC/SYNC support before adding -march=mips2; Lane attached that implementation and reported a successful NetBSD/gxemul build #11 #12 #13.
- Andres Freund proposed replacing uncommon-platform spinlock assembly with compiler intrinsics, but Lane opposed relying on older compilers' implementations and pointed to existing MIPS buildfarm coverage #14 #15.
- After Su questioned emitting MIPS-II instructions for a MIPS-I target, Lane examined GCC's intrinsic output and found the same .set mips2 strategy, explaining that kernel emulation could handle those instructions on actual MIPS-I hardware #16 #17.
- Lane abandoned the configure-wide architecture override because it exceeded PostgreSQL's authority over the platform target, and posted a reworked version of Su's original conditional-assembly solution with explanatory comments #18.
- Su identified that the new condition must use __mips rather than __mips_isa_rev, explaining their different values across architecture generations; Lane accepted the correction in the thread's final message #19 #20.
- Lane subsequently committed 1323bfce55 from #18 with the corrected architecture guard and corresponding comment, crediting Su and backpatching the fix to all supported branches.