Re: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
YunQiang Su <wzssyqa@gmail.com>
From: YunQiang Su <wzssyqa@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>, pgsql-bugs@lists.postgresql.org
Date: 2019-06-22T22:59:44Z
Lists: pgsql-bugs
Tom Lane <tgl@sss.pgh.pa.us> 于2019年6月23日周日 上午6:37写道: > > I wrote: > > So the gcc guys aren't any more wedded than we are to the rule that > > one must not generate LL/SC on MIPS-I. They're probably assuming the > > same thing we are, which is that if you're actually doing this on > > MIPS-I then you'll get an instruction trap and the kernel will > > emulate it for you. > > Actually, after further contemplating that argument (which I was reminded > of by excavating in our commit log), I realize that having a .set mips2 > in the ASM is actually the right way to do this, because that only results > in LL/SC getting emulated when we need them to be. Forcing -march=mips2 > across the entire Postgres build would exceed our authority really --- > yeah, it might produce better code quality, but it's not our business to > override platform-level target architecture decisions. you are correct, that we should follow the target architecture decisions of OS vendor, if possible. > > So I now think your original proposal was about the best way to do this, > though I'd tweak it to make the test be "#if __mips_isa_rev < 2", as here we should use #if __mips < 2 instead of __mips_isa_rev . The history of MIPS revisions: MIPS I : __mips=1 __mips_isa_rev = undef MIPS II : __mips=2 __mips_isa_rev = undef MIPS III : __mips=3 __mips_isa_rev = undef MIPS IV : __mips=4 __mips_isa_rev = undef MIPS 32/64(r1) : __mips=32/64 __mips_isa_rev = 1 MIPS 32/64 r2 : __mips=32/64 __mips_isa_rev = 2 MIPS 32/64 r3 : __mips=32/64 __mips_isa_rev = 3 MIPS 32/64 r5 : __mips=32/64 __mips_isa_rev = 5 MIPS 32/64 r6 : __mips=32/64 __mips_isa_rev = 6 > attached. It doesn't seem like forcing the ISA level down is ever > something we want to do, even if we know there's no practical difference. > > regards, tom lane > -- YunQiang Su
Commits
-
Fix spinlock assembly code for MIPS so it works on MIPS r6.
- 9895e3a36a72 9.6.15 landed
- 40dde829070d 11.5 landed
- 36d2c3ad33f8 9.5.19 landed
- 2854e2ab6806 9.4.24 landed
- 1323bfce5510 12.0 landed
- 05399b14889e 10.10 landed