Re: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: YunQiang Su <wzssyqa(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
Date: 2019-06-22 22:37:07
Message-ID: 27494.1561243027@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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.

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
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

Attachment Content-Type Size
avoid-asm-set-mips2-2.patch text/x-diff 1.7 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message YunQiang Su 2019-06-22 22:59:44 Re: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
Previous Message Tom Lane 2019-06-22 19:05:32 Re: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build